Skip to content

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

Notifications You must be signed in to change notification settings

alimpfard/citron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Mar 1, 2025
3995cf8 · Mar 1, 2025
Jan 22, 2022
Jan 6, 2019
Dec 26, 2019
Nov 29, 2019
Jun 10, 2018
Feb 11, 2022
Nov 19, 2018
Dec 28, 2017
Mar 9, 2022
Aug 3, 2021
Mar 1, 2025
Mar 4, 2022
Feb 11, 2022
Jan 22, 2022
Aug 3, 2021
Aug 4, 2021
Nov 3, 2020
Aug 4, 2021
Mar 9, 2022
Aug 3, 2021
Sep 19, 2017
Aug 22, 2019
Mar 10, 2022
Sep 20, 2017
Oct 15, 2018
Sep 19, 2017
Mar 4, 2022

Repository files navigation

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

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:

  • cmake -- for libsocket

for the braindead distros (don't kill me)

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

Basic steps to build and install:

clone this repository

$ cd citron
$ git submodule update --init
$ make
$ sudo make install
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