Skip to content

A JIT-compiled Lisp dialect targetting the LLVM.

License

Notifications You must be signed in to change notification settings

rjmacready/Hylas-Lisp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Hylas is a statically-typed, wide-spectrum, JIT-compiled dialect of Lisp that combines the performance and control of low-level languages with the advanced metaprogramming features of languages like Lisp.

Examples

Recursive, Tail Call-Optimized Fibonacci Function:

(recursive fib i64 ((n i64))
  (if (icmp n slt 2)
    n
    (add (fib (sub n 1))
         (fib (sub n 2)))))

Calling a foreign function:

(foreign C printf i32 (pointer i8) ...)

(printf "Hello, world! This is a double, in scientific notation: %e", 3.141592)

Using a foreign library:

(link "libSDL.so")

(foreign C SDL_Init void i64)
(foreign C SDL_Delay void i64)
(foreign C SDL_Quit void)

(structure SDL_Color
  (r            byte)
  (g            byte)
  (b            byte)
  (unused       byte))

Benchmarks

Recursive Fibonacci with n=40

Fibonacci benchmarks

Building

A simple make (Or make console) will build the default console front-end for Hylas.

If you have the Qt libraries (they are not statically compiled), you can build the Syntagma IDE using make gui. Both commands will produce an executable called hylas.o.

Documentation

Documentation on the language is available as a series of Markdown files in the docs folder, and can be built using Make and Pandoc:

$ cd docs
$ make

This will generate the HTML files in the docs/html folder. Use make clean to delete them.

Documentation on the compiler is available as Doxygen comments, the Doxyfile being in the same docs folder. A Make recipe (doxygen) can be used to build the output into the docs/Doxygen folder.

Types

KindC/C++Hylas
Integerschar, short, int, long, long long, signed and unsigned. i1, i2, i3... i8388607. (Number indicates the bit-width).
Signature is a property of operations, not types. Aliases exist for the most common ones:
  • bool: i1.
  • char, byte: i8 or i7, depending on the architecture.
  • short: i16.
  • int: i32.
  • long: i64.
  • word: i32 on 32-bit machines, i64 on 64-bit machines (Width of a machine word, to be used like size_t).
Floating-Pointfloat, double, long double. half, float, double, fp128, x86_fp80, ppc_fp128.
AggregateStructures (Can be opaque), arrays, pointers and unions. Has void pointers.Structures (Can be opaque) and pointers. Arrays are pointers. Doesn't have void pointers, can be implemented through coercion functions.
Standard Librarysize_t, FILE*, _Bool. Hash Tables, Sequences (Resizable arrays, bound-checked arrays), filesystem-independent Filepath and Process objects...

About

A JIT-compiled Lisp dialect targetting the LLVM.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 98.0%
  • Other 2.0%