6 ms·
So why not Cython like PayPal?
by denfromufa 10y ago
So why not Cython like PayPal?
- 0xCMP 10y agoYea they mentioned alternatives, but cython wasn't mentioned at all. I guess Rust makes sure there aren't any memory issues , but it's far from the only easy option. Cython is used everywhere and can be compiled on the machine it's about to be used on. It also follows best practices for talking to python via FFI.
- ngoldbaum 10y agoNot sure what you mean about cython and the FFI. As far as I know, cython is tightly coupled to the CPython C API. I agree that cython is a good option if you only care about CPython.
- 0xCMP 10y agoThat's true, it does have to be using the C API. I think I just meant there are several ways to use that API and it does the "harder way" automatically so it's more efficient.
- thesmallestcat 10y agoThat's just not true, Cython works with PyPy https://cython.readthedocs.io/en/latest/src/userguide/pypy.html https://cython.readthedocs.io/en/latest/src/userguide/pypy.h..., and it's not like you're going to target Jython with CFFI.
- ngoldbaum 10y agoCython does work with pypy, but via the cpyext emulation of the CPython C API. See this answer from one of the pypy devs when I asked about this about a year ago: https://news.ycombinator.com/item?id=10195892 https://news.ycombinator.com/item?id=10195892 Maybe cpyext has gotten faster since then, but I think that's the state of things still.
- pokpokpok 10y agoleveraging the crate ecosystem is one reason
- zeeg 10y agothis is pretty important here, given that we already have a sourcemap library we built in Rust (for our sentry-cli tool)
- smegel 10y agoI think they said they had a pre-existing source-map parser written in Rust for their CLI.
- sidlls 10y agoI'd switch it around: why Cython and not Rust, given their CLI is written in Rust? This strikes me as a perfect use case for Rust, too: it has great compile time memory and other safety guarantees with a speed that is likely close to (or perhaps even better than "safe") C or C++.
- thesmallestcat 10y agoBecause the author (Armin Ronacher) loves Rust. And because common sense is lame.
- guitarbill 10y agoThat's very disingenuous as Armin Ronacher/mitsuhiko has done so much for Python.
- thesmallestcat 10y agoDisingenuous? I'm not lying, he is publicly a Rust enthusiast. It would be no less true if I said this about Steve Klabnik regardless of his contributions to Ruby on Rails.
- jjawssd 10y agoThe hivemind hates people like you that point out the elephant in the room
- DasIch 10y agoArmin might like Rust but that doesn't mean that's why it was chosen in this case. In fact the article provides a reason: they already had a Rust library for source maps and that is a very good reason to go with Rust. More generally though you're being unfair by not even seriously considering the option that there could be a legitimate reason. Also you're simply being an insulting with your common sense comment. You are being disingenuous, for pretending this is about truth in some way and you're coming across as being an asshole by insulting people.
- thesmallestcat 10y agoHuh, I wonder who's responsible for their adoption of Rust in the first place. A real brain-teaser, this one. Anyway my point stands (and glad to see I've ruffled some feathers): Cython is the dull and maintainable choice here. Tell me which story is better for the new hire who has to work on this (David Cramer's shop is plainly a Python shop): 1) python setup.py install. Read a Cython tutorial. 2) Install the Rust toolchain and learn Rust. Hope that the language hasn't changed drastically in the past month. Hm... But I appreciate the "asshole" ad hominem.
- nerdponx 10y agoIt looks like they already had a Rust parser that they reused
- masklinn 10y agoBecause they already had Rust code to do the job (in a CLI tool), it was just a question of extracting and binding it.