augustss / MicroHs

Haskell implemented with combinators
Other
370 stars 25 forks source link

Use as an interpreter #29

Open starmonger999 opened 10 months ago

starmonger999 commented 10 months ago

Is there a way to use MicroHs as an embedded interpreter/scripting language inside regular haskell like

import MicroHs
main = putStrLn $ microhs_run "case 1+1 of 2 -> True; _ -> False"

I think this would be great lightweight alternative to lua/hint. I guess this would require the runtime system to be ported to Haskell/MicroHs?

augustss commented 10 months ago

There is no way right now, but it would be pretty easy to add. But would it be light weight? It would need many MBytes of memory. And to be fast it would also need a saved cache which isn't small.

It's an idea, though. So I'll add it to my TODO list.