~shakna/evjl

Increment patch number to reflect number of small fixes
Fixed passCount in testsuite
Commented on examples.

clone

read-only
https://git.sr.ht/~shakna/evjl
read/write
git@git.sr.ht:~shakna/evjl

You can also use your local clone with git send-email.

#evjl

A strange programming language.


evjl is a low-level programming language, currently in "alpha" levels of design. (However, the language is already self-hosting, and capable of compiling itself.)

The versioning is not yet semantic. Until 1.0.0 breaking changes will be common.

evjl is:

  • AOT compiled. (Even when run through the interpreter).
  • Staticly typed.
  • Weakly typed.
  • Procedural

#Obligatory "Hello, World!"

Main then displayln("Hello, World!"); end


#A larger example

This example creates a function, which acts as a coroutine to yield back an integer that increases by one each time.

proc(example, int)
  storage(int, i, 0);
  coroutine();
  While true then
    co_return(++i);
  end
  co_end();
  return i;
end

Main then
  displayln(example());
  displayln(example());
  displayln(example());
  displayln(example());
  displayln(example());
  displayln(example());
  displayln(example());
  displayln(example());
end

Here for the first time you get to see defining a procedure, which may also be called a function in other languages. Procedure was chosen as the word as side-effects are entirely possible, whereas in a pure function, they are not.


#Building

Arch Linux users can install from the AUR: yay -Sy evjl

Gentoo users might try the ebuild here.


You must have libtcc installed and available before continuing.

You must have xxd installed and available before continuing.

You need a C11 compatible C-compiler.

evjl is only tested on Linux, and may not function on other platforms, though it may also be possible to compile for other platforms.

evjl requires a 64bit platform.

To build & install the binary:

# Get the source code
git clone --recurse-submodules https://git.sr.ht/~shakna/evjl
# Checkout the latest release
git checkout "$(git describe --tags $(git rev-list --tags --max-count=1))"

# Build it
make
make test
make install

Note: evjl's compiler is now written in evjl. It uses an older version of itself as a bootstrap compiler.

Note: The test phase of compiling is important, but can take a little time on the average consumer's hardware. Somewhere less than 2 minutes is normal.


#Usage

evjl v0.3.0
Basic Usage: evjl [file] [--expand | -e, --help | -h, --version | -v]
--expand | -e Expand the given file into it's C source.
--help | -h Show this message and exit.
--version | -v  Show the version and exit.

--compile=<outfile> Compile the given file out an executable called <outfile>.
--include=<directory> Add an include path. (You can use this option multiple times).
--library=<library> Link against a library. (You can use this option multiple times).

See https://git.sr.ht/~shakna/evjl for help and documentation.

#Issue Tracker

~shakna/evjl.


#Learning

There is the beginning of documentation in docs.


#LICENSE

evjl heavily relies on the Tiny C Compiler, released under the LGPL 2.1.

evjl itself is released under the 3-Clause BSD License, found in the LICENSE file.