Welcome to the Grace Runtime Library repository! This repository contains the source code and documentation for the compiler library developed as part of the compilers course project at ECE-NTUA. The library is made to get a grade. It is designed to support the compilation of programs written in the Grace programming language.
Grace is a language designed specifically for programmers to learn to program compilers. It’s small, concise, and amazingly powerful. Grace leaves out a lot of the boilerplate that lards other languages; this makes it easier for new students to focus on the essentials of programming. The primary goal of this project is to get a grade, and perhaps to develop a reliable and efficient compiler for the Grace language.
- Written using C and its standard system libraries.
- Simple as is. No particular optimizations or advanced techniques used.
- Compatible with probably anything not Windows related.
-
Clone the repo
-
Build with
make -
Move library
libgrc.ato your compiler directory
Link with clang :
clang program.asm libgrc.agracec program.grc
clang -o a.out program.asm libgrc.a -no-pieFunctions included (among others from stdlib):
writeInteger(i64) -> voidwriteChar(i8) -> voidwriteString(ptr) -> voidreadInteger() -> i32readChar() -> i8readString(i64, ptr) -> voidascii(i8) -> i32chr(i64) -> i8strlen(ptr) -> i32strcmp(ptr, ptr) -> i32strcpy(ptr, ptr) -> voidstrcat(ptr, ptr) -> void
Any helpful contributions are welcome, but not necessary. This is just for a school project.
This project is licensed under the MIT License. Feel free to use and modify the library according to the terms of the license.
