News for hackers. Stuff that matters.
Re:Mastering Nim – now available on Amazon by jasfi on Thursday June 30, 2022 @01:00AM (#31928852)
I totally agree, Nim is great but it really needs more traction. I'm developing a web framework for Nim with batteries included (an ORM, for one), Nexus: https://github.com/jfilby/nexus
Re:Mastering Nim – now available on Amazon by rishav_sharan on Thursday June 30, 2022 @02:14AM (#31929176)
jasfi, I am actually following your project and wanted to take this moment to ask a couple of questions. How are you planning to solve for Postgres drivers/clients with async and pipelining support?

I had added nim std lib to the Techempower benchmarks, and while Nim shines in the plain text and other non db related requests, it comes at the very bottom as far as tests like Fortune go. When I did the work, there were no maintained/active Postgres drivers with async and pipelining support. And IMO, that wa the biggest reason why Nim hasn't had great benchmarking scores.

Re:Mastering Nim – now available on Amazon by jasfi on Thursday June 30, 2022 @04:37AM (#31930045)
Glad to hear you're interested in Nexus. The ORM currently uses db_postgres (from Nim's stdlib) only. I'm going to implement support for db_mysql and db_sqlite as well, it should be easy enough given how similar the API for the stdlib DB drivers are.

Actual work on DB drivers is out-of-scope for me though. I noticed there is an async Postgres driver available: https://github.com/treeform/pg. I don't know how well tested this driver is, and no mention of pipelining support.

It would be great to see Nim's web frameworks higher up on the Techempower benchmarks. Lack of such DB driver features usually comes down to time. The support for those features in stdlib would be a good bounty issue.

Re:Mastering Nim – now available on Amazon by prirun on Thursday June 30, 2022 @08:37AM (#31931611)
I did some testing with Nim a couple of years ago for HashBackup. Here's one of the db_sqlite issues I created:

https://github.com/nim-lang/Nim/issues/13559

I had much better luck with tiny_sqlite: https://github.com/GULPF/tiny_sqlite

Re:Mastering Nim – now available on Amazon by jasfi on Friday July 01, 2022 @02:03AM (#31942920)
It seems that issue is now fixed. Either way, Nexus will soon support multiple DB drivers, and I'll work on making adding new ones relatively straightforward.
Re:Mastering Nim – now available on Amazon by rishav_sharan on Thursday June 30, 2022 @06:14AM (#31930568)
I went with db_postgres as well. Unfortunately, it is not async. I did consider treeform's pg, but unfortunately i did not get any reply from him on my question so decided not to go with it for the TE benchmarks.

I think the lowest hanging fruit for db drivers would be to just wrap libpq, the default PG driver. Given Nim's c interop, that should be easy. I was planning to do that, but then life happened and I had to skip that project.

I would say, that if you are trying to create a very involved framework, you should look to solve this problem. Otherwise the current perf of db_postgres can be a big deterrent to a lot of potential users.

Re:Mastering Nim – now available on Amazon by jasfi on Friday July 01, 2022 @02:00AM (#31942906)
I agree that wrapping libpq sounds like a good idea.
Re:Mastering Nim – now available on Amazon by rishav_sharan on Friday July 01, 2022 @06:37AM (#31944587)
did a bit more digging and apparantly db_postgres wraps libpq already. So either nim is still using a very old version of libpq or it was never updated to use the async apis.
Re:Mastering Nim – now available on Amazon by giancarlostoro on Thursday June 30, 2022 @01:13AM (#31928912)
Nice one of the projects I want to work on is a simple text editor that lets you build and run. I think back to some of my favorite niche languages like Processing and Racket although I dont use them a ton when I do I love their interactive editors.

I am getting ahead of myself since I am still learning the language but I am coming from Python and various other languages so it has not been a complex transition.

Re:Mastering Nim – now available on Amazon by jasfi on Thursday June 30, 2022 @01:26AM (#31928956)
Nim also needs lots of example code for people to learn from. Even if people don't use Nexus, it's at least one more Nim project out there.
Re:Mastering Nim – now available on Amazon by giancarlostoro on Thursday June 30, 2022 @10:06AM (#31932498)
Do you have a Discord or anything? I'm interested in helping, I love Django and I would love to help any way I can.
Re:Mastering Nim – now available on Amazon by jasfi on Thursday June 30, 2022 @11:48AM (#31934215)
There's no Discord yet, just GitHub issues. Here's an issue to track this request: https://github.com/jfilby/nexus/issues/14

I'll email you regarding what/how to help.

Re:Mastering Nim – now available on Amazon by giancarlostoro on Thursday June 30, 2022 @12:59PM (#31935360)
Yes, that is fine, my email is in my profile. I'll look forward to hearing from you. I can help with the Discord if you need help.