- C memory management
static u64 read_data(u64 list_ptr, const char* prompt) {
u64 data_ptr = 0;
u64 ui_mode_ptr = string->load("UI_MODE");
u64 mode_ptr = string->load("--ui");
u64 value_ptr = os->getenv(ui_mode_ptr);
if (ui_mode_ptr != 0 && string->strcmp(value_ptr, mode_ptr) != 0) {
data_ptr = read_input(prompt);
} else {
printf(">%s:\n", prompt);
data_ptr = list->pop(list_ptr);
if (data_ptr == 0) {
printf("\n");
}
}
return data_ptr;
}
int main(void) {
pointer->init(8); // initializes virtual memory manager with chunk size of 8
// some work with standard classes: os, string, data, etc.
pointer->gc(); // releases all resources added to GC
pointer->destroy(); // releases virtual memory manager
return 0;
}
- managed (C programming language model)
- safe
- friendly
- extensibe
- simple
- tested (100% code coverage)
-
VM managed types / C API
-
user defined types / extensibility system
- C API
- memory management
- garbage collection
-
development environment:
- WSL2/devcontainers
- Ubuntu 22.04.3 LTS
-
C API generated docs (doxygen):
-
streaming channels
-
2023
-
added v1 core Virtual Machine (vm1) with types:
-
added support including:
- file IO
- string manupulation methods
- search
-
List<T>
implementations- code coverage
- coverage hot-reload
- memory allocation playground
- automatic garbage collection implementation (GC)
- GTK GUI app demo ready to run on containerized environment
repo is ready to run on containers, WSL, remote hosts.
- installation from git repo (manually)
Installs sources from git repo
eval `ssh-agent -s`
git config --global user.name "$USER_NAME"
git config --global user.email "$USER_EMAIL"
git clone https://github.com/default-writer/c.git
- init
Sets up primary/optional tools and git hooks
./bin/init.sh --setup
./bin/init.sh --optional
./bin/init.sh --hooks
- rexo
./bin/utils/install.sh --submodule-rexo
- add/update Visual Studio Code environment settings:
"environment": [
{
"name": "UI_MODE",
"value": "--ui"
}
]
- run command line build
cd gtk
./bin/build.sh --target gtk-experiment1 --clean
UI_MODE=--ui ./build/gtk-experiment1
- are self-documented
- placed in ./bin folders
- detects execution as user or root (sudo)
- runs with required and optional command-line parameters
support this project become a sponsor
- added support for classes / inheritance (oberon exaple)
- added GC implementation
- added several list implementations
- playing around with visibility in class declarations
- ./bin/init.sh --setup
- ./bin/init.sh --hooks
- ./bin/init.sh --optional
C API PDF(refman.pdf)
- memory PDF(memory.pdf)
- list PDF(list.pdf)
- class PDF(class.pdf)
- history PDF(history)
- scripts PDF(scripts)
- labs PDF(labs)
PVS-Studio - static analyzer for C, C++, C#, and Java code.