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

          RustMozilla的編程語(yǔ)言

          聯(lián)合創(chuàng)作 · 2023-09-28 00:11

          Rust 是 Mozilla 的一個(gè)新的編程語(yǔ)言,由web語(yǔ)言的領(lǐng)軍人物Brendan Eich(js之父),Dave Herman以及Mozilla公司的Graydon Hoare 合力開(kāi)發(fā)。

          創(chuàng)建這個(gè)新語(yǔ)言的目的是為了解決一個(gè)很頑疾的問(wèn)題:軟件的演進(jìn)速度大大低于硬件的演進(jìn),軟件在語(yǔ)言級(jí)別上無(wú)法真正利用多核計(jì)算帶來(lái)的性能提升。Rust是針對(duì)多核體系提出的語(yǔ)言,并且吸收一些其他動(dòng)態(tài)語(yǔ)言的重要特性,比如不需要管理內(nèi)存,比如不會(huì)出現(xiàn)Null指針等等。

          特點(diǎn):

          • 零成本的抽象

          • 移動(dòng)語(yǔ)義

          • 保證內(nèi)存安全

          • 線程沒(méi)有數(shù)據(jù)競(jìng)爭(zhēng)

          • trait-based泛型

          • 模式匹配

          • 類型推斷

          • 最小運(yùn)行時(shí)

          • 高效的C綁定

          // This code is editable and runnable!
          fn main() {
              // A simple integer calculator:
              // `+` or `-` means add or subtract by 1
              // `*` or `/` means multiply or divide by 2
          
              let program = "+ + * - /";
              let mut accumulator = 0;
          
              for token in program.chars() {
                  match token {
                      '+' => accumulator += 1,
                      '-' => accumulator -= 1,
                      '*' => accumulator *= 2,
                      '/' => accumulator /= 2,
                      _ => { /* ignore everything else */ }
                  }
              }
          
              println!("The program \"{}\" calculates the value {}",
                        program, accumulator);
          }
          瀏覽 15
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <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>
                  亚洲一区在线免费 | 久久九色| 看骚逼久久TV | 久久影音先锋 | 欧美韩日中文字幕视频 |