FunScript: Why bother?

alfonsogarciacaro7 7,497 views 34 slides Oct 01, 2014
Slide 1
Slide 1 of 34
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34

About This Presentation

FunScript is an F# to JavaScript compiler but, why bother with yet another *** to JS compiler? Give me five minutes and I'll try to convince you.


Slide Content

FunScript
F# to JavaScript with type providers

FunScript
F# to JavaScript with type providers

FunScript
F# to JavaScript with type providers
It seems as if every programming language
in the world compiles now to JavaScript

And many of them are functional





So, why bother with FunScript?
Reason #1...

FunScript
F# to JavaScript with type providers
THERE’S A F#er
WITHIN YOU
AND YOU KNOW IT

FunScript
F# to JavaScript with type providers
F# is a mature, open source, cross-platform,
functional-first programming language.


F# runs on Linux, Mac OS X, Android, iOS,
Windows as well as HTML 5 and GPUs.



But enough of sales pitch!
Free as in beer!
And we all know when sth wants to conquer
the whole world is always a good thing
but also multi-paradigm

FunScript
F# to JavaScript with type providers
SHOW ME DA GOODIES

FunScript
F# to JavaScript with type providers
Write F# client-side code in powerful IDEs
with autocomplete and tooltips
Intellisense is addictive!
No plugin required!

FunScript
F# to JavaScript with type providers
F# compiler is your best friend
It helps you write better code by pointing out your mistakes
If it were a human I would kill it
...but it’s not!

FunScript
F# to JavaScript with type providers
Usual functional stuff





Type safety
without the hassle

FunScript
F# to JavaScript with type providers
Functional data structures









Never type
IEnumerable
again!

FunScript
F# to JavaScript with type providers
.NET mutable collections



They’ll compile as JS arrays and POJOs,
so they’re compatible with browser code

FunScript
F# to JavaScript with type providers
FunScript is compatible with many methods
of most used .NET classes





Am I the only one with trouble
to remember how to use Regex
and Dates in each platform?

FunScript
F# to JavaScript with type providers
.NET Regular Expressions usage example

FunScript
F# to JavaScript with type providers
F# unique features



Click here for
a wonderful talk

FunScript
F# to JavaScript with type providers
FunScript.HTML extensions

FunScript
F# to JavaScript with type providers

Every element has
an equivalent extension
property to generate
an IObservable

FunScript
F# to JavaScript with type providers

Internal state

FunScript
F# to JavaScript with type providers

String formatting
DateTime
These extension methods
can easily be implemented
for other platforms

FunScript
F# to JavaScript with type providers


LINQ, Web API and
FunScript do the tedious
marshaling work for you

FunScript
F# to JavaScript with type providers






Forget about “Inversion of Control”
Take the program flow control back!

FunScript
F# to JavaScript with type providers

No flags needed!

FunScript
F# to JavaScript with type providers
Some people
still like
JS event
handling
though

FunScript
F# to JavaScript with type providers
So FunScript and FunScript.HTML
extensions allow you to:





And most importantly...

FunScript
F# to JavaScript with type providers


This is great. But...
Nope!

FunScript
F# to JavaScript with type providers

FunScript
F# to JavaScript with type providers



Ractive.js

FunScript
F# to JavaScript with type providers

FunScript
F# to JavaScript with type providers

FunScript
F# to JavaScript with type providers


, a fantastic project

W is a

FunScript
F# to JavaScript with type providers

FunScript
F# to JavaScript with type providers

SA
BABY
That’s what he said in the Spanish version

FunScript
F# to JavaScript with type providers
FunScript has been created by Zach Bray
and several bright minds from the
F# community have contributed to it



...more at funscript.info

FunScript
F# to JavaScript with type providers









I’m also a
collaborator
now, but I’m
more of a
freeloader

FunScript
F# to JavaScript with type providers