15 ms·
Hey, folks! I have never used Rust but all the buzz around it made me curious, so I may ask you to forgive my ignorance on the matter. I have a few honest quest
by GoodbyeEarl 9y ago
Hey, folks!
I have never used Rust but all the buzz around it made me curious, so I may ask you to forgive my ignorance on the matter. I have a few honest questions about it and I'm pretty sure these questions were answered before, so feel free to point me to this resources, I'd appreciate very much.
First of all what's the point of Rust? OK, it's a systems language, but what does that even mean? You can write a system in any language right? Python is a scripting language and lots of people use it everyday to write systems. What problems is it trying to solve? Also how does it compare to Go? (I haven't used either one or another). It seems to me that both Go and Rust are mainly used by C/C++ folks that want a new shiny language that somehow resemble the syntax or structure or funcionality of the former and at the same time add some modern features (I might be totally wrong by presuming this).
From the perspective of other languages I know a little bit such as Ruby, Python or JS its syntax seems really bloated to me with all those specials symbols. Do you feel more productive writing software in it than in let's say JS?
Please keep in mind that I really don't know Rust (nor I've never tried a statically-typed language) and I don't mean to offend anyone.
Thank you guys!
- SkyMarshal 9y agoThink of Rust as a better C - when you need low-level hardware control like C enables, Rust gives you that + guarantees about never having memory segfaults or concurrency errors that C can't. If your Rust program compiles, it won't break for those reasons (unless you intentionally enable and use unsafe code, but not by default). Think of Go as a better Python (scripting) or Java (application) language - simpler than Java, faster and with better concurrency than Python. Like Python and Java it's garbage-collected, like Java it's statically weakly typed so can't offer the level of guarantees that Rust can, but possibly faster to develop in as a result. Still too new and thus lacks the extensive libraries of either Java or Python, but growing fast.
- collyw 9y agoI managed to crash compiled Rust programs in my brief experience with it.
- caconym_ 9y agoRust doesn't guarantee no crashes. It guarantees protection against certain errors e.g. use-after-free and out-of-bounds indexing, some of which can't be done statically at compile time, so if Rust didn't crash e.g. when you index an array out-of-bounds, it wouldn't be doing its job. It'll also let you do whatever you like if you write `unsafe` code.
- jfoutz 9y agoAnd unsafe is tagged. You don't have to look at the entire codebase, just the few unsafe blocks. Those bugs are often subtle. Any way to restrict where to look is super helpful.
- bluejekyll 9y agoIt's not actually "whatever" you want. It drops a number of restrictions, but still guarantees some others that C doesn't for instance. https://doc.rust-lang.org/book/unsafe.html https://doc.rust-lang.org/book/unsafe.html
- mseri 9y agoYou are not alone. Being memory safe doesn't mean bug free or panic free. This does not invalidate any of the comments, it is a fairly good low level language with a compiler that helps you to catch nasty issues at compile time. The main complaint imho is that despite the many speed improvements, it's still not the fastest of the compilers. But it's getting there!
- bmh100 9y agoOne of the big gains they still have to make IIRC is providing partial compilation. That will be significant with the good developer practice of breaking source code into multiple files.
- Manishearth 9y agoI personally don't think that compilation units should be driven by files. Too often have I been forced to keep something in the "wrong" place in C++ because of the compilation model. (This happens in rust too, due to other reasons) Instead, the compiler should figure out what needs to be recompiled and do just that. This can mean benefits like not needing to recompile everything because you added a comment to a header file.
- jcranmer 9y ago> OK, it's a systems language, but what does that even mean? You can write a system in any language right? When people refer to systems languages, they usually refer to languages that need to do lower-level interactions with hardware. For example, calling to your graphics card manually rather than using a high-level GUI toolkit. Or mmap'ing memory, or using internal JITs. This means that you need clear C and assembly interoperability and generally want to avoid garbage collection.
- bnolsen 9y agoOr to put it more succinctly, deterministic behavior. Important for anything time(r) critical. You don't want a GC pause to hit at the wrong time...
- pjmlp 9y ago> You don't want a GC pause to hit at the wrong time... Military don't see to have any issue using real time Java to control weapon systems. Aonix, nowadays part of PTC, has lots of customers. From missile systems to battle cruiser targeting systems. So apparently Java real time GCs don't have any issue on the battlefield.
- rapsey 9y agoBattlefields are glacier slow compared to games, vr, trading, data processing, etc.
- pjmlp 9y agoTell that to a missile radar system that needs to evaluate in in real time what the missiles it is tracking are actually going to hit. Example the NORMANDIE ballistic missile tracking. http://www.businesswire.com/news/home/20090302005701/en/Thales-Air-Systems-Selects-Aonix-PERC-Ultra http://www.businesswire.com/news/home/20090302005701/en/Thal... I have other examples, like battleship gun turrets computer aided targeting systems. You don't want the computer to stop for thinking instead of live tracking what those turrets are supposed to hit.
- aturon 9y agoRust's goal is to make it easier to write fast, reliable software. It's not just targeted at C/C++ folks. The Rust team often hears from people who have been pulling their hair out trying to get a particular component written in a scripting language (Ruby, Python, JS) to go fast enough, which entails getting very intimate with the runtime systems for those languages. They're often surprised that they can instead write that core component in Rust, without giving up any developer productivity (or sometimes gaining it, compared to hand-optimizing their code), and get something much faster than what they were able to achieve in a scripting language. There was a post just the other day on the Rust reddit telling this story: https://www.reddit.com/r/rust/comments/67m4eh/rust_day_two_a_python_devs_perspective https://www.reddit.com/r/rust/comments/67m4eh/rust_day_two_a..., with a choice quote: "I feel like I discovered a programming super power or something. I mean I did expect it to be faster, but not this much faster this easily!" You can also check out the videos here: http://usehelix.com/resources http://usehelix.com/resources Rust also makes it much easier to write reliable software. The best example of this is with multithreaded programming (which is something you might reach for for speed), where Rust gives you guarantees not found in any other major language: you can know for sure that data is owned by one thread and not accessible by others, and the compiler will check this for you. You can know for sure that you only access lock-protected data while holding the lock. Rust will check thread safety for you, and more. You can read more about the concurrency benefits here: http://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.html http://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.ht... Relative to Go specifically, in addition to the reliability improvements, Rust supports a wider range of "systems" use cases. Unlike Go, it does not require a garbage collector or other runtime system, which makes it very easy to write small Rust components that can be used with a large script, or to write extremely performance-sensitive or low-level code like a browser or game engine, an operating system, or a bare-metal web server. One reason that Dropbox switched to Rust from Go for one of their core components is greater control over memory footprint, which allowed them to reduce their server memory needs by 4x, leading to significant financial savings. The slogan I've been using for Rust personally is: Confident, Productive Systems Programming. You can write fast code. You can write low-level code. You can do it with high productivity, thanks to the work on modern tooling and ergonomics. But most importantly, you can do all of this fearlessly, because the Rust compiler has your back.
- kbenson 9y ago> You can write a system in any language right? Python is a scripting language and lots of people use it everyday to write systems. It's a systems language in the respect that you get full control over the resources that are used or not used, and you can reason about exactly what code runs (or check the generated output). You can write a webserver in Python, but unless you are serving a dynamic site implemented in Python, you are likely paying a steep cost for that, at least in respect to a language with much finer control such a C/C++ or Rust (or many others that are in this category). > Also how does it compare to Go? My understanding of Go is that it aims to fit a similar niche, if not entirely overlapping. Sort of a C/C++ with some changes to make it more modern/easier to use, some language functionality that makes concurrent programming easier, and memory management to ease the pains of manually dealing with memory. Sort of a hybrid of C and Java, where Java's VM is reduced to be very simple and embedded with every binary you create. At least that's how I understand it, not really having done much in it. > From the perspective of other languages I know a little bit such as Ruby, Python or JS its syntax seems really bloated to me with all those specials symbols. In many cases it's hard to compare from a dynamic language to a low-level compiled language. It's sort of like comparing a Cessna to a Fighter Jet. If you just need to get from point A to point B and time isn't too much of a factor, a Cessna is fine, and comfortable, and doesn't require much training or diligence in its use. When you need to get there fast, and you might also need to fight a battle or two, a Cessna is not sufficient, but you might make do if you bolt a few missiles and guns on it if you don't expect much of a fight. That's probably the equivalent of writing your own module or library in C/C++ and calling to it from Python. The symbols allow for greater control and specification of the problem, and when your goal is already to make a very robust system, are something you might end up needing anyway. Imagine you are telling a friend how to go pick up your drink at Starbucks, and he's unfamiliar with the area. You can give very general directions and trust your friend is smart enough to figure it out, and in many cases they will, after taking some time to reason out the ambiguities they are presented with in the real world. Sometimes your drink comes back cold or wrong. Alternatively, you can write very detailed directions for exactly where to go, what to expect to see, and what to say. This takes time up front, but you have higher assurance that you will get your drink in a timely and correct manner. Having a shared shorthand you and your friend know might make that list of directions a bit hard to read from the outside, but it can add to accuracy and/or reduce the number of steps if it's a well defined shorthand.
- thenewwazoo 9y agoI'll answer the "what's-it-for" question first: basically, a systems language (as loosely distinguished from a scripting language, or languages with a runtime) is, to me, a language that lets me take control of the bare metal. With Go, for example, I can't control directly whether a value lives on the stack or the heap. With Python, I can't get assurances that variable access in loops won't have a layer of indirection that may hurt performance. With Java, I don't necessarily control the layout of structures in memory, which may be important for things like managing memory pages. A systems language lets me manipulate memory and machine state directly. With all the power that a systems language gives, comes great risk. To err is human, and most system languages do not prevent humans from erring in ways that can cause significant undefined effects. The usual suspect is, of course, memory safety, but this can also mean things like losing sight of an algorithm because you're carrying too much intellectual overhead when doing the aforementioned memory or system state manipulation. Computer science has lots of very well-studied approaches to solving particular parts of problems, but there's a gap between those approaches and the expressiveness of systems languages to implement them in a way that is fault-free, or doesn't make things like Hoare analysis too difficult to manage. I am a neophyte using Rust, but it has me excited because it closes that gap in a really elegant way. I just published a libnss plugin that queries Azure Active Directory for user information[1]. Without going into too much detail, it's a set of functions that takes pointers to memory, and stuffs them full of data that it gets from an OAuth2-protected REST endpoint. That's a looooot of "range" in terms of function, and the surface area for bugs in a language like C is huge. On the other hand, doing FFI in runtime-based languages is usually very hard and can be relatively slow, which matters in something as basic as user information retrieval. Rust made writing it extraordinarily easy. I have to "speak C" on one end, but I can handle HTTP calls with the ease and low-risk usually only found in languages like Python. At the same time, if there is a bug that effects memory, I can trust the compiler will catch it, which frees me up to think about structure, maintainability, extensibility, &c. [1] https://github.com/outlook/libnss-aad https://github.com/outlook/libnss-aad
- pjmlp 9y agoModula-3 is a systems programming language with GC and you can control precisely where the data goes. There are lots of other examples.
- Rusky 9y ago"Systems language" usually refers to lower-level programming. For example: an OS kernel or its drivers where you're poking at hardware and need control over memory layout, a library to be called from many other languages that thus needs to avoid a large runtime and garbage collector, or high-performance infrastructure like web servers or game engines. Generally things you've had to use C or C++ for, in the past. Go is sometimes called a systems language, but in a much narrower sense than Rust. For example, it is garbage collected and has a runtime, so it's not great at being FFI'd into. It seems to be quite useful for distributed applications. Rust, on the other hand, is closer to C++ in that it has no real runtime and no GC. On top of that, it brings compile-time memory safety and lots of other modern features to systems programming. One of its biggest applications is making Firefox safer and faster as part of the Quantum project (https://wiki.mozilla.org/Quantum https://wiki.mozilla.org/Quantum). Part of why Rust is more symbol-heavy than Python or Javascript is it has to express things in more detail, giving you the control required to do systems programming. So it's not necessarily a direct competitor to JS, since it can work in areas JS simply can't. In some ways, though, that can make it more productive- static typing is like compiler-enforced documentation and tests, making it easier to keep track of a large codebase.
- slowmovintarget 9y ago>> Rust, on the other hand, is closer to C++ in that it has no real runtime and no GC. On top of that, it brings compile-time memory safety and lots of other modern features to systems programming. I think that's it in a nutshell. I want to write a program in a language that allows modern programming construction... Cool: Python, Ruby, JavaScript (ES 6+), Haskell, Elixir The language must be fast... OK, so maybe Java or C#? I need to control the response times and can't have GC pauses. It needs to be really fast... Assembly! Stop... OK, OK, you're kind of stuck with C or C++. Sigh. I want a modern language that compiles to bare metal, doggone it. What should I do? This is what Rust is. Memory safety without GC, and a modern language without an interpreter or runtime. Plus all the package management/build tool/library ecosystems that all those 1990s languages have. (Would you believe that Java, Ruby, and Python are all more than 20 years old and that Java is the youngest of the three?!?)
- l1ambda 9y agoBecause you can build things like: * A faster grep ( https://github.com/BurntSushi/ripgrep https://github.com/BurntSushi/ripgrep ) * A GPU accelerated terminal emulator ( https://github.com/jwilm/alacritty https://github.com/jwilm/alacritty ) * A web browser ( https://servo.org/ https://servo.org/ ) * A containerization system ( https://github.com/tailhook/vagga https://github.com/tailhook/vagga ) * An operating system ( https://github.com/redox-os/ https://github.com/redox-os/ ) * An extremely fast text editor ( https://github.com/google/xi-editor https://github.com/google/xi-editor ) And be faster and safer than C/C++.
- hacker_9 9y agoJust like with Javascript, everything must be rebuilt again!..
- drzaiusapelord 9y agoExcept Rust has incredible memory safety, without cumbersome and slow GC, and runs close to C++ speeds, unlike the heavy, wasteful, and slow frameworks you mention like Electron or HTML5. Rust is a modern C/C++ replacement, or at least tries to be. That's no mean feat.
- mseri 9y agoPlus alacritty looks great and is much faster and lighter than most other terminal emulators, ripgrep is a great replacement for grep and can be a serious improvement when you are searching through millions of lines on thousands of giant files. To mention just the two of them...
- bpicolo 9y agoI only use ripgrep these days.
- Spiritus 9y agoAlacritty is full of render issues and missing features. It's fast because it barely does anything, and doesn't even do it correct. Just check the ever growing laundry list of issues it has on Github. With that said, it's a very interesting project. Especially with regards to its rendering engine.
- nsgoetz 9y agoDifferent languages are targeted for different purposes. Most people don't like JS as a language, but necessary to take full advantage of what a web app can do. This is because today browsers run JS and not much else. The sometimes chose to write their sever in it too to decrease the number of languages they need to maintain in their code base, and to be able to reuse code for the backend and front end of their webapps. One of the ways languages differ is how much of the hardware they abstract. Assembly is literally a list instructions to manipulate registers (a component of a processor) containing 1 number at a time, and to jump around those lines. Resisters and you memory just hold ints, so the programmer has to know what ints are numbers what are addresses pointing to an array or other number(pointer), etc. C abstracts a ton of those instructions, so for example you have to keep track of what memory you're using but not which register has that memory's address and how to allocate registers etc. Static typing is necessary to remember how to interpret those ints. Python abstracts even more so you don't have to keep track of you memory and its very close to abstract logic. However, in exchange there is a large bit of code that has to run with you python code to figure out how to use the registers and assembly instructions to compute your function. OK it doesn't do that directly, but indirectly that's the point of what is called an interpreter. There are advantages of more abstract languages like python. You don't have to think about as much and there are generally more safety guarantees. However, sometimes you can't afford to the time or space overhead of the interpreter. This is a commonly cited reason people move away from ruby. Sometimes you need the minute control over you data. For example, if you are writing a OS or a device driver, you need to give very specific instructions to the processor. Languages that are well suited for the latter cases are usually called systems languages. Rust and Go are examples of languages that try to fit between C and Python on this spectrum. They want to give some of the abstractions and security grantees that python provides without the overhead and while enabling some precise control of the hardware if you need it. They also provide some abstractions that may speed up you code because the language designers have thought through some complex algorithms and code better than you may be able to. Hope that helped, and let me know if you have any questions.
- AsyncAwait 9y ago> You can write a system in any language right? Python is a scripting language and lots of people use it everyday to write systems. Systems here means things like an operating system, a device driver, video games or a web browser, things that need fast execution, direct access to hardware and the ability to manually maintain memory. Stuff that C/C++ are normally used for. Could you do it in Python? Not really, since Python has garbage collection, a very high-level of abstraction and is extremely slow for these kinds of tasks. > What problems is it trying to solve? It's trying to make it possible to write programs that require manual memory management, but that are checked for correctness of that manual memory management automatically, so that you can avoid many bugs that are related to memory and are commonplace in programs written in C/C++, like referring to a certain object that is in fact no longer present etc. > Also how does it compare to Go? It seems to me that both Go and Rust are mainly used by C/C++ folks that want a new shiny language that somehow resemble the syntax or structure or funcionality of the former and at the same time add some modern features Go is not really used by C/C++ programmers, as it does have a garbage collector, just like Python. Unlike Python however it is way faster and unlike Java, it is compiled to a native executable, thus it is used by many Python/Ruby/Java programmers who want a faster/native language with similar capabilities. Go is mainly used for writing web applications and command line apps, just like Python. > Do you feel more productive writing software in it than in let's say JS? Rust targets a very different market from JS, but it has a very strong type system and catches a lot of errors at compile time, which to me makes it a lot more productive than JS is, just by not having things explode on me at runtime. As for the syntax, it actually feels very neutral once you spend a couple of days with it and read the book + apart from the 'lifetime annotation there aren't really any other weird symbols for the category of language Rust is. For example things like https://github.com/redox-os/redox https://github.com/redox-os/redox or https://github.com/servo/servo https://github.com/servo/servo would be very hard to write in both Python & Go, because they require direct access to hardware, fastest possible execution and manual memory management. They could've been written in C/C++, but would then contain many memory management errors, (given its manually done by the programmer and programmers are fallible humans), which could lead to crashes or serious security problems. Rust aims to prevent these drawbacks of C/C++, while still maintaining all of their benefits, i.e. speed, manual memory management etc.
- GoodbyeEarl 9y agoMan, I really didn't expect all those nice and thoughtful responses. Thank you so much for everyone who replied it. It was really kind of you. Now I have a much better idea on what Rust was designed for and its strenghts. I've learnt so much here. Also thanks for the articles and videos you shared, I'll definitely take a look at them all. I'm glad I didn't let the fear of been bashed to keep me away of asking. I'm not sure if I'll ever need to use Rust but it surely has the coolest people around it. :) Thank you guys!
- farresito 9y agoYou will rarely get bashed in HN, and those cases will be either when you are disrespectful or when you make a joke a la reddit. Otherwise, people are more than happy to help, at least in my experience over the past four or five years or so.
- kbenson 9y agoEven jokes aren't necessarily frowned upon, as long as you contribute something meaningful as well. A joke prefixing or postfixing a comment of substance (even if it's just a question) doesn't garner many down votes, in my experience. I think people are wary of this turning into reddit where you sometimes get chains of joke comments swamping discussion. Which is fine, because we have Reddit for those that want that, and HN for something different.
- dafrankenstein2 9y agosame here!
- maxpert 9y agoNo GC with power of C/C++ and safety guarantees. Personally I think if you have not dealt in a high performance system where every byte matters. You won't appreciate the rust that much. I can write Redis for example in Rust with a guarantees of no memory leaks! C/C++ can't guarantee that.
- Rusky 9y agoRust doesn't guarantee no memory leaks any more than C++.
- jplatte 9y agoWhile it is not part of the memory safety guarantee of safe Rust, in practice it is much harder to accidentally leak memory in Rust than in C++. There is no counterpart to the C++ new operator in Rust; no commonly-used language feature or standard library function puts the burden of explicitly freeing memory on the programmer. For those who are interested in why leaking memory isn't disallowed by Rusts safety guarantees, have a look at the documentation of the (AFAIK) only safe function in the standard library that leaks memory: https://doc.rust-lang.org/std/mem/fn.forget.html https://doc.rust-lang.org/std/mem/fn.forget.html
- vertex-four 9y agoActually... the counterpart to the C++ new operator would be the perfectly safe `Box::into_raw(Box::new(whatever))` - along with its counterparts on other smart pointer types - and there may be a heap module one day[0] - but your point stands that this is not the "default" way of allocating. [0] https://doc.rust-lang.org/alloc/heap/ https://doc.rust-lang.org/alloc/heap/
- bronz 9y agoit actually does in a certain way. if at some point the lone pointer ("pointer") to that memory goes out of scope then the memory is deallocated. happens a lot.
- 9y ago
- infogulch 9y ago"systems" is an overloaded term and I wish Rustaceans would stop using it or add some qualifiers to manage the ambiguity. I mean, GoodbyeEarl says it right there: You can write a system in any language right? Sure, if you're a kernel developer (or rust user) then you might know what "systems language" means more precisely and that phrase makes it easier for you to communicate with other kernel developers, but it loses its' value as a "distinct meaningful element of speech" (define: word) when the context includes almost anyone else. Hell, even the definition of "System programming language" on Wikipedia[1] is ambiguous enough that many GC'd or even scripting languages would fit it. So lets stop using just bare "systems language" to describe rust. It deserves better. Newcomers faceplanting into the 10-story granite wall that is the borrow checker is bad enough, there's no reason they should be confused by the tagline on the homepage. You can write a system in any language right? [1]: https://en.wikipedia.org/wiki/System_programming_language https://en.wikipedia.org/wiki/System_programming_language
- kbenson 9y ago> Hell, even the definition of "System programming language" on Wikipedia[1] is ambiguous enough that many GC'd or even scripting languages would fit it. And the definition of race car is ambiguous enough that you can take your 70's pinto onto the track if you want. In some contexts that might even be entirely acceptable. But if you look at the current uses of the term and what it applies to, and why, it becomes fairly obvious what class of vehicles it's referring to. There are, of course, more specific terms (Indy, Nascar, Formula 1, Rally) for more specific meaning. If someone says they are building a race car, you have a pretty good idea that they are building a vehicle to compete in a race, and speed and handling are important, but specific details might change depending on the type of racing. > Newcomers faceplanting into the 10-story granite wall that is the borrow checker is bad enough, there's no reason they should be confused by the tagline on the homepage. Then again, should newcomers come under the impression it's as easy as Python or JavaScript and when they hit that brick wall think it's just themselves, or that the language is poorly designed because it isn't as accessible? Systems language is probably the closest thing I can think of that approximates what to expect out of languages in this category. More explanation might be nice, but I think systems language signals the right things for people that know the term, or are willing to look it up.
- kernelbandwidth 9y agoA lot of people describe Rust as a systems language (and it is!) and often that's followed up as a "better C". But it's also more than that! Despite Rust looking a lot like C++ and often occupying a similar role as C, it's heritage is just as much that of an ML, and it shows in the semantics and type system. So while a lot of people do use it as a safer C, I often find it to be a "pragmatic Haskell". My company does much of our back-end in Rust, and we've found it to be an excellent application language. A lot of this is the type system and the tooling. Cargo, the package manager and build system is excellent, builds are far more reproducible and I've spent far less time debugging builds (as opposed to code) than just about any other language I've used. Rust's type system is great if you like that kind of thing, and I find Rust to be particularly easy to debug and refactor. RAII and destructors/drop semantics come in handy more often than you'd think, and the "fearless concurrency" thing is real. That said, lifetimes do occasionally cause some pain, the learning curve isn't the kindest, and the patterns are different from a lot of other languages. Personally though, I've found Rust to be very productive after getting over the initial learning hump and understanding the borrow checker more. This is gets more true the larger the project gets, as Rust tends (in my experience) toward the trade off of putting a fair bit of complexity up front in exchange for a slower accumulation of complexity as the project increases in size and scope. It's a trade off that I'm often happy to make, but is always a judgement call.
- dronemallone 9y agoCould you please explain why and how the Rust compiler is better than compilers for other languages? After all, every language compiles down to machine code/assembly. So, the reason that one language is "better" than the other has to do with the fact that the compiler for one language is "better" than another.
- biokoda 9y agoC/C++ compiler will compile your code if it is correct. Rust will not compile code if it can detect that it will not work or it is not safe even though the syntax is correct. It can guarantee the program is memory safe (double free, user after free, null dereferencing, using uninitialized memory, array bounds checks). This makes large refactorings so much easier. It also makes working on large projects with lots of people much easier.
- amenghra 9y agoLanguages that bind you to a garbage collector aren't always well suited for "systems programming". You might not want to pay the memory or latency cost. It's not always clear cut though. I think Go is a great language for writing system tools, and yet it has a gc.
- proyb2 9y agoIn the previous discussion on Rust Fireflowers https://news.ycombinator.com/item?id=13272474 https://news.ycombinator.com/item?id=13272474 One of the successful stories with Rust I read https://users.rust-lang.org/t/success-story-new-rustacean-beating-c-perf-in-first-week/10199 https://users.rust-lang.org/t/success-story-new-rustacean-be... In other blog, there are benchmarks that Go outperform Rust but I believe the Rust code didn't use buffer read. http://126kr.com/article/5cikidl5bhe http://126kr.com/article/5cikidl5bhe
- shmerl 9y agoHere is a good overview of how Rust is by design fixing some problems which other languages don't. https://www.youtube.com/watch?v=WQbg6ZMQJvQ https://www.youtube.com/watch?v=WQbg6ZMQJvQ It's using somewhat historic version of Rust, but ideas explained are quite applicable.
- Certhas 9y agoMuch ground has been covered here already, but let me add something concrete. I'm a scientist who lives in Python. However, sometimes I need code to be fast and precise. In Python we resort to things like numba or cython or weave to achieve that. So why am I interested in rust? Well if you read around a bit in the literature, you'll find about a million ways to shoot yourself in the foot with C. I have been bitten by that in practice, with subtle memory allocation errors in C code I had to use, that manifested non-deterministiaclly and that I failed to debug without help. I am very interested in a language that allows me to write fast compiled code, and do so safely, exactly because I'm not a C wizard or systems programmer who has a lot of experience writing mostly bug free code. I don't _like_ writing C code, it feels brittle. In python the python interpreter takes care of everything for me. When I go down to C (as cython or weave allow me to do) things become brittle. (And numba, while I love it and use it alot, is an exercise in constrained writing). Rust is not brittle. In Rust, mathematics does for me what the python interpreter does on the python side. That's massive, and it's elegant. It probably helps that I have written more papers including categories than programs involving C though.