<< 28-07-2018 >>

00:04:43*couven92 quit (Quit: Leaving)
00:15:57*mwbrown quit (Ping timeout: 240 seconds)
00:16:04*ng0 quit (Quit: Alexa, when is the end of world?)
00:19:01*mwbrown joined #nim
00:21:29*endragor joined #nim
00:26:19*endragor quit (Ping timeout: 260 seconds)
00:44:47FromDiscord<awr> are there any libraries / std library procedures for pretty-printing the contents of object variables
00:45:13FromDiscord<awr> prettier than `$` i mean, with newlines and proper indentation
00:49:03FromDiscord<awr> actually i suppose i can just use nimyaml
00:53:42*NimBot joined #nim
00:53:43*leorize quit (Read error: Connection reset by peer)
00:54:36*leorize joined #nim
00:59:35FromGitter<kayabaNerve> treeform: TBH I rather not post my bounties here.
00:59:42FromGitter<kayabaNerve> And I won't.
01:02:59*stefanos82 quit (Quit: Quitting for now...)
01:03:14FromGitter<rayman22201> I don't think Nim has an official place for that sort of thing @kayabaNerve. Too small of a community atm.
01:04:26FromGitter<rayman22201> You could create a bounty on one of the big bounty sites and then advertise it on the forum and here in IRC. I think that's the best route for now.
01:15:31FromGitter<kayabaNerve> I don't want an official place; just to know where I have the best odds :P But I guess that isn't answerable either
01:16:34FromGitter<rayman22201> lol. Sorry man! #SmallCommunityProblems
02:33:28*PrimHelios joined #nim
02:34:09*ftsf_ joined #nim
03:04:20FromDiscord<2vg> Is it possible to make Future non-ref type with asyncfuture?
03:04:20FromDiscord<2vg> I guess that asyncdispatch will be faster.
03:18:21zacharycarter[m]ugh the playground box is so effed
03:18:34zacharycarter[m]`/` is at 100% inode usage somehow
03:18:42zacharycarter[m]dunno wtf created all those files
03:19:21zacharycarter[m]also - I don't know why the kernel version of the box and the docker version keep getting out of sync
03:19:48zacharycarter[m]and I can't figure out this closure gc ref issue - or at least find a way to work around it
03:19:59zacharycarter[m]not a great day
03:21:37zacharycarter[m]docker is the culprit
03:21:38zacharycarter[m]that bastard
03:21:58zacharycarter[m]79182 ./var/lib/docker/overlay2/l
03:34:38zacharycarter[m]deleting var/lib/docker took the inode usage from 100% to 7%
03:37:56*dddddd quit (Read error: Connection reset by peer)
03:39:55zacharycarter[m]playground's back up
04:02:16zacharycarter[m]emscripten source maps don't seem to work for me
05:00:38zacharycarter[m]compiling my Nim code with debug symbols might help πŸ˜€
05:21:26*kinkinkijkin joined #nim
05:48:35*leorize quit (Quit: WeeChat 2.2)
05:50:00*nsf joined #nim
05:57:55zacharycarter[m]quiet in here tonight...
06:02:41FromGitter<gogolxdong> Error: undeclared identifier: 'Channel' ⏎ cannot open channels if import .
06:03:09FromGitter<gogolxdong> channels.nim is under lib/system/
06:04:04Araq--threads:on
06:04:08zacharycarter[m]do you have threads on?
06:25:58*kinkinkijkin quit (Remote host closed the connection)
06:26:15*kinkinkijkin joined #nim
06:34:29FromGitter<Varriount> Yay, my shell is complete!
06:34:42FromGitter<Varriount> Well, for this course, anyway.
06:35:29zacharycarter[m]:D
06:35:36zacharycarter[m]congrats!
06:43:46*kinkinkijkin quit (Remote host closed the connection)
07:03:40*ftsf_ quit (Quit: Leaving)
07:14:23*wildlander quit (Quit: Konversation terminated!)
07:52:24*Trustable joined #nim
07:54:06*Vladar joined #nim
08:00:10*aguspiza joined #nim
08:13:37*gmpreussner_ joined #nim
08:14:47*gmpreussner quit (Ping timeout: 265 seconds)
08:16:05*xylef joined #nim
08:24:06FromGitter<mratsim> @Araq, I think closure procs are currently broken: https://github.com/nim-lang/Nim/issues/8432#issuecomment-408591628
08:31:27FromGitter<mratsim> ^ actually it’s closure + generics that is broken
08:45:40*Trustable quit (Remote host closed the connection)
08:49:43*xylef quit (Quit: WeeChat 2.2)
09:26:36*noonien joined #nim
09:30:35*dddddd joined #nim
09:53:59*nsf quit (Quit: WeeChat 2.1)
11:18:51aguspizazacharycarter[m]: nim playgroung is working again thx
11:27:55dom96So, what do you guys think about this new approach to package management that Russ Cox et al are proposing? https://www.youtube.com/watch?v=F8nrpe0XWRg&feature=youtu.be
11:49:10m712is https://github.com/zah/nim.vim dev
11:50:49m712oops didn't mean to post that
11:51:04m712are there any plans to add auto-completion support to nim.vim?
12:27:33*arecacea1 quit (Quit: WeeChat 2.0.1)
12:28:07*arecaceae joined #nim
12:38:40*yglukhov[i] joined #nim
12:39:02FromGitter<mratsim> so many PRs in the past week
12:47:09*yglukhov[i] quit (Ping timeout: 260 seconds)
12:47:24*yglukhov[i] joined #nim
12:49:48dom96m712: You'll have to ask zahary this. He's not really on IRC often though.
12:49:53dom96You can create an issue in that repo I suppose
12:57:31*yglukhov[i] quit (Read error: Connection reset by peer)
12:58:34*yglukhov[i] joined #nim
13:00:42livcd3How would i translate something like this to Nim ? uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr("blah")))
13:05:58*ng0 joined #nim
13:06:40dom96var x = "blah"; cast[ptr uint](x) # I guess?
13:06:47dom96Not familiar with Go
13:08:45livcdthanks i figured that it's wrapped already in winim :)
13:10:37dom96oh, so that is an actual Win API call
13:11:02livcdyes!
13:20:10*yglukhov[i] quit (Remote host closed the connection)
13:24:18zacharycarter[m]aguspiza: np
13:25:23zacharycarter[m]good day all
13:27:31livcdahh works flawlessly
13:32:21livcd...but does not work on windows 208
13:34:02*yglukhov[i] joined #nim
13:40:55FromGitter<imdaveho> just throwing a thought out there, but a dart backend make sense with flutter in the mix....we have js and since flutter is an aot to native that hits opengl to build x-plat uis, with nim able to target both ndk and obj-c, it would be a very compelling target to do end to end x-plat and perhaps off set any tradeoffs
13:42:02*dorelix quit (Quit: Leaving)
13:47:30zacharycarter[m]wouldn't it just make sense to write a library like flutter in Nim?
13:48:36zacharycarter[m]I don't think a dart backend makes much sense tbh
13:49:12*nsf joined #nim
13:50:04dom96I think new backends are a simple cost-benefit evaluation
13:50:42dom96I don't think the benefit of a Dart backend is higher than the cost of it.
13:51:41zacharycarter[m]I'd rather have NLVM than a dart backend
14:14:13FromGitter<rayman22201> Hey @dom96. Can you put your clang bindings on github? Please? 😁
14:14:53*yglukhov_ joined #nim
14:15:08FromGitter<rayman22201> I have an old C project I would love to do some analysis on
14:16:15*yglukhov[i] quit (Ping timeout: 244 seconds)
14:24:50dom96https://github.com/dom96/libclang
14:24:51dom96Voila
14:26:26dom96I might release my more advanced module as a separate lib later
14:26:29dom96but that will take more time
14:28:54*stefanos82 joined #nim
14:29:43FromGitter<citycide> getting `undeclared field: 'attrs'` from a karax `VNode` in a click handler, how is that possible when it's declared right here: https://github.com/pragmagic/karax/blob/015590e8060402f9f31a16f6de1d6371f64c3317/karax/vdom.nim#L125
14:31:14*dddddd quit (Remote host closed the connection)
14:33:05FromGitter<citycide> I get the same error with the `dom` field, the others seem ok
14:40:36zacharycarter[m]attrs arent exposed
14:41:48*yglukhov[i] joined #nim
14:43:58*yglukhov_ quit (Read error: Connection reset by peer)
14:47:15*yglukhov[i] quit (Ping timeout: 265 seconds)
14:48:29*ng0 quit (Quit: Alexa, when is the end of world?)
14:49:12FromGitter<gogolxdong> why does macro generate object as follows: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5c82683315465845761436]
14:50:09FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5c82a1cb4d5b036ca14b40]
14:53:37FromGitter<gogolxdong> I'm following `dumpASTGen`
14:56:03*rockcavera joined #nim
14:58:40FromGitter<citycide> zacharycarter[m]: ah, missed that. and apparently now `dom` doesn't error, I may have tried to access its `dataSet` earlier
15:03:37*yglukhov[i] joined #nim
15:05:44*yglukhov_ joined #nim
15:05:44*yglukhov[i] quit (Read error: Connection reset by peer)
15:09:39*Ven`` joined #nim
15:15:18*rockcavera quit (Remote host closed the connection)
15:17:42FromGitter<rayman22201> @dom96 thank you!
15:28:00*rockcavera joined #nim
15:28:01*rockcavera quit (Changing host)
15:28:01*rockcavera joined #nim
15:29:51*yglukhov[i] joined #nim
15:31:14*yglukhov_ quit (Ping timeout: 265 seconds)
15:38:53FromGitter<generative99> what is the nim equivelant of this casting?: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I convert the vector to seq[char] and then cast with "castptr uint32 (code[0]))" ... [https://gitter.im/nim-lang/Nim?at=5b5c8e0dbf754466066a32d3]
15:41:30*yglukhov[i] quit (Ping timeout: 256 seconds)
15:42:25*BitPuffin joined #nim
15:43:51*yglukhov[i] joined #nim
15:46:07*leorize joined #nim
15:46:08*yglukhov[i] quit (Read error: Connection reset by peer)
15:46:22*yglukhov[i] joined #nim
15:51:06dom96generative99: how do you convert to seq[char]?
15:51:19*yglukhov[i] quit (Ping timeout: 268 seconds)
15:53:22FromGitter<generative99> @dom96 : meant to say in Nim im using a sequence instead of a vector and when I need a point to the memory block i use ```addr varName[0]```, so I don't convert it I just start out with it at that value
15:53:43*yglukhov_ joined #nim
15:54:00FromGitter<generative99> This has works except in this instance
15:54:20*yglukhov_ quit (Read error: Connection reset by peer)
15:54:44*yglukhov_ joined #nim
15:59:30*yglukhov_ quit (Ping timeout: 256 seconds)
16:04:24*Perkol joined #nim
16:04:56FromGitter<generative99> The value it needs is a pointer to a memory block, but code[0] would just be casting the value at the first element right? but when I cast with ```castptr uint32 (addr code[0]))``` I get an ```Expression has no address``` error
16:07:32FromGitter<mratsim> expression has no address is because you are trying to cast something that does not have an address (a `const` or a literal) or you are not allowed to take it (a `let`)
16:07:46FromGitter<mratsim> if it’s a `let` try unsafeAddr
16:11:13FromGitter<generative99> @mratsim thanks I believe that worked, I used ```castptr uint32 (unsafeAddr code[0]))``` I'm getting a non Sigsegv vulkan message now
16:11:18FromGitter<mratsim> also `castptr uint32 (code[0])` means that you are interpreting the valude at `code[0]` as a pointer (ptrdiff = uint64 on x86_64) to an uint32 value. meaning it interpret code\[0\] and code\[1\] concatenated as a pointer, which probably doesn’t point to an addressable address
16:13:43FromGitter<mratsim> btw, you can use Arraymancer as reference to work with pointer on GPU, not familiar with Vulkan but I suppose it gets a lot of inspiration from OpenCL and Cuda: ⏎ ⏎ 1) https://github.com/mratsim/Arraymancer/blob/master/src/tensor/data_structure.nim#L196-L216 ptr to normal CPU seq ⏎ 2) https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/cuda.nim - ptr to Cuda ⏎ 3)
16:13:43FromGitter... https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/opencl_backend.nim - ptr to OpenCL [https://gitter.im/nim-lang/Nim?at=5b5c9637c83d1230b130c368]
16:14:40FromGitter<mratsim> The `ptr UncheckedArray[T]` type is especially useful because it supports indexing compared to simple `ptr T`
16:16:16FromGitter<generative99> @mratsim excellent thanks I'll keep reference to those
16:17:44*PrimHelios quit (Quit: Leaving)
16:18:50FromGitter<kayabaNerve> @mratsim I use everything as ptr T
16:18:59FromGitter<kayabaNerve> First name? ptr T
16:19:10FromGitter<kayabaNerve> Last name? ptr T
16:19:16FromGitter<kayabaNerve> Age as a whole number?
16:19:19FromGitter<kayabaNerve> ptr T
16:20:42FromGitter<kayabaNerve> You're 😀 not 😀a😀 real 😀C😀 Dev 😀 if 😀 you 😀 use 😀 anything 😀 but 😀void*😀
16:20:53FromGitter<kayabaNerve> *I'll stop now :p*
16:23:56m712you're not a real dev if you don't make everything void * and not document any of the functions which uses these void *s
16:24:15FromGitter<mratsim> @kayabaNerve ptr UncheckedArray\[T\] is super useful, it usually means you don’t need pointer arithmetics
16:24:38FromGitter<mratsim> or worse, use doxygen and say it’s proper documentation.
16:25:00FromGitter<kayabaNerve> What I need to master is array[0
16:25:28FromGitter<mission712> create a text file, put a list of functions with brief explanations, and not update this file during the next 5 years of development
16:25:51*Suigetsu joined #nim
16:26:06FromGitter<kayabaNerve> A bunch of C libs require arrays and Nim screws you over. I either have to static size, write the array code in C, or set up a ptr to an array[0], alloc0, and cast
16:26:13FromGitter<kayabaNerve> I should make a library for this...
16:26:32FromGitter<kayabaNerve> And it's not even me misusing arrays per say.
16:26:46FromGitter<kayabaNerve> I don't feel like this is my fault or nims fault. Just a fault.
16:26:51FromGitter<mratsim> as I said, cast to ptr UncheckedArray\[T\] instead of ptr T
16:27:41FromGitter<mission712> when in doubt, blame UNIX
16:27:50FromGitter<kayabaNerve> Can I pass an unchecked array [int] to a C int[] function?
16:28:25FromGitter<mratsim> yes
16:28:30FromGitter<kayabaNerve> If so, then it is my fault
16:28:43FromGitter<mratsim> not really, uncheckarray is completely undocumented
16:29:01FromGitter<mratsim> UncheckedArray*
16:29:30FromGitter<mratsim> it’s just a pointer with array indexing semantics.
16:30:08FromGitter<mratsim> I probably need to write some post about Array + C tips and tricks
16:30:22FromGitter<mratsim> or Nim wrapper tips and tricks
16:31:01FromGitter<kayabaNerve> LOL. I'll start editing my random function and my hash functions.
16:33:43FromGitter<mission712> is your random pure and reentrant?
16:34:22FromGitter<kayabaNerve> It's a wrapper around Nimcrypto
16:34:41FromGitter<mission712> hold on can nim do multiple return values
16:35:18FromGitter<kayabaNerve> It takes in (array[size, int], length). I pass in any size array and length, and just cast it. TBH it's so minimal I should remove it.
16:35:37FromGitter<kayabaNerve> Define multiple.
16:35:46FromGitter<kayabaNerve> There's overloading. There's Option. There's objects.
16:36:17FromGitter<mission712> can nim return (proc(), int)
16:36:22FromGitter<mission712> for instance
16:39:09FromGitter<kayabaNerve> I think in a tuple
16:39:28FromGitter<mission712> let me see
16:39:59FromGitter<mission712> yeah that's right
16:40:41FromGitter<mission712> ```var r = Rand() ⏎ // get a number ⏎ ``` [https://gitter.im/nim-lang/Nim?at=5b5c9c89966e80395027643e]
16:40:44FromGitter<mission712> oopsie daisie
16:40:52FromGitter<mission712> i didn't mean to post that. my apologies
16:41:20FromGitter<mission712> gitter likes to switch between compose and chat mode on its own
16:41:26*Perkol quit (Remote host closed the connection)
16:42:51FromGitter<mratsim> by the way @kayabaNerve I started a wrapper around Milagro Crypto: https://github.com/status-im/nim-milagro-crypto
16:43:36FromGitter<mratsim> though I might create a Nim ECC from scratch because Milagro Crypto is not properly constant time even though the authors claim it is.
16:44:57FromGitter<mratsim> (Nim ECC = Nim Elliptic Curve Cryptography)
16:46:25*stefanos82 suggests to use NECC for acronym; it rhymes with neck
16:47:04FromGitter<mratsim> I already reserved Hardy (Hardened Integer) for constant time big int implementation ;) - https://github.com/status-im/nim-hardy
16:58:25*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:11:35FromGitter<Varriount> @mratsim Once again, I'm amazed by the stuff you've written.
17:11:59FromGitter<mratsim> thanks :)
17:17:28FromGitter<kayabaNerve> @mratsim but is it of variable length
17:17:46FromGitter<kayabaNerve> I rather lose speed than lose memory
17:17:49FromGitter<mratsim> ptr UncheckedArray you mean?
17:18:16FromGitter<mratsim> you need to pass a len with it, you don’t have any length information for that.
17:18:22FromGitter<mratsim> just like passing an array in C
17:18:33FromGitter<kayabaNerve> I mean if I declare a int, must it always be under a certain bit size unless I declare a new int
17:18:55FromGitter<kayabaNerve> Do you only use 1 byte if the value can be represented in 1 byte
17:19:05FromGitter<kayabaNerve> Stint required you to define the size
17:19:14FromGitter<mratsim> ah, you mean constant time big int? The implementation is not finished yet.
17:19:58FromGitter<mratsim> it will probably use a fixed size depending on the modulo you need. because several operation timings depends on bit size (especially modulo/division)
17:20:30FromGitter<kayabaNerve> K. I'm speaking because I have big ints, always positive, less than 255 and would rather you resize than I lose all that memory
17:20:38FromGitter<kayabaNerve> Got it
17:21:50FromGitter<mratsim> resizing requires heap allocations which is slow :/
17:23:29FromGitter<kayabaNerve> 31 bytes though
17:23:43FromGitter<kayabaNerve> Holy I think you solved my memory leak
17:23:54FromGitter<kayabaNerve> I don't think I'm actually deleting those
17:31:03FromGitter<kayabaNerve> @mratsim is there a way to have Nim GC imported C structs?
17:31:44FromGitter<kayabaNerve> Would just a destructor work?
17:32:00FromGitter<mratsim> You can use destructors or finalizers
17:32:27FromGitter<mratsim> in Arraymancer I still use finalizers like here: ⏎ ⏎ https://github.com/mratsim/Arraymancer/blob/master/src/tensor/fallback/blas_l3_gemm_data_structure.nim#L17-L30
17:32:44FromGitter<kayabaNerve> Thanks
17:33:36FromGitter<mratsim> Have to check if destructors work again on ptr type: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/cuda_global_state.nim#L31-L35
17:36:36*yglukhov[i] joined #nim
17:41:09*yglukhov[i] quit (Ping timeout: 264 seconds)
17:44:16*yglukhov[i] joined #nim
17:50:06*yglukhov_ joined #nim
17:50:09*yglukhov[i] quit (Ping timeout: 264 seconds)
17:53:04*Trustable joined #nim
17:55:27*yglukhov_ quit (Ping timeout: 240 seconds)
17:59:57*yglukhov[i] joined #nim
18:04:50*yglukhov_ joined #nim
18:05:26*yglukhov[i] quit (Ping timeout: 256 seconds)
18:06:33*yglukhov_ quit (Remote host closed the connection)
18:13:16FromGitter<Quelklef> How come templates seem to be flaky with evaluating to expressions?
18:13:19FromGitter<Quelklef> e.g.
18:13:49*Jesin joined #nim
18:13:51FromGitter<Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5cb25ef52b276ced4bd795]
18:14:02FromGitter<Quelklef> Why's it becoming a statement? I assume I'm doing something wrong
18:15:50stefanos82what your x's type?
18:15:55stefanos82*what is
18:16:05FromGitter<Quelklef> untyped, it's a template
18:16:33FromGitter<Quelklef> adding type annotations fixes it, but still seems odd to me
18:17:38FromGitter<mratsim> `template `!`(x: untyped): int = 2` is the proepr signature @Quelklef
18:17:56FromGitter<Quelklef> It won't work with `(x: untyped): untyped`?
18:18:19FromGitter<mratsim> untyped is for statement, typed for expression
18:18:28FromGitter<mratsim> 2 is an expression not a statement
18:18:31*yglukhov[i] joined #nim
18:18:35FromGitter<Quelklef> Hmmm
18:18:45FromGitter<Quelklef> I thought untyped was for invoking the macro before type resolution and typed for after
18:18:58FromGitter<mratsim> in macros, not in template ;)
18:19:03FromGitter<Quelklef> Ahhhhhhhhhhhh
18:19:18FromGitter<Quelklef> so would `(x: typed): typed` work as well
18:19:51FromGitter<mratsim> yes if x is an expression as well
18:20:05FromGitter<Quelklef> Nope, gives the same error
18:20:09FromGitter<mratsim> (i.e. x has a type)
18:20:42FromGitter<Quelklef> ```template f(x: typed): typed = 2 ⏎ echo f(3)``` ⏎ ⏎ seems to fail [https://gitter.im/nim-lang/Nim?at=5b5cb3fad4527523f639e168]
18:21:23FromGitter<mratsim> ```template `!`(x: typed): untyped = 2 ⏎ let y = !3``` ⏎ ⏎ ^ugh, weird but this works [https://gitter.im/nim-lang/Nim?at=5b5cb422bf754466066a8ae5]
18:21:34FromGitter<Quelklef> What the heck
18:21:41FromGitter<Quelklef> why though
18:21:48FromGitter<Quelklef> I'd assume only the result type would be relevant
18:21:56FromGitter<mratsim> dunno, I think it’s a bug in typed semcheck
18:22:09FromGitter<Quelklef> Huh. Should I open an issue?
18:22:18FromGitter<mratsim> yeah you can try
18:22:20FromGitter<Quelklef> ok
18:22:25FromGitter<Quelklef> thank you for your help btw!
18:22:29FromGitter<mratsim> no problem
18:26:29FromGitter<Quelklef> Ok, so ⏎ ⏎ ```template f(x: untyped): untyped = 2 ⏎ echo(f(3))``` ⏎ ⏎ does, which seems to contradict what you were saying [https://gitter.im/nim-lang/Nim?at=5b5cb55517c942036b7c518b]
18:30:56*yglukhov[i] quit (Read error: Connection reset by peer)
18:30:57*yglukhov_ joined #nim
18:35:15*yglukhov[i] joined #nim
18:35:26*yglukhov_ quit (Remote host closed the connection)
18:41:52*yglukhov[i] quit (Remote host closed the connection)
19:04:07*dddddd joined #nim
19:09:43*aguspiza quit (Ping timeout: 244 seconds)
19:15:05*Suigetsu quit (Remote host closed the connection)
19:21:26*yglukhov[i] joined #nim
19:25:54*aguspiza joined #nim
19:32:27*aguspiza quit (Ping timeout: 240 seconds)
19:36:17Araqhttps://arstechnica.com/gadgets/2018/07/new-spectre-attack-enables-secrets-to-be-leaked-over-a-network/
19:42:20stefanos82I'm not surprised by this Araq to be honest with you
19:42:47stefanos82I have seen a presentation on YouTube by a researcher that has detected registers that are not included in CPU's manual
19:42:56stefanos82therefore, there are lots of things we yet don't know
19:46:19FromGitter<Varriount> Hm, one method requires the download of a file on a (presumably idle) system. Both methods are rather slow (1 byte of information every 8 minutes is the fastest).
19:51:20*rockcavera quit (Remote host closed the connection)
19:54:13FromGitter<citycide> I'm using karax but still working out the architecture of things... I have this: `proc renderLabel (label: Label): VNode` and was expecting to be able to modify a field on that passed `Label` object that would make it re-render. this doesn't work but I don't know how I should restructure it. Tips?
20:04:46dom96That should work
20:04:52dom96Where are you modifying `label`?
20:06:32FromGitter<citycide> in an `onClick` an element or 2 down
20:08:05dom96Are you sure you're modifying the right `label`?
20:08:30FromGitter<citycide> yeah I'm just using the one that's given as a parameter
20:09:16dom96Hrm, can't guess what the issue could be
20:09:19dom96show the code :)
20:09:59FromGitter<citycide> I will try to reduce!
20:23:38FromGitter<citycide> dom96: try this https://gist.github.com/citycide/2f65d19903c45f11049ac8a4bf1b5e7b
20:25:29dom96Two things to try: log in onClick to make sure it's actually called
20:25:36dom96and try putting Label inside a global variable
20:25:45dom96I have a feeling that the root component's state has to be in a global var
20:26:29FromGitter<citycide> it does log
20:27:58FromGitter<citycide> hmm. I'll have to figure out how to track state differently then. the idea is I'm listing many elements that the user interacts with, each of which needs its own state. I thought passing that object to the renderer would be enough
20:28:41FromGitter<citycide> I'm gonna check out nimforum since that's a similar concept to thread posts
20:31:38dom96It is enough, but not when it's the root object
20:31:54dom96At least that's my guess
20:31:58dom96It could be another weird issue
20:32:04dom96That i'm not noticing in the code
20:32:49*yglukhov[i] quit (Remote host closed the connection)
20:39:04Araqit's actually obvious
20:39:18Araqproc render (): VNode =
20:39:18Araq result = renderLabel(Label(flag: false))
20:39:18AraqsetRenderer render
20:39:34Araq^ on a render, recreate the Label object with 'flag: false'
20:39:52dom96oh yeah, duh
20:40:16dom96So I am right, you do need a global variable to solve this :P
20:40:48*yglukhov[i] joined #nim
20:44:15*yglukhov[i] quit (Remote host closed the connection)
20:44:32*yglukhov[i] joined #nim
20:51:41FromGitter<generative99> How would I instantiate this type? : ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5cd75c95988830b08482f0]
20:52:34FromGitter<generative99> Everyway I tried results in type error
20:56:34FromGitter<Varriount> Hm, that's a union to type
20:56:55FromGitter<Varriount> Unions can only have one member active
20:57:52FromGitter<generative99> Makes sense, I can't seem to instantiate it as an object or array type though
21:00:40*nsf quit (Quit: WeeChat 2.1)
21:03:46FromGitter<generative99> Ok I tested it without typehinting it as ```VkClearColorValue``` and it seems to be accepted in the parent object field, for now...
21:04:07FromGitter<generative99> NM, still doesn't work
21:11:33dom96Brackets around type?
21:11:35dom96Does that compile?
21:11:36*aguspiza joined #nim
21:11:38dom96First time I'm seeing it
21:12:58*BitPuffin quit (Remote host closed the connection)
21:17:38*Trustable quit (Remote host closed the connection)
21:18:09*zama quit (Ping timeout: 260 seconds)
21:20:27FromGitter<generative99> Ok sorry brackets around type name are user error, still not sure how to instantiate it though
21:24:19*zama joined #nim
21:25:41*Vladar quit (Quit: Leaving)
21:31:08FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5ce09c12f1be71376163d2]
21:42:32stefanos82dom96: I think those who come from C or C++ get confused with * in front of a proc or a var type
21:42:40stefanos82they think it's a pointer
21:43:57FromGitter<kayabaNerve> It isn't?
21:44:10FromGitter<kayabaNerve> πŸ€”
21:44:14FromGitter<generative99> Doesn't it mean export ?
21:44:30FromGitter<generative99> Any ideas how to instantiate that union type? (ignoring the brackets on type name)
21:45:36FromGitter<kayabaNerve> Nope. Pointer.
21:45:52FromGitter<kayabaNerve> (joking; yes. It marks the symbol as public)
21:49:04*NimBot joined #nim
21:49:21FromGitter<generative99> ```var tColor = VkClearColorValue(uint32:[1.uint32, 1.uint32, 1.uint32, 1.uint32])```
21:49:26FromGitter<generative99> brute forced it
21:59:17FromGitter<Bennyelg> any Idea why Im getting ```Error: cannot open file: vdom``` on karax carousel example ?
22:03:23dom96Bennyelg: probably because it assumes you're compiling the example as-is
22:03:31dom96This is why examples shouldn't assume there is a nim.cfg file
22:03:38dom96Araq: *cough*
22:04:14FromGitter<Bennyelg> :\
22:05:13dom96just replace `vdom` with `karax/vdom`
22:05:29FromGitter<Bennyelg> yea, just did so
22:05:32FromGitter<Bennyelg> thanks!
22:10:09stefanos82@generative99: is this what you were trying to do with union? https://pastebin.com/kCGFMDek
22:20:08zacharycarter[m]I think I'm giving up on this GC_Ref / unref thing and wasm - I don't see how what I want to do is possible
22:31:38*aguspiza quit (Ping timeout: 256 seconds)
22:31:47*yglukhov[i] quit (Remote host closed the connection)
22:33:52FromGitter<generative99> @stefanos82 thanks it may have been I sort of figured out a solution for my context with my above comment, just based on trying random different things
22:33:58zacharycarter[m]generative99: mind if I ask what you're using Vulkan for?
22:34:49FromGitter<generative99> @zacharycarter trying to get a nim vulkan renderer up and running (mabye MIT it?), since there doesn't seem to be any, almost have a triangle :D
22:35:53zacharycarter[m]πŸ˜ƒ cool! - yeah I know I'm going to be using BGFX for my next graphics related project
22:36:05zacharycarter[m]I'm hoping to build an editor this time along with a full featured 3d renderer
22:37:57FromGitter<generative99> BGFX is a good lib, fairly low level. I wanted the challenge of learning Vulkan and if I don't run into any showstoppers be able to experiment with lighting techniques totally from scratch, which I've never done
22:38:28FromGitter<mratsim> @generative99 your union pragma is on the wrong side : `type VkClearColorValue* {.union.}= object`
22:39:13zacharycarter[m]gotcha
22:39:48FromGitter<mratsim> here is an example of using union types @generative99: https://github.com/mratsim/chirp8/blob/master/src/cpu.nim#L9-L19
22:39:59FromGitter<generative99> @mratsim interesting, that one isn't my doing, I'm pulling that code from the vulkan bindings, I guess it can work either way?
22:40:41stefanos82we need to add example(s) in official docs
22:40:50stefanos82all it says is about union pragma, nothing else
22:42:28FromGitter<mratsim> @generative99, oh really, well I just updated it to support big endian and little endian CPU btw.
22:43:21zacharycarter[m]union types are a C thing though
22:43:21FromGitter<mratsim> btw, did you try Vulkan Compute? Is it ready?
22:43:51zacharycarter[m]I don't know if Nim needs to document all C features
22:44:18FromGitter<mratsim> yes union don’t work properly in JS - https://github.com/nim-lang/Nim/issues/7658
22:45:31FromGitter<generative99> Here's the syntax I used to instantiate that union type, couldn't find anything else that worked ⏎ ⏎ ``````var tColor = VkClearColorValue(uint32: [1.uint32, 1.uint32, 1.uint32, 1.uint32])`````` ⏎ ⏎ Having that in the docs would have been helpful [https://gitter.im/nim-lang/Nim?at=5b5cf20b17c942036b7cdb89]
22:46:40FromGitter<mratsim> you really shouldn’t call your field uint32
22:47:59FromGitter<generative99> I assumed it had to be that, that's why I didn't guess I could just use the field name normally, because it's a language term
22:48:28zacharycarter[m]you can also do 1ui32
22:48:54FromGitter<mratsim> @generative99 ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5cf2d617c942036b7cdd15]
22:49:04zacharycarter[m]sorry
22:49:04zacharycarter[m]1u32
22:49:24zacharycarter[m]instead of 1.uint32
22:49:42FromGitter<mratsim> 1’u32 to be accurate
22:50:14zacharycarter[m]`echo 1u32` seems to work too?
22:50:28FromGitter<generative99> @mratsim interesting thanks I'll try that. I'm getting the types from here: https://github.com/nimious/vulkan/blob/master/src/vulkan.nim I just avoid changing it mostly because of the can of worms that could open and assuming the authors had their reasons
22:50:28FromGitter<mratsim> !eval echo 1u32
22:50:30NimBot1
22:51:08zacharycarter[m]!eval echo sizeof(1u32)
22:51:11NimBot4
22:52:05zacharycarter[m]!eval echo sizeof(1)
22:52:07FromGitter<mratsim> uint32 as a field is a can of worm, you will have ambiguities with converter, this should be a bug on the repo
22:52:07NimBot8
22:53:14zacharycarter[m]all these prs are great :D
23:00:10zacharycarter[m]mratism: I think my Nim wasm webapp thing is dead in the water 😞
23:09:39ldleworkzacharycarter[m]: don't worry araq will come by soon enough and tell you how you're doing it wrong :)
23:10:17zacharycarter[m]I wish
23:11:52*yglukhov[i] joined #nim
23:12:55zacharycarter[m]yglukhov[i]: would you take a PR to jsbind? I notice `EM_ASM_` isn't anywhere in the bindings
23:14:55zacharycarter[m]that mention came out really weird on riot
23:15:57zacharycarter[m]what have you been up to Idlework?
23:16:34*yglukhov[i] quit (Ping timeout: 260 seconds)
23:47:18zacharycarter[m]why is github search so terrible?