base on ๐Ÿš€Memory safe, blazing fast, configurable, minimal hello world written in rust(๐Ÿš€) in a few lines of code with few(1247๐Ÿš€) dependencies๐Ÿš€ # ๐Ÿš€ hello-world.rs ๐Ÿš€ ๐Ÿš€ Memory safe, blazing fast, minimal and configurable hello world project written in the rust(๐Ÿš€) programming language ๐Ÿš€ ๐Ÿš€ While this depends on more c code than rust(๐Ÿš€) code to compile, because rust(๐Ÿš€) is magically **memory safe**, now all c code is memory safe too ๐Ÿš€ ๐Ÿš€ This project is very minimal, it only requires **1247** crates ๐Ÿš€ ### Building To compile this project you need only one library ๐Ÿš€: <div>1. <a href="https://www.cairographics.org/download/">cairo development libraries</a> ๐Ÿš€.</div> <div>1. <a href="https://www.gtk.org/docs/installations/">libgtk development libraries</a> ๐Ÿš€.</div> <div>1. alsa-lib ๐Ÿš€</div> <div>1. glfw ๐Ÿš€</div> <div>1. freetype ๐Ÿš€</div> <div>1. libglib ๐Ÿš€</div> <div>1. pango ๐Ÿš€</div> <div>1. atk ๐Ÿš€</div> <div>1. pixbuf ๐Ÿš€</div> <div>1. gdk ๐Ÿš€</div> <div>1. vulkan(moltenVK on mac) ๐Ÿš€</div> </br> <div>Just a single library ๐Ÿš€</div> </br> You probably have most of them already, if it says something along the words, you know what to search for now Then you can just `make` and the compiled executable should be located in `./target/release/hello-world` run it or install it with `make install`. Due to the lightweightness of rust(๐Ÿš€), unlike node_modules being fairly large for few dependencies, rust(๐Ÿš€) manages compile caches efficiently and stores them to storage to save compile times! Just **37G** target folder on couple of compilation(dev+release), the compile time is only around **2 hours and 30 minutes** on my mac air on release mode ![๐Ÿš€](/ast/unclean.png) A clean build makes it take around _4.7G_ ![๐Ÿš€](/ast/clean.png) The CPU usage is pretty minimal too (release mode) ![๐Ÿš€](/ast/cpu.png) It is slower than echo but memory safety comes at a cost! We need to be memory chad and blazing pure and lightning based ![๐Ÿš€](/ast/lib_benchmark.png) Benchmark by [cypercine](https://github.com/mTvare6/cypercine) ### Installation #### Arch Linux ```sh $ makepkg -si $ pacman -U <package>.pkg.tar.xz ``` #### Docker ```sh $ docker build -t hello-world . $ docker run -it --rm --name hwrs hello-world ``` #### Nix ```sh $ nix-env -i -f default.nix ``` #### Shade ```sh $ wget "https://raw.githubusercontent.com/mTvare6/hello-world.rs/master/hello-world.rs-buildscript" -O <prefix>/user/main/hello-world.rs $ shade install hello-world.rs ``` ### Why rust(๐Ÿš€) while its only 1 line and depends on 600 c bind crates? Here are my takes on that matter > **C** in "c language" stands for **C**ringe and **C**VE and **C**ervical **C**apricious **C**atastrophic **C**hthonic **C**lumsy **C**lueless **C**omplex and **C**ryptic ๐Ÿคฎ > **R** in "rust(๐Ÿš€) systems programming language" stands for **R**ewrite, **R**obust, **R**eliable, **R**ambunctious, **R**eprehensibl[ly great] and **S**ecure๐Ÿš€ > [Since hello-world.rs is written in blazingly pure, configurable, lightweight and memory pure rust(๐Ÿš€) - the CVEs are secure, memory chad and blazing pure](https://github.com/mTvare6/hello-world.rs/issues/) ๐Ÿš€ Here are the comments from few of my fellow Rustaceans ๐Ÿš€ > People ask the question "what's rust(๐Ÿš€) good for?" pretty frequently, and little terminal apps like this are precisely the reason. [...]. It enables a kind of workflow that simply didn't exist before: I could have a fully safe, "correct", LLVM-optimized binary installed on my desktop in an afternoon.๐Ÿš€ > Modern rust(๐Ÿš€) appears pretty similar to modern JavaScript. You declare your variables with let๐Ÿš€ > I think it would make rust(๐Ÿš€) more productive if rust(๐Ÿš€) could absorb Python's ecosystem(many mature wheels) as soon as possible.๐Ÿš€ > One thing I like about rust(๐Ÿš€) is that it filters out lazy/sloppy thinkers. Even when I disagree with another rust(๐Ÿš€) programmer, there is a certain level of respect that comes from knowing that they thought about the problem deeply enough to pass the borrow checker.๐Ÿš€ > The thing I hate about rust(๐Ÿš€) the most is that all the other languages feel extra dumb and annoying once I learned borrowing, lifetimes etc.๐Ÿš€ > "I feel like the discovery of rust(๐Ÿš€) is transporting me back to my younger self [...]" "When I started learning rust(๐Ÿš€) in earnest in 2018, I thought this was a fluke. It is just the butterflies you get when you think you fall in love, I told myself."๐Ÿš€ > rust(๐Ÿš€)โ€™s product is not a programming language or a compiler. rust(๐Ÿš€)โ€™s product is the experience of being a rust(๐Ÿš€) developer๐Ÿš€ > rust(๐Ÿš€) can handle CPU-intensive operations such as executing algorithms. ๐Ÿš€ > Because itโ€™s typically typed, rust(๐Ÿš€) catches errors at compile time. [...] Also, it compiles code down to machine learning, allowing for extra efficiency.๐Ÿš€ > Many people try to compare rust(๐Ÿš€) to Go, but this is flawed. Go is an ancient board game that emphasizes strategy. rust(๐Ÿš€) is more appropriately compared to Chess, a board game focused on low-level tactics.๐Ÿš€ > rust(๐Ÿš€)'s unsafe keyword is a critical innovation for information security. I believe that Safe rust(๐Ÿš€) will eventually be a foundational technology for all of human society.๐Ÿš€ > I wish I had a compiler (one as informative as rust(๐Ÿš€)'s would be amazing) but for Japanese. If I could learn Japanese the way I learn programming I'd be conversationally fluent by now.๐Ÿš€ > rust(๐Ÿš€) held onto itโ€™s spot as the most beloved language among the professional developers we surveyed. That said, the majority of developers who took the survey arenโ€™t familiar with the language.๐Ÿš€ > I've experienced modern package management through Cargo and anything below that level now seems like returning to stone age.๐Ÿš€ > I probably can write same code in c, but since rust(๐Ÿš€) is rust(๐Ÿš€), I need to (re)write in rust(๐Ÿš€) ๐Ÿš€ > Wait its only time until rust(๐Ÿš€) makes assembly memroy safe.๐Ÿš€ > Done lots of C/C++/Python is the past, just started learning node/JS recently. Just kicked off a rust(๐Ÿš€) tutorial, you people obviously already know this, but rust(๐Ÿš€) is basically all the awesomeness of C++ smashed together with all the awesomeness and dependency management of JS. Looking forward to learning more rust(๐Ÿš€) in the future! ๐Ÿš€ > All C/C++ devs are absolute fools, they are wasting their time writing c/c++ when instead they could write in rust(๐Ÿš€)! > [C devs are people who use leeches to cure diseases](https://matrix.to/#/!CkLhFPTTdUYTfxSNGd:libera.chat/$nlVNx5d4nW6dNd7Y_0M6feEdwln2xU_mIUOivwJaXgM?via=libera.chat&via=matrix.org&via=halogen.city) ๐Ÿš€ > As a rust(๐Ÿš€) developer, I have no idea how any of my code or computers actually works, but its cool to ask people in discord.gg/rust(๐Ÿš€) for all help and write code๐Ÿš€ I've recently added source to where I've got these quotes from, when I get time I will add sources to where there messages are from, for now some sources aren't marked ", Assign "at most 3 tags" to the expected json: {"id":"12356","tags":[]} "only from the tags list I provide: []" returns me the "expected json"