Stream: Dune devs & users

Topic: Dune vs. SBT


view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:42):

There are _general_ questions with DSLs and embedded DSLs, including whether users are disciplined enough.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:43):

If you don’t trust your users, maybe you should prevent them from doing even pure computations. That’s basically the Go argument, but I totally buy that :-).

view this post on Zulip Karl Palmskog (Sep 17 2020 at 20:43):

at least make them pay commensurately for pure computation, like on blockchains, heh

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:43):

Except I usually don’t choose Go-like systems.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:44):

mind you, I’m also happy to rant about SBT, like any Scala user

view this post on Zulip Karl Palmskog (Sep 17 2020 at 20:44):

I used Scala a while, SBT seemed like the hackiest hack ever

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:45):

I don’t think _that_ is the problem.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:45):

Using higher-kinded types in a build system might be closer to it.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:45):

Not even Haskellers do that in _their_ build systems ;-)

view this post on Zulip Karl Palmskog (Sep 17 2020 at 20:46):

did they even have a metaphor (mental abstract model) for SBT at all? If so, I never noticed

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:47):

Yes. Took just a few years to document it.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:47):

And after a few more years, one developer managed to understand it and explain why it had a couple of concepts in excess.

view this post on Zulip Karl Palmskog (Sep 17 2020 at 20:48):

this sounds familiar for the Scala community (Akka comes to mind, although in reverse)

view this post on Zulip Karl Palmskog (Sep 17 2020 at 20:49):

there [in Akka], they started with a clean concept, and then made it unrecognizable

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:49):

no no, in SBT the author started with a clean concept.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:49):

it’s even enforced by types and whatnot.

view this post on Zulip Karl Palmskog (Sep 17 2020 at 20:50):

what was it, and why can't anyone tell what it is?

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:50):

I suspect they had one of the first HList implementations in production? Actually a KList — so a list of type constructors.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:50):

Basically, it was written by a type astronaut who left very little documentation.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:51):

so the _usage_ was hacky, just cargo-cult what works.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:52):

but nowadays the model is documented, it’s just not immediate.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:53):

sorry, that was a slight understatement, and my “exercise for the reader” moment

view this post on Zulip Karl Palmskog (Sep 17 2020 at 20:53):

"type astronaut" :laughter_tears:

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:54):

oh, that’s a term of art, and not mine

view this post on Zulip Karl Palmskog (Sep 17 2020 at 20:54):

the equivalent of the pattern-happy Java programmer?

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:54):

this is an analysis: https://www.lihaoyi.com/post/SowhatswrongwithSBT.html

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:55):

it’s more like somebody who in Coq picks Vector, or rather intrinsically-typed syntax

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:55):

even when it’s overcomplicated for the task at hand

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:55):

requiring multiple PhD to be able to contribute

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:56):

for higher marks, they might want to paint themselves into a corner by being unable to wield the tools properly

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:56):

(I recall a prominent Haskeller complaining about Haskell programmers bringing too many commercial Haskell projects to failure this way)

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 20:58):

OTOH, (since we’re hopelessly OT) in this channel I’d rather be suspicious about OCaml’s lack of control for side effects — I am not sure, but it does seem like Coq suffers terribly from it

view this post on Zulip Karl Palmskog (Sep 17 2020 at 20:58):

ah, the problem in many industry-oriented PL communities (in my opinion) is that they really have close to zero incentives to write anything but plain old how-do-I-use-this documentation

view this post on Zulip Karl Palmskog (Sep 17 2020 at 21:00):

feel free to break this out from parent topic by changing the topic at some well-chosen point

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:01):

(wouldn’t know where at this point, and I’m on the app which doesn’t seem to let me)

view this post on Zulip Karl Palmskog (Sep 17 2020 at 21:01):

OK I will do it at what will probably be the wrong point in hindsight

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:01):

re docs, that’s somewhat true but SBT seems a special case... all we know is the author disappeared from the Internet (maybe because of the reactions)

view this post on Zulip Karl Palmskog (Sep 17 2020 at 21:03):

hmm, isn't the community a bit embarrassed that they adopted a tool they had no idea how it worked?

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:03):

however, some of the SBT ideas are really nice, and I think it is in some sense declarative — a task can depend on another one by using its result — and that’s done automatically by defining an appropriate monad. And your build files just describe a build to be later executed :-)

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:04):

hm, I’m not sure they should be embarrassed.

view this post on Zulip Karl Palmskog (Sep 17 2020 at 21:05):

sigh, I would send them the original Mokhov et al. paper and tell them to get back on where SBT fits

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:05):

SBT was the first tool to support fine-grained incremental builds...

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:05):

for Scala, that is

view this post on Zulip Karl Palmskog (Sep 17 2020 at 21:05):

by fine-grained, do you mean edits at the method level?

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:06):

nowadays yes

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:06):

back then it wasn’t so good I think, but it was still better than the alternatives

view this post on Zulip Karl Palmskog (Sep 17 2020 at 21:06):

and how do they deal with dynamic dependencies and reflection and so on?

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:07):

in any case: like for dune, it builds Scala projects faster than alternatives, so people did the right thing

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:08):

re dynamic deps, I’d have to look at your link on Selective to understand what you mean.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:08):

on reflection, do you mean Java reflection?

view this post on Zulip Karl Palmskog (Sep 17 2020 at 21:08):

it's not really related to that. You have to do your change impact analysis accurately to get correct fine-grained builds

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:09):

ah, the dependencies of a Scala file are completely static in that sense

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:09):

if a class loads another class, you cannot predict the runtime types, that’s true

view this post on Zulip Karl Palmskog (Sep 17 2020 at 21:09):

dynamic class loading/modification and so on?

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:10):

not a problem in the compilation model

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:10):

the _output_ of compilation only depends on the source and the dependencies.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:10):

there’s a strict stage separation between compile-time and runtime.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:11):

well. Except for (compile-time) macros, and those _are_ hackier in Scala 2.

view this post on Zulip Paolo Giarrusso (Sep 17 2020 at 21:12):

those indeed are a problem because they’re basically compiler plugins, up to some sealing of ML-modules, which you can anyway bypass fairly easily with Obj.magic and friends.

view this post on Zulip Karl Palmskog (Sep 17 2020 at 21:32):

my number one mistake when reading tech writing by non-academics: scrolling directly to the conclusion and assuming it actually sums up what the document is about (re: https://www.lihaoyi.com/post/SowhatswrongwithSBT.html)


Last updated: Apr 19 2024 at 00:02 UTC