-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathembedded.slide
144 lines (90 loc) · 3.22 KB
/
embedded.slide
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
Go
Embedded Community
2 May 2018
Tags: Embedded, Golang, Community
Víctor Pérez
ERNI
* Introduction
* A Tour of Go
.iframe https://www.youtube.com/embed/ytEkHepK08c 530 1000
.link https://research.swtch.com/gotour FAQ
* Why Go Is Successful (aka Simplicity is Complicated)
.iframe https://www.youtube.com/embed/k9Zbuuo51go 530 1000
* Sharing code
* Sharing code : Go Code
go-cshared-examples/awesome.go
.code go-cshared-examples/awesome.go /"C"/
.code go-cshared-examples/awesome.go /export Add/,/{/
.code go-cshared-examples/awesome.go /export Cosine/,/{/
.code go-cshared-examples/awesome.go /export Sort/,/{/
.code go-cshared-examples/awesome.go /export Log/,/{/
go build -o awesome.so -buildmode=c-shared awesome.go
* Sharing code : Shared code
go-cshared-examples/awesome.h
.code go-cshared-examples/awesome.h /Add/,/Log
.link https://medium.com/learning-the-go-programming-language/calling-go-functions-from-other-languages-4c7d8bcc69bf Calling Go Functions from Other Languages
.link https://github.com/vladimirvivien/go-cshared-examples Github Example
* Sharing code : Hands on
- Build shared
- Build C "gcc -o client client1.c ./awesome.so"
- Run from C
- Run from python2.7 "python client.py"
* Cross compile
.iframe https://golang.org/doc/install/source#environment 530 1000
.link https://golang.org/doc/install/source#environment enviroment variables
* Cross compile : Hands on
* Examples
* Web Crawler
* Get and find href
.code crawler/fetcher.go /FindUrlsIn/
.code crawler/fetcher.go /Part1/,/END/
* Get and find href
.code crawler/fetcher.go /Part1/,/END/ HL1
* Get and find href
.code crawler/fetcher.go /Part1/,/END/ HL2
* Get and find href
.code crawler/fetcher.go /Part1/,/END/ HL3
* Get and find href
.code crawler/fetcher.go /Part1/,/END/ HL4
* Get and find href
.code crawler/fetcher.go /Part1/,/END/ HL5
.code crawler/fetcher.go /Part2/,/END/
* Async work
.code crawler/main.go /Channels/,/END/ HL1
.code crawler/main.go /FindUrlsIn/ HL1
.code crawler/main.go /Part1/,/END/ HL1
* Async work
.code crawler/main.go /Channels/,/END/ HL2
.code crawler/main.go /FindUrlsIn/ HL2
.code crawler/main.go /Part1/,/END/ HL2
* Async work
.code crawler/main.go /Channels/,/END/ HL3
.code crawler/main.go /FindUrlsIn/ HL3
.code crawler/main.go /Part1/,/END/ HL3
* Async work
.code crawler/main.go /Channels/,/END/ HL4
.code crawler/main.go /FindUrlsIn/ HL4
.code crawler/main.go /Part1/,/END/ HL4
* Async work
.code crawler/main.go /Channels/,/END/ HL5
.code crawler/main.go /FindUrlsIn/ HL5
.code crawler/main.go /Part1/,/END/ HL5
* Async work
.code crawler/main.go /Channels/,/END/ HL6
.code crawler/main.go /FindUrlsIn/ HL6
.code crawler/main.go /Part1/,/END/ HL6
* Async work
.code crawler/main.go /Channels/,/END/ HL7
.code crawler/main.go /FindUrlsIn/ HL7
.code crawler/main.go /Part1/,/END/ HL7
* Flow control
.code crawler/main.go /Control/,/END/ HL1
.code crawler/main.go /wgwait/,/END/ HL1
* Flow control
.code crawler/main.go /case <-timeout/,/END/
.code crawler/main.go /case done/,/END/
* Give it a try!
* Raspberrypi GPIO
* Real Stories
.link http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang/ 1 million request per minute
.link https://movio.co/en/blog/migrate-Scala-to-Go/ From Scala to Go