tama @ YanoLab.LT
Go?
Big names!
  Robert C Pike          Plan 9


Kenneth Thompson          Unix


Robert Griesemer      V8, HotSpot

      etc...
Overviews
• Launched by Google
 • R.I.P Noop?
• System Programming
 • Server side?
 • Frustration with existing languages
...
Go!
Hello, World!
package main

import "fmt"

func main()
{
   fmt.Printf("Hello,   n")
}
Interface

• Duck typing
 • Method set
 • Not Java like interface
• Flexible!
 • Add method to struct
e.g. Interface
// Apply this to any type implementing Sortable
func Sort(data Sortable)
{
    for i := 1; i < data.Len(); ...
type Sortable interface
{
   Len() int;
   Less(i, j int) bool;
   Swap(i, j int);
}

type Array []int
func (p Array) Len(...
Goroutine

• Lightweight process
 • go keyword
 • Concurrently
• Channel (CSP)
 • Communication between goroutines
e.g. Goroutine
func main()
{
   ch := make(chan int); // Create a new channel.
   go generate(ch);      // Start as a goro...
e.g. Channel
// Send the sequence 2, 3, 4, ... to channel 'ch'.
func generate(ch chan int)
{
    for i := 2; ; i++ {
     ...
Others
• Garbage Collected
 • M&S, IBM’s Recycler in the future
• Windows support
 • Patch welcome! but...
• Multiple valu...
Earthquake Problem



Issue 9
is here to stay!
• Future works
 • Performance, Libraries, Tools, etc...
• Go vs Go!
 • Going : Go is not Go!
 • Issue9
  ...
Upcoming SlideShare
Loading in …5
×

なぜ検索しなかったのか

1,615 views

Published on

YanoLab.LT 04での発表資料

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,615
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • なぜ検索しなかったのか

    1. 1. tama @ YanoLab.LT
    2. 2. Go?
    3. 3. Big names! Robert C Pike Plan 9 Kenneth Thompson Unix Robert Griesemer V8, HotSpot etc... Plan 9, GCC, etc...
    4. 4. Overviews • Launched by Google • R.I.P Noop? • System Programming • Server side? • Frustration with existing languages • Implement some useful ideas
    5. 5. Go!
    6. 6. Hello, World! package main import "fmt" func main() { fmt.Printf("Hello, n") }
    7. 7. Interface • Duck typing • Method set • Not Java like interface • Flexible! • Add method to struct
    8. 8. e.g. Interface // Apply this to any type implementing Sortable func Sort(data Sortable) { for i := 1; i < data.Len(); i++ { for j := i; j > 0 && data.Less(j, j-1); j-- { data.Swap(j, j-1); } } }
    9. 9. type Sortable interface { Len() int; Less(i, j int) bool; Swap(i, j int); } type Array []int func (p Array) Len() int { return len(p); } func (p Array) Less(i, j int) bool { return p[i] < p[j]; } func (p Array) Swap(i, j int) { p[i], p[j] = p[j], p[i]; }
    10. 10. Goroutine • Lightweight process • go keyword • Concurrently • Channel (CSP) • Communication between goroutines
    11. 11. e.g. Goroutine func main() { ch := make(chan int); // Create a new channel. go generate(ch); // Start as a goroutine. for { // do something // fmt.Print(<-ch); } }
    12. 12. e.g. Channel // Send the sequence 2, 3, 4, ... to channel 'ch'. func generate(ch chan int) { for i := 2; ; i++ { ch <- i // Send 'i' to channel 'ch'. } }
    13. 13. Others • Garbage Collected • M&S, IBM’s Recycler in the future • Windows support • Patch welcome! but... • Multiple values • etc...
    14. 14. Earthquake Problem Issue 9
    15. 15. is here to stay! • Future works • Performance, Libraries, Tools, etc... • Go vs Go! • Going : Go is not Go! • Issue9 • http://issuenine.com/ :)

    ×