Boundary Conditions for 4tH Forth for the Raspberry Pi

72 views
Skip to first unread message

Peter Merchant

unread,
Feb 6, 2016, 10:12:05 AM2/6/16
to 4tH-compiler
Many years ago (79-80) I programmed a  communications protocol in Forth for the Telxon 718. The best programming of my life. 

Now I have a Raspberry Pi Zero, and want to use it to build a controller for a toy car. What I don't know and have not been able to find are the boundary limits of this 4tH? Does it have capability of controlling GPIO pins?   Can Wireless connectivity to the outside world be configured? Can it read from USB devices such as webcams?   As Forth is highly thought of as a Controller software  ( I notice that it is used on Philae) I thought it would have these features, but I cannot find them in the Manual. 

Any help welcomed.

PM


The Beez

unread,
Feb 6, 2016, 10:22:03 AM2/6/16
to 4tH-compiler


On Saturday, February 6, 2016 at 4:12:05 PM UTC+1, Peter Merchant wrote:
Now I have a Raspberry Pi Zero, and want to use it to build a controller for a toy car. What I don't know and have not been able to find are the boundary limits of this 4tH? Does it have capability of controlling GPIO pins?   Can Wireless connectivity to the outside world be configured? Can it read from USB devices such as webcams?   As Forth is highly thought of as a Controller software  ( I notice that it is used on Philae) I thought it would have these features, but I cannot find them in the Manual.

Well Peter, as you might have seen in the manual, 4tH is foremost a FRAMEWORK to either include into a larger program (as a scripting language) or to extend yourself. Both have been done. So the basic design makes it first and foremost a programmers tool - not an end user product.

However, through the years, people have taken a liking of the language itself, using the example programs (like 4tH, PP4tH and 4tsH) to do some programming. Sure, I have facilitated this use, in some sense giving the project a different direction - but without sacrificing the basic design objectives.

The long answer is: it can do everything you want, but you'll have to interface with the appropriate C libraries yourself. You have a lean 150 primitives to add if you want. Short answer is: you're looking for something that works out of the box - and that it isn't. Rule of the thumb: if it isn't supported by ANSI C, it isn't there.

Hans Bezemer

Ron K. Jeffries

unread,
Feb 6, 2016, 10:35:39 AM2/6/16
to 4th-co...@googlegroups.com
I assume (but am unsure) this question assumes using 4tH on top of Linux on the Raspi. FYI, a couple of the best libraries for low-level i/o on Raspi interface well with Python.

I have wondered if/when someone will choose to implement a FORTH (with solid low level i/o hooks) on top of a very skinny, minimalist OS. 

Ron K Jeffries

---
Ron K. Jeffries





--
You received this message because you are subscribed to the Google Groups "4tH-compiler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 4th-compiler...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hans Bezemer

unread,
Feb 6, 2016, 10:45:40 AM2/6/16
to 4th-co...@googlegroups.com
On Saturday 06 February 2016, Ron K. Jeffries wrote:
> I assume (but am unsure) this question assumes using 4tH on top of Linux on
> the Raspi. FYI, a couple of the best libraries for low-level i/o on Raspi
> interface well with Python.
I know Ron. There (Python) they built an interface. For a true professional I
think it will be breeze in the park to make an interface with the appropriate
libs. But things are not as easy as they seem. I'm not a H/W tinkerer, so I
can't properly test it. And there have been reports of C programs behaving
differently (timing stuff I guess) from Python.

So yes, I'll be happy to include some well built, well tested interface, but I
don't have the time, skill or means to facilitate it myself.

Hans Bezemer


--
No, I didn't wake up a grumpy nerd this morning. I'm a nerd. And I'm always
grumpy. This morning was no different.

Visit our website! http://thebeez.home.xs4all.nl/4tH/

*** Home of the 4tH compiler! ***

Peter Merchant

unread,
Feb 6, 2016, 1:52:16 PM2/6/16
to 4tH-compiler, han...@xs4all.nl
 Ron K. Jeffries wrote:
> I assume (but am unsure) this question assumes using 4tH on top of Linux on
> the Raspi.

Ah, I thought that 4tH was an operating system by  itself, and did not need an underlying OS. That is how I used Forth in the past.

More research needed. I must delve into the forum to see what answers and pointers I can find. I have programmed in 'c' but I wasn't a top-notch programmer in that. 

PM
 

Hans Bezemer

unread,
Feb 6, 2016, 5:53:43 PM2/6/16
to 4th-co...@googlegroups.com
On Saturday 06 February 2016, Peter Merchant wrote:
> More research needed. I must delve into the forum to see what answers and
> pointers I can find. I have programmed in 'c' but I wasn't a top-notch
> programmer in that.
4tH comes with a full development guide, Peter.

HB

Ron K. Jeffries

unread,
Feb 6, 2016, 7:29:29 PM2/6/16
to 4th-co...@googlegroups.com
In all fairness, running on bare metal was not (as I understand things) a design objective for 4tH. That's neither good nor bad, it just is.

---
Ron K. Jeffries





Hans Bezemer

unread,
Feb 7, 2016, 7:22:44 AM2/7/16
to 4th-co...@googlegroups.com
On Sunday 07 February 2016, Ron K. Jeffries wrote:
> In all fairness, running on bare metal was not (as I understand things) a
> design objective for 4tH. That's neither good nor bad, it just is.
Can't agree with you more, you're completely correct, Ron. The design
objective was to create something that fitted better in the development chain
of make, cc and the likes.

Hans Bezemer
Reply all
Reply to author
Forward
0 new messages