<< 27-03-2024 >>

00:03:35*pbsds quit (Quit: Ping timeout (120 seconds))
00:04:07*pbsds joined #nim
00:07:43FromDiscord<pri.ivy> is there some way to give an equal amount of whitespace in between strings
00:34:15FromDiscord<albassort> Hewo
00:34:25FromDiscord<albassort> does this work on your machiens? re.match("Escape", re"U[0-9]+")
00:34:30FromDiscord<albassort> (edit) "machiens?" => "machines?"
00:34:42FromDiscord<albassort> I was talking about this last week, im now investigating
00:34:47FromDiscord<albassort> no reason this should default
00:35:11FromDiscord<albassort> Nim version: Version 2.1.1
00:36:33FromDiscord<albassort> (edit) "default" => "segfault"
00:36:54FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=SSYTkTGMVmoW
00:37:04FromDiscord<albassort> (edit) "https://play.nim-lang.org/#pasty=JnVyTUKxeZRw" => "https://play.nim-lang.org/#pasty=dbRYrFDkBlxA"
00:50:06FromDiscord<ta_efimova_19> I need new friends
00:51:05*arkurious joined #nim
00:57:12FromDiscord<albassort> In reply to @albassort "does this work on": I ran it in a debian docker
00:57:18FromDiscord<albassort> seems to work fine
00:57:24FromDiscord<albassort> help
01:03:48FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1222350323637682186/image.png?ex=6615e573&is=66037073&hm=e08bd0f3cf4fd26cb9907513917390972fcbbecb763b22828c19da64176012bc&
01:04:03FromDiscord<albassort> help me after im doing updating my system šŸ˜“
01:05:59FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#pasty=hUECllAcTGSn
01:06:23FromDiscord<patitotective> (edit) "https://play.nim-lang.org/#pasty=WOjqNasnSAwF" => "https://play.nim-lang.org/#pasty=JOdiAkTEDxXP"
01:06:57FromDiscord<Elegantbeef> Nope a C++ map has more information
01:07:36FromDiscord<Elegantbeef> You will need to use `importcpp`
01:07:50FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#importcpp-pragma-importcpp-for-objects
01:09:11FromDiscord<patitotective> In reply to @Elegantbeef "https://nim-lang.org/docs/manual.html#importcpp-pra": Oops, missed it. Perfect example
01:09:16FromDiscord<patitotective> (edit) "example" => "example, thanks"
01:18:33*jmdaemon quit (Ping timeout: 268 seconds)
01:28:15FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#pasty=pzWGuePufEZr
01:28:54FromDiscord<Elegantbeef> You could submodule the c++ then just use that path always
01:46:05*jmdaemon joined #nim
01:52:47*jmdaemon quit (Ping timeout: 264 seconds)
02:04:33*Mister_Magister quit (Ping timeout: 256 seconds)
02:04:54FromDiscord<m4ul3r> sent a code paste, see https://play.nim-lang.org/#pasty=LzzGRRYYMZHz
02:05:07FromDiscord<m4ul3r> (edit) "https://play.nim-lang.org/#pasty=rbTunbEZKdid" => "https://play.nim-lang.org/#pasty=HKyBARuyPcEO"
02:08:31*Mister_Magister joined #nim
02:26:35FromDiscord<patitotective> In reply to @Elegantbeef "Nope a C++ map": Likewise, can a `std::string` be represented as a `cstring` or do I have to do the same (`{.importcpp: "std::string".}`)?
02:26:55FromDiscord<Elegantbeef> You need to import
02:40:46FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#pasty=WuMJJBuGbKvn
02:40:52FromDiscord<patitotective> Let me upload it to github
02:43:07FromDiscord<patitotective> Here it is https://github.com/Patitotective/boletin_abast/blob/main/src/trial.nim
02:44:15FromDiscord<patitotective> Maybe it has something to do with `Paragraph` being an `object of Box`, not sure if c++ inheritance can be translated just like that
02:45:14*krux02_ quit (Remote host closed the connection)
03:15:45*xutaxkamay quit (Ping timeout: 255 seconds)
03:16:17*xutaxkamay joined #nim
03:18:25FromDiscord<demotomohiro> You can learn about C++ here: https://en.cppreference.com/w/cpp
03:19:05FromDiscord<eebahn> whats the equivalent of `gorge` for runtime?
03:21:57FromDiscord<eebahn> nvm, found it! `osproc.execProcess( "cmd" )`
03:22:48FromDiscord<patitotective> In reply to @demotomohiro "You can learn about": Thanks :]
03:28:13*dtomato7 joined #nim
03:29:36*dtomato quit (Ping timeout: 268 seconds)
03:29:36*dtomato7 is now known as dtomato
03:44:44*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
03:45:06*SchweinDeBurg joined #nim
03:50:46*arkurious quit (Quit: Leaving)
04:19:26NimEventerNew thread by ITwrx: Glaucus Linux, see https://forum.nim-lang.org/t/11301
04:24:31FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=KugmvYDnugAO
05:36:48*advesperacit joined #nim
07:45:57FromDiscord<ezquerra> sent a code paste, see https://play.nim-lang.org/#pasty=unuNinOeHngC
07:46:31FromDiscord<ezquerra> Then I could have another version of the procedure for other combinations or as a fallback
07:50:43*ntat joined #nim
08:00:09FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=zBDvXKNZhTDX
08:05:43FromDiscord<ezquerra> Thank you @demotomohiro. In this particular example, that is the way I would do it, but for more complex conditions regular overloads result in a combinatorial explosion of functions
08:06:18FromDiscord<ezquerra> Functions which in many cases have the exact same body
08:07:10FromDiscord<ezquerra> I hoped there was some way to constrain the types on the function definition itself, i.e. to specify a relationships between type T and type K
08:23:54NimEventerNew Nimble package! jsonpak - Packed ASTs for compact and efficient JSON representation, with JSON Pointer, JSON Patch support., see https://github.com/planetis-m/jsonpak
08:42:30FromDiscord<whisperecean> Hello does anybody know how I can fix this https://play.nim-lang.org/#pasty=dtlecoAWYkRH. I get a segmentation fault when the config file does not exist
08:44:47FromDiscord<Elegantbeef> Check if the file exists first and have a toctou race condition
08:49:02FromDiscord<whisperecean> The thing is I thought that one of the points of that library was to check this for me based on the fact that it's InputFile https://github.com/status-im/nim-confutils/blob/master/confutils.nim#L501
08:49:05FromDiscord<whisperecean> but it just segfaults
08:56:13*ntat quit (Quit: Leaving)
09:05:20FromDiscord<arnetheduck> In reply to @whisperecean "Hello does anybody know": looks like a bug in faststreams, a repro/bug report would be in order
09:11:05FromDiscord<whisperecean> Ok I'll do it. Anything i can do to circumvent the problem in the meantime? Here's my build flags "-d:nimOldCaseObjects", "--mm:refc", on M1 mac
09:12:20NimEventerNew thread by scippie: Cross compilation to Windows, linker error (unrecognized option '-z', see https://forum.nim-lang.org/t/11302
09:18:28FromDiscord<arnetheduck> In reply to @whisperecean "Ok I'll do it.": I guess you can use `addConfigFileContent(readFile(yourfile))` instead of `addConfigFile` which skips the buggy part
09:18:38FromDiscord<arnetheduck> (edit) "In reply to @whisperecean "Ok I'll do it.": I guess you can use `addConfigFileContent(readFile(yourfile))` instead of `addConfigFile` which ... skips" added "(probably)"
09:20:18*modev joined #nim
09:20:20*modev left #nim (#nim)
10:02:20FromDiscord<whisperecean> I created an issue on github
10:02:49*xet7 quit (Remote host closed the connection)
10:11:21*Jjp137 quit (Ping timeout: 268 seconds)
11:32:06*Lord_Nightmare quit (Ping timeout: 255 seconds)
11:44:15*fallback quit (Ping timeout: 255 seconds)
11:45:10*modev joined #nim
11:45:37*modev quit (Client Quit)
11:53:03*fallback joined #nim
11:56:42NimEventerNew thread by lollinux: Access operator on distinct type of array, see https://forum.nim-lang.org/t/11304
12:23:50*Jjp137 joined #nim
12:32:30*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
12:46:55FromDiscord<sOkam! šŸ«> is there a way to get the field names of an object into a seq, using a function and not a for loop? šŸ¤”
12:49:13FromDiscord<odexine> Youā€™ll have to make the function
12:50:37*modev joined #nim
12:51:01*modev quit (Client Quit)
12:51:06FromDiscord<sOkam! šŸ«> sent a code paste, see https://play.nim-lang.org/#pasty=iudVhhBCisyt
12:56:17*ntat joined #nim
13:50:35NimEventerNew thread by chaemon: Strange behavior of global variable in 2.0, see https://forum.nim-lang.org/t/11307
13:50:40*SchweinDeBurg joined #nim
14:04:29*xutaxkamay quit (Ping timeout: 240 seconds)
14:08:40*modev joined #nim
14:08:47*modev quit (Client Quit)
14:08:59*modev joined #nim
14:09:00*modev quit (Client Quit)
14:09:15*modev joined #nim
14:09:28*modev quit (Client Quit)
14:09:43*modev joined #nim
14:09:46*modev left #nim (#nim)
14:12:47*xutaxkamay joined #nim
15:04:36*Lord_Nightmare joined #nim
16:07:14FromDiscord<patitotective> Finally got the minidocx binding working! I ended up doing it by hand, so I have only wrapped 4 functions but it actually generates a docx file! Still, I have to make the compiler find the source/header files without using the full path, maybe using `getCurrentDir`... And while I'm just going to use this for my project, I plan to wrap all of minidocx and publish it as a library https://github.com/Patitotective/boletin_abast/blob/mai
16:38:24FromDiscord<fosster> does anyone know what even `IOSelectorsException` is?
16:40:33*xet7 joined #nim
16:42:46*krux02 joined #nim
16:50:11FromDiscord<demotomohiro> https://github.com/search?q=repo%3Anim-lang%2FNim%20IOSelectorsException&type=codeā†µIt seems related to this proc:ā†µhttps://github.com/nim-lang/Nim/blob/devel/lib/pure/selectors.nim#L276
16:55:07FromDiscord<fosster> mh thanks
17:27:36*def- quit (Quit: -)
17:28:51*def- joined #nim
17:36:35*advesperacit quit (Ping timeout: 268 seconds)
17:50:21*advesperacit joined #nim
17:52:35NimEventerNew thread by Nlits: Logarithm Implementation Tutorial, see https://forum.nim-lang.org/t/11308
18:40:07FromDiscord<morgan> sent a code paste, see https://play.nim-lang.org/#pasty=BDCYyaRydyog
18:41:06FromDiscord<morgan> tldr of the lldb screenshot, which doesn't show all of the relevant steps, it gets to the function, does some internal nim stuff, gets to the lock, does lock stuff, and exits
18:55:47*ntat_ joined #nim
18:56:08*ntat quit (Ping timeout: 268 seconds)
18:56:09*ntat_ quit (Read error: Connection reset by peer)
18:57:27*ntat_ joined #nim
19:00:35*ntat_ quit (Client Quit)
19:00:54*ntat joined #nim
19:44:53FromDiscord<michalkap> sent a code paste, see https://play.nim-lang.org/#pasty=dRMolWHmfPpS
19:51:06FromDiscord<intellij_gamer> Have a feeling it's to do with you accessing the global. `onRequest` needs the be GC safe iircā†µYou can just indent the access to it under a `{.gcsafe.}`
19:53:24FromDiscord<michalkap> In reply to @intellij_gamer "Have a feeling it's": how?
19:53:34FromDiscord<michalkap> i don't really understand
19:54:55FromDiscord<intellij_gamer> sent a code paste, see https://play.nim-lang.org/#pasty=uJRUTBLpgmMX
19:58:16FromDiscord<Phil> sent a long message, see https://pasty.ee/CPRqfNhyThvh
19:58:28FromDiscord<michalkap> In reply to @isofruit "> type mismatch >": it's the full thing
20:00:16FromDiscord<Phil> Ah, I see, yeah your proc "onRequest" does not match what it's expecting.ā†µIt's expecting sth with the type `OnRequest`. Your proc takes something the type of `Request`
20:00:29FromDiscord<michalkap> sent a code paste, see https://play.nim-lang.org/#pasty=CSCMsQjLdhVL
20:00:57FromDiscord<Phil> sent a long message, see https://pasty.ee/owAhwgUSVomd
20:01:21FromDiscord<Phil> So the expression it expects does neither return anything, nor does it take a parameter of type `Request`
20:02:16FromDiscord<michalkap> Error: undeclared field: 'httpMethod' for type httpx.OnRequest [type declared in httpx-0.3.7-6e0fc3133fbd20530d53ab2792e93d3151387b10/httpx.nim(79, 3)]
20:02:17FromDiscord<Phil> @ringabout Might know more on this, I never used httpx directly
20:02:26FromDiscord<michalkap> (edit) "https://play.nim-lang.org/#pasty=dahMXGLJQxjs" => "https://play.nim-lang.org/#pasty=HprwiTIJoaxt"
20:07:14FromDiscord<Phil> I'd try to compile, but I can't evne install that god damn markdown dependency without nimble blowing up on me
20:07:16FromDiscord<Phil> Holy shit
20:07:25FromDiscord<Phil> (edit) "evne" => "even"
20:07:43FromDiscord<Phil> (edit) "that god damn" => "the"
20:08:45FromDiscord<Phil> Okay, I stand corrected, it compiles if you just don't access the global variables
20:08:46FromDiscord<Phil> (edit) "variables" => "variable"
20:10:11FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=iiTPGXcPTbUX
20:10:50FromDiscord<Phil> But that's kind of a given with jester given the amount of macro magic it does and thus it may be generating code that is entirely unexpected for you
20:11:10FromDiscord<Phil> (edit) "But that's kind of a given with jester ... given" added "and friends"
20:11:31FromDiscord<Phil> Though maybe I'm just talking out my ass here, my brain is toast from work daily nowadays
20:24:54FromDiscord<michalkap> sent a code paste, see https://play.nim-lang.org/#pasty=KYLqNeylwYYM
20:25:03FromDiscord<michalkap> thanks to all of you
20:25:08FromDiscord<michalkap> sent a code paste, see https://play.nim-lang.org/#pasty=gCbQXaHshKFE
20:27:41*rockcavera quit (Read error: Connection reset by peer)
20:35:18*rockcavera joined #nim
20:44:58*ntat quit (Quit: Leaving)
21:38:29*advesperacit quit ()
22:09:27*zgasma quit (Quit: Lost terminal)
22:56:30FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#pasty=DwlBwEiUgIMq
22:58:28FromDiscord<Robyn [She/Her]> Wish the better comments extensions worked with Nim multiline comments
22:59:06FromDiscord<Robyn [She/Her]> It sort of does but not nicely?
22:59:18FromDiscord<Robyn [She/Her]> You need a `TODO:` for every line, which imo is a bit ugly
23:01:29FromDiscord<patitotective> In reply to @patitotective "Hi, I'm a bit": If anyone wants to help me, here's are the files you can use to reproduce it https://github.com/Patitotective/minidocx-nim
23:02:22FromDiscord<patitotective> (edit) "here's" => "here"
23:03:53FromDiscord<Robyn [She/Her]> Does it matter if I use a `TableRef` or `Table` in a ref object? Assuming yes, but not in a way that'll matter much
23:04:59FromDiscord<Robyn [She/Her]> Heap vs stack, I'm assuming
23:05:16FromDiscord<Robyn [She/Her]> Well, obviously
23:05:43FromDiscord<Robyn [She/Her]> But in a ref object, would be a pointer to the heap or stack depending on which one I use
23:08:11FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#pasty=cEOOqkNxsWQD
23:10:24FromDiscord<Robyn [She/Her]> Hm... Should I use a `Session` object to store a user's last login with a certain session ID, or should I store it as JSON data?
23:11:12FromDiscord<Robyn [She/Her]> A session object seems better purely because it lifts the load off of my chat application and onto the database
23:14:27FromDiscord<jviega> Most of the contents of a table are going to be in the heap no matter what.
23:18:35FromDiscord<Robyn [She/Her]> 'Most'? But thanks!
23:19:28FromDiscord<jviega> Yes, since tables resize depending on additions and subtractions, that requires dynamic allocation, and you wouldn't be able to free up stack space (which is somewhat limited)
23:19:43FromDiscord<jviega> Nim's tables are pretty terrible thop
23:21:22FromDiscord<Robyn [She/Her]> Oh? Why are they terrible? Idk much about them
23:21:38FromDiscord<Robyn [She/Her]> In reply to @chronos.vitaqua "A session object seems": But yeah I decided to just use a `Session` object instead
23:23:06FromDiscord<jviega> Well, the fact that you have separate constructs for stack vs heap isn't awesome, but: 1) It also requires seprate data structures for ordered vs not, and 2) does not handle concurrent access.
23:24:45FromDiscord<Robyn [She/Her]> That makes sense, thanks!
23:26:20FromDiscord<jviega> If you really need something there, we've got a project that has a decent hash table (called `Dict[]`, but it wouldn't be straightforward to use it w/o some effort
23:27:53FromDiscord<Robyn [She/Her]> That's fine, thanks though! I'm going to use a `Session` object instead, though I'll still need to figure out how to protect against multithreading, probably a global lock manager? šŸ¤·ā€ā™€ļø
23:28:15FromDiscord<Robyn [She/Her]> I still need to learn more about multithreading honestly, I'm way too used to asyncdispatch aha
23:29:05FromDiscord<bosinski2023> In reply to @jviega "If you really need": i'd like to take a look at `Dict[]`.
23:29:11FromDiscord<jviega> Yeah ours is lock free so will avoid memory corruption, etc. but that doesnā€™t solve lots of state problems
23:29:40FromDiscord<Robyn [She/Her]> Makes sense
23:29:47FromDiscord<Robyn [She/Her]> (edit) "multithreading," => "concurrent access,"
23:30:28FromDiscord<jviega> Well the biggest problem is thereā€™s a C dependency that isnā€™t published in a way thatā€™s easy to build yet (I wrote it in C a few years ago but wrapped it in Nim)
23:30:49FromDiscord<Robyn [She/Her]> Oh I think I might of seen that a while ago actually
23:31:04FromDiscord<grumblygibson> How to remove `-lpthread` in nim's call to gcc? I'm cross compiling to windows zig and supplying my own mingw libpthread. Nim spits out the huge gcc call that fails, and I can run that call without the trailing `-lpthread` and it succeeds. Is there a way I can automate this The Right Way instead of grabbing the string output and removing the `-lpthread` etc. as I am doing?
23:31:36FromDiscord<jviega> I donā€™t know why you would have cause itā€™s buried in our bigger projects šŸ™‚
23:32:01FromDiscord<jviega> Thereā€™s a flag to turn off threads, should be in the docs under flags
23:32:18FromDiscord<grumblygibson> `--threads:off` disables threading through the entire nim app, but I need threading.
23:33:12FromDiscord<grumblygibson> Fails to compile with `...requires --threads:on for this to build`
23:33:15FromDiscord<jviega> Oh you just need to not have pthreads linked
23:33:49FromDiscord<jviega> Hmm what platform?
23:33:56FromDiscord<grumblygibson> on linux
23:34:48FromDiscord<jviega> I feel like I remember doing that once
23:35:30FromDiscord<grumblygibson> That's the sage advice I'm here for :p I'm waiting with baited keyboard. šŸ˜†
23:36:58FromDiscord<grumblygibson> Maybe there's a better way to do this. I'm using `--os:windows` and calling zig to produce a windows binary. So it's actually kinda weird that nim still tacks on `-lpthread` since I'm saying "dude, I want windows c code..."
23:37:26FromDiscord<jviega> Generally if you pass -os it should get it right
23:37:46FromDiscord<grumblygibson> but I guess that's controlled by `--cc:` which I have set to `gcc` and then overridden it with zig so thar be dragons.
23:38:13FromDiscord<Robyn [She/Her]> In reply to @grumblygibson "but I guess that's": If you're using Zig, make sure to use `--cc:clang`
23:38:30FromDiscord<Robyn [She/Her]> Not related to your issue probably, but yeah
23:39:48FromDiscord<grumblygibson> sent a code paste, see https://play.nim-lang.org/#pasty=zRBuYJfXNuHi
23:40:42FromDiscord<grumblygibson> No, I'm just guess. I'm out of my confort zone here.
23:40:48FromDiscord<grumblygibson> (edit) "guess." => "guessing."
23:41:36FromDiscord<jviega> I guess Iā€™d add my own wrapper that strips off the flag then :/