Live data from Hacker News

Language War - Scala versus Python

blog.zlemma.com

31–40 of 52 posts

Re: Language War - Scala versus Python

#31
post #8

I haven't tried Scala but since no one has mentioned it: Clojure is a pleasure to work with if you want a functional language in JVM. I have no idea which and how many startups use Clojure, besides Datomic :) It would be interesting to know.

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

Re: Language War - Scala versus Python

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

Re: Language War - Scala versus Python

#33
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…

Nowhere in his post did tikhonj suggest that compilation == correctness, even in Haskell. Of course it isn't. The only people making that assumption are wyqueshocec's coworkers, and naturally they're getting burned as a result.

The key point is that a sufficiently expressive type system gets you far closer to correctness on the basis of type checking alone than does a weaker static system like Java's or a dynamic one like JS's. You should still write tests, you just won't have to write as many in order to reach the same degree of confidence in your code.

Re: Language War - Scala versus Python

#35
post #19

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

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

Either way, you end up keeping lots of things in your head. With dynamic langs, you do have to think about types and use them conservatively. With languages like Java -- the same. No toolset is going to work well unless the dev is on top of things and good at using the tool well.

I've found that debugging in a dynamic environment is great for managing types in a well architected system. It falls down in a poorly architected one, in ways that static typing would not ave allowed. However, in such systems, "it compiles so it must be correct," programmers just get stuck in deeper snow.

Re: Language War - Scala versus Python

#36
post #34

Did you guys consider Google Go? I really like the language and its environment after coding in it for a bit.

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

Re: Language War - Scala versus Python

#37
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

Re: Language War - Scala versus Python

#38
post #29
post #16

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

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…

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 Scheme when I was learning both simultaneously.

I certainly do not think that syntax is anywhere near why some people find Haskell hard to pick up. Thanks to pattern matching, the syntax is very visual and thanks to having relatively few forms and keywords, it's much simpler than most imperative languages'.

Also, I'm not suggesting necessarily using Haskell exclusively, by any means; I just want more people to consider it at all!

Re: Language War - Scala versus Python

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

Re: Language War - Scala versus Python

#40
post #38
post #29

Earlier quoted context omitted.

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…

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.
Post reply on HN