4 ms·
Go may well be better for many apps than js or C++, but there are other languages out there. If you're looking for a new language it's worth considering more po
by lmm 12y ago
Go may well be better for many apps than js or C++, but there are other languages out there. If you're looking for a new language it's worth considering more possibilities, e.g. see http://roscidus.com/blog/blog/2013/06/09/choosing-a-python-replacement-for-0install/ http://roscidus.com/blog/blog/2013/06/09/choosing-a-python-r...
- est 12y agoGo has a larger and more active eco-system for today's world.
- sergiosgc 12y agoLarger than...? It's comparable to Node's, certainly smaller than JS in general, much smaller than either python's or C++'s.
- _yosefk 12y agoIncidentally, your link includes a great example of Go's error handling - which is inevitably what actually happens in languages without exceptions: errors are silenced and the program marches on, each step making less sense than the previous. It's a good talking point that you can always check error values - but it never really happens, in part because library designers try to avoid putting the burden on themselves and their users: "Getenv returns the empty string and continues. Then Go somehow manages to parse the empty string as an empty JSON list and still continues. Then it tries to interpret the first of the user arguments to the program as the path of the program to run and execs that instead! Utter failure." I happened to write about it just before Go came out here: http://yosefk.com/blog/what-makes-cover-up-preferable-to-error-handling.html http://yosefk.com/blog/what-makes-cover-up-preferable-to-err... It seems that having exceptions in the language is a great predictor for libraries/built-ins barfing upon bad input vs silently producing garbage (as in JS's "undefined" string produced from undefined values and propagated, or Go's behavior above, etc.) For instance Lisp's NTH produces garbage and it predates Lisp's exception handling features whereas AREF was added later and indeed complains loudly, etc.
- enneff 12y agoThe hundreds of high quality Go packages that do handle errors are an existence proof against your argument. Look at nearly anything on godoc.org. You didn't cite that quote. I am certain whoever said it is doing something silly.
- _yosefk 12y agoI did cite it - it's from my parent comment's link: http://roscidus.com/blog/blog/2013/06/09/choosing-a-python-replacement-for-0install/ http://roscidus.com/blog/blog/2013/06/09/choosing-a-python-r... Are you saying that: * Getenv doesn't return an empty string for a non-existent env var? * Go JSON parser doesn't return an empty list given an empty string? That you can handle errors without exceptions needn't have an existence proof... The question is how many errors are silenced. Stats will be hard to come by. But getenv and JSON parsing are pretty basic functionality and in most languages with exceptions they would not silence errors. (say, Python's json.loads barfs and os.getenv returns None which unlike the empty string will almost certainly lead to an exception if the code won't account for None). So it's a good anecdote in the absence of hard data.
- bsdetector 12y agoAnd here I thought you were talking about the first example in the blog: fmt.Println("Hello, world") Now what happens when program opens a file and is run without stdout: ./program >&- The file it opens is fd 1 and the program prints to the file instead of printing to the console. An odd case that has caused security holes in the past. In languages that fail on errors if they print anything before opening the file then they don't corrupt the file. The default and laziest case for errors should never be to just hide them and continue on.
- tuxychandru 12y agoJSON parser does return an error on empty string. http://play.golang.org/p/DE0soRRRBp http://play.golang.org/p/DE0soRRRBp
- dom96 12y agoThis blog post misses a very good Python replacement, namely Nimrod (http://nimrod-lang.org http://nimrod-lang.org).
- collyw 12y agoWith the exception of speed, why does Python need a replacement? I am using Python daily, and pretty much all performance problems (with my work) can be solved at the database or caching level. I get the impression that Numpy can produce reasonable performance for numeric problems. In my experience developer productivity is of far more importance to business than language performance (obviously that depends on your domain). I do get asked to speed things up. But I get asked for "something working" by yesterday far more often.
- lmm 12y agoThe blog post gives the rationale; it's a combination of performance, a hope that static typing would make it possible to avoid a class of errors 0install had been experiencing, and wanting to ship native binaries with no dependencies - a pretty specialized use case, but one that 0install happens to need. (I'm aware that things like freeze exist, but they're not really first-class citizens, and the startup time - very important for a command-line utility - is not great). In general I agree with you, I was a big fan of Python until I discovered Scala. But it's not a great fit for the 0install use case, and as you'll see from subsequent posts, switching to OCaml turned out to increase reliability and performance without sacrificing concision or development productivity.
- mercurial 12y ago> With the exception of speed, why does Python need a replacement? Depends what you use it for. It's very good for a subcategory of problems, in particular prototypes or glue code. However, it leads to "use your test suite as a compiler" for large scale projects due its lack of static typing.
- Dewie 12y ago> In my experience developer productivity is of far more importance to business than language performance You seem to be assuming that Nimrod would necessarily be less productive to work with than Python?