Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Ontogeny recapitulates phylogeny.


devel / comp.lang.forth / WINTERPRET

SubjectAuthor
* WINTERPRETnone
+* Re: WINTERPRETNN
|`- Re: WINTERPRETnone
`* Re: WINTERPRETRuvim
 `* Re: WINTERPRETnone
  `- Re: WINTERPRETRuvim

1
WINTERPRET

<nnd$2be8e622$09945cbc@3c4e5770d71d1a4a>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24840&group=comp.lang.forth#24840

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: WINTERPRET
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$2be8e622$09945cbc@3c4e5770d71d1a4a>
Organization: KPN B.V.
Date: Sun, 08 Oct 2023 20:18:37 +0200
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feed.abavia.com!abe006.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 49
Injection-Date: Sun, 08 Oct 2023 20:18:37 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: none - Sun, 8 Oct 2023 18:18 UTC

Since a long time (meta compilers for the 8051 while ISO was
new) the Dutch community has a word WINTERPRET that sees
it use mainly for meta compilers.

This word interprets a string constant, and thus INTERPRET
is a loop over this word. Naturally it terminates on
a string with length zero.
( NAME would be something like `` BL WORD COUNT '' )

: INTERPRET
BEGIN NAME DUP WHILE WINTERPRET ?STACK REPEAT 2DROP ;

WINTERPRET comes in handy for my lisp efforts too, 1]
but I'm inclined to name it INTERPRET-TOKEN.

1. Are others using this factor of INTERPRET ?
2. Is the name WINTERPRET common ?
3. Is this known under another name?

As far as 2 is concerned I expect not. WINTERPRET is a
Dutch word and its meaning is `` winter fun ''.
This cuteness is not a good base for a name, and I can't
relate it to any naming convention in Forth, prefixing a single
character.

1]
In lisp a ' is supposed to parse another token and transform it like so:
'<item> --> (quote <item> )
Such words can be generated by a defining word:
: define-quote CREATE $, DROP PREFIX DOES>
empty() SWAP $@ symbol-append interpret-token build-list
vector-append ; PREFIX

Example:
"quote" define-quote '
and
"deref" define-quote @

Note that <item> can be a list `` (+ 1 2) '' that is parsed by
the prefix `` ( '' or any type that is determined by the
first character: 1 " ( [ a b .. z

Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: WINTERPRET

<ff47651a-c8d8-44a6-ad5f-b7c0eb6e0500n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24842&group=comp.lang.forth#24842

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:2292:b0:419:b68f:df5 with SMTP id ay18-20020a05622a229200b00419b68f0df5mr176423qtb.1.1696808318819;
Sun, 08 Oct 2023 16:38:38 -0700 (PDT)
X-Received: by 2002:a05:6871:3208:b0:1d5:a24a:c33 with SMTP id
mo8-20020a056871320800b001d5a24a0c33mr5331184oac.8.1696808318602; Sun, 08 Oct
2023 16:38:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 8 Oct 2023 16:38:38 -0700 (PDT)
In-Reply-To: <nnd$2be8e622$09945cbc@3c4e5770d71d1a4a>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23c5:6f05:3a01:45b5:b1aa:8312:c32c;
posting-account=9A5f7goAAAD_QfJPZnlK3Xq_UhzYjdP-
NNTP-Posting-Host: 2a00:23c5:6f05:3a01:45b5:b1aa:8312:c32c
References: <nnd$2be8e622$09945cbc@3c4e5770d71d1a4a>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ff47651a-c8d8-44a6-ad5f-b7c0eb6e0500n@googlegroups.com>
Subject: Re: WINTERPRET
From: november.nihal@gmail.com (NN)
Injection-Date: Sun, 08 Oct 2023 23:38:38 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3223
 by: NN - Sun, 8 Oct 2023 23:38 UTC

On Sunday, 8 October 2023 at 19:18:51 UTC+1, none albert wrote:
> Since a long time (meta compilers for the 8051 while ISO was
> new) the Dutch community has a word WINTERPRET that sees
> it use mainly for meta compilers.
>
> This word interprets a string constant, and thus INTERPRET
> is a loop over this word. Naturally it terminates on
> a string with length zero.
> ( NAME would be something like `` BL WORD COUNT '' )
>
> : INTERPRET
> BEGIN NAME DUP WHILE WINTERPRET ?STACK REPEAT 2DROP ;
>
> WINTERPRET comes in handy for my lisp efforts too, 1]
> but I'm inclined to name it INTERPRET-TOKEN.
>
> 1. Are others using this factor of INTERPRET ?
> 2. Is the name WINTERPRET common ?
> 3. Is this known under another name?
>
> As far as 2 is concerned I expect not. WINTERPRET is a
> Dutch word and its meaning is `` winter fun ''.
> This cuteness is not a good base for a name, and I can't
> relate it to any naming convention in Forth, prefixing a single
> character.
>
> 1]
> In lisp a ' is supposed to parse another token and transform it like so:
> '<item> --> (quote <item> )
> Such words can be generated by a defining word:
> : define-quote CREATE $, DROP PREFIX DOES>
> empty() SWAP $@ symbol-append interpret-token build-list
> vector-append ; PREFIX
>
> Example:
> "quote" define-quote '
> and
> "deref" define-quote @
>
> Note that <item> can be a list `` (+ 1 2) '' that is parsed by
> the prefix `` ( '' or any type that is determined by the
> first character: 1 " ( [ a b .. z
>
> Groetjes Albert
> --
> Don't praise the day before the evening. One swallow doesn't make spring.
> You must not say "hey" before you have crossed the bridge. Don't sell the
> hide of the bear until you shot it. Better one bird in the hand than ten in
> the air. First gain is a cat spinning. - the Wise from Antrim -

What you have named interpret I just called repl() and so interpret is free to be
used as as interpret()

Any reason why you didnt just call it eval ( or a variation of )?

Re: WINTERPRET

<nnd$493aab32$184bf00e@34330427289a2007>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24847&group=comp.lang.forth#24847

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <nnd$2be8e622$09945cbc@3c4e5770d71d1a4a> <ff47651a-c8d8-44a6-ad5f-b7c0eb6e0500n@googlegroups.com>
Subject: Re: WINTERPRET
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$493aab32$184bf00e@34330427289a2007>
Organization: KPN B.V.
Date: Mon, 09 Oct 2023 11:17:34 +0200
Path: i2pn2.org!i2pn.org!news.swapon.de!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe005.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 72
Injection-Date: Mon, 09 Oct 2023 11:17:34 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 3245
 by: none - Mon, 9 Oct 2023 09:17 UTC

In article <ff47651a-c8d8-44a6-ad5f-b7c0eb6e0500n@googlegroups.com>,
NN <november.nihal@gmail.com> wrote:
>On Sunday, 8 October 2023 at 19:18:51 UTC+1, none albert wrote:
>> Since a long time (meta compilers for the 8051 while ISO was
>> new) the Dutch community has a word WINTERPRET that sees
>> it use mainly for meta compilers.
>>
>> This word interprets a string constant, and thus INTERPRET
>> is a loop over this word. Naturally it terminates on
>> a string with length zero.
>> ( NAME would be something like `` BL WORD COUNT '' )
>>
>> : INTERPRET
>> BEGIN NAME DUP WHILE WINTERPRET ?STACK REPEAT 2DROP ;
>>
>> WINTERPRET comes in handy for my lisp efforts too, 1]
>> but I'm inclined to name it INTERPRET-TOKEN.
>>
>> 1. Are others using this factor of INTERPRET ?
>> 2. Is the name WINTERPRET common ?
>> 3. Is this known under another name?
>>
>> As far as 2 is concerned I expect not. WINTERPRET is a
>> Dutch word and its meaning is `` winter fun ''.
>> This cuteness is not a good base for a name, and I can't
>> relate it to any naming convention in Forth, prefixing a single
>> character.
>>
>> 1]
>> In lisp a ' is supposed to parse another token and transform it like so:
>> '<item> --> (quote <item> )
>> Such words can be generated by a defining word:
>> : define-quote CREATE $, DROP PREFIX DOES>
>> empty() SWAP $@ symbol-append interpret-token build-list
>> vector-append ; PREFIX
>>
>> Example:
>> "quote" define-quote '
>> and
>> "deref" define-quote @
>>
>> Note that <item> can be a list `` (+ 1 2) '' that is parsed by
>> the prefix `` ( '' or any type that is determined by the
>> first character: 1 " ( [ a b .. z
>>
>> Groetjes Albert
>
>
>
>What you have named interpret I just called repl() and so interpret is
>free to be
> used as as interpret()

Take a better read. Evaluate is a loop over words, with an important
function to isolate those words.
WINTERPRET is a factor that has as an input a single token,
already isolated from the environment.

>
>Any reason why you didnt just call it eval ( or a variation of )?

Any reason why I should? EVAL is not an established Forth word,
and the name doesn't suggest that it looks up a single name to execute
a single action. So what do you even mean?

Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: WINTERPRET

<ugdmdp$3pgl5$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24924&group=comp.lang.forth#24924

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pinka@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: WINTERPRET
Date: Sat, 14 Oct 2023 09:18:49 +0000
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <ugdmdp$3pgl5$1@dont-email.me>
References: <nnd$2be8e622$09945cbc@3c4e5770d71d1a4a>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 14 Oct 2023 09:18:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b1311020349fc87afd66e70ff5390892";
logging-data="3981989"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BK1TdG6wDMVhEPh4YPoEI"
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Firefox/102.0
Cancel-Lock: sha1:JECp8lyWNYS6WWDw4ctBL+blDYc=
Content-Language: en-US
In-Reply-To: <nnd$2be8e622$09945cbc@3c4e5770d71d1a4a>
 by: Ruvim - Sat, 14 Oct 2023 09:18 UTC

On 2023-10-08 18:18, albert wrote:
> Since a long time (meta compilers for the 8051 while ISO was
> new) the Dutch community has a word WINTERPRET that sees
> it use mainly for meta compilers.
>
> This word interprets a string constant, and thus INTERPRET
> is a loop over this word. Naturally it terminates on
> a string with length zero.
> ( NAME would be something like `` BL WORD COUNT '' )
>
> : INTERPRET
> BEGIN NAME DUP WHILE WINTERPRET ?STACK REPEAT 2DROP ;
>
> WINTERPRET comes in handy for my lisp efforts too, 1]
> but I'm inclined to name it INTERPRET-TOKEN.
>
> 1. Are others using this factor of INTERPRET ?
> 2. Is the name WINTERPRET common ?
> 3. Is this known under another name?

In SP-Forth/4 there is a similar word:
EVAL-WORD ( i*x sd.name -- j*x )

It translates only a word name (it throws an exception if the word is
not found). So, it cannot be used in the Forth text interpreter loop.

I use the word TRANSLATE-LEXEME ( i*x sd.lexeme -- j*x )
that translates any lexeme according to the current state.

To translate a lexeme: to recognize a lexeme and perform the compilation
semantics for it if the Forth text interpreter is in compilation state,
or the interpretation semantics if in interpretation state.

The name "INTERPRET-TOKEN" is confusing, since:
1. It can mean both performing interpretation semantics regardless of
the state, and translating (according to the above term definition).
2. "Token" can mean execution token, name token, or other similar thing,
or "lexical token" (which is a pair of a lexeme and *its kind*). And
what this word actually implies is not from this list.

--
Ruvim

Re: WINTERPRET

<nnd$1f69a478$2b1e3be2@69ed09f2040e55b3>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24928&group=comp.lang.forth#24928

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: Re: WINTERPRET
References: <nnd$2be8e622$09945cbc@3c4e5770d71d1a4a> <ugdmdp$3pgl5$1@dont-email.me>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$1f69a478$2b1e3be2@69ed09f2040e55b3>
Organization: KPN B.V.
Date: Sat, 14 Oct 2023 21:48:03 +0200
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp003.abavia.com!news.kpn.nl!not-for-mail
Lines: 76
Injection-Date: Sat, 14 Oct 2023 21:48:03 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 3478
 by: none - Sat, 14 Oct 2023 19:48 UTC

In article <ugdmdp$3pgl5$1@dont-email.me>,
Ruvim <ruvim.pinka@gmail.com> wrote:
>On 2023-10-08 18:18, albert wrote:
>> Since a long time (meta compilers for the 8051 while ISO was
>> new) the Dutch community has a word WINTERPRET that sees
>> it use mainly for meta compilers.
>>
>> This word interprets a string constant, and thus INTERPRET
>> is a loop over this word. Naturally it terminates on
>> a string with length zero.
>> ( NAME would be something like `` BL WORD COUNT '' )
>>
>> : INTERPRET
>> BEGIN NAME DUP WHILE WINTERPRET ?STACK REPEAT 2DROP ;
>>
>> WINTERPRET comes in handy for my lisp efforts too, 1]
>> but I'm inclined to name it INTERPRET-TOKEN.
>>
>> 1. Are others using this factor of INTERPRET ?
>> 2. Is the name WINTERPRET common ?
>> 3. Is this known under another name?
>
>In SP-Forth/4 there is a similar word:
>EVAL-WORD ( i*x sd.name -- j*x )
>
>It translates only a word name (it throws an exception if the word is
>not found). So, it cannot be used in the Forth text interpreter loop.

I don't follow the logic. It is not true for at least one implementation
model. I can factor out INTERPRET-TOKEN out of INTERPRET in ciforth.
INTERPRET-TOKEN throws exceptions all the time.

>I use the word TRANSLATE-LEXEME ( i*x sd.lexeme -- j*x )
>that translates any lexeme according to the current state.

As English dictionaries go:
INTERPRET is approximately the same TRANSLATE
TOKEN is approximately the same as LEXEME
So we are not far apart.

>
>To translate a lexeme: to recognize a lexeme and perform the compilation
>semantics for it if the Forth text interpreter is in compilation state,
>or the interpretation semantics if in interpretation state.
>
>
>The name "INTERPRET-TOKEN" is confusing, since:
>1. It can mean both performing interpretation semantics regardless of
>the state, and translating (according to the above term definition).
>2. "Token" can mean execution token, name token, or other similar thing,
>or "lexical token" (which is a pair of a lexeme and *its kind*). And
>what this word actually implies is not from this list.

You can argue a name by logic, for now.
It is established by convention by a Standards team.
Not all of Forth names are logical ...

So we have
WINTERPRET
INTERPRET-TOKEN
EVAL-WORD
TRANSLATE-LEXEME

The conclusion is that it is a solid concept, reinvented many times,
and that it is deserving of a definitive name.

>
>--
>Ruvim
>
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: WINTERPRET

<ugfa0j$48j4$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24929&group=comp.lang.forth#24929

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pinka@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: WINTERPRET
Date: Sat, 14 Oct 2023 23:59:15 +0000
Organization: A noiseless patient Spider
Lines: 118
Message-ID: <ugfa0j$48j4$1@dont-email.me>
References: <nnd$2be8e622$09945cbc@3c4e5770d71d1a4a>
<ugdmdp$3pgl5$1@dont-email.me> <nnd$1f69a478$2b1e3be2@69ed09f2040e55b3>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 14 Oct 2023 23:59:15 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9bb42ffbf899ac3c7b2281ba2c57f1f0";
logging-data="139876"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/IeqZ5c5SVm09yRakT/umM"
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Firefox/102.0
Cancel-Lock: sha1:ctGjWZRrAXHx8mdfpl+qEWk5kjI=
Content-Language: en-US
In-Reply-To: <nnd$1f69a478$2b1e3be2@69ed09f2040e55b3>
 by: Ruvim - Sat, 14 Oct 2023 23:59 UTC

On 2023-10-14 19:48, albert wrote:
> In article <ugdmdp$3pgl5$1@dont-email.me>,
> Ruvim <ruvim.pinka@gmail.com> wrote:
>> On 2023-10-08 18:18, albert wrote:
>>> Since a long time (meta compilers for the 8051 while ISO was
>>> new) the Dutch community has a word WINTERPRET that sees
>>> it use mainly for meta compilers.
>>>
>>> This word interprets a string constant, and thus INTERPRET
>>> is a loop over this word. Naturally it terminates on
>>> a string with length zero.
>>> ( NAME would be something like `` BL WORD COUNT '' )
>>>
>>> : INTERPRET
>>> BEGIN NAME DUP WHILE WINTERPRET ?STACK REPEAT 2DROP ;
>>>
>>> WINTERPRET comes in handy for my lisp efforts too, 1]
>>> but I'm inclined to name it INTERPRET-TOKEN.
>>>
>>> 1. Are others using this factor of INTERPRET ?
>>> 2. Is the name WINTERPRET common ?
>>> 3. Is this known under another name?
>>
>> In SP-Forth/4 there is a similar word:
>> EVAL-WORD ( i*x sd.name -- j*x )
>>
>> It translates only a word name (it throws an exception if the word is
>> not found). So, it cannot be used in the Forth text interpreter loop.
>
> I don't follow the logic. It is not true for at least one implementation
> model. I can factor out INTERPRET-TOKEN out of INTERPRET in ciforth.
> INTERPRET-TOKEN throws exceptions all the time.

What I mean is that the word "EVAL-WORD" tries to recognize a lexeme
only as a Forth word (a named Forth definition). And the "WORD"
component in its name implies exactly this.

In Forth-2012 this word can be defined as follows.

: compilation ( -- flag ) state @ 0<> ;
: ?found ( x -- x | 0 -- ) dup 0= -13 and throw ;

\ NB: programs never actually need to analyze
\ the result of "name>interpret" for zero.
: name> ( nt -- xt )
name>interpret ( nt -- xt|0 )
dup if exit then drop [: -14 throw ;]
;

: eval-word ( i*x sd.name -- j*x )
find-name ?found
compilation if name>compile else name> then execute
;

Of course, a better choice was to extract the corresponding part of the
Forth text interpreter loop into a separate word completely.

>> I use the word TRANSLATE-LEXEME ( i*x sd.lexeme -- j*x )
>> that translates any lexeme according to the current state.
>
> As English dictionaries go:
> INTERPRET is approximately the same TRANSLATE
> TOKEN is approximately the same as LEXEME
> So we are not far apart.

Yes! Moreover, each of them has many different meanings (depending on
the context).

It's just that in the context of the Forth languages, "token" already
has some other meaning.

And "interpret" has both meanings, so "translate" is more unequivocal.

The "translate" term is applicable not only to a lexeme, but also to a
name token, execution token, number (on the stack), etc.

For example, the following useful words can be defined using the
"translate" term:

: lit, postpone literal ; \ just a well-known factor

: translate-lit ( x -- x| )
compilation if lit, then
;
: translate-xt ( i*x xt -- j*x )
compilation if compile, exit then execute
;
: translate-name ( i*x nt -- j*x )
compilation if name>compile else name> then execute
;

And then, "eval-word" can be defined as:

: eval-word ( i*x sd.name -- j*x )
find-name ?found translate-name
;

[...]
>
> So we have
> WINTERPRET
> INTERPRET-TOKEN
> EVAL-WORD
> TRANSLATE-LEXEME
>
> The conclusion is that it is a solid concept, reinvented many times,
> and that it is deserving of a definitive name.

I agree.

--
Ruvim

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor