It's disingenuous to say that /sbin/init (machined/main.go) is less than 400 lines of code. Sure, that file is. What about all of the in-tree modules that are being imported? A super lazy summing of Go lines in the master branch of the repo:
$ find . -name *.go | xargs wc -l | tail -1
354085 total
Heck, there are almost 100k lines under internal/app!
Kind of like TextAdept claiming that text editor is "just 2K lines of C/C++ and 4K lines of Lua", when it's in fact wrapping a well known third party text editor widget.
At least here it makes more sense, since it's not like "our init system is just 200 lines" when those lines are wrapping a third party init system library.
It's more like "our init system logic is just 200 lines, not including third party dependencies". That's legit, provided that those deps are stuff like parsers, some library for dealing with strings or running processes, and things like that.
I know there are a lot more lines and I didn’t count any of the imports from systemd either. 300 loc (machined) vs 3000 loc (systemd) was the closest comparison I could think of without crawling all imports and deps.
Would be happy to update with a different comparison you think is more fair.
Comments
It's disingenuous to say that /sbin/init (machined/main.go) is less than 400 lines of code. Sure, that file is. What about all of the in-tree modules that are being imported? A super lazy summing of Go lines in the master branch of the repo:
$ find . -name *.go | xargs wc -l | tail -1
Heck, there are almost 100k lines under internal/app!$ find internal/app -name *.go | xargs wc -l | tail -1
I'm curious what argument you are making here with regards to the number of lines in a single file.Kind of like TextAdept claiming that text editor is "just 2K lines of C/C++ and 4K lines of Lua", when it's in fact wrapping a well known third party text editor widget.
At least here it makes more sense, since it's not like "our init system is just 200 lines" when those lines are wrapping a third party init system library.
It's more like "our init system logic is just 200 lines, not including third party dependencies". That's legit, provided that those deps are stuff like parsers, some library for dealing with strings or running processes, and things like that.
I know there are a lot more lines and I didn’t count any of the imports from systemd either. 300 loc (machined) vs 3000 loc (systemd) was the closest comparison I could think of without crawling all imports and deps.
Would be happy to update with a different comparison you think is more fair.
How about we just don't compare lines of code at all, as if it's a useful metric of anything?
"Measuring programming progress by lines of code is like measuring aircraft building progress by weight."
-- attributed to Bill Gates
For measuring bloat however they're a good proxy.
Is there a metrics that can convey the complexity of a general purpose init system like systemd vs a single purpose init like Talos' machined?
That is what I was trying to convey and couldn't find a reasonable metric.