r/ProgrammingLanguages • u/edgmnt_net • Apr 11 '23
Functional bytecode
I'm interested in whether work has been done to create a bytecode that is less imperative and more of a functional style. My hunch is such a bytecode may be more amenable to fast interpretation, since stuff like loops may be dispatched more directly to native code (instead of individual flow control ops). Has anyone seen anything like this? How annoying would it be for traditional languages to get translated into such a bytecode (does it require vectorization?)?
62
Upvotes
View all comments
Show parent comment
4
u/edgmnt_net Apr 11 '23
Thanks. Do you think this is useful for a somewhat general-purpose portable bytecode? I was considering strict semantics, the functional part is merely to get more structure for computations and make interpretation faster, in turn.
As far as I can tell, STG and similar approaches are more appropriate as IRs for non-strict functional languages. I imagine a compiler could go through STG to output some portable bytecode.