00:03:31 | * | noeontheend joined #nim |
00:09:54 | NimEventer | New thread by Sixte: Module typing, code reuse and separate compilation , see https://forum.nim-lang.org/t/8795 |
00:13:46 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
00:14:13 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3LW1 |
00:16:23 | FromDiscord | <Elegantbeef> No |
00:16:45 | FromDiscord | <Elegantbeef> `proc `[]=`[T: not NiPref](node: var PrefsNode, key: string, val: T) = ` |
00:17:34 | FromDiscord | <Elegantbeef> Replace `NiPref` for whatever the second type is |
00:18:13 | FromDiscord | <Patitotective> the second type? |
00:19:10 | FromDiscord | <Patitotective> do you mean `PrefsNode`? or the table type, which is `PObject`? |
00:19:22 | FromDiscord | <Patitotective> (edit) "`PObject`?" => "`OrderedTable[string, PrefsNode]`?" |
00:23:31 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3LW4 |
00:23:37 | FromDiscord | <Elegantbeef> What ever the value is for the table |
00:23:37 | FromDiscord | <Elegantbeef> You have `Table[K,V]` that should be `T: not V` with whatever your V is |
00:24:02 | FromDiscord | <Patitotective> why? |
00:32:18 | * | covoid19 quit (Quit: Client closed) |
00:32:24 | FromDiscord | <Elegantbeef> why what? |
00:33:04 | FromDiscord | <Patitotective> why `T: not V`? |
00:33:41 | FromDiscord | <Elegantbeef> Cause you dont want to call this proc when `T is V` you want to call the `table[K] = V` |
00:33:59 | FromDiscord | <Elegantbeef> If you remove that it'll always dispatch on this and have stack overflows |
00:34:12 | FromDiscord | <Elegantbeef> Since `node.objectV[key] = newPNode(val)` matches the procedure call |
00:35:02 | FromDiscord | <Patitotective> sent a code paste, see https://paste.rs/6J6 |
00:36:08 | FromDiscord | <Elegantbeef> i mean i dont know why it doesnt i dont know what any of this is |
00:36:12 | FromDiscord | <Elegantbeef> A compiler error or output would be nice |
00:37:30 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3LWb |
00:37:49 | FromDiscord | <Patitotective> (edit) "https://play.nim-lang.org/#ix=3LWb" => "https://play.nim-lang.org/#ix=3LWc" |
00:37:59 | FromDiscord | <Elegantbeef> I mean the compiler error says why |
00:38:20 | FromDiscord | <Elegantbeef> `but expression 'val' is of type: PrefsNode` |
00:39:09 | FromDiscord | <Patitotective> so i must do `newPNode` for every element in a sequence? |
00:39:21 | FromDiscord | <Patitotective> (edit) "so ... i" added "should" | removed "must" |
00:40:30 | FromDiscord | <Patitotective> nvm |
00:40:34 | FromDiscord | <Elegantbeef> Well `proc newPNode(obj: PSeqParam): PrefsNode` you need a `PSeqParam` |
00:40:37 | FromDiscord | <Elegantbeef> Whatever that is |
01:21:25 | * | noeontheend quit (Ping timeout: 240 seconds) |
01:31:03 | * | krux02 quit (Remote host closed the connection) |
01:48:48 | FromDiscord | <Patitotective> How can I make a type that's just a shortcut for another type?↵https://play.nim-lang.org/#ix=3LWp |
01:49:00 | FromDiscord | <Elegantbeef> You didi |
01:49:06 | FromDiscord | <Patitotective> But it doesn't work |
01:49:10 | FromDiscord | <Patitotective> (edit) "work" => "work, run it" |
01:49:37 | FromDiscord | <Elegantbeef> Read the erroor |
01:49:39 | FromDiscord | <Elegantbeef> error even |
01:49:55 | FromDiscord | <Elegantbeef> `expected var` |
01:50:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/4qN |
01:50:36 | FromDiscord | <Patitotective> In reply to @Elegantbeef "Read the erroor": sorry... hehe ;-; |
01:55:24 | FromDiscord | <Patitotective> sent a code paste, see https://paste.rs/Vtt |
01:55:42 | FromDiscord | <Elegantbeef> Typically |
01:55:47 | FromDiscord | <Elegantbeef> Unless it's a reference |
01:56:25 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3LWs |
01:56:33 | FromDiscord | <Patitotective> (edit) "https://play.nim-lang.org/#ix=3LWs" => "https://play.nim-lang.org/#ix=3LWt" |
01:56:56 | FromDiscord | <Patitotective> What happens when it is a reference? |
01:57:22 | FromDiscord | <Elegantbeef> An immutable reference's fields are mutable |
01:57:30 | FromDiscord | <Elegantbeef> So `var` is only required to change where the reference points |
02:04:58 | FromDiscord | <huantian> sent a code paste, see https://paste.rs/4gX |
02:06:45 | FromDiscord | <huantian> XQueryTree takes `para1: PDisplay, para2: Window, para3: PWindow, para4: PWindow, para5: PPWindow, para6: Pcuint` |
02:07:07 | FromDiscord | <Elegantbeef> Making a window manager? |
02:07:09 | FromDiscord | <Rika> What is wrong? |
02:07:38 | FromDiscord | <huantian> wups forgot a line |
02:07:46 | FromDiscord | <Rika> Lol |
02:07:47 | nrds | <Prestige99> must be, beef |
02:07:53 | FromDiscord | <Elegantbeef> https://github.com/beef331/goodwm/blob/master/src/goodwm.nim#L47-L55 is how you should do it |
02:08:12 | FromDiscord | <huantian> but the for loop segfaults on the second iteration |
02:09:49 | FromDiscord | <Elegantbeef> Why are you creating a cuint |
02:10:00 | FromDiscord | <Elegantbeef> just do `n = 0.cuint` |
02:10:05 | FromDiscord | <Elegantbeef> then pass `n.addr` |
02:10:31 | FromDiscord | <huantian> oh I can do that? that is helpful |
02:11:43 | FromDiscord | <Elegantbeef> Also you should use XCreate to interact with Xlib |
02:13:31 | FromDiscord | <huantian> trying to get the window of an already existing window though |
02:14:29 | * | Gustavo6046 joined #nim |
02:15:21 | FromDiscord | <Elegantbeef> Anyway everthing else looks good |
02:16:26 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=3LWC |
02:16:29 | FromDiscord | <huantian> then segfaults |
02:16:55 | FromDiscord | <huantian> I think I'm doing something incorrect with children/childrens? |
02:17:39 | FromDiscord | <huantian> (edit) "https://play.nim-lang.org/#ix=3LWC" => "https://paste.rs/Sc3" |
02:19:15 | FromDiscord | <congusbongus> do you need to check the return value of XQueryTree |
02:19:17 | FromDiscord | <Elegantbeef> It seems right to me but i've been known to read bad |
02:19:40 | FromDiscord | <Elegantbeef> It returns an error code so they should |
02:21:23 | FromDiscord | <huantian> hm yeah it returns 1 |
02:22:23 | FromDiscord | <huantian> why is it failing |
02:23:35 | FromDiscord | <huantian> wait no nonzero is success |
02:27:02 | FromDiscord | <huantian> so that isn't failing |
02:27:30 | * | neurocyte09170 joined #nim |
02:29:44 | * | neurocyte0917 quit (Ping timeout: 256 seconds) |
02:29:44 | * | neurocyte09170 is now known as neurocyte0917 |
02:41:17 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=3LWD |
02:41:26 | FromDiscord | <Elegantbeef> Avoiding "X is not used" |
02:41:37 | FromDiscord | <auxym> oh |
02:41:38 | FromDiscord | <Rika> just doing nothing pretty much |
02:41:40 | FromDiscord | <auxym> so nothing |
02:41:42 | FromDiscord | <auxym> yeah |
02:41:44 | FromDiscord | <auxym> thanks |
02:41:47 | FromDiscord | <Elegantbeef> As you can tell it's "not implemented" |
02:41:52 | FromDiscord | <auxym> heh |
02:57:25 | FromDiscord | <auxym> btw @ElegantBeef, what do you think of my proposal to write all the target_link_libraries stuff in a separate include file for your picostdlib PR? |
02:58:00 | FromDiscord | <Elegantbeef> Seems fine, i'm still disliking the method of writing the linked libraries though |
02:58:04 | FromDiscord | <Elegantbeef> I really dislike the hack |
02:58:56 | FromDiscord | <Elegantbeef> I dont know if you looked at the hack but it's a hack |
02:59:20 | FromDiscord | <Elegantbeef> https://github.com/beef331/picostdlib/blob/683445f825b1ff538133f0aec840f8eafc72dfa6/src/picostdlib/private/linkutils.nim makes me hurt inside |
02:59:24 | * | vicfred quit (Quit: Leaving) |
02:59:29 | FromDiscord | <auxym> I don't mind the "write some nim code and invoke nim" thing, personally. |
02:59:45 | FromDiscord | <auxym> not a huge fan of "importing this library writes to a file" |
03:00:09 | FromDiscord | <Elegantbeef> I mean we need to propagate to the builder somehow |
03:00:15 | FromDiscord | <Elegantbeef> I'm still lost at the best way to do that |
03:00:20 | FromDiscord | <Elegantbeef> I dont like the searching for headers |
03:00:28 | FromDiscord | <auxym> not sure if there's a better way. Why not scan the nim compiler C files though? |
03:00:30 | FromDiscord | <Elegantbeef> It's probably the least hacky |
03:00:59 | FromDiscord | <auxym> yeah, choice between a hack and a hack 🙂 |
03:01:09 | FromDiscord | <Elegantbeef> Cause you can import multiple different ways |
03:01:35 | FromDiscord | <auxym> how so? |
03:01:42 | FromDiscord | <Elegantbeef> `from x import y` `import x as y` `import x except y` |
03:01:55 | FromDiscord | <Elegantbeef> What do you mean? |
03:03:57 | FromDiscord | <auxym> that shouldn't break either method of detecting the import, no? You get the module output as a c file. Or the import writes to the file |
03:04:30 | FromDiscord | <Elegantbeef> Oh i misread |
03:04:46 | FromDiscord | <Elegantbeef> I dont like scanning C files, i'm think the usage of the name might be sensible |
03:05:20 | * | arkurious quit (Quit: Leaving) |
03:05:42 | FromDiscord | <Elegantbeef> I mentioned somewhere about how the files end with `picostdlib@[email protected]` |
03:05:56 | FromDiscord | <Elegantbeef> That's the least ugly solution imo |
03:06:24 | FromDiscord | <auxym> yeah that sounds reasonable to me too |
03:07:35 | FromDiscord | <Elegantbeef> The down side is that it requires a new `piconim` executable every update |
03:08:58 | FromDiscord | <auxym> every update of what? |
03:09:22 | FromDiscord | <Elegantbeef> picostdlib, anytime a new module is added that needs to be linked |
03:09:26 | FromDiscord | <Elegantbeef> I assume we dont have them all |
03:11:42 | FromDiscord | <auxym> oh, well every time you add a new module, you need to add the logic to detect it in piconim? Sounds reasonable I think |
03:12:35 | FromDiscord | <Elegantbeef> Well i might make a PR for that variant tomorrow |
03:13:18 | FromDiscord | <Elegantbeef> Dont know about the cmake stuff whatsoever though\` |
03:14:21 | FromDiscord | <auxym> yeah pretty new to me too. I'm trying to get a barebones POC working for tinyusb HID. it's a pita. |
03:17:13 | FromDiscord | <Elegantbeef> Yea that was my experience with attempting to get tinyusb to work |
03:17:57 | FromDiscord | <auxym> i got their C example working, even modified for CDC+HID composite, now trying to mix in Nim |
03:19:04 | FromDiscord | <Elegantbeef> Yea i had the C stuff working, just not anything with Nim compiling |
03:20:45 | FromDiscord | <auxym> you're supposed to implement callbacks that they declare in headers, say `uint16_t tud_hid_get_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t buffer, uint16_t reqlen)` where `hid_report_type_t` is an enum |
03:21:07 | FromDiscord | <Elegantbeef> Yea i have macros for that |
03:21:13 | FromDiscord | <Elegantbeef> Or templates |
03:21:57 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=3LWK |
03:22:16 | FromDiscord | <auxym> But nim exports the enum type as `long int` and that fails to compile :S |
03:23:09 | FromDiscord | <Elegantbeef> Are you doing `{.size: sizeof(uint16)}`? |
03:24:32 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=3LWL |
03:24:39 | FromDiscord | <Elegantbeef> Well there is your problem |
03:25:11 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=3LWL |
03:25:21 | FromDiscord | <Elegantbeef> Is it supposed to be `sizeof(byte)`? |
03:25:26 | FromDiscord | <auxym> wait |
03:25:50 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=3LWM |
03:26:03 | FromDiscord | <auxym> are enums not `int` by default? |
03:26:07 | Amun-Ra | they are |
03:26:15 | FromDiscord | <Elegantbeef> Do i look like a C programmer to you? |
03:26:36 | FromDiscord | <Hamid_Bluri> LOL beef |
03:26:49 | * | sagax quit (Ping timeout: 256 seconds) |
03:27:01 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=3LWN |
03:27:13 | FromDiscord | <auxym> the only discrepancy is the enum: |
03:27:32 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=3LWO |
03:27:55 | FromDiscord | <auxym> nim exports `long int`, gcc is expecting `hid_report_type_t` |
03:28:13 | FromDiscord | <Elegantbeef> Oh you're not doing `importC: "hid_report_type_T"` |
03:28:36 | FromDiscord | <auxym> no. i can try that though |
03:30:50 | FromDiscord | <Rika> im back hello |
03:31:01 | FromDiscord | <auxym> well that's working 👍 |
03:31:08 | FromDiscord | <Rika> what shenanigans are you folk up to now |
03:31:13 | FromDiscord | <auxym> c stuff |
03:31:16 | FromDiscord | <Rika> i c |
03:31:19 | FromDiscord | <auxym> fun times |
03:33:28 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=3LWQ |
03:33:43 | FromDiscord | <auxym> how can I get nim to output that `const unsigned char` signature? |
03:33:46 | FromDiscord | <Rika> i dont remember if nim had a way of representing const |
03:34:02 | FromDiscord | <Elegantbeef> https://github.com/beef331/picostdlib/blob/master/src/picostdlib/tusb.nim#L174-L223 |
03:34:24 | FromDiscord | <Rika> lol thats major pain |
03:35:04 | FromDiscord | <auxym> lol that's ridiculously nicer that what I have atm (a bunch of crappy c2nim output) |
03:35:21 | FromDiscord | <Elegantbeef> beef2nim |
03:42:24 | FromDiscord | <auxym> unfortunately your `setReportCb` implementation seems to have the same result: gcc rejects it because it's lacking a `const` on a param |
03:42:45 | Amun-Ra | auxym: that's how I do it: https://play.nim-lang.org/#ix=3LWS |
03:44:26 | FromDiscord | <auxym> I think I want to `exportc` a proc though? TinyUSB wants the user to implement some functions (callbacks) that they declare a signature for in their header |
03:45:31 | FromDiscord | <auxym> I can't call `foo`, because there's no actual implementation in the c code |
03:45:35 | Amun-Ra | you have to use {.cdecl.} |
03:46:36 | Amun-Ra | proc somecallback(some c typed params) {.cdecl.} = … |
03:46:51 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=3LWT |
03:47:09 | FromDiscord | <auxym> Can I get nim to output that `uint8_t const` signature though? |
03:47:34 | FromDiscord | <Elegantbeef> with the `codegendecl` procs |
03:47:34 | FromDiscord | <Elegantbeef> On the procs\ |
03:48:00 | FromDiscord | <auxym> ah yeah, I guess that'd be the only way |
03:50:38 | FromDiscord | <auxym> anyways, enough fun for tonight, gotta sleep |
04:06:39 | * | adigitoleo quit (Remote host closed the connection) |
04:07:22 | * | adigitoleo joined #nim |
04:11:58 | arkanoid | what are the cons of -d:useMalloc? I use it to run valgrind and check for leaks, but I'm not aware what are the cons of leaving it enabled |
04:13:51 | * | rockcavera quit (Remote host closed the connection) |
04:23:34 | nrds | <Prestige99> Been having a lot of issues recently reporting through nimlsp by nimsuggest, but the code compiles and runs just fine. Anyone else been having issues? |
04:25:36 | nrds | <Prestige99> e.g. https://play.nim-lang.org/#ix=3LX0 https://i.imgur.com/oieV8uc.png |
04:27:07 | FromDiscord | <Elegantbeef> Is your nimlsp/nimsuggest not the same version as your compiler? |
04:27:29 | FromDiscord | <Elegantbeef> Nevermind that compiles all the way back in 0.13.0 |
04:29:53 | nrds | <Prestige99> Maybe I'll just ping PMunch about it when he's around, see if he has an idea |
04:29:58 | nrds | <Prestige99> I'm on 1.6.2 |
04:32:16 | nrds | <Prestige99> ah it's actually just a nimsuggest bug |
04:32:34 | nrds | <Prestige99> Was able to repro just using nimsuggest, chk 1 on the file |
04:32:42 | FromDiscord | <Elegantbeef> Ah |
04:33:37 | FromDiscord | <Elegantbeef> Wait you do `nimsuggest file.nim` then `chk 1`? |
04:33:44 | nrds | <Prestige99> yeah |
04:33:52 | nrds | <Prestige99> happens in 1.6.0 but not 1.4.8 |
04:34:19 | FromDiscord | <Elegantbeef> Ah doesnt happen on devel |
04:34:25 | nrds | <Prestige99> oh |
04:34:43 | FromDiscord | <Elegantbeef> Wait nvm it does |
04:34:46 | nrds | <Prestige99> it does for me with devel |
04:34:47 | FromDiscord | <Elegantbeef> I somehow wasnt on devel 😀 |
04:34:57 | nrds | <Prestige99> I'll just downgrade to 1.4.8 for now and file a bug |
04:35:17 | FromDiscord | <Elegantbeef> I dont like this bug since it might be related to me |
04:35:25 | nrds | <Prestige99> lol |
04:35:41 | nrds | <Prestige99> It also happens on base methods, very easy to repo. It says they aren't a base |
04:36:37 | FromDiscord | <Elegantbeef> Testing with my code breaker |
04:40:05 | FromDiscord | <Elegantbeef> Try with this commit https://github.com/nim-lang/Nim/commit/f373c17ad926b669bb3b5819ae1dff4bde1da88a |
04:41:43 | nrds | <Prestige99> Is there an easy way to do that with choosenim? |
04:42:56 | FromDiscord | <Elegantbeef> You should be able to do `choosenim install #commitHash` |
04:44:59 | nrds | <Prestige99> ah it's choosenim #f373c17ad926b669bb3b5819ae1dff4bde1da88a |
04:45:05 | nrds | <Prestige99> I tried without the # before |
04:45:16 | * | cyraxjoe quit (Quit: No Ping reply in 180 seconds.) |
04:45:32 | nrds | <Prestige99> Filed https://github.com/nim-lang/Nim/issues/19371 - I'm building that commit now |
04:45:35 | FromDiscord | <Elegantbeef> If that doesnt fail try the next commit |
04:46:41 | * | cyraxjoe joined #nim |
04:46:56 | nrds | <Prestige99> failed to build |
04:47:26 | nrds | <Prestige99> /home/avahe/.choosenim/toolchains/nim-#f373c17ad926b669bb3b5819ae1dff4bde1da88a/config/nim.cfg(16, 1) Error: invalid command line option: '--hint' |
04:47:45 | nrds | <Prestige99> Gonna get dinner I'll be back in a bit |
04:47:50 | FromDiscord | <Elegantbeef> Odd |
04:51:51 | * | vicfred joined #nim |
04:53:55 | arkanoid | speaking of nimsuggest, do you have any idea if it is expected it to consider nim files into .cache/nim/myproject_* ? |
04:54:19 | arkanoid | because if yes, I have a problem, if no, I should open a ticket to PMunch |
04:55:05 | FromDiscord | <Elegantbeef> Well if they're importable they should be considered |
04:55:18 | FromDiscord | <Elegantbeef> if the compiler can find them so should the tooling |
04:58:49 | arkanoid | so I have a problem |
05:00:00 | FromDiscord | <Rika> yes |
05:01:27 | arkanoid | but how can I track it down? I am using futhark that generates a nim file in .cache/nim/myproject_d/, if I leave it there I have hundreds of errors in vscode but the code compiles and runs. If I copy the generated nim file into local dir and import it instead of running futhark I've zero errors and code completion works nicely |
05:03:15 | arkanoid | I have a define to switch between the two behaviors, it is immediate: just commenting "--d:futhark" in config.nims makes the errors appears again, but compilation works https://github.com/arkanoid87/nimmap/blob/faa3d11411ee0d029fa3a4f958ce31be1633ca00/src/nimmap.nim#L8 |
05:10:15 | FromDiscord | <Elegantbeef> You might be able to add a `config.nims` with `--path:"~.confing/nim/myproject_d` |
05:10:20 | FromDiscord | <Elegantbeef> Thought not overly safe |
05:11:22 | arkanoid | let me try |
05:12:34 | arkanoid | in my case I think it should be --path:"~/.cache/nim/nimmap_d" |
05:13:26 | arkanoid | but no, it is not working |
05:13:52 | FromDiscord | <leorize> I don't think the compiler resolve `~` in path |
05:14:04 | arkanoid | target file is "/hom/jack/.cache/nim/nimmap_d/futhark_ABCBC588AD64774C.nim" |
05:14:12 | arkanoid | *home |
05:14:54 | arkanoid | but even --path:"/home/jack/.cache/nim/nimmap_d" does not solve the problem |
05:15:30 | arkanoid | if I copy futhark_ABCBC588AD64774C.nim into ./src/gdal.nim and do "import gdal" I have perfectly fine error correction/completion |
05:27:55 | * | Lord_Nightmare2 joined #nim |
05:35:11 | * | szahid quit (*.net *.split) |
05:35:12 | * | lain quit (*.net *.split) |
05:35:12 | * | dv^_^ quit (*.net *.split) |
05:35:12 | * | Lord_Nightmare quit (*.net *.split) |
05:35:13 | * | arkanoid quit (*.net *.split) |
05:35:13 | * | def- quit (*.net *.split) |
05:35:13 | * | drewr quit (*.net *.split) |
05:35:13 | * | tinystoat quit (*.net *.split) |
05:35:13 | * | flynn quit (*.net *.split) |
05:39:55 | * | Lord_Nightmare joined #nim |
05:39:59 | * | Lord_Nightmare2 quit (Ping timeout: 256 seconds) |
05:40:13 | * | lain joined #nim |
05:40:13 | * | szahid joined #nim |
05:40:13 | * | dv^_^ joined #nim |
05:40:13 | * | arkanoid joined #nim |
05:40:13 | * | def- joined #nim |
05:40:13 | * | drewr joined #nim |
05:40:13 | * | tinystoat joined #nim |
05:40:13 | * | flynn joined #nim |
05:46:55 | nrds | <Prestige99> @Elegantbeef I'm back, not sure why that isn't building. Are you able to build that commit? |
05:47:54 | adigitoleo | do I need to explicitly close the `File` of a `FileLogger`? |
05:52:08 | FromDiscord | <Elegantbeef> I'm not prestige even from source atm |
05:52:24 | nrds | <Prestige99> hm |
05:53:43 | FromDiscord | <Elegantbeef> Building it now i guess |
06:01:44 | FromDiscord | <Elegantbeef> Yea that's not the breaking change it seems |
06:03:23 | FromDiscord | <Elegantbeef> Built with that commit and also borked |
06:05:29 | FromDiscord | <Elegantbeef> So yay for me |
06:13:32 | nrds | <Prestige99> Could probably git bisect to figure out the commit, if it'll build that is :P |
06:13:41 | nrds | <Prestige99> know it's a 1.6.0 bug |
06:14:01 | FromDiscord | <Elegantbeef> well it's between 1.4.8 and that commit |
06:14:11 | nrds | <Prestige99> yeah |
06:14:40 | FromDiscord | <Elegantbeef> I'm a numpty that just randomly chooses commits and guesses |
06:20:21 | nrds | <Prestige99> git bisect is great |
06:59:23 | * | adigitoleo quit (Remote host closed the connection) |
07:00:06 | * | adigitoleo joined #nim |
07:14:55 | * | jjido joined #nim |
07:24:59 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
07:30:29 | * | PMunch joined #nim |
07:35:26 | * | jjido joined #nim |
07:49:31 | FromDiscord | <Rika> pmunch do you think its worth it to make a futhark kinda thing that works more like c2nim than a macro or w/e |
07:49:54 | FromDiscord | <Rika> im really not liking the macro idea so far, and would much rather edit the converted file directly |
07:50:17 | PMunch | Well, you're free to copy the file out and edit it to your hearts desire |
07:50:36 | PMunch | It completely defeats the purpose though, but I'm not going to arrest you for it |
07:51:26 | FromDiscord | <Elegantbeef> Of course not norway doesnt have extradition agreements with all the nations of the world! |
07:51:55 | PMunch | The whole point of Futhark is to bring C files into Nim exactly as they are, with some support for changing types if you want to make a more strict alias or something. |
07:52:19 | FromDiscord | <Rika> well its not enough support for what i want to do |
07:52:46 | PMunch | As soon as you edit the Futhark output you've broken the possibility of rebuilding if a new version of the library comes out |
07:52:54 | PMunch | What do you want to do? |
07:53:02 | FromDiscord | <Rika> that's already broken given that i am making a full wrapper and not a thin wrapper |
07:53:27 | PMunch | The idea is that you take the C code into Nim exactly as it appears, then you write your wrapper on top, calling the functions from the library. |
07:53:33 | NimEventer | New post on r/nim by Familiar_Ad_8919: why do we have to import everything, see https://reddit.com/r/nim/comments/s20r04/why_do_we_have_to_import_everything/ |
07:53:45 | FromDiscord | <Rika> converting C-style flags (or'ed ints) into sets is somewhat hairy |
07:53:53 | PMunch | This way you will get type mismatch errors if the library updates |
07:54:05 | arkanoid | PMunch: I'm still on that weird clang bug, it's strange, I've been working successfully with futhark until couple hours ago and then suddenly SIGSEGV |
07:54:11 | PMunch | Instead of silent errors that suddenly crashes or allows exploits on runtime |
07:55:03 | PMunch | Hmm, that is very unfortunate. I do remember having some SIGSEGVs while I was developing it, but that was just me actually making mistakes and all those should be fixed |
07:55:28 | PMunch | I mean the error comes from the clang library, so I'm not entirely sure what we can do about it |
07:55:28 | FromDiscord | <Rika> then what would be a better way for me to change what i said |
07:55:42 | FromDiscord | <Rika> or'ed ints into sets and enums |
07:55:58 | arkanoid | PMunch: I agree with leaving the generated futhark nim file in .cache/nim/myproject_*, but the issue with that is that nimsuggests seems not picking it's contents for helping users out. I have to copy that file into local project folder and remove futhark to get bindings+nimsuggest working correctly |
07:55:58 | FromDiscord | <Elegantbeef> Templates/procs that do the Nim \<-\@Rika) |
07:56:07 | FromDiscord | <Rika> no |
07:56:13 | FromDiscord | <Rika> inelegant to me |
07:56:20 | arkanoid | just like here: https://github.com/arkanoid87/nimmap/blob/master/src/nimmap.nim |
07:56:22 | PMunch | Well that's the way to do it |
07:56:27 | FromDiscord | <Elegantbeef> I agree but that's what pmunch suggests if you want |
07:56:28 | arkanoid | sorry: https://github.com/arkanoid87/nimmap/blob/faa3d11411ee0d029fa3a4f958ce31be1633ca00/src/nimmap.nim#L8 here |
07:56:43 | FromDiscord | <Elegantbeef> You can always use futhark like c2nim and just copy the nim files |
07:56:56 | FromDiscord | <Elegantbeef> There is nothing stopping you from automating half the process |
07:57:22 | PMunch | You overload the proc you want to "fix" with a version that takes a set and then you do the conversion and call the underlying function |
07:57:40 | FromDiscord | <Rika> its not just a proc |
07:57:41 | FromDiscord | <Rika> its a type as well |
07:58:08 | PMunch | Same concept applies to types |
07:58:36 | PMunch | You shouldn't force Nim to think C code is something else than what it is. Just build your abstractions on top of the C code like a sane person |
07:58:39 | FromDiscord | <Elegantbeef> You do the cast internally with the template/proc |
07:58:40 | FromDiscord | <Rika> there are facilities for me to add prefixes to every symbol right |
07:58:45 | FromDiscord | <Rika> if there are then that would be better |
07:59:28 | PMunch | Yes, you can create a rename hook (a procedure that gets called upon to rename things) |
07:59:39 | PMunch | And then just add a prefix or postfix that way |
08:00:18 | arkanoid | oh, I've just found that also Yardanico faces the "var cursor = getTranslationUnitCursor(unit)" SIGSEGV, but that happened 01-12-2021 |
08:00:35 | PMunch | Or you can have a module that runs Futhark and then have `from myWrapper import nil` and then have to prefix everything with `myWrapper` |
08:00:49 | FromDiscord | <Rika> okay] |
08:00:55 | FromDiscord | <Rika> good enough |
08:01:15 | PMunch | arkanoid, did you check the clang library headers and compare them to the wrapper I use? |
08:01:47 | arkanoid | which wrapper? |
08:02:04 | PMunch | This one: https://github.com/PMunch/futhark/blob/master/futhark.nimble#L15 |
08:03:44 | arkanoid | no I havent, but I need some more hint to understand where to check, it's a log of text there |
08:04:38 | PMunch | Well I was thinking compare the call at the point of the SIGSEGV from that wrapper to the actual libclang header on your system |
08:05:17 | arkanoid | sure, let me get it |
08:07:09 | arkanoid | I've already checked that the symbol is present in /usr/lib/x86_64-linux-gnu/libclang-10.so.1 |
08:07:36 | arkanoid | but "rg clang_getTranslationUnitCursor" in "/usr/lib/clang/10/include" returns zero results |
08:08:06 | PMunch | Well it would probably be called get_translation_unit_cursor or something I guess |
08:08:28 | PMunch | Wait, clang/10? |
08:08:41 | PMunch | That might be why, I'm running clang/13.0.0 |
08:09:51 | arkanoid | the importc in index.nim is "proc getTranslationUnitCursor*(a1: CXTranslationUnit): CXCursor {.importc: "clang_getTranslationUnitCursor", cdecl.}" |
08:10:15 | arkanoid | nm -D /usr/lib/x86_64-linux-gnu/libclang-10.so.1 | grep clang_getTranslationUnitCursor results in 00000000003cf1c0 T clang_getTranslationUnitCursor |
08:10:45 | arkanoid | nm -D /usr/lib/x86_64-linux-gnu/libclang-12.so.1 | grep clang_getTranslationUnitCursor results in 0000000000455710 T clang_getTranslationUnitCursor |
08:10:57 | arkanoid | I have more than one libclang installed |
08:11:24 | arkanoid | But I've been always working with the v 10 so far, and futhark behaved correctly |
08:11:40 | PMunch | Oh right, I see |
08:11:42 | arkanoid | (10 is the one shipped with ubuntu 20.04 LTS) |
08:12:40 | arkanoid | I get same error with both versions (nim c --passl:"-lclang" opir.nim, nim c --passl:"-lclang-12" opir.nim) |
08:12:48 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:14:18 | arkanoid | question is why I don't ripgrep it in clang headers folder |
08:14:28 | arkanoid | is it a private function? |
08:14:30 | PMunch | I can't seem to find it either |
08:15:46 | arkanoid | seems documented https://clang.llvm.org/doxygen/group__CINDEX__CURSOR__MANIP.html#gaec6e69127920785e74e4a517423f4391 |
08:15:47 | PMunch | Aha, on my system it's in /usr/include/clang-c |
08:17:32 | arkanoid | zero results in my /usr/include/clang |
08:17:54 | arkanoid | I see it should be in index.h https://github.com/hdoc/llvm-project/blob/a6ad3505abc7409abd2a4118338b9c85ec2e9f09/clang/include/clang-c/Index.h#L2729 |
08:20:56 | arkanoid | got it, is in /usr/lib/llvm-12/include/clang-c/Index.h |
08:23:01 | arkanoid | the original signature is "CINDEX_LINKAGE CXCursor clang_getTranslationUnitCursor(CXTranslationUnit);" |
08:23:22 | PMunch | Yeah I just asked my package manager to list all the files installed for `clang` and then grepped that list for Index.h |
08:23:41 | PMunch | That's the same as it is for me |
08:25:32 | FromDiscord | <Rika> whats the recommended enum entry naming scheme nowadays> |
08:25:34 | FromDiscord | <Rika> (edit) "nowadays>" => "nowadays?" |
08:26:26 | arkanoid | what if the problem in in a linked library used by libclang? https://termbin.com/txld |
08:29:18 | PMunch | I guess we could see if we could find a clang/llvm channel to ask these questions in :P |
08:29:22 | PMunch | Might be more productive |
08:29:33 | PMunch | And @Rika, I'm not sure TBH |
08:31:12 | PMunch | I used to be a fan of pure enums.. |
08:31:20 | FromDiscord | <Rika> i recall not exactly needing to prefix enum names with prefixes anymore but yeah |
08:31:33 | FromDiscord | <Rika> they can be disambiguated easily nowadays ig |
08:31:39 | PMunch | Of course |
08:31:54 | FromDiscord | <Elegantbeef> there is the experimental overridedable enums\:D |
08:32:18 | FromDiscord | <Rika> @_@ |
08:32:44 | PMunch | Overrideable? |
08:33:00 | FromDiscord | <Elegantbeef> Cant tell if that's a correction or asking |
08:33:15 | FromDiscord | <Rika> asking likely |
08:33:19 | FromDiscord | <Elegantbeef> Overloadable enum sorry |
08:33:28 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/RFCs/issues/373 RFC |
08:33:54 | FromDiscord | <Elegantbeef> Why arent they in the manual somewhere, no clue |
08:34:09 | FromDiscord | <Elegantbeef> Ah nvm i'm dumb they're in the normal manual |
08:34:11 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#types-overloadable-enum-field-names |
08:34:18 | FromDiscord | <Elegantbeef> Not the experimental manual |
08:34:21 | PMunch | I've just never heard of them before :P |
08:34:56 | FromDiscord | <Elegantbeef> They're new in 1.6.0 |
08:35:14 | FromDiscord | <Rika> so do i still prefix or not xd |
08:35:26 | FromDiscord | <Elegantbeef> If you use overloadable you do not |
08:35:35 | FromDiscord | <Elegantbeef> otherwise it's up to you |
08:35:39 | FromDiscord | <Rika> if i dont since this is a library |
08:36:28 | FromDiscord | <Elegantbeef> personally i prefer prefix |
08:36:49 | FromDiscord | <Elegantbeef> I dont like the name spacing |
08:36:55 | FromDiscord | <Rika> why not |
08:37:07 | FromDiscord | <Rika> personally im torn |
08:37:12 | FromDiscord | <Rika> both have upsides and downsides |
08:37:17 | FromDiscord | <Elegantbeef> It's just tedious especially when there no ambiguity |
08:37:17 | FromDiscord | <Rika> and im not sure which is better |
08:37:51 | FromDiscord | <Elegantbeef> like if you have `a: MyEnum` i do not like typing `myObj.a = MyEnum.myEnumVal` |
08:37:51 | FromDiscord | <Rika> if theres no ambiguity then you dont have to "namespace" i thought? |
08:38:20 | FromDiscord | <Elegantbeef> I always forget the semantics for enums so i dont recall at the moment |
08:38:51 | FromDiscord | <Elegantbeef> Just dont write your library until 1.8 or 2.0 whenever overloadables are stable 😀 |
08:39:11 | FromDiscord | <Rika> gotcha, delay my program by a century |
08:39:22 | FromDiscord | <Elegantbeef> Indeed |
08:39:29 | FromDiscord | <Rika> though i dont know if ill live to 120 |
08:39:34 | arkanoid | PMunch: I'm asking in #llvm (oftc) and first idea is ABI mismatch |
08:39:43 | FromDiscord | <Elegantbeef> Well good luck |
08:39:52 | arkanoid | not sure how to handle this hint in our context |
08:39:54 | FromDiscord | <Elegantbeef> Hopefully no one needs the library you're wanting to write |
08:40:12 | FromDiscord | <Rika> prolly not, this is a convenience wrapper more than a thin one |
08:40:36 | FromDiscord | <Rika> theres already a thin wrapper of it but its not "updated" i think or its slightly wrong which led to errors |
08:41:01 | PMunch | Maybe try to wrap clang with Futhark and see if it gives you the same signature :P |
08:43:25 | arkanoid | futhark inception |
08:45:19 | arkanoid | well, the original signature is "CINDEX_LINKAGE CXCursor clang_getTranslationUnitCursor(CXTranslationUnit);", it's just matter of expanding the macros with preprocessor |
08:46:58 | arkanoid | done, here's the expanded version "__attribute__((visibility("default"))) CXCursor clang_getTranslationUnitCursor(CXTranslationUnit);" |
09:07:17 | * | sagax joined #nim |
09:13:02 | PMunch | Hmm, that looks like it should match what the wrapper says |
09:15:33 | arkanoid | PMunch: I've recovered the list of the installed packages before the error, and matched it with the dynamic libraries needed by libclang |
09:15:51 | arkanoid | the only thing that pops out is linux-libc-dev:amd64 (5.4.0-92.103, 5.4.0-94.106) |
09:16:00 | arkanoid | but not sure if that means anything |
09:17:31 | arkanoid | that package only contains header files, and here it doesn't seem that the error is driven by a .h import |
09:17:34 | arkanoid | but not sure |
09:19:53 | arkanoid | what puzzles me is that the error seems to be into clang-*.so no matter the version |
09:20:23 | * | Gustavo6046 quit (Quit: Leaving) |
09:24:32 | PMunch | This happens with all C files right? |
09:24:47 | PMunch | You can't create a simple hello world header and it works? |
09:28:39 | arkanoid | I've been trying to compile a different (old) project that was working before (libgiintrospection) and I got same error. I'm going to build a barebone test case |
09:28:42 | * | jjido joined #nim |
09:35:06 | arkanoid | PMunch: I've created a test similar to the one in your readme using single stb file, but I'm getting same SIGSEGV |
09:35:40 | arkanoid | opir -I/usr/lib/clang/10/include -I/home/jack/nim/futhest/stb /home/jack/.cache/nim/futhest_d/futhark-includes.h |
09:35:43 | PMunch | Hmm |
09:36:18 | arkanoid | sigsegv is always at /home/jack/.nimble/pkgs/futhark-#head/opir.nim(343) opir |
09:36:41 | arkanoid | in the meanwhile I've installed clang-11, so now I have 3 versions to test agains |
09:37:00 | PMunch | Why not clang-13? |
09:37:15 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:37:44 | arkanoid | because it is not present in ubuntu LTS repository |
09:38:16 | arkanoid | opir compiles and links successfully to all 3, but same sigsegv |
09:41:43 | PMunch | Since a update triggered it and none of those versions fix it I think this might be related to another dependency of clang.. |
09:42:18 | * | jjido joined #nim |
09:47:27 | arkanoid | PMunch: sure, but gdb should point to it |
09:47:53 | PMunch | What does it point to now? |
09:48:06 | arkanoid | or at least the backtrace would show libclang calling a symbol in another .so |
09:50:05 | arkanoid | 0x00007ffff62a81d3 in clang_getTranslationUnitCursor () from /usr/lib/x86_64-linux-gnu/libclang-10.so.1 |
09:51:13 | PMunch | That's the last part? |
09:52:09 | * | Figworm quit (Ping timeout: 256 seconds) |
09:53:29 | arkanoid | yes, the gdb backtrace stops there |
09:53:36 | arkanoid | before that is nimland |
09:53:47 | arkanoid | #0 0x00007ffff62a71d3 in clang_getTranslationUnitCursor () from /usr/lib/x86_64-linux-gnu/libclang-10.so.1 |
09:53:53 | arkanoid | #1 0x0000555555592c52 in NimMainModule () |
09:54:57 | PMunch | Hmm |
09:56:37 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:56:51 | PMunch | It's really hard to help you when it doesn't crash for me.. |
09:58:48 | arkanoid | I wish I didn't do that apt upgrade |
09:59:27 | arkanoid | but it should have a meaningful explanation. It's a compiled .so, and that had not been upgraded |
10:07:34 | PMunch | Yeah, I mean it has to be *something* in that update you did which caused it |
10:08:40 | PMunch | This is part of the reason I switched to Arch in the first place. Apt just lagging so far behind on packages. I mean even if you find the error it is likely that it has been fixed like a year ago and you just have to wait for the next release |
10:11:01 | * | Figworm joined #nim |
10:11:02 | arkanoid | PMunch: if I need an upgraded package I have many different alternative ways (nix, container, vm), but here I'm dealing with something that was working before without apparent change in the relevant file |
10:11:14 | arkanoid | here's the list of the upgraded packages: https://termbin.com/pna3 |
10:11:25 | FromDiscord | <Rika> Could it be the fact that you didn’t update somehow |
10:11:53 | arkanoid | Rika, what do you mean? |
10:13:44 | arkanoid | gdb shows that the error is in /usr/lib/x86_64-linux-gnu/libclang-10.so.1 and here's the stats: https://termbin.com/eqb7 last change is more than 1 month old |
10:15:18 | arkanoid | and if we consider the modification date, is more than 8 months |
10:20:10 | PMunch | That could be when it was built though, file timestamps can be wonky |
10:22:52 | arkanoid | Sure, you can hack them, but thats not what server distros generally do. Other like nix do them for every package for reproducible builds |
10:27:45 | PMunch | Oh I just meant like if you unzip a folder for example you get the original timestamps |
10:34:48 | arkanoid | Sure it is the build time. The last time a .so is modified is hopefully the linking time. |
10:35:06 | arkanoid | Or some patchelf hack |
11:17:18 | NimEventer | New question by Clarence Liu: Nim Compile - Modify default compile flags on MacOS - issue with clang ld: library not found for -lrt, see https://stackoverflow.com/questions/70680615/nim-compile-modify-default-compile-flags-on-macos-issue-with-clang-ld-libra |
11:26:35 | FromDiscord | <hmmm> yo doods what libs would you use to create something like this in nim https://media.discordapp.net/attachments/371759389889003532/930784821423251486/thing.PNG |
11:30:48 | FromDiscord | <Rika> What |
11:30:51 | FromDiscord | <Rika> Like what’s |
11:30:56 | FromDiscord | <Rika> Graph generation? |
11:30:58 | FromDiscord | <Rika> Sorting? |
11:31:02 | FromDiscord | <Rika> Hash tables? |
11:31:39 | PMunch | Shuffling algorithm? |
11:32:27 | FromDiscord | <hmmm> like some graphical representation that connects similar element from 2 lists. I'll figure the backend logic, I'm just looking for what can I use for the presentation part |
11:34:42 | FromDiscord | <hmmm> I started looking at plots options in python since they have massive libs but still not finding something that models arrows |
11:34:57 | FromDiscord | <Rika> So a graph library |
11:35:03 | FromDiscord | <hmmm> yea something like that |
11:40:05 | PMunch | Neat, trimmed some unnecessary code off-of my keyboard firmware, it is now smaller than the Blink example from Arduino :P |
11:40:49 | PMunch | @hmmm, easiest is probably just to have Nim output Dot/graphviz definitions and then use that tool to build the graph |
11:42:01 | PMunch | Ah there are apparently also some bindings for it: https://github.com/Aveheuzed/nimgraphviz |
11:42:10 | PMunch | So you don't have to create a file and build it externally |
11:48:17 | FromDiscord | <hmmm> graphviz seems like a strong option, still looks a bit heavy weight for my usecase but I can see it working. I want to try to look if I find easier options before committing tho |
11:48:27 | FromDiscord | <hmmm> ty pmunchie 👑 |
12:06:12 | * | fvs joined #nim |
12:15:56 | FromDiscord | <hmmm> scratch that, nimgraphviz is perfect 😃 https://media.discordapp.net/attachments/371759389889003532/930797241772441610/test_graph.png |
12:19:26 | PMunch | I mean it's been around for ages and is built for exactly this kind of thing |
12:19:32 | PMunch | So you'd expect it to be good |
12:21:14 | FromDiscord | <vindaar> definitely better than 'plotting' it \:P |
12:21:18 | FromDiscord | <vindaar> funny\_arrows.png https://media.discordapp.net/attachments/371759389889003532/930798591570739230/funny_arrows.png |
12:21:38 | FromDiscord | <vindaar> (yeah, yeah, I didn't feel like creating a proper arrow 🤣) |
12:21:42 | FromDiscord | <hmmm> hey how you did that vind |
12:21:57 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=3LYJ |
12:22:18 | FromDiscord | <hmmm> dataframes and ggplot |
12:22:38 | FromDiscord | <hmmm> it's very good tbh |
12:23:50 | FromDiscord | <hmmm> I mean dataframes are like the best structure to model my stuff since it's basically 2 lists that gets connected with some logic |
12:25:35 | FromDiscord | <vindaar> well, that may be the case, but I'd still opt for generating graphviz based on the data (maybe use some DF logic for some processing before, sure). At least graphviz gives you a nice figure without specifying everything |
12:54:36 | * | rockcavera joined #nim |
12:54:36 | * | rockcavera quit (Changing host) |
12:54:36 | * | rockcavera joined #nim |
13:03:09 | * | jjido joined #nim |
13:11:47 | * | yann-kaelig joined #nim |
13:12:44 | yann-kaelig | Hello |
13:12:59 | yann-kaelig | Maybe you have read this news https://www.bleepingcomputer.com/news/security/dev-corrupts-npm-libs-colors-and-faker-breaking-thousands-of-apps/ |
13:13:27 | yann-kaelig | I wonder how this similar things could not happen on nim and why ? |
13:13:48 | FromDiscord | <mratsim> In reply to @yann-kaelig "I wonder how this": use lockfiles |
13:17:16 | FromDiscord | <Rika> It can happen |
13:17:57 | yann-kaelig | I don't understand. So I should use a lockfiles on all the ecternal packages available for nim, to prevent that maybe one day a dev of an external package available for nim could be corrupted ? How can I be also sure that a new package added to the list of nim-lang/packages is "clean" |
13:18:34 | FromDiscord | <mratsim> In reply to @yann-kaelig "I don't understand. So": You audit the package |
13:18:57 | FromDiscord | <mratsim> and before updating you lock at the diff |
13:19:13 | FromDiscord | <mratsim> (edit) "lock" => "look" |
13:19:29 | FromDiscord | <xx_ns> In reply to @yann-kaelig "I don't understand. So": this problem exists with all dependency managers regardless of language |
13:19:41 | FromDiscord | <xx_ns> and to an extent, all package managers even for linux distros |
13:19:59 | FromDiscord | <xx_ns> the difference being that uploaded linux distro packages are usually vetted by a central authority |
13:20:16 | FromDiscord | <mratsim> There is a reason supply chain attacks are getting more popular, especially on Pypi and NPM, it's effective |
13:20:57 | FromDiscord | <Rika> People aren’t taught in mitigating the attacks yet I guess |
13:21:49 | yann-kaelig | I never heard of this on a language like C or C++. Apologize for my ignorance, maybe I missed something that I should learn. |
13:22:06 | FromDiscord | <mratsim> because C and C++ don't have a package manager |
13:23:00 | yann-kaelig | ok, I was aware of that, so there is an issue with these new languages making use of package manager |
13:23:32 | FromDiscord | <mratsim> well even distro packaged C libraries can break everything cough systemd |
13:23:50 | FromDiscord | <mratsim> someone somewhere needs to spend time |
13:24:08 | FromDiscord | <mratsim> it can be the one who depends on that library, a distro maintainer or the end user |
13:24:10 | FromDiscord | <Rika> It’s a problem in C and C++ if you use a package manager |
13:24:13 | FromDiscord | <Rika> It’s not inherent to the language |
13:25:17 | FromDiscord | <mratsim> glibc manages to break everything every couple years |
13:27:17 | * | neurocyte0917 quit (Read error: Connection reset by peer) |
13:28:25 | * | neurocyte09170 joined #nim |
13:31:28 | FromDiscord | <haxscramper> I think it is inherent to the algorithm used |
13:31:44 | FromDiscord | <xx_ns> In reply to @yann-kaelig "I never heard of": c/c++ projects usually either simply import symbols from shared libraries on the system where the executable is.. executed, or libraries are compiled in statically in which case they are vendored in the source tree and vetted |
13:31:49 | FromDiscord | <haxscramper> pull-highest vs pull-lowest, and former is more "convenient" as recent discussion indicated |
13:31:56 | FromDiscord | <xx_ns> ie - supply chain does not include an untrusted link |
13:32:09 | FromDiscord | <haxscramper> viewed as more convenient by some people |
13:37:15 | PMunch | I guess GitHub has tried to help with this recently. For popular languages you will get security warnings if you depend on a package that is tagged as insecure. |
13:37:25 | PMunch | Of course then it might be too late |
13:38:31 | PMunch | But yeah, if you lock your versions you should be safe (and vet any updates). It still boggles me how many people have stuff breaking when a rogue dev pushes an edit to a package. Do their live environments just pull in new versions willy-nilly? |
13:39:06 | FromDiscord | <Rika> Yes |
13:39:09 | PMunch | That being said Nimble, unlike NPM, doesn't actually host any packages. So even if you have locked your versions a dev can still just delete their repo.. |
13:39:23 | PMunch | And if you don't have a backup you're out of luck |
13:39:42 | FromDiscord | <Rika> NPM hosting the packages doesn’t help, the owner could probably still delete their package |
13:39:52 | PMunch | I'm assuming the lockfile system uses hashes, otherwise they could also hard-push exploits |
13:40:12 | PMunch | @Rika, AFAIK you can't remove or edit previous versions |
13:40:19 | PMunch | The only thing you can do is push a new one |
13:41:25 | FromDiscord | <xx_ns> as a rule of thumb, i commit my node_modules directory alongside source code. This way, diffs between pulled dependencies are highlighted by git itself, which makes it super easy to vet differences. As an added bonus, my CI pipeline does not require internet access after the initial git clone |
13:42:13 | FromDiscord | <xx_ns> coincidentally enough, I am currently conducting a supply chain attack proof of concept on npm right this second (I'm a security researcher) |
13:42:27 | FromDiscord | <xx_ns> i unpublished a package, but have to wait 24 hours before i can publish it again |
13:43:25 | FromDiscord | <xx_ns> getting a 403 `<package-name> cannot be republished until 24 hours have passed.` |
13:44:25 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
13:45:31 | PMunch | @xx_ns, adding node_modules to your git repo is a nice way to make your Git repo huge and unwieldy. Generally it's not recommended to do that |
13:46:16 | yann-kaelig | Well, not talking only about security, but I have the feeling that something is wrong with nim, rust, npm and all others languages that use the package manager model. The fact that it is based on one person and everything that comes from that, security, audit and finally the possibility of seeing one day the project disappear. I found a lof of 404 in the nim external package list |
13:50:26 | PMunch | The alternative is writing everything yourself though |
13:50:41 | PMunch | And using that system you won't get much done |
13:51:19 | PMunch | Well, I guess you could wait for someone to set up an organisation to implement libraries for you. But a lot of stuff is maintained by single people |
13:51:39 | FromDiscord | <Rika> In reply to @yann-kaelig "Well, not talking only": Well I’m not aware of any other systems that would be better |
13:51:43 | yann-kaelig | In fact it seems to be fine in a corporate or organisation model ( like mozilla and that where rust comes from ) but in a community model, it's too much 'scattered' |
13:53:00 | FromDiscord | <xx_ns> PMunch: yes, this is usually what people tell me, but i don't care |
13:54:20 | FromDiscord | <xx_ns> it is the approach that google takes, for example |
13:54:21 | FromDiscord | <xx_ns> https://www.jackfranklin.co.uk/blog/check-in-your-node-dependencies/ |
13:54:44 | PMunch | @xx_ns, sure you do you, but posing this as a fix to the problem isn't really helpful, because it's literally the opposite of how you're supposed to use Git |
13:55:49 | FromDiscord | <xx_ns> what do you mean by "not supposed to use git"? |
13:56:06 | FromDiscord | <auxym> In a company setting, I think the best way would be to set-up an immutable mirror of the packages you use (old versions cannot be removed or modified) and lockfiles on each project. Still can't get around auditing new packages though. |
13:56:12 | FromDiscord | <xx_ns> node dependencies are code, and you absolutely are meant to use git to commit code and keep track of its history |
13:57:04 | FromDiscord | <xx_ns> you're _not_ supposed to store binaries in git projects (without LFS), but "large amounts of code" is not a problem |
13:57:05 | PMunch | Sure, but not in your own tree |
13:57:26 | szahid | best ide for nim? |
13:57:37 | szahid | vsc? |
13:57:37 | PMunch | szahid, depends on which IDE you like |
13:57:50 | PMunch | And how much you tend to use the IDE |
13:57:59 | FromDiscord | <hmmm> In reply to @PMunch "That being said Nimble,": can nimble store backups if you ask with a flag? |
13:58:33 | PMunch | @hmmm, I meant the external packages, Nimble is just a huge list of repos with some tags and links to where to find them. |
13:58:36 | FromDiscord | <xx_ns> PMunch: i absolutely don't see why not |
13:59:00 | PMunch | @xx_ns, well you can start with the list of things from the article you listed |
13:59:37 | FromDiscord | <xx_ns> ... the article also details why those issues aren't really issues |
13:59:53 | FromDiscord | <hmmm> In reply to @PMunch "<@887269570765791243>, I meant the": no I mean store installed backups on your local machine in a backup folder |
14:00:01 | FromDiscord | <xx_ns> from the same article, "As with anything in software engineering, most "rules" are guidelines, and we're able to side-step them when required." |
14:00:27 | PMunch | I mean if you want to speed up builds, keep a consistent set of packages, etc. you can create another repo with just your node modules that you update when you need it, and then submodule that or something. |
14:01:13 | PMunch | @xx_ns, oh yeah, as I said I'm not going to tell you not to do this. If it fits your use-case and you don't mind the drawbacks I won't stand in your way. But it's not something I would recommend |
14:02:12 | FromDiscord | <xx_ns> i'm just a tad miffed at the statement that my recommendation is "not helpful" when it has clear benefits and is used by very large companies |
14:02:51 | FromDiscord | <xx_ns> the latter being anecdotal, of course, but proof that it works in practice |
14:03:19 | PMunch | Sorry, I didn't mean that is wasn't helpful at all, just that it wasn't helpful as a general solution to the package manager issues debate |
14:03:38 | PMunch | Didn't mean to sound so dismissive |
14:04:24 | FromDiscord | <xx_ns> of course, no worries, and i agree that it is not a solution to the package management issue in general, just said that as a side note |
14:07:17 | PMunch | The whole problem is quite complex though. Even if you check all you node_modules into your repo there's nothing stopping it from containing a `if epochTime() > 1643000000: staticExec("rm -rf ~")` |
14:08:45 | PMunch | And maybe one of the dependencies you're holding back from an update was a critical security fix for a non-disclosed security hole. They won't draw too much attention to it because that would mean disclosing the bug, and you will then be vulnerable until you either update or it is disclosed. |
14:12:23 | * | lumo_e joined #nim |
14:13:25 | FromDiscord | <xx_ns> of course, but you can say that about anything, all dependencies everywhere are ultimately untrusted. The issue with supply chain attacks specifically is the fact that previously benign packages are replaced with malicious versions - when checking node_modules into your tree, you force yourself to be very mindful of vetting dependencies when they are updated |
14:13:44 | FromDiscord | <xx_ns> i'm not advocating against regular patch updates at all |
14:14:05 | FromDiscord | <xx_ns> rather, even patch updates should not be pulled in blindly |
14:14:13 | PMunch | Of course |
14:14:36 | PMunch | At least not if the package isn't actually checked to make sure that it is in fact a patch update |
14:15:01 | PMunch | Nothing that stops a malicious (or even just ignorant) dev from just ticking up the patch number and rewriting their entire API |
14:15:48 | FromDiscord | <hmmm> well apparently the solution is just trust the devs are not out to damage you and just trust them and you will be safe 99.99% of the times, if you need 100% it means you are a business so you have the means to pay someone to inspect the lesser vetted packages every update |
14:18:21 | FromDiscord | <xx_ns> ultimately it comes down to your specific use case and balancing software fast (and trusting/using third party dependencies) vs writing secure software (ie - first party dependencies or a vetting procedure for dependencies) |
14:18:46 | FromDiscord | <xx_ns> in most cases, companies don't have the resources or simply don't want to go the latter route |
14:19:59 | FromDiscord | <hmmm> no one said 100% was free 😃 the alternative is just accept the risk and have some backups for catastrophe scenarios |
14:20:09 | FromDiscord | <haxscramper> In reply to @hmmm "well apparently the solution": I bet in several years we will see a lot of "verified by" packages - someone certainly would be willing to monetize on that |
14:20:34 | FromDiscord | <xx_ns> that's not a bad business idea |
14:20:53 | FromDiscord | <haxscramper> Or maybe this will just become a standard practice, like debian thoroughly reviews things IIRC (not sure how detailed the review is though) |
14:21:43 | FromDiscord | <haxscramper> Or maybe more attention will be given to semantic diff tools, to automate patterns like `static(rm rf)` |
14:22:15 | FromDiscord | <haxscramper> nobody prevents me from doing `var a = "rm"; var b = "rf` and then merging things together |
14:23:03 | FromDiscord | <haxscramper> then maybe some proxy layer for interpreted languages, some kind of stricter "audit" mode, where it tries to see all the paths that execution can take |
14:23:36 | FromDiscord | <haxscramper> `if epochTime() > 1643000000:` is probably ok, but what about`when (...): static: kill everything` |
14:24:19 | FromDiscord | <xx_ns> as someone who writes malware for a living: there's a million different ways to hide malicious behaviour and backdoors. Ultimately, you _will_ need to be observing behaviour when executed. Static analysis can only get you so far |
14:25:16 | * | jjido joined #nim |
14:28:13 | FromDiscord | <Tanguy> Is there a way to make a distinct type implicitly convertible to it's original type without converters? |
14:30:24 | FromDiscord | <haxscramper> no, for user-defined implicit conversion you need to use `converter`, I don't think there is a way around that |
14:34:21 | PMunch | The "verified by" sounds interesting, but you'd probably be out of business the first time you slip up and a package makes it through your vetting process with some kind of breaking bug.. |
14:34:36 | PMunch | And as @xx_ns pointed out, vetting packages isn't all that easy |
14:35:03 | PMunch | @Tanguy, implicit conversion is the whole point of a converter, why do you want to avoid them? |
14:38:33 | FromDiscord | <Tanguy> They don't always work |
14:39:12 | FromDiscord | <Tanguy> I was hopping for a simpler shortcut with distinct |
14:41:00 | PMunch | Well the whole goal of distinct is to *not* make the types implicitly convertible |
14:41:42 | yann-kaelig | "all dependencies everywhere are ultimately untrusted" >> That right, but between a dependency built by one person with several users and eyes on it, and a dependency built by many people, I will certainly make more confidence in the second model, the issue being resolved upstream and I have less chance to leave it and touch the 'users' |
14:42:10 | FromDiscord | <Rika> In reply to @PMunch "The "verified by" sounds": well i guess thats why many companies should do it |
14:42:31 | FromDiscord | <Tanguy> Yes, but I basically need: `type test = distinct int`, test -> int = implicit conversion, int -> test: explicit conversion |
14:45:16 | FromDiscord | <Rika> maybe package managers should encourage audits when updating, but thats still a lot of work |
14:45:23 | PMunch | Then a converter is what you're supposed to use |
14:45:32 | FromDiscord | <Rika> or have a slow rollout? and a feedback system? |
14:45:33 | PMunch | Why do you say they don't always work? |
14:45:52 | FromDiscord | <mratsim> NPM and Pypi main feature is low overhead and 0 friction |
14:46:06 | FromDiscord | <mratsim> basically it's production readyness vs happy-go-lucky |
14:46:11 | FromDiscord | <mratsim> (edit) "readyness" => "readiness" |
14:46:41 | * | arkurious joined #nim |
14:47:32 | FromDiscord | <hmmm> In reply to @Rika "well i guess thats": since they will be vetting it internally anyway they might as well share it. Not something like verified by since they would implicitly taking responsability but something like "package xyz ver 0.3.0 used by {BigCorp} for {BigCorpProject}" if that version is good for BigCorp to rely on it should be good for the rest of us |
14:47:33 | FromDiscord | <Rika> long time no see |
14:48:05 | FromDiscord | <mratsim> In reply to @hmmm "since they will be": that's what we do at Status, we pin all dependencies, even our own libraries. |
14:48:24 | FromDiscord | <mratsim> and the Nim compiler |
14:48:47 | FromDiscord | <Rika> In reply to @hmmm "since they will be": it would need to be a hash of the code and not a version, or the host platform should be like npm and not allow changes to code once pushed and versioned |
14:48:50 | PMunch | I mean that's the obvious way to do it |
14:49:12 | PMunch | @Rika, I'd still use a hash just in case |
14:49:20 | PMunch | Never know when you get mitm-ed |
14:49:26 | FromDiscord | <Rika> yeah i guess so |
14:49:31 | PMunch | Or maybe NPM itself could get hacked |
14:49:41 | FromDiscord | <Rika> i mean if the host is compromised then you cant trust anything there at all anymore |
14:49:46 | FromDiscord | <Rika> even hashes |
14:50:00 | PMunch | @hmmm, problem is now BigCorp is paying for vetting the package and BigCompetitor can use it for "free" |
14:50:14 | FromDiscord | <xx_ns> i mean, packages can be (and are) signed |
14:50:18 | FromDiscord | <Rika> In reply to @PMunch "<@887269570765791243>, problem is now": make it anonymous then |
14:50:32 | FromDiscord | <mratsim> just like all Linux kernel development is paid by afew and enjoyed by many. |
14:50:39 | PMunch | "Someone vetted this" doesn't inspire a whole lot of confidence :P |
14:50:46 | FromDiscord | <Rika> vetted by 1, 2, 3, now competitors would need to weigh against "trusting one" or vetting then adding to the auditor count |
14:50:50 | FromDiscord | <Rika> i mean thats the point |
14:51:06 | PMunch | @mratsim, oh yeah, I was just saying that for some companies they wouldn't care to do this |
14:51:15 | FromDiscord | <mratsim> In reply to @Rika "long time no see": 👋 |
14:51:41 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
14:51:41 | FromDiscord | <Rika> a lot of companies prolly wouldnt care |
14:52:04 | FromDiscord | <Rika> such is the issue of open source i guess |
14:52:09 | FromDiscord | <mratsim> Talent is a harder problem than competitors to be honest |
14:52:22 | FromDiscord | <Rika> ~~technically thats literally the problem that caused the supply chain attack~~ |
14:52:25 | FromDiscord | <Tanguy> @PMunch in a generic-heavy codebase, I get a nice `Error: cannot instantiate: 'T'` on my generic converter. Will try to do a minimal repro, but in the meantime i'm stuck |
14:52:27 | FromDiscord | <mratsim> attract all the talent with your open-source policy and competitors cannot reuse the code 😉 |
14:52:43 | FromDiscord | <Rika> though the dude has more history than just "not being paid by the big corps that use his code" |
14:52:58 | FromDiscord | <mratsim> In reply to @Tanguy "<@!696333749570371585> in a generic-heavy": do you have `foo[T](a: T)` something? |
14:53:10 | FromDiscord | <mratsim> cannot isntantiate T is often because you forgot the [T] |
14:53:18 | FromDiscord | <mratsim> (edit) "isntantiate" => "instantiate" |
14:53:19 | * | lumo_e quit (Quit: Quit) |
14:54:23 | FromDiscord | <Tanguy> Yeah yeah, it works on simple use cases, but when embedded in weird generic stuff, fails |
14:54:32 | FromDiscord | <hmmm> In reply to @PMunch "<@887269570765791243>, problem is now": since all the BigCompetitors will be slurping BigCorp efforts for free I see great opportunity for GoBigOrDieFastStartup to use all the bleeding edge stuff and become the next BigCorp 😃 |
14:55:04 | FromDiscord | <mratsim> In reply to @Tanguy "Yeah yeah, it works": I removed all converters from my codebases |
14:55:20 | FromDiscord | <mratsim> I had converters for float->complex and it messed up everything. |
14:55:32 | FromDiscord | <mratsim> I only do converters scoped by template |
14:55:41 | FromDiscord | <Rika> maybe only show the "verified by x" when more than n companies have vetted it? im not sure, this just delays the issue |
14:56:33 | FromDiscord | <Tanguy> Yes, I'm not fond of converters, but I need backward compat and so needs to be able to convert the old type to the new one implicitly, basically |
14:57:18 | FromDiscord | <mratsim> maybe instead of having the converter generic, you create a template and instantiate only concrete converters |
14:57:53 | FromDiscord | <mratsim> like `template createConverter(inType, outType: typedesc): untyped =` |
14:58:22 | FromDiscord | <Tanguy> Mhh seems tricky, don't know which types it's going to be used with (it's for the Future type) |
15:00:47 | FromDiscord | <mratsim> you can also overload all calls that use the new API |
15:01:36 | FromDiscord | <mratsim> you can create an overloading macro similar to https://github.com/mratsim/Arraymancer/blob/61188413abb269471ff5cbf4b9326ddd3c2a38c7/src/arraymancer/private/deprecate.nim#L20-L70 |
15:03:14 | FromDiscord | <Tanguy> That's pretty cool |
15:03:40 | PMunch | I have also had code break with converters. I wonder if there's something "wrong" with them or how they're invoked that is the source for these issues |
15:03:41 | FromDiscord | <mratsim> this one is also an overload generator: https://github.com/mratsim/Arraymancer/blob/61188413abb269471ff5cbf4b9326ddd3c2a38c7/src/arraymancer/linear_algebra/helpers/overload.nim |
15:03:56 | FromDiscord | <mratsim> I think here it's generics |
15:04:32 | FromDiscord | <mratsim> you can just modify this part to call a conversion procedure that doesn't need to be a converter - https://github.com/mratsim/Arraymancer/blob/61188413abb269471ff5cbf4b9326ddd3c2a38c7/src/arraymancer/linear_algebra/helpers/overload.nim#L14 |
15:05:11 | FromDiscord | <mratsim> usage: https://github.com/mratsim/Arraymancer/blob/61188413abb269471ff5cbf4b9326ddd3c2a38c7/src/arraymancer/linear_algebra/helpers/solve_lapack.nim#L14 |
15:11:28 | * | cuibonobo joined #nim |
15:23:39 | * | Zevv quit (Ping timeout: 256 seconds) |
15:34:08 | * | Zevv joined #nim |
15:36:16 | FromDiscord | <Patitotective> Does someone have an example of a parser package parsing json? I've this parser https://github.com/chocobo333/mcmurry but it only have an example of a calculator and `std/parsejson` is raw, and complex |
15:36:24 | FromDiscord | <Patitotective> (edit) "Does someone have an example of a parser package parsing json? I've ... this" added "found" |
15:37:07 | FromDiscord | <Patitotective> _honeycomb_'s example is also a calculator |
15:37:13 | FromDiscord | <Patitotective> 😕 |
15:37:28 | FromDiscord | <Patitotective> (edit) "a calculator" => "simple" |
15:38:53 | FromDiscord | <Patitotective> _nimly_'s example is also a calculator |
15:42:01 | FromDiscord | <eyecon> Do you really need to reimplement JSON parsing though? There are so many JSON parsers, I thought |
15:42:07 | FromDiscord | <eyecon> Or is this a learning project |
15:42:13 | FromDiscord | <eyecon> In which case more power to you |
15:42:24 | FromDiscord | <Patitotective> i want to parse a syntax similar to json |
15:42:35 | FromDiscord | <Patitotective> https://patitotective.github.io/PREFS/ |
15:43:02 | FromDiscord | <Patitotective> (edit) "https://patitotective.github.io/PREFS/" => "sent a code paste, see https://play.nim-lang.org/#ix=3LZS" |
15:43:06 | FromDiscord | <Rika> ah were back to this again |
15:43:09 | FromDiscord | <Patitotective> hehe |
15:43:09 | FromDiscord | <Rika> i forgot youre that guy |
15:43:35 | FromDiscord | <Rika> imo |
15:43:45 | FromDiscord | <Rika> i would just "make my own examples" |
15:43:49 | FromDiscord | <eyecon> Well, I assume you know how to parse the atoms, the complicated part is the recursion |
15:44:00 | FromDiscord | <Rika> not really i dont think |
15:44:12 | FromDiscord | <Patitotective> i dont know which parser to use |
15:44:18 | FromDiscord | <Rika> wdym? |
15:44:27 | FromDiscord | <Patitotective> like, a parser library |
15:44:32 | FromDiscord | <Rika> ah |
15:44:37 | FromDiscord | <mratsim> In reply to @Patitotective "Does someone have an": jsony, nim-json-serialization, .... there are like 7 or so |
15:45:11 | FromDiscord | <Rika> i really like status' serialisation lib, dunno why people arent using it that much |
15:45:29 | FromDiscord | <eyecon> I would just use CBOR for everything if it were up to me |
15:45:33 | FromDiscord | <eyecon> Compact and well-defined |
15:45:42 | FromDiscord | <Rika> cbor is a binary format |
15:45:48 | FromDiscord | <Rika> i assume he wants it to be readable |
15:45:52 | FromDiscord | <Patitotective> yea |
15:45:53 | FromDiscord | <mratsim> there is a chronos dependencies because we need it for testing and we don't have test-only / optional dependencies in nimble :/ |
15:45:55 | FromDiscord | <Rika> in which case why invent a new format? |
15:45:58 | FromDiscord | <Rika> just use json.... |
15:46:07 | FromDiscord | <mratsim> (edit) "dependencies" => "dependency" |
15:46:11 | FromDiscord | <Rika> In reply to @mratsim "there is a chronos": ah i see |
15:46:20 | FromDiscord | <Patitotective> In reply to @Rika "just use json....": that's not the idea ._. |
15:46:26 | FromDiscord | <Rika> im just sayin |
15:46:55 | FromDiscord | <Patitotective> back to my question, which parser should I use? |
15:47:00 | FromDiscord | <Patitotective> (edit) "back to my question, which parser ... should" added "library" |
15:47:11 | FromDiscord | <mratsim> what constraints do you have? |
15:47:12 | FromDiscord | <Rika> if you want you can start with a peg |
15:47:15 | FromDiscord | <eyecon> Do you have a specific reason to implement your own (citing Greenspun) half-assed implementation of half the JSON? |
15:47:18 | FromDiscord | <Rika> in which case id use npeg |
15:47:28 | FromDiscord | <mratsim> In reply to @eyecon "Do you have a": Isn't it about Lisp though? |
15:47:44 | FromDiscord | <Patitotective> In reply to @mratsim "what constraints do you": huh? |
15:47:53 | FromDiscord | <eyecon> In reply to @mratsim "Isn't it about Lisp": It is but I have to think of this every time I hear of a new configuration format nowadays |
15:48:01 | * | Zevv quit (Ping timeout: 256 seconds) |
15:48:13 | FromDiscord | <eyecon> The idea is the same |
15:48:21 | FromDiscord | <mratsim> In reply to @Patitotective "huh?": well what development constraint and design constraint do you have? |
15:48:27 | FromDiscord | <Rika> In reply to @Patitotective "huh?": its a kinda-difficult question, probably about what kind of language it is in the chomsky hierarchy to be able to choose which type of parser |
15:48:30 | FromDiscord | <Rika> ah |
15:48:35 | FromDiscord | <Rika> misinterpretation galore |
15:48:36 | FromDiscord | <eyecon> Every human-readable declarative configuration language converges to one of JSON, YAML or TOML |
15:49:31 | * | Zevv joined #nim |
15:49:43 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3LZT |
15:49:56 | FromDiscord | <Rika> In reply to @eyecon "Every human-readable declarative configuration": i'd wish someone made an ultra-YATOJSONML that combined each's benefits |
15:50:09 | FromDiscord | <mratsim> There are way more but see the many json read/writer: https://github.com/treeform/jsony/blob/master/tests/bench.nim#L2-L10 |
15:50:28 | FromDiscord | <Rika> lmfao tha reaction |
15:50:39 | FromDiscord | <mratsim> jsony, jason, eminim, packedjson, json-serialization, json |
15:51:56 | FromDiscord | <mratsim> if you want to code-gold on loc, I guess npeg. |
15:52:02 | FromDiscord | <mratsim> code-golf |
15:52:17 | FromDiscord | <Patitotective> ill try npeg |
15:52:18 | FromDiscord | <Patitotective> thanks |
15:52:20 | FromDiscord | <Patitotective> 🙃 |
15:54:08 | FromDiscord | <mratsim> there is a json parser in the tests if you want to use that as a reference |
15:54:49 | FromDiscord | <mratsim> https://github.com/zevv/npeg/blob/master/tests/examples.nim#L85-L107 |
16:06:38 | FromDiscord | <auxym> json sort of sucks for human-writeable config though, cause no comments and no trailing commas |
16:07:49 | FromDiscord | <auxym> plain old ini, json5, toml or kdl are probably the best for that IMO. (yaml has... issues) |
16:08:04 | FromDiscord | <eyecon> I root for TOML |
16:08:06 | FromDiscord | <eyecon> FWIW |
16:08:21 | FromDiscord | <eyecon> Nice, intuitive, relatively capable |
16:10:38 | FromDiscord | <auxym> agreed. toml's biggest disadvantage is probably deeply nested structures, but that should hopefully not come up for the "human writeable config" usecase (or you have bigger issues) |
16:14:50 | FromDiscord | <Rika> same here |
16:15:07 | FromDiscord | <Rika> config should probably be max. 3 depth |
16:15:19 | FromDiscord | <Rika> and 3 is already kinda pushing it |
16:15:22 | FromDiscord | <Rika> so not much of an issue id say |
16:35:55 | * | rockcavera quit (Remote host closed the connection) |
16:38:35 | * | yann-kaelig left #nim (#nim) |
16:43:46 | * | rockcavera joined #nim |
16:43:46 | * | rockcavera quit (Changing host) |
16:43:46 | * | rockcavera joined #nim |
16:50:07 | FromDiscord | <IsaacPaul> big fan of json5 here. Simple and explicit. |
16:52:56 | * | jjido joined #nim |
17:02:46 | FromDiscord | <Patitotective> Can Nim `char`s be defined like `Print <- {'\x21'..'\x7e',' '}, # Visible characters and spaces`?↵(npeg) |
17:04:09 | FromDiscord | <Patitotective> is there a place where i could see how nim type's grammar is defined? |
17:04:34 | FromDiscord | <Patitotective> like this https://nim-lang.org/docs/manual.html#syntax-grammar↵but for types |
17:16:47 | FromDiscord | <mratsim> In reply to @Patitotective "Can Nim `char`s be": Nim char are 0..255 |
17:16:50 | * | stkrdknmibalz joined #nim |
17:16:52 | FromDiscord | <mratsim> the same as C |
17:17:15 | FromDiscord | <hmmm> uh oh, I forgot again how to zip two seqs into a std table, halp pls 😑 |
17:17:40 | FromDiscord | <mratsim> In reply to @hmmm "uh oh, I forgot": import sequtils? |
17:17:44 | FromDiscord | <hmmm> oh |
17:17:59 | FromDiscord | <hmmm> I don't think I did it with sequtils when I did it the last time |
17:21:01 | FromDiscord | <hmmm> oh yea I used zip, ty miri |
17:21:52 | FromDiscord | <Rika> miri? |
17:22:15 | FromDiscord | <hmmm> 😅 |
17:50:40 | * | noeontheend joined #nim |
18:17:09 | FromDiscord | <yallxe> hi, how do I compile nim application without any console/window? |
18:20:29 | FromDiscord | <Rika> --app:gui? not sure |
18:35:15 | * | Lord_Nightmare quit (*.net *.split) |
18:35:16 | * | cyraxjoe quit (*.net *.split) |
18:35:16 | * | oprypin quit (*.net *.split) |
18:35:16 | * | cornfeedhobo quit (*.net *.split) |
18:35:16 | * | ldlework quit (*.net *.split) |
18:35:17 | * | dv2 quit (*.net *.split) |
18:35:17 | * | oisota quit (*.net *.split) |
18:35:17 | * | LyndsySimon quit (*.net *.split) |
18:35:18 | * | termer quit (*.net *.split) |
18:35:18 | * | Amun-Ra quit (*.net *.split) |
18:35:18 | * | euantorano quit (*.net *.split) |
18:35:18 | * | Ekho quit (*.net *.split) |
18:35:19 | * | anadahz quit (*.net *.split) |
18:35:19 | * | Goodbye_Vincent quit (*.net *.split) |
18:35:19 | * | mahlon quit (*.net *.split) |
18:35:20 | * | GnuYawk quit (*.net *.split) |
18:35:20 | * | ecs quit (*.net *.split) |
18:35:20 | * | [R] quit (*.net *.split) |
18:35:21 | * | xiamx quit (*.net *.split) |
18:35:22 | * | robertmeta quit (*.net *.split) |
18:35:22 | * | stkrdknmibalz quit (*.net *.split) |
18:35:22 | * | rockcavera quit (*.net *.split) |
18:35:23 | * | neurocyte09170 quit (*.net *.split) |
18:35:24 | * | vicecea quit (*.net *.split) |
18:35:24 | * | rb quit (*.net *.split) |
18:35:25 | * | jkl1337 quit (*.net *.split) |
18:35:26 | * | happycorsair[m] quit (*.net *.split) |
18:35:26 | * | xiamx[m] quit (*.net *.split) |
18:35:26 | * | averell quit (*.net *.split) |
18:35:27 | * | meowray quit (*.net *.split) |
18:35:29 | * | toothlessgear quit (*.net *.split) |
18:35:29 | * | blackbeard420 quit (*.net *.split) |
18:35:30 | * | zgasma[m] quit (*.net *.split) |
18:35:30 | * | xet7 quit (*.net *.split) |
18:35:30 | * | dtomato quit (*.net *.split) |
18:35:31 | * | redj quit (*.net *.split) |
18:35:31 | * | GreaseMonkey quit (*.net *.split) |
18:35:31 | * | koltrast quit (*.net *.split) |
18:35:32 | * | dom96 quit (*.net *.split) |
18:35:32 | * | adium quit (*.net *.split) |
18:35:33 | * | FromDiscord quit (*.net *.split) |
18:35:33 | * | mal`` quit (*.net *.split) |
18:35:33 | * | mjsir911 quit (*.net *.split) |
18:35:34 | * | ormiret quit (*.net *.split) |
18:35:34 | * | Yardanico quit (*.net *.split) |
18:35:34 | * | NimEventer quit (*.net *.split) |
18:35:34 | * | jjido quit (*.net *.split) |
18:35:34 | * | Zevv quit (*.net *.split) |
18:35:34 | * | fvs quit (*.net *.split) |
18:35:35 | * | nixfreaknim[m] quit (*.net *.split) |
18:35:35 | * | cheer[m] quit (*.net *.split) |
18:35:35 | * | notchris quit (*.net *.split) |
18:35:35 | * | Schnouki quit (*.net *.split) |
18:35:36 | * | gshumway quit (*.net *.split) |
18:35:36 | * | madprops quit (*.net *.split) |
18:35:36 | * | djanatyn quit (*.net *.split) |
18:35:37 | * | sagax quit (*.net *.split) |
18:35:37 | * | vicfred quit (*.net *.split) |
18:35:38 | * | anddam quit (*.net *.split) |
18:35:38 | * | kayabaNerve_ quit (*.net *.split) |
18:35:38 | * | joast quit (*.net *.split) |
18:35:39 | * | ozzz quit (*.net *.split) |
18:35:39 | * | ehmry quit (*.net *.split) |
18:35:39 | * | Onionhammer quit (*.net *.split) |
18:35:39 | * | oddish quit (*.net *.split) |
18:38:44 | * | noeontheend quit (Ping timeout: 256 seconds) |
18:39:52 | * | oprypin_ joined #nim |
18:39:52 | * | MightyJoe joined #nim |
18:39:52 | * | hexeme joined #nim |
18:39:52 | * | Lord_Nightmare joined #nim |
18:39:52 | * | termer_ joined #nim |
18:39:52 | * | LyndsySimon joined #nim |
18:39:52 | * | euantorano joined #nim |
18:39:52 | * | oisota joined #nim |
18:39:52 | * | stkrdknmibalz joined #nim |
18:39:52 | * | jjido joined #nim |
18:39:52 | * | rockcavera joined #nim |
18:39:52 | * | Zevv joined #nim |
18:39:52 | * | neurocyte09170 joined #nim |
18:39:52 | * | fvs joined #nim |
18:39:52 | * | sagax joined #nim |
18:39:52 | * | vicfred joined #nim |
18:39:52 | * | anddam joined #nim |
18:39:52 | * | vicecea joined #nim |
18:39:52 | * | kayabaNerve_ joined #nim |
18:39:52 | * | anadahz joined #nim |
18:39:52 | * | joast joined #nim |
18:39:52 | * | zgasma[m] joined #nim |
18:39:52 | * | nixfreaknim[m] joined #nim |
18:39:52 | * | xiamx joined #nim |
18:39:52 | * | happycorsair[m] joined #nim |
18:39:52 | * | cheer[m] joined #nim |
18:39:52 | * | xiamx[m] joined #nim |
18:39:52 | * | jkl1337 joined #nim |
18:39:52 | * | rb joined #nim |
18:39:52 | * | [R] joined #nim |
18:39:52 | * | ecs joined #nim |
18:39:52 | * | GnuYawk joined #nim |
18:39:52 | * | mahlon joined #nim |
18:39:52 | * | Goodbye_Vincent joined #nim |
18:39:52 | * | robertmeta joined #nim |
18:39:52 | * | meowray joined #nim |
18:39:52 | * | averell joined #nim |
18:39:52 | * | blackbeard420 joined #nim |
18:39:52 | * | toothlessgear joined #nim |
18:39:52 | * | NimEventer joined #nim |
18:39:52 | * | Yardanico joined #nim |
18:39:52 | * | ormiret joined #nim |
18:39:52 | * | mjsir911 joined #nim |
18:39:52 | * | mal`` joined #nim |
18:39:52 | * | FromDiscord joined #nim |
18:39:52 | * | koltrast joined #nim |
18:39:52 | * | GreaseMonkey joined #nim |
18:39:52 | * | redj joined #nim |
18:39:52 | * | dtomato joined #nim |
18:39:52 | * | xet7 joined #nim |
18:39:52 | * | adium joined #nim |
18:39:52 | * | dom96 joined #nim |
18:39:52 | * | djanatyn joined #nim |
18:39:52 | * | madprops joined #nim |
18:39:52 | * | Schnouki joined #nim |
18:39:52 | * | notchris joined #nim |
18:39:52 | * | gshumway joined #nim |
18:39:52 | * | oddish joined #nim |
18:39:52 | * | Onionhammer joined #nim |
18:39:52 | * | ehmry joined #nim |
18:39:52 | * | ozzz joined #nim |
18:40:32 | FromDiscord | <yallxe> In reply to @Rika "--app:gui should disable the": works! what about `echo`? will it just ignore all the `echo` statements? |
18:40:33 | FromDiscord | <Rika> no it still runs, its just "hidden" |
18:40:33 | FromDiscord | <Rika> afaik |
18:42:22 | * | Amun-Ra joined #nim |
18:44:40 | * | Ekho- joined #nim |
18:45:30 | * | cornfeedhobo joined #nim |
19:33:47 | FromDiscord | <Patitotective> In reply to @mratsim "Nim char are 0..255": 0..255? |
19:39:32 | nrds | <Prestige99> a range from 0 to 255 |
19:41:22 | FromDiscord | <demotomohiro> !eval echo char.low, ",", char.high |
19:41:24 | NimBot | |