Recent

Author Topic: Found more info on Pastel language  (Read 3405 times)

dtoffe

  • Jr. Member
  • **
  • Posts: 55
Found more info on Pastel language
« on: August 07, 2023, 09:51:07 pm »
    Well, not exactly found, but "asked", and Mr. Brougthon was kind enough to take a look at the Wikipedia list of features and write down some notes of what he could recall from it, which I'm sharing here with his permission:

Quote

>> Constant expressions

const
   <name> = <expr>;    (* expr can contain, constants, other named constants and operators *)
   (* likewise, constant-value expressions could be used in type declarations, and other places where simple constants were required *)


>> Variable initialization

var
   <name> : <type> = <expr>. (* equivalent to an assignment at the start of the block *)


>>  Loop-exit form:

loop. (* loop forever, until exit condition is true *)
   ….
exit if <expr>; (* multiple allowed *)
  ….
end;


>> Additional control constructs

let <name> = <expr> do <stmt>;   (* assign the value to the variable, and execute the statement *)
    (* the variable is known only within the scope of the statement *)


>> Condition boolean operations

orif / andif  (* analogous to || and && *)


>> Return statement

return <expr>;  (* from a function *)
or
return;  (* in a procedure *)


>> Set iteration

for <name> in <set expr> do <stmt> ;   (* perform statement with name bound to values in the set *)


>> Additional parameter passing modes

In a procedure or function declaration:

procedure xxx (<ptype> <name> : <type>; … )

<ptype> could be
       var — by reference
       <empty> — by value
       in — by value
       out — copy out on return
       inout — by value on input and copy out on return


>> Module definition

module <name> ;  (* at the beginning of a file defines a module *)

use <name> ;  (* in another file, incorporates the definitions from another module *)

I believe that you had to use x.y in a referencing module.   I don’t believe that it did an “import *”.


>> Improved type definition

I believe that you could do things like

type
  <name> :   0..<expr>  (* where expr was actually a variable expression, useful with parameters and fields, especially arrays *)


>> Parametric types

We were able to define a record that was partly self defining.    Examples:

type
    x = record
         y: integer
         z: array [0..y] of integer;
         end

   a = record
         b:  0..4
         case b of
             0: (d, e, f:…);
             1: (g, h, i: …);

These were intended to be used with pointers to records to describe variable operation system structures.
   
 I forget if we could specified the values in a new, so that the record was of the minimum lenghth.


>> Explicit packing and allocation control

I vaguely recall that you could add “packed <bitsize>” to individual field definitions.


>> Exceptions

I forget how these worked.


    He also told me that he donated some tapes containing S-1 Project documentation to the Computer History Museum, but the site doesn't seem to have those online (the material is only listed with a catalog number).

Cheers,

Daniel

440bx

  • Hero Member
  • *****
  • Posts: 3944
Re: Found more info on Pastel language
« Reply #1 on: August 07, 2023, 10:23:11 pm »
Thank you Daniel for your efforts and for sharing.  That's great stuff
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Found more info on Pastel language
« Reply #2 on: August 08, 2023, 08:57:05 am »
Kudos to @dtoffe for reaching out, please give Mr. Brougthon my compliments and extend the community's gratitude for his recollections.

I sincerely hope that Certain People will resist the temptation to say "but modern Pascal already does that..."

I wonder whether those would be worth working into the Wikipedia article? One of the problems is that Wp appears to be institutionally biased against anything that derives from "private communication", and if Mr. Brougthon added the notes himself somebody would mark them with "the author appeared to be personally involved" or "private research" tags.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

dtoffe

  • Jr. Member
  • **
  • Posts: 55
Re: Found more info on Pastel language
« Reply #3 on: August 08, 2023, 08:54:53 pm »
Thank you Daniel for your efforts and for sharing.  That's great stuff

    I feel sad when I'm chasing some old material, even for the lightest curiosity, and the only relevant page in the Wayback Machine has broken download links pointing to an FTP server that was probably decommissioned before pets.com...

I sincerely hope that Certain People will resist the temptation to say "but modern Pascal already does that..."

    I was hoping to start exactly this discussion, but in a very constructive way. Like "const expressions are important because so and so, and were introduced to fpc in version 0.8, Delphi also supports them since version 8, etc, etc..." (version numbers cited are all made up as examples).

I wonder whether those would be worth working into the Wikipedia article? One of the problems is that Wp appears to be institutionally biased against anything that derives from "private communication" --snip--

    a). I will try contacting CHM and see if some part of the material is accessible and cleared (S-1 project was supported by the US Navy, even being so old, there are probably things that are not to be made public, although I don't think the language specs should be a problem).
    b). Mr. Broughton said he could maybe have a box somewhere with relevant material, no promises.
    c). If the above fails, is there the possibility that a page for Pastel can be created in the FPC wiki ? I don't think it would be a problem, after all, Pastel is a Pascal with extensions...

Cheers,

Daniel

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Found more info on Pastel language
« Reply #4 on: August 08, 2023, 09:30:49 pm »
Thank you Daniel for your efforts and for sharing.  That's great stuff

    I feel sad when I'm chasing some old material, even for the lightest curiosity, and the only relevant page in the Wayback Machine has broken download links pointing to an FTP server that was probably decommissioned before pets.com...

Also beware of links internal to Wayback which appear to be broken: some of them are likely to be archived but hidden because the current owner of the domain is using a no-robots tag. I don't believe there's any way round that, since (when I discussed it with them quite some years ago) the administrators had a policy of not distinguishing between the owners of a domain and the owners of the IP it had formerly contained.

Quote
I sincerely hope that Certain People will resist the temptation to say "but modern Pascal already does that..."

    I was hoping to start exactly this discussion, but in a very constructive way. Like "const expressions are important because so and so, and were introduced to fpc in version 0.8, Delphi also supports them since version 8, etc, etc..." (version numbers cited are all made up as examples).

:-) That seems fair, but there are too many people in the community who are excessively protective of their little corner of the status quo.

Quote
I wonder whether those would be worth working into the Wikipedia article? One of the problems is that Wp appears to be institutionally biased against anything that derives from "private communication" --snip--

    a). I will try contacting CHM and see if some part of the material is accessible and cleared (S-1 project was supported by the US Navy, even being so old, there are probably things that are not to be made public, although I don't think the language specs should be a problem).
    b). Mr. Broughton said he could maybe have a box somewhere with relevant material, no promises.
    c). If the above fails, is there the possibility that a page for Pastel can be created in the FPC wiki ? I don't think it would be a problem, after all, Pastel is a Pascal with extensions...

I'd certainly be supportive of a local page, but a better one might be http://pascal.hansotten.com/

Apropos old media (and fully prepared to be shot down by Mr. Broughton), my understanding is that at least some of the S-1 work was done at SLAC where they had something like a B5500. In those days the tapes were 7-track, and that system had an "unusual" (if not perverse) scheme where text and binary files could be mixed on a tape but were distinguished depending on whether parity was even or odd. I would /hope/ the CSM was aware of that, but GOK whether anybody is still set up to read them...

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

440bx

  • Hero Member
  • *****
  • Posts: 3944
Re: Found more info on Pastel language
« Reply #5 on: August 08, 2023, 09:40:02 pm »
    I was hoping to start exactly this discussion, but in a very constructive way. Like "const expressions are important because so and so, and were introduced to fpc in version 0.8, Delphi also supports them since version 8, etc, etc..." (version numbers cited are all made up as examples).
Personally, my main interest is to analyze the decisions very smart people made and the consequences those decisions had in extending the power of the language.  I think that's a good way to learn.

In the case of FPC (and, by implication, Delphi as well), I'm not sure features are added to the language based on characteristics such as consistency and symmetry.   I don't want to criticize FPC, I'm grateful  for its existence and grateful to the developers for keeping it alive but, from what I've seen so far, constructive or "destructive" criticism has little to no effect on what is or isn't included in the language.

Thank you again for your efforts to dig out information on Pastel.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Found more info on Pastel language
« Reply #6 on: August 08, 2023, 10:19:13 pm »
Personally, my main interest is to analyze the decisions very smart people made and the consequences those decisions had in extending the power of the language.  I think that's a good way to learn.

In the case of FPC (and, by implication, Delphi as well), I'm not sure features are added to the language based on characteristics such as consistency and symmetry.

100% agreed. "Modern Pascal" is based on an unholy melange of things thrown together by UCSD, Borland and the ISO standard, and I can't help but feel that the people responsible were far less smart than they believed. Add in Wirth's involvement in what became Object Pascal, and while there were some reasonable pragmatic decisions overall it's... well, to be frank, at least as much of a mess as C or any other language that came into being in the '70s and '80s.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: Found more info on Pastel language
« Reply #7 on: August 09, 2023, 09:22:36 am »
(If I quote only a TP or a Delphi version as origin, it means that FPC also supports it out of compat to that version)

Quote

>> Constant expressions

const
   <name> = <expr>;    (* expr can contain, constants, other named constants and operators *)
   (* likewise, constant-value expressions could be used in type declarations, and other places where simple constants were required *)

And under FPC some built-ins, e.g. ORD() I assume that is the same under classic Pascals. Turbo already had some of this, but over the years the number of options (read: built-ins) were expanded.

Quote
>> Variable initialization

var
   <name> : <type> = <expr>. (* equivalent to an assignment at the start of the block *)

Delphi 4 has the syntax, but this makes it a scope protected global initialized symbol when nested in e.g. a procedural block.

FPC modes try to do this the C way, but I avoid the feature as the plague. Adding a "feature" using the same syntax for a semantically unrelated feature is not sane.

See note in https://www.freepascal.org/docs-html/3.0.0/ref/refse23.html

Quote
>>  Loop-exit form:

loop. (* loop forever, until exit condition is true *)
   ….
exit if <expr>; (* multiple allowed *)
  ….
end;

Modula-2 has this but it would be simply if <expr> then exit;    Continue and break somewhere in the later Turbo Pascals ?

Quote
>> Additional control constructs

let <name> = <expr> do <stmt>;   (* assign the value to the variable, and execute the statement *)
    (* the variable is known only within the scope of the statement *)

Nope. Doesn't even look familiar (except LET from Basic). But I don't have (any) Algol experience or knowledge

Quote
>> Condition boolean operations

orif / andif  (* analogous to || and && *)

Simply "or" and "and".  Differences between boolean and integer operators are generally not a problem in Pascal. I think this dripped in from somewhere else.

Some non Borland dialects might have or_else and_else for short circuit, Borland dialects use directives/pragmas for that.

Quote
>> Return statement

return <expr>;  (* from a function *)
or
return;  (* in a procedure *)

Modula-2.      Pascal has Exit() since D2009, but Free Pascal has had it before (2000ish, FPC 1.0.x)

Quote
>> Set iteration

for <name> in <set expr> do <stmt> ;   (* perform statement with name bound to values in the set *)

D2009 and FPC 3.0.  Name must be of the enum type of the set.

Quote
>> Additional parameter passing modes

In a procedure or function declaration:

procedure xxx (<ptype> <name> : <type>; … )

<ptype> could be
       var — by reference
       <empty> — by value
       in — by value
       out — copy out on return
       inout — by value on input and copy out on return

var, const, out .  var and const since TP types, OUT since D4 or D6 mostly for ref counted interfaces as reason.

Some very recent Delphi and a slightly older FPC support either const [ref]  or constref as modifier to forcedly pass by reference (instead of leaving that up to the ABI with possible inconsistent behaviour between architectures)

Quote
>> Module definition

module <name> ;  (* at the beginning of a file defines a module *)

use <name> ;  (* in another file, incorporates the definitions from another module *)

I believe that you had to use x.y in a referencing module.   I don’t believe that it did an “import *”.

unit/uses but afaik standard pascal and modula use module and import (and Modula2 also QUALIFIED/UNQUALIFIED and FROM module_xx IMPORT yy;)

Quote
>> Improved type definition

I believe that you could do things like

type
  <name> :   0..<expr>  (* where expr was actually a variable expression, useful with parameters and fields, especially arrays *)

As long as it is compile time resolvable, it was allowed.

Quote
>> Parametric types

We were able to define a record that was partly self defining.    Examples:

type
    x = record
         y: integer
         z: array [0..y] of integer;
         end

   a = record
         b:  0..4
         case b of
             0: (d, e, f:…);
             1: (g, h, i: …);

These were intended to be used with pointers to records to describe variable operation system structures.

ISO Pascal feature. Some support in mode ISO. Like packed/unpacked arrays a mostly ignored feature in Borland Pascals

Quote

>> Explicit packing and allocation control

I vaguely recall that you could add “packed <bitsize>” to individual field definitions.

Bitpacking not supported in any standard, but a common extension in more embedded system.  Free Pascal  uses a bitpacked modifier for this, and also support bitpacked fields.  Delphi doesn't have any support.


Quote
>> Exceptions

I forget how these worked.


Delphi, but of course various kinds of exceptions exist.
« Last Edit: August 09, 2023, 09:29:57 am by marcov »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: Found more info on Pastel language
« Reply #8 on: August 09, 2023, 10:00:44 am »
     I was hoping to start exactly this discussion, but in a very constructive way. Like "const expressions are important because so and so, and were introduced to fpc in version 0.8, Delphi also supports them since version 8, etc, etc..." (version numbers cited are all made up as examples).

That's clear because we all like to forget that Delphi 8 existed. 

Quote
     c). If the above fails, is there the possibility that a page for Pastel can be created in the FPC wiki ?

FPC is not a general wiki hosting. There must be relevance for FPC, and to be honest, it is so far removed that I don't see it. Why not simply the general wikipedia?

Quote
I don't think it would be a problem, after all, Pastel is a Pascal with extensions...

Is it ? Or is it an Pascal implementation with a lot of backend options bleeding through in the language ?

i.e. were they really consciously defined and implemented, or did they simply create equivalents for functionality that was already existing in the backend?

domasz

  • Sr. Member
  • ****
  • Posts: 423
Re: Found more info on Pastel language
« Reply #9 on: August 09, 2023, 11:28:52 am »

100% agreed. "Modern Pascal" is based on an unholy melange of things thrown together by UCSD, Borland and the ISO standard, and I can't help but feel that the people responsible were far less smart than they believed. Add in Wirth's involvement in what became Object Pascal, and while there were some reasonable pragmatic decisions overall it's... well, to be frank, at least as much of a mess as C or any other language that came into being in the '70s and '80s.
While "Modern Pascal" might be a bit messy it's far better than a lot of other languages. In C using a preprocessor you can bend the syntax so much you can basically write in Pascal. In Pascal Strings are a standard feature, in C you have some barbaric pointers to chars and array of chars. And those funny functions returning voids are just quick hacks.
And if we compare with some modern languages, like JavaScript then there was some deeper thought behind Pascal and absolutely none behind JS.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Found more info on Pastel language
« Reply #10 on: August 09, 2023, 11:57:43 am »
Quote
>> Additional control constructs

let <name> = <expr> do <stmt>;   (* assign the value to the variable, and execute the statement *)
    (* the variable is known only within the scope of the statement *)

Nope. Doesn't even look familiar (except LET from Basic). But I don't have (any) Algol experience or knowledge

OK, I have a strong opinion on that one. ALGOL, like C, had variables declared after rather than before the BEGIN. They definitely had to be declared before use, I don't know whether declarations and statements could be mixed or if it was implementation/version defined.

Pascal, as originally defined, has a general form

Code: Text  [Select][+][-]
  1. <preamble>
  2.   <declarations>
  3. BEGIN
  4.   <statements>
  5. END
  6.  

<preamble> is normally PROGRAM, PROCEDURE or FUNCTION.

With reference to the language as defined, i.e. before the addition of BREAK etc., it would be entirely reasonable to treat FOR, WITH and possibly other types of statement as preambles, with variables declared in the preamble (specifically including FOR's control variable) taking the associated BEGIN...END as their scope following the example of PROCEDURE/FUNCTION's parameters.

It might also have been possible to extend that philosophy to finalisation and exception mechanisms.

Quote
>> Additional parameter passing modes
...
       out — copy out on return
       inout — by value on input and copy out on return

Actually, I quite like the idea of "out" resulting in a value being copied to the surrounding scope only at exit, rather than being updated e.g. during every iteration of a loop. I'm not saying it's better than Borland's innovation of allowing non-scalars as function returns, but neither am I saying it's worse. An implementation of "inout" might need to document that it didn't protect the parameter from being changed by e.g. an ISR.

I note and am very grateful for the explanation of parametric types, which I'd wrongly envisaged as being like generics.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

440bx

  • Hero Member
  • *****
  • Posts: 3944
Re: Found more info on Pastel language
« Reply #11 on: August 09, 2023, 01:34:38 pm »
While "Modern Pascal" might be a bit messy it's far better than a lot of other languages.
True but, that doesn't mean Pascal doesn't have faults that could/should be addressed.

In C using a preprocessor you can bend the syntax so much you can basically write in Pascal.
While the preprocessor can make C's syntax approximate that of Pascal, it cannot bestow upon C, Pascal's strong typing.

In Pascal Strings are a standard feature, in C you have some barbaric pointers to chars and array of chars.
Pascal strings are a _mess_.  There are longstrings and shortstrings. longstrings may or may not be unique while shortstrings are always unique, some strings are guaranteed to be null terminated while others are not.  Pascal strings make C's character array look like mana from heaven (at least C character arrays are fully consistent.)

And those funny functions returning voids are just quick hacks.
I wouldn't say a hack but, definitely a shortcut.  A function that returns nothing/void is just a procedure.  More of a hack is allowing a programmer to ignore a function's result because, when reading the line of code where it is ignored, it is not possible to determine if the function returns void, therefore there is no result or it returns a result but it is being ignored.  IOW, it is ambiguous and ambiguities in programming are bad.  Oh wait, that ill-advised shortcut made it into Pascal in spite of Pascal having procedures specifically to indicate there is no return value. 

I can't believe I have to defend C, a language I very strongly dislike.

And if we compare with some modern languages, like JavaScript then there was some deeper thought behind Pascal and absolutely none behind JS.
As its name states, it's just a scripting language.  IOW, a tricycle should not be compared to (or presumed to be) a method of transportation.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: Found more info on Pastel language
« Reply #12 on: August 09, 2023, 01:51:42 pm »
With reference to the language as defined, i.e. before the addition of BREAK etc., it would be entirely reasonable to treat FOR, WITH and possibly other types of statement as preambles, with variables declared in the preamble (specifically including FOR's control variable) taking the associated BEGIN...END as their scope following the example of PROCEDURE/FUNCTION's parameters.

It might also have been possible to extend that philosophy to finalisation and exception mechanisms.

No. The procedural structure is mandatory, and with for with and while you are stuck with the one or multiline block.  I.e. there might be no BEGIN..END etc.

So LET's not.

Quote
Quote
>> Additional parameter passing modes
...
       out — copy out on return
       inout — by value on input and copy out on return

Actually, I quite like the idea of "out" resulting in a value being copied to the surrounding scope only at exit, rather than being updated e.g. during every iteration of a loop. I'm not saying it's better than Borland's innovation of allowing non-scalars as function returns, but neither am I saying it's worse. An implementation of "inout" might need to document that it didn't protect the parameter from being changed by e.g. an ISR.

Well, every "feature" has its proponents I guess.

Quote
I note and am very grateful for the explanation of parametric types, which I'd wrongly envisaged as being like generics.

Or schemata. But this is afaik standard ISO functionality, though afaik many compilers didn't overlay union fields if you used it.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Found more info on Pastel language
« Reply #13 on: August 09, 2023, 02:02:30 pm »
No. The procedural structure is mandatory, and with for with and while you are stuck with the one or multiline block.  I.e. there might be no BEGIN..END etc.

I said the language as defined, and as I've previously written it was defined badly.

Pastel was trying to fix some of the damage, but unfortunately it was drowned by USCD and Borland.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: Found more info on Pastel language
« Reply #14 on: August 09, 2023, 02:22:54 pm »
No. The procedural structure is mandatory, and with for with and while you are stuck with the one or multiline block.  I.e. there might be no BEGIN..END etc.

I said the language as defined, and as I've previously written it was defined badly.

Pastel was trying to fix some of the damage, but unfortunately it was drowned by USCD and Borland.

Assumptions and heavily opinion coloured language.   Unless you have references from Mr. Broughton why he did certain things, that is all speculation. As said, there might have been reasons in the backend or his model for the backend.

 

TinyPortal © 2005-2018