16 ms·
Why Scala is the best language available today
- steveklabnik 13y agoI'm not normally one to complain about headlines, but I think the editorializing here does a huge dis-service to the blog post. It implies there is such a thing as one true best language, which is pretty obviously false. I almost didn't even bother reading the post because of it. EDIT: If it gets changed, the submitted title is "Why Scala is the best language available today"
- lmm 13y agoThe original headline doesn't tell you anything about what the post is about; when I've submitted posts under similar headlines they've sunk without trace.
- steveklabnik 13y agoI won't argue with you that the best way to get articles to not disappear is to give them a flamebait title, for sure.
- mcv 13y agoThen make it "Scala: Language design is hard". That gets the point across that it is about Scala, without suggesting the article makes some absurd claim.
- CmonDev 13y agoIt might be best overall, but specific features can be inferior to other languages. C#'s dynamic keyword for instance.
- octo_t 13y agoI don't think the author is denying this fact at all? There's plenty in Scala that other languages do better, the author's claim is that no languages puts all of its features together better than Scala.
- CmonDev 13y agoThen the post subj should be changed, otherwise I could argue it's a "jack of all trades - master of none" kind of scenario.
- CmonDev 13y ago"Actors, a core feature in Erlang, are just another library in Scala." - or any other language out there.
- lmm 13y agoDo you know a good actor library for another language? I'd be very interested to hear of one for Python, because I still have to use it sometimes.
- steveklabnik 13y agoCelluloid is great for Ruby, I'm not sure what Python has.
- jiaweihli 13y agoThere's always pulsar: https://pypi.python.org/pypi/pulsar https://pypi.python.org/pypi/pulsar I confess I haven't used it before though...why use pulsar when I can get away with using akka?
- danieldk 13y agoFor Java: http://blog.paralleluniverse.co/post/49445260575/quasar-pulsar http://blog.paralleluniverse.co/post/49445260575/quasar-puls... Yes, you can use Akka from Java. Just to show that you don't need something like Scala to implement an actor system.
- lmm 13y agoI don't see any Java examples on that page, just Clojure.
- CmonDev 13y agoThere are multiple for .NET: http://stackoverflow.com/questions/2186222/any-good-implementation-of-actors-for-c http://stackoverflow.com/questions/2186222/any-good-implemen... For distributed scenarios NServiceBus is a good option although it's a bit different kind of model.
- 13y ago
- dallagi 13y agoWaiting for the 'why scala is a bad language' response
- adamnemecek 13y agoOh, this already is a response to a posting from yesterday https://news.ycombinator.com/item?id=6829725 https://news.ycombinator.com/item?id=6829725
- StavrosK 13y agoThat was yesterday.
- edem 13y agoBest language for what? This is highly subjective.
- babawere 13y agoThe best Java improvement :)
- edem 13y agoCeylon is a better improvement imho. The problem with scala is that it is not best for anything. It is a jack of all trades but does not surpass any competitor.
- frowaway001 13y ago> It is a jack of all trades but does not surpass any competitor. I think this a statement which deserves some actual facts.
- islon 13y ago"This is the problem with dynamic syntax in, well, dynamic languages. As Philips puts it, ignorance is strength, and freedom is slavery..." Hey man, that's like... your opinion In my opinion types are a poor man's schema, my email is not a string, it's a email, and my longitude/latitude pair are not just ints they have specific ranges, saying that longitude is 500 is as wrong as saying it's "foo". I use schema libraries and asserts to both document the code and make sure you can't feed it wrong data. I even generate automatic html documentation out of my schema so my clients know what to send me, and this only in the places I need, no need to a schematize or assert every simple function with obvious parameters. Maybe type annotation is more useful in OO languages, but as a clojure programmer, for me, data is just data, there's no behavior associated. If I really want type safety at compile time I can use core.typed only in the places I need it. As a former long time java programmer (who tried scala for months) I welcome my new found freedom from type slavery, but that's just... my opinion.
- adamnemecek 13y ago> I use schema libraries and asserts to both document the code and make sure you can't feed it wrong data. Dependent types to the rescue!
- danieldk 13y agoDependent types to the rescue! Dependent types are nice, but much what the grandparent wants can be achieved fine with normal types. E.g. in Haskell, define the Longitude type and some helper functions newtype Longitude = Longitude Double fromDouble :: Double -> Maybe Longitude ... And don't export the Longitude constructor to maintain invariants. Obviously, the same can be done in OO languages that allow you to hide members, C (via opaque pointers), etc.
- octo_t 13y agoDependent types to the rescue! Unfortunately dependent types are incredibly difficult to get working (Scala's type system is already turing complete (and can handle path-dependent types) and true dependent types would make reasoning about nigh-on impossible). I would argue that you're dealing with a sub-typing problem here, Email <: String, LongLat <: (Int, Int)* * I would say in Scala: case class LongLat(longitude: Int, Latitude: Int)
- toolslive 13y agoI have problems a few random floating statements: "decorators have well-defined semantics in Python" Python lacks well-defined semantics for just about anything. even simple expressions like 1.0 + 1/2 will evaluate to different things depending on which python version you're using. "Even F# simply isn't powerful enough (never mind OCaml)" evidence, please?
- frowaway001 13y agoHigher-kinded types, type-classes, traits ... just a few things which come to mind.
- coolsunglasses 13y agoClojure and Haskell represent untyped and typed FP better and are nicer to use in actual work.
- asdf1234 13y agoI disagree. I've used Clojure, Scala and Haskell in numerous projects and I'd personally choose Scala over Clojure every single time. Language arguments like this are pointless.
- coolsunglasses 13y agoWell, that might be because you prefer typed languages, which then leads to Haskell in that case. You can't cherry pick one of the two options I mentioned and then act as if that invalidates the whole thing. I also said not that Clojure and Haskell were vastly superior in every way, but that they individually represented their language niches better.
- seanmcdirmid 13y agoHaskell's options for nominal subtyping are incredibly limited; Scala goes much farther (lets not get into O'Haskell). Much of Scala's power is missing from Haskell, or at least, is quite differently directed. As for dynamic typing, Scala is definitely not trying to compete with a dynamic language.
- coolsunglasses 13y agoRight, and how well do subtyping and implicits get along? This is the problem, everything and the kitchen sink is tossed into Scala without any consideration for how well things work together because they've let it be a PLT grad students playground. http://www.reddit.com/r/haskell/comments/1pjjy5/odersky_the_trouble_with_types_strange_loop_2013/cd3bgcu http://www.reddit.com/r/haskell/comments/1pjjy5/odersky_the_... http://www.youtube.com/watch?v=TS1lpKBMkgg http://www.youtube.com/watch?v=TS1lpKBMkgg The Scala community didn't lose one its best core developers for nothing. I mention Clojure and Haskell in the same breath because FP and immutability are what I care about and Scala fails to be a nice functional language.
- girvo 13y agoI want a strongly and statically typed, preferably compiled, multicore PHP, basically. With good tooling, if the world was perfect. Scala seems to fit that in my limited playing, and seems to be the closest in terms of what I want out of a language in general. I'm still keeping an eye out though, as Scala does have some rough edges.
- lucian1900 13y agoI wish I had this much confidence in any one language. I'm productive with Python, but it lacks many useful things and I'm no longer comfortable with the rampant mutation. I like Haskell and the type system is extremely useful (typeclasses ftw), but I haven't managed to become productive using it. Scala scares me like C++ does, through sheer size. Rust is very interesting, but not yet mature enough. I'm not even certain that level of abstraction would generally be the one I want. Clojure is perhaps the closest (especially with core.typed and ClojureScript), but the dependency on the JVM is unpleasant for me to say the least.
- deleted 13y ago[deleted]
- andrewcooke 13y agoyou might try julia. it's a bit like python with optional types and (the promise of) speed. i am hoping it works out (and agree in general with your viewpoint otherwise, except i haven't tried rust or kotlin).
- skriticos2 13y agoHm, I have an issue with the absolute qualifier "best". Best in what respect? I'd personally say Python is best.. for general data manipulation. But it's slow. Go is best.. for network and concurrent programming, but it's rough around the edges and comparably low level. C is best.. for precise control of the hardware. No hand-holding here. But that's also it's weakness. C++ is best.. has all the bells and whistles you can think of, and more. More of the later probably. PHP is best for.. masochists and people used to it. It's also one of the quickest ways to create a web application by completely abstracting the low level stuff away. C# is best.. for religious people and people who buy into the Microsoft ecosystem. Strong library selection. Java is best.. for people who are looking for a job. As boring as enterprise is, they have money and look for Java devs. VBA is best.. if you are on a locked down corporate environment, just because it's almost the only option. <insert language> is best.. <advantages>, but <constraint>. So, you want to tell me that Scala has all advantages and none of the disadvantages? I don't buy it..
- seanmcdirmid 13y agoLegally, best is a vacuous term, meaning "as good as anything else." So if you say "this is the best tire ever" you can't be sued, at least in an English speaking country (unless they spell it tyre). Critically, never take a "best" statement at face value since these things can't be measured anyways.
- octo_t 13y agoScala is best.... if you want scalability and modularity, but some parts of the language are complex and take time to learn
- banachtarski 13y agoFlagging for the editorialized title.
- zs0H 13y agoWhy the sudden Scala love/hate on HN?
- kitd 13y agoIf you want Haskell, but don't want to leave the JVM, Frege might be an option. https://code.google.com/p/frege/ https://code.google.com/p/frege/
- vorg 13y ago> a language core should be small but flexible; despite the power and complexity of Scala libraries, Scala's language specification is much shorter than Java's Looks like GrǬǬvy, also begun in 2003, went the other way, making its language grammar larger but its core methods small. Beginning with a clone of Java's grammar, they expanded it with lots of extras, see http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/antlr/groovy.g http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/... And for the core methods http://groovy.codehaus.org/api/org/codehaus/groovy/runtime/DefaultGroovyMethods.html http://groovy.codehaus.org/api/org/codehaus/groovy/runtime/D... (note the methods marked "deprecated" still actually exist but were repackaged into other classes for Groovy 2.x).
- Horusiath 13y agoJust another day on HN and another trolling, controversial post...
- pron 13y agoI will not rehash my strong objections to Scala, but I think that this kind of discussion about programming language starts off on the wrong foot – the same wrong foot that led to what I perceive is everything that's wrong with Scala. A new programming language that hopes to achieve wide adoption is a big deal. A very big deal. C has been in widespread use for 40 years now, and Java for almost 20. You could switch a language every five years or so, but that means that you're not in "mainstream software development" but in some kind of Silicon Valley startup (a tiny minority among software developers). Mainstream software developers don't switch languages every five years, and in most case, not even every decade, so they'd better get the language right. But what makes a programming language right? That is a big question. Obviously, adoption, which is also a result of marketing, is a major factor regardless of the language's intrinsic merits. Also, you must consider your domain. Ruby is great for short-lived projects; Java is great for big, complex projects with dozens or hundreds of developers. But assuming you've taken all that into account, making a switch better be really justified. The problem with the article, I think, is it focuses on specific language features (effects, delegation, etc.), which is what got Scala into trouble (IMO) in the first place. When thinking about a new programming language, especially one not intended for research but for widespread adoption, this is not the way to go. I believe we should start by thinking what are the big problems with software developments, and how we can address them with a new language – one that does not simply offer this or that convenient feature, but gives a really big advantage, one that merits a switch. Java has done it with a GC for a C++-like language, and to a lesser degree, with threads. Clojure and Erlang address the issue of state - Erlang because of fault-tolerance, and Clojure (mostly) because of concurrency. On the other hand, some languages, like Ruby, focus on "developer productivity", which often means getting to working, useful code quickly, while maintaining good readability. This is, no doubt, important (for some domains much more so than others), but is this a major problem of software development today? Also, the article talks a lot about type safety. But type safety is language feature which is a means to an end. That end can be project maintenance/manageability, and arguably more correct code. But are there other ways of achieving this goal? I'm not saying there are, I'm just saying we should start by studying the problem, not examining particular solutions. Every language feature must be a part of solving a big problem; big enough to justify switching languages. After all, that's is a big deal so we better get it right. So, what big problem are you trying to solve?
- _pmf_ 13y ago> To my eyes this is half the genius of Scala: things that would have to be config files in another language are instead just Scala code that uses particular functions and classes[2]. That's cute; he seems to think the reason for managing configuration information in separate files is due to the inflexibility of Java. Let's hope that one day he has to deal with a non-trivial project and is enlightened.
- Grue3 13y agoPossibly the worst post I've ever read here. Horrendous title and completely devoid of any useful content.
- cosmicvisitor 13y agoso many Scala language flame wars! it must be doing something right!