Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite it in Rust - Rust is closer to the Metal!!! 🦀🤘 #20

Open
rochacbruno opened this issue Dec 5, 2024 · 3 comments
Open

Rewrite it in Rust - Rust is closer to the Metal!!! 🦀🤘 #20

rochacbruno opened this issue Dec 5, 2024 · 3 comments

Comments

@rochacbruno
Copy link

🎸 Rust is the True Metal of Programming
Java is fine, but it's like a lukewarm power ballad—good, but predictable. Rust, on the other hand, is like a blazing dragon-riding speed-metal solo, built for raw power and precision. Its memory safety features will guard your code like the sacred shields of Valhalla. No null pointers here, just clean, battle-ready logic.

⚡ Java is Legacy, Rust is the Axe of the Future
Sure, Java has stood the test of time, but Rust is the sword reforged, the new anthem for the coders of tomorrow. Its fearless concurrency will crush the bottlenecks of multithreading like a hammer smashing through false metal. Rewrite "Hello World" in Rust, and you forge your place in programming legend.

🔥 Performance So Fast, Even the Gods Will Tremble
Rust doesn’t have the JVM as a middleman—it compiles to raw machine code like a guitar solo that burns straight to your soul. Imagine your program shredding through execution time faster than Yngwie Malmsteen's fingers on a fretboard. That's Rust.

⚔️ Zero-Cost Abstractions = Pure, Untamed Efficiency
In Rust, you write beautiful, expressive code, but without sacrificing performance. It’s like wielding a guitar made of mithril: light, elegant, and incredibly strong. Java’s abstractions? Clunky like a broken lute from a discount tavern.

🎤 Rewrite it and Earn Eternal Fame
Rewriting "Hello World" in Rust isn’t just coding—it’s a declaration of dominance. You’ll stand tall as Nanowar of Coding, the ones who chose the language of the gods. Every line of Rust you write is like a lyric to an immortal anthem.

fn main() {
    println!("Hello, World! Let there be Metal!");
}

Simple, elegant, and powered by fearless concurrency. Rewrite "Hello World" in Rust, and ascend to Asgard's Hall of Legendary Programmers. Embrace the true heavy metal of programming and leave Java in the dust like a poser at a Dio concert!

Are you ready to wield the axe of Rust? 🤘

@nappa85
Copy link

nappa85 commented Dec 5, 2024

You can do Rust #[no_std], there is nothing more bare metal

@prenone
Copy link

prenone commented Dec 6, 2024

Rust is too high level, it should use LLVM Intermediate Rappresentation and avoid the middle man all together

@immortaly007
Copy link

Here is a Rust port of the main class.
Note that, even tho the comment (or "bridge", if you will) claims that the JVM will manage our bug, in this case it will just panic.

struct HelloWorldMainLauncherClass {
    foo: u32
}

impl HelloWorldMainLauncherClass {
    fn new(foo: u32) -> HelloWorldMainLauncherClass { HelloWorldMainLauncherClass { foo } }

    pub fn song_refrain(&self) {
        for _ in 0..self.foo {
            println!("Hello world!")
        }

        let mut pippo = 0;
        while pippo < self.foo {
            println!("Hello World!");
            pippo += 1;
        }
    }

    /*
     * If I may introduce a bug, the JVM will manage it for me
     * ensuring both security and portability
     * Then I'll write my code once, and run it everywhere!
     * With Static and Strong Typing, will let my programs be type safe!
     */
    pub fn false_method(&self) {
        let metal = false;
        if metal == false {
            let joey_de_caio: Option<String> = None;
            joey_de_caio.or_else(|| panic!("java.lang.NullPointerException"));
        }
    }
}

fn main() {
    println!("Hello World Programmer Start");
    let tizio = HelloWorldMainLauncherClass::new(2);
    tizio.song_refrain();
    println!("Program Finished!");
    tizio.false_method()

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants