Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rust macros are just programs that take source code as input and produce source code as output.

These programs can do anything that the user running them does.

You can compile them to WASM, ship them over the network, and run them on a WASM interpreter with restricted permissions, like "no file-system access, no random-number generator access, no network access", etc.

WASM runs very fast (compiled to native code), is supported on every platform that has a web browser or a WASM interpreter, of which there are many open source implementations available, and has no undefined behavior (WASM modules either fail to validate or trap during execution but they don't "read out of bounds" or "segfault").

So to me at least this is a solved problem.

I guess one can do the same with common lisp macros, but nowadays at least, the infrastructure for WASM is just much better.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: