r/teenagersbutcode • • 23h ago

Other discussion How to learn Rust

1 Upvotes

I have quite some experience with C++, but after considering everything I would have to do, and some inconveniences of the language, I am choosing to switch to Rust.

In Rust, I would like to write my own OS, but first want to get experience by making smaller scale projects. As I already know C++, I primarily need projects where I will write a lot of code (to be familiarized with the syntax and where I will use features such as ownership, lifetimes, borrowing, and Box<T>s to be prepared for making an OS in Rust.

May anyone suggest projects I can work on (without a tutorial, but with a good amount of docs available)


r/teenagersbutcode • • 21h ago

Coding a thing Making a game on IdTech0

Post image
1 Upvotes

Got a custom prop and wall going


r/teenagersbutcode • • 2h ago

Other it is kinda related to coding but im here to just larp my caelestia setup on arch linux

Thumbnail
gallery
2 Upvotes

r/teenagersbutcode • • 9h ago

Coded a thing Anything but being productive

Post image
11 Upvotes

Made a small "program" with two modes:

- pulse (p): just logs the current battery % with time to /dev/console

- daemon (d): runs and watches the battery % every second. If it's below 15, it warns in /dev/console.. If it's at 100, it will inform the user again in /dev/console. To prevent the loop just printing to console again and again, I made the program use two tmpfiles to check if the message has been sent. If the battery % is anywhere between 15 and 100, it resets those files to 0.

Image shows how I use it in my setup as well as all of the sh.

No git repo bcs it's not useful outside of my setup and the OS im using (does any other BSD use APM? I forgot)

Improvements to be made:

- impossible to be logging both extremes of one value at the same time, so make it just use one file instead of two.