4 ms·
What made me pick Go over Nim is a bigger standard library. For my use Nim is missing a good http server package/module and templating. If those two things had
by mrweasel 6y ago
What made me pick Go over Nim is a bigger standard library. For my use Nim is missing a good http server package/module and templating.
If those two things had been present I would pick Nim over Go, it’s just a nice language for some like me, who have mostly done Python.
I’m not sure if this was a bug in a third party module, but I also struggled a little with unicode support.
- otherme123 6y agoTemplating as in Jinja? I'm using Karax (https://github.com/karaxnim/karax#server-side-html-rendering https://github.com/karaxnim/karax#server-side-html-rendering) and it's awesome.
- mrweasel 6y agoThat’s nothing like Jinja, it’s more like React. I just want text templating and not a virtual dom and I don’t want to build my HTML in Nim.
- planetis 6y agoWe have many https://nimble.directory/search?query=template https://nimble.directory/search?query=template Also karax can also work as on server side, no virtual dom in that scenario. People prefer it because of type checking over string templates.
- mrweasel 6y agoI think I tried most of those templating options, but some seems to have been abandoned, many try to abstract the html away and most are incomplete. Nwt seemed like the most promising, but it don’t even allow loops in your template.
- planetis 6y agoI really don't understand what your requirements are. Again karax is well known and better alternative than all these (i.e loops and other control flow work as expected).
- mrweasel 6y agoUnderstandably, I don't think I explained it all that well. If I look at the Karax example, it seems more like a way of building the HTML in Nim, but I want to write HTML. If you look at Jinja2, then it's HTML, but with a bit of embedded syntax to do loops, conditionals and string replacement, plus a few handy functions. The built in templates in Go is a bit simplistic, but it's enough for my needs. So something like it would be nice. As you pointed out the Karax it has type safety, which my suggestions doesn't have. It's also not required, because HTML/text templates doesn't need type safety, it's all just text. Basically I want nwt, with loops and control statements implemented.
- planetis 6y agoThis might do it https://nim-lang.github.io/Nim/filters.html https://nim-lang.github.io/Nim/filters.html
- xigoi 6y agohttps://nimble.directory/search?query=mustache https://nimble.directory/search?query=mustache
- sigzero 6y agoSomething like: https://nim-lang.org/docs/asynchttpserver.html https://nim-lang.org/docs/asynchttpserver.html https://github.com/zendbit/nim.zfblast https://github.com/zendbit/nim.zfblast
- mrweasel 6y agoZfblast seems new, so maybe. The asynchttpserver does work, but it’s simply not as good or complete as the one in Go. It might just be to low level.
- planetis 6y agoAlso httpbeast and GuildenStern https://github.com/dom96/httpbeast https://github.com/dom96/httpbeast https://github.com/olliNiinivaara/GuildenStern https://github.com/olliNiinivaara/GuildenStern