Live data from Hacker News

Nova: A JavaScript and WebAssembly engine written in Rust

trynova.dev

51–60 of 70 posts

Re: Nova: A JavaScript and WebAssembly engine written in Rust

#51

Earlier quoted context omitted.

Did you consider other systems languages (such as Zig, etc) before settling on Rust? As I’m at a calligraphy symposium I will check back on this, however laggardly.

Not really, no. The main reason is that the origins of the Nova JavaScript engine as a project (without the ECS / data-oriented design focus, that came later) are in the Deno runtime's Discord where a friend joked "so when are we starting our own JS engine?" in response to someone jokingly complaining about Deno using V8 which is of course written in C++. So the project started as a "let's write a better JS engine th…

> sufficient abuse[1],

And `1` is?

Re: Nova: A JavaScript and WebAssembly engine written in Rust

#52

Earlier quoted context omitted.

Hmm, sorry, I'm not sure what you mean. The engine is written with a fair bit of feature flags to disable more complicated or annoying JS features if the embedder so wants: it is my aim that this would go quite deep and enable building a very slim, simple, and easily self-optimising JS engine through this. That could then perhaps truly serve as an easy and fast scripting engine for embedding use cases.

That answers half my question (eg disable networking), thank you. The other part was about the overhead of adding this to an app (startup memory usage and increase in binary size) and how much work has been done on interop so that you can execute a static rust function Foo() passing in a rust singleton Bar, or accessing properties or methods on a rust singleton Baz, i.e. calling whitelisted rust code from within the…

So for executing static Rust functions we do have "full" support via the `Value::BuiltinFunction` type. We have an internal "BuiltinFunctionBuilder" type for creating these conveniently (mostly) at compile time, and we have some external helper functions for creating them at runtime.

As for calling methods on a Rust singleton / struct, that is not yet really supported. We do have a `Value::EmbedderObject` type that will be the place for these, but its implementation is so far entirely empty / todo!() only. The first step for those will be just a very plain and simple `Box` type of thing, but eventually I'm thinking that our EmbedderObjects would actually become backed by an ECS data storage in the engine heap. So eg. your Bar type would be registered to the engine via some call together with its fields, and those would form an ECS "archetype". Then these items would be created by another call and would then become visible to JS code as objects, with some of their fields possibly being pointers to foreign heap data etc.

But that's a little ways off.

Re: Nova: A JavaScript and WebAssembly engine written in Rust

#53
post #33

Earlier quoted context omitted.

Hmm, sorry, I'm not sure what you mean. The engine is written with a fair bit of feature flags to disable more complicated or annoying JS features if the embedder so wants: it is my aim that this would go quite deep and enable building a very slim, simple, and easily self-optimising JS engine through this. That could then perhaps truly serve as an easy and fast scripting engine for embedding use cases.

> written with a fair bit of feature flags I see you use Cargo feature for this. One thing to be aware of is Cargo's feature unification ( https://doc.rust-lang.org/cargo/reference/features.html#feat... ), ie. if an application embeds crate A that depends on nova_vm with all features and crate B that depends on nova_vm without any security-sensitive features like shared-array-buffer (eg. because it runs highly untrus…

Thank you for pointing this out, I'll have to look into this at some point.

There is currently no other way to disable features, and at least for the foreseeable future I don't plan on adding runtime flags for these things. I'm hoping to use the feature flags for optimisations (eg. no need to check for holes, getters, prototype chain in Array indexed operations if those are turned off) and I'm a bit leery of making those kinds of optimisations if the feature flags are runtime-controllable. It sounds like a possible safety hole.

For now I'll probably have to just warn (potential) users about this.

Re: Nova: A JavaScript and WebAssembly engine written in Rust

#54

How does Nova compare to Boa? Regardless it’s great to see new js engines popping up

Hey, thank you for the question!

We owe a lot to Boa: I would like to call Jason Williams a personal acquaintance, we've discussed JS engines in general, and Boa and Nova in particular both face to face and online. Some parts of builtin methods, like float parsing, have been copied verbatim from Boa with copyright notices to Jason.

As for comparisons, the focal difference is perhaps the starting aims of each project: Boa was started by Jason (according to his Node.JS conf talk) to see if one can build a JS engine in Rust, and what building a JS engine means anyhow. They've since showed that indeed this can be done, no problem whatsoever. Because Boa walked, Nova could "run": I started working on Nova actively because I wanted to see what building a JS engine using an ECS-like architecture and data-oriented design would look like; what would it mean to get rid of the traditional structural inheritance / object-oriented design paradigm of JS engines, and what would the resulting engine look like?

So, Boa is a quest to show that a (traditional) JS engine can be built in Rust. Nova is a quest to show that Rust-like non-traditional architectures can be applied to a JS engine, and hoping that this will lead to unforeseen (or previously unappreciated) benefits.

Re: Nova: A JavaScript and WebAssembly engine written in Rust

#55

How does Nova compare to Boa? Regardless it’s great to see new js engines popping up

Oh, and of course Boa is much more complete and ready for action than Nova. If you need an embeddable JS engine in Rust today, go use Boa. If you want to try something new, then Nova may be of interest but it will probably also be an annoying piece of crap that panics on you every time you try to use this feature or that :)

Re: Nova: A JavaScript and WebAssembly engine written in Rust

#56
post #51

Earlier quoted context omitted.

Not really, no. The main reason is that the origins of the Nova JavaScript engine as a project (without the ECS / data-oriented design focus, that came later) are in the Deno runtime's Discord where a friend joked "so when are we starting our own JS engine?" in response to someone jokingly complaining about Deno using V8 which is of course written in C++. So the project started as a "let's write a better JS engine th…

> sufficient abuse[1], And `1` is?

Oops, sorry! https://fosdem.org/2025/schedule/event/fosdem-2025-4394-abus...

Re: Nova: A JavaScript and WebAssembly engine written in Rust

#57
Very interesting.

Wondering how hard it is to embed / vendor it into other projects. In the past we relied on duktape especially because how easy it is to just copy one .c file into your project and have it integrated there. It's one of the best features of duktape that other JS engines couldn't yet beat. Do you have plans to maybe provide a collapsed version of nova that is especially easy for embedding into third party projects?

Re: Nova: A JavaScript and WebAssembly engine written in Rust

#59

Wow, 70% is seriously impressive.

Thank you! In a way I'm honestly surprised we've gotten that high, but on the other hand maybe it's not too crazy either: Kiesel engine (written in Zig) is at 75% and is pretty much the same age as Nova, and I believe has a similar sized "development team" (one person doing a lot of the work, LinusG for them and me on Nova's side, and then a smattering of other people with a bit less free time on their hands). We als…

I hope you make more progress on this! You’ve made it so far already!
Post reply on HN