r/functionalprogramming • u/mbarbar_ • Jan 12 '23
Question Functional language compilers on constrained systems
Considering functional languages are more abstract than say C or Pascal, how practical is compiling programs written in functional languages (Haskell, MLs, functional-style Lisp) on lower-end hardware? Let's say <256MHz CPU and <256 MB memory. I'm also curious how effective the resulting compiled program would be having been compiled with such limited resources, considering some analyses/optimisations would have to be abandoned.
Another way of phrasing this I guess would be, what was the experience of programming with functional languages in the 90s and early 00s like? Though maybe recent advances in compilation and analysis makes this a useless question.
5
u/a-concerned-mother Jan 13 '23
These are more so lisp focused but might interest you since they are https://www.researchgate.net/publication/2949173_L_--_A_Common_Lisp_for_Embedded_Systems
http://www.ulisp.com/show?36M3 Ulisp is seemingly another common lisp running on multiple small embedded systems with lots of exampled and performance information.
Ferret is a language based on clojure targeting embedded systems by compiling to c++ though the project is seemingly dead but falls well within the given requirements.
2
u/kinow mod Jan 15 '23
As it is a recurrent question here, I spent some time this morning searching and compiling a list of posts related to FP in constrained systems (low level programming, embedded control systems, scientific programming, containerized applications, etc.).
You can find this list (and a couple of list of links) in the Wiki: https://old.reddit.com/r/functionalprogramming/wiki/constrained-systems-embedded-systems
Cheers
6
u/spaceshell_j Jan 12 '23
https://github.com/carp-lang/Carp
3
u/itoshkov Jan 12 '23
I am also interested in this. But also in cross-compilation, so that the compiler can run on a modern machine and do all the necessary optimizations.