73
votes
Is the Tildes code base really only 1.3MB?
According to the repository, “project storage” amounts to 1.3MB. I know that this doesn’t include the data/posts of course, but that still seems impossibly small: https://gitlab.com/tildes/tildes
Isn't it nice when a project is lightweight and not bloated? A rarity it seems in web development these days. As an aside, I don't think Tildes runs all on its lonesome. There's a stack of required software which makes it work which may or may not themselves have rather large and extensive codebases.
It’s very refreshing - if that is the case! I wouldn’t count software dependencies in the project size either, unless they were patched significantly enough to be almost a different variant.
Here's the software stack for Tildes in case folks were curious: https://tildes.net/~comp/18bd/good_open_source_projects_to_contribute_to#comment-9nyn
And here's the instructions on how to start up a dev branch of Tildes on your local machine: https://docs.tildes.net/development/initial-setup
My heart aches that I know just enough about programing to follow the broad strokes, but not enough to actually contribute.
Everyone has their role to play, no matter how large or small! You're contributing just by sharing this information, and that's pretty rad.
Aw, you guys (@teaearlgraycold too) are making my heart feel all warm and fuzzy. :)
If you have time on your hands… It’s only a matter of time before you can contribute!
Couldn't be too terribly hard to make some custom .CSS files/values in the efforts of creating a couple themes...
I'm surprised about Postgres. I'd imagine Tildes would use NoSQL for getting information. Postgres just doesn't seem to fit the requirement of being scalable.
There was a comment Deimos made a couple weeks ago where he said as much -- that Tildes is nowhere near overloading its server's capacity from active usage nor user volume.
One thousand 80-character lines is 80kb. You can do a lot with 1000 lines of code. So, relatively speaking, it (1.3 MB) actually isn't that small...
My first language was assembly. I used to marvel at the size of things like printer drivers. "How is this 40MB? Is it sentient?" I couldn't imagine writing a program 1 whole megabyte in size.
Then I learned modern programming and continue to be increasingly horrified.
My mind's never gotten used to the bloated sizes. I did a Unity tutorial not long ago and was stunned that the output for that tutorial project—five-odd sprites and no audio/video—was just shy of 100MB! I had hard drives smaller than that!
What's actually happening there? Where is the increased size going to?
In Unity's case I imagine most of that space is going to be the engine itself, which will include everything it's capable of even if unused by the game.
The real game code (before il2cpp came along) should be in a file named Assembly-CSharp.dll (even outside Windows, as C# libraries share the same .dll extension as native Windows libs).
I haven't looked at tildes but I imagine it's doing similar things. There's a server written somewhere else, and a db, and probably docker and kubernetes running somewhere if it wants to scale. The actual app is a tiny part of a big beast.
https://tildes.net/~comp/18bd/good_open_source_projects_to_contribute_to#comment-9nyn
Not an expert myself, but from what I understand it's that the higher level your coding language becomes, the larger it becomes due to needing to translate through all the levels of abstraction.
This is partially true. It's still possible to write small applications with higher level programming. Most of the time, programs are large because of their dependencies. The other part is that we don't typically need our programs to be very small, so we don't usually try.
Web applications (like Tildes) are interesting because of the unique requirement of dealing with load times over the internet, which can vary vastly from user to user. Making web apps small goes a long way for this reason. Tildes was architected to be small on purpose to solve this issue.
That reminded me of kilo which I discovered a few years back: A pretty full-fledged editor… written in about 1000 lines of C. Without using ncurses.
Very good point.
I think even 1.3MB would be quite a bit higher than it actually is. Since that's the amount of storage being used on GitLab, I'd assume it probably includes the size of the entire development history inside the git repo.
There's also about 129kb of third-party javascript files here that the repo needs to include but aren't really "Tildes code": https://gitlab.com/tildes/tildes/-/tree/master/tildes/static/js/third_party
About 100kb of third-party SCSS in here: https://gitlab.com/tildes/tildes/-/tree/master/tildes/scss/spectre-0.5.1
And about 114kb of migration scripts in here that I wouldn't really consider "Tildes code" either (they're only for handling database changes between versions, not actively used at all): https://gitlab.com/tildes/tildes/-/tree/master/tildes/alembic/versions
There's even more that I'd probably exclude if I was trying to narrow it down to only Tildes code, like some configuration files inside the Ansible directory.
So it's hard to tell exactly, but overall I think something closer to 500kb would probably be more likely.
Wow, that’s absolutely fascinating. So not only can it fit on any old floppy disk, but it could fit on an Amiga 880k disk :)
Probably wouldn’t be hard to do a shallow git clone and figure this out for sure. I don’t have the time myself but it would certainly be an interesting figure to know.
That size does not include data, nor does it include Python dependencies. Each file is only a few KB (honestly the biggest file might be the license file haha).
It also doesn't include any dependencies, or the python runtime. Everyone talks about "bloated electron apps", but if you were able to look at just the code in the repo, it would also be similarly small; the "bloat" is in the entire copy of chromium packaged with the app, and all the dependencies in node_modules. CPython is quite heavy a hefty runtime, and the virtual environment any deployment of tildes would run in would have a pretty large bin folder too.
1.3 MB of business code is not a small number.
Almosy all the actual content is in a database, the source code is just a way to display it.
This site doesn't seem to have much complexity in the way it decides what content to display either. Also lots of the code to display an actual page is going to be reused in multiple pages or many times within the same page, so its written once then referenced multiple times.
Deimos has also said previously that a lot of the admin tasks are very manual. I take that to mean that there are no admin control panels so even less size.
If the site scales up I'm sure there will be more code and more features to handle the problems that arise.
Oh ya, this is also only available in English.
I had a look at mastadon's github and their source code is 64mb and having a VERY quick glance through it to see where the size comes from... half is photos. I also found a fonts folder thats 11mb.
Great comparison with Mastodon. So it’s true; Tildes can fit on a floppy disk :)
Yeah, Tildes just has one graphic in the logo I think which is probably just a few kB. I tried my hand at hobbyist game dev on Unity once and we spent some time discussing how to keep things lightweight. It was actually pretty fun to design good looking texture which fit our simplistic art style but barely take up any room. In modern gaming, uncompressed audio and graphics have ballooned some big name games to hundreds of GB which is crazy imo.
1.3MB seems like a lot