I do not know much about Haskell, but from what I have read about the mutability of computations (e.g: functions returning functions, complex monads and functions, etc.) it seems like you can do a lot of meta-programming, even at runtime.
I'm not sure what you mean by "mutability" precisely, but it is certainly the case that compiling such an abstract language to efficient machine code is a complicated task. As a starting point, you could read The Implementation of Functional Programming Languages, a book by Simon Peyton-Jones, one of the main people behind Haskell.
For something more recent, there's some commentary on the internals of GHC, the flagship Haskell compiler.
On a more down-to-earth note, if it's just the idea of "functions as values" that you're wondering about, that's old hat--Lisp dialects have been compiling higher-order functions for longer than I've been alive, and even C passes pointers to functions around.
How can Haskell ... compile to machine code ...?
Via this compilation strategy: Implementing Lazy Functional Languages on Stock Hardware
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With