How to implement a functional programming language?

In a functional paradigm, function is the primary “management structure”. For example, the + operator is also considered a function, and you can pass them along with any other “objects”. I was interested that if I had to implement a functional language of toys, I would perform simple functions as true functions (that is, translate + into the called procedure) or translate them into regular instructions, which will be placed inline in the translated code, But then, with the second strategy, can I pass them on and apply them partially as in haskell? What are your thoughts on implementing / translating functions as a central idea in a functional language?

+7
source share
1 answer

I can recommend the PJL book. I wrote a compiler with it (in 1989-1990, in Prolog), and the book is a very good introduction to the topic.

It can be dated (written in 1987, 30 years ago), but it still covers the basics very well. This, however, is completely focused on lazy languages ​​like Haskell. Haskell did not exist at that time, and the book uses LML or Miranda, the predecessor language, but the languages ​​are very close.

0
source

All Articles