A few days ago, I informed you all that I had released version 0.3.0 of
my Voodoo compiler, and that I would be working on a code generator for
AMD64. Well, that work is done, and Voodoo Compiler v0.4.0 has been
released. You can read more about it and download it at
http://voodoo-compiler.sourceforge.net/
I have also added a few test cases with the aim of covering the entire
Voodoo language (described at http://inglorion.net/documents/designs/voodoo/).
These have uncovered a few bugs, which, of course, have been fixed.
Now that Voodoo actually supports multiple target architectures with different
word sizes, I think the language has proven itself useful for the purpose it
was designed for: to simplify native code generation by providing a thin
abstraction over the various instruction sets. The next step is to create
programming language implementations that actually use Voodoo!
As always, I am looking forward to your comments and questions. I think
the next step for the Voodoo compiler is to think about what features should
be in the 1.0.0 release, so if any of you have ideas on that front, I would
love to hear them. Also, of course, I would be honored if any of you would
use Voodoo in your own work.
Kind regards,
Bob
--
A policeman pulls Werner Heisenberg over on the Autobahn for speeding.
Policeman: Sir, do you know how fast you were going?
Heisenberg: No, but I know exactly where I am.
I'm glad you're still working on it, something simple compared to llvm would be
nice. I just tried it, but after I sudo install I get:
> voodooc hello.voo
sh: Illegal option -
Any ideas?
Mike
On Thu, Nov 05, 2009 at 12:41:56AM -0800, Mike Austin wrote:
> >
> >released. You can read more about it and download it at
> >http://voodoo-compiler.sourceforge.net/
>
> I'm glad you're still working on it, something simple compared to
> llvm would be nice. I just tried it, but after I sudo install I
> get:
>
> > voodooc hello.voo
> sh: Illegal option -
>
> Any ideas?
First of all, thank you for trying Voodoo!
As for the issue you are experiencing, nothing immediately jumps out at me as
being the likely problem. Perhaps you could email me some additional
information. Some things that may be useful to know are:
- What kind of system are you running this on
(operating system, instruction set)?
- Do you have NASM or YASM installed? (http://www.nasm.us/ and
http://www.tortall.net/projects/yasm/, respectively)
- What ouput does configure (in the Voodoo tarball) give you when you
run it?
- What version of Ruby do you have installed?
- What are the contents of your voodoo/config.rb (by default, installed to
/usr/local/lib/site_ruby/voodoo/config.rb)?
- If you run "voodooc -f nasm hello.voo", do you get the same error?
I am looking forward to hearing from you and I hope we can make voodooc
work for you!
Kind regards,
Bob
--
``Those who forget history are doomed to repeat it.''
Oops, I grabbed nasm after I ran configure. I just ran configure and make
again and it's working fine. I'll play with it more over the weekend. I tried
voodoo about a year ago (?) and remember talking to you. I probably asked if
it's possible to write continuations or coroutines in voodoo :) I think that
is too low level, right?
Mike
A probable use of voodoo for me would be writing low level dispatching
code for my interpreter, or coroutines if that is possible. I really
like the simplicity of voodoo, but I'm wondering what it can do that C
can't? Tail recursion can be emulated in C, and C code is highly
optimized and portable. If it had access to stack pointers and was a
bit more low level, I feel you could do more with it.
Regards,
Mike
In answering your post, I had written a long post that I realized
is more of a status report on Voodoo than an actual answer to yours.
To address your points:
On Tue, Nov 10, 2009 at 03:54:03PM -0800, Mike Austin wrote:
>
> A probable use of voodoo for me would be writing low level dispatching
> code for my interpreter, or coroutines if that is possible.
I think that would definitely be a good use for Voodoo. If you decide to
go that way, please keep me posted on your progress and experiences. If
you run into any difficulties, perhaps we can use those to identify weaknesses
in Voodoo and improve it.
> I really like the simplicity of voodoo, but I'm wondering what it can
> do that C can't? Tail recursion can be emulated in C, and C code is highly
> optimized and portable.
That's a good point. There is a more elaborate answer in my other post, but
this is what it boils down to:
It is not so much a question of what is and isn't possible as it is a
matter of cost. You say "C code is highly optimized and portable". It is
portable, yes, but it is highly optimized only if you use an optimizing
compiler. Those tend to be rather heavyweight. Also, to get tail recursion,
you either have to use a compiler that implements it (C certainly doesn't
mandate it), or you have to implement it as a kludge, either sacrificing
performance or writing your program in a very un-C-like fashion.
With Voodoo, you get tail calls as part of the language specification, and
you don't need a heavy C compiler.
I wish I could say "with Voodoo, you can have on-the-fly native code
generation and execution in just a few hundred KB", but the current
implementation doesn't do that, even if that is what I hope to achieve.
> If it had access to stack pointers and was a
> bit more low level, I feel you could do more with it.
I agree. In fact, early designs of Voodoo did have pointers to local
variables. However, this causes portability issues. On i386 using the
System V ABI, function arguments and local variables are kept on the stack,
and you can have pointers to them. On MIPS, however, function arguments
and local variables are in registers, which don't have addresses. Figuring
a lot of useful programs can be written without access to the stack, I
have dropped such features for now. However, I am certainly open to
suggestions for improvement, especially if you have a good idea about how
to implement them!
Regards,
Bob
--
The only thing you know for sure is that you never know anything for sure.