News for hackers. Stuff that matters.
Re:Show HN: NimForum – A lightweight alternative to Discourse by beagle3 on Saturday May 26, 2018 @10:31AM (#17162232)
Nim is awesome - the programming language, the community, and the emerging ecosystem. Live example, for discussing the Nim programming language: https://forum.nim-lang.org/ ; Dominik Picheta (dom96), the main author of NimForum, is one of the core Nim language developers and is one of the people making the Nim community so awesome. Thanks, Dom.

The Nim developers practice dogfooding, and NimForum is one result of that practice. I haven't had much mileage with this new version (the actual Nim forum was updated just a couple of days ago), but the previous revision was incredibly fast and responsive, and had the feature of running example code within the forum. The usefulness of this feature in a programming language forum cannot be overstated -- I think it shortens the average discussion thread by 50%, and makes it way more useful to boot.

This newer version looks much better but has two issues compared to the previous one: (a) it won't run example code within the forum, and (b) it won't work without JavaScript. IIUC the first will be solved shortly, the second might take a little more time (but ... if you can just run the older version in the mean time if it bothers you).

Re:Show HN: NimForum – A lightweight alternative to Discourse by dom96 on Saturday May 26, 2018 @11:24AM (#17162521)
I didn't realise the ability to run Nim code on the forum was such a coveted feature. I did initially plan to reimplement it for the new forum (the "Run" button is there, it just needs the logic), but sadly I ran out of time and decided to prioritise other things.

I've thought about continuing the non-SPA nature of the original forum, but with Araq's new Karax framework being available I couldn't resist using it (and of course Araq really wanted me to as well). Even though the forum doesn't run without JS I do still think this was a good decision. In the long run we can probably render the page on the server side, because the front end is written in Nim this should be fairly simple.

Re:Show HN: NimForum – A lightweight alternative to Discourse by beagle3 on Saturday May 26, 2018 @11:43AM (#17162613)
For sure, the new version is much more aesthetically pleasing and (if JS is enabled) at least as functional. I wasn't trying to criticize anything, just point it out as a matter of fact. I think it's a good decision too, even though I generally like non-js sites. Did you verify that Google and DuckDuckGo manage to index the forum topics? That would be my concern, much more than the "no JS, lame" crowd.

Every programming language forum has, in about 80% of the answers including a code sample, a disclaimer of the ".. or something like this, I didn't actually try to run it" -- and usually the answer also has a type, missing import/include, etc - which makes it less useful for newbies, even though it's usually helpful enough to more experienced users.

The only languages for this isn't true (that I've seen) are the APL/J/K family, where a complete working answer is usually 2-3 lines so people try it in a console before posting; and Nim since you introduced the "run" button to the older forum.

Re:Show HN: NimForum – A lightweight alternative to Discourse by Quequau on Saturday May 26, 2018 @12:48PM (#17162964)
Slightly off topic but... my social circle grew concerned about our privacy some years ago and some of us, including myself, really didn't want to continue using a 'private' Facebook group. After a fair bit of trial and error we wound up using a vanilla Discourse image on some AWS provider. It's turned out to be the best think we've done for our friendships in decades.
Re:Show HN: NimForum – A lightweight alternative to Discourse by yoavm on Saturday May 26, 2018 @04:12PM (#17164037)
Can you share more on how you use it?
Re:Show HN: NimForum – A lightweight alternative to Discourse by Quequau on Sunday May 27, 2018 @06:21AM (#17166316)
I'm not a web guy so I'm not 100% familiar with the details but as far as I understand it's nothing more than a vanilla Discourse image from an outfit called bitnami running on the smallest instance available on Amazon... and absolutely nothing else.

Presumably it's what discourse looks & acts like before people wrap their business logic / webpage around it.

Re:Show HN: NimForum – A lightweight alternative to Discourse by yoavm on Sunday May 27, 2018 @03:29PM (#17168666)
oh I didn't mean from the technical aspect. I meant socially, how it works. What kind of things your friends post there, how often you go check what's up with them, with type of discussions you have there etc'.
Re:Show HN: NimForum – A lightweight alternative to Discourse by Quequau on Monday May 28, 2018 @11:23AM (#17172902)
I don't use any other social media. So I post everything that pops into my mind, news that I read elsewhere, things that go in my life, and often stuff that's much more personal than I would have ever posted anywhere else. The discussion is much the same as what I suppose people have on Facebook, Instagram or whatever... though it's orders of magnitude more civil and reasonable.

Roughly half the group has also abandoned all other social media, while the other half occasionally act as a Facebook diode by posting worthy or important things they might come across.

As the group now lives in several different countries on different continents, having a mechanism that helps us work around time zone constraints which isn't an unmanageable tangle of email chains is hugely beneficial. It's remarkable how making things easier to keep track of wound up facilitating a lot more discussion.

Also as it's just us we have no constraints concerning thread life cycles. So when something occurs that relates to our discussion in some ancient thread it's not a problem to revive it. So we've got threads that run over the course of five years.

Re:Show HN: NimForum – A lightweight alternative to Discourse by jtrtoo on Monday May 28, 2018 @07:58PM (#17175496)
How much do the connections between the people in your friend group overlap?

How do you deal with people you're connected with but not necessarily others in the group?

Just thinking out loud. Thanks for sharing!

Re:Show HN: NimForum – A lightweight alternative to Discourse by Quequau on Tuesday May 29, 2018 @01:43AM (#17176766)
Everyone in the group has known each other since the late seventies, we just don't live in the same places anymore. It's just us and, except for a couple of deaths, the group hasn't changed size in a couple of decades. We haven't and wouldn't invite anyone else.
Re:Show HN: NimForum – A lightweight alternative to Discourse by gyyfl on Saturday May 26, 2018 @10:45AM (#17162304)
This is great but I wish developers would get away from naming software based on the language it's coded in, in general. It's purely a public relations thing but I think the practice creates an impression of valuing process over product, and conceptually ties a product to a particular language ecosystem as a sort of implicit presumption.
Re:Show HN: NimForum – A lightweight alternative to Discourse by reificator on Saturday May 26, 2018 @11:05AM (#17162424)
Libraries I don't mind: how much time do you really want to spend naming the 394th serialization library?

But for products aimed at end-users? Absolutely don't name it after the language it's written in.

To play devil's advocate for a moment though: this is the software used to run the forum for the language Nim. If you've ever been to the Nim forums, this is a version you can run yourself. Maybe that makes the name a bit more reasonable?

Re:Show HN: NimForum – A lightweight alternative to Discourse by dom96 on Saturday May 26, 2018 @11:28AM (#17162542)
I do agree that NimForum is a bit of a lame name for end-users. The initial NimForum implementation was very much intended to only be used for the Nim community, with this new version I wanted to make it possible for others to use it as well. I have thought about creating a new identity for this project, but I couldn't come up with a good name on the spot (or at least one that others liked), so for now I just decided to keep the old NimForum name.

Certainly if there is interest I will happily consider rebranding.

Re:Show HN: NimForum – A lightweight alternative to Discourse by tbirdz on Saturday May 26, 2018 @12:26PM (#17162852)
What about NimbleForum? Still keeps the Nim reference, while also giving the impression of a fast and light forum.
Re:Show HN: NimForum – A lightweight alternative to Discourse by dom96 on Saturday May 26, 2018 @12:29PM (#17162865)
Hehe, good idea, but that clashes with the name of our package manager: https://github.com/nim-lang/nimble :)
Re:Show HN: NimForum – A lightweight alternative to Discourse by reificator on Saturday May 26, 2018 @07:15PM (#17164692)
How about Jack, because he's nimble and quick and jumped over the candlestick?
Re:Show HN: NimForum – A lightweight alternative to Discourse by pavlov on Saturday May 26, 2018 @04:58PM (#17164213)
How about DeNim — since it came from Nim.
Re:Show HN: NimForum – A lightweight alternative to Discourse by apocrypher on Saturday May 26, 2018 @07:13PM (#17164684)
NimTalk?

NimSquawk?

from the very obvious to the whimsical:

NimmoPhon

Nimference

Nimbeaumôt [sic]

Nimditer

Echonim

Edit:

how I missed Nimsical, I don't know..

Nimminent

I am pushing it rather, so I'll quit while I'm behind... Sorry, but I have to try suggesting PhonoNim, after [0] thinking of phone typos in text conversations.

[0] https://www.urbandictionary.com/define.php?term=phononym

Re:Show HN: NimForum – A lightweight alternative to Discourse by e12e on Saturday May 26, 2018 @04:20PM (#17164072)
Since it's a forum using jester; troupe ? Ensemble ?
Re:Show HN: NimForum – A lightweight alternative to Discourse by beagle3 on Saturday May 26, 2018 @11:49AM (#17162650)
Occasionally things change enough that a rebranding is in order.

Kodi was previously XBMC which stood for "X-Box Media Center" long after the X-Box was no longer their focus of development (and perhaps even completely unsupported).

Your criticism applies equally to phpBB, and is valid. I suspect if NimForum becomes popular, the Nim part of the name will go away.

Re:Show HN: NimForum – A lightweight alternative to Discourse by WalterBright on Saturday May 26, 2018 @11:52PM (#17165369)
The D language forums:

    https://forum.dlang.org/
are powered by DFeed, written in D:

    https://github.com/CyberShadow/DFeed
Re:Show HN: NimForum – A lightweight alternative to Discourse by vasili111 on Sunday May 27, 2018 @12:34AM (#17165445)
It is very fast and responsive. It is really a pleasure to navigate it :)
Re:Show HN: NimForum – A lightweight alternative to Discourse by ShorsHammer on Sunday May 27, 2018 @08:10AM (#17166574)
Just a note: Those links aren't clickable :(
Re:Show HN: NimForum – A lightweight alternative to Discourse by SamReidHughes on Monday May 28, 2018 @08:47PM (#17175642)
I clicked them just fine (??).
Re:Show HN: NimForum – A lightweight alternative to Discourse by bberrry on Saturday May 26, 2018 @10:32AM (#17162236)
Thanks, this is the first thing I've seen actually implemented in Nim. Will be interesting too look through some actual code.
Re:Show HN: NimForum – A lightweight alternative to Discourse by accnumnplus1 on Saturday May 26, 2018 @01:05PM (#17163041)
Having had only the briefest of looks at Nim (the last 60 seconds), it seems most comparable to Go - correct? Anyone more clued up feel like contrasting the two?
Re:Show HN: NimForum – A lightweight alternative to Discourse by e12e on Saturday May 26, 2018 @04:12PM (#17164031)
I'd say go is to c as nim is to Pascal would be one approximation. But that doesn't really do justice to nim's power in the form of meta/compile time programming and such.
Re:Show HN: NimForum – A lightweight alternative to Discourse by k__ on Saturday May 26, 2018 @04:58PM (#17164209)
I had the impression Nim was Python in fast.
Re:Show HN: NimForum – A lightweight alternative to Discourse by nitely on Saturday May 26, 2018 @06:54PM (#17164631)
Some of the syntax is similar, but similarities end there. Nim was inspired by many languages: Modula 3, Delphi, Ada, C++, Python, Lisp, Oberon, C# and Pascal.
Re:Show HN: NimForum – A lightweight alternative to Discourse by kybernetikos on Sunday May 27, 2018 @03:41AM (#17165936)
The forums seem simple, pleasant and fairly snappy to navigate.

I've recently been looking at 'head-less' CMSs. Does anyone know of forum software that separates the head from the backend via a well described API? I'd like to be able to embed a forum into a front end application that I already have, so having a 'head-less' forum would be pretty useful.

Re:Show HN: NimForum – A lightweight alternative to Discourse by dom96 on Sunday May 27, 2018 @07:40AM (#17166503)
NimForum does exactly that. The API probably isn't as stable as it could be though. Discourse could be another alternative for you.
Re:Show HN: NimForum – A lightweight alternative to Discourse by wiradikusuma on Saturday May 26, 2018 @10:54AM (#17162354)
I wonder why sqlite? Isn't quite limiting for a client-server app?
Re:Show HN: NimForum – A lightweight alternative to Discourse by mwcampbell on Saturday May 26, 2018 @11:11AM (#17162453)
I suppose nimforum's developer is comfortable limiting it to just one web server, because with an efficient, AOT-compiled language like Nim, a single server can bear a heavy load.

Still, performance isn't everything. What about high availability through redundancy? I see that forum.nim-lang.org is behind CloudFlare. Is that the answer?

Finally, what about disaster recovery? In the absence of replication, I hope forum.nim-lang.org at least has backups.

Re:Show HN: NimForum – A lightweight alternative to Discourse by dom96 on Saturday May 26, 2018 @11:39AM (#17162601)
You're very right to point out high availability and disaster recovery. I must be honest that I haven't considered the impact that the use of SQLite has on redundancy, but in the multiple years that I have been running the forum I never needed it, a single instance of the forum works perfectly fine. I would say that for most communities, setting up the forum on a VPS and letting it run will be perfectly adequate and that creating redundant servers would be overkill.

As for backups, of course we do have them. Although I've also recently learned that we could be handling them better. SQLite has a backup API that we should make use of[1].

The main reason I have set up CloudFlare is for DDoS protection. I learned the hard way that Digital Ocean will null route a VPS' network if they detect a DDoS.

1 - https://www.sqlite.org/backup.html

Re:Show HN: NimForum – A lightweight alternative to Discourse by mwcampbell on Saturday May 26, 2018 @11:41AM (#17162607)
Fair enough. How do you do backups?
Re:Show HN: NimForum – A lightweight alternative to Discourse by dom96 on Saturday May 26, 2018 @11:50AM (#17162658)
Mainly using DigitalOcean's droplet backups.
Re:Show HN: NimForum – A lightweight alternative to Discourse by omnimus on Saturday May 26, 2018 @03:23PM (#17163803)
This thread reminds me of Basecamps Getting Real book.

Just getting it done. I am now intrigued to try Nim if you are core dev.

Re:Show HN: NimForum – A lightweight alternative to Discourse by mwcampbell on Saturday May 26, 2018 @12:30PM (#17162870)
Have you researched the potential pitfalls of relying only on crash-consistent VM backups? For example, I read that if you're using the ext4 filesystem, the data=journal option is safer than the default (data=ordered, I think).
Re:Show HN: NimForum – A lightweight alternative to Discourse by dom96 on Sunday May 27, 2018 @09:17AM (#17166773)
Nope. I should probably read up on it a bit more :)
Re:Show HN: NimForum – A lightweight alternative to Discourse by dom96 on Saturday May 26, 2018 @11:32AM (#17162564)
For our use case, SQLite has been working fine for many years. I like to think that for most communities SQLite will be perfectly adequate. The main reason for choosing SQLite is that it is much simpler to work with, you don't need to spend time setting up a mysql or postgres server.
Re:Show HN: NimForum – A lightweight alternative to Discourse by beagle3 on Saturday May 26, 2018 @12:11PM (#17162780)
If it isn't already, it's worth switching the sqlite database to WAL mode (perhaps even by default, or as an admin option) using "pragma journal_mode=WAL"[0]; In standard "journal_mode=DELETE" mode, readers don't block readers, but readers do block writers, and writers do block both readers and writers. In WAL mode, readers do not block writers and writers do not block readers - the only contention is that writers block writers -- so you get much better performance and much less waiting in most use cases.

The downsides of WAL mode are:

(a) simple file copies are much more fragile - unless you have a "point-in-time" backup, you essentially must use the backup API to copy the database, or alternatively use [1] which does it for you; Best practice is to do that even if you do have a "point-in-time" backup.

(b) All processes that use the WAL database simultaneously must be on the same host. This is NOT a requirement for standard mode -- you only need an underlying filesystem without a broken locking implementation[2]..... (I would trust no NFS implementation based on history; No idea if SMB or AFS is trustworthy -- but if your underlying filesystem is good, you actually can do load-balancing / high availability through the file system with a standard-mode sqlite backend)

[0] https://www.sqlite.org/wal.html

[1] https://stackoverflow.com/questions/25675314/how-to-backup-s...

[2] https://www.sqlite.org/howtocorrupt.html#_file_locking_probl...

Re:Show HN: NimForum – A lightweight alternative to Discourse by dom96 on Saturday May 26, 2018 @12:31PM (#17162873)
Sounds good. I added an issue for this: https://github.com/nim-lang/nimforum/issues/138. Thanks!
Re:Show HN: NimForum – A lightweight alternative to Discourse by gravypod on Sunday May 27, 2018 @08:18AM (#17166604)
What I'm interested in is why write all of your code for a single database? Are there no query level abstractions for Nim? Even a basic ORM or even a query-builder would allow portability across systems.

Writing for a single db is a bad idea.

Re:Show HN: NimForum – A lightweight alternative to Discourse by syseng1002 on Tuesday May 29, 2018 @05:14AM (#17177592)
> Writing for a single db is a bad idea.

That's quite a bold statement. Abstractions are never free. Abstract too much and you end up with something slow, that uses the common subset of many databases, and requires very extensive testing.

Re:Show HN: NimForum – A lightweight alternative to Discourse by dom96 on Sunday May 27, 2018 @04:51PM (#17169037)
Indeed, Nim badly needs a good ORM library. Maybe you'd be interested in creating one? :)
Re:Show HN: NimForum – A lightweight alternative to Discourse by gravypod on Sunday May 27, 2018 @05:09PM (#17169124)
ORMs are extremely simple to implement. I've written them a few times in Java for simple things. Primarily you need something equivalent to reflection so you can read from and inject into any properties that an object might contain. Does Nim have this kind of feature set?
Re:Show HN: NimForum – A lightweight alternative to Discourse by dom96 on Monday May 28, 2018 @06:01AM (#17171586)
I've never written one, I always thought it's one of those things that sound simple but actually require a lot of careful thought and design.

Nim doesn't do reflection, but it has some of the best metaprogramming features including static introspection tools which are far superior to reflection IMO.

Re:Show HN: NimForum – A lightweight alternative to Discourse by gravypod on Monday May 28, 2018 @06:30AM (#17171661)
It just takes some opinions. If you haven't developed any yet just take someone else's opinions. Eloquent is a good start for where to look. The QueryBuilder frame is a nice platform that makes available many nice features.
Re:Show HN: NimForum – A lightweight alternative to Discourse by weego on Sunday May 27, 2018 @07:37AM (#17166493)
Why would forum software be a good use case for an SPA?