Comments are Back

March 16th, 2006

I installed some spam filter for my comments, one that doesn\’t use CAPTCHA, which means it also works on trackbacks; my favorite kind of comment.

Most of the spam are being filtered out right now, it seems. Much better than the hundreds I used to get each day, in any case. The last few posts also have comments enabled again, so please, comment and trackback away.

Multiple Paradigms

March 8th, 2006

I\’ve got a few things floating around in my brain, making some odd connections. I recently watched Richard Dawkins\’ The Root of All Evil? where he discusses many of the problems with religion. And today I had a discussion with someone at work who didn\’t see why I would do a project in Lisp. We discussed a few different reasons, but there\’s one in particular I want to focus on, and I think it ties in with \”the religion problem\”.

Read the rest of this entry »

Concision

March 6th, 2006

After reading too many papers, skimming even more, and completely skipping the majority, I\’ve realized that there\’s a real skill to keeping things short but clear. Some papers ramble on past thirty-five pages while others leave out so much information that few people other than the authors have any idea what it\’s about.

An example of someone who does it well, in my opinion, is Robin Milner. This is a guy who has contributed so much to computer science, including ML and the π calculus. I\’ve read some papers of his before, and am now reading Communicating and Mobile Systems. I have ah-ha moments constantly, can read multiple chapters in a sitting, and when I get lost, five minutes of more detailed reading or exercises has me back on track.

Anyway, I\’m just frustrated by papers in general, and happy about Milner in particular. The difficulty of knowing what to cut is apparent, and it\’s something I want to keep in mind.

\”I didn\’t have time to write a short letter, so I wrote a long one instead.\” —Mark Twain

The Language Game

February 24th, 2006

Those of you who know me well, may know of my aborted attempt at language design. While working on it, I hit what I call the \”language design singularity\” — a point at which you realize you\’re headed down the wrong path, and make that jump to the right one. I imagine a lot of would-be language designers hit the singularity. People get interested in design because they recognize the problems with the current system, and seek to improve the situation. At this point, their path begins to move closer to the singularity, eventually there is a jump, like when a metal rod slides close enough to a magnet, and you find yourself in a world where your problems don\’t exist.

For me, it happened like this … Read the rest of this entry »

Hints for Happy Living #72

February 21st, 2006

Before you go to bed, lay out the clothes you plan to wear the next day in a place that gets sun in the morning. They\’ll feel cozy and warm when you put them on, like they just came out of the dryer. (Note: this may not be desirable if you live in a hot climate.)

Python Indentation

February 21st, 2006

So, one of the touted benefits of Python is its indentation-based structure. Who needs curly braces, begin-end blocks, or (heaven forfend) parentheses? Now, I agree … proper indentation makes reading code easier. However I don\’t indent my code, my editor does. And when I change the structure of something one keystroke fixes all the indentation. Does this happen in Python editors? How does it know which parts should be re-indented, and which are correct? Does the programmer walk line-by-line typing tab, or is the editor really smart enough to handle it?

Haskell behaves the same way as Python, but

  1. I don\’t write much Haskell either and
  2. the code I do write doesn\’t really have much indentation, thanks to pattern matching.

I\’ll admit — I\’m pretty hooked on parentheses. Working with an AST directly feels so powerful, and reader macros allow me to add syntax where necessary. I will try to listen to the Python side, though. I was pretty into the idea of indentation-based structure for a while.

BTW, this comes to mind because of Guido\’s posting where he says, \”I find any solution unacceptable that embeds an indentation-based block in the middle of an expression,\” which sounds more like an indictment of indentation-syntax than of lambdas.

Hello, Google Talk.

January 17th, 2006

I\’ve mentioned Google Talk before, but at the time it had one disastrous flaw — it couldn\’t talk to other Jabber servers. It was an island. Well, that\’s fixed now. So, all you Gmailing Google Talkers, add sellout@jabber.sk to your contact lists!

Common Libraries for Common Lisp

December 12th, 2005

A frequent complaint about Common Lisp is that it doesn\’t have the sort of standard library that is so popular these days. Java, Python, Ruby … everything has a standard library now. When Common Lisp was standardized, its functions comprised an enviable library. But, times change, everyone else catches up, and you gotta keep on your toes to stay in the game. So what does CL need to do to get back in it? Not too much. There are a lot of libraries out there already: cl-containers, CL-XML, etc. But, whereas Java just comes with a pile of a few thousand useful classes, CL doesn\’t. The available libraries need to be collected, sorted through to see where there are still gaps as compared with other languages\’ libraries, and made 1-step retrievable (if not included in the distribution).

I started writing this a while ago, and in the meantime, Dave Robert\’s posted an article that made a very similar point, in which he decided to dive in and fill one of those gaps (a full-fledged networking library). I have spent (very little) time wrapping a few implementations\’ threading libs in the BORDEAUX-MP API.

Now I\’m stepping into the other half of the game — collecting and categorizing all the existing CL libraries, and trying to pull some of those into a competitive standard library. I\’ll post a link to my standard library comparison shortly.

Single-Dispatch\’s Win

December 12th, 2005

There is a common feature in single-dispatch OO systems that I haven\’t seen in multiple dispatch: handling of \”missing methods\”. In Ruby, it\’s method_missing(); in Perl it\’s AUTOLOAD; Smalltalk, doesNotUnderstand:; and Obj-C, forwardInvocation:. For the C++ and Java programmer, who lack such functionality, I\’ll describe it a bit:

If you define (say, in Ruby) method_missing() on a class, and a user calls a method on that class which does not exist, Ruby will pass the call to your method_missing() implementation and you\’re given the opportunity to handle the call there. This can be useful in a number of cases; one of those is where the user may expect certain things to exist as methods, but the set may be variable or unbounded. For example, creating an XML structure, and allowing the user to just assuming the existance of a method matching each element.

In Lisp (and other multiple-dispatch systems that I\’m aware of) there is no such ability. I\’ve run into a number of places where I\’ve wanted such a mechanism. I don\’t have any solution in mind to this now, but it is something that I would like to think about. And maybe get input from others about.

Reading Update

November 14th, 2005

I haven\’t gotten as far into the Topology and Algebra as I had been hoping to. Although, my focus has definitely helped a lot with my progress in general. I\’ve read Nietzsche\’s Why I am So Wise, I Think, Therefore I Laugh by John Allen Paulos, most of Thomas Paine\’s Common Sense, and getting a good way into Machine Learning.

Actually, seeing that it\’s been a month, I\’m now less happy with my progress. I\’ve definitely been devoting much less time to my reading over the past few years. Gotta step it up.

EE and Me

November 13th, 2005

My x0xb0x kit has arrived. So, if anyone has recommendations on things like a soldering iron, multimeter, or anything else on this list, feel free to share them. I haven\’t done anything like this in 10 years, and this project is definitely more ambitious than what I built previously.

I really probably won\’t get around to building this until after Christmas. My time seems pretty crazy until then. Right now the assembled shell stares back at me from next to my monitor.

Approaching AI

November 13th, 2005

You know, I had a silly little thought about AI the other day … People talk about software that can write music, hold a conversation (the Turing Test), or some other creative task being the \”real\” test for AI. But really, a person wrote the program that wrote the music, so you really want to say AI has succeeded when it writes a program that can write programs that make music. So, at this level, we now have programming being the \”real\” test. Of course, we know it\’s creative, but it\’s not really seen that way. But, even if we write a program that writes music-writing programs, we\’re still acting at one level above that program. So, we need to write a program that can write programs that will generate arbitrary levels of other programs and eventually spit out a music-writing program. Of course, then we\’re writing programs that do this arbitrary nesting, so we have to write programs that do arbitrary nesting to show that the AI is real. After this, it gets a bit recursive …

Read the rest of this entry »

The Reading Plan

October 24th, 2005

I just want to let everyone know that I haven\’t fallen off the math track yet. I\’m just not so good at the blogging about it. I\’ve tried to optimize my reading by concentrating on fewer books at once. I\’ve got five right now. For those who don\’t know me, that probably sounds high, but really, it\’s like a four-fold improvement. I\’m trying to stick with one book in each category:

  • fiction: The System of the World, Neal Stephenson
  • non-fiction: Why I am So Wise, Friedrich Nietzsche
  • analysis: Introduction to Topology, Bert Mendelson
  • algebra: A First Course in Abstract Algebra, John Fraleigh
  • computer science: Machine Learning, Tom Mitchell

For each of the last three, I also have a nice little Moleskine journal to take notes and work through problems in. I\’ve only used the Machine Learning notebook so far. It\’s the subject most relevant to work, so it gets a bit more attention.

The Statistical Inquirer

October 24th, 2005

Woah, I can\’t believe I haven\’t published this one. Just noticed it languishing in the backlog.

Combining ideas from Edward Tufte and John Allen Paulos, I thought it\’d be a good idea to create a statistical supplement to the newspaper. Which newspaper? All of them. The supplement would be organized like a newspaper, but would have only statistics. It\’s not meant to replace a paper, but to fill in the blanks that are always left in stories. Of course, not every story can be covered, but sports, important national and world events, etc. can all be handled quite well. Each paper may leave out different pieces of the puzzle, and this supplement will help to fill them in for the people who are interested in seeing the numbers.

Ideally, it seems like this could be an insert included with the paper. I definitely want it to be printed. The Web is so coarse, graphically. One of the primary issues will be how to keep it up-to-date with the daily papers. Maybe it\’s a weekly supplement?

Wouldn\’t it be nice to open your newspaper and have a little sheet to keep at hand so that when you ask yourself \”3,000 people died? Out of how many?\” you have somewhere to look?

I wrote a Common Lisp sparklines library. Maybe I can tie it in with cl-typesetting, and make something from there.

Selling out all over again

October 24th, 2005

Look to the right ? that\’s right, AdSense. Feel free to click your way into my wallet. I don\’t have any traffic here, but I figure no sense wasting this prime real estate. We\’ll see if it stays. I don\’t see why not. I consider it pretty unintrusive, and those pennies add up … or so I hope. Maybe also motivation to do more with this blog.

It Begins

October 13th, 2005

I\’ve been reading a bit of Introductory Functional Analysis with Applications, but with the knowledge that it\’d mostly be over my head until I went back and did some Real Analysis. Today the first two analysis books arrived, Introduction to Topology and Introductory Real Analysis. I expect the Topology book will be simple, but it will probably also fill in a few blanks for me. Also, these books are smaller than Functional Analysis, so I\’m more likely to carry them around with me, too.

I\’ll probably get into Topology tonight.

I\’m also waiting on delivery of Basic Category Theory for Computer Scientists, which should lead nicely into Types and Programming Languages by the same author. As much as I may enjoy math, my primary motivation here is being a better programmer, so being able to see direct applications is nice.

There\’s More to Life than Analysis

October 2nd, 2005

So, as I mentioned yesterday, I\’m starting to study math more seriously. After yesterday\’s post, I was informed that the list I had was only one half of the landscape. Farus gave me a path (as requested) to Rudin. That path has no aspect of Algebra in it, so I need to create a parallel path. Here\’s what I have so far:

  1. A First Course in Abstract Algebra — John B. Fraleigh (I\’m already reading this one)
  2. Something in Category Theory (Basic Category Theory for Computer Scientists — Benjamin C. Pierce? I have TAPL, so I\’m guessing Pierce is a good bet)
  3. Something in Combinatorics

Any help fleshing this out?

Update: Apparently I should replace Fraleigh with Topics in Algebra — I. N. Herstein.

Maths on $50 a Year

October 1st, 2005

So, as the result of a conversation on #lisp the other day, I\’ve come up with this potential course of study to gain some math knowledge. Please comment, let me know which books are good, and which aren\’t. Also, any general strategies for diving into this stuff.

With the exception of Apostol and Rudin, these books are all around $10. That\’s pretty awesome.

  1. Introduction to Topology — Burt Mendelson
  2. Calculus, Vol. 1 — Tom Apostol (can I skip this one, at least on my first pass?)
  3. Introductory Real Analysis — A. N. Kolmogorov, S. V. Fomin
  4. Infinite Sequences and Series — Konrad Knopp
  5. Elements of the Theory of Functions and Functional Analysis — A. N. Kolmogorov, S. V. Fomin, which I might replace with Introductory Functional Analysis with Applications — Erwin Kreyszig since I already own it
  6. Principles of Mathematical Analysis — Rudin

So, from that list, how do I get to Category Theory? Where does Abstract Algebra fit into this? What other topics are important to a programmer using lambda calculus and machine learning?

I\’m going to try to post semi-regularly about what I\’m studying as I go. Hopefully 1. I\’ll make progress and 2. I\’ll remember to post about it here.

Thanks to farus for giving me a good path, and luis for recommending I blog about this.

Typing Done Right

September 17th, 2005

I\’m a big fan of all the sort of agile/dynamic sort of stuff. C2:TestDrivenDevelopment, C2:IterativeDevelopment, etc. But one thing I\’ve always had trouble with is accepting C2:DynamicTyping as the Right Thing. I mean, yeah, C2:ManifestTyping sucks, but C2:TypeInference is there to pick up the slack, as ML and Haskell show. With type inference, you get the clear code of dynamic typing, with the safety and performance of static typing. Which, I thought, was everything.

Yeah, I had heard the whining of those die-hard dynamicists who procliamed that there are correct programs that can not be statically typed. I didn\’t disagree, but I felt that for all practical purposes it was irrelevant. However, I\’m now working on a project where static typing gets in my way every day. It\’s unbearable.

I have a solution, which I think balances all the important bits. Yes, it\’s not perfectly \”safe\” like you static guys like, but it gives you the flexibility when you need it.

  1. type inference is key;
  2. there should be something like C2:CommonLisp\’s DECLAIM that allows you to say whether un-inferenceable bindings are errors, warnings, or ignored (and should default to errors, making the static guys happy);
  3. you can DECLARE individual bindings as dynamic, regardless of whether they\’re treated as errors.

Anyone who just wants dynamic fun DECLAIMs that un-inferenceable bindings are ignored, while others can make them warnings or errors and deal with the exceptions on a case-by-case basis. Type inference is always used whereever it is possible.

Daft Engineer

September 13th, 2005

My friend and co-worker, Mike, and I love de Daft Punk. Lourve it, I tells ya. So, after too many hours of watching the best Web site evar, we realized that they were instructing us in How to Code. Let me lay it down for you:

Work it harder
spend your time making it work, and work according to spec. Work hard at this.
Make it better
refactor, refactor, refactor. Keep the code clean, improve your algorithms, add unit tests.
Do it faster
ok, now you can optimize, but make sure you\’ve got a profiler there to tell you what\’s slow in the first place.
Makes us stronger
this leads to better software, more robust, and that keeps your company strong.
More than ever hour after (h)our work is never over
wash, rinse, repeat. Iteration, my friends, iteration.

These five simple steps will have your boss offering you the mad bling-bling and keep you rockin\’ like Dokken.


?>