Artwork

Content provided by Scalawags Podcast. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Scalawags Podcast or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
Player FM - Podcast App
Go offline with the Player FM app!

Scalawags #32 - Scala Puzzlers

1:02:57
 
Share
 

Archived series ("HTTP Redirect" status)

Replaced by: scalawags.tv

When? This feed was archived on December 02, 2017 16:21 (6+ y ago). Last successful fetch was on August 17, 2017 14:32 (6+ y ago)

Why? HTTP Redirect status. The feed permanently redirected to another series.

What now? If you were subscribed to this series when it was replaced, you will now be subscribed to the replacement series. This series will no longer be checked for updates. If you believe this to be in error, please check if the publisher's feed link below is valid and contact support to request the feed be restored or if you have any other concerns about this.

Manage episode 99458701 series 60604
Content provided by Scalawags Podcast. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Scalawags Podcast or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.

YouTube link: https://www.youtube.com/watch?v=kCcWxI85hbg

Our guests Andrew Phillips and Nermin Šerifovi? (aka @higherkinded) bring us puzzlement both enlightening and confounding. They are the authors of Scala Puzzlers (Artima Press), creators ofscalapuzzlers.com, and keepers of @ScalaPuzzlers.

In this episode the hosts try to stump the authors, the authors try to stump the hosts, and everyone goes home confused.

your hosts this episode: Seth Tisue, Josh Suereth

Two actual puzzlers are discussed in the podcast. If you're listening on audio, it will help to look at the code. For the first puzzler, the code is shown below. For the second, seehttp://scalapuzzlers.com/#pzzlr-056.

Intro (0:00)
  • Josh is stealing paintings from his hotel room
How'd this start? (0:30)
  • Nermin started Boston Scala Enthuasiasts. Andrew is best known for owning a large portfolio of Scala-related domain names.
    • contact Andrew's sales staff for pricing information
  • inspired by Java Puzzlers, a book by Joshua Bloch and Neal Gafter
  • scalapuzzlers.com came first; most puzzlers are submitted by the user community
  • were they worried this would throw fuel on the Scala-complexity fire?
  • some puzzlers can be fixed, others are inherent?
A Stream puzzler (13:35) val nats: Stream[Int] = 1 #:: (nats map { _ + 1 }) val odds: Stream[Int] = 1 #:: (odds map { _ + 1 } filter { _ % 2 != 0 }) nats filter { _ % 2 != 0 } take 2 foreach println odds take 2 foreach println
  • if it's not a language-quirks puzzler, is it still a puzzler?
  • shouldn't that val be a lazy val? or does it matter?
  • Seth confidently makes a totally wrong assertion about #::, and even says "definitely" while doing so
  • Josh and Andrew agree on a fix that (we realize later, after the show has ended) doesn't actually help
A Future puzzler (24:30)
  • puzzler #56 from the site: "An Exceptional Future"
  • this one's about Future about how it handles different kinds of Throwables
  • some of this is standard Java/JVM stuff, but there's a Scala-specific part too
  • earthquake!
  • Martin Odersky stumped on a plane; Adriaan Moors and Daniel Spiewak stumped live
  • a key survival skill in Scala is to remove portions of your own brain with a laser
  • a handful of puzzlers in the book are already fixed in newer Scalas, or at least give warnings with certain compiler flags
    • Wartremover can help too. (and Scalastyle, Abide...?)
Implicits (36:50)
  • Josh's parting advice before the hotel police drag him off: to avoid puzzlers, learn how not to use implicits
  • on implicit val vs. implicit def, and on implicit values which are themselves functions
    • implicit val s = Set(1, 2, 3); 2: Boolean, anybody?
  • and don't forget that implicits have names, and the name doesn't matter... except when it does
Puzzlers live! (42:10)
  • illegal popcorn is served, exhausted conferencegoers soothed
  • Predef: disable parts? heck, disable it all
  • Punchcard Puzzlers was a big seller back in 1965
Will Dotty save us? (47:55)
  • Andrew puts Seth on the spot
  • hope, yes. but not too much, and not too soon
Safer Scala (50:50)
  • Andrew asks the big question: how we can make Scala safer for more people?
  • Seth: we need more static checking. we have some checkers, we need more and better. Abide is a promising new entrant, and needs community participation.
  • Nermin: compiler flags help. style guides help. there's a Spark style guide in which they recommend avoiding a lot of language features.
  • the "five second rule": don't eat your code if it's been on the floor for more than five seconds
  • Andrew: in the static-checking space, don't forget SuperSafe
  • Seth: the rise of Spark changes the makeup of the Scala community. it ups the ante for needing to make the language easier and safer.
  • Andrew: and it means fewer people are coming straight from Java
Conclusion (1:01:15)
  • "Patrick" in the audience wants to know if there's a coupon code for the book
    • Bill Venners from Artima helpfully provides: "Here's a 35% discount code for Scala Puzzlers that will be good through midnight Central Time, Friday, September 4. PUZZLEWAGS"

  continue reading

41 episodes

Artwork
iconShare
 

Archived series ("HTTP Redirect" status)

Replaced by: scalawags.tv

When? This feed was archived on December 02, 2017 16:21 (6+ y ago). Last successful fetch was on August 17, 2017 14:32 (6+ y ago)

Why? HTTP Redirect status. The feed permanently redirected to another series.

What now? If you were subscribed to this series when it was replaced, you will now be subscribed to the replacement series. This series will no longer be checked for updates. If you believe this to be in error, please check if the publisher's feed link below is valid and contact support to request the feed be restored or if you have any other concerns about this.

Manage episode 99458701 series 60604
Content provided by Scalawags Podcast. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Scalawags Podcast or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.

YouTube link: https://www.youtube.com/watch?v=kCcWxI85hbg

Our guests Andrew Phillips and Nermin Šerifovi? (aka @higherkinded) bring us puzzlement both enlightening and confounding. They are the authors of Scala Puzzlers (Artima Press), creators ofscalapuzzlers.com, and keepers of @ScalaPuzzlers.

In this episode the hosts try to stump the authors, the authors try to stump the hosts, and everyone goes home confused.

your hosts this episode: Seth Tisue, Josh Suereth

Two actual puzzlers are discussed in the podcast. If you're listening on audio, it will help to look at the code. For the first puzzler, the code is shown below. For the second, seehttp://scalapuzzlers.com/#pzzlr-056.

Intro (0:00)
  • Josh is stealing paintings from his hotel room
How'd this start? (0:30)
  • Nermin started Boston Scala Enthuasiasts. Andrew is best known for owning a large portfolio of Scala-related domain names.
    • contact Andrew's sales staff for pricing information
  • inspired by Java Puzzlers, a book by Joshua Bloch and Neal Gafter
  • scalapuzzlers.com came first; most puzzlers are submitted by the user community
  • were they worried this would throw fuel on the Scala-complexity fire?
  • some puzzlers can be fixed, others are inherent?
A Stream puzzler (13:35) val nats: Stream[Int] = 1 #:: (nats map { _ + 1 }) val odds: Stream[Int] = 1 #:: (odds map { _ + 1 } filter { _ % 2 != 0 }) nats filter { _ % 2 != 0 } take 2 foreach println odds take 2 foreach println
  • if it's not a language-quirks puzzler, is it still a puzzler?
  • shouldn't that val be a lazy val? or does it matter?
  • Seth confidently makes a totally wrong assertion about #::, and even says "definitely" while doing so
  • Josh and Andrew agree on a fix that (we realize later, after the show has ended) doesn't actually help
A Future puzzler (24:30)
  • puzzler #56 from the site: "An Exceptional Future"
  • this one's about Future about how it handles different kinds of Throwables
  • some of this is standard Java/JVM stuff, but there's a Scala-specific part too
  • earthquake!
  • Martin Odersky stumped on a plane; Adriaan Moors and Daniel Spiewak stumped live
  • a key survival skill in Scala is to remove portions of your own brain with a laser
  • a handful of puzzlers in the book are already fixed in newer Scalas, or at least give warnings with certain compiler flags
    • Wartremover can help too. (and Scalastyle, Abide...?)
Implicits (36:50)
  • Josh's parting advice before the hotel police drag him off: to avoid puzzlers, learn how not to use implicits
  • on implicit val vs. implicit def, and on implicit values which are themselves functions
    • implicit val s = Set(1, 2, 3); 2: Boolean, anybody?
  • and don't forget that implicits have names, and the name doesn't matter... except when it does
Puzzlers live! (42:10)
  • illegal popcorn is served, exhausted conferencegoers soothed
  • Predef: disable parts? heck, disable it all
  • Punchcard Puzzlers was a big seller back in 1965
Will Dotty save us? (47:55)
  • Andrew puts Seth on the spot
  • hope, yes. but not too much, and not too soon
Safer Scala (50:50)
  • Andrew asks the big question: how we can make Scala safer for more people?
  • Seth: we need more static checking. we have some checkers, we need more and better. Abide is a promising new entrant, and needs community participation.
  • Nermin: compiler flags help. style guides help. there's a Spark style guide in which they recommend avoiding a lot of language features.
  • the "five second rule": don't eat your code if it's been on the floor for more than five seconds
  • Andrew: in the static-checking space, don't forget SuperSafe
  • Seth: the rise of Spark changes the makeup of the Scala community. it ups the ante for needing to make the language easier and safer.
  • Andrew: and it means fewer people are coming straight from Java
Conclusion (1:01:15)
  • "Patrick" in the audience wants to know if there's a coupon code for the book
    • Bill Venners from Artima helpfully provides: "Here's a 35% discount code for Scala Puzzlers that will be good through midnight Central Time, Friday, September 4. PUZZLEWAGS"

  continue reading

41 episodes

All episodes

×
 
Loading …

Welcome to Player FM!

Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.

 

Quick Reference Guide