4 ms·
The entire user experience is so much nicer that even if Rust was slightly worse I would prefer it. I don't miss header files, makefiles, not having a package m
by nostradumbasp 2y ago
The entire user experience is so much nicer that even if Rust was slightly worse I would prefer it. I don't miss header files, makefiles, not having a package manager, maintaining all the crazy code people wrote themselves as pet projects instead of using an existing project in an ecosystem. Thankfully its not worse, so I don't even have to weigh the odds.
- tomcam 2y agoWait isn't cargo a package manager? Not a rust expect so I'm probably missing something
- Tanjreeve 2y agoI think their point was that Rust has a batteries included package manager (cargo). Another advantage of which being that all rust projects are pretty standard in that particular aspect.
- nostradumbasp 2y agoThat is correct.
- amelius 2y agoWithout makefiles, how do you do projects with multiple languages or code generators like lex and yacc?
- nostradumbasp 2y agoWell, I don't use makefiles to deploy software with Rust. I also have never used lex or yacc, but I bet there are similar tools in the ecosystem, or wrappers for those. That would obviate what I will offer below. Often a new language in a project would define an application boundary. So those would be different containers or services. I may deploy via container images, or an OS specific installer, etc. If we aren't crossing an application boundary I may use FFI. Sometimes I use https://rust-lang.github.io/rust-bindgen/ https://rust-lang.github.io/rust-bindgen/ to smooth that over for C dependencies. There is also a nice concept called a build.rs file: https://doc.rust-lang.org/cargo/reference/build-script-examples.html https://doc.rust-lang.org/cargo/reference/build-script-examp.... There's also tools like: https://github.com/casey/just https://github.com/casey/just and https://sagiegurari.github.io/cargo-make/ https://sagiegurari.github.io/cargo-make/ I rarely use multiple languages with Rust. A lot of interpreted languages have bindings through crates and can go in to a project through Cargo (python, etc). If it involves JS/TS on desktop, I'm usually using Tauri for that. Guess it depends on the system? Hopefully that helps. You can also still use a Makefile if you want I just haven't dealt with one in a long time.
- eslaught 2y agoIf you're embedding, say, a C library inside of Rust, you can do so via a so-called "build.rs" script [1]. These run at build time so you can do pretty much whatever you want. They're not necessarily pretty, but given that Cargo isn't going to support other languages natively, it's often a less-evil option. Then there are build systems that natively support Rust in addition to other languages and know how to plug them together [2] [3] [4]. If you're already using one of these existing tools, then you don't need to roll your own, you can plug it into your existing project. Of course if you really are using Makefiles in C you're already living in the wild west, so it's on you to figure out how to add Rust to your projects in that case (or switch to a better build system). [1]: https://doc.rust-lang.org/cargo/reference/build-scripts.html https://doc.rust-lang.org/cargo/reference/build-scripts.html [2]: https://bazelbuild.github.io/rules_rust/ https://bazelbuild.github.io/rules_rust/ [3]: https://buck.build/rule/rust_library.html https://buck.build/rule/rust_library.html [4]: https://mesonbuild.com/Rust.html https://mesonbuild.com/Rust.html
- richrichie 2y agoRust is great for pet projects. Otherwise, it is a big security risk for large commercial projects, since it lacks a useful standard library and any non trivial program needs to download a thousand crates to work.
- alfiedotwtf 2y agoWhat languages are you thinking of that have all the libraries you could ever possibly need for a commercial project built-in?
- richrichie 2y agoGo and C++ have pretty decent standard libraries, for example.
- alfiedotwtf 2y agoApart from `simd`, and if you allow us to embelish by using Tokio and I'll ignore the C++'s reliance on Boost, there's not really much I can see from C++'s standard library that's anyhow wildly different from Rust. What in particular do you see lacking in Rust that you can do in C++?
- uecker 2y agoAlso from legal and liability point of view it opens a can of worms.
- alightsoul 2y agoYeah. Too much stuff to manage
- nipah 2y agoThis is pure bs considering the massive amount of large commercial projects written in C# that depends on a lot of community-made packages.