Tootfinder

Opt-in global Mastodon full text search. Join the index!

@khalidabuhakmeh@mastodon.social
2024-03-18 18:39:06

I found this really cool repo for particle simulations in #rustlang using the #bevy game engine.

Rust particle simulator.
@kornel@mastodon.social
2024-04-14 19:23:53

I like to minimize the size of binaries I build. Unremovable debugging strings annoyed me, so I've added an option to completely neuter `Debug::fmt` in #Rustlang
github.com/rust-lang/rust/pull

@khalidabuhakmeh@mastodon.social
2024-02-19 15:02:38

Hey #rust folks, I'm trying to figure out how to handle invalid form submissions with #rocket. There's a global catcher that returns a 422 (unprocessible entity), but I'd like to be able to handle a form post for a specific endpoint.

@frankel@mastodon.top
2024-02-11 16:36:49

#ErrorManagement in #Rust, and libs that support it.
As part of learning the Rust ecosystem, I dedicated the last few days to error management. Here are my findings.

@astrojuanlu@social.juanlu.space
2024-02-18 14:02:14

Say what you want about Python packaging, but what about this?
```
$ cargo install lfs-dal
...
package `clap v4.5.1` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.73.0
```
😒 #rust #rustlang

@khalidabuhakmeh@mastodon.social
2024-02-20 19:52:49

My dive into #Rust and its web ecosystem continues. This time, I'm using #Axum to serve HTML from an endpoint and sending static files from a directory.
The IDE I'm using is #JetBrains

JetBrains RustRover running Axum web application
@kornel@mastodon.social
2024-04-14 19:23:53

I like to minimize the size of binaries I build. Unremovable debugging strings annoyed me, so I've added an option to completely neuter `Debug::fmt` in #Rustlang
github.com/rust-lang/rust/pull

@MBrandtner@gruene.social
2024-04-17 11:24:38

Was mir in der Berichterstattung über den tödlichen Unfall am Filmset von #Rust manchmal fehlt, ist die Tatsache, dass dieser ohne die laxen #Waffengesetze in den #USA niemals hätte passieren können.

@khalidabuhakmeh@mastodon.social
2024-02-17 17:13:34

#rust

@Ozzy@social.linux.pizza
2024-02-11 09:28:53

in case you want to run whois query via #TOR network in #rustlang here is a good example

@frankel@mastodon.top
2024-02-10 17:12:04

#Rust wont save us, but its ideas will
glitchbyte.io/posts/rust-wont-

@khalidabuhakmeh@mastodon.social
2024-02-16 21:23:01

Not going to lie. This is going to take some getting used to in #rust coming from the land of #dotnet

In Rust, the semicolon ; is used to separate statements. It denotes the end of one statement and the beginning of another. Rust is an expression-oriented language, which means that most things in Rust are expressions that return a value. However, if you place a semicolon ; at the end of an expression, it becomes a statement -- and statements do not return values.
@Xavier@infosec.exchange
2024-03-09 17:58:24

I have a question for those who know #rust. When I went to school I learned Assembly, ANSI C, Java, and Perl (oh... and Mathematica, but I'm trying to forget it). Then I learned VB (later .NET), C , and Python on my own. I've never been a full-time developer, but I will pick up an occasional pet project. Nearly everything I've done in the last 10 years has been in python.
Should I learn Rust? Are there new #programming concepts? Are there other reasons, as am #infosec professional, that make it worthwhile to run to an "Intro to Rust" class?

@shuttle@mastodon.online
2024-04-16 20:00:04

Tomorrow, Maxwell Flitton will be covering how to use #docker as a private crates registry that you define in your #rust cargo.toml, end to end testing, and the concept of nanoservices. 🚀
Get notified when we’re live 🔔

@khalidabuhakmeh@mastodon.social
2024-02-16 21:23:01

Not going to lie. This is going to take some getting used to in #rust coming from the land of #dotnet

In Rust, the semicolon ; is used to separate statements. It denotes the end of one statement and the beginning of another. Rust is an expression-oriented language, which means that most things in Rust are expressions that return a value. However, if you place a semicolon ; at the end of an expression, it becomes a statement -- and statements do not return values.
@cyrevolt@mastodon.social
2024-02-13 11:22:45

A #poem
This cannot be true
You make my buffer overflow
Though I am written in #Rust,
Give you all my trust,
Call you with 'unsafe', - oh
And take input from you.

@risottobias@tech.lgbt
2024-04-12 18:53:43

what are the power-saving settings in a CPU?
like if you had a task scheduler and wanted to fill in a very low priority nice job
but only when the voltage isn't asleep
like is it per core?
how would you design a kernel for something silly like that?
I dunno but most #rust kernels aren't suspending cores right now, right?

@smurthys@hachyderm.io
2024-03-21 11:13:34

Rust for C#/.NET Developers
#rustlang

@shuttle@mastodon.online
2024-04-16 20:00:04

Tomorrow, Maxwell Flitton will be covering how to use #docker as a private crates registry that you define in your #rust cargo.toml, end to end testing, and the concept of nanoservices. 🚀
Get notified when we’re live 🔔

@stsquad@mastodon.org.uk
2024-02-17 21:57:24

Well I've gotten the #embassy #rust example running on my #picow and connecting to the network. Now I need to choose a #nostd

@frankel@mastodon.top
2024-02-13 17:28:06

Extending #Rust's Effect System
blog.yoshuawuyts.com/extending

@khalidabuhakmeh@mastodon.social
2024-03-13 00:30:05

Cool #rustlang post about iterators by @…

@Ozzy@social.linux.pizza
2024-02-14 23:02:45

#cpp #rust #rustlang

@khalidabuhakmeh@mastodon.social
2024-03-15 13:26:19

I just learned that #rustlang has a `bin` folder that allows you to create multiple executables from a single project, and now I think my 🧠 is broke.
doc.rust-lang.org/cargo/guide/

Package Layout: https://doc.rust-lang.org/cargo/guide/project-layout.html
@cyrevolt@mastodon.social
2024-02-09 22:13:34

Times when #Rust drives you mad:
Hey, just add `&foo[..]` something.
No, drop the `&` again.
Hey, add some more `[..]`!
Gosh... I have a struct, say,
`struct Boop { boop: [u8; 32] }`
How do I instantiate it?
I tried
`Boop { boop: vec![0u8; 32] }`
and that didn't work. So I tried
`Boop { boop: vec![0u8; 32].as_slice() }`
and that …

@frankel@mastodon.top
2024-02-15 08:33:14

From #Go to #Rust: The Two Types of #Readable Code

@shuttle@mastodon.online
2024-03-02 19:51:34

We wrote a #Rust article about what we think the best ORM is 👀
Check it out: shuttle.rs/blog/2024/01/16/bes

@michabbb@social.vivaldi.net
2024-03-07 15:59:12

Open-sourcing our progress on #TailwindCSS v4.0 Alpha
It introduces #Oxide for faster builds, smaller footprints, #Rust integration, with a

@toothFAIRy@scholar.social
2024-01-26 21:33:29

How Are Paid and Volunteer #OpenSource Developers Different? A Study of the #Rust Project #OpenScience

@crell@phpc.social
2024-02-21 05:05:37

This video is about #Rust, but it's comments about error handling are valid for anyone in any language. PHP friends especially, this is the kind of stuff I've been ranting about for a while now. :-)
youtu.be/sbVxq7nNtgo

@khalidabuhakmeh@mastodon.social
2024-03-15 13:29:38

I love the #rustlang concept of building examples directly into crates as a first-class citizen. It fosters a mindset of thinking about other developers and being empathetic.
xion.io/post/code/rust-example

@Ozzy@social.linux.pizza
2024-02-25 20:34:13

#rustlang may bring #linux to desktop 😂
blog.rust-lang.org/2024/02/19/…

@khalidabuhakmeh@mastodon.social
2024-04-02 22:35:39

Oh right, I wrote a new #rustlang blog post about testing.
Rust Unit and Integration Testing in #RustRover

@frankel@mastodon.top
2024-02-22 09:09:00

#Rust #Tooling: 8 tools that will increase your productivity
dev.to/shuttle…

@shuttle@mastodon.online
2024-02-29 01:50:03

Hey everyone!
We wrote an article about implementing OpenAI and Qdrant to write our own RAG LLM powered web service in #Rust!
Check it out: shuttle.rs/blog/2024/02/28/rag

@khalidabuhakmeh@mastodon.social
2024-02-28 12:28:29

Just published my first #rust blog post for #jetbrains #RustRover about building your first web app.

@crell@phpc.social
2024-03-22 04:29:06

Type driven design in #Rust.
Most of these concepts apply in any language, subject to the limitations of the language's type system. The better the type system, the more logic you can push into the type system and thus out of runtime.

@shuttle@mastodon.online
2024-02-25 19:28:02

Interested in trying out Rocket and #Rust? We've got you 👀 check out our article that does a deep dive into using the Rocket web framework as well as deployment!
shuttle.rs/blog/2023/12/13/usi…

@frankel@mastodon.top
2024-04-08 17:23:11

#XKCD comics is a game using #Rapier, a #Rust-based physics engine

@crell@phpc.social
2024-03-22 04:29:06

Type driven design in #Rust.
Most of these concepts apply in any language, subject to the limitations of the language's type system. The better the type system, the more logic you can push into the type system and thus out of runtime.

@khalidabuhakmeh@mastodon.social
2024-03-07 18:47:00

Is it common in #Rust to have tests side-by-side with the implementations?

Side-by-side tests in Rust in RustRover
@shuttle@mastodon.online
2024-04-10 09:00:13

We're excited to share how #OpenTelemetry enhances observability in #Rust applications later today! 🦀
We'll be diving into setup and practical examples. Perfect for Rustaceans looking to elevate their monitoring game. Stay tuned for the full article!

@frankel@mastodon.top
2024-04-08 17:23:11

#XKCD comics is a game using #Rapier, a #Rust-based physics engine

@Ozzy@social.linux.pizza
2024-01-24 07:30:51

#freebsd getting closer to #rustlang , things are getting funkier 🤓
phoronix.com/news/F…

@khalidabuhakmeh@mastodon.social
2024-03-06 16:26:40

TIL about the #Rust “?" operator, which is shorthand for Error propagation in a method. If a call fails, the Error will be sent to the caller, and the method’s execution ends there. That's pretty neat.

Result propagation in Rust
@shuttle@mastodon.online
2024-04-10 09:00:13

We're excited to share how #OpenTelemetry enhances observability in #Rust applications later today! 🦀
We'll be diving into setup and practical examples. Perfect for Rustaceans looking to elevate their monitoring game. Stay tuned for the full article!

@khalidabuhakmeh@mastodon.social
2024-03-14 18:52:29

This is a cool #rustlang project for accessing #SQL #databases.

@khalidabuhakmeh@mastodon.social
2024-03-04 19:24:16

It’s pretty neat in #Rust that type usage in multiple locations can be inferred from the return type of a function. So while you could explicitly set the types, you don't have to.

Rust code starts here:

fn read_pizzas() -> Vec<Pizza> {
    let mut reader = csv
@khalidabuhakmeh@mastodon.social
2024-03-05 14:54:22

I learned that #RustRover can detect logic improvements like De Morgan's Law in #Rust logic and recommend a change. That's pretty neat.

De Morgan’s law improvement in Rust code with RustRover
@frankel@mastodon.top
2024-03-02 17:15:00

#Pingora is a #Rust framework to build fast, reliable and programmable networked systems.
Pingora is battle tested as it has been serving more than 40 million Internet requests per second for more than a few years.

@khalidabuhakmeh@mastodon.social
2024-03-04 15:42:46

Continuing to experiment with #Rust, #RustRover, and some basic workflows. This time, I was able to read data from a `csv` and output it to the terminal in a pretty table.

CSV table output with Rust and RustRover
@shuttle@mastodon.online
2024-02-04 10:37:00

What are some underappreciated #Rust crates you think more people should know about?

@khalidabuhakmeh@mastodon.social
2024-03-04 19:44:54

I like the #rust, it gives me avenues to explore the ecosystem.

crates.io site
@khalidabuhakmeh@mastodon.social
2024-03-07 21:10:18

I still think ownership transfer will be the most challenging part of wrapping my brain around #rust, especially with nearly two decades of #dotnet programming.
The shoe collection ownership is passed to the function, so it can't be used after the function call.

let shoes = vec![
            Shoe { size: 10, style: String
@shuttle@mastodon.online
2024-02-03 16:00:00

#Rust will replace C for system programming in the next 5 years.
Too bold a prediction or is it inevitable? 🚀

@frankel@mastodon.top
2024-01-27 09:12:06

Nominal Types in #Rust
experimentalworks.net/posts/20

@khalidabuhakmeh@mastodon.social
2024-03-07 18:28:36

Onto #rust lifetimes. It makes sense. Lifetime definitions imply the lifetime relationships between parameters and the return type. When you have branching logic and a potential for multiple paths, it's vital to pick a lifetime.

fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
    if x.len() > y.len() {
        x
    } else {
        y
    }
}
@khalidabuhakmeh@mastodon.social
2024-03-07 18:03:51

I really like #rust shorthand syntax for constraints on parameters by using the sign with traits.

pub fn some_func(item: impl SomeTrait + OtherTrait) -> bool {
    item.some_function() && item.other_function()
}
@khalidabuhakmeh@mastodon.social
2024-03-07 16:27:05

I’m learning about #rust traits today, which behave like interfaces. They can also have default implementations, which is cool. 😎

pub trait Summary {
    fn summarize(&self) -> String {
        String
@khalidabuhakmeh@mastodon.social
2024-03-06 14:26:13

This is a neat #rust compiler error. If you take a reference to an element in a list, it won't let you modify the collection because it might lead to a bug.

Cannot borrow mutable because it is also borrowed as immutable.
@khalidabuhakmeh@mastodon.social
2024-02-21 18:52:11

Learned how to increment a static count in #Rust and about the built-in AtomicI32 type. Also had other tries with the `unsafe` keyword and the use of Mutex.

Rust Code sample in Rust Rover

Code is:

use std
@khalidabuhakmeh@mastodon.social
2024-03-05 19:15:37

I do wish that #rust had picked a better symbol for mutable references other than `&mut`, maybe something like `&!` or `&&`.

print_months(&months);
    print_months_reversed(&mut months);
    print_months(&months);
@khalidabuhakmeh@mastodon.social
2024-02-16 21:19:59

I made my first #rust #rocket web app using #RustRover from #JetBrains. Was an exciting experience:

<…
JetBrains RustRover with Rocket framework
@khalidabuhakmeh@mastodon.social
2024-02-16 21:19:59

I made my first #rust #rocket web app using #RustRover from #JetBrains. Was an exciting experience:

<…
JetBrains RustRover with Rocket framework
@khalidabuhakmeh@mastodon.social
2024-03-05 14:12:15

Shadowing is a neat #Rust concept. It gives the illusion of mutability but with immutable variables. I'm reusing the `x` variable name.

fn main() {
    let x = 5;

    let x = x + 1;

    let x = x * 2;

    println!("The value of x is: {}", x); // outputs 12
}
@khalidabuhakmeh@mastodon.social
2024-03-05 17:32:26

Yesterday, someone recommended once_cell for #rust compared to !lazy_static, and it was a very good recommendation. This is much more straightforward.

static PIZZAS: once_cell
@khalidabuhakmeh@mastodon.social
2024-02-25 18:19:00

Hey @…, check this out. #rust

@khalidabuhakmeh@mastodon.social
2024-03-05 15:44:29

I learned you can use the `break` inside a `loop` to return a value. It feels strange coming to #Rust from #csharp. I would have expected to use the `return` keyword, but I guess it makes sense.
By the way, I'm taking the

Break within a loop returning a value.
@khalidabuhakmeh@mastodon.social
2024-03-04 18:20:28

Learning to use `lazy_static` in #Rust and found that #RustRover helps visualize what type you're dealing with when working with pointers and references. Check out the inlay hints. They're great!

Inlay hints changing types
@khalidabuhakmeh@mastodon.social
2024-03-04 19:54:30

In #csharp, the "YOLO" operator is the “!" symbol, but in #Rust, it's the "?" symbol. Oh this is going to mess with my brain isn't it?

fn main() {
    let connection = Connection
@khalidabuhakmeh@mastodon.social
2024-04-03 18:53:48

This is pretty cool. I'm calling #rustlang from #dotnet. That said, there's a lot to think about when it comes to this interop-style code, especially the memory handoff.

C sharp code calling Rust library
Rust code with exports so it can be consumed from a .NET application
@khalidabuhakmeh@mastodon.social
2024-04-03 18:53:48

This is pretty cool. I'm calling #rustlang from #dotnet. That said, there's a lot to think about when it comes to this interop-style code, especially the memory handoff.

C sharp code calling Rust library
Rust code with exports so it can be consumed from a .NET application
@khalidabuhakmeh@mastodon.social
2024-02-21 19:13:45

It turns out that #Rust has something similar to extension methods in #csharp. You can create additional implementations outside of type definitions to include more functionality at the call site.
Update: not traits 😅

Rust traits implementation in RustRover

—

struct Person {
    first_name: String,
    last_name: String,
}

impl Person
{
    fn hello(&self) {
        println!("Hi, my name is {} {}",
                 &self.first_name, &self.last_name)
    }
}

fn main()
{
    let me = Person {
        first_name: String
@khalidabuhakmeh@mastodon.social
2024-02-21 12:48:51

#Rust is known to solve certain problems, but nothing is free, right? What are common mistakes you might see in a Rust codebase?

@khalidabuhakmeh@mastodon.social
2024-01-31 19:38:13

Learning some #rust and the #RustRover quick fix for adding arguments to a string format is pretty neat.

RustRover quick fix for adding a format argument
@khalidabuhakmeh@mastodon.social
2024-01-31 20:29:38

When adding a dependency to your #rust project, if you click the gutter icon in #RustRover it will open up the crate's documentation page. That's pretty awesome.

RustRover gutter icon.
@khalidabuhakmeh@mastodon.social
2024-01-31 21:18:59

What’s surprising about #RustRover and #rust in general is that the compilation times are much faster than expected.
A lot of dependency optimization and caching makes the iterative loop surprisingly pleasant.
Also, here's a fox running in

Bevy sample of a 3D fox running.
@khalidabuhakmeh@mastodon.social
2024-02-20 23:26:09

Can someone explain #rust lifetimes to me? Coming from #csharp my brain sees generics.