To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.pbforthOpen lugnet.robotics.rcx.pbforth in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / pbFORTH / 317
316  |  318
Subject: 
Re: Standard extension suggestions
Newsgroups: 
lugnet.robotics.rcx.pbforth
Date: 
Mon, 8 May 2000 17:08:56 GMT
Reply-To: 
SJM@JUDGEMENTstopspammers.COM
Viewed: 
1622 times
  
Jeffrey Hazen wrote:

I think this would be a good idea, even if they never incorporated into the
"official" kernel.  Sort of a code repository similar to what has been
proposed for NQC.

That said, the thing that intimidates me is my lack of any experience with
the software tools required.  I am not a software guy.  I do some work in
VC++.  I did a little Peeking and Poking on a Commadore 64 once, but gnu,
tcl, and all the other TLA's (three letter acronyms) have vague and ominous
meaning to me.  I'd like to try, but my available time and my perception of
the learning curve keep me from jumping in.  I sure am spoiled by IDE's
like rcxCC.

Now, in all fairness, I haven't tried at all.  Maybe it isn't as daunting
as I think.  Is it??

It is hard for me to tell. It is not hard for
me but I am a programmer with many years under
his belt.

However forth seems idealy suited for someone
getting started. It is a very interactive
environment which encourages experimentation.

Let me describe how I program on the RCX and it
may give you a better feel. I will assume that
forth is loaded and that a terminal window
is properly configured.

Basically I fire up the terminal and start typing.
The cool thing is that you talk directly to
pbforth in the RCX.

So what do I type? Well first I start to play.
I want to change what is on the LCD display so
I browse through Ralph's rcx extensions and find
ones related to LCD. So I try:

LCD_CLEAR

nothing happens. I go back to the doc and notice
that the LCD doesn't change until I invoke the
LCD_REFRESH word. So I type that and lo and behold
the LCD blanks out. Cool. Now I get adventuresome
and go for two commands on the same line:

LCD_4TH LCD_REFRESH

The display is back. We're rolling here. Now I'm
getting a little annoyed at typing so many letters
so I make some shortcuts by defining two new
words called "cls" and "on."

ok
: cls LCD_CLEAR LCD_REFRESH ;
ok
: on LCD_FORTH LCD_REFRESH ;
ok

Mind you I am still talking to the RCX just typing.
So I try my new words

ok
cls
ok

The screen is blank

  on
ok

The 4th logo is back. In 5 minutes I have written two
programs and am ready to start harder things. Whenever
I want to run those programs I type them. Later I
may create a new program (actually in forth you add
words) which uses these. I keep making simple
words and test them and then make new words which
use the previous ones.

I created here the simplest possible forth words
where the new words invoke simple list of existing
words. I haven't even used any parameters but that's
the point. Simple things are simple to do. You don't
have to learn a complex environment and language
grammar and syntax just to get started. You can
grow into the harder things one step at a time.

I tend to create hundreds of little words, each
seldom more than 5-10 words long. That means I
seldom have to debug more than 5-10 words at a time.

Eventually you need to figure out how to save and
download your work in case the batteries go or
you are switching between firmware but you can ignore
that in the beginning. Eventually you need to figure
out conditional execution (IF/ELSE) or how to do things
in loops and how to save values for later use etc. etc.
but you don't need these things to get started.

The key is that you are not writing programs
in some editor and then compiling and then sending
the programs to the RCX and then running them. It's
more like sitting at the screen of your Commadore
and typing things. Of course you can and will write
bigger words in a text editor but usually you
experiment first while typing at the pbforth
command prompt.

The only thing the RCX doesn't have is a disk to save
things, however the RAM is battery backed up so the
words that you defined earlier are still there when
you power up again.

The key features that make forth a good starter language
are that the syntax is extremely simple to learn
and the language is interactive. You type and something
happens.

Regards



Message is in Reply To:
  RE: Standard extension suggestions
 
I think this would be a good idea, even if they never incorporated into the "official" kernel. Sort of a code repository similar to what has been proposed for NQC. That said, the thing that intimidates me is my lack of any experience with the (...) (25 years ago, 8-May-00, to lugnet.robotics.rcx.pbforth)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR