Hacker News new | ask | show | jobs
by skybrian 4155 days ago
I think this will be solved (well, managed) by using unrestricted "colors" as glue languages at the top of the stack and restrictive colors for portable, embedded code that should be sandboxed. Pure functions shouldn't be hard to call or to cross-compile.
1 comments

I'm not sure about this. For instance, Scala has a very capable Java FFI, but using it can be problematic due to the different expectations of the languages.

In Java, you represent a missing value with null, but well-typed Scala should never encounter a null. Java will also regularly raise exceptions, but Scala usually prefers wrapping values that may fail with Either. There's no clear way to automatically bridge the gap, which means falling back to Java is always going to be a necessary evil, rather than something that should be encouraged.

Scala isn't really designed for embedding but something else might work. Perhaps a little language specifically designed for embedding. Some existing little languages include regexps and SQL, but perhaps there's room for portable pure functions.

But you do have to decide how data gets passed in and out.