8

GitHub - mTvare6/hello-world.rs: 🚀Memory safe, blazing fast, configurable, minim...

 3 years ago
source link: https://github.com/mTvare6/hello-world.rs
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

rocket hello-world.rs rocket

rocket Memory safe, blazing fast, minimal and configurable hello world project written in the rust(rocket) programming language rocket

rocket While this depends on more c code than rust(rocket) code to compile, because rust(rocket) is magically memory safe, now all c code is memory safe too rocket

rocket This project is very minimal, it only requires 1061 crates rocket

Building

To compile this project you need only one library rocket:

1. alsa-lib rocket
1. glfw rocket
1. freetype rocket
1. libglib rocket
1. pango rocket
1. atk rocket
1. pixbuf rocket
1. gdk rocket
Just 1 lib as you can see the number list along the names rocket

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(rocket), unlike node_modules being fairly large for few dependencies, rust(rocket) manages compile caches efficiently and stores them to storage to save compile times! Just 33G target folder, the compile time is around 2 hours and 30 minutes on my mac on release mode

A clean build makes it take around 3.8G

The CPU usage is pretty minimal too (release mode)

Docker

$ docker build -t hello-world .
$ docker run -it --rm --name hwrs hello-world

Why rust(rocket) 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 cringe and CVE rocket

R in "rust(rocket) systems programming language" stands for rewrite and robust rocket

Here are the comments from few of my fellow Rustaceans rocket

People ask the question "what's rust(rocket) 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.rocket

Modern rust(rocket) appears pretty similar to modern JavaScript. You declare your variables with letrocket

I think it would make rust(rocket) more productive if rust(rocket) could absorb Python's ecosystem(many mature wheels) as soon as possible.rocket

One thing I like about rust(rocket) is that it filters out lazy/sloppy thinkers. Even when I disagree with another rust(rocket) 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.rocket

The thing I hate about rust(rocket) the most is that all the other languages feel extra dumb and annoying once I learned borrowing, lifetimes etc.rocket

"I feel like the discovery of rust(rocket) is transporting me back to my younger self [...]" "When I started learning rust(rocket) 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."rocket

rust(rocket)’s product is not a programming language or a compiler. rust(rocket)’s product is the experience of being a rust(rocket) developerrocket

rust(rocket) can handle CPU-intensive operations such as executing algorithms. rocket

Because it’s typically typed, rust(rocket) catches errors at compile time. [...] Also, it compiles code down to machine learning, allowing for extra efficiency.rocket

Many people try to compare rust(rocket) to Go, but this is flawed. Go is an ancient board game that emphasizes strategy. rust(rocket) is more appropriately compared to Chess, a board game focused on low-level tactics.rocket

rust(rocket)'s unsafe keyword is a critical innovation for information security. I believe that Safe rust(rocket) will eventually be a foundational technology for all of human society.rocket

I wish I had a compiler (one as informative as rust(rocket)'s would be amazing) but for Japanese. If I could learn Japanese the way I learn programming I'd be conversationally fluent by now.rocket

rust(rocket) 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.rocket

I've experienced modern package management through Cargo and anything below that level now seems like returning to stone age.rocket

I probably can write same code in c, but since rust(rocket) is rust(rocket), I need to (re)write in rust(rocket) rocket

Wait its only time until rust(rocket) makes assembly memroy safe.rocket

Done lots of C/C++/Python is the past, just started learning node/JS recently. Just kicked off a rust(rocket) tutorial, you people obviously already know this, but rust(rocket) is basically all the awesomeness of C++ smashed together with all the awesomeness and dependency management of JS. Looking forward to learning more rust(rocket) in the future! rocket

All C/C++ devs are absolute fools, they are wasting their time writing c/c++ when instead they could write in rust(rocket)!!!!

As a rust(rocket) developer, I have no idea how any of this or computers actually works, but its cool to ask people in discord.gg/rust(rocket) for all help and write coderocket


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK