rlworkbench is my project where I try to build a language workbench. What is that? What am I trying to build?
The way I think about it is that rlworkbench should be a text editor that is aware of the language of the text that is being edited. That awareness can give you syntax highlighting for example. But it can also give you more if it knows more about the language. For example, there might be an editor operation to expand the selection. If the cursor is inside a function, expanding the selection might select the whole function. Because the editor is aware of the language, it knows where the function starts and ends. Furthermore, defining the languages that rlworkbench knows about should be easy. And the norm should be the create many small domain specific languages. And when you define a language, it not only gives you editor support, but you can also define how that language should be compiled or translated.
Here is rlworkbench editing the README file. A markup language has been defiend and it provides both the syntax highlighting as well as the ability to turn the README file into html for display on this webpage.

When I write about rlworkbench on my blog, I tag the posts #rlworkbench.
markup: Recognizes .md extension as a markup file
markup: Allow escaping [ and ]
markup: Support blockquotes >
markup: Support numbered lists
python: First version of basic keyword lexing
First version (used by markup2website)
Finalize chanagelog
git commit -a -m 'Release <version>' && git push && git tag <version> && git push --tags
Bump version in release.sh and add entry in changelog
Common error handling for all parse errors
Examine errors from -fsanitize=undefined
Generate highlight.c from high level description
Generate language.c from list of available languages
Or load from dynamic library?
Generate input C files in out/c and add only that to include path
Handmade style
Program in a style where you can choose the language (abstraction level) at choice, and always have to possibility to go low level when needed
Code re-use is bad for performance. It does what you want, but not in the optimal way for this problem
Allow layers of abstractions to be shaved off if the problem is more easily solved at a lower level
How do I do c projects?
RLC? No build system. Only C compiler. First compile rlmeta2.c Then rlc.rlmeta2 -> RLC.c -> RLC Then main.rlc -> main.c -> main RLC should have high level syntax for low level stuff. Like nothing?
Make it bootstrapable with only a C compiler (any C compiler)
Experiment: fork+exec to run process (Which header? Which linker?)
https://github.com/tsoding/nob.h/blob/main/nob.h#L1136-L1226
https://dependablec.org/
https://github.com/tsoding/nob.h (idea for a build system)
Notes:
gcc -o out/meta src/meta/meta.c out/meta <src/make/make.build >out/make.c gcc -o out/make out/make.c out/make
How to make make.c platform independent?
Build Windows platform layer in wine?
i686-w64-mingw32-gcc -Wfatal-errors -Werror -o $2 $1
It adds .exe extension
Use SDL_HINT_MAIN_CALLBACK_RATE=waitevent and animate cursor differently
Convert learningc to tests
Prevent close if files is not saved
Safe write (to prevent corruption)
: should open command selection window
:w should save file
ctrl-t should be mapped to command :edit (and it opens file section window)
Support for undo/redo
Fun "character explode" animation when saving
Show related functions inline so that there is no need to jump
Show a tree view of your folder/files in one view
You switch to another file by just navigating to a different location in this giant document
The document can collapse subsections to make the structure clear
TempleOS style autocomplete
Hot reload languages (loaded as dynamic libraries)
Build and load languages as dynamic libraries
The meta file can be the interface
No need to define a C API if rlworkbench can recompile
More generic names for MetaHighligt enum members
Base highlight on top-level items and only re-parse the top-level section that changed (that is how 10x Editor works according to If you're serious about programming, listen to Stewart Lynch)
Create "compile <file>" command
Spell check language
Make glyph cache support utf-8
Got idea for implementation from hash map that Steward talked about in If you're serious about programming, listen to Stewart Lynch
Learned more about hash maps from HashMaps & Dictionaries, Explained Simply
Support numbered lists (needed in projects2)
Highlight code blocks in editor (not only when rendering html)
Should we handle html escape in meta or C? Or both as it is now?
Define function in meta and use it from C? String -> String?
Should String use unsigned char?
Add convenience command to compile a standalone language
rlworkbench_sdl language compile --standalone <language>.meta
Versus
rlworkbench_sdl run <language>.meta > <language>.c cc -DSTANDALONE <language>.c -o <language>
Allow parsing only (no skip overhead of actions when not used)
Generalize unique to work on any expression (to replace unseen)?
Pass Buffer as value instead of allocating on heap?
Flags for more compact data structure for Chunk?
Detect infinite loop -> OOM ((rule*)*)
Optimize 'or' based on first character
keyword = 'foo' | 'bar' | 'baz' | 'return' | other
->
switch (first_char) {
case 'f':
keyword = 'foo' | other
case 'b':
keyword = 'bar' | 'baz' | other
case 'r':
keyword = 'return' | other
}
How to make this transform?
Add support for unicode character classes?
Bind variable without action causes error in meta rule = foo:x;
Implicit counters for star operator? Se aoc20254
Be able to rotate text with dynamic number of string builders? See aoc20255