3 ms·
as browsing the api docs I kinda like lots of things from rust however, how is the portability ie. target windows/linux/mac at once? is it easy to cross compile
by merb 11y ago
as browsing the api docs I kinda like lots of things from rust however, how is the portability ie. target windows/linux/mac at once? is it easy to cross compile?
is it easy to include c/c++ header files and use them?
kinda like to link with nuance c sdk
- kansface 11y agoTo the best of my knowledge: 1. Rust is working on cross compiling support (very hard atm). 2. Rust can (pretty trivially) interface with C.
- mastax 11y agoSome things I'd add: 1. Cross compiling has worked in rust since before 1.0, but it's required some manual configuration (downloading the platform's stdlib and adding command line switches, etc.). A goal for the future is push-button cross compilation [1]. I'd also add that the standard library has most of what you'd want for cross platform compatibility, from higher-level interfaces that work cross-platform (like std::thread [2]) to lower level bindings for each platform like (std::os::unix::fs [3] or the OsStr system [4]). 2. Yep, C interfaces are pretty trivial. However, they do need to be manually defined. There is no built-in way to parse C header files or declarations. [5] [1]: http://blog.rust-lang.org/2015/08/14/Next-year.html http://blog.rust-lang.org/2015/08/14/Next-year.html [2]: https://doc.rust-lang.org/nightly/std/thread/ https://doc.rust-lang.org/nightly/std/thread/ [3]: https://doc.rust-lang.org/nightly/std/os/unix/fs/ https://doc.rust-lang.org/nightly/std/os/unix/fs/ [4]: https://doc.rust-lang.org/nightly/std/ffi/struct.OsStr.html https://doc.rust-lang.org/nightly/std/ffi/struct.OsStr.html [5]: https://doc.rust-lang.org/nightly/book/ffi.html https://doc.rust-lang.org/nightly/book/ffi.html
- steveklabnik 11y agoThere is https://crates.io/crates/bindgen https://crates.io/crates/bindgen but it's not perfect.
- merb 11y agowhat editor do you guys use? or what editor has the best rust support, yet? In golang code was easily written via st2/st3
- erickt 11y agoThere's a fierce battle between the honorable Vim-ers (https://github.com/rust-lang/rust.vim https://github.com/rust-lang/rust.vim), and those scoundrel Emac-ians (https://github.com/rust-lang/rust-mode https://github.com/rust-lang/rust-mode). Work is ongoing to have better support for code completion (https://github.com/phildawes/racer https://github.com/phildawes/racer), and I heard that there has been some preliminary work to get support into Visual Studio and JetBrains, but I'm not sure how far along that is yet.
- jhasse 11y agoI'm using Atom, it work's really well with a few Rust plugins.
- Gankro 11y agoI've submitted over a hundred patches to the standard library using only st3, for reference.
- merb 11y agowhich plugins do you used?
- Gankro 11y agoGoogle Spell Check, WordCount, and Wrap Plus for docs. LLVM for IR highlighting, Rust for Rust highlighting. I've tried racer in the past but it just doesn't scale with the current compiler architecture. I'm hoping the ongoing refactoring work will get us a great incremental/parallel/continuous compilation system for autocomplete/red-squigglies. My two biggest pains are: "trivial" errors (syntax, typos, etc) which I ideally would just see as red squigglies as I go (not a compile-fail loop); and the absolute lack of any kind of incremental compilation (which paired with the community's over-use of generics is super painful for codegen time).
- dbaupp 11y agoCross-compiling is easy... once you have the standard library for the target, which usually requires compiling the compiler manually (work on better cross-compiling is focusing on removing this requirement). For this particular library, I've been running tests for the author on some ARM hardware (both Android and plain Linux) without issue: it's just a `cargo build --target=...` away.