Archive for May, 2002

May 29 2002

Phase I Complete

Published by matt under Uncategorized

With Brooke’s help, we now have a Scheme compiler that can take a small program

(for example, the Scheme program ‘75′), and expand it into an executable Forth

program approximately 2.5K in size. Keep in mind, that Scheme program (the number

‘75′) is CPSed in the final output; it’s tail recursive, guaranteed!


:P

But the important thing: IT WORKS! YEAH! I had a misunderstanding about how my

interpretation of mset! should be translated to Forth. That’s all over

now, though, and even some fairly complex Scheme code compiled and ran

without any tweaking. Now I need to write a pretty-printer for our tagged Scheme

objects in Forth, and everything will be good to go.

To take the compiler from a Scheme->Forth compiler to a Scheme->pbForth compiler,

we need to

  • Add symbols (and strings?)

  • Add the motor/sensor primitives (trivial)

  • Add a front-end suite of macros for expanding things like cond

    and define into our Core Scheme

  • Tie the system into DrScheme 200 under Windows and X.

Someday, I will own the Google search for “Scheme to Forth Compiler.” Bwahahaha!

Ahem.

Time for bed.

4 responses so far

May 22 2002

Big moves…

Published by matt under Uncategorized

The impending move to UKC has been keeping us busy, and I suppose relates to the notes

I would be jotting on this site in a way. This post isn’t really about research per se, though (the move itself),

although research is a significant part of the motivation for the move.

I will point out the Southeast National Trails

site, though (and this one for my own reference).

Carrie and I are intending to arrive in London, perhaps dump some things in

Canterbury, and then walk the North Downs way, or the Pilgrims Way. This is a modern interpretation

of the path Chaucer and pilgrims of centuries past from Winchester to Canterbury.

This, I think, is a nice way to spend some time together before we head to opposite sides of the

island and get to work. And to see some of the country we’ll be living in for 3 years.

Comments Off

May 22 2002

Does it have to be semantically correct?

Published by matt under Uncategorized

It compiles to Forth code, and that code is syntactically correct.

Granted, the Forth code doesn’t run. A few things jump out from initial testing:

I have no idea how to go about debugging a Forth program.

I really don’t want this compiler to have to run past register allocation

just to compile to Forth.

Comments Off

May 20 2002

Success!

Published by matt under Uncategorized

It wasn’t an infinte loop. When writing a ‘meta-circular compiler,’ so to speak,

you have to be careful where the language of the compiler begins and your

implementation ends. In particular, there are some macros that (under Chez Scheme)

implement the semantics of the predicate ‘begin?’ for the last few passes of the compiler.

These same macros do not work in MzScheme, because they do not

get expanded in the same way. As a result, the meaning of ‘boolean?’ gets clobbered,

and Very Bad ThingsTM happen.

All of this is to say, SUCCESS! I have a Scheme->C compiler running

under MzScheme, and tomorrow will (hopefully) start and finish the Forth pass.

If all goes well, I’ll have a complete Scheme->Forth compiler running by the end of the day.

Now, we know that such unbridled optimism is bound to run into a brick wall somewhere,

but we can hope.

Comments Off

May 20 2002

Silliness == Two Schemes

Published by matt under Uncategorized

The “silliness holding up the Scheme compiler” is a difference between Chez and MzScheme

regarding when macros are expanded and top-level defines are expanded into the namespace.

While I’m confident there is good reason for separating out the stages of definition and

macro expansion, it is frustrating, because things that work in Chez _don’t_ work in Mz, and

visa-versa.

At least I know what the problem was now. And, I can fix it.

Update: One problem down, one infinite loop in test case 128… argh!

Comments Off

May 20 2002

Doldrums

Published by matt under Uncategorized

Last week was a “down” week. Instead of trying to fight it, I took some time to re-read

the Lord of the Rings, and got the apartment cleaned up for a visit by the ‘rents.

It was good to see them, although it was too short.

My goals this week:

  • Get past the silliness that is holding up the completion of the compiler, and finish it.

  • Transcribe the last day of class, and use it as the basis for a paper. This needs to be done

    soon for a variety of reasons. Wednesday, at the latest, I should start this.

  • Plan out a sequence of 6 labs for all the kids doing the summer program.

  • Write up some ideas re: what/how might be good things for the kids in the LEGO research track

    to engage in. I’m leaning more and more torwards distributed systems, because we have 6 bots

    per participant, and there are some cool, deep concepts for them to play with and explore.

Must… climb… out… of… funk…

One response so far

May 13 2002

Grr

Published by matt under Uncategorized

I’m tying all the passes together, and right now the compiler isn’t even generating good C code.

The bootstrapping code provides a “heap” and “stack” for us to play with (a couple of character arrays),

and provides some rudimentary bounds and alignment checking. All the code being produced right now

right now violates the alignment conditions we have on closures and data objects.

Poopies.

I need to put together a reasonably robust driver script to push all 200+ of our tests

through every pass, and make sure the code evaluates correctly at every step of the way.

Down at the UIL level, there are Scheme macros that let us run with msets

and mrefs in place; if everything tests out there, then I’m doing something

really silly.

Comments Off

May 07 2002

New participants?

Published by matt under Uncategorized

I think I need to follow up with Tammy and Andy… looks like they aren’t here yet…

While I think the hack to the update script to report “Empty Blog” was nice, I’d rather they weren’t empty.


:(

3 responses so far

May 07 2002

32x is fast!

Published by matt under Uncategorized

Let the record show that a 32×10x40 CDRW (WritexRewritexRead) is really fast.

The implication here is that 600MB of data can be written to disc at 32x

the speed audio is played at. Or, since audio is roughly 10MB/minute, a

1x CDR takes 60 minutes to write a disc. A 32x writer should take, oh…

Chez Scheme Version 6.7

Copyright (c) 1985-2001 Cadence Research Systems

> (/ 60 32)

15/8

>

1 7/8 minutes.

My first test (backing up parts of the PB) didn’t manage 600MB in under

2 minutes; it did manage 577MB in approximately 2 minutes and 40 seconds, though.

Close enough, in my opinion. And, it spanks the daylights out of my old 2x drive. Wow. Amazing.

Time to start creating multiple copies of this semester’s data…

2 responses so far

May 06 2002

No peace unto the wicked…

Published by matt under Uncategorized

Wow. The harassment begins. Looks like my delta for posts before harassment begins is 4 days…

Here’s whats up:

  1. CPS: I CPSed the subset of Scheme we’re working with high up in the compilation chain;

    this way, closure building and representation decisions that get made late in the chain will take care of the

    procedural representation of continuations I’m making use of (why? because I have lambda, why else?). Brooke

    (partner in crime in this endeavor) and I attempted to integrate my code into the rest of the compiler

    today, and I didn’t do a thorough job testing. After chatting with Amr this afternoon, I intend to heed his advice: keep

    it simple. I have some tools that traverse the tree looking for “simple” expressions in head and tail position, and

    it isn’t trivial. It isn’t horrendous, either, but it’s complex enough that when things don’t “just work,” I’m at a loss.

    Point being: time to throw some things out, start simple, put the code in a test harness, and do it right from the getgo. Well, that’s not

    entirely true: I’m going to simplify the “simple?” tests, and see if catching more things in the “complex-head-position” type continuation

    rules solves any of my problems.

  2. The summer course I was teaching has shrunk–disasterously. Things are up in the air (today) as to what exactly is happening.

    I’m faced with a possible opportunity to teach C212, our second course in the majors sequence, while still mentoring a few kids in the LEGO stuff.

    Basically, teaching a full-on course in 8 weeks (daily lecture) while also assisting in the mentoring of some high school students in a research experience.

    Without going into too much painful detail, my options are basically:

    1. Relax, enjoy the summer, and spend lots of time with one or two motivated (I hope) students

      on research projects of our devising, focusing around agent-based stuff with the LEGO Mindstorms kit/Star LOGO/Anything cool.

      This option has no cash available for Brooke, who was planning on co-teaching the summer course.

    2. Panic, stress out, teach C212, leave most of summer LEGO stuff to Brooke. Come in and help out, but most of the mentoring falls to her.

      Includes cash for Brooke. Not much time available for me to, say, pack up the apartment and get ready for the move to the UK. Involves teaching for the

      seven weeks before I leave 4x/week, with possible responsibilities for checking in on labs, etc.

    Suggestions? Number 1 seems like the obvious thing, and number 2 would be good experience, a good challenge, and something I haven’t done before. I’d enjoy it,

    in a certain perverse way. I probably would not enjoy the life pressure that would result.

  3. I bought a digital camera. And, a new CDRW is in the mail. These have nothing to do wiith my research, exactly, although the CDRW is a critical

    thing w.r.t. getting data overseas. And having a copy preserved here (backups!).

?

4 responses so far

Next »