Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Computers are stateful and imperative, so any functional language that runs on real computers has a stateful and imperative base. OpenGL vs not seems like an odd place to draw the line on what you would consider functional vs not.


> Computers are stateful and imperative

This is semi-Truth.

Modern off the shelf Microcomputers nearly all imperative, because marketing won, but when world was under Mainframes (nearly up to 1980), existed many examples FP-optimized architectures or high-level architectures, even some of them was commercially successful (Lisp computers and some high-level mainframes).

Also, most developers don't deal with naked hardware, but working with libraries of structures and libraries of high level algorithms, this named abstraction layer. Just some existing abstraction layers are less abstract and other are more abstract. As example, in Windows (and in most UNIXes) file abstraction is very simple and just imperative, but in MacOS it is OOP (derived from NEXTStep as I hear, based on ObjectiveC), and also exist some other OSes based on OOP languages, like BeOS, even when MacOS/BeOS are now running on same x86 hardware.

So possible just run inside higher level VM.

And mathematics is not prohibiting FP-machine, they could have very effective implementations with modern math.

What really problem, except of Prolog, I don't hear about high-level debuggers for fp languages, so writing on for example Ocaml, you once end up looking on fp structures with old C debugger, which sure don't see fp structures.


A Lisp machine is no counterexample - they had assembly language instructions that were tailored for Lisp, but were still very much imperative. In fact, Clojure is significantly more functional than other Lisps, which used mutable cons cells extensively. Object oriented languages are also stateful and imperative, so I'm not sure why those are relevant here.

I'm not saying these things are bad - it's possible to imagine a computer architecture that makes functional programming easier, but it's really hard to imagine a useful computer that is not stateful and imperative! What would it do, in that case?

OpenGL vs not-OpenGL still seems like a very arbitrary way to classify simulations.


Lisp really counter-example, because they have read-ahead (superscalar), specialized data types and hardware GC support.

Read-ahead (superscalar) becomes typical from Pentium and similar class CPUs; even specialized data types gaining some usage (AVX-512, FP-16/FP-8); but for hardware GC I don't know any widely used examples.


What conclusion do you draw from that? Nothing you're saying contradicts anything I said.


I stated exactly - MICROCOMPUTERS are stateful and imperative just because marketing dictated them, but multi-chip CPUs are not always imperative.

Other conclusion, looks like you are hater, minusing my comments just because you don't agree and don't accept any views except your own.


We're talking past each other somehow. Nothing I've said in this thread is hateful.


So I must assume your answer as "thank you for your view, I just see other"?

I just don't see thank you. Formally your answers are not hateful, but you may say thanks for info I provided, as I see you was not aware before.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: