A note to anyone who creates a new programming language: Please put up a quick bite of sample code that shows how your language looks and what it does on the site, and don't require me to download a PDF and search through it.
"To give a sense of what programming in Boomerang is like, we will define the lens implementing the transformations between XML and CSV composers shown above.
First we define a lens c that handles a single <composer> element. It uses a number
of functions defined in our XML library, as well as primtives for copying (copy) and
deleting (del) strings, and for concatenating lenses (.).
let c : lens =
Xml.elt NL2 "composer"
begin
Xml.simple_elt NL4 "name"
(copy [A-Za-z ]+ . ins ", ") .
Xml.attr2_elt_no_kids NL4 "years"
"birth" (copy NUMBER . ins "-")
"death" (copy NUMBER) .
Xml.simple_elt NL4 "nationality" (del [A-Za-z]+)
end
Using c, we then define a lens that handles a top-level <composers> element, enclosing a list of <composers>. This lens is defined using the features already described, a primitive for inserting a string (ins), as well as union (|) and Kleene star.
let cs : lens =
Xml.elt NL0 "composers"
begin
copy EPSILON |
c . (ins newline . c)*
end
Ask HN/PG: Asterisks around something make it italics (except in indented code, apparently). In the above comment I had to remove a literal asterisk in the text because I couldn't figure out how to escape it. Backslash doesn't work, and two stars in a row doesn't work. Any ideas?
Update: Okay, so putting spaces around it ( * ) works. But the asterisk in question was inside parens without spaces.
I just skimmed the manual a bit, so I'm still quite uninformed. Does it require bidi translations? If so, that's quite a limitation as most of the data manipulations I've done have been at least a bit lossy.
Some formalisms would certainly be nice though..it's easy to think that you've transformed data well only to find holes in your methods later.
Oddly enough, it allows lossy bidirectional translations. The general setup is that you have an "abstract" representation of some information, and a "concrete" representation that may have extra details in it. Then the three key operations are:
"get" abstract info from a concrete version;
"put" new abstract info into a concrete version, returning a new concrete version;
"create" a new concrete version from abstract info, presumably filling in extra details with defaults.
The running example in their tutorial is a database of information about composers. The "concrete" version is an XML file. The "abstract" version is something more compact, one entry per line, which omits the nationality data in the XML file.
I had the pleasure of having out with the folks in the UPenn plclub (their programming language research group) one summer during high school, awesome group of people. One fellow who graduated a year agowas hacking together a pretty snazzy user level tcp/ip stack with a programmable scheduler in haskell. (some measures indicated that it did better than apache or erlang!)
It uses it for the pagination, which is both irritating and pointless. The only advantage gained by doing this is speed--and they could have that by making the links go to anchors within the page. This kind of thing is far from rare, but it does make me sad when I see real programmers doing it.