5 ms·
I find the fact that MS is promoting Rust in itself much more interesting than the content. Also, I would still really like to learn Rust properly, but I don't
by lorenzfx 5y ago
I find the fact that MS is promoting Rust in itself much more interesting than the content.
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.
- austincheney 5y agoI have a file system distribution application I am working on. It is written entirely in TypeScript but I envision using Rust to perform certain media execution tasks or things heavily focused upon arithmetic like financial data analysis. My application is fully isomorphic so the only value in TypeScript on the terminal is for portability of systems automation with Node. Tasks that do not require cross-OS systems portability can be done with something like Rust as a child process.
- brundolf 5y agoFwiw Rust has fantastic cross-OS systems portability in just about every way except the fact that you have to compile separately for each platform (which you obviously don't for Node). But if you aren't needing to ship a single precompiled binary, you should have no problems.
- alain_gilbert 5y agoIf you are interested in rust and want a very simple project to try it on: I made a bot library for https://turntable.fm/ https://turntable.fm/ in javascript -> https://github.com/alaingilbert/Turntable-API https://github.com/alaingilbert/Turntable-API Then I rebuilt it in go -> https://github.com/alaingilbert/ttapi 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/47282b7a334d947ccc38cf7e9179fae2cb632b96/src/main.rs#L342 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.
- rav 5y agoYou cannot access "bot" inside bot.on_speak(|| { ... }) because Rust does not know that the "bot" variable stays alive for whenever the callback is called. In this situation I would expect "bot" to be stored in an Arc, and then you would move a clone of the Arc into the callback: 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| { ... })
- alain_gilbert 5y agoeasier said than done though. I tried the second option (calling callback with a mut reference to self) but I couldn't make it all work. I think I also had issues with "async" in a closure that could not be done. Anyway, if you can make it work, I'll study your code religiously !
- masklinn 5y ago> I think I also had issues with "async" in a closure that could not be done. Yes, async closures are not currently stable, which is a huge pain in the ass: you have to use a regular closure with an `async` block inside, but said async block will usually need to be an `async move` block, which requires more contorsions because you can't just use stuff the closure owns as that'd make said closure FnOnce (the closure's item is moved into the `async move` block meaning the closure is destroyed). This is usually solved by putting the item behind an `Arc` (if it's too costly to be directly copied, or if you want / need to mutate it), this way you can `clone()` the arc so the async move block has its own "copy". Alternatively, have the closure immediately and only call into an async function or method. I can't wait for async closures, though, I'm sure others have their own bugbears but that's by far my biggest pain in the ass when using async rust.
- rav 5y agoHere you go: https://github.com/alaingilbert/rust-ttapi/pull/1 https://github.com/alaingilbert/rust-ttapi/pull/1
- mikepurvis 5y agoI did advent of code in it this past year as a learning exercise and had a great time. It’s not exactly “real world”, but it’s great for soaking up syntax, algorithms, many basic crates, etc, without locking a project into a bunch of bad design decisions.
- geodel 5y agoMicrosoft is promoting / providing courses on all sort of languages and technologies and so are other cloud providers. It is good to know but it sure is not like "Rust on Microsoft site? This changes everything!!" E.g. here are course for Go [1], for Java[2] 1. https://docs.microsoft.com/en-us/learn/paths/go-first-steps/ https://docs.microsoft.com/en-us/learn/paths/go-first-steps/ 2. https://docs.microsoft.com/en-us/learn/paths/java-on-azure/ https://docs.microsoft.com/en-us/learn/paths/java-on-azure/
- staticassertion 5y agoYeah we get it you don't like rust.
- 6c696e7578 5y agoMicrosoft don't sell software in this context. They're selling a service, primarily Azure. Azure is the mainframe that you'll be running your Rust applications on and paying Microsoft the monthly rental for that. 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.
- harikb 5y agoLooking at the contents, it doesn’t seem like they are pitching Azure specifically. The Java one shown in a sibling comment does talk about Azure API. At least the work done by MS on VsCode, Language Server, TypeScript etc is truly helping whole community. May be there is something in Rust world as well.
- ModernMech 5y agoStep 4 of this tutorial is "Install Visual Studio Code", so Microsoft is definitely using this as a vehicle to promote VSC.
- watermelon0 5y agoI don't think vscode needs any additional promotion.
- ModernMech 5y agoSure it does. I teach intro programming and I have 100+ freshmen students every semester who have no idea what visual studio code is. Students in US high school are learning Java these days due to it being the language of the AP exam, and they're not using Visual Studio or VSC. They're using IntelliJ, Netbeans, and Eclipse. Microsoft needs these kids to use VSC to get them on the Microsoft developer path early.
- steveklabnik 5y agoVS: Code has already been in first or very close to it inside the Rust community for years now. VS: Code doesn't put you down a particular "Microsoft developer path" at all.
- ModernMech 5y ago> VS: Code has already been in first or very close to it inside the Rust community for years now. True, but the directions to VSC in this case don't seem to relate to that, as these tutorials do the same for Go and Python. It's part of the strategy of this site. They want you to learn Python with VSC, and Go with VSC, not because they want you to learn Python or Go, but because they want you to use a Microsoft property in the process. Just as they aren't teaching you Git through this site, they are teaching you Git in the context of Github. All arrows are pointing toward Microsoft properties. I'm not saying this is a bad thing or wrong, but people here are asking "What's the catch" and it's all just marketing. > VS: Code doesn't put you down a particular "Microsoft developer path" at all. I disagree. Like I said, students emerging from high school are fully steeped in the Java ecosystem. A lot of them think that programming == Java. Many don't even have a concept that there is more than one programming language out there, and don't see a purpose of anything other than Java. The best thing MS can do to get people into .Net land is to get them out of JVM land. VSC is that vehicle. It doesn't matter what language they're using as long as they're using it in a Microsoft branded context. Not to mention half the people (I'm exaggerating of course) who set out to install VSC end up installing Visual Studio Community. I don't think that's intentional on Microsoft's part, but I'm sure they aren't mad at it.
- brundolf 5y agoFun Rust projects I've done that it was well-suited to: - 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 :)