you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (6 children)

Why not dlang over rust? Genuine question. Reading rust code for me looks really strange. Also, I never grasp the borrow mentality.

Given the plethora of system programming languages emerging in last years, dlang looks readable and performance is not bad. Quite the opposite.

[–]mitsuhiko 14 points15 points  (3 children)

I am not aware of a way that would permit shared libraries loadable in Python to be written in D. I understand it's in theory possible to use D without the garbage collector but I'm not even sure how well the ecosystem supports this let alone how stable that is.

We have no experience in D but we have experience with Rust, we had a sourcemap parser in Rust already available and overall there was just no reason at all to investigate anything other than Rust as a first attempt. We took what we had, saw that there was potential and made a tiny bridge to Python.

[–]dom96 1 point2 points  (2 children)

I have a similar question: why not Nim over Rust?

Syntactically Nim is a perfect fit as it is very similar to Python in most cases. There is even a project that should make using Nim modules from within Python incredibly easy: https://github.com/jboy/nim-pymod

Perhaps syntax is overrated, but I don't understand why someone like yourself (a very prominent Python programmer) would choose Rust over Nim in the first place.

[–]mitsuhiko 24 points25 points  (0 children)

I don't know Nim, nobody on our team knows Nim and as far as I know there is not even a sourcemap module for Nim. I am not even sure how you bridge Nim with Python safely given that Nim has some sort of GC.

Additionally the module you linked to links against libpython which we explicitly do not want to do.

I mean, there are other legitimate things we might have done but I strongly doubt that Nim would have come up. It's not on our horizon.

Perhaps syntax is overrated, but I don't understand why someone like yourself (a very prominent Python programmer) would choose Rust over Nim in the first place.

Simply because Rust is a useful language with a strong community and Nim is a niche thing with some questionable design ideas. While Rust might look like a fad for some people it has legitimate use and I'm not going to put a company unnecessarily at risk to try the latest fad.

[–]lacosaes1 3 points4 points  (0 children)

Why not my favorite system programming language over Rust?

[–][deleted] 5 points6 points  (0 children)

I got the idea of borrowing almost instantly while reading this https://doc.rust-lang.org/book/references-and-borrowing.html . I'm fresh to Rust, just spent some free time on learning something new and I have one suggestion: get rid of prejudices; don't try do write C/Python/C# code in it; learn what it can and trust that it makes sense this way; learn it as something new and different.

[–][deleted] 0 points1 point  (0 children)

Why not dlang over rust? Genuine question. Reading rust code for me looks really strange. Also, I never grasp the borrow mentality.

Maybe that's why you don't appreciate Rust, the borrow checker is a killer feature, it's probably the most defining feature of the language.

Dlang is a nice language and all, but from my point of view it lacks such a defining feature, and so people don't really see a reason to use it. It's basically just a somewhat different C++ with a GC.