chsasank / llama.lisp

Lisp dialect designed for HPC and AI
GNU Lesser General Public License v2.1
14 stars 6 forks source link

Create a driver for the compiler framework #54

Open GlowingScrewdriver opened 3 months ago

GlowingScrewdriver commented 3 months ago

The pressing need of the hour is a single command that can be used to compile code, instead of a messy command line with multiple commands and pipes. For the time being, llama.lisp.sh serves that purpose. Below is the built-in help message, just to give the reader an idea of what this is:

$ ./llama.lisp.sh -h
C-Lisp compiler driver

Usage: ./llama.lisp.sh -i <input filename> [ -s <stage> ] [ -c <clang options> ] [ -h ]
Options:
  -i: Specify the source file
  -s: Specify the stage to run
      supported stages: clisp, brilisp, llvm
  -c: Supply arguments to clang (note that you will have to quote
      them if there are multiple arguments)
      Defaults to: '<script directory>/tests/brilisp/runtime.c -Wno-override-module -O2'
  -h: Display this message

Each "stage" above is one compilation step: clisp is C-Lisp to Brilisp, brilisp is Brilisp to LLVM, and llvm is from LLVM to the executable. Running without an -s argument will run all stages from C-Lisp to executable.