wiseowise
4 days ago
Recent resurgence of tools going native is really interesting. For years (at least last decade) I've heard mantra that JIT/interpreters are getting so good that you don't need to bother with native languages anymore, clients can be written in Python/Ruby, because it's a one-off operation anyway, etc., etc.
And now everyone is rewriting everything in Go/Rust left and right.
cameronh90
3 days ago
It really comes down to the Go and Rust ecosystems being easy to work with. A decade or two ago, writing a native app meant setting up an automake/autoconf Rube Goldberg machine - especially difficult if you needed to build for multiple architectures.
I'd argue Rust and Go are even easier to work with than Python/JS/TS. The package management is better, and static linked native binaries eliminate so many deployment headaches.
pjmlp
3 days ago
As someone educated in the likes of BASIC and Z80, it isn't as if it was really that complicated, versus the willigness to learn.
Sometimes people really need to follow Yoda and Mr Miyagi advices, instead of jumping right into it.
cameronh90
3 days ago
It is complicated, though. Not as complicated as quantum physics, but still far more complicated than it needs to be - especially if you care about multiple architectures and platforms. At one point I was making builds for X86, AMD64 and Itanium on Windows, MacOS, Linux (which itself was subdivided into various distributions with different glibc/openssl/whatever versions). It took more work maintaining the build pipeline than working on features.
Go and Rust prove you can get most of the benefit of C/C++ without paying that complexity cost.
pjmlp
3 days ago
Well, Modula-2 and Object Pascal already proved that quite a time ago, but they didn't come with curly brackets, nor UNIX.
jvanderbot
3 days ago
Both can be true. It can be easy to learn and also a complete pain to set up and get right for every new project and menu of architectures you want to support.
fragmede
3 days ago
cross compiling to Mac from Linux, cross-architecture used to be an impossible bitbake adventure to go on. in go, it's just two env vars!
metaltyphoon
3 days ago
With a big footnote: Until you need CGO
supriyo-biswas
3 days ago
Having recently done some investigation along the same lines for a side project that I did not continue to work on: is it not just a matter of passing CGO_LDFLAGS=—static and building on musl?
saagarjha
3 days ago
I don't think you can do this when targeting macOS
metaltyphoon
3 days ago
or FreeBSD
steveklabnik
3 days ago
To say what your siblings said, but more generally: basically this only works for Linux. Other OSes generally don't let you do this, you must have some degree of dynamic linking.
Go used to try and let you do it, but has walked back those implementations after all the bugs they've caused, in my understanding.
fragmede
3 days ago
fair.
diggan
4 days ago
> And now everyone is rewriting everything in Go/Rust left and right.
Especially interesting for software that are 99.9% of the time waiting for inference to come back to you. Sure, makes sense to rewrite something that is heavily relying on the CPU, or where you want an easier time to deal with concurrency, but I feel like that's not what makes Codex takes long time to finish a prompt.
With that said, I also rewrote my local LLM agent software to Rust, as it's easier to deal with concurrency compared to my initial Python prototype. That it compiles into a neat binary is an additional benefit, but could have as easily gone with Go instead of Rust.
gwynforthewyn
4 days ago
> Especially interesting for software that are 99.9% of the time waiting for inference to come back to you.
In a different domain, I’ve seen a cli tool that requests an oauth token in Python be rewritten to rust and have a huge performance boost. The rust version had requested a token and presented it back to the app in a few milliseconds, but it took Python about five seconds just to load the modules the oauth vendor recommends.
That’s a huge performance boost, never mind how much simpler it is to distribute a compiled binary.
rybosome
3 days ago
I’ve spent some time optimizing Python performance in a web app and CLI, and yeah it absolutely sucks.
Module import cost is enormous, and while you can do lots of cute tricks to defer it from startup time in a long-running app because Python is highly dynamic, for one-time CLI operations that don’t run a daemon or something there’s just nothing you can do.
I really enjoy Python as a language and an ecosystem, and feel it very much has its place…which is absolutely not anywhere that performance matters.
EDIT: and there’s a viable alternative. Python is the ML language.
emporas
4 days ago
Python's startup cost is terrible. Same with Node. Go is very good, but Rust is excellent.
Even if a GC'ed language like Go is very fast at allocating/deallocating memory, Rust has no need to allocate/deallocate some amount of memory in the first place. The programmer gives the compiler the tools to optimize memory management, and machines are better at optimizing memory than humans. (Some kinds of optimizations anyway.)
nasretdinov
3 days ago
TBH I'm still surprised how quickly Go programs start up given how much stuff is there in init() functions even in the standard library (e.g. unicode tables, etc)
teaearlgraycold
4 days ago
Packaging Python apps is pure hell. npm gets a lot of shit, but Python deserves as much if not more.
dayjah
4 days ago
I know far too much about python packaging while only knowing a little about it.
I agree it’s hell. But I’ve not found many comprehensive packaging solutions that aren’t gnarly in some way.
IMHO the Python Packaging community have done an excellent job of producing tools to make packaging easy for folks, especially if you’re using GitHub actions. Check out: https://github.com/pypa/cibuildwheel
Pypa have an extensive list of GitHub actions for various use cases.
I think most of us end up in the “pure hell” because we read the docs on how to build a package instead of using the tools the experts created to hide the chaos. A bit like building a deb by hand is a lot harder than using the tools which do it for you.
teaearlgraycold
4 days ago
That’s fair. I’m also thinking about the sheer size of Python apps that make use of the GPU. I have to imagine a C++ app performing neural network shenanigans would’t be >1GB before downloading weights.
QuadmasterXLII
3 days ago
I’ve tried, it is still gigabytes, unless you try to dynamically link to user installed CUDA libraries from c++. Which I don’t recommend.
teaearlgraycold
3 days ago
Oof
crabmusket
4 days ago
Speaking of which, I didn't realise Node had a built in packaging feature to turn scripts into a single executable:
bxdhxhxh
3 days ago
I was not aware of that feature either, thanks for the heads up
In my opinion, bundling the application Payload would be sufficient for interpreted languages like python and JavaScript
dweekly
4 days ago
Everything follows a cycle. Client/server, flat/skeuomorphic, compiled/interpreted, cloud/colo, colorful/minimalist, microservices/monolithic, standards-driven/vendor-driven, open/proprietary, CPU/xPU. There is a natural tension in the technical universe that pushes progress in one direction that loads the spring in the other direction. Over time you'll see the cycles rhyme.
BrouteMinou
4 days ago
I can't wait for the "rewritten in Rust" era to end!
apwell23
4 days ago
crazy how fast "rewritten in Go" ended . now suddenly all those native go projects are uncool again.
jeremyloy_wt
3 days ago
The official Typescript compiler is being rewritten in Go as we speak.
apwell23
3 days ago
ah intersting
"The existing code base makes certain assumptions -- specifically, it assumes that there is automatic garbage collection -- and that pretty much limited our choices."
tonyhart7
4 days ago
wait until Zig(and ecosystem) got mature first
this is next Trends
mbb70
4 days ago
Feels like the big shift is Rust hitting critical mass mindshare and LLM assisted translation making these rewrites viable. Rust is a very vibable language.
An announcement of Codex CLI being rewritten in C++ would be met with confusion and derision.
energy123
4 days ago
> Rust is a very vibable language.
Why would you say this for Rust in particular?
falcor84
4 days ago
Once a Rust program finally compiles it's much likelier that it's correct, in comparison to other languages, at least in the sense of avoiding unexpected runtime behavior.
csomar
3 days ago
If you properly structure your types and document them well, you can speed run lots of code generation.
wrsh07
4 days ago
Good error messages which are great for humans but also great for LLMs that are trying to debug their initial attempt
energy123
4 days ago
What about this which says the opposite:
koakuma-chan
4 days ago
The comment you replied to is talking about Rust compiler's errors.
The comment you linked is talking about unspecified application's runtime errors.
ralusek
4 days ago
Speaking for myself: one reason would be because it's one of the things LLMs/tools like Codex are the most useful for.
When I have a smallish application, with tests, written in one language, letting an LLM convert those files into another language is the single task I'm most comfortable handing over almost entirely. Especially when I review the tests and all tests in the new language are passing.
lmm
3 days ago
I suspect it's accidents of history that those are "native". Go's advantage is in its Google backing, and Rust is just a good language design that's managed to hit on the right kind of community. As far as I can see all the reasons that native was unnecessary are still valid.
pjmlp
4 days ago
And then they ship an Electron based GUI on top.
Note that most of these rewrites wouldn't be needed if the JIT language would be Java, C#, Common Lisp, Dart, Scheme, Raket.
And all of that list also have AOT compilers, and JIT cache tooling.
NitpickLawyer
3 days ago
> And then they ship an Electron based GUI on top.
If this catches on, and more tools get the "chatgpt, translate this into rust, make it go brrr" treatment, hopefully someone puts in the time & money to take tauri that extra 10-20% left to make it an universal electron replacement. Tauri is great, but still has some pain points here and there.
h1fra
3 days ago
For cli I'm sure the biggest drawback of node is the lack of portability and very large footprint of the "executables".
gschier
4 days ago
You really notice the startup delay with a large CLI written in something like NodeJS. Going from >100ms to ~0ms is a huge QoL improvement.
rane
3 days ago
It largely depends on how often you have to run the command.
miki123211
3 days ago
CLIs are different than other software, as they're launched and killed often.
amazingamazing
2 days ago
> And now everyone is rewriting everything in Go/Rust left and right.
Seems like confirmation bias.
CSMastermind
3 days ago
If only we could shift off of React Native as well.