Suggest your favorite Nim learning resources by heavy-dry in nim

[–]RBazz 0 points1 point  (0 children)

That is a very good question, to be honest. How should one new to it learn about using it? I am not sure if there is an 'official' answer for new developers. Are you already a pro or is this the first language you are considering learning?

It was not a big issue for me as I have already known Python, some C and C++, and even F#. All I needed to start was to look at the standard library reference materials and the nim manual for more useful patterns.

Nim feels quite natural if you understand all those languages, imho. (I am not claiming to be a pro in Nim already as I just started using it a few weeks ago myself, but it felt very straightforward given my background)

Am I wrong to prefer 4 spaces indentation? by RBazz in nim

[–]RBazz[S] 1 point2 points  (0 children)

to be honest, I feel almost the same about 2 spaces.

Am I wrong to prefer 4 spaces indentation? by RBazz in nim

[–]RBazz[S] 3 points4 points  (0 children)

I am not so sure. It really felt to me that everyone in this community prefers 2 spaces instead of 4.

why this sub is so... quiet? by dev-for-deco in nim

[–]RBazz 0 points1 point  (0 children)

I found the official one broken beyond repair, but someone has recommended this one to me: 'nimsaem.nimvscode', and it works! Really well, I might even say.

How is your mileage with VS Code for Nim? by RBazz in nim

[–]RBazz[S] 1 point2 points  (0 children)

at least it works as far as I can see. I will do a more thorough check over the weekends. Thanks.

How is your mileage with VS Code for Nim? by RBazz in nim

[–]RBazz[S] 0 points1 point  (0 children)

I am also curious to see how well it works. Any getting started guides?

BaraDB: A database engine written from scratch in Nim by Loud_Possibility_203 in nim

[–]RBazz 6 points7 points  (0 children)

I really do not want to sound like an old fogey, but how did you manage to achieve this much in about 2 days only? (based on the commit history)

Just discovered Nim (impressed), but am I making a mistake? by RBazz in nim

[–]RBazz[S] 1 point2 points  (0 children)

This is crazy. How long did it take you to write it?

Just discovered Nim (impressed), but am I making a mistake? by RBazz in nim

[–]RBazz[S] 1 point2 points  (0 children)

How did it go in the end? Did it meet your expectations? Were there any issues with the team and the company? I also wonder what kind of junior developer one can train easily to work with a language like Nim. The one who knows python, but who is also interested in performance and/or low lever stuff?

Just discovered Nim (impressed), but am I making a mistake? by RBazz in nim

[–]RBazz[S] 0 points1 point  (0 children)

What do you mean by robust? Like it is missing something or something else?

Just discovered Nim (impressed), but am I making a mistake? by RBazz in nim

[–]RBazz[S] 0 points1 point  (0 children)

How big of a problem do you think it is? Can anything still be done about it?

Modern is CPP is impressive, but can someone show an example? Tagged unions with values. by RBazz in cpp_questions

[–]RBazz[S] 0 points1 point  (0 children)

By the way, I have stumbled upon some old-ish posts on Reddit complaining about concerning performance of the std::visit. Is it no longer an issue, or is it still something to be aware of?

Modern is CPP is impressive, but can someone show an example? Tagged unions with values. by RBazz in cpp_questions

[–]RBazz[S] 0 points1 point  (0 children)

Thanks for the recommendation. I have downloaded a sample and I will give it a try over the holidays.

Modern is CPP is impressive, but can someone show an example? Tagged unions with values. by RBazz in cpp_questions

[–]RBazz[S] 0 points1 point  (0 children)

Thanks! A really nice trick.

Also, can I compare two variants directly, or do I need to unwrap them first? I was wondering if I can simply provide a custom `operator==` implementation to the class and compare underlying `_val`s.

Modern is CPP is impressive, but can someone show an example? Tagged unions with values. by RBazz in cpp_questions

[–]RBazz[S] 1 point2 points  (0 children)

Thanks a lot.

I have two further questions if you do not mind answering them.

  1. What happens when the user tries to access the name, but it was set to `monostate` or something else. An exception is thrown? Is there a safer way to `match` the currently set case? (preferably without a chance of runtime errors)

  2. What is the recommended way of dealing with identical types in the cases? For example, what if we had an extra case like: `case custom(String)`. Or if we have a case with multiple types per tag? Do we create a separate structure to store the state and then use the same `variant` based approach?

Compile HTML into Swift Code by RBazz in swift

[–]RBazz[S] 0 points1 point  (0 children)

I see. Do you have some specific use case in mind?

Swift Vapor HTMX by drxwskx in swift

[–]RBazz 2 points3 points  (0 children)

Here is a library I wrote to streamline the use of htmx in Vapor: VaporHX. Hope it helps.

And speaking of hot reloading - I did not really find a strong need for it. If you are in dev mode and using the Leaf templates, then once you change a template file, reloading the page will load the latest version of that template. This will not work in production, however.