[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GNU and Lisp
From: |
Jose E. Marchesi |
Subject: |
GNU and Lisp |
Date: |
Thu, 4 Aug 2005 15:58:55 +0200 |
Hi all.
"Both C and Lisp will be available as system programming
languages." - The GNU Manifesto
* Statement of work.
Lisp is a high level language.
Lisp is also a quite good language for write system scripts and even
complex system software such as initialization systems and package
managers. I also find it vastly superior to other system scripting
languages such as sh or perl.
Well... would be nice if we could write in lisp as many as possible
pieces of the GNU operating system.
But what lisp implementation should we use?
There are two lisp implementations on the GNU project:
a) Emacs (Emacs Lisp)
b) Guile (Scheme)
Of the two, Emacs is clearly not convenient for be used as a general
purpose interpreter.
Guile, on the other hand, offer a pretty nice scheme implementation,
is extremely extensible and provides many advanced facilities.
So the best option would be to use Guile, i think.
What would should be done?
You can actually do system programming using Guile on unix systems and
GNU/Linux: Guile has wrappers for accesing the POSIX facilities
exported by glibc.
Of course, due to Hurd's special capabilities, the GNU operating
system is more than POSIX. So Guile should be extended in order to
support hurdish features. That means wrappers for Hurd libraries such
as trivfs, iohelp, libports, etc.
In that way, scheme scripts could translate inodes of the filesystem
by installing the guile binary with `settrans'.
* Extending Guile for Hurd coverage.
Guile support two complementary but separate notions for extension
writing:
- Extension binary libraries (wrapper libraries), that are regular
shared libraries compiled from C, exporting functions and data
types (really value types on lisp) to the scheme side.
- Modules, written using Scheme.
A guile program can request the loading of a given module by calling
the `use-modules' function. In turn, a module can load binaries with
compiled extensions at runtime.
So the work consist on write wrapper libraries in C for cover the hurd
API, including trivfs, netfs, and so.
The proposed architecture for the extension follows:
- A wrapper library should be written for each Hurd library:
libguile-trivfs.so
libguile-ipcports.so
...
Note that, due the difference in semantics between C and scheme, the
wrapping cannot be "literal" (to exactly wrap each data type and
function) but an adaptation to scheme semantics should be done.
- A scheme module should be written for each of the extensions, plus
a general module `gnu' for load all the GNU-specific extensions:
gnu-trivfs.scm
gnu-ipcports.scm
...
gnu.scm
The dependencies between different extensions (for example, trivfs
needs libports) would be managed on the modules and not on the
extensions.
* Work in progress
By now i have written the foundation gnu.scm module and just started
the libports extension. I will request help to this mailing list in
order to determine how several semantics should be exported to the
scheme side.
What do you think about this project? Any idea?
--
José E. Marchesi <address@hidden>
<address@hidden>
GNU España http://es.gnu.org
GNU No es Unix! http://www.gnu.org
- GNU and Lisp,
Jose E. Marchesi <=
Re: GNU and Lisp, Richard M. Stallman, 2005/08/05
Re: GNU and Lisp, Luis F. Araujo, 2005/08/04