Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

This screen intentionally left blank.


devel / comp.lang.forth / Re: Examples of non-trivial oop

SubjectAuthor
* Examples of non-trivial oopalbert
+- Re: Examples of non-trivial oopBranimir Maksimovic
`* Re: Examples of non-trivial oopHugh Aguilar
 +- Re: Examples of non-trivial oopdxforth
 `* Re: Examples of non-trivial oopHugh Aguilar
  `* Re: Examples of non-trivial oopHugh Aguilar
   `- Re: Examples of non-trivial oopdxforth

1
Examples of non-trivial oop

<nnd$76c12e60$7de651cb@a80a926208697912>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
From: alb...@SPENARNC.XS4ALL.NL
Subject: Examples of non-trivial oop
Organization: HCC!FORTH
Newsgroups: comp.lang.forth
Summary:
Keywords:
Message-ID: <nnd$76c12e60$7de651cb@a80a926208697912>
Date: Thu, 14 Oct 2021 10:28:55 +0200
Path: rocksolid2!i2pn.org!news.swapon.de!news.mixmin.net!feed.abavia.com!abe002.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 16
Injection-Date: Thu, 14 Oct 2021 10:28:55 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: alb...@SPENARNC.XS4ALL.NL - Thu, 14 Oct 2021 08:28 UTC

The following programs exhibit a essential use of Object
Oriented techniques:
- ciasdis , who (in)famously analysed colorforth, disassemble and reassemble
- manx2, who plays multi part, polyphonic music on instruments with varying drivers,

percussion and during tone.
The bad news is that is based on a one screen mini-oop.
The challenge :
show me one sophisticated program, that takes advantage from
features they are advocated
- or show me how these programs could be simplified by
more advanced oop.
Am I applying oop to the more involved programs?
Groetjes Albert

Re: Examples of non-trivial oop

<QFT9J.37009$j52.1572@fx18.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: rocksolid2!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx18.iad.POSTED!not-for-mail
Newsgroups: comp.lang.forth
From: branimir...@icloud.com (Branimir Maksimovic)
Subject: Re: Examples of non-trivial oop
References: <nnd$76c12e60$7de651cb@a80a926208697912>
User-Agent: slrn/1.0.3 (Darwin)
Lines: 27
Message-ID: <QFT9J.37009$j52.1572@fx18.iad>
X-Complaints-To: abuse@usenet-news.net
NNTP-Posting-Date: Thu, 14 Oct 2021 10:31:12 UTC
Organization: usenet-news.net
Date: Thu, 14 Oct 2021 10:31:12 GMT
X-Received-Bytes: 1516
 by: Branimir Maksimovic - Thu, 14 Oct 2021 10:31 UTC

On 2021-10-14, albert@SPENARNC.XS4ALL.NL <albert@SPENARNC.XS4ALL.NL> wrote:
> The following programs exhibit a essential use of Object
> Oriented techniques:
> - ciasdis , who (in)famously analysed colorforth, disassemble and reassemble
> - manx2, who plays multi part, polyphonic music on instruments with varying drivers,
>
> percussion and during tone.
> The bad news is that is based on a one screen mini-oop.
> The challenge :
> show me one sophisticated program, that takes advantage from
> features they are advocated
> - or show me how these programs could be simplified by
> more advanced oop.
> Am I applying oop to the more involved programs?
> Groetjes Albert
>

oop is just vtable, that is table of pointers to
functions. Else is composition, embedding data into
data :P
And finally data hiding...

--

7-77-777
Evil Sinner!
with software, you repeat same experiment, expecting different results...

Re: Examples of non-trivial oop

<0308b31e-2fd1-4988-bb99-05e848bbcab0n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:17a9:: with SMTP id ay41mr8290212qkb.452.1634274970915;
Thu, 14 Oct 2021 22:16:10 -0700 (PDT)
X-Received: by 2002:ac8:15a:: with SMTP id f26mr11414220qtg.248.1634274970798;
Thu, 14 Oct 2021 22:16:10 -0700 (PDT)
Path: rocksolid2!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: Thu, 14 Oct 2021 22:16:10 -0700 (PDT)
In-Reply-To: <nnd$76c12e60$7de651cb@a80a926208697912>
Injection-Info: google-groups.googlegroups.com; posting-host=159.118.226.178; posting-account=OxDKOgoAAADW0cxAqHqpN1zqeCoSsDap
NNTP-Posting-Host: 159.118.226.178
References: <nnd$76c12e60$7de651cb@a80a926208697912>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0308b31e-2fd1-4988-bb99-05e848bbcab0n@googlegroups.com>
Subject: Re: Examples of non-trivial oop
From: hughagui...@gmail.com (Hugh Aguilar)
Injection-Date: Fri, 15 Oct 2021 05:16:10 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 10
 by: Hugh Aguilar - Fri, 15 Oct 2021 05:16 UTC

On Thursday, October 14, 2021 at 1:30:03 AM UTC-7, alb...@spenarnc.xs4all.nl wrote:
> The challenge :
> show me one sophisticated program, that takes advantage from
> features they are advocated

My MSP430 assembler HJA430 uses my LIST.4TH and rquotations.
https://board.flatassembler.net/topic.php?t=21841

You would presumably not consider this to be a sophisticated program.
I don't actually consider it to be very sophisticated either --- it was easy.
All of my programs use LIST.4TH --- all of them were easy to write.

Re: Examples of non-trivial oop

<skbbe0$42k$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: rocksolid2!news.neodome.net!news.mixmin.net!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Examples of non-trivial oop
Date: Fri, 15 Oct 2021 18:42:55 +1100
Organization: Aioe.org NNTP Server
Message-ID: <skbbe0$42k$1@gioia.aioe.org>
References: <nnd$76c12e60$7de651cb@a80a926208697912>
<0308b31e-2fd1-4988-bb99-05e848bbcab0n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="4180"; 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:78.0) Gecko/20100101
Thunderbird/78.14.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Fri, 15 Oct 2021 07:42 UTC

On 15/10/2021 16:16, Hugh Aguilar wrote:
> On Thursday, October 14, 2021 at 1:30:03 AM UTC-7, alb...@spenarnc.xs4all.nl wrote:
>> The challenge :
>> show me one sophisticated program, that takes advantage from
>> features they are advocated
>
> My MSP430 assembler HJA430 uses my LIST.4TH and rquotations.
> https://board.flatassembler.net/topic.php?t=21841

"I don't want others to follow me --- that is why I don't provide source-code."

In the absence of which there is no reason to believe.

>
> You would presumably not consider this to be a sophisticated program.
> I don't actually consider it to be very sophisticated either --- it was easy.
> All of my programs use LIST.4TH --- all of them were easy to write.
>

Re: Examples of non-trivial oop

<2d2b1a41-935b-4a6b-bd26-40d9dd9ca1bbn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ae9:e887:: with SMTP id a129mr16322919qkg.81.1634419346736;
Sat, 16 Oct 2021 14:22:26 -0700 (PDT)
X-Received: by 2002:a05:6214:154d:: with SMTP id t13mr18448188qvw.40.1634419346565;
Sat, 16 Oct 2021 14:22:26 -0700 (PDT)
Path: rocksolid2!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: Sat, 16 Oct 2021 14:22:26 -0700 (PDT)
In-Reply-To: <0308b31e-2fd1-4988-bb99-05e848bbcab0n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.174.192.66; posting-account=OxDKOgoAAADW0cxAqHqpN1zqeCoSsDap
NNTP-Posting-Host: 98.174.192.66
References: <nnd$76c12e60$7de651cb@a80a926208697912> <0308b31e-2fd1-4988-bb99-05e848bbcab0n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2d2b1a41-935b-4a6b-bd26-40d9dd9ca1bbn@googlegroups.com>
Subject: Re: Examples of non-trivial oop
From: hughagui...@gmail.com (Hugh Aguilar)
Injection-Date: Sat, 16 Oct 2021 21:22:26 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 42
 by: Hugh Aguilar - Sat, 16 Oct 2021 21:22 UTC

On Thursday, October 14, 2021 at 10:16:11 PM UTC-7, Hugh Aguilar wrote:
> On Thursday, October 14, 2021 at 1:30:03 AM UTC-7, alb...@spenarnc.xs4all.nl wrote:
> > The challenge :
> > show me one sophisticated program, that takes advantage from
> > features they are advocated
> My MSP430 assembler HJA430 uses my LIST.4TH and rquotations.
> https://board.flatassembler.net/topic.php?t=21841

I rely heavily on inheritance. My LIST.4TH is my work-horse and it has a lot of
features that are useful for application programs --- so, inheritance is the key.
I don't have polymorphism --- I don't consider that to be useful, and it is hard to do.

Here we have had this thread:
https://groups.google.com/g/comp.lang.forth/c/WYGu4YFhhas

On Wednesday, October 13, 2021 at 5:17:00 PM UTC-7, Doug Hoffman wrote:
> On 10/13/21 6:02 PM, Ruvim wrote:
> > One of basic OOP features is encapsulation. So it's very unexpected to
> > an OOP model to not isolate instance variable accessors of different
> > classes from each other (and even from other code out of the classes).
> >
> > As I can see, a sound OOP model cannot be implemented without utilizing
> > namespaces.
> I won't disagree. You have seen a version that encapsulates using
> wordlist primitives. It would not be hard to incorporate that or maybe
> provide encapsulation in some other way that you like.

This focus on polymorphism is impractical.
The Forth-200x committee have never succeeded in implementing a
general-purpose linked-list. Peter Knaggs attempt was grossly incompetent:
https://groups.google.com/g/comp.lang.forth/c/cMa8wV3OiY0/m/INBDVBh0BgAJ
The Forth-200x committe would fail badly at writing an MSP430 assembler
comparable to my HJA430 --- it was easy though, given LIST.4TH.
On that FASM thread I said this:
----------------------------------------------------------
....the code-blocks have a list of lists. The first node is the first level, the second node
is the second level, etc.. Each node is a list of forward references that have to be resolved
when the code block finishes with }, and this code block is then removed from the list of lists
so that what was the second node is now the first level.
----------------------------------------------------------
This is not sophisticated programming --- this is basic OOP programming that any
high-school student would be familiar with --- the Forth-200x committee worry about
polymorphism, but they don't really know anything about practical programming.

Re: Examples of non-trivial oop

<9f575e5d-1b47-4b8e-93c9-b4438087242en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:411d:: with SMTP id q29mr22807114qtl.46.1634426158513;
Sat, 16 Oct 2021 16:15:58 -0700 (PDT)
X-Received: by 2002:a05:622a:14:: with SMTP id x20mr22939703qtw.372.1634426158366;
Sat, 16 Oct 2021 16:15:58 -0700 (PDT)
Path: rocksolid2!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: Sat, 16 Oct 2021 16:15:58 -0700 (PDT)
In-Reply-To: <2d2b1a41-935b-4a6b-bd26-40d9dd9ca1bbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.174.192.66; posting-account=OxDKOgoAAADW0cxAqHqpN1zqeCoSsDap
NNTP-Posting-Host: 98.174.192.66
References: <nnd$76c12e60$7de651cb@a80a926208697912> <0308b31e-2fd1-4988-bb99-05e848bbcab0n@googlegroups.com>
<2d2b1a41-935b-4a6b-bd26-40d9dd9ca1bbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9f575e5d-1b47-4b8e-93c9-b4438087242en@googlegroups.com>
Subject: Re: Examples of non-trivial oop
From: hughagui...@gmail.com (Hugh Aguilar)
Injection-Date: Sat, 16 Oct 2021 23:15:58 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 73
 by: Hugh Aguilar - Sat, 16 Oct 2021 23:15 UTC

On Saturday, October 16, 2021 at 2:22:27 PM UTC-7, Hugh Aguilar wrote:
> The Forth-200x committee have never succeeded in implementing a
> general-purpose linked-list. Peter Knaggs attempt was grossly incompetent:
> https://groups.google.com/g/comp.lang.forth/c/cMa8wV3OiY0/m/INBDVBh0BgAJ
> The Forth-200x committe would fail badly at writing an MSP430 assembler
> comparable to my HJA430 --- it was easy though, given LIST.4TH.
> On that FASM thread I said this:
> ----------------------------------------------------------
> ...the code-blocks have a list of lists. The first node is the first level, the second node
> is the second level, etc.. Each node is a list of forward references that have to be resolved
> when the code block finishes with }, and this code block is then removed from the list of lists
> so that what was the second node is now the first level.
> ----------------------------------------------------------

On second thought, Peter Knaggs' idiotic attempt at linked-lists would work
for HJA430 (if Peter Knaggs actually wrote the code for it). The most idiotic
limitation of his design is that it is limited to structs that have only one cell-sized
field. In the case of HJA430 though, my structs do have only one cell-sized field.
So, this is a rare case in which Peter Knaggs' weird limitation would not be a problem.
Here is a small excerpt from my HJA430 code (that DXforth doesn't believe exists):
-------------------------------------------------------------------
list
w field .adr
constant adr

: init-adr \ adr node -- node
init-list >r
r@ .adr !
r> ;

: new-adr \ adr -- node
adr alloc
init-adr ;

: kill-adr \ head --
each[ dealloc ]each ;

\ Already defined are:
\ JUMPS this is an ADR list of ADR lists of forward jump-instruction addresses
\ BEGINS this is an ADR list of code-block beginning addresses

\ JUMPS is an ADR list. 1ST is the ADR list of jump instructions to >, 2ND of jump instructions to >>, etc..
\ BEGINS is an ADR list of destinations. 1ST is <, 2ND is <<, etc..
\ The code-blocks can be nested to any depth. At this time however, I only support <<<< <<< << < > >> >>> >>>> for jumps.
\ Jumping to great-grand-parents <<<< or >>>> is not recommended because this is ugly confusing code.
\ Code should be factored better and/or labels should be used to simplify the code blocks.
\ Conditional jumps to <<<< <<< << < > >> >>> >>>> are always 10-bit --- they abort if out-of-range.
\ The unconditional JMP does optimize as either a 10-bit <JMP> or a 16-bit GOTO if necessary.
\ The user must fix out-of-range jumps manually, typically using structured control-flow to hop over a GOTO.
\ I don't want hidden inefficiencies resulting from the assembler fixing problems automatically.
-------------------------------------------------------------------

JUMPS is for resolving forward references to the ends of the code blocks and
BEGINS is for holding the beginnings of the code blocks.
Also, the labels have an ADR list for resolving forward references to the label.

I originally had HJA430 optimize conditional jumps as an opposite-conditional hop over
an unconditional 16-bit jump. I dropped this for three reasons:

1.) There is always the cost of inserting NOP instructions to provide enough room.
This is only an issue with forward conditional jumps, not backward conditional jumps.

2.) This is almost never needed because a 10-bit jump is almost never out-of-range.
This was more of an issue in my 65c02 assembler because the offset was 8-bit,
but even then an out-of-range conditional jump was pretty rare.

3.) I don't like assemblers doing optimization internally because the user can't easily
determine how many clock-cycles his code takes without disassembly.

So, I got rid of the optimization.
In the rare cases that the 10-bit forward conditional jump is out-of-range, assembly aborts
with a helpful error-message and the user fixes the problem manually.
Backward conditional jumps do not get optimized despite the fact that #1 above
is not an issue --- #3 above is still an issue --- #2 above is also still true.

Re: Examples of non-trivial oop

<skfv9e$jt8$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: rocksolid2!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: Examples of non-trivial oop
Date: Sun, 17 Oct 2021 12:46:21 +1100
Organization: Aioe.org NNTP Server
Message-ID: <skfv9e$jt8$1@gioia.aioe.org>
References: <nnd$76c12e60$7de651cb@a80a926208697912>
<0308b31e-2fd1-4988-bb99-05e848bbcab0n@googlegroups.com>
<2d2b1a41-935b-4a6b-bd26-40d9dd9ca1bbn@googlegroups.com>
<9f575e5d-1b47-4b8e-93c9-b4438087242en@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="20392"; 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:78.0) Gecko/20100101
Thunderbird/78.14.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Sun, 17 Oct 2021 01:46 UTC

On 17/10/2021 10:15, Hugh Aguilar wrote:
>
> On second thought, Peter Knaggs' idiotic attempt at linked-lists would work
> for HJA430 (if Peter Knaggs actually wrote the code for it). The most idiotic
> limitation of his design is that it is limited to structs that have only one cell-sized
> field. In the case of HJA430 though, my structs do have only one cell-sized field.
> So, this is a rare case in which Peter Knaggs' weird limitation would not be a problem.
> Here is a small excerpt from my HJA430 code (that DXforth doesn't believe exists):
> ...

Teasing an audience with a doc but not the code only raises questions e.g.
'Why exactly did Hugh need linked lists, structs, rquotions etc for a forth
assembler?'. Pitching a forth assembler to non-forthers will likely be seen
as evidence of 'forth nuttiness'. More things they didn't need.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor