D compiles fast, right? Right??
Atila Neves
atila.neves at gmail.com
Mon Apr 2 12:33:37 UTC 2018
On Friday, 30 March 2018 at 16:41:42 UTC, Jonathan Marler wrote:
>
> Seems like you're comparing apples to oranges.
No, I'm comparing one type of apple to another with regards to
weight in my shopping bag before I've even taken a bite.
> Go's path.go is very small, a 215 line file:
> https://github.com/golang/go/blob/master/src/path/path.go
> Documentation: https://golang.org/pkg/path/
gocloc has it at 123 SLOC.
> Dlang's std.path is much more comprehensive with 4181 lines:
> https://github.com/dlang/phobos/blob/master/std/path.d
> Documentation: https://dlang.org/phobos/std_path.html
dscanner says 1857 SLOC. Also, that includes unit tests, of which
there are 72 so probably some 700SLOC there.
I don't think how big the files are is revelant for me, a user of
the standard library. If I want to do something with paths and
don't want to roll my own code, I pay a price for it in D,
whereas it's relatively free with Go. It makes me want to
substitute every usage of std.path.buildPath in my code with just
`foo ~ "/" ~ bar ~ ...`.
> It's over an order of magnitude more code
More lines of code is a liability, not an advantage.
> and only takes twice as long to compile without unittests,
No... that's ~11.583x with no unittests and ~43.75x with. The
former number not being interesting to me in the slightest.
> and it's only fair to compare the "non-unittest" version of
> std.path with Go, since Go does not include unittests.
Absolutely not.
There is *0* compile-time penalty on Go programmers when they
test their programs, whereas my compile times go up by a factor
of 3 on a one-line program. And that's >3 multiplied by "already
slow to begin with".
Atila
More information about the Digitalmars-d
mailing list