6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 12:21 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Tue Jan 23, 2024 9:41 pm 
Offline

Joined: Sun Mar 19, 2023 2:04 pm
Posts: 137
Location: about an hour outside of Springfield
so I have an old i386 netbook,

is gforth on openbsd suitable for learning the basics of forth?
Im no fan of RPN for math, though I reckon I should at least get the basics

my primary reason for looking into forth are:

[list=][*]it will run in some fashion on 6502x
[*]it allows a simple interactive environment with files/scripts and can act as a calculator program for advanced maths
[*]it is constructed out of user created 'words'
[/list]
I am also interested in alternatives that satisfy these ideals, though that list inst really exhaustive I have other considerations as well, those are the main ones that are prompting my interest in forth

scheme, lisp, C and lua are also among my list, maybe erlang or haskell


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 23, 2024 9:55 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
wayfarer wrote:
is gforth on openbsd suitable for learning the basics of forth?

I'm not familiar with gforth, but I have little doubt that it would be suitable for learning the basics.

The classic place to start is Leo Brodie's book "Starting Forth" which is available online, free, at http://www.forth.com/starting-forth/index.html, somewhat modernized, but with the original cartoons.  I bought it on paper before we had the internet, and found it very easy to understand and latch onto, even though the machine I originally used on Forth on had a very unusual architecture (primarily a 4-bit data bus and 20-bit address bus, and therefore used a 20-bit cell size in Forth) which made for a minor challenge in implementation.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 24, 2024 2:38 pm 
Offline

Joined: Sun May 13, 2018 5:49 pm
Posts: 255
wayfarer wrote:
is gforth on openbsd suitable for learning the basics of forth?
Im no fan of RPN for math, though I reckon I should at least get the basics

GForth is fine. Once you have the basics down, I'll recommend Tali Forth 2 https://github.com/SamCoVT/TaliForth2 (although I am totally biased) if you'd like to try Forth on real 65C02 hardware - it's designed to be a subset of GForth so that programs written in Tali Forth 2 will also run in GForth. It can also run in a simulator if you want to try it without setting it up for your hardware. You can also try writing your own Forth, which is an experience to be had at least once.

In regards to the RPN - you'll get used to it and may even come to like it. I have an RPN calculator that I use almost daily, so I'm already a convert. There is a measure of joy to be had when you get the arguments to your words just right and don't have to do any (or minimal, at least) stack juggling. Before that, though, there will be lots of stack juggling (SWAP, OVER, ROT, etc), and that's fine while getting started.

I think exposure to Forth is good for any programmer - as it operates so differently than modern languages do. It makes you think in new ways that are beneficial even when programming in other languages, but it's also simple enough to peek under the hood and see how it works inside.

Regardless of the path you take on your Forth adventure, we'd love to hear your thoughts, things you find interesting, or any questions you may have.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 30, 2024 9:21 pm 
Offline

Joined: Wed Aug 21, 2019 6:10 pm
Posts: 217
I used gforth heavily in the late 90's when I was in Australia, including on a floppy-only laptop on which I ran the floppy-Linux distribution muLinux.

While I originally learned Forth on a fig-Forth based system running on a single disk C64 system, learning Forth with a more modern "large desktop" style distribution seems like a good approach, since you can focus on the programming without spending a lot of time working around resource limitations.

You can edit files in the text editor you are used to and then tab over to the window running Forth and INCLUDE it ... You can explore on the command line and then go to the history file and copy and paste a successful definition into an INCLUDE file ... etc.

Now, Forth is good at coping with resource limitations, and resource limited systems are where we often see Forth still being used, but if working through something like "Starting Forth" and "Thinking Forth", I reckon it's fine to focus on getting a hang of the language and then you'll be in a position to work with a small Forth on a small system.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 31, 2024 5:27 am 
Offline

Joined: Wed Jan 03, 2007 3:53 pm
Posts: 64
Location: Sunny So Cal
GARTHWILSON wrote:
a very unusual architecture (primarily a 4-bit data bus and 20-bit address bus, and therefore used a 20-bit cell size in Forth


Well, don't leave us guessing. What on earth was it?

_________________
Machine room: http://www.floodgap.com/etc/machines.html


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 31, 2024 6:23 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
6502inside wrote:
GARTHWILSON wrote:
a very unusual architecture (primarily a 4-bit data bus and 20-bit address bus, and therefore used a 20-bit cell size in Forth

Well, don't leave us guessing. What on earth was it?

It's the handheld Hewlett-Packard HP-71B.  See viewtopic.php?p=77595#p77595 .
The mainframe has by far the best BASIC I've ever seen, built in (just my BASIC takes up something like 160KB; so no, it'd never fit in a 6502's memory map, let alone leave any room to add your code); but I also have the Forth plug-in module (as well as others).  It has the Saturn processor which was also used in a lot of other HP models, and was later emulated with an ARM in the 50g, I believe.  The 71's Forth wasn't nearly as good as its BASIC; but since it's Forth, I was able to make big improvements to it.

If you want to see something really strange, there's a Forth for the HP41 calculator/computer as well; but I think it was mostly just to show that it could be done, rather than being for any practical use.  The 41 uses the Nut processor, with 56-bit registers, RAM having 56-bit registers consisting of seven bytes each, ROM having 10-bit "bytes," the data bus being bit-serial, and clock being 375kHz.  I am not experienced with this Forth; but these things, plus others, tell me it can't possibly be practical.  The text editor, which I assume you'd use for editing source-code files, is very slow, particularly to insert or delete things in a sizeable file.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: