Live data from Hacker News

Nim 2.0 thoughts

forum.nim-lang.org

111–120 of 150 posts

Re: Nim 2.0 thoughts

#111

Earlier quoted context omitted.

Templating as in Jinja? I'm using Karax ( https://github.com/karaxnim/karax#server-side-html-rendering ) and it's awesome.

That’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.

We have many 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.

Re: Nim 2.0 thoughts

#112

Earlier quoted context omitted.

That’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.

We have many 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.

I 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.

Re: Nim 2.0 thoughts

#113

Earlier quoted context omitted.

I think one reason is that there's no big corporation behind it, for Rust it was Mozilla and now the members of the Rust Foundation, for Go it is Google. But I totally agree, Nim is an awesome language and definitely deserves more attention!

Didn't python start this way 25ish years ago? It then has slowly and steadily gained developers. Nim might also be there in another 15 years.

Python did had a couple of smallish killer applications like Zope, being used as scripting language in 3D applications, and gaining adoption among Perl users after Perl 6 never ending story.

Additionally Guido has always worked in well known companies, and Microsoft and IBM have toyed with Python on their products as well.

Re: Nim 2.0 thoughts

#114
post #66

Earlier quoted context omitted.

Nim is getting very close to Rust in terms of safety (but without the verbose ownership management) https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc... https://nim-lang.org/blog/2020/12/08/introducing-orc.html

Memory safety with GC is easy. Rust is novel because it offers memory safety without GC. Your links mention GC.

Can Rust deal with linked lists as well? Nim has a cycle collector based on the trial deletion algorithm https://researcher.watson.ibm.com/researcher/files/us-bacon/... It's different than the usual GC algorithms.

Re: Nim 2.0 thoughts

#115
post #66

Earlier quoted context omitted.

Nim is getting very close to Rust in terms of safety (but without the verbose ownership management) https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc... https://nim-lang.org/blog/2020/12/08/introducing-orc.html

Memory safety with GC is easy. Rust is novel because it offers memory safety without GC. Your links mention GC.

[deleted]

Re: Nim 2.0 thoughts

#116

Earlier quoted context omitted.

We have many 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.

I 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.

I 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).

Re: Nim 2.0 thoughts

#117
post #94

Earlier quoted context omitted.

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.

Something like: https://nim-lang.org/docs/asynchttpserver.html https://github.com/zendbit/nim.zfblast

Also httpbeast and GuildenStern

https://github.com/dom96/httpbeast https://github.com/olliNiinivaara/GuildenStern

Re: Nim 2.0 thoughts

#118
post #61

Earlier quoted context omitted.

Actually, in Nim "functionName", "function_name" and "functionname" are equivalent and interchangeable

So one needs to grep 3 times instead of once in a code-base. Why did the authors chose this abominable convention ? It makes maintenance a nightmare.

nimgrep solves this, you might not like it, but people who have actually tried it are fond of it.

Re: Nim 2.0 thoughts

#119
post #53
post #20

Earlier quoted context omitted.

The equivalent in Python would be: T = TypeVar("T") def odd_numbers(a: list[T]) -> Iterator[T]: # implementation I don't really find that less verbose, in terms of brackets and symbols…

Does Nim have comprehensions? Even if you're striving for equivalent signatures the inner body of the function can be expressed as a comprehension in Python: T = TypeVar("T") def odd_numbers(a: Iterable[T]) -> Iterator[T]: yield from (n for n in a if n % 2 == 1)

That's an obscure/not optimal way to write this code though. I mean why would you use LIST comprehension if you are going to yield each element.

Re: Nim 2.0 thoughts

#120
post #63

Earlier quoted context omitted.

Nim compiles to C and then runs GCC (not LLVM) to compile the binary. Overall, it's much faster than Go and Rust.

Is transpiled C readable?

If you disable all runtime checks, like integer overflows, range checks, etc..., stack traces and debug information (-d:danger) it's readable yes.
Post reply on HN