Also, I would still really like to learn Rust properly, but I don't have any use for it currently either at my day job nor for my side projects.
1. https://docs.microsoft.com/en-us/learn/paths/go-first-steps/ 2. https://docs.microsoft.com/en-us/learn/paths/java-on-azure/
I made a bot library for https://turntable.fm/ in javascript -> https://github.com/alaingilbert/Turntable-API
Then I rebuilt it in go -> https://github.com/alaingilbert/ttapi
Then I tried to write it in rust, but the pattern isn't really good with the borrow checker, I cannot make this work -> https://github.com/alaingilbert/rust-ttapi/blob/47282b7a334d...
So if someone can find a good pattern to use for this type of library, I would gladly want to learn.
Pull requests are welcome, I'm also always on discord if you want to chat.
let bot = Arc::new(bot);
bot.on_speak({ let bot = bot.clone(); move |evt: SpeakEvt| { ... }});
Edit to add: Alternatively, the bot could pass a mutable reference to itself to the callback when it is invoked. bot.on_speak(|bot, evt: SpeakEvt| { ... })It's a bit of boilerplate to define, but then your client code can look something like this:
while Some(event) = bot.try_next().await? {
match event {
Event::Speak { text, .. } => {
bot.speak(&text).await?;
}
_ => {}
}
}But this is just the start of your problems. To use Async, your Fn type should now also return a Future since these async tags will infect all your functions and their returns.
tl;dr: I'll start over and use Channels.
Microsoft don't care if that is a Rust, Java, Python, Visual Basic or PowerShell application. They only care that you choose to do it in Azure (so lets learn the Microsoft centric ways early) though.
- Conway's Game of Life
- Graphics stuff (raytracing, procedural generation, etc)
- Parsers/interpreters/compilers
- Command-line tools
None of these were things I needed exactly, but that's the fun of side projects :)
https://opensrcsec.com/open_source_security_announces_rust_g...
https://www.embecosm.com/2021/01/12/gcc-rust-how-it-can-be-a...
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
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
(There's a fourth project, https://github.com/sapir/gcc-rust, but it seems abandoned)
If that's important, why not pretend that your project is in "Clang C++" rather than C++? Clang compiles to at least all the platforms that Rust does.
> not to mention the whole mess around dependencies in C++ code
Agreed. I feel like the proliferation of header-only libraries is a sign that something's seriously wrong here.
Standards exist to make multiple implementations palatable.
See Python for a stunning example where they botched the standardization effort and ruined the language for good.
https://thephilbert.io/ is the primary developer's blog and has status updates.
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.
[1] https://msrc-blog.microsoft.com/2019/11/07/using-rust-in-win...
https://docs.microsoft.com/en-us/cpp/code-quality/using-sal-...
1: https://docs.microsoft.com/en-us/windows-hardware/drivers/de...
They are one of the founding member of Rust Foundation, and from the article it seems that they do use Rust in some of their products.
Not clear why one would choose this over the official rust documentation and tutorials.
Oh and also - it’s a trap. Microsoft are not friends of free software.
Please don't make vague accusations. If you have something substantive to add - describe it.
How does a freely available tutorial on a programming language have anything to do with someone's position on free software?
Would I call it a trap? No, but MS hasn't shown well enough that they are friends to free software.
> For example, if your distribution uses the GNOME desktop, locate the Show Applications icon (a grid of dots) docked on the left side of the screen, usually near the bottom. This icon opens a full-screen list of all applications installed on your system.
Why would they be teaching Linux beginners how to use GNOME if that was their opinion?
"Until then, you can think of String data as string data that can change as your program runs, while &str are immutable views into string data that do not CHANGES as your program runs."
// Instantiate a tuple struct by passing the values in the same order as defined. let origin = Point2D(0, 0) // Missing ;