Live data from Hacker News

On Learning Rust and Go: Migrating Away from Python

blog.liw.fi

101–110 of 346 posts

Re: On Learning Rust and Go: Migrating Away from Python

#101
post #76

I'm going to have a go with Rust and Go too, but for different reasons. IMO Python is still the best language to go with when you are writing anything "scripty": - Stuff that's not expected to be long. Do one thing well, let some other program do another, compose the higher order functions from functions that work. Of course this isn't always possible. - Stuff where the types are not going to confuse you. Often you j…

There is one and only one language that's both correct and the best tool for scripting: Bourne or its superset the Korn shell (not even bash).

Because shell scripts usually have lots of dependencies on external tools, it's harder to make them portable. Those external utilities have different behavior on different platforms. I have much better luck with Python, Perl, etc, for scripts.

Re: On Learning Rust and Go: Migrating Away from Python

#102
post #30

> Note that I've not written any significant code in either language, so I'm just writing based on what I've learnt by reading. So he’s basically comparing 20+ years of Python usage with marketing material from Go and Rust. Right. I wish people could be honest with their motivations, instead of making up excuses to justify this sort of change. Here it’s a classic case of “I got bored and I don’t like the new features…

You don't need to convince anyone, including yourself, that python's well-known limitations couldn't possibly have inspired this guy to look at other languages.

[deleted]

Re: On Learning Rust and Go: Migrating Away from Python

#103

> Rust is developed by a community, and was started by Mozilla. Go development seems to be de facto controlled by Google, who originated the language. I'd rather bet my non-work future on a language that isn't controlled by a huge corporation, especially one of the main players in today's surveillance economy. Anyone else agree with this view ? Programming languages should be choosen based on technical merits, rather…

Oracle and Java

Re: On Learning Rust and Go: Migrating Away from Python

#104
post #46

Earlier quoted context omitted.

You’re flip flopping all over the place with your descriptions of tests. Broadly speaking, There are two types of tests being discussed here. Those are positive tests and negative tests. Positive being that the code does what you expect under normal operation. Those you’d obviously need in any language Negative tests are, amongst other things, checking that your functions behave correctly when you put garbage in. If…

>You’re flip flopping all over the place with your descriptions of tests. The straw man of my argument living in your head flip flopped. I did no such thing. When I said "basic tests" I meant demonstrate the behavior under normal circumstances". If you're doing TDD on 60% of your code base you'll write enough of these. >Negative tests are, amongst other things, checking that your functions behave correctly when you p…

I have no problems with exception per se but what you’ve now done is push your error checking into the runtime which means your application could crash at unexpected times. This might be fine for your typical use cases but it is a terrible way to go about building software if you’re writing headless services.

The point of functional tests is they catch developer errors before your codebase hits production. Which you cannot guarantee if your error checking is only in the runtime.

Disclaimer: I write services used by millions of people (literally) each day. Some of those services are written in Python.

Re: On Learning Rust and Go: Migrating Away from Python

#105

> Rust is developed by a community, and was started by Mozilla. Go development seems to be de facto controlled by Google, who originated the language. I'd rather bet my non-work future on a language that isn't controlled by a huge corporation, especially one of the main players in today's surveillance economy. Anyone else agree with this view ? Programming languages should be choosen based on technical merits, rather…

I'd say, all things being equal, yes, choose languages on tech merit or suitability to task. But look at what's happening with Java and Oracle's handling of it. I think the Google vs Oracle lawsuit is still going through appeal. Ask Google if they wish in hindsight they'd built Android on something else.

Not saying you’re wrong, but Google re-implemented Java for Android, which is quite different from using Java alone.

So it’s not a completely fair comparison.

Re: On Learning Rust and Go: Migrating Away from Python

#106
Thanks for The writeup, I am going through a similar process. I just retired last Friday (I am an old guy) from managing a machine learning team and everything was done in Python.

For personal projects (and past consulting work) I have been loving Lisp languages since the 1980s but many languages have so many of the benefits of Lisp (thinking of Haskell and Julia) and there is definitely a ‘lisp tax’ on deploying and shipping products.

Anyway, for writing new books, writing open source projects, and perhaps some consulting, I would like to cut back to a single language, instead of the 4 or 5 I use now.

EDIT: I did some Go Lang codelabs when I worked at Google and have played with Rust (principally spending some evenings with an open source blockchain project) and neither language will be my home base language.

Re: On Learning Rust and Go: Migrating Away from Python

#107
post #26

Earlier quoted context omitted.

Mypy and type hints does catch that.

Sure. There are additional tooling you can use in Rust and Go to catch a plethora of errors beyond what I described too. However if they require the user run them manually then they’re just as open to user error as the testing I also described. This is why having those checks in the compiler itself can be invaluable.

Running a static analyzer is just another case to add to the test suite. So...you add them to your build system and Bob's your uncle.

Re: On Learning Rust and Go: Migrating Away from Python

#108
I have reverse experience I've used pretty much everything under the sun, but never really taken Python seriously just had to do a project in Python @ work and it was such a pleasant experience so my current mindset Python + Cython for most projects unless things are really perfomance sensitive than Rust.

Re: On Learning Rust and Go: Migrating Away from Python

#109

Thanks for The writeup, I am going through a similar process. I just retired last Friday (I am an old guy) from managing a machine learning team and everything was done in Python. For personal projects (and past consulting work) I have been loving Lisp languages since the 1980s but many languages have so many of the benefits of Lisp (thinking of Haskell and Julia) and there is definitely a ‘lisp tax’ on deploying and…

Congrats on your retirement!

And enjoy your opportunity to work with whatever languages you like. The variety of tools available today is so much greater than it was in the 80s.

Re: On Learning Rust and Go: Migrating Away from Python

#110
post #66
post #59

Earlier quoted context omitted.

Yet the entire data science world is built on Python. I don't understand this blatant disregard of reality.

Wrong: the data science world is built on R, which was designed from the ground up to be the freeware alternative to SAS and Mathematica.

Oddly in biology I’m seeing an uptick in R use as it’s easier to install and run tools in R for non programmers. The python 2/3 confusion (why doesn’t this google result work?), and various install packages (conda/pip...) seem to have made R more popular. This is despite biopython which is quite good. The newest single sell rna seq analysis tools are in R.

R is a strang thing to me, though it has its moments (graphing). I still think pandas which gives python R like data frames is one of the great tools out there.

Post reply on HN