Exceptions not being handled with libuv: bug or what?

2023-11-20 Thread blackmius
with this code you specified you return earlier then raising an exception also check where the future.fail will lead. it jump into asyncCheck or something that awaits a coroutine and exception will be raised without emiting nimTestErrorFlag remove error checking part if err != 0:

NIR

2023-11-20 Thread Araq
> What made you choose your own over their supposedly mature and tested AST? NIR is higher level than LLVM IR and takes up less memory. I don't want to write the transformations that I have in mind with LLVM's IR.

slice assignment doesn't work when converter is present

2023-11-20 Thread veksha
thank you! bug reported:

Concept generics

2023-11-20 Thread LilKeet
As a forewarning: Concepts are one of the more experimental (and less functional) features in Nim. They have long been known to lead to [exponential compile times](https://github.com/nim-lang/Nim/issues/9422), [code-gen malfunctions](https://github.com/nim-lang/Nim/issues/13982), and more. But f

Concept generics

2023-11-20 Thread ElegantBeef
You can just do `: auto` then in the first line `result = default(myVal.x)` it's not ideal, but it's totally workable

os:any vs os:standalone

2023-11-20 Thread khaledh-nim
Sorry, follow up question. I noticed that if I put `--os:any` in a `nim.cfg` file, it doesn't take effect. It has to be passed on the command line to work. Is this by design or something overlooked?

Concept generics

2023-11-20 Thread icedquinn
I did note using concepts as return values gives errors about `typeof(result.x)`, so it's not seemingly possible to organically chain functions across disparate math types. Can be solved by having out parameters, but does make the API er. Weird to use.

Concept generics

2023-11-20 Thread icedquinn
thank you. i tried it and now it is working. previously it was giving odd issues about function signatures not being present even though the struct had those fields. i guess i was confused because `var` typically means variable and in the setters i did not use var because i was trying to match

Nim in university context?

2023-11-20 Thread amkrajewski
In my research group specializing in computational materials science and thermodynamics, I've been advocating for using Nim roughly once every two weeks with some success, as we have already reimplemented two Python packages we use internally. Some of my colleagues who almost exclusively use Py

Concept generics

2023-11-20 Thread ElegantBeef
type Vector3*[T] = concept var v v.x is var T v.y is var T v.z is var T proc doThing(v: Vector3[int]) = echo v doThing (x: 100, y: 200, z: 400) Run Although `V.x is var T` did work in my testing this is likely a more approp

Concept generics

2023-11-20 Thread icedquinn
How do these work? I don't see them mentioned in the documentation. I did try something like this: type Vector3*[T] = concept V V.x is var T V.y is var T Run But later attempts to use `Vector3[int]` failed saying I had supplied the `typedesc

How can templates detech if argument is let value or expression?

2023-11-20 Thread ElegantBeef
It is certainly documented There is no copying in the above code. As can be seen by the pointers. > Obviously, with literals and expressions the string does not exist on the > stack so copying is necessary Strings never exist on th

How can templates detech if argument is let value or expression?

2023-11-20 Thread ggb-sw1
@ElegantBeef Alas, if I understand what you are doing there correctly, it is exactly what I don't want to do. Aside from what I can tell, the cursor pragma is deliberately undocumented so is likely to change or be deprecated in future versions; but my intention in what I was doing was to ident

How can templates detech if argument is let value or expression?

2023-11-20 Thread ElegantBeef
Thanks to Orc/Arc cursors and COW string literals in this example you can likely use the following: import sugar import strutils template test2(src:string, lab: string = "Inner tmpl") = let s {.cursor.} = src # This works for let values but fails for expressi

Nim in university context?

2023-11-20 Thread PMunch
I used Nim while at university, even used it for my master's thesis. I wasn't required nor encouraged to use it, but we where allowed to use any language we wanted and I tried different ones for different assignments (until I found Nim that is). We had been taught C and Python for our beginner c

Nim in university context?

2023-11-20 Thread mszs
Is anyone aware of courses at university level in which students are at least encouraged to use Nim (if not required)? Any experience with students who learn python first and then switch to Nim would be appreciated. I'm considering whether I might do this. I once required all teams to use Scala

Question from one of my customers.

2023-11-20 Thread uzo2005
Hi, just in case you/your client wish to hire nim programmers (remote or in-office), please leave a post in the [nim discord job channel](https://discord.com/channels/371759389889003530/845770858470965258)

Lean Genix Keto ACV Gummies

2023-11-20 Thread garyjjohn
Official Facebook@Official Facebook>> Lean Genix Keto ACV Gummies:- The candies not only cause the body to enter a state of metabolic ketosis, which is advantageous in and of themselves, but they also increase our levels of energy and ath

Question from one of my customers.

2023-11-20 Thread AntonioFS
Hello. One thing I have read repeatedly on the Internet about Nim is that the Nim community is friendly and quick to help. I consider this very important and will pass it on to my client. As for what you are giving me as characteristics of the language compared to others (plus what I am learnin

What's stopping Nim from going mainstream? (And how to fix it?)

2023-11-20 Thread SolitudeSF
you're just proving my point

https://www.facebook.com/TryLeanGenixKetoACVGummiesUS

2023-11-20 Thread waigjohnson
Official Facebook@Official Facebook>> Lean Genix Keto ACV Gummies:- A person's basal metabolic rate (BMR) is much greater during sleep than it is during the day. When excess fat takes over a person's body, however, the amount of breathing

os:any vs os:standalone

2023-11-20 Thread khaledh-nim
Great! Thanks for the confirmation 👍🏼

How can templates detech if argument is let value or expression?

2023-11-20 Thread ggb-sw1
That was a direction I was thinking about, although I was not confident that I knew how to get the AST associated with the argument.

How can templates detech if argument is let value or expression?

2023-11-20 Thread Araq
You can analyse the passed AST inside a macro.

How can templates detech if argument is let value or expression?

2023-11-20 Thread ggb-sw1
The following code works for let variables and literals but gets compile errors for expressions. I want to be able to trap the expressions to treat them separately from let variables (as I do literals). #!/usr/bin/env -S nim r ## :File: test2.nim ## import sugar

Question from one of my customers.

2023-11-20 Thread ggb-sw1
The first question is how large is your codebase? If you have a large system then there will be a lot of code to translate to another language, which itself will create an overhead. The other thing to think about is that there is very good interoperability between Nim and C, so you can always l

What's stopping Nim from going mainstream? (And how to fix it?)

2023-11-20 Thread ggb-sw1
I have been playing with nim (totally private use) for a a few months. I generally use Geany as an editor. Support in Geany is somewhat mixed, and I would certainly like it much improved, but it has not been a show stopper for me. Lack of debugger support also generally has not been a show stop

gensym redeclaration

2023-11-20 Thread sky_khan
I dont know much about compiler internals but it may be related to optimization, I think. Global references are kept until exit so they're kinda const regarding to variable lifetime. Inside procedures compiler needs to keep track of assignments and refcounts and fails. Thats just a guess, I may

overload operator `+=` for private member

2023-11-20 Thread mimonot
Thanks everyone. I solved my question by adding a special method.

What's stopping Nim from going mainstream? (And how to fix it?)

2023-11-20 Thread Zoom
@xigoi How many time do you need to compile your project during the day? `cargo check` is usually enough for a basic cycle. I don't get the obsession with the compilation speed anyway, perhaps I don't work with big enough projects. I'm pumped for recent IC and IR developments not because of the

Question from one of my customers.

2023-11-20 Thread AntonioFS
Hello. Well, the thing is that at 61 years old I have been programming in some languages for about 40 years (Basic, Fortran, Cobol, Bal, Clipper, some Java and some Javascript together with HTML, CSS). This client started small and now has a group of five medium-sized companies. The thing is th

Question from one of my customers.

2023-11-20 Thread Clonk
> The main PROS of Nim are : * Strongly typed, statically compiled language that comes with battery included (the stdlib is not perfect, but it is a very good toolbox) * Readable syntax * Strong meta-programming which allows you to * Write better, more readable API * Find generic so

Question from one of my customers.

2023-11-20 Thread Araq
The problem domain (finance, AI, business software) and project structures are more important than the used programming language, so the company should not look for "Nim programmers" but for programmers that have experience in that problem domain. IME.

Templates: How to gensym proc names, and inject variables in asm?

2023-11-20 Thread PMunch
That example would indeed be great for the tutorial, please create a PR adding it! The macro you've created works fine, but as you mentioned that you didn't like the way it looked I took a stab at improving it: import macros macro interproc(): untyped = const errorin

What's stopping Nim from going mainstream? (And how to fix it?)

2023-11-20 Thread xigoi
Yeah, coping after having waited about ten minutes for a Rust program to compile, just to get an error that some library is not installed.

Question from one of my customers.

2023-11-20 Thread Zoom
I'm pretty confident your employer won't have much difficulty finding competent and available Nim developers if he targets the Nim community specifically. And, depending on the available positions and the scope of the project, even those who are willing to relocate to Spain.

Question from one of my customers.

2023-11-20 Thread PMunch
Sounds like the last programmer has left your client in a bit of a pickle. Nim, while being a fantastic language, unfortunately doesn't have the fame and userbase that some other languages enjoy. Because of this you will have a hard time finding a large pool of Nim programmers to pick from. On t

Templates: How to gensym proc names, and inject variables in asm?

2023-11-20 Thread Araq
Documentation PRs are as welcome as any other PR.

gensym redeclaration

2023-11-20 Thread dlesnoff
Thanks! I want to create two separate sequences. I guess this would be more clearer for the compiler: var (lower, upper) = (newSeqWith(n, newSeq[float](n)), newSeqWith(n, newSeq[float](n))) Run Before I raise an issue in the Nim repository, I would like to understand

slice assignment doesn't work when converter is present

2023-11-20 Thread janAkali
Looks like a bug to me, please report it on github. You can also add code example below. > in this small example i don't even use strings Converters enable implicit conversion. And combined with templates (used in the system library) it causes unexpected results: template inspect(

Templates: How to gensym proc names, and inject variables in asm?

2023-11-20 Thread Charles
Thanks for the hint, after a few hours breaking my teeth on it I got something working but it's really ugly: var interruptProcedures: array[32, uint64] macro interproc() = result = newStmtList() for iv in 0..<32: let wrapperName = if iv in erroring

What's stopping Nim from going mainstream? (And how to fix it?)

2023-11-20 Thread SolitudeSF
thats just coping