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
270
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
250
dplyr 1.0.0
romainfrancois
1
1.2k
dplyr episode 9, summarise() of the vctrs
romainfrancois
0
990
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
360
rap
romainfrancois
0
98
arrow + ergo
romainfrancois
0
350
Other Decks in Programming
See All in Programming
Effect の双対、Coeffect
yukikurage
5
1.4k
関数型まつり2025登壇資料「関数プログラミングと再帰」
taisontsukada
2
820
人には人それぞれのサービス層がある
shimabox
3
680
Claude Codeの使い方
ttnyt8701
1
110
Create a website using Spatial Web
akkeylab
0
290
型付きアクターモデルがもたらす分散シミュレーションの未来
piyo7
0
780
複数アプリケーションを育てていくための共通化戦略
irof
10
3.9k
GoのWebAssembly活用パターン紹介
syumai
3
10k
Practical Tips and Tricks for Working with Compose Multiplatform Previews (mDevCamp 2025)
stewemetal
0
120
CSC307 Lecture 17
javiergs
PRO
0
110
TypeScript LSP の今までとこれから
quramy
1
500
機械学習って何? 5分で解説頑張ってみる
kuroneko2828
0
210
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
41
7.3k
Thoughts on Productivity
jonyablonski
69
4.7k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Agile that works and the tools we love
rasmusluckow
329
21k
Speed Design
sergeychernyshev
31
990
The Invisible Side of Design
smashingmag
299
51k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Visualization
eitanlees
146
16k
Transcript
ergo
[email protected]
@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
[email protected]
@romain_francois http://bit.ly/ergo-rr2018