6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 10:03 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun Jan 24, 2021 12:17 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
This might be of interest - it's portable, by intent, rather than being 6502 specific.

Here's documentation in PDF format. Here's a home page.

Although the central VM is written in C, I see it's buildable with TinyCC, and there's a barebones version, so I hope it's not too large for our world. In any case, perhaps there are some nice ideas within which can be borrowed.

Quote:
RETRO is a clean, elegant, and pragmatic dialect of Forth. It provides a simple alternative for those willing to make a break from legacy systems.

The language draws influences from many sources including traditional Forth systems, cmForth, colorForth, Factor, and Parable. It was designed to be easy to grasp and adapt to specific uses.

The basic language is very portable. It runs on a tiny virtual machine (Nga), which is written in C. There are multiple interface options, the main one (rre) is buildable with just the standard C compiler and libraries on most systems.


(via here and here)


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 07, 2022 4:27 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
FYI: The link to the PDF above is broken.

I wanted to read it because I am curious why the authors wrote this Forth. Especially because writing the VM in C is a bit of a bold choice for a Forth interpreter.


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 07, 2022 7:41 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
There's a copy on the Internet Archive's Wayback Machine:
https://web.archive.org/web/20210124121 ... Manual.pdf


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 08, 2022 12:43 am 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
That was a good idea.

I downloaded it and started skimming it. So far it looks like it is less bare bones than the Forths I am used to. Specifically it includes namespaces, support for mixed data type arrays, and some string functions. Also, because it is built on top of the C RTL it can have access to C's floating point data types and functions.

Update: It also has a socket API, which shouldn't be a surprise given that it is written in C. But that would allow for network programming in Forth which might please some people.


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 09, 2022 8:53 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
It's clear the authors wanted to target lower end hardware because their floating point library supports 64 bit to 32 bit compaction of floating point quantities. The idea is that it should reduce the memory footprint while only losing some precision.

Their compaction algorithm is pretty simple and they reference a paper on it. They store the square root of the number and square it to restore the number.


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 16 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: