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.
(recursive fib i64 ((n i64))
(if (icmp n slt 2)
n
(add (fib (sub n 1))
(fib (sub n 2)))))
(foreign C printf i32 (pointer i8) ...)
(printf "Hello, world! This is a double, in scientific notation: %e", 3.141592)
(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))
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 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.
Kind | C/C++ | Hylas |
---|---|---|
Integers | char , 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:
|
Floating-Point | float , double , long double . |
half , float , double , fp128 , x86_fp80 , ppc_fp128 . |
Aggregate | Structures (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 Library | size_t , FILE* , _Bool . |
Hash Tables, Sequences (Resizable arrays, bound-checked arrays), filesystem-independent Filepath and Process objects... |