Rust Programming

8438 readers
25 users here now

founded 5 years ago
MODERATORS
326
327
 
 

Hey all! Just wanted to share a little fun side project I've been working on recently. It's an ecosystem similar to smol for writing async rust code, but the internals make no use of unsafe at all

repos:

  • async-join: a safe join_all function for Vec<Future>
  • polldance: a safe polling library built on unix poll with rustix for memory & io safety
  • foxtrot: a safe async reactor bulit on polldance and rustix
  • jitterbug: a safe async executor with multi-threaded work-stealing support

I'm not here to say "you should definitely use this" because I've wirtten zero tests, and I've made no effort to implement standard apis like AsyncRead, AsyncWrite, etc, but I wanted to show it is possible to build these things yourself

Shoutout to rustix for making socket programming safe and easy

328
329
 
 

What if Rust code could instead declare the context it needs, and the compiler took care of making sure that context was provided?

This is by far the most exciting reading I have had in the Rust ecosystem lately. Follow up and comment posts:

330
331
332
333
334
335
336
337
1
submitted 3 years ago* (last edited 3 years ago) by [email protected] to c/[email protected]
338
 
 

I want to use the crate human-sort but it only takes [&str] and I'm currently working with Vec<String>.
Is this possible to make the conversion Vec<String> to [&str]? and in the other way?

339
340
341
342
343
344
345
346
 
 

I'm looking for suggestions for an in-memory database or other type of store that syncs to the file system (preferably as a single file) to store small, text-only documents (notes) and additional metadata.

It should preferably be made purely with Rust and have no dependencies to outside libraries like SQLite (without the dependency to the sqlite library in the system it would be my first choice). Also it shouldn't depend on any server/service running in the system.

It should support relational data (but not necessarily relational as in SQL and relational databases) to allow fast and easy searching and retrieval of data.

So far I (from the crate descriptions only) I found RedDB. the rql crate looks promising, too, even though I'll have to write the sync to the filesystem myself.

Are there more suggestions?

347
 
 

(asciinema-player was previously written in ClojureScript)

348
 
 

From a language architecture standpoint and not an ecosystem standpoint, what might be some things where you'd really not want to use Rust, either because of some limitation that prevents it from doing it or just because it'd be massively annoying to write to the point of significantly reduced productivity? What about Rust makes it unsuitable, and what language paradigms are the best for it?

I hear a lot about how the things that Rust is not good for, JIT compilation with a garbage collector is usually the best solution, and vice versa. How true is this?

349
 
 

Something I'm genuinely curious about with people who really like Rust, and want it to be used for everything. If you had a say, which way of the programming ecosystem developing would you personally prefer, and why? Like, if Go or C++ started developing features similar to Rust, like a borrow checker and better compile time error checking, would you see that as a good thing that other languages are getting the same benefits of Rust? What about other organisations started making new programming languages with similar benefits as Rust? Or would you rather that none of those happened and everything that wants Rust's benefits just converged to using Rust?

350
 
 

Has anyone here ever tried using Rust's Qt or GTK bindings, or another library, to make a complex GUI beyond a few simple forms or dialog boxes? I keep hearing that the language's architecture makes it really hard to do any sort of advanced GUI development on it, but what's the actual experience like? How would you compare it to say, native Qt or GTK using C++/C respectively, or things like JavaFX or Flutter? Maybe even the .NET Framework or whatever Apple uses for their platform? Would you actually recommend Rust over any of those?

view more: ‹ prev next ›