f# perspectives
Post on 26-Jun-2015
135 Views
Preview:
DESCRIPTION
TRANSCRIPT
F# Experiences & Perspectives
Dmitri Nesteruk@dnesteruk
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.
Traditional F#/functional domains
DSLsMathematics
Quant financeProbabilistic models
Symbolic processingParsing/lexingSymbolic differentiationCircuit verification
AlgorithmsHeuristic, collective intelligence
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
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
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++
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
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
Questions?@dnesterukdmitrinesteruk@gmail.com
Thanks!
top related