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... |
Copyright (C) 2012 Fernando Borretti
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.