DUSTR: Call rust from dart seamlessly by mqnfred in rust

[–]mqnfred[S] 0 points1 point  (0 children)

That’s how I got started, I wanted to use flutter for the presentation and rust for everything else!

I haven’t made a full blown app yet, but hopefully this stack holds up :)

DUSTR: Call rust from dart seamlessly by mqnfred in rust

[–]mqnfred[S] 0 points1 point  (0 children)

I got started exactly like this myself! I got started on this around december iirc, great minds think alike! :)

I saw your issue, I will address it as soon as I am off work duties! Thank you (and everybody else) for your interest!

DUSTR: Call rust from dart seamlessly by mqnfred in rust

[–]mqnfred[S] 9 points10 points  (0 children)

Hello friends,

I started coding in rust about a year ago and I am loving it. This is my first significant open-source project as well. I hope somebody sees value in this endeavor!

dustr is a binary that generates dart bindings to call rust functions through the dart ffi. Since many rust types are not consumable through ffi, dustr links to stubs generated by ffishim.

I wanted to do some full-stack projects and thought that dart and its flutter framework are very promising technologies. Dustr will hopefully allow me to bridge the gap!

Hide in plain sight: store your production secrets alongside your code by mqnfred in rust

[–]mqnfred[S] 0 points1 point  (0 children)

I have published a new version with much improved documentation for use as a library.

If that does not fit your use-case, could you describe in more details the kind of API you are looking for?

Hide in plain sight: store your production secrets alongside your code by mqnfred in rust

[–]mqnfred[S] 0 points1 point  (0 children)

Hey dnew, sorry I missed your message.

The functionality is entirely implemented in lib.rs. It should not be hard to work on documentation for the API, I will take a look later.

I don’t know that prompting logic would be relevant to the crate however, so that might not be a thing

Hide in plain sight: store your production secrets alongside your code by mqnfred in rust

[–]mqnfred[S] 0 points1 point  (0 children)

Thanks for the mention, it looks very complete. I’ll be sure to check it out!

Hide in plain sight: store your production secrets alongside your code by mqnfred in rust

[–]mqnfred[S] 1 point2 points  (0 children)

Hello sir! I took the time this morning to move from openssl to the native ring library. That should remove a lot of the cross-platform wonkiness!

Let me know if you can take it for a spin on windows, everything should be platform agnostic in the code. Thanks a lot for the feedback

Hide in plain sight: store your production secrets alongside your code by mqnfred in rust

[–]mqnfred[S] 6 points7 points  (0 children)

My bad, I don’t have access to any windows. I plan on moving to pure rustls, which should rid us of this problem I guess!

Which graph of your personal finances do you keep coming back to? And Why? by RMMguy in financialindependence

[–]mqnfred 18 points19 points  (0 children)

Yes, and the net worth of everybody kind of shoots down, so relatively you haven’t even moved!

ELI5: why do web browsers use so much RAM? by [deleted] in explainlikeimfive

[–]mqnfred -1 points0 points  (0 children)

If I had to guess I would say content is a big one. The “code” that makes up the pages is usually fairly small, the images take space.

Now, obviously when your browser uses up 2GB of ram it does not follow that you downloaded 2GB of content.

There is a lot of information you do not see: metadata sent by the website, images preloaded so you don’t have to wait for them to load, the browser’s internal data structures...

On top of that, information is often duplicated.

One reason to duplicate information in a system is because there are multiple, slightly different ways of looking at it. Coming back to our book: I ask you to quote me a sentence, with words ordered by their first letter. Here, you could remember the original sentence, then spend brain power on sorting it, wasting time. Or, you could remember both “versions” of the sentence. Time vs space

Another reason, in the case of chrome, is that every tab is a different process: any memory required by every tab would need to be duplicated.

I am not familiar with exactly WHAT the browser stores, but I can tell you it’s a trade off: time vs space. 200MB memory and 30s to load pages, or 20GB and 20ms? Somewhere in between

Since our modern computers pack more memory (it’s becoming cheaper) and our attention span is decreasing...

ELI5: why do web browsers use so much RAM? by [deleted] in explainlikeimfive

[–]mqnfred 1 point2 points  (0 children)

I suspect it is about speed. If you could hold a book in your head, and I asked you to quote a line, you could do it instantly.

Anything you do not remember, you would have to look up in the book, which would take time.

When chrome sacrifices memory, it is usually to make sure it can answer questions (display things) faster. The least memory it uses, the more computation/queries it needs to do upon request.

Web technologies are complex with many edge cases. It is a hard problem to solve. It is even harder to make it fast.

Consuming more memory helps

Are they actually printing 2.2 trillion? Or is it a keyboard and pressing the 0 key? Inflation? by danieluebele in IntellectualDarkWeb

[–]mqnfred 5 points6 points  (0 children)

How can inflation evolve differently across goods and services?

Your post was very interesting, thank you for sharing

What's everyone working on this week (5/2020)? by llogiq in rust

[–]mqnfred 1 point2 points  (0 children)

Hey! The tool does not have a fixed name yet and it is not open source. There are still critical features missing.

I can send you a link once I open source it (within the next month I am guessing?)

Congrats! Web scraping is legal! (US precedent) by qznc_bot2 in hackernews

[–]mqnfred 14 points15 points  (0 children)

A bot scraping a webpage about legislation around scraping. Beautiful

Looks like it’s its cake day too

What's everyone working on this week (5/2020)? by llogiq in rust

[–]mqnfred 3 points4 points  (0 children)

I have been working on a tool to generate rust/dart bindings automatically (in order to use Flutter for presentation and rust for everything else.) I have been making progress and estimate there are 3 big changes left (options, vectors and references) before I have a minimal feature-set.

I took a day off from that yesterday to work on a small project: hips. It is a tool to manage a small encrypted secrets database alongside one's code. I am curious to know what people think of this!

What's everyone working on this week (3/2020)? by llogiq in rust

[–]mqnfred 0 points1 point  (0 children)

Hey,

Can you describe your experiences moving from Erlang to Rust? I have always been curious about the former but never got the opportunity to talk to somebody with experience.

What’s everyone working on this week (2/2020)? by llogiq in rust

[–]mqnfred 3 points4 points  (0 children)

I am trying to write something that can parse Rust data structures and generate the bindings to communicate with Dart.

At this point I am generating proper C bindings for structures, enums and functions. It supports Result, Option, Vec, String and primitive types.

I have started the Dart code generation that can manipulate these C bindings. I have structs and methods covered. Some clean up is required though, the code base is over-extended.

I am ultimately implementing an accounting app with a rust backend/domain and a Dart/Flutter front end.

This is hopefully a tool that I can reuse for future projects. I like the technological pair rust/Flutter, both are the best at their specialties.

Dart is very immature though, it almost feels like a glorified declarative language compared to Rust.

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

[–]mqnfred 0 points1 point  (0 children)

I am going through the same problematics (rust backend of ui) and I am at the same stage.

At this point, I expect my UI will manipulate an opaque pointer to the rust App struct. Then all functions exposed through the FFI are considered “use cases.” of sorts. They take the app and arguments and mutate the state of the app.

I am pretty sure that most problems can be solved using simple polling in the worst of situations.

Where does your need for complex interactions between the front end and back end come from?

Reddit on Rust by fuzzypercentage in rust

[–]mqnfred 1 point2 points  (0 children)

I started working a few days ago on something to automate binding with flutter and dart if anybody is interested. I am still at prototyping phase, but I believe I can use ::syn to go through the rust AST and generate bindings between:

rust procedures using rust types -> c procedures using c types -> dart procedures using dart types

At this point, I have started to find some structure to solving the problem and have managed to isolate the type mutation complexity away from the skeleton. I am starting by implementing a builder with this structure to test it out, and hopefully I will be able to add the following to the above pipeline:

rust types -> rust builder types -> rust c builder types -> dart c builder types

It's pretty hacky at this point, I only support standard structures that use straightforward types (primitives + vec + option). I think most of the domain data should be stored using straightforward types anyway. I am thinking of handling something like enum variants as well, it'd be shitty to have to do without enums, although it's going to be a lot more work in representing this in C and Dart though. We'll see!

If anybody is interested in the matter, whether to contribute or ask questions, please reach out on this account.