Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Go - A great language for building web applicat...
Search
sporto
September 06, 2013
1
320
Go - A great language for building web applications
sporto
September 06, 2013
Tweet
Share
More Decks by sporto
See All by sporto
React inside Elm
sporto
2
170
Elm
sporto
1
250
Redux: Flux Reduced
sporto
1
330
Practically Immutable
sporto
0
180
Webpack and React
sporto
4
380
Rails with Webpack
sporto
1
210
Lesson learnt building Single Page Application
sporto
0
110
Grunt
sporto
1
160
Safe Testing in Ruby
sporto
1
120
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.3k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Automating Front-end Workflow
addyosmani
1366
200k
Into the Great Unknown - MozCon
thekraken
33
1.5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Agile that works and the tools we love
rasmusluckow
328
21k
Transcript
Go Why use it for building web application? @sebasporto
Comparing it to languages I use and love Ruby JavaScript
To start with + Lightweight + Relatively easy to learn
+ Familiar
It is fast
Bubble sort benchmark # ruby bubble.call([2, 10, 1, 9, 5,
6, 8, 3, 7, 4]) // JS bubble([2, 10, 1, 9, 5, 6, 8, 3, 7, 4]); // Go arr := []int{2, 10, 1, 9, 5, 6, 8, 3, 7, 4} bubble(arr) Code here
It is fast! 190x faster than Ruby
Concurrency as core feature
Concurrency - Parallel requests
None
Concurrency - Parallel requests Ruby Mutex and Threads :( EventMachine
:(
Concurrency - Parallel requests Node.js var defX = Q.defer(); var
defY = Q.defer(); var oneAndTwo = Q .all([defX.promise, defY.promise]) .then(processConcat); requestValue('/x', defX); requestValue('/y', defY);
Concurrency - Parallel requests Go var cx chan string =
make(chan string) var cy chan string = make(chan string) go requestValue("/x", cx) go requestValue("/y", cy) x := <-‐cx y := <-‐cy processConcat(x, y)
Efficient memory usage
# Run benchmark ab -‐n 10000 -‐c 100 http://127.0.0.1:8100/ Node.js
FATAL ERROR: (...) process out of memory Go Time taken for tests: 20.689 seconds Complete requests: 10000 # No problems
Rich standard library + Http + Templating + JSON
Static typing (+ IMO) + More robust + Easier to
refactor + Less tests + Compiler can go crazy with optimisations + Still flexible (with interfaces) + No ceremony
Compiled But ultra fast
Single binary + Compile and deploy + No need to
worry about dependencies, e.g. NPM modules, RubyGems
A lot more + Simple and flexible object system -
composition + Functions as first class + Closures + Standard formating of source code
It is great alternative Try it!
Thanks @sebasporto