Live data from Hacker News

Language War - Scala versus Python

blog.zlemma.com

41–50 of 52 posts

Re: Language War - Scala versus Python

#41
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:

"practicality beats purity."

Re: Language War - Scala versus Python

#42

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 coul…

+django

Re: Language War - Scala versus Python

#43
post #12

> Typecheck in Python 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]. [1]: http://cython.org/ [2]: http://wiki.cython.org/tutorials/numpy

I know, it great for the speed-up. But for just making things more manageable it's not worth the added complication of build/compile. I know, my problem is actually solved by "properly written tests" :) ...for I still long for some optional drop-in static typing.

Re: Language War - Scala versus Python

#44
post #28
post #22

Earlier quoted context omitted.

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…

You are totally missing the point of the parent. Just because types work out doesn't mean the behavior of the program is correct. The problem is not how to make something compile, regardless of how complex the types are. The problem is how to do the right thing. It is not enough to return a string - you must return the correct string, and that is not normally not something a type can solve for you. I suppose you may…

"It is not enough to return a string - you must return the correct string, and that is not normally not something a type can solve for you."

It can, however, ensure that you have returned a legally-formatted email address instead of someone's first name, with proper use of the type system. You'd probably be surprised what you can do with a real type system, based on what you're saying here. It is not a proof of correctness, but there's a great deal more possible than in Java.

It of course can not ensure you returned the correct email address, but often that's a much less pressing problem, because the thing returning the address may very well have had only one address in hand to chose from, in which case it can't be wrong. There's a lot of logic like that you can deploy in Haskell, when scopes and inputs to functions are much more carefully controlled than a traditional language.

Re: Language War - Scala versus Python

#45
post #39

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. 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.or…

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).

>> because we complained at some point That's not true, and you already know that's not true.

http://news.ycombinator.com/item?id=4599431

Please stop making this pathetic accusation.

Re: Language War - Scala versus Python

#46
post #45
post #39

Earlier quoted context omitted.

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).

>> because we complained at some point That's not true, and you already know that's not true. http://news.ycombinator.com/item?id=4599431 Please stop making this pathetic accusation.

Oh, yes sorry, it was completely coincidental. It was correlated in time though.

Re: Language War - Scala versus Python

#47
post #40
post #38

Earlier quoted context omitted.

Syntax is by far the most superficial difference. If you're going to actually use functional programming, the trick will be learning the paradigm and not worrying about syntax. In fact, from that perspective, I think Haskell syntax actually wins out: it's extremely simple and very well-suited to functional programming. I found things like curried functions and recursion much easier to grasp and use in Haskell than in…

Well, I'm still not so sure. I've been doing functional programming for 20 years and I thought Haskell syntax was weird.

I find Haskell's syntax very attractive. It is the same style in which one would express domains and operations on a whiteboard.

Re: Language War - Scala versus Python

#48
post #46
post #45

Earlier quoted context omitted.

>> because we complained at some point That's not true, and you already know that's not true. http://news.ycombinator.com/item?id=4599431 Please stop making this pathetic accusation.

Oh, yes sorry, it was completely coincidental. It was correlated in time though.

>> It was correlated in time though. Post hoc ergo propter hoc is a well known fallacy.

Lest anyone forget that your repeated complaints don't withstand scrutiny -- http://news.ycombinator.com/item?id=4598737

Re: Language War - Scala versus Python

#49
post #32

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. 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.or…

Note that in each case, Python has the smallest code. Generally, but not always, this means that people can address tasks quicker in Python.

For doing anything serious in Python, you will need unit tests. In my experience, they double the amount of code.

Haskell and Scala have static typing instead (and therefore need much less unit tests).

Re: Language War - Scala versus Python

#50
post #39

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. 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.or…

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).

All benchmarks come with the implicit disclaimer:

The best benchmark is always your application. All benchmarks are flawed, use your judgement and determine how flawed a benchmark is; Any flaws are relative to your application similarity to what the benchmark tests. An imperfect tool is not a useless tool, so long as you are smart about how you use it.

This is probably relevant too: http://benchmarksgame.alioth.debian.org/dont-jump-to-conclus...

Post reply on HN