基于JVM平台的静态类型语言 Mirah

码农软件 · 软件分类 · Java开发工具 · 2019-11-07 19:58:50
  • 授权协议: 未知
  • 开发语言: Java Ruby
  • 操作系统: 跨平台
  • 软件首页: http://www.mirah.org/

软件介绍

Mirah,又叫做Duby,又一个基于JVM平台的静态类型语言,它拥有Ruby一样的语法的同时,且拥有Java般的速度。他是由JRuby衍生出来的项目,旨在让Ruby能更进一步的沁入JVM平台。

Mirah(Duby)的特性:

  • Ruby的语法
  • 可编译为.class或.java
  • 拥有Java般的速度

代码示例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的设计原则:

  • 平台无关
  • 摆脱对后端类型系统的具体决定
  • 代码生成,或其他细节由外部语言确定
  • 没有运行时的依赖库

 

本文地址:https://codercto.com/soft/d/18492.html

Data Structures and Algorithms with JavaScript

Data Structures and Algorithms with JavaScript

Michael McMillan / O'Reilly Media / 2014-2-22 / USD 28.51

If you’re using JavaScript on the server-side, you need to implement classic data structures that conventional object-oriented programs (such as C# and Java) provide. This practical book shows you how......一起来看看 《Data Structures and Algorithms with JavaScript》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具