Lambda the Ultimate

inactiveTopic Playing with the GNAT Run Time
started 6/26/2002; 7:58:49 AM - last post 6/10/2003; 1:10:16 AM
Ehud Lamm - Playing with the GNAT Run Time  blueArrow
6/26/2002; 7:58:49 AM (reads: 2393, responses: 7)
Playing with the GNAT Run Time
Miranda, J., Guerra, F., Gonzalez, A., Martin, J. How to modify the GNAT Run Time to experiment with Ada extensions. (ISBN: 84-87526-68-3).

Another Ada-Europe link. Gnat (free download) is an open source GCC based Ada compiler. It is one of the widely used Ada compilers, and provides many interesting features. This book length document is a detailed description of the Gnat runtime.

Since the Ada language supports concurrency, exceptions and various other language features that effect the runtime, this book may even interest people not using Ada. Obviously, if you want to play around with Gnat this is a great resource.

If you are more interested in the compiler front-end, I believe a book about the Gnat front-end is in the works. Until it comes out you can make use of some papers by the same author that talk about extending the front-end. (Springer LINK required for full-text access)


Posted to implementation by Ehud Lamm on 6/26/02; 8:07:03 AM

Ehud Lamm - Re: Playing with the GNAT Run Time  blueArrow
6/27/2002; 5:03:31 AM (reads: 1262, responses: 0)
I always liked to read compilers source code, and grok the internals. I wonder how widespread this tendency is among programming language fans. Is it just beacuse I generally like to hack, or is it beacuse I want to see "how languages work"?

Ehud Lamm - Re: Playing with the GNAT Run Time  blueArrow
6/8/2003; 5:30:22 AM (reads: 850, responses: 0)
New URL.

Darius Bacon - Re: Playing with the GNAT Run Time  blueArrow
6/8/2003; 12:30:56 PM (reads: 847, responses: 1)
Reading compilers is something I do on occasion (see my annotated RABBIT for one), but most `real' compilers are too complex to be worth reading just to see how languages work. Actually that sounds like a good idea for a link collection -- language tools that are fun to read.

Ehud Lamm - Re: Playing with the GNAT Run Time  blueArrow
6/8/2003; 1:23:49 PM (reads: 862, responses: 0)
Right! In fact, I am a real fan of reading source code, and try to organize code reading workshops from time to time. Reading the source code of compilers and interpreters is obviously something I enjoy...

The original J interpreter (written in C) was really fun to read. I am not sure it is still out there, but if you like C hacks, you really should take a look.

Darius Bacon - Re: Playing with the GNAT Run Time  blueArrow
6/9/2003; 11:08:09 PM (reads: 845, responses: 2)
Haven't found that one. Peter Norvig's code is some of the most enjoyable reading I've seen... The AWK Programming Language has some very nice code for teeny little languages, with a very practical bent. I wish I could think of more instructive code online, not in books.

Have you ever had one of these workshops?

Ehud Lamm - Re: Playing with the GNAT Run Time  blueArrow
6/10/2003; 12:25:50 AM (reads: 878, responses: 1)
Haven't found that one.

The closest thing I found is here. I am sure the .c file is somewhere, but I can't put my hand on it at the moment.

Have you ever had one of these workshops?

I did several informal sessions, but never managed to get anyone to pay me for it..

I think code reading workshops can also be used quite effectively for OJT (in house training). They work well with the Socratic way of teaching, which is really the best way to learn about software: Find the improtant questions, and try to figure out the answers.

Ehud Lamm - Re: Playing with the GNAT Run Time  blueArrow
6/10/2003; 1:10:16 AM (reads: 916, responses: 0)
can also be used quite effectively for OJT

Let me elaborate.

Most oragnizations have a complicated IT architecture, often involving multiple databases, transaction monitors, and core infrastructure subsystems. We try to educate programmers about the philosophy of the architecture in use, by exploring the code of some of the central components.

Here's the way this works. I sit with one or two of the people who are most knowledgeable aobut the system, and decide what pieces of code to review. Mainly, we want code that reveals imoprtant design issues, and that show interesting techniques. I then carefully read the the code (and code it depends on) and try to find the most useful pieces (often deciding that some piece of code we forgot is, in fact, essential for understanding the story). I may then go back to the in house people I interact with, so they can review my suggestions.

When the code base is finalized, we may use code beautifiers etc. to make the code reading experience more fun.

In the workshop itself we try to reverse engineer to code, and expose the major design decisions. Some will be enlightening, and some will prove to be wrong, and emberassing (either because they were so to begin with, or because things changed since the original code was written).

Depending on the platform and tools, we may also do some quick hacking, to prove to ourselves that we really understand what's going on. Often we will realize that things are more complicated than we thought.

Along the way, me may find interesting coding tricks, obscure libraries etc.