Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: FORTH - How Does It Work? Date: Mon, 04 May 2015 20:01:11 -0400 Organization: Aioe.org NNTP Server Lines: 69 Message-ID: References: <058a96b0-8a32-476d-b062-a8db0be69130@googlegroups.com> <5547c4e0$0$3072$e4fe514c@dreader35.news.xs4all.nl> NNTP-Posting-Host: n4wpt9zq8xR26Ttf9mo2BA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:38827 On Mon, 04 May 2015 15:13:36 -0400, Albert van der Horst wrote: > Well the OP suggest this to people who want to know how Forth > works on the inside. An alternative is to randomly start SEE-ing > some code in a Forth you use. > For an extreme example take this: > > Gforth 0.7.0, Copyright (C) 1995-2008 Free Software Foundation, Inc. > Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license' > Type `bye' to exit > SEE TO > noname : > ' dup >definer 140003129076120 >definer = > IF 16 + ! > ELSE -32 throw > THEN ; > latestxt > > noname : > COMP' drop dup >definer 140003129076120 >definer over = > IF drop 16 + POSTPONE ALiteral 6396632 compile, > ELSE 140003129105440 >definer over = > IF drop 6397824 compile, 16 + @ lp-offset, 6396656 compile, > ELSE 140003129105608 >definer over = > IF drop 6397824 compile, 16 + @ lp-offset, 6396632 > compile, > > ELSE 140003129105496 >definer over = > IF drop 6397824 compile, 16 + @ lp-offset, > 6396664 > compile, > ELSE 140003129105552 >definer over = > IF drop 6397824 compile, 16 + @ > lp-offset, > 6397288 compile, > ELSE -32 throw drop > THEN > THEN > THEN > THEN > THEN ; > latestxt > interpret/compile: TO ok > > Compared to Ting's books this is pretty intimidating. > Of course you're right that Forth is not defined by an implementation, > and this example serves to show how different implementations are, > but traditionally (some) people *are* interested in how one manages to > make a compiler/interpreter. > It seems that the constants beginning with digit '6' might be XTs due to COMPILE, . I could guess that >DEFINER takes the constants which begin with '14', but what is >DEFINER ? Are the large constants the XTs of primitive words? Are they the XTs of NONAME words? Can I execute '6397824'? (Yes.) Can I execute '140003129105440'? ... Can I display their name or SEE their code? Rod Pemberton -- Cars kill more people than guns in the U.S. Yet, no one is trying to take away your car.