March 2019: functional
Meetup #58. Please RSVP at Meetup.
We get started at 6:30 pm.
Sponsors
Venue provided by Startup Edmonton.
Food sponsored by Bellstone Engineering.
Talks
Functional Go: How well does Go Support Functional Programming?
Axel von Bertoldi (Kira Systems) took a practical look at how well Go supports functional programming, scoring each concept as supported (A), neutral (B/C), or prevented (F). He walked through the FP pillars — immutable variables, referential transparency, and first-class functions — and related ideas like tail recursion, higher-order functions, monads, pattern matching, currying, and algebraic types. Go scored well on first-class functions (generators, closures, and the functional options pattern) but only B- on immutability and C on referential transparency, since package-level state and in-place operations like sort.Strings are allowed. Tail-call optimization, higher-order functions, and monads all scored F: the first by design, the latter two because they need parametric polymorphism (generics). His conclusion was to use immutability and referential transparency by convention, lean into first-class functions, avoid deep recursion, and wait for generics before adopting HOFs and monads.
Key points:
- Scored Go against core FP concepts: A supported, F prevented.
- First-class functions: A — closures, generators, functional options.
- Immutability: B- —
constand immutable strings, but mutable slices/structs. - Referential transparency: C — global state and in-place stdlib calls are allowed.
- Tail recursion: F — Go has no tail-call optimization.
- Higher-order functions and monads: F — they need generics to be practical.
- Practical advice: apply FP by convention where it doesn't hurt performance.
News
Events
- Monthly Hack Day - Apr 6
- Gocon Canada - May 31, Toronto
- GopherCon - Jul 24-27, San Diego
- Edmonton Go Meetup - April