新程式語言 Vim - Zimbu, Google - Go

現在開始流行開發程式語言? 大家都要寫一套~ XD

新聞

Zimbu 特色

  • Zimbu 官方網站: Home (the Zimbu programming language)
  • Zimbu 下載: zimbu - A no-nonsense programming language (Google Code)
  • 下述取自 官方首頁: (Zimbu 要打倒的對象. XD)
    • It has to be as fast as possible, so interpreted languages are out.
    • You don't want to micro manage memory, so C is out.
    • You don't want to require programmers to have a degree, so C++ is out.
    • You want fast startup and not depend on a big runtime, so Java is out.
    • It has to run on most systems, anything with a C compiler, so D is out.
    • You want to have fun making something new.

Zimbu 範例

hello.zu


MAIN()
    IO.write("Hello, World!\n")
}

看完此 Hello world 的範例, 如果要學的話, Vim 的縮排又要開始頭痛了~

Go 特色

  • 官方網頁: The Go Programming Language
  • 下述取自 官方網頁:
    • a systems programming language
    • expressive, concurrent, garbage-collected
    • simple, fast, safe, concurrent, fun, open source
hello.go


package main
 
import "fmt"
 
func main() {
  fmt.Printf("Hello, 世界\n")
}

註: 上述是官方首頁的完整範例, "世界" 確實是打中文沒錯~ 🙂 是漢字. XD

Go 語法 範例


package main
 
import fmt "fmt"
 
const (
        Space = " ";
      )
 
func main() {
    var s string = "";
    for i := 0; i < 10; i++ {
        if i > 0 {
            s += Space
        }
        s += "foo"
    }
 
    var a int;
    b := 0;
    c := 0;
    switch {
        case a < b:
            c = -1
        case a == b:
            c = 0
        case a > b:
            c = 1
    }
}

相關網頁


關於 Tsung

對新奇的事物都很有興趣, 喜歡簡單的東西, 過簡單的生活.
本篇發表於 News-Technology。將永久鏈結加入書籤。

新程式語言 Vim - Zimbu, Google - Go 有 4 則回應

  1. debain 說道:

    第一眼我也覺得是中文
    想了一下也可能是日文
    是漢字就對了

  2. kevinwatt 說道:

    研發者的說法是日文, but you really can't tell the difference can you?

    事實上,這種東西叫統漢字。

  3. apu 說道:

    世界是日本语吧

  4. freehaha 說道:

    我從 google code 那邊下載的 zimbu 裡面就有 vim 用的indent, syntax file 了, 畢竟還是vim 的作者開發的阿..XD

發表迴響