2025-12-25 03:25:54
Released KC3 v0.1.16 🎄
KC3 is a programming language project developed by kmx.io. Taking its roots in C, Elixir and Common Lisp, it could be described as C with Elixir modules, pattern matching, and a semantic object system backed by a graph database. The idea is to plug modules, closures, pattern matching, a graph database and metaprogramming into C11 with a small set of dependencies.
See the release on
See the KC3 guides for information about installation.
New in this release
libkc3
- dlopen inside lib/ only
- Generic typed pointers :
(U8*) 0x0 - make
kc3_requireandenv_eval_do_blockmore careful about error handling - MP-safe integer counters :
defcounter name = value- environment hash table for name resolution
- mp-safe
Counter.decrease(Ident, Tag)as acfn_macro, Tag must be a positive integer (non-zero)Counter.get(Ident)as acfn_macroCounter.increase(Ident, Tag)as acfn_macro, Tag must be a positive integer (non-zero)Countermodule included at init
- unveil supported on OpenBSD
- pledge supported on OpenBSD
- rename f128 to f80: long double is actually 80 bits precision on x86 and amd64
- followed System-V ABI documentation for struct alignment and padding, works on amd64, arm64, i386 and sparc64 (marshalling and unmarshalling is portable across all these architectures)
libtls
- basic TLS client and server in test/tls/tls.kc3
ikc3
- Remote procedure call
- client : ikc3 --client HOST PORT
- opens a prompt on stdin and forwards parsed tags to server
using
RPC.request("input") - reads structured response from server :
%RPC.Response{out: "plop\n", err: "warning: message\n", result: (Sw) 5}
- opens a prompt on stdin and forwards parsed tags to server
using
- server : ikc3 --server HOST PORT
- accepts only one connection and exits
- works with netcat (no prompt)
- TLS with libtls : ikc3 --tls (--client|--server) HOST PORT
- "ikc3: TLS server: listening on HOST PORT"
- "ikc3: TLS server: client connected: HOST PORT TLS-1.3"
- "ikc3: TLS client: connected to HOST PORT TLS-1.3"
- client : ikc3 --client HOST PORT
- ship ikc3 as a standalone file that links to the right lib directory on MacOS, this way you can open ikc3 using Finder in a Terminal.app and the dynamic libraries will still be found (require Socket loads the socket library for instance, through dlopen)
- Remote procedure call
build system
- use
runjto parallelize configure and update_sources - use
sortto have a portable sort algorithm that gives consistent results across all operating systems.
- use
test infrastructure
- modular test infrastructure with test/test.subr and test/test_runner
- use
runjto call test_runner in parallel - removed
sleep 2that slowed each ikc3 test - all test suites run in under 30 seconds now compared to more than 5 minutes before
HTTPd
- limit acceptor loop using defcounter
- achieved securelevel(2) after load_app() by moving all
def*into proper modules and usingdefcounter - apply unveil filesystem access permissions on OpenBSD
- current dir (./) is read-only and ./log and ./db are read-write
- using kc3 unveil wrapper that soft fails on other systems
- on OpenBSD a failed unveil call aborts the program into the debugger
- apply unrevokable restrictions on future syscalls on OpenBSD using pledge(2)
window
- demo
- unified all OpenGL demos under window/demo
- SDL2
- OpenGLESv3
- Use Angle GLESv3 implementation with Metal backend on MacOS. This provides SDL2 with an EGL/GLESv3 driver on MacOS despite OpenGL support being dropped by Apple.
- OpenGLESv3
- EGL backend
- XCB backend for X11
- VT backend on Linux and OpenBSD using DRM KMS and GBM
- demo
kc3s supports the following command line arguments :
RPC
- --server 127.0.0.1 1026
- --client 127.0.0.1 1026
TLS
- --tls
- --tls --server 127.0.0.1 1026
- --tls --client 127.0.0.1 1026
additionnaly code was deduplicated from ikc3 and kc3s to share the same source file for both binaries
kpkg - KC3 package manager
release engineering
- compressed dmg with large icons and a nice arrow pointing to
applications symlink
- mac release binaries work from any absolute path and use relative paths to find dynamic libraries
- debian package building from sources
- gentoo overlay and ebuilds for
- kc3
- kmx_sort
- runj
- compressed dmg with large icons and a nice arrow pointing to
applications symlink
removed unused/merged branches