News for hackers. Stuff that matters.
Re:Rust Traits Deep Dive, Part 2 by toyg on Wednesday June 20, 2018 @09:31AM (#17355143)
I've just started working with Rust, coming from a python/java/web background. Some of the constraints are a bit mind-bending, and the ecosystem is very immature; but compared to C/C++, it's a dream.

It only needs a few things to achieve world domination, imho: a good crossplatform GUI toolkit, and a trivial way to interface with higher-level languages like Python.

Re:Rust Traits Deep Dive, Part 2 by lmm on Wednesday June 20, 2018 @11:19AM (#17356215)
What is it that you want from Python? Presumably automated memory management - but if you have GC pauses anywhere in your stack then you can presumably afford to have them everywhere in your stack. Would a language like OCaml (or my own favourite, Scala) give you everything you need: Rust-like safety but Python-like expressiveness?
Re:Rust Traits Deep Dive, Part 2 by toyg on Wednesday June 20, 2018 @12:38PM (#17356953)
It's just that the Python ecosystem is so much bigger, there are much more productive libraries for dealing with things that are not performance-critical. With python you get stuff like QT, nice configuration parsing (rust has one lib and pretty immature too) and so on, available with zero effort. Python is now so huge that only a handful of other communities has anything comparable (Java, PHP, JS and maybe Perl, basically; I would add C# but there you usually have to pay for stuff).
Re:Rust Traits Deep Dive, Part 2 by lmm on Thursday June 21, 2018 @06:50AM (#17363792)
Yeah, availability of libraries is important. That's one thing Scala was quite clever about bootstrapping: there are native-Scala libraries for a lot of things these days, but if you need to do something rarer you can very easily call into a Java library.
Re:Rust Traits Deep Dive, Part 2 by twic on Wednesday June 20, 2018 @03:33PM (#17358899)
One approach to this is to write a core program in Rust, and support it with a bunch of scripts in Python.

For example, i have a program that accepts data over the network, filters it according to some rules downloaded from a config server, and sends matching data somewhere. The packet handling, which needs to be fast and reliable, is in Rust; the downloading and parsing of the rules, which can be slow and just needs a sanity check at the end, is in Python.

Re:Rust Traits Deep Dive, Part 2 by steveklabnik on Wednesday June 20, 2018 @09:38AM (#17355201)
Have you checked out milksnake or pyo3?
Re:Rust Traits Deep Dive, Part 2 by toyg on Wednesday June 20, 2018 @09:45AM (#17355247)
I'd seen milksnake and found it daunting. Pyo3 looks sweet. Thanks for the pointer!
Re:Rust Traits Deep Dive, Part 2 by steveklabnik on Wednesday June 20, 2018 @11:23AM (#17356248)
No problem!