4 ms·
I love how in an article about making python faster, the fastest option is to simply write Rust, lol
by LarsDu88 7mo ago
I love how in an article about making python faster, the fastest option is to simply write Rust, lol
- falcor84 7mo agoThere's no surprise that Rust is faster to run, but I don't think there are many who would claim that Rust is faster to write.
- orochimaaru 7mo agoMaybe with LLM/Code Assistance this effort reduces? Since we're mostly talking mathematics here, you have well defined algorithms that don't need to be "vibed". The codegen, hopefully, is consistent.
- LarsDu88 7mo agoI actually started this comment thread, and I just "wrote" two things using Opus 4.6 in Rust: https://panel-panic.com https://panel-panic.com https://larsdu.github.io/Dippy6502/ https://larsdu.github.io/Dippy6502/ The issue is... I barely know the language. There are vast gaps in my knowledge (e.g. lifetimes, lifetime elison, dynamic dispatch, Box, Ref, Arc, all that) Nor do I know much of anything about the 6502 microprocessor. I know even less from having the LLM one shot most of the project rather than grinding through it myself. So in the age of AI, the question of how easy it is to write with a language may be less important than the question of how we should go about reading code. Quite honestly, I don't really know why I wouldn't use Rust for a wide variety of projects with AI other than the compile/iteration time for larger projects. The compiler and static typing provide tremendously useful feedback and guardrails for LLM based programming. The use of structs and traits rather than OOP prevent a lot of long term architectural disasters by design. Deployment on the web can be done with WASM. Performance is out-of-the-box? Writing Rust by hand though? I'm still terrible at it.
- scuff3d 7mo agoGo and Java/C# (if you forgo all the OOP nonsense) aren't much harder to write than Python, and you get far better performance. Not all the way to Rust level, bur close enough for most things with far less complexity.
- LarsDu88 7mo agoAs an AI engineer I kinda wish the community had landed on Go or something in the early days. C# would also be great, although it tends to be pretty verbose. Python just has too strong network effects. In the early days it was between python and lua (anyone remember torchlua?). GoLang was very much still getting traction and in development. Theres also the strong association of golang to google, c# to microsoft, and java to oracle...
- scuff3d 7mo agoYeah that bothers me too, but it's damn hard to get away from these days. Most language projects have significant corporate involvement one way or the other. Go is criminally underrated in my opinion. It ticks so many boxes I'm surprised it hasn't seen more adoption.
- LarsDu88 7mo agoIt ticks many boxes for me on the surface, but I've read a few articles that critique some of its design choices. Rust really ticks the "it got all the design choices right" boxes, but fighting the borrow checker and understand smart pointers, lifetimes, and dispatch can be a serious cognitive handicap for me.
- scuff3d 7mo agoNo languages are perfect, they all make tradeoffs. I just like a lot of the ones Go made. Go and Rust try to solve very different problems. Rust takes on a lot of complexity to provide memory safety without a garbage collector, which is fine, but also unnecessary for a lot of problems.
- pjmlp 7mo agoThat has been a thing forever, many "Python" libraries, are actually bindings to C, C++ and Fortran. The culture of calling them "Python" is one reason why JITs are so hard to gain adoption in Python, the problem isn't the dynamism (see Smalltalk, SELF, Ruby,...), rather the culture to rewrite code in C, C++ and Fortran code and still call it Python.