lambdaconf / winter-retreat-2017

The official repository for the LambdaConf 2017 Winter Retreat (January 8 - 12).
12 stars 0 forks source link

Guide: TJ Usiyan #9

Open griotspeak opened 7 years ago

griotspeak commented 7 years ago

I'm TJ Usiyan, iOS instructor at The Iron Yard and frequent speaker on the topics of Swift, iOS, functional programming, math, music, and how all or some of those things can be juxtaposed into something delightful. I have a liberal arts background and have an unconventional CS background.

I have been teaching one thing (music, math) or another (programming), for over ten years.

Past topics I've covered in some way include (mostly in Swift):

Parser Combinators, Types and API design, DSLs, Generics, Protocols, Monads, Language, Symbolic Music Representation: Notation & Theory, Symbolic Calculus, Functional Reactive Programming, Polymorphic Temporal Media, Operator overloading, , Translating Haskell through meditation.

I would love to talk more about any of these topics but exploring new DSLs, Sane and sanitary Operator Overloading, Polyphonic temporal media, Generics, or protocols would be especially wonderful, I think.

I'm excited to be a guide and hope we can craft beautiful language together this winter. None of this is set in stone. I invite suggestions and requests! Vote using thumbs up and thumbs down emojis and we'll figure this all out together!

Functional Programming and Polymorphism basics in Swift

Swift allows us to apply many techniques from functional programming but, at the end of the day, Swift is not meant to be a functional programming language. This point can make it tricky to learn and apply functional programming principles using the language. One approach is to eschew FP concepts altogether when using Swift. It doesn’t take much time to realize that this is not the correct approach. Use of closures as first class types, map and filterare all completely at home in Swift. Clearly, there are some concepts which work well in Swift.

In this session, we’ll introduce fundamental functional programming concepts using swift, explain and explore the ways in which Swift is not meant to adhere to these, and try to define some basic guidelines for successfully using FP ideas in Swift. Attendees should have the latest Xcode installed, should understand what variables and types are in a general sense, and should be able to type quickly (more quickly than ‘hunt and peck’).

Building a small Parser Combinator library in Swift

There are so many ways to parse text and so many of them obscure what it is we are trying to do overall. Parser combinators, at their best, allow us to write programs that closely resemble the grammar we are interested in. Swift, with its expressive type system and closures, provides us the tools to create our own parser combinator library.

In this session, attendees will write a small parser combinator library. We’ll discuss the various choices one can make in building a library and the effects that those choices can have on the resulting API. Attendees should have a working understanding of Swift, Generics, and Closures. Basic knowledge of FP concepts will help but are not strictly required. Attendees should have the latest Xcode installed and should be able to type quickly (more quickly than ‘hunt and peck’).

jdegoes commented 7 years ago

I'd vote for DSLs in Swift, especially comparing what is and is not possible in Swift and how standard techniques in Haskell or other FP languages have to be adapted for Swift's type system & semantics.

But that's just me, hopefully someone else votes for something. 😄

ShaneDelmore commented 7 years ago

Protocols sounds fun

hirad commented 7 years ago

I use Swift daily but I'm new to FP. I'd love to hear about Parser Combinators, Generics (still don't take advantage of them enough), and Monads.

ErrorNullPointer commented 7 years ago

Out of curiosity what would the topic "Translating Haskell through meditation" consist of?

ghost commented 7 years ago

TJ I'm interested in using a couple Clojure platforms to ask what kinds of musical decisions can be automated. I need to practice basics of coding though (I wasn't a very accomplished developer in any language before I started on Clojure). More generally though, I hope we find time to talk about the relations between typing, FP, and music!

kent-white commented 7 years ago

Translating Haskell through meditation sounds cool. Any functional programming in swift would also be cool and bring more variety.

alexi21 commented 7 years ago

I would be interested in functional approaches to programming in Swift. Cheers

argumatronic commented 7 years ago

Super excited for the parser combinator workshop!