Skip to content
Code for my Becoming a Polyglot talk
JavaScript HTML PHP Ruby Python Perl Other
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


Code for my Becoming a Polyglot talk

Slides are available at:

Many people understand the very basics of several languages, all the way to Hello World. However, this isn’t a full fledged application and it’s challenging to make the translations in your head between all the different dialects (interpreted languages aren’t really different from each other like different languages – they work very much the same and the only difference is in the structure of the language). Out in our community are many people who firmly believe that moving from Ruby to Perl is not possible, that it’s very difficult to learn a new language, that it makes no sense to try to understand what “foreign” code might be doing.

In this repository are examples in several languages of a basic API in a common framework for that language. They all use the same mongodb backend, and all use the same single page HTML application.

All of them run at http://{server}:8080

The following paths work in each environment:

  • /api/quotes => quote list
  • /api/quotes/random => random quote
  • / => hello world from the framework
  • /demo => Single page HTML application


You will need to have mongodb installed and running. Installation info for the major platforms is at

To insert the information from the quoteid.json file to get your DB started, use the following command:

mongoimport --collection quotes --file data/quoteid.json --type json --jsonArray


cd python; pip install --user -r requirements.txt; python


cd node; npm install; node express-server.js cd node; npm install; node hapi-server.js


cd ruby; gem install bundler; bundle install; ruby sinatra-server.rb


sudo cpan -i -f Dancer Dancer::Plugin::CRUD JSON MongoDB; perl


$ php composer.phar install 

$ pecl install mongo
$ php -i | grep ini - add to this file, or create it
$ php -S -t ./public/ ./public/index.php

Docker setup

You can skip all of the setup instructions above and use the docker container if you like. First, install docker from


  • Start the docker shortcut utility
  • docker run -i -t -p 8080:8080 synedra/polyglot
  • /etc/init.d/mongodb start
  • mongoimport --collection quotes --file data/quoteid.json --type json --jsonArray
  • run the startup command for whichever language you like
  • cd python; python
  • cd perl; perl
  • cd ruby; ruby
  • cd node; node
  • cd php; php -S -t ./public/ ./public/index.php
  • The server will be running on http://localhost:8080
  • Check http://localhost:8080 to see the welcome message
  • Check http://localhost:8080/api/quotes to see the JSON API response
  • Check http://localhost:8080/demo to see the front page application. Use the chrome developer tools to watch the traffic on the backend and play with the frontend
You can’t perform that action at this time.