Live data from Hacker News

How I wrote a self-hosting C compiler in 40 days

sigbus.info

121–128 of 128 posts

Re: How I wrote a self-hosting C compiler in 40 days

#124

Earlier quoted context omitted.

And I think the person you responded to is implying his exit from childhood did not in any way slow down his use of advent calendars for chocolate-eating purposes.

Why would I purchase a device specifically designed to rate limit my chocolate consumption? Advent calendars are the Internet data caps of dessert.

It's probably good to learn a little calender-based self control when young, but I happen to agree Chocolate Is Life.

Re: How I wrote a self-hosting C compiler in 40 days

#125
post #95
post #66

Earlier quoted context omitted.

I definitely agree with ML and OCaml, but why do you recommend Lisp for compiler work? I love working withs Lisps, but how do you deal with dynamic typing bugs in compiler work? I prefer OCaml/Haskell/ML for its really strong static type checking for compiler work. Just curious though...

ML got ADTs and static type guarantees, but Lisp got macros, which allows to implement things like http://andykeep.com/pubs/np-preprint.pdf - which is significantly less boilerplate than in ML. An ideal language for compilers would have combined both properties, but to make it happen, an expression problem must be solved first. See a relevant discussion here from not long ago: https://news.ycombinator.com/item?id=107…

A commenter elsewhere said Racket had ADT's with langplai but also with langracket via subtypes of struct type with match macro. Said it was same style of programming.

So that's static typing (Typed Racket) and macros for sure. Possibly ADT's depending on whether you object to claim above. Should cover your list of requirements.

Re: How I wrote a self-hosting C compiler in 40 days

#126
post #95

Earlier quoted context omitted.

ML got ADTs and static type guarantees, but Lisp got macros, which allows to implement things like http://andykeep.com/pubs/np-preprint.pdf - which is significantly less boilerplate than in ML. An ideal language for compilers would have combined both properties, but to make it happen, an expression problem must be solved first. See a relevant discussion here from not long ago: https://news.ycombinator.com/item?id=107…

A commenter elsewhere said Racket had ADT's with langplai but also with langracket via subtypes of struct type with match macro. Said it was same style of programming. So that's static typing (Typed Racket) and macros for sure. Possibly ADT's depending on whether you object to claim above. Should cover your list of requirements.

The problem here is that a single variant tag does not uniquely define a type, as all such type systems expect.

Re: How I wrote a self-hosting C compiler in 40 days

#127

Earlier quoted context omitted.

A commenter elsewhere said Racket had ADT's with langplai but also with langracket via subtypes of struct type with match macro. Said it was same style of programming. So that's static typing (Typed Racket) and macros for sure. Possibly ADT's depending on whether you object to claim above. Should cover your list of requirements.

The problem here is that a single variant tag does not uniquely define a type, as all such type systems expect.

You think it could be modified to handle that?
Post reply on HN