2 ms·
You're going to have a hell of a time implementing elixir in python.
by dnautics 7y ago
You're going to have a hell of a time implementing elixir in python.
- macintux 7y agoIt’d be a lot harder to implement Python in Elixir!
- dnautics 7y agoWould it? The basics of the language are at least easy, you might have trouble when python drops into it's ffi. Same holds in the reverse; you can't easily do elixir ffi in python. FFI aside, I don't see a good way of implementing Kernel.spawn/1, Process.monitor/1, etc. in python, without rebuilding the entire erlang VM from scratch.
- macintux 7y agoIt’s a lot easier to implement an immutable language in a mutable one than vice versa, or so I’d assume, never having tried. But yeah, I’d assume you’d have to build the VM first. A lot of work.
- dnautics 7y agoYou can mock mutable variables in actors. Actors and genservers are a first class module in the standard library. Elixir is not Haskell. There are plenty of places with accessible statefulness/mutability, it's just shielded in a functional wrapper and made slightly difficult to dissuade you from using statefulness unnecessarily, so you make fewer coding and concurrency mistakes in annoying places and you can focus on delivering features and solving hard problems.