Neither FORTH nor QL

Discussion and advice about emulating the QL on other machines.
User avatar
polka
Trump Card
Posts: 196
Joined: Mon Mar 07, 2011 11:43 am

Re: Neither FORTH nor QL

Post by polka »

Hi all,
My apologies for initiating all this tumult, I will not do it again.

The pertinent question is
Derek_Stewart wrote:HI,

Could Oberon be ported to the QL?
As you can see, following the two hopefully "legal" links I gave in the first post of this thread, you may install on a Pi a "freeware" Ceres Worktation Emulation by Josef Templ, under its final version of the V4 framework and Oberon2 langage compiler.

You can use this to code your software "modules", importing modules of the framework and executing their "commands" or exporting them to further modules withing the Ceres executive.

But Josef Templ added also a "transpiler", which in parallel to the Oberon2 compilation will generate two files "in plain old C" that could be used in any plateform that offers a classic Posix environment (with X11 for pixmap display and pointer, if needed).

Let's see a simple example (departing from "HelloWorld", but not quite) :

This is the Oberon2 module "Helene", source file : Helene.Mod

Code: Select all

MODULE Helene ;

IMPORT Out ;

	PROCEDURE Salut* ;
		Out.String("Salut, Paul ! Comment ca va ?") ;
		Out.Ln ;
	END Salut ;

END Helene.
Please note that this module exports a procedure called "Salut", because it is marked with a "*". When compiling it, you will get an executable module for Ceres AND (because of ofront), two other files :

a Helene.c file :

Code: Select all

/* Ofront 1.4 -xtpkaG */
#include "SYSTEM.h"
#include "Out.h"


export void Helene_Salut (void);

void Helene_Salut (void)
{
	Out_String((CHAR*)"Salut,Paul ! Comment ca va ?", (LONGINT)27);
	Out_Ln();
}

export void *Helene__init(void)
{
	__DEFMOD;
	__IMPORT(Out);
	__REGMOD(Helene, 0);
	__REGCMD("Salut", Helene_Salut);
/* BEGIN */
	__ENDMOD;
}
and a Helene.h file :

Code: Select all

/* Ofront 1.4 -xtpkaG */

#ifndef Helene__h

#define Helene__h

#include "SYSTEM.h"

import void Helene_Salut (void);
import void *Helene__init(void);

#endif
As the Templ freeware contains all the Oberon2 source files and all the transpiled C and H files of the Ceres emulation, it has be used to port it on a Pi OS and on i386 linux, and in principle, could also be used in any environment with a C compiler and standard libraries (plus X11 support like in these two instances). For porting it on a QL, a display and pointer adaptation might however be an important issue.

I will not try to do it, I am content with a faithfull Ceres emulation on my PIs.

Bye, POLKa


May the FORTH be with you !
POLKa
Tinyfpga
Gold Card
Posts: 252
Joined: Thu Sep 27, 2018 1:59 am

Re: Neither FORTH nor QL

Post by Tinyfpga »

The Preface of the book mentioned in this topic is an interesting read, and as Norm writes, it can be bought cheaply from Amazon. The authors state that Oberon is the result of trying to build a system from scratch and making it as simple as possible, but not simpler (attributed to Einstein,no less).

I feel the same could be said about SMS and even more so about Stella, but I feel, and for no particular reason, that SMS and Stella are superior to Oberon.(read TT's documentation posted elsewhere on this forum)

I have installed Oberon on one of the smallest Lattice ECP5s, so I suppose, in theory, it could be installed on Peter Graf's Qzero but I can't imagine that he would be interested in such a pointless endeavour. After all Oberon can be installed on any number of existing devices.

I tried,on many occasions, to encourage TT to explain, in a positive tone and in such away that someone like me could understand, the entirety of his work. At various points in time he produced a number of documents but never a complete tome, and more's the pity in my opinion.
To be fair, as I am sure Norm would attest, writing a substantial book that is both readable and informative is no easy task and TT's time was probably better spent expressing his ideas in software that actually worked.

I can guess that Reiser and Wirth had significant assistance in writing their book, eg. the backing of IBM Research in Zurich and Eidgenossische Technische Hochschule Zurich. In any event the book is worth buying, relatively easy to read and interesting, if computing is your kind of thing.


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Neither FORTH nor QL

Post by NormanDunbar »

Tinyfpga wrote:To be fair, as I am sure Norm would attest, writing a substantial book that is both readable and informative is no easy task
Two years of my life, every spare moment writing words, or code, analysing code to see howit works, deep diving the somewhat convoluted data sheets for hardware information, chrcking I'm not writing BS!

Then at the publishing stage, uploading "completed" chapters, on specific dates, using online tools supplied by the publisher to correct and spelling, grammar errors, noticing my words being converted to (simplified!) US English as opposed to proper English, uploading fixes, repeat until they re happy.

Sorting out what the reviewer raised -- very little as it happened, luck? Skill? Who knows?

Waiting for a publication date......then a box arrives with author copy/copies as appropriate. Yippee!

All in all, it's easy! (Not!)

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Post Reply