annathyst: (Default)
[personal profile] annathyst
This guy is like this guy, only fifteen times funnier, less pretentious, and more entertaining. Also, he likes Ruby.



Of course we're not just talking about log data. The situation is even clearer for configuration files. You definitely want them in XML, except it has the same problems, so... Hey, wait a minute -- if your configuration file is... Lisp, then it's not really a... configuration file anymore; it's part of your... program? Is that right?

Um, yep. You got it.

The whole nasty "configuration" problem becomes incredibly more convenient in the Lisp world. No more stanza files, apache-config, .properties files, XML configuration files, Makefiles -- all those lame, crappy, half-language creatures that you wish were executable, or at least loaded directly into your program without specialized processing. I know, I know -- everyone raves about the power of separating your code and your data. That's because they're using languages that simply can't do a good job of representing data as code. But it's what you really want, or all the creepy half-languages wouldn't all evolve towards being Turing-complete, would they?

In fact, if you insist on code/data separation and you're an advocate of OOP, then you're talking out of both sides of your mouth. If your gut reaction to having log entries know how to transform or process themselves is "woah, that's just wrong", think again: you're imposing a world-view on the problem that's not consistent with your notions of data encapsulation and active objects. This world-view dates back to ancient Unix and pre-Unix days. But if you think about it, there's no reason log entries or config files shouldn't be executable and subclassable. It might be better.

And what about, oh, web pages? Or word-processor documents? Well, you figure it out. Web pages use HTML, which isn't even powerful enough to represent text styles, let alone something like an event handler. So Web pages have CSS, and JavaScript, and all this other hooey. It's become so ugly that people don't really write web pages anymore, not for production stuff. Nowadays people treat the morass of ancient, crufty Web technologies as a sort of assembly language. You write code to assemble your pages piecewise using PHP or XML/XSLT or Perl/Mason or Java/JSP or perhaps all of them in a giant ugly pipeline, which "compiles" down to an unreadable Web page format. Talk about fun!

I can tell you in all honesty: everyone who tries this feels pain. And there are a lot of people in the world doing exactly what I described above. Building production websites == pain. The world is gradually, very slowly, converging towards using a variety of "executable XML" formats (e.g. Ant, Jelly, Cocoon) which... well, they sort of ease the pain, but it's replaced with new pain: the pain of the executable-XML language designers not having a frigging clue what they're doing.

So now Ant has a macro system, and try/catch tags, and if-tags, and it's gradually migrating towards Turing-completeness if it's not there already. But it still has all the same yucky problems it's had from day one: properties that look like variables that you can only set once, and weird inconsistencies in the way the tags work, and of course the fact that it's automatically 10x as verbose as a programming language because it's XML. Don't get me wrong -- it's still way better than Make. But that's not a very high bar now, is it?

Let's face it: a Turing-complete Ant (or Jelly, or any pure-XML processing framework) is going to be a monstrosity, because it will take years (if not decades) for them to figure out that Turing-completeness does not equal expressiveness, and they'll have to add lexical scoping, and data types, and a class system, and first-class functions, and and and...

And in the end, it'll still be XML.



Reference also: this thread, wherein it is shown that I'm joined in my heretical refusal to worship at the altar of the Holy Angle Brackets by none less than the Google engineers. Good enough for me.

Date: 2006-03-07 11:38 am (UTC)
From: [identity profile] billemon.livejournal.com
Heh. XML really does suck, for a lot of things. In fairness, it is at least a consistent syntax, but frankly I'd rather see C-style or perl-style data structures than tags.

However, I think the idea of making all configuration be "part of the program" *is* dangerous. There needs to be a sandbox.

Make is a special case; ultimately it boils down to the idea that it's declarative rather than procedural, but the rules are procedural. Whether you use XML or "that ugly make syntax" is really pretty irrelevant (and in fact I think xml does make it uglier). What you have to decide is, do you want a supposedly human-readable format that in practice is only usable by other programs, or do you want to be able to edit it by hand?

Date: 2006-03-07 11:39 am (UTC)
From: [identity profile] billemon.livejournal.com
Oh, and kudos for referring to PG as pretentious ;)

Date: 2006-03-07 03:18 pm (UTC)
From: [identity profile] myth.livejournal.com
Hell yes! Fuck Paul Graham.

Date: 2006-03-07 09:42 pm (UTC)
From: [identity profile] cowbert.livejournal.com
sounds like a case for ColdFusion :)

Profile

annathyst: (Default)
Anna

June 2021

S M T W T F S
  12345
67 89101112
13141516171819
20212223242526
27282930   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 24th, 2025 07:53 pm
Powered by Dreamwidth Studios