<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Mirah基于JVM平臺的靜態(tài)類型語言

          聯(lián)合創(chuàng)作 · 2023-10-01 08:24

          Mirah,又叫做Duby,又一個基于JVM平臺的靜態(tài)類型語言,它擁有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的設計原則:

          • 平臺無關(guān)
          • 擺脫對后端類型系統(tǒng)的具體決定
          • 代碼生成,或其他細節(jié)由外部語言確定
          • 沒有運行時的依賴庫

           

          瀏覽 24
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  成人少妇MCA | 日韩国产免费 | AⅤ黄色片| 毛片操逼| 很很鲁97 |