【Rust日报】2022-04-02 Wasm Web 框架 Spin 发布​

2022年4月3日 272点热度 0人点赞 0条评论

Wasm Web 框架 Spin 发布

我们很高兴宣布我们新的WebAssembly框架Spin。Spin是Fermyon平台的基础部件。这也是开始为云编写WebAssembly的好方法。
什么是wasm框架?
我们认为WebasseMbly主要作为编译目标。选择语言,编写代码,并将其编译为WASM。但是在webassembly中写的是什么类型的代码?
运行webassembly模块的原始方法是在浏览器中。因此,早期的WebAssageMbly努力集中在优化在网页或客户端Web应用上执行的性能密集型代码。
。。。
Github 链接,https://github.com/fermyon/spin
文章链接,https://www.fermyon.com/blog/introducing-spin

Fermyon WebAssembly Language Guide

本文档跟踪各种语言对编译成WebAssembly的支持。它被组织成三个部分:前20种语言,WebAssembly特定语言和其他值得注意的语言。我们跟踪语言是否可以编译在浏览器中运行,在其他非浏览器环境中以及在WASI环境中运行。在每种语言的详细信息页面中,我们不仅会尽最大努力说明当前的支持级别,同时也附加了一系列有用的资源。
Github 链接,https://github.com/fermyon/wasm-languages
文章链接,https://www.fermyon.com/wasm-languages/webassembly-language-support

发布我的第一个 crate - 一个用于数学表达式的可扩展编译引擎

这是我第一次公开发布crate:欢迎意见和建议
lavendeux解析器是一个可扩展的数学表达式解析引擎。它支持变量和函数分配、各种数据类型,并且可以通过javascript编写的扩展在运行时轻松扩展。
扩展在没有主机或网络访问的沙箱环境中运行。
下面是一个使用示例
use lavendeux_parser::{ParserState, ParserError, Token, Value};

fn main() -> Result<(), ParserError> {
let mut state : ParserState = ParserState::new();
let lines = Token::new("x=9\nsqrt(x) @bin", &mut state)?;

// String representation of the full result
assert_eq!(lines.text(), "9\n0b11");

// String representation of the first line's result
assert_eq!(lines.child(0).unwrap().text(), "9");

// Actual value of the first line's result
// Values are integers, floats, booleans or strings
let value = lines.child(0).unwrap().value();
assert_eq!(value.as_int().unwrap(), 9);
assert_eq!(true, matches!(value, Value::Integer(_)));

Ok(())
}
Github 链接,https://github.com/rscarson/lavendeux-parser
文章链接,https://www.reddit.com/r/rust/comments/ttrbwj/released_my_first_crate_an_extensible_parsing/

From 日报小组 TOM

社区学习交流平台订阅:
  • Rustcc论坛: 支持rss
  • 微信公众号:Rust语言中文社区

41130【Rust日报】2022-04-02 Wasm Web 框架 Spin 发布​

这个人很懒,什么都没留下

文章评论