Three big type-in compilers to type in

request software or documentation that you can't find online
Post Reply
User avatar
BigEd
Posts: 4522
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Three big type-in compilers to type in

Post by BigEd »

Jeremy Ruston wrote (at least) three compilers in Basic, published in books which are now online, with commented source code and implementation notes.

But, the listings have not come cleanly through OCR, as ever, and the type-ins need to be typed in if they are to be made available. (Or, if it's been done, please let us know where to find the results!)

There's a Pascal compiler in Pascal For Human Beings (1982) (web) (files, including txt and pdf)
including implementation notes and commented source code for a Pascal compiler, written in Basic and compiling to Basic
And there's a Forth-like FROTH and an Algol-like SLUG in BBC Micro Compendium (web) (files, including txt and pdf)
includes two complete compilers. One compiles FROTH, a threaded language resembling FORTH and the other compiles a new language called SLUG, which is a block structured language based on Algol, BCPL and Pascal. Both these languages can run up to 100 times faster than BBC BASIC.
Any takers? Perhaps some kind of collaboration is possible?
melchett
Posts: 433
Joined: Tue Jan 28, 2003 9:52 am
Contact:

Re: Three big type-in compilers to type in

Post by melchett »

You can cross the Jeremy Ruston's Pascal for Human Being's compiler off the list - I recreated it.

It's quite interesting how it just converts Pascal to BBC Basic. Not quite "compilation" but it's pretty effective. Amazing how long it takes to execute on a BBC Micro (20 seconds) versus a modern machine (almost instant).

Andy
User avatar
colinhoad
Posts: 128
Joined: Fri Mar 15, 2019 2:25 pm
Location: London, UK
Contact:

Re: Three big type-in compilers to type in

Post by colinhoad »

BigEd wrote:
Mon Jun 07, 2021 6:18 pm
Any takers? Perhaps some kind of collaboration is possible?
I'll happily have a go at typing in the FROTH compiler - depending on how I get on (and whether anyone else volunteers) I might take on SLUG as well. Do you have a preferred output format? I'd probably use Richard Russell's editor and save it as .BBC and .BAS files, if that's acceptable.
User avatar
BigEd
Posts: 4522
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Three big type-in compilers to type in

Post by BigEd »

Well done, Andy, that's marvellous!

For myself, Colin, I'd prefer a text file, but a tokenised file is fine too, as it's easy enough to convert from one to the other.
User avatar
jgharston
Posts: 4572
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Three big type-in compilers to type in

Post by jgharston »

BigEd wrote:
Fri Nov 19, 2021 4:29 pm
For myself, Colin, I'd prefer a text file, but a tokenised file is fine too, as it's easy enough to convert from one to the other.
.BAS /is/ a text file.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.36
(C) Copyright J.G.Harston 1989,2005-2020
>_
User avatar
BigEd
Posts: 4522
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Three big type-in compilers to type in

Post by BigEd »

Very good!
User avatar
sweh
Posts: 2597
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: Three big type-in compilers to type in

Post by sweh »

I remember, back in the day, typing in a FORTRAN interpreter, written in BASIC.

I'm not sure it was from this book, but it looks familiar
Image

There's even two simple demos...
Attachments
fortran.ssd.zip
(3.6 KiB) Downloaded 13 times
Rgds
Stephen
User avatar
BigEd
Posts: 4522
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Three big type-in compilers to type in

Post by BigEd »

wow - Fortran in a couple of hundred lines of Basic. And with an editor too.
User avatar
colinhoad
Posts: 128
Joined: Fri Mar 15, 2019 2:25 pm
Location: London, UK
Contact:

Re: Three big type-in compilers to type in

Post by colinhoad »

BigEd wrote:
Fri Nov 19, 2021 4:29 pm
For myself, Colin, I'd prefer a text file, but a tokenised file is fine too, as it's easy enough to convert from one to the other.
No problem - I've finished the initial type-in, just need to find a bit of time to test it out and make sure there aren't any bugs (from my own typos or the original published listing!) It's been fun, I'm learning about FORTH in the process, so a valuable learning exercise all round :)
caspian
Posts: 81
Joined: Sat Nov 24, 2018 5:15 am
Contact:

Re: Three big type-in compilers to type in

Post by caspian »

I remember reading about FROTH in that book but I never tried it (yet)
User avatar
colinhoad
Posts: 128
Joined: Fri Mar 15, 2019 2:25 pm
Location: London, UK
Contact:

Re: Three big type-in compilers to type in

Post by colinhoad »

I've now finished typing and testing out the compiler! I had to make a few corrections as there were a few errors in the original listing, but I've made those explicit (listing-correction.png in my Git repo). All files, including a plain text version of the listing code, a tokenised .bbc file and a .ssd disk image are available here, along with a readme: https://github.com/colinhoad/bbc-micro-forth-compiler
User avatar
BigEd
Posts: 4522
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Three big type-in compilers to type in

Post by BigEd »

Great!
caspian
Posts: 81
Joined: Sat Nov 24, 2018 5:15 am
Contact:

Re: Three big type-in compilers to type in

Post by caspian »

Yeah it works!
froth-session.png
I don't know if I'll get time to work out using BEGIN END
User avatar
colinhoad
Posts: 128
Joined: Fri Mar 15, 2019 2:25 pm
Location: London, UK
Contact:

Re: Three big type-in compilers to type in

Post by colinhoad »

Is anyone else planning on (or already started) typing in the SLUG compiler? I had a read of the introduction to it last night and it looks fascinating (it converts BASIC programs into 6502 assembly code) but I won't start typing it in if someone else is already in the midst of doing so.
nicolagiacobbe
Posts: 93
Joined: Tue Jul 03, 2007 10:40 am
Location: italy
Contact:

Re: Three big type-in compilers to type in

Post by nicolagiacobbe »

I am trying to type it in, just halfway by now and must be proof-read but going forward.
We could split the work. I type it and someone else will proof-read it, anyone volunteering?
BTW and not willing to start an argument, the SLUG compiler compiles a subset of ALGOL(-like) language to MC.
Attachments
SLUG.txt
(8.95 KiB) Downloaded 4 times
Post Reply

Return to “archive requests”