26
9
ReactNative but Rust? (programming.dev)
submitted 3 months ago by [email protected] to c/[email protected]

Hi.

Rust can run on anything from web browsers to Adruinos. BUT can you make Android/iOS apps with it? I heard that you can make the backend of your app in Rust and then incorporate it into your Java/Kotlin app, but I'm looking for something like React Native or Flutter, where you can build the entire app (including UI and interacting with native APIs) in Rust without writing a single line of Java/Kotlin.

Does something like that exist? If not, then is anyone working on it?

Oh, and I don't mean I want one of the many libraries which just compile your code to WASM and run the app in a WebView... I want something that lets me make native UIs - like React Native or Flutter.

Thanks

27
34
submitted 3 months ago by [email protected] to c/[email protected]

Rust is beautiful and at the same time pretty hard language to learn. While mastering it and digging deeper, I decided to play around basic data structures and algorithms. I put a repo with some theory, implementations and examples on github mainly for myself, but maybe someone will find it helpful, or share more effective solutions. For now, just a few topics are covered, and I'm going to update it from time to time.

repo: https://github.com/tracyspacy/algos_data_structures_rust

28
25
submitted 3 months ago by [email protected] to c/[email protected]
29
16
submitted 3 months ago by [email protected] to c/[email protected]

I have a plugin trait that includes some heavy types that would be almost impossible to wrap into a single API. It looks like this:

pub struct PluginContext<'a> {
    pub query: &'a mut String,
    pub gl_window: &'a GlutinWindowContext,
    flow: PluginFlowControl,
    pub egui_ctx: &'a Context,
    disable_cursor: bool,
    error: Option<String>,
}
pub trait Plugin {
    fn configure(&mut self, builder: ConfigBuilder) -> Result<ConfigBuilder, ConfigError> {
        Ok(builder)
    }
    fn search(&mut self, ui: &mut Ui, ctx: &mut PluginContext<'_>);
    fn before_search(&mut self, _ctx: &mut PluginContext<'_>) {}
}

Here is what I considered:

  1. Keeping all plugins in-repo. This is what I do now, however I'd like to make a plugin that would just pollute the repository. So I need another option that would keep the plugins' freedom as it is right now, but with the possibility to move the plugin out to a separate repository.
  2. I tried to look into dynamic loading, and since rust doesn't have a stable ABI, I'm okay with restricting the rust versions for the plugin ecosystem. However, I don't think it's possible to compile this complex API into a dynamic lib and load it safely.
  3. I'm also ok with recompiling the app every time I need a new plugin, but I would like to load these plugins automatically, so I don't want to change the code every time I need a new plugin. For example, I imagine loading all plugins from a folder. Unfortunately, I didn't find an easy solution for this neither. I think I will write a build macro that checks the ~/.config/myapp/plugins and include all of them into the repo.

Do you have any better ideas, suggestions? Thanks in advance.

(For context, this the app I'm writing about: https://github.com/fxdave/vonal-rust)

30
20
submitted 4 months ago by [email protected] to c/[email protected]

When I install some Linux app from, let's say GitHub, I can feel how long without updates means the project is not maintained.
For example last commit being 5 years ago for GTK app is a long time and this is considered an abandoned repo. For super simple things like cowsay it's not that simple but still I can feel it.

How is that with crates with Rust? I see a lot of parsers or web libraries that are not updated for a year, two years, three years... How old is too old?
Also, many of them have a version 0.x.x, so can I even consider them stable?

31
10
Serving Astro with Rust (www.yieldcode.blog)
submitted 4 months ago by [email protected] to c/[email protected]
32
36
submitted 4 months ago by [email protected] to c/[email protected]

similar to other tools. the author says "RustViz is a bit more of a purely educational tool, as code has to be annotated manually, while Boris aims to be more of a development assistance"

33
21
submitted 4 months ago by [email protected] to c/[email protected]

Using the Overpass API to read OSM data, parsing the data with Rust, and then drawing the map onto HTML5 canvas.

34
17
submitted 4 months ago by [email protected] to c/[email protected]

I recently made a fairly simple shader heavily inspired by the one used for characters in The Legend of Zelda: The Wind Waker. I've got all my info on how it worked on the GameCube from this amazing video

Check out the source at bevy_wind_waker_shader

Here are some screenshots :)

Sphere:

Sphere

Light throughout day:

Light throughout day

Daylight

Daylight

Night time

Night time

35
33
submitted 4 months ago by [email protected] to c/[email protected]
36
17
submitted 4 months ago by [email protected] to c/[email protected]
37
5
submitted 5 months ago by [email protected] to c/[email protected]

Anyone aware of a testing framework hopefully integrating well, and abstracting the shuttle testing functionality?

BTW I found rtest, but it doesn't in particular abstracts shuttle at all, it's a fixtures generic framework.

Planning to use shuttle to do MT testing targeting C binded code, and looking for a way to abstract as much as possible the shuttle scheduler trait and such...

Thanks !

38
13
submitted 5 months ago by [email protected] to c/[email protected]

publicado de forma cruzada desde: https://infosec.pub/post/8054415

Stract is an open source search engine where the user has the ability to see exactly what is going on and customize almost everything about their search results. It's a search engine made for hackers and tinkerers just like ourselves. No more searches where some of the terms in the query arent used, and the engine tries to guess what you really meant. You get what you search for.

Fun fact: It's written in Rust! (nearly 90%) https://github.com/StractOrg/stract

39
52
submitted 5 months ago by [email protected] to c/[email protected]

Hi all,

We've started a new community for learning rust and/or the lemmy codebase together.

Come join in: [email protected]

The idea is that there are probably a good amount of people interested in learning rust, or, interested in contributing to or using the lemmy codebase, but find it difficult to get started ... so basically why not start a sort of study group or reading group or support channel style of community? Here's where the idea was originally suggested: https://lemmy.ml/post/11232276

We're just putting the place together and sorting out how it could work, but all kinds of inputs and levels of expertise are welcome!

40
11
submitted 5 months ago by [email protected] to c/[email protected]
41
26
submitted 5 months ago by [email protected] to c/[email protected]
42
58
submitted 5 months ago* (last edited 5 months ago) by [email protected] to c/[email protected]

I am delighted to finally release a project that has been cooking for quite a while: Yarn Spinner for Rust 🎉 . Some of you might remember this under the name Yarn Slinger, but the kind folks at Secret Lab have allowed me to use their trademark! Yay!

What is Yarn Spinner?

It's a friendly tool that helps you write dialog! See for yourself at the live demo. You can also check out this or this GDC talk about the original C# implementation. What I have released today is the Rust port for the project, with first-class support for Bevy!

Quickstart

Writing a dialog with Yarn Spinner is as easy as whipping up a simple screenplay:

// assets/dialogue/hello_world.yarn
title: Start
***
Ancient Reptilian Brain: There is nothing. Only warm, primordial blackness. Your conscience ferments in it -- no larger than a single grain of malt. You don't have to do anything anymore.
Ancient Reptilian Brain: Ever.
Ancient Reptilian Brain: Never ever.
-> Never ever ever?
  Ancient Reptilian Brain: Never ever ever ever, baby!
-> (Simply keep on non-existing.)

Ancient Reptilian Brain: An inordinate amount of time passes. It is utterly void of struggle. No ex-wives are contained within it. 
===

Pretty simple file format, right? Check out the general Yarn Spinner documentation for more or look into the Bevy examples.

43
42
submitted 5 months ago by [email protected] to c/[email protected]

I made it for myself as the simplest way to keep track of positive routines. The concept is simple: Track the activities that make up your perfect day and monitor your daily progress effortlessly. Here is also a github link for those who interested : https://github.com/tracyspacy/yacht

44
2
submitted 5 months ago by [email protected] to c/[email protected]

Maybe 2024 will be the year I rebuild everything in @rust

45
32
submitted 5 months ago by [email protected] to c/[email protected]

cross-posted from: https://lemmy.world/post/11271385

Basically, you can choose some slides from an opened .tex file to copy. It also has the function to see which graphics files are included in the selected files, so you know which ones to copy.

Here is the Github link: https://github.com/Atreyagaurav/beamer-quickie

The PDF pages are shown using the SyncTeX (if available) so that you can visually choose the slides as long as there is a single .tex source file, (might still work without synctex for simple cases).

I've made it on Linux, so it hasn't been tested in windows. You probably will need to compile gtk on Windows if you want to make it work. So if someone is really interested let me know, I can give instructions. Even in linux you'll need to install dependencies.

46
40
submitted 5 months ago by [email protected] to c/[email protected]

I am new to Rust, and have always been interested in how games were made. But man I've got to say that just ready the bevy book has been pretty fun. I am looking at all the examples in the repo. I wanna here others perspective on bevy, or Rust game development in general!

crossposted from: https://programming.dev/post/8881051

47
26
submitted 6 months ago by [email protected] to c/[email protected]
48
24
submitted 6 months ago by [email protected] to c/[email protected]
49
3
submitted 6 months ago* (last edited 6 months ago) by [email protected] to c/[email protected]

cross-posted from: https://lemmy.world/post/10459323

Live coding Matrix in Rust #owncast #streaming #coding #rust #matrix

Find Andy’s previous recordings at: https://diode.zone/a/andybalaam/video-channels

50
63
submitted 6 months ago by [email protected] to c/[email protected]

This library is responsible for federation in Lemmy, and can also be used by other Rust projects.

view more: ‹ prev next ›

Rust Programming

7734 readers
2 users here now

founded 5 years ago
MODERATORS