5 ms·
And the thing is, that is largely why I love Haskell and Erlang... and then never use them for a project. Its really frustrating to me.
by DiabloD3 11y ago
And the thing is, that is largely why I love Haskell and Erlang... and then never use them for a project. Its really frustrating to me.
- jerf 11y agoIf you like Erlang but can't use it, consider either Go or Elixir. The former is probably the "more enterprise" and conservative bet, but Elixir is growing enough that it's probably not going away any time soon. (Honestly, whenever I have to go back to programming in a language without cheap threads I am often sad with the BS that comes out of my fingers. Single-threaded languages, even ones wrapped around an event loop with various hacks to try to obscure the single-threadedness, are so 20th century compared to the ones that were built for it from day one.)
- DiabloD3 11y agoGo is a language with serious flaws. It clearly was not made with threads in mind, and just gives low level primitives instead of just exposing a model like Erlang actors. I have high hopes for Rust, though. Even quite a few people at Google seem to have converted to the Rust camp, away from Go.
- MikeKusold 11y ago> It clearly was not made with threads in mind What exactly are you trying to do? Golang was designed from the start for high concurrency programs. Instead of threads, they use go routines. https://golang.org/doc/faq#goroutines https://golang.org/doc/faq#goroutines
- jerf 11y agoI've used both extensively. The practical differences between a goroutine and an Erlang process are small. The most significant difference is enforcement of isolation vs. isolation-by-convention (and bear in mind the latter is not the same as "no isolation"), but this is a bigger difference in theory than in fact. OTP being missing matters less than you might initially think, too. I implement what bits of supervisor trees can be implemented here: https://github.com/thejerf/suture https://github.com/thejerf/suture , and in general, with the way Go is structured, gen_servers and such just sort of melt away into "things you interact with over channels" without much fuss. (IMHO, OTP is generally a good thing, but the reification of gen_X so deeply into the language was an error. I actually prefer Go+Suture's way of bringing up a server; much simpler, virtually no loss of capability in practice. Again, the theoretical difference turns out to be larger than the practical difference.) (And before someone angrily smashes the reply button, pleases meditate on the distinction between a "small difference" and "no difference", especially the subjective nature of such judgment calls. You can certainly quibble with the size I assign to the differences but please don't reply as if I claimed no difference, or as if I have not demonstrated awareness of the difference between a strictly-enforced no-sharing environment vs. unenforced no-sharing convention, and, likewise, let's not pretend "isolation by convention" is the same thing in practice as "traditional shared-memory threading". Memory sharing can bite you in Go, and while I've gotten pretty used to the necessary patterns to avoid that (spending years in Erlang first is really good training for that), I don't deny it is non-zero cognitive effort required.)
- Cshelton 11y agoGo is good, and yes, every language has serious flaws. I think what you really meant is Go is nothing special. It's a nice language with nice syntax, but the ideas behind it aren't different. The reason people like Rust is it is different. It's what people wished C++ could have been so many years ago. With that said though, each of the languages have its place and uses. Sure many things can be done with both of them, but some things only Rust can do/will be able to do(many unstable things still). Both languages will be successful imo. I can see Go and Rust being taught as the primary languages in the academic world and in the enterprise world. If I were starting out in school, I'd probably pick Go and Javascript.
- vezzy-fnord 11y agoI'm not sure in what setting would Erlang be inappropriate, but somehow Elixir would be fine. Elixir actually adds a further layer of complication compared to Erlang, which is a straightforward pattern matching, expression-based language with recursion and polymorphic functions for looping and conditionals. Elixir looks Ruby-ish, but that illusion breaks down very quickly since the underlying semantics are anything but. Not to mention Elixir doesn't shield you from having to be aware of the Erlang runtime, the VM and OTP.
- bduerst 11y agoAs someone who uses python, what are some reasons for me to switch to Go?
- robmccoll 11y agoThe language itself is far simpler (fewer built-in basic complex data types, composition over inheritance, no overloading, no slots) but still batteries-included w.r.t. the standard library. You'll likely get a performance improvement unless you are writing some really zany code. Static types and the compiler will actually make your life much easier when dealing with larger code bases (no more wondering what type a parameter is, if it compiles there is a much better chance that it will just work, fewer worries about unhandled runtime conditions). Less magic (no decorators or deep class hierarchies) which means its easier to trace control flow in someone else's code. Verbose, but still very clean error handling. IMHO, the import system is pretty broken and awful, but importing someone else's packages straight off of github is still much better than pypi / wheelhouses. Compiled static binaries by default means that building somewhere and then shipping a binary is quite easy.
- bduerst 11y agoThanks - that's what I was looking for. I'll read more about the deep class hierarchies to see if it would be a problem. Shame to hear about the importing, I kind of like Python's importing (sans the circular dings).
- robmccoll 11y agoSure - the import thing really just depends on what you're doing and how you use imports. Personally I found it to be really cool at first, but later realized it's more of an 80% solution that makes great demos but runs into practical problems (not flexible, tools around versioning or and relative paths are hackish). With hierarchies, you can mostly implement them, but they language pushes you away from them, which is really a feature.
- bliti 11y agoDepends on what you use Python for.