Skip to content

jotheberlock/Enki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enki is a toy statically-typed, statically-compiled programming
language, wherein I experiment with the following:

A common ABI across operating systems, such that a file with the
same machine code could run on Windows, Linux and MacOS (or Windows Mobile,
Android and iOS). Note that the MacOS support has bitrotted and definitely
won't work with the new ARM-based Macs (part of the MachO format is a segment
defining the initial thread which is basically a register dump similar to
what you get from getcontext(3) which is inherently processor specific -
I have support for older x86-based MacOS but nothing for ARM).

A spaghetti stack/support for closures and generators.

Direct code generation to machine code and native executable files for x86-64
and ARM - no assembler here.

It's currently at least in the ballpark of being as expressive as C (structs,
arrays, functions, function pointers, variously-sized integers) - no
floating point or memory management as such so far, though. Also pretty
much no optimisation whatsoever as yet.

Yes, I have heard about LLVM - but LL is indeed a VM, and it Vs the things
I'm most interested in messing around with, i.e. calling conventions (both
in the sense of 'what goes in what register' and also it assumes you have
a conventional C-style stack) and object file formats.

Originally this was written some time ago in C++98 with portability in mind
- I have compiled and run it succesfully with gcc 3.4 on a Solaris 7 SPARC
machine for example. However it is now 2024 and I am incrementally updating it
to C++11, a somewhat slow process given the size of the codebase.

About

An experimental compiled language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published