00:07:08 | FromDiscord | <demotomohiro> It is initialized to zero. |
00:07:47 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement |
01:00:37 | * | tiorock joined #nim |
01:00:37 | * | rockcavera quit (Killed (copper.libera.chat (Nickname regained by services))) |
01:00:37 | * | tiorock is now known as rockcavera |
01:06:16 | * | tiorock joined #nim |
01:06:16 | * | rockcavera is now known as Guest9703 |
01:06:16 | * | tiorock is now known as rockcavera |
01:09:48 | FromDiscord | <heysokam> In reply to @.tokyovigilante "I would expect `testObject`": nim zero-initializes everything by default |
01:10:16 | * | Guest9703 quit (Ping timeout: 244 seconds) |
01:11:49 | FromDiscord | <heysokam> In reply to @.tokyovigilante "Concretely, using the Vulkan": that's weird. I haven't encountered that before, even with vulkan 🤔 |
01:23:50 | FromDiscord | <heysokam> what's the best way to serialize a `{.packed.}` object into a binary file? |
01:32:14 | * | nyeaa49284230101 quit (Read error: Connection reset by peer) |
01:32:38 | * | nyeaa49284230101 joined #nim |
01:45:40 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "what's the best way": why would the packed pragma change anything? |
01:47:28 | FromDiscord | <heysokam> In reply to @battery.acid.bubblegum "why would the packed": then reword the question and the question still remains 🤷♂️ |
01:48:24 | FromDiscord | <Robyn [She/Her]> hmm could look at frosty by disruptek (iirc), or flatty by treeform iirc? |
01:49:55 | FromDiscord | <heysokam> binny doesn't have anything for structs, afaik |
01:50:05 | FromDiscord | <heysokam> if it does, I haven't seen it |
01:51:04 | FromDiscord | <heysokam> I guess the question could be reworded into:↵"how do I turn a struct into a char list without changing the layout" |
01:59:08 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "binny doesn't have anything": flatty, not binny |
01:59:23 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "I guess the question": into a char list? |
01:59:53 | FromDiscord | <heysokam> In reply to @battery.acid.bubblegum "flatty, not binny": doesn't have it either |
01:59:59 | FromDiscord | <heysokam> at least I didn't see it |
02:00:08 | FromDiscord | <heysokam> frosty does have it, but its macro-based |
02:00:37 | FromDiscord | <Robyn [She/Her]> hm, do you care about transferring this over the network or between machines? if not, you could do `cast[array[sizeof(T), byte]](obj)` |
02:01:01 | FromDiscord | <Robyn [She/Her]> tho, gl with pointers or references, you'll have to implement custom logic for them |
02:01:11 | FromDiscord | <Robyn [She/Her]> strings and sequences also would need custom logic |
02:01:24 | FromDiscord | <heysokam> packed does not work with references anyway, so no issues |
02:01:34 | FromDiscord | <Robyn [She/Her]> atp, you should just make a simple dumper and loader using the fieldPairs iterator |
02:01:46 | FromDiscord | <heysokam> and I dont need dynamic storage, its all C-like |
02:01:56 | FromDiscord | <Robyn [She/Her]> gotcha, have fun then o7 |
02:02:07 | FromDiscord | <Robyn [She/Her]> In reply to @battery.acid.bubblegum "hm, do you care": this should work, in theory |
02:05:10 | FromDiscord | <heysokam> doesn't array have a length in nim? |
02:05:39 | FromDiscord | <Robyn [She/Her]> arrays have a static length, hence why `sizeof(T)` is used |
02:05:50 | FromDiscord | <heysokam> but they have a length |
02:05:50 | FromDiscord | <Robyn [She/Her]> T being the type you're using |
02:06:02 | FromDiscord | <Robyn [She/Her]> yeah, they do |
02:06:08 | FromDiscord | <Robyn [She/Her]> do you want it as a sequence? |
02:06:15 | FromDiscord | <heysokam> if you turn something into an array, and the array has a length, then what bytes are casted into the len? |
02:06:24 | FromDiscord | <Robyn [She/Her]> what |
02:06:41 | FromDiscord | <heysokam> the length number lives somewhere |
02:06:48 | FromDiscord | <Robyn [She/Her]> no, not at runtime |
02:07:39 | FromDiscord | <Robyn [She/Her]> the `array` in Nim is similar to the array types in C, (excluding the variable length arrays in C now) the size is known at compile time |
02:09:44 | FromDiscord | <heysokam> C arrays have no len |
02:10:11 | FromDiscord | <heysokam> they must be indicated separately. so I don't see much similarity, beyond the array part 🙂 |
02:11:28 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "C arrays have no": `char name[32]` |
02:12:16 | FromDiscord | <Robyn [She/Her]> that's an array of 32 characters, length is compile time info only, that looks the same as `array[32, char]` in Nim, to me |
02:13:36 | FromDiscord | <heysokam> yea, but `name.len` is not a thing in C |
02:13:50 | FromDiscord | <heysokam> while that is valid nim code, even at runtime |
02:14:53 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "while that is valid": can't you do `sizeof(name)` in C? |
02:16:15 | FromDiscord | <Robyn [She/Her]> either way, i feel like `len` on `array` in Nim doesn't say anything about it being runtime or no |
02:16:48 | FromDiscord | <.tokyovigilante> sent a code paste, see https://play.nim-lang.org/#pasty=niImCOFu |
02:17:05 | FromDiscord | <Robyn [She/Her]> you can do `myArr.I` and it'll return the size of it, too |
02:18:44 | FromDiscord | <.tokyovigilante> `info.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;` works fine |
02:26:49 | FromDiscord | <heysokam> In reply to @.tokyovigilante "`info.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_": for vulkan flags, enum sets are invaluable |
02:27:34 | FromDiscord | <heysokam> if you have control over the wrapper, they are fully compatible with C, so if you have the bindings take an enum set then you'll be able to send them directly |
02:27:55 | FromDiscord | <heysokam> without having to use setBit and friends, just `imageUsage.incl` |
02:34:02 | FromDiscord | <heysokam> In reply to @battery.acid.bubblegum "can't you do `sizeof(name)`": sizeof relies on null termination |
02:34:11 | FromDiscord | <heysokam> afaik |
02:36:47 | FromDiscord | <.tokyovigilante> In reply to @heysokam "without having to use": Thanks, I'm using Volk with a Futhark-generated wrapper currently, are you able to elaborate on that a bit? I haven't seen an enum set documented anywhere. |
02:38:52 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=cVGAqzfv |
02:39:31 | FromDiscord | <heysokam> shouldn't need the converter casts if you have control over the bindings |
03:14:58 | Amun-Ra | Robyn: you can't use sizeof(name) in C unless name is an array and not a pointer |
03:15:56 | Amun-Ra | (and it'll still return the size of an array and not a string length) |
03:20:55 | FromDiscord | <.bobbbob> if I have an object type is there an easy way to do a value based == function like repr for strings or do I have to do a custom overload? |
03:21:15 | FromDiscord | <Elegantbeef> `==` is already value based |
03:21:46 | FromDiscord | <.bobbbob> oh so it just werks? |
03:23:09 | FromDiscord | <Elegantbeef> Assuming all your types internally of the object are `==` |
03:23:38 | FromDiscord | <Elegantbeef> if you have `a: ref int` of course it won't be a value comparison |
03:24:34 | FromDiscord | <.bobbbob> ah if it's a ref object does it compare the address? in which case I would need an overloaded ==? |
03:24:48 | FromDiscord | <Elegantbeef> Of course |
03:25:00 | FromDiscord | <.bobbbob> ok |
04:20:18 | * | ntat joined #nim |
04:23:18 | * | nyeaa49284230101 quit (Ping timeout: 245 seconds) |
04:24:24 | * | rockcavera quit (Remote host closed the connection) |
06:09:54 | * | fabricio quit (Quit: WeeChat 3.5) |
06:47:10 | * | skippy8 joined #nim |
07:26:19 | * | andy-turner joined #nim |
08:16:38 | * | PMunch__ joined #nim |
08:19:55 | * | PMunch_ quit (Ping timeout: 276 seconds) |
08:21:05 | * | beholders_eye joined #nim |
08:35:08 | * | beholders_eye quit (Ping timeout: 272 seconds) |
09:09:41 | FromDiscord | <.tokyovigilante> can I detect whether the compiler is running in release mode from code? i.e. disable debug logging or other debug features if `-d:release` is specified? |
09:10:39 | FromDiscord | <nnsee> In reply to @.tokyovigilante "can I detect whether": `when defined(release):` |
09:10:58 | FromDiscord | <.tokyovigilante> ah right, thanks |
09:11:01 | FromDiscord | <Phil> (you can do that when defined trick for any flag using -d, even your own) |
10:43:47 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "sizeof relies on null": not in Nim |
10:44:08 | FromDiscord | <Robyn [She/Her]> i don't think so, at least |
11:19:50 | FromDiscord | <tauruuuuuus> just for my sanity, is there no way of defined a static sub-range type? |
11:20:49 | FromDiscord | <tauruuuuuus> something like `static range[0..8]` or `static Natural`? they don't seem to work as I would expect and there is no mention of it in the manual (that I found at least) |
11:32:57 | FromDiscord | <litlighilit> I test an exa. and it works.↵How didn't they work as expected?↵(@tauruuuuuus) |
11:48:46 | * | xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in) |
11:49:06 | * | PMunch_ joined #nim |
11:50:33 | * | xutaxkamay joined #nim |
11:51:49 | * | PMunch__ quit (Ping timeout: 276 seconds) |
12:04:07 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=WBNmEbQR |
12:05:32 | FromDiscord | <tauruuuuuus> In reply to @litlighilit "I test an exa.": No I'm just still asleep from the weekend and cannot think straight... |
12:05:44 | FromDiscord | <tauruuuuuus> I made it work lol I was operating under wrong assumptions |
12:52:10 | * | andy-turner quit (Remote host closed the connection) |
12:52:28 | * | andy-turner joined #nim |
12:57:27 | * | andy-turner quit (Quit: Leaving) |
13:05:48 | * | andy-turner joined #nim |
13:17:43 | * | andy-turner quit (Quit: Leaving) |
13:18:07 | * | andy-turner joined #nim |
13:59:17 | * | beholders_eye joined #nim |
14:09:14 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#pasty=mDdVgfpt |
14:40:36 | FromDiscord | <TFed> how to install HEAD commit? if a package has no tags We do install HEAD commit. package@0 ? |
14:43:44 | FromDiscord | <TFed> or @0 means last tag or HEAD if tags are missing, but there is no way to install specific commit or always HEAD |
14:43:45 | FromDiscord | <TFed> or @0 means last tag (or HEAD if tags are missing), but there is no way to install specific commit or always HEAD |
14:43:47 | FromDiscord | <TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1376570724441129082): how to install HEAD commit? if a package does not have any tags then we do install HEAD commit.is t package@0 ? |
14:43:47 | FromDiscord | <TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1376570724441129082): how to install HEAD commit? if a package does not have any tags then we do install HEAD commit. |
14:45:03 | FromDiscord | <TFed> Is this `package@0` working with all commits or just tags? |
14:47:57 | FromDiscord | <resumina> @user2m\: confirm which dll is being loaded by adding `-d:nimDebugDlOpen` to the compilation. Then confirm the DLL that is loaded has the symbol exported\: `dumpbin /exports C:\Program Files\OpenSSL-Win64\bin\WHICHEVERISGETTINGLOADED.DLL | find "PKCS5_PBKDF2_HMAC"` |
15:00:34 | * | skippy8 quit (Quit: WeeChat 4.5.2) |
15:45:12 | * | beholders_eye quit (Ping timeout: 265 seconds) |
15:55:49 | * | andy-turner quit (Quit: Leaving) |
16:51:55 | xtr00 | is it possible to import non std module in nimscript? It doesnt seem to work. I want to reuse some targets and configs beween sibling projects. |
17:01:48 | * | beholders_eye joined #nim |
17:05:59 | FromDiscord | <janakali> @xtr00 it seems to work fine for me. Maybe you have problems trying to import `.nims` file? In that case you need to use quotes around filename, e.g. :`import "somename.nims"` |
17:06:03 | FromDiscord | <heysokam> yes, but nimble need to know about it. so its not easy to do if you want it on nimble |
17:07:12 | xtr00 | yes, it is for nimble, now I am starting to find some issues on github around this |
17:07:21 | FromDiscord | <heysokam> I had that issue when trying to provide nimble support for `heysokam/confy`, and I couldn't solve it well because of the dependency needing to exist before its called, but calling the file would itself resolve the dependency |
17:10:21 | FromDiscord | <heysokam> you could write a nimscript file that resolves your dependency locally, and calls nimble after it↵or any other type of script, really |
17:15:32 | * | khazakar quit (Quit: Connection closed for inactivity) |
17:16:39 | xtr00 | well, I got something simple to work after simplifying evrything to the max. I think include might be working fine, but the error messages are confusing |
17:20:53 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=pBCbjhwp |
17:21:56 | FromDiscord | <heysokam> nimsuggest freaks out about nimscript because it doesn't know it needs to import that module, so every symbol is missing entirely. so the file ends up full of errors because of it |
17:23:34 | FromDiscord | <leorize> maybe also open an issue about that... |
17:39:38 | xtr00 | I found a few issues open already, but I think that my and these usecases are out of nimble's scope. nimble is a package manager not a build system. I need to use the correct tool for the job. |
17:39:49 | xtr00 | thanks for the help |
17:40:57 | FromDiscord | <heysokam> nimble is a buildsystem tool too |
17:41:05 | FromDiscord | <heysokam> its just a very lacking one |
17:44:13 | xtr00 | exactly, for complex projects you need appropriate tools. Even nim uses kock :) that's what I need to do. |
17:44:42 | xtr00 | *koch |
17:45:36 | FromDiscord | <heysokam> I wrote confy for this very reason, so might be worth it to check it out |
17:45:56 | FromDiscord | <heysokam> https://github.com/heysokam/confy/ |
17:46:39 | FromDiscord | <heysokam> I was sick and tired of nimble being broken, and nimscript being so lacking, and decided to do things differently |
17:48:29 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=IvtduBUQ |
17:49:10 | * | jinn6 quit (Quit: WeeChat 4.6.3) |
17:49:34 | FromDiscord | <leorize> it's likely that discardable is not a transferable property |
17:49:47 | FromDiscord | <leorize> nim doesn't have true aliases |
17:50:17 | xtr00 | confy looks interesting, scons and zig are nice, I will keep an eye on it and give a try some time. |
17:50:42 | FromDiscord | <heysokam> didn't know there was such a thing as transferable properties. ty leo |
17:56:03 | FromDiscord | <Elegantbeef> Cmon leo that's just a fancy way of saying discardable is not allowed on proc types! |
17:56:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=bDFASZJC |
17:58:05 | FromDiscord | <leorize> if you want to get pedantic, then it boils down to some pragmas are attached to symbols and some are attached to types xd |
17:59:32 | FromDiscord | <heysokam> both are useful insights, so thanks both for the helpful pedantisms 🙂 |
18:01:38 | FromDiscord | <heysokam> is there anything resembling an UUIDv4 generator in the stdlib?↵doesnt need to be uuid per se, just something of similar nature |
18:04:01 | FromDiscord | <leorize> I guess there's this\: https://nim-lang.github.io/Nim/oids.html |
18:04:15 | FromDiscord | <leorize> but it doesn't use a good random source from the description |
18:06:44 | FromDiscord | <heysokam> looks good enough, never saw that module before. ty |
18:07:23 | FromDiscord | <leorize> just know that modules that are infrequently used are usually riddled with bugs |
18:27:09 | * | jinn6 joined #nim |
18:45:02 | * | beholders_eye quit (Ping timeout: 272 seconds) |
18:55:31 | * | beholders_eye joined #nim |
19:12:43 | FromDiscord | <hamdy34> can I compile nim to c source files? |
19:14:24 | Amun-Ra | yes, but it's much better to build a library and {.exportc.} functions you need |
19:15:02 | Amun-Ra | C code generated is not meant to be human readable |
19:16:04 | FromDiscord | <hamdy34> I don't want it to be readable as long as it compiles |
19:16:29 | FromDiscord | <hamdy34> Can nim export to wasm/emscripten directly though? |
19:16:56 | Amun-Ra | indirectly |
19:17:04 | FromDiscord | <hamdy34> I plan to use SDL to handle windowing, input, etc |
19:17:15 | FromDiscord | <hamdy34> so the js target is not exactly what I need |
19:23:38 | Amun-Ra | this is my old emcc+sdl2 code compiled with nim, it's about 1y old: https://retro.rocks/tmp/ronin/emscripten/ ; perhaps I'll make a howto in spare time describing how to do that |
19:34:05 | * | beholders_eye quit (Ping timeout: 252 seconds) |
20:01:23 | FromDiscord | <hamdy34> when settings a debugger for nim, it works but break points does not work.↵I'm using clang+gdb on windows on vscode using the Native Debug extension https://media.discordapp.net/attachments/371759389889003532/1376651451182485614/image.png?ex=68361a12&is=6834c892&hm=9465f3a325af52738af48783bdde94e27282782d1029213c4404dd9d658e557f& |
20:02:07 | FromDiscord | <hamdy34> it prints correctly to the debug console but for some reason it doesn't see my .nim source files (the files do exist, I tried opening the path directly) |
20:03:55 | FromDiscord | <hamdy34> sent a code paste, see https://play.nim-lang.org/#pasty=uxhtKOdR |
20:59:04 | * | rockcavera joined #nim |
21:18:25 | * | ntat quit (Quit: leaving) |
21:25:56 | * | m5zs7k quit (Ping timeout: 252 seconds) |
21:31:07 | FromDiscord | <heysokam> Does someone understand what this error from clang is about when compiling my nim code? https://media.discordapp.net/attachments/371759389889003532/1376674031008223383/err.txt?ex=68362f1a&is=6834dd9a&hm=775289e4c247ae96dcbf900ada963314cf3ef21cef3a1ba3e497c0d7e739d0ab& |
22:08:00 | * | m5zs7k joined #nim |