Which is in itself quite wonderful news (artificial languages need all the help they can get), but the Globe and Mail article is also one of the best introductions to the language I’ve seen, so do check it out—web version or print scan—if you’re interested in Toki Pona(and if you speak Spanish, don’t forget to check out my Spanish manual on it).
A 16-line hack to make the JS DOM API a tad more humane.
...absolutely amazing. I’ve yet to find a smaller and yet more astounding example of how you can encapsulate functionality within JavaScript and create brand new APIs on the fly.
Web pages are written in HTMLWP but as they have become more and more complex, they now tend to be written, clientside, through JavascriptWP, which can manipulate and insert HTML. Google Images, for instance, uses Javascript to write the HTML that displays your image results.
Yes, it’s roundabout, but it’s due to the nature of the languages: Javascript does stuff, HTML displays stuff. When you want the browser to do things (instead of merely displaying dumbly what it receives) and when these things themselves involve a lot of displaying, you end up writing HTML through Javascript.
It’s a little like writing French through English (André went to Marie and said: ”Bonjour! Ça va, ma chérie?”) and just as frustrating, particularly because you sometimes have to narrate whole scenes in French (pidgin tends to be painfully verbose) and your English self is left completely in the dark—so you end up naming things in both French and English and it gets as ugly as you can imagine.
HyperScript is a bizarre and quixotic attempt to write French in English; that is, HTML in Javascript. Basically, you do what went on in the Norman conquest of EnglandWP: you anglicize as many French words as you can; that is, you turn into Javascript as many HTML words as you can.
The lark itself takes gratefully (and rather surpisingly) only 16 paltry lines of Javascript code (highlighting thanks to Mark “Tarquin” Wilton-Jones.):
functioneach(a, f) { for(vari=0, l=a.length; i<l; i++) f(a[i]) }; each('a big blockquote br b center code div em form h1 h2 h3 h4 h5 h6 hr img iframe input i li ol option pre p script select small span strong style sub sup table tbody td textarea tr ul u'.split(''), function(label){ window[label]=function(){ vartag=document.createElement(label); each(arguments, function(arg){ if(arg.nodeType) tag.appendChild(arg); elseif(typeofarg=='string' ||typeofarg=='number') tag.innerHTML+=arg; elsefor(varattrinarg){ if(attr=='style') for(varstyinarg[attr]) tag[attr][sty]=arg[attr][sty]; elsetag[attr]=arg[attr];
};
}); returntag;
};
});
and you can play with it right here, right now:
Test Area:
The translation between HTML and Hyperscript is straightforward, where you would have written
“If it succeeds, milk it; if not, try something different. And if the fans are into file sharing (which they are), keep the lawyers leashed and find a way to make piracy work for you.”
Seven years ago musicians derived two-thirds of their income, via record labels, from pre-recorded music, with the other one-third coming from concert tours, merchandise and endorsements, according to the Music Managers Forum, a trade group in London.But today those proportions have been reversed—cutting the labels off from the industry’s biggest and fastest-growing sources of revenue. Concert-ticket sales in North America alone increased from $1.7 billion in 2000 to over $3.1 billion last year, according to Pollstar, a trade magazine.
Frustrated record companies have responded by trying to get their artists to spend more time promoting records and less time touring and endorsing products, says Jeanne Meyer of EMI, another big record label. “Sometimes you’ve got a tug of war going on,” she says. Yet the more labels spend on marketing pre-recorded music, the more they raise their artists’ profiles and boost their other, more lucrative, sources of income. Pre-recorded music, no longer the main cash cow, increasingly serves merely as a marketing tool for T-shirts and concert tickets.The best seats for The Police’s world tour this summer cost over $900; the group’s entire catalogue on CD costs less than $100.
The shift away from recorded music is due in part to the recognition that touring and merchandise are more lucrative. But it may also be a consequence of internet piracy, as free downloads give music fans more money to spend on other things. Jwana Godinho, the director of Música no Coração, a concert promoter in Lisbon, thinks many music lovers have a “mental budget” that they are prepared to spend on music, and have switched their spending from CDs to tickets and merchandise.
The logical conclusion is for artists to give away their music as a promotional tool. Some are doing just that. This week Prince announced that his new album, “Planet Earth”, will be given away in Britain for free with the Mail on Sunday, a national newspaper, on July 15th. (For years Prince has made far more money from live performances than from album sales; he was the industry’s top earner in 2004.) Outraged British music retailers were quick to condemn the idea. As far as the record industry is concerned, it is madness. But for the music industry, it could well be the shape of things to come.
I’ve always hated, with a passion, moral-indignation ads against piracy—not only because they’re manipulative but because they’re stupid. And the best defense for piracy may be how hard it is to make an argument against it that doesn’t stink of moral indignation—if maudlin pleas are the best you can do, you’re probably rotten. (On a related sidenote, I found it mighty interesting when The Economistcircuitously referred to Kazaa as “a file-sharing program that was widely used to download music without paying for it”—as much as ads want to make us believe pirating is stealing, there are crucial differences, which is why such circumlocutions are essential.)
To solve intellectual property’s malaise I’ve long sought for grand economic solutions (new innovative schemes or perhaps even a new concept of property rights) rather than grand political ones (which are just, ugh, imposed moral rules). While there has been plenty of both, I’m starting to see these days that maybe the solution will be simply to move on. Piracy is just another (admittedly extreme) form of commodificationWP. You don’t fight commodification by outlawing it, you take the next thing that hasn’t been commodified yet, you offer value however you can, you move on.