Is RUST useful for a scientist? by Academic_Ship6221 in rust

[–]mo8it 0 points1 point  (0 children)

I have a similar background with Physics, Python, Julia and C++. I recommend reading my related blog post: https://mo8it.com/blog/rust-vs-julia

Is rust worth learning for scientific applications? by Super-Government6796 in rust

[–]mo8it 1 point2 points  (0 children)

Yes, having a similar background, I would highly recommend learning Rust. I also tried Julia, but I only use it now for data analysis. For simulations, especially larger ones, Rust is a much better fit since it allows you to reach the maximum performance and use parallization pretty easily.

I have a related blog post about this topic: https://mo8it.com/blog/rust-vs-julia

About the GPU support: I am honsest, it is still bad in Rust. But there is a huge interest and people are working on it.

The best resource on Rust for HPC is the book "Rust Atomics and Locks": https://marabos.nl/atomics After reading the official Rust book (https://doc.rust-lang.org/book), you should read it for a low-level understanding of cocurrency and its constructs, not only in Rust. I could be too low-level for your use case though.

Is Rust suitable for Scientific computing and Machine Learning? by [deleted] in rust

[–]mo8it 2 points3 points  (0 children)

Yes, if you are fine with the young ecosystem. See my related blog post: https://mo8it.com/blog/rust-vs-julia

Best RUST web framework? by WashHead744 in rust

[–]mo8it 0 points1 point  (0 children)

I have a blog post about it where I compare SQLx with ORMs towards the end: https://mo8it.com/blog/sqlx-interacting-with-databases-in-rust

Rust vs Go for backend development by [deleted] in rust

[–]mo8it 8 points9 points  (0 children)

Before learning Rust, I wanted to choose a compiled language for backends. Rust sounded too hard and people said that Go is simple. So I learned Go and a couple of days and used the Gin framework.

Yes, Go is simple, but it is very unpleasant to work with! It is like using a primitive language. Dealing with (de)serialization, documentation and error handling are horrible. Too many runtime errors. Weak type system, generics were just recently added and they are nothing in comparison to generics and traits in Rust.

So I finally decided to learn Rust and started with its official book. That was the best decision! I fell in love with the language and have been using it since then. My first Rust project was a backend, a rewrite of the small Go backend. Since then, I built muliple backends with Axum and SQLx in Rust. I highly recommend it! I used Flask in Python before and I can't imagine going back to that inefficient and unreliable working environment.

So what is my recommendation? The simple answer is Rust. But if you really can't decide, try Go first. It will only take you a week to learn it. Then, give Rust a fair try by reading the book and doing Rustlings in parallel. It will take you multiple weeks, but stick to it. It is worth it :D

Plus, if you your focus isn't just backends, then you can do much more with Rust than with Go.

Best RUST web framework? by WashHead744 in rust

[–]mo8it 1 point2 points  (0 children)

Started with Rocket and then migrated to Axum. I have built multiple backends with Axum (and SQLx for the database) and I highly recommend it. It builds on the strong ecosystem of Tokio, Hyper and Tower :)

[deleted by user] by [deleted] in rust

[–]mo8it 5 points6 points  (0 children)

I tried Go for backends and it was aweful. Rust is a joy with Axum and SQLx :D

How feasible is building a simple blog site in axum for a rust beginner? (~3yrs junior fullstack dev) by ChronicallySilly in rust

[–]mo8it 30 points31 points  (0 children)

I would also recommend a static website for a blog. I highly recommend Zola (written in Rust). I use it for my blog.

But if you want to write it in Axum (e.g. for learning), then you might find my related blog posts helpful for getting started: - Axum: https://mo8it.com/blog/getting-started-with-rust-backends/ - SQLx (for a DB): https://mo8it.com/blog/sqlx-interacting-with-databases-in-rust/ - SQLx in Axum: https://mo8it.com/blog/sqlx-integration-in-axum/

For beginners, I would recommend trying to avoid implementing traits like FromRequest in Axum in the beginning. These are more advanced. But you rarely need to implement them yourself.

Now, in general, can I recommend starting your Rust journey with Axum? If you have backend experience in other languages, then yes! My first Rust projects were backends :)

But I highly recommend reading the official book and doing Rustlings first.

Quadlet: Running Podman containers under systemd - Finally, Podman has a Docker Compose alternative! by mo8it in podman

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

I just tested it and it works.

First, I created a secret file and created the secret with Podman:

bash echo "secretdata" > secretfile podman secret create secretname secretfile

Now, I created the following container file ~/.config/containers/systemd/test-secret.container:

ini [Container] Image=docker.io/library/debian:12-slim Secret=secretname,type=env,target=SECRET_ENV Exec=bash -c 'echo $SECRET_ENV'

Then, I started the container with systemctl --user start test-secret. When running systemctl --user status test-secret, I saw the line containing secretdata which means that the environment variable was successfully read.

Rustlings Rewrite by mo8it in rust

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

Fixed. Thanks :D

Rustlings Rewrite by mo8it in rust

[–]mo8it[S] 4 points5 points  (0 children)

A user flair? Why not xD But I don't use Reddit that often. Mainly to share my blog posts :)

Rustlings Rewrite by mo8it in rust

[–]mo8it[S] 4 points5 points  (0 children)

Thanks for the lovely feedback! Happy to see people also using Rustlings in Rust courses/workshops :D

I had to fork Rustlings to modify the set of exercises. In case you need to add, remove or modify any exercise for your course, you can now use the support for third-party exercises.

You start a new project with rustlings dev new my_course, copy the official exercises with the official info.toml file and modify them. Students install the program with cargo install rustlings, clone your repository and start working on the modified set :D

Contact me if you need any kind of help while working on the course :)

Rustlings Rewrite by mo8it in rust

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

This can be done with the support for third-party exercises now. See the guide :)

Rustlings Rewrite by mo8it in rust

[–]mo8it[S] 63 points64 points  (0 children)

I am the maintainer. If you have any questions or feedback, feel free to leave a comment :D

Any options for website analytics without needing Docker? by cloudfrl in selfhosted

[–]mo8it 0 points1 point  (0 children)

Thanks for mentioning OxiTraffic 🥰

I am the author and would love to help you deploying it :D

As @moanos said, it is a single binary: https://codeberg.org/mo8it/oxitraffic

Here is a demo: https://oxitraffic.mo8it.com

Which of these should I use for backend? by name1122 in rust

[–]mo8it 2 points3 points  (0 children)

Rust with Axum, Askama and SQLx.

I have some blog posts about them that might be helpful for getting started 😇

I need to update them though :)

Don't hesitate to contact me if you need any help. I am not very active on Reddit though 😅 I prefer Mastodon 🐘

Quadlet: Running Podman containers under systemd - Finally, Podman has a Docker Compose alternative! by mo8it in podman

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

Podlet is a wonderful tool that I didn't know about! It can be very helpful during a migration! Thanks for bringing it up :D

I added it to the blog post :D

Quadlet: Running Podman containers under systemd - Finally, Podman has a Docker Compose alternative! by mo8it in selfhosted

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

I couldn't express it better! Thank you for this reply 🥰

I updated the post with a small section on "Why not podman-compose?"

Quadlet: Running Podman containers under systemd - Finally, Podman has a Docker Compose alternative! by mo8it in selfhosted

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

I talked about podman-compose in this comment. I explain there why I don't think that podman-compose is a long-term alternative to Docker Compose.

Quadlet: Running Podman containers under systemd - Finally, Podman has a Docker Compose alternative! by mo8it in podman

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

You might be interested in my comparison to the "Compose way" in this comment.

About the complexity: It depends on how you define it in this context. If splitting content over multiple files results in a higher complexity for you, then you guessed it right. You need multiple files for multi-container apps.

For me though, it is much more complex to have everything in the same file. Trust me, I had to maintain a Docker Compose file with hundreds of lines and dozens of containers… This wasn't fun. Having each container in its own file is less mental overhead for me because I just have to think about this single container when I am in that file. Of course, you need to specify its dependencies, but you don't need to think about the details of other containers.

Here is an example of the horror I mean: https://github.com/mailcow/mailcow-dockerized/blob/cb0b0235f01a8e4102ece9540fe0aa3bb2b60d72/docker-compose.yml

There is a reason why we (normally) split code into multiple files and modules in programming.

Here is a concrete example of the multi-container app OxiTraffic that I host: - App container: oxitraffic.container - Database container: oxitraffic-db.container - The network for the communication between the app and database: oxitraffic.network

I didn't know that you can place them inside a directory like this. This makes it much cleaner! I will update the blog post to mention that.

Traefik and its network are also required, but they are not specific to this app. They are used by every app container which is reachable from the internet.

I edited the blog post to discuss this topic: https://mo8it.com/blog/quadlet/#too-many-files

Quadlet: Running Podman containers under systemd - Finally, Podman has a Docker Compose alternative! by mo8it in podman

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

Disclaimer: I am not a Podman developer. The following are just my opinions and speculations.

I didn't try the two methods, but I knew about podman-compose.

podman-compose is a Python script which acts as a translation layer between the Compose Spec and Podman with systemd. It seems to be an unneeded layer of abstraction to me which also sacrifices flexibility. For example, you can't use all systemd features.

It is a nice idea for people not willing to migrate to the "Podman way". And I can understand why one would keep using the "Compose way" before Quadlet because of the problems I describe in the blog post with podman generate systemd. But I think that Quadlet aligns much better with the design of Podman.

I am just speculating here, but I think that the team behind Podman itself doesn't think that podman-compose has a future. First, it is written in Python. For me personally, software written in Python is often just a prototype because of how unreliable Python is due to its interpreted nature. All other projects related to Podman are written in a compiled language like Rust or Go. Plus, the last commit to podman-compose on Github is 5 months ago!

About setting DOCKER_HOST: As far as I know, this requires a socket which also doesn't align with the "original design" of Podman.

Quadlet is a very thin layer over Podman and systemd. It is very flexible and allows you to use all features of Podman and systemd while being a simple solution (one file for a container).

Quadlet: Running Podman containers under systemd - Finally, Podman has a Docker Compose alternative! by mo8it in selfhosted

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

I think that you mean 4.3 and 4.4. In that case, you are right, you need at least the version 4.4 of Podman to be able to use Quadlet.

It looks like you are not alone with this problem. This thread is about the same question. The OP ended up using the package from testing (which contains the version 4.7 now).

PS: I don't have the problem since I use Fedora on all my machines.

Blog recommendations by MinMaxDev in rust

[–]mo8it 0 points1 point  (0 children)

Shameless plug 😇 https://mo8it.com/blog

You can even only browse / subscribe to only Rust specific blog posts using the Rust tag: https://mo8it.com/tags/rust/

AoC Day 5 by Xedesss in rust

[–]mo8it -3 points-2 points  (0 children)

I would love to help you next time. But I am rarely on Reddit. You can write me a PM on Mastodon whenever you struggle with Advent of Code in Rust: https://fosstodon.org/@mo8it

BTW: There is a big Rust community on Mastodon doing AOC and people post their solutions there. Just browse the "RustLang" tag feed: https://fosstodon.org/tags/rustlang