HNHacker News
TopNewBestAskShowJobs

jatcwang

57 karma · joined September 11, 2018

submissionscomments
jatcwang··on Ask HN: Why do message queue-based architectures seem less popular now?
Have you looked into temporal.io? It supports dynamic workflows.
jatcwang··on Scala 3.0
https://xuwei-k.hatenablog.com/entry/2021/05/14/210911

Someone did some tests on Scalaz codebase and Scala 3 is around 2.5x faster. While Scalaz (and Cats) isn't exactly like your typical Scala production code base, I think we should see noticeable improvement across all kinds of Scala code.

jatcwang··on From First Principles: Why Scala?
Scala _can_ do structural typing, but you almost never see it in the wild so I don't think you'll be able to find any data on it. The main reason why it isn't used in Scala is because it's implemented using run-time reflection which can be slow.

From the time I've spent working with Typescript (Probably the most mainstream with with structural types), I don't think structural-by-default is the right approach if we are to design a language for safety & productivity. The error messages are a lot worse than nominal typing, and useful patterns like new type are either not safe or has a runtime cost. [1]

I suspect nominal first with good structural typing support from the compiler is where the sweet spot is, but to integrate it nicely in any language used today is probably an open research question.

[1] https://kubyshkin.name/posts/newtype-in-typescript/

jatcwang··on Scala 3.0.0-M1
Very, very excited about Scala 3. Here are some of the things I'm looking forward to using:

* Generally a more clean language for everyday use, codifying existing patterns like newtypes (opaque types), typeclass derivation and extension methods

* Improved type inference & lots of other quality of life improvements

* A macro system based on the idea of multi-stage programming. This has a lot of potential for improving both type-safety and performance. An example: beating existing database systems query optimization with ~500 lines of Scala code [1]

* TASTY, a new intermediate representation (AST) for artifacts. This means that Scala will have a much better version upgrade / binary compatibility story in the future. (e.g. TASTY is used for facilitating 2.13 <-> 3.0 bi-direction upgrade!)

* Significant compile time improvements over Scala2 alraedy[2] (and we're only at M1 release)!

Scala has already been a wonderful language to work with professionally with many great tooling (linting, automatic migration, 2 good OSS IDEs), and I think Scala 3 will certainly push the state-of-the-art forward in many departments in the coming years.

[1]:https://www.cs.purdue.edu/homes/rompf/papers/rompf-icfp15.pd...

[2]: https://twitter.com/not_xuwei_k/status/1323643312230772737

jatcwang··on My Favorite Shortcuts for JetBrains' IDEs
Using remote dev boxes can definitely be a huge productivity boon, from having better specs to much faster networks.

Here's an example of how Databricks improved their dev cycle with beefy machines running Bazel + remote cache: https://databricks.com/blog/2019/02/27/speedy-scala-builds-w...

jatcwang··on The Road to Scala 3
I was initially skeptical of Scala when I landed my first Scala gig a few years ago, but now I'm really glad I picked it. Simple things like pattern matching and immutability are amazing, and Implicits + Macros enables some awesome libraries like Shapeless[1], Chimney[2] which solves real business problems in a succinct and type-safe way.

Very excited about what's coming in Scala 3

* Lots of improvements to make the language simpler and easier to work with * Integrating some tried-and-true patterns from the current Scala ecosystem directly into the language * First-class tooling to solve some long-standing issues in the ecosystem (binary compatibility)

The team behind Scala 3 has done a tremendous job. Along with the whole movement of better tooling that's happening in the Scala ecosystem right now, I think the language will have a fun and productive future!

[1]: https://github.com/milessabin/shapeless [2]: https://scalalandio.github.io/chimney/