<< 24-02-2023 >>

00:16:54FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1078470538919420024/20230223_190527.jpg
00:17:06FromDiscord<albassort> Wrong discord
00:17:11FromDiscord<albassort> If anyone saw that don't yell at me
00:17:54*MythicalForestCo joined #nim
00:18:02FromDiscord<Elegantbeef> Honestly wtf
00:18:28FromDiscord<Elegantbeef> I didnt see it just flaming
00:19:18*MythicalForestCo left #nim (#nim)
00:25:08FromDiscord<Hourglass [She/Her]> Where's the irc logs :)
00:26:26FromDiscord<Hourglass [She/Her]> Well
00:26:29FromDiscord<Hourglass [She/Her]> That is... Something?
00:32:47FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p1G
00:33:02FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4p1G" => "https://play.nim-lang.org/#ix=4p1H"
00:33:37FromDiscord<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:01FromDiscord<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:10FromDiscord<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:38FromDiscord<Kali> do i have to give credit? because nim is MIT licensed or is my app not affected by it?
01:05:57FromDiscord<Elegantbeef> The code is licensed under MIT but binaries are not
01:06:30FromDiscord<Elegantbeef> It's not much different to something like krita
01:08:41FromDiscord<Kali> what about the std library
01:08:49FromDiscord<Elegantbeef> Same thing
01:08:55FromDiscord<Elegantbeef> Unless you use re or nre
01:08:59FromDiscord<Elegantbeef> or openssl
01:10:09FromDiscord<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:26FromDiscord<Naiy> Mks
03:32:41FromDiscord<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:31FromDiscord<amadan> can also do `import module {.all.}` to import private procs↵And then use `privateAccess` from `std/importutils` to access private properties
03:35:51FromDiscord<Arathanis> this sounds amazing, I will try it. is there documentation on `{.all.}`? I can't find any
03:42:26FromDiscord<Arathanis> In reply to @amadan "can also do `import": Gave this a whirl and it does not seem to be working.
03:43:38FromDiscord<amadan> ah damn, does it give any error?
03:43:50FromDiscord<Arathanis> it treats it like a custom pragma that does not exist
03:45:00FromDiscord<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:44FromDiscord<Arathanis> maybe it requires the entire import statement in the example?
03:46:08FromDiscord<Arathanis> oh wait, i see the regular one too... hmmm
03:51:53FromDiscord<Arathanis> @amadan might actually be something else... checking
03:53:25FromDiscord<Arathanis> yup I was being dumb
03:59:26*azimut quit (Ping timeout: 255 seconds)
04:02:50NimEventerNew 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:20NimEventerNew 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:14FromDiscord<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:02FromDiscord<Naiy> B
06:09:43FromDiscord<Naiy> B
06:13:51FromDiscord<Naiy> B
06:14:48FromDiscord<Naiy> https://yax.im/i/#%23nim-lang%[email protected]?join
06:20:19FromDiscord<Naiy> B
06:23:49FromDiscord<Rika> what?
06:24:25FromDiscord<Elegantbeef> Cannot tell if inane spam or if they're testing that their xmpp interop is working
06:26:00FromDiscord<ringabout> Wrong channel to test anyway.
06:32:46FromDiscord<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:12FromDiscord<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:38FromDiscord<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:06FromDiscord<Phil> (edit) "runs" => "turns"
07:40:24FromDiscord<Phil> (edit) "doesn't.↵I" => "doesn't.↵Rerunning often enough will make it eventually succeed.↵I"
08:18:53*PMunch joined #nim
08:19:54FromDiscord<4zv4l> is that normal that on windows my logging is all in one line ?↵it doesn't seem to add newline
08:21:37FromDiscord<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:16PMunch@4zv4l, likely a CRLF/LF issue
08:55:23FromDiscord<enthus1ast> In code you can use \`\\p\` instead of \`\\n\`
08:55:49FromDiscord<enthus1ast> https://nim-lang.org/docs/manual.html#lexical-analysis-string-literals
08:58:27FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4p30
09:08:47PMunchOoh, very exciting @ringabout!
09:09:40FromDiscord<ringabout> Thanks!
09:14:56FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4p3c
09:15:06FromDiscord<4zv4l> ` for raw string
09:15:12FromDiscord<4zv4l> instead of `r""`
09:15:23FromDiscord<Coachonko> In reply to @4zv4l "is that normal that": windows version?
09:15:46FromDiscord<4zv4l> yeah windows
09:15:56FromDiscord<Coachonko> version
09:15:57FromDiscord<4zv4l> notepad doesn't show the newline↵but with a different text editor it's fine
09:15:59FromDiscord<4zv4l> oh
09:16:36FromDiscord<4zv4l> windows server 2012
09:16:37FromDiscord<Coachonko> Because recent windows 10 and 11 versions do not have problems with unix new line characters, older versions do have problems
09:16:44FromDiscord<Coachonko> Yep that's an old boy
09:17:19FromDiscord<4zv4l> but the program is compiled using `nim.exe` (windows version) for windows target, doesn't it adapt the newline character ?
09:17:31FromDiscord<Coachonko> How are you even on 2012? Company pays for license?
09:17:40FromDiscord<4zv4l> that's a test server
09:17:41FromDiscord<4zv4l> xD
09:17:49FromDiscord<4zv4l> yeah company
09:17:59FromDiscord<4zv4l> they pay for it
09:18:05FromDiscord<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:16FromDiscord<Coachonko> (edit) "focus" => "focuses"
09:18:39FromDiscord<Coachonko> 2012 is quite old, considering 2019 and 2022 are out
09:19:02FromDiscord<4zv4l> windows 2012 r2 datacenter edition↵↵idk why they use that one
09:19:15FromDiscord<Coachonko> (edit) "2012 is quite old, considering ... 2019" added "2016,"
09:19:15FromDiscord<4zv4l> since that's a test one maybe they don't care much about the version ?↵I'm gonna ask my manager
09:19:28FromDiscord<Coachonko> Probably
09:19:39FromDiscord<Coachonko> Or maybe because they deploy to 2012r2
09:20:05FromDiscord<4zv4l> In reply to @Coachonko "Not sure, probably not": feels weird to think windows server 2012 is legacy lol xD
09:20:19FromDiscord<Coachonko> It's literally 1 decade old at this point lmao
09:20:20FromDiscord<4zv4l> to me Windows 7 isn't legacy yet in my mind
09:20:22FromDiscord<4zv4l> yeah right
09:20:42FromDiscord<4zv4l> In reply to @Coachonko "It's literally 1 decade": Windows 10 too tho
09:21:00FromDiscord<Coachonko> Kinda, windows 10 is technically a rolling release
09:21:16FromDiscord<Coachonko> Except windows 11 exists and my hardware is not allowed to run it
09:21:59FromDiscord<4zv4l> sent a long message, see http://ix.io/4p3f
09:22:32FromDiscord<Coachonko> I only dev on linux and believe most people should, the market share of windows servers is so small
09:22:48FromDiscord<Coachonko> It weirds me out that people dev on windows
09:23:23FromDiscord<4zv4l> yeah right↵well because `bUt lInUx DoEsNT hAvE ExCeL`
09:23:34FromDiscord<4zv4l> or whatever silly reason
09:24:25FromDiscord<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:11FromDiscord<4zv4l> and the whole Active Directory thing
09:27:22FromDiscord<ieltan> AD is really the only thing that Windows Server is good for
09:27:46FromDiscord<ieltan> Havent used anything else that i couldnt already do on linux
09:28:13FromDiscord<ieltan> maybe there is though
09:39:01FromDiscord<luteva> sent a code paste, see https://play.nim-lang.org/#ix=4p3g
09:40:11PMunchHmm, 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:48FromDiscord<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:26FromDiscord<luteva> thx! gonna read that :=
09:44:31FromDiscord<luteva> (edit) ":=" => "🙂"
10:03:39*kenran joined #nim
10:07:45FromDiscord<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:58PMunchHmm, how do you read static parameters from a procedure implementation?
10:23:35PMunchAs 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:20PMunchI'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:34FromDiscord<amadan> Are you trying to get the int parameter? Or trying to find types that are static?
11:04:48FromDiscord<amadan> (edit) "types" => "parameters"
11:10:03FromDiscord<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:16FromDiscord<amadan> `import theModule`↵You don't need to do `module.xy` unless its ambiguous what you are referring to
11:17:13FromDiscord<amadan> In reply to @amadan "Are you trying to": nvm I see what you mean, that static type just disappears 🤔
11:19:38FromDiscord<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:45FromDiscord<amadan> `CARD_TEMPLATE_ID` isn't exported in `CmdParams`
11:21:35FromDiscord<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:02FromDiscord<amadan> Kind of but its best to just manually mark them as exported
11:29:45FromDiscord<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:21PMunch@amadan, trying to get the `int` parameter
11:31:54PMunchI can see that it is static, but I can't get the inner type
11:32:38FromDiscord<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:39FromDiscord<Rika> In reply to @Gen "it still doesn't work": diod you try compiling it
11:32:47FromDiscord<Rika> nimsuggest can have spurious errors
11:33:08FromDiscord<Rika> In reply to @amadan "Any different error message": that would be a runtime error no?
11:33:12FromDiscord<Rika> paramStr is runtime
11:33:50FromDiscord<amadan> I'd assume so, but I'm mostly just guessing cause I can't see anything else wrong
11:34:19FromDiscord<Rika> well i think its just nimsuggest not updating correctly
11:34:21FromDiscord<Rika> so try compiling
11:35:31FromDiscord<Gen> sent a code paste, see https://play.nim-lang.org/#ix=4p3E
11:35:43FromDiscord<Gen> removed the parameter check
11:36:05FromDiscord<Gen> no errors in vs code shown anymore but it doesn't compile
11:36:43FromDiscord<Rika> AH
11:36:49FromDiscord<Rika> i know now
11:37:03FromDiscord<Rika> dont name your module and anything in that module the same name (style-insensitively)
11:37:09FromDiscord<Rika> cmdParams == cmd_params
11:37:22FromDiscord<Rika> rename one of them
11:37:34FromDiscord<Gen> oh lol
11:37:45FromDiscord<Gen> is there a naming convention for modules that i can follow?
11:38:00FromDiscord<Gen> im so used to creating atomic module that export the same thing they're called
11:38:07FromDiscord<Gen> (edit) "module" => "modules"
11:38:33FromDiscord<Rika> for this scenario there isnt really a convention
11:39:07PMunchHmm, this is weird: https://play.nim-lang.org/#ix=4p3F
11:40:19PMunchThat fails, because of an "unspecified generic", but replacing `Test` with `static[string]` in the procedure definition makes it work
11:40:31PMunchSo `static[string]` can't be put into a type?
11:43:24Zevvwelcome to the wonderful world of typed macros
11:46:32PMunchFun stuff..
11:48:46Zevvi've heard people call it the "empty room syndrome"
11:49:12Zevvyou are wandering through this huge castle, roaming corridors, hallways, dungeons
11:49:44Zevvyour adventures bring you deeper and deeper into the structures
11:50:13Zevvthe smell of mold, rats and funghi burns in your nostrils
11:50:41Zevvand finally, after a bloody fight with a pack of goblins you manage to open the large, wooden door
11:50:50Zevvonly to find a large room that is completely empty
11:50:53Zevvno one ever comes here
11:50:55Zevvno one ever came here
11:51:01Zevvno one ever writes tests for this particular area
11:52:13Zevvyou cry out for help, but no one comes to your rescue
11:54:32PMunchHaha, interesting analogy :P
11:55:53Zevvgo into the other room, the resident goblin there is likely able to help you out
11:57:26FromDiscord<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:44ZevvPMunch: I mean, go ask disruptek
11:58:05FromDiscord<Rika> didnt know disruptek is a goblin
11:58:17FromDiscord<Rika> the more you know
12:00:16ZevvPMunch: 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:25Zevvs/ping/pink/
12:00:47PMunchHaha, what a wonderfully chaotic idea
12:01:00PMunchI think I might need a bigger closet first though..
12:01:22PMunchWell, it has actually gotten quite a lot better
12:02:16Zevvsure, but it depends on what you're doing. As long as I write 'normal' code, Nim is generally doing just fine.
12:02:34Zevvbut especially in the area's where macros come in or when I try to do advanced typing
12:02:42Zevvit's sometime very interesting, still
12:06:22*kenran quit (Remote host closed the connection)
12:07:18FromDiscord<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:27FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4p3Y
13:24:29PMunchHuh, that is indeed weird
13:24:40PMunchDid `quote` get merged with `superQuote`?
13:24:58PMunchOh wait, that would've echoed 1000
13:25:59FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4p42
13:26:16FromDiscord<ringabout> It only takes the first ident within backticks.
13:26:56FromDiscord<ringabout> ['a', '!', '999']
13:28:39FromDiscord<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:23PMunchHmm, I guess it might be to avoid some weird syntactic limitations..
13:35:43FromDiscord<ringabout> Yeah
13:40:25*ox is now known as oz
13:59:20FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4p45
14:00:01FromDiscord<auxym> `let foo = if bar: "bar" else: "foo"`
14:00:09FromDiscord<Dudugz> Got it, thx
14:00:16FromDiscord<auxym> see also: https://peterme.net/tips-and-tricks-with-implicit-return-in-nim.html
14:25:24*derpydoo joined #nim
14:31:33FromDiscord<frobnicate> `{'a' .. 'z', 'A' .. 'Z', '!', '.', ',', 'æ', 'ø', 'å', 'Æ', 'Ø', 'Å'} in text` is being weird
14:31:49FromDiscord<frobnicate> or rather won't compile
14:31:58FromDiscord<frobnicate> only supports US ascii or something?
14:32:31PMunchCharacter literals are single byte
14:32:48FromDiscord<frobnicate> ah
14:33:19PMunchI guess it would work if you converted your text string to use a Norwegian code page or something
14:33:30PMunchBut I'm not sure that's the best solution
14:33:33PMunchWhat're you trying to do?
14:34:50FromDiscord<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:05FromDiscord<frobnicate> I thought it was because of the å or the !
14:35:53FromDiscord<frobnicate> sent a code paste, see https://play.nim-lang.org/#ix=4p4l
14:35:59FromDiscord<frobnicate> ignore me making the last stuff strings I was trying to fix it
14:36:19FromDiscord<frobnicate> oh wait
14:36:35FromDiscord<frobnicate> the "var" is picking up "Advarsel" isn't it
14:37:31FromDiscord<frobnicate> ok making it "var " fixed it, and still removes all the js
14:37:33FromDiscord<frobnicate> cool
14:37:38FromDiscord<frobnicate> thanks for being the rubberduck
14:37:44PMunchHaha no proble
14:38:00*PMunch quit (Quit: Leaving)
14:38:40FromDiscord<frobnicate> it's such a hacky tool I made oh well
14:47:38FromDiscord<Rika> not really secure to "check if something isnt code"
14:50:53FromDiscord<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:10FromDiscord<ringabout> In reply to @j2q "Hi Guys little question": Why do you need this?
14:57:11FromDiscord<ringabout> https://github.com/nim-lang/Nim/tree/8b2a9401a147bd0b26cd2976ae71a1022fbde8cc/nim
14:59:43FromDiscord<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:38FromDiscord<j2q> In reply to @ringabout "Why do you need": Thanks a lot for Your answer
15:15:34FromDiscord<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:23FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4p4G
15:19:47FromDiscord<ringabout> Just like consts.
15:20:38FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p4H
15:21:05FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4p4H" => "https://paste.rs/PAz"
15:21:34FromDiscord<ringabout> Yeah, probably more efficient/
15:22:30FromDiscord<ringabout> Anyway hardly there is a more efficient implementation than the compiler implementaion.
15:22:45FromDiscord<ringabout> (edit) "implementaion." => "implementaion, if not less."
15:24:59FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4p4I
15:25:18FromDiscord<ringabout> It doesn't compile for now.
15:27:54FromDiscord<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:33FromDiscord<Phil> Ah, in that case it's likely still not an option for me
15:39:58FromDiscord<ieltan> urg
15:40:03FromDiscord<ieltan> why is everything dying on me
15:40:03FromDiscord<Phil> Since in norm models are ref objects and you can have nested models
15:40:08FromDiscord<ieltan> i just wanna make a damn discord bot
15:41:01FromDiscord<ringabout> In reply to @Isofruit "Since in norm models": Yeah, it probably doesn't work.
15:41:11FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p4L
15:43:00FromDiscord<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:39FromDiscord<ringabout> I haven't tested ref types. I only know `newTable` doesn't work.
15:44:36FromDiscord<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:49FromDiscord<ieltan> i imported asyncdispatch https://media.discordapp.net/attachments/371759389889003532/1078704055544725624/image.png
15:46:35FromDiscord<Phil> What does the compiler say?
15:48:06FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4p4O
15:48:34FromDiscord<Phil> ... I should've known better than to update devel
15:49:04FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p4P
15:50:57FromDiscord<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:06FromDiscord<ieltan> (edit) "know" => "now"
15:51:45FromDiscord<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:14FromDiscord<Phil> Something that expresses "The actual specific type is irrelevant"
15:52:32FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4p4R
15:52:49FromDiscord<ieltan> its two libraries with the same function name and the same signatures
15:53:19FromDiscord<ringabout> In reply to @Isofruit "Is there a replacement": I don't know the issue. Why is it broken?
15:54:11FromDiscord<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:33FromDiscord<ieltan> er
15:54:41FromDiscord<ieltan> the issue is that im not the one using log
15:55:08FromDiscord<Phil> In reply to @ieltan "the issue is that": You can not import `log`
15:55:12FromDiscord<Phil> from logging.log
15:55:14FromDiscord<Phil> (edit) "logging.log" => "logging"
15:55:24FromDiscord<Phil> Using `import std/logging except log`
15:55:46FromDiscord<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:09FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p4V
15:57:58FromDiscord<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:39FromDiscord<ringabout> Is it a regression on the devel branch of Nim?
16:00:22FromDiscord<Phil> I'm not even sure it's a regression
16:00:29FromDiscord<Phil> It is however on the newest devel branch
16:00:39FromDiscord<Phil> Updated 5 minutes ago
16:00:53FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p4Z
16:01:01FromDiscord<ringabout> In reply to @Isofruit "I'm not even sure": Yeah, perhaps https://github.com/nim-lang/Nim/pull/21192
16:02:10FromDiscord<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:43FromDiscord<Phil> Should I file a bug -report?
16:03:19FromDiscord<ringabout> Yeah, a fix can cause more bugs/regressions.
16:05:33FromDiscord<ringabout> I confirmed that it causes this bug./
16:06:53FromDiscord<Phil> I'll file a bug report
16:07:03FromDiscord<ringabout> Nice
16:11:03*Notxor quit (Remote host closed the connection)
16:11:34FromDiscord<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:30FromDiscord<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:11FromDiscord<ringabout> It is a pity that norm doesn't support 2.0 yet, otherwise the CI will have caught the regression.
16:13:39FromDiscord<ringabout> I disabled norm testing in the important packages.
16:14:56FromDiscord<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:33FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4p57
16:15:56FromDiscord<ieltan> In reply to @Isofruit "Syntax may be slightly": the syntax i used was `import norm/sqlite except log`
16:15:59FromDiscord<Phil> I found either pretty trivial, so in that case seems like a case of me sticking with the stdlib
16:16:07FromDiscord<Phil> Wait, when tf would norm export log
16:16:09FromDiscord<Phil> Give me a sec
16:16:32FromDiscord<Phil> Hot dang, it does export private.log
16:16:46FromDiscord<sOkam!> Yeah if you know one, I doubt there is much reason to change to the other
16:17:02FromDiscord<ieltan> In reply to @Isofruit "Hot dang, it does": it shouldnt do that i suppose
16:17:06FromDiscord<ieltan> its in private folder
16:17:37FromDiscord<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:14FromDiscord<Phil> So that your dimscord stuff calls a proc and the part of your code you need norm/sqlite for is elsewhere
16:18:58FromDiscord<ieltan> i will give it a try
16:19:08FromDiscord<Phil> You could also open a ticket in the norm repo that it should deal with logging without exporting it
16:19:26FromDiscord<Phil> That's more in the long-term
16:19:32FromDiscord<Phil> (edit) "in" => "for"
16:20:01FromDiscord<ringabout> Why `except log` didn't work?
16:20:45FromDiscord<ringabout> That doesn't make sense.
16:21:05FromDiscord<Phil> A minimal code example would indeed be nice
16:21:53FromDiscord<ieltan> i could try `import norm/private except log` but i am not sure it will work
16:22:22FromDiscord<ringabout> What are your imports?
16:22:34FromDiscord<ieltan> do we have a `import x except all` perhaps ?
16:23:03FromDiscord<ringabout> from x import nil
16:23:18FromDiscord<Phil> Code example my guy, code example! 😛
16:23:53FromDiscord<ieltan> sent a code paste, see https://paste.rs/PTK
16:23:56FromDiscord<ringabout> In reply to @ringabout "from x import nil": enforces qualified imports
16:24:28FromDiscord<ieltan> In reply to @ringabout "from x import nil": i'll go back to one file and try this out thanks
16:26:42FromDiscord<Phil> sent a code paste, see https://paste.rs/g7F
16:27:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p5c
16:27:42FromDiscord<ieltan> `imported and not used: 'log' [UnusedImport]nim(nimsuggest chk)`
16:27:54FromDiscord<ieltan> after doing `from norm/private/log import nil`
16:28:09FromDiscord<ieltan> `norm/private` doesnt work i have to specify log
16:28:54FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4p5e
16:29:29FromDiscord<ieltan> In reply to @Isofruit "Some of the source": sure lemme copy a snippet
16:30:36FromDiscord<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:59FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4p5h
16:32:04FromDiscord<ieltan> as you can see, it's dumb simple that a bloke like me can understand
16:32:12FromDiscord<ieltan> but it supposedly still errors out
16:32:22FromDiscord<ringabout> Where?
16:32:40FromDiscord<ieltan> nim suggest also freaks out for supposedly no reason: https://media.discordapp.net/attachments/371759389889003532/1078716101246074960/image.png
16:32:48FromDiscord<ieltan> ;/
16:32:48FromDiscord<Phil> @ringabout The issue here is that norm doesn't bind the `log` proc from `private/log`
16:32:57FromDiscord<Phil> norm does not export private/log
16:32:59FromDiscord<ieltan> In reply to @ringabout "Where?": not in MY code
16:33:02FromDiscord<ringabout> It compiles.
16:33:08FromDiscord<Phil> HOWEVER, the insert proc etc. are generics
16:34:05FromDiscord<ringabout> Then, use `import dimscord except log`.
16:34:17FromDiscord<ringabout> (edit) "use" => "using" | "log`." => "log` should work."
16:34:25FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p5j
16:34:38FromDiscord<Phil> That log proc is from `private/log` (which compiles out the log call given a specific flaag)
16:34:44FromDiscord<Phil> (edit) "flaag)" => "flag)"
16:34:51FromDiscord<ringabout> Is it intended? Otherwise use `bind` or something.
16:34:55FromDiscord<Phil> That proc is not bound properly apparently
16:35:28FromDiscord<ieltan> so
16:35:30FromDiscord<ieltan> for some reason
16:35:39FromDiscord<Phil> Yeah, `bind log.log` would do it here
16:35:47FromDiscord<ieltan> some private log is contaminating my code
16:35:50FromDiscord<Phil> Or rather `bind log`
16:35:58FromDiscord<ieltan> and prevents it from compiling
16:36:11FromDiscord<ieltan> In reply to @Isofruit "Yeah, `bind log.log` would": Can i do that ?
16:36:16FromDiscord<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:32FromDiscord<Phil> That's a change in the norm codebase
16:37:29FromDiscord<ieltan> how can i make my code compile then
16:37:43FromDiscord<ringabout> @ieltan using import dimscord except log should work.
16:37:44FromDiscord<ieltan> i think maybe pinning norm to a previous commit should do it ?
16:38:01FromDiscord<ringabout> (edit) "import" => "`import" | "log should" => "log` might"
16:41:12FromDiscord<spoon> do arc/orc dlls still depend on nimrtl.dll?
16:41:29FromDiscord<ieltan> In reply to @ringabout "<@256520101015060480> using `import": it did, thanks !
16:42:05FromDiscord<ieltan> @Phil may i inquire your help for the last time ?
16:42:11FromDiscord<ieltan> its about norm again
16:42:41FromDiscord<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:00FromDiscord<Phil> Should suffice to do it to insert, update, delete, read, select and createTables procs etc.
16:43:05FromDiscord<ringabout> In reply to @spoon "do arc/orc dlls still": No
16:43:11FromDiscord<ieltan> lemme check something
16:43:12FromDiscord<spoon> nice
16:44:32FromDiscord<spoon> <https://nim-lang.org/docs/nimc.html#dll-generation> this part of the docs should be updated then
16:45:45FromDiscord<ringabout> True
16:45:49FromDiscord<spoon> is there a github page for docs or is it generated?
16:46:09FromDiscord<ringabout> In reply to @spoon "is there a github": Yeah https://github.com/nim-lang/Nim/edit/devel/doc/nimc.md#L1
16:46:19FromDiscord<ringabout> There is an edit btton on the page
16:46:43FromDiscord<ringabout> https://nim-lang.github.io/Nim/nimc.html#dll-generation
16:46:48FromDiscord<ringabout> https://media.discordapp.net/attachments/371759389889003532/1078719658473037974/image.png
16:47:38FromDiscord<spoon> ah so it is part of the compiler page
16:48:32FromDiscord<ringabout> Postive
16:55:25FromDiscord<spoon> ah, i imagine the process for compiling a dll would be different since there's no need to link it
16:55:35FromDiscord<spoon> is there a different compiler flag for compiling standalone?
16:58:29FromDiscord<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:53FromDiscord<spoon> ah can use `--app:lib`
17:57:09*arkurious joined #nim
18:12:25*xet7 joined #nim
18:27:35FromDiscord<Phil> My stance on my bugticket about `[_]` has firmly solidified
18:27:57FromDiscord<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:08FromDiscord<Phil> (edit) "is." => "is and then acting on that."
18:28:16FromDiscord<4zv4l> what's `[_]` ?
18:29:25FromDiscord<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:54FromDiscord<Phil> Now the question is, should this be that way or should it work as before?
18:30:11FromDiscord<4zv4l> why using `_` over `T` ?
18:30:31FromDiscord<Phil> In some generics, you really do not care about the actual type
18:30:55FromDiscord<Phil> To make that very clear, you declare that type as `_`
18:31:16FromDiscord<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:28FromDiscord<Phil> (edit) "behaviour," => "usage of syntax,"
18:32:20FromDiscord<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:50FromDiscord<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:46FromDiscord<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:25FromDiscord<4zv4l> well for example I used to think↵`_ = someFuncThatReturnSomething()` is a good idea↵but↵`discard someFuncThatReturnSomething()` is actually better
18:35:19FromDiscord<Phil> Actually, let me check if that works on new devel
18:36:07FromDiscord<Phil> Yeah `let _ = 5` and `proc x(_: int) = echo "potato"` still work
18:37:01FromDiscord<Lanky Lemur> sent a code paste, see https://play.nim-lang.org/#ix=4p5X
18:40:28FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p5Y
18:41:01FromDiscord<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:30FromDiscord<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:30FromDiscord<Lanky Lemur> What is dynamic dispatch?
18:43:14FromDiscord<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:15FromDiscord<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:50FromDiscord<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:01FromDiscord<Phil> (edit) "use"-basis" => "use it"-basis"
18:44:11FromDiscord<Phil> (edit) "jtv," => "jtv!" | "jtv!I was rummaging around ... how" added "in my head on"
18:44:25FromDiscord<Phil> (edit) "a" => "an"
18:44:41FromDiscord<jtv> LOL no problem
18:47:07FromDiscord<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:22FromDiscord<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:39FromDiscord<Phil> (edit) "Bla2`" => "Bla`"
18:47:44FromDiscord<jtv> Or you can convert it to a root object if there's only ever the one method
18:47:51FromDiscord<jtv> RootObj(ex)
18:48:08FromDiscord<Lanky Lemur> In reply to @jtv "RootObj(ex)": > RootObj(ex)
18:48:25FromDiscord<Lanky Lemur> (edit) "RootObj(ex)" => "RootObj(ex)↵It did not like it when I tried that"
18:48:49FromDiscord<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:50FromDiscord<jtv> It should but use cast[RootObj](ex) if you need to
18:53:24*derpydoo quit (Quit: derpydoo)
18:58:13FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4p69
18:59:24FromDiscord<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:26FromDiscord<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:11FromDiscord<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:48FromDiscord<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:19FromDiscord<jtv> Or, if they all inherit from rootobj, you need to track the types
19:02:41FromDiscord<jtv> Variants are better
19:02:54FromDiscord<jtv> But aren't always viable
19:02:55FromDiscord<Phil> Yeah, was about to say that if you're tracking the type explicitly anyway then you might as well use variants
19:03:33FromDiscord<Phil> I can see the appeal for methods and dynamic dispatch to solve the entire "throw things together in data structures" issue
19:04:07FromDiscord<Phil> Just that I see little middle ground between "go full blown usage of dynamic dispatch" and object variants ^^
19:05:40FromDiscord<Phil> Though maybe that's my inexperience in actually making use of inheritance in nim talking
19:05:57FromDiscord<jtv> Nah
19:06:45FromDiscord<jtv> I think if it had been me, I'd have done dynamic dispatch via interfaces only, and skipped inheritance
19:06:48FromDiscord<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:04FromDiscord<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:10FromDiscord<jtv> Basically automate all the variant stuff behind the scenes
19:07:45FromDiscord<Phil> So basically there would've been only static dispatch and object variants, just through 2 different APIs?
19:08:08FromDiscord<Phil> (One being classic object variants of now and the second being the one that takes care of stuff behind the scenes)
19:08:15FromDiscord<jtv> Well, no, have you used interfaces in other languages/
19:08:24FromDiscord<Phil> Only java
19:08:36FromDiscord<Phil> As nim only has concepts which only apply to generics
19:08:48FromDiscord<jtv> Same basic thing... you could stick items of different types in an array as long as they implement the interface
19:09:19FromDiscord<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:45FromDiscord<Nerve> I felt my blood boiling a little bit. Did somebody say...Java?
19:11:07FromDiscord<Phil> Yes
19:11:56FromDiscord<Nerve> 👹
19:12:14FromDiscord<Phil> Eh, I stand by my statement that the community around java is worse than the language.
19:13:09FromDiscord<Phil> Like, I'm still not a fan, but it's workable. But god damn those 50 abstractions over every damn problem
19:13:20FromDiscord<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:44FromDiscord<Phil> ~~Don't let BSD users hear you say that!~~
19:14:06FromDiscord<jtv> I've got friends who are FreeBSD maintainers, they know it too 🙂
19:15:41FromDiscord<Phil> 😄 Fair
19:17:26FromDiscord<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:39FromDiscord<jtv> And there, the operational overhead is what's really bad
19:18:40FromDiscord<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:25FromDiscord<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:28FromDiscord<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:05FromDiscord<jtv> sent a long message, see http://ix.io/4p6l
19:27:39FromDiscord<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:21FromDiscord<jtv> At that time, languages you'd consider writing in for real were either interpreted or C/C++ 🙂
19:31:36FromDiscord<Haze System (they/them)> does nimpretty not format indentation? https://media.discordapp.net/attachments/371759389889003532/1078761129565761716/image.png
19:31:42FromDiscord<Haze System (they/them)> (edit) "indentation?" => "indentation or am i doing something wrong?"
19:36:04FromDiscord<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:51FromDiscord<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:05FromDiscord<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:08FromDiscord<Haze System (they/them)> gotcha ty :)
19:38:51FromDiscord<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:28FromDiscord<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:17FromDiscord<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:48FromDiscord<guttural666> (edit) "lacking" => "lacking, my example works but I'm a bit mad that I cannot get " to work"
20:21:41NimEventerNew post on r/nim by LurzMeister: Beginner having a problem, see https://reddit.com/r/nim/comments/11b10a8/beginner_having_a_problem/
20:37:16FromDiscord<SREagle> In reply to @guttural666 "can somebody tell my": `echo html_link[front..back]` gives me `Abhorrent Castigation` - not what you wanted?
20:37:32FromDiscord<guttural666> In reply to @SREagle "`echo html_link[front..back]` gives me": yeah yeah
20:38:32FromDiscord<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:46FromDiscord<SREagle> works a little different than I know regex from perl, I have to admit
20:39:13FromDiscord<guttural666> yeah, something is clashing with Nims escaping of string types? this is just over my head
20:40:16FromDiscord<guttural666> the regex I want part is what I tried out in regex playgrounds online and this should work
20:40:22FromDiscord<guttural666> some prob with the escaping
20:40:33FromDiscord<guttural666> tried \\", tried \\\"
20:40:53FromDiscord<guttural666> doesnt render in Discord: tried triple \ and " and double \ and "
20:42:36FromDiscord<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:10FromDiscord<SREagle> like in your screenshot.. thank the programming gods for OCR g
20:46:46FromDiscord<SREagle> and even the gods aren't perfect : Casttgation - but the rest should match, I think
20:51:58*luis_ joined #nim
21:13:48FromDiscord<halc> In reply to @Haze System "does nimpretty not format": excuse me, what colorscheme are you using?
21:17:08FromDiscord<Haze System (they/them)> In reply to @halc "excuse me, what colorscheme": abyss
21:17:49FromDiscord<halc> I see, thank you
21:18:00FromDiscord<halc> don't love the low contrast but the colours are nice
21:18:15FromDiscord<Haze System (they/them)> yeah some things like colons can be hard to see
21:27:55FromDiscord<4zv4l> Nim default's `int` is `int32` ?
21:28:04FromDiscord<Elegantbeef> No
21:28:07FromDiscord<Elegantbeef> `int` is a platform specific int
21:28:33FromDiscord<ezquerra> sent a code paste, see https://play.nim-lang.org/#ix=4p70
21:28:33FromDiscord<4zv4l> what would be the equivalent to `usize` ?↵to get the biggest `uint` possible on the device
21:28:44FromDiscord<Elegantbeef> `uint`
21:28:44FromDiscord<4zv4l> In reply to @Elegantbeef "`int` is a platform": hmmm
21:28:57FromDiscord<4zv4l> so without precising, it will get as much as it can ?
21:29:01FromDiscord<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:08FromDiscord<4zv4l> the compiler won't try to use a `int8` if it sees that it can ?
21:29:27FromDiscord<Elegantbeef> ezquerra generally it's expression \> result \> return
21:29:39FromDiscord<Elegantbeef> You generally do not want to use return as it creates undesired flow control imo
21:30:01FromDiscord<Elegantbeef> Of course it will not
21:30:42FromDiscord<4zv4l> alright so no type optimization
21:30:45FromDiscord<4zv4l> good to know
21:31:07FromDiscord<Elegantbeef> I do not even know what type optimization means
21:31:21FromDiscord<ezquerra> @ElegantBeef, what do you mean by "undesired flow control"? Do you have an example?
21:31:22FromDiscord<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:35FromDiscord<4zv4l> well if the compiler see that you only use number in range to `int8` it won't 'allocate' an `int32`
21:31:43FromDiscord<Elegantbeef> Using return means you have flow control that depends on the compiler
21:31:54FromDiscord<Elegantbeef> So then use a int8↵(@4zv4l)
21:32:12FromDiscord<Elegantbeef> Whoops
21:32:12FromDiscord<Elegantbeef> I mean depends on runtime logic
21:32:12FromDiscord<Elegantbeef> Was reading 4's message
21:32:13FromDiscord<4zv4l> that's why I was asking about default `int` size
21:32:25FromDiscord<Elegantbeef> I generally avoid return unless it's a optimisation like in a search
21:33:10FromDiscord<halc> I do remember something being mentioned about `result` allowing for some sort of optimization by the compiler
21:33:44FromDiscord<halc> NRVO?
21:38:10FromDiscord<halc> yeah, apparently using `result` guarantees NRVO optimization
21:38:31FromDiscord<Elegantbeef> ATM machine 😛
21:41:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4p72
21:52:11*derpydoo quit (Quit: derpydoo)
22:29:53FromDiscord<halc> In reply to @4zv4l "well if the compiler": is that really optimization? In what sense?
22:32:49FromDiscord<halc> I don't believe that would improve performance, might even decrease it depending on the CPU architecture
22:33:31FromDiscord<halc> And it won't really utilize less memory unless you're packing data, which could also potentially incur a performance hit
22:33:44FromDiscord<halc> I don't believe it's the work of the compiler to choose your types for you
22:33:51FromDiscord<halc> (edit) "your" => "the"
22:35:01FromDiscord<halc> at least not integer sizes
22:39:54*Guest4033 joined #nim
22:42:15FromDiscord<Elegantbeef> Well if you have a collection of these it would be more efficient to the cache
22:44:42FromDiscord<Phil> Beef!
22:44:57FromDiscord<Elegantbeef> il!
22:46:15FromDiscord<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:00FromDiscord<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:28FromDiscord<Elegantbeef> Could just put it inside a `when not defined(owlKettleDemo): brew(...)`
22:48:32FromDiscord<Elegantbeef> I wonder if nimibook has a define
22:48:48FromDiscord<Elegantbeef> If so could use that
22:48:57FromDiscord<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:33FromDiscord<Elegantbeef> raw string literals do not work with escaping↵(@guttural666)
22:49:43FromDiscord<Elegantbeef> `re("{?<....}")`
22:49:48FromDiscord<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:09FromDiscord<Elegantbeef> Oh i agree the compiler should not change types on the fly
22:50:16FromDiscord<Elegantbeef> It's not like `i8` is a complex thing to write
22:50:57FromDiscord<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:44FromDiscord<Elegantbeef> Uhhh I'm saying `\"` does not do what you want inside the \`re"..."\~
22:51:50FromDiscord<Elegantbeef> cause it's a raw string literal
22:52:04FromDiscord<Elegantbeef> Put a space, use parenthesis, do something that makes it not parsed as a raw string
22:53:40FromDiscord<guttural666> In reply to @Elegantbeef "Put a space, use": hmm
22:54:54*advesperacit quit ()
22:54:58FromDiscord<Elegantbeef> !eval echo"\\t"
22:55:05NimBot\\t
22:55:26FromDiscord<Elegantbeef> !eval echo "\\t"
22:55:31NimBot\t
22:55:43FromDiscord<Elegantbeef> Nimbot is mean
22:56:12FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1078812617851805757/image.png
23:00:05FromDiscord<ezquerra> Thanks!
23:01:29FromDiscord<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:44FromDiscord<Elegantbeef> Yes "" also works
23:02:16FromDiscord<Elegantbeef> I'd just use command syntax as it's more reasonable
23:03:13FromDiscord<guttural666> I have no clue why tho
23:03:25FromDiscord<Elegantbeef> Why what?
23:03:31FromDiscord<guttural666> what has " to do with escaping, escaping is by \ is it not
23:03:37FromDiscord<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:46FromDiscord<Elegantbeef> Like i said escaping doesnt work inside string literals
23:03:49FromDiscord<guttural666> why this works
23:03:54FromDiscord<Elegantbeef> so it doesnt see an escape sequence it sees `\`
23:04:26FromDiscord<guttural666> okay, but the escaping (in terms of regex does work for the tail \/a>
23:04:32FromDiscord<Elegantbeef> so you have a raw string literal that is `(?<=\`
23:04:45FromDiscord<Elegantbeef> then it sees a `>)`
23:05:06FromDiscord<guttural666> ah
23:05:32FromDiscord<Elegantbeef> So it turns into `re"(?<=\" > )`
23:05:32FromDiscord<Elegantbeef> Which is invalid code
23:05:58FromDiscord<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:13FromDiscord<Elegantbeef> Put a space after re
23:06:15FromDiscord<Elegantbeef> Like what
23:07:29FromDiscord<Elegantbeef> Works just fine
23:07:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4p7l
23:07:57FromDiscord<Elegantbeef> The string call syntax of `re"..."` uses a raw string literal
23:08:27FromDiscord<Elegantbeef> Command syntax or parenthesis call does not
23:09:00FromDiscord<guttural666> this is what I tried on a regex website ↵regex i want = (?<=">)(.)(?=<\/a>)
23:09:11FromDiscord<guttural666> how do I do code snippets here
23:09:19FromDiscord<Elegantbeef> backticks
23:09:20FromDiscord<guttural666> and this worked perfectly fine
23:09:24FromDiscord<guttural666> thanks
23:09:31FromDiscord<guttural666> `regex i want = (?<=">)(.)(?=<\/a>)`
23:09:55FromDiscord<Elegantbeef> How about `re"""(?<=">)(.)(?=</a>)"""`?
23:10:00FromDiscord<Elegantbeef> I do not use regex so I cannot say much
23:11:30FromDiscord<guttural666> https://media.discordapp.net/attachments/371759389889003532/1078816471666413658/image.png
23:11:34*jmdaemon joined #nim
23:11:34FromDiscord<guttural666> thisseems to work
23:11:51FromDiscord<guttural666> I cant even
23:11:54FromDiscord<guttural666> dunno how
23:12:02FromDiscord<Elegantbeef> Why we just parsing the xml is beyond me
23:12:08FromDiscord<Elegantbeef> Why we arent\
23:12:20FromDiscord<guttural666> I just feel like playing Tekken at 12 years old, just spamming buttons until it works
23:12:33FromDiscord<Elegantbeef> Which works?
23:12:40FromDiscord<guttural666> yours works but why
23:13:01FromDiscord<Elegantbeef> Cause raw string literals exist
23:13:15FromDiscord<guttural666> yes, this is what I researched yesterday night
23:13:16FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#lexical-analysis-raw-string-literals
23:13:38FromDiscord<Elegantbeef> `re"bleh"` is a raw string literal
23:13:45FromDiscord<Elegantbeef> `re "bleh"` is not
23:14:02FromDiscord<Elegantbeef> `re """bleh"""` is a triple string literal, which is a raw string literal but can be multi line
23:14:05FromDiscord<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:09FromDiscord<Elegantbeef> It also doesnt need to escape single characters
23:14:37FromDiscord<Elegantbeef> Ahh thank you 😄
23:15:26FromDiscord<Elegantbeef> Huan someone made a Nim xml parser that operated on the xml adding fields, entries and nodes all without parsing it
23:15:28FromDiscord<Elegantbeef> They used pure regex to do it
23:15:40FromDiscord<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:01FromDiscord<Elegantbeef> I can only say read the manual and learn how strings work
23:16:08FromDiscord<Elegantbeef> I know it's condescending but it's all that you need to do
23:16:44FromDiscord<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:03FromDiscord<guttural666> isn't this an std ergonomics issue, that can be solved somehow?
23:17:06FromDiscord<Elegantbeef> @huantian\: I see that post and raise you https://github.com/abdulbadii/HTML-XML-Operations-Nim
23:17:32FromDiscord<Elegantbeef> It can be solved by people understanding how generalise string literals work
23:18:28FromDiscord<Elegantbeef> It can also be solved by not attempting to use regex to parse html
23:18:40FromDiscord<Elegantbeef> Yes you can just search the html, but cmon parsing it is just more sane
23:19:12FromDiscord<guttural666> it's just not what I do every day, so I use the tools that seem most obvious
23:19:27FromDiscord<guttural666> first with find and rfind from strutils
23:19:30FromDiscord<guttural666> then regex
23:19:38FromDiscord<guttural666> dunno what's the best way
23:20:20FromDiscord<guttural666> I have written config parsers before with c++
23:20:48FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4p7n
23:21:27FromDiscord<Elegantbeef> The best way to interact with data is almost always to parse the data instead of working on it raw
23:22:10FromDiscord<guttural666> by that you mean just going through it char by char and searching for what you are looking for?
23:22:33FromDiscord<Elegantbeef> No I mean giving it to a parser and getting a tree you can easily navigate
23:22:47FromDiscord<guttural666> oh yeah, yeah
23:22:47FromDiscord<Elegantbeef> Unless you mean the raw part
23:22:49FromDiscord<Elegantbeef> Then yes i mean that
23:24:02FromDiscord<guttural666> if you want to get things done yeah haha
23:24:07FromDiscord<Elegantbeef> Point is you see how simple it is to use the stdlib parser
23:24:47FromDiscord<guttural666> yeah, just wasn't aware, I am using the JSON parser to loop over the results of my API call already
23:31:54FromDiscord<guttural666> In reply to @Elegantbeef "Point is you see": thanks again
23:32:01FromDiscord<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)