Live data from Hacker News

On Learning Rust and Go: Migrating Away from Python

blog.liw.fi

331–340 of 346 posts

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

#331
post #147

Earlier quoted context omitted.

Maybe I'm picking nits, but the author is comparing programming experiences in each of those languages, which is perfectly valid. For example, last year I was part of a team that rewrote a very large Node.js program (several hundred thousand lines of code) in Go. The differences in following control flow and in the edit-build-test loop are like night and day. We've found Go meets our needs better than Node.js for wri…

Interesting. What are some the benefits you felt with Go in comparison to Node.js? We already have a largish (couple hundred thousand line) Node.js app written in Typescript and are looking towards other alternatives for the future product as I am not very happy with the quality of Node.js ecosystem.

Sorry for the late reply. There are a few advantages to go.

1. we don't force our customers to lay down a large Node.js blob just to run our software.

2. The old code was written for an old version of Node.js, v4.x, I believe. As such, it was full of code suffering from callback hell, and a lot of anonymous functions written inline. It was very difficult to reason about when tracking down bugs. I'm sure your Typescript code is far better organized.

3. The edit-compile-test loop is far faster. It takes less than a minute (20-50 seconds) to compile the new codebase, which is a mix of Go and C apps and libraries. The developers use a simple build script to rebuild everything from scratch. The old codebase, a mix of Javascript and C apps and libraries, was built with CMake to manage dependencies. Each rebuild would complete in a few minutes for small changes, but could take about 10 minutes if the "right" code was touched.

4. Like theshrike79, I find Go's concurrency patterns, channels, and goroutines a delight to use.

5. We use json files for configuration. Go has a simple scheme for converting between json and structs. Node.js allowed us to make poorly structured json files. When we converted them to follow some simple nesting patterns of structs within structs, converting between structs in memory and json files was just too easy!

It seems that the new codebase is significantly smaller, so it's easier to find where things are implemented. Part of that is getting rid of tech debt and being very familiar with the new code.

When we were still in beta, we ran some performance tests. They indicated the new code was as performant as the old node code (which has been worked on for years). We expect to be able to improve on that as we have time.

I hope that helps. It's been a major amount of work to rewrite our apps while maintaining the old code base - not something to do on a whim. I know the dev team is delighted with the results. Good luck.

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

#332

Earlier quoted context omitted.

Benchmarks are meaningless. I know from experience at looking at the generated assembler code and intel Fortran's SIMD code that it's faster. Take a look at the generated code and then we can discuss it, but not before. I'm not going to beat myself in C when I calculate a 100 million by 100 million matrix in Fortran. ifort will generate SIMD code with CPU autodetection and use machine code seqencing best for that pro…

> Benchmarks are meaningless. Random anecdotes are meaningless. I've looked at plenty of generated code, and I've written plenty of SIMD assembly too. If you can't measure it, you can't compare it or improve it. There's nothing to discuss.

So if you looked at it, where are the assembler listings to compare? Let me see, I want to see too!

If there is nothing to discuss and you plain refuse to do what I told you, why reply? Until you do exactly what I told you, there is nothing to see here. I have zero tolerance for people who won't listen. Move along, move along.

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

#333

Earlier quoted context omitted.

Slow compilation speed is never a problem, I doubt anyone besides you cares about it. What is important is whether it generates fast code. Taking a long time to compile is fine if I get very fast code. I'm not going to be compiling code anywhere near as many times as I'm going to be running it.

You really think it's just me? Take care.

I do. Computers for most people are tools to perform final work faster, not a purpose unto itself which is all about programmer's convenience. A programmer's job is to be as uncomfortable and to suffer as much as possible so that the users could suffer as little as possible or not at all. This "developer convenience" attitude should be reproached or even financially penalized, so that such prima donnas finally come down to earth and start taking responsibility for their (shitty) software.

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

#334

Earlier quoted context omitted.

You're working from old information. Show me a benchmark where Fortran wins over C or C++ any more. Those days are gone. Here's my line in the sand: https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/fortran.html As for GPUs, no contest.

Benchmarks are meaningless. I know from experience at looking at the generated assembler code and intel Fortran's SIMD code that it's faster. Take a look at the generated code and then we can discuss it, but not before. I'm not going to beat myself in C when I calculate a 100 million by 100 million matrix in Fortran. ifort will generate SIMD code with CPU autodetection and use machine code seqencing best for that pro…

If you can contribute better Fortran programs for those Intel Fortran measurements, please do.

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

https://salsa.debian.org/benchmarksgame-team/benchmarksgame/...

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

#335

Earlier quoted context omitted.

> Benchmarks are meaningless. Random anecdotes are meaningless. I've looked at plenty of generated code, and I've written plenty of SIMD assembly too. If you can't measure it, you can't compare it or improve it. There's nothing to discuss.

So if you looked at it, where are the assembler listings to compare? Let me see, I want to see too! If there is nothing to discuss and you plain refuse to do what I told you, why reply? Until you do exactly what I told you, there is nothing to see here. I have zero tolerance for people who won't listen. Move along, move along.

It's very weird you have the presentation of an impudent 20 year old but you share an irrational preference for Fortran, which is something I'm only used to seeing in people who are past their mid 50s.

"Move along"? You're very full of yourself, and I think that explains why you aren't as smart as you think you are.

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

#336

Earlier quoted context omitted.

You really think it's just me? Take care.

I do. Computers for most people are tools to perform final work faster, not a purpose unto itself which is all about programmer's convenience. A programmer's job is to be as uncomfortable and to suffer as much as possible so that the users could suffer as little as possible or not at all. This "developer convenience" attitude should be reproached or even financially penalized, so that such prima donnas finally come d…

Compilers don't have to be slow to generate good code (at least not as slow as Rust). If you prefer them slow, you're just choosing to be ineffective like some idiotic martyr. Suffering for it's own sake is just stupid.

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

#337

Earlier quoted context omitted.

I do. Computers for most people are tools to perform final work faster, not a purpose unto itself which is all about programmer's convenience. A programmer's job is to be as uncomfortable and to suffer as much as possible so that the users could suffer as little as possible or not at all. This "developer convenience" attitude should be reproached or even financially penalized, so that such prima donnas finally come d…

Compilers don't have to be slow to generate good code (at least not as slow as Rust). If you prefer them slow, you're just choosing to be ineffective like some idiotic martyr. Suffering for it's own sake is just stupid.

I don't care about that, could not care less: I just do make -j 96 and go do something else. The only thing that matters is very fast code. Back-end optimizers cost CPU cycles, there's no way around that. Expecting fast compilation times when iropt and lto have to do their thing is incredibly naive. How can anyone in this day and age be so naive?

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

#338

Earlier quoted context omitted.

So if you looked at it, where are the assembler listings to compare? Let me see, I want to see too! If there is nothing to discuss and you plain refuse to do what I told you, why reply? Until you do exactly what I told you, there is nothing to see here. I have zero tolerance for people who won't listen. Move along, move along.

It's very weird you have the presentation of an impudent 20 year old but you share an irrational preference for Fortran, which is something I'm only used to seeing in people who are past their mid 50s. "Move along"? You're very full of yourself, and I think that explains why you aren't as smart as you think you are.

What you are or aren't used to seeing is about relevant to me as the last year's snow. You're free to think whatever the hell you want, that being a basic human right. Move along now, nothing to see here.

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

#339
post #334

Earlier quoted context omitted.

Benchmarks are meaningless. I know from experience at looking at the generated assembler code and intel Fortran's SIMD code that it's faster. Take a look at the generated code and then we can discuss it, but not before. I'm not going to beat myself in C when I calculate a 100 million by 100 million matrix in Fortran. ifort will generate SIMD code with CPU autodetection and use machine code seqencing best for that pro…

If you can contribute better Fortran programs for those Intel Fortran measurements, please do. https://benchmarksgame-team.pages.debian.net/benchmarksgame/... https://salsa.debian.org/benchmarksgame-team/benchmarksgame/...

And who will compensate me for my free time spent on that and at which rate per hour in USD?

Where and to whom do I send the bill?

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

#340
post #101

Earlier quoted context omitted.

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.

Shell scripts depend on what is in /sbin and /usr/bin, so software which comes with the OS. If you are struggling with that, then I warmly recommend the "Learning the UNIX operating system" book from O'Reilly to get the basics down. Your argument makes no sense.

You seem to be assuming that Unix like utilities have the same options and work the same way everywhere. They don't.

Shell portability issues are a thing. Also, why all the snark?

Post reply on HN