

Replacing Python: candidates. ATS, C#, Go, Haskell, OCaml & Rust - dbaupp
http://roscidus.com/blog/blog/2013/06/09/choosing-a-python-replacement-for-0install

======
cdoxsey
This post has some bizarre conclusions. Like this:

    
    
        My theory is, if the language designers can’t write hello world safely, what hope do the rest of us have?
    

It's not at all obvious to me that dumping your program's stdout to /dev/null
should result in an error.

    
    
        Getenv returns the empty string and continues. Then Go somehow manages to parse the empty string as an empty JSON list and still continues.
    

I don't understand this. Go's JSON methods return errors for invalid JSON. If
you want to know if something wasn't set you can test for the empty string.
There's no magic. Later he has the code:

    
    
        json.Unmarshal(json_data, &argv)
    

And you can see that he just chooses to ignore the error.

He also knocks go for its lack of shared library support. I suppose this is
controversial but this wasn't an accident.

    
    
       http://harmful.cat-v.org/software/dynamic-linking/
    

He says for Go:

    
    
       These languages cannot distinguish between values and null at compile time.
    

This is also not true.

Also I'm not sure what his performance test is testing. Just starting an empty
hello world? That doesn't seem all that useful to me.

~~~
dbaupp
> dumping your program's stdout to /dev/null should result in an error

That's not what's happening though. The invocation is:

    
    
        hello 1< /dev/null
    

i.e. stdout is read-only, and it seems reasonable that that should be an
error.

~~~
markeganfuller
This is a very strange way of 'faking' a read-only file and after testing
Python, it handles real read-only files fine

    
    
      -rw-r--r-- 1 root root  0 Jun 10 17:28 test
      python hello.py > test 
      bash: test: Permission denied
      echo $?
      1

~~~
talex5
The "Permission Denied" message you see here is from your shell, not Python.

But note the test isn't about whether you can _open_ the file successfully,
but about detecting writes to an open file failing (e.g. because the disk
becomes full during writing).

~~~
markeganfuller
His example focused on the program return code which in this case is correctly
1

------
TheAnimus
I am not sure why he tried something as subjective as code in each language,
as ultimately if you don't use each of the languages equally, you will have a
natural bias.

For instance, as someone who spends too much time in C#, his C# example is
just hideous.

Not to mention the instant judgement that the language framework is poor if
you don't get an exception. That is more the debate as to null/empty vs
exception.

------
digitalzombie
I wish Ada was in there too.

Rooting for Rust.

I was already disappointed with Go lang but this post have shown that Go can
do worst.

------
pekk
It's outright silly that C wasn't considered for this system utility project.

~~~
talex5
C would be fine for these 4 lines (so would Go, in fact). But we have another
20,000 lines we also need to convert, and C might be less good there.

