Samrat Man Singh

Hi! I'm Samrat, a programmer from Nepal.

Miscellaneous updates(2016-11-23)

2016-11-23


Some random updates:

I’ve been reading Neal Stephenson’s Quicksilver. This is the second time I’ve started to read the book and I must say that I’m just having a lot of trouble getting into the book. That said, I haven’t abandoned it yet- I’ve enjoyed all of the other Stephenson novels I’ve read so far. Also, the last book I read, Gore Vidal’s Creation got me excited about the genre of historical fiction. I’m still hoping Quicksilver gets better eventually.



The other book I’ve been working through is Compiler Construction by Niklaus Wirth. This is a concise, and in my opinion, great introduction to compilers. I have also been building a small compiler written in C. It doesn’t have much yet, but here’s the test program, which it can successfully compile:

    a := 11;
    b := a+12;
    if a > b then c := b*5 
        elsif a > 20 then c := b + 5
        elsif 0 > 1 then c := 2*b
        else c := 101
    end;
    
    repeat
        a := a - 1;
        b := b + 3
    until a < 1;
    
    d := 14

No procedures, arrays or types yet(of course, it doesn’t have plenty of other stuff missing, these three just happen to be on my immediate backlog). But hey, baby steps!