3 ms·
Why not python ?
by revskill 1y ago
Why not python ?
- linguae 1y agoI’m not the OP, but static types, Hindley-Milner type inference, algebraic data types, and pattern matching can be quite ergonomic. I have also come to appreciate functional programming and how it makes reasoning about and testing code easier.
- rizky05 1y ago[dead]
- kqr 1y agoYeah, just last week I updated the numeric precision of a value across an entire user journey in a big enterprise application, spanning many functions and data types. Thanks to Haskell, I could do it in a day. In any other language I've used (barring maybe Ada) that is a refactoring that would take at least days, if not weeks, to manually track down all the places it interacts with the system directly or indirectly, because mixing e.g. int with long long is not a type error. In Haskell, I change the type and the compiler spits out a list of locations that needs to change. This is repeated for a few iterations until all transitive interactions are worked out. Done!
- xboxnolifes 1y agoThey really aren't anything alike at all.
- tasuki 1y agoNo one wants to be a python programmer. It's a practical language to get things done. It isn't a language to make you feel proud of yourself nor about the current state of our industry.
- Philpax 1y agoThe concept of "the Pythonic Way" indicates to me that there are people who are proud of being Python programmers. May God have mercy on their souls.
- revskill 1y agoCould u be more specific ?
- sgarland 1y agoI’ve enjoyed making it go faster by finding quirks, but at this point it’s mostly become “OK, what else can I offload to C?” I should really learn Rust. Or Zig. I tried Nim (best of both worlds, Python-esque code that compiles to C!), but it wasn’t nearly as fast as my Python + C for my specific use case.
- knighthack 1y agoWhat exactly do you write, where your Python+C is faster than Nim which compiles to optimized C?
- sgarland 1y agoGenerating millions of rows of synthetic data for testing RDBMS. Tbf, I didn't spend much time trying to optimize the Nim code once I got a working PoC, so it's entirely possible that I could've made it faster.
- cb321 1y agoYou may no longer be interested in this kind of thing, but if you are there might be some ideas of note over at https://github.com/c-blake/nio/blob/main/db-bench.md https://github.com/c-blake/nio/blob/main/db-bench.md (in particular the demo/gbyGen.nim program).
- butterisgood 1y agoCan’t stand Python. Have to use Python. Wish it would DIAF to be honest.