I think you shouldn't have let people talk you out of using Haskell. It's a very nice language and has some advantages for this sort of project (at least based on your cursory description).
However, its advantages are really not the important part. Rather, I just wish you wouldn't dismiss it immediately as a crazy choice. It's no more crazy than any other less-popular language. It has a reputation for being impractical, but this reputation is rather unfair especially in the light of recent very practical developments like simpler concurrency, an improved IO manager, very good web frameworks and a fair about of strong libraries both for very specific domains and general productivity.
The main disadvantage is that many people find it hard to learn. However, this is a function (heh) of functional programming rather than the language itself. It's actually a simpler language than Scala in many ways because it tries to do one thing well--for example, it has no sub-typing, so you do not have to ever worry about covariance and contravariance.
Now, my point here is not that you should always use Haskell, just that you should seriously consider it. Too many people dismiss it out of hand almost as a joke when it is anything but.
Thanks for your support. Like I mentioned, I will circle back to Haskell as the business develops. If I was the only programmer in my startup, I would likely go with Haskell for important components of our software. But I have concerns about hiring a large team that would thrive in Haskell. One never knows - I'm keeping an open mind :)
Haskell's syntax is weird compared to more popular languages. This is the main reason it's hard.
That said, It's a better choice than Scala for math. However, if the math is numerical algorithms, Python is better than either Haskell or Scala.
I'm not sure why they need to settle on one language. Seems like painting the bike shed. For better or worse, every sufficiently large web system has a number of languages being used behind the scenes.
Novus Partners also does Scala. We've even got a few Python guys coding in Scala. It's just a language with the JVM ecosystem to back it up. Python has it's own ecosystem and for numerics, access to LAPACK and UBLAS is pretty awesome, I must admit. That said, both can exist fairly comfortably in a company and can be used for different purposes.
I like Python for prototyping, algorithm validation, and just to hack on. I like Scala for damned near everything else. (Also, Adam is going to be open sourcing what is essentially a Scala clone of Pandas but statically typed and with comparable performance.)
The article's basis of the comparison for building an entire business seems to be very shallow.
Surely other considerations are more important, such as,
- encapsulation/domain partitioning
- messaging
- libraries and library maturity
- native code interoperability (likely critical for this application)
- concurrency
- performance
- JVM platform
- etc.
Maybe, as a result of this type of analysis, Python-like language is more suitable in some domains and a JVM language in others.
In my opinion, for the requirements quoted, with a deep and performant mathematical framework involved, I cannot envisage how Scala/JVM could win any "war" for the core of the business.
A few more considerations will be posted in Part 2 of the post.
I appreciate your pointers - as the business grows and takes shape, a fresh evaluation will be required where some of the considerations you mention will be taken into account.
This was done a few years ago. I'd love to hear what people have to say about Scala now that code bases have grown. Anyone working with a couple hundred thousand lines of Scala?
For instance, I know compilation performance was always frustrating for developers. What's it like for teams of people dealing with a large code base?
No discussion of run-time characteristics? I realize for a some start-ups this is not the most important metric, but these guys sound like they might be compute bound. And faster language can mean cheaper/less hardware.
Seriously, computer language shootout is just harmful. Those benchmarks are bad (but it's unclear whether cross-language comparisons can get much better), implementations are worse. And on top of that it does not include opitmized VMs like PyPy or LuaJIT (in fact, it does not include PyPy because we complained at some point).
Thanks! Great articles. We are not compute-bound for the near-term, so it's not our most important consideration. As the business evolves, we will embark on a fresh language war where compute performance is likely to be a key factor.
Python has real good, battle tested and actively developed libraries for math, scientific computing and analytics. Most of these are written in C and hence give great performance in addition to the flexibility of python. Some great ones are: Numpy/Scipy, LAPACK, Pandas (lots more for machine learning as well). Also, I think the REPL is no match for IPython :). For your specific domain (math and analytics) python could be a great fit. Of course the lack of type systems and no compile step can be scary, but for a startup, which needs to move fast, python gives you the power of quick iteration. Just to round this off, from the zen of python:
I'd like to agree here. IMO up-and-coming Clojure is an up-and-coming competitor to Scala. As a Lisp variant for the JVM, I'm a major fan of it.
Unfortunately I can't share any personal experience as the core of my work is in the Enterprise so I haven't had the right opportunity to present itself. But if you're coming from a mathematical background you should check it out
People actually use it? It seems abandoned and the link to homepage broken: https://pypi.python.org/pypi/typecheck. I'm asking because I'd really like the idea of starting a project the dynamic typing way and then bolting on a (semi)-static type system on top once more new programmers join the game, preferably being able to completely disable it on production machines for best performance.
Have you checked out Cython[1]? It's used quite often in Numpy. Basically, you add some type annotations like, int, double, etc. for some speed-up. There is a quick tutorial as well [2].
> Besides, dynamic typing scares the hell out of me
Funny. I feel exactly the opposite. Static typing is false security.
I program in JS. My coworkers in Java. They have so many bugs that make it to prod because they assume that just because it compiles it must therefore be safe.
Well, it's not like type checking is a binary attribute of a language - for example, Haskell/ML have 'stronger' type systems than Java/C++.
In the former languages, you can encode many more attributes of a program into the type system, and so you can have check at compile-time many more invariants of your program - e.g. enforcing a function does no I/O, enforcing that all possibilities are handled when pattern matching, enforcing the equivalent of nullptr checking, etc.
In languages like C++, there are techniques you can apply to allow the type system to help you out a bit (see this talk by Jordan DeLong for some examples [1]), but in general, the guarantees you get from a non-HM type system are weaker than those from one, and so the notion of successfully passing type-checking is correspondingly weaker.
Yeah, Java is not a fair example. It has a type system with the worst compromise between being awkward (and infamously verbose) and not very effective: it gets the short end of the stick on both accounts. It's better than C, granted, but that's saying nothing. It does not compare to a good type system like Scala's or especially Haskell's.
Good type systems can catch far more bugs than you imagine. Moreover, they can actually make writing code easier: there are some extremely valuable and expressive features like typeclasses that simply cannot be reproduced in a dynamically typed language.
Not all static type systems are created equal. The sort of type checking provided by Java (and similar languages) provides far less safety than that of a full-fledged type-inferring language like Scala or Haskell.
I use Ruby and JavaScript professionally. I do like Ruby for a number of reasons, and JavaScript I can at least live with. But in both languages, I constantly find myself spending tons of time tracking down bugs that would have been discovered right away if I had Haskell's type system at my disposal.
I prefer static typing because those assurances reduce the number of things I have to manage--they mean I must keep less state in my head. I do not assume that it guarantees things that it does not.
Attributing your coworkers' "if it builds, it works" assumptions to static typing strikes me as incorrect. Static typing, at least in Java, ensures only a (relatively) small set of conditions are true; I don't think you can really blame that for increased/additional assumptions on the part of sub-par programmers.
I think the reason was the math libraries. There aren't mature libraries yet for numerical computing. Python has Numpy/Scipy, but am not sure of Scala (I don't use).
[+] [-] tikhonj|13 years ago|reply
However, its advantages are really not the important part. Rather, I just wish you wouldn't dismiss it immediately as a crazy choice. It's no more crazy than any other less-popular language. It has a reputation for being impractical, but this reputation is rather unfair especially in the light of recent very practical developments like simpler concurrency, an improved IO manager, very good web frameworks and a fair about of strong libraries both for very specific domains and general productivity.
The main disadvantage is that many people find it hard to learn. However, this is a function (heh) of functional programming rather than the language itself. It's actually a simpler language than Scala in many ways because it tries to do one thing well--for example, it has no sub-typing, so you do not have to ever worry about covariance and contravariance.
Now, my point here is not that you should always use Haskell, just that you should seriously consider it. Too many people dismiss it out of hand almost as a joke when it is anything but.
[+] [-] cover_drive|13 years ago|reply
[+] [-] rdouble|13 years ago|reply
That said, It's a better choice than Scala for math. However, if the math is numerical algorithms, Python is better than either Haskell or Scala.
I'm not sure why they need to settle on one language. Seems like painting the bike shed. For better or worse, every sufficiently large web system has a number of languages being used behind the scenes.
[+] [-] wheaties|13 years ago|reply
I like Python for prototyping, algorithm validation, and just to hack on. I like Scala for damned near everything else. (Also, Adam is going to be open sourcing what is essentially a Scala clone of Pandas but statically typed and with comparable performance.)
[+] [-] drucken|13 years ago|reply
Surely other considerations are more important, such as,
- encapsulation/domain partitioning
- messaging
- libraries and library maturity
- native code interoperability (likely critical for this application)
- concurrency
- performance
- JVM platform
- etc.
Maybe, as a result of this type of analysis, Python-like language is more suitable in some domains and a JVM language in others.
In my opinion, for the requirements quoted, with a deep and performant mathematical framework involved, I cannot envisage how Scala/JVM could win any "war" for the core of the business.
[+] [-] userulluipeste|13 years ago|reply
It looks more like an emotional kind of story than one about practical decisions.
[+] [-] cover_drive|13 years ago|reply
I appreciate your pointers - as the business grows and takes shape, a fresh evaluation will be required where some of the considerations you mention will be taken into account.
[+] [-] leothekim|13 years ago|reply
Foursquare also uses Scala, as does LinkedIn. Here's a page of organizations using it:
http://www.scala-lang.org/node/1658
[+] [-] melling|13 years ago|reply
For instance, I know compilation performance was always frustrating for developers. What's it like for teams of people dealing with a large code base?
[+] [-] cover_drive|13 years ago|reply
-Ashwin
[+] [-] voidlogic|13 years ago|reply
Scala vs Python: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
Also since he mentioned Haskell at first, Haskell vs Scala: is also interesting: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
Haskell vs Python is just for lolz: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
[+] [-] fijal|13 years ago|reply
[+] [-] cover_drive|13 years ago|reply
[+] [-] lake99|13 years ago|reply
[+] [-] tapan_pandita|13 years ago|reply
"practicality beats purity."
[+] [-] zubinmehta|13 years ago|reply
[+] [-] beggi|13 years ago|reply
I have no idea which and how many startups use Clojure, besides Datomic :) It would be interesting to know.
[+] [-] dwelch2344|13 years ago|reply
Unfortunately I can't share any personal experience as the core of my work is in the Enterprise so I haven't had the right opportunity to present itself. But if you're coming from a mathematical background you should check it out
[+] [-] nnq|13 years ago|reply
People actually use it? It seems abandoned and the link to homepage broken: https://pypi.python.org/pypi/typecheck. I'm asking because I'd really like the idea of starting a project the dynamic typing way and then bolting on a (semi)-static type system on top once more new programmers join the game, preferably being able to completely disable it on production machines for best performance.
[+] [-] shared4you|13 years ago|reply
[1]: http://cython.org/
[2]: http://wiki.cython.org/tutorials/numpy
[+] [-] wyqueshocec|13 years ago|reply
Funny. I feel exactly the opposite. Static typing is false security.
I program in JS. My coworkers in Java. They have so many bugs that make it to prod because they assume that just because it compiles it must therefore be safe.
[+] [-] ajtulloch|13 years ago|reply
In the former languages, you can encode many more attributes of a program into the type system, and so you can have check at compile-time many more invariants of your program - e.g. enforcing a function does no I/O, enforcing that all possibilities are handled when pattern matching, enforcing the equivalent of nullptr checking, etc.
In languages like C++, there are techniques you can apply to allow the type system to help you out a bit (see this talk by Jordan DeLong for some examples [1]), but in general, the guarantees you get from a non-HM type system are weaker than those from one, and so the notion of successfully passing type-checking is correspondingly weaker.
[1]: http://vimeo.com/55674014
[+] [-] tikhonj|13 years ago|reply
Good type systems can catch far more bugs than you imagine. Moreover, they can actually make writing code easier: there are some extremely valuable and expressive features like typeclasses that simply cannot be reproduced in a dynamically typed language.
[+] [-] tmhedberg|13 years ago|reply
I use Ruby and JavaScript professionally. I do like Ruby for a number of reasons, and JavaScript I can at least live with. But in both languages, I constantly find myself spending tons of time tracking down bugs that would have been discovered right away if I had Haskell's type system at my disposal.
[+] [-] eropple|13 years ago|reply
Attributing your coworkers' "if it builds, it works" assumptions to static typing strikes me as incorrect. Static typing, at least in Java, ensures only a (relatively) small set of conditions are true; I don't think you can really blame that for increased/additional assumptions on the part of sub-par programmers.
[+] [-] cover_drive|13 years ago|reply
[+] [-] bsg75|13 years ago|reply
[+] [-] Flow|13 years ago|reply
[+] [-] shared4you|13 years ago|reply
[+] [-] z3phyr|13 years ago|reply
[+] [-] cover_drive|13 years ago|reply