< 返回版块

长琴 发表于 2024-03-25 19:35

Tags:rust,日报,wasmenv,crows,lancelot,rq

[new library] wasmenv

wasmenv 是一个基于 Rust 的 wasm 运行时版本管理器。目前 wasmtime 仅支持 wasmer。此项目允许我们轻松地在不同版本的 wasmer 之间切换、管理安装和配置 shell 环境。

$ wasmenv --help

Usage: wasmenv <COMMAND>

Commands:
  current  Display the currently active version of wasmer
  shell    Configure wasmenv for a specific shell (bash, zsh, fish)
  use      Install wasmer
  list     List all the available versions of wasmer
  exec     Run command with wasmer
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

GitHub: https://github.com/ayys/wasmenv

[new library] crows

Crows 是一个分布式负载和压力测试运行程序。测试可以用任何可以编译为 WASM 的语言编写,前提是库的绑定可用。目前,绑定仅适用于 Rust,但是一旦 ABI 稳定下来,添加更多语言应该相对简单。一个用 Rust 编写的示例场景看起来像这样:

#[config]
fn config() -> ExecutorConfig {
    let config = ConstantArrivalRateConfig {
        duration: Duration::from_secs(5),
        rate: 10,
        allocated_vus: 10,
        ..Default::default()
    };
    ExecutorConfig::ConstantArrivalRate(config)
}

#[export_name = "scenario"]
pub fn scenario() {
    http_request(
        "https://google.com".into(), GET, HashMap::new(), "".into(),
    );
}

它将每秒向 google.com 发送 10 个请求。

文章: https://itsallaboutthebit.com/crows/

GitHub: https://github.com/drogus/crows

[new library] lancelot

重建控制流程的 Intel x86(-64)代码分析库。

文章: https://www.williballenthin.com/post/rust-compilation-time/

GitHub: https://github.com/williballenthin/lancelot

[new version] rq 0.1.0

rq 是一种微小的函数式语言,可以使用它来操作 JSON。基本上,它是用 Rust 编写的 jq(一个微不足道的子集)。这也是它的第一个release版本。

使用示例:

$ cat test.json
[{"name": "John Doe", "age": 43, "phones": ["+44 1234567", "+44 2345678"]}]

$ cat test.json | rq '\x -> x.0.phones.1'
+44 2345678

GitHub: https://github.com/slotThe/rq


From 日报小组 长琴

社区学习交流平台订阅:

评论区

写评论

还没有评论

1 共 0 条评论, 1 页