vino816 Forth design

Topics relating to various Forth models on the 6502, 65816, and related microprocessors and microcontrollers.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: vino816 Forth design

Post by BigEd »

Very good point John!
Hugh Aguilar
Posts: 158
Joined: 03 Jun 2016

Re: vino816 Forth design

Post by Hugh Aguilar »

John West wrote:
Dr Jefyll wrote:
"Most computer applications boil down to searching and sorting."
BigEd wrote:
"I believe that virtually every important aspect of programming arises somewhere in the context of sorting or searching!" (Donald Knuth, The Art of Computer Programming, Volume 3, "Sorting and Searching")
It's worth noting that these two quotes are saying opposite things. The first is the one that people often think Knuth was saying, but if you read the preface to Vol. 3, it is clear that he was not. A bit more context makes it clear:
Knuth wrote:
The title “Sorting and Searching” may sound as if this book is only for those systems programmers who are concerned with the preparation of general-purpose sorting routines or applications to information retrieval. But in fact the area of sorting and searching provides an ideal framework for discussing a wide variety of important general issues:
  • How are good algorithms discovered?
    How can given algorithms and programs be improved?
    How can the efficiency of algorithms be analyzed mathematically?
    How can a person choose rationally between different algorithms for the same task?
    In what senses can algorithms be proved “best possible”?
    How does the theory of computing interact with practical considerations?
    How can external memories like tapes, drums, or disks be used efficiently with large databases?
Indeed, I believe that virtually every important aspect of programming arises somewhere in the context of sorting or searching!
A full exploration of sorting and searching will cover virtually everything that is important. None of those things are themselves sorting or searching.
Interesting point! This actually makes more sense
I had never understood the idea of all programs involving searching and sorting --- as I said above, this is not true for micro-controllers --- it is somewhat more plausible for desktop-computers, but still a pretty gross simplification.
So Donald Knuth was saying that studying searching and sorting allows the student to encounter most of the important aspects of programming --- that is more reasonable --- it is still not totally true though, as Donald Knuth takes a much more mathematical approach to programming than most people do (I would expect most high-school students are interested in writing a video game and have little or no interest in algorithmics).

Anyway, this thread has gone way OT. Why are we discussing Pascal?
I designed vino816 as a Forth system for the 65c816. I am not going to support quotations (anonymous nested functions) because the 65c816 lacks enough registers to have a local-frame pointer (as I said, a zero-page pointer could be used, but it would be slow). I am unlikely to implement vino816 because the chance of having any users is zilch --- if I did implement it, I would focus on supporting micro-controllers (as I said, accessing I/O ports, doing logic on data going in and out, and circular buffers) --- none of this has anything to do with Pascal, which is a desktop-computer language.

All of this discussion of Pascal seems to have started because I said that William Mensch may have been thinking of Pascal, but it would have to be a crippled version of Pascal without nested functions --- he may have been thinking of C, which is like a crippled Pascal (plus you get ugly syntax!) --- he definitely wasn't thinking about Forth.
Forth needs two stacks: a data-stack and a return-stack --- the 65c816 lacks support for a data-stack --- the X register can be used, but there is no pre-decrement or post-increment addressing-mode, so you get a lot of DEX DEX and INX INX code-sequences (as I said though; with peephole-optimization this can be reduced to some extent).
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: vino816 Forth design

Post by BigEd »

Yep, threads will follow topics which are mentioned, especially if mentioned in an overstated or controversial way. It is to some extent under your control.
User avatar
Dr Jefyll
Posts: 3526
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: vino816 Forth design

Post by Dr Jefyll »

Hugh Aguilar wrote:
William Mensch may have been thinking of Pascal
Is it important what Mensch (or any chip designer) was thinking? I mean, it's interesting, just as a matter of speculation. I get that -- don't have a problem with it.

But let's remember it's just fluff -- it has no practical value when it comes to working with the chip. The chip is what it is. If we have a job to do then let's get on with it!

Rather than Mensch's thoughts from decades ago, I'd rather read a thread focusing on a new Forth being created today :)
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
sark02
Posts: 241
Joined: 10 Nov 2015

Re: vino816 Forth design

Post by sark02 »

Hugh Aguilar wrote:
I am unlikely to implement vino816 because the chance of having any users is zilch
I've noticed that Forth enthusiasts around here spend more effort (and I'd suspect take more pleasure) in discussing Forth internals and building their own versions than in using an existing implementation or just using the language to do stuff. I get the feeling that it's somehow "Forth's way" to tinker, to get down in the mechanics, to tweak and experiment.

It also occurs to me (and this is pure speculation) that many if not all of these hobby implementations have zero users outside of the author. That's not a bad thing... like building your own computer, or any personal endeavor in the field, doing it is its own reward, and then you share it so that others might see that it's possible, or that it can be done this way vs. that way, or just because it's cool.

Point being: I think it's unfortunate that you'd not proceed with this simply because (a) nobody is paying you, and (b) nobody will use it. Seeing the number of posts you make it's clear that you have opinions on these things. Some garner support, some don't, but it's a subject you seem passionate about. Why not follow through... just for you?
User avatar
GaBuZoMeu
Posts: 660
Joined: 01 Mar 2017
Location: North-Germany

Re: vino816 Forth design

Post by GaBuZoMeu »

sark02 wrote:
Hugh Aguilar wrote:
I am unlikely to implement vino816 because the chance of having any users is zilch
I've noticed that Forth enthusiasts around here spend more effort (and I'd suspect take more pleasure) in discussing Forth internals and building their own versions than in using an existing implementation or just using the language to do stuff. I get the feeling that it's somehow "Forth's way" to tinker, to get down in the mechanics, to tweak and experiment.

It also occurs to me (and this is pure speculation) that many if not all of these hobby implementations have zero users outside of the author. That's not a bad thing... like building your own computer, or any personal endeavor in the field, doing it is its own reward, and then you share it so that others might see that it's possible, or that it can be done this way vs. that way, or just because it's cool.

Point being: I think it's unfortunate that you'd not proceed with this simply because (a) nobody is paying you, and (b) nobody will use it. Seeing the number of posts you make it's clear that you have opinions on these things. Some garner support, some don't, but it's a subject you seem passionate about. Why not follow through... just for you?
100% ACK
JimBoyd
Posts: 931
Joined: 05 May 2017

Re: vino816 Forth design

Post by JimBoyd »

sark02 wrote:
Hugh Aguilar wrote:
I am unlikely to implement vino816 because the chance of having any users is zilch
I've noticed that Forth enthusiasts around here spend more effort (and I'd suspect take more pleasure) in discussing Forth internals and building their own versions than in using an existing implementation or just using the language to do stuff. I get the feeling that it's somehow "Forth's way" to tinker, to get down in the mechanics, to tweak and experiment.

It also occurs to me (and this is pure speculation) that many if not all of these hobby implementations have zero users outside of the author. That's not a bad thing... like building your own computer, or any personal endeavor in the field, doing it is its own reward, and then you share it so that others might see that it's possible, or that it can be done this way vs. that way, or just because it's cool.

Point being: I think it's unfortunate that you'd not proceed with this simply because (a) nobody is paying you, and (b) nobody will use it. Seeing the number of posts you make it's clear that you have opinions on these things. Some garner support, some don't, but it's a subject you seem passionate about. Why not follow through... just for you?
If you don't implement it, you will not really know how sound your design is. By implementing vino816 you will be able to see how fast it really is, how much memory it consumes with a certain level of functionality, and confirm that it is a fully functional Forth. In short, implementing it is the one sure way to work out, or be certain you have worked out, any bugs in the design and see your speed vs. size tradeoffs.
Post Reply