Being able to allow custom behaviour via JS/TS in Rust is definitely something that I wanted to explore too. If you haven’t already you should check out these two articles from the Deno blog website which go a bit further: https://deno.com/blog/roll-your-own-javascript-runtime https://deno.com/blog/roll-your-own-javascript-runtime-pt2
I wasn't aware of a pt2, thanks for the link.
Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates
11–20 of 22 posts
Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates
#12Being able to allow custom behaviour via JS/TS in Rust is definitely something that I wanted to explore too. If you haven’t already you should check out these two articles from the Deno blog website which go a bit further: https://deno.com/blog/roll-your-own-javascript-runtime https://deno.com/blog/roll-your-own-javascript-runtime-pt2
> Being able to allow custom behaviour via JS/TS in Rust I understanding wanting to call out to Rust from JS/TS, but I don't think I understand wanting the reverse. Isn't a major goal of Rust not to have "custom behavior" that is invisible to the compiler?
Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates
#13Earlier quoted context omitted.
> Being able to allow custom behaviour via JS/TS in Rust I understanding wanting to call out to Rust from JS/TS, but I don't think I understand wanting the reverse. Isn't a major goal of Rust not to have "custom behavior" that is invisible to the compiler?
I'm trying to build a view rendering engine / perform SSR straight on Rust with that
Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates
#14Being able to allow custom behaviour via JS/TS in Rust is definitely something that I wanted to explore too. If you haven’t already you should check out these two articles from the Deno blog website which go a bit further: https://deno.com/blog/roll-your-own-javascript-runtime https://deno.com/blog/roll-your-own-javascript-runtime-pt2
> Being able to allow custom behaviour via JS/TS in Rust I understanding wanting to call out to Rust from JS/TS, but I don't think I understand wanting the reverse. Isn't a major goal of Rust not to have "custom behavior" that is invisible to the compiler?
I haven't looked into the details of this so I'm not sure if its a suitable replacement for embedding lua (binary size would be my first concern..does this embed v8?) But I would much prefer TypeScript as a configuration language than Lua.
Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates
#15That is ... exactly what windmill is https://github.com/windmill-labs/windmill
The orchestrator is built from scratch in rust using postgresql to store the state. The steps when in typescript are run in deno: https://github.com/windmill-labs/windmill/blob/main/backend/... and the transforms between the steps (piping outputs of any node to the input of any node) are actually javascript expressions run by deno JsRuntimes: https://github.com/windmill-labs/windmill/blob/f3ec9ca09dc37...
Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates
#16Earlier quoted context omitted.
Imagine you are building a game in Rust where players can write mods. Those mods could be written in JS/TS while the game is written in Rust.
It of course doesn't need to be a game. VBA macros in Office and AutoLISP in AutoCAD are two examples of scripting environments on large compiled applications that allows users to customize and automate behavior, outside of gaming. Hell, you can point at Emacs and vim as examples too.
Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates
#17Earlier quoted context omitted.
I'm trying to build a view rendering engine / perform SSR straight on Rust with that
Why not transpile Rust to WebAssembly directly?
Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates
#18Being able to allow custom behaviour via JS/TS in Rust is definitely something that I wanted to explore too. If you haven’t already you should check out these two articles from the Deno blog website which go a bit further: https://deno.com/blog/roll-your-own-javascript-runtime https://deno.com/blog/roll-your-own-javascript-runtime-pt2
> Being able to allow custom behaviour via JS/TS in Rust I understanding wanting to call out to Rust from JS/TS, but I don't think I understand wanting the reverse. Isn't a major goal of Rust not to have "custom behavior" that is invisible to the compiler?
Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates
#19OMG. That's ridiculous.
Write the code in C or Zig, and use Lua for scripting, and you're down to under 1MB for the final binary.