Uploaded December 2017 | Updated November 2026, 5 days ago
In this tool-assisted education video I create a parser in C++ for a B-like programming language using GNU Bison. For the lexicographical analysis, a lexer is generated using re2c.
This is part of a multi-episode series. In the next video, we will focus on optimization.
Become a member: youtube.com/Bisqwit/join
Downloads:
— github.com/bisqwit/compiler_series/tree/master/ep1 All the material associated with this episode can be downloaded here.
Acknowledgements:
— Picture: Processors :: Jason Rogers
— Music¹: Aryol :: The Strategy Continues :: Kyohei Sada (converted into MIDI and played through OPL3 emulation through homebrew software)
— Music²: Star Ocean :: Past Days :: Motoi Sakuraba (SPC-OPL3 conversion)
— Music³: Rockman & Forte :: Museum :: Kirikiri-Chan and others (SPC-OPL3 conversion)
— Music⁴: Famicom Tantei Club Part II: Ushiro ni Tatsu Shōjo :: Dean’s Room :: Kenji Yamamoto (SPC-OPL3 conversion), original composition: Bach's Invention № 15
— Music⁵: Aryol :: Arrest :: Kyohei Sada (SPC-OPL3 conversion)
— Music⁶: Ren & Stimpy Show : Fire Dogs :: Main Theme :: Martin Gwynn Jones and others (SPC-OPL3 conversion)
— Music⁷: Aryol :: Warmup :: Kyohei Sada (SPC-OPL3 conversion)
— Music⁸: Energy Breaker :: Golden-Colored Wind :: Yukio Nakajima (SPC-OPL3 conversion)
— Music⁹: Wonder Project J :: House :: Akihiko Mori (SPC-OPL3 conversion)
— SFX: Mostly from YouTube Audio Library. Some are recorded from video games like The Guardian Legend, Lunar Ball, and Super Mario All-Stars.
¹ 00:37, ² 02:46 & 39:26, ³ 10:10, ⁴ 16:06, ⁵ 27:18, ⁶ 37:20, ⁷ 38:58 & 45:58, ⁸ 49:00, ⁹ 50:40
My links:
Twitter: twitter.com/RealBisqwit
Liberapay: liberapay.com/Bisqwit
Steady: steadyhq.com/en/bisqwit
Patreon: patreon.com/Bisqwit (Other options at bisqwit.iki.fi/donate.html)
Twitch: twitch.tv/RealBisqwit
Homepage: iki.fi/bisqwit
You can contribute subtitles: youtube.com/timedtext_video?ref=share&v=eF9qWbuQLuw or to any of my videos: youtube.com/timedtext_cs_panel?tab=2&c=UCKTehwyGCKF-b2wo0RKwrcg
---Rant---
[9:35 PM] Bisqwit: Now uploading to YouTube. Within about 24 hours I will know if the rogue AI at YouTube slams the “limited or no advertising" stamp into it, or not. Actually, I only know if it does so *when* it does it. Then, I need to wait an additional 25 hours for YouTube staff to manually review it and clear the flag. If the flag does not appear, then it is possible that the bot just has not scanned it yet and I need to wait longer. Premature publication could mean that the bot will mark it after it has already been published, and then I will not receive any revenue for the first spike of views. It used to be 18 hours (since uploading that the bot does its evil deeds), but nowadays YT recommends waiting just 3 hours. We will see, we will see.
#Bisqwit #Compiler #Tutorial
In this tool-assisted education video I create a parser in C++ for a B-like programming language using GNU Bison. For the lexicographical analysis, a lexer is generated using re2c.
This is part of a multi-episode series. In the next video, we will focus on optimization.
Become a member: youtube.com/Bisqwit/join
Downloads:
— github.com/bisqwit/compiler_series/tree/master/ep1 All the material associated with this episode can be downloaded here.
Acknowledgements:
— Picture: Processors :: Jason Rogers
— Music¹: Aryol :: The Strategy Continues :: Kyohei Sada (converted into MIDI and played through OPL3 emulation through homebrew software)
— Music²: Star Ocean :: Past Days :: Motoi Sakuraba (SPC-OPL3 conversion)
— Music³: Rockman & Forte :: Museum :: Kirikiri-Chan and others (SPC-OPL3 conversion)
— Music⁴: Famicom Tantei Club Part II: Ushiro ni Tatsu Shōjo :: Dean’s Room :: Kenji Yamamoto (SPC-OPL3 conversion), original composition: Bach's Invention № 15
— Music⁵: Aryol :: Arrest :: Kyohei Sada (SPC-OPL3 conversion)
— Music⁶: Ren & Stimpy Show : Fire Dogs :: Main Theme :: Martin Gwynn Jones and others (SPC-OPL3 conversion)
— Music⁷: Aryol :: Warmup :: Kyohei Sada (SPC-OPL3 conversion)
— Music⁸: Energy Breaker :: Golden-Colored Wind :: Yukio Nakajima (SPC-OPL3 conversion)
— Music⁹: Wonder Project J :: House :: Akihiko Mori (SPC-OPL3 conversion)
— SFX: Mostly from YouTube Audio Library. Some are recorded from video games like The Guardian Legend, Lunar Ball, and Super Mario All-Stars.
¹ 00:37, ² 02:46 & 39:26, ³ 10:10, ⁴ 16:06, ⁵ 27:18, ⁶ 37:20, ⁷ 38:58 & 45:58, ⁸ 49:00, ⁹ 50:40
My links:
Twitter: twitter.com/RealBisqwit
Liberapay: liberapay.com/Bisqwit
Steady: steadyhq.com/en/bisqwit
Patreon: patreon.com/Bisqwit (Other options at bisqwit.iki.fi/donate.html)
Twitch: twitch.tv/RealBisqwit
Homepage: iki.fi/bisqwit
You can contribute subtitles: youtube.com/timedtext_video?ref=share&v=eF9qWbuQLuw or to any of my videos: youtube.com/timedtext_cs_panel?tab=2&c=UCKTehwyGCKF-b2wo0RKwrcg
---Rant---
[9:35 PM] Bisqwit: Now uploading to YouTube. Within about 24 hours I will know if the rogue AI at YouTube slams the “limited or no advertising" stamp into it, or not. Actually, I only know if it does so *when* it does it. Then, I need to wait an additional 25 hours for YouTube staff to manually review it and clear the flag. If the flag does not appear, then it is possible that the bot just has not scanned it yet and I need to wait longer. Premature publication could mean that the bot will mark it after it has already been published, and then I will not receive any revenue for the first spike of views. It used to be 18 hours (since uploading that the bot does its evil deeds), but nowadays YT recommends waiting just 3 hours. We will see, we will see.
#Bisqwit #Compiler #Tutorial

![Illumination Tutorial for Software 3D Rendering (2/2+) [c++20]
In this series we explore how to do illumination in your polygon-based texture-mapping 3D renderer. This time we focus on realistic diffuse lightmaps. We use nothing but standard C++20 (and libSDL for 2D graphics).
Become a member: https://youtube.com/Bisqwit/join
My links:
Twitter: https://twitter.com/RealBisqwit
Liberapay: https://liberapay.com/Bisqwit
Patreon: https://patreon.com/Bisqwit (Other options at https://bisqwit.iki.fi/donate.html)
Steady: https://steadyhq.com/en/bisqwit
Twitch: https://twitch.tv/RealBisqwit
Homepage: https://iki.fi/bisqwit/
You can contribute subtitles: http://www.youtube.com/timedtext_video?ref=share&v=eXU-6_jmw7Q
Downloads:
https://bisqwit.iki.fi/jkp/polytut/ (nag at me if something is missing)
Music list (s = SPC-OPL conversion):
— Picnic & 月の丘 — ノスタルジア — 甘茶 (nostalgiamusic.info)
— Lufia II — Last Duel (s) Illumination Tutorial for Software 3D Rendering (2/2+) [c++20]](https://i.ytimg.com/vi/eXU-6_jmw7Q/mqdefault.jpg)


![Ur-Quan Masters: No-Starbase Practice Run: PART 8/12
I completed Star Control II: The Ur-Quan Masters (the open source version) without ever talking to the Earth starbase commander, Hayes, or without orbiting the starbase.
Note: There are occasional video / audio glitches in the videos, but those will [hopefully] get less and less common as the game progresses, as I fixed bugs in my recording software. Unfortunately, their effect tends to cascade the longer the video is.
This is a practice / proof-of-concept run, created within a span of 7 days.
Technical information: Played in real time on Linux computer across SSH link on Cygwin desktop. Recording was done using a homebrew LD_PRELOAD library that hooked into SDL video & audio updates, and produced 32-bit zmbv+pcm mkv files. Extra calls were added to notify the recording library of save & load events, so that the finished video could be constructed from the relevant segments. Undone segments are not shown (except in the totally uncut series).
THE FINISHED PRACTICE SERIES WITH COMMENTS, AND BORING/REPETITIVE PARTS MOSTLY CUT OUT:
Part 1: https://youtu.be/-fPtTwm_vOU
Part 2: https://youtu.be/HJc_ykXU9TY
Part 3: https://youtu.be/QI6FB62BoBQ
Part 4: https://youtu.be/2DaxgFCy8JM
Part 5: https://youtu.be/9CF-OZy5dR4
Part 6: https://youtu.be/mwoLQUKCrkE
Part 7: https://youtu.be/JUFVnDCyY1w
Part 8: https://youtu.be/fYOFJvfxDec
Part 9: https://youtu.be/1PmBct19ctA
Part 10: https://youtu.be/wIVYv_DEpak
Part 11: https://youtu.be/ZzM5tHLfHxw
Part 12: https://youtu.be/WjLTRWJK5j0
UNCUT VIDEO (FINISHED PRACTICE SEGMENTS IN ONE VIDEO, WITHOUT COMMENTS):
https://youtu.be/tH6GEJH3Ro8
TOTALLY UNCUT SERIES (ALL PRACTICE SEGMENTS; INCLUDING THE FAILED ONES):
Part 1: https://youtu.be/ilLlvEIItkM
Part 2: https://youtu.be/h8mtdNwfoB4
Part 3: https://youtu.be/9gJzNUlBNZM
Part 4: https://youtu.be/EaB92-uGuo0
Part 5: https://youtu.be/duJ5PTvqJaE
Part 6: https://youtu.be/lRnS9Fxjy20
Part 7: https://youtu.be/wqIC58YoLuk
Part 8: https://youtu.be/Xmowt7XyRmI
Part 9: https://youtu.be/EvBLmFOX06M
Note: The totally-uncut series includes some very long sections where absolutely nothing happens. This is because sometimes I was off-keyboard while the game and its music was playing, and when I came back, I loaded a save.
FAQ:
Q) How does no-starbase (i.e. BGD, beating-game-differently) differ from normal game?
A) Obvious differences: No flagship upgrades / module building, no crew recruiting, no fuel-for-RU, no building of ships, no Arilou ships, no replacing of planet landers, no escaping of battles. RU is worthless. Non-obvious differences: 100% of chance of probe spawning every day in hyperspace, versus maximum of 8% in normal game. When the Chmmr refit your ship, they no longer reset your fuel to 10, nor do they take away all of your modules, nor do they rob the ability to build new storage-bays (if you suddenly decide to help the starbase. You get to keep your minerals, too. Bring a megaton of exotic materials to the Sa-Matra explosion! They still remove your landers and max out your thrusters and turning jets. Also, they transport you to Earth orbit rather than aboard Starbase.
Q) How does UQM differ from the PC Star Control II in terms of gameplay in BGD challenge?
A) When you emerge in hyperspace (from battle, from truespace), in the PC version you would always emerge with the ship pointing north. It means that if you wanted to go anywhere else but north, you would have to slowly crank the ship to rotate towards the desired direction. In the open source version, the ship is automatically quick-oriented towards the original direction, which is a huge boon in a challenge like this. The planet lander only holds 50 units of BIO data rather than 64, necessitating more landings. And the BIO is more aggressive.
(Your question here) Ur-Quan Masters: No-Starbase Practice Run: PART 8/12](https://i.ytimg.com/vi/fYOFJvfxDec/mqdefault.jpg)



![Bisqwit Plays: The Talos Principle [1/4] (complete blind 100% all endings)
The Talos Principle is a 3D puzzle game, which also happens to explore the topic of artificial humanity. It was developed in Serious Engine by Croteam. It is famed for its extremely beautiful graphics and good story writing. It draws inspiration from the Portal series.
The game is rife with references to different religions from the history of humanity. Most prominently, the narrator character calls themselves Elohim, the Hebrew title for the God of Bible who created the world and sustains it. This may feel annoying at first, but given the story of the game, it all makes sense.
Part 1: https://youtu.be/gG6vHClsdAw
Part 2: https://youtu.be/lyOm553O7rQ
Part 3: https://youtu.be/8BG9rTToh0Q
Part 4: https://youtu.be/un8dW-iX8k4
PLOT
The story of the game is that humanity has contracted an unstoppable lethal virus. Realizing their inevitable extinction, all of humanity comes together in a last-ditch effort to assemble a computer data bank of the collective knowledge of all humanity. They also develop a simulated world with access to those databanks. The goal of the data bank is to provide a record of humanity for whichever aliens might visit Earth in the future. The goal of the simulation is to evolve an AI that would eventually pass as a worthy artificial inheritor of the human race, so that the essence of human race might live on, despite real humans being biologically extinct.
Unfortunately there was not enough time to develop and test the project fully before humanity expired. When the events of this game transpire, uncounted years have passed, and the database has been deteriorating, and most of the data has been lost and whatever little remains is hardly coherent. In addition, there is a bug in the AI, which sometimes pulls data from wrong databases. As a consequence, religions and reality get mixed up, and the AI instances, which somehow interact despite being separated by time and generations, have hard time understanding why they exist in the first place. Despite these difficulties, they seem to be achieving positive progress on evolving human characteristics. The player character is the latest of these instances. Could they prove the project has reached its goal?
Twitter: https://twitter.com/RealBisqwit
Patreon: https://patreon.com/Bisqwit (alternatives at https://iki.fi/bisqwit/donate.html)
Twitch: https://twitch.tv/RealBisqwit
Homepage: https://iki.fi/bisqwit/
I played through this game in Q1 2016 in the passage of two weeks, and streamed most of it on Twitch.
Buy The Talos Principle at: http://store.steampowered.com/app/257510/
VIDEO MAP:
Note: Sorry about A/V desync in parts of the video, and lack of video at 1:20:14—2:51:56.
03:06 Game start
12:28 A1 P
18:40 A1 OtToU
22:54 A1 ASOfR
24:44 A1 O
26:51 A1 StBP
35:58 A1 doot
45:27 A1 TB
47:51 A1 PaSL
50:15 A Hall
52:58 A5 doot
1:01:08 A2 doot
1:06:14 A2 doot2
1:09:46 A2 HoW
1:12:48 A2 TGMBC
1:17:10 A2 SM
1:19:17 (game crash)
1:20:14 (back, but ‹‹NO VIDEO››)
2:51:04 (finally someone informs me that video is off)
2:51:56 (‹‹VIDEO IS BACK››)
2:52:56 A4 BiO
3:18:59 A5 doot
3:19:45 Unlock: decahedron
3:21:54 A5 TtDWTB
3:25:20 found Warps stamp
3:28:57 A5 FC
3:31:30 A5 FC star
3:33:12 A5 GOtF
3:34:39 A5 YKYMCtS
3:36:02 A5 OLB
3:49:41 Unlock: A
3:51:51 A doot
3:54:53 A6 doot
3:56:33 A6 MM
4:04:28 A6 D
4:31:19 A6 doot2
4:32:24 A6 star
4:34:41 A6 ADTF
5:00:01 A6 BE
5:09:52 A6 doot
5:13:51 A7 doot
5:15:05 A7 WiaL
5:26:07 A7 TPLB
5:33:23 A7 PW (unsuccesful)
5:34:00 end of day 1
5:39:07 begin day 2
6:07:13 C doot
6:10:48 B doot
6:14:11 Unlock: B
6:18:55 B1 doot
6:22:00 found Deigns stamp
6:22:50 B1 WtaD
6:28:46 B1 TW
6:39:43 B1 RoD
6:47:28 ghost
6:48:48 B1 doot2
6:51:25 B1 SaaS
6:54:26 B1 doot
7:01:00 Unlock: fan
7:03:13 B7 BSbS
7:09:13 B7 doot
7:11:23 B7 doot2
7:19:40 B2 M
7:22:40 B2 TT
7:29:45 end of day 2
7:29:55 begin day 3
7:32:41 B2 doot
7:34:22 B2 HG (unsuccessful)
7:40:41 found DeathWish808s stamp
7:41:10 B2 HG
7:53:33 B2 MoTM
7:56:28 B3 doot
7:58:11 B3 EN
8:12:25 B3 BA
8:15:37 B3 W (unintended solution)
8:34:43 B3 S
8:36:46 B3 doot
8:42:14 Unlock: recorder
8:43:51 B4 doot
8:45:11 B4 SHT
8:47:21 B4 DP
8:52:40 B4 TRA
8:57:04 B4 ABUH
9:02:50 B4 RPS
9:10:29 B4 WAtC
9:11:53 B4 doot
9:16:19 B5 doot
9:20:55 B5 doot2
9:23:42 B5 SES
9:39:20 B5 MMaOTJ (unsuccessful)
9:45:59 Nexus 1
9:52:58 Unlock: Nexus 2
10:03:51 A7 PW
10:06:43 A7 TI (unsuccessful)
10:07:45 Nexus doot
10:09:00 Nexus 2
10:26:49 Unlock: Nexus 3
10:29:41 end of day 3
(between here, hours of progress were made off-screen)
10:29:47 begin day 4, on Linux
Played on a computer with the following specs:
MB: Gigabyte Z97P-D3
PSU: Corsair CX600W V2
CPU: Intel Xeon E3-1281 v3 @ 3.70GHz
RAM: 2 × Kingston KHX1600C10D3/8G for a total of 16 GB @ 1600 MHz
HDD: 128 GB of Kingston SVP200S
GFX: GeForce GTX 560/PCIe
OS: Windows 10, Linux Debian jessie+backports
Streaming: OBS
Any other hardware not mentioned is random no-name stuff. Bisqwit Plays: The Talos Principle [1/4] (complete blind 100% all endings)](https://i.ytimg.com/vi/gG6vHClsdAw/mqdefault.jpg)

![[SGDQ 2015 TAS race] Streemerz - Top 10ish, synced encode
In Summer Games Done Quick 2015 there was a TAS [tool-assisted speedrun] competition. The game and game mode was announced live, and players were given a few hours of time to create the best TAS they could for that game. Anyone could join, as both the game and the emulator are free for download.
Out of the ten fastest entries submitted into the competition, here are the seven that were made in FCEUX, shown in one video. In this video, each entry is synced at the beginning of each room, for easy comparison of strategies taken by the different players.
I did not win, but at least I made it into the top 10. [SGDQ 2015 TAS race] Streemerz - Top 10ish, synced encode](https://i.ytimg.com/vi/h1CYQwJxiRw/mqdefault.jpg)