| 00:01:39 | FromDiscord | <timotheecour> `{.nosystem.}` will solve this problem of system bloat without introducing any breaking change |
| 00:02:26 | FromDiscord | <timotheecour> (edit) "change" => "change, allowing to redefine system module as one that imports a number of `{.nosystem.}` smaller modules" |
| 00:04:02 | arkanoid | when I test a module I import it on the top of the test file, but this forces me to export some names even if they should stay hidden inside the module |
| 00:12:42 | FromDiscord | <Elegantbeef> you could always put them inside a `when defined(yourPackageNameTest)` |
| 00:13:02 | FromDiscord | <r3m> can someone mention my nickname please i'm testing something |
| 00:13:22 | FromDiscord | <leorize> or... `import {.all.}`, newly introduced in devel |
| 00:13:53 | FromDiscord | <Elegantbeef> Import all i presume disregards ``? |
| 00:15:00 | FromDiscord | <leorize> yea |
| 00:17:45 | arkanoid | Elegantbeef, what do you mean? Do you mean not using * but add all "export name" in myPackageName in a when block? |
| 00:22:26 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3uxe |
| 00:24:29 | arkanoid | yeah got it. thanks |
| 00:24:40 | arkanoid | quite verbose, but probably is the cleanest solution |
| 00:24:54 | FromDiscord | <Elegantbeef> Well unless in devel like leorize mentioned |
| 00:25:28 | arkanoid | this compiles "proc foo: Future[string] {.async.} = result = "bar"", this not "proc foo: Future[string] {.async.} = "bar"" |
| 00:26:03 | arkanoid | I don't understand why |
| 00:28:39 | arkanoid | I mean, the result should be implicit, and the return type is explicit. I see no differences between the two |
| 00:30:05 | FromDiscord | <timotheecour> that's because of the way the async macro is implemented, feel free to send a PR to fix it |
| 00:30:54 | arkanoid | I don't have the skills for that (yet), thanks for the answer! |
| 00:37:28 | * | Onionhammer quit (Quit: Ping timeout (120 seconds)) |
| 00:37:45 | * | Onionhammer joined #nim |
| 00:56:20 | arkanoid | I've just found out that the times.nim module is cursed and has side effects on string format if you import it whole, but not if you import it partially https://play.nim-lang.org/#ix=3uxk |
| 00:58:03 | arkanoid | is this an issue worth posting on github? |
| 01:02:53 | FromDiscord | <Elegantbeef> well it prints the time locally so i dont think it's "cursed" |
| 01:04:13 | arkanoid | Elegantbeef, printing? no, the proc returns string, there's no main, no echo |
| 01:04:26 | fn | <ForumUpdaterBot99> New thread by Giaco: '$' on Time can have side effect, but only if you import the whole times module, see https://forum.nim-lang.org/t/8287 |
| 01:04:30 | FromDiscord | <Elegantbeef> I mean it converts it to time local |
| 01:04:47 | arkanoid | why it should, I'm not even filling it |
| 01:04:53 | FromDiscord | <Elegantbeef> Without importing the whole module you use the normal object stringify operator |
| 01:04:57 | FromDiscord | <Elegantbeef> When you import the entire module you get the overriden one which it relies on a global variable |
| 01:05:12 | FromDiscord | <Elegantbeef> And as such it's not a pure function |
| 01:05:42 | FromDiscord | <Rika> In reply to @mlokis "yes that's why i": Nim also has {} for indexing |
| 01:07:16 | arkanoid | so Time is not the right type to store timestamps? |
| 01:08:56 | FromDiscord | <Elegantbeef> DateTime might be what you want |
| 01:09:27 | FromDiscord | <Elegantbeef> I dont know much about time truthfully |
| 01:09:27 | FromDiscord | <Elegantbeef> I dont know much about times truthfully |
| 01:10:21 | arkanoid | datetime raises same error |
| 01:10:43 | FromDiscord | <Elegantbeef> I mean you can override side effect analysis |
| 01:10:51 | FromDiscord | <Elegantbeef> But it's a question of what do you want to echo \:D |
| 01:11:29 | FromDiscord | <Elegantbeef> I guess i mean it's a question of what do you want the string to be |
| 01:11:37 | arkanoid | is it really necessary to do side effect to print a time? |
| 01:11:48 | FromDiscord | <Elegantbeef> Well it converts it to local |
| 01:11:48 | arkanoid | I mean, to format a time |
| 01:13:20 | arkanoid | btw, I got the point. It's just the fast the format is implicit that puzzles me |
| 01:13:26 | arkanoid | s/fast/fact |
| 01:13:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3uxm |
| 01:13:55 | FromDiscord | <Elegantbeef> Or make your own `$` operator |
| 01:14:15 | FromDiscord | <Rika> It would be nice to know why it is having side effects |
| 01:14:36 | FromDiscord | <Elegantbeef> Cause it converts to the local time zone which is done by calling `local` which populates an internal global |
| 01:15:24 | FromDiscord | <Elegantbeef> Which is the same for datetime, it calls format, which calls local |
| 01:16:06 | arkanoid | yeah it makes kinda sense, but shouldn't it default to utc? |
| 01:17:19 | FromDiscord | <Elegantbeef> I'd tell you if i knew |
| 01:18:41 | arkanoid | while the DateTime init asks you a timezone, the Time init doesn't. https://nim-lang.org/docs/times.html#initTime%2Cint64%2CNanosecondRange |
| 01:21:46 | * | arkurious quit (Quit: Leaving) |
| 01:22:02 | arkanoid | let's see if this requires an effect too https://nim-lang.org/docs/times.html#format%2CTime%2Cstring%2CTimezone |
| 01:24:33 | arkanoid | yes, also mytime.format("yyyy-MM-dd'T'HH:mm:ss", utc()) requires an effect |
| 01:25:30 | FromDiscord | <Elegantbeef> Yes `utc` and `local` use global variables |
| 01:26:08 | arkanoid | damn, I've to use noSideEffects escape hatches then |
| 01:26:29 | FromDiscord | <Elegantbeef> Or you know make your own `$` operator |
| 01:27:54 | arkanoid | Time attributes are not exported |
| 02:15:54 | arkanoid | a type made of a deeply nested hierachy of non-ref objects is checked on all hierachy levels with default `==`? |
| 02:16:36 | FromDiscord | <Rika> i believe so yes |
| 02:17:35 | arkanoid | thanks |
| 02:18:00 | arkanoid | to forbid ref types in generic type is proc foo[T not ref](...)? |
| 02:18:43 | FromDiscord | <Elegantbeef> Should be |
| 02:18:58 | FromDiscord | <Elegantbeef> well `T: not ref` though dont know if it's just the bridge ruining it |
| 02:19:44 | arkanoid | no you're right I was missing ':' |
| 02:20:13 | FromDiscord | <Rika> bridge moment |
| 02:20:29 | arkanoid | I wonder if this function I just wrote is already in system: func isDefault*[T: not ref](o: T): bool = o != T.default |
| 02:20:56 | arkanoid | oops I inverted the result, :D yes, is it already in stdlib? |
| 02:21:38 | FromDiscord | <Elegantbeef> I dont think so, also reference default is `nil` so you dont need that |
| 02:21:54 | FromDiscord | <Elegantbeef> !eval echo (ref int).default.isNil |
| 02:21:57 | NimBot | true |
| 02:22:26 | FromDiscord | <Rika> yeah i dont see a reason when you can just `v == c.typeof.default` i think? |
| 02:22:34 | FromDiscord | <Rika> v |
| 02:22:53 | FromDiscord | <Rika> !eval let a = 2; echo a == a.typeof.default |
| 02:22:55 | FromDiscord | <Rika> lets see |
| 02:22:56 | NimBot | false |
| 02:23:01 | FromDiscord | <Rika> yeah |
| 02:23:44 | arkanoid | isDefault seems a quite important function, isn't it |
| 02:23:53 | arkanoid | I mean, I find myself using it quite oftem |
| 02:23:58 | FromDiscord | <Elegantbeef> Well they can always keep the procedure, but a normal generic will be fine |
| 02:23:58 | FromDiscord | <Elegantbeef> Not really since everything is 0-init'd |
| 02:24:20 | FromDiscord | <Elegantbeef> I know an unassigned value is default why do i need to check |
| 02:24:31 | arkanoid | parsers! |
| 02:24:57 | FromDiscord | <Elegantbeef> Options |
| 02:25:36 | FromDiscord | <leorize> if you like parsers and you like types, you might like this\: https://github.com/nim-lang/Nim/pull/15212 |
| 02:26:13 | FromDiscord | <Elegantbeef> That's pretty nice |
| 02:31:14 | * | vicfred_ joined #nim |
| 02:33:40 | * | vicfred quit (Ping timeout: 256 seconds) |
| 02:36:45 | arkanoid | what's this, peeping into category theory? |
| 02:37:37 | FromDiscord | <generic linux user> is looping eraseLine and cursorUp better than eraseScreen? |
| 02:39:39 | FromDiscord | <Elegantbeef> Well eraseScreen on unix puts `\e[2J` to the buffer which clears it afaik |
| 02:40:08 | FromDiscord | <Elegantbeef> So it's probably better to just use the terminal emulator commands |
| 02:40:52 | FromDiscord | <leorize> eraseScreen is better, eraseLine is for deleting a selected portion of a string |
| 02:40:58 | FromDiscord | <leorize> screen\ |
| 02:41:32 | FromDiscord | <leorize> if you want to do more advanced cli things, checkout illwill |
| 02:50:33 | FromDiscord | <theangryepicbanana> In reply to @leorize "if you like parsers": that looks cool |
| 02:51:51 | FromDiscord | <generic linux user> like we print a menu, and then we put "> " |
| 02:51:57 | FromDiscord | <generic linux user> then we ask for a choice |
| 02:52:08 | FromDiscord | <generic linux user> if user enters something invalid |
| 02:52:32 | FromDiscord | <generic linux user> for a in 1..4:↵ eraseLine()↵ cirsorUp() |
| 02:52:40 | FromDiscord | <generic linux user> (edit) "cirsorUp()" => "cursorUp()" |
| 02:53:06 | FromDiscord | <generic linux user> so instead of clearing that menu , which is supposed to be static,until we exit |
| 02:53:15 | FromDiscord | <generic linux user> will it be useful tho |
| 02:53:33 | FromDiscord | <generic linux user> (edit) "1..4:↵" => "1..2:↵" |
| 02:54:41 | FromDiscord | <generic linux user> In reply to @Elegantbeef "Well eraseScreen on unix": do it print out 255 \n s?↵thats what i get on my terminal, it doesnt clear the screen↵it prints out a lot of newlines , and then if on posix, i have to use setcursorpos(0,0) to set it back |
| 02:54:50 | FromDiscord | <generic linux user> but in wjndows it works ok |
| 02:55:01 | FromDiscord | <generic linux user> (edit) "do" => "does" |
| 02:56:12 | FromDiscord | <generic linux user> since it talks to win32 api i think |
| 02:58:23 | FromDiscord | <generic linux user> yes, using eraseScreen only doesnt do the job |
| 02:58:40 | FromDiscord | <Elegantbeef> Consider using illwill |
| 02:59:30 | FromDiscord | <generic linux user> sent a code paste, see https://play.nim-lang.org/#ix=3uxy |
| 02:59:44 | FromDiscord | <generic linux user> (edit) "https://play.nim-lang.org/#ix=3uxy" => "https://play.nim-lang.org/#ix=3uxz" |
| 03:01:40 | * | vicfred__ joined #nim |
| 03:04:08 | * | vicfred_ quit (Ping timeout: 250 seconds) |
| 04:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
| 04:06:34 | * | supakeen joined #nim |
| 04:24:56 | FromDiscord | <Bung> @Araq please consider merge https://github.com/karaxnim/karax/pull/207 or https://github.com/karaxnim/karax/pull/208 |
| 04:38:43 | * | max22- quit (Remote host closed the connection) |
| 06:25:15 | * | thunder quit (Ping timeout: 276 seconds) |
| 06:35:59 | * | sagax joined #nim |
| 06:39:08 | * | thunder joined #nim |
| 06:53:03 | * | max22- joined #nim |
| 07:01:25 | * | vicfred__ quit (Quit: Leaving) |
| 07:34:44 | * | neceve joined #nim |
| 07:57:14 | * | pro joined #nim |
| 08:45:27 | * | thunder quit (Ping timeout: 258 seconds) |
| 09:03:06 | * | neceve quit (Ping timeout: 240 seconds) |
| 09:10:03 | * | neceve joined #nim |
| 09:11:53 | FromDiscord | <dom96> Happy weekend. What’s everybody up to? |
| 09:12:48 | FromDiscord | <generic linux user> back on project |
| 09:15:12 | FromDiscord | <impbox [ftsf]> does nim have a way to output your source without anything that wouldn't be included according to defines? |
| 09:16:41 | FromDiscord | <hotdog> In reply to @impbox "does nim have a": Nim source you mean? |
| 09:16:46 | FromDiscord | <impbox [ftsf]> yep, nim source |
| 09:16:52 | FromDiscord | <hotdog> That would be cool if it doesn’t exist already |
| 09:17:30 | FromDiscord | <hotdog> Don’t know if it’s possible atm |
| 09:20:37 | FromDiscord | <impbox [ftsf]> mmm can't find anything in the compiler guide for it, figured it'd be nice for doing a tutorial series where i gradually add features but you could see the source without any specific features for simplicity |
| 09:21:38 | FromDiscord | <impbox [ftsf]> but seems like a pretty niche usecase |
| 09:42:21 | FromDiscord | <rishavs (Rishav Sharan)> sent a code paste, see https://paste.rs/MH0 |
| 09:43:19 | FromDiscord | <impbox [ftsf]> hmm Options already exist in nim? |
| 09:44:10 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://paste.rs/4lH |
| 09:44:29 | * | pro quit (Ping timeout: 258 seconds) |
| 09:44:44 | FromDiscord | <impbox [ftsf]> https://nim-lang.org/docs/manual.html#types-enumeration-types you should probably learn about enum types in nim |
| 09:45:11 | * | pro joined #nim |
| 09:45:37 | FromDiscord | <impbox [ftsf]> each entry in an enum needs to be a value, not a type |
| 09:46:32 | FromDiscord | <rishavs (Rishav Sharan)> Options are in nim?! o.0↵can you link m to them. I never knoew! |
| 09:46:34 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3uyV |
| 09:46:41 | FromDiscord | <rishavs (Rishav Sharan)> Thanks! |
| 09:46:52 | FromDiscord | <impbox [ftsf]> https://nim-lang.org/docs/options.html |
| 09:50:09 | FromDiscord | <impbox [ftsf]> https://play.nim-lang.org/#ix=3uyW |
| 09:53:41 | FromDiscord | <impbox [ftsf]> if you're having seqs, it doesn't make much sense to use Option, Option = good for one or none, Seq = good for many or none |
| 09:56:00 | FromDiscord | <impbox [ftsf]> you might also be interested in object variants |
| 09:56:10 | FromDiscord | <impbox [ftsf]> https://nim-lang.org/docs/manual.html#types-object-variants |
| 09:58:36 | FromDiscord | <impbox [ftsf]> https://play.nim-lang.org/#ix=3uyY using object variants |
| 10:11:31 | arkanoid | is this assumption correct? converter toByteSeq*(s: string): seq[byte] = cast[seq[byte]](s) |
| 10:12:41 | FromDiscord | <impbox [ftsf]> what is `castseq`? |
| 10:13:13 | arkanoid | I think the bridge us mangling the squared parethesis |
| 10:13:38 | FromDiscord | <impbox [ftsf]> it shows as toByteSeq(s: string): seq[byte] = castseq[byte] |
| 10:14:42 | * | neceve quit (Ping timeout: 272 seconds) |
| 10:14:48 | arkanoid | here https://play.nim-lang.org/#ix=3uz2 |
| 10:15:23 | FromDiscord | <impbox [ftsf]> ok, what is your assumption that you want confirmed? |
| 10:16:47 | arkanoid | if that unsafe cast is safe |
| 10:17:02 | arkanoid | and if that is the most idiomatic way to turn a string into a byte sequence |
| 10:17:27 | arkanoid | I'm parsing network bytes but streams receives it as string |
| 10:18:16 | FromDiscord | <impbox [ftsf]> seems to be safe |
| 10:18:32 | arkanoid | ok thanks |
| 10:24:30 | FromDiscord | <Rika> It is safe as long as strings are internally the same as seqs (which they are since it is more convenient as of now, but may not in the future) |
| 10:25:15 | FromDiscord | <Rika> In reply to @impbox "does nim have a": You mean like the preprocessor pass flag in GCC? |
| 10:25:20 | FromDiscord | <Rika> I don’t think so |
| 10:26:19 | FromDiscord | <impbox [ftsf]> @Rika i'm not familiar with it, but i'd like the output to be the same as the input just without anything that fails a when defined test |
| 10:26:55 | FromDiscord | <Rika> Yeah in GCC they have a flag that only runs the preprocessor and emits the code after |
| 10:27:17 | FromDiscord | <Rika> So without the defines and the ifdef stuff |
| 10:27:25 | FromDiscord | <impbox [ftsf]> yeah, that kinda thing would be nice |
| 10:27:25 | FromDiscord | <Rika> (Though it also does the includes) |
| 10:38:31 | FromDiscord | <evil> does anyone know what the syntax would be for integer string indices in nimpy? |
| 10:46:33 | * | pro quit (Quit: WeeChat 3.2) |
| 10:48:17 | * | pro joined #nim |
| 11:23:27 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3uzn |
| 11:25:15 | FromDiscord | <haxscramper> yes, it should be safe, but if C compiler complains you need to use `struct udev` in `object` |
| 11:25:17 | FromDiscord | <Rika> No I think that’s an opaque pointer, I don’t know how those would convert to Nim |
| 11:25:28 | FromDiscord | <haxscramper> But you would still have an issue with forward declaration |
| 11:25:41 | FromDiscord | <enthus1ast> it compiles |
| 11:25:56 | FromDiscord | <enthus1ast> but does not work \:) and i do not understand c good enough |
| 11:26:45 | FromDiscord | <haxscramper> "does not work" .. how exactly? |
| 11:26:48 | FromDiscord | <haxscramper> segfault/wrong runtime behavior/etc? |
| 11:27:52 | FromDiscord | <enthus1ast> nope no segfault |
| 11:28:32 | FromDiscord | <Rika> What’s the issue then? |
| 11:28:35 | FromDiscord | <enthus1ast> when i call the↵var udev = udev\_new()↵i get a pointer un the udev object but i think there is the error because its just an object |
| 11:28:57 | FromDiscord | <enthus1ast> i think object is not correct here |
| 11:29:17 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/870991326261420042): when i call the↵var udev = udev\_new()↵i get a pointer on the udev object but i think there is the error because its just an object |
| 11:29:33 | FromDiscord | <Rika> Then find the definition perhaps |
| 11:31:07 | FromDiscord | <haxscramper> You can wrap forward-declared C types as nim `object`, but that would later introduce issues when you try to wrap actual declaration |
| 11:31:31 | FromDiscord | <haxscramper> Ideally you would want to either treat `udev` as an opaque pointer always - if C library does not expose the struct itself |
| 11:31:47 | FromDiscord | <haxscramper> Or, if struct definition is exposed in another header you need to wrap that header |
| 11:31:55 | FromDiscord | <enthus1ast> so opaque pointer would be just `pointer` |
| 11:31:56 | FromDiscord | <enthus1ast> ? |
| 11:32:18 | FromDiscord | <haxscramper> `pointer` is no different from `ptr udev` |
| 11:32:39 | FromDiscord | <haxscramper> And I'm sure you don't want to wrap things as `udev_unref(p: pointer)` to later get absolutely unexplainable crashes |
| 11:33:32 | FromDiscord | <haxscramper> And I'm still not sure about the issue |
| 11:33:34 | FromDiscord | <haxscramper> Like, does it work or not? |
| 11:34:00 | FromDiscord | <Rika> Is there an error or do you just think it’s wrong |
| 11:34:01 | FromDiscord | <haxscramper> And look at C code btw |
| 11:34:27 | FromDiscord | <haxscramper> it should make things clearer as to what is going on behind the scenes |
| 11:34:38 | FromDiscord | <enthus1ast> yes thats a good tip |
| 11:35:36 | FromDiscord | <enthus1ast> the problem for me is i don't know yet if it does not work because i have a error in my test, or if the wrapping types are not correct. |
| 11:35:59 | FromDiscord | <enthus1ast> but yes i'll look at the generated c code |
| 11:58:38 | * | max22- quit (Ping timeout: 256 seconds) |
| 12:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
| 12:06:33 | * | supakeen joined #nim |
| 12:18:48 | * | Mister_Magister quit (Ping timeout: 250 seconds) |
| 12:32:01 | * | Mister_Magister joined #nim |
| 12:48:25 | * | arkurious joined #nim |
| 12:51:42 | * | koltrast quit (Ping timeout: 272 seconds) |
| 13:03:26 | * | koltrast joined #nim |
| 13:05:43 | * | koltrast quit (Read error: Connection reset by peer) |
| 13:06:21 | * | koltrast joined #nim |
| 13:09:51 | * | koltrast quit (Read error: Connection reset by peer) |
| 13:16:34 | * | koltrast joined #nim |
| 13:20:41 | * | koltrast quit (Client Quit) |
| 13:21:19 | * | xet7 quit (Remote host closed the connection) |
| 13:21:45 | * | max22- joined #nim |
| 13:22:09 | * | koltrast joined #nim |
| 13:22:20 | * | xet7 joined #nim |
| 13:51:56 | * | koltrast quit (Ping timeout: 272 seconds) |
| 14:36:31 | FromDiscord | <fwsgonzo> hey all, is there a way to embed binary data into a nim program? |
| 14:37:38 | FromDiscord | <haxscramper> `const binaryData = staticRead("dataFile")` |
| 14:37:48 | FromDiscord | <fwsgonzo> really? |
| 14:40:11 | FromDiscord | <haxscramper> https://nim-lang.org/docs/system.html#staticRead%2Cstring |
| 14:40:18 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=3uA8 |
| 14:42:29 | FromDiscord | <Rika> In reply to @haxscramper "`const binaryData = staticRead("dataFile")`": FYI, this just inlines strings into wherever the const is used, i believe with enough uses it will blow your binary up |
| 14:42:40 | FromDiscord | <Rika> i dont recall how to embed the string once and refer to that via address |
| 14:43:47 | FromDiscord | <haxscramper> `let tgaFile = static: staticRead("../data/test.tga")` is also possible |
| 14:44:34 | FromDiscord | <haxscramper> someone asked earlier about embedding const data to ROM to save on RAM |
| 14:45:30 | FromDiscord | <haxscramper> sent a long message, see http://ix.io/3uA9 |
| 14:46:17 | FromDiscord | <haxscramper> So it might internally take advantage of some optimizations and `let` and cursor inference |
| 14:46:19 | FromDiscord | <Rika> good point lol |
| 14:46:25 | FromDiscord | <haxscramper> so look at C codegen |
| 15:28:20 | * | koltrast joined #nim |
| 15:51:12 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
| 15:58:12 | * | neceve joined #nim |
| 16:31:45 | * | stkrdknmibalz joined #nim |
| 16:42:42 | * | federico3_ is now known as federico3 |
| 16:47:54 | * | thunder joined #nim |
| 17:02:13 | * | krux02 joined #nim |
| 17:04:30 | FromDiscord | <treeform> In reply to @nixfreak_nim "* So I took": You can do a ton with pixie, if you are ok with CPU only you it can be done. |
| 17:09:35 | FromDiscord | <timotheecour> sent a code paste, see https://play.nim-lang.org/#ix=3uBg |
| 17:09:49 | FromDiscord | <timotheecour> (edit) "https://play.nim-lang.org/#ix=3uBg" => "https://play.nim-lang.org/#ix=3uBh" |
| 17:10:15 | FromDiscord | <timotheecour> (edit) "https://play.nim-lang.org/#ix=3uBh" => "https://play.nim-lang.org/#ix=3uBi" |
| 17:18:58 | * | max22- quit (Remote host closed the connection) |
| 17:21:17 | * | thunder quit (Ping timeout: 265 seconds) |
| 17:24:15 | * | thunder joined #nim |
| 18:10:34 | FromDiscord | <0ffh> Is there a standalone library to parses Nim code?↵I think I saw an example once that uses Nim's Nim parser, but that didn't work (was probably outdated). |
| 18:10:42 | FromDiscord | <0ffh> (edit) "parses" => "parse" |
| 18:11:53 | FromDiscord | <Bung> have you tried compiler package ? |
| 18:20:52 | FromDiscord | <0ffh> In reply to @Bung "have you tried compiler": Can you point me to some documentation on how to use it? I looked a (longer) while ago and didn't find much apart from the third party example I have mentioned. |
| 18:21:16 | FromDiscord | <0ffh> (edit) "mentioned." => "mentioned (which didn't work)." |
| 18:21:37 | FromDiscord | <0ffh> (edit) "In reply to @Bung "have you tried compiler": Can you point me to some documentation on how to use it? I looked a (longer) while ago and didn't find much apart from the third party example I have mentioned ... (which" added "above" |
| 18:22:46 | FromDiscord | <haxscramper> In reply to @haxscramper "Easiest solution would be": Using compiler API |
| 18:23:06 | FromDiscord | <0ffh> In reply to @Bung "have you tried compiler": I can't find any documentation |
| 18:23:07 | FromDiscord | <Bung> https://github.com/bung87/rehighlite I only have example project show you |
| 18:23:09 | fn | <R2D299> itHub: 7"<No Description>" |
| 18:23:17 | FromDiscord | <0ffh> In reply to @Bung "https://github.com/bung87/rehighlite I only have": Oh, thanks! |
| 18:23:19 | fn | <R2D299> itHub: 7"<No Description>" |
| 18:23:25 | FromDiscord | <Bung> yeah, It's not well documented. |
| 18:25:33 | FromDiscord | <0ffh> In reply to @haxscramper "Using compiler API": Thanks, too! |
| 18:27:34 | FromDiscord | <0ffh> In reply to @haxscramper "Using compiler API": That might actually be the snippedt I tried before.↵compiler_parser_test.nim(3, 16) Error: cannot open file: compiler/parser |
| 18:27:52 | FromDiscord | <0ffh> (edit) "snippedt" => "snippet" |
| 18:28:47 | FromDiscord | <0ffh> No it's not. I see. Need to get the Nim source first. |
| 18:31:13 | FromDiscord | <haxscramper> Install `compiler` package |
| 18:31:14 | FromDiscord | <haxscramper> you just need to `nimble install compiler` |
| 18:31:14 | FromDiscord | <haxscramper> no, you don't |
| 18:56:30 | FromDiscord | <theangryepicbanana> question: does `create`/`alloc` have to be explicitly freed if one of the gc backends is used (instead of orc/arc)? |
| 18:58:31 | FromDiscord | <haxscramper> I would assume yes, because GC is only concerned with traced references |
| 18:58:50 | FromDiscord | <haxscramper> Whatewher happens in your manual allocatinos you need to manage yourself, or wrap in object that can be `=destroy`ed |
| 18:59:14 | FromDiscord | <theangryepicbanana> hmm ok |
| 19:00:44 | FromDiscord | <theangryepicbanana> also a possibly related question: are seqs laid out sequentially in memory like a ptr/array, or does it do weird alignment stuff? |
| 19:01:15 | FromDiscord | <theangryepicbanana> it seems to but I'm not completely sure |
| 19:02:14 | FromDiscord | <haxscramper> Seq internally uses `T data` |
| 19:02:14 | FromDiscord | <haxscramper> So it depends on the C compiler being used |
| 19:02:17 | FromDiscord | <haxscramper> Flags |
| 19:02:24 | FromDiscord | <theangryepicbanana> ok |
| 19:02:33 | FromDiscord | <theangryepicbanana> thx |
| 19:02:38 | FromDiscord | <haxscramper> C and nim pragmas and other implementaiton details |
| 19:10:29 | * | supakeen quit (Remote host closed the connection) |
| 19:10:53 | * | supakeen joined #nim |
| 20:02:47 | FromDiscord | <carmysilna> How do you access the inner type of a distinct type, ie convert back or deconstruct. I've tried `.0` and `.inner` but neither works |
| 20:04:10 | FromDiscord | <Rika> What’s the inner type variable name? Type[T] is accessed with T for example |
| 20:07:17 | FromDiscord | <carmysilna> `seq[Term]` in this case. so I would do `seq[Term](val)`? |
| 20:12:36 | FromDiscord | <timotheecour> @carmysilna typetraits.distinctBase ? |
| 20:14:11 | arkanoid | I need to convert an uint64 to the equivalent bytestring. I'm currently doing myint.toHex.parseHexStr and it is working as expected, I just wonder if this is the most idiomatic/efficient way to do this |
| 20:27:04 | FromDiscord | <Rika> In reply to @carmysilna "`seq[Term]` in this case.": type A[B] = … then val.B where val is A returns what type B is |
| 20:54:37 | * | max22- joined #nim |
| 20:54:41 | * | pro quit (Ping timeout: 252 seconds) |
| 21:12:36 | arkanoid | I tried a massive hack force times module to be {.noSideEffect.} by creating https://play.nim-lang.org/#ix=3uCn , but by importing it I'm getting strange errors like Error: type mismatch: got <Time> but expected 'Time = object' |
| 21:27:28 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
| 21:35:41 | FromDiscord | <0ffh> In reply to @haxscramper "no, you don't": Ooops, didn't realise there was a package out there! 😅 |
| 21:56:52 | * | thunder quit (Remote host closed the connection) |
| 21:57:15 | * | thunder joined #nim |
| 22:16:46 | * | max22- quit (Quit: Leaving) |
| 22:17:57 | * | max22- joined #nim |
| 22:27:06 | FromDiscord | <@bracketmaster-5a708063d73408ce4> @haxscramper\:matrix.org , have you seen this before?\:https://github.com/loloicci/nimly |
| 22:27:07 | fn | <R2D299> itHub: 7"Lexer Generator and Parser Generator as a Library in Nim." |
| 22:27:11 | FromDiscord | <@bracketmaster-5a708063d73408ce4> seems good for describing grammars |
| 22:28:43 | FromDiscord | <haxscramper> Yes, it is a first item in my "languages and vms" list. But I'm not a big fan of parser generators, and would prefer to use more commonly used tool |
| 22:30:06 | FromDiscord | <haxscramper> Also it is a simple LR/LALR without any advanced hacks from bison or tree-sitter |
| 22:30:41 | FromDiscord | <@bracketmaster-5a708063d73408ce4> what type of advanced hacks do you need? |
| 22:31:38 | FromDiscord | <haxscramper> Glr for runtime grammar conflict resolution, support for operator precedence |
| 22:32:01 | FromDiscord | <haxscramper> And decades worth of examples in case of bison |
| 22:32:42 | * | thunder quit (Remote host closed the connection) |
| 22:33:01 | * | thunder joined #nim |
| 22:33:19 | FromDiscord | <haxscramper> And when I write parsers by hand I want to have manual failure resolution and more attention to error messages, which is not possible with LALR generator |
| 22:34:35 | FromDiscord | <haxscramper> But it is my personal preference, and there are valid use cases for all items in my list |
| 22:35:09 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Ah, I see |
| 22:56:32 | * | oprypin quit (Quit: Bye) |
| 22:56:41 | * | oprypin joined #nim |
| 23:20:16 | * | max22- quit (Remote host closed the connection) |
| 23:30:18 | * | ehmry quit (Ping timeout: 276 seconds) |
| 23:40:14 | FromDiscord | <Varriount> In reply to @haxscramper "And when I write": NPeg? |
| 23:40:17 | * | vicfred joined #nim |
| 23:40:27 | * | emery joined #nim |
| 23:45:46 | * | neceve quit (Ping timeout: 240 seconds) |