Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!nerds-end From: "BartC" Newsgroups: comp.compilers Subject: Re: Good practical language and OS agnostic text? Date: Fri, 20 Apr 2012 09:45:18 +0100 Organization: A noiseless patient Spider Lines: 51 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <12-04-048@comp.compilers> References: <12-04-019@comp.compilers> <12-04-021@comp.compilers> <12-04-040@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: leila.iecc.com 1334978465 46602 64.57.183.58 (21 Apr 2012 03:21:05 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Sat, 21 Apr 2012 03:21:05 +0000 (UTC) Keywords: books Posted-Date: 20 Apr 2012 23:21:04 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:591 wrote in message news:12-04-040@comp.compilers... > I have an undergraduate degree in computer science as well but we didn't > get into much theoretical stuff. Same here. I started writing my own compilers out of necessity (to make it easier to program the microprocessor circuits I was building; it was just not practical to run someone else's compiler). But I also created my very simple languages which could do just what I needed. I'd heard of the 'proper' parsing methods in my compiler course, but ignored all that and just did whatever was necessary to tokenise source code, parse the few statements I had in the language, and write whatever code was required to run the results. And it worked! I think those first attempts might even have been single pass compilers, so ultra-simple if that was the case. > I really want to understand the parts well enough to write my own pieces > and not use something other people have written. That method has always been a > good idea in the past because I was forced to understand how the code > works. If you use other people's code you can miss things. (Again, same here. Thirty years on and I still don't think I've ever used someone else's actual source code (or language). (However I do use some libraries, and someone else's OS.)) >> I hope this gives you some hope because its not the easiest subject to >> tackle. There is no substitution to just working at something just >> starting your own small basic compiler project to understand >> expressions will give you very much of what you want to know for the >> basics in my opinion and just work at that in your own time. > > Thanks that's exactly what I'm after. I don't have any plans to rock > the compilation world or write books on the subject. I'd be very excited > to be able to understand the basics enough to produce something I can use and > to use that as a path to additional learning on the topic. Start with a very simple language. Perhaps even a version of Basic (as a useful language consisting of Let, If, Goto, Print (and perhaps Input) can be created without any structured statements; only expressions need recursive methods to deal with). You might consider also interpreting the language rather than translating to a target language. And use an easy, dynamic language to implement it all in. Stay away from C, C++, or anything else with curly braces. (Sorry, I can't recommend any books because I haven't read any...) -- Bartc