manuzhang / read-it-now

Don't read it later; read it now
4 stars 0 forks source link

So, what's wrong with SBT ? #19

Open manuzhang opened 7 years ago

manuzhang commented 7 years ago

image

Breaking Tweets from Li Haoyi, who was calling out to collaborate a new build tool for Scala to replace SBT(Scala Build Tool or Simple Build Tool 😂). Later on, he explained the motivate in So, what's wrong with SBT. As an aside, here is a underrated self-introduction of Li Haoyi.

Haoyi is a software engineer, an early contributor to Scala.js, and the author of many open-source Scala tools such as the Ammonite REPL and FastParse.

I'm a big fan and you should absolutely check out his blog if you haven't.

So, what's wrong with SBT

The post started out with people's complaints in the community but

These comments aren't always objective, peer-reviewed analyses. Judgements are subjective, facts are wrong, people's understanding is incomplete.

But the confusion and frustration are real.

The deeper underlying problem of SBT as summarized by the author is

  1. Four dimensional data model
  2. Three layers of interpretation with semantic duplication and lack of tooling support
  3. Global mutable execution model
  4. Lack of caching (No caching by default)
  5. Single process / classpath architecture (SBT plugins need to be compiled before your own code)

Interestingly, these points are agreed by Scala's father Martin Ordersky who wrote a critique of SBT 6 years ago. image

My recent unpleasant experience with SBT was Incompatibility between 3.20 (depended by SBT plugins) and 3.21 (depended by my project) of json4s and switching from SBT 1.0 back to 0.13. Meanwhile, here's my story of struggling with shade in SBT(I, II, III). As a Scala developer, my biggest frustration with SBT is debugging and what I find when going to definition.

val libraryDependencies = settingKey[Seq[ModuleID]]("Declares managed dependencies.")
manuzhang commented 6 years ago

Interesting to see the announcement of Bloop

a tool that Scala developers can use to compile and test their projects faster without being tied to their stock build tool.

Bloop takes advantage of improvements from Zinc 1.0 and hot compiler feature of Nailgun, and allows other build tools to integrate with it.

Ironically, Bloop itself is built with SBT so it's not easy to get started.