Posts Tagged ‘golang’

new command: goinstall

星期三, 三月 17th, 2010

golang
http://golang.org/cmd/goinstall/

各位太太小姐,您是否每次安裝library都要下10行command呢?還記不清是先pull還是先up?

upgrade 時老忘記這個library是在下git還是hg?還是前面兩種都試完才發現是svn?

體貼各位開發者的辛苦,美國加力佛尼亞的g公司最新科技登場…
每次裝library要手動一步一步來的時代已經過去了。

現在裝Go-MySQL-Client-Library就是這麼簡單
goinstall -dashboard=true github.com/thoj/Go-MySQL-Client-Library

程式中要使用它,直接import library在goroot/pkg/$arch/下的路徑即可。
import (mysql "github.com/thoj/Go-MySQL-Client-Library")

這個cmd是Russ Cox上個月底加的
主要是簡單安裝第三方library. 目前goinstall支援git, hg, svn 三種。

Go Wiki!

星期三, 三月 17th, 2010

http://code.google.com/p/go/wiki/WikiIndex
其實這一兩天已經從golang-dev嗅到一點wiki的味道了,go wiki正式上線。

不過要參與編輯的話必須要成為contributer,需照以下方法確保你的貢獻會採用Google版的BSD Style License。
Contributor License Agreement: http://golang.org/doc/contribute.html#copyright

我個人不是很喜歡這種作法。

上課囉,Go語言在羅徹斯特理工學院(RIT)開課了。

星期一, 三月 15th, 2010

http://www.cs.rit.edu/~ats/

null

Go, Concurrent and Systems Programming (in mycourses)
4003-561-70, 4005-714-70 MW 6:00-7:50 pm, 70-3560

這堂課從2010年春季開始講授。

相關資料跟note可以參考

http://www.cs.rit.edu/~ats/go-2009-3/index.xml

Go出書了?Go for Dummies

星期五, 三月 12th, 2010

golang

還差的遠呢… Go每週Release一次,平均每兩到三個星期就會有一次語言上的修正。
這種書怎麼寫啊?

不過現在 Toni Mikael Korpela 整理了一份給笨蛋的Go入門資料(Go for Dummies)。
如果你還沒入門,可以參考看看。

http://docs.google.com/Doc?docid=0Abeqw3xBUqsUZGY2YnM5Z2tfN3NzNWJ0NGdk&hl=en

Go in Google AI Challenge

星期五, 三月 12th, 2010

Go在Google AI Challenge貪吃蛇大賽中表現亮眼。

http://csclub.uwaterloo.ca/contest/index.php



其中使用Go語言的shinobi贏得整個賽事第29名,排名他在之前的程式都是由 C++, Common Lisp, 和 C# 所撰寫的。

http://csclub.uwaterloo.ca/contest/language_profile.php?lang=Go

http://csclub.uwaterloo.ca/contest/rankings.php?page=1

RANK USERNAME COUNTRY ORGANIZATION LANGUAGE ELO SCORE
1 (29) shinobi Other Go 2570

new package: websocket

星期五, 三月 12th, 2010

http://golang.org/pkg/websocket/

websocket

websocket是html5中WebServer跟Browser交換資料的新方法。

http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-74

不仰賴 XMLHttpRequest or iframe s 這些傳統的作法,也不用開啟多個HTTP connections就可以進行資料交換。

是一個很有趣的東西。

一個關於Ken Thompson的小故事

星期五, 十二月 11th, 2009

Go 的建立者之一,也是UNIX的建立者 Kenneth Thompson Kenneth Thompson
他在1960年發明了 B 語言,然後和 C 語言的建立者之一 Dennis Ritchie 一起用 C 語言寫了 UNIX 作業系統。
Anyway,他一直有一個遺憾。

http://en.wikiquote.org/wiki/Kenneth_Thompson

Ken Thompson was once asked what he would do differently if he were redesigning the UNIX system. His reply: 『I’d spell creat with an e.』
Ken Thompson有一次被問到,如果你有機會重新設計UNIX系統,你最想改的是甚麼?他回答:我會讓creat這個拼寫加上e。

就是 UNIX 的系統呼叫建立檔案都是用 O_CREAT。
他一直想要把它改成 O_CREATE ,但是 O_CREAT 已經被 IEEE 已經加到 POSIX 裡作為規範了。

因為Go,他終於辦到了…

Ken Thompson的Log message


// Flags to Open wrapping those of the underlying system. Not all flags
// may be implemented on a given system.
const (
O_RDONLY = syscall.O_RDONLY; // open the file read-only.
O_WRONLY = syscall.O_WRONLY; // open the file write-only.
O_RDWR = syscall.O_RDWR; // open the file read-write.
O_APPEND = syscall.O_APPEND; // open the file append-only.
O_ASYNC = syscall.O_ASYNC; // generate a signal when I/O is available.
O_CREAT = syscall.O_CREAT; // create a new file if none exists.
O_EXCL = syscall.O_EXCL; // used with O_CREAT, file must not exist
O_NOCTTY = syscall.O_NOCTTY; // do not make file the controlling tty.
O_NONBLOCK = syscall.O_NONBLOCK; // open in non-blocking mode.
O_NDELAY = O_NONBLOCK; // synonym for O_NONBLOCK
O_SYNC = syscall.O_SYNC; // open for synchronous I/O.
O_TRUNC = syscall.O_TRUNC; // if possible, truncate file when opened.
O_CREATE = O_CREAT; // create a new file if none exists.
)

………………..花了40年啊~

聽完這個故事有沒有很感動? 要不要好好學 go?
http://golangd.com/