Polyglot Programmer

Preview:

Citation preview

Polyglot Programmer

Porto Linux

João Cerdeira

Who Am I

➢My Name: João Cerdeira➢Software Developer/Architect➢An Agile enthusiast:

➢ Scrum / Kanban / Lean➢ A true believer in OpenSource

Agenda

➢ Introduction➢ Today➢ Solution➢ Future➢ Example➢ DEMO (if there's enough time)

➢ Conclusion

Introduction

Polyglot

Many Languages

From Ancient Greek πολύγλωττος

(poluglōttos), “‘'many-tongued, polyglot'’”), from

πολύς (polus), “‘many’”) + γλῶττα (glōtta),

“‘'tongue, language'’”)

Polyglot Programming

We are entering a new era of software development. For most of our (short) history, we've primarily written code in a single language...the core language...will cease its monoculture... applications of the future will take advantage of the polyglot nature of the language...it's all about choosing the right tool for the job and leveraging it correctly...the times of writing an application in a single general purpose language is Over.

Excerpts from: Neal Ford, “Polyglot Programming”

http://memeagora.blogspot.com/2006/12/polyglot-programming.html

Golden Hammer

Golden Hammer

Same tool, product or technique to solve every problems

Today Golden Hammers

TODAY

You've Done It In The Past

● Shell/Bash Script● AWK● Perl● SED● etc ...

Linux Systems are traditionally Polyglot

You're Already doing it

SQL

JavaScript

HTML / CSS

WebDevelopment

Java / Ruby / ..XML (not a language)

Drivers

New languagues are driven by new business and/or technical demand

Drivers

SQL Relational Data Management

JavaScript Web 2.0

HTML / CSS Web 1.0

XMLData Interchange App Configuration

Today

Why aren't today's applications more Polyglot ?

Is there a solution out there ?

SOLUTION

Solution Needs to Ensure

We need to ensure and ease the transition

➢ Framework Available➢ Ready for Enterprise

Solution

Do we have a platform to do polyglot ?

Solution

Do we have a platform to do polyglot ?

Yes the JVM

Java

➢ Java appeared in 1995➢ It is based in C / C++➢ Networking and multithreading were included➢ Lots of frameworks and Aplications

But

➢ It's old➢ The old major feature was Generics in 2004➢ Version 7 was postponed to 2011 (again)

But ...

➢ Verbose compared to others➢ Threading is no longer enough➢ Very dificult to implement twitter without an IDE

However

The JVM is a great place to work however java could make it painful sometimes

FUTURE

New Drivers

➢ Concurrency/Multi-core Hardware➢ Framework Availability➢ Sintax sugar (do more with less)➢ Essence over Ceremony➢ Testing➢ etc

JVM

➢ more than 200 languages➢ many of these aren't exactly practical, but many are➢ at least 5 are ready to be used in production enviroment

What are the big players

Who's The Best

● Which of these is the best?

Who's The Best

● Which of these is the best?

Depend

Of what ?➢ personal preference➢ best tool for the job➢ best human resources➢ etc

Some Considerations

➢ All have java interoperability➢ Native syntax for collections ➢ Allmost everything is a object➢ Closures➢ Regular expressions

Some Considerations

➢ Groovy, Jruby and Jython➢ Dynamic ➢ Metaprogramming➢ Grails, RoR and Django

➢Scala➢ Actors

➢Clojure➢ Functional Programming➢ STM

EXAMPLE

Drupal

➢In 2007 someone tried to cluster Drupal➢Drupal is a PHP application➢The solution was encontered in JVM

PHP and JVM !?

PHP an JVM

➢Caucho's Quercos enables PHP to run in Tomcat/Resin➢EHCahe enables cache in JVM➢Terracotta enables cluster features➢How about putting drupal run in this eco system

Information : http://www.terracotta.org/confluence/display/wiki/Drupal

http://rifers.org/blogs/gbevin/2007/8/1/clustered_drupal_terracotta

DEMO

Very Very Small Twitter

Objective

Implement a twitter with a 'lot' of diferente languages

Java

API(java)

Java ImplWEB(Spring MVC)

Groovy

API(java)

Groovy ImplWEB(Spring MVC)

Scala

API(java)

Scala ImplWEB(Spring MVC)

Conclusion

Conclusion

➢Use the best language for the job

➢Use all the old good frameworks with new languages

➢Painless transition

Q&A

Twitter: http://twitter.com/jacerdeiraGit: https://github.com/jcerdeira/polyprog/tree/developSlideShare: http://www.slideshare.net/jcerdeira/