So it's probably a rust wrapper around a C++ project (unless they reimplement V8 in rust... )
> cargo install --locked deno
Compiling rusty_v8 v0.22.2
error[E0308]: mismatched types
--> /home/craig/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.22.2/build.rs:157:18
|
157 | fn platform() -> &'static str {
| -------- ^^^^^^^^^^^^ expected `&str`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
error: could not compile `rusty_v8`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `deno v1.10.1`, intermediate artifacts can be found at `/tmp/cargo-installwrTFWi`
Caused by:
build failedIf you care about FreeBSD support, I bet the community would be delighted to receive some pull requests patching the problem.
> git clone https://github.com/denoland/deno.git denoland/deno
> git clone https://github.com/denoland/rusty_v8.git denoland/rusty_v8
> cd denoland/deno
> vi Cargo.toml
...
[patch.crates-io]
rusty_v8 = { path = "../rusty_v8" }
...
> cargo build --release
... as expected same failure - good ...
Make rusty_v8 build.rs aware of freebsd > vi ../rusty_v8/build.rs
...
#[cfg(target_os = "freebsd")]
{
"freebsd"
}
...
Have a quick squizz to see where this is used: > rg "platform\(\)" ../rusty_v8
build.rs
157:fn platform() -> &'static str {
180: .join(platform());
Attempt to fix... and bang! It's using the platform() result to call a python script that pulls binaries from here:https://github.com/denoland/ninja_gn_binaries/
And there's no FreeBSD build there. To much yak shaving for idle curiosity on my part.
Guessing it is inspired by v8/chrome build system? Maybe have a look at nodejs for freeBSD for inspiration? Or just provide ninja/gn some other way.
Little sad to see a build process import binaries from the net either way...
Like Wasmtime? https://github.com/bytecodealliance/wasmtime
Like you say, it would take a long time for a Rust JS engine to reach parity with V8. But long-running projects need real use-cases to succeed... they drive support and provide direction/feedback. How much will a half-baked Rust JS engine be adopted when a mature, stable V8 or SM is available? Will the projects that do so be successful themselves? A pure Rust JS engine might be destined to peter-out well before becoming viable.
A better approach (though less satisfying) might be to convert an existing engine incrementally. But even there, there probably needs to be continuous, compelling benefits along the way to justify the increased complexity and large amount of additional work. Imagine release after release where the main item in the release notes is "rewrote another subsystem in Rust"... followed by a bunch of bugs in the previously stable subsystem. I know SM has some Rust bits, but I'm not sure how far that is really going to go.