Real Ultimate Programming

The Home for People Who Like to Flip Out and Write Code

Notes From PyATL 2014-07-10

Announcements

  • The Weather Channel is hiring
  • So is AirSage (sp?)

Functional Programming in Python - A Sampler (Cliff)

Functional programming languages make big promises

  • Makes it easy to write robust, modular, decoupled code
  • They’re easy to test (since output is solely dependent on input)
  • They make programming fun

Do they deliver?

  • Didn’t find it worth the switching costs, personally.
  • Has a problem with the no I/O thing
  • I don’t think he gets the “no state” thing; there’s no mutable, shared state, not no state at all.

Hallmarks of Functional Code

  • Functions are first-class objects
  • Functions are typically very small
  • Closures
  • Partials/curried functions
  • Recursion
  • Immutable

Various Places that Functional Idioms Can Be Useful

  • He’s using templating as an example of how to use partials; that’s interesting. I’m going to have to look into this.
  • Interesting point about Python 3’s crazy argument ordering options and partials (how does partial application work with some of the wilder ones?)

Takeaways

  • Maybe use Python in a more functional style
  • Admits he doesn’t do this currently, so it’s aspirational
  • Use list comprehensions more
  • Isolating I/O looks like a good idea
  • Closures, decorators, and partials are a yes
  • Still doesn’t like recursion

Random observations by me

  • I didn’t realize iPython Notebook had presentation capabilities; I’m going to have to play with that.

GNU Radio and Python (Andrew Henshaw)

  • According to Andrew, it’s more him showing off instead of demonstrating programming techniques.
  • GNU Radio is for signal processing
  • It’s a C++ kernel wrapped in beautiful Python goodness
  • It’s dataflow-oriented
  • Software-defined radio is apparently a big thing, lately
  • Apparently, hardware has gotten fast enough that software Digital Signal Processing (DSP) is fast enough to replace dedicated hardware, which brings all the standard flexibility wins that software tends to provide over dedicated hardware.
  • There’s some crazy $20 dongle that can work as a receiver for just about every frequency band you could want, and feed it into software-defined radio
  • Fancy: you can draw a dataflow diagram to define your DSP pipeline.
  • That’s pretty awesome: assuming I didn’t miss anything, he just ran a touch-tone dialer program, in Python, generated from his fancy-pants dataflow diagram. It was a 7.
  • The gremlins are out in full force (technical presentations are like crack for these things); his GUI example with a volume slider suddenly stopped working despite working earlier.
  • My computer’s battery is now toast, so you’ll have to talk to him if you want the details of the presentation/demo.