Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Compilers

    Voodoo Compiler 1.0.1

    Download button

    No screenshots available
    Downloads: 233  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Robbert Haarman | More programs
    LGPL v2 / FREE
    January 31st, 2012, 15:28 GMT [view history]
    ROOT / Programming / Compilers

     Read user reviews (0)  Refer to a friend  Subscribe

    Voodoo Compiler description

    An implementation of the Voodoo programming language

    Voodoo Compiler is an implementation of the Voodoo programming language. The Voodoo programming language is a low-level programming language, abstracting over the platform's instruction set and calling conventions, but otherwise leaving the programmer free to do anything at all.

    Voodoo Compiler is written in Ruby and generates code for i386-compatible, AMD64, and MIPS CPUs. Support for additional target CPUs is planned for the future.

    Usage

    There are two main ways to use the Voodoo compiler: by running the voodooc program, or by using the Ruby API.

    The voodooc program compiles a Voodoo source files. Its usage is described in the voodooc.1 manpage, included in the distribution. The following is an example of how voodooc can be used to create an executable hello from a source file hello.voo:

    $ voodooc hello.voo
    $ cc hello.o -o hello
    $ ./hello
    Hello, world!


    An implementation of hello.voo can be found in the directory test of the distribution.

    The second way to use the Voodoo compiler is by using it from a Ruby program. This can be used, for example, to generate code for the target platform without having to create a .voo file. The following is an example which creates an object file called fact.o, containing a definition of a function fact which computes factorials:

    require 'voodoo'

    generator = Voodoo::CodeGenerator.get_generator :architecture => :i386,
     :format => :elf

    generator.export :fact
    generator.add_function_label :fact
    generator.add_function [:n],
     [:ifle, [:n, 1],
     # then
     [[:return, 1]],
     # else
     [[:let, :x, :sub, :n, 1],
     [:set, :x, :call, :fact, :x],
     [:return, :mul, :n, :x]]]


    File.open('fact.o', 'w') { |outfile| generator.write outfile }

    The Voodoo compiler API that is a available to Ruby programs is described in the API documentation.


    Product's homepage

    What's New in This Release: [ read full changelog ]

    · This version adds a number of improvements to the parser, which now reports source code locations for all errors and can report multiple errors inside blocks, functions, and conditionals. Several tests for the parser have been added.
    · This release fixes a parse error on statements followed by comments and a problem which caused the parser to fail on empty input.

      


    TAGS:

    programming language | low-level programming | Voodoo | programming | compiler



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM