GFHumiston@Hotmail.com
Posts: 1
Joined: Tue Dec 27, 2011 4:21 am

Re: FORTH Language for RPi ?

Tue May 01, 2012 3:03 am

Is anyone aware of a FORTH Language distro in the works for RPi ?

GFHumiston@Hotmail.com

User avatar
jbeale
Posts: 3264
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: FORTH Language for RPi ?

Tue May 01, 2012 3:38 am

Not aware of anything specifically for RasPi yet, but I don't see any problem with porting one of the many freely-available versions. Also, there are some Java and JavaScript based Forths which (AFAIK) would not require porting at all. See:

http://www.forth.org/compilers.html


User avatar
gordon@drogon.net
Posts: 1961
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: FORTH Language for RPi ?

Tue May 01, 2012 9:31 am

Well there's GForth for a start - a standard package in Debian - many others, I'm sure.

And not a Pi, but cheaper is the Fignition board - amazing. I saw it being demoed by its creator at the weekend - outputs to composite video done entirely in software on an 8-bit Amel microcontroller.

ok - after sudo apt-get install gforth:gordon @ dot: gforth
Gforth 0.7.0, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
1 2 3 * + . 7 ok
: hi ." Hello, world" ; ok
hi Hello, world ok


So there you are - just remember, its running bog-standard (Debian) Linux, so if there's a package for it, then it's almost certian it'll run on the Raspberry Pi. (Although it's not a dedicated Forth "distro" as such)

Gordon
--
Gordons projects: https://projects.drogon.net/

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4205
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: FORTH Language for RPi ?

Tue May 01, 2012 9:38 am

If you wanted an actual distribution -- ie a standalone Forth environment, then the hard part would be writing the USB and SD card drivers. Those will not exist for any existing Forth distribution and you will probably have to use the Linux drivers as the sole documentation. Porting Forth is trivially easy in comparision.

If all you want is the Forth language running under Linux, then see above.

User avatar
cheery
Posts: 219
Joined: Wed Jan 25, 2012 9:39 pm

Re: FORTH Language for RPi ?

Tue May 01, 2012 2:58 pm

You could roll your own easily, by porting JONESFORTH. Forth is unique of all others due to its simplicity.

Standalone Forth environment isn't far away if you can get one written at all. Find yourself a copy of ARM Architecture Reference Manual, ARM1176ZF-S Technical Reference Manual, and BCM2835 ARM Peripherals.

Have seen the kernel.img in the SD card image? On bootup it'll be loaded into the address 0x00000000. The image starts with an exception vector table (0x00-0x20). Fill the vector table with branches into correct handlers.0x00 Reset
0x04 Undefined Instruction
0x08 Hypervisor Call (Software Interrupt)
0x0C Prefetch Abort
0x10 Data Abort
0x14 Hyp Trap? (not sure what this is)
0x18 IRQ interrupt
0x1C FIQ interrupt

...the hard part would be writing the USB and SD card drivers...


You won't necessarily need those for a toy implementation. And I guess it's same problem for writing any standalone running thing for raspberry.

pablooliveira
Posts: 1
Joined: Thu Feb 21, 2013 1:03 pm

Re: FORTH Language for RPi ?

Thu Feb 21, 2013 1:12 pm

Sorry to resurrect such an old topic. But my Embedded System's students ported this semester Jones Forth to Raspberry PI. Their port is available at https://github.com/M2IHP13-admin/JonesForth-arm and seems pretty stable.

The port uses the linux new EABI for input/output, but it could be a fun project to make a bare-metal standalone version in Raspberry-PI :)

Pablo.

skiddaw
Posts: 9
Joined: Sat Oct 29, 2011 6:19 pm

Re: FORTH Language for RPi ?

Fri Mar 01, 2013 1:59 am

I've just had printed the 4tH Forth 'compiler' by J.L Bezemer, better known as The Beez: http://thebeez.home.xs4all.nl/4tH/
Google group: https://groups.google.com/forum/?fromgr ... h-compiler
I do have 4tH running on a 'Pi but as yet I'm still struggling with the installation. 4tH is a COMPILER but it will work interactively.
I'm also interested in the GPIO c-libraries such as http://abyz.co.uk/rpi/pigpio/pigpio-v1.tar but I'm a ways from getting anything talking, if at all. I was quite elated when the 'Pi went online and also found My Book network drive.

arieverbeek
Posts: 12
Joined: Mon Jan 28, 2013 2:40 pm

Re: FORTH Language for RPi ?

Sun Mar 03, 2013 6:49 pm

Hello,

I'am using Gforth with GPIO libraries which you can find here : https://github.com/harrypower/Rpi_Gforth_GPIO.
It has also a assembler/disassembler for arm.
The only trouble I have with the assembler and the Forth is you can only access the virtual memory, so you need the c-libraries for GPIO-access.
A question I have is is there a way to access the GPIO register direct from Forth?

Bye,
Arie

mmi
Posts: 85
Joined: Sun Feb 24, 2013 3:53 am
Location: Bavaria-Germany

Re: FORTH Language for RPi ?

Thu Mar 14, 2013 4:14 am

I think the easiest way to access the GPIO ports from *any* program language is to use the kernels "export", "unexport" interface in the "/sys/class/gpio" directory. It should be accessable by normal file operations also in Forth.

I currently don't have a link, but there is at least one example written in c somewhere - so you can see how it works in detail. And there should be a way to get access to GPIO not only by root. But for very fast GPIO operations (like pwm)
another solution has to be found.

good luck!

8thdev
Posts: 22
Joined: Fri Jul 31, 2015 2:23 pm

Re: FORTH Language for RPi ?

Mon Nov 09, 2015 6:03 am

Just to answer the OP: "8th" supports the RPi as well as desktop and mobile systems.

Return to “Other languages”

Who is online

Users browsing this forum: No registered users and 3 guests