{"id":637,"date":"2011-11-15T17:37:07","date_gmt":"2011-11-15T22:37:07","guid":{"rendered":"http:\/\/alarmingdevelopment.org\/?p=637"},"modified":"2011-11-17T00:42:58","modified_gmt":"2011-11-17T05:42:58","slug":"devolving-subtext-to-javascript","status":"publish","type":"post","link":"https:\/\/alarmingdevelopment.org\/?p=637","title":{"rendered":"Devolving Subtext to JavaScript"},"content":{"rendered":"<p>I have to rewrite Subtext in JavaScript. First, a quick update. I presented my prototype implementation at the <a href=\"http:\/\/program-transformation.org\/view\/WGLD\/WebHome\">working group<\/a> this summer, to a tepid response. But in the course of preparing for that I thought of a radical simplification to the language. That inspired a whole rampage of brutal simplifications. The code is so much happier now. And when the code is happy, I&#8217;m happy.<\/p>\n<p>I have also been spending a lot of time thinking about my &#8220;market&#8221;. I have an idea for targeting web\/mobile apps with a new twist. More anon. In other news, I am going back to calling the language Subtext. The name is apropos\u00a0to my new direction, and it seems to be my brand. People ask me if I&#8217;m the &#8220;subtext guy&#8221;.<\/p>\n<p>Now I need to run inside the browser. But rewriting my evolving Java implementation in JavaScript fills me with dread. People that do serious large-scale programming in JavaScript are often deeply troubled by it, and resort to tools like Google&#8217;s Closure and GWT that treat the language as a bug to be worked around. The fact that Google felt the need to make big investments in these tools is an indictment of the language that can not be easily dismissed. I have come up with the following three-step strategy:<\/p>\n<p><!--more--><\/p>\n<ol>\n<li>Keep the parser and interpreter in Java and do the UI as a thin shell in JavaScript doing fine-grained RPC to a web server running the interpreter. This is the fastest and safest way to get up and running. But it means there needs to be a locally running web server attached to the browser. An iPad would need a local PC as its server. This is really just a mock-up for demo purposes, but it is the easiest, and it sits squarely in the sweet spot of current tools.<\/li>\n<li>Use GWT to run the interpreter inside the browser. The parser can&#8217;t be GWT&#8217;d, so it needs to be rewritten in JavaScript, perhaps using <a href=\"http:\/\/pegjs.majda.cz\/\">PEG.js<\/a>. The RPC work done in stage 1 is not wasted, as the JavaScript\/Java interface in GWT needs to be handled similarly. Deploying and testing and debugging get more awkward in this approach, so it is best done once the code is already working in stage 1.<\/li>\n<li>Rewrite the interpreter in JavaScript. Hopefully by deferring this step there will be time for JavaScript tools and libraries to better mature, or for other options to emerge, like fully-tooled CoffeeScript, or JS.next, or Dart (my preference).\u00a0Deferring\u00a0this step would also be an opportunity to do performance work (likely needed for tablets) which would be premature right now.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>I have to rewrite Subtext in JavaScript. First, a quick update. I presented my prototype implementation at the working group this summer, to a tepid response. But in the course of preparing for that I thought of a radical simplification to the language. That inspired a whole rampage of brutal simplifications. The code is so &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/alarmingdevelopment.org\/?p=637\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Devolving Subtext to JavaScript&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-637","post","type-post","status-publish","format-standard","hentry","category-general"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pfEnU-ah","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/posts\/637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=637"}],"version-history":[{"count":15,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/posts\/637\/revisions"}],"predecessor-version":[{"id":653,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/posts\/637\/revisions\/653"}],"wp:attachment":[{"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}