Tuesday, November 24, 2015

;;; Narf!

"What are we going to do tonight, Brain?"

"The same thing we do every night Pinky - try to take over the world!"

Seems like I've got enough to work with to try this package idea now. A stream of gesticulating wildness that strays into the nethermost regions of the nether...um, regions of something anticlimactic here. I've got a little idea and I've got a little code. I'm going to try to install whatever this crap is into the Lisp I'm writing and see what explodes. Nothing should. 

More likely it won't do anything. Anything intelligent, that is. I'm expecting frustration and angst. Maybe crying. I hate wasting time, and attacking packages seems like the ultimate in tilting at windmills. Of course, nobody would know if I wasn't blabbing about it on the internet. This is meant to motivate me because mom isn't the only person reading. Unless she's spoofing Google stats again.

I'm going to report back if this festering pile gets a full head of steam and threatens humanity. Or my sanity, which, like a well-worn shirt, is frayed to the very moment of disintegration.

Maybe it'll work. Though I fear it will end, as so many episodes do, in travesty and hubris.

"Like every night, Pinky."

"Narf!"

Saturday, November 21, 2015

The Fun Part Is...

The fun part is thinking.

I just erased the post that I was writing here. It was as incoherently difficult to follow as the logic inside what I'm exploring, so I'll write it again. It's some hard shit. For me. But it's the kind of stuff I like to do. Does that make me masochistic? I wonder sometimes.

Packages work. OOP works. But they don't. But they do. There's something there, in each of them, that needs to be elevated as the absolute truth because we would otherwise be suffering in the darkness of Pascal or worse. And something in each that must die or we'll never make it as a species. That's why I spend a lot of time trying to understand each. Since I want to explore them, I explore them in Lisp.

Friday, November 20, 2015

Well, This Is Awkward...

The deeper I go into Common Lisp, the more I realize I'm just baby-stepping along the path blazed by John McCarthy. In awe. Dude was pretty out there. He was out there and his language and disciples are some scary individuals, too.

Any language that turned Paul Graham into Paul Graham and two of the craziest programming books ever written is worth looking into. No knock on Peter Norvig, or any of the other SLW's who aren't really SLW's, but studious and capable. I remember thinking I was a competent programmer who might have been actually kind of capable. Then I read a post on c.l.l from a giant-brained guy who wrote the language spec and about how he wrote a parser in a half-hour before bedtime. (blink blink). I'm useless before bedtime. And a parser in 30? Yo. That's as sick as anaphoric macros. Want to find some newfound humility? Read OnLisp cover to cover and realize you would *never* have thought of *most* of that. Probably never.

Unless you hacked Lisp.  Then you'd see that's just how all the old timers think, and have thunk, for as long as they've hacked Lisp.  Stepping into Common Lisp is a humbling experience.  In a good way. It's not that there are better languages out there. There might be. I don't worry about metrics like that. I use Common Lisp to think.  Most of the other languages demand my attention.  Lisp is like the friend that's always ready to play.

And the more I think with Common Lisp as the mode of expression, the more I learn that I'm still metaphorically climbing the mountain that John McCarthy mapped out.

Common Lisp has some weird quirks. It has areas of the language that work, and well, but awkwardly. Like a lurchy teenager that's borderline adult and almost does it right, but there's just that one thing that's not right.  Some things don't scale and packages are it.

I think the packages solution I'm working on is, but isn't, necessarily novel. I had the feeling this morning that it has more to do with m-expressions than anything. I just made it up in my imagination right now that McCarthy saw Common Lisp as some kind of mathematical, amorphous wildness that was akin to primordial ooze. Mud. Common Lisp is Mud, and not in a derogatory way. It's up to m-expressions to terraform that mud into cities, solutions, infinity ... and beyond.

Looks good on paper. Still have to code it, but it hit me yesterday that what I may be attempting to write was Common Lisp, but wasn't. But it was. That's when I thought maybe it's a form of m-expressions on top of all that mud and turtles all the way down.

Thursday, November 19, 2015

I'm Pedaling As Fast As I Can

I'm working on a description of this package implementation I've suddenly found myself exploring. I freaked myself out this morning, staying up until it was time to get up making sure I was playing with a full deck and the logic was reasonably sound. It seems to be holding together. As soon as I have a reasonable description of the concept, I'll post it here. I'm fighting my brain, which is convinced that what I'm writing about isn't new, has been done, and smacked down for valid reasons that will become obvious as I try to pull together all the details. I hope not. I'm pretty sure not.

More to come.

Saturday, November 14, 2015

The Problems I Solve, I Seem To Be Making

I had something to say, but I forgot it.

I was going to title this missive "I'm Writing Packages. What Are Packages Again?", but I decided to create a theme with titles and see if it makes it easier to remember articles by slight variation in title.

Now I remember what it was...I'm an idiot. I start dinking around with packages, functions, and classes, decide I'm going to write a package system and blab about it on the internet. Whooooo!!!

I have to write it now. It could be fun to explore if nothing else.

I was going to write about some of the issues of packages, but while I was reading Erann Gat's "The Complete Idiot's Guide to Packages" I realized it was written for me, the idiot, who needs to learn about the issues of packages again. Because I have to see if what I wrote is any kind of reasonable.

It's fun to write about and imagine it's really real. I hope it really is. Really.

Friday, November 13, 2015

Solving Problems Is My Life...

It's weird that I think it's possible to alter the way packages work in Common Lisp. It's almost heretical. It's like suggesting everybody who had a hand in Common Lisp was on a three-day bender when they came up with something like defstruct. Or packages. And it's about time and they really need to be done right, because...I dunno, drugs? But that's the cool thing about the language. You can go rogue on whatever part of it you want.

Think you can do something different or better? Go ahead. Just be sure to remember the system is pretty tight and some smfers pored over a lot of detail to come up with workable solutions. It's possible, with reasonable statistical probability, that it's already been done. Or attempted. Best to ask first. I don't ask when I enjoy the explorations and this package stuff is fun. If it turns into something, I can add it to my Android Lisp and share it here.

I was feeling pretty sheepish when I thought of what I was trying to do as I read about the package system for the umpteenth time. Then I saw some statements that made me realize that if I could make a couple of things work different, it'd maybe be a contribution. Maybe. It'd be dialog-worthy at least. Hopefully.

I went back and read the package docs again. I think I can maybe make some changes that make sense. I'll just test it for a while and keep quiet until I have something of interest to report.

Thursday, November 12, 2015

I'll Play My Mulligan Here

While looking at my latest experiment in linguistic gyrations (since I discovered Common Lisp in 1997, I find myself sandboxing ideas frequently) I found myself wondering if I was delusional for even spending time trying to alter the way packages and functions are interacted with.  Something there is drawing my attention, but it's vexing.

Because this morning I looked at it, and it's jarring and weird.  No other way to say it.  I'd post it here, but the idea has to live on the other side of this senseless screed.  It's supposed to be logic.  This is where I sort things out.  It's guaranteed to have a mildly manic frustration packed like air in a turbine all compressed before the explosion.  I'm sure it sounds stupid to be wondering what could be so troublesome about working with packages and functions.

Maybe it's not weird to wonder about.  Everybody knows all this programming crap is full of weird frustrations, lost time, and failure by people used to at least moderate scholastic success, if not significantly better.  A high failure rate associated with software delivery should be unacceptable.

This morning, I was stepping back to look at the coherence of the design and I bumped into something.  Turning around, I found that big, gentle monster CLOS standing behind me, waving sheepishly.

Oh.  Wow.  Forgot about the OOP stuff.

It turns out it fits, but it's weird.  New thoughts are like that.

If I can dredge up the alternative method dispatching thingie I put together about 10 years ago, I'll share that.  It's probably anticlimactic, but it might have some value, even if it's a "don't go down that road" lesson.  I'm pretty sure I was heading for that project to write about and share when this project grabbed me by the pant leg like a precocious puppy determined to drag somebody into play for as long as everybody is awake so we can play, then eat, and then sleep in the big pile until it's time to play again.  Kids are fun, no matter what the species.  We're all wired to learn when we play.

I suddenly feel like I'm writing a blog about nothing, but I'm pretty sure that's been done and way better than I can "Etch-A-Sketch" anything.

Wednesday, November 11, 2015

It Stops Hurting After I Find the Answer, Right?

It's fun to explore language concepts in programming.  Unfortunately, it's hard to experiment in many languages, especially in a way that rewires the language itself.  Common Lisp is very accommodating when it comes to experimentation and welcomes being rewired.

I've been playing with the package mechanism in Common Lisp for a couple of days and it looks like there are some ways to evolve it.  It's intricate, but seems like there's opportunity to alter the way packages and functions are managed.

I've been adding some operators that allow constructs to be built and tested.  So far, the structure works and it's highlighted where it appears the real core of the issues live and that's going to take some more experimentation to get into a more robust model.  More to come.

Tuesday, November 10, 2015

I'm Pretty Sure It's Supposed To Work Like That

While dinking around with Common Lisp and some idea about something I'd already worked on, I started wondering about packages and functions, classes and methods.  Packages are weird.  I wondered if there was some other way to make packages work.  Surprisingly, or shockingly, I came up with an idea that actually seemed viable and interesting as a way of working with organizing structure.  I'm building it now.  It looks interesting.

I think I'll have a working model of this strange new idea in a few hours.  I hope it makes packages easier to work with, but it could just be an exercise in better understanding why packages are difficult to work with.  Regardless, it's fun to be experimenting with metadata and program structure.

Monday, November 9, 2015

The Funny Thing Is

I'm revisiting some code I wrote a while ago.  This morning I realized I should have written about it in 2005 when I came up with it.  All the reasons why I didn't blog about it, which are pretty valid, will take another blog to describe.  The idea might be interesting.  I dunno.  I mean, I liked the idea enough to try it out.

While considering the code, I started thinking about all the ways it's possible to alter Lisp so it does things different.  It's a very liberating experience to be able to think, explore, and experiment with a programming language that is so malleable it will become my programming language, no matter how stupid I want to get with it.

Onions Never Made Me Cry Like This

I managed to wrestle my Android Lisp into operation.  Which was weird because I'm the only jockey running this keyboard and I thought it worked before.  Though I used the code-base for a project I built in Eclipse, so I might have been in the last desperate throes of Android Studio misery.

My really old laptop computer can run a lot of software, but when it cranks up Android Studio, it stops working.  At first, I tried to make that sound funny, but it's really not.  Recovering from severe brain damage is hard enough without Android Studio giving you 10 Android builds a day.  That's so 1990.

I can run a lot of editors and run a lot of software, but Android Studio grinds my computer to shut-off and has people in the room asking about the health of my system sounding like a jet engine.  I do what I can to keep the system cool, but I finally gave up on Android Studio for practical reasons, though I'll probably see if I can build the Lisp in it.  Android Studio has a clean interface, but it's unreal how slow it is on my system.  I switched to Eclipse to finish some projects and haven't been back to Android Studio for a while.

Now I remember why my software was broken.  Fixed a few small issues with a rogue package declaration, waited 15 minutes for Android Studio to grind surface material off my hard drive, heat the CPU to just below meltdown, then spit out an APK for my tablet.  Now it works.  I ran all the test code and it worked.  There are 192 functions written.  Almost done.  Whoot!

Only about a million miles left to go because I cherry-picked all the easy functions and now the hard parts are staring at me tauntingly like, "What're you gonna do now?  Huh, punk?"  Writing defmacro scares me.  Wait, I wrote it.  Phew!  I think I wrote it.  Better look that up.  Something else scares me, but I forget what it is right now.  I think it's the remaining 800 functions, CLOS, and everything related to I/O and ... everything.  Maybe.  I ain't scared now, because I got the repl going.  Or I'm a glutton for punishment.

I've never written a Lisp before.  I'm pretty surprised I was able to get this far.  I was curious one day.  I wondered how a piece of code I was writing would have looked if it used some Lisp structure inside.  That turned it into a weekend project.  I kept it going for a few weeks.  Three weeks in, I wrote a function to spit out all the functions and how many and I was shocked it came together that easily.  Maybe that's the marketing teaser and I'm about to buy the whole system with surround sound and extended warranty and the rest of Lisp is a beat-down.  I find it difficult to believe.  Writing Lisp in Java has been shockingly fun and fast.

It'd be cool if my code base could inhale large school of CMUCL code like whale inhale krill.  That would be the glorious, "and then a miracle happened", unilateral hand-wave over the tough part of the project that is usually not fun, only this time it'd be real.  And fun.  Common Lisp is always fun.

Sunday, November 8, 2015

Back to the Back to the Future. Again.

It's been five and a half years since I pulled down my Common Lisp blog.  I didn't know then why I did it.  I just did.  Now that I know why (head injuries from sports, mostly) and have some time reconnected to the great relativity we call reality, I've decided to restart a new blog that'll be mostly about Common Lisp and the myriad ways I enjoy exploring and using the language.

To begin with, I'm going to write about the implementation of an interpreted Common Lisp I'm writing on Java.  I spent three weeks writing it in April or May of this year, turned out close to 200 functions, then it was gone as life put the hurt on.  I'm going to resurrect the project, turn it into something programmable in Lisp and ship it on Android.  Then I'll figure out how to take over the desktop with it, and see what kind of trouble I can get into there.

Beyond that, there are language explorations, graphing packages, an operating system with secret sauce, and a few other goodies I've explored, built, and hacked out prototypes of.  Will see what makes sense to take out and play show-and-tell with for the sheer fun of it.