views:

180

answers:

3

I'm currently using Eiffel (SmartEiffel/ISE Eiffel) which is compiling to c.

I found it much easier to extend the language yourself with new features or tool support if the output is going into the portable assember language also known as C.

Which general purpose, non functional language have this feature too.

I know that there have been outdated C++ precompilers and i even found an old one for Objective-C.

(I also heared about ((Scheme and Lisp) compilers) but i don't like this (language)).

Please list only FOSS (free open source) projects, as i need to study them.

+2  A: 

Vala, a language similar to C# which is part of the Gnome project.

Bastien Léonard
+4  A: 

Well, there are some caveats dealing with things like exceptions and floating point numbers, but llvm can output C (though no one uses it in production so it often lags the main release). That means any LLVM based language that can be statically compiled can output to C, including all llvm-gcc frontends:

Not all of these have necessarily been tested, and may require some tweaking to make work, but they should all work without too much trouble.

Louis Gerbarg
Well i try to get away from the giant project LLVM (does not install and work easily on Windows) and gcc backend. So this are not really options for me.
Lothar
+1  A: 

Fortran (http://en.wikipedia.org/wiki/F2c) COBOL (http://sourceforge.net/projects/open-cobol/) Perl (http://www.xav.com/perl/lib/B/C.html) Matlab

I once knew a guy who wanted to study how to write a parser, but did not want to bother with code generation at that point. So, he got his parser to print out simple statements, expressions and gotos in C. So, that would be a C compiler that compiles to C (albeit very bad C) :-)

Gautham Ganapathy
There was also a guy that wanted to write an OO language who took the same approach - you wouldn't believe the trouble it caused.
Martin Beckett