#rust
posts tagged #rust
preview
cross-posted from: lemmy.bestiver.se/post/1442424
cross-posted from: lemmy.bestiver.se/post/1442424
preview
I found the author post on Reddit and decide to repost it here because it looks like an interesting project. Original text:
Note that the JIT is a beta feature so it is not production ready.
Is this the same as LuaJIT?
No. LuaJIT is tracing JIT while Tsuki is method JIT. LuaJIT should be faster in every cases on vanilla Lua syntax. The ultimate goal of JIT in Tsuki is to boost performance on extension syntax that will be implemented in the future (yes Tsuki will become a superset of Lua 5.4).
How it is implemented?
What JIT currently does is compile Lua instructions into machine code with Cranelift. In other words, it just generate the same code that Rust compiler generate to execute Lua instruction, except it does not read the instruction to execute at runtime. The benefits from this is it eliminate the jump table for the instruction and it known which VM registers to use during compile time. Performance?
On fannkuch-redux benchmark, Tsuki is faster than Lua about 38% on AMD Ryzen 5 5600G and 63% on Apple M1. There are some rooms to optimize this so I expect the performance can be improved in the future.
I found the author post on Reddit and decide to repost it here because it looks like an interesting project. Original text:
Note that the JIT is a beta feature so it is not production ready.
Is this the same as LuaJIT?
No. LuaJIT is tracing JIT while Tsuki is method JIT. LuaJIT should be faster in every cases on vanilla Lua syntax. The ultimate goal of JIT in Tsuki is to boost performance on extension syntax that will be implemented in the future (yes Tsuki will become a superset of Lua 5.4).
How it is implemented?
What JIT currently does is compile Lua instructions into machine code with Cranelift. In other words, it just generate the same code that Rust compiler generate to execute Lua instruction, except it does not read the instruction to execute at runtime. The benefits from this is it eliminate the jump table for the instruction and it known which VM registers to use during compile time. Performance?
On fannkuch-redux benchmark, Tsuki is faster than Lua about 38% on AMD Ryzen 5 5600G and 63% on Apple M1. There are some rooms to optimize this so I expect the performance can be improved in the future.
preview
I’m happy to announce the release of Diesel 2.4.0, a ORM and query builder for Rust. This release contains the development of the last 14 months, including the contributions of 76 people.
Headline features include:
- Support for database views
- Improved support for enums
- Support for batch update statements
- A distinct backend for MariaDB
- Extended support for SQLite functionality, including hooks, pragmas and BLOB’s
- Support for using Diesel (SQLite) in a no-std environment
- Migrations written in Rust
- Support for
diesel-asyncin#[derive(MultiConnection)]
See the announcement blog post about details to each feature: diesel.rs/news/2_4_0_release/
I would like to use this possibility to thank all contributors and sponsors that made this release possible. A special thank goes to Luca for his large contributors to the release, to Prototype Found for funding the development of the Database View support and to RustFoundation for funding the general maintenance.
Nevertheless, the Diesel project is always looking for support. You can help by:
- Contributing Code, Documentation, or Guides.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping to triage issues in our issue tracker
- Sponsoring the maintainers.
- Filling out this survey about about the current state and future developments of Diesel (EDIT: lemmy seems to break that link, please use that one from the blog post instead)
Feel free to answer questions about the release or Diesel in general, I will try to answer them in the next days.
I’m happy to announce the release of Diesel 2.4.0, a ORM and query builder for Rust. This release contains the development of the last 14 months, including the contributions of 76 people.
Headline features include:
- Support for database views
- Improved support for enums
- Support for batch update statements
- A distinct backend for MariaDB
- Extended support for SQLite functionality, including hooks, pragmas and BLOB’s
- Support for using Diesel (SQLite) in a no-std environment
- Migrations written in Rust
- Support for
diesel-asyncin#[derive(MultiConnection)]
See the announcement blog post about details to each feature: diesel.rs/news/2_4_0_release/
I would like to use this possibility to thank all contributors and sponsors that made this release possible. A special thank goes to Luca for his large contributors to the release, to Prototype Found for funding the development of the Database View support and to RustFoundation for funding the general maintenance.
Nevertheless, the Diesel project is always looking for support. You can help by:
- Contributing Code, Documentation, or Guides.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping to triage issues in our issue tracker
- Sponsoring the maintainers.
- Filling out this survey about about the current state and future developments of Diesel (EDIT: lemmy seems to break that link, please use that one from the blog post instead)
Feel free to answer questions about the release or Diesel in general, I will try to answer them in the next days.
preview
What’s in 1.100.0 stable
- Never type
- Allocator API
- DropGuard API
- Conjuring zero-sized types
- Reporting unused dependencies in Cargo
- Reducing Cargo cache collisions
- Cargo min-publish-age
- Stabilized APIs
What’s in 1.100.0 stable
- Never type
- Allocator API
- DropGuard API
- Conjuring zero-sized types
- Reporting unused dependencies in Cargo
- Reducing Cargo cache collisions
- Cargo min-publish-age
- Stabilized APIs
preview
Here the verus github page with some code samples in color:
Here the verus github page with some code samples in color:
preview
I’m happy that the support for Aarch64 in rustc_codegen_gcc is getting closer to x86-64! Next step is some bug fixing and testing before doing a crater run.
I’m happy that the support for Aarch64 in rustc_codegen_gcc is getting closer to x86-64! Next step is some bug fixing and testing before doing a crater run.
preview
I wanted to implement the Signal protocol for a series of secure messaging apps I’m working on, so I built this project to test and use in my own work. It’s still far from finished, but I think it’s at a stage where it’s worth sharing with the community.
IMPORTANT DISCLAIMER: This project is not professionally audited and is not production-ready. I do not recommend anyone use this in their own code yet. It is provided strictly for testing, experimentation, and demo purposes. I used AI as an assistant to help build this, so double-check everything before taking it seriously.
Project Links:
- GitHub: github.com/positive-intentions/signal-protocol
- Live Demo: signal.positive-intentions.com
- Formal Verification Docs: glitr.io/docs/technical/…/signal-protocol
- Security Feedback (ROS): reddit.com/…/security_audit_feedback_from_radical…
Current Status & Development:
- Spec Alignment: The goal is to fully align with the official Signal protocol spec.
- Testing: It includes unit tests, but due to WASM testing limitations, I also added a Storybook-like UI to run and test it directly within a browser environment.
I wanted to implement the Signal protocol for a series of secure messaging apps I’m working on, so I built this project to test and use in my own work. It’s still far from finished, but I think it’s at a stage where it’s worth sharing with the community.
IMPORTANT DISCLAIMER: This project is not professionally audited and is not production-ready. I do not recommend anyone use this in their own code yet. It is provided strictly for testing, experimentation, and demo purposes. I used AI as an assistant to help build this, so double-check everything before taking it seriously.
Project Links:
- GitHub: github.com/positive-intentions/signal-protocol
- Live Demo: signal.positive-intentions.com
- Formal Verification Docs: glitr.io/docs/technical/…/signal-protocol
- Security Feedback (ROS): reddit.com/…/security_audit_feedback_from_radical…
Current Status & Development:
- Spec Alignment: The goal is to fully align with the official Signal protocol spec.
- Testing: It includes unit tests, but due to WASM testing limitations, I also added a Storybook-like UI to run and test it directly within a browser environment.
preview
Cryptography is considered to be one of the best application of rust. So I was wondering what cryptography crates people usually use. I see many crates that are abandoned, and other discussions I found on this topic are 2+ years old.
Cryptography is considered to be one of the best application of rust. So I was wondering what cryptography crates people usually use. I see many crates that are abandoned, and other discussions I found on this topic are 2+ years old.
preview
So yeah, as the probably unnecessarily long title says, this is a CLI that displays the current playing lyrics, but instead of trying to go online and fetch a match it just uses the already there xesam:asText property in MPRIS.
Sadly a lot of popular players that implement the MPRIS2 standard still don’t implement that specific one, so it wont work with them. Even the one used in the showcase had to be modified, tho I am hopefully gonna upstream it soon.
I am very strict about AI usage, so for this project the only hint of AI that was used was for tab auto completion that is just used for boilerplate like, idk, implementing the Default trait for PlayerState (not including the actual tricky metadata_last_updated part). Safe to say it was only one notch above no AI at all.
So yeah, here you go give it a try and feel free to roast me, after all this is my first cli and cargo publish ;)
So yeah, as the probably unnecessarily long title says, this is a CLI that displays the current playing lyrics, but instead of trying to go online and fetch a match it just uses the already there xesam:asText property in MPRIS.
Sadly a lot of popular players that implement the MPRIS2 standard still don’t implement that specific one, so it wont work with them. Even the one used in the showcase had to be modified, tho I am hopefully gonna upstream it soon.
I am very strict about AI usage, so for this project the only hint of AI that was used was for tab auto completion that is just used for boilerplate like, idk, implementing the Default trait for PlayerState (not including the actual tricky metadata_last_updated part). Safe to say it was only one notch above no AI at all.
So yeah, here you go give it a try and feel free to roast me, after all this is my first cli and cargo publish ;)
preview
Rustweek 2027 Call for Proposals is open for anyone interesting in submitting a talk to the conference. RustWeek is in Utrecht, The Netherlands, May 24–29 2027.
Rustweek 2027 Call for Proposals is open for anyone interesting in submitting a talk to the conference. RustWeek is in Utrecht, The Netherlands, May 24–29 2027.
preview
Was recently somewhat surprised that you can’t just copy a Rust executable into a ´scratch´ container and have it work, so this is a cool blog post to find in my RSS feed.
I’m guessing, if you’re doing something less complex, then you just need the ´musl´ target and the allocator…
Was recently somewhat surprised that you can’t just copy a Rust executable into a ´scratch´ container and have it work, so this is a cool blog post to find in my RSS feed.
I’m guessing, if you’re doing something less complex, then you just need the ´musl´ target and the allocator…
preview
See also the discussion for Klabnik’s Arguing about arguments
See also the discussion for Klabnik’s Arguing about arguments
preview
1.100 is looking to be an interesting release, with the allocator api and never type (and dependency cooldowns in Cargo). Which is kind of nice for a round number release.
1.100 is looking to be an interesting release, with the allocator api and never type (and dependency cooldowns in Cargo). Which is kind of nice for a round number release.
preview
cross-posted from: lemmy.zip/post/71977304
I think most of my comments and error messages are written in Portuguese, but this is only a prototype, so please ignore that.
Kata manages memory with per-fiber bump arenas backed by structured concurrency — no garbage collector, no borrow checker, no reference counting; escape analysis decides at compile time whether each value stays local or escapes to the caller’s arena, and ; in actions distinguishes “local computation” from “value that escapes.” Refined types (data (Int, > _ 0) as PositiveInt) carry logical predicates validated at compile time, participate in multiple dispatch, and can delegate interface implementations to their base type through refines — a fallback mechanism with no equivalent in Rust or Haskell. The pure/impure boundary is not a monad you thread through your code — functions (lambda) and actions (action) are separate syntactic domains with their own structural rules, enforced at compile time; where Haskell tracks purity through IO as a type-level effect, Kata makes it a property of the syntax you write.
Memory
• Kata: Per-fiber bump arenas + escape analysis; no GC, no borrow checker
• Python: Refcounting + cycle GC
• Haskell: Tracing GC
• Rust: Ownership + borrow checker
Refined types
• Kata: data (Int, > _ 0) as PositiveInt — predicates validated at compile time, participate in dispatch, refines delegates interfaces to base
• Python: Not available
• Haskell: Liquid Haskell (external plugin, not core)
• Rust: Not available
Purity
• Kata: Physical barrier: separate syntax, operators, structural rules
• Python: Not enforced
• Haskell: Monadic IO (type-level effect)
• Rust: Not enforced
Conditionals
• Kata: Pattern matching + guards (exhaustiveness enforced)
• Python: if/elif/else
• Haskell: if + pattern matching
• Rust: if + match
Backend • Kata: Cranelift JIT/AOT (native, no VM)
• Python: CPython interpreter
• Haskell: GHC (LLVM/native)
• Rust: LLVM (native)
The repo is at github.com/ArthurJ/Kata — build with cargo build, then try kata repl, kata run examples/, or kata test. I’d love feedback on the language design: what feels right, what feels wrong, what you’d do differently.
action greet (name::Text) => Unit echo!(+ "Hello, " (+ name "!")) action main greet!("World") greet!("Kata") main!()enum BMI Underweight(< _ 18.5) Normal(<= _ 25.0) Overweight(<= _ 30.0) Obese action main echo!(BMI 17.0) echo!(BMI 22.0) echo!(BMI 27.0) echo!(BMI 35.0) main!()fizzbuzz :: Int => Text lambda x: both: "FizzBuzz" fizz: "Fizz" buzz: "Buzz" otherwise: show x with fizz := divisible x 3 buzz := divisible x 5 both := and fizz buzz divisible :: Int Int => Boolean lambda x n: match div x n Ok q: = x (* n q) Err _: Boolean::False action main for i in [1..16] echo!(fizzbuzz i) main!()
cross-posted from: lemmy.zip/post/71977304
I think most of my comments and error messages are written in Portuguese, but this is only a prototype, so please ignore that.
Kata manages memory with per-fiber bump arenas backed by structured concurrency — no garbage collector, no borrow checker, no reference counting; escape analysis decides at compile time whether each value stays local or escapes to the caller’s arena, and ; in actions distinguishes “local computation” from “value that escapes.” Refined types (data (Int, > _ 0) as PositiveInt) carry logical predicates validated at compile time, participate in multiple dispatch, and can delegate interface implementations to their base type through refines — a fallback mechanism with no equivalent in Rust or Haskell. The pure/impure boundary is not a monad you thread through your code — functions (lambda) and actions (action) are separate syntactic domains with their own structural rules, enforced at compile time; where Haskell tracks purity through IO as a type-level effect, Kata makes it a property of the syntax you write.
Memory
• Kata: Per-fiber bump arenas + escape analysis; no GC, no borrow checker
• Python: Refcounting + cycle GC
• Haskell: Tracing GC
• Rust: Ownership + borrow checker
Refined types
• Kata: data (Int, > _ 0) as PositiveInt — predicates validated at compile time, participate in dispatch, refines delegates interfaces to base
• Python: Not available
• Haskell: Liquid Haskell (external plugin, not core)
• Rust: Not available
Purity
• Kata: Physical barrier: separate syntax, operators, structural rules
• Python: Not enforced
• Haskell: Monadic IO (type-level effect)
• Rust: Not enforced
Conditionals
• Kata: Pattern matching + guards (exhaustiveness enforced)
• Python: if/elif/else
• Haskell: if + pattern matching
• Rust: if + match
Backend • Kata: Cranelift JIT/AOT (native, no VM)
• Python: CPython interpreter
• Haskell: GHC (LLVM/native)
• Rust: LLVM (native)
The repo is at github.com/ArthurJ/Kata — build with cargo build, then try kata repl, kata run examples/, or kata test. I’d love feedback on the language design: what feels right, what feels wrong, what you’d do differently.
action greet (name::Text) => Unit echo!(+ "Hello, " (+ name "!")) action main greet!("World") greet!("Kata") main!()enum BMI Underweight(< _ 18.5) Normal(<= _ 25.0) Overweight(<= _ 30.0) Obese action main echo!(BMI 17.0) echo!(BMI 22.0) echo!(BMI 27.0) echo!(BMI 35.0) main!()fizzbuzz :: Int => Text lambda x: both: "FizzBuzz" fizz: "Fizz" buzz: "Buzz" otherwise: show x with fizz := divisible x 3 buzz := divisible x 5 both := and fizz buzz divisible :: Int Int => Boolean lambda x n: match div x n Ok q: = x (* n q) Err _: Boolean::False action main for i in [1..16] echo!(fizzbuzz i) main!()