Re: What's lacking: a good intermediate form

Robbert Haarman <comp.lang.misc@inglorion.net>
Wed, 4 Mar 2009 09:26:18 +0100

          From comp.compilers

Related articles
[13 earlier articles]
Re: What's lacking: a good intermediate form cr88192@hotmail.com (cr88192) (2009-03-01)
Re: What's lacking: a good intermediate form max@gustavus.edu (Max Hailperin) (2009-03-02)
Re: What's lacking: a good intermediate form cr88192@hotmail.com (cr88192) (2009-03-03)
Re: What's lacking: a good intermediate form james.harris.1@googlemail.com (James Harris) (2009-03-02)
Re: What's lacking: a good intermediate form walter@bytecraft.com (Walter Banks) (2009-03-03)
Re: What's lacking: a good intermediate form tony@my.net (Tony) (2009-03-03)
Re: What's lacking: a good intermediate form comp.lang.misc@inglorion.net (Robbert Haarman) (2009-03-04)
Re: What's lacking: a good intermediate form max@gustavus.edu (Max Hailperin) (2009-03-05)
Re: What's lacking: a good intermediate form tony@my.net (Tony) (2009-03-05)
Re: What's lacking: a good intermediate form pertti.kellomaki@tut.fi (Pertti Kellomaki) (2009-03-06)
Re: What's lacking: a good intermediate form jon@ffconsultancy.com (Jon Harrop) (2009-03-06)
Re: What's lacking: a good intermediate form bartc@freeuk.com (Bartc) (2009-03-06)
Re: What's lacking: a good intermediate form comp.lang.misc@inglorion.net (Robbert Haarman) (2009-03-06)
[14 later articles]
| List of all articles for this month |

From: Robbert Haarman <comp.lang.misc@inglorion.net>
Newsgroups: comp.lang.misc,comp.compilers
Date: Wed, 4 Mar 2009 09:26:18 +0100
Organization: Wanadoo
References: 09-02-132 09-02-136 09-02-144 09-03-003 09-03-014 <fRhrl.13260$8_3.4266@flpi147.ffdc.sbc.com>
Keywords: design, UNCOL
Posted-Date: 05 Mar 2009 06:02:15 EST

Hello everybody,


[Cross-posting so that everybody who followed the original thread gets
the message too.]


I also feel that the world would benefit from a good common
intermediate language. In fact, I think it would be good to have a
number of them, at different levels and with different features. For
myself, and for everybody who is interested in using them, I am
developing at least two such languages.


The first is a low-level language, whose main goal is to allow
compilation to efficient machine code and otherwise get out of the
way. Development of this language is partially underway in Voodoo
(http://inglorion.net/documents/designs/voodoo/).


Voodoo abstracts away most of the differences between instruction sets
and calling conventions, but otherwise stays close to machine
code. The idea is that this allows anything that can be expressed
efficiently in native machine code to be expressed efficiently in
Voodoo, but expressing it in Voodoo will have the benefit that the
same code can be compiled to native code for a number of hardware
architectures and operating systems.


The second intermediate language I am thinking to develop is at a much
higher level. While I still aim to make this language as flexible as
possible, the main goal of this language is type-safety. Among other
things, this means programs in this language will be free of buffer
overflows and other memory access errors.


Besides being a desireable property in itself, the type-safety also
means that a program can use only the functionality it explicitly
mentions. For example, a program that does not mention the file I/O
module will not be calling any functions to access files - at most, it
may access files in a controlled way through some other API. This
allows the creation of various restricted environments by allowing
programs to use only specific modules. For example, a profile could be
defined for programs that are allowed to run in a web browser, where
things like drawing graphics are allowed, but accessing arbitrary
files isn't.


Both of these intermediate languages are goals in and of themselves.
Basically, they are meant to be tools for programming language
implementers. I see many great programming language projects, but many
languages have sub-obtimal implementations, and this limits the
applicability of the programming language. For example, many promising
languages start out with an interpreter which is so slow that it
limits the cases where the programming language can be used. By
providing tools, I hope to make it easier to implement programming
languages and to create fast implementations of programming languages,
so that languages won't be as limited by the implementation, and more
effort can be spent on language design and libraries than on language
implementation.


The intermediate languages are also part of a larger programming
language project. This programming language is called Mana, and I have
been thinking about it for many years already, coming up with new ideas
and thinking about how I can include those in the language and whether I
should do that now or start actually implementing something. The
original idea was to create a language that would be terse enough and
syntactically clean enough to be used interactively (a la the Unix
shell), yet offer the features necessary to allow large projects to be
built in it (in particular, a powerful type system and an extensive
standard library). Other features include security (type safety and
libraries that make writing secure code easy (e.g. handling escaping
when interfacing to shells and databases)), macros (a la Lisp),
automatic resource management (think garbage collection, but for more
than just memory), and parallelism (automatic in some places, with
features to control it).


Well, that's quite enough text for now. Apologies if I got carried away
a bit too much, these were some things I have been meaning to write down
for a long time. For those interested: the Voodoo language page is at
http://inglorion.net/documents/designs/voodoo/, and some
not-really-up-to-date writing about Mana is at
http://inglorion.net/documents/designs/mana/.


Regards,


Bob


--
#include <stdio.h>
#define SIX 1 + 5
#define NINE 8 + 1
int main(int argc, char **argv) {
return printf("When you multiply SIX by NINE, you get %d\n",
SIX * NINE);
}


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.