https://www.rust-lang.org/learn/get-started curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
codyduong Updated
Context Rust has been at the TOP of the "most loved" programming languages list for the last few years: 🔝 https://survey.stackoverflow.co/2022/#technology-most-loved-dreaded-and-wanted This year Elixir was finally allowed on the survey again and no surprise, it's #2! 💧 😍 In previous years it was excluded from the survey so obviously it didn't appear in the results ... 🤦‍♂️ What? Rust is a multi-paradigm, general-purpose programming language. Rust emphasizes performance, type safety, and concurrency. The aspects that appeal to me about Rust are: Types + compile-time type-checking. This is mega helpful in a larger team building more complex software/systems. 👌 Memory safety; not crashing mid process! (looking at you JavaScript - and all compile-to-JS languages!) 🦺 Performance: execution speed is similar to C so if we need to perform lots of ops fast ... 🚀 "Recruit-ability" don't know if that's a word, but you get the idea: finding team members who are passionate about solving problems and writing high-performance code. i.e. the best engineers. Ref: paulgraham.com/pypar 💡 These pros are all great, but the learning curve for Rust is considerably steeper than for Elixir. 📈 We have all dabbled with Rust informally, but haven't had a need for it in a project yet. 🧑‍💻 Recently I've enjoyed watching "Code to the Moon" videos on Rust: Rust Demystified 🪄 Simplifying The Toughest Parts: https://youtu.be/TJTDTyNdJdY Rust's Alien Data Types 👽 Box, Rc, Arc: They have been an acute reminder of how much more complex Rust code is when compared to Elixir. I feel that we already have a superb Tech Stack with PETAL + Flutter until we need Rust for performance or safety reasons. All the practical reasons why Elixir is a great choice for the product/services we are building are still relevant. And the learning curve for new contributors is virtually flat for Elixir whereas having a Rust-wall to contribution on our core App might put a lot of people off ... the counter-argument is obviously that using Rust would be evidence of our focus on performance i.e. "Never waste anyone's time" How? There is a great Free / Open Source Book: https://doc.rust-lang.org/book and we have a repo waiting to be populated: https://github.com/dwyl/learn-rust There is evidence that Rust works on iOS and Android so we could explore those options but AFAIK it's all very experimental ... 🧑‍🔬 But where Rust would shine would be in handling a specific aspect of compute for us such as transforming large data structures. We don't currently have the need for it. Which is why I haven't invested the time to get good at it. I want to resist the temptation to invent a "reason" to use Rust until we have a legit need. But if anyone else reading this wants to proactively learn Rust and populate the dwyl/learn-rust repo ... It would be awesome if it could match the dwyl/learn-elixir in terms of getting setup, basic syntax and examples. I wouldn't be opposed to adopting Rust for a specific performance/safety-focussed element in the stack. For that we could either run it as a Erlang NIF function e.g: https://github.com/rusterlium/rustler or an independent "microservice" e.g. on AWS Lambda or Fly.io 💭 Todo If you want to work on this. Show your interest in learning Rust by commenting below. Start reading the docs/book Create a branch and make notes in the dwyl/learn-rust repo.
Game Title Rust Status of the Anti-Cheat 😥 Broken Tinkering Steps With this update the eac loading launcher has changed and you will get a "Disconnected: EAC: Client integrity violation" however if you change to "proton experimental" then start the game and load into a server you may be able to join an eac protected server. However you will be kicked after a minute or so. Proof of Mention https://twitter.com/playrust/status/1575061791280971778
Rainerr123 Updated
// 5. transfer the amount from user to staking pot T::Currency::transfer( &who, &Self::staking_pot(), amount, ExistenceRequirement::AllowDeath, )?; 关联类型 pub trait TestType { type AccountId; fn test_fn(who: Self::AccountId); } pub trait Config: frame_system::Config { ... type TestType: TestType<AccountId = Self::AccountId>; } impl<T: Config> TestType for Pallet<T> { fn test_fn(who: T::AccountId) { ... } } 泛型 pub trait TestType<AccountId> { fn test_fn(who: AccountId); } pub trait Config: frame_system::Config { ... type TestType: TestType<Self::AccountId>; } impl<T: Config> TestType<T::AccountId> for Pallet<T> { fn test_fn(who: T::AccountId) { ... } } /// The current storage version. const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); #[frame_support::pallet] pub mod pallet { // ... #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] #[pallet::storage_version(STORAGE_VERSION)] #[pallet::without_storage_info] pub struct Pallet<T>(PhantomData<T>); // ...
mohaijiang Updated
https://github.com/takahirox/riscv-rust
cisen Updated Rust RISC-V
Other than wasm (requirement) and IO (constraints) are there any other constraints to be aware of before going full tilt boogies on an application? TIA
FrankC01 Updated
As I noted in the orange site, it is a long-term goal to produce a parallel Rust version of J40. There are many unanswered questions before starting this process, however. Should we cooperate with the image-rs organization? Or should we let image-rs to use J40 as a dependency? J40 needs to use many image buffers; should we use ImageBuffer for this purpose, or make our own? (This is important when J40 is going to be used as a dependency!) Rust version can probably afford the default CMS as opposed to the C version (#9), but which one to use? The current design of J40 involves many layered subsystems---input source, backing buffer, container and codestream-offset-to-file-offset mapping, logical buffer, bit reader---and they may not translate clearly to Rust. In the C version the error is primarily communicated with a shared state (j40__st), which would be a bad design in Rust. But this allows for a delayed error checking, which may be crucial for some cases. The top-level of decoding process involves a coroutine (that would be a part of j40_advance in the future), which is a good abuse of C macros. I'm not very sure this can be ever translated to Rust (should I use something like genawaiter?).
https://doc.rust-lang.org/book/title-page.html
rust
b1tg Updated
Hello, I write a rust client zmqRemoteApi github.com/samuel-cavalcanti/rust_zmqRemoteApi. I rewrite some exemples: pController.py opencv.py simpleTest.py synchronousImageTransmission.cpp example.cpp please check out 😃
samuel-cavalcanti Updated
Configure the required Rust toolchain via rust-toolchain.toml.
den-mentiei Updated build
cc @ojeda @nathanchance @kees just filing an issue for the corresponding email thread.
Consider adding rust-toolchain file and if so propose a way of updating it from time to time.
zie1ony Updated help wanted
while the #2214 PR is relatively large, it would be useful to make a smaller PR exposing only the trezorhal::storage module, for use in, e.g., #2521 trezorhal::storage_field might be optionally included as well, but I am afraid that with what we know now about const generics and stack consumption, the Field<String<N>> and Field<Vec<N>> will need to be done differently.
matejcik Updated code
It should theoretically not be too hard to add compatibility for Rust 2018. The main issue is importing some traits which are only in the 2021-and-onwards preludes. The question is, is doing this desirable? What do we really gain from using 2018 - compatibility with older toolchains? If so, why not even use 2015? I feel like this needs more thought/consideration, as it could be a development hamper. The effects on the MSRV are real though - 1.56.1 is pretty high. Hell, even Debian Stable doesn't use it. As such there's three potential options for consideration: Do nothing, staying on 2021. This is the most likely path forward. After all, it does allow people who need 2018 to fall back to it with their own patches (see 3). Move to 2018. Primary caveats already mentioned. Have a separate branch on 2018. This seems like a fair option, and could be done by anyone needing 2018 on their own. Patches would be made on the 2021 (main) branch, and then as necessary, get pulled down to the 2018 branch with whatever changes are necessary.
The the time we require rust >1.56 we can switch to the 2021 edition. io_safety (#166) will requires rust 1.63.
One way to resolve this is to include the Arrow dependency and utilizing the FFI_ArrowSchema struct; which should map to the C struct ArrowSchema declared in /api/ARROW_C_DATA_INTERFACE.h Or is there another way to define this struct across the languages? FFI should do this.
Tracking issue for Rust support Add Solana submodule a1df833 Add Bazel source modules and cargo-raze f4522d7 Create script to fix aliases google/cargo-raze#474 Create build definitions for Solana crates of interest
ripatel-jump Updated
I know that the rust version isn't totally correct yet and also I need to put in unit testing
lskatz Updated
Rust 1.43 Docs Download it now for free! Android: https://play.google.com/store/apps/details?id=cc.nextlabs.rust
Sindou-dedv Updated
Thanks for taking over maintaining dotenvy! It was great to have an alternative when cargo audit started warning about the old crate being unmaintained. Unfortunately today's 0.15.4 release broke our application, which is building on rust 1.58.1. I see you're only testing on stable, beta, and nightly; would you consider supporting older toolchains as well? Many crates declare a minimum supported rust version (MSRV) so downstream users have some guidance toward the impact on their support surface.
rillian Updated
First of all, thank you for the great package, so we want to use a rusk SDK that has multiple files (20+), is there any way we can generate all of them? Would love to hear from your side, that will be a big help. Thank You
rawquesh Updated
I maintain a project called rb-sys that builds on top of the rake-compiler ecosystem, so building native extensions with Rust would have the same workflow as a C extension. I wanted make it easy to precompile Rust gems for multiple platforms in a repeatable and maintaintainable way. Naturally, I turned to RCD. After chatting with @flavorjones a bit, he nudged me to document my experience using rake-compiler-dock in the rb-sys project (thanks Mike!). Overall, I'm really happy with how everything has turned out. RCD is such an important gem for Ruby, and I'm grateful for all of the great work that has been put into it. (ps: I apologize in advance for the massive brain dump, but I knew it was the only way I could document this stuff!) How I used RCD to compile Rust extensions Here's a brief overview of things I did to make Rust extensions work with RCD. It's kind of a brain dump, but I hope it's useful. I created a bunch of platform-specific dockerfiles which all inherit FROM larskanis/rake-compiler-dock-mri-$PLAT:$VERSION. Each dockerfile installs the Rust toolchain and any other dependencies. There's a CI job that builds the docker images and pushes them to dockerhub after each release. Since the rb_sys gem knows how to generate a compatible Makefile from an extconf.rb, users can just use RCD normally by specifying the RCD_IMAGE=rbsys/$RUBY_PLATFORM:$RB_SYS_VERSION environment variable. I also made a GitHub Action to make this process a bit easier. Stumbling blocks I ran into a few issues while trying to get this to work. I'll try to document them here. Some of them are Rust specific, so take those as you will. Bundler and rake-compiler-dock (user experience) rake-compiler-dock doesn't ensure that bundle install is run for each RUBY_CC_VERSION. This means that any Rakefile that uses bundler/setup will fail with Bundler::GemNotFound (example here). For users of RCD, this is not an intuitive fix, as it's not obvious what the problem is. I've seen a few people run into this feel "actually a bit stuck" (their words). Essentially, the manual fix is to do something like: Do the bundle yourself: rvm 3.1 && bundle install && rvm 3.0 && bundle install ... Be very cautious and make sure to not include bundler/setup or extra gems in your Rakefile. IMO, neither options is ideal. I think it would be nice if RCD could run bundle install for each RUBY_CC_VERSION before invoking the commands. This would be an easy win and make RCD much more user friendly! OS differences Now this is a more general issue with the cross-platform ecosystem, and not RCD specific. However, I think it's worth mentioning. Depending on which platform you are compiling for, you may have an entirely different OS / package-manager. Some are redhat, some are debian, and the versions seem to be inconsistent. This poses a challenge when installing dependencies. Typically, it's best practice to compile any gem native libs yourself (e.g. with miniportile), but for certain things (like LLVM, CMake, etc) this is not feasible. This puts us in a situation where were have differing versions of these deps depending on the platform. Adds some complexity to the build process. CC, CXX, AR, LD and the like This one is not a huge deal, but it has tripped me up a few times. When compiling a third party library, you often need to make sure that the CC, CXX, AR, LD and other environment variables are set correctly. In the rb-sys dockerfile, I've hardcoded sane defaults for the Rust ecosystem like so: ENV CC_arm_unknown_linux_gnueabihf="arm-linux-gnueabihf-gcc" \ CXX_arm_unknown_linux_gnueabihf="arm-linux-gnueabihf-g++" \ AR_arm_unknown_linux_gnueabihf="arm-linux-gnueabihf-ar" IIRC, rake-compiler-dock does not do this automatically set CC/CXX for you. I wonder if it should? Mounting cache directories By default, rake-compiler-dock mounts the ./tmp directory so things are cached nicely. For Rust, I would also like to be able to cache the ./target directory. I finagled this once, but I don't remember how. I think it's possible, but it's not obvious how to do it. I wonder if RCD should support some type of configuration file to make this type of thing easier? # .rake-compiler-dock.yml ???? global: extra_mounts: ["./target:/wherever/the/gem/is/target"] env: BAR: baz x86_64-linux: image: larskanis/my-custom-mri-x86_64-linux:latest env: FOO: bar Different compilers This is probably biased for the Rust world, but it would be amazing Ruby were built using clang + lld for every platform (ideally, the same version of clang for each). This would fix so many headaches and edge cases. Docker Woes Again, not an RCD problem, but a more general grief... Docker for Mac is almost un-useably slow for me on M1 (and bug ridden). The slow feedback cycle is extra-painful when debugging build issues. Using a remote DOCKER_HOST doesn't work either since directories cannot be mounted from the host. The only solution I've really found is ssh'ing into another machine. :/ I'm curious if anyone else has run into this, and if they know a better way? Testing Testing precompiled gems is a bit of a pain. To solve this, I've created a useful monstrosity to make this a bit easier. It's not ideal, but I'm able to run an entire test suite against a precompiled gem, which is nice. [Here's the Gist][gist] if you're curious. Maybe we could extract some of this into something proper? It would be nice to have a golden path for testing precompiled gems, because as of now it's a bit of a lone-wolf situation. Summary Thanks to RCD, we have a way to reliably build cross-platform gems with Rust. Although there are a couple stumbling blocks for new users, hopefully we can collaborate to make it easier. PS: Would love to integrate the rb-sys docker stuff as well, if interested. ❤️ Ian
ianks Updated
Is your feature request related to a problem? Please describe. Currently, Rust is not officially supported https://aws-otel.github.io/docs/getting-started/x-ray Describe the solution you'd like Need the ability to manual instrument a Lambda with custom runtime (Rust) with X-Ray here Describe alternatives you've considered None available Additional context tried using the "aws-otel-collector-arm64-ver-0-56-0" I can see my spans in CloudWatch but I am pretty sure I miss something because I don't see any span in x-ray fn init_tracer() -> sdkTracer { global::set_text_map_propagator(XrayPropagator:: stdout::new_pipeline() .with_trace_config( config() .with_sampler(Sampler::AlwaysOn) .with_id_generator(XrayIdGenerator::default()), ) .install_simple() } #[tokio::main] async fn main() -> Result<(), Error> { let tracer = init_tracer(); tracing_subscriber::fmt() .with_ansi(false) .without_time() .with_max_level(tracing_subscriber::filter::LevelFilter::INFO) .init(); let config = aws_config::load_from_env().await; let dynamodb_client = aws_sdk_dynamodb::Client::new(&config); // other stuff lambda_http::run(service_fn(|event: Request| { tracer.in_span("root", |cx| { my_handler(event, cx) }) })).await?; global::shutdown_tracer_provider(); Ok(()) } pub async fn my_handler(event: Request, ctx: Context) -> Result<impl IntoResponse, Error> { ctx.span().add_event("calling dyanmodb", vec![]); //dynamodb query ctx.spaIt).add_event("doing something else", vec![]); } Thanks
ymwjbxxq Updated
Previous Next