6 ms·
When will there be another implementation of Rust? If there's ever a GNU implementation, I might be willing to try it.
by adenozine 6y ago
When will there be another implementation of Rust? If there's ever a GNU implementation, I might be willing to try it.
- geofft 6y agohttps://github.com/Rust-GCC/gccrs https://github.com/Rust-GCC/gccrs is in progress, but I believe it works enough to be worth playing with. Note that it doesn't implement the borrow checker - the plan is to reuse rustc's borrow checker as a compiler plugin. For now, as I understand it, gccrs itself assumes that the code is valid (i.e., would be accepted by rustc). https://thephilbert.io/ https://thephilbert.io/ is the primary developer's blog and has status updates.
- nextaccountic 6y agoSome links on the most promising effort so far, gccrs https://opensrcsec.com/open_source_security_announces_rust_gcc_funding https://opensrcsec.com/open_source_security_announces_rust_g... https://www.embecosm.com/2021/01/12/gcc-rust-how-it-can-be-achieved/ https://www.embecosm.com/2021/01/12/gcc-rust-how-it-can-be-a... https://rust-gcc.github.io/ https://rust-gcc.github.io/ This is an entirely new frontend written in C++, that shares no code with rustc (the official rust compiler). It might be merged some day in GCC proper. But honestly, I'm more excited for rustc_codegen_gcc: https://github.com/antoyo/rustc_codegen_gcc https://github.com/antoyo/rustc_codegen_gcc It adds gcc as an alternative backend of the official Rust compiler. That way it is much more feasible to stay up to date as the language evolves. Anyway the former two don't actually work right now. The one that does work today is mrustc, or at least it works for bootstrapping rustc; it doesn't have a borrow checker though (and instead assumes the program is correct). Also, mrustc isn't based on gcc. https://github.com/thepowersgang/mrustc https://github.com/thepowersgang/mrustc (There's a fourth project, https://github.com/sapir/gcc-rust https://github.com/sapir/gcc-rust, but it seems abandoned)
- dhosek 6y agoMeh. Part of what makes rust appealing over C++ for my current project is that the latter has at least three major target compilers with subtle differences in how they implement things that mean that even staying within the bounds of the standard might result in different outcomes in the code (not to mention the whole mess around dependencies in C++ code). Multiple implementations of a language feels more like a bug than a feature to me.
- seoaeu 6y agoAs best I can tell, C and C++ are the only languages where people are actually happy that there are multiple implementations.
- dsfbjornjaja 6y agoHmmm what about CPython and PyPy?
- tonyarkles 6y agoAs a single data point, I’ve been using Python since 2005 and have never played with PyPy any beyond a quick peek after seeing a conference talk. On the other hand, I use gcc, clang, and MSVC++ on a regular basis. But... I think the reason I care about multiple C++ compilers is mostly because there’s no “one compiler that is ergonomic to use everywhere” and I end up writing better code because of it (eg gcc warning about something clang doesn’t care about). For Python, I mostly just care that it Just Works everywhere (modulo compiler setup for building C modules)
- wongarsu 6y agoAlmost all Python code is written for CPython, and if you run into performance issues you tweak it until it runs on pypy. I'm glad that pypy exists because it forces cpython to do something about performance, but for python overall it's a pretty niche tool.
- dsfbjornjaja 6y agoStill—multiple implementation has an impact on the reference implementation.
- anp 6y agoI think Javascript has many user who think they benefit from competing implementations. I’m not sure the sentiment there seems as strong as in the C++ community, but it definitely exists.
- nextaccountic 6y agoSee also the discussion here https://news.ycombinator.com/item?id=21734529 https://news.ycombinator.com/item?id=21734529 (about https://github.com/sapir/gcc-rust https://github.com/sapir/gcc-rust but also about a GNU Rust compiler in general)
- v8dev123 6y agoI suggest you try a functional language before driving into Rust.
- adenozine 6y agoFirst off, your account is just C++ spam. So, off the bat, I've dismissed the notion of taking you seriously. I've implemented a basic ML variant before, and maybe half a dozen different lisps. Rust is only BARELY functional. A C++ guy ought to know better! Believe me, I'm not interested in Rust for Rust's sake. If there were a GNU implementation, I could see writing code generators for Rust a little less cumbersome than trying to target C or LLVM IR or Wasm. Realistically, I see Zig winning the fight that Rust is trying to fight, and C++'s headaches being replaced with Rust's headaches.
- v8dev123 6y agoI don't spam C++ and I comment on C++. There is no fight. There is made-up flame-war. Every war happen at HN and Reddit's Echochamber not at Real World. Every languages has headaches. You won't find a perfect language ever. You can't do serious Rust if you don't understand functional aspects. I know C++, Haskell and Rust. Like many says Rust is a functional language disguised as imperative. There were case studies on Rust where a one with Haskell background more like to learn it faster than a one with C++ background. The Rust book don't show you the functional parts at beginning to build your intuition but once you drive deeper you will realize what I meant. https://ceronman.com/2020/09/17/is-rust-a-functional-language-in-disguise/ https://ceronman.com/2020/09/17/is-rust-a-functional-languag...
- spoiler 6y agoIn my (limited) experience with people who tried to learn Rust with a predominantly C++ background mostly struggle with trying to shoehorn some OOP design, when the language has other idioms better auite to it. Rust does have a lot of nice ideas borrowed (hehe) from functional programming, but it's far from being FP! On a tangent: you're comment about learning a FP before learning Rust is great advice, but not for the reasons you initially intended perhaps. Learning FP in general is great, since it teaches you a different way of thinking from the "classical" way programmers think. So, it's great to learn FP for anyone, regardless of whether it's for Rust's sake (it will help a bit with reasoning about some Rust concepts and idioms, though), or not.
- AYBABTME 6y agoFor my own enlightenment, why a GNU implementation? What does it bring to the table?