Haoyi is an amazing guy. Last night at 8pm and 2pm this morning I submitted two PR to the Mill, he merged within one hour. In about 7 years, he helped to create an eco-system around Scala: - REPL (ammonite) - build tool (mill) - JSON serializer(uPickle) - web framework (cask) - test framework(uTest) - http client lib (requests-scala) - HTML tag lib (scalatags) - parser(fast parse) Scala development and tool can be di…
Hands-on Scala Programming
101–108 of 108 posts
Re: Hands-on Scala Programming
#102I didn't post this, but cool to see this up here! The full book is ~400 pages and will be released Summer 2020 (i.e. soon!). If you're interested in being notified when it comes out, there's a mailing list link on the page and I'll let you know when it's out. There will be both E-Books as well as paperbacks & hardcovers (assuming the supply-chains are still open in this COVID-19 global environment...) The first 5 cha…
I can vouch for lihaoyi. He is one of the more prolific people in the scala community writing top notch stuff. The best part about most of the stuff be writes is they are extremely ergonomic, even by scala standards. Look at either scala-tags or even better his parsing library. The parsing library is actialy so good you'll feel like finding more problems to solve. Its a breeeze to get started with (even in repl). Sca…
Re: Hands-on Scala Programming
#103Both the content and layout looks really fantastic! I wanted to ask any experienced Scala folks if its possible become really proficient without a solid background in Java. I understand that its only JVM hosted language so I guess my concern is how much Java you need to know when things go sideways - stack traces, low level debugging etc?
You will inevitably have to learn about the Java ecosystem when things go sideways.
One example that comes to mind is problems with dependency resolution. SBT, the most common Scala build tool, allows you to add libraries to your project easily with notation like this:
libraryDependencies += "com.lihaoyi" %% "upickle" % "1.0.0"
Normally that is fine.
But when things go awry, sbt may provide unhelpful messages. You actually end up having to learn about how Java's Maven (or Ivy) and its repositories work.
A couple of instances I recall:
- SBT repositories were configured to look for dependencies on site A. A was redirecting downloads to site B. Site B was configured with an expired TLS certificate. The error message reported from sbt only mentioned site A. I only figured out what was going on by tracing the network activity.
- Maven central disabled insecure (HTTP) access earlier this year and started requiring HTTPS. Some of our build configurations still referenced repositories via HTTP URLs. I don't remember what the SBT error message was, but it was again cryptic and unhelpful. Other developers who mostly work with Go had to enlist my help in diagnosing the problem and fixing it.
A lot of Scala teaching material also assumes familiarity with Java. "Scala's Traits are like Java Interfaces, but with these improvements: ...."
That didn't help when I hadn't used Java Interfaces before.
Fortunately, it looks like Hands-On Scala Programming doesn't assume a Java background.
It also took me longer than it should have to understand the deep stack traces you often run into. The key: look for lines that reference your own application code, and focus there. (But this doesn't work if you are really encountering library bugs or infrastructure flakiness.) The traces can be very deep and a lot of the lines are not really relevant to solving your problem. I was accustomed to reading shallower Python traces.
Learn to use a debugger early on. JVM code debugging with an IDE is powerful and easy to use. Plus you can't just monkey-patch your dependencies on the fly to add more diagnostics, the way I had done in Python.
Re: Hands-on Scala Programming
#104Earlier quoted context omitted.
Option does throw away the error. I like Try { expr } a lot, to the point that I retry, give up, and then serialize a Try[T <: Product] into a Row so flaky dependencies don't trash all the output from a big Spark job.
Yes, that's true, if you want to propagate information about the nature of what went wrong locally (e.g. logging) you need to use something richer (e.g. Either).
Re: Hands-on Scala Programming
#105Earlier quoted context omitted.
I can vouch for lihaoyi. He is one of the more prolific people in the scala community writing top notch stuff. The best part about most of the stuff be writes is they are extremely ergonomic, even by scala standards. Look at either scala-tags or even better his parsing library. The parsing library is actialy so good you'll feel like finding more problems to solve. Its a breeeze to get started with (even in repl). Sca…
He is, and nobody even talks about how his dad is the PM of Singapore and his grandfather founded the country.
Re: Hands-on Scala Programming
#106I didn't post this, but cool to see this up here! The full book is ~400 pages and will be released Summer 2020 (i.e. soon!). If you're interested in being notified when it comes out, there's a mailing list link on the page and I'll let you know when it's out. There will be both E-Books as well as paperbacks & hardcovers (assuming the supply-chains are still open in this COVID-19 global environment...) The first 5 cha…
Hiya, found a typo - couldn't see where else to mention it so adding here, maybe the author will notice. Ch 3. This chapter will not covering any Scala-specific should be: This chapter will be not covering any Scala-specific Otherwise enjoying what I've read so far. I've just been dropped in at the deep end of a project with no scala experience, so I'm trying to get off the ground asap.
should be: This chapter will not be covering any Scala-specific
Re: Hands-on Scala Programming
#107Earlier quoted context omitted.
He is, and nobody even talks about how his dad is the PM of Singapore and his grandfather founded the country.
I can tell you if this were true he wouldn't be programming a language that has to deal with jvm.
Re: Hands-on Scala Programming
#108Earlier quoted context omitted.
He is, and nobody even talks about how his dad is the PM of Singapore and his grandfather founded the country.
I can tell you if this were true he wouldn't be programming a language that has to deal with jvm.