Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A simple plan

Chris Vannoy
September 14, 2016

A simple plan

Exploring various languages and framework to build a simple web API. Bonus: Intense pluggable for Indy's PLIBMTTBHGATY

Chris Vannoy

September 14, 2016

More Decks by Chris Vannoy

Other Decks in Technology


  1. The Reason I'm hosting a get-together in a few weeks*

    for folks to experiment with non-typical programming languages. I wanted to experiment as well. * - More on this later.
  2. The API GET /attendees - All the attendees POST /attendees

    - Create an attendee GET /attendee/:id - Get a single attendee GET /languages - Get all the languages GET /languages/:lang - All the attendees interested
  3. The options » Crystal & Kemal » Rust & Iron

    » Swift & Vapor » A few other attempts in Elixir, Haskell ... but let's not talk about those
  4. Crystal It's like compiled, statically-typed Ruby. With type- inference. Most

    Ruby exercism solutions can move over with just a few tweaks. Love. puts "Hello World!"
  5. Kemal Sinatra, but in Crystal. require "kemal" get "/" do

    "Hello World!" end This might become a theme.
  6. Downfall » This thing is young and everything is in

    a perpetual state of semi-broken right now. » As a Rubyist, writing it really isn't a stretch at all. » Did I mention everything is kinda broken?
  7. Rust A systems programming language sponsored by Mozilla. Also statically-typed

    and compiled with type- inference. fn main() { println!("Hello World!"); }
  8. Iron Um. Kinda Sinatra in Rust. extern crate iron; use

    iron::prelude::*; use iron::status; fn main() { fn hello_world(_: &mut Request) -> IronResult<Response> { Ok(Response::with((status::Ok, "Hello World!"))) } let _server = Iron::new(hello_world).http("localhost:3000").unwrap(); println!("On 3000"); }
  9. Downfall » Docs. Ugh. Docs, man. » Big, big jump

    to persistence ... because, docs. » unwrap() literally everywhere.
  10. Vapor A web framework for running Swift on the server

    - including Linux servers. And Heroku! import Vapor import HTTP let drop = Droplet() drop.get("hello") { request in return "Hello, world!" } let port = drop.config["app", "port"]?.int ?? 80 drop.serve()
  11. Bonuses » Better docs than most. » Built-in ORM -

    with relationships! » Built-in deployment pipeline to Heroku » Type-safe routing(!)
  12. Downsides » Moving target » vapor new includes a lot

    of garbage » MySQL only at the moment (unless you roll your own)
  13. To

  14. Try

  15. But

  16. To