Which VSCode plugin do you recommend?

2023-12-03 Thread Yardanico
> so it seems saem's plugin works with nimsuggest only Funnily enough it's a bit different, saem and kosz extensions both work with nimsuggest by default, but saem's plugin also offers an option to use LSP instead, albeit only with nimlangserver.

Why is "end" a reserved keyword?

2023-12-03 Thread Yardanico
In the past, Nim had syntax skin support, so `end` was reserved for a possible `end`-style syntax skin, although it got never implemented. The only skin that was ever made was braces (using {} instead of indentation), but it was eventually removed from the compiler.

Why is "end" a reserved keyword?

2023-12-03 Thread angus
Is it a vestige of an early hesitation about syntax? Or is it used some place I'm not aware of?

How to make a generic type parameter be late bound for evaluating proc parameter types?

2023-12-03 Thread jcosborn
A concept would be late bound type IntToStr[T] = concept type C when T is int: C is string else: C is T proc test[T](t: IntToStr[T]) = discard test[int]("") test[float](1.0) Run

Which VSCode plugin do you recommend?

2023-12-03 Thread mskuma
No it doesn't seem to.. but I'm a new Nim user so I might have just done something wrong. I just tried installing the nimlanguageserver (via nimble, which requires a path to gcc to compile it) and then enabling it via the { "nim.provider": "lsp" } setting JSON or the setting UI directly in the

NPainter: semi-gpu accelerated digital painting software

2023-12-03 Thread kongxua
This is a good idea! how about the drawing program right now. Some good recommendations about the best digital painting software here: , You can use them as a reference.

Which VSCode plugin do you recommend?

2023-12-03 Thread giaco
I'm with vscode + nimlsp boat at the moment using bung87 extension. In my experience, saem extension fails to keep/kill nimlangserver background processes in order due to some heisengbug I yet have to investigate, and sometimes OOM is triggered due to 30GB of nimlangserver processes accumulating

Which VSCode plugin do you recommend?

2023-12-03 Thread giaco
https://github.com/saem/vscode-nim/issues/131

Enu 0.2

2023-12-03 Thread dsrw
[nim-godot](https://github.com/pragmagic/godot-nim) is excellent. Rock solid in my experience. However, it's mostly unmaintained and it's Godot 3 only, which is at this point is a fairly major issue. It's still working very well for me, but it's hard to look at the shiny new Godot 4 features and

Object variant - returning different types

2023-12-03 Thread Isofruit
You're running into a classic problem :-D No, it is not possible. This is the "cost" that Object variants bring with them - You need to explicitly describe what should happen for every scenario the variant could be in. There is no "dynamic" programming in that sense, the static type system won'

Object variant - returning different types

2023-12-03 Thread PMunch
No, this is not possible. Nim is quite strict about types, and a procedure can only have one specific return type. For your case however a custom `+` operator and a `$` proc should solve what you want to do in an easy way.

Object variant - returning different types

2023-12-03 Thread mantielero
I am struggling with something like the following: type MyVariant = object case kind: bool of true: intValue: int of false: floatValue: float proc getValue(variant: MyVariant): auto = if variant.kind: result = va

FMU - C interop

2023-12-03 Thread mantielero
Thanks @Araq. When I try that, the generated C code looks good: typedef N_CDECL_PTR(void, tyProc__cHW7sT4DDkMwCdiO69bkpDw) (void* c_p0, NCSTRING instanceName_p1, tyEnum_fmi2Status__tRvUjl2s9cdFxDxRk7K39cSA status_p2, NCSTRING category_p3, NCSTRING message_p4, ...); Run

FMU - C interop

2023-12-03 Thread Araq
`a6: varargs[fmi2String]` is wrong, instead you should use the `.varargs` pragma.

thread process can not change text buffer

2023-12-03 Thread tissatussa
Thanks to @Isofruit and @Araq for the detailed and honest feedback. I appreciate a working example. I have to study this, i've not tested the code yet. To accomplish what i want, the way threads must (not) be used now becomes more clear - it was really hard to find a solution / setup for it, for

Nim - plugin for IntelliJ IDEs | JetBrains

2023-12-03 Thread Yardanico
Looks like the developer has continued the development and has updated the plugin to work on newest versions of IDEA (from reviews): > Devon, thanks for feedback and sorry for the problems. I haven't tested the > plugin with recently released Nim 2.0 yet. I will ensure that everything > works f

Advent of Nim 2023

2023-12-03 Thread Boston
My first advent of code, my solutions will live here

FMU - C interop

2023-12-03 Thread mantielero
I am working on a project where I try to export FMU (which it is a format used for simulations). I have a couple of working examples where I manage to export a FMU, but they show an error when I pass a fmuchecker on them. The failure that I get from fmuchecker is: [ERROR][FMUCHK]

Advent of Nim 2023

2023-12-03 Thread remix
All years since 2016 done in Nim

Errors within async are not being raised

2023-12-03 Thread Nlits
Thanks for your reply! I had something similar set before with a wrapper proc, but decided to change it because changing all the arguments twice was tedious. I am going to retry that method but with a template or macro to make it easier.

Nimsuggest connection over sockets refused

2023-12-03 Thread Araq
Firewall?

Nimsuggest connection over sockets refused

2023-12-03 Thread LilKeet
Hey, all. I'm trying to interface with nimsuggest according to the the [Nim IDE Integration Guide](https://nim-lang.org/docs/nimsuggest.html) and have run into some issues with sockets. I'm trying to connect to nimsuggest over port 6000 but my connection keeps being refused. Any help would be gr

Operators.

2023-12-03 Thread Zoom
[The manual](https://nim-lang.github.io/Nim/manual.html#lexical-analysis-operators) is rather clear about the semantics in this case. Basically, operators are just regular functions that are named with any combination of the symbols in this list: = + - * / < > @ $ ~ & % | ! ? ^ .

re.findBounds doesn't return all matches

2023-12-03 Thread Charles
Oh I see that makes sense, thank you.

re.findBounds doesn't return all matches

2023-12-03 Thread dxb
My bad, I should have deduced which `findBounds` you were referring to from the type of the arguments passed to it. Nethertheless the `findBounds` you are using only returns the bounds of the first matching span of the string passed as first argument. The `matches` sequence contains the matched

re.findBounds doesn't return all matches

2023-12-03 Thread Charles
That's not the same findBounds I'm talking about, sorry I should have specified, I'm talking about this one: It takes an array of strings as parameters that it says it will fill.

Advent of Nim 2023

2023-12-03 Thread SpotlightKid
So, if you're not on the first private leaderboard can you at least somehow see it?

re.findBounds doesn't return all matches

2023-12-03 Thread dxb
findBounds <> has an optional `start` argument defaulting to `0` and will return the first match encountered scanning from `start` offset in the string. In order to return all matches I wrote this iterator: itera

Operators.

2023-12-03 Thread SpotlightKid
Please provide more context. In Nim you can define / override the behaviour for operators based on the type of the operand(s), so we need to see the code where the operator is used.

Operators.

2023-12-03 Thread AntonioFS
Hello. I don't understand the following operators, can you help me with examples? '@' '~' Thank you. Best regards. Antonio F.S.

re.findBounds doesn't return all matches

2023-12-03 Thread Charles
Hello, I'm confused about the behaviour of findBounds from std/re. It seems to only ever return the first match in the matches parameter and leave the rest empty. Here is a minimal example: import std/re let temp = findAll("Hello World", re"(\w+)") echo temp v

Which VSCode plugin do you recommend?

2023-12-03 Thread rel
How can I install in VSCode? It's not available in the VSCode Marketplace.

Which VSCode plugin do you recommend?

2023-12-03 Thread wwang1990
Yes, please