6 ms·
> if I wanted a language built around concurrency I’d use Erlang or Haskell. And if you wanted a concurrent language that wasn't a functional language what wou
by smegel 11y ago
> if I wanted a language built around concurrency I’d use Erlang or Haskell.
And if you wanted a concurrent language that wasn't a functional language what would you use?
- eloff 11y agoOr just a practical concurrent language with strong libraries that lets you be productive quickly. I'm aware of many of the theoretical benefits of Erlang and Haskell over Go. But Go is still a much better choice for getting things done.
- solarexplorer 11y agoOther languages like Clojure, Python and even Javascript are catching up to Go and are adding decent support for concurrency too. But I would definitely prefer a functional language for a project that involves a lot of concurrency. "not a functional language" is a weird requirement.
- istvan__ 11y agoAre you talking about Clojure? :) I am not sure what is the fuss about functional vs. imperative, you can do both in Clojure, both ways have a place in the programming toolkit. I think about functional programming as a philosophy. Nobody is going to despite me if I use swap! in Clojure or I use a mutable variable. On the other hand even when I am in an imperative environment I tend to use functions that keep the state in the parameters so the state is explicit and visible rather than a hidden something inside a class.
- solarexplorer 11y agoYes Clojure, sorry about the typo! The difference is that with Haskell or Erlang you get hard guarantees about side effects, but access to imperative libraries is very difficult. So you are kind of locked in a small ecosystem. With Clojure, Scala or F# you need to be disciplined and don't really get many guarantees, but you can reuse lots of imperative code. It kind of depends what your priorities are, if it's correctness or development speed.
- codygman 11y ago> The difference is that with Haskell or Erlang you get hard guarantees about side effects, but access to imperative libraries is very difficult. In my experience creating Haskell bindings to say imperative c libraries is pretty easy. What imperative libraries have been hard to access for you personally?
- istvan__ 11y ago> The difference is that with Haskell or Erlang you get hard > guarantees about side effects, but access to imperative > libraries is very difficult. Well yes, I can just live without imperative libraries because it is so natural to have single assignment (in the same scope) that I do it even in other languages. Accessing imperative libraries is possible though, just think about the C libs. What would you implement in Erlang the imperative way or which library do you miss exactly? The ecosystem is definitely smaller, but you can get support, some of the smartest software guys hang out on the mailing lists and IRc as well. I got absolutely amazing help from both when we worked on a Erlang project. > It kind of depends what your priorities are, if > it's correctness or development speed. Yeah and also how much fun you want to have. :) Using Erlang is great but not many devs out there for hire, on the other side you have two seasoned Erlang devs they can do a lot. Contractors FTW! Btw. what about using ASN.1 with Erlang? How does that change the correctness / development speed?
- wtetzner 11y ago> The difference is that with Haskell or Erlang you get hard guarantees about side effects As far as I know Erlang doesn't give you any guarantees about side effects. You can call side-effecting functions at any point in your program, just like in Clojure or OCaml.
- eloff 11y agoPython is my longest standing favorite language. But after working on a large python project I am cured for life of dynamic languages. I would not use them for anything over ten thousand lines of code ever again if I can help it. Go is now my favorite language.
- edgyswingset 11y agoC# has had excellent concurrency support for quite some time, and is most definitely a utilitarian language. Of course, the elephant in the room is needing a windows-based infrastructure ... but if that's not a huge barrier, it's not an unreasonable choice.
- solarexplorer 11y agoI keep forgetting about C# and F#, but with Microsoft embracing open source they may become actually interesting for people outside the windows world.
- MattHarrington 11y agoIt might not be common knowledge yet, but C#, F#, and .NET are fully open source and cross-platform. Development is done in public on GitHub (https://github.com/dotnet https://github.com/dotnet), and pull requests are accepted from the community. You can even get a support contract from Microsoft and call them up to troubleshoot your .NET project on Linux. No Windows required.
- sanderjd 11y agoThis is what I think (hope?) Elixir could be: a bit more practical (familiar? convenient?) language with the same concurrency support as Erlang. Maybe after another couple years of maturing libraries.
- wyager 11y ago>But Go is still a much better choice for getting things done. What makes you say this?
- tomcam 11y agoReasonable question,seemingly phrased without ill intent. Do not understand downvote.
- eloff 11y agoExperience. I still don't quite understand it fully, but I'm much more productive in Go than any other language I've used, and I have deep experience in about 8 popular languages and passing experience with another 12. I can list things that contribute to that, but a list of ingredients does not equate to a culinary masterpiece. Other people's experience may vary. Being a "boring" simple language with limited options for implementation means more focus on the problem and less on the infinite number of ways to solve the problem "elegantly". But there are a lot of other factors too. Static typing helps once the code base gets above 5000 lines, for example. Fast iteration from making a change to running the tests again also helps.
- codygman 11y agoMaybe you should write a blog post and list those reasons and post it here. Would probably create interesting discussion.
- codygman 11y agoAs someone who used Go in the past for work and now uses Haskell, I can say that the advantages of Haskell over Go are more than "just theoretical". In my day job I use Haskell to "just get shit done". However when it comes time to refactor I can do it much faster and safer in Haskell. The ease of refactoring creates an incentive to improve code.
- crimsonalucard 11y agoSeems like Go and other imperative languages are easier to start a project off with, but functional languages really shine when the code becomes really large and complex.
- codygman 11y agoI can agree with that, but once you are experienced with functional languages I think "easier to start off with" becomes a very low value. I'm assuming by start off with you solely mean "starting a new project" and not "starting to use language from scratch". At least that seems to be what has happened in my case.
- dllthomas 11y agoI find that the confidence that refactoring will be easy helps me tremendously with velocity when starting a project.
- eloff 11y agoMy experience is the exact opposite. Maybe we work on very different kinds of problems, or maybe it's just because we're different people.
- codygman 11y agoI work on rest APIs mostly and the Internet of things.
- deleted 11y ago[deleted]
- lxcid 11y agoErlang is probably the only true object-oriented language. http://www.infoq.com/interviews/johnson-armstrong-oop http://www.infoq.com/interviews/johnson-armstrong-oop
- zak_mc_kracken 11y ago> Erlang is probably the only true object-oriented language. And it's true because its creator says so right here, in this link!
- vezzy-fnord 11y agoOr because it does satisfy much of the Kay criteria for OO and encourages such programming styles.
- zak_mc_kracken 11y agoNobody follows Kay's definition of OOP. And I bet you're going to say "But he coined the term!". Yes. He's still making up his own definition twenty years after the industry gave its own, so whatever he says on the topic is moot.
- vezzy-fnord 11y agoSeveral things to note here. Firstly, I don't know at what exact point did Kay come out in demystifying OO (1998 or so?), but the design principles of Smalltalk and messaging date back to publishing in 1974, with many references to it afterwards. Secondly, the idea that there is one singular definition of OO that the industry has standardized on is absurd. Object models differ semantically from language to language, even if some general motif of "encapsulation/inheritance/polymorphism" is present (though again, important subtleties abound - is encapsulation enforced or merely convention, how structural and nominal subtyping are modeled [mixins], etc.). But would you say that's the definition of OO? In fact, Kristen Nygaard who was the creator of the Simula language, an ALGOL extension, and now considered to be the first OO language (semantically in that it beefed up structs and other procedural nuances) considered object orientation to be a property of any system in general as opposed to language constructs. Thus, Erlang definitely does count as OO under that, too. So what definition do we follow, then? Who do we trust? Apparently this is a difficult problem: http://c2.com/cgi/wiki?DefinitionsForOo http://c2.com/cgi/wiki?DefinitionsForOo But by all means, Erlang embodies many OO design principles by certain important taxonomies - both Nygaard's and Kay's. If you're going to reject both, then you're going down murky waters.
- RyanZAG 11y agoProbably Java (or other JVM lang) running something like Disruptor for high performance, or actor based libraries like Akka for general use case. No numbers, but considering how it's used in nearly all the bigger tech and finance companies, I'm guessing it probably has more use as a highly concurrent platform than anything else discussed here.
- tomphoolery 11y agoAnother reason for their usage of the JVM could be because a lot of these languages specifically designed for concurrent programming either didn't exist or were in their infancy of real-world usage. Erlang was proprietary until 1998, and Haskell was not created by a large company. In the meantime, Sun was pushing Java everywhere they possibly could. So it makes sense that larger tech and financial firms, especially those who established themselves in the late 1990s (or descendants of such companies), would use the Java platform. There were also a lot more Java developers than Haskell developers, and there still are, and that's a big part of the decision-making process when choosing a platform.
- pron 11y agoForget familiarity, hot code loading, and the huge library ecosystem (the largest in computing history) compared to one of the tiniest, but Java's runtime monitoring is far, far ahead of anything Haskell (or any other language or platform) can provide, and while Erlang's is pretty impressive (a close second), it is still not on the same level as Java's.
- smegel 11y agoThe standard JVM's don't support lightweight threading (like Go's Goroutines)...so yeah while you can do concurrency with callbacks, or "actors" (callbacks with lipstick on), it's not quite the same thing.
- wtetzner 11y agoYou can use Quasar, which does bytecode instrumentation. http://docs.paralleluniverse.co/quasar/ http://docs.paralleluniverse.co/quasar/