GithubHelp home page GithubHelp logo

froggey / iota Goto Github PK

View Code? Open in Web Editor NEW
259.0 19.0 16.0 27.42 MB

LLVM to Common Lisp transpiler.

HTML 1.49% Makefile 9.86% C 72.36% Shell 1.17% C++ 7.68% Objective-C 0.93% M4 0.86% Roff 0.47% Assembly 4.14% R 0.01% Logos 0.01% Perl 0.15% Mathematica 0.01% Common Lisp 0.11% Batchfile 0.01% Emacs Lisp 0.04% GDB 0.01% Python 0.04% TeX 0.67% Yacc 0.01%

iota's Introduction

Iota is an LLVM to CL transpiler, similar to emscripten. It converts LLVM bitcode
to safe, portable Common Lisp code.


Quick Start
-----

# You'll probably want to make this available as a quicklisp local project.

# Optional, for parallel builds
export MAKEFLAGS=-j2

# Clone the LLVM/Clang repos.
./fetch-llvm.sh

# Build LLVM, Clang, and the translator.
# This will take a long time unless you have a beefy machine.
./build-llvm.sh

# Build & translate libraries and programs.
./build.sh

# Load into Lisp.
lisp --load load.lisp

# prboom & sdlquake can now be run using (CL-USER::RUN-PRBOOM) and (CL-USER::RUN-SDLQUAKE).


Usage
-----

The build-llvm.sh and build.sh scripts build the translator and compiler,
installing them in the toolchain/ subdirectory.
C source code can be compiled to object files as normal using clang -c.
There is no ld-style linker, so object code and libraries must be linked
with llvm-link.
The linked bitcode file can then be translated with iota.


Example
-----

cat > example.c <<EOF
#include <stdio.h>
int main(int argc, char **argv) {
    printf("Hello, World!\n");
    return 0;
}
EOF
toolchain/bin/clang -c example.c
toolchain/bin/llvm-link -o=example.bc example.o toolchain/le32-iota/lib/libc.a
toolchain/bin/iota -package=":example" example.bc > example.lisp

iota's People

Contributors

froggey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iota's Issues

build-llvm.sh results in Makefile error

make[2]: *** [lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/build.make:180: lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CodeGenPrepare.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:727: lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

System "iota" Not Found

This is SBCL 2.3.1, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* (load "load.lisp")
While evaluating the form starting at line 3, column 0
  of #P"/Users/MacOSuser/Downloads/Iota-master/load.lisp":

debugger invoked on a QUICKLISP-CLIENT:SYSTEM-NOT-FOUND in thread
#<THREAD "main thread" RUNNING {1001098003}>:
  System "iota" not found

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE               ] Try again
  1: [ABORT                  ] Give up on "iota"
  2: [REGISTER-LOCAL-PROJECTS] Register local projects and try again.
  3: [RETRY                  ] Retry EVAL of current toplevel form.
  4:                           Ignore error and continue loading file "/Users/MacOSuser/Downloads/Iota-master/load.lisp".
  5:                           Abort loading file "/Users/MacOSuser/Downloads/Iota-master/load.lisp".
  6:                           Exit debugger, returning to top level.

((LABELS QUICKLISP-CLIENT::RECURSE :IN QUICKLISP-CLIENT::COMPUTE-LOAD-STRATEGY) "iota")
   source: (CERROR "Try again" 'SYSTEM-NOT-FOUND :NAME NAME)
0] 

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.