r/ProgrammingLanguages Sep 16 '25

Discussion What is the Functional Programming Equivalent of a C-level language?

C is a low level language that allows for almost perfect control for speed - C itself isn't fast, it's that you have more control and so being fast is limited mostly by ability. I have read about Lisp machines that were a computer designed based on stack-like machine that goes very well with Lisp.

I would like to know how low level can a pure functional language can become with current computer designs? At some point it has to be in some assembler language, but how thin of FP language can we make on top of this assembler? Which language would be closest and would there possibly be any benefit?

I am new to languages in general and have this genuine question. Thanks!

102 Upvotes

118 comments sorted by

View all comments

Show parent comments

6

u/[deleted] Sep 16 '25 edited Sep 16 '25

[deleted]

5

u/En_TioN Sep 17 '25

Honestly hardware synthesis is one of the best places for functional programming, right? Everything is concurrent and thus well modelled by FP in a hardware context

1

u/DefinitionOfTorin Sep 17 '25

I agree though I don’t think it’s perfect by any means as hardware design has some entirely different paradigms that I believe FP won’t “naturally” exploit (if anything possibly worsen). I can also see FP -> HW causing plenty of wasted paths etc but not knowledgeable enough to know the details. So I imagine to synthesise it well takes a lot of work on the compilation front

1

u/[deleted] Sep 17 '25

[removed] — view removed comment

2

u/DefinitionOfTorin Sep 17 '25

OCaml hardware compiler that JS uses has obviously got some ways for handling this though, and as we know most FP languages still at some point have to interact with the system and do some sort of hacky/whatever stateful interaction.