11 ms·
The Rust compiler has gotten faster again
- arthurcolle 5y agoRust is too syntax heavy, I don't see it catching on
- adamnemecek 5y agoIf you compare it with Python, maybe. If you compare it with C++ or Scala, then not even close.
- nikitaga 5y agoScala syntax and boilerplate is a lot leaner than both C++ and Rust. Don't mistake weird operators in some hardcore FP libraries for "Scala syntax".
- the_only_law 5y ago> Don't mistake weird operators in some hardcore FP libraries for "Scala syntax". Fair, but Jesus every Scala library I look at seems to have its own DSL making the language seem unapproachable.
- howdydoo 5y agoWe need a programming language that doesn't have syntax
- ashton314 5y agoI know this is snark, but there’s an arguably good answer. That’d be Lisp, according to an essay by pg that I’m too lazy to dig up right now. (Probably “revenge of the nerds” or something.) You just write the language in the parse trees.
- roywiggins 5y agoarguably FORTH has even less syntax
- klyrs 5y agoBrainfuck and Piet come to mind... come to think of it, brainfuck compilers might get mad about unmatched brackets. You can't go wrong with Piet, though.
- est31 5y agoTried perl? :)
- ashton314 5y agoUm, what? Are you joking? Mind elaborating? Rust has gotten tremendous momentum behind it—which is great since it’s introducing a lot of useful, heretofore cutting-edge tech from research into a mainstream language. (Thinking affine types.) Tooling is excellent too.
- nrabulinski 5y agoWhat’s so “heavy” about it?
- rumblefrog 5y agoWhile I agree Rust has a steeper learning curve with its lifetime and borrow checker. Why do you surmise that Rust is too syntax heavy? The BNF of Rust doesn't seem anymore complicated than most of the popular languages. The current trend of Rust seems to to suggest the opposite as well, with more large adopters.
- rjzzleep 5y agoLarge adoption, but I don't think the borrow checker and lifetime are the source of its steep learning curve
- paxys 5y agoI think Rust is a bit beyond "catching on" already.
- deleted 5y ago[deleted]
- djbusby 5y agoIt's sarcasm! (I'm sure)
- azangru 5y ago> I don't see it catching on But it is! People are (re)writing stuff in Rust and sound very excited about it.
- woodruffw 5y agoWait till you hear about this little language called C++ :-)
- dilawar 5y agoC++ is my bread and butter but I don't want my unborn kids to be raised in the world where C++ is not living at the margins. That's despite of all the awesome people putting their sweat and blood in supporting the little languages additional standards.
- n42 5y agothis comment was a great reminder of the level of discourse I should expect on the internet.. what the OP meant was “I don’t see myself using it”, but they instead projected their limited world view as prophetic. hate to break it, but if we’re entertaining Rust in the Linux kernel, I’m afraid it has already “caught on”
- esjeon 5y agoTBH, compiled general languages are doomed to be complicated, because they need more info during compile-time. The only exception is C (if you don't count stuffs like Lisp). IIRC, C grammar can be easily printed on a single sheet of letter paper.
- nynx 5y agoUnfortunately, the behavior of C’s grammar is incredibly complicated.
- xvedejas 5y agoI'm not convinced this is true. A simple grammar can express a whole lot of information. I think complex grammar is desirable in some cases because a lot of ways we choose to make grammar more complex are ergonomic. Binary infix operators, various kinds of brackets and braces, ... it all is a bit more difficult to describe as a grammar, sometimes more difficult to learn, but also closer to natural ad-hoc ways that technical people would write things down to communicate them. Just see the typical ways of writing mathematics as an extreme example.
- eatonphil 5y agoAny language can be compiled whether it's dynamically, weakly typed or not. Look at Chicken Scheme as an example or my projects compiling Javascript or Python. https://github.com/eatonphil/pyc https://github.com/eatonphil/pyc https://github.com/eatonphil/jsc https://github.com/eatonphil/jsc
- lmm 5y agoC is absurdly complicated (just try to understand all the different arithmetic promotion rules that can apply to an expression like "a + b"), you just don't notice it because it doesn't use that complexity for anything except occasionally giving you undefined behaviour.
- rectang 5y agoIs that you, Ken M?
- deleted 5y ago[deleted]
- dang 5y ago"Please don't post shallow dismissals, especially of other people's work. A good critical comment teaches us something." https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- nynx 5y agoWow, this is super impressive. Great work rust team!
- woodruffw 5y agoKudos to the Rust and LLVM teams for taking performance so seriously! I'm excited to see things get even faster once the new LLVM pass manager is enabled by default.
- est31 5y agoThat improvement is already included in the newest nightly, so it is included in the linked benchmark. It will ship to stable in the 1.57.0 release: https://github.com/rust-lang/rust/pull/88243 https://github.com/rust-lang/rust/pull/88243 Rustc supports running with LLVM versions other than 13.0, which some distros enable, but the official builds of rustc all use LLVM 13.0, a pre-release version in 1.56.0, and the final in 1.57.0 onwards.
- hvasilev 5y agoReality is not on the side of this language. 11 year old, has a very low adoption with virtually no jobs associated. (https://www.tiobe.com/tiobe-index/ https://www.tiobe.com/tiobe-index/) On the other hand if you search for "Rust" in the latest "Who wants to be hired?" thread, you will see it is quite popular with unemployed people. The reality is that the language has a lot of friction, the ergonomics are bad, the syntax is heavy and some poor decision making has been made there for a systems-level programming language. There are a lot of ideological traps in this industry and many people that fall for them. Why people are interested in ideologies and cults is beyond me.
- nynx 5y agoUh dude, might want to do a bit of research first. Rust is getting increasingly popular and is close to being an official language for wiring Linux kernel drivers. If that doesn’t count as having made it, I’m not sure what else will.
- hvasilev 5y agoLiterally provided a link with its popularity.
- woodruffw 5y agoWhy not a link to which languages programmers like the most[1]? It's our field, after all. [1]: https://insights.stackoverflow.com/survey/2021#section-most-loved-dreaded-and-wanted-programming-scripting-and-markup-languages https://insights.stackoverflow.com/survey/2021#section-most-...
- the_only_law 5y agoMildly saddened at the “dreaded” percentage on Erlang.
- woodruffw 5y ago
- Steltek 5y agoAnyone using Rust on ESP32? I'm 24 hours into trying and it's dredging up memories of old cross-compile toolchain problems, like trying to compile dependencies as x86 :). Either way, it's a fun project so far so I'm not complaining. Embedded seems like a great fit for Rust for ensuring correctness and speed.
- remcob 5y agoLLVM (Rusts' backend) doesn't support the Xtensa instruction set, which makes this so complicated. The newer ESP32-C{3,6} instead use a RISC-V instruction set which is already supported by Rust, so its much easier to set up. So far I managed to get basic serial coms working, but am waiting for some HAL so I can build a blinky LED.
- skrap 5y agoIf you haven't yet, check out Scott Mabin's blog. He's working on ESP32 & Rust: https://mabez.dev/blog/posts/esp-rust-18-10-2021/ https://mabez.dev/blog/posts/esp-rust-18-10-2021/
- elcritch 5y agoNo, I started using Nim on esp32's due to the Rust/llvm toolchain issue and found it quite nice. I wrapped much of the esp-idf in a project called Nesper. Though I keep an eye on Rust in the embedded world. Rust type system does seem to require a lot more work creating shared hardware api's.
- dividedbyzero 5y agoI really like Rust, it hits a lot of sweet spots for me – strongly typed, neat type system, the mild functional-ness thats useful while keeping people from going too crazy with functional patterns, usually low on boilerplate, static binaries, clever little things like ? ... but sometimes I wish there was a garbage-collected version of it, the constraints of the borrow checker make things like tree structures at least an order of magnitude harder to get right, and I'd love to have the ergonomics of the language and the ergonomics of a gc-ed runtime. Not going to happen I guess, but I feel like there's an opportunity for a Rust-ish language that is somewhat less finnicky, at the cost of making some abstractions more expensive, for microservices with complex business logic and such.
- winrid 5y agoSounds like you're looking for Nim!
- estebank 5y agoFor what is worth, you can opt-into reference counting and internal mutability with container types (Arc/Rc, Cell/RefCell, RwLock/Mutex), and get the same performance characteristics as a GC language (but without a JIT) for the cost of more complex types in your signatures. Edit: > the constraints of the borrow checker make things like tree structures at least an order of magnitude harder to get right The constraints of the borrow checker make those things more unlikely to compile without extra ceremony. The likelihood of getting them right is orthogonal from making the compiler "happy", even in Rust but specially in other languages. The way I've heard it described is that Rust is a language where you get the hangover first. It upfronts dealing with the error conditions of your problem space in a way that (you can argue) hinders the exploration phase, but that makes of a very quiet maintenance phase.
- sizediterable 5y agoPeople like to bring up reference cycles a lot as if it's always a deal-breaker, but for short-lived processes it kind of seems like a non-issue. Anecdotally, we've seen Instagram get overall gains by disabling GC in Python (which will still do reference counted cleanup).
- klipt 5y agoI remember Pascal compiling crazy fast compared to C/C++. Partly because the language was designed to be easy to parse, but I assume part of the speed came at the cost of producing less optimal code. But if most of your compiles are during development and debugging where optimization is less important, wouldn't it be nice to have super fast compilation during those stages? I don't know if any other compiled language comes close to Pascal in that regard.
- deaddabe 5y agoFrom my experience C is very fast to compile. Especially compared to C++, because of the metaprogramming and monomorphization stuff. In C you would use void*. Dynamic dispatch is faster to compile than static dispatch, but runtime performance differs. You can do dynamic dispatch in Rust, I think it could enable faster/smaller builds but at the cost of worst runtime performance. Tradeoffs, Yada Yada.
- pjmlp 5y agoOn our C projects back in the 2000's, a full build took around one hour, composed of Apache, IIS ISAPI modules, our own mod_tcl fork, all the TCL database drivers for MS SQL Server, Sybase SQL Server, Informix, Oracle, and several other native modules. Then we had to repeat it for HP-UX, Aix, Solaris, Windows NT/2000, in release and debug variants. A release would be a day event, so fast to compile is relative.
- cb321 5y agoWhile I agree the common pattern is to use void*/dynamic dispatch, this is not necessary. E.g., https://github.com/glouw/ctl/ https://github.com/glouw/ctl/ or https://github.com/c-blake/bst https://github.com/c-blake/bst show a couple ways to have generic code statically specialized in regular old C. (Instantiation/specialization is just marginally less automatic/syntactically supported.)
- the8472 5y agoA faster codegen backend for debug builds is in the works. https://github.com/bjorn3/rustc_codegen_cranelift https://github.com/bjorn3/rustc_codegen_cranelift
- pjmlp 5y agoNice to see the ongoing improvements, congratulations to everyone making it happen.