Set file extension for i386_elf_generator to ".o".
[voodoo-lang.git] / README
blob836c0ed66f4d35630e344062cd08881b820e2ac8
1                        The Voodoo Compiler
3 Introduction
4 ============
6 The Voodoo compiler is a compiler for the Voodoo programming language.
7 The Voodoo programming language is designed to be a thin abstraction
8 layer over the CPU's native instruction set. It provides functionality
9 to read and write memory, perform arithmetic, define and call
10 functions, and not much more. In particular, Voodoo has no concept of
11 types, let alone type safety. Voodoo is as dangerous as it is
12 powerful. The Voodoo programming language is described in more detail
13 in doc/language.html.
15 Usage
16 =====
18 The directory src contains an executable, voodooc, as well as a number
19 of Ruby modules. The program can be run from the src directory itself,
20 or from any other directory if the src directory is added to the
21 environment variables PATH and RUBYLIB. It works with Ruby 1.8.5, and
22 may also work with earlier and later versions.
24 The below example compiles and runs the hello program from the test
25 directory, after adding the src directory to PATH and RUBYLIB:
27 $ export PATH="$PATH:$PWD/src"
28 $ export RUBYLIB="$RUBYLIB:$PWD/src"
29 $ voodooc -o /tmp/hello.asm test/hello.voo
30 $ nasm -f elf /tmp/hello.asm
31 $ cc /tmp/hello.o -o /tmp/hello
32 $ /tmp/hello
33 Hello, world!
35 Note that the C compiler is used for the linking step; this is so that
36 the C library and any necessary files to handle a main function are
37 linked in. This is not the only way to get a working executable.
38 Voodoo programs can use other libraries than the C library, or even no
39 library at all. Linking with the C library is just used as a
40 convenient way to get a working puts function.