基于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

Dive Into Python

Dive Into Python

Mark Pilgrim / Apress / 2004-11-5 / GBP 31.49

Python is a new and innovative scripting language. It is set to replace Perl as the programming language of choice for shell scripters, and for serious application developers who want a feature-rich, ......一起来看看 《Dive Into Python》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具