F# perspectives

9

Click here to load reader

description

Video of the talk here http://www.youtube.com/watch?v=vayP7AAWO1w&hd=1

Transcript of F# perspectives

Page 1: F# perspectives

F# Experiences & Perspectives

Dmitri Nesteruk@dnesteruk

Page 2: F# perspectives

F# MEH

Tool supportVS support very thinNo code analysis tools

And VS itself is slow

Profiling, unit testing

Market penetrationThin but we don’t know how thinNot in top 50 (!) on TIOBE

Steep learning curveFunctional aspects

Perceived lack of evolutionOpen sourced ergo uncertain future

This dog is skeptical.

Page 3: F# perspectives

Traditional F#/functional domains

DSLsMathematics

Quant financeProbabilistic models

Symbolic processingParsing/lexingSymbolic differentiationCircuit verification

AlgorithmsHeuristic, collective intelligence

Page 4: F# perspectives

DSLs

Top-level declarationsNo need to ‘nest’ in namespace+classNo need for main() entrypoint

(Curried) function calls without braces/commasdoFoo a b c

No need for explicit declarations (var/let)Can have global-appearing state

Result: you end up writing English(replace English with any language)

Mutability may result in (somewhat) ugly code

Page 5: F# perspectives

Parsing/lexing

VS parses F# with F#http://fsharppowerpack.codeplex.com

Fslexx/fsyaccProject template online

Most power gained fromDiscriminated unionsPattern matching

Partial matching

List comprehensions

Page 6: F# perspectives

Math

Math in print is (typically) immutableType inference means less typing

But can lead to real annoyances2.0 * sign x // invalid!

No braces in function callsDubious

Functional compositionProbably not powerful enough for symbolic computation

REPL/continuous compilationIt’s all about the libs & tools

Used in quant institutions:KiwibankTrafiguraUBSBarclays CapitalGloucester ResearchGrange InsuranceEuroperformanceTrayport

Reminder: quant world uses C++

Page 7: F# perspectives

FSharper

F# support in R#R# is OOP, F# is ‘optional’Currently done in C#

OSS project (MIT license)http://github.com/jetbrains/fsharper Team of 4 people (3xJB, 1xMS)Very early stagesFeel free to contribute

Cannot run yet, but check outLexer Visualizer

Page 8: F# perspectives

Conclusion

Okay for math but needs libsMost good libs are C++, but many have .NET wrappers

Great for algorithmic/back-end tasksUseful for DSLsGood for quickly defining simple data structuresNot good for

Full OOPHighly mutable constructsUI

Page 9: F# perspectives

Questions?@[email protected]

Thanks!