Discussion:
Which comes first, languages or compilers?
(too old to reply)
gah4
2023-10-25 19:39:24 UTC
Permalink
Not from a Quora question, but one did remind me.

Which (well known) languages were mostly defined before the first
compiler was written? (Not counting the one you did for a homework
assignment.)

As well as I know it, and similar to the way IBM defined the S/360
architecture before five different groups started implementing it,
PL/I (nee NPL) was pretty much completely described before groups
started implementing it. There is a published IBM manual with that
description.

I don't count Fortran0, as I believe Knuth named an early description
before the first Fortran compiler was written.

It is somewhat convenient to adapt the language when you find parts
harder to implement than was thought. PL/I mostly didn't do that.
[COBOL, Algol60 and 68, Ada. Maybe Pascal? -John]
Kaz Kylheku
2023-10-26 21:46:54 UTC
Permalink
Post by gah4
Not from a Quora question, but one did remind me.
Which (well known) languages were mostly defined before the first
compiler was written? (Not counting the one you did for a homework
assignment.)
Lisp is one example. Definitions for interpreting it (not compiling)
were written by McCarthy on paper, in Lisp. Steve Russel realized that
you can translate that specification to machine code to get
a working implementation. At first McCarthy was famously taken aback,
thinking that Russel is working under some misconception: the document
is for people, not for the machine.

So it is very clear that the semantics of Lisp evaluation was first
defined in a document intended for human use, which turned out to be
susceptible hand-translation to an interpreter.

(Compiling followed not long after that; I think by around 1960
they were compiling it.)
--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @***@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.
[Lisp was considerably more than McCarthy's paper design. The CAR and
CDR function names refer to the addresss and decrement parts of a
memory word on the IBM 704 which presumably did not come up before
they implemented it. -John]
minf...@arcor.de
2023-10-27 10:19:03 UTC
Permalink
Post by gah4
Not from a Quora question, but one did remind me.
Which (well known) languages were mostly defined before the first
compiler was written? (Not counting the one you did for a homework
assignment.)
Also APL first defined by Iverson
https://en.wikipedia.org/wiki/APL_(programming_language)
Luke A. Guest
2023-10-27 15:57:50 UTC
Permalink
Post by gah4
Not from a Quora question, but one did remind me.
Which (well known) languages were mostly defined before the first
compiler was written? (Not counting the one you did for a homework
assignment.) ...
[COBOL, Algol60 and 68, Ada. Maybe Pascal? -John]
You can definitely count Ada as being defined before being
implemented. You can find the various language designs put forward by
looking for "common hol phase 1" in this group.

I don't really consider any of Wirth's languages to be designed as
they would not have the gaping big holes they have. Aiming to having
short specifications is not really a good thing, but it comes across
as half-arsed and you end up leaving a metric shit-ton of "undefined"
things that should've been defined up to the implementor, creating
"implementation defined" and incompatible variants, see Pascal,
Modula-2 and Oberon and their variants.
Hans-Peter Diettrich
2023-10-30 03:26:10 UTC
Permalink
Post by Luke A. Guest
I don't really consider any of Wirth's languages to be designed as
they would not have the gaping big holes they have.
The *languages* are all well designed, system *libraries* are incomplete
or missing.

DoDi
OrangeFish9737
2023-10-30 14:02:43 UTC
Permalink
Post by Hans-Peter Diettrich
Post by Luke A. Guest
I don't really consider any of Wirth's languages to be designed as
they would not have the gaping big holes they have.
The *languages* are all well designed, system *libraries* are incomplete
or missing.
I recall that Wirth also modified the language based on difficulty of
implementation, i.e. compiler and language born together.

OF
[That was certainly the case with AlgolW and PL360. -John]
Luke A. Guest
2023-10-30 20:35:50 UTC
Permalink
Post by Hans-Peter Diettrich
Post by Luke A. Guest
I don't really consider any of Wirth's languages to be designed as
they would not have the gaping big holes they have.
The *languages* are all well designed,
That's not what the Oakwood guidelines say.

system *libraries* are incomplete
Post by Hans-Peter Diettrich
or missing.
Yes.
[I'd prefer not to refight 30 year old arguments about language design details here.
At this point Oberon is purely of historical interest and Pascal is close to dead. -John]
Thomas Koenig
2023-11-02 07:20:18 UTC
Permalink
Post by Luke A. Guest
Post by Hans-Peter Diettrich
Post by Luke A. Guest
I don't really consider any of Wirth's languages to be designed as
they would not have the gaping big holes they have.
The *languages* are all well designed,
That's not what the Oakwood guidelines say.
What do they say?
Post by Luke A. Guest
system *libraries* are incomplete
Post by Hans-Peter Diettrich
or missing.
Yes.
There is actually a problem with language design - how to handle I/O.
Kernighan discusses briefly this in "UNIX: A History and a Memoir".

You can make I/O part of the language, as FORTRAN first did with
FORMAT (which was an excellent idea). You can leave it unspecified
(which has been shown to be a bad idea). Or you can leave it to
libraries, like C or Modula-2 do.

If you leave it to libraries, the question is how to make up complex
format strings. You can use C's varargs, which make for easy use (but
somewhat difficult error checking), or you can use the Modula-2
approach where each type has its own library function, which makes I/O
a pain to use.

And varargs certainly has issues for compilers, especially in ABI
definition when arguments are usually passed in registers. Lenient
ABIs which allow you to call a normal functions with a varargs
argument list without crashing are certainly a source of errors, even
now.
Post by Luke A. Guest
[I'd prefer not to refight 30 year old arguments about language design details here.
At this point Oberon is purely of historical interest and Pascal is close to dead. -John]
A Pascal descendant, Delphi, is still being sold.

And Modula-2 has just gained a gcc front end, so not all of Wirth's
languages are dead.
[The line between language I/O and library I/O is quite blurry. The C
standard makes includes the stdio library as a mandatory part of the
language so compilers often do static compatibility checks of printf
strings and arguments at compile time. Sure, you can build the format
at runtime but it's almost always a static string. And, Fortran lets
you build the FORMAT statement in a runtime string, too. -John]

Loading...