Using Zig from Python π± (Twitch Live Stream)
In this live stream, we dive into learning the Zig programming language and integrating it with Python. We start off by exploring the Zig documentation and reviewing our Advent of Code exercise from the previous episode. Next, we scaffold a sample Zig library for Python and install the Zig VSCode plugin. We then dive into writing a more advanced function signature from Zig and start to write our solution. Along the way, we tackle challenges such as getting the maximum from a set of integers, creating a stack with ArrayList, handling state with a struct, and learning HashMaps. We also explore de-initializers and the main loop of our algorithm.
Throughout the video, we share our debugging process and replace our ArrayList with the library zig-deque. We create a build.zig file and install and use zig-deque. Finally, we test our final solution and close out the live stream. Whether you're an experienced developer looking to learn a new language or a beginner interested in exploring the integration of programming languages, this video has something for everyone.
Our previous episode: https://youtu.be/0FTEIBAzRyY
Our code on GitHub: https://github.com/lmammino/zig-python-experiment/
Chapters
00:00:00 Intro
00:01:41 Looking at Zig documentation
00:02:30 Reviewing our Advent of Code exercise from the previous episode
00:04:27 Scaffolding a sample Zig library for Python
00:07:30 Installing Zig VSCode plugin
00:09:00 Figuring out how to write a more advanced function signature from Zig
00:16:40 Starting to write our solution in Zig
00:19:30 Figuring out how to get the maximum from a set of integers
00:21:00 Figuring out how to create a stack with ArrayList
00:25:50 Handling state with a struct
00:27:00 Learning HashMaps
00:29:00 Using de-initializers
00:30:00 The main loop of our algorithm
00:44:03 Debugging our solution
01:02:10 Replacing our ArrayList with the library zig-deque
01:04:00 Creating a build.zig file
01:10:55 Installing and using zig-deque
01:14:00 Testing our final solution
01:17:00 Closing
#zig #python #livecoding