00:16:54 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1078470538919420024/20230223_190527.jpg |
00:17:06 | FromDiscord | <albassort> Wrong discord |
00:17:11 | FromDiscord | <albassort> If anyone saw that don't yell at me |
00:17:54 | * | MythicalForestCo joined #nim |
00:18:02 | FromDiscord | <Elegantbeef> Honestly wtf |
00:18:28 | FromDiscord | <Elegantbeef> I didnt see it just flaming |
00:19:18 | * | MythicalForestCo left #nim (#nim) |
00:25:08 | FromDiscord | <Hourglass [She/Her]> Where's the irc logs :) |
00:26:26 | FromDiscord | <Hourglass [She/Her]> Well |
00:26:29 | FromDiscord | <Hourglass [She/Her]> That is... Something? |
00:32:47 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p1G |
00:33:02 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4p1G" => "https://play.nim-lang.org/#ix=4p1H" |
00:33:37 | FromDiscord | <Phil> These procs that are being complained about are procs that exist, they're defined... I just don't get it.↵This is one of those "Happens sometimes, but not all the time" issues |
00:34:01 | FromDiscord | <Phil> (edit) "issues" => "issues, but the few times it does happen it's always on github pipelines" |
00:35:48 | * | Guest68 joined #nim |
00:47:10 | FromDiscord | <demotomohiro> Maybe you need to run `make clean` to clear old temporary files before running `make`. |
00:54:51 | * | Guest68 quit (Quit: Client closed) |
01:05:38 | FromDiscord | <Kali> do i have to give credit? because nim is MIT licensed or is my app not affected by it? |
01:05:57 | FromDiscord | <Elegantbeef> The code is licensed under MIT but binaries are not |
01:06:30 | FromDiscord | <Elegantbeef> It's not much different to something like krita |
01:08:41 | FromDiscord | <Kali> what about the std library |
01:08:49 | FromDiscord | <Elegantbeef> Same thing |
01:08:55 | FromDiscord | <Elegantbeef> Unless you use re or nre |
01:08:59 | FromDiscord | <Elegantbeef> or openssl |
01:10:09 | FromDiscord | <Kali> ah thank you for helping me out |
01:53:54 | * | arkurious quit (Quit: Leaving) |
02:13:08 | * | oz quit (Remote host closed the connection) |
02:13:22 | * | ox joined #nim |
02:55:26 | FromDiscord | <Naiy> Mks |
03:32:41 | FromDiscord | <Arathanis> What are the best practices for testing private procs and other private members of a module? So far I've determined you can use `include`. |
03:33:31 | FromDiscord | <amadan> can also do `import module {.all.}` to import private procs↵And then use `privateAccess` from `std/importutils` to access private properties |
03:35:51 | FromDiscord | <Arathanis> this sounds amazing, I will try it. is there documentation on `{.all.}`? I can't find any |
03:42:26 | FromDiscord | <Arathanis> In reply to @amadan "can also do `import": Gave this a whirl and it does not seem to be working. |
03:43:38 | FromDiscord | <amadan> ah damn, does it give any error? |
03:43:50 | FromDiscord | <Arathanis> it treats it like a custom pragma that does not exist |
03:45:00 | FromDiscord | <amadan> In reply to @Arathanis "this sounds amazing, I": Theres a section here↵https://nim-lang.org/blog/2021/10/19/version-160-released.html#private-imports-and-private-field-access |
03:45:44 | FromDiscord | <Arathanis> maybe it requires the entire import statement in the example? |
03:46:08 | FromDiscord | <Arathanis> oh wait, i see the regular one too... hmmm |
03:51:53 | FromDiscord | <Arathanis> @amadan might actually be something else... checking |
03:53:25 | FromDiscord | <Arathanis> yup I was being dumb |
03:59:26 | * | azimut quit (Ping timeout: 255 seconds) |
04:02:50 | NimEventer | New post on r/nim by heinthanth: Nim Macros For Internationalization ( i18n ) and Localization ( l10n ), see https://reddit.com/r/nim/comments/11ahxp0/nim_macros_for_internationalization_i18n_and/ |
05:47:20 | NimEventer | New thread by CardealRusso: "SIGSEGV: Illegal storage access. (Attempt to read from nil?)" running edge webview on windows, see https://forum.nim-lang.org/t/9934 |
05:55:14 | FromDiscord | <I have 50GB of nothing on my PC> what should I do if my stream errors out with "cannot retrieve file position" when trying to getPosition? |
06:02:02 | FromDiscord | <Naiy> B |
06:09:43 | FromDiscord | <Naiy> B |
06:13:51 | FromDiscord | <Naiy> B |
06:14:48 | FromDiscord | <Naiy> https://yax.im/i/#%23nim-lang%[email protected]?join |
06:20:19 | FromDiscord | <Naiy> B |
06:23:49 | FromDiscord | <Rika> what? |
06:24:25 | FromDiscord | <Elegantbeef> Cannot tell if inane spam or if they're testing that their xmpp interop is working |
06:26:00 | FromDiscord | <ringabout> Wrong channel to test anyway. |
06:32:46 | FromDiscord | <jtv> In reply to @I have 50GB of nothing on my PC "what should I do": Assuming you feel like they're surprise issues where the fd should be active, any chance you're hitting the ulimit on file descriptors for your process? Sounds like the failure mode when you do. |
07:01:50 | * | advesperacit joined #nim |
07:38:12 | FromDiscord | <Phil> In reply to @demotomohiro "Maybe you need to": That turns out to have been a golden idea.↵I don't have a make clean target and given that this is from a github pipeline I don't have easy inspection access to whatever cache is being used, but I can test the idea by re-running the process in the assumption that different runners should have different caches. |
07:39:38 | FromDiscord | <Phil> That runs out to have been correct, so sometimes the doc deployment pipeline just randomly fails, sometimes it doesn't.↵I currently have no understanding as to where that comes from.↵I have the faint hope that maybe this can be made more consistent by adding a clean target to the make file (it currently doesn't have one) that clears out cache and that the cleaned-up place is where the runner gets its wrong files from |
07:40:06 | FromDiscord | <Phil> (edit) "runs" => "turns" |
07:40:24 | FromDiscord | <Phil> (edit) "doesn't.↵I" => "doesn't.↵Rerunning often enough will make it eventually succeed.↵I" |
08:18:53 | * | PMunch joined #nim |
08:19:54 | FromDiscord | <4zv4l> is that normal that on windows my logging is all in one line ?↵it doesn't seem to add newline |
08:21:37 | FromDiscord | <4zv4l> it seems that notepad shows on one line↵but `type <file>.log` in powershell shows the multiple line |
08:23:45 | * | Notxor joined #nim |
08:48:16 | PMunch | @4zv4l, likely a CRLF/LF issue |
08:55:23 | FromDiscord | <enthus1ast> In code you can use \`\\p\` instead of \`\\n\` |
08:55:49 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/manual.html#lexical-analysis-string-literals |
08:58:27 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4p30 |
09:08:47 | PMunch | Ooh, very exciting @ringabout! |
09:09:40 | FromDiscord | <ringabout> Thanks! |
09:14:56 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4p3c |
09:15:06 | FromDiscord | <4zv4l> ` for raw string |
09:15:12 | FromDiscord | <4zv4l> instead of `r""` |
09:15:23 | FromDiscord | <Coachonko> In reply to @4zv4l "is that normal that": windows version? |
09:15:46 | FromDiscord | <4zv4l> yeah windows |
09:15:56 | FromDiscord | <Coachonko> version |
09:15:57 | FromDiscord | <4zv4l> notepad doesn't show the newline↵but with a different text editor it's fine |
09:15:59 | FromDiscord | <4zv4l> oh |
09:16:36 | FromDiscord | <4zv4l> windows server 2012 |
09:16:37 | FromDiscord | <Coachonko> Because recent windows 10 and 11 versions do not have problems with unix new line characters, older versions do have problems |
09:16:44 | FromDiscord | <Coachonko> Yep that's an old boy |
09:17:19 | FromDiscord | <4zv4l> but the program is compiled using `nim.exe` (windows version) for windows target, doesn't it adapt the newline character ? |
09:17:31 | FromDiscord | <Coachonko> How are you even on 2012? Company pays for license? |
09:17:40 | FromDiscord | <4zv4l> that's a test server |
09:17:41 | FromDiscord | <4zv4l> xD |
09:17:49 | FromDiscord | <4zv4l> yeah company |
09:17:59 | FromDiscord | <4zv4l> they pay for it |
09:18:05 | FromDiscord | <Coachonko> In reply to @4zv4l "but the program is": Not sure, probably not because I don't believe compiler focus on supporting legacy os |
09:18:16 | FromDiscord | <Coachonko> (edit) "focus" => "focuses" |
09:18:39 | FromDiscord | <Coachonko> 2012 is quite old, considering 2019 and 2022 are out |
09:19:02 | FromDiscord | <4zv4l> windows 2012 r2 datacenter edition↵↵idk why they use that one |
09:19:15 | FromDiscord | <Coachonko> (edit) "2012 is quite old, considering ... 2019" added "2016," |
09:19:15 | FromDiscord | <4zv4l> since that's a test one maybe they don't care much about the version ?↵I'm gonna ask my manager |
09:19:28 | FromDiscord | <Coachonko> Probably |
09:19:39 | FromDiscord | <Coachonko> Or maybe because they deploy to 2012r2 |
09:20:05 | FromDiscord | <4zv4l> In reply to @Coachonko "Not sure, probably not": feels weird to think windows server 2012 is legacy lol xD |
09:20:19 | FromDiscord | <Coachonko> It's literally 1 decade old at this point lmao |
09:20:20 | FromDiscord | <4zv4l> to me Windows 7 isn't legacy yet in my mind |
09:20:22 | FromDiscord | <4zv4l> yeah right |
09:20:42 | FromDiscord | <4zv4l> In reply to @Coachonko "It's literally 1 decade": Windows 10 too tho |
09:21:00 | FromDiscord | <Coachonko> Kinda, windows 10 is technically a rolling release |
09:21:16 | FromDiscord | <Coachonko> Except windows 11 exists and my hardware is not allowed to run it |
09:21:59 | FromDiscord | <4zv4l> sent a long message, see http://ix.io/4p3f |
09:22:32 | FromDiscord | <Coachonko> I only dev on linux and believe most people should, the market share of windows servers is so small |
09:22:48 | FromDiscord | <Coachonko> It weirds me out that people dev on windows |
09:23:23 | FromDiscord | <4zv4l> yeah right↵well because `bUt lInUx DoEsNT hAvE ExCeL` |
09:23:34 | FromDiscord | <4zv4l> or whatever silly reason |
09:24:25 | FromDiscord | <4zv4l> they share excel in the server (kinda like with X server over ssh)↵and they asked me to make a program that protect the clipboard from extraction and infiltration |
09:25:11 | FromDiscord | <4zv4l> and the whole Active Directory thing |
09:27:22 | FromDiscord | <ieltan> AD is really the only thing that Windows Server is good for |
09:27:46 | FromDiscord | <ieltan> Havent used anything else that i couldnt already do on linux |
09:28:13 | FromDiscord | <ieltan> maybe there is though |
09:39:01 | FromDiscord | <luteva> sent a code paste, see https://play.nim-lang.org/#ix=4p3g |
09:40:11 | PMunch | Hmm, has anyone written a macro to generate case statements for tuples to allow non-constant array access? |
09:42:15 | * | xet7 quit (Quit: Leaving) |
09:43:48 | FromDiscord | <amadan> In reply to @luteva "Hi! What exactly does": Basically says that `apply` shares the effects that `op` has↵https://nim-lang.github.io/Nim/manual.html#effect-system-effectsof-annotation |
09:44:26 | FromDiscord | <luteva> thx! gonna read that := |
09:44:31 | FromDiscord | <luteva> (edit) ":=" => "🙂" |
10:03:39 | * | kenran joined #nim |
10:07:45 | FromDiscord | <Rika> In reply to @4zv4l "is it possible to": not really no |
10:07:59 | * | nyeaa49284230 quit (Quit: Ping timeout (120 seconds)) |
10:08:17 | * | nyeaa49284230 joined #nim |
10:21:58 | PMunch | Hmm, how do you read static parameters from a procedure implementation? |
10:23:35 | PMunch | As you can see from this output the static parameter just sows as the type of the argument.. https://play.nim-lang.org/#ix=4p3r |
10:37:23 | * | junaid_ joined #nim |
10:45:20 | PMunch | I'm completely incapable of finding this type.. https://play.nim-lang.org/#ix=4p3v |
10:55:55 | * | junaid_ quit (Remote host closed the connection) |
10:57:34 | * | jmdaemon quit (Ping timeout: 246 seconds) |
11:03:34 | FromDiscord | <amadan> Are you trying to get the int parameter? Or trying to find types that are static? |
11:04:48 | FromDiscord | <amadan> (edit) "types" => "parameters" |
11:10:03 | FromDiscord | <Gen> How do I import all exported variables/procs from a module so I do not have to prefix them with module.xy? |
11:12:16 | FromDiscord | <amadan> `import theModule`↵You don't need to do `module.xy` unless its ambiguous what you are referring to |
11:17:13 | FromDiscord | <amadan> In reply to @amadan "Are you trying to": nvm I see what you mean, that static type just disappears 🤔 |
11:19:38 | FromDiscord | <Gen> In reply to @amadan "`import theModule` You don't": Why am I getting this undeclared identifier error then? https://media.discordapp.net/attachments/371759389889003532/1078637318925209660/image.png https://media.discordapp.net/attachments/371759389889003532/1078637319248162877/image.png |
11:20:45 | FromDiscord | <amadan> `CARD_TEMPLATE_ID` isn't exported in `CmdParams` |
11:21:35 | FromDiscord | <Gen> In reply to @amadan "`CARD_TEMPLATE_ID` isn't exported in": oh, every property has to be exported as well? is there a shortcut to mark all child properties as exported as well? |
11:23:02 | FromDiscord | <amadan> Kind of but its best to just manually mark them as exported |
11:29:45 | FromDiscord | <Gen> In reply to @amadan "Kind of but its": it still doesn't work https://media.discordapp.net/attachments/371759389889003532/1078639868613230633/image.png https://media.discordapp.net/attachments/371759389889003532/1078639868822962237/image.png |
11:31:21 | PMunch | @amadan, trying to get the `int` parameter |
11:31:54 | PMunch | I can see that it is static, but I can't get the inner type |
11:32:38 | FromDiscord | <amadan> In reply to @Gen "it still doesn't work": Any different error message when compiling? Think it might be because of the quitting when less than 5 params |
11:32:39 | FromDiscord | <Rika> In reply to @Gen "it still doesn't work": diod you try compiling it |
11:32:47 | FromDiscord | <Rika> nimsuggest can have spurious errors |
11:33:08 | FromDiscord | <Rika> In reply to @amadan "Any different error message": that would be a runtime error no? |
11:33:12 | FromDiscord | <Rika> paramStr is runtime |
11:33:50 | FromDiscord | <amadan> I'd assume so, but I'm mostly just guessing cause I can't see anything else wrong |
11:34:19 | FromDiscord | <Rika> well i think its just nimsuggest not updating correctly |
11:34:21 | FromDiscord | <Rika> so try compiling |
11:35:31 | FromDiscord | <Gen> sent a code paste, see https://play.nim-lang.org/#ix=4p3E |
11:35:43 | FromDiscord | <Gen> removed the parameter check |
11:36:05 | FromDiscord | <Gen> no errors in vs code shown anymore but it doesn't compile |
11:36:43 | FromDiscord | <Rika> AH |
11:36:49 | FromDiscord | <Rika> i know now |
11:37:03 | FromDiscord | <Rika> dont name your module and anything in that module the same name (style-insensitively) |
11:37:09 | FromDiscord | <Rika> cmdParams == cmd_params |
11:37:22 | FromDiscord | <Rika> rename one of them |
11:37:34 | FromDiscord | <Gen> oh lol |
11:37:45 | FromDiscord | <Gen> is there a naming convention for modules that i can follow? |
11:38:00 | FromDiscord | <Gen> im so used to creating atomic module that export the same thing they're called |
11:38:07 | FromDiscord | <Gen> (edit) "module" => "modules" |
11:38:33 | FromDiscord | <Rika> for this scenario there isnt really a convention |
11:39:07 | PMunch | Hmm, this is weird: https://play.nim-lang.org/#ix=4p3F |
11:40:19 | PMunch | That fails, because of an "unspecified generic", but replacing `Test` with `static[string]` in the procedure definition makes it work |
11:40:31 | PMunch | So `static[string]` can't be put into a type? |
11:43:24 | Zevv | welcome to the wonderful world of typed macros |
11:46:32 | PMunch | Fun stuff.. |
11:48:46 | Zevv | i've heard people call it the "empty room syndrome" |
11:49:12 | Zevv | you are wandering through this huge castle, roaming corridors, hallways, dungeons |
11:49:44 | Zevv | your adventures bring you deeper and deeper into the structures |
11:50:13 | Zevv | the smell of mold, rats and funghi burns in your nostrils |
11:50:41 | Zevv | and finally, after a bloody fight with a pack of goblins you manage to open the large, wooden door |
11:50:50 | Zevv | only to find a large room that is completely empty |
11:50:53 | Zevv | no one ever comes here |
11:50:55 | Zevv | no one ever came here |
11:51:01 | Zevv | no one ever writes tests for this particular area |
11:52:13 | Zevv | you cry out for help, but no one comes to your rescue |
11:54:32 | PMunch | Haha, interesting analogy :P |
11:55:53 | Zevv | go into the other room, the resident goblin there is likely able to help you out |
11:57:26 | FromDiscord | <luteva> I am searching for a general datastructure that has keys and values and is being sorted by a given property while inserting. So a kind of SortedMap/SortedTree something like this (but i need to set the property by which the structure is sorted). any ideas? |
11:57:44 | Zevv | PMunch: I mean, go ask disruptek |
11:58:05 | FromDiscord | <Rika> didnt know disruptek is a goblin |
11:58:17 | FromDiscord | <Rika> the more you know |
12:00:16 | Zevv | PMunch: we have this running gag when hitting internal compiler errors, that we should print them on a shirt every time we hit one. I recently ordered a bright ping one with 'Error: internal error: expr(nkBracketExpr, tyUserTypeClassInst)' on it. |
12:00:25 | Zevv | s/ping/pink/ |
12:00:47 | PMunch | Haha, what a wonderfully chaotic idea |
12:01:00 | PMunch | I think I might need a bigger closet first though.. |
12:01:22 | PMunch | Well, it has actually gotten quite a lot better |
12:02:16 | Zevv | sure, but it depends on what you're doing. As long as I write 'normal' code, Nim is generally doing just fine. |
12:02:34 | Zevv | but especially in the area's where macros come in or when I try to do advanced typing |
12:02:42 | Zevv | it's sometime very interesting, still |
12:06:22 | * | kenran quit (Remote host closed the connection) |
12:07:18 | FromDiscord | <Gen> In reply to @Rika "for this scenario there": thx a lot for helping me with this weird issue its working |
12:23:27 | * | Batzy quit (Quit: No Ping reply in 180 seconds.) |
12:24:54 | * | Batzy joined #nim |
12:31:29 | * | azimut joined #nim |
13:17:27 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4p3Y |
13:24:29 | PMunch | Huh, that is indeed weird |
13:24:40 | PMunch | Did `quote` get merged with `superQuote`? |
13:24:58 | PMunch | Oh wait, that would've echoed 1000 |
13:25:59 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4p42 |
13:26:16 | FromDiscord | <ringabout> It only takes the first ident within backticks. |
13:26:56 | FromDiscord | <ringabout> ['a', '!', '999'] |
13:28:39 | FromDiscord | <ringabout> I don't know what's the meaning for backticks. If it only accepts an identifier, it might be concatenated to get the actual identfier. |
13:34:23 | PMunch | Hmm, I guess it might be to avoid some weird syntactic limitations.. |
13:35:43 | FromDiscord | <ringabout> Yeah |
13:40:25 | * | ox is now known as oz |
13:59:20 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4p45 |
14:00:01 | FromDiscord | <auxym> `let foo = if bar: "bar" else: "foo"` |
14:00:09 | FromDiscord | <Dudugz> Got it, thx |
14:00:16 | FromDiscord | <auxym> see also: https://peterme.net/tips-and-tricks-with-implicit-return-in-nim.html |
14:25:24 | * | derpydoo joined #nim |
14:31:33 | FromDiscord | <frobnicate> `{'a' .. 'z', 'A' .. 'Z', '!', '.', ',', 'æ', 'ø', 'å', 'Æ', 'Ø', 'Å'} in text` is being weird |
14:31:49 | FromDiscord | <frobnicate> or rather won't compile |
14:31:58 | FromDiscord | <frobnicate> only supports US ascii or something? |
14:32:31 | PMunch | Character literals are single byte |
14:32:48 | FromDiscord | <frobnicate> ah |
14:33:19 | PMunch | I guess it would work if you converted your text string to use a Norwegian code page or something |
14:33:30 | PMunch | But I'm not sure that's the best solution |
14:33:33 | PMunch | What're you trying to do? |
14:34:50 | FromDiscord | <frobnicate> make sure a string isn't code, since I'm traversing some xml that has code as text nodes. So first I try to check for braces, and then I check the string is alphabet, but it won't pick up this one `Advarsel! Yderligere stregkoder virker kun såfremt serverside scan er aktiveret.` |
14:35:05 | FromDiscord | <frobnicate> I thought it was because of the å or the ! |
14:35:53 | FromDiscord | <frobnicate> sent a code paste, see https://play.nim-lang.org/#ix=4p4l |
14:35:59 | FromDiscord | <frobnicate> ignore me making the last stuff strings I was trying to fix it |
14:36:19 | FromDiscord | <frobnicate> oh wait |
14:36:35 | FromDiscord | <frobnicate> the "var" is picking up "Advarsel" isn't it |
14:37:31 | FromDiscord | <frobnicate> ok making it "var " fixed it, and still removes all the js |
14:37:33 | FromDiscord | <frobnicate> cool |
14:37:38 | FromDiscord | <frobnicate> thanks for being the rubberduck |
14:37:44 | PMunch | Haha no proble |
14:38:00 | * | PMunch quit (Quit: Leaving) |
14:38:40 | FromDiscord | <frobnicate> it's such a hacky tool I made oh well |
14:47:38 | FromDiscord | <Rika> not really secure to "check if something isnt code" |
14:50:53 | FromDiscord | <j2q> Hi Guys little question any one knows where can I find the original old code for nim compiler written in Pascal. Thanks in advance. |
14:57:10 | FromDiscord | <ringabout> In reply to @j2q "Hi Guys little question": Why do you need this? |
14:57:11 | FromDiscord | <ringabout> https://github.com/nim-lang/Nim/tree/8b2a9401a147bd0b26cd2976ae71a1022fbde8cc/nim |
14:59:43 | FromDiscord | <j2q> In reply to @ringabout "Why do you need": Just for learning, I like Object Pascal language and always have been interested in how the compilers/interpreters are made. |
15:00:38 | FromDiscord | <j2q> In reply to @ringabout "Why do you need": Thanks a lot for Your answer |
15:15:34 | FromDiscord | <Phil> In reply to @ringabout "<@180601887916163073> Here is good": Impossible!↵Could the time truly have arrived for me to move on from constructor?↵This might actually make instantiation even more efficient, wouldn't it?↵Since constructor assigns defaults at runtime and if I get this right, then nim now does it at compiletime (kinda) |
15:19:23 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4p4G |
15:19:47 | FromDiscord | <ringabout> Just like consts. |
15:20:38 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p4H |
15:21:05 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4p4H" => "https://paste.rs/PAz" |
15:21:34 | FromDiscord | <ringabout> Yeah, probably more efficient/ |
15:22:30 | FromDiscord | <ringabout> Anyway hardly there is a more efficient implementation than the compiler implementaion. |
15:22:45 | FromDiscord | <ringabout> (edit) "implementaion." => "implementaion, if not less." |
15:24:59 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4p4I |
15:25:18 | FromDiscord | <ringabout> It doesn't compile for now. |
15:27:54 | FromDiscord | <ringabout> It doesn't support circular types in the same type section because of limitations. I might explore possibilities after https://github.com/nim-lang/Nim/pull/18822 is supported. |
15:39:33 | FromDiscord | <Phil> Ah, in that case it's likely still not an option for me |
15:39:58 | FromDiscord | <ieltan> urg |
15:40:03 | FromDiscord | <ieltan> why is everything dying on me |
15:40:03 | FromDiscord | <Phil> Since in norm models are ref objects and you can have nested models |
15:40:08 | FromDiscord | <ieltan> i just wanna make a damn discord bot |
15:41:01 | FromDiscord | <ringabout> In reply to @Isofruit "Since in norm models": Yeah, it probably doesn't work. |
15:41:11 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p4L |
15:43:00 | FromDiscord | <Phil> In reply to @ringabout "It doesn't support circular": So it may be an option down the line?↵Or is unlikely to ever be an option because of ref-types? |
15:43:39 | FromDiscord | <ringabout> I haven't tested ref types. I only know `newTable` doesn't work. |
15:44:36 | FromDiscord | <ieltan> anyone knows why this is doing this :/ https://media.discordapp.net/attachments/371759389889003532/1078704002746830949/Screenshot_from_2023-02-24_16-43-55.png |
15:44:49 | FromDiscord | <ieltan> i imported asyncdispatch https://media.discordapp.net/attachments/371759389889003532/1078704055544725624/image.png |
15:46:35 | FromDiscord | <Phil> What does the compiler say? |
15:48:06 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4p4O |
15:48:34 | FromDiscord | <Phil> ... I should've known better than to update devel |
15:49:04 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p4P |
15:50:57 | FromDiscord | <ieltan> i dont know what i did but know it has gone from 560 errors to just 10 https://media.discordapp.net/attachments/371759389889003532/1078705604438261890/image.png |
15:51:06 | FromDiscord | <ieltan> (edit) "know" => "now" |
15:51:45 | FromDiscord | <Phil> In reply to @ringabout "I haven't tested ref": Is there a replacement for back when folks used `[_]` for generics as apparently that's been turned into a compile-time error? |
15:52:14 | FromDiscord | <Phil> Something that expresses "The actual specific type is irrelevant" |
15:52:32 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4p4R |
15:52:49 | FromDiscord | <ieltan> its two libraries with the same function name and the same signatures |
15:53:19 | FromDiscord | <ringabout> In reply to @Isofruit "Is there a replacement": I don't know the issue. Why is it broken? |
15:54:11 | FromDiscord | <Phil> In reply to @ieltan "how do i fix": You can make `log` non-ambiguous by writing either `logging.log` or `constants.log` depending on what you need.↵What you need (either log using dimscords mechanism or your own with the std-lib) is something that you must know yourself 😛 |
15:54:33 | FromDiscord | <ieltan> er |
15:54:41 | FromDiscord | <ieltan> the issue is that im not the one using log |
15:55:08 | FromDiscord | <Phil> In reply to @ieltan "the issue is that": You can not import `log` |
15:55:12 | FromDiscord | <Phil> from logging.log |
15:55:14 | FromDiscord | <Phil> (edit) "logging.log" => "logging" |
15:55:24 | FromDiscord | <Phil> Using `import std/logging except log` |
15:55:46 | FromDiscord | <Phil> Syntax may be slightly off, I'd need to look through the docs to be 100% certain, should be sth like it |
15:57:09 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p4V |
15:57:58 | FromDiscord | <Phil> Norm has a whole bunch of those, I'll add an issue to norm about it but the intention appears to have been to make it clear that the explicit type `_` does not matter, just needs to be a generic |
15:59:39 | FromDiscord | <ringabout> Is it a regression on the devel branch of Nim? |
16:00:22 | FromDiscord | <Phil> I'm not even sure it's a regression |
16:00:29 | FromDiscord | <Phil> It is however on the newest devel branch |
16:00:39 | FromDiscord | <Phil> Updated 5 minutes ago |
16:00:53 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p4Z |
16:01:01 | FromDiscord | <ringabout> In reply to @Isofruit "I'm not even sure": Yeah, perhaps https://github.com/nim-lang/Nim/pull/21192 |
16:02:10 | FromDiscord | <Phil> I don't think I fully get it, it fixes some bug, but I'm not sure if that means that it's intended that `[_]` generics now break or not |
16:02:43 | FromDiscord | <Phil> Should I file a bug -report? |
16:03:19 | FromDiscord | <ringabout> Yeah, a fix can cause more bugs/regressions. |
16:05:33 | FromDiscord | <ringabout> I confirmed that it causes this bug./ |
16:06:53 | FromDiscord | <Phil> I'll file a bug report |
16:07:03 | FromDiscord | <ringabout> Nice |
16:11:03 | * | Notxor quit (Remote host closed the connection) |
16:11:34 | FromDiscord | <Phil> https://github.com/nim-lang/Nim/issues/21435↵Pinged the author of the PR in case they have a better idea on if that was intentional or not |
16:12:30 | FromDiscord | <Phil> Lul, I just realized I updated my nim-devel version a week before this change dropped and introduced this breaking change 😄 |
16:12:56 | * | Notxor joined #nim |
16:13:11 | FromDiscord | <ringabout> It is a pity that norm doesn't support 2.0 yet, otherwise the CI will have caught the regression. |
16:13:39 | FromDiscord | <ringabout> I disabled norm testing in the important packages. |
16:14:56 | FromDiscord | <sOkam!> In reply to @Isofruit "How's logit btw? Only": You asked me about this a long time ago, and I just started learning std/logging.↵Seems like logit is much much simpler, so probably easier to get into. But other than that, I currenlty see not much of a difference. At least from what I encountered so far. |
16:15:33 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4p57 |
16:15:56 | FromDiscord | <ieltan> In reply to @Isofruit "Syntax may be slightly": the syntax i used was `import norm/sqlite except log` |
16:15:59 | FromDiscord | <Phil> I found either pretty trivial, so in that case seems like a case of me sticking with the stdlib |
16:16:07 | FromDiscord | <Phil> Wait, when tf would norm export log |
16:16:09 | FromDiscord | <Phil> Give me a sec |
16:16:32 | FromDiscord | <Phil> Hot dang, it does export private.log |
16:16:46 | FromDiscord | <sOkam!> Yeah if you know one, I doubt there is much reason to change to the other |
16:17:02 | FromDiscord | <ieltan> In reply to @Isofruit "Hot dang, it does": it shouldnt do that i suppose |
16:17:06 | FromDiscord | <ieltan> its in private folder |
16:17:37 | FromDiscord | <Phil> Maybe, let me think on how you can get around this.↵I mean, first thought would be on moving the norm code into a separate module |
16:18:14 | FromDiscord | <Phil> So that your dimscord stuff calls a proc and the part of your code you need norm/sqlite for is elsewhere |
16:18:58 | FromDiscord | <ieltan> i will give it a try |
16:19:08 | FromDiscord | <Phil> You could also open a ticket in the norm repo that it should deal with logging without exporting it |
16:19:26 | FromDiscord | <Phil> That's more in the long-term |
16:19:32 | FromDiscord | <Phil> (edit) "in" => "for" |
16:20:01 | FromDiscord | <ringabout> Why `except log` didn't work? |
16:20:45 | FromDiscord | <ringabout> That doesn't make sense. |
16:21:05 | FromDiscord | <Phil> A minimal code example would indeed be nice |
16:21:53 | FromDiscord | <ieltan> i could try `import norm/private except log` but i am not sure it will work |
16:22:22 | FromDiscord | <ringabout> What are your imports? |
16:22:34 | FromDiscord | <ieltan> do we have a `import x except all` perhaps ? |
16:23:03 | FromDiscord | <ringabout> from x import nil |
16:23:18 | FromDiscord | <Phil> Code example my guy, code example! 😛 |
16:23:53 | FromDiscord | <ieltan> sent a code paste, see https://paste.rs/PTK |
16:23:56 | FromDiscord | <ringabout> In reply to @ringabout "from x import nil": enforces qualified imports |
16:24:28 | FromDiscord | <ieltan> In reply to @ringabout "from x import nil": i'll go back to one file and try this out thanks |
16:26:42 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/g7F |
16:27:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p5c |
16:27:42 | FromDiscord | <ieltan> `imported and not used: 'log' [UnusedImport]nim(nimsuggest chk)` |
16:27:54 | FromDiscord | <ieltan> after doing `from norm/private/log import nil` |
16:28:09 | FromDiscord | <ieltan> `norm/private` doesnt work i have to specify log |
16:28:54 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4p5e |
16:29:29 | FromDiscord | <ieltan> In reply to @Isofruit "Some of the source": sure lemme copy a snippet |
16:30:36 | FromDiscord | <ieltan> beware, the variables and type object names are quite cringeworthy because it's supposed to be a joke bot for a private server |
16:30:59 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4p5h |
16:32:04 | FromDiscord | <ieltan> as you can see, it's dumb simple that a bloke like me can understand |
16:32:12 | FromDiscord | <ieltan> but it supposedly still errors out |
16:32:22 | FromDiscord | <ringabout> Where? |
16:32:40 | FromDiscord | <ieltan> nim suggest also freaks out for supposedly no reason: https://media.discordapp.net/attachments/371759389889003532/1078716101246074960/image.png |
16:32:48 | FromDiscord | <ieltan> ;/ |
16:32:48 | FromDiscord | <Phil> @ringabout The issue here is that norm doesn't bind the `log` proc from `private/log` |
16:32:57 | FromDiscord | <Phil> norm does not export private/log |
16:32:59 | FromDiscord | <ieltan> In reply to @ringabout "Where?": not in MY code |
16:33:02 | FromDiscord | <ringabout> It compiles. |
16:33:08 | FromDiscord | <Phil> HOWEVER, the insert proc etc. are generics |
16:34:05 | FromDiscord | <ringabout> Then, use `import dimscord except log`. |
16:34:17 | FromDiscord | <ringabout> (edit) "use" => "using" | "log`." => "log` should work." |
16:34:25 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p5j |
16:34:38 | FromDiscord | <Phil> That log proc is from `private/log` (which compiles out the log call given a specific flaag) |
16:34:44 | FromDiscord | <Phil> (edit) "flaag)" => "flag)" |
16:34:51 | FromDiscord | <ringabout> Is it intended? Otherwise use `bind` or something. |
16:34:55 | FromDiscord | <Phil> That proc is not bound properly apparently |
16:35:28 | FromDiscord | <ieltan> so |
16:35:30 | FromDiscord | <ieltan> for some reason |
16:35:39 | FromDiscord | <Phil> Yeah, `bind log.log` would do it here |
16:35:47 | FromDiscord | <ieltan> some private log is contaminating my code |
16:35:50 | FromDiscord | <Phil> Or rather `bind log` |
16:35:58 | FromDiscord | <ieltan> and prevents it from compiling |
16:36:11 | FromDiscord | <ieltan> In reply to @Isofruit "Yeah, `bind log.log` would": Can i do that ? |
16:36:16 | FromDiscord | <Phil> In reply to @ieltan "some private log is": It isn't really, it is more that somehow dimscord is polluting the norm namespace |
16:36:32 | FromDiscord | <Phil> That's a change in the norm codebase |
16:37:29 | FromDiscord | <ieltan> how can i make my code compile then |
16:37:43 | FromDiscord | <ringabout> @ieltan using import dimscord except log should work. |
16:37:44 | FromDiscord | <ieltan> i think maybe pinning norm to a previous commit should do it ? |
16:38:01 | FromDiscord | <ringabout> (edit) "import" => "`import" | "log should" => "log` might" |
16:41:12 | FromDiscord | <spoon> do arc/orc dlls still depend on nimrtl.dll? |
16:41:29 | FromDiscord | <ieltan> In reply to @ringabout "<@256520101015060480> using `import": it did, thanks ! |
16:42:05 | FromDiscord | <ieltan> @Phil may i inquire your help for the last time ? |
16:42:11 | FromDiscord | <ieltan> its about norm again |
16:42:41 | FromDiscord | <Phil> Sure, but do file a bug please.↵Norm just needs to apply `bind log` to its generics so that this kind of stuff doesn't happen |
16:43:00 | FromDiscord | <Phil> Should suffice to do it to insert, update, delete, read, select and createTables procs etc. |
16:43:05 | FromDiscord | <ringabout> In reply to @spoon "do arc/orc dlls still": No |
16:43:11 | FromDiscord | <ieltan> lemme check something |
16:43:12 | FromDiscord | <spoon> nice |
16:44:32 | FromDiscord | <spoon> <https://nim-lang.org/docs/nimc.html#dll-generation> this part of the docs should be updated then |
16:45:45 | FromDiscord | <ringabout> True |
16:45:49 | FromDiscord | <spoon> is there a github page for docs or is it generated? |
16:46:09 | FromDiscord | <ringabout> In reply to @spoon "is there a github": Yeah https://github.com/nim-lang/Nim/edit/devel/doc/nimc.md#L1 |
16:46:19 | FromDiscord | <ringabout> There is an edit btton on the page |
16:46:43 | FromDiscord | <ringabout> https://nim-lang.github.io/Nim/nimc.html#dll-generation |
16:46:48 | FromDiscord | <ringabout> https://media.discordapp.net/attachments/371759389889003532/1078719658473037974/image.png |
16:47:38 | FromDiscord | <spoon> ah so it is part of the compiler page |
16:48:32 | FromDiscord | <ringabout> Postive |
16:55:25 | FromDiscord | <spoon> ah, i imagine the process for compiling a dll would be different since there's no need to link it |
16:55:35 | FromDiscord | <spoon> is there a different compiler flag for compiling standalone? |
16:58:29 | FromDiscord | <ringabout> In reply to @spoon "ah, i imagine the": I'm not aware of any, see also https://forum.nim-lang.org/t/8897 |
17:09:53 | FromDiscord | <spoon> ah can use `--app:lib` |
17:57:09 | * | arkurious joined #nim |
18:12:25 | * | xet7 joined #nim |
18:27:35 | FromDiscord | <Phil> My stance on my bugticket about `[_]` has firmly solidified |
18:27:57 | FromDiscord | <Phil> I have gained certainty that I have no clue what the actually intended spec is and I feel like this issue is about deciding what it actually is. |
18:28:08 | FromDiscord | <Phil> (edit) "is." => "is and then acting on that." |
18:28:16 | FromDiscord | <4zv4l> what's `[_]` ? |
18:29:25 | FromDiscord | <Phil> It's a bug about how this: `proc bla[_](x: _) = echo "potato"` used to be a valid generic.↵It is no longer on nim devel due to another fix, where `_` was disallowed in general from several places to make it easier to reason about that "_" for a type name in a declaration makes no sense and you shouldn't use things that way. |
18:29:54 | FromDiscord | <Phil> Now the question is, should this be that way or should it work as before? |
18:30:11 | FromDiscord | <4zv4l> why using `_` over `T` ? |
18:30:31 | FromDiscord | <Phil> In some generics, you really do not care about the actual type |
18:30:55 | FromDiscord | <Phil> To make that very clear, you declare that type as `_` |
18:31:16 | FromDiscord | <Phil> However, that is weird behaviour, I fully agree, I merely understand why some generics in norm were written that way by moigagoo way back when |
18:31:28 | FromDiscord | <Phil> (edit) "behaviour," => "usage of syntax," |
18:32:20 | FromDiscord | <4zv4l> well I don't often use generics so↵I don't really have an opinion about that xD↵but I guess the more possibility you have, the better |
18:32:50 | FromDiscord | <Phil> Kinda, but also by allowing it you're enabling the user to make other assumptions that they might be able to use `_` in other places where they really shouldn't |
18:33:46 | FromDiscord | <Phil> The original writer of the changes that introduces the "forbiddance" of `_` explained that in the ticket I filed and I agree with him, rules that are easier to follow (like `_` is not allowed in weird places like generic types in general) make it easier to reason about the language |
18:34:25 | FromDiscord | <4zv4l> well for example I used to think↵`_ = someFuncThatReturnSomething()` is a good idea↵but↵`discard someFuncThatReturnSomething()` is actually better |
18:35:19 | FromDiscord | <Phil> Actually, let me check if that works on new devel |
18:36:07 | FromDiscord | <Phil> Yeah `let _ = 5` and `proc x(_: int) = echo "potato"` still work |
18:37:01 | FromDiscord | <Lanky Lemur> sent a code paste, see https://play.nim-lang.org/#ix=4p5X |
18:40:28 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p5Y |
18:41:01 | FromDiscord | <Phil> Generally the `ref object of RootObj` mostly means that you can inherit from A at all, I haven't really seen it used like "write your stuff based on RootObj" |
18:41:30 | FromDiscord | <Phil> Though, do note that this way of writing procs does not give you dynamic dispatch!↵If you want that, look at `method`s |
18:42:30 | FromDiscord | <Lanky Lemur> What is dynamic dispatch? |
18:43:14 | FromDiscord | <j2q> In reply to @ringabout "Why do you need": Sorry bother you do you know where can I find llstream unit, I can't find it on pascal source |
18:43:15 | FromDiscord | <jtv> The method will get selected at runtime based on the concrete type of the object, as opposed to at compile time based on the static type in the context |
18:43:50 | FromDiscord | <Phil> Thanks jtv, I was rummaging around how to explain it since I've mostly got that concept down on a "I can use"-basis |
18:44:01 | FromDiscord | <Phil> (edit) "use"-basis" => "use it"-basis" |
18:44:11 | FromDiscord | <Phil> (edit) "jtv," => "jtv!" | "jtv!I was rummaging around ... how" added "in my head on" |
18:44:25 | FromDiscord | <Phil> (edit) "a" => "an" |
18:44:41 | FromDiscord | <jtv> LOL no problem |
18:47:07 | FromDiscord | <jtv> So basically @Lanky Lemur You need to make "test" a method instead of a proc, and use the {.base.} pragma on it |
18:47:22 | FromDiscord | <Phil> In reply to @Lanky Lemur "What is dynamic dispatch?": But yeah, basically the nim way you'd write this code is that you first write your base type as `type Bla = ref object of RootObj` and then you inherit from that using `type Bla2 = ref object of Bla2` , see the first `"ref object of RootObj" annotation mostly as a way to "enable" inheritance for that type |
18:47:39 | FromDiscord | <Phil> (edit) "Bla2`" => "Bla`" |
18:47:44 | FromDiscord | <jtv> Or you can convert it to a root object if there's only ever the one method |
18:47:51 | FromDiscord | <jtv> RootObj(ex) |
18:48:08 | FromDiscord | <Lanky Lemur> In reply to @jtv "RootObj(ex)": > RootObj(ex) |
18:48:25 | FromDiscord | <Lanky Lemur> (edit) "RootObj(ex)" => "RootObj(ex)↵It did not like it when I tried that" |
18:48:49 | FromDiscord | <Lanky Lemur> In reply to @Isofruit "But yeah, basically the": Creating a dummy type for everything else to inherit from worked. Thank you so much for your help |
18:48:50 | FromDiscord | <jtv> It should but use cast[RootObj](ex) if you need to |
18:53:24 | * | derpydoo quit (Quit: derpydoo) |
18:58:13 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p69 |
18:59:24 | FromDiscord | <Phil> You don't necessarily need to have inheritance if you're not making use of `method`/dynamic dispatch or want to use the inheritance to make sure all child-objects have a specific set of fields. |
19:00:26 | FromDiscord | <Phil> And by simply using a generic you'll keep your overall code simpler - if you don't need actually make use of inheritance features |
19:01:11 | FromDiscord | <jtv> Inheritance is the easiest way to get objects of different types in one seq[] though... that question comes up a lot on here. |
19:01:48 | FromDiscord | <Phil> That one is a fair shout, though at that point you'd also be using methods to get certain things out of them |
19:02:19 | FromDiscord | <jtv> Or, if they all inherit from rootobj, you need to track the types |
19:02:41 | FromDiscord | <jtv> Variants are better |
19:02:54 | FromDiscord | <jtv> But aren't always viable |
19:02:55 | FromDiscord | <Phil> Yeah, was about to say that if you're tracking the type explicitly anyway then you might as well use variants |
19:03:33 | FromDiscord | <Phil> I can see the appeal for methods and dynamic dispatch to solve the entire "throw things together in data structures" issue |
19:04:07 | FromDiscord | <Phil> Just that I see little middle ground between "go full blown usage of dynamic dispatch" and object variants ^^ |
19:05:40 | FromDiscord | <Phil> Though maybe that's my inexperience in actually making use of inheritance in nim talking |
19:05:57 | FromDiscord | <jtv> Nah |
19:06:45 | FromDiscord | <jtv> I think if it had been me, I'd have done dynamic dispatch via interfaces only, and skipped inheritance |
19:06:48 | FromDiscord | <Phil> Like I write OO code in java and almost exclusively procedural in nim, that's why I tend to be sometimes careful |
19:07:04 | FromDiscord | <Phil> (edit) "Like I write OO code in java and almost exclusively procedural in nim, that's why I tend to be sometimes careful ... " added "there" |
19:07:10 | FromDiscord | <jtv> Basically automate all the variant stuff behind the scenes |
19:07:45 | FromDiscord | <Phil> So basically there would've been only static dispatch and object variants, just through 2 different APIs? |
19:08:08 | FromDiscord | <Phil> (One being classic object variants of now and the second being the one that takes care of stuff behind the scenes) |
19:08:15 | FromDiscord | <jtv> Well, no, have you used interfaces in other languages/ |
19:08:24 | FromDiscord | <Phil> Only java |
19:08:36 | FromDiscord | <Phil> As nim only has concepts which only apply to generics |
19:08:48 | FromDiscord | <jtv> Same basic thing... you could stick items of different types in an array as long as they implement the interface |
19:09:19 | FromDiscord | <jtv> The system would implicitly wrap them in a box that knows (statically per box) which implementation to call dynamically for that object |
19:10:45 | FromDiscord | <Nerve> I felt my blood boiling a little bit. Did somebody say...Java? |
19:11:07 | FromDiscord | <Phil> Yes |
19:11:56 | FromDiscord | <Nerve> 👹 |
19:12:14 | FromDiscord | <Phil> Eh, I stand by my statement that the community around java is worse than the language. |
19:13:09 | FromDiscord | <Phil> Like, I'm still not a fan, but it's workable. But god damn those 50 abstractions over every damn problem |
19:13:20 | FromDiscord | <jtv> Java's reason for being is it's legacy code base and ecosystem. The whole reason the JVM was awesome in its day is pretty much gone now that there are really only two hardware platforms and 3 OSes that matter. |
19:13:44 | FromDiscord | <Phil> ~~Don't let BSD users hear you say that!~~ |
19:14:06 | FromDiscord | <jtv> I've got friends who are FreeBSD maintainers, they know it too 🙂 |
19:15:41 | FromDiscord | <Phil> 😄 Fair |
19:17:26 | FromDiscord | <jtv> Seriously, if you're writing systems software, in Nim or Go you produce one binary and you're done, and the JVM is worthless. If you need to support ARM, now you've got 2 binaries, and since the OS interface is basically identical for almost every program under the sun, I don't have to worry, I write once and it runs where I need it, w/o having the overhead of the JVM |
19:17:39 | FromDiscord | <jtv> And there, the operational overhead is what's really bad |
19:18:40 | FromDiscord | <Phil> I can't really evaluate. One of the reasons I'm dabbling in GUI is to get some understanding on where the hardship in distributing your stuff actually lies |
19:19:25 | FromDiscord | <Phil> Write application, write some CI pipelines for building binaries on different systems and adjust things based on what system they're for.↵Maybe make a flatpak just for the heck of it |
19:20:28 | FromDiscord | <Phil> So far I never really was exposed with the hardship that apparently is "dealing with different operating systems" - I only ever wrote nim-code that was going to go in a linux image, run on a linux server and the GUI would be browser based where firefox/chromium take care of the OS specific crap for me |
19:27:05 | FromDiscord | <jtv> sent a long message, see http://ix.io/4p6l |
19:27:39 | FromDiscord | <jtv> Getting one piece of software to run across all that w/ any efficiency seemed like a fool's errand before Java. But interpreted languages like Python weren't a problem for that |
19:30:21 | FromDiscord | <jtv> At that time, languages you'd consider writing in for real were either interpreted or C/C++ 🙂 |
19:31:36 | FromDiscord | <Haze System (they/them)> does nimpretty not format indentation? https://media.discordapp.net/attachments/371759389889003532/1078761129565761716/image.png |
19:31:42 | FromDiscord | <Haze System (they/them)> (edit) "indentation?" => "indentation or am i doing something wrong?" |
19:36:04 | FromDiscord | <I have 50GB of nothing on my PC> does any nimlet know how to read output from process's stream where poParentStreams was used |
19:37:51 | FromDiscord | <Phil> In reply to @Haze System "does nimpretty not format": My understanding is nimpretty just parses your code into nimnodes and rewrites it in a "standard way" that nim itself would write this code.↵If your nim-code isn't valid and thus parseable, nimpretty likely won't be able to cope |
19:38:05 | FromDiscord | <Phil> (edit) "In reply to @Haze System "does nimpretty not format": My understanding is nimpretty just parses your code into nimnodes ... and" added "(so basically partially compiles it)" |
19:38:08 | FromDiscord | <Haze System (they/them)> gotcha ty :) |
19:38:51 | FromDiscord | <Phil> In reply to @jtv "Yeah, that's the modern": That feels like you came out of wild west into easy mode territory nowadays. |
19:39:28 | FromDiscord | <Phil> Well, the benefits of the future! We streamlined things !... by having a ton of things die off 😅 |
19:50:08 | * | derpydoo joined #nim |
20:09:17 | FromDiscord | <guttural666> can somebody tell my why I cannot match the double quotes here, I have read the std/re docs but they seem a bit lacking https://media.discordapp.net/attachments/371759389889003532/1078770610680905859/image.png |
20:10:48 | FromDiscord | <guttural666> (edit) "lacking" => "lacking, my example works but I'm a bit mad that I cannot get " to work" |
20:21:41 | NimEventer | New post on r/nim by LurzMeister: Beginner having a problem, see https://reddit.com/r/nim/comments/11b10a8/beginner_having_a_problem/ |
20:37:16 | FromDiscord | <SREagle> In reply to @guttural666 "can somebody tell my": `echo html_link[front..back]` gives me `Abhorrent Castigation` - not what you wanted? |
20:37:32 | FromDiscord | <guttural666> In reply to @SREagle "`echo html_link[front..back]` gives me": yeah yeah |
20:38:32 | FromDiscord | <guttural666> but escaping " gives me a problem, I have read about \ being a special character in nim and raw strings, but it doesn't seem to make sense nontheless |
20:38:46 | FromDiscord | <SREagle> works a little different than I know regex from perl, I have to admit |
20:39:13 | FromDiscord | <guttural666> yeah, something is clashing with Nims escaping of string types? this is just over my head |
20:40:16 | FromDiscord | <guttural666> the regex I want part is what I tried out in regex playgrounds online and this should work |
20:40:22 | FromDiscord | <guttural666> some prob with the escaping |
20:40:33 | FromDiscord | <guttural666> tried \\", tried \\\" |
20:40:53 | FromDiscord | <guttural666> doesnt render in Discord: tried triple \ and " and double \ and " |
20:42:36 | FromDiscord | <SREagle> I just did the single backslash before the double quotes within a normal double quoted string... worked for me: `let html_link = "<a href=\"Abhorrent">https://www.metal-archives.com/bands/Abhorrent_Casttgation/3540344201\">Abhorrent Castigation</a> <!-- 0.27216554 -->"` |
20:44:10 | FromDiscord | <SREagle> like in your screenshot.. thank the programming gods for OCR g |
20:46:46 | FromDiscord | <SREagle> and even the gods aren't perfect : Casttgation - but the rest should match, I think |
20:51:58 | * | luis_ joined #nim |
21:13:48 | FromDiscord | <halc> In reply to @Haze System "does nimpretty not format": excuse me, what colorscheme are you using? |
21:17:08 | FromDiscord | <Haze System (they/them)> In reply to @halc "excuse me, what colorscheme": abyss |
21:17:49 | FromDiscord | <halc> I see, thank you |
21:18:00 | FromDiscord | <halc> don't love the low contrast but the colours are nice |
21:18:15 | FromDiscord | <Haze System (they/them)> yeah some things like colons can be hard to see |
21:27:55 | FromDiscord | <4zv4l> Nim default's `int` is `int32` ? |
21:28:04 | FromDiscord | <Elegantbeef> No |
21:28:07 | FromDiscord | <Elegantbeef> `int` is a platform specific int |
21:28:33 | FromDiscord | <ezquerra> sent a code paste, see https://play.nim-lang.org/#ix=4p70 |
21:28:33 | FromDiscord | <4zv4l> what would be the equivalent to `usize` ?↵to get the biggest `uint` possible on the device |
21:28:44 | FromDiscord | <Elegantbeef> `uint` |
21:28:44 | FromDiscord | <4zv4l> In reply to @Elegantbeef "`int` is a platform": hmmm |
21:28:57 | FromDiscord | <4zv4l> so without precising, it will get as much as it can ? |
21:29:01 | FromDiscord | <ezquerra> I've been converting some python code to nim and I'm trying to make the nim code a bit more idiomatic 😅 |
21:29:08 | FromDiscord | <4zv4l> the compiler won't try to use a `int8` if it sees that it can ? |
21:29:27 | FromDiscord | <Elegantbeef> ezquerra generally it's expression \> result \> return |
21:29:39 | FromDiscord | <Elegantbeef> You generally do not want to use return as it creates undesired flow control imo |
21:30:01 | FromDiscord | <Elegantbeef> Of course it will not |
21:30:42 | FromDiscord | <4zv4l> alright so no type optimization |
21:30:45 | FromDiscord | <4zv4l> good to know |
21:31:07 | FromDiscord | <Elegantbeef> I do not even know what type optimization means |
21:31:21 | FromDiscord | <ezquerra> @ElegantBeef, what do you mean by "undesired flow control"? Do you have an example? |
21:31:22 | FromDiscord | <Elegantbeef> It's a statically typed language if you change the literal type based off the size of the number you now need to play compiler to reason the type |
21:31:35 | FromDiscord | <4zv4l> well if the compiler see that you only use number in range to `int8` it won't 'allocate' an `int32` |
21:31:43 | FromDiscord | <Elegantbeef> Using return means you have flow control that depends on the compiler |
21:31:54 | FromDiscord | <Elegantbeef> So then use a int8↵(@4zv4l) |
21:32:12 | FromDiscord | <Elegantbeef> Whoops |
21:32:12 | FromDiscord | <Elegantbeef> I mean depends on runtime logic |
21:32:12 | FromDiscord | <Elegantbeef> Was reading 4's message |
21:32:13 | FromDiscord | <4zv4l> that's why I was asking about default `int` size |
21:32:25 | FromDiscord | <Elegantbeef> I generally avoid return unless it's a optimisation like in a search |
21:33:10 | FromDiscord | <halc> I do remember something being mentioned about `result` allowing for some sort of optimization by the compiler |
21:33:44 | FromDiscord | <halc> NRVO? |
21:38:10 | FromDiscord | <halc> yeah, apparently using `result` guarantees NRVO optimization |
21:38:31 | FromDiscord | <Elegantbeef> ATM machine 😛 |
21:41:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4p72 |
21:52:11 | * | derpydoo quit (Quit: derpydoo) |
22:29:53 | FromDiscord | <halc> In reply to @4zv4l "well if the compiler": is that really optimization? In what sense? |
22:32:49 | FromDiscord | <halc> I don't believe that would improve performance, might even decrease it depending on the CPU architecture |
22:33:31 | FromDiscord | <halc> And it won't really utilize less memory unless you're packing data, which could also potentially incur a performance hit |
22:33:44 | FromDiscord | <halc> I don't believe it's the work of the compiler to choose your types for you |
22:33:51 | FromDiscord | <halc> (edit) "your" => "the" |
22:35:01 | FromDiscord | <halc> at least not integer sizes |
22:39:54 | * | Guest4033 joined #nim |
22:42:15 | FromDiscord | <Elegantbeef> Well if you have a collection of these it would be more efficient to the cache |
22:44:42 | FromDiscord | <Phil> Beef! |
22:44:57 | FromDiscord | <Elegantbeef> il! |
22:46:15 | FromDiscord | <Phil> Do you know enough about owlkettles source to get how to "block" it from actually starting when it actually calls brew?↵Background: I made the new nimibook docs. Those compile code examples. There's like 12 fully functional compileable owlkettle example apps in there, when that executes it launches 12 mini apps.↵I'd like that to not happen by defining a compiler flag that returns before it starts going into the rendering loop that genera |
22:47:00 | FromDiscord | <Phil> The easy solution is just commenting out the call to "brew", but can.l would like for those to stick around for easier copy-pasteability |
22:47:28 | FromDiscord | <Elegantbeef> Could just put it inside a `when not defined(owlKettleDemo): brew(...)` |
22:48:32 | FromDiscord | <Elegantbeef> I wonder if nimibook has a define |
22:48:48 | FromDiscord | <Elegantbeef> If so could use that |
22:48:57 | FromDiscord | <guttural666> In reply to @SREagle "I just did the": yeah, don't know what to do 😛 this seems perfectly fine, will play with raw strings etc. https://media.discordapp.net/attachments/371759389889003532/1078810792574582864/image.png |
22:49:33 | FromDiscord | <Elegantbeef> raw string literals do not work with escaping↵(@guttural666) |
22:49:43 | FromDiscord | <Elegantbeef> `re("{?<....}")` |
22:49:48 | FromDiscord | <halc> In reply to @Elegantbeef "Well if you have": I did say "potentially", point is, it'd be pretty damn complex for the compiler to asses whether it's a good idea or not |
22:50:09 | FromDiscord | <Elegantbeef> Oh i agree the compiler should not change types on the fly |
22:50:16 | FromDiscord | <Elegantbeef> It's not like `i8` is a complex thing to write |
22:50:57 | FromDiscord | <guttural666> In reply to @Elegantbeef "raw string literals do": yeah, thats kinda what I was hoping for, something like escapeRe? https://nim-lang.org/docs/re.html#escapeRe%2Cstring |
22:51:44 | FromDiscord | <Elegantbeef> Uhhh I'm saying `\"` does not do what you want inside the \`re"..."\~ |
22:51:50 | FromDiscord | <Elegantbeef> cause it's a raw string literal |
22:52:04 | FromDiscord | <Elegantbeef> Put a space, use parenthesis, do something that makes it not parsed as a raw string |
22:53:40 | FromDiscord | <guttural666> In reply to @Elegantbeef "Put a space, use": hmm |
22:54:54 | * | advesperacit quit () |
22:54:58 | FromDiscord | <Elegantbeef> !eval echo"\\t" |
22:55:05 | NimBot | \\t |
22:55:26 | FromDiscord | <Elegantbeef> !eval echo "\\t" |
22:55:31 | NimBot | \t |
22:55:43 | FromDiscord | <Elegantbeef> Nimbot is mean |
22:56:12 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1078812617851805757/image.png |
23:00:05 | FromDiscord | <ezquerra> Thanks! |
23:01:29 | FromDiscord | <guttural666> In reply to @Elegantbeef "Put a space, use": I think a preceding " before the " seems to work? it did compile, have to check correctness |
23:01:44 | FromDiscord | <Elegantbeef> Yes "" also works |
23:02:16 | FromDiscord | <Elegantbeef> I'd just use command syntax as it's more reasonable |
23:03:13 | FromDiscord | <guttural666> I have no clue why tho |
23:03:25 | FromDiscord | <Elegantbeef> Why what? |
23:03:31 | FromDiscord | <guttural666> what has " to do with escaping, escaping is by \ is it not |
23:03:37 | FromDiscord | <jtv> @4zv4l generally compilers will prefer the natural word size for int values no matter what, because aligned accesses are faster. Shrinking the size allocated is a bad idea performance wise and I am not sure I can think of any language where, on one platform, the same int type could end up different sizes depending on the code |
23:03:46 | FromDiscord | <Elegantbeef> Like i said escaping doesnt work inside string literals |
23:03:49 | FromDiscord | <guttural666> why this works |
23:03:54 | FromDiscord | <Elegantbeef> so it doesnt see an escape sequence it sees `\` |
23:04:26 | FromDiscord | <guttural666> okay, but the escaping (in terms of regex does work for the tail \/a> |
23:04:32 | FromDiscord | <Elegantbeef> so you have a raw string literal that is `(?<=\` |
23:04:45 | FromDiscord | <Elegantbeef> then it sees a `>)` |
23:05:06 | FromDiscord | <guttural666> ah |
23:05:32 | FromDiscord | <Elegantbeef> So it turns into `re"(?<=\" > )` |
23:05:32 | FromDiscord | <Elegantbeef> Which is invalid code |
23:05:58 | FromDiscord | <guttural666> damn this is tricky, I would prefer to just be able to copy and paste valid regex to nim code and have it work |
23:06:13 | FromDiscord | <Elegantbeef> Put a space after re |
23:06:15 | FromDiscord | <Elegantbeef> Like what |
23:07:29 | FromDiscord | <Elegantbeef> Works just fine |
23:07:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4p7l |
23:07:57 | FromDiscord | <Elegantbeef> The string call syntax of `re"..."` uses a raw string literal |
23:08:27 | FromDiscord | <Elegantbeef> Command syntax or parenthesis call does not |
23:09:00 | FromDiscord | <guttural666> this is what I tried on a regex website ↵regex i want = (?<=">)(.)(?=<\/a>) |
23:09:11 | FromDiscord | <guttural666> how do I do code snippets here |
23:09:19 | FromDiscord | <Elegantbeef> backticks |
23:09:20 | FromDiscord | <guttural666> and this worked perfectly fine |
23:09:24 | FromDiscord | <guttural666> thanks |
23:09:31 | FromDiscord | <guttural666> `regex i want = (?<=">)(.)(?=<\/a>)` |
23:09:55 | FromDiscord | <Elegantbeef> How about `re"""(?<=">)(.)(?=</a>)"""`? |
23:10:00 | FromDiscord | <Elegantbeef> I do not use regex so I cannot say much |
23:11:30 | FromDiscord | <guttural666> https://media.discordapp.net/attachments/371759389889003532/1078816471666413658/image.png |
23:11:34 | * | jmdaemon joined #nim |
23:11:34 | FromDiscord | <guttural666> thisseems to work |
23:11:51 | FromDiscord | <guttural666> I cant even |
23:11:54 | FromDiscord | <guttural666> dunno how |
23:12:02 | FromDiscord | <Elegantbeef> Why we just parsing the xml is beyond me |
23:12:08 | FromDiscord | <Elegantbeef> Why we arent\ |
23:12:20 | FromDiscord | <guttural666> I just feel like playing Tekken at 12 years old, just spamming buttons until it works |
23:12:33 | FromDiscord | <Elegantbeef> Which works? |
23:12:40 | FromDiscord | <guttural666> yours works but why |
23:13:01 | FromDiscord | <Elegantbeef> Cause raw string literals exist |
23:13:15 | FromDiscord | <guttural666> yes, this is what I researched yesterday night |
23:13:16 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#lexical-analysis-raw-string-literals |
23:13:38 | FromDiscord | <Elegantbeef> `re"bleh"` is a raw string literal |
23:13:45 | FromDiscord | <Elegantbeef> `re "bleh"` is not |
23:14:02 | FromDiscord | <Elegantbeef> `re """bleh"""` is a triple string literal, which is a raw string literal but can be multi line |
23:14:05 | FromDiscord | <huantian> In reply to @Elegantbeef "Why we just parsing": <https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags> :) |
23:14:09 | FromDiscord | <Elegantbeef> It also doesnt need to escape single characters |
23:14:37 | FromDiscord | <Elegantbeef> Ahh thank you 😄 |
23:15:26 | FromDiscord | <Elegantbeef> Huan someone made a Nim xml parser that operated on the xml adding fields, entries and nodes all without parsing it |
23:15:28 | FromDiscord | <Elegantbeef> They used pure regex to do it |
23:15:40 | FromDiscord | <guttural666> In reply to @Elegantbeef "It also doesnt need": okay, I'll read up on this thanks, but this is super infuriating, first time I tried this I just resorted to windowing my way to my string with front index and back index |
23:15:54 | * | Guest4033 quit (Quit: Client closed) |
23:16:01 | FromDiscord | <Elegantbeef> I can only say read the manual and learn how strings work |
23:16:08 | FromDiscord | <Elegantbeef> I know it's condescending but it's all that you need to do |
23:16:44 | FromDiscord | <guttural666> yeah, that is what I had to resort to, but should this be so hard, I mean I figured out what I wanted from regex |
23:17:03 | FromDiscord | <guttural666> isn't this an std ergonomics issue, that can be solved somehow? |
23:17:06 | FromDiscord | <Elegantbeef> @huantian\: I see that post and raise you https://github.com/abdulbadii/HTML-XML-Operations-Nim |
23:17:32 | FromDiscord | <Elegantbeef> It can be solved by people understanding how generalise string literals work |
23:18:28 | FromDiscord | <Elegantbeef> It can also be solved by not attempting to use regex to parse html |
23:18:40 | FromDiscord | <Elegantbeef> Yes you can just search the html, but cmon parsing it is just more sane |
23:19:12 | FromDiscord | <guttural666> it's just not what I do every day, so I use the tools that seem most obvious |
23:19:27 | FromDiscord | <guttural666> first with find and rfind from strutils |
23:19:30 | FromDiscord | <guttural666> then regex |
23:19:38 | FromDiscord | <guttural666> dunno what's the best way |
23:20:20 | FromDiscord | <guttural666> I have written config parsers before with c++ |
23:20:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4p7n |
23:21:27 | FromDiscord | <Elegantbeef> The best way to interact with data is almost always to parse the data instead of working on it raw |
23:22:10 | FromDiscord | <guttural666> by that you mean just going through it char by char and searching for what you are looking for? |
23:22:33 | FromDiscord | <Elegantbeef> No I mean giving it to a parser and getting a tree you can easily navigate |
23:22:47 | FromDiscord | <guttural666> oh yeah, yeah |
23:22:47 | FromDiscord | <Elegantbeef> Unless you mean the raw part |
23:22:49 | FromDiscord | <Elegantbeef> Then yes i mean that |
23:24:02 | FromDiscord | <guttural666> if you want to get things done yeah haha |
23:24:07 | FromDiscord | <Elegantbeef> Point is you see how simple it is to use the stdlib parser |
23:24:47 | FromDiscord | <guttural666> yeah, just wasn't aware, I am using the JSON parser to loop over the results of my API call already |
23:31:54 | FromDiscord | <guttural666> In reply to @Elegantbeef "Point is you see": thanks again |
23:32:01 | FromDiscord | <guttural666> (edit) "In reply to @Elegantbeef "Point is you see": thanks ... again" added "once" |
23:41:45 | * | Notxor quit (Remote host closed the connection) |
23:43:05 | * | luis_ quit (Quit: Leaving) |