44
Polyglot Programmer Porto Linux João Cerdeira

Polyglot Programmer

Embed Size (px)

Citation preview

Page 1: Polyglot Programmer

Polyglot Programmer

Porto Linux

João Cerdeira

Page 2: Polyglot Programmer

Who Am I

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

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

Page 3: Polyglot Programmer

Agenda

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

➢ Conclusion

Page 4: Polyglot Programmer

Introduction

Page 5: Polyglot Programmer

Polyglot

Many Languages

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

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

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

“‘'tongue, language'’”)

Page 6: Polyglot Programmer

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

Page 7: Polyglot Programmer

Golden Hammer

Page 8: Polyglot Programmer

Golden Hammer

Same tool, product or technique to solve every problems

Page 9: Polyglot Programmer

Today Golden Hammers

Page 10: Polyglot Programmer

TODAY

Page 11: Polyglot Programmer

You've Done It In The Past

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

Linux Systems are traditionally Polyglot

Page 12: Polyglot Programmer

You're Already doing it

SQL

JavaScript

HTML / CSS

WebDevelopment

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

Page 13: Polyglot Programmer

Drivers

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

Page 14: Polyglot Programmer

Drivers

SQL Relational Data Management

JavaScript Web 2.0

HTML / CSS Web 1.0

XMLData Interchange App Configuration

Page 15: Polyglot Programmer

Today

Why aren't today's applications more Polyglot ?

Is there a solution out there ?

Page 16: Polyglot Programmer

SOLUTION

Page 17: Polyglot Programmer

Solution Needs to Ensure

We need to ensure and ease the transition

➢ Framework Available➢ Ready for Enterprise

Page 18: Polyglot Programmer

Solution

Do we have a platform to do polyglot ?

Page 19: Polyglot Programmer

Solution

Do we have a platform to do polyglot ?

Yes the JVM

Page 20: Polyglot Programmer

Java

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

Page 21: Polyglot Programmer

But

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

Page 22: Polyglot Programmer

But ...

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

Page 23: Polyglot Programmer

However

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

Page 24: Polyglot Programmer

FUTURE

Page 25: Polyglot Programmer

New Drivers

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

Page 26: Polyglot Programmer

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

Page 27: Polyglot Programmer

What are the big players

Page 28: Polyglot Programmer

Who's The Best

● Which of these is the best?

Page 29: Polyglot Programmer

Who's The Best

● Which of these is the best?

Page 30: Polyglot Programmer

Depend

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

Page 31: Polyglot Programmer

Some Considerations

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

Page 32: Polyglot Programmer

Some Considerations

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

➢Scala➢ Actors

➢Clojure➢ Functional Programming➢ STM

Page 33: Polyglot Programmer

EXAMPLE

Page 34: Polyglot Programmer

Drupal

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

PHP and JVM !?

Page 35: Polyglot Programmer

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

Page 36: Polyglot Programmer

DEMO

Page 37: Polyglot Programmer

Very Very Small Twitter

Objective

Implement a twitter with a 'lot' of diferente languages

Page 38: Polyglot Programmer

Java

API(java)

Java ImplWEB(Spring MVC)

Page 39: Polyglot Programmer

Groovy

API(java)

Groovy ImplWEB(Spring MVC)

Page 40: Polyglot Programmer

Scala

API(java)

Scala ImplWEB(Spring MVC)

Page 41: Polyglot Programmer

Conclusion

Page 42: Polyglot Programmer

Conclusion

➢Use the best language for the job

➢Use all the old good frameworks with new languages

➢Painless transition

Page 43: Polyglot Programmer

Q&A

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

Page 44: Polyglot Programmer