Where to start with creating direct Qt bindings?

2022-10-21 Thread grd
Take your time but keep us informed ;-) If you need more info about Qt then maybe I or someone else can help you.

NimConf 2022 - Saturday, October 22nd

2022-10-21 Thread giaco
Hype!

NimConf 2022 - Saturday, October 22nd

2022-10-21 Thread carterza
Also, just wanted to add that the number of libraries Treeform and Guzba have authored is quite impressive, thus the comment about running out of names :) I haven't used any personally but I've heard good things from others that have.

Error using `bindSym` at compile time

2022-10-21 Thread Araq
> A bit offtopic, but this is the kind of explanation for these sort of > features that would really help a lot to have written up in the manual. I refuse to mention `dynamicBindSym` until I can foresee its consequences for the Nim spec and implementation.

Compile time safety for case object fields

2022-10-21 Thread Araq
https://github.com/nim-lang/Nim/pull/20614

NimConf 2022 - Saturday, October 22nd

2022-10-21 Thread carterza
I think it refers to boiling the ocean / embracing NIH syndrome / doing everything yourself / yak shaving. Treeform and co have written their own libraries for everything, and they have similar sounding names like: `jsony` and `pixie` and `netty` because I guess once you start trying to do ever

Compile time safety for case object fields

2022-10-21 Thread deech
I am able to reproduce with: nim c -r --warning:ProveField:on /tmp/test.nim Run Yes that is odd. I'm not sure why the warning triggers in the loop but not above. FWIW I can get the warning to go away with: for node in list: let n = node[] case

Compile time safety for case object fields

2022-10-21 Thread axyz
I'm on version 1.6.8 I can try updating anyway if I run `nim c -r --forceBuild --verbosity\:0 --hint\[Processing\]\:off --excessiveStackTrace\:on test.nim` or even just `nim c test.nim` it compiles without warning and outputs foo hello Run if I run with `nim c -

Compile time safety for case object fields

2022-10-21 Thread deech
I do not see a warning when compiled with: nim c -r --forceBuild --verbosity\:0 --hint\[Processing\]\:off --excessiveStackTrace\:on /tmp/test.nim Run I also tried it with the `--warning:ProveField:on` flag, still no warning. My nim version: Nim Compiler

Error using `bindSym` at compile time

2022-10-21 Thread sls1005
> in a language like Nim that doesn't have any stages above "compile time" Then how could i do this static: const a = static: let b = static: var c = static: 2 * 2 static: assert not(c is static) c - 1 static: assert not

Compile time safety for case object fields

2022-10-21 Thread axyz
not sure if I got the issue right. If the problem is related to partial initialization, why it affects also accessors? e.g. # node is correctly initialized with all fields let n = Node(kind: nkChild, name: "foo") case n.kind of nkChild: echo $n.name #using case statement

Compile time safety for case object fields

2022-10-21 Thread deech
This is unfortunate but happens because you are initializing a `ref` object which allows unsafe partial initialization, making a `NodeObj` first errors the way it should without adding any warning flags: type NodeKind = enum nkParent, nkChild Node

Test for static in macro

2022-10-21 Thread sls1005
Use a recursive macro. import macros const constant = "abc" macro mymacro(hasResult: static[bool] = false, isConst: static[bool] = false; idt: typed = nil): untyped = if hasResult: if isConst: echo idt.strVal, " is const" else: echo i

Where to start with creating direct Qt bindings?

2022-10-21 Thread jerous
Still working on it, but I don't have that much time and it's going slow. There's a lot of exceptions and corner cases going that have to be taken care of. But so far I have most of QtCore already converted. Next up QtGui and QtWidgets, which should hopefully go smoother. Then I'll post here an

NimConf 2022 - Saturday, October 22nd

2022-10-21 Thread cblake
Seems to have made front page of HN (for now).

Compile time safety for case object fields

2022-10-21 Thread axyz
the problem seems to happen inside loops: let list = @[Node(kind: nkParent), Node(kind: nkChild)] for node in list: case node.kind of nkParent: node.children = @[] # inside the loop results in warning, if not in a loop is fine as in previous post of

Compile time safety for case object fields

2022-10-21 Thread axyz
ok, this is working: let a = Node(kind: nkParent) case a.kind of nkParent: a.children = @[] else: discard Run I guess it makes sense as the kind could change at runtime so the compiler needs a case or if to infer it. Still on a more complex code I ha

Enums, custom overloads & redundant strings

2022-10-21 Thread drkameleon
Answering my own case, in the example above to avoid the default strings for the enum, all I did (and it did work) was to directly assign the string values (inside the _enum_ definition) and avoid the `$` overload altogether. Quite an obvious solution, I guess... :)

Compile time safety for case object fields

2022-10-21 Thread axyz
sorry if the code is not too clean, when I do let a = Node(kind: nkParent, children: @[]) # this is fine (now warnings) echo $a.children # this throws a warning (cannot prove that field is accessible) Run Myabe I am missing something, but was expecting that once `a

Compile time safety for case object fields

2022-10-21 Thread Araq
`--warning[ProveField]:on` works but depending on your shell you can also write it as `--warning:ProveField:on`

Enums, custom overloads & redundant strings

2022-10-21 Thread drkameleon
Jesus christ! I forgot to make the `$` overload public... How stupid! (I re-organized the code/modules a bit and that's the side effect :S) (I have had such issues in the past and I thought it was something else; in this case, it was just me. Jesus!)

NimConf 2022 - Saturday, October 22nd

2022-10-21 Thread pietroppeter
Happy and excited about the upcoming NimConf!🥳 🚀 Very curious about all the talks but I gotta ask: @treeform what does "Scratch built games" mean? Games built from scratch? Does it has anything to do with ? Me and @hugogranstrom probably overdid it a bit in terms of t

Enums, custom overloads & redundant strings

2022-10-21 Thread drkameleon
I'll show you the example in question... Here we have the **printable** module, which comes with a `$` overload which is supposed to take Value objects and return them stringified. As you can see there are different _kinds_ of Value objects, so the stringification process varies accordingly. L

Enums, custom overloads & redundant strings

2022-10-21 Thread ElegantBeef
If you run the code you will see it does not print out `"Hello"` as `$` was bound at the generic's declaration. If you have generic code you can sometimes walk into a generic issue where your procedure is not properly being chosen. Without code that reproduces this error it's hard to say more.

Enums, custom overloads & redundant strings

2022-10-21 Thread ElegantBeef
If your overload is in scope it will call your procedure as it's the most specific. Now this is not true if a generic procedure `bind` s shut a procedure: proc doThing(a: auto) = bind `$` echo $a type A = object proc `$`(a: A): string = "Hello"

Enums, custom overloads & redundant strings

2022-10-21 Thread drkameleon
My main case is an `enum` value inside an `object`. Both the object and the enum have `$` overloads. Generally, it works as I expect it to. Until it doesn't... (as for `bind`, I've never ever used it; I'm not sure I fully understand your point...)

Compile time safety for case object fields

2022-10-21 Thread axyz
cool, I have 2 questions/issues though: 1\. I was able to enable the warning using a pragma like `{.warning[ProveField]: on.} ` on top of the file, but not sure how to pass it as a compilation argument. I tried nim c or nimble build with that argument and it says `no matches found: --warning[Pr

Enums, custom overloads & redundant strings

2022-10-21 Thread drkameleon
I have defined an enum type like: type myEnum = enum someValue = "str-Value" anotherValue = "another-Value" Run with a `$` overload like: func `$`*(v: myEnum): string = case v: of someValue: return "one"

NimConf 2022 - Saturday, October 22nd

2022-10-21 Thread miran
NimConf 2022 will be held **tomorrow, October 22nd, from 10:00 UTC**. We have 11 pre-recorded talks, which you'll be able to watch live as they premiere and interact with the authors via YouTube live chat. Here is a dedicated web page where you can see all the talks and their timeline: