Branch :
KC3 is a programming language with meta-programmation and a graph database embedded into the language. It aims to be the language for semantic programming, and programming the semantic web.
You can easily convert each KC3 function to a C function. KC3 is both a language and a runtime.
This is a development branch, for the latest release see KC3 v0.1.15.
KC3 is currently a programming language project, inspired by C, Elixir and Common Lisp. It could be described as C with Elixir modules, pattern matching, and a semantic object system. The idea is to plug modules, closures, pattern matching, a graph database and metaprogramming into C99 with an extremely small set of dependencies.
Components :
libkc3 library is a full KC3 parser and interpreter.ikc3 is the interactive interpreter (verbose).kc3s is the script interpreter (same as ikc3 but terse).lib/kc3/0.1
using the make lib_links command.kc3_httpd.All binaries can be compiled for four targets :
assert is disabled.assert is enabledSupported operating systems (additional dependencies) :
Supported architectures :
To install and test KC3 for yourself, you can follow the KC3 Installation Guide.
There are now four full applications written in KC3 that we know of :
make demomake demo_glmake test_httpd with all the KC3 releases and
documentation.(Facts*) → p_facts(U8*) 0x0kc3_require and env_eval_do_block more careful about error
handling224b1777 (readme, todo, new in this release) - block all Cfn definition if
securelevel(0) > 0-env_eval_callable-cfn_eval-cfn_link-cfn_prep_cif-buf_parse_pcallable-buf_parse_cfn- block system() calls ifsecurelevel(0) > 0-kc3_system-kc3_system_pipe_exec- block dlopen() calls ifsecurelevel(0) > 0- kc3_dlopen - env_dlopen - block dlsym() calls ifsecurelevel(0) > 0- only ever called by cfn_apply which is already blocked at securelevel > 0 - 2 → eval - block buf_parse_fn ifsecurelevel(0) > 1- block buf_parse_pcallable ifsecurelevel(0) > 1- block env_eval_callable ifsecurelevel(0) > 1- block all env_def* ifsecurelevel(0) > 1- block all kc3_def* ifsecurelevel(0) > 1- block all facts_add* on global env facts ifsecurelevel(0) > 1- block all facts_remove* on global env facts ifsecurelevel(0) > 1- 3 → ø (no KC3 eval, C-mode only) - block all env_eval_* ifsecurelevel(0) > 2
MP-safe integer counters : defcounter name = value
Counter.decrease(Ident, Tag) as a cfn_macro, Tag must be a
positive integer (non-zero)Counter.get(Ident) as a cfn_macroCounter.increase(Ident, Tag) as a cfn_macro, Tag must be a
positive integer (non-zero)Counter module included at initikc3
RPC.request("input")%RPC.Response{out: "plop\n",
err: "warning: message\n",
result: (Sw) 5}
build system
runj as a git submodule to parallelize configure
and update_sourcessort as a git submodule to have a portable sort
algorithm that gives consistent results across Linux and BSD.test infrastructure
runj to call test_runner in parallelsleep 2 that slowed each ikc3 testHTTPd
Join us on kmx.io Discord server !
Follow the KC3 guides to discover how to use KC3 for your own projects.
(Macro) fn (x) { x }\n)(TAG_VOID: 1, TAG_TUPLE: (1+ (max (height tuple->tags))))