ted.neward@newardassociates.com | Blog: http://blogs.newardassociates.com | Github: tedneward | LinkedIn: tedneward
https://crystal-lang.org/
web playground: https://play.crystal-lang.org/#/cr
native compilation (via LLVM)
heavily Ruby-inspired syntax
statically type-checked, type-inferenced
non-nillable types (compile-time nil checks)
macro metaprogramming system
An HTTP server
require "http/server" server = HTTP::Server.new do |context| context.response.content_type = "text/plain" context.response.print "Hello world! The time is #{Time.local}" end address = server.bind_tcp 8080 puts "Listening on http://#{address}" server.listen
https://crystal-lang.org/install/
Online playground: https://play.crystal-lang.org/#/cr
Download: https://crystal-lang.org/install/from_targz
Package managers:
Homebrew/Linuxbrew: brew install crystal-lang
Ubuntu: curl -fsSL https://crystal-lang.org/install.sh | sudo bash
From sources: https://crystal-lang.org/install/from_sources/
self-hosting, so you need Crystal to build Crystal
Create a project
crystal init app hello
Hello, world: src/hello.cr
# TODO: Write documentation for `Hello` module Hello VERSION = "0.1.0" # TODO: Put your code here end
Run
crystal run src/hello.cr
Compile
crystal build src/hello.cr; ./hello
Architect, Engineering Manager/Leader, "force multiplier"
http://www.newardassociates.com
http://blogs.newardassociates.com
Sr Distinguished Engineer, Capital One
Educative (http://educative.io) Author
Performance Management for Engineering Managers
Books
Developer Relations Activity Patterns (w/Woodruff, et al; APress, forthcoming)
Professional F# 2.0 (w/Erickson, et al; Wrox, 2010)
Effective Enterprise Java (Addison-Wesley, 2004)
SSCLI Essentials (w/Stutz, et al; OReilly, 2003)
Server-Based Java Programming (Manning, 2000)