SlideShare uma empresa Scribd logo
1 de 39
Baixar para ler offline
FredAtBootstrap
http://bootstrap.me.uk
https://dev.to/redfred7
Fred
Quest for a new language
Requirements:
● Safe
● Portable
● Performant
● Expressive
● Elegant
Candidates:
1. Rust
2. Go
3. Nim
● 2005: Andreas Rumpf
● Community-driven
● Imperative
● Multi-paradigm
● Current release: 1.0.2
Origins
© Nim In Action, Dominik Picheta, Manning Publications, 2016
Portability
● nim c cc:gcc myproject.nim
● nim c --cpu:i386 --os:linux --compileOnly --genScript
myproject.nim
● nim c --cpu:arm --os:linux myproject.nim
● nim c -d:mingw myproject.nim
● nim c --os:nintendoswitch myproject.nim
--passC="-I$DEVKITPRO/libnx/include"
--passL="-specs=$DEVKITPRO/libnx/switch.specs
-L$DEVKITPRO/libnx/lib -lnx"
Compilation
● FFI
● Wrapping code or libraries (see next slide)
● c2nim = Parse a C file and generate equivalent
Nim code
Interoperability with C-family
languages
● Non-tracing GC
● Can be customised
○ GC_setMaxPause(MaxPauseInUs: int)
○ GC_step(us: int, strongAdvice = false, stackSize = -1)
● Can be turned off
○ GC_disable()
Garbage Collection
Tooling
● $> choosenim 0.12
● $> nimble install nake
● Sublime, vim, VS Code, Aporia Editor
Nim Basics
Statically typed + variable state
Functions - classic return
Functions - implicit return
Functions - returning result
Functions - style agnostic calls
Functions - UFC
Function: overloading
Generics
First-class Functions
Modules
person.nim
main.nim
Modules
Functional programming
Side-effect checking
Built-in functional style
Multi-tasking &
Asynchronous coding
Multi-threading
Async + Futures
Async Await
Metaprogramming
Templates
Macros
● Modify the
AST
● See example
Macros
Macros
Compile-time function execution
(CTFE)
Nim in Action, Dominik Picheta, Manning
Publications 2016
Compile-time Function
Execution
proc fillString(): string =
result = ""
echo("Generating string")
for i in 0 .. 4:
result.add($i)
const count = fillString()
NimScript
Embedded scripts
let script1 = compileScript("script1.nims")
let result = script1.call
Other features
- Deferred code execution
- Iterators
- staticExec
- {.emit.}
-
- Asm
Why Nim?
❏ Portability
❏ High Performance
❏ Compatibility
❏ Excellent type system
❏ Syntactic sugar
❏ Strong Concurrency & Parallelism
Learn more!
http://nim-lang.org/
https://hookrace.net/blog

Mais conteúdo relacionado

Mais procurados

Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...
Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...
Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...
niallo
 
KDE Plasma Develop Intro
KDE Plasma Develop IntroKDE Plasma Develop Intro
KDE Plasma Develop Intro
csslayer
 
Madrid .NET Meetup: Microsoft open sources .NET!
Madrid .NET Meetup: Microsoft open sources .NET!Madrid .NET Meetup: Microsoft open sources .NET!
Madrid .NET Meetup: Microsoft open sources .NET!
Alfonso Garcia-Caro
 

Mais procurados (20)

Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...
Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...
Continuous Deployment of Front-end JavaScript with StriderCD, Github and Sauc...
 
How can OpenNebula fit your needs - OpenNebulaConf 2013
How can OpenNebula fit your needs - OpenNebulaConf 2013 How can OpenNebula fit your needs - OpenNebulaConf 2013
How can OpenNebula fit your needs - OpenNebulaConf 2013
 
Making CLIs with Node.js
Making CLIs with Node.jsMaking CLIs with Node.js
Making CLIs with Node.js
 
FreeBSD hosting
FreeBSD hostingFreeBSD hosting
FreeBSD hosting
 
Docker
DockerDocker
Docker
 
From NodeJS to Rust
From NodeJS to RustFrom NodeJS to Rust
From NodeJS to Rust
 
Introduction To Dart (GDG NY Jan 2014 Meetup)
Introduction To Dart (GDG NY Jan 2014 Meetup)Introduction To Dart (GDG NY Jan 2014 Meetup)
Introduction To Dart (GDG NY Jan 2014 Meetup)
 
pkgsrc 2012 - the record of the past year
pkgsrc 2012 - the record of the past yearpkgsrc 2012 - the record of the past year
pkgsrc 2012 - the record of the past year
 
Async e await com JavaScript: entenda e use agora
Async e await com JavaScript: entenda e use agoraAsync e await com JavaScript: entenda e use agora
Async e await com JavaScript: entenda e use agora
 
2015-09-16 georchestra @ foss4g2015 Seoul
2015-09-16 georchestra @ foss4g2015 Seoul2015-09-16 georchestra @ foss4g2015 Seoul
2015-09-16 georchestra @ foss4g2015 Seoul
 
Docker basic on azure
Docker basic on azureDocker basic on azure
Docker basic on azure
 
KDE Plasma Develop Intro
KDE Plasma Develop IntroKDE Plasma Develop Intro
KDE Plasma Develop Intro
 
nginx.conf - globo.com's live video platform for fifa world cup 14
nginx.conf  - globo.com's live video platform for fifa world cup 14nginx.conf  - globo.com's live video platform for fifa world cup 14
nginx.conf - globo.com's live video platform for fifa world cup 14
 
Madrid .NET Meetup: Microsoft open sources .NET!
Madrid .NET Meetup: Microsoft open sources .NET!Madrid .NET Meetup: Microsoft open sources .NET!
Madrid .NET Meetup: Microsoft open sources .NET!
 
K9s - Kubernetes CLI To Manage Your Clusters In Style
K9s - Kubernetes CLI To Manage Your Clusters In StyleK9s - Kubernetes CLI To Manage Your Clusters In Style
K9s - Kubernetes CLI To Manage Your Clusters In Style
 
Use MQTT in Docker on Raspberry Pi
Use MQTT in Docker on Raspberry PiUse MQTT in Docker on Raspberry Pi
Use MQTT in Docker on Raspberry Pi
 
Docker. General overview
Docker. General overviewDocker. General overview
Docker. General overview
 
vmod workshop
vmod workshopvmod workshop
vmod workshop
 
Code on the Beach 2019 - Let's Take a Tour of .Net Core: CLI
Code on the Beach 2019 - Let's Take a Tour of .Net Core: CLICode on the Beach 2019 - Let's Take a Tour of .Net Core: CLI
Code on the Beach 2019 - Let's Take a Tour of .Net Core: CLI
 
Intro to Linux - Skillswap
Intro to Linux - Skillswap Intro to Linux - Skillswap
Intro to Linux - Skillswap
 

Semelhante a Nim programming language - DevFest Berlin 2019

Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Opersys inc.
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Docker, Inc.
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VI
Opersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VLeveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon V
Opersys inc.
 

Semelhante a Nim programming language - DevFest Berlin 2019 (20)

Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
 
Snap - the universal packaging format for linux distros
Snap - the universal packaging format for linux distrosSnap - the universal packaging format for linux distros
Snap - the universal packaging format for linux distros
 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
 
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo..."Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
 
NetBSD workshop
NetBSD workshopNetBSD workshop
NetBSD workshop
 
Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011
 
GR8Conf US 2017 - Dockerize your Grails!
GR8Conf US 2017 - Dockerize your Grails!GR8Conf US 2017 - Dockerize your Grails!
GR8Conf US 2017 - Dockerize your Grails!
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper API
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VI
 
Leveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VLeveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon V
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Headless Android
Headless AndroidHeadless Android
Headless Android
 
Kick my mouse away
Kick my mouse awayKick my mouse away
Kick my mouse away
 
How to Use OpenMP on Native Activity
How to Use OpenMP on Native ActivityHow to Use OpenMP on Native Activity
How to Use OpenMP on Native Activity
 
Unmanned Aerial Vehicles: Exploit Automation with the Metasploit Framework
Unmanned Aerial Vehicles: Exploit Automation with the Metasploit FrameworkUnmanned Aerial Vehicles: Exploit Automation with the Metasploit Framework
Unmanned Aerial Vehicles: Exploit Automation with the Metasploit Framework
 
Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...
Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...
Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...
 

Mais de Fred Heath

Mais de Fred Heath (7)

Agile software requirements management with Impact Mapping and BDD
Agile software requirements management with Impact Mapping and BDDAgile software requirements management with Impact Mapping and BDD
Agile software requirements management with Impact Mapping and BDD
 
USP Estimation - SwanseaCon 2016
USP Estimation - SwanseaCon 2016USP Estimation - SwanseaCon 2016
USP Estimation - SwanseaCon 2016
 
Introduction to Nim
Introduction to NimIntroduction to Nim
Introduction to Nim
 
Port80: the uncertainty principle
Port80: the uncertainty principlePort80: the uncertainty principle
Port80: the uncertainty principle
 
Agile diff usp
Agile diff uspAgile diff usp
Agile diff usp
 
Design Patterns the Ruby way - ConFoo 2015
Design Patterns the Ruby way - ConFoo 2015Design Patterns the Ruby way - ConFoo 2015
Design Patterns the Ruby way - ConFoo 2015
 
User Story Point estimation method at ConFoo 2015
User Story Point estimation method at ConFoo 2015User Story Point estimation method at ConFoo 2015
User Story Point estimation method at ConFoo 2015
 

Último

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Último (20)

The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 

Nim programming language - DevFest Berlin 2019