5 ms·
One of the awesome things about Rust is how easy it is to build Rust projects. Looking at the readme, it's a simple `cargo run` to compile and run the project.
by returningfory2 4y ago
One of the awesome things about Rust is how easy it is to build Rust projects. Looking at the readme, it's a simple `cargo run` to compile and run the project. Versus CPython where you have to worry about Makefiles and configuration and third party libraries in your system.
- codetrotter 4y agoFor a lot of Rust projects this is true. But if they interface with external libraries then some extra steps may be needed. Not to take away from the excitement. I love Rust and cargo is great.
- nrabulinski 4y agoExtra steps i.e. install pkg-config and said library on your system
- codetrotter 4y agoIt’s gonna depend on what kind of system you use and what kind of external things are needed. It can be more involved, it can be less involved. For example https://github.com/servo/servo https://github.com/servo/servo seems a bit involved to set up for development but at the same time not too bad either.
- javier2 4y agoI kind of hate Rust, but I do think cargo looks great!
- xcdzvyn 4y agoThat's what Nix is for ;)
- noloblo 4y agoYes rust has user friendly tooling that's far superior to pip poetry pipenv and venv etc Since rust Python can theoretically access Tokio does it make it avoid the cpython gil issues
- seabrookmx 4y agopip/poetry/venv are all for python code, whereas the op is talking about building the CPython interpreter itself which is written in C. Hence makefiles etc.
- mindwok 4y agoRustPython still uses the GIL. The GIL is not a consequence of technical limitations in the language used for the interpreter, meaning you could also remove the GIL in CPython. But it’s a design decision that makes many things in the interpreter and the code simpler.
- youknowone 4y agoRustPython doesn't use GIL at all. RustPython use individual lock for each data type. So RustPython has more multithreading bugs.
- outworlder 4y agoYou mean more multithreaded bugs are possible in the Python code that it's running, right? Not that RustPython itself has more multithreading bugs?
- youknowone 4y agoRustPython itself has more bugs. e.g. `dict()` doesn't work well on some multithread scenario yet.
- noloblo 4y agoWhy does rust python need to use Gil Is it an artificial artifact or is it necessary to make rust python work?
- schemescape 4y agoDoes Cargo support building C or C++ dependencies? I see a lot of projects with a mix of Rust and C/C++ and I’d assumed that just meant I’d have to deal with 2 build systems. I looked at Nix to help with multi-language builds (and cross compiling), but only had limited success.
- shakow 4y agoIt could technically do it with a build.rs script, but it typically expects to find the .so/.a on your system.
- jeroenhd 4y agoIt does support calling into other compilers and toolchains through build scripts and such. Take cc-rs[0] for example: this allows building C and C++ files natively without even calling an executable yourself. In practice, I'd expect libraries to just call make/cmake/ninja for you, or (like openssl-sys) ask you to install the necessary libraries using your favourite package manager. [0]: https://github.com/rust-lang/cc-rs https://github.com/rust-lang/cc-rs
- schemescape 4y agoThat’s pretty much what I was looking for, thanks!
- shaunsingh0207 4y agoYes, through a `build.rs` file and crates such as `pkg-config`. Quite a few projects depends on c/c++ source and are merely rust bindings. However, the majority of crates don't require external dependencies
- slaymaker1907 4y agoThat's the biggest killer feature for me vs. C/C++. Any time I write C++, I avoid libraries like the plague unless they do a ton of stuff because it's such a hassle.
- cozzyd 4y agocpython isn't particularly hard to compile. Pretty much just git clone, ./configure, and make in my experience.