Download - Дмитрий Нестерук «F#: Опыт и Перспективы»
![Page 1: Дмитрий Нестерук «F#: Опыт и Перспективы»](https://reader036.vdocuments.net/reader036/viewer/2022080419/589ff5a01a28ab46598b56d5/html5/thumbnails/1.jpg)
Dmitri Nesteruk@dnesteruk
![Page 2: Дмитрий Нестерук «F#: Опыт и Перспективы»](https://reader036.vdocuments.net/reader036/viewer/2022080419/589ff5a01a28ab46598b56d5/html5/thumbnails/2.jpg)
Tool supportVS support very thinNo code analysis tools
And VS itself is slow
Profiling, unit testingMarket penetration
Thin but we don’t know how thinCurrently (Sept 2016) 29th on TIOBE
Are functional aspects worth it?Next slide
Perceived lack of evolutionOpen sourced ergo uncertain future
This dog is skeptical.
![Page 3: Дмитрий Нестерук «F#: Опыт и Перспективы»](https://reader036.vdocuments.net/reader036/viewer/2022080419/589ff5a01a28ab46598b56d5/html5/thumbnails/3.jpg)
First class functionsC# has this
Higher order functionsC# has this, e.g., LINQ etc.
Pure functionsRecursion
No tail recursion in C#, see JITType inferencePurely functional data structures
Of dubious valueImmutability
Function ‘magic’Currying/partial applicationFunctional composition >>Pipelining <| |>
Not really functional stuffWorkflows (~ monads)ADTsTuplesPattern matching118 operators
C# will eventually steal everything worth stealing
![Page 4: Дмитрий Нестерук «F#: Опыт и Перспективы»](https://reader036.vdocuments.net/reader036/viewer/2022080419/589ff5a01a28ab46598b56d5/html5/thumbnails/4.jpg)
Domain-Specific Languages (DSLs)Mathematics/algorithms
Quant financeProbabilistic modelsData science, AI, etc…
Symbolic processingParsing/lexingSymbolic differentiationCircuit verification
![Page 5: Дмитрий Нестерук «F#: Опыт и Перспективы»](https://reader036.vdocuments.net/reader036/viewer/2022080419/589ff5a01a28ab46598b56d5/html5/thumbnails/5.jpg)
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 EnglishMutability may result in (somewhat) ugly code
![Page 6: Дмитрий Нестерук «F#: Опыт и Перспективы»](https://reader036.vdocuments.net/reader036/viewer/2022080419/589ff5a01a28ab46598b56d5/html5/thumbnails/6.jpg)
Math in print is (typically) immutableType inference means less typing
But can lead to real annoyances2.0 * sign x // invalid!
Lowercase functions with no namespace prefixNo braces in function callssin x
Conditional logic is better
Continuous compilation (REPL)It’s all about libs & tools
![Page 7: Дмитрий Нестерук «F#: Опыт и Перспективы»](https://reader036.vdocuments.net/reader036/viewer/2022080419/589ff5a01a28ab46598b56d5/html5/thumbnails/7.jpg)
VS parses F# with F#http://fsharppowerpack.codeplex.com
Fslexx/fsyaccProject template online
Most power gained fromDiscriminated unionsPattern matching
Active patternsList comprehensions
![Page 8: Дмитрий Нестерук «F#: Опыт и Перспективы»](https://reader036.vdocuments.net/reader036/viewer/2022080419/589ff5a01a28ab46598b56d5/html5/thumbnails/8.jpg)
Niche language for specific domainsOkay for math but needs libs
Most good libs are C++, but many have .NET wrappersGood for algorithmic/back-end tasksUseful for DSLsGood for quickly defining simple data structuresNot good for
Full OOPHighly mutable constructsUI
![Page 9: Дмитрий Нестерук «F#: Опыт и Перспективы»](https://reader036.vdocuments.net/reader036/viewer/2022080419/589ff5a01a28ab46598b56d5/html5/thumbnails/9.jpg)
Questions?@[email protected]