A seasoned programmer's take on Nim's docs

2023-01-04 Thread jtv
In my experience, decisions on language choice in most of the big tech companies are generally bottoms up. The company often won't have any oversight on language choice. I've seen people in big tech companies consider not going with Rust because they were worried about the size of the talent poo

A seasoned programmer's take on Nim's docs

2023-01-04 Thread carterza
> That's a reasonable concern for sure. Still, until the cloud providers find > Nim important enough to ship their own SDKs, this is a MAJOR use case in the > real world, and will be a real impediment in to adoption in a lot of tech > companies, if it's not easy to find something that works well

A seasoned programmer's take on Nim's docs

2023-01-04 Thread jtv
> I'd prefer to not have integration with proprietary commercial software as > part of the standard library. That's a reasonable concern for sure. Still, until the cloud providers find Nim important enough to ship their own SDKs, this is a MAJOR use case in the real world, and will be a real im

A seasoned programmer's take on Nim's docs

2023-01-04 Thread xigoi
> I'd get the inscrutable "Could not Instantiate T" with no other context to > indicate WHY instantiation wasn't possible. This is why I think improving error messages should be a bigger priority for Nim. > Another example of that one; I recently had need to use object storage. > There's one f

Regex error - "Error: missing closing ' for character literal"

2023-01-04 Thread xigoi
You can also use a triple-quoted string literal: temp = temp.replace(re"""{%[\n\r\t\0\s]?(include|INCLUDE)\s(\".+\"|\'.+\')[\n\r\t\0\s]?%}""", "It works!") Run

Delete items in a seq while iterating over it?

2023-01-04 Thread ElegantBeef
I generally just do the normal iterate `countDown(mySeq.high, 0)` and either `del` or `delete` depending if order matters. It's simple but it works :D

Delete items in a seq while iterating over it?

2023-01-04 Thread moigagoo
If your goal is to filter out elements based on some criteria, I'd say the idiomatic way tondi that would be to use filter/filterIt or keepIf/keepItIf procs from std/sequtils.

The state of GPU codegen with Nim (bonus: LLVM JIT codegen)

2023-01-04 Thread elcritch
Thanks for the writeup @mratsim! It'd be great to be able to do GPU / NN stuff in Nim (again). Note that I really dislike LLVM -- it sucks as a user because the libraries break compatibility regularly. Your distro provide LLVM13 but your compiler needs LLVM14, etc. Then Apple's LLVM builds ofte

Delete items in a seq while iterating over it?

2023-01-04 Thread elcritch
A number of times I've wanted to iterate through a sequence and delete various items in it. However, that causes errors. I'm curious if there is an idiomatic Nim way to do it? I'm sorta hoping there's a nice tool in system.nim?

Regex error - "Error: missing closing ' for character literal"

2023-01-04 Thread luqaska
I just tried your solution and it worked as intended! Thank you very much!!!

-d:useMalloc fixes memory leak, but I don't know why

2023-01-04 Thread jasonfi
At some point I'll create a minimal program that reproduces the issue. But I'll also retest with each new version.

A seasoned programmer's take on Nim's docs

2023-01-04 Thread namisboss
I apologize for not having read absolutely everything in this thread, but I wanted to throw two ideas out. What if on the documentation pages there was an optional feedback popup (they would need to click it to see it) that could ask basic questions like "Why did you come to this page", "How go

Regex error - "Error: missing closing ' for character literal"

2023-01-04 Thread jrfondren
Consider: import re let x = re"a\"b" Run Which fails to compile with `Error: closing " expected` This isn't a special regex syntax, but 'generalized raw string literals', and raw string literals require embedded double quotes to be doubled rather than escaped: <

A seasoned programmer's take on Nim's docs

2023-01-04 Thread jtv
> Along those lines some specific actions that I think would be promising would > be: > > working towards a nim foundation (see previous discussion). A foundation > could foster the creation of specific official working groups on various > matters (documentation, ecosystem, funding, ...) and it

A seasoned programmer's take on Nim's docs

2023-01-04 Thread jtv
Hey there! I'm going to start with your ending, then go back up to the top. > Finally, there are enough breadcrumbs in your replies to make me guess > (without being afraid of an unintended reveal ;)) that your identity is John > Viega, correct? It is very nice to see an established industry pla

nimqt - bindings to Qt

2023-01-04 Thread grd
Yes, I saw it. Excellent work! Tomorrow I am gonna try it.

Regex error - "Error: missing closing ' for character literal"

2023-01-04 Thread luqaska
Hello, I've been having this error lately while using regex. This error only occurs while using Nim, because I tried this thing on different Regex testing websites and it seem to work. I'm desperate to get your help and find to find a solution. I'll leave my code below. Thank you, Luqaska.

Is there a traditional rounding function?

2023-01-04 Thread jdf
Wow, can’t believe I hadn’t heard of this.

A seasoned programmer's take on Nim's docs

2023-01-04 Thread pietroppeter
as far as some of the additional questions asked: > 1\. Is driving more adoption of Nim a meaningful goal? that's an easy yes, but it I guess it is a rethorical question :) > 2\. If so, what are the biggest hurdles? For me the number one priority is working on **building the community** , in p

A seasoned programmer's take on Nim's docs

2023-01-04 Thread jtv
> > Ideally, someone compiles a numbered list from this thread with actionable > > issues or action items and we create an issue/documentation roadmap from > > this. > > What I'd suggest is a #docs (and a #bugs) room in discord. Even if everyone's > not there, it serves as an easily searchable

nimqt - bindings to Qt

2023-01-04 Thread jerous
It was actually not too difficult to implement loading .ui files using my approach :) In examples/load_ui.nim there's an example (see also )

A seasoned programmer's take on Nim's docs

2023-01-04 Thread pietroppeter
first of all, thanks for the detailed write up on an experienced outsider's perspective on nim docs! I will address mostly the original message, trying to offer remarks that have not been already made. > multiple people who understand generics and interfaces in other languages, > but don't find

A seasoned programmer's take on Nim's docs

2023-01-04 Thread jrfondren
> Ideally, someone compiles a numbered list from this thread with actionable > issues or action items and we create an issue/documentation roadmap from this. What I'd suggest is a #docs (and a #bugs) room in discord. Even if everyone's not there, it serves as an easily searchable appendix for th

A seasoned programmer's take on Nim's docs

2023-01-04 Thread mratsim
Let's take the personal issues, the generalization issues and name calling out of this thread. Or we or at least I unfortunately will have to lock it. It does happen that Nim veterans get fatigue and are more abrupt in some situations (from replying to "Nim is not a compiler it's a transpiler" t

A seasoned programmer's take on Nim's docs

2023-01-04 Thread pp
Hey guys... we are here for the same reason: we love Nim Make Love and not War. And about documentation we will expect pull requests from @jtv ! Keep going to improve further Nim during this year!

A seasoned programmer's take on Nim's docs

2023-01-04 Thread jrfondren
> More broadly, the thread's about driving Nim adoption, and there, it sounds > like a lack of general kindness and professionalism does seem to be a thing > that drives people away, as well. Even if you are trying to get someone to > write posts that better fit the standard you expect, note tha

A seasoned programmer's take on Nim's docs

2023-01-04 Thread jtv
> > for trying to make people talk to each other in a more respectful and > > professional way > > This is a statement about your intentions behind making your post. My > statement is about your post itself. The thread's about documentation. Did > your post concern documentation? Your intention

A seasoned programmer's take on Nim's docs

2023-01-04 Thread jrfondren
I've found the strscans documentation helpful, sure. My experience with strscans docs is limited to looking at the very first example (yep, that's how scanf assigns its arguments) and then the very first table (yep, those are the `$blah` that I need to match this input). Since I've used sscanf b

-d:useMalloc fixes memory leak, but I don't know why

2023-01-04 Thread Araq
Well ARC/ORC is responsible for calling `free` (with or without `-d:useMalloc`) and since it doesn't leak with `-d:useMalloc` it's likely Nim allocator's fault. The allocator got an overhaul for its multi threading support so it's probably related.

The state of GPU codegen with Nim (bonus: LLVM JIT codegen)

2023-01-04 Thread guibar
> I wasn't aware of Axel and it's definitely very interesting. I'm surprised > you managed to have {.kernel.} work without going through the pain of > rewriting the AST to avoid Nim artifacts like in > `kernel` mostly tags the proc w

The state of GPU codegen with Nim (bonus: LLVM JIT codegen)

2023-01-04 Thread guibar
Sorry, bad phrasing, I was commenting on axel. What I meant was, when you compile a project with axel, with staticExec a second compilation is done on your project with nlvm-gpu.

A seasoned programmer's take on Nim's docs

2023-01-04 Thread jrfondren
> for trying to make people talk to each other in a more respectful and > professional way This is a statement about your intentions behind making your post. My statement is about your post itself. The thread's about documentation. Did your post concern documentation? Your intentions were to en

A seasoned programmer's take on Nim's docs

2023-01-04 Thread freeflow
If you don't want folks to look at the nim manual as a tutorial then you should say so in the first paragraph of the manual and give a link to one or more tutorials. Taking the table you provided ,why not include that in the first paragraph of each of the types with links to appropriate sections

A seasoned programmer's take on Nim's docs

2023-01-04 Thread planetis
I would like to ask a question instead, for modules that there is arguably more documentation, [strscans](https://nim-lang.org/docs/strscans.html), have these examples been useful to understand how these macros work? Looking back, I would remove some of them, especially the link parsing one. But

A seasoned programmer's take on Nim's docs

2023-01-04 Thread mratsim
I feel like a parrot but taking this for example > A good example of the style of documentation that makes things difficult for > beginners is the ‘Iterators and the For statement’ section in the Nim manual. > From a beginners perspective this might be better presented as two sections, > one ab

The state of GPU codegen with Nim (bonus: LLVM JIT codegen)

2023-01-04 Thread mratsim
> About compile-time generation, for info I experimented with a CUDA-like > approach based on nlvm some time ago: . It > is still quite unfinished, though. I wasn't aware of Axel and it's definitely very interesting. I'm surprised you managed to have `{.kernel.

A seasoned programmer's take on Nim's docs

2023-01-04 Thread 0x0000ffguy
There is too much personal feeling in your message, I understand why but, please, I did not mean to lecture you on what you should do. Here is the thing: because this is a recurring heated topic, some experienced project contributors may be on the defensive toward anyone who bring up the subjec

A seasoned programmer's take on Nim's docs

2023-01-04 Thread Zoom
The important issue that becomes obvious reading this thread is the culture mismatch. There's different approaches to working on an open and community-driven project, there's different approaches to collaborating with other developers in such projects. Some prefer diving in and exploring things

A seasoned programmer's take on Nim's docs

2023-01-04 Thread freeflow
A good example of the style of documentation that makes things difficult for beginners is the 'Iterators and the For statement' section in the Nim manual. From a beginners perspective this might be better presented as two sections, one about the For statement, the second about iterators and thei

A seasoned programmer's take on Nim's docs

2023-01-04 Thread Hlaaftana
> I have the impression people here feel superior for using or creating Nim and > look at others as not worth having them in the boat. I think the main sentiment is that people see Nim as a fragile baby that either needs to be defended from any attackers or needs every possible weak point to be

A seasoned programmer's take on Nim's docs

2023-01-04 Thread 0x0000ffguy
Hmm... I have the strange feeling that if the same amount of energy (and passion?) was spent discussing this recurring documentation topic, Nim would certainly be one of the best documented project in the world. One point though IHMO: if some improvements in the docs may be brought more easily b

A seasoned programmer's take on Nim's docs

2023-01-04 Thread ElegantBeef
> have the impression people here feel superior for using or creating Nim and > look at others as not worth having them in the boat. I'm interested in concrete examples of this, but probably not best to pick. More often then not people suggest ideas in naivety that do not match the Nim way of d