Oh, I forgot to add an example: the good example
is „snit” TCL package: https://core.tcl-lang.org/tcllib/doc/tcllib-1-18/embedded/www/tcllib/files/modules/snit/snit.html
Oh, I forgot to add an example: the good exampleCan you show a practical performance benchmark
is „snit” TCL package: https://core.tcl-lang.org/tcllib/doc/tcllib-1-18/embedded/www/tcllib/files/modules/snit/snit.html
against one of the established Forth OOP extensions
like SWOOP or FMS2?
„Apples to oranges”.Oh, I forgot to add an example: the good exampleCan you show a practical performance benchmark
is „snit” TCL package: https://core.tcl-lang.org/tcllib/doc/tcllib-1-18/embedded/www/tcllib/files/modules/snit/snit.html
against one of the established Forth OOP extensions
like SWOOP or FMS2?
What will tell you „performance benchmark” of an OOP package
prepared not just for different implementation, but for
completely different programming language?
No, I don't have such benchmark — and TCL itself is well-known
not being top-performer among scripting languages. Which doesn't
say anything about „delegation” model of OOP.
Referring to tcl is not sufficient, to go study it.
A few examples that this style of programming is valuable could
do it.
No, I didn't even try to prepare anything like this for Forth;
I simply feel no need to do Forth more OOP-ed than its
„standard” tools (like CREATE DOES) allowed since years.
No, I didn't even try to prepare anything like this for Forth;
I simply feel no need to do Forth more OOP-ed than its
„standard” tools (like CREATE DOES) allowed since years.
Referring to tcl is not sufficient, to go study it.
A few examples that this style of programming is valuable could
do it.
Several examples — of course, TCL examples — are on the linked
„snit” page.
Zbig schrieb am Dienstag, 5. September 2023 um 11:26:41 UTC+2:
No, I didn't even try to prepare anything like this for Forth;
I simply feel no need to do Forth more OOP-ed than its
„standard” tools (like CREATE DOES) allowed since years.
Dick Pountain once wrote a whole book about object-oriented Forth
by stacking several CREATE DOES (BUILDS) structures over
each other. I found it rather intriguing at that time, although
many OO purists rejected it.
Dick Pountain once wrote a whole book about object-oriented Forth
by stacking several CREATE DOES (BUILDS) structures over
each other. I found it rather intriguing at that time, although
many OO purists rejected it.
Anyway, I have read the book, and found it interesting at the time.
But the more I learned about object-oriented programming, the more I
found that Pountain mostly missed the point. The essential part of
OOP is run-time polymorphism (dynamic binding). Most of the book does
not deal with this feature at all; IIRC only the last chapter even
concerns itself with this topic, and it does so in a clumsy and
inefficient way. So this book has rightly been ignored by everyone
who really implemented and used OOP in Forth.
Static polymorphism is limited indeed. But sufficient for many applications. >I wouldn't rule it out of the toolbox.
AFAIK C++ offers both: dynamic and static polymorphism.
Forth does not have this, and attempts to perform overloading
resolution in Forth have typically come out very messy, with
STATE-smartness and other atrocities everywhere. Now, after 40 years,
we know how to implement TO alone relatively cleanly, but as soon as
we add +TO and friends, it again becomes messy.
- anton
minforth <minf...@arcor.de> writes:Hi Anton,
Dick Pountain once wrote a whole book about object-oriented ForthNot sure what an OO purist is.
by stacking several CREATE DOES (BUILDS) structures over
each other. I found it rather intriguing at that time, although
many OO purists rejected it.
Anyway, I have read the book, and found it interesting at the time.
But the more I learned about object-oriented programming, the more I
found that Pountain mostly missed the point. The essential part of
OOP is run-time polymorphism (dynamic binding). Most of the book does
not deal with this feature at all; IIRC only the last chapter even
concerns itself with this topic, and it does so in a clumsy and
inefficient way. So this book has rightly been ignored by everyone
who really implemented and used OOP in Forth.
If you want to see how a minimalistic OOP package in Forth can look
like, look at <https://bernd-paysan.de/mini-oof.html>.
- 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: https://forth-standard.org/
EuroForth 2023: https://euro.theforth.net/2023
On Thursday, September 7, 2023 at 9:48:30 AM UTC+2, Anton Ertl wrote:processing languages.
minforth <minf...@arcor.de> writes:Hi Anton,
Dick Pountain once wrote a whole book about object-oriented ForthNot sure what an OO purist is.
by stacking several CREATE DOES (BUILDS) structures over
each other. I found it rather intriguing at that time, although
many OO purists rejected it.
Anyway, I have read the book, and found it interesting at the time.
But the more I learned about object-oriented programming, the more I
found that Pountain mostly missed the point. The essential part of
OOP is run-time polymorphism (dynamic binding). Most of the book does
not deal with this feature at all; IIRC only the last chapter even
concerns itself with this topic, and it does so in a clumsy and
inefficient way. So this book has rightly been ignored by everyone
who really implemented and used OOP in Forth.
If you want to see how a minimalistic OOP package in Forth can look
like, look at <https://bernd-paysan.de/mini-oof.html>.
- 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: https://forth-standard.org/
EuroForth 2023: https://euro.theforth.net/2023
You say "The essential part of OOP is run-time polymorphism", and I think you are right, in that what many ideas like OOP are trying to do is to get back some dynamic functionality, after it has been nailed down as static by one or other of the batch
I find it interesting that the Udemy course that I just took (mainly so I could speak to my colleagues in the language they were using) does not mention run-time polymorphism, nor any sort of binding, run-time, compile time etc.
This confirms my theory that "Object Oriented Programming" is a marketing concept that can mean whatever you want it to mean ;-)
You say "The essential part of OOP is run-time polymorphism", and I think y= >ou are right, in that what many ideas like OOP are trying to do is to get b= >ack some dynamic functionality, after it has been nailed down as static by = >one or other of the batch processing languages.
I find it interesting that the Udemy course that I just took (mainly so I c= >ould speak to my colleagues in the language they were using) does not menti= >on run-time polymorphism, nor any sort of binding, run-time, compile time e= >tc.
This confirms my theory that "Object Oriented Programming" is a marketing c= >oncept that can mean whatever you want it to mean ;-)
On Thursday, September 7, 2023 at 9:48:30 AM UTC+2, Anton Ertl wrote:processing languages.
minforth <minf...@arcor.de> writes:
Dick Pountain once wrote a whole book about object-oriented ForthNot sure what an OO purist is.
by stacking several CREATE DOES (BUILDS) structures over
each other. I found it rather intriguing at that time, although
many OO purists rejected it.
Anyway, I have read the book, and found it interesting at the time.
But the more I learned about object-oriented programming, the more I
found that Pountain mostly missed the point. The essential part of
OOP is run-time polymorphism (dynamic binding). Most of the book does
not deal with this feature at all; IIRC only the last chapter even concerns itself with this topic, and it does so in a clumsy and inefficient way. So this book has rightly been ignored by everyone
who really implemented and used OOP in Forth.
If you want to see how a minimalistic OOP package in Forth can look
like, look at <https://bernd-paysan.de/mini-oof.html>.
- antonHi 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: https://forth-standard.org/
EuroForth 2023: https://euro.theforth.net/2023
You say "The essential part of OOP is run-time polymorphism", and I think you are right, in that what many ideas like OOP are trying to do is to get back some dynamic functionality, after it has been nailed down as static by one or other of the batch
I find it interesting that the Udemy course that I just took (mainly so I could speak to my colleagues in the language they were using) does not mention run-time polymorphism, nor any sort of binding, run-time, compile time etc.
This confirms my theory that "Object Oriented Programming" is a marketing concept that can mean whatever you want it to mean ;-)
Cheers,
Howerd
Howerd <howerdo@yahoo.co.uk> writes:
You say "The essential part of OOP is run-time polymorphism", and I think y= >> ou are right, in that what many ideas like OOP are trying to do is to get b= >> ack some dynamic functionality, after it has been nailed down as static by = >> one or other of the batch processing languages.
I don't think so. Simula-67, C++, and Java embrace static
type-checking and the separation of compile time and run time. They
add dynamic dispatch not to get back something, but as a statically
safe way to attack problems whose existence is denied or treated as irrelevant by those in clf who deny the value of OOP.
I find it interesting that the Udemy course that I just took (mainly so I c= >> ould speak to my colleagues in the language they were using) does not menti= >> on run-time polymorphism, nor any sort of binding, run-time, compile time e= >> tc.
This confirms my theory that "Object Oriented Programming" is a marketing c= >> oncept that can mean whatever you want it to mean ;-)
That's true of any popular term; Humpty Dumpty knew that. A few days
ago, I heard or read the story of an Evangelical Christian who reacted
to a story about Jesus read to her from the Holy Bible with something
along the lines that Jesus was far too left-wing.
Still we use terms with common meaning, not with Humpty Dumpty's
meaning. E.g., we look at Wikepdia what they mean.
Howerd <how...@yahoo.co.uk> writes:Hi Anton,
You say "The essential part of OOP is run-time polymorphism", and I think y=I don't think so. Simula-67, C++, and Java embrace static
ou are right, in that what many ideas like OOP are trying to do is to get b=
ack some dynamic functionality, after it has been nailed down as static by = >one or other of the batch processing languages.
type-checking and the separation of compile time and run time. They
add dynamic dispatch not to get back something, but as a statically
safe way to attack problems whose existence is denied or treated as irrelevant by those in clf who deny the value of OOP.
I find it interesting that the Udemy course that I just took (mainly so I c=That's true of any popular term; Humpty Dumpty knew that. A few days
ould speak to my colleagues in the language they were using) does not menti=
on run-time polymorphism, nor any sort of binding, run-time, compile time e=
tc.
This confirms my theory that "Object Oriented Programming" is a marketing c= >oncept that can mean whatever you want it to mean ;-)
ago, I heard or read the story of an Evangelical Christian who reacted
to a story about Jesus read to her from the Holy Bible with something
along the lines that Jesus was far too left-wing.
Still we use terms with common meaning, not with Humpty Dumpty's
meaning. E.g., we look at Wikepdia what they mean.
Concerning OOP, <https://en.wikipedia.org/wiki/Object-oriented_programming#Features>
lists a large number of features, but many of them tend to be not
universal. In the old times, I have seen definitions of
"object-oriented" that only listed three (in one case) or four (in
another definition) features that are necessary for an OO language. I
don't remember them all, but I think that classes, inheritance, and
garbage collection were listed.
* Prototype-based OO languages (e.g., Self, JavaScript) do without
classes.
* My collegue who teaches object-oriented programming recommends to
avoid inheritance, because inheritance often seduces the programmer
to violate Liskov's substitution principle.
* C++ does without garbage collection and the Wikipedia link above
does not list garbage collection.
While many OO languages have many features listed in Wikipedia as
features, maybe because they are useful for the goals of the
programming language, maybe because the languages that inspired the
new one have it (e.g., inheritance), the question a Forther may ask themselves is: What is the essential feature. And my answer to that
is: dynamic dispatch.
An example is the Unix VFS (virtual file system) interface. When you
do, say, a read() system call, it is dynamically dispatched to the
actual file system of the file you are accessing. You can consider
the file system type as the class of the file system; there is no inheritance, not even when a file system is actually derived from
another one (e.g. ext4 is derived from ext2). And there is no garbage collection. And it's all written in C.
- 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: https://forth-standard.org/
EuroForth 2023: https://euro.theforth.net/2023
An excellent summary. Has anyone compiled a list of the way OO Languages use and define OO?
It would be good to see the features and requirements listed for the popular OO languages, all on one page...
An excellent summary. Has anyone compiled a list of the way OO Languages us= >e and define OO?
I agree with the statement "The essential part of OOP is run-time >polymorphism". I think there is definitely a use case in Forth for
run-time polymorphism, but I also think it is kind of rare.
Years ago, the Whitewater Group developed a really cool proprietary
language called Actor (along with some other great stuff) that had lots of >great ideas that basically evolved Smalltalk up to the next level. One of >those ideas was selectively being able to label functions as Static or >Dynamic, which allowed the compiler to optimize. Unfortunately, the >Whitewater Group was purchased by Borland for their Windows abstraction
layer and they killed Actor.
Back to lurk mode,--
Ron Braithwaite
On 10/09/2023 1:29 am, Anton Ertl wrote:
Still we use terms with common meaning, not with Humpty Dumpty's
meaning. E.g., we look at Wikepdia what they mean.
Wikipedia is more than common meaning. It has set itself up as authority.
The OOP page includes Leo Brodie's criticism from 'Thinking FORTH' (another >authority apparently). This was too much for one reader (see Talk page)
who took the view only criticism from 'recognized' authorities be used - if >at all.
On Friday, September 8, 2023 at 11:45:07 AM UTC-7, Howerd wrote:processing languages.
On Thursday, September 7, 2023 at 9:48:30 AM UTC+2, Anton Ertl wrote:
minforth <minf...@arcor.de> writes:
Dick Pountain once wrote a whole book about object-oriented ForthNot sure what an OO purist is.
by stacking several CREATE DOES (BUILDS) structures over
each other. I found it rather intriguing at that time, although
many OO purists rejected it.
Anyway, I have read the book, and found it interesting at the time.
But the more I learned about object-oriented programming, the more I found that Pountain mostly missed the point. The essential part of
OOP is run-time polymorphism (dynamic binding). Most of the book does not deal with this feature at all; IIRC only the last chapter even concerns itself with this topic, and it does so in a clumsy and inefficient way. So this book has rightly been ignored by everyone
who really implemented and used OOP in Forth.
If you want to see how a minimalistic OOP package in Forth can look like, look at <https://bernd-paysan.de/mini-oof.html>.
- antonHi 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: https://forth-standard.org/
EuroForth 2023: https://euro.theforth.net/2023
You say "The essential part of OOP is run-time polymorphism", and I think you are right, in that what many ideas like OOP are trying to do is to get back some dynamic functionality, after it has been nailed down as static by one or other of the batch
able to label functions as Static or Dynamic, which allowed the compiler to optimize. Unfortunately, the Whitewater Group was purchased by Borland for their Windows abstraction layer and they killed Actor.I find it interesting that the Udemy course that I just took (mainly so I could speak to my colleagues in the language they were using) does not mention run-time polymorphism, nor any sort of binding, run-time, compile time etc.
This confirms my theory that "Object Oriented Programming" is a marketing concept that can mean whatever you want it to mean ;-)
Cheers,I agree with the statement "The essential part of OOP is run-time polymorphism". I think there is definitely a use case in Forth for run-time polymorphism, but I also think it is kind of rare.
Howerd
Years ago, the Whitewater Group developed a really cool proprietary language called Actor (along with some other great stuff) that had lots of great ideas that basically evolved Smalltalk up to the next level. One of those ideas was selectively being
I dropped out of the initial ANSI efforts in 1990 in order to go teach at the University of Zimbabwe, where one of the courses I taught was Object Oriented Programming with Actor. The Whitewater Group was kind enough to provide me with all sorts ofmaterials and free licenses for students. It was really well received and when Borland dropped it, I contacted the Product Manager. She told me that Borland had decided to focus on C++ and had dropped Actor because it competed with it. Really sad.
So, back to Forth, I am all in favor of having Object Oriented extensions that I could plug into a “standard” Forth without having to rewrite them from scratch.Hi Ron,
Back to lurk mode,
Ron Braithwaite
dxf <dxf...@gmail.com> writes:Hi Anton,
On 10/09/2023 1:29 am, Anton Ertl wrote:
Still we use terms with common meaning, not with Humpty Dumpty's
meaning. E.g., we look at Wikepdia what they mean.
Wikipedia is more than common meaning. It has set itself up as authority. Has it? Die Wikipedia send out troops that conquered the world anddemanded that everyone accepts it as authority?
My view is that Wikipedia is as authoritative as we accept. And I
personally find that it usually does quite well at definitions. In
the case of
<https://en.wikipedia.org/wiki/Object-oriented_programming> I don't
find that the first paragraph is a good definition of OOP (whereas for
other subjects the first sentence or first paragraph often is). It's
not wrong, but it fails to include essential parts.
The OOP page includes Leo Brodie's criticism from 'Thinking FORTH' (another >authority apparently). This was too much for one reader (see Talk page) >who took the view only criticism from 'recognized' authorities be used - if >at all.This writer does not mention Brodie or anybody else, and it's unclear
what he means.
Concerning Brodie's criticism, he writes in the preface to the 1994
edition:
|Of all the opinions in the book, the one that I most regret seeing in |print is my criticism of object-oriented programming. Since penning
|this book, I’ve had the pleasure of writing an application in a
|version of Forth with support for object-oriented programming,
|developed by Digalog Corp. of Ventura, California. I’m no expert, but |it’s clear that the methodology has much to offer.
Reading through the section in Thinking Forth called "No Segregation
Without Representation", he seems to have some specific program in
mind that claimed to use objects, and his criticism applies to that;
but given the lack of concreteness, I don't know what he actually
means. Some othe the things he criticises "objects" for are actually
things that OOP languages tends to make easy (e.g., the claimed lack
of extensibility).
He then goes on to criticise more concertely and rightly the IBM PC
BIOS interface, which leads to inefficiency in displaying text on the screen. The inefficiency has led to programs that directly write to
the video memory, and to the success of 100% IBM PC compatible
computers and the demise of BIOS-compatible computers. But this has
little to do with OOP. It's just an inefficient interface.
Interestingly, these days no application program writes directly to
video memory, but they also don't use character-by-character or pixel-by-pixel interfaces.
- 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: https://forth-standard.org/
EuroForth 2023: https://euro.theforth.net/2023
But what to think of my specification of my QSORT
8 \ Sort the range FIRST to LAST (inclusive) of item compared
9 \ by the xt COMPARING and exchanged by the xt EXHANGING.
10 \ The xt's are filled in into *< and *<--> and must observe the
11 \ interface. All indices be compatible with these xt's.
12 \ After the call we have that :
13 \ ``For FIRST<=I<J<=LAST I J *< EXECUTE leaves TRUE.''
This restricts the items to be sorted in no way.
If this count as polymorphism, I don't think is rare.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 47:04:06 |
Calls: | 6,710 |
Calls today: | 3 |
Files: | 12,243 |
Messages: | 5,354,365 |
Posted today: | 1 |