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
ergo
Search
Romain François
July 05, 2018
Programming
0
260
ergo
Talk about ergo at the rencontres R 2018
Romain François
July 05, 2018
Tweet
Share
More Decks by Romain François
See All by Romain François
dplyr 1.0.0 / Paris R-addicts
romainfrancois
0
240
dplyr 1.0.0
romainfrancois
1
1.2k
dplyr episode 9, summarise() of the vctrs
romainfrancois
0
960
dplyr episode 9: summarise() of the vctrs
romainfrancois
0
340
n() cool #dplyr things
romainfrancois
2
2.9k
dance
romainfrancois
0
270
rap and splice girls
romainfrancois
0
350
rap
romainfrancois
0
92
arrow + ergo
romainfrancois
0
340
Other Decks in Programming
See All in Programming
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
1.1k
Datadog Workflow Automation で圧倒的価値提供
showwin
1
310
Jasprが凄い話
hyshu
0
180
未経験でSRE、はじめました! 組織を支える役割と軌跡
curekoshimizu
1
200
Visual StudioのGitHub Copilotでいろいろやってみる
tomokusaba
1
220
Amazon Bedrockマルチエージェントコラボレーションを諦めてLangGraphに入門してみた
akihisaikeda
1
160
バッチを作らなきゃとなったときに考えること
irof
2
550
コードを読んで理解するko build
bells17
1
120
良いコードレビューとは
danimal141
9
7.7k
Rails 1.0 のコードで学ぶ find_by* と method_missing の仕組み / Learn how find_by_* and method_missing work in Rails 1.0 code
maimux2x
1
260
読まないコードリーディング術
hisaju
0
120
Jakarta EE meets AI
ivargrimstad
0
670
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Embracing the Ebb and Flow
colly
84
4.6k
Designing Experiences People Love
moore
140
23k
Building Adaptive Systems
keathley
40
2.4k
Building Your Own Lightsaber
phodgson
104
6.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
11
540
Designing for humans not robots
tammielis
250
25k
GraphQLとの向き合い方2022年版
quramy
44
14k
GitHub's CSS Performance
jonrohan
1030
460k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.5k
Git: the NoSQL Database
bkeepers
PRO
428
65k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Transcript
ergo romain@rstudio.com @romain_francois http://bit.ly/ergo-rr2018
None
None
•Open source •Google •Simple •Fast enough
https://www.docker.com
https://bookdown.org/yihui/blogdown/
https://www.rstudio.com/products/connect/
example
package main import "fmt" func fahrenheit(celcius float64) float64 { return
celcius * 1.8 + 32 } func main() { var freezing float64 = fahrenheit(0.0) boiling := fahrenheit(100.0) fmt.Printf("Water freezes at %4.2f F\n", freezing) fmt.Printf("Water boils at %4.2f F\n", boiling) }
package main import "fmt" func fahrenheit(celcius float64) float64 { return
celcius * 1.8 + 32 } func main() { var freezing float64 = fahrenheit(0.0) boiling := fahrenheit(100.0) fmt.Printf("Water freezes at %4.2f F\n", freezing) fmt.Printf("Water boils at %4.2f F\n", boiling) }
$ go run fahrenheit.go Water freezes at 32.00 F Water
boils at 212.00 F
research
bit.ly/ergorigin purrple.cat/tags/go/
bit.ly/ergorigin purrple.cat/tags/go/
None
http://bit.ly/grrr-join
wttr.in/Rennes
library(rvest) library(glue) library(fahrenheit) library(tibble) library(dplyr) temperature <- function(where = "Rennes"){
glue("https://wttr.in/{where}") %>% read_html() %>% html_node("span:nth-child(3)") %>% html_text() %>% as.numeric() } temperature("Rennes") %>% tibble(celcius = .) %>% mutate(fahrenheit = fahrenheit(celcius)) #> # A tibble: 1 x 2 #> celcius fahrenheit #> <dbl> <dbl> #> 1 19 66.2 #' Created on 2018-07-05 by the [reprex package](http://reprex.tidyverse.org) (v0.2.0).
romain@purrplex ~/git/rstats-go/rencontresr2018/fahrenheit $ tree . !"" DESCRIPTION !"" NAMESPACE !""
R # $"" fahrenheit.R !"" fahrenheit.Rproj !"" man $"" src !"" Makevars !"" fahrenheit.h !"" fahrenheit.so $"" go $"" src !"" fahrenheit # $"" fahrenheit.go $"" main !"" main.c $"" main.go 7 directories, 10 files fahrenheit main } }
package fahrenheit func Fahrenheit(celcius float64) float64 { return celcius *
1.8 + 32 } src/go/src/fahrenheit/fahrenheit.go
package main import "C" import "fahrenheit" //export Fahrenheit func Fahrenheit(x
float64) float64 { return fahrenheit.Fahrenheit(x) ; } func main() {} src/go/src/main/main.go
#include <R.h> #include <Rinternals.h> #include "_cgo_export.h" SEXP _fahrenheit(SEXP x){ return
Rf_ScalarReal(Fahrenheit(REAL(x)[0]); } src/go/src/main/main.c
#' @useDynLib fahrenheit #' @export fahrenheit <- function(celcius) { .Call("_fahrenheit",
celcius, PACKAGE = "fahrenheit" ) } R/fahrenheit.R
.PHONY: go CGO_CFLAGS = "$(ALL_CPPFLAGS)" CGO_LDFLAGS = "$(PKG_LIBS) $(SHLIB_LIBADD) $(LIBR)"
GOPATH = $(CURDIR)/go go: CGO_CFLAGS=$(CGO_CFLAGS) CGO_LDFLAGS=$(CGO_LDFLAGS) \ GOPATH=$(GOPATH) /usr/local/go/bin/go \ build -o $(SHLIB) -x -buildmode=c-shared main src/Makevars
future
None
None
None
ergo romain@rstudio.com @romain_francois http://bit.ly/ergo-rr2018