1
10

Hello,

I have been learning rust and want to make something exciting so I though why not build a Lisp compiler in Rust B)

so here what I did today. https://gist.github.com/anon2834678263/bcaa06e934f7b478be79203553f170ee

the tokenizer isn't ready and might have horrible bugs but at least I got comfortable declaring immutable variable by default, not surrounding stuff with parentheses unnecessarily. oh and also Enums which is most powerful thing in rust as people say.

I am still not satisfied though since the code looks more like C than Rust xD

maybe some experienced people can correct me :)

2
19
3
3
submitted 4 days ago by veloren23djk@lemmy.zip to c/rust@lemmy.ml

I am creating an app that will have some data visulization features. I have no experience in tauri or web dev, so I want to know whether it is possible to render D3.js, plotty, etc. and use them as a part of the tauri frontend

4
11
submitted 1 week ago by thingsiplay@lemmy.ml to c/rust@lemmy.ml
5
1
6
6
7
19
submitted 1 week ago by Ephera@lemmy.ml to c/rust@lemmy.ml
8
11
This Week in Rust 653 (this-week-in-rust.org)
submitted 1 week ago by dessalines@lemmy.ml to c/rust@lemmy.ml
9
9
10
9
submitted 3 weeks ago by dessalines@lemmy.ml to c/rust@lemmy.ml
11
22
submitted 3 weeks ago* (last edited 3 weeks ago) by tracyspcy@lemmy.ml to c/rust@lemmy.ml

Finally I can stay forever on lemmy even not opening the browser! 😂

Thinking of using it as a mod tool to see new posts in communities I moderate.

Sharing it early, maybe get some ideas on how to make it better.

https://github.com/tracyspacy/lemmy-tray

12
6
submitted 1 month ago by dessalines@lemmy.ml to c/rust@lemmy.ml
13
7
14
8
submitted 1 month ago by remustan37@sh.itjust.works to c/rust@lemmy.ml

Hi everyone I was thinking of creating a backend module that has functione for a note taking(search, sort, etc). So anyone can implement a ui on top of it.

I have some basic understanding of rust (made a just-working chip-8 emulator). But I've never used SQL or other database.

Is this plausible? Is there a similar project that I can use as reference? What are the mistakes I should avoid?

15
6
submitted 1 month ago* (last edited 1 month ago) by steam_lover@sh.itjust.works to c/rust@lemmy.ml
16
29
Announcing Rust 1.95.0 (blog.rust-lang.org)
17
5
[features]
default = ["runtime_completion_gen", "comptime_completion_gen", "comptime_manpage_gen"]
runtime_completion_gen = ["dep:clap_complete",]
comptime_completion_gen = ["dep:clap_complete"]
comptime_manpage_gen = ["dep:clap_mangen"]

[dependencies]
anyhow = "1.0.0"
clap = { version = "4.0.0", features = ["derive", "help"] }
clap_complete = { version = "4.0.0", optional = true }
ignore = "0.4.25"

[build-dependencies]
clap = { version = "4.0.0", features = ["derive"] }
clap_complete = { version = "4.0.0", optional = true }
clap_mangen = { version = "0.2.31", optional = true }

The features that start with comptime, as their name suggest, happen at comp time in build.rs, they generate shell completions and manpages for my cli utility, thus they depend only at build time to their respective dependencies, but there seems no way to specify this.

Does anyone know if there is a way to specify build deps for a feature?

18
9
submitted 2 months ago by steam_lover@sh.itjust.works to c/rust@lemmy.ml
19
3
submitted 2 months ago by tracyspcy@lemmy.ml to c/rust@lemmy.ml

cross-posted from: https://lemmy.ml/post/45214693

Also vm repo

20
27
submitted 2 months ago by TitanNano@vger.social to c/rust@lemmy.ml

cross-posted from: https://vger.social/post/37291894

godot-rust goes into the next round with v0.5, just released on crates.io!

On the toolchain side:

  • We now support Rust edition 2024 and Godot 4.6 out of the box, as well as all versions >= 4.2.

  • WebAssembly support no longer needs LLVM/bindgen and is being unit-tested on CI.

  • It's now possible to depend on other godot-rust crates through rlib.

Some features added in this cycle:

Typed dictionary. Also, enums in Godot collections!

let tiles: Dictionary<Vector2i, Tile> = dict! {
   Vector2i::new(1, 2) => Tile::GRASS,
   Vector2i::new(1, 3) => Tile::WATER,
};

Non-null engine APIs:

// Instead of...
let t: Gd<Tween> = node.create_tween().unwrap();
// ...now:
let t: Gd<Tween> = node.create_tween();

Direct == &str comparison, saving allocation:

let s = StringName::from("hello");
if s == "hello" { ... }

Bitfield Debug impl:

assert_eq!(
    format!("{flags:?}"),
    "PropertyUsageFlags { EDITOR | READ_ONLY }"
);

Optional parameters -- call from GDScript as method(1) or method(1, 2):

#[func]
fn method(
    required: i32,
    #[opt(default = 100)] optional: i32,
) { ... }

Export tool button -- click in Godot's inspector to immediately execute Rust code:

#[export_tool_button(fn = Self::on_clicked, icon = "2DNodes")]
click_me: PhantomVar<Callable>, // not a physical property

We now also have a Games page showcasing projects that users made with godot-rust! And I'm still behind on adding new entries there :)

Huge thanks to the community for making this possible! Countless bug reports, PRs, and feedback based on real-world projects have helped godot-rust immensely to reach this point.

If you like the project, consider giving us a star on GitHub. As it's maintained entirely in free time without any financial backing, small GitHub Sponsor contributions are also very appreciated (Yarwin or TitanNano or Bromeon). Thanks to everyone supporting the project -- We are excited to see what will be built on v0.5!

21
16
Announcing Rust 1.94.1 (blog.rust-lang.org)
submitted 2 months ago by steam_lover@sh.itjust.works to c/rust@lemmy.ml
22
22
Synchi - Two-way file sync (jakobkreft.github.io)
submitted 2 months ago by jak0b@lemmy.ml to c/rust@lemmy.ml

cross-posted from: https://lemmy.ml/post/44815211

Two-way file sync, no remote agent needed

Today Synchi is finally public! It's designed for syncing files between two locations (local or over SSH). It detects conflicts, and lets you decide what to do.

Why not rsync/Unison/Syncthing?

  • rsync has no memory between runs and is one-way
  • Unison needs to be installed on both sides
  • Syncthing requires always-on daemons

Synchi runs on demand, works over SSH, and only transfers what actually changed.

I use it daily for syncing a shared folder between my machines and an android phone. Works great in combination with Tailscale/WireGuard so that you can sync files remotely.

23
9
Security advisory for Cargo (blog.rust-lang.org)
submitted 2 months ago by steam_lover@sh.itjust.works to c/rust@lemmy.ml
24
18
submitted 2 months ago by Ephera@lemmy.ml to c/rust@lemmy.ml

Always had the problem that if I wanted to just log an error, rather than bubble it all the way up to main(), that you wouldn't get a stacktrace. You could iterate the source chain and plug the stacktrace together yourself, but it's rather complex code.

Now I realized, you can do this to get a stacktrace:

let error = todo!("Get an error somehow...");
let error = anyhow::anyhow!(error); //converts to an `anyhow::Error`
eprintln!("Error with stacktrace: {error:?}");

For converting to an anyhow::Error, it often also makes sense to use anyhow::Context like so:

use anyhow::Context;
let error = error.context("Deleting file failed.");
25
40
submitted 2 months ago* (last edited 2 months ago) by steam_lover@sh.itjust.works to c/rust@lemmy.ml
view more: next ›

Rust Programming

9286 readers
8 users here now

founded 7 years ago
MODERATORS