5 ms·
While I would consider myself more a Golang fan than a Rust fan, I am impressed by the speed by which the Mozilla team is changing fundamental parts of their br
by JepZ 9y ago
While I would consider myself more a Golang fan than a Rust fan, I am impressed by the speed by which the Mozilla team is changing fundamental parts of their browser and somehow I believe rust has something to do with that speed.
- pimeys 9y agoI've been working professionally with Rust for a year now. When I got over the first wall, it has become the best tool I've had for creating backend applications. I have history with at least nine different languages during my professional career, but nothing comes close giving the confidence and ergonomics than the tools Rust ecosystem provides. Firefox, especially the new Quantum version is awesome. But Rust as a side product might be the best thing Mozilla brought us. I'm truly thankful for that.
- htn369 9y agoHow complete is the Rust library and complementing open source projects comparing with golang?
- pimeys 9y agoProbably not that complete, but getting better. I needed to write some of my own libraries, but for http server/client hyper[0] is fast and quite comfortable. It's getting a http2 support soon[1] and the ecosystem around the tokio[2] framework grows fast. I need to do fast consuming and for Kafka the situation is quite good, for rabbitmq I have stuff that works but I needed to hack with a knife to get stuff working the way I wanted. Everything's quite low level in the end and there hasn't been a task I couldn't solve either by myself or finding a library and doing a couple of pull requests to get things running. The hardest was to implement a working HTTP-ECE for web push notifications by reading and understanding all the RFC drafts, but the project[3] teached me a lot. Basically all my consumers deal with millions of events every hour, using 0.1 cpu's and about 50 megabytes of RAM. Uptimes reaching 2-3 months if I don't need to update the software. [0] https://github.com/hyperium/hyper https://github.com/hyperium/hyper [1] https://github.com/carllerche/h2 https://github.com/carllerche/h2 [2] https://tokio.rs/ https://tokio.rs/ [3] https://github.com/pimeys/rust-web-push https://github.com/pimeys/rust-web-push
- fjksksvdjsjd 9y agoIt’s good. Net/http is still less mature, but this an absolutey massive golang ecosystem. You can certainly write http clients and servers today. Unicode, string processing, regex—all of these have performant, stable implementations, either in std or in crates. Recently i’ve been doing audio processing in rust; the code there is at least as good as the equivalent in go. Overall I’d say I haven’t had issues finding a package for something in a couple years, though the quality varies from “has a full support community” to “DIY if you need something”. However, rust really shines with datastructures. Heap? Btree? Doubly linked lists? It’s all high quality, performant, and type-safe code (though the internals are unsafe as hell), which was my major pain point in go. Doing anything with a typed datastructure feels a lot like copy/paste coding in go, though apparently templates formalize this.
- fb03 9y agoCan you tell me about your audio coding endeavours in Rust? Are you into writing VSTs or stuff? I've been reading more and more about Rust and while I've fallen in love with its premises I still fail to tackle the real world task of starting to do stuff with it. Would you give me some pointers? I work with Python and C professionally and have more than 15 years coding backend stuff for un*x systems, to give you some bg. thanks in advance!
- fjksksvdjsjd 9y agoI haven’t played too much with VSTs beyond a proof of concept for logic tools. However I have been doing plenty of realtime processing! It’s great: it integrates seamlessly with the C ABI—I wrote my own core audio binding (though there is already on on crates) to get to know the API, and I was far more restricted by the poor documentation than the FFI itself. But, rust has everything you need: find-grained control over memory and ownership, inline assembly and intrinsics (I haven’t attempted autovectorization yet), bindings to common audio formats, and excellent parallelization. The datastructures are extremely expressive, especially if you come from a C background; so far I really just want better VLA support, which is mostly annoying to work around (you have to manually poke the values into memory at the correct offset in an unsafe block). I did find that tokio-rs wasn’t suitable as I had hoped for realtime work with an async/future api and fell back onto ringbufs locked with mutexes. The good news is you can wrap that in futures itself and have a great async api that does its work eith shared memory, minimizing the viable races. Rust will definitely be a player in the audio workstation world; right now you’ll be implementing the bindings yourself, but you can go out and write plugins today so long as the ABI is C.
- fb03 9y agonice! can you talk more about Rust's tooling? How do you debug? What IDE or text editor do you feel comfy with? Do you have/use/need autocomplete? I'm coming from a a Python background and I'm too spoiled by Pycharm's insane tooling and autocomplete and stuff.. I wanna trail de Rust path too! thanks in advance.
- richardwhiuk 9y agoRust with VSCode and RLS gives pretty good code auto-complete.
- Rusky 9y agoNot pimeys, but VSCode with the RLS plugin has pretty good IDE functionality. Personally I tend to use Vim out of habit, and debug in Visual Studio. I might switch at some point for RLS (or try to hook it up to Vim).
- lambda 9y agoWhile I mostly use Emacs and have only actually written a little bit of Rust, from what I've gathered the two best IDE experiences are either VSCode with RLS (Rust language server, which uses an adaptation of the compiler for reporting syntax errors and various other information like jump to definition, coupled with a simpler but faster engine for things like autocompletion so that you can start doing that before the server finishes a full compile) and the Rust IntelliJ Plugin which uses IntelliJ's native tooling and adapts it to understand Rust, which has the advantage of all being originally written for fast and robust autocompletion, highlighting, and the like, rather than adapting something written as a compiler to provide that information, but the disadvantage that you need to implement a lot of Rust's syntax and type inference so there are some more complicated cases that it can't necessarily handle yet. If you're interested in trying out a Rust IDE, those are the two I'd try and see how you find them.
- mrsteveman1 9y ago> nice! can you talk more about Rust's tooling? How do you debug? What IDE or text editor do you feel comfy with? Do you have/use/need autocomplete? For writing code, I've been using IntelliJ with the Rust plugin for the past year. Autocomplete works pretty well, there is Cargo integration so you can edit your dependency file in IntelliJ and things will automatically update so that autocomplete and documentation (go to definition) for the newly added dependencies start working immediately. There is also simple build/check/run support, with build and test output appearing in the lower panel inside the IDE. There are some quirks, but they have been very minimal. I've never used IntelliJ to debug Rust itself, because in most of the projects I've worked on, the Rust code has been designed as a completely separate library with a semi-public API, intended for embedding in another language like Swift or C#. So the debugger has almost always been Visual Studio or Xcode, but it works exactly as I would expect even without using any sort of Rust plugin for either one. The other day I was stepping through the call stack to find the source of a crash (one that I caused by failing to keep the P/Invoke signatures up to date with our Rust functions), and Visual Studio switched right from C# to Rust from one frame to the next, showing the source code and the line where the crash occurred in Rust. Really I can't think of anything that has been even a moderately significant problem, it's been great all around.
- GoodbyeEarl 9y agoHey, is it restful APIs that you write or more like crud apps with rendered views?
- pimeys 9y agoWe get events in and trigger other events in the system. So basic SOA with a message broker in the middle. Our REST stuff with quite minimal traffic is done with Clojure.