6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu May 09, 2024 3:26 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri Sep 04, 2015 12:31 pm 
Offline

Joined: Mon Jan 07, 2013 2:42 pm
Posts: 576
Location: Just outside Berlin, Germany
Not for the 6502, but possibly interesting to the other Forthwrights here: Foud a link on Reddit (where there is a forum for Forth) to a "Forth on a DIP" project (http://jeelabs.org/2015/07/22/forth-on-a-dip/). This uses the LPC1114 chip, a 28-pin DIP ARM (http://www.nxp.com/products/microcontro ... 4FN28.html), with Mecrisp Forth (http://mecrisp.sourceforge.net/). The author has a moment of insight:
Quote:
Forth code runs surprisingly fast. Here is a delay loop which does nothing:

: delay 0 do loop ; ok.
And this code:

10000000 delay ok.
… takes about 3.5 seconds before printing out the final “ok.” prompt. That’s some 3 million iterations per second. Not too shabby, if you consider that the LPC1114 runs at 12 MHz!
Well, duh.


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 04, 2015 3:29 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10800
Location: England
Edit: Oops, I did misunderstand - there's no repeated function call, so this is a counted but empty loop taking 4 ticks for each time round. Still not much by way of overhead.

[Previously: Am I missing something? That seems quite impressive, for an interpreted language, to call a function in just 4 ticks - even if the function does nothing, doesn't it still have to do the nothing? In effect this Forth is running very close to native speed, which is about as good as it gets.]


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 04, 2015 9:31 pm 
Offline

Joined: Tue Jan 07, 2014 8:40 am
Posts: 91
Looks like Mecrisp compiles directly to native code (machine code), so yes, that is quite possible.

_________________
Because there are never enough Forth implementations: http://www.camelforth.com


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 26, 2015 2:22 am 
Offline

Joined: Wed Sep 23, 2015 8:14 pm
Posts: 171
Location: Philadelphia, PA
On a related note, there is FlashForth which will run on an 18-pin DIP (Microchip PIC18) among a number of other families.

http://www.flashforth.com/

P.S. Also a short article on FlashForth in the May, 2015 issue of Circuit Cellar.


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 27, 2015 1:23 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 575
The Parallax Propeller chip has at least three Forth variants on it. The two most popular are PropForth and TachyonForth. PropForth is closer to standard Forths while Tachyon is much faster. I've done two projects in PropForth

Drawbot: https://www.youtube.com/watch?v=1Z5kE-3XzS0

ScaraArm Mk I: https://www.youtube.com/watch?v=14BX50aHDAk

There's also AmForth for several other microcontrollers: http://amforth.sourceforge.net/


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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: