Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Writing Pong in Rust for My OS Written in Rust (stephenmarz.com)
134 points by lukastyrychtr on March 15, 2021 | hide | past | favorite | 24 comments


Too bad the author used Wordpress instead of Zola. Otherwise, his next post could be "Blogging about writing Pong in Rust in my OS written in Rust in a blog engine written in Rust".


...served from a Warp server written in Rust...


This is the first time I've seen pong not written in assembly.


I still have a VHDL version lying around from my old student project. :)


Wasn’t the original “written” using discrete logic (as in, no ROM)? How close to the original is your VHDL version then?


Since it's a student project to learn about VHDL and synthesis the pong clone had a few additions like simple math-expression based textures and we ignored trying to get close to the exact movement behaviour. But you actually get to control it with rotation based input. :)

In regards to ROM. It was an FPGA, meaning it was reprogrammed on every startup. But all behaviour was built as logic without accessing any memory.


Am inspired how can I learn how to write a RISC-V OS?

Is it alot of work?


The very first link in the post is to https://osblog.stephenmarz.com/, which is the author's tutorial on doing so. You should check it out!


Tsinghua University has a course about writing OS on RISC-V by Rust.

However you probably needs Google Translate to read it since it’s written in Chinese.

https://rcore-os.github.io/rCore-Tutorial-Book-v3/


n-gate is going to have a field day with this one


I never heard of n-gate before. I've just lost two hours of work I have to make up tonight! Funny stuff.


It's Rust all the way down!


When Christ returns from vacation, He wants everything, including the Bible, to be rewritten on Rust.


"And he who dares write Unsafe code shall be strung up and scourged. His limbs broken, his flesh stripped from his body, and his eyes pierced. For he has defiled the glory of Rust, and the righteous should not suffer such a man to live."



[flagged]


No, it is not from the Quran.


Rust is already used in Bible (6 or 7 times).

Ezekiel 24:6 Therefore thus says the Lord Yahweh: Woe to the bloody city, to the caldron whose rust is therein, and whose rust is not gone out of it! take out of it piece after piece; No lot is fallen on it.


Sure but Matthew 6:19-20 clearly indicates that Rust is too powerful for man and can only be used after ascending to live amongst the angels:

“Do not lay up for yourselves treasures on earth, where moth and rust destroy and where thieves break in and steal;

but lay up for yourselves treasures in heaven, where neither moth nor rust destroys and where thieves do not break in and steal.“


"has rust inside it, and whose rust will not come off!" (Ezekiel)


www.arewebibleyet.com


[flagged]


This is simply a bad take.

Wheels have been improved over many millennia. Were they all pointless? First logs. Then the axle. Then carriage wheels with wooden spokes. Then steel wheels with rubber tires, also with spokes, but light enough for bicycles. Then aluminum wheels, again lightening the rolling weight. And now we’re seeing wheels with integrated suspension systems.

All of these are reinventing the wheel and each is a dramatic improvement over the wheel before it. This is how we make progress, by improving on things from the past.


That's true. Reinventing the wheel is not necessarily pointless. But technology has moved on since wheels and there are arguably more important areas to focus on. That is, a specific improvement may be dramatic for the performance of the wheel, but for the overall system an improvement elsewhere could prove more useful.

OSes have not changed much from a conceptual point of view since the 70s. I'd personally like to see more research there.


isn't someone writing a new one doing more research there? even if all the do is copy the past, they are learning what is good, and hopefully what is bad, so that they can do it better then next time...

While Rust is just a tool to help with that development, it does overall lower the cost so that focus can be paid to higher level problems and less paid to memory usage errors.


With "unsafe" keyword.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: