Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

lp1 on fire -- One of the more obfuscated kernel messages


devel / comp.lang.forth / ANN: 4tH version 3.64.0 has just been released!

SubjectAuthor
* ANN: 4tH version 3.64.0 has just been released!Hans Bezemer
+* Re: ANN: 4tH version 3.64.0 has just been released!meff
|`- Re: ANN: 4tH version 3.64.0 has just been released!Hans Bezemer
`* Re: ANN: 4tH version 3.64.0 has just been released!j.merkel
 `* Re: ANN: 4tH version 3.64.0 has just been released!Hans Bezemer
  `* 4tH question (was: ANN: 4tH version 3.64.0 ...)j.merkel
   `* Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)Hans Bezemer
    +- Re: 4tH questionj.merkel
    `* Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)Heinrich Hohl
     `* Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)Ron AARON
      +* Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)Hans Bezemer
      |`* Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)Hans Bezemer
      | +- FORWARD (was: 4tH question (was: ANN: 4tH version 3.64.0 ...))Anton Ertl
      | `* Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)Ron AARON
      |  `* Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)dxforth
      |   `* Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)Ron AARON
      |    `* Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)dxforth
      |     `- Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)Ron AARON
      `* Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)Heinrich Hohl
       `- Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)Ron AARON

1
ANN: 4tH version 3.64.0 has just been released!

<9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16309&group=comp.lang.forth#16309

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:1743:: with SMTP id l3mr13517764qtk.342.1642509169121; Tue, 18 Jan 2022 04:32:49 -0800 (PST)
X-Received: by 2002:a05:6214:5298:: with SMTP id kj24mr21615330qvb.59.1642509168994; Tue, 18 Jan 2022 04:32:48 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Tue, 18 Jan 2022 04:32:48 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=82.95.228.79; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 82.95.228.79
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
Subject: ANN: 4tH version 3.64.0 has just been released!
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Tue, 18 Jan 2022 12:32:49 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 52
 by: Hans Bezemer - Tue, 18 Jan 2022 12:32 UTC

You can download it at http://thebeez.home.xs4all.nl/4tH/download.html

Changes:
* The words +TO, ;THEN, R"@, I', ?EXIT, [NAMES], EXCEPT, UNLESS,
THROW", >ZERO, RDROP, 2RDROP, CASE, OF, ENDOF, ;ENDOF, ENDCASE
and STOW were added.
* The preprocessor now supports single, double and floating point
FORTRAN formulas.
* Destructors and constructors were added to FOOS (Forth Object
Oriented Simple).
* An "expert mode" has been added to 4tH.
* The [NAMES] directive enables symbolic decompilation.
* The behavior of COMPARE can be influenced by issuing the
appropriate pragmas.
* The library files now support Intel hex format.
* Global variables can be converted to local variables.
* New binary search libraries were added.
* Dynamic string support was added.
* Dynamic array support was added.
* CCITT-2 and CRC32 support were added.
* A new priority queue library was added.
* A general purpose filename splitting library was added.
* Internationalization support (i18n) was added.
* A fast Levenshtein Distance library was added.
* A sequences library was added
* A floating point equivalent of >NUMBER was added.
* A fast >FLOAT implementation was added to ANS floating point.
* Fast single and double word exponentiation libraries were
added.
* A fast fixed point exponentiation and natural logarithm library
was added.
* Several mathematical functions were added to the fractions
library.
* The graphics suite now includes routines for drawing circles,
arcs, ellipses and different lines.
* The graphics suite now includes flood fill routines.
* MRG32k3a was added to the random number generators.
* Binary Insertionsort and a simple Timsort were added to the
sort algorithms.
* Preprocessing is 2.5x times faster, compilation is 25% faster
(on average).

Features:
* Comes with an extensive library, featuring hundreds
of words covering ANS-Forth compatibility, user defined stacks,
lists, XLS, LaTeX, RTF and HTML files, floating point,
databases, etc. etc.
* Almost 95% of the CORE wordset is supported.
* Comes with a nice, 600+ page manual.
* Over 250 examples and 500+ libraries.
* Turbo C and GCC like frontends.
* Native packages for MS-DOS, MS-Windows, Coherent, Linux,
including the Ben Nanonote and the Raspberry Pi.

Re: ANN: 4tH version 3.64.0 has just been released!

<ss85hi$m2r$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16319&group=comp.lang.forth#16319

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ema...@example.com (meff)
Newsgroups: comp.lang.forth
Subject: Re: ANN: 4tH version 3.64.0 has just been released!
Date: Wed, 19 Jan 2022 04:54:10 -0000 (UTC)
Organization: That of fools
Lines: 4
Message-ID: <ss85hi$m2r$1@dont-email.me>
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
Injection-Date: Wed, 19 Jan 2022 04:54:10 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="fe3d65d4adf614523f5837ac89dfbdfe";
logging-data="22619"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18xDRMleIrbFpA9+RGNuQZw"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:YtWx79EI9xwm709I3UwVVa3wwDc=
 by: meff - Wed, 19 Jan 2022 04:54 UTC

On 2022-01-18, Hans Bezemer <the.beez.speaks@gmail.com> wrote:
> * An "expert mode" has been added to 4tH.

What is "expert mode" about?

Re: ANN: 4tH version 3.64.0 has just been released!

<FmAYnqFgRIB@j.m>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16321&group=comp.lang.forth#16321

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: j.m...@7fun.de (j.merkel)
Newsgroups: comp.lang.forth
Subject: Re: ANN: 4tH version 3.64.0 has just been released!
Date: Wed, 19 Jan 2022 10:53:00 +0100
Lines: 50
Message-ID: <FmAYnqFgRIB@j.m>
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-Trace: individual.net V4PYBCiQSRx4taiBGljI9QZ03TQXHGvrBraB9OQ+ei7SViU1qT
Cancel-Lock: sha1:BlGdbriJS25ZHeYdAF9jzUeU6+M=
 by: j.merkel - Wed, 19 Jan 2022 09:53 UTC

Hans Bezemer wrote:
> You can download it at http://thebeez.home.xs4all.nl/4tH/download.html

Hi Hans,

great stuff, many thanks, deeply appreciating the libs, the source
organisation, the doc and the examples.
I copy source from the doc as a text-version from your homepage
to try some examples. 25 years ago i asked you for this service
and you published the text-version since then, extremely helpful.

4tH here is the most favoured program to explore and optimize
the organisation of many of my text tools because it's
tremendously easy to deconstruct and factorize functions and
do conceptually changes.
BTW my preferred editor is TSEpro, now freeware, with an
own build syntax highlighting and function list of 4tH source.

Just one question:
I often use defer and if i comment some out,
have i also to comment out the definition of :noname
or only the part after the closing
semicolon "is xyz" for that noname definition?

Compiling the not needed nonames costs me compile time
not space, right?
Commenting out defer and leaving the :noname as is, costs
me space but is not harmful otherwise, right?

Here you see parts of a function list. It
shows the begin and the end of :noname definitions.

defer shdcn2
\ defer splic
defer adrith
defer hdverg5

:noname \ hdverg5
; is hdverg5
:noname \ shdcn2
; is shdcn2
:noname \ splic
; \ is splic
:noname \ adrith
; is adrith

--
Salut
_)oachim

Re: ANN: 4tH version 3.64.0 has just been released!

<d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16322&group=comp.lang.forth#16322

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:a892:: with SMTP id r140mr19296319qke.662.1642596621980;
Wed, 19 Jan 2022 04:50:21 -0800 (PST)
X-Received: by 2002:a05:622a:148d:: with SMTP id t13mr8237327qtx.86.1642596621809;
Wed, 19 Jan 2022 04:50:21 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 19 Jan 2022 04:50:21 -0800 (PST)
In-Reply-To: <FmAYnqFgRIB@j.m>
Injection-Info: google-groups.googlegroups.com; posting-host=82.95.228.79; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 82.95.228.79
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com> <FmAYnqFgRIB@j.m>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>
Subject: Re: ANN: 4tH version 3.64.0 has just been released!
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Wed, 19 Jan 2022 12:50:21 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 198
 by: Hans Bezemer - Wed, 19 Jan 2022 12:50 UTC

On Wednesday, January 19, 2022 at 10:58:31 AM UTC+1, j.merkel wrote:

> Just one question:
> I often use defer and if i comment some out,
> have i also to comment out the definition of :noname
> or only the part after the closing
> semicolon "is xyz" for that noname definition?

TL;DR version: BOTH.

Now for the real answer:

Well, I slightly changed your code by adding the [NAMES] directive to it, so you can see EXACTLY what is going on:

[names]

defer shdcn2
\ defer splic
defer adrith
defer hdverg5
\ etc.

4tH message: No errors at word 21
Object size: 21 words
String size: 0 chars
Variables : 3 cells
Strings : 0 chars
Symbols : 3 names
Reliable : Yes

Addr| Opcode Operand Argument

0| literal -9223372036854775808
1| to 0 shdcn2 \ yes, this simply expands to (error) to shdcn2
2| literal -9223372036854775808
3| to 1 adrith \ likewise for adrith
4| literal -9223372036854775808
5| to 2 hdverg5 \ likewise for hdverg5
6| literal 7 \ xt of :noname
7| branch 8 \ :noname definition
8| exit 0
9| to 2 hdverg5 \ now hdverg5 has that xt assigned to it
10| literal 11 \ xt of :noname
11| branch 12 \ :noname definition
12| exit 0
13| to 0 shdcn2 \ now shdcn2 has that xt assigned to it
14| literal 15 \ xt of :noname
15| branch 16
16| exit 0
17| literal 18 \ xt of :noname
18| branch 19
19| exit 0
20| to 1 adrith \ now shdcn2 has that xt assigned to it

So, let me get you in to some dirty 4tH secrets: neither VALUE nor DEFER is actually required. TO (or IS) will create that identifier when it is not there yet.

if ((y = GetSymbol (CurrentWord, W_SEARCH)) == MISSING)
AddSymbol (ValueToken, (val = Object->Variables++), CurrentWord);
else
{
if (Object->SymTable [y].Token != ValueToken)
Object->ErrNo = M4NOTYPE;
val = Object->SymTable [y].Value;
}

It simply queries the Symboltable. If it find it, it simply establishes whether the right thing is requested. Filling a predefined VALUE with IS isn't gonna cut it - so it bombs out with an error. If it doesn't find it, it adds the symbol to the Symboltable and continues. In both cases, the address of the VECTOR or the VALUE is known when compiling.

So, if you want to write tight 4tH code and don't mind portability or properly declaring all the stuff you require, you don't actually *need* to use DEFER ( and save two tokens). I don't actually recommend this practice for large programs, because when maintaining it you wonder where this darn thing actually came from. As you know I tend to declare all stuff beforehand and comment them.

The very reason 4tH behaves like this is that is saves tokens - which are a very limited resource. Using this scheme we can fold TO, IS, DEFER and VALUE into one single token - without sacrificing any ANS Forth compatibility. (ERROR) is a guarantee that you WON'T be able to use it before proper assignment - because it will simply bomb out.

Ok, second part. What does the standard say about :NONAME? Create an execution token xt, enter compilation state and start the current definition, producing colon-sys. ( C: -- colon-sys ) ( S: -- xt ) What this mumbo jumbo actually means it that the darn thing leaves its execution token AFTER the definition so that :NONAME ; EXECUTE actually works. And given gForth, we can see it do it:

Gforth 0.7.9_20211216
Copyright © 2021 Free Software Foundation, Inc.
Type `help' for basic help
:noname cr ." Hello world" cr ; dup . execute 140403878221608
Hello world
ok

So yes, the :NONAME left an 'xt' on the stack that we printed an executed. 4tH does essentially the same thing - it only drops the 'xt' right at the beginning, which is no problem since we jump over the definition anyways.

14| literal 15
15| branch 16
16| exit 0

That means you left a lonely 'xt' on the stack which is *not* consumed - and that is stack pollution. I consider that a problem. Want proof? Let's add a '.' at the very end of this program:

$ pp4th -x joachim.4th
15 $

And yes, that's the 'xt' that was left on the stack at operator #14. So, not commenting out the equivalent :NONAME definition gets you in much worse trouble than simply a little overhead. Personally, I'd rather use :TOKEN definitions, because that is equivalent to ANS Forth:

:NONAME ; CONSTANT bladibla \ which won't compile in 4tH

Let's see hoe what works out:

[names]

defer shdcn2
\ defer splic
defer adrith
defer hdverg5

:token (hdverg5) \ hdverg5
; (hdverg5) is hdverg5

:token (shdcn2) \ shdcn2
; (shdcn2) is shdcn2

:token (splic) \ splic
; \ (splic) is splic

:token (adrith) \ adrith
; (adrith) is adrith

depth .

And decompiled:

Addr| Opcode Operand Argument

0| literal -9223372036854775808
1| to 0 shdcn2
2| literal -9223372036854775808
3| to 1 adrith
4| literal -9223372036854775808
5| to 2 hdverg5
6| branch 7
7| exit 0
8| literal 6
9| to 2 hdverg5
10| branch 11contermination
11| exit 0
12| literal 10
13| to 0 shdcn2
14| branch 15
15| exit 0
16| branch 17
17| exit 0
18| literal 16
19| to 1 adrith
20| sp@ 0
21| . 0

Note I added the latter two to see which effect it has on the stack - and it's clean. It you remove them, the actual program is even a token shorter, because the stack contamination is solved. If you tend to use this practice, it is safer to use :TOKEN definitions.

However, definitions YOU DON'T USE will ALWAYS take up space, since 4tH compiles in one single pass and doesn't redo the whole shebang to see if there is any dead code there. Any optimization that is done is using a very, very tiny window.

A bit lengthier than you expected may be, but here it is..

Hans Bezemer

Re: ANN: 4tH version 3.64.0 has just been released!

<5cf3138c-d26c-4a99-b13d-6c03cfa0a3f0n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16323&group=comp.lang.forth#16323

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:1743:: with SMTP id l3mr17556681qtk.342.1642596808745;
Wed, 19 Jan 2022 04:53:28 -0800 (PST)
X-Received: by 2002:ac8:53c9:: with SMTP id c9mr24507126qtq.104.1642596808618;
Wed, 19 Jan 2022 04:53:28 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 19 Jan 2022 04:53:28 -0800 (PST)
In-Reply-To: <ss85hi$m2r$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=82.95.228.79; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 82.95.228.79
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com> <ss85hi$m2r$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5cf3138c-d26c-4a99-b13d-6c03cfa0a3f0n@googlegroups.com>
Subject: Re: ANN: 4tH version 3.64.0 has just been released!
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Wed, 19 Jan 2022 12:53:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 11
 by: Hans Bezemer - Wed, 19 Jan 2022 12:53 UTC

On Wednesday, January 19, 2022 at 5:54:12 AM UTC+1, meff wrote:
> On 2022-01-18, Hans Bezemer <the.bee...@gmail.com> wrote:
> > * An "expert mode" has been added to 4tH.
> What is "expert mode" about?
4tH is one of the 4tH incarnations, mimicking an early Turbo Pascal. After each command, it repaints the entire menu. Some people use the menu so frequently, they know it by heart and don't feel they need it. pressing 'X' will stop repainting the menu and simply leave only the prompt. An empty entry restores the menu - for those who accidentally enter the mode and don't know their way out.

Hans Bezemer

4tH question (was: ANN: 4tH version 3.64.0 ...)

<FmAYrhAgRIB@j.m>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16327&group=comp.lang.forth#16327

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: j.m...@7fun.de (j.merkel)
Newsgroups: comp.lang.forth
Subject: 4tH question (was: ANN: 4tH version 3.64.0 ...)
Date: Wed, 19 Jan 2022 19:34:00 +0100
Lines: 28
Message-ID: <FmAYrhAgRIB@j.m>
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-Trace: individual.net AFwqDsWlNpa/hF07CPa5agyzsatKcZ/KpYxyTT4d0R99dBCJmD
Cancel-Lock: sha1:Yyw/KYOYSekVvYXJ02thFl5s138=
 by: j.merkel - Wed, 19 Jan 2022 18:34 UTC

Hans Bezemer wrote:

> [...]
> If you tend to use this practice, it is safer to use :TOKEN
> definitions.

Now i understand :TOKEN and :NONAME better, i took :NONAME because
it was lesser typing.

> However, definitions YOU DON'T USE will ALWAYS take up space, since 4tH
> compiles in one single pass [...]
I use defer for high speed testing code, so i can have
the main stuff on top of the source file contrary to
the Forth style. This habit came from my older Basic programs.

It's not much work to comment it out with an editor macro --
otherwise i use a self defined library -- the best way to
hold the source readable.

> A bit lengthier than you expected may be, but here it is..

Thank you for hints again exploring the compiler stuff.

--
Salut
_)oachim

Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)

<e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16335&group=comp.lang.forth#16335

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:1c42:: with SMTP id if2mr30891255qvb.61.1642683428416;
Thu, 20 Jan 2022 04:57:08 -0800 (PST)
X-Received: by 2002:a05:620a:102e:: with SMTP id a14mr24436988qkk.327.1642683428246;
Thu, 20 Jan 2022 04:57:08 -0800 (PST)
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 20 Jan 2022 04:57:08 -0800 (PST)
In-Reply-To: <FmAYrhAgRIB@j.m>
Injection-Info: google-groups.googlegroups.com; posting-host=82.95.228.79; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 82.95.228.79
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com> <FmAYrhAgRIB@j.m>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
Subject: Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Thu, 20 Jan 2022 12:57:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 50
 by: Hans Bezemer - Thu, 20 Jan 2022 12:57 UTC

On Wednesday, January 19, 2022 at 7:35:13 PM UTC+1, j.merkel wrote:
> I use defer for high speed testing code, so i can have
> the main stuff on top of the source file contrary to
> the Forth style. This habit came from my older Basic programs.

Due to this use case I've implemented a new directive, called [FORWARD]. I think it makes your work a lot easier:

." This is the beginning" cr

[forward] test
test

: test ." Hello world!" cr ;
test

It allows you to defer the implementation of a colon definition. So, you can use it BEFORE it is defined. You later define the word as usual - nothing special. I've tried to break it in any way possible, but it seems rock solid.

It works, because a [FORWARD] declaration defines an empty BRANCH instruction, that is caught later on when you actually define it. If you fail to define it, it simply bombs out - exactly like an undefined DEFER.

Since the overhead is a single jump, I don't think it will break the bank. The thing is quite smart as well. After you've defined the colon definition subsequent use does NOT håve the overhead anymore (the jump is omitted).

Does this help?

Hans Bezemer

Addr| Opcode Operand Argument

0| ." 0 This is the beginning
1| cr 0
2| branch 3 \ here we got the [forward] declaration
3| branch 5
4| call 2 \ here we use the [forward] declaration
5| branch 8 \ this is the implementation of "TEST"
6| ." 22 Hello world!
7| cr 0
8| exit 0
9| call 5 \ now we call "TEST" directly

Re: 4tH question

<FmIYxSrgRIB@j.m>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16338&group=comp.lang.forth#16338

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: j.m...@7fun.de (j.merkel)
Newsgroups: comp.lang.forth
Subject: Re: 4tH question
Date: Fri, 21 Jan 2022 04:17:00 +0100
Lines: 19
Message-ID: <FmIYxSrgRIB@j.m>
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYrhAgRIB@j.m> <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-Trace: individual.net sKtIJFOyfppnJrml1EDaSgX6ecJB5AKU8CCRsgZnwbzuKccLPu
Cancel-Lock: sha1:fZeqAXSaHP3kFO6iq55BD1z+nKs=
 by: j.merkel - Fri, 21 Jan 2022 03:17 UTC

Hans Bezemer wrote
: > Due to this use case I've implemented a new directive, called [FORWARD].
[...]
> It allows you to defer the implementation of a colon definition.
[...]
> Does this help?

Sounds promising because renaming colon definitions to :noname etc.
becomes superfluous.

defer - :noname definitions primarily seems to be sort of a
library technique and [FORWARD] appropriately used in the main
program.

--
Salut
_)oachim

Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)

<66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16339&group=comp.lang.forth#16339

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:66c6:: with SMTP id a189mr2199513qkc.374.1642760218846;
Fri, 21 Jan 2022 02:16:58 -0800 (PST)
X-Received: by 2002:a05:622a:120b:: with SMTP id y11mr2524983qtx.307.1642760218669;
Fri, 21 Jan 2022 02:16:58 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 21 Jan 2022 02:16:58 -0800 (PST)
In-Reply-To: <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=91.45.201.168; posting-account=mrP5kgoAAADXISqI3e5f4EXLUinHClBq
NNTP-Posting-Host: 91.45.201.168
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>
<FmAYrhAgRIB@j.m> <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com>
Subject: Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)
From: hheinric...@gmail.com (Heinrich Hohl)
Injection-Date: Fri, 21 Jan 2022 10:16:58 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 13
 by: Heinrich Hohl - Fri, 21 Jan 2022 10:16 UTC

On Thursday, January 20, 2022 at 1:57:09 PM UTC+1, the.bee...@gmail.com wrote:
> Due to this use case I've implemented a new directive, called [FORWARD]. I think it makes your work a lot easier:

Absolutely useful. LMI Forth had similar words:

F: <name>
used to create a forward reference colon definition (builds just the header)

R: <name> ... ;
used to resolve the forward reference (contains the body of the word)

I used these words very often to create menus in DOS programs.

Henry

Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)

<sse406$q5n$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16340&group=comp.lang.forth#16340

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: clf...@8th-dev.com (Ron AARON)
Newsgroups: comp.lang.forth
Subject: Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)
Date: Fri, 21 Jan 2022 13:04:38 +0200
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <sse406$q5n$1@dont-email.me>
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>
<FmAYrhAgRIB@j.m> <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
<66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jan 2022 11:04:38 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="8005c4547994b227c1551f5ab76e2a1b";
logging-data="26807"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Z+Pir0Te42DRfTouTzCet"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.5.0
Cancel-Lock: sha1:qcXKiBWJXrfz9GhHLyUun9BY0Ac=
In-Reply-To: <66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com>
Content-Language: en-US
 by: Ron AARON - Fri, 21 Jan 2022 11:04 UTC

On 2022-01-21 12:16, Heinrich Hohl wrote:
> On Thursday, January 20, 2022 at 1:57:09 PM UTC+1, the.bee...@gmail.com wrote:
>> Due to this use case I've implemented a new directive, called [FORWARD]. I think it makes your work a lot easier:
>
> Absolutely useful. LMI Forth had similar words:
>
> F: <name>
> used to create a forward reference colon definition (builds just the header)
>
> R: <name> ... ;
> used to resolve the forward reference (contains the body of the word)
>
> I used these words very often to create menus in DOS programs.
>
> Henry

How are these better than the defer/is paradigm? Seems about the same to me.

Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)

<999c2a18-0c4d-4a40-b88c-72d0ae5466bcn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16341&group=comp.lang.forth#16341

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:c8f:: with SMTP id r15mr3029170qvr.78.1642764235631;
Fri, 21 Jan 2022 03:23:55 -0800 (PST)
X-Received: by 2002:a05:622a:148d:: with SMTP id t13mr2735267qtx.86.1642764235460;
Fri, 21 Jan 2022 03:23:55 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 21 Jan 2022 03:23:55 -0800 (PST)
In-Reply-To: <sse406$q5n$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=82.95.228.79; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 82.95.228.79
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>
<FmAYrhAgRIB@j.m> <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
<66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com> <sse406$q5n$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <999c2a18-0c4d-4a40-b88c-72d0ae5466bcn@googlegroups.com>
Subject: Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Fri, 21 Jan 2022 11:23:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 25
 by: Hans Bezemer - Fri, 21 Jan 2022 11:23 UTC

On Friday, January 21, 2022 at 12:04:41 PM UTC+1, Ron AARON wrote:
> How are these better than the defer/is paradigm? Seems about the same to me.
In 4tH it is VERY different! DEFER creates a variable that when executed, retrieves the xt stored there and executes it. It can be reassigned, though - since in essence it just stores an xt. This method (which I had to change slightly for architectural reasons) creates a trampoline.

It compiles two BRANCH instructions: BRANCH (this location + 1) and subsequently BRANCH (some outrageous location). This is required, because 4tH's tail call optimization like:

: no1 ." Do something here" ;
: no2 no1 ;

Creates EXACTLY the same two BRANCH instructions MINUS the "outrageous location". This is what the forward counterpart makes it recognize as a valid trampoline for resolving the forward declaration. 4tH won't allow you to write code that results in such a "trampoline".

So under the hood it is a very different implementation. DEFER is quite an expensive one in 4tH terms, because it requires its own token. The trampoline can be settled in the compiler only and doesn't require a variable. The use cases are slightly different as well. Gotta test performance though..

Hans Bezemer

Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)

<b1d5e9b6-37be-4b26-9af6-4ace72adddb2n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16343&group=comp.lang.forth#16343

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:2301:: with SMTP id gc1mr4452230qvb.24.1642782509064;
Fri, 21 Jan 2022 08:28:29 -0800 (PST)
X-Received: by 2002:a05:6214:518e:: with SMTP id kl14mr4401257qvb.130.1642782508933;
Fri, 21 Jan 2022 08:28:28 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!2.eu.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 21 Jan 2022 08:28:28 -0800 (PST)
In-Reply-To: <999c2a18-0c4d-4a40-b88c-72d0ae5466bcn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=82.95.228.79; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 82.95.228.79
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>
<FmAYrhAgRIB@j.m> <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
<66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com> <sse406$q5n$1@dont-email.me>
<999c2a18-0c4d-4a40-b88c-72d0ae5466bcn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b1d5e9b6-37be-4b26-9af6-4ace72adddb2n@googlegroups.com>
Subject: Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Fri, 21 Jan 2022 16:28:29 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 8
 by: Hans Bezemer - Fri, 21 Jan 2022 16:28 UTC

On Friday, January 21, 2022 at 12:23:56 PM UTC+1, Hans Bezemer wrote:
> Gotta test performance though..

Well, the figures are in:

DEFER: 109% versus a direct execution;
FORWARD: 111% versus a direct execution.

Hans Bezemer

FORWARD (was: 4tH question (was: ANN: 4tH version 3.64.0 ...))

<2022Jan21.194651@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16345&group=comp.lang.forth#16345

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: FORWARD (was: 4tH question (was: ANN: 4tH version 3.64.0 ...))
Date: Fri, 21 Jan 2022 18:46:51 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 49
Message-ID: <2022Jan21.194651@mips.complang.tuwien.ac.at>
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com> <FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com> <FmAYrhAgRIB@j.m> <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com> <66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com> <sse406$q5n$1@dont-email.me> <999c2a18-0c4d-4a40-b88c-72d0ae5466bcn@googlegroups.com> <b1d5e9b6-37be-4b26-9af6-4ace72adddb2n@googlegroups.com>
Injection-Info: reader02.eternal-september.org; posting-host="f3330af5c14adb39dd5848134bc45a5d";
logging-data="23419"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pqqfHOxLKqg1bfsU7NiIM"
Cancel-Lock: sha1:cIBTzl6X9fwpZ5dPZkgAgqqipE8=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Fri, 21 Jan 2022 18:46 UTC

Hans Bezemer <the.beez.speaks@gmail.com> writes:
>On Friday, January 21, 2022 at 12:23:56 PM UTC+1, Hans Bezemer wrote:
>> Gotta test performance though..
>
>Well, the figures are in:
>
>DEFER: 109% versus a direct execution;
>FORWARD: 111% versus a direct execution.

Gforth has had a FORWARD in forward.fs for three years, and, since
today, available from the start; this FORWARD works only for colon
definitions and should not cost any performance. Here's a
microbenchmark:

forward foo1
defer foo2
: bar1 foo1 ;
: bar2 foo2 ;
: foo1 ; \ resolves the FORWARD FOO1 above
' foo1 is foo2
: bar3 foo1 ; \ direct call of the colon definition FOO1
: bench1 100000000 0 do bar1 bar1 bar1 bar1 bar1 bar1 bar1 bar1 bar1 bar1 loop ;
: bench2 100000000 0 do bar2 bar2 bar2 bar2 bar2 bar2 bar2 bar2 bar2 bar2 loop ;
: bench3 100000000 0 do bar3 bar3 bar3 bar3 bar3 bar3 bar3 bar3 bar3 bar3 loop ;

The performance results on a Skylake (Core i5 6600K), measured with

for i in 1 2 3; do LC_NUMERIC=en_US.utf8 perf stat -B -e cycles:u -e instructions:u gforth-fast bench-forward.fs -e "bench$i bye"; done

are (cycles and instructions per bar* call):

cyc inst
8.6 25.1 bar1
11.7 28.1 bar2
9.6 25.1 bar3

It's not clear to me why BAR1 has a different performance from BAR3
(my guess is that code alignment played a role, this time with BAR1
being lucky), but in any case, you can see that the benefit of not
using DEFER is just 2 or 3 cycles and three instructions on Skylake.
Whether that benefit makes it worthwhile to use FORWARD rather than
DEFER is up to the reader to decide.

- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2021: https://euro.theforth.net/2021

Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)

<a329b597-349b-4db6-91a3-7755251aaaeen@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16364&group=comp.lang.forth#16364

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:2529:: with SMTP id gg9mr740054qvb.85.1642870493449;
Sat, 22 Jan 2022 08:54:53 -0800 (PST)
X-Received: by 2002:a05:620a:294f:: with SMTP id n15mr6421020qkp.419.1642870493290;
Sat, 22 Jan 2022 08:54:53 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 22 Jan 2022 08:54:53 -0800 (PST)
In-Reply-To: <sse406$q5n$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:ed:a704:7701:5971:bdad:2f0c:ab37;
posting-account=mrP5kgoAAADXISqI3e5f4EXLUinHClBq
NNTP-Posting-Host: 2003:ed:a704:7701:5971:bdad:2f0c:ab37
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>
<FmAYrhAgRIB@j.m> <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
<66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com> <sse406$q5n$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a329b597-349b-4db6-91a3-7755251aaaeen@googlegroups.com>
Subject: Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)
From: hheinric...@gmail.com (Heinrich Hohl)
Injection-Date: Sat, 22 Jan 2022 16:54:53 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Heinrich Hohl - Sat, 22 Jan 2022 16:54 UTC

On Friday, January 21, 2022 at 12:04:41 PM UTC+1, Ron AARON wrote:
> How are these better than the defer/is paradigm? Seems about the same to me.

"F: <name>" (forward definition) and "R: <name>" (resolve definition) are not better
than DEFER / IS.

In fact, the DEFER / IS method is more powerful because it allows you to change the behavior
of the deferred action as often as you like. In contrast, "R: <name>" has only one fixed action,
namely the one that you specify when you resolve the definition, and you cannot change this
action later on.

For certain applications you want just this: A forward reference for a word, but this word
is supposed to have only one behavior. For example, you may want to design and test
the menu tree of software using top-down design. With forward references, the menu works
and can be tested, although all menu entries are still no-ops because the bodies have not
been resolved yet..

In such cases, "F: <name>" and "R: <name>" are very convenient. For each word that you
define, you only need to specify one name. In case of DEFER, you also need a name
for the variable. This is not a big deal, but the forward/resolve method is easier to use
and in my opinion gives the code more clarity.

It is similar to using a CONSTANT instead of a VARIABLE in cases where the stored value
will be specified only once and is never changed later on.

I have used F: and R: in my descriptions, but the same thing applies to similar methods
such as the [FORWARD] directive presented above by Hans Bezemer.

Henry

Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)

<ssind3$4kg$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16368&group=comp.lang.forth#16368

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: clf...@8th-dev.com (Ron AARON)
Newsgroups: comp.lang.forth
Subject: Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)
Date: Sun, 23 Jan 2022 07:00:17 +0200
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <ssind3$4kg$1@dont-email.me>
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>
<FmAYrhAgRIB@j.m> <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
<66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com>
<sse406$q5n$1@dont-email.me>
<a329b597-349b-4db6-91a3-7755251aaaeen@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 23 Jan 2022 05:00:19 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2128a8c8ea3fe461d6870cb1724cf940";
logging-data="4752"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18mdYIzXRJisTFsMjc7vts+"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.5.0
Cancel-Lock: sha1:G0jN8exv/kEe0RaxHZ1a7psxGVM=
In-Reply-To: <a329b597-349b-4db6-91a3-7755251aaaeen@googlegroups.com>
Content-Language: en-US
 by: Ron AARON - Sun, 23 Jan 2022 05:00 UTC

On 22/01/2022 18:54, Heinrich Hohl wrote:
> On Friday, January 21, 2022 at 12:04:41 PM UTC+1, Ron AARON wrote:
>> How are these better than the defer/is paradigm? Seems about the same to me.
>
> "F: <name>" (forward definition) and "R: <name>" (resolve definition) are not better
> than DEFER / IS.
>
> In fact, the DEFER / IS method is more powerful because it allows you to change the behavior
> of the deferred action as often as you like. In contrast, "R: <name>" has only one fixed action,
> namely the one that you specify when you resolve the definition, and you cannot change this
> action later on.
>
> For certain applications you want just this: A forward reference for a word, but this word
> is supposed to have only one behavior. For example, you may want to design and test
> the menu tree of software using top-down design. With forward references, the menu works
> and can be tested, although all menu entries are still no-ops because the bodies have not
> been resolved yet..
>
> In such cases, "F: <name>" and "R: <name>" are very convenient. For each word that you
> define, you only need to specify one name. In case of DEFER, you also need a name
> for the variable. This is not a big deal, but the forward/resolve method is easier to use
> and in my opinion gives the code more clarity.
>
> It is similar to using a CONSTANT instead of a VARIABLE in cases where the stored value
> will be specified only once and is never changed later on.
>
> I have used F: and R: in my descriptions, but the same thing applies to similar methods
> such as the [FORWARD] directive presented above by Hans Bezemer.
>
> Henry

Thank you for that insight.I'd considered some 'forward' implementation
in the past for 8th, but haven't yet because I couldn't see any
particular advantage over defer/is.

However, code clarity is a consideration. I've already got a "deferred:"
word which creates a deferred word with initial code, just because it's
"nicer" in some way.

Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)

<ssingm$4kg$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16369&group=comp.lang.forth#16369

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: clf...@8th-dev.com (Ron AARON)
Newsgroups: comp.lang.forth
Subject: Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)
Date: Sun, 23 Jan 2022 07:02:14 +0200
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <ssingm$4kg$2@dont-email.me>
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>
<FmAYrhAgRIB@j.m> <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
<66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com>
<sse406$q5n$1@dont-email.me>
<999c2a18-0c4d-4a40-b88c-72d0ae5466bcn@googlegroups.com>
<b1d5e9b6-37be-4b26-9af6-4ace72adddb2n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 23 Jan 2022 05:02:15 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2128a8c8ea3fe461d6870cb1724cf940";
logging-data="4752"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++txSIEChjHiQSdRGBAQRq"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.5.0
Cancel-Lock: sha1:yfq/yJocF+n8kiAs6bmoq0cipgc=
In-Reply-To: <b1d5e9b6-37be-4b26-9af6-4ace72adddb2n@googlegroups.com>
Content-Language: en-US
 by: Ron AARON - Sun, 23 Jan 2022 05:02 UTC

On 21/01/2022 18:28, Hans Bezemer wrote:
> On Friday, January 21, 2022 at 12:23:56 PM UTC+1, Hans Bezemer wrote:
>> Gotta test performance though..
>
> Well, the figures are in:
>
> DEFER: 109% versus a direct execution;
> FORWARD: 111% versus a direct execution.
>
> Hans Bezemer

Ah, so no serious performance difference then. I'll bet real differences
would be on a per-CPU-class basis (older CPUs showing more difference
would be my guess).

Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)

<ssiqgl$sci$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16370&group=comp.lang.forth#16370

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)
Date: Sun, 23 Jan 2022 16:53:25 +1100
Organization: Aioe.org NNTP Server
Message-ID: <ssiqgl$sci$1@gioia.aioe.org>
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>
<FmAYrhAgRIB@j.m> <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
<66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com>
<sse406$q5n$1@dont-email.me>
<999c2a18-0c4d-4a40-b88c-72d0ae5466bcn@googlegroups.com>
<b1d5e9b6-37be-4b26-9af6-4ace72adddb2n@googlegroups.com>
<ssingm$4kg$2@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="29074"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.5.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Sun, 23 Jan 2022 05:53 UTC

On 23/01/2022 16:02, Ron AARON wrote:
>
>
> On 21/01/2022 18:28, Hans Bezemer wrote:
>> On Friday, January 21, 2022 at 12:23:56 PM UTC+1, Hans Bezemer wrote:
>>> Gotta test performance though..
>>
>> Well, the figures are in:
>>
>> DEFER: 109% versus a direct execution;
>> FORWARD: 111% versus a direct execution.
>>
>> Hans Bezemer
>
> Ah, so no serious performance difference then. I'll bet real differences
> would be on a per-CPU-class basis (older CPUs showing more difference
> would be my guess).

If speed matters, I'd be looking to defer at a higher level of abstraction
where the defer has negligible impact.

Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)

<ssir9e$lf7$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16371&group=comp.lang.forth#16371

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: clf...@8th-dev.com (Ron AARON)
Newsgroups: comp.lang.forth
Subject: Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)
Date: Sun, 23 Jan 2022 08:06:38 +0200
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <ssir9e$lf7$1@dont-email.me>
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>
<FmAYrhAgRIB@j.m> <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
<66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com>
<sse406$q5n$1@dont-email.me>
<999c2a18-0c4d-4a40-b88c-72d0ae5466bcn@googlegroups.com>
<b1d5e9b6-37be-4b26-9af6-4ace72adddb2n@googlegroups.com>
<ssingm$4kg$2@dont-email.me> <ssiqgl$sci$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 23 Jan 2022 06:06:38 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2128a8c8ea3fe461d6870cb1724cf940";
logging-data="21991"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX185+TBUhfQtYmDOeCsP6Cnx"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.5.0
Cancel-Lock: sha1:EfISywe5jM9mTUGKIybQpeWyS+0=
In-Reply-To: <ssiqgl$sci$1@gioia.aioe.org>
Content-Language: en-US
 by: Ron AARON - Sun, 23 Jan 2022 06:06 UTC

On 23/01/2022 7:53, dxforth wrote:
> On 23/01/2022 16:02, Ron AARON wrote:
>>
>>
>> On 21/01/2022 18:28, Hans Bezemer wrote:
>>> On Friday, January 21, 2022 at 12:23:56 PM UTC+1, Hans Bezemer wrote:
>>>> Gotta test performance though..
>>>
>>> Well, the figures are in:
>>>
>>> DEFER: 109% versus a direct execution;
>>> FORWARD: 111% versus a direct execution.
>>>
>>> Hans Bezemer
>>
>> Ah, so no serious performance difference then. I'll bet real differences
>> would be on a per-CPU-class basis (older CPUs showing more difference
>> would be my guess).
>
> If speed matters, I'd be looking to defer at a higher level of abstraction
> where the defer has negligible impact.

Such as (perhaps) conditionally compiling different versions?

Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)

<ssj114$t5k$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16373&group=comp.lang.forth#16373

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)
Date: Sun, 23 Jan 2022 18:44:35 +1100
Organization: Aioe.org NNTP Server
Message-ID: <ssj114$t5k$1@gioia.aioe.org>
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>
<FmAYrhAgRIB@j.m> <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
<66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com>
<sse406$q5n$1@dont-email.me>
<999c2a18-0c4d-4a40-b88c-72d0ae5466bcn@googlegroups.com>
<b1d5e9b6-37be-4b26-9af6-4ace72adddb2n@googlegroups.com>
<ssingm$4kg$2@dont-email.me> <ssiqgl$sci$1@gioia.aioe.org>
<ssir9e$lf7$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="29876"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.5.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Sun, 23 Jan 2022 07:44 UTC

On 23/01/2022 17:06, Ron AARON wrote:
>
>
> On 23/01/2022 7:53, dxforth wrote:
>> On 23/01/2022 16:02, Ron AARON wrote:
>>>
>>>
>>> On 21/01/2022 18:28, Hans Bezemer wrote:
>>>> On Friday, January 21, 2022 at 12:23:56 PM UTC+1, Hans Bezemer wrote:
>>>>> Gotta test performance though..
>>>>
>>>> Well, the figures are in:
>>>>
>>>> DEFER: 109% versus a direct execution;
>>>> FORWARD: 111% versus a direct execution.
>>>>
>>>> Hans Bezemer
>>>
>>> Ah, so no serious performance difference then. I'll bet real differences
>>> would be on a per-CPU-class basis (older CPUs showing more difference
>>> would be my guess).
>>
>> If speed matters, I'd be looking to defer at a higher level of abstraction
>> where the defer has negligible impact.
>
> Such as (perhaps) conditionally compiling different versions?

Were I at the point where the difference mattered, I suspect I'd be having
speed issues everywhere. Defer would be the least of my problems (nor the
solution).

Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)

<ssj87d$nfm$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16375&group=comp.lang.forth#16375

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: clf...@8th-dev.com (Ron AARON)
Newsgroups: comp.lang.forth
Subject: Re: 4tH question (was: ANN: 4tH version 3.64.0 ...)
Date: Sun, 23 Jan 2022 11:47:25 +0200
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <ssj87d$nfm$1@dont-email.me>
References: <9822630a-8683-49f3-a5c0-bce8568076ccn@googlegroups.com>
<FmAYnqFgRIB@j.m> <d1618638-6a58-4b3e-b0a5-467d13af5b03n@googlegroups.com>
<FmAYrhAgRIB@j.m> <e2bdf763-840c-47ad-820f-71c4b3cb5a21n@googlegroups.com>
<66e341aa-78e3-4b0c-b2e1-d17ff3653cd2n@googlegroups.com>
<sse406$q5n$1@dont-email.me>
<999c2a18-0c4d-4a40-b88c-72d0ae5466bcn@googlegroups.com>
<b1d5e9b6-37be-4b26-9af6-4ace72adddb2n@googlegroups.com>
<ssingm$4kg$2@dont-email.me> <ssiqgl$sci$1@gioia.aioe.org>
<ssir9e$lf7$1@dont-email.me> <ssj114$t5k$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 23 Jan 2022 09:47:25 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2128a8c8ea3fe461d6870cb1724cf940";
logging-data="24054"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186I8f7vjq+FWIO5Q1xG6CI"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.5.0
Cancel-Lock: sha1:MBEJt2+dSzyeeNeRfSnhmgJrMPY=
In-Reply-To: <ssj114$t5k$1@gioia.aioe.org>
Content-Language: en-US
 by: Ron AARON - Sun, 23 Jan 2022 09:47 UTC

On 23/01/2022 9:44, dxforth wrote:
> On 23/01/2022 17:06, Ron AARON wrote:
>>
>>
>> On 23/01/2022 7:53, dxforth wrote:
>>> On 23/01/2022 16:02, Ron AARON wrote:
>>>>
>>>>
>>>> On 21/01/2022 18:28, Hans Bezemer wrote:
>>>>> On Friday, January 21, 2022 at 12:23:56 PM UTC+1, Hans Bezemer wrote:
>>>>>> Gotta test performance though..
>>>>>
>>>>> Well, the figures are in:
>>>>>
>>>>> DEFER: 109% versus a direct execution;
>>>>> FORWARD: 111% versus a direct execution.
>>>>>
>>>>> Hans Bezemer
>>>>
>>>> Ah, so no serious performance difference then. I'll bet real
>>>> differences
>>>> would be on a per-CPU-class basis (older CPUs showing more difference
>>>> would be my guess).
>>>
>>> If speed matters, I'd be looking to defer at a higher level of
>>> abstraction
>>> where the defer has negligible impact.
>>
>> Such as (perhaps) conditionally compiling different versions?
>
> Were I at the point where the difference mattered, I suspect I'd be having
> speed issues everywhere.  Defer would be the least of my problems (nor the
> solution).

That's my take on it as well.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor