News for hackers. Stuff that matters.
Re:Why people in Google hate Go? by jiripospisil on Friday November 03, 2023 @07:11AM (#38127021)
Except when you actually enjoy things being fast. For example, HTTPie easily adds 0.5-1s delay to every request because it's written in Python, especially on the first invocation. xh (https://github.com/ducaale/xh), on the other hand, starts immediately because it's written in Rust. I very much like this trend.
Re:Why people in Google hate Go? by benterix on Friday November 03, 2023 @07:36AM (#38127229)
Yeah, I agree on that. In the nineties, basically the only general purpose language was C, with C++ growing in pains (and then extending uncontrollably) and Java promising to get better but having its own issues at that time. So people who needed to get their job done (efficiently) just used C, like Torvalds.

At that time, this new Python language was a curiosity. It was nice that you could easily replace dozens of C code with one line of Python but everybody was aware it's too slow. However, this window shifted with time. The perceptions of "fast" and "slow" changed for various reasons such as network delays so Python became acceptable in many areas it would be dismissed otherwise. To the point it became the no. 1 language now.

But we are not in the 2000s anymore. We do have powerful, batteries-included languages that are faster than Python. So I expect with time, large parts will be rewritten. However, the area related to scientific computing will stay with Python, just like Fortran programs continue to be used today.

Re:Why people in Google hate Go? by jkbr on Friday November 03, 2023 @07:35AM (#38127217)
I don’t know when you last tested the start-up time, but we significantly improved it in HTTPie CLI 3.0 [0]. Now it’s still slower by ~0.1s.

    $ time http --version
    3.2.2

    real 0m0.113s
    user 0m0.087s
    sys 0m0.020s



    $ time xh --version
    xh 0.18.0
    -native-tls +rustls

    real 0m0.007s
    user 0m0.002s
    sys 0m0.002s

[0] https://httpie.io/blog/httpie-3.0.0#speed-ups
Re:Why people in Google hate Go? by jiripospisil on Friday November 03, 2023 @08:11AM (#38127537)
> Now it’s still slower by ~0.1s

Not for me. Printing HTTPie's version takes longer than to finish a real http request with xh. I suspect it's because I'm testing it on a relatively old server where the differences are even more pronounced.

https://gist.github.com/jiripospisil/d0de1355d534a19af2334de...

I'm using HTTPie 3.2.1 because Arch doesn't have the latest version available but based on the release notes that shouldn't make a difference.

Re:Why people in Google hate Go? by jkbr on Friday November 03, 2023 @09:51AM (#38128756)
Gotcha. Would you mind checking if you happen to have PyOpenSSL installed inside the Python environment HTTPie runs from?
Re:Why people in Google hate Go? by jiripospisil on Friday November 03, 2023 @10:23AM (#38129190)
I did not have it installed. Installing it did not make a difference. If it's of any help, here's a profile generated using cProfile. https://gist.github.com/jiripospisil/d492f67453d4aa8723432aa...
Re:Why people in Google hate Go? by jkbr on Friday November 03, 2023 @10:24AM (#38129228)
Thanks!
Re:Why people in Google hate Go? by amelius on Friday November 03, 2023 @08:28AM (#38127710)
Python is not a good comparison. It's improving but its runtime system is very slow compared to a modern concurrent GCed system.