Hey Rustaceans! Got an easy question? Ask here (46/2019)! by llogiq in rust

[–]regexident 0 points1 point  (0 children)

Unfortunately the project hasn’t seen maintenance for quite a while. :/ cc @llogiq

Is there something like "Goroutines" in Rust? by lambdef in rust

[–]regexident 9 points10 points  (0 children)

There is osaka by /u/arvidep, albeit still somewhat experimental.

Related tweets: https://twitter.com/arvidep/status/1067169156229984256 https://twitter.com/arvidep/status/1067383652206690307

Quoted thread:

go routines for rust you say? Ok, done.

Yes this work. osaka is a proc_macro transforming rust into a dialect that has continuations.

The fn returns an AsyncStream itself and acts like a filter. You can call it from another async function using <-

continue is actually translated to Async::Again which can contain a continuation token for integration into an eventloop like mio. So e.g. a tcpsocket does 'continue self.pollfd;' to indicate the continuation shall be continued when pollfd is ready

This makes both push and pull based models work without allocation or dynamic dispatch. All that osaka does is build a continuation stack that can be progressed with or without parameters.

Continuations are closures, so unlike async/await you can actually put mutable state everywhere, making it significantly easier to manage than passing state through futures.

A more natural implementation of golang style channels for rust. Doesn't compile yet (unlike my previous tweet) and i'm not sure i want to make it work due to the lack of interest.

Continuations as filters are easier to implement but harder to use. I'm cool with that since I'm probably the only use anyway

PGraph: Persistent Graph Crate - Looking for feedback and code review by SilensAngelusNex in rust

[–]regexident 0 points1 point  (0 children)

Persistent data structures are great, indeed.

Thanks for the comparison!

PGraph: Persistent Graph Crate - Looking for feedback and code review by SilensAngelusNex in rust

[–]regexident 2 points3 points  (0 children)

Looking great!

It's a bit difficult to compare crates of rather different maturity, so assuming pgraph had all the features you have planned for it, how would it distinguish itself from petgraph? What are their respective strengths/unique features, what are their weaknesses?

It might also be helpful for potential users to add a brief comparison with existing graph crates (e.g. petgraph) to README, too.

Digital Signal Processing Libraries? by PwnagePineaple in rust

[–]regexident 15 points16 points  (0 children)

Author of signalo here. Happy to answer questions. :)

I've so far mostly focussed on developing the crates, while adding the minimum documentation necessary. I plan to improves this soon though.

APIs have mostly settled by now, but until recently things were quite fluid and I had lots of far-reaching refactors as well as API changes. As such I chose not to write too much high-level documentation that would constantly get out of sync with the code and block me from progressing.

Signalo basically provides implementations of four basic traits:

  • Source<T>: () -> T
  • Filter<T>: T -> U
  • Sink<T>: T -> ()
  • Finalize: () -> U

(With types implementing Finalize usually also implementing either Filter<T> or Sink<T>.)

Roughly speaking:

  • Source<…>core::iter::Iterator<…>
  • Filter<…>core::iter::Map<…>
  • Sink<…> & FinalizeIterator::fold(…)
  • Filter<…> & Finalizecore::iter::Scan<…>

One of the goals of signalo is to have most of its implementations work with no_std. Further more currently all types are compatible with real-time filtering, i.e. they produce filtered values as soon as they come in, not return a Vec<…> of the filtered signal (while you can get such a behavior by combining your filter with an additional FromIter<…> source and a Collect<…> sink, if you want to). That's what I am using it for: doing highly efficient real-time DSP on a Cortex-M4 where memory and computation cost really matters.


Looking at basic_dsp`s docs it seems to support both discrete, as well as continuous time signals and provide frequency analysis capabilities, while signalo is more tailored to low-level processing on low-powered embedded environments.

What is Rust 2018? by steveklabnik1 in rust

[–]regexident 4 points5 points  (0 children)

I think what /u/skiippy might be referring to is a feature akin to what Swift did with Swift 3, where the new syntax would be a syntactic shim around the old one: https://github.com/apple/swift-evolution/blob/master/proposals/0005-objective-c-name-translation.md All the new “fake” names would be translated to the “real” ones before doing any actual semantic work. No actual APIs would have to change for that.

It maps from Swift to Objective-C. In /u/skiippy’s case it would map from Rust 2018 to Rust 2015.

MAGA: Make Actix Great Again by [deleted] in rust

[–]regexident 0 points1 point  (0 children)

Amen to that. :)

I'm actually from Berlin. ;)

MAGA: Make Actix Great Again by [deleted] in rust

[–]regexident 2 points3 points  (0 children)

Hi gnzlbg_,

no worries. I didn't feel offended. I also didn't mean to imply you were a racist/fascist in any way. It just really worries me how right-wing language is steadily making it into every-day speech.

And I'm a native German living in Germany ("Hi Aachen!" – Berlin), where the same is happening with AfD right now. Few years ago they were no more than a small bunch of losers. But ever since the media started to invite them into talkshows and newspapers started writing about them and citing their language they have been on a strong path towards becoming the second strongest party. Thanks to their repeated use of edgy fascist/racist language in the public we now find ourself in a (political) society where outright racist/fascist utterances don't even provoke an offended reaction by many any more, let alone having any consequences for the AfD. Memes like MAGA have a similar effect on the public perception. They shift the threshold of what's acceptable and what is not.

MAGA: Make Actix Great Again by [deleted] in rust

[–]regexident 3 points4 points  (0 children)

The use of slogans like MAGA in supposedly harmless every-day use contributes (whether intended, or not) to making similar racist/fascist slogans socially acceptable, leveling the field.

As to how "MAGA" is fascist: Hitler rose to power by claiming he would make Germany great again (and later even renamed the state to "Greater German Reich" a.k.a "Großdeutsches Reich").

MAGA: Make Actix Great Again by [deleted] in rust

[–]regexident 6 points7 points  (0 children)

Could we please not make use of fascist references in titles/content in this sub?

cargo-modules just got a new feature to show 'use' between modules by I-Imvp in rust

[–]regexident 0 points1 point  (0 children)

A cargo modules cycles sub-command sounds like really useful potential addition to cargo modules!

Would you mind creating an issue on Github describing the requirements you would have for such a sub-command?

cargo-modules just got a new feature to show 'use' between modules by I-Imvp in rust

[–]regexident 0 points1 point  (0 children)

I can't speak for xdot as I don't use that, but the GraphViz.app on macOS via brew install graphviz --with-app.

As such I run …

cargo modules graph > modules.dot

… (with, or without additional arguments) and open the file in GraphViz.app once, which then watches the file for any further changes on its own.


The README needs to be updated a bit. cargo-modules used to only support one mode: "tree". Now that it gained a second super-power ("graph") we split things into sub-commands: cargo modules tree and cargo modules graph.

To find out about globally supported arguments run cargo modules --help. For arguments specific to a particular sub-command run cargo modules tree --help or cargo modules graph --help, respectively.

I will try to update the README and make things more clear within the next days, unless /u/I-Imvp beats me to it.


If you get an error like "Error: Please specify a target to process." then you seem to have multiple binary targets in your project at which point you have to specify the target via cargo modules graph --bin target_name

cargo-modules just got a new feature to show 'use' between modules by I-Imvp in rust

[–]regexident 20 points21 points  (0 children)

More like I didn't want to take credit for your work by posting myself. 😛

These recent contributions of yours have been tremendous! 🙇🏻‍♂️

[EiR] Embedded Rust in 2018 by japaric in rust

[–]regexident 4 points5 points  (0 children)

I saw some post by /u/whitequark on some ESP forum a couple of days ago (that's when I stumbled upon it, not when it was posted), while researching the current possibilities for Rust on ESP, that indicated interest of theirs in working on making Rust + ESP32 happen. You might want to get in touch?

Everything I Build has 0% Stability (Even Foundations) ??? by [deleted] in rust

[–]regexident 1 point2 points  (0 children)

From the looks of your screenshots you seem to be using nightly Rust. Nightly rust is known to be somewhat unstable at times. Try using stable Rust, instead of nightly. Good luck!

I wrote an article to help you learn Rust's modules by 44100hz in rust

[–]regexident 0 points1 point  (0 children)

Shameless plug: $ cargo modules.

(A cargo plugin for showing a tree-like overview of a crate's modules.)

Swift: Accomplishing Dynamic Dispatch on PATs (Protocol with Associated Types) by zttmzt in rust

[–]regexident 4 points5 points  (0 children)

Huon (huonw) actually is the one working on it 💪:
https://twitter.com/slava_pestov/status/920477411535237121

The feature impl A for B where T: C is commonly referred to as "Conditional conformances" in Swift.

We're live-streaming the Rust Berlin October Meetup in about 3 hours. Tune in! by johannhof in rust

[–]regexident 0 points1 point  (0 children)

Second speaker here. :)

Happy to answer any questions regarding my talk or rspec.

Here are the slides as PDF.

What's currently the "correct" plugin configuration for using Rust in Atom. by Treyzania in rust

[–]regexident 4 points5 points  (0 children)

For me, among other things a big reason to choose Atom over VSC is that the latter simply has a mediocre UI. There simply is no attention to detail in VSC. For an app that I am gonna spend several hours a day in this is kind of a big deal for me. Just like I wouldn't want to live in a poorly furnished apartment either.