Type Checker for SL (Simple Language)

Posted by igor Mon, 27 Mar 2006 22:03:00 GMT

SSW Institute JKU

After two days of work I have finally completed my Type Checker for SL(SimpleLanguage). The specification of the language can be found here, but in order to make the language more usefull I have slightly modified and extended it (e.g. added return statements to procedures).

The scanner and parser had to be implemented with Coco/R, a compiler generator for LL(k) languages, which has been developed at the SSW Institute. What makes Coco/R somewhat special is the fact that it can process an attributed grammar of a source language. After having worked with Lex & Yacc and CUP, I have to say that I was positively surprised by the functionality Coco/R had to offer.

The only thing I was missing in the JAVA version of Coco/R is the ability to pass around Generics as attributes. That of course should be rather easy to fix but as of now I lived without it and put it on my @TODO list.

So the first part of the assignment is done. I am especially proud of the type checker though ;-). TPL was surely very helpful to provide the background and exercise which is necessary to implement typecheckers for such simple languages in short time.

The next goal is to implement code generation for the x86 architecture. Because of lack of time I will not transform the source language into an intermediate language, there will also be no or only very few and simple optimizations applied. Thus I will try the ad-hoc approach and emitt code while the parser is doing syntactical analysis.

But right now I will go home and work on other things since exams are coming up and I can not afford to devote all my time to this project (even though I would love to).

Another great cookout

Posted by igor Sun, 26 Mar 2006 22:24:00 GMT

Marsha, Ida, Michael and @me having a delicious dinner

that's 4kg of potatoes transformed into Roesti - a recipe I learned from my friend Christian

Last Saturday night we had another one of our big cookouts at Rothesay Place 13. Marsha has made delicious Quiche and I (with some help) have transformed 4kg of potatoes into Berner Rosti. It was very delicious.

Afterwards we watched two movies, The Constant Gardener and Cabaret. Both of them were quite good, so if you are planning a video night and don’t know what to get, check them out.

Charming Ruby Compiler

Posted by igor Fri, 24 Mar 2006 23:10:00 GMT

In the recent advent of interpreted dynamic object oriented languages, and the Rails framework, the programming language Ruby has gained widespread acceptance. Ruby has many cutting edge features inspired by programming languages like Eiffel and Ada, and its object system is inspired by Smalltalk.

Ruby in a few words:
  • is purely object oriented (everything is an object)
  • supports duck typing
  • supports closures via constructs called blocks
  • support for exceptions
  • ...

Now, as it has been stated in the first sentence of this article – Ruby is an interpreted object oriented language. Even though the Ruby interpreter is quite efficient (hey, otherwise no one would really use the language), there is no real industrial strength compiler for Ruby. One explanation for the fact that there is no compiler for Ruby may be that writing a compiler may be a substantially larger undertaking than writing an interpreter.

Both, compilers producing executable code and interpreters have advantages and disadvantages, but I do not want to go down that road in this article.

As I was looking around to see if someone has attempted to develop a compiler for Ruby I stumbled over the Charming Ruby Compiler.

The Charming Ruby Compiler is a proof of concept compiler from Ruby to C- (a compiler target language). Even though the Charming Ruby Compiler is NOT complete (i.e. it does not support everything the Ruby language has to offer), it is a very interesting project because it is useful for further study and analysis. I can really recommend the paper as an overview of how things have been done in order to engineer the compiler. In this context it is also worth taking a look at C-.

Information Aggregation 1

Posted by igor Sat, 18 Mar 2006 13:33:00 GMT

Compilers, computer architectures, programming languages…these topics make my pulse go up because despite the fact that there is never enough spare time to deeply delve into these topics as I wish there would be, I still try to spend every creative moment I have and feed my brain with this very fine nutrition around compiling techniques, architectures and programming languages. I am not trying to pretend to be a genious in these topics but what I have done is started to build up a collection of very delicate information which includes lots of very usefull links, papers, slides, etc. on these topics. Well, the reason I post this here because maybe someone out there may also find this usefull…

Pre-orders for OpenBSD 3.9 started

Posted by igor Wed, 08 Mar 2006 14:28:00 GMT

It is the time of the year again where you shall get out your CC and support a great project such as OpenBSD. Also check the undeadly post by Bob Beck.

All the new and fancy stuff is described here. I can’t wait to upgrade my current installation.

What do you listen to while you work? 1

Posted by igor Wed, 08 Mar 2006 03:03:00 GMT

Kosheen:Resist

Long forgotten but rediscovered – Kosheen:Resist. This wonderful collection of delicious vocal Drum’n Bass is just so wonderful to listen to in various life situations.

Usually I prefer to listen to Drum’n Bass while I work but after a while the fast and aggressive beat sometimes drives me crazy – so this album is definitely a must hear during hard times in front of the PC.

Well, but I better get back to do some work after having refueled with motivation and ambition….....

Trip to Stirling

Posted by igor Wed, 01 Mar 2006 23:01:00 GMT

behind me is Stirling

This Wednesday I went to Stirling with Klaus in order to see the Wallace Monument, Stirling Castle and many other little things in and around Stirling.

It was a very nice trip partly because we had very nice weather. But don’t let the sunshine fool you! Up on the Wallace Monument it was very very windy and cold!

We also went to see Argyll’s Lodging, the most complete surviving example of a seventeenth century town house in Scotland. Klaus has also published a story about our trip.

Blog syndication by jp@

Posted by igor Sat, 25 Feb 2006 23:50:00 GMT

Just a quick note to announce a link to jp@s blog syndication. Jakob has implemented this nice website and it is really neet since its so much easier to keap upto date with what is going on. Thumbs up jp@.

Rugby 6 nations cup: Scotland beats England

Posted by igor Fri, 24 Feb 2006 23:50:00 GMT

No one would have thought this could happen but these results prove it. Scotland beat England in the rugby 6 nations cup. They were playing last night at Murrayfield stadium in Edinburgh.

After the amazing victory against the English the whole town was packed with rugby fans wearing kilts, singing, drinking, and having a good time.

Walking down Princess Street was a funny adventure. One could experience first hand impressions of “scottish pride” – all I can say is yuppiee ‘we’ beat the english.

Semester break in England

Posted by igor Fri, 10 Feb 2006 23:50:00 GMT

Christina in front of a waterfall in Pitlochry

Christina@Edinburgh castle - the street behind her is Princess Street

Semester break in England is from the 11.-18. of February and thus Christina came up here to Edinburgh to visit me and see a little bit of Scotland. This time we even had more luck with the weather :). As usual we made some very nice pictures.

We went to see Glasgow for a day. It was a nice trip and we have seen the most intersting parts of town.

The day before our Glasgow trip we went to the Ocean Terminal shopping center in Leith where the Royal Yacht Britannia is located.

On Wednesday we made a day trip to Pitlochry where the picture with the waterfall was taken. We also went to a Whiskey Distillery and made a very interesting tour there. I am now a whisky expert! Since Pitlochry is also known for its nice walks we made the Edradour tour where we saw a beautiful waterfal and some very nice scenery.

At the Blair Atholl Whiskey Distillery in Pitlochry

We also went to see the Edinburgh Castle. I still had some vouchers so we could go in for free. There are 2 museums in the castle and the view over Edinburgh is just terrific.

I also finally had the chance to go to the Doctor’s Pub with Christina. A place where Christian (hello to Switzerland) and I went to eat the famous Ben Nevis Burger :). Well, the week went by quickly and Christina had to go back to London because school started again and I had to get busy with university again. But it was a very nice and exciting week!

Older posts: 1 ... 9 10 11 12 13 ... 15