Friday, February 5, 2016

I Started with Nothing, and I Still Have a Whole Lot of It, But Look at All the Words!

I never know what I'm going to write here until I start writing.  I'm close to finishing an Android project.  Once that's done, it's back to some kind of Lisp.

I just put out a teaser on my Products blog about an upcoming product I'm going to be working on.  I'm currently a day or so away from releasing an upgrade to a calculator I wrote for Android.  I'm thinking that after that, I'm going to work on another calculator, but something that might have a programmable feel to it.  Something that makes use of this Common Lisp engine I spontaneously erupted into last year.

I still don't know what came over me, but in something like 3-5 weeks, I had a working Common Lisp repl going that did a surprising amount of stuff.  I think I need ten or fifteen more core functions in Java, then I can jump into writing Lisp code on top of it, though I have a bunch of Lisp functions already defined.  Then I can try this experimental package system I've got running around in my head and wow, look at me, I'm all running off at the mouth like an excitable teenager.

The thing I remember about working on that Lisp, was that it wasn't like Android, or really anything else.  Where Android requires groveling over docs, trial and error, figuring, head-scratching, and laps over certain areas of the program, the Lisp engine went like this:  Oh no, a bug!  Where is it?  It's right there.  What is it doing?  It needs a cons or an atom or both.  That's it?  Let me fix it.  Fixed!  Let me test it.  It works!

I'm kind of doing it tongue-in-cheek, but it really was a lot like - logic.  Strange that would be missing in other engineering languages (I'm kidding, a little.)  At first I remember freaking out when there was a bug in read or eval.  Then, I fixed them and they... were fixed... and never came back.  Then a function would break and I'd get stressed but then I noticed the fixes started looking logical and stable and, once fixed, they never broke again and there was test code that built up along with the system and everything ran and if it didn't, nothing broke and it was easy to fix.  I think mapcar tripped me up for a little while, but it was like a couple of hours.

It was weird because I could feel the system growing and at the same time gaining in stability over time.  Unlike the Java syndrome, where things suddenly explode and you're left slogging through a stack trace that's 99% spew and one hyperlink to a null variable, the Lisp code just worked or it returned null and it's not supposed to and it's a small function and not much of a fix.

It was like Programming Nirvana.

It was like a dream last summer that just kind of happened out of a little experiment inside of another program I was working where I wondered how it would look like if I built a data structure that looked like maybe how Lisp would do it, and then I eyeballed Peter Norvig's Python code squinty-eyed like until I went, "Oh, that's what it's doing!" and that showed how a reader worked, and then I thoroughly abused the Java type system, and it was all so fun, even if it was only interpreted for starters.  I think it was the most fun I'd had programming almost anything because it was totally fast and fun and I'm pretty sure my smile grew with each new thing that was added and that doesn't happen often, except in Lisp because I could try it two or three or ten different ways until I got it right and it was satisfying.  Not slogging.

There's some tools that need to get put into it, error handling, and some core functionality that needs to be expanded on, and the package system either has to be the Lisp package system, which is mostly there, or the one I've been wanting to plug in and try out with some sort of Frankeninterface on top of it that might be cool... or just weird.  But it's R&D and it's fun to try things out and play like it's clay except with bits and ideas and how does it work like this, or that, or this other way... not getting all worn out just doing it one way then being too tired and knowing there's nowhere near enough time to even try to do it another way.

Even if it is interpreted, it's Lisp and it's fun and maybe if it can be exposed even a little bit inside of a programmable calculator on Android for starters, it might be fun for others, too.  Maybe?

No comments:

Post a Comment