CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”
Channel:CppCon · Length:1:19:52 · Published:2016-09-24 · Views:264521
Summary
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.
Why HN recommends it
A perennial favorite, recommended as proof that expressive modern C++ can compile to efficient code even on tiny retro hardware.
there is a wonderful talk by Jason Turner about writing a simple Pong clone for the Commodore 64 in modern C++ — HN, 2016
C, C++, Rust, Go & systems languages · Compilers, interpreters & program analysis · Demoscene & retrocomputing
Subtitles (excerpt)
Good morning. Everyone having fun at the conference so far? So, as Rob said, I um have been doing things with 30 and 40y old computers for the fun of it. So, which brings us to today's plenary. We are going to make a simple Commodore 64 game in C++ 17. today. But before we get started, who all here regularly needs to program for desktop and server systems, ARM? You know, I'm assuming most people pro. Yeah. Okay, there we go. Um, PowerPoint just crashed. That's very strange. [Applause] All right. Yeah. Uh, it actually seems my computer just rebooted on me. So, just a moment. So, I'm going to actually fully reboot my computer now and uh without the HDMI cable plugged in and we'll continue the poll. So, the first question was who all has to program for regular computers? That's everyone basically, right? Who uh programs for microcontrollers? So, that's a I don't know 10% of people. So, does anyone here regularly have to program for 40y old 8-bit CPUs by any chance? 8bit CPUs, but not really. Uh, what are you programming for? AVR. Does AVR not do 16 bit math? You can't do 16 math. 16 bit emulated. Okay. So, um, today while we wait for my computer to reboot, we are, um, we're going to make this game in for the Commodore 64 and we're going to
On Hacker News
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] [VIDEO] — MereInterest, 2017-02
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++: [VIDEO] — dmit, 2016-10
There's a great talk [1] in which C++17 features are used to build an efficient Pong clone on C64. As I recall, the author wound up writing an (obviously limited) x86-to-6502 translator to get around the lack of 6502 support. [1] [VIDEO] — 0xcde4c3db, 2023-02
Creativity flourishes with the right restrictions. In this case, the graphics and sound limitations. Also, just because you're targeting old platforms doesn't mean you need to use old platform's tools. Modern tools make it so much easier to develop on these old platforms, check out this talk about coding in C++17 for the Commodore 64 [VIDEO] — ciroduran, 2022-09
> Nor does it have any concern for the elegance of its design. It has a lot of inelegant facilities, which, when used under the hood, allow you to express your elegant abstractions. > Hence the common practice of using a small subset C++ and pretending it's just C with Extras. That's mostly failure to use C++. Since C++11, and especially with later updates to the standard, idiomatic C++ is very d… — einpoklum, 2022-05
Related videos
- Why Starting A Rocket Engine Is So Hard! · Everyday Astronaut · 1:00:26
- A4 / V2 Rocket in detail: Turbopump · Astronomy and Nature TV · 1:51:13
- Why guitarists USED TO play more in tune! (Microtonal Frets) · Brandon Acker · 15:15
- Superluminal Time Travel + Time Warp Challenge Answer · PBS Space Time · 11:48
- Strange Spheres in Higher Dimensions - Numberphile · Numberphile · 10:33
- Delvon Lamarr Organ Trio - Warm-up Set (Live on KEXP) · KEXP · 18:29
- MIT's Pathway to Fusion Energy (IAP 2017) - Zach Hartwig · MIT Plasma Science and Fusion Center · 1:11:39
- mRNA Translation (Advanced) · DNA Learning Center · 3:03
- Origins of Precision · Machine Thinking · 30:32
- Richard Feynman. Why. · firewalker · 7:33
- ROTATING DETONATION ENGINE · Integza · 14:45
- Testing 432 Hz Frequencies (and temperaments) · Adam Neely · 14:06
- Building a 6800 CPU on an FPGA with nMigen (part 1) · Robert Baruch · 24:45
- I'll Let Myself In: Tactics of Physical Pen Testers · Wild West Hackin' Fest · 44:55
- Cassettes - better than you don't remember · Techmoan · 22:46
- 2 1 1 Jason Scott Rescuing The Prince of Persia from the sands of time · Adrian Crenshaw · 52:47
- Incels | ContraPoints · ContraPoints · 35:04
- Inside Africa's Food Forest Mega-Project · Andrew Millison · 14:10
- De-fragmenting C++: Making Exceptions and RTTI More Affordable and Usable - Herb Sutter CppCon 2019 · CppCon · 1:33:12
- CppCon 2017: Fedor Pikus “C++ atomics, from basic to advanced. What do they really do?” · CppCon · 1:14:22