"I have a mind like a steel... uh... thingy." Patrick Logan's weblog.

Search This Blog

Loading...

Friday, January 28, 2005

Lisp: an XML scripting language?

I guess if I had to sell someone on Lisp or Scheme today, I might describe it like this:

"Lisp is an XML scripting language."

More sexpr in Utah

Phil Windley is connecting language concepts, Scheme, and XML in his BYU programming language concepts course.

He has a simple excercise that makes the connection. The next step would be to blow their minds with SSAX.

Update: Phil Windley has a page for his students for running SSAX. To gauge how similar Lisp is to XML, how natural the mapping, the SSAX translation of Phil's original classroom example is identical except SSAX wraps Phil's translation in a list to indicate that is the top of the document...
(*TOP* (phil's data))

Naturally Dull

"Naturally dull, I’ve forgotten Zen activities"
- Isshi Bunshu (1608-1646)

Thursday, January 27, 2005

Testing Interfaces

Another blog item on testing.

This one asks whether the tests themselves should alter the interface of what's being tested. i.e. should the test have a back door for peeking into the black box.

My opinion is, emphatically, no. Not for the kinds of tests created while test-first programming.

An impulse to check on the internal state of an object while test-first programming is an indication of one or two things:

  • The test is being perceived too much as "testing" and not enough as "designing".
  • The object itself is probably too complex. Fix the design.

A Future so Bright?

Um...

Avid sailor Craig Venter has trawled for microbes in the Sargasso Sea and discovered more than a million new genes and 1,800 new species. Among them are organisms that thrive on carbon dioxide. Venter hopes to re-engineer some of these unique microbes genetically, into "designed species" that may reduce environmental CO2 levels, as well as provide new foods and energy sources. "Biology can do much more sophisticated chemistry than the best chemists," says Venter.
Hey, I suspect biology can do much more sophisticated *biology* than the best biologists as well!

I'm not sure I want people tinkering with CO2 consuming microbes any more than I want us putting fossil carbon into the atmosphere in the first place.

Test-First Programming

Frank Sommers writes...

I find myself violating this tenet of XP very often. I do test all my code, but often only after I've already written that code. Why does this one XP rule seem so out of place to me? ...

I like to think of refactoring and testing as editing. When writing an article, most writers first create an outline, then write the content, typically in a few sittings, and without regard to mistakes, typos, sentence structure, etc. Only then does an author spend most of his time on editing, fine-tuning, and polishing the article.

I think this seems out of place when "testing" is perceived to be a testing activity rather than a design activity. Rather than not testing first, try taking on a new perception of what it means to "test" software.

The way I view test-first programming exhibits the same outline -> content -> polish flow. In my perception, the "outline" is the short list of tests I think I want to write over the next hour or so. This list of tests is just a list of names, each name being some *design* feature that needs to be developed. Each name will show up in the design.

Then the "content" is the expansion of a name on the list into code:

  1. One or a few function calls or message sends.
  2. One or a few assertions about what is true afterwards.
  3. The other code needed to setup the calls, implement the assertions, and teardown.
  4. Then when this content breaks, the test framework tells me what's wrong.
  5. The rest of the content is missing... I have to write the code that implements the calls.
  6. When the "test" part of the content does not break, the initial draft is complete.
This content (the calls and assertions) is design information, an expression of a design contract. I am not testing something already conceived. I am in fact conceiving of something, creating something, designing something new: an expression about a system and an assertion about what is true given that expression.

As soon as the content is drafted, immediately I begin to polish that draft, consider how it fits with the other content, and how the content itself could be better expressed through reconsidering the names and parts and assertions.

So I see test-first programming as a way of designing. It happens to be a way of testing as well, which is good because a program has to be tested in ways that an informal text does not.

Wednesday, January 26, 2005

Exactly

A note to Sean McGrath from Steve Jensen in Sean's comment section...

Thanks for plugging Erlang: even if it doesn't end up being heavily adopted, it at least moves people in the right direction.
Exactly. I like what else Steve wrote...
We need to move from using semaphores and monitors to lock global state towards thinking of the world as partially ordered and asynchronous.
Someone asked Joe Armstrong at his Lightweight Languages 2002 presentation what synchronization mechanisms Erlang has. Joe responded, "Two. Send and receive."

Exactly.

Why...

...is Sharepoint the suckiest thing on this planet?

Monday, January 24, 2005

JSON: The Fat-Free Alternative to XML

JSON is the JavaScript Object Notation for writing "smart clients" like GMail in JavaScript without bulky XML messages. JSON-RPC is a simple RPC mechanism like XML-RPC. (Via Slashdot.)

I suppose this could also be based on YAML which is more rich than JSON, yet still not as complex as XML. I've not seen a mapping, in the few minutes I've looked, from JSON to XML, such as what's been defined for YAML.

Sunday, January 23, 2005

Communication

As seen on the XPDX Yahoo group...

Thanks for all the comments... One respondent said XP depends on communication, but I work in a corporation.
I guess that corporation does not "empower" their employees enough.

We Won't Get Fooled Again?

Scott Rosenberg writes...

The Bush inaugural marked the final transition of the Bush-family ideology from old-school conservatism, with its abhorrence of abstract schemes of human perfectibility, to a messianic idealism so divorced from reality it gives even sympathizers like Noonan the willies. Bush's vision of human perfectibility may be shaped by born-again fervor rather than socialist theory, but that difference doesn't make its collision with reality any less dangerous.
and writes...
This speech wasn't just soaring rhetoric. It was a lighter-than-air burst of helium verbiage -- lofty language untethered from the perplexing world we occupy and from the messy events of the last four years, sentences floating off into an empyrean of millennial vagaries.

The world is a simple place to Bush... His "untamed fire" is the cathartic inferno dreamed of by people who are confounded by a world they know is out of their control.

Thank You, Ken Anderson

Thank you, Ken Anderson, for your contributions to JScheme. There have been many times when I needed access to Java functionality but not the Java language per se. JScheme makes that kind of programming pleasant and productive. One of Ken's contributions was the Javadot notation which is a large part of ease of this Scheme/Java integration.

From Tim Hickey, another of JScheme's creators, via Chris Double...

I'm sorry to bring you the very sad news that Ken Anderson, one of the co-developers of JScheme, died last night...

Ken touched many lives and brought many communities together.

Blog Archive

About Me

Portland, Oregon, United States
I'm usually writing from my favorite location on the planet, the pacific northwest of the u.s. I write for myself only and unless otherwise specified my posts here should not be taken as representing an official position of my employer. Contact me at my gee mail account, username patrickdlogan.