LinArcX / citron

General purpose programming language (mainly for unix-like systems)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Citron :: A Programming Language for the crazy and people that like functions Build Status Codacy Badgecodecov

Release

A binary release (x86_64 ELF) is available (see Default Module Resolution for dynamic modules)

You can also use the docker image (will probably be auto-built later...)

# to run an interpreter
$ docker run --rm -it anothertest/citron:latest

Build guide

required libraries:

  • libdl -- for dynamic loading of modules
  • libbsd -- for utility functions (compile without forLinux defined to get rid of this dependency)
  • libpcre -- for regular expressions
  • libpthread -- for threading support
  • libgc -- for Garbage Collection
  • libsparsehash -- Symbol storage
  • llvm -- (>= 7) for inline asm (if you're on a braindead distro that adds version numbers to these, add an alias for llvm-config)

build-time tools:

  • autotools -- configure and such
  • cmake -- for libsocket

for the braindead distros (don't kill me)

$ sudo apt install build-essential automake libtool cmake libbsd-dev libpcre3-dev libgc-dev libsparsehash-dev llvm-8 llvm-8-dev

Basic steps to build and install:

clone this repository

$ git submodule update --init
$ cd citron/autohell
$ autoreconf
$ CFLAGS="-O3" CXXFLAGS="-O3" ./configure --with-stdpath=/usr/local/share/Citron --prefix=/usr/local --with-inject --with-ffi --with-inlineasm
$ make
$ make install

The normal configure options apply.

Note

If the binary is built without ffi, to launch the repl, you must pass these flags to it:

  • --assume-non-tty --without-signals

i.e. the invocation would be citron --assume-non-tty --without-signals

Basic language syntax:

All operations are done through sending and receiving messages between objects.

receiver message

receiver keyword: 'string' messages: 1, can be: 'chained', like so.

there are some examples in the examples directory.

Default Module Resolution

A default module resolution path is assigned at build-time, which normally points to the data directory of the install; However, this can always be overridden by specifying an environment variable (CITRON_EXT_PATH by default).

Scratchpad fun

Assuming the Tcl extension is built and accessible (the binary build has it); a basic scratchpad can be accessed:

$ citron -m scratchpad

For a basic introduction, see Scratchpad on the citron-book

About

General purpose programming language (mainly for unix-like systems)


Languages

Language:C 86.6%Language:Makefile 8.4%Language:HTML 1.0%Language:Python 0.9%Language:Roff 0.6%Language:C++ 0.5%Language:CMake 0.4%Language:Shell 0.4%Language:Perl 0.3%Language:Vim Script 0.2%Language:Assembly 0.2%Language:M4 0.2%Language:Common Lisp 0.1%Language:Haskell 0.1%Language:Yacc 0.0%Language:Batchfile 0.0%Language:Dockerfile 0.0%Language:Ruby 0.0%Language:Scheme 0.0%Language:Jupyter Notebook 0.0%