Thursday, September 22, 2011

Back into Java for a while

OK, decided to fix a bushel of nagging bugs in the Java part of the system. I started by finishing the SORT function. Well, that led me into doing some serious problems with vectors such that I could sort them. And to use the Java sort system, I had to add about 15 methods in each most of the vector classes (the Java Collections system). Now I can sort vectors, but (there is always one or more of those...) there are fence post problems with bit vectors, strings, and lists. I'm pretty sure that I can make them work by the end of the weekend. Here is the prior thought.

And to add to the work, none of the Character functions have a Function2 interface - needed for Sort. And that will bring out ideas of updating the Unicode tables. They're about 4 years old now, and it would be good to update it.

I have a new student working for me on some new ideas for handling subtyping. It's built similarly with the Factory classes for creating new instances of types. For other of you don't know, types in CLforJava are reified with Java interfaces and map the CL type system. Many of these interfaces also house one or more nested static classes. For example, to get a Lisp Integer, you go to lisp.common.type.Integer.Factory.newInstance("57890978450503857"). In subtyping, many of the interfaces would also have another nested factory that can reify a subtype (for example, (integer 4 15)) as a function that can detect that a value or set of values that fit the type or not. Since this is a function (Java/Lisp), it can be used by the compiler with safe checking.

Tuesday, September 6, 2011

Sorting things out

OK, I'm tired of working on the new compiler, so I decided to fix up the SORT function. I had a student working on it last semester, and he had made some good forward work. Then he managed to crash the compiler. Not ours; the Java compiler. Ouch! So it was left on the floor for a while.

Ok, last weekend I decided to fix it up. I had broken a toe, so I wasn't going anywhere anyway. Going back with some of the Java code was a good thing. It showed some problems in the basic type system. I moved the java.util.List and java.util.Collection interface packages up to the lisp.common.type.Sequence interface. This forced me to complete the code for all of the affected classes. The next thing to redo is the implementation for the SortComparator (implements the Java compareTo method). The student didn't realize that compareTo has 3 possible values rather 2. hmmm.

This is where the type system gets a bit squirrelly in handling Vectors. More on that after I get sorting lists working.

Wednesday, July 20, 2011

(Back am I)


Ok, I've been away for CLforJava for a bit. Believe there is something more important than making a Lisp system. We have a GRANDSON!! He's wonderful, cool, cute, and feisty. My wife has been in NYC being a nanny, and I fly up on every other weekend. That schedule (school, flying, baby, house work) didn't leave me much time for coding. About the only place I could was on the plane. And that was slow, but making forward progress. Let's see...
  • rewrote the lambda list parser
  • fixed a lot of problems with APPLY
  • fixed problems with sequences
and one of my students (graduated but still working on the project - what a guy!)
  • has about 2/3 of the std tests working
  • of those, we have about 85% working
  • wrote FORMAT - some compiler problems found in that
We did come upon something we did not expect. One of my students was working on SORT. The approach was to use the sort in the Java library. As a design, it was rather simple (we had to teach it to use Lisp functions - but that's what CLforJava is good at). After getting out a few bugs, we were ready to try it out. We built it, and when the Java compiler came at the SORT, it crashed. It didn't complain, it actually crashed! That something not expected. We filed a serious bug - SORT is waiting...

For the last few weeks, I've been making a new compiler entirely in Lisp. Most of the new environment is done - which will make handling code MUCH easier. And I'm well into a semantic analyzer that will know how to handle all of the special operations. My goal is to have the SA working by school starts up in August.

The next big thing is building the structural analysis (a la Muchnick) module. The old compiler was pretty stupid. I expect that, having a "real" compiler, CLforJava will run with at least a quarter of the code and a speed-up of a factor 3 or 4. Thoughts that anyone has, please send them over.

Oh, yes. Sorry to the NYC Lisp Group - missed the flyer about of the gathering at Randall's island. I'm still going up, and I'd like to meet you folks!

As the last, I just have to let you see why the grandson is just wonderful!!

Jerry


Sunday, February 27, 2011

Work is coming on - really!

Yes, we're still working on CLforJava!

It's just that I've had a few distractions this semester. The biggest is that I have new grandson! To help the kids, I'm dividing my time between teaching in Charleston and going to NYC every other long weekend. That doesn't leave much time for parentheses...

But... I have one student learning about compilers by creating FORMAT. And another student is building the SORT function, based on the Java sort method. I do get a couple of airline hours to work on the current (ick) compiler. Not much, but it's still fun.

Great stuff going over at Planet Lisp. Thanks to all of those posters!