Live data from Hacker News

Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates

austinpoor.com

1–10 of 22 posts

Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates

#2
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

Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates

#3

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

> 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

#4
post #3

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

> 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?

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.

Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates

#5
post #3

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

> 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?

Presumably Deno is a use case where you would want to write rust that hosts js/ts safely

Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates

#6
post #3

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

> 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?

[deleted]

Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates

#7
post #4
post #3

Earlier 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?

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

#8

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.

Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates

#9

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

Part 3 of the series was published just an hour ago:

https://deno.com/blog/roll-your-own-javascript-runtime-pt3

Re: Running JavaScript in Rust with Deno: Experimenting with Deno's Rust Crates

#10
post #3

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

> 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?

Building a data ingestion pipeline that scales horizontally but leaves the ingestion rules up to your customer in the form of a ts module that implements an interface? There’s plenty of opportunities to allow your runtime to be controlled via scripting.

Or a function host that executes jobs at scale? You only need to program the security, sandboxing, scheduling, and distribution of functions that can be invoked.

Post reply on HN