Monday, February 8, 2016

This Old Android Colors App

I wrote an app last year.  It was written in Common Lisp.  It generated colors and selectors for an Android app.  It had an interface.  It kept colors related by degree.  It worked.  I put it away.  I forgot about it.

I can't imagine how Hemingway wrote in such short sentences.  It makes me nuts to feel all constrained by a single thought and not be able to use a conjunction to extend a thought to something maybe meaningful like...

I forgot what I was saying.  Then again, Hemingway wrote amazing books which have withstood the tests of time and I write marginal software and blog posts (also likely marginal.)

The point, the point... what is the point?  I wrote a color app for Android last year.  I wanted to make buttons with stroke and fill colors and lots of them.  But being a total color spaz, I wanted them to look like they had some kind of relation other than "lots of them".  Because we all know from emacs, hmm, editors in general, that lots of colors ends up looking not brown, like in art and oil painting or pastels, but like three vibrantly colored meals suddenly evacuated from... well, you get the point.

So I wrote an app in Lisp to see if I could write an app in Lisp that might help me work with colors while making said colors look visually appealing.  It worked.  Pretty much.  I used well-defined color relationships to create the color relationships.  I think I should have to find a way to put it on the web.  Because I think other people might want to generate the same thing I did, only for their own super-cool apps.  Not that it's the only app like it or that my apps are any great shakes (yet.)  But it's good to have choice and maybe it could be something somebody might want to use.  Maybe.  I never know what anybody wants anymore.

The app allowed for a variable number of controls, a stroke color and a fill color.  Each could be defined by color relations and then the degree/intensity could be modified:

  • analogous
  • triadic
  • split-complement
  • complementary
  • lightness

There might have been some other color relationship thing in there, like monochromatic.  It was a decent prototype, so I think as soon as I finish this calculator, I'll add it to the short list of projects to get done, because web projects in Lisp aren't difficult.  At least I don't remember them being difficult.

Not that I'm writing a teaser or anything.  I find if I don't write a note about it for public consumption, I forget about it.  Like I did last year whenever it was I wrote this app and forgot to write a blog post about it.


The fact that the app generated something like 200 color specifiers (I'd said 1500 earlier because that was the last index on the generated colors, but went back after thinking about it and calculating how many unique colors it would have created) and scads of other detail is what has me thinking it might be useful.  I think that's why I built it in the first place; I wanted colors, but I didn't have ten years to generate all the xml by hand, and if I was going to do all the xml by hand, because I wanted colors, I knew I was going to end up with black, white, and charcoal grey and a lot of impatience at that.  And my inner artist wanted something less Seattle winter and more Seattle spring.  I'm from Seattle.  If you've been, you know why coffee is big, winters are depressing, and spring is like waking from darkness into lots of fresh berries everywhere and colors that leave you blinking as you wonder where all the amazing colors came from.  Spring is an amazing season, but spring in Seattle is pretty nice, though it's been twenty years since I've visited.

I wax poetic sometimes.  But I can't write like anybody else.  Except I used to channel my inner Hunter S. Thompson a long time ago.  But that's a story for another time.

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?

Monday, January 25, 2016

A Lisp Mind, Trapped in a Java World

You know how it is.  Slogging names like SomethingReallyLongWithItsTypeAtTheEndDialog.  Groveling through docs endlessly while trying to remember how to make the widget work right, but the names and the choices are so similar, you have to try a bunch of them before figuring out the right one, which might turn out to be the wrong one for some configuration or target system, but the docs are so light and confusing, they don't tell you that, you have to find out for yourself while the pressures of life squeeze like a vice and HURRY UP AND SHIP IT is all anybody ever says to you along with I THOUGHT YOU WERE DONE?!  Madness.  As if that's not enough, endlessly waiting for the build to finish and launch before you can agonize over the slow-motion rumblings of a debugger spitting out insane volumes of meaningless crap for an indication of what really went wrong that got set to null for you to find like buried treasure somewhere up there after scrolling around.  Again.  And again.

I wrestled with a simple math problem in Java for a while yesterday.  For far longer than it should have taken.  I was progressively more sure my brain injury was slowing me down.  Or I did think it, because I couldn't believe I couldn't solve a simple trigonometry problem involving a handful of variables.  I spun over it in Java, editing, thinking, compiling, waiting, building, testing as time flew by.  I started thinking I needed to get out of programming and accept I was old, broken, and rapidly losing intelligence and vitality.  I paced the room waving my hands as each held variables and my mind creaked and groaned under the strain and I felt the desire to overcome a simple problem rapidly diminishing.  I never quit, but quit was all I heard in my head, screaming like a Siren into every fiber that was me.  I was almost seduced, but then I remembered...Lisp.

I fired up Clisp.  I wrote an equation and fed it variables.  Then, I wrote a loop with an equation and the output got me... thinking.  Where my mind had been a wildly vibrating pile of gelatin about to implode only minutes earlier, it was suddenly calm, focused, and coming to life.  In two minutes I had carefully considered each step, then prototyped, considered some more, realized, and, eureka, solved what took hours to only confound me in Java.

For a moment, life was good again.

One day, I hope to be able to go forward into Lisp for good and the onto construction of some of these crazy ideas I have, and not get dragged into hell and halfway back to C++ ever again.  Amen.

Wednesday, January 20, 2016

Just Venting

I can't wait to get back to Lisp development and soon.  So many tools to build and Android/Java just keeps getting me down...

It's not Lisp the language that excites me.  It is.  But it's not.  It's the opportunity to experiment and try things out and do real rapid thinking that Lisp offers.

It's more than just fun to do real R&D and define ways to do things just to see how they work and what kind of structures they require and what kind of tools they need and see real things develop as fast as I can think, as opposed to as fast as I can type, compile, test, and repeat.

What I enjoy about Lisp isn't that it's the be-all-end-all of languages, but the beginning of exploration.  And an exploration anybody can pursue.

Wednesday, January 13, 2016

Early January Update

I really need to work on coming up with better titles for articles.

I've been working on Android apps.  It's keeping me from writing my pending Java-based Lisp-thing.  It's not keeping me from working on it at all, because it's the next app in the queue.  I just had to get some apps out of my head and get the flow going - for personal as well as professional reasons.

The last Android app is in the final stages.  Hopefully, not more than a couple of more days.  Then it'll be on to the Lisp thing I'm working on, because I have plans to make it the foundation of a Java-based Common Lisp on every platform kind of thing.  With a slammin' interface that *does things* that'll blow your mind.

I hope, I mean, I really hope so.  But don't hold me to it.  My kind of cool might not be your kind of cool.  Though I'm pretty sure I wouldn't work on it if it wasn't some kind of cool.  It's Lisp, how could it not have some kind of maximum inherent cool in it?

After all this Android coding, I'm looking forward to getting into a Common Lisp groove.

Monday, January 4, 2016

Plans Are What Happen In Between Distractions

I'm trying hard to steer back to work in Common Lisp, but with the writings about the Bible/Torah, and parasites, and health, along with the Android Development on normal apps, it's taking some time.

Here are some plans I have to write about.  The articles will come along with code on Github.  I'll be adding detail as time allows, in hopes that putting my eyeballs here and on my Lisp environment will allow me to rip through problems in that special way only Lisp makes possible.  To me.  You go ahead with your php and java, yo.

Articles, topics, and tools:
  1. Lisp editor with some kind of layer that will be like m-expressions.  It's still on paper, but it looks quite promising.
  2. New package system.  Also on paper (and if it works.  I'm pretty sure it'll work.  I'm just trying to build tension.)
  3. Language concepts that will use the m-expression layer.  Concepts?  Might be concept.  Singular.  It's been a while, I have to check.  Oh, I remember, there's at least two or three things.  There are plural concepts.
  4. Code and concepts I've dinked with over the years in Lisp:
    1. Charting package
    2. Poker game
    3. A different way to do polymorphic methods
    4. Accounting system...maybe.  Accounting is so very boring
    5. Tools for generating Java code
    6. Tools for generating Android Java code
    7. An editable operating system with simple apps and interfaces that's faster than fast, but maybe the editable part will be too confusing.  And the interface is too simple.  And the debugger needs to be normal-human-readable.  I'm not sure it's really workable, but it'd be fun to share and joke about, at the least.  I liked it when I had it running, but I never know if my bias as author affects my desire to believe things are as super-awesome as they seem and the math proves me a fool.
It seems the brain damage I contracted so very long ago gummed up the works with amnesia and aphasia-ed me up to the point I'd write things and then couldn't figure out how to get them out of my head and off my computer.  I can definitely correlate the head injuries to the abject poverty, so if any of this helps me find work?  Whoot!  That'd be a good day.

[Note to potential future investors and/or employers: the diet (Biblical section above) has made recovery from severe brain damage possible.  Leave an engineer alone for 20 years and they're going to figure some kind of problem out...eventually.]

Not sure how much of the list above is relevant anymore, but I think some of the concepts are still pretty slammin'.  But I'll share what I can and you can maybe tell me what you think as vociferously as you like.

My hope is that the editor and package system with m-expressions works as well as it seems it could.  I know I sound skeptical or even hesitant, but until things are done and coherent, it's easy to lay an egg.  Look at me, I'm hedging to software engineers.  You get it.  Marketing peeps are the dweebs that over-promise and demand miracles.  I've always felt that engineers just want things to work well with some modicum of efficiency and within a reasonably normal work-day.

My real hope is that something here gets me hired to slog lisp code, even if it's based on sales of a product I build.  That way I can build my super-OS on top of mobile devices and make those things fast and easy to use, so people put their devices down once in a while and look around a little.