Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
FunScript 
F# to JavaScript with type providers 
What is FunScript?
FunScript 
F# to JavaScript with type providers 
FunScript is... 
yet another JavaScript compiler 
So why bother?
FunScript 
F# to JavaScript with type providers 
It seems as if every programming language 
in the world compiles now to J...
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 
Free as in beer! 
F# is a mature, open source, cross-platform, 
functiona...
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 tooltip...
FunScript 
F# to JavaScript with type providers 
F# compiler is your best friend 
It helps you write better code by pointi...
FunScript 
F# to JavaScript with type providers 
Usual functional stuff 
• First-class and higher-order functions 
• Immut...
FunScript 
F# to JavaScript with type providers 
Functional data structures 
• Tuples 
• Records 
• Discriminated Unions (...
FunScript 
F# to JavaScript with type providers 
.NET mutable collections 
• Array 
• ResizeArray (mutable List) 
• Dictio...
FunScript 
F# to JavaScript with type providers 
FunScript is compatible with many methods 
of most used .NET classes 
• R...
FunScript 
F# to JavaScript with type providers 
.NET Regular Expressions usage example
FunScript 
F# to JavaScript with type providers 
Click here for 
a wonderful talk 
F# unique features 
o Type providers! 
...
FunScript 
F# to JavaScript with type providers 
And with FunScript.HTML extensions 
you can create HTML 5 web apps 
using...
FunScript 
F# to JavaScript with type providers 
Functional Reactive Programming (1) 
Every element has 
an equivalent ext...
FunScript 
F# to JavaScript with type providers 
Functional Reactive Programming (2) 
Internal state
FunScript 
F# to JavaScript with type providers 
Functional Reactive Programming (and 3) 
DateTime 
String formatting 
The...
FunScript 
F# to JavaScript with type providers 
Asynchronous workflows (1) 
Share types with LINQ to SQL, Web API and cli...
FunScript 
F# to JavaScript with type providers 
Asynchronous workflows (2) 
Asynchronous workflows are also very good 
to...
FunScript 
F# to JavaScript with type providers 
Asynchronous workflows (and 3) 
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: 
o Minimize err...
FunScript 
F# to JavaScript with type providers 
This is great. But... 
There are wonderful JS libraries out there 
Do I h...
FunScript 
F# to JavaScript with type providers
FunScript 
F# to JavaScript with type providers 
FunScript.HTML also offers deeper 
integration with a great JavaScript 
M...
FunScript 
F# to JavaScript with type providers 
Encapsulate state Async for events 
and state updates
FunScript 
F# to JavaScript with type providers 
If necessary, you can extend FunScript 
yourself easily
FunScript 
F# to JavaScript with type providers 
To be fair, there is also another F# 
to JavaScript compiler out there: 
...
FunScript 
F# to JavaScript with type providers 
Oh, c’mon! 
FUNSCRIPT 
FEATURES 
Everything 
you just saw 
WEBSHARPER 
FE...
FunScript 
F# to JavaScript with type providers 
This is coming to an end 
SAYONARA 
BABY 
That’s what he said in the Span...
FunScript 
F# to JavaScript with type providers 
FunScript has been created by Zach Bray 
and several bright minds from th...
FunScript 
F# to JavaScript with type providers 
And this presentation has been 
assembled by yours truly, 
Alfonso García...
FunScript 
F# to JavaScript with type providers 
WHAT THE 
HELL ARE YOU 
WAITING FOR
Upcoming SlideShare
Loading in …5
×

FunScript: Why bother?

5,250 views

Published on

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.

Published in: Technology
  • Be the first to comment

FunScript: Why bother?

  1. 1. FunScript F# to JavaScript with type providers What is FunScript?
  2. 2. FunScript F# to JavaScript with type providers FunScript is... yet another JavaScript compiler So why bother?
  3. 3. 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 o Elm o LiveScript o PureScript o Fay So, why bother with FunScript? Reason #1...
  4. 4. FunScript F# to JavaScript with type providers THERE’S A F#er WITHIN YOU AND YOU KNOW IT
  5. 5. FunScript F# to JavaScript with type providers Free as in beer! F# is a mature, open source, cross-platform, functional-first programming language. but also multi-paradigm F# runs on Linux, Mac OS X, Android, iOS, Windows as well as HTML 5 and GPUs. And we all know when sth wants to conquerthe whole world is always a good thing But enough of sales pitch!
  6. 6. FunScript F# to JavaScript with type providers SHOW ME DA GOODIES
  7. 7. 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!
  8. 8. 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!
  9. 9. FunScript F# to JavaScript with type providers Usual functional stuff • First-class and higher-order functions • Immutability • Recursion • Pattern matching • Type inference Type safety without the hassle
  10. 10. FunScript F# to JavaScript with type providers Functional data structures • Tuples • Records • Discriminated Unions (Option built-in) • Classes and Modules • Functional collections o Recursive lists o Map o Set o seq Never type IEnumerable again!
  11. 11. FunScript F# to JavaScript with type providers .NET mutable collections • Array • ResizeArray (mutable List) • Dictionary They’ll compile as JS arrays and POJOs, so they’re compatible with browser code
  12. 12. FunScript F# to JavaScript with type providers FunScript is compatible with many methods of most used .NET classes • Regular Expressions • DateTime / TimeSpan • String Formatting • WebRequest Am I the only one with trouble to remember how to use Regex and Dates in each platform?
  13. 13. FunScript F# to JavaScript with type providers .NET Regular Expressions usage example
  14. 14. FunScript F# to JavaScript with type providers Click here for a wonderful talk F# unique features o Type providers! o Units of measure o Computation expressions
  15. 15. FunScript F# to JavaScript with type providers And with FunScript.HTML extensions you can create HTML 5 web apps using your F#/.NET skills Like...
  16. 16. FunScript F# to JavaScript with type providers Functional Reactive Programming (1) Every element has an equivalent extension property to generate an IObservable
  17. 17. FunScript F# to JavaScript with type providers Functional Reactive Programming (2) Internal state
  18. 18. FunScript F# to JavaScript with type providers Functional Reactive Programming (and 3) DateTime String formatting These extension methods can easily be implemented for other platforms
  19. 19. FunScript F# to JavaScript with type providers Asynchronous workflows (1) Share types with LINQ to SQL, Web API and client code LINQ, Web API and FunScript do the tedious marshaling work for you
  20. 20. FunScript F# to JavaScript with type providers Asynchronous workflows (2) Asynchronous workflows are also very good to handle events as you can use them to represent a state-machine Forget about “Inversion of Control” Take the program flow control back!
  21. 21. FunScript F# to JavaScript with type providers Asynchronous workflows (and 3) No flags needed!
  22. 22. FunScript F# to JavaScript with type providers Some people still like JS event handling though
  23. 23. FunScript F# to JavaScript with type providers So FunScript and FunScript.HTML extensions allow you to: o Minimize errors o Reuse code And most importantly... o Reuse your skills
  24. 24. FunScript F# to JavaScript with type providers This is great. But... There are wonderful JS libraries out there Do I have to renounce to use them? Nope! FunScript offers wrappers for all definitions in the TypeScript repository through NuGet
  25. 25. FunScript F# to JavaScript with type providers
  26. 26. FunScript F# to JavaScript with type providers FunScript.HTML also offers deeper integration with a great JavaScript MVC framework: Ractive.js Check its wonderful website to know more
  27. 27. FunScript F# to JavaScript with type providers Encapsulate state Async for events and state updates
  28. 28. FunScript F# to JavaScript with type providers If necessary, you can extend FunScript yourself easily
  29. 29. FunScript F# to JavaScript with type providers To be fair, there is also another F# to JavaScript compiler out there: WebSharper, a fantastic project by IntelliFactory Unlike FunScript, WebSharper is a full-fledged web framework A more detailed comparison follows.
  30. 30. FunScript F# to JavaScript with type providers Oh, c’mon! FUNSCRIPT FEATURES Everything you just saw WEBSHARPER FEATURES Sorry, I haven’t used it. Please visit their site and judge yourself
  31. 31. FunScript F# to JavaScript with type providers This is coming to an end SAYONARA BABY That’s what he said in the Spanish version
  32. 32. 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 ▪ Tomas Petricek ▪ Robert Pickering ▪ James Freiwirth Doesn’t it sound like a Marvel Hero name? ...more at funscript.info
  33. 33. FunScript F# to JavaScript with type providers And this presentation has been assembled by yours truly, Alfonso García-Caro @alfonsogcnunez github.com/alfonsogarciacaro So now... I’m also a collaborator now, but I’m more of a freeloader
  34. 34. FunScript F# to JavaScript with type providers WHAT THE HELL ARE YOU WAITING FOR

×