From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Fren Zeee Newsgroups: gmane.emacs.help Subject: Re: What's the spec for emacs lisp virtual machine ? Date: Fri, 23 Jul 2010 09:03:51 -0700 (PDT) Organization: http://groups.google.com Message-ID: <61a26ed5-80eb-4175-b7c4-162a1ce21a59@e5g2000yqn.googlegroups.com> References: <87d3ueiokq.fsf@kuiper.lan.informatimago.com> <1de2313f-2646-437e-9305-a5e7a8bb22f9@k39g2000yqb.googlegroups.com> <777141d9-4f52-45bb-97d1-df33ca9af88a@c10g2000yqi.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291855373 26725 80.91.229.12 (9 Dec 2010 00:42:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 00:42:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 01:42:48 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQUau-0001z0-AN for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 01:42:48 +0100 Original-Received: from localhost ([127.0.0.1]:44162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQUat-0004xi-Mm for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 19:42:47 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!e5g2000yqn.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.lisp Original-Lines: 141 Original-NNTP-Posting-Host: 75.28.155.77 Original-X-Trace: posting.google.com 1279901037 24927 127.0.0.1 (23 Jul 2010 16:03:57 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 23 Jul 2010 16:03:57 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e5g2000yqn.googlegroups.com; posting-host=75.28.155.77; posting-account=Xy1x0QoAAAC1_8XWVbTILoO5VL5JMCDm User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:179986 comp.lang.lisp:290573 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76316 Archived-At: On Jul 23, 9:01=A0am, Fren Zeee wrote: > On Jul 23, 8:59=A0am, Fren Zeee wrote: > > > > > On Jul 23, 1:34=A0am, p...@informatimago.com (Pascal J. Bourguignon) > > wrote: > > > > Fren Zeee writes: > > > > What's the spec for emacs lisp virtual machine ? > > > > The source code of emacs. > > > > > Where are the complete set of virtual machine commands ? > > > > In src/bytecode.c > > > > > Where is the theory for such a virtual machine in the clearest > > > > description ? (not general theory, but one applicable directly to > > > > understanding emacs vm.) > > > > It's really quite a simple VM. =A0Just read the sources! > > > > > Does the emacs lisp operate as a stack push/pop or as parsing ? > > > > emacs lisp works like any other lisp. =A0There's an abstract 'eval' t= hat > > > interprets it. =A0Any good course about lisp would introduce it. > > > > > Why is a VM needed when there is compiled C code running machine > > > > code ? > > > > Is this home work? > > > > Search the sources of emacs for compilers. > > > How many compilers do you find? > > > What are their source files? > > > What machine do they target? > > > > > How do you implement a LISP interpreter using a stack based and syn= tax > > > > tree methods ? > > > > Interpretation may be done without any consideration on the underlyin= g > > > architecture. > > > > > Some overview with concrete examples please, but of practical value= . > > > > Perhaps you should not limit yourself to emacs lisp. =A0Allow yoursel= f > > > to read also about other lisps, including scheme. =A0 > > > > You could also check the sources of various other Lisp, including: > > > - sbcl or ccl, > > > - clisp, and > > > - ecl > > > to answer the above questions for them as well as for emacs lisp. > > > > There's a lot of material out there. =A0You could start with: > > > > =A0http://www.informatimago.com/develop/lisp/small-cl-pgms/aim-8/ > > > =A0 =A0(that paper contains the original LISP interpreter). > > > > Googling for: lisp in lisp > > > gives good results such as: > > > > =A0http://lib.store.yahoo.net/lib/paulgraham/jmc.lisp > > > > =A0http://www.softwarepreservation.org/projects/LISP/ > > > > =A0http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs.html > > > =A0 =A0(this report contains (part of) formal specifications of schem= e). > > > > > Also, for either you need a scanner and so an example of a scanner > > > > using a transition table. How do you decide on the states that are > > > > minimal and not redundant ? > > > > > What is the difference between a stack architecture of a processor = and > > > > register based one ? > > > > Get a description of a stack architecture. > > > Get a description of a register based processor. > > > Compute the differences. > > > > If you're lazy, as it seems you are, you could just > > > use google: =A0stack vs register VM > > > > > wouldnt the former still need an ALU and indirect > > > > addressing to do the job ? > > > > What do you think? > > > > > A diagram and some explanation, or else we > > > > will be in the domain of linguistic ambiguity. > > > > Or even better, use formal specifications for the various kind of VM, > > > and a formal specification of Lisp, and show how you can map the late= r > > > to each one of the formers. > > > > > Upload a hand sketched image if necessary, or a reference to specif= ic > > > > pages in google books. > > > > > I have done searches on wiki and other places but the things are no= t > > > > entirely clear because they are not oriented to my goal of centerin= g > > > > around emacs. > > > > You need to read LiSP, which covers how to implement Lisp. > > > > LiSP =A0 =3D "Lisp in Small Pieces" =A0 > > > =A0 =A0 =A0 =A0 =A0http://www-spi.lip6.fr/~queinnec/WWW/LiSP.html > > > =A0 =A0 =A0 =A0 =A0This book covers Lisp, Scheme and other related di= alects, > > > =A0 =A0 =A0 =A0 =A0their interpretation, semantics and compilation. T= o sum it up > > > =A0 =A0 =A0 =A0 =A0in a few figures: 500 pages, 11 chapters, 11 inter= preters and > > > =A0 =A0 =A0 =A0 =A02 compilers. > > > > -- > > > __Pascal Bourguignon__ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0http://= www.informatimago.com/ > > > unfortunately, this reply did not give any benefit and info repeated > > before. the reply did not even put a snippet of the code from c file > > to illustrate how he himself read and understood it. someone else try > > if anyone knows. > > I already read and understood jmc's doc. he does nt seem to understand > the difference between stack based and tree based parsing. portability does not require VM, it only requires C while emacs interprets the lisp code. a diff command in C is portable over computers because its written in C. not because of a VM.