From: Allan Adler
Subject: disassemble in clisp
Date: 
Message-ID: <y93fywwwi9t.fsf@nestle.csail.mit.edu>
In clisp, one can disassemble something with the command

(disassemble #'something)

and get an interesting printout of what looks like assembly code.
Where is this "lisp assembly code" documented and, if one wanted to
visualize an idealized machine it was running on, where would one
find a description of that machine?
-- 
Ignorantly,
Allan Adler <···@zurich.csail.mit.edu>
* Disclaimer: I am a guest and *not* a member of the MIT CSAIL. My actions and
* comments do not reflect in any way on MIT. Also, I am nowhere near Boston.

From: Patrick Frankenberger
Subject: Re: disassemble in clisp
Date: 
Message-ID: <d5nusk$fql$01$1@news.t-online.com>
Allan Adler schrieb:
> In clisp, one can disassemble something with the command
> 
> (disassemble #'something)
> 
> and get an interesting printout of what looks like assembly code.
> Where is this "lisp assembly code" documented and, if one wanted to
> visualize an idealized machine it was running on, where would one
> find a description of that machine?

clisp uses a vm that is documented at 
http://clisp.cons.org/impnotes/bytecode.html

Other lisp implementations compile to native code. disassemble shows 
"real" CPU assembly code there.

HTH,
Patrick
From: Pascal Bourguignon
Subject: Re: disassemble in clisp
Date: 
Message-ID: <87hdhcv1lf.fsf@thalassa.informatimago.com>
Patrick Frankenberger <···············@gmx.net> writes:

> Allan Adler schrieb:
>> In clisp, one can disassemble something with the command
>> (disassemble #'something)
>> and get an interesting printout of what looks like assembly code.
>> Where is this "lisp assembly code" documented and, if one wanted to
>> visualize an idealized machine it was running on, where would one
>> find a description of that machine?
>
> clisp uses a vm that is documented at
> http://clisp.cons.org/impnotes/bytecode.html
>
> Other lisp implementations compile to native code. disassemble shows
> "real" CPU assembly code there.

Just to note that clisp uses native code too:

[290]> (disassemble (function nreverse))
0x4018d477 in ?? ()
0x80e2b90 <C_reverse>:	mov    %ebx,%eax
0x80e2b92 <C_reverse+2>:	and    $0x7,%eax
0x80e2b95 <C_reverse+5>:	add    $0x10,%esp
0x80e2b98 <C_reverse+8>:	cmp    $0x6,%eax
0x80e2b9b <C_reverse+11>:	mov    %ecx,%edx
0x80e2b9d <C_reverse+13>:	mov    %ecx,0x81ddf1c
0x80e2ba3 <C_reverse+19>:	jne    0x80e2bc0 <C_reverse+48>
0x80e2ba5 <C_reverse+21>:	mov    0x2(%ebx),%al
0x80e2ba8 <C_reverse+24>:	dec    %eax
0x80e2ba9 <C_reverse+25>:	cmp    $0x17,%al
0x80e2bab <C_reverse+27>:	jbe    0x80e2d79 <C_reverse+489>
0x80e2bb1 <C_reverse+33>:	jmp    0x80e2bc0 <C_reverse+48>
[...]
NIL

[291]> (disassemble (lambda (f) (lambda (x) (dotimes (i 42 x) 
                                              (setf x (funcall f x))))))

Disassembly of function :LAMBDA
(CONST 0) = #<COMPILED-FUNCTION :LAMBDA-1>
1 required argument
0 optional arguments
No rest parameter
No keyword parameters
6 byte-code instructions:
0     (NIL)
1     (MAKE-VECTOR1&PUSH 1)
3     (LOAD&STOREC 2 0 0)
7     (LOAD&PUSH 0)
8     (COPY-CLOSURE 0 1)                  ; #<COMPILED-FUNCTION :LAMBDA-1>
11    (SKIP&RET 3)
NIL
[292]> 


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Small brave carnivores
Kill pine cones and mosquitoes
Fear vacuum cleaner
From: Charles Shannon Hendrix
Subject: Re: disassemble in clisp
Date: 
Message-ID: <b62j6d.drn.ln@escape.goid.lan>
On 2005-05-09, Pascal Bourguignon <···@informatimago.com> wrote:

> Just to note that clisp uses native code too:
>
> [290]> (disassemble (function nreverse))
> 0x4018d477 in ?? ()
[snip]

I get an error on that function, or any other:

    No function contains specified address.

Is this because of how I built clisp or is my package actually broken
somewhere?


-- 
shannon "AT" widomaker.com -- ["All of us get lost in the darkness,
dreamers turn to look at the stars" -- Rush ]

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
From: Sam Steingold
Subject: Re: disassemble in clisp
Date: 
Message-ID: <uis1estvy.fsf@gnu.org>
> * Charles Shannon Hendrix <·······@arjf.jvqbznxre.pbz> [2005-05-19 17:58:35 -0400]:
>
> On 2005-05-09, Pascal Bourguignon <···@informatimago.com> wrote:
>
>> Just to note that clisp uses native code too:
>>
>> [290]> (disassemble (function nreverse))
>> 0x4018d477 in ?? ()
> [snip]
>
> I get an error on that function, or any other:
>
>     No function contains specified address.
>
> Is this because of how I built clisp or is my package actually broken
> somewhere?

did you strip your clisp executable?

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.honestreporting.com> <http://www.camera.org>
<http://www.openvotingconsortium.org/> <http://pmw.org.il/> <http://ffii.org/>
There are 10 kinds of people: those who count in binary and those who do not.
From: Allan Adler
Subject: Re: disassemble in clisp
Date: 
Message-ID: <y933bsvpqlw.fsf@nestle.csail.mit.edu>
Thanks for answering my question about the lisp assembly language. Now I'd
like to ask about reversing the process.

Patrick Frankenberger <···············@gmx.net> writes:

> clisp uses a vm that is documented at 
> http://clisp.cons.org/impnotes/bytecode.html

Suppose someone wanted to experience the thrill of writing a program in
this lisp assembly language and having clisp execute it. How would they
tell clisp about it and get clisp to execute it?

> Other lisp implementations compile to native code. disassemble shows 
> "real" CPU assembly code there.

Pascal Bourguignon pointed out that the example of nreverse shows sometimes
one gets real CPU assembly code in clisp. Am I correct in thinking that, even
if one can do what I asked for above, one can't get clisp to execute something
written in real CPU assembly code?
-- 
Ignorantly,
Allan Adler <···@zurich.csail.mit.edu>
* Disclaimer: I am a guest and *not* a member of the MIT CSAIL. My actions and
* comments do not reflect in any way on MIT. Also, I am nowhere near Boston.
From: Pascal Bourguignon
Subject: Re: disassemble in clisp
Date: 
Message-ID: <87zmv3ts0r.fsf@thalassa.informatimago.com>
Allan Adler <···@nestle.csail.mit.edu> writes:

> Thanks for answering my question about the lisp assembly language. Now I'd
> like to ask about reversing the process.
>
> Patrick Frankenberger <···············@gmx.net> writes:
>
>> clisp uses a vm that is documented at 
>> http://clisp.cons.org/impnotes/bytecode.html
>
> Suppose someone wanted to experience the thrill of writing a program in
> this lisp assembly language and having clisp execute it. How would they
> tell clisp about it and get clisp to execute it?

The best source is the compiler.lisp file in clisp sources.  There's
stuff internal to the SYSTEM packages that should allow to do it.

>> Other lisp implementations compile to native code. disassemble shows 
>> "real" CPU assembly code there.
>
> Pascal Bourguignon pointed out that the example of nreverse shows sometimes
> one gets real CPU assembly code in clisp. 

I should precise that what is in native code in clisp is the primitive
functions that are written in C (or some very few in assembler) in the
clisp sources, or external libraries or modules.  The only compiler
provided by clisp compiles to byte-codes.


> Am I correct in thinking that, even
> if one can do what I asked for above, one can't get clisp to execute something
> written in real CPU assembly code?

There's at least two ways to do it.

- generate your native code into a shared library file, then
- define the FFI to the functions in this new shared library file, and
- invoke them, which will load the shared library file and execute the 
  generated native code.

In the newest clisp, there's now a function to unload a shared library
so you'll be able to "update" this code.

An other way would be with the help of a small C stub, which would
allow you to generate the native code in memory and to JSR to it
without going to the file system.  With clisp FFI one can copy a lisp
vector of (unsigned-byte 8) to a malloced memory block (important to
avoid the native code moved by the garbage collector), and then put
the following in a shared library or a clisp module:

typedef int (*function_t)(void*);
int call(function_t function,void* arguments){ return(function(arguments)); }

and in lisp:

(ffi:def-call-out call
        (:name "call")
        (:arguments (function ffi:c-pointer) (arguments ffi:c-pointer))
        (:result-type (ffi:int))
        (:library "libcall.so"))

(defparameter *nc-fun1* (compile-to-native-code 'fun1))
(print (call *nc-fun1* nil))


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Grace personified,
I leap into the window.
I meant to do that.
From: Sam Steingold
Subject: Re: disassemble in clisp
Date: 
Message-ID: <uu0lbf0q5.fsf@gnu.org>
> * Allan Adler <···@arfgyr.pfnvy.zvg.rqh> [2005-05-10 02:00:43 -0400]:
>
> Suppose someone wanted to experience the thrill of writing a program in
> this lisp assembly language and having clisp execute it. How would they
> tell clisp about it and get clisp to execute it?

see clisp/modules/clx/new-clx.f in your CLISP source distribution.

more seriously, there have been talk about compiling CLISP bytecodes to
C or, alternatively, using libjit.
if you are interested in contributing to these projects,
please subscribe to clisp-devel and speak up there.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.memri.org/> <http://www.iris.org.il> <http://ffii.org/>
<http://www.jihadwatch.org/> <http://www.mideasttruth.com/>
If brute force does not work, you are not using enough.
From: Pascal Bourguignon
Subject: Re: disassemble in clisp
Date: 
Message-ID: <87u0lbexy1.fsf@thalassa.informatimago.com>
Sam Steingold <···@gnu.org> writes:

Sam Steingold <···@gnu.org> writes:

>> * Allan Adler <···@arfgyr.pfnvy.zvg.rqh> [2005-05-10 02:00:43 -0400]:
>>
>> Suppose someone wanted to experience the thrill of writing a program in
>> this lisp assembly language and having clisp execute it. How would they
>> tell clisp about it and get clisp to execute it?
>
> see clisp/modules/clx/new-clx.f in your CLISP source distribution.

clisp/modules/clx/new-clx/clx.f  actually.

> more seriously, there have been talk about compiling CLISP bytecodes to
> C or, alternatively, using libjit.
> if you are interested in contributing to these projects,
> please subscribe to clisp-devel and speak up there.
>
> -- 
> Sam Steingold (http://www.podval.org/~sds) running w2k

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Until real software engineering is developed, the next best practice
is to develop with a dynamic system that has extreme late binding in
all aspects. The first system to really do this in an important way
is Lisp. -- Alan Kay
From: Sam Steingold
Subject: Re: disassemble in clisp
Date: 
Message-ID: <ubr7igbsg.fsf@gnu.org>
> * Pascal Bourguignon <···@vasbezngvzntb.pbz> [2005-05-10 20:29:58 +0200]:
>
> Sam Steingold <···@gnu.org> writes:
>
> Sam Steingold <···@gnu.org> writes:
>
>>> * Allan Adler <···@arfgyr.pfnvy.zvg.rqh> [2005-05-10 02:00:43 -0400]:
>>>
>>> Suppose someone wanted to experience the thrill of writing a program in
>>> this lisp assembly language and having clisp execute it. How would they
>>> tell clisp about it and get clisp to execute it?
>>
>> see clisp/modules/clx/new-clx.f in your CLISP source distribution.
> clisp/modules/clx/new-clx/clx.f  actually.

indeed...
search for "XLIB:CHANGE-POINTER-CONTROL"

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.iris.org.il> <http://www.memri.org/> <http://www.dhimmi.com/>
<http://pmw.org.il/> <http://ffii.org/> <http://www.mideasttruth.com/>
The only time you have too much fuel is when you're on fire.
From: Allan Adler
Subject: Re: disassemble in clisp
Date: 
Message-ID: <y9364xqjqe7.fsf@nestle.csail.mit.edu>
Sam Steingold <···@gnu.org> writes:
> indeed...
> search for "XLIB:CHANGE-POINTER-CONTROL"

Why does a file named clx.f, whose extension looks like that of a FORTRAN
file, have a syntax such as
  Bool do_accel = False;
  Bool do_threshold = False;
  int accel_numerator = -1;
  int accel_denominator = -1;
  int threshold = -1;
  Display *dpy;

  if (!eq (STACK_0, unbound) && !eq (STACK_0,NIL))
    {
 [...]

which looks like that of a C program, and function declarations such as
defun XLIB:CHANGE-POINTER-CONTROL (1, 0, norest, key, 2, (:ACCELERATION :THRESH
in which "defun" looks like LISP. I guess it must really be C and defun must
really be a defined type.
-- 
Ignorantly,
Allan Adler <···@zurich.csail.mit.edu>
* Disclaimer: I am a guest and *not* a member of the MIT CSAIL. My actions and
* comments do not reflect in any way on MIT. Also, I am nowhere near Boston.
From: Pascal Bourguignon
Subject: Re: disassemble in clisp
Date: 
Message-ID: <87oebifexp.fsf@thalassa.informatimago.com>
Allan Adler <···@nestle.csail.mit.edu> writes:
> Why does a file named clx.f, whose extension looks like that of a FORTRAN
> file, have a syntax such as [...]

http://www.podval.org/~sds/clisp/impnotes/source-files.html

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
You never feed me.
Perhaps I'll sleep on your face.
That will sure show you.
From: Sam Steingold
Subject: Re: disassemble in clisp
Date: 
Message-ID: <uekcdetmm.fsf@gnu.org>
> * Allan Adler <···@arfgyr.pfnvy.zvg.rqh> [2005-05-11 01:14:08 -0400]:
>
> Sam Steingold <···@gnu.org> writes:
>> indeed...
>> search for "XLIB:CHANGE-POINTER-CONTROL"
>
> Why does a file named clx.f, whose extension looks like that of a FORTRAN
> file, have a syntax such as
>   Bool do_accel = False;
>   Bool do_threshold = False;
>   int accel_numerator = -1;
>   int accel_denominator = -1;
>   int threshold = -1;
>   Display *dpy;
>
>   if (!eq (STACK_0, unbound) && !eq (STACK_0,NIL))
>     {
>  [...]
>
> which looks like that of a C program, and function declarations such
> as defun XLIB:CHANGE-POINTER-CONTROL (1, 0, norest, key, 2,
> (:ACCELERATION :THRESH in which "defun" looks like LISP. I guess it
> must really be C and defun must really be a defined type.

this is a C file extended by pre-processing with ccmp2c and modprep,
see <http://www.podval.org/~sds/clisp/impnotes/src-preprocessing.html>

it should be named clx.c, just like all the module C file are.
look at utils/modprep.lisp and, e.g., modules/syscalls/calls.c:
when you need to convert C symbolic constants, like S_ISUID, to CL
keywords, like :SUID, you would probably prefer to write

DEFCHECKER(check_chmod_mode, type=mode_t, reverse=UL_to_I,      \
           prefix=S_I, delim=, default=, bitmasks=both,         \
           SUID SGID SVTX RWXU RUSR WUSR XUSR RWXG RGRP         \
           WGRP XGRP RWXO ROTH WOTH XOTH)

instead of

static struct c_lisp_pair check_chmod_mode_table[] = {
 #ifdef S_ISUID
  { S_ISUID, &(O(object_Ksuid)) },
 #endif
 #ifdef S_ISGID
  { S_ISGID, &(O(object_Ksgid)) },
 #endif
 #ifdef S_ISVTX
  { S_ISVTX, &(O(object_Ksvtx)) },
 #endif
 #ifdef S_IRWXU
  { S_IRWXU, &(O(object_Krwxu)) },
 #endif
 #ifdef S_IRUSR
  { S_IRUSR, &(O(object_Krusr)) },
 #endif
 #ifdef S_IWUSR
  { S_IWUSR, &(O(object_Kwusr)) },
 #endif
 #ifdef S_IXUSR
  { S_IXUSR, &(O(object_Kxusr)) },
 #endif
 #ifdef S_IRWXG
  { S_IRWXG, &(O(object_Krwxg)) },
 #endif
 #ifdef S_IRGRP
  { S_IRGRP, &(O(object_Krgrp)) },
 #endif
 #ifdef S_IWGRP
  { S_IWGRP, &(O(object_Kwgrp)) },
 #endif
 #ifdef S_IXGRP
  { S_IXGRP, &(O(object_Kxgrp)) },
 #endif
 #ifdef S_IRWXO
  { S_IRWXO, &(O(object_Krwxo)) },
 #endif
 #ifdef S_IROTH
  { S_IROTH, &(O(object_Kroth)) },
 #endif
 #ifdef S_IWOTH
  { S_IWOTH, &(O(object_Kwoth)) },
 #endif
 #ifdef S_IXOTH
  { S_IXOTH, &(O(object_Kxoth)) },
 #endif
  { 0, NULL }
};
static const uintL check_chmod_mode_table_size
 = (sizeof(check_chmod_mode_table)/sizeof(struct c_lisp_pair))-1;
static mode_t check_chmod_mode (object a) {
  unsigned int index;
 restart_check_chmod_mode:
  if (integerp(a)) return (mode_t)I_to_L(a);
  else {
    for (index = 0; index < check_chmod_mode_table_size; index++)
      if (eq(a,*check_chmod_mode_table[index].l_const))
        return (mode_t)check_chmod_mode_table[index].c_const;
    pushSTACK(NIL); pushSTACK(a);
    pushSTACK(O(object___28or_2....h__29_29));
    pushSTACK(O(object___28or_2....h__29_29));
    pushSTACK(a); pushSTACK(TheSubr(subr_self)->name);
    check_value(type_error,GETTEXT("~S: ~S is not of type ~S"));
    a = value1; goto restart_check_chmod_mode;
  }
}
static object check_chmod_mode_reverse (mode_t a) {
  unsigned int index = 0;
  for (; index < check_chmod_mode_table_size; index++)
    if (a == check_chmod_mode_table[index].c_const)
      return *check_chmod_mode_table[index].l_const;
  return UL_to_I(a);
}
static object check_chmod_mode_to_list (mode_t a) {
  int count = 0;
  unsigned int index = 0;
  for (; index < check_chmod_mode_table_size; index++) {
    unsigned int c_const = check_chmod_mode_table[index].c_const;
    if (c_const == (a & c_const)) {
      pushSTACK(*check_chmod_mode_table[index].l_const);
      count++;
      a &= ~c_const;
    }
  }
  if (a) { pushSTACK(fixnum(a)); count++; }
  return listof(count);
}
static mode_t check_chmod_mode_from_list (object a) {
  mode_t ret = 0;
  pushSTACK(a);
  for (; !endp(STACK_0); STACK_0 = Cdr(STACK_0))
    ret |= check_chmod_mode(Car(STACK_0));
  skipSTACK(1);
  return ret;
}
static mode_t check_chmod_mode_parse (object a) {
  if (integerp(a)) return (mode_t)I_to_L(a);
  if (listp(a)) return check_chmod_mode_from_list(a);
  return check_chmod_mode(a);
}

(see build-dir/syscalls/calls.m.c)

the clx.f name is for historical reasons: originally it was passed
through 3 (!)  pre-processors: f->e->d->c.
now there are just 2 and, actually,
ccmp2c should be merged into modprep.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.jihadwatch.org/> <http://ffii.org/> <http://www.iris.org.il>
<http://www.openvotingconsortium.org/> <http://www.mideasttruth.com/>
Garbage In, Gospel Out
From: Pascal Bourguignon
Subject: Re: disassemble in clisp
Date: 
Message-ID: <87k6m6fc1g.fsf@thalassa.informatimago.com>
Sam Steingold <···@gnu.org> writes:

>> * Pascal Bourguignon <···@vasbezngvzntb.pbz> [2005-05-10 20:29:58 +0200]:
>>
>> Sam Steingold <···@gnu.org> writes:
>>
>> Sam Steingold <···@gnu.org> writes:
>>
>>>> * Allan Adler <···@arfgyr.pfnvy.zvg.rqh> [2005-05-10 02:00:43 -0400]:
>>>>
>>>> Suppose someone wanted to experience the thrill of writing a program in
>>>> this lisp assembly language and having clisp execute it. How would they
>>>> tell clisp about it and get clisp to execute it?
>>>
>>> see clisp/modules/clx/new-clx.f in your CLISP source distribution.
>> clisp/modules/clx/new-clx/clx.f  actually.
>
> indeed...
> search for "XLIB:CHANGE-POINTER-CONTROL"

Well I guess the OP had in mind rather something like:


(defun assemble (code)
  (flet ((closure-slot (obj num)
                       (if (sys::closurep obj)
                         (sys::%record-ref obj num)
                         nil)))
    (let* ((definition (symbol-function 'testam))
           (compiler::*compiling* t)
           (compiler::*error-count* 0)
           (compiler::*warning-count* 0)
           (compiler::*style-warning-count* 0)
           (compiler::*compiling-from-file* nil)
           (compiler::*c-listing-output* nil)
           (compiler::*fasoutput-stream* nil) ; compiled code may be called right away
           (compiler::*c-error-output* *error-output*)
           (compiler::*known-special-vars* '())
           (compiler::*constant-special-vars* '())
           (compiler::*func* nil)
           (compiler::*fenv* nil)
           (compiler::*benv* nil)
           (compiler::*genv* nil)
           (compiler::*venv* nil)
           (compiler::*venvc* nil)
           (compiler::*denv* compiler::*toplevel-denv*)
           (compiler::*no-code* nil))
      (let ((fnode
             (compiler::make-FNODE :NAME nil
                                   :CODE (compiler::make-anode
                                          :type 'compiler::lambdabody
                                          :seclass nil
                                          :code code)
                                   :ENCLOSING NIL :VENVCONST NIL :VENVC NIL

                                   :BLOCKS-OFFSET 0 :BLOCKS NIL
                                   :TAGBODYS-OFFSET 0 :TAGS NIL :TAGBODYS NIL
                                   :KEYWORD-OFFSET 0 :REQ-ANZ 0
                                   :OPT-ANZ 0 :REST-FLAG NIL :KEYWORD-FLAG NIL
                                   :KEYWORDS NIL :ALLOW-OTHER-KEYS-FLAG NIL
                                   :CONSTS-OFFSET 0  :CONSTS nil
                                   :CONSTS-FORMS NIL :CONSTS-LTV-FORMS NIL
                                   :GF-P NIL
                                   :FAR-USED-VARS NIL
                                   :FAR-ASSIGNED-VARS NIL
                                   :FAR-USED-BLOCKS NIL
                                   :FAR-USED-TAGBODYS NIL)))
        (let ((compiler::*fnode-fixup-table* '()))
          (compiler::pass2 fnode)
          (compiler::pass3)
          (compiler::fnode-code fnode))))))

(defun testasm () (print :hello))
(disassemble 'testasm)

Disassembly of function TESTASM
(CONST 0) = :A
0 required arguments
0 optional arguments
No rest parameter
No keyword parameters
4 byte-code instructions:
0     (CONST&PUSH 0)                      ; :A
1     (PUSH-UNBOUND 1)
3     (CALLS1 132)                        ; PRINT
5     (SKIP&RET 1)
NIL

[69]> (disassemble (assemble 
                  `((compiler::const ,(compiler::make-const :value :a))
                    (compiler::push) 
                    (compiler::push-unbound 1)
                    (compiler::funcall 132)
                    (compiler::ret))))

Disassembly of function NIL
(CONST 0) = :A
0 required arguments
0 optional arguments
No rest parameter
No keyword parameters
4 byte-code instructions:
0     (CONST&PUSH 0)                      ; :A
1     (PUSH-UNBOUND 1)
3     (FUNCALL 132)
6     (SKIP&RET 0)
NIL
[70]> (funcall (assemble 
                  `((compiler::const ,(compiler::make-const :value :a))
                    (compiler::push) 
                    (compiler::push-unbound 1)
                    (compiler::funcall 132)
                    (compiler::ret)))))

Process inferior-lisp segmentation fault


Of course, I'd need to understand what I'm doing to have it work, but
at least one can see from compiler::traverse-anode that the 2nd pass
doesn't accept the full documented byte-code, but a somewhat higher
level, undocumented, "assembler".  Disassemble lose some information.
And some syntactic sugar would be in order...


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Until real software engineering is developed, the next best practice
is to develop with a dynamic system that has extreme late binding in
all aspects. The first system to really do this in an important way
is Lisp. -- Alan Kay
From: Allan Adler
Subject: Re: disassemble in clisp
Date: 
Message-ID: <y931x8ejpgf.fsf@nestle.csail.mit.edu>
Sam Steingold <···@gnu.org> writes:

> see clisp/modules/clx/new-clx.f in your CLISP source distribution.

I just took a quick look. I've been writing a lot of programs in PostScript
because I have found it the most convenient way to do computations and also
display graphics associated with them without knowing much (of course,
convenience is somewhat subjective...). In this respect, it is the closest
thing I've found to GWBASIC on the old IBM PC's that will run on my system,
even if PostScript isn't really intended for it, including more recent
versions of BASIC. My impression of clx.f is that it lets you do this in
Lisp if you understand X programming well enough (I understand nothing).
Is that correct? If so, what do you have to know to use it that way?

Just to be more concrete, suppose I want to numerically evaluate a definite
integral whose integrand F(x,c)dx and limits of integration depend on the
parameter c, and then graph the integrand F(x,c) for all values of c for
which the integral turns out to be an integer in a certain interval. I can
and have done that in PostScript but if it is possible to do that with
Lisp by having Lisp manage some X windows, that would be good to know about.

> more seriously, there have been talk about compiling CLISP bytecodes to
> C or, alternatively, using libjit.
> if you are interested in contributing to these projects,
> please subscribe to clisp-devel and speak up there.

I'm singularly unqualified to contribute to these projects, even though the
work sounds interesting and even though I think it would be nice to know
how to do stuff like that. Also, I'm already pretty swamped with my own
projects. If I subscribed, I would probably just get in the way. Is there
some way to follow the discussions without investing a lot of effort and
without bothering people there to explain stuff to me?
-- 
Ignorantly,
Allan Adler <···@zurich.csail.mit.edu>
* Disclaimer: I am a guest and *not* a member of the MIT CSAIL. My actions and
* comments do not reflect in any way on MIT. Also, I am nowhere near Boston.
From: Sam Steingold
Subject: Re: disassemble in clisp
Date: 
Message-ID: <uk6m5euc7.fsf@gnu.org>
> * Allan Adler <···@arfgyr.pfnvy.zvg.rqh> [2005-05-11 01:34:24 -0400]:
>
> If I subscribed, I would probably just get in the way. Is there some
> way to follow the discussions without investing a lot of effort and
> without bothering people there to explain stuff to me?

you don't have to post to be subscribed :-)
it's the other way around - you do need to to be subscribed to post (to
this specific list).

you can also read it on gmane.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.iris.org.il> <http://www.camera.org> <http://www.jihadwatch.org/>
<http://www.openvotingconsortium.org/> <http://pmw.org.il/> <http://ffii.org/>
The only time you have too much fuel is when you're on fire.