Giter Site home page Giter Site logo

ti-lisp's People

Contributors

bbli avatar cww0614 avatar jayzern avatar lijning avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jayzern

ti-lisp's Issues

Scanner: comments without line breaks

# comments

Without a new line after the commented content, Fatal error: exception Failure("lexing: empty token") would be raised.

# comments

This works well.

testing framework

After program arguments is implemented, we could build a very simple unit testing framework using ocaml.

It could be like for one test case, we have test.args specifying switches passed to the tilisp executable, test.input as input file and test.output as expected output. The test framework finds all such files in tests directory and execute them.

[general] program arguments

The executable tilisp.native should accept a file name for source code to compile, and support optional switches for printing AST, AST after macro expansion, SAST.

irgen test

As irgen is being implemented, we could begin writing some tests for the already implemented features. The test program should test the output of the compiled source program.

Error message when executing "make all"

SANITIZE: a total of 3 files that should probably not be in your source tree
  has been found. A script shell file
  "/mnt/e/Local-Git-Repo/ti-lisp/_build/sanitize.sh" is being created. Check
  this script and run it to remove unwanted files or use other options (such
  as defining hygiene exceptions or using the -no-hygiene option).
IMPORTANT: I cannot work with leftover compiled files.
ERROR: Leftover object files:
  File tilisp.o in . has suffix .o
  File helper.o in . has suffix .o
  File libtilisp.a in . has suffix .a
Exiting due to hygiene violations.
Compilation unsuccessful after building 0 targets (0 cached) in 00:00:00.
make: *** [Makefile:12: testing.native] Error 1

Can be resolved after "make clean"

IR Generating

Plan:

  • variable type, define and set!
  • most basic display builtin function (displaying an integer)
  • if
  • lambda
  • other control structures
  • other types of literals
  • allocate variables on heap (now it's possible to access invalid variables on stack through closure)
  • garbage collection

Compile the source code into executable

Right now we are able to print the generated IR directly to stdout like microc does (The IR code could be interpreted by lli from LLVM toolchain). I think it should be possible for us to compile source code directly into a binary executable. To make testing easier, the tilisp entrypoint could also have some parameters to run the executable after compiling successfully

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.