Hi,

I've been working on a real scripting language for GRUB.  This mail
explains my goals, and the implementation design I've got so far.

* I want a real, object-oriented programming language so that we can
write new functionality much more easily than in C.

* Safety, clarity, and correctness are much more important than speed,
so that we avoid hardware damage.

* The full power of the language should be available at the GRUB
command prompt.

* The language should be syntax-independant.  I see no reason to
dictate one syntax over another.

* There must be a simple foreign function interface to C and assembler
(there should be a way to call interrupts from inside the scripting
language so that we don't need any handwritten assembly code).

* It is necessary that this language can stand on its own.  It must
not have any dependencies on another language (such as C), aside from
an initial bootstrap period.  It must be possible to do everything
from inside the language, especially defining new objects.

* Compilation must be supported so that functions can be optimized
without having to use C.

* It must be embeddable, so that people can use it in existing
applications without requiring them to rewrite everything.

My initial implementation idea was to try building a stripped-down
version of Guile, then writing reader functions for the legacy GRUB
configuration language, and a new Bash-like syntax (as well as the
native Scheme syntax).

This fell through when I looked at the code, and saw that the core of
Guile is actually pretty big, and depends on a lot of libc.  I don't
want to implement so many stubs, especially when it is clear that we
don't really need all that overhead for our little project.

Also, I tried to use Guile as the basis for GUSH, but was not happy
with the fact that you need to write C in order to accomplish anything
useful or efficient.

So, I've started writing a dynamic object system called GO (GRUB
Objects, later GUSH Objects, or maybe GNU Objects).  It is designed to
be syntax-independent, and suitable for implementing any kind of
language syntax.

GO will support explicit deallocation as well as several different
garbage collectors, choosable at both compile time and run time.  GO's
primary influency is RScheme (http://www.rscheme.org/), except GO is
GPLed, and won't really be Scheme (although Scheme will be one of the
language syntaxes that it supports).

My intention is to keep GO's core tiny enough that it can be used for
GRUB, and to provide compilation features so that we can eventually
use it exclusively (no more C or asm).

I intend to implement GUSH (the GNU User's Shell) using GO, too.  I
think that these two different applications will put enough pressure
on GO to make it useful in a variety of environments.  I also have
plans for a full-blown application I want to write, but they are not
ready to be discussed yet.

So, consider this a declaration of intent.  Please don't make plans to
redesign GRUB's scripting system unless you talk to me first, because
I have ideas that I'm working on.  I welcome any comments you might
have.

-- 
 Gordon Matzigkeit <[EMAIL PROTECTED]>  //\ I'm a FIG (http://www.fig.org/)
Committed to freedom and diversity \// I use GNU (http://www.gnu.org/)

Reply via email to