Skip to content

mokrates/limo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

bbd4f33 · Sep 24, 2024
Apr 1, 2024
Mar 9, 2024
Aug 3, 2024
Apr 24, 2024
Jun 27, 2024
Jul 27, 2024
Sep 24, 2024
Apr 7, 2021
Jan 9, 2020
Jun 26, 2022
Mar 9, 2024
Jan 10, 2023
Apr 1, 2024
Dec 5, 2012
Apr 7, 2021
Apr 13, 2023
Jan 10, 2023
Jan 10, 2023
Jul 28, 2024
Apr 13, 2023
Mar 17, 2024
Jan 10, 2023
Apr 15, 2023
Jun 13, 2021
Mar 19, 2023
Apr 15, 2023
Apr 14, 2023
Jul 29, 2021
Apr 15, 2023
Jan 21, 2023
Mar 5, 2021
Apr 13, 2023
Jun 10, 2024
Dec 31, 2019
Oct 21, 2019
Sep 14, 2024
Dec 11, 2012
May 22, 2022
Dec 7, 2019
Apr 15, 2023
Feb 1, 2023
Apr 14, 2023
Apr 15, 2023
Apr 13, 2023
Aug 13, 2021
Aug 6, 2021
Mar 25, 2023
Apr 13, 2023

Repository files navigation

   _ _                \
  | (_)_ __ ___   ___  \  (λ)
  | | | '_ ` _ \ / _ \ |\~~|
  | | | | | | | | (_) || \ |
  |_|_|_| |_| |_|\___/ |___|

written by Moritz Molle

Licensed under GPL (v3) (applies to all files in this tarball) http://www.gnu.org/licenses/gpl.html

CodeQL


for the impatient:

$ bash build.sh bin

builds and installs limo into ~/.local/bin and ~/.local/lib

Installing systemwide:

$ make 
$ make install

builds and installs into /usr/local/

Custom prefix

You can define a prefix where limo should be installed by giving make a INSTALL_PREFIX:

$ make clean
$ make INSTALL_PREFIX=/usr/local/ limo
$ make INSTALL_PREFIX=/usr/local/ install

please be aware that the INSTALL_PREFIX should be given to all the make targets.

It it advisable to always make clean before every build. build.sh does this.

build.sh:
build.sh is really simple, I recommend to modify it to your needs and use that.


dependencies:

build-essential (gcc, make)
libgc (boehm garbage collector)
libreadline
libgmp (gnu multiprecision library)
libpthread

really, see deps/, meanwhile there's a whole lot of new libraries available

Libraries:

You can choose to build libraries or not to build them: If you choose not to build libraries, you have to remove them from libs/Makefile

If you choose to build a library with limo you can choose to inline libraries or to build them as shared objects. If you want to inline a library, add it to inlined.mods

Library dependencies:

ncurses: ncurses ncmenu: ncurses ncmenu (if you inline ncmenu, you have also have to inline ncurses) sdl: sdl simplesdl: sdl limogtk: gtk3

limogtk

Not built by default. This is very dirty stuff.

  1. You need a working limo installed to build limogtk
  2. this takes a while. The scripts generate C code from the gtk header files.

~/limo$ cd libs/limogtk ~/limo/libs/limogtk$ make clean ~/limo/libs/limogtk$ make ~/limo/libs/limogtk$ cd ../..

~/limo$ make install or ~/limo$ bash build.sh

Building on MAC OS X

You can install all the dependencies using homebrew (http://brew.sh) You have to use the limo-wsl or limo-almost-static target.

Building on Windows Subsystem for Linux (WSL)

You have to use the limo-wsl or limo-almost-static target.

Attributions and Licenses

As not 100% of the code is mine, please have a look at attributions.txt


specials:

on REPL:    _	: the last evaluated value

(try TRY CATCH)	: the TRY form is tried. if an error occurs, the CATCH form will be executed
                  In the CATCH form, there is a var _EXCEPTION which contains the
				  argument to throw().

_exception	: see try

(eval EXP [ENV]): evaluate EXP under environment ENV. EXP and ENV are evaluated once under the
	              normal environment, as befits a function. THEN EXP is evaluated again.

dcons/#<thunk>	: #<thunk> are instances of a type which cannot be instatiated by a program.
  	  what CAN be instantiated are dcons'es.
	  #<thunk> is a type used to implement tailcall-optimization. if an EXP is the
	  last in an eval-chain, it is not evaluated, but packed into an #<thunk>
	  (evaluate again) and returned. this is purely internal.
	  it can be used with dcons(). dcons is a builtin, which evaluates it's first
	  argument, packs the second into an #<thunk> and cons'es those two.
	  this way the cdr of the cons only gets evaluated, when cdr() is called on the
	  cons. this is limo's way of implementing iterators.

There's tons of other stuff: language:

  • tailcall optimization
  • multithreading
  • objects/classes
  • bignums/quotients
  • macros

simple libraries:

  • simplest networking (sockets)
  • simple graphics (sdl/gtk/ncurses)

EXAMPLES

Tetris

You can play tetris limo examples/tetris.limo

Snake

You can see snake beat itself: limo examples/autosnake2.limo 10 10

mandelbrot

The usual mandelbrot fractal rendered with sdl

more

just see the examples/-directory.