{"id":21,"date":"2005-03-05T17:18:44","date_gmt":"2005-03-05T23:18:44","guid":{"rendered":"http:\/\/www.ourada.org\/blog\/archives\/21"},"modified":"2005-03-05T17:18:44","modified_gmt":"2005-03-05T23:18:44","slug":"javascript-domain-specific-language-syntax-hack","status":"publish","type":"post","link":"https:\/\/www.ourada.org\/blog\/archives\/21","title":{"rendered":"JavaScript domain-specific language syntax-hack"},"content":{"rendered":"<p>This is an interesting idea: <a href=\"http:\/\/trimpath.com\/blog\/?p=2\">using the JavaScript &#8216;with&#8217; keyword<\/a>, you can hack up a syntax for an embedded DSL pretty easily. Even if I <em>had<\/em> known about the &#8216;with&#8217; keyword :-), I might not have thought of that. Although I actually did do something like that in Python before, using a string of Python code and eval, which is actually the same thing but harder.<\/p>\n<p>Now, the syntax you get here isn&#8217;t perfect; the extra commas and stuff aren&#8217;t that cool. However, it&#8217;s neat to see that such a simple idea can get you so close to having well-integrated embedded DSLs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is an interesting idea: using the JavaScript &#8216;with&#8217; keyword, you can hack up a syntax for an embedded DSL pretty easily. Even if I had known about the &#8216;with&#8217; keyword :-), I might not have thought of that. Although I actually did do something like that in Python before, using a string of Python [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-21","post","type-post","status-publish","format-standard","hentry","category-general","author-admin"],"_links":{"self":[{"href":"https:\/\/www.ourada.org\/blog\/wp-json\/wp\/v2\/posts\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ourada.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ourada.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ourada.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ourada.org\/blog\/wp-json\/wp\/v2\/comments?post=21"}],"version-history":[{"count":0,"href":"https:\/\/www.ourada.org\/blog\/wp-json\/wp\/v2\/posts\/21\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ourada.org\/blog\/wp-json\/wp\/v2\/media?parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ourada.org\/blog\/wp-json\/wp\/v2\/categories?post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ourada.org\/blog\/wp-json\/wp\/v2\/tags?post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}