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:47 | FromDiscord | <awr> are there any libraries / std library procedures for pretty-printing the contents of object variables |
00:45:13 | FromDiscord | <awr> prettier than `$` i mean, with newlines and proper indentation |
00:49:03 | FromDiscord | <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:35 | FromGitter | <kayabaNerve> treeform: TBH I rather not post my bounties here. |
00:59:42 | FromGitter | <kayabaNerve> And I won't. |
01:02:59 | * | stefanos82 quit (Quit: Quitting for now...) |
01:03:14 | FromGitter | <rayman22201> I don't think Nim has an official place for that sort of thing @kayabaNerve. Too small of a community atm. |
01:04:26 | FromGitter | <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:31 | FromGitter | <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:34 | FromGitter | <rayman22201> lol. Sorry man! #SmallCommunityProblems |
02:33:28 | * | PrimHelios joined #nim |
02:34:09 | * | ftsf_ joined #nim |
03:04:20 | FromDiscord | <2vg> Is it possible to make Future non-ref type with asyncfuture? |
03:04:20 | FromDiscord | <2vg> I guess that asyncdispatch will be faster. |
03:18:21 | zacharycarter[m] | ugh the playground box is so effed |
03:18:34 | zacharycarter[m] | `/` is at 100% inode usage somehow |
03:18:42 | zacharycarter[m] | dunno wtf created all those files |
03:19:21 | zacharycarter[m] | also - I don't know why the kernel version of the box and the docker version keep getting out of sync |
03:19:48 | zacharycarter[m] | and I can't figure out this closure gc ref issue - or at least find a way to work around it |
03:19:59 | zacharycarter[m] | not a great day |
03:21:37 | zacharycarter[m] | docker is the culprit |
03:21:38 | zacharycarter[m] | that bastard |
03:21:58 | zacharycarter[m] | 79182 ./var/lib/docker/overlay2/l |
03:34:38 | zacharycarter[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:55 | zacharycarter[m] | playground's back up |
04:02:16 | zacharycarter[m] | emscripten source maps don't seem to work for me |
05:00:38 | zacharycarter[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:55 | zacharycarter[m] | quiet in here tonight... |
06:02:41 | FromGitter | <gogolxdong> Error: undeclared identifier: 'Channel' β cannot open channels if import . |
06:03:09 | FromGitter | <gogolxdong> channels.nim is under lib/system/ |
06:04:04 | Araq | --threads:on |
06:04:08 | zacharycarter[m] | do you have threads on? |
06:25:58 | * | kinkinkijkin quit (Remote host closed the connection) |
06:26:15 | * | kinkinkijkin joined #nim |
06:34:29 | FromGitter | <Varriount> Yay, my shell is complete! |
06:34:42 | FromGitter | <Varriount> Well, for this course, anyway. |
06:35:29 | zacharycarter[m] | :D |
06:35:36 | zacharycarter[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:06 | FromGitter | <mratsim> @Araq, I think closure procs are currently broken: https://github.com/nim-lang/Nim/issues/8432#issuecomment-408591628 |
08:31:27 | FromGitter | <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:51 | aguspiza | zacharycarter[m]: nim playgroung is working again thx |
11:27:55 | dom96 | So, 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:10 | m712 | is https://github.com/zah/nim.vim dev |
11:50:49 | m712 | oops didn't mean to post that |
11:51:04 | m712 | are 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:02 | FromGitter | <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:48 | dom96 | m712: You'll have to ask zahary this. He's not really on IRC often though. |
12:49:53 | dom96 | You 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:42 | livcd | 3How would i translate something like this to Nim ? uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr("blah"))) |
13:05:58 | * | ng0 joined #nim |
13:06:40 | dom96 | var x = "blah"; cast[ptr uint](x) # I guess? |
13:06:47 | dom96 | Not familiar with Go |
13:08:45 | livcd | thanks i figured that it's wrapped already in winim :) |
13:10:37 | dom96 | oh, so that is an actual Win API call |
13:11:02 | livcd | yes! |
13:20:10 | * | yglukhov[i] quit (Remote host closed the connection) |
13:24:18 | zacharycarter[m] | aguspiza: np |
13:25:23 | zacharycarter[m] | good day all |
13:27:31 | livcd | ahh works flawlessly |
13:32:21 | livcd | ...but does not work on windows 208 |
13:34:02 | * | yglukhov[i] joined #nim |
13:40:55 | FromGitter | <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:30 | zacharycarter[m] | wouldn't it just make sense to write a library like flutter in Nim? |
13:48:36 | zacharycarter[m] | I don't think a dart backend makes much sense tbh |
13:49:12 | * | nsf joined #nim |
13:50:04 | dom96 | I think new backends are a simple cost-benefit evaluation |
13:50:42 | dom96 | I don't think the benefit of a Dart backend is higher than the cost of it. |
13:51:41 | zacharycarter[m] | I'd rather have NLVM than a dart backend |
14:14:13 | FromGitter | <rayman22201> Hey @dom96. Can you put your clang bindings on github? Please? π |
14:14:53 | * | yglukhov_ joined #nim |
14:15:08 | FromGitter | <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:50 | dom96 | https://github.com/dom96/libclang |
14:24:51 | dom96 | Voila |
14:26:26 | dom96 | I might release my more advanced module as a separate lib later |
14:26:29 | dom96 | but that will take more time |
14:28:54 | * | stefanos82 joined #nim |
14:29:43 | FromGitter | <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:05 | FromGitter | <citycide> I get the same error with the `dom` field, the others seem ok |
14:40:36 | zacharycarter[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:12 | FromGitter | <gogolxdong> why does macro generate object as follows: β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5c82683315465845761436] |
14:50:09 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5c82a1cb4d5b036ca14b40] |
14:53:37 | FromGitter | <gogolxdong> I'm following `dumpASTGen` |
14:56:03 | * | rockcavera joined #nim |
14:58:40 | FromGitter | <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:42 | FromGitter | <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:53 | FromGitter | <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:06 | dom96 | generative99: how do you convert to seq[char]? |
15:51:19 | * | yglukhov[i] quit (Ping timeout: 268 seconds) |
15:53:22 | FromGitter | <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:00 | FromGitter | <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:56 | FromGitter | <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:32 | FromGitter | <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:46 | FromGitter | <mratsim> if itβs a `let` try unsafeAddr |
16:11:13 | FromGitter | <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:18 | FromGitter | <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:43 | FromGitter | <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:43 | FromGitter | ... 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:40 | FromGitter | <mratsim> The `ptr UncheckedArray[T]` type is especially useful because it supports indexing compared to simple `ptr T` |
16:16:16 | FromGitter | <generative99> @mratsim excellent thanks I'll keep reference to those |
16:17:44 | * | PrimHelios quit (Quit: Leaving) |
16:18:50 | FromGitter | <kayabaNerve> @mratsim I use everything as ptr T |
16:18:59 | FromGitter | <kayabaNerve> First name? ptr T |
16:19:10 | FromGitter | <kayabaNerve> Last name? ptr T |
16:19:16 | FromGitter | <kayabaNerve> Age as a whole number? |
16:19:19 | FromGitter | <kayabaNerve> ptr T |
16:20:42 | FromGitter | <kayabaNerve> You're π€ not π€aπ€ real π€Cπ€ Dev π€ if π€ you π€ use π€ anything π€ but π€void*π€ |
16:20:53 | FromGitter | <kayabaNerve> *I'll stop now :p* |
16:23:56 | m712 | you'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:15 | FromGitter | <mratsim> @kayabaNerve ptr UncheckedArray\[T\] is super useful, it usually means you donβt need pointer arithmetics |
16:24:38 | FromGitter | <mratsim> or worse, use doxygen and say itβs proper documentation. |
16:25:00 | FromGitter | <kayabaNerve> What I need to master is array[0 |
16:25:28 | FromGitter | <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:06 | FromGitter | <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:13 | FromGitter | <kayabaNerve> I should make a library for this... |
16:26:32 | FromGitter | <kayabaNerve> And it's not even me misusing arrays per say. |
16:26:46 | FromGitter | <kayabaNerve> I don't feel like this is my fault or nims fault. Just a fault. |
16:26:51 | FromGitter | <mratsim> as I said, cast to ptr UncheckedArray\[T\] instead of ptr T |
16:27:41 | FromGitter | <mission712> when in doubt, blame UNIX |
16:27:50 | FromGitter | <kayabaNerve> Can I pass an unchecked array [int] to a C int[] function? |
16:28:25 | FromGitter | <mratsim> yes |
16:28:30 | FromGitter | <kayabaNerve> If so, then it is my fault |
16:28:43 | FromGitter | <mratsim> not really, uncheckarray is completely undocumented |
16:29:01 | FromGitter | <mratsim> UncheckedArray* |
16:29:30 | FromGitter | <mratsim> itβs just a pointer with array indexing semantics. |
16:30:08 | FromGitter | <mratsim> I probably need to write some post about Array + C tips and tricks |
16:30:22 | FromGitter | <mratsim> or Nim wrapper tips and tricks |
16:31:01 | FromGitter | <kayabaNerve> LOL. I'll start editing my random function and my hash functions. |
16:33:43 | FromGitter | <mission712> is your random pure and reentrant? |
16:34:22 | FromGitter | <kayabaNerve> It's a wrapper around Nimcrypto |
16:34:41 | FromGitter | <mission712> hold on can nim do multiple return values |
16:35:18 | FromGitter | <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:37 | FromGitter | <kayabaNerve> Define multiple. |
16:35:46 | FromGitter | <kayabaNerve> There's overloading. There's Option. There's objects. |
16:36:17 | FromGitter | <mission712> can nim return (proc(), int) |
16:36:22 | FromGitter | <mission712> for instance |
16:39:09 | FromGitter | <kayabaNerve> I think in a tuple |
16:39:28 | FromGitter | <mission712> let me see |
16:39:59 | FromGitter | <mission712> yeah that's right |
16:40:41 | FromGitter | <mission712> ```var r = Rand() β // get a number β ``` [https://gitter.im/nim-lang/Nim?at=5b5c9c89966e80395027643e] |
16:40:44 | FromGitter | <mission712> oopsie daisie |
16:40:52 | FromGitter | <mission712> i didn't mean to post that. my apologies |
16:41:20 | FromGitter | <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:51 | FromGitter | <mratsim> by the way @kayabaNerve I started a wrapper around Milagro Crypto: https://github.com/status-im/nim-milagro-crypto |
16:43:36 | FromGitter | <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:57 | FromGitter | <mratsim> (Nim ECC = Nim Elliptic Curve Cryptography) |
16:46:25 | * | stefanos82 suggests to use NECC for acronym; it rhymes with neck |
16:47:04 | FromGitter | <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:35 | FromGitter | <Varriount> @mratsim Once again, I'm amazed by the stuff you've written. |
17:11:59 | FromGitter | <mratsim> thanks :) |
17:17:28 | FromGitter | <kayabaNerve> @mratsim but is it of variable length |
17:17:46 | FromGitter | <kayabaNerve> I rather lose speed than lose memory |
17:17:49 | FromGitter | <mratsim> ptr UncheckedArray you mean? |
17:18:16 | FromGitter | <mratsim> you need to pass a len with it, you donβt have any length information for that. |
17:18:22 | FromGitter | <mratsim> just like passing an array in C |
17:18:33 | FromGitter | <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:55 | FromGitter | <kayabaNerve> Do you only use 1 byte if the value can be represented in 1 byte |
17:19:05 | FromGitter | <kayabaNerve> Stint required you to define the size |
17:19:14 | FromGitter | <mratsim> ah, you mean constant time big int? The implementation is not finished yet. |
17:19:58 | FromGitter | <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:30 | FromGitter | <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:38 | FromGitter | <kayabaNerve> Got it |
17:21:50 | FromGitter | <mratsim> resizing requires heap allocations which is slow :/ |
17:23:29 | FromGitter | <kayabaNerve> 31 bytes though |
17:23:43 | FromGitter | <kayabaNerve> Holy I think you solved my memory leak |
17:23:54 | FromGitter | <kayabaNerve> I don't think I'm actually deleting those |
17:31:03 | FromGitter | <kayabaNerve> @mratsim is there a way to have Nim GC imported C structs? |
17:31:44 | FromGitter | <kayabaNerve> Would just a destructor work? |
17:32:00 | FromGitter | <mratsim> You can use destructors or finalizers |
17:32:27 | FromGitter | <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:44 | FromGitter | <kayabaNerve> Thanks |
17:33:36 | FromGitter | <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:16 | FromGitter | <Quelklef> How come templates seem to be flaky with evaluating to expressions? |
18:13:19 | FromGitter | <Quelklef> e.g. |
18:13:49 | * | Jesin joined #nim |
18:13:51 | FromGitter | <Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5cb25ef52b276ced4bd795] |
18:14:02 | FromGitter | <Quelklef> Why's it becoming a statement? I assume I'm doing something wrong |
18:15:50 | stefanos82 | what your x's type? |
18:15:55 | stefanos82 | *what is |
18:16:05 | FromGitter | <Quelklef> untyped, it's a template |
18:16:33 | FromGitter | <Quelklef> adding type annotations fixes it, but still seems odd to me |
18:17:38 | FromGitter | <mratsim> `template `!`(x: untyped): int = 2` is the proepr signature @Quelklef |
18:17:56 | FromGitter | <Quelklef> It won't work with `(x: untyped): untyped`? |
18:18:19 | FromGitter | <mratsim> untyped is for statement, typed for expression |
18:18:28 | FromGitter | <mratsim> 2 is an expression not a statement |
18:18:31 | * | yglukhov[i] joined #nim |
18:18:35 | FromGitter | <Quelklef> Hmmm |
18:18:45 | FromGitter | <Quelklef> I thought untyped was for invoking the macro before type resolution and typed for after |
18:18:58 | FromGitter | <mratsim> in macros, not in template ;) |
18:19:03 | FromGitter | <Quelklef> Ahhhhhhhhhhhh |
18:19:18 | FromGitter | <Quelklef> so would `(x: typed): typed` work as well |
18:19:51 | FromGitter | <mratsim> yes if x is an expression as well |
18:20:05 | FromGitter | <Quelklef> Nope, gives the same error |
18:20:09 | FromGitter | <mratsim> (i.e. x has a type) |
18:20:42 | FromGitter | <Quelklef> ```template f(x: typed): typed = 2 β echo f(3)``` β β seems to fail [https://gitter.im/nim-lang/Nim?at=5b5cb3fad4527523f639e168] |
18:21:23 | FromGitter | <mratsim> ```template `!`(x: typed): untyped = 2 β let y = !3``` β β ^ugh, weird but this works [https://gitter.im/nim-lang/Nim?at=5b5cb422bf754466066a8ae5] |
18:21:34 | FromGitter | <Quelklef> What the heck |
18:21:41 | FromGitter | <Quelklef> why though |
18:21:48 | FromGitter | <Quelklef> I'd assume only the result type would be relevant |
18:21:56 | FromGitter | <mratsim> dunno, I think itβs a bug in typed semcheck |
18:22:09 | FromGitter | <Quelklef> Huh. Should I open an issue? |
18:22:18 | FromGitter | <mratsim> yeah you can try |
18:22:20 | FromGitter | <Quelklef> ok |
18:22:25 | FromGitter | <Quelklef> thank you for your help btw! |
18:22:29 | FromGitter | <mratsim> no problem |
18:26:29 | FromGitter | <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:17 | Araq | https://arstechnica.com/gadgets/2018/07/new-spectre-attack-enables-secrets-to-be-leaked-over-a-network/ |
19:42:20 | stefanos82 | I'm not surprised by this Araq to be honest with you |
19:42:47 | stefanos82 | I have seen a presentation on YouTube by a researcher that has detected registers that are not included in CPU's manual |
19:42:56 | stefanos82 | therefore, there are lots of things we yet don't know |
19:46:19 | FromGitter | <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:13 | FromGitter | <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:46 | dom96 | That should work |
20:04:52 | dom96 | Where are you modifying `label`? |
20:06:32 | FromGitter | <citycide> in an `onClick` an element or 2 down |
20:08:05 | dom96 | Are you sure you're modifying the right `label`? |
20:08:30 | FromGitter | <citycide> yeah I'm just using the one that's given as a parameter |
20:09:16 | dom96 | Hrm, can't guess what the issue could be |
20:09:19 | dom96 | show the code :) |
20:09:59 | FromGitter | <citycide> I will try to reduce! |
20:23:38 | FromGitter | <citycide> dom96: try this https://gist.github.com/citycide/2f65d19903c45f11049ac8a4bf1b5e7b |
20:25:29 | dom96 | Two things to try: log in onClick to make sure it's actually called |
20:25:36 | dom96 | and try putting Label inside a global variable |
20:25:45 | dom96 | I have a feeling that the root component's state has to be in a global var |
20:26:29 | FromGitter | <citycide> it does log |
20:27:58 | FromGitter | <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:41 | FromGitter | <citycide> I'm gonna check out nimforum since that's a similar concept to thread posts |
20:31:38 | dom96 | It is enough, but not when it's the root object |
20:31:54 | dom96 | At least that's my guess |
20:31:58 | dom96 | It could be another weird issue |
20:32:04 | dom96 | That i'm not noticing in the code |
20:32:49 | * | yglukhov[i] quit (Remote host closed the connection) |
20:39:04 | Araq | it's actually obvious |
20:39:18 | Araq | proc render (): VNode = |
20:39:18 | Araq | result = renderLabel(Label(flag: false)) |
20:39:18 | Araq | setRenderer render |
20:39:34 | Araq | ^ on a render, recreate the Label object with 'flag: false' |
20:39:52 | dom96 | oh yeah, duh |
20:40:16 | dom96 | So 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:41 | FromGitter | <generative99> How would I instantiate this type? : β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5cd75c95988830b08482f0] |
20:52:34 | FromGitter | <generative99> Everyway I tried results in type error |
20:56:34 | FromGitter | <Varriount> Hm, that's a union to type |
20:56:55 | FromGitter | <Varriount> Unions can only have one member active |
20:57:52 | FromGitter | <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:46 | FromGitter | <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:07 | FromGitter | <generative99> NM, still doesn't work |
21:11:33 | dom96 | Brackets around type? |
21:11:35 | dom96 | Does that compile? |
21:11:36 | * | aguspiza joined #nim |
21:11:38 | dom96 | First 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:27 | FromGitter | <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:08 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5ce09c12f1be71376163d2] |
21:42:32 | stefanos82 | dom96: I think those who come from C or C++ get confused with * in front of a proc or a var type |
21:42:40 | stefanos82 | they think it's a pointer |
21:43:57 | FromGitter | <kayabaNerve> It isn't? |
21:44:10 | FromGitter | <kayabaNerve> π€ |
21:44:14 | FromGitter | <generative99> Doesn't it mean export ? |
21:44:30 | FromGitter | <generative99> Any ideas how to instantiate that union type? (ignoring the brackets on type name) |
21:45:36 | FromGitter | <kayabaNerve> Nope. Pointer. |
21:45:52 | FromGitter | <kayabaNerve> (joking; yes. It marks the symbol as public) |
21:49:04 | * | NimBot joined #nim |
21:49:21 | FromGitter | <generative99> ```var tColor = VkClearColorValue(uint32:[1.uint32, 1.uint32, 1.uint32, 1.uint32])``` |
21:49:26 | FromGitter | <generative99> brute forced it |
21:59:17 | FromGitter | <Bennyelg> any Idea why Im getting ```Error: cannot open file: vdom``` on karax carousel example ? |
22:03:23 | dom96 | Bennyelg: probably because it assumes you're compiling the example as-is |
22:03:31 | dom96 | This is why examples shouldn't assume there is a nim.cfg file |
22:03:38 | dom96 | Araq: *cough* |
22:04:14 | FromGitter | <Bennyelg> :\ |
22:05:13 | dom96 | just replace `vdom` with `karax/vdom` |
22:05:29 | FromGitter | <Bennyelg> yea, just did so |
22:05:32 | FromGitter | <Bennyelg> thanks! |
22:10:09 | stefanos82 | @generative99: is this what you were trying to do with union? https://pastebin.com/kCGFMDek |
22:20:08 | zacharycarter[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:52 | FromGitter | <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:58 | zacharycarter[m] | generative99: mind if I ask what you're using Vulkan for? |
22:34:49 | FromGitter | <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:53 | zacharycarter[m] | π cool! - yeah I know I'm going to be using BGFX for my next graphics related project |
22:36:05 | zacharycarter[m] | I'm hoping to build an editor this time along with a full featured 3d renderer |
22:37:57 | FromGitter | <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:28 | FromGitter | <mratsim> @generative99 your union pragma is on the wrong side : `type VkClearColorValue* {.union.}= object` |
22:39:13 | zacharycarter[m] | gotcha |
22:39:48 | FromGitter | <mratsim> here is an example of using union types @generative99: https://github.com/mratsim/chirp8/blob/master/src/cpu.nim#L9-L19 |
22:39:59 | FromGitter | <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:41 | stefanos82 | we need to add example(s) in official docs |
22:40:50 | stefanos82 | all it says is about union pragma, nothing else |
22:42:28 | FromGitter | <mratsim> @generative99, oh really, well I just updated it to support big endian and little endian CPU btw. |
22:43:21 | zacharycarter[m] | union types are a C thing though |
22:43:21 | FromGitter | <mratsim> btw, did you try Vulkan Compute? Is it ready? |
22:43:51 | zacharycarter[m] | I don't know if Nim needs to document all C features |
22:44:18 | FromGitter | <mratsim> yes union donβt work properly in JS - https://github.com/nim-lang/Nim/issues/7658 |
22:45:31 | FromGitter | <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:40 | FromGitter | <mratsim> you really shouldnβt call your field uint32 |
22:47:59 | FromGitter | <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:28 | zacharycarter[m] | you can also do 1ui32 |
22:48:54 | FromGitter | <mratsim> @generative99 β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5cf2d617c942036b7cdd15] |
22:49:04 | zacharycarter[m] | sorry |
22:49:04 | zacharycarter[m] | 1u32 |
22:49:24 | zacharycarter[m] | instead of 1.uint32 |
22:49:42 | FromGitter | <mratsim> 1βu32 to be accurate |
22:50:14 | zacharycarter[m] | `echo 1u32` seems to work too? |
22:50:28 | FromGitter | <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:28 | FromGitter | <mratsim> !eval echo 1u32 |
22:50:30 | NimBot | 1 |
22:51:08 | zacharycarter[m] | !eval echo sizeof(1u32) |
22:51:11 | NimBot | 4 |
22:52:05 | zacharycarter[m] | !eval echo sizeof(1) |
22:52:07 | FromGitter | <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:07 | NimBot | 8 |
22:53:14 | zacharycarter[m] | all these prs are great :D |
23:00:10 | zacharycarter[m] | mratism: I think my Nim wasm webapp thing is dead in the water π |
23:09:39 | ldlework | zacharycarter[m]: don't worry araq will come by soon enough and tell you how you're doing it wrong :) |
23:10:17 | zacharycarter[m] | I wish |
23:11:52 | * | yglukhov[i] joined #nim |
23:12:55 | zacharycarter[m] | yglukhov[i]: would you take a PR to jsbind? I notice `EM_ASM_` isn't anywhere in the bindings |
23:14:55 | zacharycarter[m] | that mention came out really weird on riot |
23:15:57 | zacharycarter[m] | what have you been up to Idlework? |
23:16:34 | * | yglukhov[i] quit (Ping timeout: 260 seconds) |
23:47:18 | zacharycarter[m] | why is github search so terrible? |