6 ms·
The question i have been struggling to answer for few months now: Scala or Go?
by obilgic 13y ago
The question i have been struggling to answer for few months now: Scala or Go?
- auggierose 13y agoIf you would consider writing your program in C, then you should probably also consider Go. Otherwise, go with Scala ;-) I think Scala.js is going to be huge. Just alone for that I would choose Scala over Go.
- fnl 13y agoLike the C vs. C++/Java bridge - certainly more succinct answer than my reasoning... :) But I certainly do not believe that Scala.js has a reasonable chance of having an impact alike GWT or such; maybe it can get close to (ruby) Opal or consorts, though. The main selling point of Scala still is Akka, and, at least in the web-dev world, the Play framework, I guess.
- auggierose 13y agoI like your explanation, actually, although you seem to contradict it with this comment here. I am not using Akka, I am not using Play, I only use Scala because it is currently the language I can express my thoughts in the most elegant way, together with its industrial strength ecco system AND BECAUSE IT COMPILES TO JAVASCRIPT, TOO!!! GWT never convinced me, Java is less productive than Javascript, so what is the point (except for legacy Java programmers ...).
- SkyMarshal 13y agoFwiw, Scala has several good web frameworks besides Play - Scalatra - Scala's Sinatra Blue Eyes - appears defunct but good example of pure asynchronous framework Lift - strong built-in security, Netty integration wip. Probably a couple more I'm forgetting.
- zackangelo 13y agoSpray
- fnl 13y agoI had been asking myself the same question over the last few months, maybe even longer. The final selling point for me was lines of code, caused by the feature-richness of Scala. While implementing a few generic data collections and algorithms I need for my project, I realized that in Go this resulted in much more code than in Scala, or I would have had to sacrifice type safety by declaring everything an interface{} (sort of Go's version of a "void pointer" for C guys). I now have solved this by using Go as my favorite "scripting-like" language because it is so easy to bootstrap something there, and it is nice to quickly build efficient binaries and even wrap a C library. But to manage huge code bases and projects, for me the choice in the end became rather obvious. Particularly, with respect to all the magnificent capabilities starting from generics (~ C++ Templates), to higher kinds, the coming macros, etc. that help to create succinct DSLs and the general benefit "FP && OO", over "FP || OO", in the end made this decision obvious to me. And I have not even touched the issue of the gigantic collection of Java libraries and frameworks you automatically get by choosing Scala...
- MrBuddyCasino 13y agoWell, if you already use the JVM, its Scala of course. But ask yourself this: do you work in a team or alone? One of the first sentences is: "While highly effective, Scala is also a large language, and our experiences have taught us to practice great care in its application." And thats the biggest issue - Scala is a bit like the JVMs C++, you need capable programmers in order to not fuck it up, because it contains every paradigm ever invented. Go on the other hand is much simpler, and I like it for that - there is great value in simplicity.
- bad_user 13y agoI've been working with Scala for the last 2 years, and I also worked with C++. People claiming that Scala resembles in any way with C++ haven't worked with neither of them. Also, when speaking of simplicity, I like languages with conceptual elegance. Scheme is simple too and that's a rather interesting example. You see, Scheme is homoiconic and has macros and continuations, a combination so powerful that you can easily build on top and efficiently use any pattern or paradigm under the sun. Also, being a Lisp, most builtins can be reimplemented in Scheme. Now that's simple. What you're describing is actually easyness which is a very different notion. The main difference is that easiness is relative and depends on someone's own biases or limitations. The problem of course is that easy can overnight turn into hard. Ever tried doing FP in Go? Ever thought about implementing your own data-structures? Try it.
- yohanatan 13y ago"Haven't worked with neither" is a double negative. Also, 'resembles with' is redundant--'resembles' is sufficient. I have written both Scala and C++ at my day jobs and I would say that Scala certainly does generally remind me of C++ and specifically in its proliferation of language features. I also know of several others with similar experience and opinion on this matter.
- bad_user 13y agoEnglish is not my native language. I actually appreciate corrections.
- trailfox 13y agoPick Scala if: -You think a fusion of OO and functional programming is the way of the future -Runtime tooling and advanced instrumentation support matter to you -You like having first-class IDE support -You want to work for the likes of Twitter/Foursquare/LinkedIn/Amazon -Having tons of mature Java libraries available matters to you. -You don't mind investing time to learn the language Pick Go if: -Memory footprint matter to you (and you don't want to pick C) -Startup time matters to you (and you don't want to pick C) -You don't want to spend much time learning the language -You like C-style error handling and aren't expecting something as expressive as a python or a ruby. -You don't mind limited IDE support -You want every post of yours to be voted up on HN regardless of content
- Refefer 13y agoI would add a few more: Pick Scala if: -You find value in strong static assurances. -You find value in generics. -You want to learn functional programming, not 'functional' programming (and you should). -You value succinctness. Pick Go if: -Compile times matter (of course it does). -You find value in easier deployments (at the cost of potentially more deployments). -You don't want to learn D ;)
- saosebastiao 13y agoHa...love the last line. If I were in the market for something that solves the problems that Go attempts to solve, I would learn D. I just wish DMD was fully open source...it is awesome when you go to try a new language and all you have to do is "sudo apt-get ...".
- asdasf 13y agoI believe that very small sounding issue has played a huge role in D being as uncommonly used as it is. It seems like a trivial thing, but the ability to just pkg_add languageX is incredibly important for adoption.
- 13y ago
- candybar 13y agoFor people with zero knowledge of either, I think the following analogy is somewhat (but obviously not completely) apt: Scala is to Ruby what Go is to Python.
- SkyMarshal 13y agoInteresting, but might want to elaborate a bit more. It's not completely clear what you mean. For example, another that comes to mind regarding prototyping vs production: Python:C++::Go:Scala
- candybar 13y agoRuby and Scala are both feature-rich languages that give programmers every chance to abstract away any common logic that they can find anywhere, while remaining elegant at core. Python and Go are both minimalistic languages that provide basic abstraction facilities, but are designed to keep the programming language and source code simple and readable, even it comes at the expense of expressive power. Scala differentiates from Ruby with static typing, faster performance and better support for concurrency. Go differentiates from Python with static typing, faster performance and better support for concurrency.