Your SlideShare is downloading. ×
0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
F#3.0
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

F#3.0

288

Published on

Apresentação de F# 3.0

Apresentação de F# 3.0

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
288
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • have linq, have create way to manipulate data, but how do you get the schema?
  • who here has used one of these apis?
  • show how cloud numerics solves a problem“how would you do numerical analysis on large quantities of data?”(be interactive)- connect to problems they are already working on- “show how sausage is made” : what were we thinking in design?- type providers are linq on steroids
  • Transcript

    • 1. F# Information RichProgrammingRodrigo VidalVisual F# MVP
    • 2. What’s in this talk?• Intro to F#• Language features for solving real-world problems• F# Type Provider demos• Future directions
    • 3. F# Tagline F# is a practical, functional-first language that lets you write simple code to solve complex problems
    • 4. Created By
    • 5. Motivation Ideas Product Research Reality
    • 6. #inceptionLambda LISP ML Ocaml HaskellCalculus F#
    • 7. F# 1.0 Functional + Objects + .NET F# 2.0 Functional + Objects + .NET +Async + Parallel + Interactive + Scripting
    • 8. 12 C#, VB, 10 Java LINQ F# Nirvana 8Usefulness 6 C# Nirvana 4 Haskell LINQ 2 Haskell 0 0 2 4 6 8 10 12 Safety http://channel9.msdn.com/posts/Charles/Simon-Peyton-Jones-Towards-a-Programming-Language-Nirvana/
    • 9. Immutability “Values are immutable by default”
    • 10. Side Effects • Example: “The Butterfly Effect”• A side effect • Modifies some state • Has observable interaction with calling functions • Has observable interaction with the outside world • Example: a function or method with no return value
    • 11. Composing Functions f(x)f(x) = 3x+2g(y) = 4y-1 g(f(2)) = ? g(x)
    • 12. Simplicity
    • 13. abstract class Command {Simplicity } public virtual void Execute(); C# abstract class RoverCommand : Command {Functions as values protected Rover Rover { get; private set; } public RoverCommand(MarsRover rover) { this.Rover = rover; } F# } class BrakeCommand : RoverCommand {type Command = Rover -> unit public BrakeCommand(Rover rover) : base(rover) { }let BrakeCommand = public override void Execute() { fun rover -> rover.Accelerate(-1.0) Rover.Accelerate(-1.0); } }let TurnLeftCommand = class TurnLeftCommand : RoverCommand { fun rover -> rover.Rotate(-5.0<degs>) public TurnLeftCommand(Rover rover) : base(rover) {} public override void Execute() { Rover.Rotate(-5.0); } }
    • 14. SimplicityFunctional data let swap (x, y) = (y, x) Tuple<U,T> Swap<T,U>(Tuple<T,U> t)F# { C# return new Tuple<U,T>(t.Item2, t.Item1) } let rotations (x, y, z) = ReadOnlyCollection<Tuple<T,T,T>> Rotations<T> (Tuple<T,T,T> t) [ (x, y, z); { (z, x, y); new ReadOnlyCollection<int> (new Tuple<T,T,T>[] (y, z, x) ] { new Tuple<T,T,T>(t.Item1,t.Item2,t.Item3); new Tuple<T,T,T>(t.Item3,t.Item1,t.Item2); new Tuple<T,T,T>(t.Item2,t.Item3,t.Item1); }); } let reduce f (x, y, z) = int Reduce<T>(Func<T,int> f,Tuple<T,T,T> t) { f x + f y + f z return f(t.Item1) + f(t.Item2) + f (t.Item3); }
    • 15. F# is declarative
    • 16. F# 3.0Information Rich Programming
    • 17. Two propositions
    • 18. Proposition 1:We live in an information society
    • 19. Proposition 2:Our languages are information sparse
    • 20. A Big Problem
    • 21. Challenges• Impedance mismatch with statically-typed languages• Need to manually integrate codegen tools with build process, source control, etc.• No elegant way to handle schema change• Loss of type information due to up-casts to Object, or even have to just parse strings
    • 22. But…• Data sources often have rich schemas and associated data definitions• Static types should make your experience better, not worse!
    • 23. Why this mattersProgramming the web
    • 24. F# Type Providers:IntelliSense for data
    • 25. Type provider IDE CompilerIntelliSense for Type-Check Compile using Generated Imported Types Type Provider Types
    • 26. Demo summary• Can program against web-scale schematized data • code gen would never work here!• Don’t have to wait for codegen or code to compile• With typechecking! • Can detect schema change• With great Visual Studio tooling!
    • 27. Demo 3:Web service with multiple data sources
    • 28. What’s next for F#?• Cloud, cloud cloud!• Make F# programming on Azure even easier• Can use F# computation expressions to add new syntax in a library • for example, cloud { … } • F# async and query expressions are not built-in syntax—they use computation expressions
    • 29. Computation in the Cloud
    • 30. Cloud Numerics• Extensive library of numerical algorithms • Ranges from basic math to advanced statistics to linear algebra• Supports distributed arrays and computation• Can deploy to Azure when lots of compute resources are needed

    ×