View the demo of the system here.
View the source code on github.
What could you do if you knew what happened between your programming language and the hardware?
Caneka is a full-stack + web-server + database replacement for a web development runtime. Based entirely on simplistic components written from scratch in C.
Caneka was born from the idea that productivity in sofware engineering was in need of new tooling. To us, the evolution seamed to stall after the OOP languages.
It seams like we never got to that Level 4 set of languages. A place where developers spend more time on composition than repetitive details.
Lisp, Scala, Rust, and C# all came close with pattern matching and routing features, but there is more power that developers could wield.
The determination to start from scratch is an effort to accomplish a syntax-agnostic runtime while building transparency and reliability at the same time.
This also solves the "many dependencies" problem, by encompasing every essential feature of a software application in one place. Caneka does not require any features outside of a POSIX compliant operating system and a C compiler.
Components are linked as necessary for features such as cryptography and network handling (such as NaCL and eventually SSL). And the build system is designed for extensibility with other software sources.
It also increases portability to keep the C compilation step in place so that it can build and run on a variety of architectures.
The core components run pretty well and have been lightly tested, you can see the status of the system at caneka.org or by building and running the tests through the `bootstrap` programoption (see Build Steps above).
Unit tests are avaialable in the Example Site at code.comparebasic.com.
Caneka is a brand of Compare Basic, read more at comparebasic.com.
Caneka has three main components including a parser with no prefered syntax, a network server, and a memory manager for data storage and data structures.
Most of the system is licenced under a 3-Clause BSD Licence from Compare Basic with a few folders shared as public domain. see LICENCE file in the root directory for details about the source code licence(s) in other directories.
Think of it like "a regular expression engine that can generate and run data structures".
The goal of this approach is to increase configuration and encourage teams to map their problem space more directly, using less lines of boiler-plate code.
This is commonly refered to as a Domain Specific Language.
Since the dawn of computing, all computer tasks have been accomplished through a combination of user-interaction, protocols, markups, and programming langauges. Caneka aims to allow software development to include the definition of the langauge syntax.
Of the components of the system that are responsible for storage here are diagrams for a few of them.
The memory manager allocates 4 killobyte pages in a 16 megabyte section, refered to as a MemBook. Tasks have a chapter assigned to them MemCh. Each chapter contains an array of pages. In this context Task is a loose term that can be applied to any object in the system that will be around for long enough to deserve it's own set of memory pages. The most common case is a single unit-test or a single web request.
MemCh pages are non-contigous which is represented by the blue pages blow for MCtx #1.
"Recycled" pages in the diagram represent pages that were previously used, then reset to contain all zeroes and are available to be used by the next Task that needs it.
The Span data structure stores pointers in slabs of 16 at a time. These slabs can in tern, store other slabs to create lookup structures that use multiple pointers to target indexes of 16 at a time.
The Span object is a flexible array which holds element pointers in the highest level (called a dimension) and pointers to those 16 slot pointer arrays for each demension below. In this way it can index a total of 1,04,576 items if it nests the slabs in 5 layers.
| Level 0 | 16 items |
| Level 1 | 256 items |
| Level 2 | 4,096 items |
| Level 3 | 65,536 items |
| Level 4 | 1,048,576 items |
The resizing is also very natural. The original slab of 16 items is preserved, not copied, and a new slab of 16 is allocated to house that original slab as the address value stored in slot 0 of the new slab.
This Iter animation demonstrates how the behavior can increment a single Slab to access elements of a Span in near-constant time
This makes the Span object especially performant for sequential iteration because it can sequentially access contigous pointers in a slab of 16 items until it hits a boundary. When a boundry is hit, it can simplistically increment any lower slab which has reached the end of it's addresses. View the code here.
These are the current diagrams showing the basic memory functionality. There are many more components built using these components and other components. The symphony of components following this architecture currently delivers:
View the running webserver demo here.
Transparency through the use of simplistic components and clear computer-science concepts is our way of addressing the confusion modern software engineers face. We will take it up to level 11 and beyond, it's already rocking a number of higher level interactive features.