Mirah,又叫做Duby,又一个基于JVM平台的静态类型语言,它拥有Ruby一样的语法的同时,且拥有Java般的速度。他是由JRuby衍生出来的项目,旨在让Ruby能更进一步的沁入JVM平台。
Mirah(Duby)的特性:
代码示例1:
import java.util.Collections import java.util.ArrayList list = ArrayList.new [9,5,2,6,8,5,0,3,6,1,8,3,6,4,7,5,0,8,5,6,7,2,3] puts "unsorted: #{list}" Collections.sort(list) {|a,b| Integer(a).compareTo(b)} puts "sorted: #{list}"
代码示例2:
import "java.lang.System" def foo home = System.getProperty "java.home" System.setProperty "hello.world", "something" hello = System.getProperty "hello.world" puts home puts hello end puts "Hello world!" foo
Mirah的设计原则: