Hacker News new | ask | show | jobs
by hellofunk 3187 days ago
Why is that hard to believe? Static typing always add some code size, even in languages with inference.

On top of that, the pervasive use of macros in lisp tend to lead to a kind of code-reuse that languages without macros lack.

Not to say that Haskell can't be concise also, just not to the same degree. And I've seen very long lines in Scala that were due to pleasing the compiler's typing.

Elm and Clojurescript offer a good contrast. Elm is written in Haskell and is not too unlike Haskell syntax and general language use. I've written in both Elm and Clojurescript and there is nearly a 2X difference in code size of Elm over Clojurescript for accomplishing similar non-trivial tasks.

Code size isn't everything, but it is important.

If you still find it that hard to believe, just try Clojure for awhile, and I think it will be clear. It's a tradeoff. When you don't have to satisfy a type checker for everything, you do write less code, that's just a matter of fact most of the time.

The question is whether the increased code size of a statically-type language over a lisp makes up for the extra developer resources and potential for bloat-related bugs. But that is of course the core of the typing debate.

1 comments

Elm is nowhere near Haskell or Scala in expressibility. You would have to compare Purescript/GHCJS/ScalaJS. In the native Haskell/Scala land I usually don't have to do much ceremony and the functional code is succinct and a pleasure to write. They may lack the all powerful macros of LISPs but the need to reach for a macro seldom arises.

The original point wasn't about code size it was about bugs and I was surprised to see Clojure doing better than the very strongly typed ones. Hence the comment on the smartness of Clojure people ;)

I will agree that there are a lot of really smart people in the Clojure community, but that is also true in other communities. Some of the most brilliant developers I know are hard-core C++ guys.

The original point about bugs is in my opinion, regarding my comment you replied to, very similar to a discussion about code size. There are some great reads [0] that go into further depth on this issue, if you are curious.

[0] https://github.com/papers-we-love/papers-we-love/blob/master...