- optimising ๐
- llvm backend ๐จ
- the integer type is implemented in 64-bits only (its 2024)
- strings can contain unicode characters ๐๐
- it's like pascal and C
- it has nested functions and call by reference
- it has interesting comments
- it supports strings and has some built in functions to manage them (included in the runtime library)
- look at the spec to find out more ๐
- look bellow for example programs to get the idea of the language (or to use the compiler ๐คญ๐ณ)
- https://github.com/kostis/ntua_compilers/tree/master/grace/programs ๐ซ
- https://github.com/giannosr/grace_programs
- a plug in for vscode which includes syntax highlighting among other resources can be found here
- it is contained in
libgrc
๐ - it was based on this ๐งโโ๏ธ
- im not sure its makefile works correctly ๐ค
- it relies on C's library
- it uses C's string functions directly
make -j3
then
make clean
removes all files produced but not need to run the executable (i.e. object files etc.) ๐งด
The compiler has been tested to work under the following configuration, which may be required for the compiler to compile and/or run
$ llvm-config --version
16.0.6
$ llvm-config --cxxflags
-I/usr/include -std=c++17 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
$ llvm-config --ldflags
-L/usr/lib
$ llvm-config --system-libs
$ llvm-config --libs all
-lLLVM-16
make distclean
./grc.py [flags] program.grc
produces the executable program
(files are not required to end in .grc
๐)
โ if flags -i
or -f
are not set, then two more files are produced:
program.ll
- contains llvm irprogram.s
- contains assembly
-O
optimise ๐-f
final code ๐ค - read prorgam from stdin and put final code in stdout-i
intermediate code ๐ฝ - read prorgam from stdin and put intermediate code in stdout