Skip to content

Releases: kc3-lang/kc3

KC3 v0.1.16

25 Dec 16:36

Choose a tag to compare

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 C11 with a small set of dependencies.

New in this release

  • libkc3

    • dlopen inside lib/ only
    • Generic typed pointers : (U8*) 0x0
    • make kc3_require and env_eval_do_block more careful about error
      handling
    • MP-safe integer counters : defcounter name = value
      • environment hash table for name resolution
      • mp-safe
      • Counter.decrease(Ident, Tag) as a cfn_macro, Tag must be a
        positive integer (non-zero)
      • Counter.get(Ident) as a cfn_macro
      • Counter.increase(Ident, Tag) as a cfn_macro, Tag must be a
        positive integer (non-zero)
      • Counter module 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}
      • 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"
    • 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)
  • build system

    • use runj to parallelize configure and update_sources
    • use sort to have a portable sort algorithm that gives consistent
      results across all operating systems.
  • test infrastructure

    • modular test infrastructure with test/test.subr and
      test/test_runner
    • use runj to call test_runner in parallel
    • removed sleep 2 that 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 using defcounter
    • 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.
    • EGL backend
      • XCB backend for X11
      • VT backend on Linux and OpenBSD using DRM KMS and GBM
  • 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

    • written in 3 days in KC3 + C
    • Argument parsing as a while loop with with pattern matching
      (like Elixir)
    • Added repo definitions for :
    • supports cross compilation
    • used as main platform for compiling kc3 and dependencies for
      Android
  • 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
  • removed unused/merged branches

KC3 v0.1.15

27 Aug 18:02

Choose a tag to compare

This is KC3, a graph oriented programming language. Syntax is Elixir like with pattern matching and multiple dispatch. Eval and macros are Common-Lisp like. System and libraries interop is native KC3 functions or libffi C11 style.

In this release we celebrate structs, facts database, marshalling and env_dump / restore.

New in this release :

  • libkc3
    • stacktrace (in gdb: gdb> p err_stacktrace())
    • hash table (ht.h, ht.c)
    • operators hash table
      • defoperator
      • ops_get
      • facts_add/replace
    • pass by reference and reference counting in a few data structures
      • Callable (Fn, Cfn)
      • Struct
      • StructType
    • optional pass by copy (--copy) for use with ASAN.
      • env_init_args now parses --copy
    • documentation
    • rename block into do_block
    • implement named blocks, return and return_from like in Common Lisp
    • add a named block to function evaluation to implement return from
      functions. The first name you give to the function is the name of
      the function implicit block.
    • added unwind_protect and env_unwind_protect_push/pop dance to a
      few functions
      • marked remaining code paths with TODO where unwind_protect is
        still needed (potential memleaks / env corruption)
    • env_frame_capture implements closures that capture their lexical
      environment (free variables)
    • while, break, continue as special operators with tests
      • reworked parser and evaluator to allow for special operators
        without arguments
      • introduced a new syntax (Ident) Module.sym to exclude special
        operator parsing.
    • converted almost every file to 72 columns max
    • added licenses to kc3 files
    • defspecial_operator is a special operator that allows (not unlike
      def) the runtime definition of special operators.
    • marshall/marshall_read allow for env_dump and
      env_dump_restore to save and restore all KC3 values for
      disk or network i/o.
    • automatic loading of env dump from kc3.dump if present
      • in lib/kc3/0.1/
      • in current working dir
      • reduced loading time of environment from minutes to sub-second !

Authors

  • Thomas de Grivel thoxdg@gmail.com (lead)
  • Jeremy JEANNE (intern)
  • lyzer (intern)
  • man-google (intern)
  • perle (intern)

KC3 v0.1.14

11 Feb 16:17

Choose a tag to compare

New in kc3-0.1.14 :

  • pretty printer
    • auto indent KC3 code
  • map
    • access
    • get (get key value)
    • put (return a new map)
  • struct
    • access
    • get
    • put
  • facts database (triple store) accessible from KC3
    • new database (Ptr)
    • add_tags
    • collect_with
    • collect_with_tags
    • remove_tags
    • with_tags
    • with
    • with_macro
  • HTTPd v0.2.0
    • dynamic pages (MVC)
      • models are defined in ./app/models/
      • controllers are defined in ./app/controllers/
      • templates are defined in ./app/templates/
      • views are defined in ./app/views/
      • dynamic router is defined in ./config/router.kc3
        • For now we don't match request method and just match the start of
          the URL with Str.starts_with?(url, route.path)
        • If there is no route or no controller or the controller does
          not return a HTTP response, a 404 error is returned. Other
          frameworks like Ruby on Rails or Phoenix do return a 500...
  • threads
    • env_fork_init
    • env_fork_clean
    • Thread.new(fn)
  • fx v0.2.0
    • file explorer
      • preview files
        • text
        • image
        • video
        • audio
        • binary (hexdump -C)
      • properties
        • create
          • POST "/properties/*path"
        • delete
          • DELETE "/properties/*path"

KC3 v0.1.13

02 Sep 12:27

Choose a tag to compare

KC3 v0.1.13

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.

We are currently fundraising for the project to become real and there is a working prototype available at https://git.kmx.io/kc3-lang/kc3/, please see the https://www.kmx.io/en/donations.html page for helping out.

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.

Supported operating systems (additional dependencies) :

BSD
Linux (libbsd, libmd)
MacOS X (libmd)
Windows (MSys2)
Supported architectures :

aarch64 (arm64, Apple M1, Apple M2)
amd64
i386
sparc64

New in this release

  • libkc3
    • pretty printer
      • indentation (str, if, do, fn, struct, map)
  • ikc3
    • facts
      • Facts.with_tags(facts, s, p, o, fn (fact) {}) -> cursor
  • lib
    • File.exists?
    • File.is_directory?
    • File.list
    • File.stat
  • HTTPd v0.1.1
    • file server (lftp)
    • route_request
      • error_404_page
      • directory_page
    • slash (lftp)

v0.1.10

12 Mar 08:18

Choose a tag to compare

  • OpenGL demo (make demo_gl)
    • OpenGL 3.3 with shaders (portable)
    • makes use of C3 data structures.
  • pin operator (for pattern matching)
  • macros
  • special operators
    • their arguments do not get evaluated
    • they return a value
    • parsed without syntax
      Ideally it would look like this :
      ic3> defspecial_operator op (a, b, c) { true }                                                    
      special_operator (a, b, c) { true }                                                               
      ic3> op 1 2 3                                                                                     
      true                                                                                              
      
    • See C3 module in lib/c3/0.1/c3.facts
  • if, then, else.
  • rational numbers and corresponding operations
  • complex numbers and corresponding operations
  • float 128 bit (F128) and corresponding operations

v0.1.8

08 Nov 13:12

Choose a tag to compare

New in this release

  • Support for additional platforms : arm64, sparc64
  • libc3
    • functions
      • funcall
  • tests
    • added many tests for integer operations (s8, s16, s32, s64, sw,
      integer, u8, u16, u32, u64, uw, and all their combinations for
      binary operators)