172 points · by ducktective · 5y ago · 106 comments
This is still better than original Discourse which for this same thing needs 6MB of data (1.2MB compressed). However Discourse does not claim to be efficient or elegant.
This kind of web performance engineering attention to detail will go a long way. The benefits for users on slower connections are particularly important. And as an engineer, showing few KBs of information with few MBs of data should bother you. Your information to data ratio is less than 1%. Excessive reliance on JS does not help. The best way to think about JS is as a feature enhancer not a feature requirement.
See also: https://idlewords.com/talks/website_obesity.htm
Having said that I think it is absolutely great that you are doing this and I hope we can get efficient and elegant forum software. This will certainly help nim adoption if executed in the way that is true to your values.
Edit: A competitor has been mentioned in comments:
https://fluxbb.org/forums/index.php
They are showing similar amount of information in "only" 100KB of total data. And 80% of it is CSS (which does seem excessive for what it does, I am sure 5KB of CSS would do the same job taking that page to amazing 25KB of total data).
As a basis of comparison, HN's home is 43k, and old.reddit.com is currently 3.16MB including all assets, the sole markup is 363K (gzip'd to 104).
That being said, I agree that the web is bloated and needs to go on a diet. We just need to be careful on where to spend our energy for optimization (caches are great and we should rely on them).
Web perfomance optimization tells me a lot about a product and its priorities. I do not mind bloated products that perform a certain function well for their users and never try to pretend to be optimial from an engineering standpoint.
But this is nim, language that markets itself as efficient and elegant, and execution like this can hurt their credibility and brand perception in the very community they are trying to market themselves in (developers).
Back in 2018 when I implemented the basis for this modern reimplementation of the Nim forum I focused on the functionality and a solid CI so that we can easily accept others' contributions without fear of regressions. Unfortunately I had only 2 solid weeks to make this a reality and optimising the code size didn't make the cut.
Caches hang or crash my browser. Please don't. (Amazon Kindle Paperwhite – yes, this has been my only web browser several times – no, I will not replace it with another Kindle when it breaks)
The way I envision it is chat apps are yelling a question in a café, Discourse is walking into said café and setting down a sign then walking out, while classic forums are pinning a note in a library corkboard.
And so I decide to check out Discourse again, turns out they Announced [1] a $20m Series A Investment by Pace Capital and First Round Capital. Congrats.
1- There is excessive white-space everywhere (like every other modern web-app). I feel like it was designed as a mobile-first solution.
2- There could have been smarter features regarding gamification and karma. Currently you can only hit like button (the total like count of a user is not even visible)
3- If a post has many replies, it only shows them up until a certain point and you have to scroll down to view more. These javascript shenanigans should not exist in a forum app IMO.
I have never used a nimforum-based forum but a quick browse in https://forum.nim-lang.org/ shows that their UI is more dense (less white-space) which addresses point 1 above.
That’s wonderful. Definitely a fantastic decision to help prevent toxic conversations. So glad that “feature” doesn’t exist on Hacker News or in Discourse.
When I ask a technical question on a forum, I'd like to know if a user who is deemed helpful in the community (by like count or `solved` count) is replying to me.
So many programmers have this obsession with interfaces having every available piece of information displayed all at once. I just don't understand the appeal. I find these sorts of interfaces confusing and overwhelming, I literally can't think straight when I look at them. I immediately forget what I was doing due to all the distractions.
No JS no joy. You see a completely white page, because none of it works without JS, not even an indication can be seen, that JS is required and it is waaay off of anything having a non JS fallback.
The above also means, that any knowledge in there will not be found via search engines. I have had it happen, that there was a forum of some community, and I did not even know it existed, even though I searched loads of stuff about the project. It simply never appeared in any search result ever. It is not discoverable.
Aside from not being discoverable, I find that any traditional forum software works better than discourse. For example I cannot properly see when exactly a reply was written, because it abstacts from a simple timestamp and shows only a month and year for example.
As for the timestamp, click or hover over the timestamp to see the full date/time, etc.
The only content is in a <noscript> tag, so this complaint is probably coming from people only blocking third party JS.
When reading a random Discourse forum I don't intend to participate in, blocking all JS usually results in a smoother experience than accepting scripts from discourse-cdn.com. The only exception I've found is for massive threads, because there's no JS-free search.
I have experienced it multiple times, that stuff is only in some discourse forum and I see a blank white page. Basically a JS-wall. Not sure, if the people, who hosted it did something weird to cause that issue, but that is the impression I have of discourse forums. Rarely I allow its scripts to run and make the effort to view some content in any such forum. Usually I just close the tab.
Edit: Now I know why I might have had that experience: I also block loads of third party CDNs. Perhaps they were trying to load scripts and resources from there and that's why nothing was shown.
Edit2: But you are also correct: The Nim one does not show anything without JS.
Google's crawler can index JS-only content just fine:
https://www.google.com/search?q=site:https://forum.nim-lang....
What I don't understand is why discourse can't serve up content that isn't interactive. I get lazy loading if there are >1000 comments on a post, but for anything else, static content should be perfectly fine. Even when you have js on, ctrlf doesn't work because of dynamic loading so the site has to hijack the shortcut with different interaction patterns (pressing enter doesn't go to next result, it loads a separate page).
I just tested with the 999 comment post on that site. First page load with no cache is 5.98MB (1.25MB) and took 5.76s load time. Holding the end key to get to the bottom until I hit the last post downloads a total of 1.91MB (718KB transfer) and takes 70s! That's including all the pictures. That cannot be better than than loading all text and optionally deferring all img loads, right?
Yes, I agree. I like the FluxBB based forum that Arch community uses and find the look & feel a good balance between excessive use of whitespace and overly cramped UIs.
> No JS no joy. You see a completely white page, because none of it works without JS, not even an indication can be seen, that JS is required and it is waaay off of anything having a non JS fallback.
I am not sure if this is configurable but the official kotlin forum [1] uses discourse and I can see the content when js is disabled. A lot of interactivity is disabled but the footer does have a clear message that the site is best viewed with js enabled.
I have often found kotlin forum posts through google search, so there doesn't seem to be any issue on the SEO front.
In case there are any programmers in this comment thread, more interesting to me than the amount of whitespace or how similar the interface is to Discourse, is the source code. It's a great example of the power of the Nim language for application programming.
If you are looking for something minimal with threading support, fossil scm [2] includes a forum. You can checkout the forum for fossil itself which is powered by fossil.
As someone not too familiar with Django, this looks like a nice codebase :)
But am I right that there are no tests?
And, though this is more subjective, I find the UI confusing. I end up browsing the github issues or even reddit for answers to questions just to avoid discourse on projects that use it (discuss.linuxcontainers.org - I'm looking at you).
Every page takes a few seconds to load. If you open a page in a new tab, you still need to wait for it to load when you switch to the tab. The forum was the most annoying thing about using the language.
Go try it out: https://forum.nim-lang.org/
I'm regularly seeing 500ms on page loads. Very frustrating when you open pages in new tabs, but they're not loaded when you go to switch over.
Could definitely use a lot of minification.
https://nim-lang.org/docs/backends.html#backends-the-javascr...
It appears that the way it does that creates a lot of global vars and functions.
How is code generated? Using llvm-lib, transpiling to C, js?
Interaction with other libraries?
(You have to install Tor Browser to open these onion links https://www.torproject.org/download/)
The source code is open - GPLv3 License.
(There are clearnet->tor gates, but you should not use them.)
(There are clearnet->tor gates, but you should not use them.)
But there don't seem to be filters, like only showing posts older than a certain date. Or with a certain comment threshold.
Pass.