go! here we go!

Download Go! here we go!

If you can't read please download the document

Upload: -xing-xing

Post on 16-Apr-2017

1.409 views

Category:

Health & Medicine


3 download

TRANSCRIPT

Go! Here we go!

2012.02Xing Xing / mikespook.com / Follow @mikespook

Why

Faster slower, slower or slower...

Header hell

Type: complicated dynamically

GC and parallel computation? Systems languages said NO!

Multicore == Worry and Confusion

What

Compiling resources is a resources!

Dependency analysis easy, C-style include files and libraries.

To make types feel lighter weight .

Fully GC, support for concurrent execution and communication.

For the construction of system software on multicore machines.

A new system language, a concurrent, garbage-collected language with fast compilation.

When in Rome,
do as the Romans do.

When in Golang,do as the Gophers do.

When in Golang,do as the Gophers do.

Hello HTTP

httphello worldWho are always late?

goroutinehttp hello worldGoroutines

It is a function executing in parallel with other goroutines in the same address space.-- From "Effective Go"

channel http hello world channel Do not communicate by sharing memory; instead, share memory by communicating.-- From "Effective Go"

Do not communicate by sharing memory; instead, share memory by communicating.-- From "Effective Go"

Channels combine communicationthe exchange of a valuewith synchronizationguaranteeing that two calculations (goroutines) are in a known state.-- From "Effective Go"

Channel, PIPE or Message Queue?

Channels

Channels

Go 1: Production usable?

Only one main command: go

Lots of official packages

Not large but high-end communities

On the doorstep, coming soon...

Go 1 http://www.mikespook.com/2012/02/%e7%bf%bb%e8%af%91%e4%bb%8e-r60-%e5%88%b0-go-1/

Coding Show

The CheatSoldiers: We are out of stack, sarge!Sarge: I know! We gonna get it!(The sarge opened a console and typed showmethestack...)Soldiers: Wow...Cool! We are survivors!Sarge: Yep! Because we all love the cheat![asm_386.s, asm_amd64.s, asm_arm.s] runtime.morestack

Question?