CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”
Why Hacker News recommends it
A perennial favorite, recommended as proof that expressive modern C++ can compile to efficient code even on tiny retro hardware.
What it is
Jason Turner's CppCon 2016 talk builds a simple Commodore 64 game using C++17, showing how constexpr and const let a modern compiler produce tight 6502 code. He walks through assembly output to show abstractions being optimized away.
Recommended by 13 HN commenters across 10 different months, 2016 to 2024.
What Hacker News said
Strong rec dmit · 2016-10 · on “Twenty years later I wrote a Tetris again”
For those who haven't seen it, there is a wonderful talk by Jason Turner about writing a simple Pong clone for the Commodore 64 in modern C++: [this video]
Strong rec MereInterest · 2017-02 · on “C++ on Embedded Systems”
Absolutely. There was a fantastic talk at CppCon last year, using C++17 to program a game for the Commodore 64. Using standard C++ idioms, the optimizer was easily able to make it compile down to efficient machine code. [1] [this video]
Recommends voltagex_ · 2016-10 · on “Ask HN: What's your favorite tech talk?”
Your second link reminded me of [LINK] (which definitely builds on some of Matt's work). [this video] - C++17 for the Commodore 64. Probable language warnings for my other suggestions: * Rescuing Prince of Persia from the Sands of Time [LINK] (was this talk ever given elsewhere?) * And You Shall Know Me By My Trail of Documentation - [LINK] * The History and Evolution of Computer Viruses - [LINK]
Recommends beached_whale · 2016-10 · on “Epiphany-V: A 1024-core 64-bit RISC processor”
Check out the cppcon 2016 presentation by Jason Turner and watch how eager the compiler optimizes away code when const is enabled on values. Cool presentation too, and uses Godbolt's tool [this video]
Recommends sqeaky · 2017-01 · on “Add a const here, delete a const there”
I think this way of looking at it old. Even if the const-ness is somehow subverted without generating an error then most compilers (or at least GCC and Clang) will presume the code is compliant and make optimizations following what the standard allows. This potentially results in undefined behavior when that pointer you mentioned is used to modified a thing that ought to be const. Consider the amount of optimizations seen in the video from CppCon 2016: [this video] Jason Turner, the presenter, is writing code a few lines at a time and cross compiling for the Commodore 64. He shows his assembly at many steps of the way and shows how many functions are completely elided when const (and later conste
Recommends Nimelrian · 2018-10 · on “C++: Associative map containers with compile-time lookup”
Also highly recommended: Anything by Jason Turner and Ben Deane. Examples: - Ben Deane - Using Types Effectively [0] - Jason Turner - Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17 [1] - Ben Deane & Jason Turner - constexpr ALL the Things! [2] [0] [LINK] [1] [this video] [2] [LINK]
Recommends adev_ · 2019-07 · on “ChaiScript – Easy to Use Scripting for C++”
For the note: ChaiScript is from Jason Turner. He also does CPPCast ( [LINK] ) and is a regular presenter at CPPCon ( [this video] ). Many of his videos / tutorials are worth a look if you are interested in C++.
Recommends inetknght · 2020-03 · on “Getting started with bare-metal assembly”
> And once You think you’ve run hw to its limits there are plentiful demos and examples around to blow your mind watching what people have been able to do with these machines (often in obscure ways). What blew my mind was using a modern C++ compiler to build optimized software for that old hardware. Here's an example with the Commodore 64 [0]. [0]: [this video]