POV-Ray : Newsgroups : povray.off-topic : Additional entropy Server Time
14 Nov 2024 20:57:07 EST (-0500)
  Additional entropy (Message 1 to 9 of 9)  
From: Orchid XP v7
Subject: Additional entropy
Date: 9 Nov 2007 14:36:48
Message: <4734b6d0@news.povray.org>
I was just reading about some guy who's trying to compile the new 
version of GHC on Solaris or something random like that. I found this 
phrase deeply amusing:

   "...as soon as I can got out of the cycled happy dependency."

Cyclic happy dependency. That's deep! LOL.

(He is of course referring to the parser-generator known as Happy. 
Apparently you need Happy to build GHC's language parser - but to build 
Happy in the first place, you need to have GHC. Checkmate.)


Post a reply to this message

From: Alain
Subject: Re: Additional entropy
Date: 9 Nov 2007 22:04:07
Message: <47351fa7@news.povray.org>
Orchid XP v7 nous apporta ses lumieres en ce 2007/11/09 14:36:
> I was just reading about some guy who's trying to compile the new 
> version of GHC on Solaris or something random like that. I found this 
> phrase deeply amusing:
> 
>   "...as soon as I can got out of the cycled happy dependency."
> 
> Cyclic happy dependency. That's deep! LOL.
> 
> (He is of course referring to the parser-generator known as Happy. 
> Apparently you need Happy to build GHC's language parser - but to build 
> Happy in the first place, you need to have GHC. Checkmate.)
The first C compiler was writen and compiled in C. Think about a chicken and egg 
paradoxe where the chicken IS the egg IS the chicken...

-- 
Alain
-------------------------------------------------
At the feast of ego everyone leaves hungry.
	Bentley's House of Coffee and Tea, Tucson, AZ


Post a reply to this message

From: Orchid XP v7
Subject: Re: Additional entropy
Date: 10 Nov 2007 04:14:24
Message: <47357670$1@news.povray.org>
Alain wrote:
> Orchid XP v7 nous apporta ses lumieres en ce 2007/11/09 14:36:
>> I was just reading about some guy who's trying to compile the new 
>> version of GHC on Solaris or something random like that. I found this 
>> phrase deeply amusing:
>>
>>   "...as soon as I can got out of the cycled happy dependency."
>>
>> Cyclic happy dependency. That's deep! LOL.
>>
>> (He is of course referring to the parser-generator known as Happy. 
>> Apparently you need Happy to build GHC's language parser - but to 
>> build Happy in the first place, you need to have GHC. Checkmate.)
> The first C compiler was writen and compiled in C. Think about a chicken 
> and egg paradoxe where the chicken IS the egg IS the chicken...

Well, GHC (a Haskell compiler) is written in Haskell. Mostly.

(Apart from the runtime engine, which is C. Oh, and The Evil Mangler, 
which is Perl...)

Presumably at some point in pre-history, it was all C. It must have 
been. Heh.


Post a reply to this message

From: nemesis
Subject: Re: Additional entropy
Date: 10 Nov 2007 15:40:01
Message: <web.473616a030d33426362e2b9c0@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> The first C compiler was writen and compiled in C.

If it was the first, that means there was no C compiler, so the writers had to
hand compile the compiler by direct translating it to assembly  and then using
that binary to compile it again.  That should've been quite a straightforward
task, as C is very close to assembly and it was just a first unoptimized
version anyway.

not so sure about the feasibility of having to hand compile a huge Haskell
codebase like GHC... *gasp*...


Post a reply to this message

From: Orchid XP v7
Subject: Re: Additional entropy
Date: 10 Nov 2007 17:14:26
Message: <47362d42$1@news.povray.org>
nemesis wrote:
> Alain <ele### [at] netscapenet> wrote:
>> The first C compiler was writen and compiled in C.
> 
> If it was the first, that means there was no C compiler, so the writers had to
> hand compile the compiler by direct translating it to assembly  and then using
> that binary to compile it again.  That should've been quite a straightforward
> task, as C is very close to assembly and it was just a first unoptimized
> version anyway.
> 
> not so sure about the feasibility of having to hand compile a huge Haskell
> codebase like GHC... *gasp*...

Well that's easy - it wasn't so huge back then! ;-)

(I suspect what they probably did is implement a simple interpretter in 
C, and run the first-pass GHC sources through that to compile itself. I 
don't actually *know* of course...)


Post a reply to this message

From: nemesis
Subject: Re: Additional entropy
Date: 10 Nov 2007 18:30:00
Message: <web.47363eca30d33426362e2b9c0@news.povray.org>
Orchid XP v7 <voi### [at] devnull> wrote:
> nemesis wrote:
> > Alain <ele### [at] netscapenet> wrote:
> >> The first C compiler was writen and compiled in C.
> >
> > If it was the first, that means there was no C compiler, so the writers had to
> > hand compile the compiler by direct translating it to assembly  and then using
> > that binary to compile it again.  That should've been quite a straightforward
> > task, as C is very close to assembly and it was just a first unoptimized
> > version anyway.
> >
> > not so sure about the feasibility of having to hand compile a huge Haskell
> > codebase like GHC... *gasp*...
>
> Well that's easy - it wasn't so huge back then! ;-)

Even if that was the case, hand compiling Haskell to assembly (or more probably,
C) is nuts.  Haskell semantics is a long way off from assembly/C semantics.
More likely they first wrote the compiler in C and then went on to rewrite in
Haskell...


Post a reply to this message

From: Orchid XP v7
Subject: Re: Additional entropy
Date: 11 Nov 2007 07:37:51
Message: <4736f79f@news.povray.org>
>> Well that's easy - it wasn't so huge back then! ;-)
> 
> Even if that was the case, hand compiling Haskell to assembly (or more probably,
> C) is nuts.  Haskell semantics is a long way off from assembly/C semantics.
> More likely they first wrote the compiler in C and then went on to rewrite in
> Haskell...

Ah. Miranda.

There used to be a proprietry programming language called Miranda. 
Actually, there used to be a whole zoo of programming languages similar 
to Haskell, but all slightly different. Haskell was explicitly created 
to end this situation, so that there would be One Ring to Rule them All...

I imagine they wrote a (comparitively trivial) program to transform 
Haskell to Miranda (the difference is almost entirely syntax) and used 
Miranda's existing compiler.

Now, to find out how they bootstrapped Miranda you'd have to ask the 
guys to designed it. ;-)

Note that while *compiling* Haskell is hard, *interpretting* it is 
fairly easy [if you don't care about performance].


Post a reply to this message

From: Orchid XP v7
Subject: Re: Additional entropy
Date: 11 Nov 2007 09:45:47
Message: <4737159b$1@news.povray.org>
Authoritative answer:

http://research.microsoft.com/~simonpj/papers/history-of-haskell/index.htm

GHC was begun in January 1989 at the University of Glasgow, as soon
as the initial language design was fixed. The first version of GHC was
written in LML by Kevin Hammond, and was essentially a new front end to
the Chalmers LML compiler.

...

GHC proper was begun in the autumn of 1989, by a team consisting
initially of Cordelia Hall, Will Partain, and Peyton Jones. It was
designed from the ground up as a complete implementation of Haskell in
Haskell, bootstrapped via the prototype compiler. The only part that was
shared with the prototype was the parser, which at that stage was still
written in Yacc and C. The first beta release was on 1 April 1991 (the
date was no accident), but it was another 18 months before the first
full release (version 0.10) was made in December 1992.


Post a reply to this message

From: Darren New
Subject: Re: Additional entropy
Date: 11 Nov 2007 18:32:52
Message: <47379124$1@news.povray.org>
Alain wrote:
> The first C compiler was writen and compiled in C. 

I don't think so. I think C was the first compiler written in itself, 
but I don't think the first C compiler was written in C.

I saw a language once where the compiler was bootstrapped[*] in assembly 
(for a virtual machine), with annotations all through it about how great 
and godlike the author was, and how one better not touch that bit lest 
ye be smited, and such. (Not written by the author, but by those who 
came after.)


[*] I.e., just enough to compile the minimum bits of the compiler 
needed, then recompile with the result to get all the good optimizations 
and such.

-- 
   Darren New / San Diego, CA, USA (PST)
     Remember the good old days, when we
     used to complain about cryptography
     being export-restricted?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.