r/functionalprogramming • • Nov 26 '24

Question Is functional assembly possible ?

Hello everyone, I am learning Haskell but I wanted to understand something :

When the Haskell script is compiled, it is translated into assembly, that is assembled into machine code, right ?

But the assembly language isn't functional, or even declarative, so your Haskell script isn't executed in a "functional way" in the end.

That is why I wanted to know if somebody ever created a functional version of the assembly language, or even if it's possible ?

Thank you in advance

10 Upvotes

19 comments sorted by

View all comments

Show parent comment

3

u/sohang-3112 Nov 27 '24

Another commentor mentioned a functional cpu did used to exist - Lisp Machines

3

u/drinkcoffeeandcode Nov 27 '24

The lisp machine didn’t have a “functional cpu” per se. It had an architecture more generally suited to running lisp code - operations like car and cdr were actual CPU instructions. But it was from a “functional cpu” - w/e that’s supposed to mean.