4 ms·
Boomerang: A bidirectional programming language for ad-hoc data
- mahmud 18y agoIt's another Benjamin Pierce project, so you know it has solid theoretical foundations, and it's written in OCaml :-)
- carterschonwald 18y agoI 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!)
- ShabbyDoo 18y agoI 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.
- gjm11 18y agoOddly 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.
- ShabbyDoo 18y agoOh, ok....bidirectional != roundtrip-able Now that makes sense.
- mgreenbe 18y agoNot quite. A lens comprises three operations: get : C -> A put : A x C -> C create : A -> C And the GetPut, PutGet, CreateGet laws require of every lens that: put (get c) c = c get (put a c) = a get (create a) = a In other words, if there are no edits, then it is a round trip. The real inequality you mean is bidirectional != bijective. (EDIT: for typesetting equations.)
- joe_the_user 18y agoWell, Their site requires Javascript for no good reason, so that's a point against them.
- ionfish 18y agoIt 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.
- showerst 18y agoA 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.
- benhoyt 18y agoGood call. Quote from the PDF in the meantime: "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 ..."
- benhoyt 18y agoAsk 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.
- deleted 18y ago[deleted]