5 ms·
I didn’t know what deno was. It’s a typescript native alternative to nodejs that adopts the browser security model, replicates the golang standard library rath
by CraigJPerry 5y ago
I didn’t know what deno was.
It’s a typescript native alternative to nodejs that adopts the browser security model, replicates the golang standard library rather than node’s and is written in Rust.
- adamsvystun 5y agoNot only adopts the browser security model, but more broadly adopts browser APIs.
- otabdeveloper4 5y agoV8 is written in C++, not Rust.
- thegeekpirate 5y agoThey're talking about deno, which _is_ written in Rust. https://github.com/denoland/deno https://github.com/denoland/deno
- Manozco 5y agoDeno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust. So it's probably a rust wrapper around a C++ project (unless they reimplement V8 in rust... )
- CraigJPerry 5y agoSure, although the rust v8 bindings don’t appear to support FreeBSD as i just found out when i tried to install deno on FreeBSD 13: > 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 failed
- josephg 5y agoThat looks like a pretty simple problem. Deno probably doesn’t work on FreeBSD simply because nobody has done the work of making it compatible yet. Rust, V8 and nodejs all run great on FreeBSD. If you care about FreeBSD support, I bet the community would be delighted to receive some pull requests patching the problem.
- CraigJPerry 5y agoI gave it a whirl: > 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/ https://github.com/denoland/ninja_gn_binaries/ And there's no FreeBSD build there. To much yak shaving for idle curiosity on my part.
- Cthulhu_ 5y agoI'm pretty confident we'll see a JS engine written in Rust at some point in the future, it'll just take a very long time to get parity with V8 and will likely introduce its own slew of issues.
- dajonker 5y agoParts of the Firefox JS engine (SpiderMonkey) are written in Rust (although nothing really significant I believe).
- e12e 5y agoI rather imagine we'll see a wasm vm/runtime in rust, and a typescript/js to wasm compiler written in typescript...
- nindalf 5y ago> I rather imagine we'll see a wasm vm/runtime in rust Like Wasmtime? https://github.com/bytecodealliance/wasmtime https://github.com/bytecodealliance/wasmtime
- e12e 5y agoYes, but we would also need an event loop I guess. As I understand it nodejs is essentially a (c++) js runtime inside a c++ event loop. But I think we already have a rust event loop (or two?)
- littlecranky67 5y agoI don't see any benefits (for me, the user) if its written in Rust. Yes, Rust has nice features for more security+stability for the developer, but just because a JS Engine would be written in Rust wouldn't mean its automatically better than V8. It's not the programming language that gives the edge in this case, it is the amount of time, sweat and grease that went into V8. And other engines would have a long way to come.
- jmull 5y agoI don't know about a JS engine written in Rust. Well, I'm sure it will be attempted (no doubt it's being done right now), but I don't see a path to success. 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.