Bootstrap Scheme v0.1 (Integers) in Ada

January 12th, 2010

I did decide to follow along with Peter Michaux's Scheme from Scratch series in Ada, and I just finished v0.1 (Integers), which you can find on GitHub.

$ gnatmake scheme.adb 
gcc-4.3 -c -gnatVa -gnatwa -g -gnato -fstack-check -gnat05 scheme.adb
scheme.adb:131:15: warning: "others" choice is redundant
scheme.adb:131:15: warning: previous choices cover all values
gnatbind -x scheme.ali
gnatlink scheme.ali -g -fstack-check
$ ./scheme 
Welcome to Bootstrap Scheme -- Ada version.
> 34
34
> 235
235
> 23543
23543
> ^C

Surprisingly, my v0.1 Ada implementation is only 119 LOC, while Peter's v0.1 C implementation was 126 LOC1. I expect this to reverse very soon because I feel that string manipulation in Ada is more obtuse than within C and the Read function which handles parsing will quickly become the most unwieldy part of the code. How did I end up with a marginally shorter number of lines this round, though? My guess is that all the brackets is what racked up the LOC for Peter since my code is pretty much a straight one-to-one, C-to-Ada port of his original code.

I'm having fun learning a lot about language implementations, Ada, and C too. I look forward to getting some free time to play catch up with Peter who is already at v0.8!

  1. According to GitHub's count for LOC.

« Previous Entry

Next Entry »

View Comments


Recent Entries


TryParenScript.com

On July 23rd, 2010


In response to "A JavaScript Function Guard"

On July 19th, 2010


My Notes from John Resig's "jQuery Hack Day" Talk

On July 5th, 2010


Announcing Pocco

On June 29th, 2010


Yet Another Lisp

On June 25th, 2010


Recent Happenings: All Play and No Work

On June 21st, 2010


Arguments.callee considered extraneous

On June 2nd, 2010


Javascript, "bind", and "this"

On May 20th, 2010


Class-Based Views and Django

On May 19th, 2010


Introducing Zoolander

On May 2nd, 2010


Creative Commons License

Fork me on GitHub