[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [epsilon-devel] Questions
From: |
amz3 |
Subject: |
Re: [epsilon-devel] Questions |
Date: |
Mon, 30 Dec 2013 06:51:28 +0100 |
User-agent: |
Roundcube Webmail/0.9.5 |
Sorry in advance for this long mail, but I think it very crucial to have
a clear overview of what epsilon is and in particular epsilon0.
You pretty much nail down epsilon1 in the tutorial
(http://ageinghacker.net/blog/posts/17/#Top) and it's good. But as much
as it's important to document epsilon1, it's important to also document
epsilon0 with plain english. From the discussion we had, I think you
really want to go forward implementing new personalities on top of
epsilon1 (or is it something else?), it is normal and it is the way
forward, but other peoples, just like me, will want to understand how
epsilon is made, why it works, how it works... and not only through
code.
Sorry, again, I just would like to prevent any mis-interpretation of my
attitude and stress the fact that I'm not patronizing you or something,
I'm only documenting my work on epsilon (and asking for some help)
trying to be useful and if you don't feel like answering or find
something not interesting/useful/whatever just say so. Thanks :-)
Sadly, I'm pretty much new to language creation and not very literate in
Lisp/Scheme/Guile so I may mis-use some terms. E.g. I know what is a
lisp/scheme macro, but I can't write one myself.
Questions and requests are at the end.
On 2013-12-30 02:56, Luca Saiu wrote:
On 2013-12-29 at 23:02, address@hidden wrote:
Where buffer:make is defined in
the final implementation of epsilon?
The real definition of buffer:make is in C; it could be an assembly
wrapper instead, but however still out of epsilon0. This is what a
primitive is: just like a procedure, but implemented out of epsilon at
a
lower level.
So, if I understand correctly primitives are the primary forms?
functions? operations? datums? provided by epsilon0 (language) upon
which epsilon1 is built.
As of current bzr repository revision 239, epislon bootstraped from
Guile (http://bzr.savannah.gnu.org/lh/epsilon/trunk/revision/239), they
are defined in four places:
- runtime/c-primitives.c
- bootstrap/scheme/epsilon0-in-scheme.scm
- bootstrap/scheme/unexec.e
- bootstrap/scheme/core.e
Primitives written in C are the following
(http://bzr.savannah.gnu.org/lh/epsilon/trunk/annotate/head:/runtime/c-primitives.c#L415):
- whatever:zero
- whatever:eq?
- buffer:make
- buffer:make-uninitialized
- buffer:destroy
- buffer:get
- buffer:set!
- buffer:initialize!
- buffer:length
- fixnum:1-
- fixnum:1+
- fixnum:<
- fixnum:<=
- fixnum:negate
- fixnum:+
- fixnum:-
- fixnum:*
- fixnum:/
- fixnum:%
- fixnum:bitwise-not
- fixnum:bitwise-and
- fixnum:bitwise-or
- fixnum:bitwise-xor
- fixnum:left-shift
- fixnum:right-shift
- gc:disable!
- gc:reenable!
- whatever:atom?
- whatever:buffer?
- whatever:thread
- whatever:duplicate
- whatever:swap
- whatever:make-zero
- whatever:marshal-to-open-file
- whatever:unmarshal-from-open-file
- io:standard-input
- io:standard-output
- io:standard-error
- io:open-file
- io:close-file
- io:eof?
- io:read-character
- io:write-character
- io:read-32-bit-big-endian
- io:write-32-bit-big-endian
- io:read-sexpression
- io:write-value
- primitive:get-index
- primitive:call-in-c
- debug:dump
- debug:fail
- state:update-globals-and-procedures!
- e0:eval-in-c
Primitives written in Guile in epsilon0-in-scheme.scm are the following
(http://bzr.savannah.gnu.org/lh/epsilon/trunk/annotate/head:/bootstrap/scheme/epsilon0-in-scheme.scm):
- e0:value
- e0:the-empty-list
- e0:unspecified
- e0:if-in
- e0:if-in_
- e0:bundle
- e0:let
- e0:primitive
- e0:call
- e0:call-indirect
- e0:join
Things that I think are primitives in unexec.e
(http://bzr.savannah.gnu.org/lh/epsilon/trunk/annotate/head:/bootstrap/scheme/unexec.e):
- unexec:exec
Some primitives seem to be defined only in core.e which I think is
epsilon in epsilon itself
(http://bzr.savannah.gnu.org/lh/epsilon/trunk/annotate/head:/bootstrap/scheme/core.e#L33):
- e0:fork
- e0:fork*
- future:fork-procedure
- future:asynchronously-call-closure
Other e0:* procedures/macros that I found:
- e0:call-indirect
- e0:call0
This is more than what I *found by parsing* the thesis
(http://ageinghacker.net/blog/posts/17/#My-PhD-thesis):
Chapter 2: The core language of epsilon0 > Section 2.2: Syntax
- let
- call
- primitive
- if
- fork
- join
- bundle
Chapter 3: Reflection and self-modification > Section 3.2: Global
definitions
- state:global-set!
- state:global-get
- state:global-names
- state:procedure-set!
- state:procedure-names
- state:procedure-get-formals
- state:procedure-get-body
Chapter 3: Reflection and self-modification > Section 3.3: unexec
- unexec
Request: Can you add, strike with a comment things that are not
primitives and comment if you find it important (maybe it's documented I
did not pay attention yet). Can you mark anything not essential, I mean
not part of epsilon0, as such.
Questions:
0) Do you agree to call epsilon a language (creation?) framework?
I) Why some of the above primitives are not discussed in the thesis?
II) In the thesis, you say that compilation works like unexec, can you
expand a bit?
III) It seems to me, that all the above should start with e0:, isn't it?
IV) When an epsilon program is unexec, it's sealed somehow, it is
described in the thesis, what is required to be able run it (except the
code required to unmarshal the dump)?
V) As of yet, epsilon0 is written in Guile and Guile extensions written
in C. It's possible in theory to provide a epsilon0.so against which
bindings of some languages can be created and upon which new languages
can be created, is it correct?
VI) Does the following diagram describe correctly the current state of
epsilon:
[guile] [pritimives-c]
\ /
[epsilon0]
|
[epsilon1]
|
[epsilon0 in epsilon][**]
[**] this part is unexec when (load "bootstrap.scm") is called from
guile+whatever prompt.
After that when one use (load "quick-start.scm") from guile+whatever
prompt, the diagram of the executing epsilon is:
[guile parser] [**]
\ /
[epsilon]
Thanks in advance,
All links of this mail in no specific order:
- http://bzr.savannah.gnu.org/lh/epsilon/trunk/revision/239
-
http://bzr.savannah.gnu.org/lh/epsilon/trunk/annotate/head:/runtime/c-primitives.c#L415
-
http://bzr.savannah.gnu.org/lh/epsilon/trunk/annotate/head:/bootstrap/scheme/epsilon0-in-scheme.scm
-
http://bzr.savannah.gnu.org/lh/epsilon/trunk/annotate/head:/bootstrap/scheme/unexec.e
- http://ageinghacker.net/blog/posts/17/#My-PhD-thesis
-
http://bzr.savannah.gnu.org/lh/epsilon/trunk/annotate/head:/bootstrap/scheme/core.e#L33