On 22/04/2018 14:03, Martin Gregorie wrote:
> On Sun, 22 Apr 2018 12:22:18 +0100, Gareth's Downstairs Computer wrote:
>
>> However, it remains that my computing interest, resulting from my first
>> real job 45 years ago, is to produce an interactive programming language
>> (the interactivity of BASIC or FORTH) but that runs at the speed of
>> compiled code and yet is fully reconstructable as the original source.
>>
> You probably already know this, but don't forget that many BASICs were in
> reality compiled because RUN compiled into some more compact form and
> then executed that. Many UNIX scripting languages are the same (AWK,
> Perl, etc): they generate some form of P-code, which is then interpreted
> by the runtime system. This seems to be a nice compromise, especially if
> the code generated from each statement is the minimum needed to pass
> variables to the previously compiled runtime system - the result could be
> nearly as fast as optimised compiled code.
>
> BTW, have you looked at JOSS or its derivatives, JEAN and FOCAL? JOSS was
> one of the earlier interactive languages. JEAN ran on 1900 mainframes and
> FOCAL was a DEC language.
>
> There may be some nice ideas there, especially that like BASIC, JEAN line
> numbers were treated as labels but, unlike BASIC, the line numbers were
> real numbers. This made the editor simple since lines were always in
> numeric order and, if you needed to add a line between 1.2 and 1.3 you
> just gave it a line number of 1.25 Another nice trick was that all the
> lines with the same integer part (known in JEAN as a 'part') could be
> treated as a subroutine.
>
> The main drawback was that conditions were suffixes to the statement they
> controlled, so didn't have ELSE branches:
>
> 1.1 INPUT R as "Input a radius"
> 1.15 FINISH IF R = 0.0
> 1.2 DO PART 2 IF R > 0.0
> 1.25 GOTO 1.1
> 1.3 PRINT "Radii must be positive values"
> 1.4 GOTO 1.1
> 2.0 A = Pi * R * R
> 2.1 PRINT A "Area is %.%%"
>
> .... or something like that. Its been 50 years since I last used JEAN.
>
>
Interesting response, thankyou.
The essence behind my thinking is that there has to be a unique
tokenised form of source code, which is usually ASCII or Unicode,
and why should that unique form not also be the compiled code?
The sort of ambiguities that I seek are the two different ways
of adding R3 to R2 ...
ADD R2,R2,R3
or
Add R2,R3,R2
OK, can't compile completely as there has to be some symbol table
info somewhere so that a variable defined as, eg, CurrentArrayIndex
does not list back as V32 :-)
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|