SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
The Crystal language
*recently* updates
@karupanerura
Ruby Kaigi 2016 LT
How about me
• @karupanerura (Twitter/Github/etc..)
• Perl/Python/Go/Crystal/Swift/ES2016/etc..
• Maintener of mRuby.pm (mruby Perl binding)
• Director of Japan Perl Association
• Of cause, I like Perl and Ruby also :)
Well..
This talk’s topic is
the Crystal language
Do you know about
the Crystal language?
The Crystal language is …
• Ruby like syntax and APIs
• static typing & union type & type inference
• nil safe
• self hosting compiler (using llvm)
• SEE ALSO: https://crystal-lang.org/
It works
# A very basic HTTP server
require "http/server"
server = HTTP::Server.new(8080) do |context|
context.response.content_type = "text/plain"
context.response.print "Hello world"
end
puts "Listening on http://0.0.0.0:8080"
server.listen
# Copied from: https://crystal-lang.org/
It works
# A very basic HTTP server
require "http/server"
server = HTTP::Server.new(8080) do |context|
context.response.content_type = "text/plain"
context.response.print "Hello world"
end
puts "Listening on http://0.0.0.0:8080"
server.listen
# Copied from: https://crystal-lang.org/
Load module (at compile time)
It works
# A very basic HTTP server
require "http/server"
server = HTTP::Server.new(8080) do |context|
context.response.content_type = "text/plain"
context.response.print "Hello world"
end
puts "Listening on http://0.0.0.0:8080"
server.listen
# Copied from: https://crystal-lang.org/
type inference as HTTP::Server
It works
# A very basic HTTP server
require "http/server"
server = HTTP::Server.new(8080) do |context|
context.response.content_type = "text/plain"
context.response.print "Hello world"
end
puts "Listening on http://0.0.0.0:8080"
server.listen
# Copied from: https://crystal-lang.org/
type inference as HTTP::Server::Context
It works
# A very basic HTTP server
require "http/server"
server = HTTP::Server.new(8080) do |context|
context.response.content_type = "text/plain"
context.response.print "Hello world"
end
puts "Listening on http://0.0.0.0:8080"
server.listen
# Copied from: https://crystal-lang.org/
yield code block
type inference in arguments
# https://github.com/crystal-lang/
crystal/blob/master/src/io.cr#L262
module IO
def <<(obj) : self
obj.to_s self
self
end
end
type inference in arguments
# https://github.com/crystal-lang/
crystal/blob/master/src/io.cr#L262
module IO
def <<(obj) : self
obj.to_s self
self
end
end
type inference as Class having #to_s
(using union type: String|Integer|etc..)
language updates
YOU SHOULD READ IT
https://github.com/crystal-
lang/crystal/blob/master/
CHANGELOG.md
It’s kidding :p
but, you can do that :)
Release dates
• 0.19.0 (2016-09-02)
• 0.18.0 (2016-06-14)
• 0.17.0 (2016-05-17)
• 0.16.0 (2016-05-05)
• 0.15.0 (2016-03-31)
• 0.14.0 (2016-03-21)
• 0.13.0 (2016-03-07)
• 0.12.0 (2016-02-16)
• 0.11.0 (2016-01-23)
• 0.10.0 (2015-12-23)
• 0.9.0 (2015-10-16)
• 0.8.0 (2015-09-19)
Release times
• 0.19.0 (2016-09-02)
• 0.18.0 (2016-06-14)
• 0.17.0 (2016-05-17)
• 0.16.0 (2016-05-05)
• 0.15.0 (2016-03-31)
• 0.14.0 (2016-03-21)
• 0.13.0 (2016-03-07)
• 0.12.0 (2016-02-16)
• 0.11.0 (2016-01-23)
• 0.10.0 (2015-12-23)
• 0.9.0 (2015-10-16)
• 0.8.0 (2015-09-19)
12 minor version up releases in a year
Summary of changes in a year
• 12 minor version up releases
• 72 breaking changes
• 200+ methods/macros are added
• Some methods/macros are removed/renamed
• Many bug fixes and some micro-optimizations
(My) Featured new features
`crystal play` sub-command
`crystal tool format`
sub-command
✨✨✨✨✨✨✨✨✨
✨✨✨✨✨✨✨✨✨
✨✨✨✨✨✨✨✨✨
✨✨✨✨✨✨✨✨✨
✨✨✨✨✨✨✨✨✨
$global variable is removed
👍👍👍👍👍👍👍👍👍👍
👍👍👍👍👍👍👍👍👍👍
👍👍👍👍👍👍👍👍👍👍
👍👍👍👍👍👍👍👍👍👍
👍👍👍👍👍👍👍👍👍👍
👍👍👍👍👍👍👍👍👍👍
Int#to_s(Int)
255.to_s(2) # => "11111111"
255.to_s(8) # => "377"
255.to_s(10) # => "255"
255.to_s(16) # => "ff"
Updated syntax (before)
class Foo
getter foo :: Int32
getter bar :: String
def initialize(@foo, @bar)
end
end
pp Foo.new(1, "matz")
Updated syntax (after)
class Foo
getter foo : Int32
getter bar : String
def initialize(@foo, @bar)
end
end
pp Foo.new(1, "matz")
and more…
Conclusion
Conclusion
• Crystal is still improved
• updating the syntaxes/APIs
• self hosting compiler is stable (I think)
• Join to Crystal JP (Crystal UG in Japan)
• http://crystal.connpass.org/
Let’s enjoy Crystal!
Thank you
🍺🍣🍶

Contenu connexe

Tendances

What's node.js all about
What's node.js all aboutWhat's node.js all about
What's node.js all about
niallo
 
Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smell
olegshpynov
 
Cassandra: Not Just NoSQL, It's MoSQL
Cassandra: Not Just NoSQL, It's MoSQLCassandra: Not Just NoSQL, It's MoSQL
Cassandra: Not Just NoSQL, It's MoSQL
Eric Evans
 

Tendances (20)

What's node.js all about
What's node.js all aboutWhat's node.js all about
What's node.js all about
 
Ruby hellug
Ruby hellugRuby hellug
Ruby hellug
 
Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smell
 
Children of Ruby
Children of RubyChildren of Ruby
Children of Ruby
 
rubyonrails
rubyonrailsrubyonrails
rubyonrails
 
Crystal - Statically Typed Ruby
Crystal - Statically Typed RubyCrystal - Statically Typed Ruby
Crystal - Statically Typed Ruby
 
Node.js Patterns and Opinions
Node.js Patterns and OpinionsNode.js Patterns and Opinions
Node.js Patterns and Opinions
 
The Ruby Racer: under the hood
The Ruby Racer: under the hoodThe Ruby Racer: under the hood
The Ruby Racer: under the hood
 
Medepia ABAP JSON Library ZCL_MDP_JSON
Medepia ABAP JSON Library ZCL_MDP_JSONMedepia ABAP JSON Library ZCL_MDP_JSON
Medepia ABAP JSON Library ZCL_MDP_JSON
 
RingoJS: Server-Side Javascript When Only Java Will Do
RingoJS:  Server-Side Javascript When Only Java Will DoRingoJS:  Server-Side Javascript When Only Java Will Do
RingoJS: Server-Side Javascript When Only Java Will Do
 
Dmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesDmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script Technologies
 
Intoduction to React
Intoduction to ReactIntoduction to React
Intoduction to React
 
Cassandra: Not Just NoSQL, It's MoSQL
Cassandra: Not Just NoSQL, It's MoSQLCassandra: Not Just NoSQL, It's MoSQL
Cassandra: Not Just NoSQL, It's MoSQL
 
Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?
 
5 Ways to Build Better Web APIs with Ruby and Rails
5 Ways to Build Better Web APIs with Ruby and Rails5 Ways to Build Better Web APIs with Ruby and Rails
5 Ways to Build Better Web APIs with Ruby and Rails
 
Why and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.jsWhy and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.js
 
Perl On The JVM (London.pm Talk 2009-04)
Perl On The JVM (London.pm Talk 2009-04)Perl On The JVM (London.pm Talk 2009-04)
Perl On The JVM (London.pm Talk 2009-04)
 
Next generation frontend tooling
Next generation frontend toolingNext generation frontend tooling
Next generation frontend tooling
 
When Javascript isn't Javascript
When Javascript isn't Javascript When Javascript isn't Javascript
When Javascript isn't Javascript
 
Java Closures
Java ClosuresJava Closures
Java Closures
 

En vedette (7)

DateTimeX::Moment
DateTimeX::MomentDateTimeX::Moment
DateTimeX::Moment
 
Aniki::Internal
Aniki::InternalAniki::Internal
Aniki::Internal
 
The plan of Aniki 2.0
The plan of Aniki 2.0The plan of Aniki 2.0
The plan of Aniki 2.0
 
router-simple.cr
router-simple.crrouter-simple.cr
router-simple.cr
 
TIme::Moment+Time::Strptime=
TIme::Moment+Time::Strptime=TIme::Moment+Time::Strptime=
TIme::Moment+Time::Strptime=
 
Aniki has come
Aniki has comeAniki has come
Aniki has come
 
Optimize perl5 code for perfomance freaks
Optimize perl5 code for perfomance freaksOptimize perl5 code for perfomance freaks
Optimize perl5 code for perfomance freaks
 

Similaire à The Crystal language *recently* update

plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
Nobuo Danjou
 

Similaire à The Crystal language *recently* update (20)

萬國之津梁
萬國之津梁萬國之津梁
萬國之津梁
 
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHow to Begin to Develop Ruby Core
How to Begin to Develop Ruby Core
 
JavaScript Language Update 2016 (LLoT)
JavaScript Language Update 2016 (LLoT)JavaScript Language Update 2016 (LLoT)
JavaScript Language Update 2016 (LLoT)
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
 
Why I will never write JavaScript ever again*
Why I will never write JavaScript ever again*Why I will never write JavaScript ever again*
Why I will never write JavaScript ever again*
 
How to Write the Fastest JSON Parser/Writer in the World
How to Write the Fastest JSON Parser/Writer in the WorldHow to Write the Fastest JSON Parser/Writer in the World
How to Write the Fastest JSON Parser/Writer in the World
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming World
 
Ruby 4.0 To Infinity and Beyond at Ruby Conference Kenya 2017 by Bozhidar Batsov
Ruby 4.0 To Infinity and Beyond at Ruby Conference Kenya 2017 by Bozhidar BatsovRuby 4.0 To Infinity and Beyond at Ruby Conference Kenya 2017 by Bozhidar Batsov
Ruby 4.0 To Infinity and Beyond at Ruby Conference Kenya 2017 by Bozhidar Batsov
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
Upgrading JavaScript to ES6 and using TypeScript as a shortcut
Upgrading JavaScript to ES6 and using TypeScript as a shortcutUpgrading JavaScript to ES6 and using TypeScript as a shortcut
Upgrading JavaScript to ES6 and using TypeScript as a shortcut
 
TechDays - IronRuby
TechDays - IronRubyTechDays - IronRuby
TechDays - IronRuby
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)
 
Of Owls and IO Objects
Of Owls and IO ObjectsOf Owls and IO Objects
Of Owls and IO Objects
 
Angular2
Angular2Angular2
Angular2
 
Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...
Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...
Web development with Lua: Introducing Sailor an MVC web framework @ CodingSer...
 
The Future of Node - @rvagg - NodeConf Christchurch 2015
The Future of Node - @rvagg - NodeConf Christchurch 2015The Future of Node - @rvagg - NodeConf Christchurch 2015
The Future of Node - @rvagg - NodeConf Christchurch 2015
 
Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.
 

Plus de karupanerura

モジュール開発におけるぼくの試行錯誤
モジュール開発におけるぼくの試行錯誤モジュール開発におけるぼくの試行錯誤
モジュール開発におけるぼくの試行錯誤
karupanerura
 
mysqlcasual6-next-key-lock
mysqlcasual6-next-key-lockmysqlcasual6-next-key-lock
mysqlcasual6-next-key-lock
karupanerura
 
若手Itエンジニア飲み会-LT
若手Itエンジニア飲み会-LT若手Itエンジニア飲み会-LT
若手Itエンジニア飲み会-LT
karupanerura
 
Yapc asia-2012-lt-thon
Yapc asia-2012-lt-thonYapc asia-2012-lt-thon
Yapc asia-2012-lt-thon
karupanerura
 

Plus de karupanerura (20)

Perl5 VS JSON
Perl5 VS JSONPerl5 VS JSON
Perl5 VS JSON
 
コンテキストと仲良く
コンテキストと仲良くコンテキストと仲良く
コンテキストと仲良く
 
KOWAZA for mackerel
KOWAZA for mackerelKOWAZA for mackerel
KOWAZA for mackerel
 
Technology for reduce of mistakes - うっかりをなくす技術
Technology for reduce of mistakes - うっかりをなくす技術Technology for reduce of mistakes - うっかりをなくす技術
Technology for reduce of mistakes - うっかりをなくす技術
 
Why we use mruby with Perl5?
Why we use mruby with Perl5?Why we use mruby with Perl5?
Why we use mruby with Perl5?
 
はかたの塩
はかたの塩はかたの塩
はかたの塩
 
Gotanda.pmの紹介
Gotanda.pmの紹介Gotanda.pmの紹介
Gotanda.pmの紹介
 
すいすいSwift
すいすいSwiftすいすいSwift
すいすいSwift
 
Perlにおけるclass実装パターン
Perlにおけるclass実装パターンPerlにおけるclass実装パターン
Perlにおけるclass実装パターン
 
モジュール開発におけるぼくの試行錯誤
モジュール開発におけるぼくの試行錯誤モジュール開発におけるぼくの試行錯誤
モジュール開発におけるぼくの試行錯誤
 
Aniki - The ORM as our great brother.
Aniki - The ORM as our great brother.Aniki - The ORM as our great brother.
Aniki - The ORM as our great brother.
 
Perl5 meta programming
Perl5 meta programmingPerl5 meta programming
Perl5 meta programming
 
mysqlcasual6-next-key-lock
mysqlcasual6-next-key-lockmysqlcasual6-next-key-lock
mysqlcasual6-next-key-lock
 
dwangocpp1-lt
dwangocpp1-ltdwangocpp1-lt
dwangocpp1-lt
 
engineer-life
engineer-lifeengineer-life
engineer-life
 
若手Itエンジニア飲み会-LT
若手Itエンジニア飲み会-LT若手Itエンジニア飲み会-LT
若手Itエンジニア飲み会-LT
 
Hachioji.pm #40
Hachioji.pm #40Hachioji.pm #40
Hachioji.pm #40
 
Hachioji.pm #39
Hachioji.pm #39Hachioji.pm #39
Hachioji.pm #39
 
perl5の日付時刻処理とか
perl5の日付時刻処理とかperl5の日付時刻処理とか
perl5の日付時刻処理とか
 
Yapc asia-2012-lt-thon
Yapc asia-2012-lt-thonYapc asia-2012-lt-thon
Yapc asia-2012-lt-thon
 

Dernier

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 

Dernier (20)

Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 

The Crystal language *recently* update

  • 1. The Crystal language *recently* updates @karupanerura Ruby Kaigi 2016 LT
  • 2. How about me • @karupanerura (Twitter/Github/etc..) • Perl/Python/Go/Crystal/Swift/ES2016/etc.. • Maintener of mRuby.pm (mruby Perl binding) • Director of Japan Perl Association • Of cause, I like Perl and Ruby also :)
  • 3.
  • 5. This talk’s topic is the Crystal language
  • 6. Do you know about the Crystal language?
  • 7. The Crystal language is … • Ruby like syntax and APIs • static typing & union type & type inference • nil safe • self hosting compiler (using llvm) • SEE ALSO: https://crystal-lang.org/
  • 8. It works # A very basic HTTP server require "http/server" server = HTTP::Server.new(8080) do |context| context.response.content_type = "text/plain" context.response.print "Hello world" end puts "Listening on http://0.0.0.0:8080" server.listen # Copied from: https://crystal-lang.org/
  • 9. It works # A very basic HTTP server require "http/server" server = HTTP::Server.new(8080) do |context| context.response.content_type = "text/plain" context.response.print "Hello world" end puts "Listening on http://0.0.0.0:8080" server.listen # Copied from: https://crystal-lang.org/ Load module (at compile time)
  • 10. It works # A very basic HTTP server require "http/server" server = HTTP::Server.new(8080) do |context| context.response.content_type = "text/plain" context.response.print "Hello world" end puts "Listening on http://0.0.0.0:8080" server.listen # Copied from: https://crystal-lang.org/ type inference as HTTP::Server
  • 11. It works # A very basic HTTP server require "http/server" server = HTTP::Server.new(8080) do |context| context.response.content_type = "text/plain" context.response.print "Hello world" end puts "Listening on http://0.0.0.0:8080" server.listen # Copied from: https://crystal-lang.org/ type inference as HTTP::Server::Context
  • 12. It works # A very basic HTTP server require "http/server" server = HTTP::Server.new(8080) do |context| context.response.content_type = "text/plain" context.response.print "Hello world" end puts "Listening on http://0.0.0.0:8080" server.listen # Copied from: https://crystal-lang.org/ yield code block
  • 13. type inference in arguments # https://github.com/crystal-lang/ crystal/blob/master/src/io.cr#L262 module IO def <<(obj) : self obj.to_s self self end end
  • 14. type inference in arguments # https://github.com/crystal-lang/ crystal/blob/master/src/io.cr#L262 module IO def <<(obj) : self obj.to_s self self end end type inference as Class having #to_s (using union type: String|Integer|etc..)
  • 16. YOU SHOULD READ IT https://github.com/crystal- lang/crystal/blob/master/ CHANGELOG.md
  • 17. It’s kidding :p but, you can do that :)
  • 18. Release dates • 0.19.0 (2016-09-02) • 0.18.0 (2016-06-14) • 0.17.0 (2016-05-17) • 0.16.0 (2016-05-05) • 0.15.0 (2016-03-31) • 0.14.0 (2016-03-21) • 0.13.0 (2016-03-07) • 0.12.0 (2016-02-16) • 0.11.0 (2016-01-23) • 0.10.0 (2015-12-23) • 0.9.0 (2015-10-16) • 0.8.0 (2015-09-19)
  • 19. Release times • 0.19.0 (2016-09-02) • 0.18.0 (2016-06-14) • 0.17.0 (2016-05-17) • 0.16.0 (2016-05-05) • 0.15.0 (2016-03-31) • 0.14.0 (2016-03-21) • 0.13.0 (2016-03-07) • 0.12.0 (2016-02-16) • 0.11.0 (2016-01-23) • 0.10.0 (2015-12-23) • 0.9.0 (2015-10-16) • 0.8.0 (2015-09-19) 12 minor version up releases in a year
  • 20. Summary of changes in a year • 12 minor version up releases • 72 breaking changes • 200+ methods/macros are added • Some methods/macros are removed/renamed • Many bug fixes and some micro-optimizations
  • 21. (My) Featured new features
  • 24. $global variable is removed 👍👍👍👍👍👍👍👍👍👍 👍👍👍👍👍👍👍👍👍👍 👍👍👍👍👍👍👍👍👍👍 👍👍👍👍👍👍👍👍👍👍 👍👍👍👍👍👍👍👍👍👍 👍👍👍👍👍👍👍👍👍👍
  • 25. Int#to_s(Int) 255.to_s(2) # => "11111111" 255.to_s(8) # => "377" 255.to_s(10) # => "255" 255.to_s(16) # => "ff"
  • 26. Updated syntax (before) class Foo getter foo :: Int32 getter bar :: String def initialize(@foo, @bar) end end pp Foo.new(1, "matz")
  • 27. Updated syntax (after) class Foo getter foo : Int32 getter bar : String def initialize(@foo, @bar) end end pp Foo.new(1, "matz")
  • 30. Conclusion • Crystal is still improved • updating the syntaxes/APIs • self hosting compiler is stable (I think) • Join to Crystal JP (Crystal UG in Japan) • http://crystal.connpass.org/