Archive for the 'languages' Category

Tuesday, January 23rd, 2007

On language design…

A semi-random thought that occurred to me.

One marker of a well-designed markup language is that it looks to the future. This doesn’t mean it’s an amorphous blob of abstract indirections mapped to tags. It can (and arguably should) be concrete and solid, but designed in such a way that keeps bigger things in mind.

HTML and XHTML are, I suppose, canonical examples of this, giving birth to microformats and many other uses outside of a browser. -m

Wednesday, November 8th, 2006

Somebody correct me if I’m wrong…

but there has never been a successful Java implementation of a commercial-grade web browser. (right?)

There exist lots of huge applications including IDEs, and editors of all sorts, but nobody’s been able to nail the whole XHTML+CSS+JavaScript thing in Java. (right?)

Take it a step further–no need to pick on Java–nobody has done this in any VM-based language (right)?

Coincidence or sign of greater forces in the universe? Feel free to post counter-examples in the comments.-m

Thursday, October 5th, 2006

How PHP can be annoying

On a PHP 4 project, I need to use XSLT, but the interfaces seem far more complicated than they should be. Check out this declaration for the function to run an XSLT:

mixed xslt_process ( resource xh, string xmlcontainer, string xslcontainer [, string resultcontainer [, array arguments [, array parameters]]] )

Wow, it returns a “mixed”, that’s some helpful documentation worth looking up. And all I have to do is pass in an “xmlcontainer” and “xslcontainer”. In practice, you end up with hard-to-read code like this:

$arguments = array('/_xml' => $xml, '/_xsl' => $xsl);
$xslproc = $xslt_create();
$result = xslt_process($xslproc, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments);

Too bad I have already-parsed objects. And then there’s this:

Warning: As of PHP 4.0.6, this function no longer takes XML strings in xmlcontainer or xslcontainer. Passing a string containing XML to either of these parameters will result in a segmentation fault in Sablotron versions up to and including version 0.95.

Whatever. In fairness, this falls mainly to the XSLT engine and not the language and the PHP 5 interfaces are much different and much improved. But still.. -m