In further honor of Niklaus Wirth and Pascal:
In a Poly-88 system I acquired last year, it had a printing of the Tiny
Pascal Compiler article in a 1978 BYTE publication. That has BASIC source
code for the initial interpreter of a Pascal compiler. We ported that over
to the Commodore BASIC V2, as used on the Commander X16 system. As-is it
only supported the INTEGER type (and arrays thereof). It compiles to a
"p-code" where then an interpreter executes those results. The thing
about the X16 system is we have BASLOAD that adds a few features to BASIC:
long variable names, and symbolic GOTO/GOSUB so that line numbers aren't
needed (effectively a kind of QuickBASIC front end to the native BASIC of
the host system). It works splendidly at making it far easier to write up
more complex BASIC programs.
With the original TinyPascal baseline all working, now Martin Schmalenbach
is taking the initiative of expanding the type support (including pointer
support) and has a working "Version 1" that handles some simple input and
output.
We realize use of BASIC and p-code was never the most efficient approach to
building a robust compiler and development environment. But we still
consider it fun to use modern tools and perspective and pulling further on
the threads of that 1978 article and see where it goes. It may be a
helpful tutorial on the process of using one language to create another,
then using that result to develop the language you really wanted (e.g.
using tinyPascal to later write an on-system C compiler). Or it may be an
example of a "super sized" BASIC program doing an interesting application
(and exercising the multiple banks of the X16 system).
Original discussion thread:
-Steve
On Thu, Jan 4, 2024 at 10:08 PM Paul Berger via cctalk <
cctalk(a)classiccmp.org> wrote:
Pascal did not have strings originally, but it is a
common
"enhancement". I recall 40 years ago setting out to write a program to
create a data file using the S/370 ANSI Pascal compiler and it did not
have strings.
Paul.
On 2024-01-04 8:51 p.m., Sellam Abraham via cctalk wrote:
Pascal has strings.
Sellam
On Thu, Jan 4, 2024 at 4:19 PM Warner Losh via cctalk <
cctalk(a)classiccmp.org>
wrote:
> My first two pascal programs of any size were an Alarm Clock for my DEC
> Rainbow and a PDP-11 simulator, also for my DEC Rainbow (I did a science
> fair project comparing stack machines to traditional ones, but invented
my
> own stack machine and was too young to know
the right way to
> compare/contrast the two different machines, so I scraped by with a
better
> than average rating... mostly because nobody
knew how to evaluate it,
but
> that was to my advantage thinking back on
it...). Ah, fond memories of
> Turbo Pascal.
>
> Lack of strings, and lack of a good way to do portable I/O doomed the
> language.
>
> Warner
>