![Community banner](https://programming.dev/pictrs/image/785b76dd-e87f-4fc9-9df8-db835c373155.jpeg)
![rust](https://programming.dev/pictrs/image/1f7e5534-88d3-4d6f-bc57-7cda9553890f.webp?format=webp&thumbnail=48)
Rust
- JetBrains RustRover Is Released and Includes a Free Non-Commercial Optionblog.jetbrains.com RustRover Is Released and Includes a Free Non-Commercial Option | The RustRover Blog
We’re excited to announce the general availability of RustRover, the powerhouse IDE for Rust developers!
Rust Rover is out of preview and is free for non-commercial use. The only caveat is:
> It’s also important to note that if you’re using a non-commercial license, you cannot opt out of the collection of anonymous usage statistics.
- Types Team Update and Roadmap | Rust Blogblog.rust-lang.org Types Team Update and Roadmap | Rust Blog
Empowering everyone to build reliable and efficient software.
- Rust Container Cheat Sheet
Found this on Mastodon https://fosstodon.org/@dpom/112681955888465502 , and it is a very nice overview of the containers and their layout.
- Dioxus Labs + “High-level Rustdioxus.notion.site Notion – The all-in-one workspace for your notes, tasks, wikis, and databases.
A new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team
- What are you working on this week? (June. 23, 2024)
Hi rustaceans! What are you working on this week? Did you discover something new, you want to share?
- General purpose scripting language with no non-Rust dependencies
Is there a good general-ish purpose scripting language (something like Lua on the smaller end or Python on the bigger) that’s implemented in only Rust, ideally with a relatively low number of dependencies?
Have you used it yourself, if so for what and what was your experience?
Bonus points if it’s reasonably fast (ideally JITed, though I’m not sure if that’s been done at all in Rust).
- Frequency detection crate
I've needed to detect a frequency of an audio signal a couple of times in my life, but I cannot for the love of me remember what does the FFT output actually mean. So I took this knowledge out of my latest project and packed it up in this crate.
Also this is my first potentially useful published crate, so if I missed anything, please let me know!
- Rust just merged two new very fast sort implementations into stdlibgithub.com Replace sort implementations by Voultapher · Pull Request #124032 · rust-lang/rust
This PR replaces the sort implementations with tailor-made ones that strike a balance of run-time, compile-time and binary-size, yielding run-time and compile-time improvements. Regressing binary-s...
name diff % speedup slice::sort_large_random -65.49% x 2.90 slice::sort_large_strings -37.75% x 1.61 slice::sort_medium_random -47.89% x 1.92 slice::sort_small_random 11.11% x 0.90 slice::sort_unstable_large_random -47.57% x 1.91 slice::sort_unstable_large_strings -25.19% x 1.34 slice::sort_unstable_medium_random -22.15% x 1.28 slice::sort_unstable_small_random -15.79% x 1.19
- I've created a CLI tool to download Rust web books as EPUBgithub.com GitHub - mawkler/rust-book-to-epub: Rust Book to EPUB converter
Rust Book to EPUB converter. Contribute to mawkler/rust-book-to-epub development by creating an account on GitHub.
Hi! I've created a CLI tool for downloading Rust web books (like The Rust Programming Language) as EPUB, so that you can easily read them on your e-book reader. The tool is heavily based on this gist and a lot of proompting.
Check it out here: https://github.com/mawkler/rust-book-to-epub
- Cargo-playdate 0.5 released 🎉github.com Release 2024.06.18 · boozook/playdate
TL;DR What's Changed Refactoring some build system parts including final product matching, that gives support of cargo's auto-targets such as bin and example, as well as args like --all-targets me...
That was a hard long adventure, massive refactoring with bug-fixing 🥵
- Sophia: a Rust toolkit for RDF and Linked Datagithub.com GitHub - pchampin/sophia_rs: Sophia: a Rust toolkit for RDF and Linked Data
Sophia: a Rust toolkit for RDF and Linked Data. Contribute to pchampin/sophia_rs development by creating an account on GitHub.
I went to look into the activitypub federation package from Rust and noticed that it does not support JSON-LD. This took me to a search into other libraries, which got me to RDF-based crates. Just thought it was a good idea to share.
- What are you working on this week? (June. 16, 2024)
Hi rustaceans! What are you working on this week? Did you discover something new, you want to share?
- Allow argument in macro to be Option<T> or T
Hey,
Is there any way to create a macro that allows a
Some<T>
orT
as input?It's for creating a
Span
struct that I'm using:rust struct Span { line: usize, column: usize, file_path: Option<String>, }
...and I have the following macro:
```rust macro_rules! span { ($line:expr, $column:expr) => { Span { line: $line, column: $column file_path: None, } };
($line:expr, $column:expr, $file_path: expr) => { Span { line: $line, column: $column file_path: Some($file_path.to_string()), } }; } ```
...which allows me to do this:
rust let foo = span!(1, 1); let bar = span!(1, 1, "file.txt");
However, sometimes I don't want to pass in the file path directly but through a variable that is Option<String>. To do this, I always have to match the variable:
```rust let file_path = Some("file.txt");
let foo = match file_path { Some(file_path) => span!(1, 1, file_path), None => span!(1, 1), } ```
Is there a way which allows me to directly use
span!(1, 1, file_path)
wherefile_path
could be"file.txt"
,Some("file.txt")
orNone
?Thanks in advance!
- Announcing Rust 1.79.0blog.rust-lang.org Announcing Rust 1.79.0 | Rust Blog
Empowering everyone to build reliable and efficient software.
- Rust Foundation - Announcing the Safety-Critical Rust Consortiumfoundation.rust-lang.org Rust Foundation
The Rust Foundation is an independent non-profit organization to steward the Rust programming language and ecosystem, with a unique focus on supporting the set of maintainers that govern and develop the project.
- Rust Toolchain Question
Morning all!
Okay, let me start out by saying that I know absolutely sweet F.A. about Rust. There's simply something I'm trying to get working and it's required me to make a few changes. And with every change, it's getting closer to building successfully… or so I hope.
Anyway, I'm here to bother you for a reason, not just to waffle. I was wondering if someone could be kind enough to explain this
rust toolchain
malarkey?When I started trying to "fix" this thing (it's a dockerfile), I updated it to build from the latest and greatest rust and then updated to the latest and… I digress, point being it's failing some cargo stuff and I have reason to believe it's because of the rust toolchain which is set as
nightly-2022-07-19
now, I thought I could just set that tostable
, but upon reading some docs, I need to set the date. I was just wondering if someone could explain why? Why can't I just have the toolchain set tolatest
? It seems complicated for nothing. - [Gitoxide April] Welcome Eliah, and `gitoxide` for GitButlergithub.com [April] Welcome Eliah, and `gitoxide` for GitButler · Byron gitoxide · Discussion #1375
This month was very productive, just not directly for gitoxide. And it's notably the first month in my recollection where that happened. There must be a special reason for it, and bluntly, it's jus...
- `LazyCell`/`LazyLock` stabilized in nightlymastodon.social Rust Weekly 🦀 (@rust_discussions@mastodon.social)
`LazyCell`/`LazyLock` stabilized in nightly https://github.com/rust-lang/rust/pull/121377 Discussions: https://discu.eu/q/https://github.com/rust-lang/rust/pull/121377 #programming #rustlang
- What are you working on this week? (May. 26, 2024)
Hi rustaceans! What are you working on this week? Did you discover something new, you want to share?
- I just released my first OSS library! Introducing Aqueducts, a framework to build ETL pipelines using rustgithub.com GitHub - vigimite/aqueducts: Framework to build data pipelines declaratively
Framework to build data pipelines declaratively. Contribute to vigimite/aqueducts development by creating an account on GitHub.
This is my first try at anything open source so any feedback is welcome :)
- What are you working on this week? (May. 19, 2024)
Hi rustaceans! What are you working on this week? Did you discover something new, you want to share?
- Dart Macros
YouTube Video
Click to view this content.
Very impressive IDE integration for Dart macros. Something to aspire to.
- Rust's denotational semantics make memory safety possible!
VOID WRONG
It seems like I misunderstood some stuff.
----
Over the years, up until Rust, there were 4 ways to have a 'safe' language:
- A virtual machine (e.g. most languages today) --- whether it's a high-level (scripting languages) one or low-level one (JVM, CLR)
- What C++ and similar languages do, destructors, compile-time bound checks, make a global heap and shit in it, make a local stack and piss in it, etc (basically my AllocPPx.pl but baked into the language)
- Bake the VM in with the machine code. That's what D and Go do, and I think Nim does that too. This will make the point of your language being compiled entirely moot imo.
- Finally, the most 'controversial' decision for imperative-loving chuds: make a functional language. ML/Scheme/CLisp achieve memory safety through closures. Haskell achieves this through Monads. Functional languages have a property which allows them to be be both compiled into machine code and bytecode, and also, interpreted like an scripting language.
The problem with all these approaches is the trade-off between safety and speed. There's another factor, and that is low-level access to the system. Languages like OCaml came close to achieving a balance, and that's why Rust bassed itself on it.
Most imperative languages have 'operational semantics', but not 'denotational semantics'. You can't describe what C does with math. What C does depends on the platform, the CPU, etc.
Rust's safety is achieved by 'flattening out' the memory model of a functional language like Ocaml. OCaml is a language with denotational semantics, because it's a functional language. Rust is an imperative language but it has denotational semantics. At least when comes to memory management.
I am not going to even attempt to describe the denotational semantics of Rust because I am just an amatuer and i don't have a master's in LDT. But if someoen tries, they could.
I think people might have already done it. I am not sure.
If you tell me no, and Rust does not have denotational semantics, I stand by my great-great grandfather's barber's grave that yes, it does!
So why do I say Rust 'flattens out' the functional model for memory management? It does at least with lifetimes. So imagine this: lifetimes are just 'let' bindings, but with a different syntax.
OCaml:
ocaml let rec factorial = function | 0 -> 1 | n -> n * factorial (n - 1);;
Scheme
scheme ; This uses `let` under the hood (define (factorial n) (if (<= n 1) 1 (* n (factorial (- n 1)))))
So these two in Rust would be:
rust fn factorial<'a>(n: u32) -> u32 { match n { 0 => 1, _ => n * factorial(n - 1), } }
I know'a
is almost useless here, but what I meant was, that'a
makes it similar to the 'let' bindings in the prior to examples!Semantics here is clear. Right?
But C:
int factorial(int n) { if (n == 0) return 1; else return n * factorial(n - 1); }
We do have operational semantics here, but who's to say what are the denotational semantics? Right? What is a 'function' in C? Well most C compilers translate it to an Assembly subroutine, but what if our target does not support labels, or subroutines?
You see what I am arriving at?
Conclusion
Rust is a semi-functional, semi-imperative language, but the difference between Rust and other languages with functional aspects is: denotional semantics!
Note: A language having lambda closures does not make it 'functional', you can do that in GNU C too ffs! Denotational semantics make it functional.
- I found a tool that allows compiling Rust to JVM bytecode (make JAR files from Rust, if you dare?)github.com GitHub - davidar/lljvm: Low Level Java Virtual Machine
Low Level Java Virtual Machine. Contribute to davidar/lljvm development by creating an account on GitHub.
I thought this might interest you Rust folk. This is kinda like an LLVM bitcode to JVM bytecode translator. So run
rustc
with--emit=llvm-ir
(I think that's the flag) and then pass the bitcode image to this program, then get JVM bytecode which you can make a JVM bytecode archive (JAR) from it. Could be an interesting? The author says it can JVM code from Clang output, so why not Rustc?Keep in mind that these are two different beasts, JVM is designed for a safe virtual machine and LLVM is chiefly used to be translated into machine code. However, stupider and more wonderful things have been done with LLVM and JVM, for example, there's an LLVM to 6502 translator, so you could be making NES games with Rust.
I will test this in a few days, busy implementing my own JVM (hope I can do it) and I don't have the Rust toolchain installed on my system. But hey maybe someone can make a Cargo plugin from it (is it possible?)
Thanks, later.
- Tomorrow is a crab-day 🦀 — Rust birthday 🎉blog.rust-lang.org Announcing Rust 1.0 | Rust Blog
Empowering everyone to build reliable and efficient software.
#rust #rustlang
- cushy v0.3.0 Releasedgithub.com Release v0.3.0 · khonsulabs/cushy
Breaking Changes This crate's MSRV is now 1.74.1, required by updating wgpu. wgpu has been updated to 0.20. winit has been updated to 0.30. All context types no longer accept a 'window life...
- slint 1.6.0 Releasedgithub.com Release 1.6.0 · slint-ui/slint
Release announcement with the highlights: https://slint.dev/blog/slint-1.6-released Detailed list of changes: ChangeLog