5 ms·
As someone who has spend a fair amount of time with Haskell, Scheme, Common Lisp etc, can someone give me some insight into what's really exciting about Scala?
by Homunculiheaded 16y ago
As someone who has spend a fair amount of time with Haskell, Scheme, Common Lisp etc, can someone give me some insight into what's really exciting about Scala? There seem to be a lot of people I respect using it, but most of the articles I've read are of the form "coming from Java, Scala is awesome!" which I haven't found particularly enticing. Every time I look at examples I don't really see anything that sticks out as particularly interesting. I really want to get excited about Scala, and would really appreciate any insight that would help me with this.
- sorenbs 16y agoBeing able to do all your cool stuff in the usually boring enterprise world is the interesting part. If you don't need to integrate with container dit or java product dat there is no real need for scala.
- z0r 16y agoJust the pleasures of a powerful type system, inference, pattern matching, higher order functions... The usual good stuff, but on the JVM. I was paid to learn and program in it for a good five months earlier this year (everything ended up getting ported to python later...) and yes, it basically boils down to "coming from Java, Scala is awesome". If you have to build on top of the JVM and the Java ecosystem of libraries, it is a fine choice.
- krosaen 16y agoWhich do you prefer? Python or Scala?
- z0r 16y agoI enjoyed writing Scala more than I enjoy writing Python, but there are a few undeniable advantages that Python holds over Scala. The motivation to port from Scala to Python was to avoid the lengthy build process that had been slowing down development to a crawl. There may have been other ways to alleviate this, but by the time the port was completed, it took a good 15 - 20 minutes to get the build machine to compile and package the entire project so it could be deployed to production. At this time rapid fixes were critical. Also, the team as a whole prefers Python to Scala... I took pleasure in learning how to express my code in increasingly functional and compact ways, but my coworkers found struggling with the type system to be too much of a headache. In particular, there are rough edges when you are integrating Scala code with Scala types and data structures with Java code with Java types and data structures. In any case it will be easier to find programmers who write in Python than those who might write Scala. Scala gave me more personal pleasure to write in, but Python isn't bad either. I miss the type system and the many classes of errors it could help prevent at compile time, but I appreciate being able to change Python code and put it to the test immediately. The loss of expressiveness is probably made up in part by being forced to write code that is more easily read. I still hope I will be able to find a job writing in a functional language in the future...
- narrator 16y agoJRebel lets you change a running Scala program without having to restart the appserver and integrates well with IDEs. I find it's easily worth its price in the amount of productivity it adds when doing Scala web development.
- runT1ME 16y agoGreat response. How many LOC was your project that you got that amount of slowdown? Would you say it was the primary reason even over some developers struggling with the type system? I'm a huge Scala fan but even after a year of hobby programming here and there I feel like a beginner...
- z0r 16y agoI could pull up the LOC, but it honestly wasn't the Scala compilation that was the true issue. The true issue was that the project was built with maven and it had a tremendously large number of dependencies. If all the Scala in the project had been converted to Java, the build still would have been monstrously slow. So the port was more of an escape from the JVM than an escape from Scala - and yes, the build times were the primary reason for the port. As for the type system... not a single other person left on the team misses Scala but me. (The primary Scala evangelist had been let go for unrelated reasons)
- harryh 16y agoIt's all the interesting stuff that you get with Haskell/Scheme/Lips/etc combined with the practicality of running on the JVM with easy Java integration. Practicality being the key word.
- technomancy 16y agoThat description actually sounds a lot more like Clojure to me.
- harryh 16y agoWell with Clojure you get something that's more Lispy. With scala you get basically a mashup of Java + ML.
- runT1ME 16y agoI don't think Clojure has much at all to do with Haskell other than the pure functional aspect. One is a dynamic lispy language, the other has a very rigid type system (note I said rigid, not cumbersome) that's pretty much the antithesis of a lisp...
- technomancy 16y agoClojure's STM is based pretty heavily on Haskell's.
- runT1ME 16y agoYes, they're both pure functional so you need an STM to do anything...
- technomancy 16y agoI can't tell if this is a troll or just a misunderstanding, but it's wrong on two counts: Clojure is not purely functional, and side-effects are done more often with monads than STM in Haskell.