Nikolas Kaipel
Programmer with interest in graphics and systems development.
You can find my CV here. This page is more about my personal programming
projects
Ongoing Projects
Due to limited time there is not much I can work on.
- Codebase.
Using C as my primary language and the C standard library being so small, there is a lot of code I have to write myself.
I want to write a library that I can use in all my projects. It will have a lot of basic type definitions and macros I use,
as well as a memory management system, OS-independent file handling, but with os specific implementations for maximum
performance, a math library, a window creation module, a Vulkan renderer to implement my own immediate ui, and more.
This is inspired by the code base from the raddebugger.
Planned Projects
- Text editor with vim keybindings. I don't need much for an editor.
Currently I am using neovim and it's okay. But using too many plugins makes it slow,
the rendering is slow and I have a lot of problems on Windows. I want to write my own editor
with hardware accelerated rendering which runs on MacOS, Windows and Linux, has vim keybindings,
is fast but of course, I want to build it mainly because it's fun.
- Physically Based Rendering Engine.
I want to use Vulkan to write a physically based rendering engine. I want to learn more about how
physically based rendering works and how to implement it.
- Raytracer.
I want to write a raytracer that uses the RTX accelerators on Nvidia GPUs. I have written a CPU raytracer
before, but that was a long time ago has a lot of limitations.
Past Projects
- Compiler (ayin).
It is one of the biggest compiler projects I've done. The compiler is written C++ using LLVM for code generation to
have performant code. The language is a simple C-like language, with a few extra features that I personally miss in C,
such as basic polymorphism for dynamic arrays, defer statements, better loops, and more. I also removed some features
that I don't like in C like headers. In the end though, I decided to stop working on the project because I wanted to
learn more about other topics and the language and compiler are therefore far from complete.
- Text Editor.
An editor I wrote because I wanted to test a method of text rendering I saw. The editor implements some vim keybindings
and has a few features like basic syntax highlighting for c using a small lexer I wrote. The text is rendered using a grid
system consisting of cells. The font is rendered to a glyph map and then uploaded to the gpu as a texture. The cells
should also be uploaded to the gpu. The entire rendering is done in the fragment shader on the gpu.
The main issue with this was that I wanted to support MacOS, Windows and Linux.
I couldn't find a way in OpenGL on MacOS however, to upload the cells to the gpu. Neither integer textures nor storage buffer
objects are supported on MacOS. And uniform buffers are too small to upload all the cell data on small font sizes.
The least amount of bits I could get a cell to be was 64 (2 * 24 for foreground and background rgb, 2 * 5 bits for x and y,
and 3 bits for flags such as "blinking"). Even then, on small font sizes, it quickly took more than 64KB, not fitting into
an uniform buffer anymore. I probably could have used multiple uniform buffers, but you need to know the amount at compile
time. That's when I decided that it wasn't worth it, so the experiment kind of failed.
In the future, I plan to either use Vulkan or use a different method of
rendering text, which might be better anyway, we will see.
- 2D Game Engine.
Project to learn about game engines. The engine is written in C++ and uses OpenGL for rendering.
It implements an entity-component system and uses supports scripting by writing scripts in C++. They are compiled
using clang to a dynamic library and then loaded (and reloaded) at runtime. For the graphical user interface
I used Dear ImGui.
- NJVM.
A (mini) toy java virtual machine I wrote to learn more about how java works and its bytecode format.
It includes both a bytecode interpreter and a just-in-time compiler. The JIT compiler is written in C++ and uses LLVM.
- Vulkan Renderer.
This was the first time I wrote a very basic renderer using Vulkan. Very few features but got me into using Vulkan.
- 3D Chess.
3D Chess game I wrote using OpenGL. Learning about OpenGl and 3D rendering. The opponent can be any chess engine
that supports the UCI protocol. I used the Stockfish engine for testing.
- Old compiler.
Pretty much the predecessor of the above mentioned ayin compiler. Not as big and not as good but it was
one of my earlier attemps at writing a compiler. Also written in C++ and using LLVM for code generation.
- Yet another compiler.
This time it uses flex and bison for the lexer and parser. I wanted to see if it makes sense
to use a lexer and parser generator for a compiler. I don't really, maybe I would use it again
for a bootstrap version of a compiler to create a self-hosting compiler as quickly as possible.
But other than that, I don't see the point. Writing a lexer and parser is really easy and
you have more control over the generated code and can generate better error messages.
-
I have also spend some time learning about AI and machine learning, implementing a minimax alpha-beta pruning algorithm
for a chess ai, an AI that uses reinforcement learning to learn to play snake. I spent time writing my own little version
of PyTorch to better understand how auto differentiation and optimizers work. I also built, trained and finetuned GPT models
for fun. For those projects however, I mostly followed videos I have seen and did more experimenting than creating something.
Andrej Karpathy, for example, has great videos on this topic.
Impressum