Live data from Hacker News

Dennis Ritchie's first C compiler on Github

github.com

41–50 of 88 posts

Re: Dennis Ritchie's first C compiler on Github

#41

Earlier quoted context omitted.

if(foo) I avoid doing this because it looks like a function call.

In an appropriately powerful language, it could be a function call.

after

  #define if(X) LET(_it,X) if (_it)
it would be a macro call

Re: Dennis Ritchie's first C compiler on Github

#43

Earlier quoted context omitted.

if(foo) I avoid doing this because it looks like a function call.

In an appropriately powerful language, it could be a function call.

This is all very well if you have a friendly, high level scripting language like Ruby, but I'm definitely glad I don't have to write a C compiler where functions can take arbitrary blocks of code.

Re: Dennis Ritchie's first C compiler on Github

#45
post #4
post #2

Is this written in C? If so, what compiled this? Sorry for the noob question, I'm just a little lost.

Looks like a very early dialect. C assumes everything is an int unless specified otherwise. You can declare parameter types after the function name. So: init(s, t) char s[]; { would be equivalent to: int init(char s[], int t) { This still works with modern compilers. I'd be interested if anyone has any more info about this: waste() /* waste space */ { waste(waste(waste),waste(waste),waste(waste)); waste(waste(waste),…

> Looks like a very early dialect. C assumes everything is an int unless specified otherwise.

It looks beautiful, almost like a scripting language. No monster type signatures like

    const std::foo_bar>&

Re: Dennis Ritchie's first C compiler on Github

#46
I'm ashamed for having to google his name but for others like me here's a glimpse:

"Dennis MacAlistair Ritchie (born September 9, 1941; found dead October 12, 2011) was an American computer scientist who "helped shape the digital era." He created the C programming language and, with long-time colleague Ken Thompson, the Unix operating system"

http://en.wikipedia.org/wiki/Dennis_Ritchie

Re: Dennis Ritchie's first C compiler on Github

#47
post #43

Earlier quoted context omitted.

In an appropriately powerful language, it could be a function call.

This is all very well if you have a friendly, high level scripting language like Ruby, but I'm definitely glad I don't have to write a C compiler where functions can take arbitrary blocks of code.

Apple took care of it for you:

http://en.wikipedia.org/wiki/Blocks_(C_language_extension)

Re: Dennis Ritchie's first C compiler on Github

#48

He already used the right brace style (hanging braces, cuddled else) and the right indentation (tabs, not spaces).

tabs are an infinite source of pain and inconsistencies...

Everyone must support the space character, it cannot be banned. But a simple commit hook to ban tabs can make indentation and alignment not get messed up over time with many collaborators with default-configured editors (that mess up and use tabs for alignment).

Re: Dennis Ritchie's first C compiler on Github

#50
post #7

Coincidences... I thought "How come Warren Toomey (one of the guys of the Unix Heritage Society [1]), has never posted this?" Turns out, this Github-repo is just a mirror/copy of his work, but with attribution [2]. Still worth reading through there, tuhs also stores some extremely old UNIX versions. [1] www.tuhs.org [2] http://cm.bell-labs.com/cm/cs/who/dmr/primevalC.html Edit: Warren has written a paper on restoring…

> Edit2: Now that I've thought a little bit about it, I'm not happy that the sources are on GitHub in this form.

If one releases code under an open license and people use/copy/fork it, why should you or the original author be unhappy. (As long as the license terms are not being broken.)

If we had to worry about this each time we forked/cloned someone's work, it would make code reuse very hard.

[Edit]

I am working on some Python charting. I found Pychart, which I found interesting: http://home.gna.org/pychart/ . Because it is in bzr which I don't work with, I put it on github. Should I be worried that someone will feel offended with it?

Post reply on HN