"practicality beats purity."
Language War - Scala versus Python
41–50 of 52 posts
Re: Language War - Scala versus Python
#42Python 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…
Re: Language War - Scala versus Python
#43> 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
Re: Language War - Scala versus Python
#44Earlier 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 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
#45No 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).
http://news.ycombinator.com/item?id=4599431
Please stop making this pathetic accusation.
Re: Language War - Scala versus Python
#46Earlier 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.
Re: Language War - Scala versus Python
#47Earlier 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.
Re: Language War - Scala versus Python
#48Earlier 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.
Lest anyone forget that your repeated complaints don't withstand scrutiny -- http://news.ycombinator.com/item?id=4598737
Re: Language War - Scala versus Python
#49No 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.
Haskell and Scala have static typing instead (and therefore need much less unit tests).
Re: Language War - Scala versus Python
#50No 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).
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...