Code Confessions Digest #3: News, and Resources from Last Week
Exploring CLI Tools, Debugging Techniques, Assembly Programming, Deep Learning, Compilers and More!
Hi and welcome to Confessions of a Code Addict, the newsletter dedicated to coding and computer science. This is the weekly digest edition of the newsletter where I share a selection of some of the most interesting links and resources from last week.
In this week’s digest:
CLI tools for interacting with ChatGPT APIs
Debugging C and Python code using GDB
Rust to Assembly: Understanding inner workings of Rust
Learn 64-bit x86 assembly programming by writing a GUI from scratch
AI does not help programmers
Best Practices for Using Function Call Feature in OpenAI’s ChatGPT API
An introductory course on deep learning using PyTorch
Material from a workshop on vectorization from Cornell University
Essentials of Compilation: A book teaching you writing a compiler for your own programming language
📰 Articles
llm, ttok and strip-tags—CLI tools for working with ChatGPT and other LLMs
If you are a command line aficionado and appreciate the beauty of Unix pipes, then you will love this. Simon Willison has created a set of CLI tools for interacting with ChatGPT (via its APIs). For example, you can use these tools to get a summary of NYTimes' home page with this invocation:
curl -s https://www.nytimes.com/ \
| strip-tags .story-wrapper \
| ttok -t 4000 \
| llm --system 'summary bullet points'
He has been adding more similar tools. I will leave the rest of the details to his article. Check it out here.
Debugging a Mixed Python and C Language Stack
Many of us are building complex data science stacks comprising tools and frameworks written in multiple languages, such as C, Python, and CUDA. Every now and then, we are bound to run into bugs, but how do we go about debugging such a mixed language stack? This article shows how to do that. It demonstrates how to debug C and Python code from GDB and provides some useful debugging techniques to find out the source of a deadlock among multiple threads of execution. Check it out here.
Learn x86-64 assembly by writing a GUI from scratch
Do you want to learn x86 assembly programming but find most of the resources on it dry and boring? Then this should excite you. In this long tutorial, the author takes you through the basics of assembly programming for x86 hardware by building an x11-based GUI from scratch. Check it out here.
Learn vim While Playing a Game
Do the key bindings of Vim seem unusual to you, and you can’t quite figure out how to quit Vim (just kidding)? Then check out this online game where you need to use Vim key bindings to cross the levels. As you progress through the levels, you discover and master more and more Vim shortcuts. Find it here.
Rust to Assembly: Understanding the Inner Workings of Rust
Some of the best C programmers I have known have told me that if you want to write better C code, you need to know what assembly code is being generated by the compiler for it. It helps you write more efficient code at the C level because you can guess how the compiler might translate it, and you can guide the compiler to generate more optimal code. Rust is also a systems programming language, and by understanding how the assembly code is being generated for a piece of Rust code, you can learn to write better Rust code. This is a series of short posts that show and explain the assembly code for different Rust features. Check it out here.
AI Does Not Help Programmers
There is an overwhelming set of people claiming that AI is here to replace programmers and a lot of is being written on this. However, as I have argued in one of my articles, AI is really going to empower programmers to work on another level of abstraction for solving bigger problems. Bertrand Meyer voices a similar opinion in his article in the communications of the ACM. Check out the full article here.
Best Practices for Using Function Call Feature in OpenAI’s ChatGPT API
And if you missed my latest article from last week, check it out. In this article I provide some guidelines and best-practices to get the best output out of the ChatGPT APIs when using the function call feature. Find the article linked below.
📚 Books and Courses
Deep Learning Fundamentals
This is a hands-on course on deep learning by Sebastian Raschka, who is a researcher working in this field and has also published multiple books on this topic. The course uses PyTorch, so it’s also a good introduction to PyTorch. Find it here.
Introduction to Vectorization
This is material from a workshop on vectorization at Cornell University. It is not super detailed like a book or a course; however, it does provide a good introduction to the topic. Find it here
Essentials of Compilation (in Python and Racket)
I do have some readers who are deeply interested in compilers and programming languages. This book is a treat for them. Essentials of Compilation is an open-source book that covers how to compile a programming language down to assembly code. It does this by taking the readers through the steps of building a new programming language and a compiler for the language along with it. By the end of the book, you build a full-fledged compiler for your new language. The book comes in two flavors: one flavor uses the Racket programming language, while the other uses Python. Find the latest release of the book here.
Wrapping Up
I hope you enjoyed the articles and other resources from this week. Let me know in the comments if you enjoyed something in particular, or if something bugged you. Also, if you have anything interesting that you would like to share with me, then do so in the comments, I would love to read it. As always, thanks for reading Confessions of a Code Addict and do share it with your friends and colleagues.