4 ms·
No. Because static typing. However much Go's type system might lack some means of expression, the type system is there, and it prevents many bugs that can easi
by nine_k 12y ago
No. Because static typing.
However much Go's type system might lack some means of expression, the type system is there, and it prevents many bugs that can easily crop up while using a dynamic language.
I'd rather say 'use OCaml' or 'use F#' or even 'use Haskell'.
- wtetzner 12y agoOr 'use Typed Racket'.
- nine_k 12y agoUnfortunately, the article in question did not mention words 'typed' or 'static' at all. I didn't know about Typed Racket; I suppose it might be a kind of gradual / optional typing somehow simila to what Clojure has.
- michaelsbradley 12y agoClojure's gradual typing system is heavily inspired by Typed Racket, which preceded it. https://twitter.com/ambrosebs/status/262387983339098113 https://twitter.com/ambrosebs/status/262387983339098113 For more information, see Ambrose Bonnaire-Sergeant' dissertation: A Practical Optional Type System for Clojure https://cloud.github.com/downloads/frenchy64/papers/ambrose-honours.pdf https://cloud.github.com/downloads/frenchy64/papers/ambrose-...
- rdtsc 12y agoOr Clojure or Erlang. Funny enough out of "functional" languages those have probably just as much (or even more) been used to develop distributed, fault tolerant systems than F# or Haskell. Just saying. BTW both Clojure and Erlang allow a form a gradual typing. From personal experience. I've used both static (C#, C++, Java) and dynamic typing (Python, Erlang), and have to say, the prevents-many-bugs excuse as the main problem with dynamic types just wasn't true. Maybe my code is more complicated and dealing with distributed state, consistency, and protocols but what what kills everything is usually logic errors, network failures, files not being there, misconfiguration, segfaults, user-after-free, and the most evil ones, shared global states in a concurrent shared-heap environment. Things like "oh I expected an int but got a string" are pretty trivial and easy discovered. Moreover, in a recent service I implemented. I did in Python and I believe the faster development time and less code to write in general, gave me time to write better integration tests that exercises and covered the code a lot better. I would have had to write the tests anyway, even if this was written in Haskell. Perhaps static typing helps a lot more in large code bases. Think of a large game, or a CAD application or some huge C++ back-end. But, if you buying into the whole micro-services fad, well, you shouldn't have large code bases if you can help it. Another big motivation for types, which I think most people have in mind when they pick a strongly typed language is performance. Usually static typing and a very large performance increase would go hand in hand. Now with the effort put into v8 and PyPy we see that gap getting smaller.
- lomnakkus 12y ago> Or Clojure or Erlang. Funny enough out of "functional" languages those have probably just as much (or even more) been used to develop distributed, fault tolerant systems than F# or Haskell. Just saying. (I generally agree with the gist of your comment, I think. This just stuck out.) I don't believe Clojure belongs in that class (as "proven" for writing reliable software), but whatever. If you want truly reliable software and have the budget, then you just need to throw process at the problem -- it doesn't matter much which language you use. Several (if not all) the Mars landers were programmed in C -- with very few critical flaws experienced/discovered[2]. The Ericsson switches that achieved previously-unheard-of reliability were programmed in Erlang, but they used process and a huge number of engineers to achieve that. (Plus they're mostly stateless and so can just reset if they do it fast enough and don't lose important state when doing so.) For large-scale software which has to evolve fast, I belive strong type systems do win out. It's not so much that they prevent bugs which could be caught by test suites, but having a strong type system means that you can be certain that there are a lot of tests that you actually will never have to write or, more importantly, rewrite as the system evolves. There have been actual studies which may be of interest[1], but even if I'm on the "winning" side, I don't think I would put too much stock in the methodology/analysis of this particular study. (E.g. concluding that JavaScript suffers from few concurrency bugs relative to other languages is kind of being oblivious of the fact that JS is single-threaded (semantically) and that all the other languages in the comparison permit "real" concurrency/parallellism, and that it should thus perhaps be excluded from the category or at least treated separately.) [1] http://macbeth.cs.ucdavis.edu/lang_study.pdf http://macbeth.cs.ucdavis.edu/lang_study.pdf [2] https://www.usenix.org/conference/hotdep12/workshop-program/presentation/holzmann https://www.usenix.org/conference/hotdep12/workshop-program/... (Sorry, references out of order because edited-post-facto)
- sheepmullet 12y agoIn the study you linked to Clojure code is basically as bug free as Haskell and Scala code and Erlang code isn't far behind.
- 12y ago