News for hackers. Stuff that matters.
Re:Compiler Design in C by Ih8SF on Saturday November 15, 2014 @05:03AM (#8611332)
why use c? its a horrific, logically incongruent lang
Re:Compiler Design in C by jng on Saturday November 15, 2014 @05:42AM (#8611408)
Lowest Reasonable Common Denominator
Re:Compiler Design in C by kzrdude on Saturday November 15, 2014 @09:01AM (#8611687)
Maybe for fun? To learn something?
Re:Compiler Design in C by ternaryoperator on Saturday November 15, 2014 @07:18PM (#8613063)
It was 1990. There were not many options. The standard language for technical books then was Pascal. C was a huge improvement over it. In addition, Holub was the C columnist for Dr. Dobb's.
Re:Compiler Design in C by Dewie on Saturday November 15, 2014 @10:35AM (#8611843)
I won't echo this sentiment, but; why use C for writing a compiler? It seems that languages in the ML family, among others, are nicer for that kind of domain.

I guess it at least has its uses if you want your compiler to be really fast.

Re:Compiler Design in C by cardiffspaceman on Saturday November 15, 2014 @05:54PM (#8612872)
If you want to have fun exploring how compilers work, in your spare time after a hard day working in C++, what better way than to reimplement a language you know?

On the other hand, my projects in this vein are C++ projects but they implement functional languages or Scheme. I have implemented one parser that creates a syntax tree from a simple equational language, and several interpretive backends, such as SKI-combinator-based graph reduction and a TIM-based interpreter. I do care about the speed of the compilers I use for production code, but not for this work. The Scheme compiler I wrote was written to run on my own Scheme interpreter which was written in C++.

The reason I think most hobby compilers I know of don't go the way I've gone is that it takes tons and tons of research to find out how functional languages are implemented, and the Appel books are a bit daunting, too.

Re:Compiler Design in C by kps on Saturday November 15, 2014 @02:07PM (#8612350)
The book was published in 1990. I worked on a commercial compiler in 1990, and many of our customers ran it under 16-bit MS-DOS.
Re:Compiler Design in C by flatestcat on Saturday November 15, 2014 @05:21AM (#8611371)
I know what you mean, man. Lots of n00bz, ricers, and fanboiz will claim C is the fastest, most efficent lang because you can get "close to the metal" and "tweak". In reality, any code beyond trivial complexity will benefit much more greatly from algebraic rectification, which can only be done with certain languages that are amenable to formal analysis.
Re:Compiler Design in C by shadowfox on Saturday November 15, 2014 @07:51PM (#8613121)
> In reality, any code beyond trivial complexity will benefit much more greatly from algebraic rectification, which can only be done with certain languages that are amenable to formal analysis

What exactly is "algebraic rectification"?

While it is generally true that having a formal semantics aids greatly in analysis, it is worth noting that a very large amount of program analysis work is targetted towards C. (And mind you, flexible, high level languages bring with it their own troubles. Analysis in the presence of higher order functions is not a panacea at all)

Re:Compiler Design in C by userbinator on Saturday November 15, 2014 @10:32AM (#8611837)
Until I see an award-winning 4k/64k demo written in one of these ultra-high-level languages, I stand by my opinion that C is more efficient.
Re:Compiler Design in C by p0nce on Saturday November 15, 2014 @12:21PM (#8612095)
Check your facts. A large majority of award-winning 4k/64k are written in C++.
Re:Compiler Design in C by 10098 on Saturday November 15, 2014 @11:01PM (#8613413)
his point is still valid though
Re:Compiler Design in C by sfk on Saturday November 15, 2014 @09:00AM (#8611684)
Re:Compiler Design in C by sirfapsalot on Saturday November 15, 2014 @09:57AM (#8611776)
I think what flatestcat wants is something that actually functions and is proven to function correctly. Frama-C is yet another open source project that is long on hype but woefully short on delivery of actual, working code.
Re:Compiler Design in C by dang on Saturday November 15, 2014 @03:01PM (#8612495)
Replying to oneself using a bunch of different accounts is an abuse of this site.