4 ms·
Wishful thinking: Could modern programming languages adopt isolated heaps with message passing like Erlang does? This is the easiest solution to GC pauses and
by imtringued 9y ago
Wishful thinking:
Could modern programming languages adopt isolated heaps with message passing like Erlang does? This is the easiest solution to GC pauses and allows other nice features like hot code reloading.
The majority of programming languages invented in the last 10 years don't seem that different from each other. I'd love to see a programming language that combines the strength of C++ and Erlang for soft realtime workloads.
- jakevn 9y agoYou might find Pony interesting: https://www.ponylang.org/ https://www.ponylang.org/
- BorkJames 9y agoAt the same time you have to deal with waking up in the morning and telling yourself you're going to go do some pony today, which seems a tad off. Im going to do some C++ Im going to do some Java Im going to do some Pony
- bretthoerner 9y agoWorked out for Python.
- BorkJames 9y agoThat's because Python has a nice Monty Python vibe. Honestly if people in my CS dorm were watching Monty Python in the common areas 24/7 it would be pretty nice
- dwcnnnghm 9y agoYou are making this comment on an article about a language called Crystal.
- optimuspaul 9y agoI don't talk like that. I would say write some.
- anthonybullard 9y agoIf you are looking for a modern language with a pragmatic syntax and uses lightweight processes and message passing why not Elixir? It's an expressive, productive language that can leverage The power and scope of the Erlang/OTP ecosystem. https://www.elixir-lang.com https://www.elixir-lang.com
- acangiano 9y agoElixir is great but it most definitely doesn't fit the "C++ strengths" part of the requirements. Contrary to popular belief, Elixir is a slow language. Think Python/Ruby slow for compute-intensive tasks.
- ch4s3 9y agoIt's slow compared to C++, but for most tasks its ~5x faster than python or Ruby. If the task is parallelizable, it will be quite a bit faster. But yeah, you aren't going to be doing math with Elixir. One of the things you'll get with Elixir/BEAM languages is really low and stable latency. You'll never get that with long running Python or Ruby processes.
- anthonybullard 9y agoWell, it's mainly slow in one thing: math. Why? The BEAM uses arbitrary precision representation for most numeric values(Bignum). From _The Beam Book_: > There are two types of integers in ERTS, small integers and bignums. Small integers fits in one machine word minus four tag bits, i.e. in 28 or 60 bits for 32 and 64 bits system respectively. Bignums on the other hand can be as large as needed (only limited by the heap space) and are stored on the heap, as boxed objects. Outside of that, I have found Elixir/Erlang to be very resource efficient. And if you need blazing fast math, you can always implement such computations in C and expose it in your Elixir/Erlang application using NIFs. There are a few golden rules to pay attention to in order to avoid danger, but if you do, you can get great speed. I'm currently implementing a Protocol Buffer library in Elixir and expect to make use of this for increased performance once my library is feature complete(if I find performance to be an issue at scale).
- dom96 9y agoThere are many languages that do this. In addition to those already mentioned, there is also Nim. https://nim-lang.org https://nim-lang.org
- toast0 9y agoA simple way to get isolated heaps and message passing is multiple os processes and local sockets; this can be more heavy weight than threads/green threads though. I've done some experimentation with hot reloading in c lately, and I'm not sure how isolated heaps is a precondition for code reloading. I suspect the requirement for erlang style code reloading is a willingness to take an indirection penalty for fully qualified module calls and tail call optimization so that the old module doesn't stay in process stacks. In an OOP language, if you wanted to tie objects to specific versions of modules, you'd have to do some intrusive accounting as well. I also attempted hot code reloading in perl many years ago; it's a lot easier to do when you've seen it done properly, and there are language facilities for it (fdlopen is a lot nicer to use than exec on a pm). In my use cases (which were single threaded), I was able to write an outside loop that's simple enough that it's not a big deal that it can't be reloaded.