Comment by sph

Comment by sph 4 hours ago

13 replies

I don't think it's cycles, more like newcomers rediscovering the future.

I've learned Elixir in 2016 after a lull in my interest in programming languages, and 9 years later it's still my favourite environment by a country mile. It's not the language per se, but the BEAM, the actor model, the immutability — just makes sense, and doing things the C/Rust/Javascript/Python way is like building bridges out of cardboard.

For example, I've stepped into the world of game dev and Godot, which is fantastic and uses a regular object-oriented model. After trying to build a non-trivial desktop app with it, my thoughts are consumed by the fact that mutable state and object orientation is the silliest idea, and I'm speaking as someone that really got into Smalltalk and message-passing objects.

I don't even need actors and OTP, I just want some immutable data structures and functions operating on them. Erlang/Elixir are fantastic to build servers, but there is a sore lack of something closer to the metal within 80% the speed of a native language. I would build an entire operating system out of it. Why has no one put microkernels and Erlang into a blender? I know there's QNX, but it's still UNIX, not Erlang.

jacquesm an hour ago

> Why has no one put microkernels and Erlang into a blender? I know there's QNX, but it's still UNIX, not Erlang.

That's a very good question. There are some even lesser known dialects out there that do this but you are going to find it hard to get to the same level of feature completeness that Erlang offers out of the box.

QNX and Erlang embody quite a few of the same principles, but QNX really tried hard to do this at the OS process level in a way that destroyed a lot of the advantages that doing the same under Erlang would have. I think the main obstacle is the fact that the CPU does not support reductions natively. Maybe you could take it a step further and design an FPGA CPU that implements the core features of Erlang at the hardware level?

That would be an absolutely awesome project. Usually when you can think of it someone has already done it so a bit of googling would be a good way to start with that.

  • sph 2 minutes ago

    > That would be an absolutely awesome project. Usually when you can think of it someone has already done it so a bit of googling

    I've done a bit of googling and research, but still haven't found the time to create a prototype. I do agree that it's an awesome idea, and it's been stewing in my head for a couple years now!

    There are a lot of moving parts (scheduler design, probably needs its own high level language, mapping capabilities onto actor semantics, etc.) that are outside what most OS-research seems to be focused on.

  • shanemhansen 28 minutes ago

    You nerd sniped me a little and I'll admit I'm not 100% sure what a reduction is but I've understood it to be a measurement of work for scheduling purposes.

    A bit of googling indicates that actually you can use performance monitoring instur to generate an interrupt every n instructions. https://community.intel.com/t5/Software-Tuning-Performance/H...

    Which is part of the solution. Presumably the remainder of the solution is then deciding what to schedule next in a way that matches erlang.

    Disclaimer: this is based off some googling that makes it seem like hardware support the desired feature exists, not any actual working code.

dzonga an hour ago

> want some immutable data structures and functions operating on them.

Clojure has that for you. plus its jvm which means for your desktop use cases it works. hell with graalvm can be ported to native.

  • jacquesm an hour ago

    I used to think that Clojure was going to be the first FP language that was going to go mainstream but it seems to have fizzled. What went wrong?

    • skydhash 41 minutes ago

      FP language is very hard on novice programmers. You can write thousands of lines of bad javascript/java/python code, but you won’t write ten in FP without the whole thing blowing up.

      And then there’s the whole evaluation instead of instructions. With FP, you’re always thinking recursively. With imperative, you can coast on a line by line understanding.

      • sodapopcan 31 minutes ago

        In my experience it's still very possible to write many, many lines lines or utterly shit FP code, but I know what you're saying.

lomase 33 minutes ago

Lets count the number of comercial sucesful released games that don't use mutability or object orientation....

I can't find any.

mycall 2 hours ago

What about OCAML, does that fill your needs?

  • ccortes an hour ago

    I really want to get into ocaml but the syntax is sooo ugly I feel like you need a great IDE set up to be able to be productive with it.

    • codr7 19 minutes ago

      Might want to check out ReasonML.

  • sph 2 hours ago

    It’s perennially in my list of languages to check out. It felt harder when I looked into it 15 years ago. Now that functional programming is second-nature, it should be much easier.

    Thanks for the reminder.