Skip to content

Arcterus/Hylas-Lisp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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...

License

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.

About

A JIT-compiled Lisp dialect targetting the LLVM.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published