It seems that there's a very strong pattern in how I implement features for Runt. I seem to always start with the hardest parts, and leave the easy parts to the end. Over the time this resulted in quite a lot of code that is to be polished and integrated. So to start this report, here's a list of systems I've implemented so far:
- Platform – Completely custom platform code for Windows with Win32 API and DirectX 11, for other operating systems I'll go for SDL2/OpenGL backend.
- User Interface – A retained dynamic composition-based framework, which renders in immediate mode.
- Code Editor – Fast multi-purpose code editor with multiple-carets and extensible lexer-based syntax highlighting. Used for code editing, shell and all UI inputs for text.
- Shell – A base of the command system that allows for text-based prompt as wel as extending the application in runtime.
- Terminal – Full XTerm-inspired terminal emulator supporting both Unix and Windows console applications.
- Scripting – Implementation of a custom statically typed scripting language called
Rithat compiles to bytecode, x64 and to C. It'll take care of configuration, state and extensions, as well as run-time compiled optimizations.
- Workspaces – Multi-project system that indexes and keeps watch over the project directories loaded.
- Apps – Apps can be loaded as DLLs, each app runs in old school unprotected cooperative mode to make communication between the apps much simpler. Apps are now dormant, waiting for several major upgrades to be done in UI and command systems.
- Slicer – App for viewing images as well as slicing and annotating them up for games and web.
- Browser – App implementing Norton Commander inspired file browser.
CLOC currently reports 34k lines of code. However the code base now contains a lot of proof-of-concept pieces and code generated that shouldn't really be counted in. Realistically best guess would be around 20k-25k lines of code.
The primary milestone is to be able to replace VSCode for most of my daily and hobby projects. Bonus target is to be able to make some polished videos and screenshots mostly to build up this website and churn out some streams and/or youtube videos.
UI and command system rework
Currently the primary obstacle is reworking UI and command systems to be cleaner and support features in shell that are needed for implementing stateful and interactive commands such as
find. I now have a good base reimplementation ready, now I need to refactor the code to use it and push through with the commands.
Here's an example of how interactive commands work before I've fucked them up by refactoring:
State, configuration and scripting through Ri
Further down the line there's saving Runt's configuration and state, which I originally planned to be done through Ri, but I will most likely have to downscale for a while and use some temporary solution (most likely saving configuration and state as a list of shell commands to call when Runt starts).
Even further in the future there's Ri, which I had to leave for a few weeks to relax. Ri is currently in a state where it can generate and execute functional programs via VM that can call to C. I've stopped at the point where I need to add passing and returning structs to/from functions by x64 calling convention(s) in the VM.
I've spent a few days on prototyping a better VM that would be register based inspired by three-address code and MIPS. It should provide bytecode that is easier to translate to x64 and it's easier to optimize.
However, Runt can work pretty well without Ri. I will not have an option to change commands or syntax highlighters while Runt is running, but since recompiling it takes about a second, I can live with it.