Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Writing a compiler.

Name: Anonymous 2011-10-04 10:37

Hi, I'm currently on a placement year at University studying computer games programming. When I go back I will be writing a compiler.

I'm trying to be as prepared as I can be before returning to university.

Can anyone give me tips, a good place to start or any advice for starting?

I imagine that I'll be writing the compiler in C.

Name: Anonymous 2011-10-04 10:51

Just write a <ass> to <shit> translator in Lisp.

Name: Anonymous 2011-10-04 10:54

Write an interpreter and read SICP. Then you will realize how piss easy it is to make a decent compiler.
The hard part is generating the appropriate graphs and structures for optimizations.

Name: Anonymous 2011-10-04 11:19

I'll be writing the compiler in C.
Poor guy. Take it easy and use s-expr syntax.

Name: Anonymous 2011-10-04 11:38

>>4
If writing compilers in LISP was much better, why all compilers are in C?

Name: Anonymous 2011-10-04 11:48

>>5
If you think about it, every Lisp program is a compiler for a domain-specific Lisp language.

Name: Anonymous 2011-10-04 12:08

>>5
Because you either like Lisp so much that you don't really want to implement non-Lisps in it, or because you like your new language so much that you want to implement your new language in itself (and you may or may not write a quick implementation in Lisp because it's easy - O'Caml guys did that for bootstrapping, then rewrote that part in O'Caml after it was capable of running itself).

Name: Anonymous 2011-10-04 12:13

>>3
Thanks for the advice on reading SICP, found the online version.

>>4
I've never had to use S-expression before but I've got a full year before going back to uni.

Name: Anonymous 2011-10-04 12:36

>>1

I imagine that I'll be writing the compiler in C.

Yes and no. Standard tools are lex and yak (or some more recent variant), which generate C code from grammars, etc.
Moreover, it is possible that you'll have to use a language in the ML family, such as OCaml for instance.

Name: Anonymous 2011-10-04 12:56

>>5
LISP
GC is shit.

Name: Anonymous 2011-10-04 14:24

You are boring. You should get out.
Worse than that, you keep repeating your opinion each time you see a language that fits your criteria - criteria which is trivial for anyone to understand (has ``garbage collection'' or ``is high-level language''). This means that each time someone mentions just something which is very common, but you dislike, you will feel compelled to post this answer like a useless spambot. I don't understand how such an action doesn't bore you and how you don't see why anyone would find this utterly boring, regardless of their position about the use of garbage collection.
Your opinion has been noted and we don't need to hear it each time someone talks about a high-level language or talks about garbage collection in general. The opinion isn't even worth stating because it does not contain any other content than that you dislike or you think that garbage collection is not a good quality in a programming language or language implementation.
It is even more redundant than this post of mine. It does nothing more than lower the PSNR of the board.
Please cease or go back to /b/ (because it's one of the few boards that doesn't consider mindless spam and redundant repetition a bad thing).
If you're attempting to force this as a meme, it also belongs there. You might mildly succeed if some other loser decides to pick your forced meme up as a real meme and go with it, but that isn't likely to work on many people if any at all as this board is tiny, there is a saying that there are only 3 people in here: you, me and The Sussman.

Name: >>11 2011-10-04 14:25

That was obviously directed at >>10.

Name: Anonymous 2011-10-04 14:31

read the book Concepts of Programming Languages

learn flex and bison
master C
maybe learn some assembly?

Good luck!

Name: Anonymous 2011-10-04 14:31

babbies first compiler

Name: Anonymous 2011-10-04 14:56

>>10
C
GC is shiSegmentation fault.

Name: Anonymous 2011-10-04 15:42

>>13
I'm downloading Concepts of Programming Languages now. I've got a good list of books to work through atm as I'm also learning OpenGL. I'm also about to start the online A.I. course that Stanford University are doing in a couple of weeks. I'm going to be horrendously busy for the next few months.

I've worked with MIPS assembly when working on a PSP, and I'm pretty competent with C. I've just not worked much on low level stuff, but I do find it very interesting.

Name: Anonymous 2011-10-04 15:58

Dragon book

Name: Anonymous 2011-10-04 16:00

>>16
I've worked with MIPS assembly
Alright you should stay here.  Hell, you might even improve our signal-to-noise ratio.

Name: Anonymous 2011-10-04 16:00

>>17
Overrated shit.

Name: Anonymous 2011-10-04 18:17

I just learned how to use the spoiler tag, and now I'm shitposting on pork!

Name: Cudder !MhMRSATORI!FBeUS42x4uM+kgp 2011-10-05 4:57

>>16,18
Worked with PSP? We have a project in /jp/ and are looking for experienced PSP and MIPS reverse engineers/software analysts. See http://boards.4chan.org/jp/res/7852126 for more information.

Don't change these.
Name: Email:
Entire Thread Thread List