Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala build tools SBT vs CBT [closed]

I am currently using SBT to build my scala projects however recently I learned about another build tool called CBT.

One clear advantage I can see from CBT documentation is, writing build file is as good as writing scala code.

I want to know comparative pros and cons of both build tools like performance, build time etc. from someone who has used it.

like image 547
Yogesh Patil Avatar asked May 07 '17 07:05

Yogesh Patil


1 Answers

I am the author of CBT.

TL;DR CBT is simpler and faster in certain areas but younger and less practice proven.

The long version:

CBT aims to be significantly simpler to use than SBT while giving similar benefits in expressiveness compared to old tools like Maven or Ant. I believe CBT delivers here. It also gives you type safety when referring to task (methods), where in SBT a task may or may not be defined in the scope you are reading it from. Performance wise CBT has much quicker startup time (ca 100ms) from bash and reacts to file changes instantly via OS push notifications rather than SBT's 0.5s interval polling.

CBT is less practice proven than SBT at this point and you may find some rough edges. In particular there is very little documentation right now which I aim to change soon. You will also find much fewer examples of CBT builds online. There is the examples folder in CBT's repo however and the tests. You may also still find some blind spots wrt plugins. All the linters, code formatters, compilers, publishing plugins exist. Packaging and IDE support still needs major improvements. Plugins are very easy to write and add.

CBT's source code is conceptually very simple, beginner friendly code that is easy to contribute to, partly because CBT automatically rebuilds itself after a change which makes it immediately available. SBT's code base is much harder to grasp and I don't know how to actually use a locally changed one, i suppose deploying snapshot builds.

CBT does currently not run tasks or build projects concurrently. It may never do that for tasks within a project but will likely start concurrent compilation for different subprojects. SBT parallelizes tasks as possible (or assumed possible). I don't perceive CBT's performance as being impacted by not doing it. It's overall quite snappy.

CBT has not been battle tested on larger projects. CBT itself is a multi project build with > 10 sub projects but that's probably the largest that has been tried to date.

So right now (and that's rapidly improving within weeks and months) if you choose CBT be prepared to read a good amount of it's source code, use the gitter channel to talk to us, not use an IDE or configure it yourself, help fix smaller, superficial usability bugs nobody has bothered to fix yet.

If you want the polished, better supported, more documented, more complicated tool with more copy and pastable examples and more plugins online, go with SBT. If you want the simpler, easier to use, snappier, almost undocumented tool with a code base you can understand quickly but that you may have to fix yourself sometimes for now go with CBT.

There is also this recent video about CBT: https://youtu.be/-2aMaAPQ35s

like image 80
cvogt Avatar answered Oct 23 '22 13:10

cvogt