<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
><channel><title>Himmel &#187; ruby</title> <atom:link href="http://lazing.ave7.net/tag/ruby/feed/" rel="self" type="application/rss+xml" /><link>http://lazing.ave7.net</link> <description>时间很长；现在很短；距离很长；相遇很短</description> <lastBuildDate>Wed, 11 Jan 2012 18:03:14 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license> <item><title>Ruby on Rails 安装错误一例</title><link>http://lazing.ave7.net/2011/ruby-on-rails-installation-error-one-case/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ruby-on-rails-installation-error-one-case</link> <comments>http://lazing.ave7.net/2011/ruby-on-rails-installation-error-one-case/#comments</comments> <pubDate>Mon, 09 May 2011 15:33:02 +0000</pubDate> <dc:creator>某L</dc:creator> <category><![CDATA[Code Jam]]></category> <category><![CDATA[howto]]></category> <category><![CDATA[ror]]></category> <category><![CDATA[ruby]]></category><guid isPermaLink="false">http://lazing.ave7.net/2011/ruby-on-rails-installation-error-one-case/</guid> <description><![CDATA[Ruby on Rails 安装 Rails报错： File not found: lib ERROR:  While generating documentation for rails-3.0.7 ... MESSAGE:   exit ... RDOC args: --ri --op /usr/local/rvm/gems/ruby-1.8.7-p334/doc/rails-3.0.7/ri lib --title rails-3.0.7 Documentation –quiet 翻墙搜索得到这篇文章，转载如下： The issue is that the new Rails version you are installing uses a more recent version of Rdoc/ri and thus when the installation process gets <a href="http://lazing.ave7.net/2011/ruby-on-rails-installation-error-one-case/"> read more <span class="meta-nav">&#187;</span></a><br /><div><img src="http://lazing.ave7.net/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></description> <content:encoded><![CDATA[<p>Ruby on Rails 安装 Rails报错：</p><blockquote><pre>File not found: lib
ERROR:  While generating documentation for rails-3.0.7
... MESSAGE:   exit
... RDOC args: --ri --op /usr/local/rvm/gems/ruby-1.8.7-p334/doc/rails-3.0.7/ri lib --title rails-3.0.7 Documentation –quiet</pre></blockquote><pre>翻墙搜索得到<a href="http://buzzcodington.wordpress.com/2011/04/29/file-not-found-lib-error-while-installing-rails-3-0-7/" target="_blank">这篇文章</a>，转载如下：</pre><p>The issue is that the new Rails version you are installing uses a more recent version of Rdoc/ri and thus when the installation process gets to Rdoc/ri installation, it fails. I don’t know why the ROR developers didn’t think of checking for this and updating Rdoc/ri for you. Anyway, the correct way to solve this issue is to first uninstall the Rails version you just installed with no Rdoc/ri data:</p><blockquote><p>sudo gem uninstall rails</p></blockquote><p>Install the latest version of the rdoc-data gem. This will install ri data for core and stdlib:</p><blockquote><p>sudo gem install rdoc-data</p></blockquote><p>Then run:</p><blockquote><p>sudo rdoc-data &#8211;install</p></blockquote><p>In case you want rdoc-data for all your gems run (not necessary.. takes a while if you have as many gems as i do):</p><blockquote><p>gem rdoc –all –overwrite</p></blockquote><p>Now you can install your Rails version and it will successfully install all the rdoc-data too.</p><blockquote><p>sudo gem install rails</p></blockquote><p>Output:</p><blockquote><pre>Successfully installed rails-3.0.7
1 gem installed
Installing ri documentation for rails-3.0.7...
Installing RDoc documentation for rails-3.0.7...</pre></blockquote><ul><li><a href="http://lazing.ave7.net/2008/jruby-note-simple-is-beautiful/" rel="bookmark" title="2008/04/25">JRuby Note: 简单就是美</a></li><li><a href="http://lazing.ave7.net/2008/java-scripting-in-jdk6/" rel="bookmark" title="2008/07/21">Java Scripting in JDK6</a></li><li><a href="http://lazing.ave7.net/2007/dynamic-language-and-dsl/" rel="bookmark" title="2007/11/29">Dynamic Language and DSL</a></li></ul><p></p><p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Flazing.ave7.net%2F2011%2Fruby-on-rails-installation-error-one-case%2F&title=Ruby+on+Rails+%E5%AE%89%E8%A3%85%E9%94%99%E8%AF%AF%E4%B8%80%E4%BE%8B" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><br /><div><img src="http://lazing.ave7.net/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /> <img src="http://lazing.ave7.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1204" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://lazing.ave7.net/2011/ruby-on-rails-installation-error-one-case/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license> </item> <item><title>Java Scripting in JDK6</title><link>http://lazing.ave7.net/2008/java-scripting-in-jdk6/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java-scripting-in-jdk6</link> <comments>http://lazing.ave7.net/2008/java-scripting-in-jdk6/#comments</comments> <pubDate>Mon, 21 Jul 2008 06:44:09 +0000</pubDate> <dc:creator>某L</dc:creator> <category><![CDATA[Code Jam]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[ruby]]></category> <category><![CDATA[scripting]]></category><guid isPermaLink="false">http://lazing.ave7.net/blog/?p=299</guid> <description><![CDATA[对动态语言的爱啊，少年啊，前进～～ 无聊的开场，简单的说，就是Java Scripting其实很容易，比你想象的要容易的多，特别是在JDK6的时候。 JavaScript的例子 ScriptEngineManager mgr = new ScriptEngineManager(); ScriptEngine jsEngine = mgr.getEngineByName("JavaScript"); try { jsEngine.eval("print('Hello, world!')"); } catch (ScriptException ex) { ex.printStackTrace(); } 无需过多解释，只要用了JDK6的环境以上代码就可以运行，默认使用Mozilla Rhino (1.6 release 2)脚本引擎，支持JavaScript 1.6 Ruby的例子 Ruby的例子要麻烦一点，因为要手工添加支持。但是其实也非常简单，只要把JRuby的实现和JRuby Scripting Engine加入就行了。 下载： jruby.jar &#8211; download jruby-bin-1.0.tar.gz file from JRuby website and extract the files jruby.jar, asm-2.2.3.jar, asm-commons-2.2.3.jar, backport-util-concurrent.jar from directory jruby-1.0/lib/. You <a href="http://lazing.ave7.net/2008/java-scripting-in-jdk6/"> read more <span class="meta-nav">&#187;</span></a><br /><div><img src="http://lazing.ave7.net/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></description> <content:encoded><![CDATA[<p>对动态语言的爱啊，少年啊，前进～～</p><p>无聊的开场，简单的说，就是Java Scripting其实很容易，比你想象的要容易的多，特别是在JDK6的时候。</p><h4>JavaScript的例子</h4><pre class="brush:java">  ScriptEngineManager mgr = new ScriptEngineManager();
  ScriptEngine jsEngine = mgr.getEngineByName("JavaScript");
  try {
    jsEngine.eval("print('Hello, world!')");
  } catch (ScriptException ex) {
      ex.printStackTrace();
  }</pre><p>无需过多解释，只要用了JDK6的环境以上代码就可以运行，默认使用Mozilla Rhino (1.6 release 2)脚本引擎，支持JavaScript 1.6</p><h4>Ruby的例子</h4><p>Ruby的例子要麻烦一点，因为要手工添加支持。但是其实也非常简单，只要把JRuby的实现和JRuby Scripting Engine加入就行了。</p><p>下载：</p><ul><li><strong>jruby.jar</strong> &#8211; download jruby-bin-1.0.tar.gz file from <a href="http://jruby.org/">JRuby website</a> and extract the files <code>jruby.jar, asm-2.2.3.jar, asm-commons-2.2.3.jar, backport-util-concurrent.jar</code> from directory <code>jruby-1.0/lib/</code>. You don&#8217;t need the other files.</li><li><strong>jruby-engine.jar</strong> &#8211; download jsr223-engines.tar.gz file from <a href="https://scripting.dev.java.net/">scripting.dev.java.net</a> and extract the file <code>jruby/build/jruby-engine.jar</code></li></ul><p>使用Maven添加相关依赖：</p><ul><li>jruby &#8211; groupId=org.jruby artifactId=jruby version=1.1.2</li><li>jruby-engine &#8211; groupId=javax.scripting artifactId=jruby-engine version=20080611</li></ul><p>jruby-engine需要添加附加的repository，例如<a title="http://shibboleth.internet2.edu/downloads/maven2" href="http://shibboleth.internet2.edu/downloads/maven2/">http://shibboleth.internet2.edu/downloads/maven2</a></p><p>之后的使用和JavaScript的例子一样，当然，语法不一样。</p><p>使用下面的代码可以打印支持的脚本信息</p><pre class="brush:java">ScriptEngineManager mgr = new ScriptEngineManager();
for (ScriptEngineFactory factory : mgr.getEngineFactories()) {
	System.out.println("ScriptEngineFactory Info");
	System.out.printf("\tScript Engine: %s (%s)\n", factory
		.getEngineName(), factory.getEngineVersion());
	System.out.printf("\tLanguage: %s (%s)\n", factory
		.getLanguageName(), factory.getLanguageVersion());
	for (String name : factory.getNames()) {
		System.out.printf("\tEngine Alias: %s\n", name);
	}
}</pre><p>本地输出示例</p><blockquote><p>ScriptEngineFactory Info<br /> Script Engine: Mozilla Rhino (1.6 release 2)<br /> Language: ECMAScript (1.6)<br /> Engine Alias: js<br /> Engine Alias: rhino<br /> Engine Alias: JavaScript<br /> Engine Alias: javascript<br /> Engine Alias: ECMAScript<br /> Engine Alias: ecmascript<br /> ScriptEngineFactory Info<br /> Script Engine: JRuby Engine (1.1.4)<br /> Language: ruby (1.8.6)<br /> Engine Alias: jruby<br /> Engine Alias: ruby</p></blockquote><p>本文主要参考: <a href="http://www.ics.muni.cz/~makub/ruby/" target="_blank">Java Scripting and JRuby Examples</a><ul><li><a href="http://lazing.ave7.net/2008/jruby-note-simple-is-beautiful/" rel="bookmark" title="2008/04/25">JRuby Note: 简单就是美</a></li><li><a href="http://lazing.ave7.net/2008/spring-25-aop-schema-urinate-programming/" rel="bookmark" title="2008/02/22">Spring 2.5 AOP Schema编程小解</a></li><li><a href="http://lazing.ave7.net/2009/teaching-paste-how-to-write-plug-ins-maven2/" rel="bookmark" title="2009/05/26">教学贴：如何编写Maven2插件</a></li><li><a href="http://lazing.ave7.net/2008/java-generating-word-documents-using-xml/" rel="bookmark" title="2008/03/01">Java：利用XML生成Word文档</a></li><li><a href="http://lazing.ave7.net/2008/talk-about-easymock/" rel="bookmark" title="2008/02/10">说一下EasyMock</a></li></ul><p></p><p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Flazing.ave7.net%2F2008%2Fjava-scripting-in-jdk6%2F&title=Java+Scripting+in+JDK6" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><br /><div><img src="http://lazing.ave7.net/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /> <img src="http://lazing.ave7.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=299" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://lazing.ave7.net/2008/java-scripting-in-jdk6/feed/</wfw:commentRss> <slash:comments>1</slash:comments> <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license> </item> <item><title>JRuby Note: 简单就是美</title><link>http://lazing.ave7.net/2008/jruby-note-simple-is-beautiful/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jruby-note-simple-is-beautiful</link> <comments>http://lazing.ave7.net/2008/jruby-note-simple-is-beautiful/#comments</comments> <pubDate>Fri, 25 Apr 2008 14:12:45 +0000</pubDate> <dc:creator>某L</dc:creator> <category><![CDATA[Code Jam]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[maven]]></category> <category><![CDATA[ror]]></category> <category><![CDATA[ruby]]></category> <category><![CDATA[scm]]></category> <category><![CDATA[wiki]]></category><guid isPermaLink="false">http://lazing.ave7.net/blog/?p=250</guid> <description><![CDATA[恩，我是一个Java中毒症患者，而且还是写了些传统程序，被传染了些OO顽疾的患者，对于Ruby这种太轻巧的东西接受起来还是有个过程的。 然而，我仍旧是个年轻人，早已坚定的支持Ruby代表的“小快灵”俱乐部，受够了传统软件工艺的铺张浪费，心存着的一点点幻想仍然让我被种种传说诱惑。 趁着一周唯二的两天不加班，研究了些JRuby 1.1.1——好吧，我就是纯粹的Java中毒症。顺便还关注了下ROX荡气回肠的季后赛第三场——然后浅浅的发现了JRuby的点点好处。 出色的SCM基础支持，小巧便捷的扩展，标准化的实现 SCM基础支持 GEM真的是非常有用的工具。Ruby毕竟晚生了几年，许多新的思路得以应用的更加完善。GEM类似于Maven的Resp，配合Rake就构成了非常好用的构建工具，连版本都被模糊化了，“我只要最新的就可以了”，是这样么？我只研究了两个小时，还只能猜猜。至于之前就听过的Raven，对于不懂Ruby的人来讲，简直比Maven还难用（我是新人，我不懂上个世纪的构建方法）。SCM早晚会成为一种标准化的事情，就像之前的Java Module被接受成为标准，每种语言形成产品都需要重视这一点。 不得不说的是ROR的DB扩展，数据迁移，在我看来，这就是很棒的数据库重构工具。重构在较小的时间段上对于软件的意义，有赶超迭代开发的趋势。而数据库重构，是其中最难最复杂的主题。虽然这不是Ruby天生的特性，但随着ROR的流行，也一定会慢慢深入人心。 模块化的扩展 Java是模块化的么，你真的确定jar和package是模块化的表现么？ 动态语言天生就有这种优势，耦合和约束在非常低的水平，模块的互操作也就简单的多。加上良好的SCM，全球化的组件工厂，模块化对于Ruby，简直就是天生的完美排档。 标准化 这是一个不怎么显而易见的优点。正如标题所说，简单就是美。那么，如何简单，怎样简单？用大家都接受的概念。 用BlueCloth，HTML标签前开后闭，不用大大咧咧的程序员操心。 Wiki式的标记方法，写模板就像写文档。 学术上我们说Closure，我Ruby就实现个Closure。理论与实际尽量靠拢。“小快灵”你想要的，我最快实现。说Ajax，无非就是Autocomplete，DnD，一个单词搞定。什么，你要GoogleDoc？ 前两天见了徐昊一面，于是现在对于“语言”更特质的东西很有兴趣，而所谓标准，就是直接到大多数人都觉得应该是这个样子，把一些不显而易见的东西挑明了，固定下来。当然，我说的是与钱无关的情况，虽然这种情况不存在。 完工 怨念的说，公司发调查问卷，征求个人发展计划。网上搜了搜IT认证，中国的IT培训环境糟糕的要死。高校没有软件理论，社会没有工业协作，我们的软件行业，还弱小的很呢。 Technorati 标签: ruby,java,ror Private plan for next few weeks Java Module and Maven Java：利用XML生成Word文档 说一下EasyMock Dynamic Language and DSL Rating: 0.0/5 (0 votes cast)<br /><div><img src="http://lazing.ave7.net/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></description> <content:encoded><![CDATA[<p>恩，我是一个Java中毒症患者，而且还是写了些传统程序，被传染了些OO顽疾的患者，对于Ruby这种太轻巧的东西接受起来还是有个过程的。</p><p>然而，我仍旧是个年轻人，早已坚定的支持Ruby代表的“小快灵”俱乐部，受够了传统软件工艺的铺张浪费，心存着的一点点幻想仍然让我被种种传说诱惑。</p><p>趁着一周唯二的两天不加班，研究了些JRuby 1.1.1——好吧，我就是纯粹的Java中毒症。顺便还关注了下ROX荡气回肠的季后赛第三场——然后浅浅的发现了JRuby的点点好处。</p><p><strong>出色的SCM基础支持，小巧便捷的扩展，标准化的实现</strong></p><h4>SCM基础支持</h4><p>GEM真的是非常有用的工具。Ruby毕竟晚生了几年，许多新的思路得以应用的更加完善。GEM类似于Maven的Resp，配合Rake就构成了非常好用的构建工具，连版本都被模糊化了，“我只要最新的就可以了”，是这样么？我只研究了两个小时，还只能猜猜。至于之前就听过的Raven，对于不懂Ruby的人来讲，简直比Maven还难用（我是新人，我不懂上个世纪的构建方法）。SCM早晚会成为一种标准化的事情，就像之前的Java Module被接受成为标准，每种语言形成产品都需要重视这一点。</p><p>不得不说的是ROR的DB扩展，数据迁移，在我看来，这就是很棒的数据库重构工具。重构在较小的时间段上对于软件的意义，有赶超迭代开发的趋势。而数据库重构，是其中最难最复杂的主题。虽然这不是Ruby天生的特性，但随着ROR的流行，也一定会慢慢深入人心。</p><h4>模块化的扩展</h4><p>Java是模块化的么，你真的确定jar和package是模块化的表现么？</p><p>动态语言天生就有这种优势，耦合和约束在非常低的水平，模块的互操作也就简单的多。加上良好的SCM，全球化的组件工厂，模块化对于Ruby，简直就是天生的完美排档。</p><h4>标准化</h4><p>这是一个不怎么显而易见的优点。正如标题所说，简单就是美。那么，如何简单，怎样简单？用大家都接受的概念。</p><p>用BlueCloth，HTML标签前开后闭，不用大大咧咧的程序员操心。</p><p>Wiki式的标记方法，写模板就像写文档。</p><p>学术上我们说Closure，我Ruby就实现个Closure。理论与实际尽量靠拢。“小快灵”你想要的，我最快实现。说Ajax，无非就是Autocomplete，DnD，一个单词搞定。什么，你要GoogleDoc？</p><p>前两天见了徐昊一面，于是现在对于“语言”更特质的东西很有兴趣，而所谓标准，就是直接到大多数人都觉得应该是这个样子，把一些不显而易见的东西挑明了，固定下来。当然，我说的是与钱无关的情况，虽然这种情况不存在。</p><h3>完工</h3><p>怨念的说，公司发调查问卷，征求个人发展计划。网上搜了搜IT认证，中国的IT培训环境糟糕的要死。高校没有软件理论，社会没有工业协作，我们的软件行业，还弱小的很呢。</p><div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:7cde3615-fb12-4e74-9301-c24bc0a3c0c3" class="wlWriterSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati 标签: <a rel="tag" href="http://technorati.com/tag/ruby">ruby</a>,<a rel="tag" href="http://technorati.com/tag/java">java</a>,<a rel="tag" href="http://technorati.com/tag/ror">ror</a></div><ul><li><a href="http://lazing.ave7.net/2011/ruby-on-rails-installation-error-one-case/" rel="bookmark" title="2011/05/09">Ruby on Rails 安装错误一例</a></li><li><a href="http://lazing.ave7.net/2007/java-module-and-maven/" rel="bookmark" title="2007/12/06">Java Module and Maven</a></li><li><a href="http://lazing.ave7.net/2008/java-scripting-in-jdk6/" rel="bookmark" title="2008/07/21">Java Scripting in JDK6</a></li><li><a href="http://lazing.ave7.net/2008/maven2%e4%ba%8c%e4%b8%89%e4%ba%8b/" rel="bookmark" title="2008/07/17">Maven2 二三事</a></li><li><a href="http://lazing.ave7.net/2008/maven-need-to-act-as-wikipedia/" rel="bookmark" title="2008/05/23">Maven need to act as Wikipedia</a></li></ul><p></p><p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Flazing.ave7.net%2F2008%2Fjruby-note-simple-is-beautiful%2F&title=JRuby+Note%3A+%E7%AE%80%E5%8D%95%E5%B0%B1%E6%98%AF%E7%BE%8E" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><br /><div><img src="http://lazing.ave7.net/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /> <img src="http://lazing.ave7.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=250" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://lazing.ave7.net/2008/jruby-note-simple-is-beautiful/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license> </item> <item><title>Dynamic Language and DSL</title><link>http://lazing.ave7.net/2007/dynamic-language-and-dsl/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dynamic-language-and-dsl</link> <comments>http://lazing.ave7.net/2007/dynamic-language-and-dsl/#comments</comments> <pubDate>Thu, 29 Nov 2007 12:54:40 +0000</pubDate> <dc:creator>某L</dc:creator> <category><![CDATA[Tech Forge]]></category> <category><![CDATA[aop]]></category> <category><![CDATA[dsl]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[ruby]]></category> <category><![CDATA[xml]]></category> <category><![CDATA[xsl]]></category><guid isPermaLink="false">http://lazing.ave7.net/blog/?p=199</guid> <description><![CDATA[这是一篇技术评论，呃，请自行掠过 早上拜读了Martin Fowler老人家的BLOG Groovy or Ruby ，兴致勃勃的看这个时尚的家伙对动态语言的高谈阔论。下午就在InfoQ看到了对其新书的点评——Martin Fowler unveils details of his upcoming DSL book. 两样东西放到一起很有意思。动态语言与领域语言(Domain-Specific Language)。 MF的书中是这样介绍的。 如果我们把XSLT看成是专门格式化XML的语言，那么XSLT就是XML的DSL。 那么DSL有什么用呢？ 根据MF的论述 Domain-Specific Language DSL与通用语言相区别，是为特定目的而生的语言，它并不是什么新东西，历史几乎和计算机的历史一样长。 比如Windows的批处理文件，再比如HTML（某种意义上）。处理它们的程序和普通的应用程序不一样，这些程序并不知道这些语言具体描述了什么，却知道他们到最后大概是什么样子。但我们也不能把这些应用程序归结为系统程序，毕竟，你不能用这些动态语言写成任何一个通常意义上的程序。这些语言轻巧灵活，惹人喜爱，却长期处于没人在乎的地位。几乎没有任何一个大学开设JavaScript或者BAT的课程。然而，用它们开发的程序铺天盖地，甚至有些开发者都没有意识到他们在写程序。 我们到底有多少DSL，没有人说的清楚，甚至怎么界定都没有标准。然而这种工具的确越来越受重视。大型的软件通常都有自己的工具语言，比如SAP，比如PepleSoft，比如MathLib，比如SAS，掌握这些工具通常意味着熟练应用这些语言与相关的领域知识。而由于他们之间毫无联系，同种软件之间有着高昂的替换成本。变相垄断使得DSL由最初的简化用户操作变成了对抗新来者的武器。 标准化是由混乱走向秩序的利器。工业化也是软件行业一直追求的目标。让我们看看工业界是怎么做的，他们拥有流水线，有很好的设计，生产，销售流程。我们常常抱怨软件的变化，生产没有变化吗？现在工业可以高效的适应变化，依靠的就是对领域的深切理解，对规则的灵活掌握。 对标准的无尽追寻是业界走向成熟的重要标志。不妨设想，今后的某天，所有的财务软件都有统一的口径标准，统一的数据格式处理流程。集团化，高质量的软件生产和部署使我们更加有序的获取所需的功能。然而这一切，依靠的就是对DSL领域的入侵。Ruby的流行正式反映了这种入侵，当其追逐者不断的在各种平台上实现这门语言的时候，我们也看到了传统语言正积极的调整。Java向.net学习多语言支持。.net努力的靠近开源社区的标准。 我们说GOP，说AOP，无非就是想把领域问题(Domain Problem)从应用问题里面解离，我们需要成熟的软件产品，需要的是真正模块化的组件，而不是某个既成事实。被巨头们忽悠着团团转的我们，也只能等到他们被迫合作的时候，才能轻松一点。 Spring 2.5 AOP Schema编程小解 笔记：DSL之一 简介 Ruby on Rails 安装错误一例 JRuby Note: 简单就是美 说一下EasyMock Rating: 0.0/5 (0 votes cast)<br /><div><img src="http://lazing.ave7.net/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></description> <content:encoded><![CDATA[<blockquote><p>这是一篇技术评论，呃，请自行掠过</p></blockquote><p>早上拜读了Martin Fowler老人家的BLOG <a href="http://martinfowler.com/bliki/GroovyOrJRuby.html">Groovy or Ruby</a> ，兴致勃勃的看这个时尚的家伙对动态语言的高谈阔论。下午就在InfoQ看到了对其新书的点评——<a href="http://www.infoq.com/news/2007/11/martin-fowler-dsl-book">Martin Fowler unveils details of his upcoming DSL book</a>. 两样东西放到一起很有意思。动态语言与领域语言(Domain-Specific Language)。</p><p>MF的书中是这样介绍的。</p><blockquote><p>如果我们把XSLT看成是专门格式化XML的语言，那么XSLT就是XML的DSL。</p></blockquote><p>那么DSL有什么用呢？</p><p>根据MF的论述 <a href="http://martinfowler.com/bliki/DomainSpecificLanguage.html">Domain-Specific Language</a></p><blockquote><p>DSL与通用语言相区别，是为特定目的而生的语言，它并不是什么新东西，历史几乎和计算机的历史一样长。</p></blockquote><p>比如Windows的批处理文件，再比如HTML（某种意义上）。处理它们的程序和普通的应用程序不一样，这些程序并不知道这些语言具体描述了什么，却知道他们到最后大概是什么样子。但我们也不能把这些应用程序归结为系统程序，毕竟，你不能用这些动态语言写成任何一个通常意义上的程序。这些语言轻巧灵活，惹人喜爱，却长期处于没人在乎的地位。几乎没有任何一个大学开设JavaScript或者BAT的课程。然而，用它们开发的程序铺天盖地，甚至有些开发者都没有意识到他们在写程序。</p><p>我们到底有多少DSL，没有人说的清楚，甚至怎么界定都没有标准。然而这种工具的确越来越受重视。大型的软件通常都有自己的工具语言，比如SAP，比如PepleSoft，比如MathLib，比如SAS，掌握这些工具通常意味着熟练应用这些语言与相关的领域知识。而由于他们之间毫无联系，同种软件之间有着高昂的替换成本。变相垄断使得DSL由最初的简化用户操作变成了对抗新来者的武器。</p><p>标准化是由混乱走向秩序的利器。工业化也是软件行业一直追求的目标。让我们看看工业界是怎么做的，他们拥有流水线，有很好的设计，生产，销售流程。我们常常抱怨软件的变化，生产没有变化吗？现在工业可以高效的适应变化，依靠的就是对领域的深切理解，对规则的灵活掌握。</p><p>对标准的无尽追寻是业界走向成熟的重要标志。不妨设想，今后的某天，所有的财务软件都有统一的口径标准，统一的数据格式处理流程。集团化，高质量的软件生产和部署使我们更加有序的获取所需的功能。然而这一切，依靠的就是对DSL领域的入侵。Ruby的流行正式反映了这种入侵，当其追逐者不断的在各种平台上实现这门语言的时候，我们也看到了传统语言正积极的调整。Java向.net学习多语言支持。.net努力的靠近开源社区的标准。</p><p>我们说GOP，说AOP，无非就是想把领域问题(Domain Problem)从应用问题里面解离，我们需要成熟的软件产品，需要的是真正模块化的组件，而不是某个既成事实。被巨头们忽悠着团团转的我们，也只能等到他们被迫合作的时候，才能轻松一点。<ul><li><a href="http://lazing.ave7.net/2007/preamble-lazingu002639s-java-guide/" rel="bookmark" title="2007/06/23">序言 &#8211; Lazing&#8217;s Java Guide</a></li><li><a href="http://lazing.ave7.net/2008/maven-need-to-act-as-wikipedia/" rel="bookmark" title="2008/05/23">Maven need to act as Wikipedia</a></li><li><a href="http://lazing.ave7.net/2008/jruby-note-simple-is-beautiful/" rel="bookmark" title="2008/04/25">JRuby Note: 简单就是美</a></li><li><a href="http://lazing.ave7.net/2009/twitter-to-see-from-the-enterprise-software-architecture-such-as-a/" rel="bookmark" title="2009/06/28">从Twitter等看企业软件架构（一）</a></li><li><a href="http://lazing.ave7.net/2007/junit-unit-testing-and-integration-testing-guidelines/" rel="bookmark" title="2007/12/15">JUnit单元测试与集成测试指引</a></li></ul><p></p><p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Flazing.ave7.net%2F2007%2Fdynamic-language-and-dsl%2F&title=Dynamic+Language+and+DSL" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><br /><div><img src="http://lazing.ave7.net/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /> <img src="http://lazing.ave7.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=199" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://lazing.ave7.net/2007/dynamic-language-and-dsl/feed/</wfw:commentRss> <slash:comments>4</slash:comments> <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license> </item> </channel> </rss>
