SlideShare a Scribd company logo
Introduction to JVM Languages
and Fantom
@jph98
Welcom
e...
What I’ll Cover
JVM languages and a brief history
Where Fantom fits into the JVM language
landscape
Characteristics of the Fantom and a few
examples
JVM Languages
Java
Source Code
JIT Compiler
x86 Native Code
JIT Compiler
x86_64 Native Code
Bytecode
Compiler Compiler
Fantom
Source Code
JVM JVM
Why do we need JVM languages?
More expressive, dynamic, functional
Reduce amount of “boiler plate” code
A way of modernising and pushing the
language forward
Da Vinci Machine Project
Project to extend the JVM for supporting other
languages:
- Tail call optimisation
- Interface injection
- Dynamic invocation
- Continuations
Language Categories
General purpose languages focusing on a
specific paradigm
Languages translated from other languages
Paradigm specific or multi paradigm languages
Quiz
Anybody care to guess how many JVM
languages there are?
2007
Clojure
JVM Language History
1997
Jython/JPython
1998
Bluedragon/CFML
2000
Beanshell
2001
JRuby
Processing
Judoscript
2003
Groovy
Gosu
Scala
2008
Ioke
2011
Kotlin
Ceylon
Xtend
General Purpose Languages
Functional Languages (e.g. Frege)
Dynamically Typed Languages (e.g. JRuby)
Multi Paradigm Languages (e.g. Scala)
Languages Translated to the JVM
Ada
JGNAT
Go JGo
Lisp
CLforJava
JS
Nashorn
Pascal Free
Prolog JLog
Python Jython
R
Renjin
REXX Netrexx
Ruby JRuby
Scheme Bigloo
Tcl Jacl
Specific Purpose Languages
Parallel Programming
- Ateji (Commercial)
- Chapel (Developed by Cray)
- X10 (Developed by IBM)
Visualisation and animation
- Processing
CLR Languages (CLI)
.NET CLR also has a number of languages:
Boo (Python esque) P# (Prolog)
IKVM (Java)
Phalanger (PHP)
IronRuby
IronPython
Introduction to JVM languages and Fantom (very brief)
Overview
Originally called Fan, created by Brian Frank
and Andy Frank
Academic Free License
I’m covering this as an alternative to the
standard Scala, Clojure yada yada...
Intent
Provide a language that compiles to:
- JVM (Java) - JavaFFI
- CLR (.NET) - DotnetFFI
- Browser (Javascript) -
Produces fcode (intermediate CLR/JVM/JSVM)
code
Ecosystem Overview
Focus on providing elegant API’s
Provides a REPL
Modules in the form of Pods
Desktop (FWT) and web (Webmod)
Characteristics
Object Oriented, Functional
Static and Dynamic Typing (Choice of)
64 bit Float, Int, Decimal + Str, Bool
Duration, Uri, Slot, Range, List, Map
Fantom Language Features
Classes
Public and abstract
Can also be Final, Const or Internal
Example...
Mixins
Like interfaces, but with method
implementations. Public defender methods.
Can group a number of slots together for reuse
Can’t contain state, you need to provide own
Mixing Static and Dynamic
person.addAddress(“New Bond House”);
person->addAddress(“New Bond House”);
Reducing Boilerplate Code
Concise in places, optional setters/getters
Null safe fields, elvis operator
Accessors, optional sets/gets
Accessors: class Person {
Str name
Int age
}
Null Check Operators (Elvis)
name ?: “No name specified”
Variables can also be marked nullable or non-nullable
Closures
Closure can be thought of as a function that
can be stored in a variable
Can access variables in same scope as defined
Useful for event handling
Closure Examples
10.times |i| {
echo(i)
}
10.times {
echo(it)
}
Closure Examples
Str first := “Bart”
Str last := “Simpson”
f := |->Str| { return first + “ “ + last }
Actor Concurrency System
Works around a message passing model
Actor is responsible for specific tasks
Lets take a look at a counter example...
Concurrency with Actors
pool := ActorPool()
["one", "two", "three", "four"].each {
a := Actor(pool) |Str name| {
echo("Thread $name says Hello World!")
}
a.send(it)
}
FFI - Foreign Function Interface
JavaFFI - Java type system into Fantom
DotnetFFI - not available yet
Use native classes to provide functionality
DSL’s - Domain Specific Languages
StrDSL
RegexDSL
Can write your own using the DslPlugin
Conclusions
Impressive set of features for the language
Some useful constructs to avoid boilerplate
code
Main focus in Java and JS. Looking for .NET
contributors for the DotNetFFI.
Conclusions
There’s a lot more to cover here in terms of
learning…
Where are the JVM languages going?
Java 8, Java 9… inclusions...
Questions?
http://wiki.colar.net/fan_cheat_sheet

More Related Content

PDF
Pharo Smalltalk as Universal Development Platform
PDF
Programming paradigms c1
PDF
New c sharp4_features_part_ii
PDF
Java vs. C/C++
PDF
PL Lecture 02 - Binding and Scope
PPTX
Presentation on C++ programming
ODP
Python Compiler Internals Presentation Slides
PDF
PL Lecture 01 - preliminaries
Pharo Smalltalk as Universal Development Platform
Programming paradigms c1
New c sharp4_features_part_ii
Java vs. C/C++
PL Lecture 02 - Binding and Scope
Presentation on C++ programming
Python Compiler Internals Presentation Slides
PL Lecture 01 - preliminaries

What's hot (20)

PDF
Scaling Language Specifications
PPTX
Ruby introduction part1
PPTX
polymorphism
PDF
DTS s03e04 Typing
PPT
Douglas Crockford Presentation Goodparts
PDF
How to Learn Java Programming
PPTX
Polymorphism Using C++
ODP
TDoc - Bringing Documentation to Tool
PPT
Fantom on the JVM Devoxx09 BOF
PPT
Difference between Java and c#
PDF
My 10 favorite haxe language features in 30 mins
PPTX
Turbo pascal
PPTX
Overview of c language
PPS
Master in javascript
PPT
C++ polymorphism
PPTX
Trans coder
PDF
Polymorphism
KEY
Thinking Like a Programmer
PDF
FregeDay: Design and Implementation of the language (Ingo Wechsung)
PPTX
Computers for kids
Scaling Language Specifications
Ruby introduction part1
polymorphism
DTS s03e04 Typing
Douglas Crockford Presentation Goodparts
How to Learn Java Programming
Polymorphism Using C++
TDoc - Bringing Documentation to Tool
Fantom on the JVM Devoxx09 BOF
Difference between Java and c#
My 10 favorite haxe language features in 30 mins
Turbo pascal
Overview of c language
Master in javascript
C++ polymorphism
Trans coder
Polymorphism
Thinking Like a Programmer
FregeDay: Design and Implementation of the language (Ingo Wechsung)
Computers for kids
Ad

Similar to Introduction to JVM languages and Fantom (very brief) (20)

PPT
Groovy Update - JavaPolis 2007
PPT
Python222222222222222222222222222(2).ppt
PPT
javaeanjjisjejrehurfhjhjfeauojksfjdi.ppt
PDF
2017: Kotlin - now more than ever
PPTX
Tools for the Toolmakers
PPT
ParaSail
PPTX
What's coming to c# (Tel-Aviv, 2018)
PPT
Future Programming Language
PDF
A Survey of Concurrency Constructs
PPT
Software Internationalization Crash Course
PPT
CSharp_01_CLROverview_and Introductionc#
PDF
TI1220 Lecture 14: Domain-Specific Languages
PPT
name name2 n2.ppt
PPT
ppt2
PPT
name name2 n
PPT
ppt30
PPT
ppt18
PPT
Ruby for Perl Programmers
PPT
name name2 n2
PPT
name name2 n
Groovy Update - JavaPolis 2007
Python222222222222222222222222222(2).ppt
javaeanjjisjejrehurfhjhjfeauojksfjdi.ppt
2017: Kotlin - now more than ever
Tools for the Toolmakers
ParaSail
What's coming to c# (Tel-Aviv, 2018)
Future Programming Language
A Survey of Concurrency Constructs
Software Internationalization Crash Course
CSharp_01_CLROverview_and Introductionc#
TI1220 Lecture 14: Domain-Specific Languages
name name2 n2.ppt
ppt2
name name2 n
ppt30
ppt18
Ruby for Perl Programmers
name name2 n2
name name2 n
Ad

More from Jonathan Holloway (11)

PPTX
The Role of the Architect
PPTX
Spring boot - an introduction
PPTX
Jenkins CI presentation
PPTX
Mockito intro
PPTX
PPTX
SOLID principles
PPTX
Application design for the cloud using AWS
PPTX
Building data pipelines
PDF
Database migration with flyway
PDF
Lightweight web frameworks
PDF
Introduction to using MongoDB with Ruby
The Role of the Architect
Spring boot - an introduction
Jenkins CI presentation
Mockito intro
SOLID principles
Application design for the cloud using AWS
Building data pipelines
Database migration with flyway
Lightweight web frameworks
Introduction to using MongoDB with Ruby

Recently uploaded (20)

PDF
System and Network Administration Chapter 2
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
AI in Product Development-omnex systems
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
L1 - Introduction to python Backend.pptx
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Nekopoi APK 2025 free lastest update
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
history of c programming in notes for students .pptx
PDF
top salesforce developer skills in 2025.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
System and Network Administraation Chapter 3
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
CHAPTER 2 - PM Management and IT Context
System and Network Administration Chapter 2
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
AI in Product Development-omnex systems
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Wondershare Filmora 15 Crack With Activation Key [2025
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
L1 - Introduction to python Backend.pptx
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Nekopoi APK 2025 free lastest update
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
history of c programming in notes for students .pptx
top salesforce developer skills in 2025.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
System and Network Administraation Chapter 3
Upgrade and Innovation Strategies for SAP ERP Customers
How to Migrate SBCGlobal Email to Yahoo Easily
Which alternative to Crystal Reports is best for small or large businesses.pdf
Design an Analysis of Algorithms II-SECS-1021-03
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
CHAPTER 2 - PM Management and IT Context

Introduction to JVM languages and Fantom (very brief)