A simple plan

1f51c08169e8c7bb06016ec7907e9c17?s=47 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

1f51c08169e8c7bb06016ec7907e9c17?s=128

Chris Vannoy

September 14, 2016
Tweet

Transcript

  1. A Simple Plan Building a small web API in something

    new
  2. 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.
  3. 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
  4. The options » Crystal & Kemal » Rust & Iron

    » Swift & Vapor » A few other attempts in Elixir, Haskell ... but let's not talk about those
  5. 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!"
  6. Kemal Sinatra, but in Crystal. require "kemal" get "/" do

    "Hello World!" end This might become a theme.
  7. 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?
  8. Rust A systems programming language sponsored by Mozilla. Also statically-typed

    and compiled with type- inference. fn main() { println!("Hello World!"); }
  9. 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"); }
  10. Downfall » Docs. Ugh. Docs, man. » Big, big jump

    to persistence ... because, docs. » unwrap() literally everywhere.
  11. Swift Not just for phones! Compiled, type-inference ... but closures!

    print("Hello, world!")
  12. 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()
  13. Bonuses » Better docs than most. » Built-in ORM -

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

    of garbage » MySQL only at the moment (unless you roll your own)
  15. The Plug

  16. PLIBMTTBHGATY

  17. Programming

  18. Languages

  19. I've

  20. Been

  21. Meaning

  22. To

  23. Try

  24. But

  25. Haven't

  26. Gotten

  27. Around

  28. To

  29. Yet.

  30. September 24, 2016 The Iron Yard 475 East Market Street

    Lite Breakfast & Lunch provided
  31. <bit.ly/indy-gibberish>

  32. Thanks!