$30 off During Our Annual Pro Sale. View Details »

F# So Far

Jake Trent
January 05, 2017

F# So Far

A few tidbits about our experience building our first couple subsystems in F#.

Jake Trent

January 05, 2017
Tweet

More Decks by Jake Trent

Other Decks in Technology

Transcript

  1. Our Experience
    So far
    With
    F#
    Matt & Jake

    View Slide

  2. What We’re Building
    - Prism global nav BC
    - ~8 listeners
    - 1 publisher
    - 1 api

    View Slide

  3. Why F# for us?
    - Like functional programming, want more
    - .Net ecosystem & expertise
    - Appeal of F# when coming to .Net
    - Strong types

    View Slide

  4. The Language
    - Syntax is different than most imperative
    - Took days to grok basic syntax
    - Felt productive w/in a few weeks
    - Can use all of .Net framework
    - Interop sometimes awkward
    - TDD is great
    - Light stubs, no explicit interfaces

    View Slide

  5. Deployment
    - Pre-existing Windows servers
    - server-farm for listeners
    - internal-tools for api
    - Templates exist for TeamCity
    - Operationally equivalent w/ all other .Net
    warez

    View Slide

  6. Shared Libs
    - Can use all PS .Net libraries
    - messaging
    - logging
    - settings
    - postgres

    View Slide

  7. Abstractions
    - Mostly just functions
    - Didn’t use classes except for interop
    - No IoC container

    View Slide

  8. Tooling
    - Visual Studio
    - F# Power Tools are great
    - Rename, import, navigate to
    - ReSharper mostly absent
    - Weak refactorings
    - F# dotnetcore is not ready for prod

    View Slide

  9. Dynamic Data
    - www.youneedlotsoftypes.com
    - Painful in test
    - Partial stubs
    - Incomplete request bodies
    - Duck typing supposedly possible

    View Slide

  10. Type Inference
    - Nice to not have to write out all types
    - Sometimes inference gets confused
    - Have to annotate
    - Later can remove

    View Slide

  11. Code Organization
    - Modules group functions
    - Trying different ways to organize types
    - Forward-only compiler
    - Still getting better

    View Slide

  12. Quirfuffles
    - Just go add an assemblyRedirect
    - Just recompile src to make ur tests happy
    - Just restart Visual Studio

    View Slide

  13. Learning
    - Some strong resources
    - fsharpforfunandprofit.com
    - Pluralsight vids \m/
    - Good Google hits
    - Still growing in our proficiency
    - Language still has untapped potential

    View Slide

  14. Who might like F#?
    Likes FP and…
    - .Net - ops equivalent, all libs
    - Strong types - no wild dynamic code, sum
    types
    - Safety - immutability by default, total functions
    - Type inference - modern convenience
    - Expressive functional constructs - pipes,
    function composition, auto curry, pattern matching

    View Slide

  15. What now?
    - Finish Prism BC
    - Determine if there’s enough org interest to
    support this and future F# projects
    - Move F# from “investigate” to “avoid” or
    “adopt”
    - Profit

    View Slide

  16. IGHT!
    Thank you

    View Slide