Tao of the Machine

Programming, Python, my projects, card games, books, music, Zoids, bettas, manga, cool stuff, and whatever comes to mind.

Ancient Chinese programming secrets

And now for something completely different...

Taoism is about being in harmony with nature. As the Wikipedia page says, "Do not try to force things, for nature is overpowering. In particular one must act in accordance with how things are, not how one wants things to be." Also, there's the principle of wu wei (action through inaction). "It is the practice of working with the stream rather than against it; one progresses the most not by struggling against the stream and thrashing about, but by remaining still and letting the stream do all the work."

Confucianism is about rules and rituals. About duties, etiquette and what is proper. (There's a lot more to be said about this (see the Wikipedia item), but it mainly refers to social and interpersonal relations.)

Clearly, dynamic 1) programming languages follow the Taoist way. Due to the flexibility of those languages, the program and language can adapt to the problem, rather than the other way around. Thus, a solution can be reached that does not violate the problem's nature, with a minimum of effort.

Statically typed languages, on the other hand, are more Confucianist. They come with a set of rules and restrictions. Like with Confucianism, these rules comfort those who use these languages and give them a sense of security. When implementing a programming solution, the problem must be expressed in terms of the language, adhering to its restrictions. The result naturally complies with the language's rules, but is not necessarily the best solution.

HHOS. OK, I'm just babbling here, but I think it's an interesting idea. emoticon:smile

1) "Dynamic" meaning "dynamically typed", or something similar to it. Thus it covers Lisp, Smalltalk, Python, Perl, Ruby, Groovy and more. Where OCaml fits into the picture is unclear, being both strongly, statically typed and dynamic...

Posted by Hans Nowak on 2004-03-12 21:25:12   {link} (see old comments)
Categories: programming

Observations

Via News You Can Bruise: Twisty Little Passages. I want this book. *drool*

Writing an adventure is on my to-do list, but then again, so are 100 other things...

()

Some people think the Python logging module is difficult to use. I haven't used it myself, but it certainly doesn't look too easy, especially considering that in most cases it's enough to just open a file and write to it.

It's not surprising though... I already had the impression that some Python modules/packages were designed to be complete, or to be compatible with the Java original, rather than to be Pythonic. The xml and unittest packages come to mind. Not to slight the authors of these packages, but people still write and use their own testing frameworks and XML parsers, which is a strong indicator that something's missing.

()

Sobe has a bunch of new drinks out. Black and Blue Berry. Sobe Synergy. Pomegranate Cranberry Elixir. Sobe Courage (cherry flavor). Sobe Fuerte (mango/passion fruit). Sobe Zen Tea. I haven't seen these around here... then again, Florida always gets things last.

No, I am not sponsored by Sobe. emoticon:smile

Posted by Hans Nowak on 2004-03-11 00:55:22   {link} (see old comments)
Categories: Python, books, general

Nu even een geintje...

This code works in Lython:

(import wax)

(print wax.Application)
(:= app (wax.Application wax.Frame))
(app.Run)

Due to the limitations of Lython (which is at 0.1 currently), it's not very useful yet. If it supported keyword arguments, we could write

(:= app (wax.Application wax.Frame :direction "vertical" :title "Hello"))

And if it supported classes, we could subclass Frame. Then it wouldn't be very difficult anymore to write a Lython-wrapper around wxPython ("Lax"?). Allowing for the first Lisp dialect with a decent GUI. <ducking for cover>

Unrelated: I don't see car, cdr or cons in the code yet. Maybe the author doesn't plan on implementing them, if the goal is to just have a Python with Lispy syntax. I'm not sure they would be so easy to implement. Sure, (car x) as x[0] and (cdr x) as x[1:] would cover many cases, but AFAIK, Lisp's cdr doesn't make a copy, so code like this would be hard to implement:

[1]> (setq a '(1 2 3 4 5))
(1 2 3 4 5)
[2]> (setq b (cdr a))
(2 3 4 5)
[3]> (setf (cadr a) 42)
42
[4]> a
(1 42 3 4 5)
[5]> b
(42 3 4 5)

(I'm running into the same problems for my PyZetaLisp interpreter... how to implement setf? Not that it's really important, since it's only a toy implementation, but one wonders...)

Posted by Hans Nowak on 2004-03-10 18:19:18   {link} (see old comments)
Categories: Python, Lisp

This is what happens...

if a cat moves when you're taking a picture of it...

Posted by Hans "no weblog should be without" Nowak on 2004-03-08 23:38:42   {link} (see old comments)
Categories: general

Haiku Circus

Haiku Circus, a webcomic using haikus.

Posted by Hans Nowak on 2004-03-07 22:28:42   {link} (see old comments)
Categories: general, linkstuffs

Revolution OS

I just saw this movie, that describes the open source/free software movement, and some of the people who play an important role in it. It is basically a collection of short interviews and snippets, glued together to tell the story of (mostly) Linux.

The movie is interesting, but doesn't really tell anything new. I'm not sure who the target audience is; open source developers probably already know all this, and I doubt this material will be very interesting to non-programmers. That leaves closed-source programmers. Hmm.

It's also worth noting that the visionaries of the movement seem also to be the most annoying flamboyant. They do what we have come to expect from them... ESR stomps on Microsoft and communism. RMS rides his GNU/Linux hobbyhorse, still sounding like that irritating kid in school that corrects the teacher. emoticon:smile Linus is refreshingly "normal" in comparison. Most of the other guys also seem more down to earth and (IMHO) much more sympathetic.

The movie is worth a look, if only to see and hear these people (rather than just read about them). Aside from that, it does not seem to have much lasting value, especially not to those who are already open source developers.

Posted by Hans Nowak on 2004-03-06 16:42:07   {link} (see old comments)
Categories: general, programming

--
Generated by Firedrop2.