Busy Developer's Guide to Crystal

ted.neward@newardassociates.com | Blog: http://blogs.newardassociates.com | Github: tedneward | LinkedIn: tedneward

Objectives

What do we want to do today?

The Crystal Programming Language

... in a nutshell

The Crystal Programming Language

What is this?

The Crystal Programming Language

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

Getting Started with Crystal

From 0 to HelloWorld

Getting Started with Crystal

Installation

Getting Started with 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

Summary

So... now what?

Credentials

Who is this guy?