00:07:55*Kaivo quit (Quit: WeeChat 2.4)
00:09:43*Kaivo joined #nim
00:11:44FromGitter<jrfondren> so asyncstreams.read works by assigning the stream callback so that the next write() will complete the future that .read is now returning.
00:14:18FromGitter<jrfondren> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5cdcab5abdc3b64fcf52b0ce]
00:14:54FromGitter<jrfondren> @dirsuptek there you go. see, it's not a bug at all. your read is handled immediately by which I mean soon.
00:16:06FromGitter<jrfondren> the 'soon' isn't 500ms later. it's actually pretty close to immediately after. but there's always a poll() after the 'soon'.
00:31:20*theelous3 quit (Ping timeout: 246 seconds)
00:32:59FromGitter<jrfondren> https://gist.github.com/jrfondren/abeaef41b69b149945d325c34936f697 - updated with a fix and timings in the comment.
00:33:20*theelous3 joined #nim
00:33:58disruptekthink i'll stick with sync, thanks.
00:40:57FromDiscord<Avatarfighter> discord previews are on point today
00:42:31FromDiscord<Avatarfighter> https://prnt.sc/np55yo
00:42:37FromDiscord<Avatarfighter> ^ what i mean lol
00:42:49*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
00:43:27FromGitter<jrfondren> the tiny image is pretty much the essence of that link, aye
00:43:52FromDiscord<Avatarfighter> the image is the true eye candy to the gist haha
01:00:19*stefanos82 quit (Remote host closed the connection)
01:01:29FromDiscord<Avatarfighter> Stupid question, how do you make a table hold any type as a value?
01:06:44FromGitter<jrfondren> you can't.
01:07:25FromGitter<jrfondren> what you can do instead is define a variant type AnyType and then make that your value, which means runtime checking every time you fetch a value to see what its actual type is.
01:07:45FromGitter<jrfondren> I believe there are some packages in nimble that provide an AnyType that might be more convenient
01:08:20FromGitter<jrfondren> ... I don't remember what it's called. I saw it in passing.
01:08:51FromGitter<jrfondren> if your actual need is to have one of a small set of types, your own variant will be easy
01:09:34FromDiscord<Avatarfighter> Yeah I just need to handle a specific set of types, I just don't know what or how I should make an "AnyType"
01:10:01FromGitter<jrfondren> alright one sec
01:10:05FromGitter<kayabaNerve> Inheritance.
01:10:18FromGitter<kayabaNerve> type x = ref object of RootObj
01:10:28FromGitter<kayabaNerve> type y = ref object of x
01:10:55FromGitter<kayabaNerve> Add an enum of possible types, save a value from there to X, cast as needed
01:12:14FromDiscord<Avatarfighter> huh, I'll try that
01:13:03FromDiscord<Avatarfighter> Thank you 😃
01:14:18FromGitter<jrfondren> ah if only Nim dispatched off return types as well as parameter types, like Ada.
01:14:50FromGitter<jrfondren> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5cdcb98ada34620ff94b7bf0]
01:14:53FromGitter<jrfondren> then that would actually work :p
01:18:19FromGitter<jrfondren> this is what I was talking about: https://gist.github.com/jrfondren/44fb942087502336eac4c9e5471e729c
01:19:58FromDiscord<Avatarfighter> That seems pretty straightforward, I just need to rewrite some stuff to handle this kind of thing, i'm ngl i'm pretty excited for when i put all this code together \:). Thank you jrfondren
01:31:29FromGitter<jrfondren> #11263 created for that async stuff.
01:53:54FromGitter<kayabaNerve> A case statement doesn't allow named subtypes
01:54:07FromGitter<kayabaNerve> It is cast-less though
01:54:18FromGitter<kayabaNerve> And a Generic doesn't preserve the master type
02:01:11*banc quit (Quit: Bye)
02:06:21*rnrwashere quit (Remote host closed the connection)
02:11:43*laaron quit (Remote host closed the connection)
02:15:12*rnrwashere joined #nim
02:17:47*rnrwashere quit (Remote host closed the connection)
02:19:56*ftsf joined #nim
02:22:37*banc joined #nim
02:29:49*laaron joined #nim
03:01:16*rockcavera quit (Ping timeout: 246 seconds)
03:05:20*theelous3 quit (Ping timeout: 246 seconds)
03:09:02*dddddd quit (Remote host closed the connection)
03:12:22*rockcavera joined #nim
03:22:07*Tanger quit (Quit: Leaving)
03:24:59*Tanger joined #nim
03:51:09*gangstacat quit (Ping timeout: 250 seconds)
04:14:30*rnrwashere joined #nim
04:17:30*rnrwashere quit (Remote host closed the connection)
04:23:11*nsf joined #nim
04:42:27*leorize quit (Remote host closed the connection)
04:42:56*leorize joined #nim
04:46:54*narimiran joined #nim
04:55:13*rnrwashere joined #nim
04:59:39*rnrwashere quit (Ping timeout: 248 seconds)
05:01:12*cyberjpn joined #nim
05:12:07FromDiscord<Avatarfighter> Do case statements with enums with holes not work?
05:12:39FromDiscord<Avatarfighter> I'm getting the error `selector must be of an ordinal type` but I'm a bit perplexed as to why
05:13:03FromDiscord<Avatarfighter> https://hastebin.com/vupuwuxahi.js if anyone is interested
05:16:42*leorize quit (Quit: WeeChat 2.3)
05:25:45*cyberjpn quit (Remote host closed the connection)
05:28:49*rnrwashere joined #nim
05:36:35*cyberjpn joined #nim
05:45:10rayman22201preliminary support for Nim in Godbolt working: https://imgur.com/se1mU6j
05:47:18rayman22201What works: compiling nim.
05:47:18rayman22201What doesn't work: everything else lol
05:52:14*leorize joined #nim
05:58:15*cyberjpn quit (Remote host closed the connection)
06:02:54leorize[m]@Avatarfighter: see https://nim-lang.github.io/Nim/manual#types-enumeration-types
06:03:23leorize[m]> An explicit ordered enum can have holes ... However, it is then not an ordinal anymore ...
06:03:26*solitudesf joined #nim
06:03:40*krux02 joined #nim
06:04:06leorize[m]but I don't think the ordinal requirement is really needed for case object :/
06:08:48*arecaceae quit (Remote host closed the connection)
06:09:08*arecaceae joined #nim
06:18:03leorizenarimiran: how often does nimsuggest crashes for you?
06:18:51*ftsf quit (Remote host closed the connection)
06:19:06*ftsf joined #nim
06:26:01rayman22201debugger:native "almost" gives Godbolt enough info to do code -> asm highlighting correctly lol
06:26:49*PMunch joined #nim
06:29:09*solitudesf quit (Ping timeout: 252 seconds)
06:30:16*Summertime quit (Quit: Sunsetting.)
06:31:05FromGitter<jrfondren> Cool
06:31:45*Summertime joined #nim
06:33:36leorizerayman22201: I think you'd only need --lineDirs:on?
06:36:54*jjido joined #nim
06:41:17rayman22201Nope. Tried that. wasn't sufficient.
06:42:00rayman22201I thought the same thing. I'm not sure why lineDirs:on isn't enough
06:43:45PMunchOkay, trying to deploy the new playground now :)
06:44:01leorizerayman22201: try passing --passC:'-g'
06:44:24leorizemaybe debuginfo have to be embedded into the resulting object files?
06:45:35PMunchHmm, devel doesnt seem to build atm..
06:46:59leorizePMunch: I saw localhost in the frontend code :P
06:47:21PMunchOh right, good catch!
06:48:15leorizeyou should really store it in a const
06:49:07leorizenarimiran: just made a new feature that should reduce the amount of nimsuggest instance running, would you like to take a testdrive?
06:49:39narimiranleorize: of course :)
06:50:19narimiranand i don't know how often does it crash
06:50:44PMunchleorize, well in production it should just use relative URLs
06:50:54PMunchBut that didn't work when I opened it as a file in my browser
06:51:02leorizenarimiran: see :messages and count the number of "exited with error code 1" :P
06:51:07leorizePMunch: use jester :)
06:51:13leorizeserve it with jester :P
06:51:18PMunchThat's what the actual server does
06:51:24PMunchI was just lazy while testing this :P
06:51:44PMunchI even had the jester instance running locally, it would've just been a matter of moving the files over
06:52:27leorizelaziness strikes
06:52:45leorizenarimiran: please checkout the session-resume branch of nim.nvim
06:53:22leorizethis should attempts to revive nimsuggest when it dies instead of spawning a new one at the current location
06:53:28narimiranleorize: ok, and what am i looking for? just count open nimsuggest instances?
06:54:13leorizeyea, it should only use 1 per project
06:54:43*Vladar joined #nim
06:55:01leorizenote: a project is the directory containing the first file you open, any subdir will reuse this instance
06:55:33narimiranok, will try it
07:00:00*gmpreussner quit (Quit: kthxbye)
07:02:39FromGitter<gogolxdong> wrote a simpler SQL composer demo like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5cdd0b0f7c363c75a7ea5d93]
07:04:19leorizenice, maybe you could try expanding ormin to support mysql?
07:04:32leorizeit already sports a query building engine
07:04:44*gmpreussner joined #nim
07:04:50PMunchSince I couldn't build devel through choosenim (and Karax needs devel ATM) I manually installed the new frontend in a directory if anyone wants to try it https://play.nim-lang.org/newfrontend/index.html
07:05:53leorizenice, but you should try hiding the index.html part :)
07:06:00PMunchAnd the link format has changed, so a tour is now linked to like this: https://play.nim-lang.org/newfrontend/index.html#tour=https://play.nim-lang.org/tours/example.html
07:06:52PMunchleorize, that's just because I manually put in there, you can go to: https://play.nim-lang.org/newfrontend/ as well
07:08:04leorizeit doesn't work without the trailing slash
07:09:33*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:11:05PMunchHmm, seems to be down to it not finding the CSS and JavaScript
07:11:43leorizenow the only cool thing left that the playground needs is output streaming from the server
07:12:10PMunchHmm, yeah
07:12:43PMunchThat's a tricky one though..
07:12:48leorizeafter that you can even go further and implements terminal emulation :D
07:13:21PMunchLet's not get too carried away here :P
07:14:56leorizeI think you could use websockets for data streaming?
07:25:15*NimBot joined #nim
07:25:32leorizethe logo doesn't appear without the trailing /
07:25:36*jjido joined #nim
07:25:51narimiranleorize: i have tested it. when i'm careful which file i open first, it is just one instance of nimsuggest, but:
07:26:34narimiran...if i save a session with multiple windows and buffers, and then i do `nvim -S`, i immediately get multiple nimsuggests
07:28:04leorizethat's a feature I don't use...
07:28:13leorizeI'll try to think of a way to combat that
07:28:35narimiranwell i guess it is the same if i manually open multiple files in "wrong order"
07:28:52leorizewell there aren't any easy way to detect a project :P
07:29:16narimiran.nimble file?
07:29:58leorizewalking directories is a synchronous operation, so with the rate of nimsuggest dying this is not a nice choice
07:30:33*rnrwashe_ joined #nim
07:30:53PMunchleorize, should be fixed once the cache is updated :)
07:30:54livcdPMunch: good job
07:31:05PMunchlivcd, thanks :)
07:31:12PMunchIt's pretty much exactly the same as the old one
07:31:19PMunchJust in Karax this time
07:31:41livcdi get a huge cloudflare error
07:31:42livcdfor ix
07:31:51livcdcant wait for your karax write up
07:32:01leorizenarimiran: ofc, you could try to extend `nimble path` to return the path to the project file :)
07:32:16leorizealso it should work everywhere within the project
07:32:28PMunchlivcd, cloudflare error?
07:32:49PMunchThis works fine for me: https://play.nim-lang.org/newfrontend#ix=1Hwy
07:33:53*rnrwashere quit (Ping timeout: 250 seconds)
07:33:56narimiranleorize: in the above scenario with multiple NS, i kill all of them and then try suggestions in "root file" first, and other files later - multiple NS again :/
07:34:33leorizeuse :call nim#suggest#ProjectStop()
07:34:43leorizeor else the session resume feature will just resurrect them
07:35:10Mister_Magistercan i use nim inside c++ program?
07:35:57narimiranleorize: did that, still the same. but this is getting offtopic, we can continue privately....
07:41:15*madpat joined #nim
07:52:41livcdPMunch: https://imgur.com/a/sXX1svF
07:59:32PMunchlivcd, hmm, and what did you try to do?
07:59:41PMunchDo you have any more information in the console?
07:59:47*leorize quit (Ping timeout: 256 seconds)
08:01:39*solitudesf joined #nim
08:01:42*leorize joined #nim
08:03:00FromGitter<dom96> Pmunch: why are you abusing hashes for what the URL Param have been invented for?
08:03:12FromGitter<dom96> *params
08:04:30leorizeimo it's easier to use with karax
08:05:31leorizealso, having both `tour` and `ix` params make no sense at all :P
08:05:46*madpat quit (Ping timeout: 252 seconds)
08:06:15FromGitter<dom96> Why is it easier?
08:06:42PMunchMosly because Karax has the hash in "RouterData" but no other information
08:07:17PMunchAnd yeah, what leorize said about the tour and ix at the same time, but that was an accidental discovery after the fact :P
08:08:13*floppydh joined #nim
08:11:32*madpat joined #nim
08:12:28*rnrwashe_ quit (Remote host closed the connection)
08:15:27*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:18:22*madpat quit (Remote host closed the connection)
08:23:03*hoijui joined #nim
08:27:28*disruptek quit (Ping timeout: 258 seconds)
08:29:44*Gertm joined #nim
08:29:50*disruptek joined #nim
08:35:15*neceve joined #nim
08:35:51*JustASlacker joined #nim
08:44:17*Vladar quit (Ping timeout: 244 seconds)
08:47:23*ftsf quit (Ping timeout: 244 seconds)
08:54:16*beatmox_ quit (Remote host closed the connection)
08:55:11poopBothmm about websockets
08:55:12poopBotWS negotiation failed: no advertised protocol supported; server speaks `myfancyprotocol`
08:55:12poopBotWS negotiation failed: the only supported sec-websocket-version is 13
08:55:34poopBotdo i have to change myfancyprotocol to 13 or am i doomed
08:55:47poopBotlet (ws, error) = await(verifyWebsocketRequest(req, "myfancyprotocol"))
08:56:37*beatmox joined #nim
08:58:20poopBotoh guess i am doomed or meybe i can change client websocket too to 13
09:00:19Araqmaybe it's not hard to support more protocols for websockets.nim
09:01:02poopBotwill focus on gamelogic first guess can expand on that leater
09:03:19livcdPMunch: maybe it's my corporate network
09:03:30livcdPMunch: just clicked on share on ix
09:04:48*laaron quit (Remote host closed the connection)
09:06:58*laaron joined #nim
09:07:17*laaron quit (Remote host closed the connection)
09:07:47*laaron joined #nim
09:12:41AraqSTRIKE! finally #11239 works. Now I only have to detect/fix all the regressions...
09:13:16narimiranhttps://github.com/nim-lang/Nim/issues/11239 this one?
09:14:19*rayman22201 quit (Quit: Connection closed for inactivity)
09:14:33Araqyeah and also other overloading resolution problems
09:18:33Araqand ... the tests are ...
09:19:24Araq.. the tension reaches unbearable levels ...
09:19:34narimiranqueued :D
09:19:52Araqgreen except for a single one
09:20:52Zevvso, was this always broken?
09:20:58*Vladar joined #nim
09:23:45AraqZevv, at least of a couple of years
09:25:14*ftsf joined #nim
09:25:28Zevvinteresting that it didn't pop up earlier and there were no tests for it, it feels like a very obvious thing
09:25:38Zevvbut noone ran into it
09:25:50AraqI'm sure it was reported before
09:26:05Araqbut it's also un-generic programming aka bad style
09:26:54Araqwhy would you specialize stuff like that? it means your generic T is not valid for string
09:28:07FromGitter<alehander42> well it's a form of overloading
09:28:29*Gertm left #nim ("Leaving")
09:28:49Araqthat's just a word, if you want to specialize the implementation there are two reasons for this:
09:29:18Araq1. it doesn't do the right thing for 'string'
09:29:28Araqif so, better use [T: not string]
09:29:38Araq2. you think you can optimize it
09:30:06Araqif so, better use a 'when' statement in the generic it's clearer than misusing the overload resolution mechanism for it
09:30:22FromGitter<alehander42> yeah, but what if you have many cases: string, int etc
09:30:41Araqthen you don't have a "generic" implementation
09:30:41FromGitter<alehander42> can you even write not about them
09:30:55FromGitter<alehander42> but you can still have a default for the other types
09:32:29Araqwell please tell me about a valid use case, I'm not seeing it
09:34:24Araqremember that the specialization of vector<bool> in C++ is now widely regarded as a mistake
09:36:55*laaron quit (Remote host closed the connection)
09:37:57*laaron joined #nim
09:39:00PMunchlivcd, that is strange. It works fine for me here..
09:42:31livcdwould anyone have an idea how I can hide the powershell.exe window ? :X...i am executing a ps script from my nim app
09:45:19PMunchWell nim has the --app:gui to hide the console
09:45:29PMunchNot sure if that applies to scripts called by the program though..
09:45:38PMunchOtherwise I guess it depends on how you call them
09:46:31livcdthat does not work because I am calling explicitly powershell.exe from execCmd
09:52:25PMunchPowerShell.exe -windowstyle hidden { your script.. }
09:52:30PMunchAccording to StackOverflow
09:54:33livcdunfortunately that's not it :/
09:58:28*ftsf_ joined #nim
09:58:58*ftsf__ joined #nim
10:01:19*ftsf_ quit (Read error: Connection reset by peer)
10:02:07*ftsf_ joined #nim
10:02:13*ftsf quit (Ping timeout: 258 seconds)
10:05:03*ftsf__ quit (Ping timeout: 245 seconds)
10:07:12*laaron quit (Remote host closed the connection)
10:09:01*ftsf_ quit (Quit: Leaving)
10:09:14*laaron joined #nim
10:14:14*rnrwashere joined #nim
10:18:33*rnrwashere quit (Ping timeout: 250 seconds)
10:20:07*clyybber joined #nim
10:29:28*lritter joined #nim
10:30:03*leorize quit (Quit: WeeChat 2.3)
10:34:40FromGitter<kaushalmodi> https://lobste.rs/s/dnahfo/nim_programming_language_version_0_19_6#c_den659
10:41:40PMunchHmm, anyone have any good phone recommendations?
10:41:58PMunchMy trusty OnePlus One is starting to show its age..
10:42:35PMunchProbably didn't help that I dropped it in the sink under running water yesterday so I had to take the entire thing apart to get the speaker (and hence my alarm) to work again..
10:43:33FromGitter<kaushalmodi> Pixel 3
10:45:17FromGitter<kaushalmodi> I loved my OnePlus One too, which coincidentally, I lost to water as well .. I went swimming with my son with the phone in my swim shorts
10:45:40clyybberpocophone f1, though you might want to flash lineage on it
10:45:48clyybberto get rid of the bloatware/spyware
10:46:21*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
10:47:11PMunchclyybber, yeah I was looking at the Pocophone yesterday
10:47:13*laaron joined #nim
10:48:16PMunchHmm, the Pixel 3 lacks a mini-jack and has a smallish battery..
10:48:47PMunchThe Pocophone has such a huge notch though..
10:49:03PMunchI wish they'd just remake the One with better internal specs..
10:49:54PMunchThe grippy texture on the back is great, battery life is great (at least when it was new), and the flash anything and stay within warrenty was cool (not that I ever used it)
10:56:57PMunchHmm, the Pocophone looks nice
10:57:19PMunchAnd price-wise :P
11:01:52*dddddd joined #nim
11:13:11narimiranleorize[m]: i have an indentation bug to report when you're here :)
11:18:08*leorize[m] waves
11:18:46narimirancome on irc so i can bother you privately :D
11:18:58leorize[m]PMunch: pixel 3a, the full-featured pixel
11:21:23leorize[m]narimiran: private messages work here too :)
11:21:39PMunchleorize[m], ooh, the 3a actually looks like a good deal
11:21:52PMunchNo silly noth, headphone jack, good camera, fairly cheap
11:21:56FromGitter<kaushalmodi> PMunch: Pixel 3 lasts me one day plus
11:22:04FromGitter<kaushalmodi> I have never needed to charge it midday
11:22:51FromGitter<kaushalmodi> Camera is great (the beat I've used on a phone) on Pixel 3; is believe that 3a would be the same
11:23:09FromGitter<kaushalmodi> The Night Shot feature is not a gimmick; it's really awesome
11:23:32ZevvPMunch: phone: https://store.planetcom.co.uk/products/gemini-pda-1
11:23:41FromGitter<kaushalmodi> Btw, about Nim, are the package names supposed to be case-insensitive?
11:23:52FromGitter<kaushalmodi> Ref: https://github.com/nc-x/crafty/pull/1
11:24:31FromGitter<kaushalmodi> Apparently, they are style-insensitive on Windows, but case-sensitive on Linux
11:25:12FromGitter<kaushalmodi> Araq: please see above question about package identifier case-sensitivity on Linux.
11:25:57*gangstacat joined #nim
11:26:19narimirankaushalmodi it is known
11:26:59narimirankaushalmodi see stdlib modules and you'll see `naming_like_this.nim` but not `usingCamelCase.nim`
11:30:30PMunchZevv, if I were to get a Planet phone I think I'll hold off for the Cosmo: https://www.indiegogo.com/projects/cosmo-communicator#/
11:34:41Zevvmakes sense. I'm still pretty heppy with the gemini, only thing is the camera is barely usable
11:37:08Araqkaushalmodi: on Unix we attempt the module name as you wrote it followed by trying it in alllowercase
11:38:45Araqby the convention is snake_case_everywhere.nim
11:41:23PMunchZevv, wait you actually have a Gemini?
11:41:28*hoijui quit (Ping timeout: 264 seconds)
11:43:25Zevvfor about a year. Its not perfect but amazing how they pulled that off
11:45:32FromGitter<kaushalmodi> Araq: Coincidentally, today another Windows vs Linux thing came up on lobsters: https://lobste.rs/s/dnahfo/nim_programming_language_version_0_19_6#c_den659
11:46:48livcdhmm i think I need a serious guide to threads
11:47:00narimiranlivcd: who doesn't? ;)
11:47:14livcdnarimiran: maybe Araq
11:47:43narimiranbtw, here is a not-so-serious guide, disguised as a game: https://deadlockempire.github.io/
11:48:04leorize[m]newruntime will make threading life easier :)
11:49:28*tdc quit (Remote host closed the connection)
11:49:30Zevvnarimiran: well that is a fun way of teaching things
11:49:47livcdnarimiran: oh i meant with Nim
11:49:54*tdc joined #nim
11:50:09Zevvbetter then they way I once learned it - figuring out at 02.30 at night why the hell my interrupt handler code sometimes misbehaves
11:50:49*solitudesf quit (Ping timeout: 246 seconds)
11:51:04PMunchI have a fairly solid grasp on both Nim and threads in C, but threads in Nim still confuses me..
11:51:09Araqkaushalmodi: I don't care what the internet thinks about Windows vs Linux, I know enough of both systems to have an informed opinion on my own
11:51:46PMunchZevv, neat. Isn't it a bit big though? And do you actually use the keyboard and/or linux on it?
11:52:36AraqPMunch, threading in Nim is pretty simple, you use createThread on global vars and you use channels as global vars for communication. everything else pretty much doesn't work
11:53:38Araqbut hey, it's a lovely shared-nothing architecture that SCALES (TM) (better never benchmark anything though)
11:54:37PMunchHaha, yeah I've done a thing or two with threads in Nim. But they just seem odd to use, I always feel like I'm doing it wrong
11:55:27Araqthat's good, I also planned a compiler switch --verify to give you move of this feeling
11:55:55FromGitter<kaushalmodi> Araq: It's not about opinion; I'm genuinely curious how other languages deal with symlinks
11:56:15Araq--verify would verify your code automatically, it's pretty simple, the compiler would always say "I am sorry, I cannot compile this Dave, it has a bug somewhere"
11:56:37FromGitter<kaushalmodi> I can see myself creating a similar issue like that symlink support issue.
11:56:41livcdkaushalmodi: is not that an old gh issue ?
11:56:50FromGitter<kaushalmodi> Yes, it is
11:57:17FromGitter<kaushalmodi> Talking about that because it surfaced in a lobste.rs thread
11:57:48PMunchAraq, great feature!
11:59:47*cyberjpn joined #nim
12:02:09clyybberkaushalmodi: Fix it :) shouldn't be too hard
12:04:40Araqbefore you "fix" it, create a good test case for it
12:05:02Araqextra points when I can still checkout the tests/ directory on Windows
12:06:15Araqextra points if I can later on still *add* new test files on Windows
12:10:28*livcd quit (Remote host closed the connection)
12:13:36*JustASlacker quit (Ping timeout: 268 seconds)
12:18:47FromGitter<kaushalmodi> The first step would be to create that issue again so that we can track it. While I not be capable to fix this myself, I will attempt to investigate which part of the stdlib is causing this.
12:19:39Araqfor me the bug report was a cry for medical help.
12:20:29FromGitter<jrfondren> as in, "Doctor, when I do this, it hurts" ?
12:20:37Zevv"don't do that"
12:22:24Araq"after I've setup my system in the most convoluted way I cannot get any work done, please help me"
12:33:36*Snircle joined #nim
12:38:04poopBotwmm in nvim , when i write example rank:int it shows autocmpleti for int and only way to continue is to write a whiespace or am i using it worng
12:42:10narimiranpoopBot: you can type anything
12:44:29poopBotyep but mainly i just want to Enter to go new line
12:44:51poopBotbut Enter dosent work so i do 1 whitespace then Enter like tard :)
12:45:29narimiranfor me it does. i guess you need to tweak some setting
12:45:49poopBotfor me Enter is to pick form autocmople form what i see
12:47:02poopBotfor OOP do i need to write alwes Person = object of type RootObj , atm i just write Person = object and i think it wokrs
12:49:58*cyberjpn quit (Ping timeout: 246 seconds)
12:53:55clyybberAraq: Should I make "var a = @[1]" generate "var a; var tmp = @[1]; `=move`(a, tmp)" or just a simple assignment?
12:55:43*sacredfrog joined #nim
12:56:58clyybberbecause previously, it was apparently mapped to "var a; `=sink`(a, @[1])"
12:59:36Araqwhat would the "simple assignment" be? keep in mind that the assignment can be in a loop and then you need to free the old seq
13:02:27clyybberhmm, yeah. The problem rn is that seq literals are NIM_CONST in the generated C code, so are generating segfaults upon trying to move.
13:04:16FromGitter<mratsim> sometimes I'd like to have a seq be materialized in the BSS segment of the binary. When I'm usin them for table implementations of transcendatal functions like exponential or logarithm.
13:04:26FromGitter<mratsim> const seq*
13:04:50FromGitter<mratsim> right now I'm forced to use `var` and I can't use no-sideeffect/func
13:05:47FromGitter<alehander42> but why can't you use a const array
13:05:55FromGitter<alehander42> const seq cant change, right?
13:09:38FromGitter<jrfondren> a seq needs an accumulator. that's a pointer though so it could be 0, so you could have a const seq.
13:09:55FromGitter<mratsim> it's the same. const array/seq only exist in the VM and have no address
13:10:12*cyberjpn joined #nim
13:10:22FromGitter<mratsim> if you index them, the compiler will directly inline the value needed
13:10:37FromGitter<jrfondren> ah, different problem.
13:11:09FromGitter<mratsim> See: https://github.com/numforge/laser/blob/master/laser/primitives/simd_math/exp_log_common.nim#L40-L46
13:11:59FromGitter<mratsim> And it's used there: https://github.com/numforge/laser/blob/master/laser/primitives/simd_math/exp_log_avx512.nim#L62
13:12:18FromGitter<mratsim> but the proc can't be noSideEffect due to accessing a global var :/
13:12:36FromGitter<mratsim> it's just a small issue anyway.
13:17:41FromGitter<jrfondren> maybe `func getx: int = {.gcsafe.}: x` should work.
13:17:56FromGitter<mratsim> ah yeah, right
13:18:04FromGitter<jrfondren> it doesn't now
13:18:58FromGitter<mratsim> well since this will be mostly used in an OpenMP multithreaded context, and OpenMP proc cannot be noSideEffect, ultimately it's fine.
13:19:12FromGitter<jrfondren> I guess noSideEffects is the stronger guarantee so that shouldn't work in general, but it could at least work in the case where the only side effects are global variable accesses
13:20:16Araqyou can use a {.noSideEffect.}: block in devel
13:21:17FromGitter<mratsim> yipeeh! :p
13:21:28*enthus1ast joined #nim
13:21:29FromGitter<jrfondren> ah cool
13:22:38enthus1astcan i trigger exec() from nimble file when i do "nimble install" ?
13:23:14enthus1astso that i could execute shell commands after the nimble install procedure
13:24:07*sacredfrog quit (Ping timeout: 255 seconds)
13:24:20enthus1ast"after install" ...
13:25:48FromGitter<jrfondren> I don't think so, but I haven't checked for sure. What commands are you wanting to run?
13:26:12Zevventhus1ast: the problem is that you can not rely on shell commands if someone does your nimble thing on windows
13:26:25enthus1ast"git submodule init" and "git submodule update"
13:26:26FromGitter<jrfondren> depending on what you need to do, for a library, you might have an {.error.} at compile-time to warn the user to do something
13:26:39*PMunch quit (Remote host closed the connection)
13:27:13enthus1astit seems that "after install:" does what i want
13:27:38FromGitter<jrfondren> sir, please keep language "git submodule" in the seedy bar or the alley-way where it belongs
13:28:33enthus1asttoo much slang for me :D
13:28:37FromGitter<jrfondren> I would surprised if "after install" does what you want because on install, most of your repo has already been discarded by nim
13:28:52FromGitter<jrfondren> *by nimble
13:29:42enthus1astthe thing is, this is an installer for an internal webchat that is divided into multiple submodules. Most of the public functionality is done in submodules.
13:29:48*sacredfrog joined #nim
13:29:52FromGitter<jrfondren> maybe nimble should --recurse-submodules when it does a git clone, instead
13:30:24FromGitter<jrfondren> yeah, all I know about git submodules is that they steal candy from children and push old ladies in front of cars
13:30:28Araqsounds like you're misusing 'nimble' for 'niminst'
13:31:32FromGitter<jrfondren> https://nim-lang.github.io/Nim/niminst.html
13:32:23enthus1astbut then it's not an git repo
13:32:42poopBothmm, duckducking a video share site sux, i need somesite that wont blure my video, like some hastbin
13:33:19FromGitter<jrfondren> well you said you found something that works for you. if it doesn't, I think either nimble can be modified in one direction or another to support git submodules, or you can use nimble dependencies instead of submodules. Your deps don't need to be in the nimble repository, you can link them like `requires "https://github.com/walkre-niboshi/nim-ncurses >= 0.1.0"`
13:34:58*nsf quit (Quit: WeeChat 2.4)
13:35:09poopBothttps://streamable.com/1vjcr here my nvim autocomple issue
13:36:39narimiranpoopBot: have you tried pressing right arrow before enter?
13:36:41enthus1astok it does not work for me because it is executed from .pkg path :D
13:36:59poopBothm am trying to stop using arrow but can try
13:37:06narimiranpoopBot: and have you tried searching for "disable enter as tab completion"?
13:37:28poopBotyep right arrro works
13:37:50poopBotdidn not :)
13:38:05*Gertm joined #nim
13:40:41*theelous3 joined #nim
13:42:06enthus1astok thanks guys for your help! Soon i'll change it to requires as you've mentioned jrfondren, and i'll play with niminst Araq, but for now "before install" helps me
13:43:29Araqsure, np
13:43:58*livcd joined #nim
13:48:04poopBotnarimiran, hmm i didnet find any anwer, is there any way i can just make it like if i duble enter it goes next row i can probbaly do it with that keybinds stuff if there is some way to detect first if autocomplet is open, so i do it like if autocompletopn, fast EnterEnter = <Esc> Enter
13:48:15poopBotor <Esc> I Enter
13:48:40leorize[m]how did you configure your nvim?
13:49:22leorize[m]also, you can record terminal sessions with asciinema
13:51:26poopBotmy conf
13:56:31poopBotand i just got stuck
13:56:39poopBotwhile autocomplet was opening
13:57:43poopBotit now ignores all input
13:58:31poopBotlol it freezed for 20 sec and now its back and i done all jdkhasjkdhajs i typed while i was Wtfking
13:58:47*cyberjpn quit (Ping timeout: 246 seconds)
13:58:58narimiranpoopBot: have in mind this is #nim, not #neovim ;)
13:59:44narimiranthey might know better how to fix your enter problem
14:07:53*Gertm left #nim ("Leaving")
14:08:12Zevv /join #neonim
14:09:47FromDiscord<Avatarfighter> Oofers so I couldn't figure out how to fix my issue where an emun with holes wasn't being considered an ordinal so I just manually made a case statement handling all my stuff, not as optimal as I would've liked it but w/e
14:10:06Araquse an enum without holes
14:10:16FromDiscord<Avatarfighter> lmao
14:10:17Araqwill produce better code anyway
14:11:05FromDiscord<Avatarfighter> I shall note that down 😛
14:13:16*krux02 quit (Remote host closed the connection)
14:13:20*Vladar quit (Remote host closed the connection)
14:16:43poopBotnarimiran, no respone thare, tought 1 simple fast question, how do people move trough autocomplete if no key arrows?
14:18:00FromDiscord<Avatarfighter> Dang I would've liked an enum here bc it would've slightly more readable haha
14:18:00FromDiscord<Avatarfighter> https://cdn.discordapp.com/attachments/371759389889003532/578586952249376788/unknown.png
14:18:27narimiranpoopBot: i use 'supertab' plugin, which allows me to use tab for moving through autocomplete, and i can freely use enter for going to a new line
14:20:49*Trustable joined #nim
14:26:59livcdi am so dumb with nim :/
14:27:11livcdi do not know how to translate this in Nim and it's so simple https://glot.io/snippets/fc9r1hs0av
14:27:13*federico3 pats livcd
14:28:30FromGitter<mratsim> Are you trying to access an username that wasn't properly erased from memory?
14:29:21FromGitter<gogolxdong> Do you feel exception stacktrace loose some key frame?
14:29:22FromGitter<mratsim> the first 2 lines are let buffer = newSequint16 (256)
14:29:39FromGitter<mratsim> the first 2 lines are let buffer = newSeq\uint16\ (256)
14:29:53FromGitter<mratsim> @gogolxdong it's not feel, it's concrete truth
14:30:23livcdmratsim: just trying to use this https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getusernamew
14:30:37FromGitter<mratsim> the 3rd line is procGetuserName(buffer[0].addr, buffer.len)
14:30:37FromGitter<gogolxdong> a known issue?
14:30:56FromGitter<mratsim> I don't think anyone submitted a minimal example
14:31:11FromGitter<mratsim> When I minimize stuff the frames tends to be good again :/
14:31:22poopBotnarimiran, yey now i can enter ty :)
14:32:09poopBottough i still feel 10 time slower then using vscode, i am mostly editing in insert mode that bad or what?
14:33:24narimiranpoopBot: go through vimtutor and some other tutorials; buy 'practical vim' book; solve vimgolf challenges; practice on your own
14:35:52livcdmratsim: that does not work :/ GetUserNameW wants LPWSTR
14:37:50FromGitter<mratsim> You need to define LPWSTR somewhere: ⏎ ⏎ type LPWSTR {.importc, header:"<foo.h>".} = something
14:38:32FromGitter<mratsim> I suppose it's a cstring
14:38:50FromGitter<mratsim> or UncheckedArray[int16]
14:39:36*sz0 joined #nim
14:40:19FromGitter<mratsim> For reference, if you want to alloc raw buffer here is how to do it: https://github.com/numforge/laser/blob/master/laser/tensor/allocator.nim#L24
14:40:33FromGitter<mratsim> type is here https://github.com/numforge/laser/blob/master/laser/tensor/datatypes.nim#L26
14:40:55FromGitter<mratsim> You can use alloc, alloc0, allocShared, allocShared0
14:41:06FromGitter<mratsim> The 0 variant of for initialization with 0
14:41:31FromGitter<mratsim> don't forget the +1 to size for the \0 byte
14:45:10poopBothmm how do i make object have a tuple
14:45:12poopBot PokerTable = object
14:45:12poopBot deck52:seq[Card]
14:45:12poopBot on_t:seq[Card]
14:45:12poopBot blinds:[int,int]
14:45:27poopBotblinds ^^ that wont work
14:45:46narimiranblinds: tuple[a, b: int]
14:46:03*laaron quit (Remote host closed the connection)
14:46:07poopBotty i tryed tuple[int,int] but now i get why it ident wokr too :)
14:47:11narimiranyou can also do `blinds: (int, int)` if you want anonymous tuple
14:47:54*rnrwashere joined #nim
14:48:18narimiran(..., ...) syntax is like an "international sign for tuples" :P i havent seen [..., ...] used for it never (but maybe i haven't looked hard enough)
14:48:54*jxy quit (Quit: leaving)
14:49:46*laaron joined #nim
14:49:51*JustASlacker joined #nim
14:50:23*rnrwashere quit (Remote host closed the connection)
14:50:38*rnrwashere joined #nim
14:50:42poopBotnewb power forewer :)
14:54:54*laaron quit (Remote host closed the connection)
15:00:04livcdmratsim: thanks. I am using winim for this but i am a retard when it comes to those types / casting and passing.....
15:04:23*jxy joined #nim
15:06:03*rnrwashere quit (Remote host closed the connection)
15:06:37*rnrwashere joined #nim
15:06:47shashlickwinim is broken on devel
15:08:15*enthus1ast quit (Ping timeout: 256 seconds)
15:08:42livcdbut i did not update
15:09:00livcdso i have something like this and this gives me 4 characters of the username :D https://glot.io/snippets/fc9s6hhgk0
15:11:06*rnrwashere quit (Ping timeout: 252 seconds)
15:11:44*laaron joined #nim
15:12:09shashlickTry ascii call
15:17:15*couven92 joined #nim
15:19:30*fredrik92 joined #nim
15:20:16livcdhmm that works
15:20:22livcdbut i do not know what I am doing :D
15:21:03*rayman22201 joined #nim
15:21:28*natrys joined #nim
15:22:20*fredrik92 quit (Client Quit)
15:25:38*leorize joined #nim
15:31:49shashlickHaven't yet figured out how to convert to Nim string
15:41:33*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
15:41:55*laaron joined #nim
15:49:08*enthus1ast joined #nim
15:53:17*sacredfrog quit (Ping timeout: 258 seconds)
16:00:13*sacredfrog joined #nim
16:03:42*JustASlacker quit (Ping timeout: 258 seconds)
16:11:36*ng0 joined #nim
16:20:03leorizeWString is a wide string I think, then it'd need to be converted to seq[Rune] before turning into `string`
16:20:58*rnrwashere joined #nim
16:25:51*rnrwashere quit (Ping timeout: 264 seconds)
16:36:28*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
16:36:39*enthus1ast quit (Ping timeout: 256 seconds)
16:38:39couven92Do we have something that does fuzzy string matching?
16:39:11couven92I am thinking on how to do it, and realizing that it is a fairly complicated problem... :O
16:39:59shashlickuse fts_fuzzy_match - works nicely for me in feud - https://github.com/genotrance/feud/blob/master/wrappers/fuzzy.nim
16:40:35shashlickhere's how i use it - https://github.com/genotrance/feud/blob/master/plugins/server/file.nim#L86
16:42:30*laaron quit (Remote host closed the connection)
16:42:30couven92shashlick, huh... that's a lot of C++ :O, thanks... I'll look into it
16:44:25narimirancouven92: we do, our search in the documentation :)
16:44:57*laaron joined #nim
16:45:06couven92narimiran, do we use the same as shashlick suggested?
16:45:55narimirancouven92: see tools/dochack/fuzzysearch.nim
16:47:48couven92Hmmm... nice! Now I get to port it to C#, yaih! Sry, writing C# right now, but I actually use stuff from Nim to make it great! :D
16:48:19couven92Learned a few tricks when dealing with strings when I did some of the Unicode stuff in stdlib...
16:49:15couven92Like, linear-overhead Levenshtein
16:59:11*nsf joined #nim
17:03:15*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
17:03:59*laaron joined #nim
17:07:54*floppydh quit (Quit: WeeChat 2.4)
17:11:42*laaron quit (Remote host closed the connection)
17:15:11*laaron joined #nim
17:28:11*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
17:28:34*laaron joined #nim
17:29:56*rnrwashere joined #nim
17:31:10*theelous3 quit (Ping timeout: 252 seconds)
17:32:19*stefanos82 joined #nim
17:33:03*rnrwashere quit (Remote host closed the connection)
17:35:42*rnrwashere joined #nim
17:38:59*theelous3 joined #nim
17:41:05*rnrwashere quit (Remote host closed the connection)
17:44:27*sacredfrog quit (Ping timeout: 258 seconds)
17:56:53*Trustable quit (Remote host closed the connection)
17:57:14*neceve quit (Remote host closed the connection)
18:04:05*solitudesf joined #nim
18:05:44poopBotleorize, hmm should this nim plugin for neovim show me erros like vscode
18:06:30poopBotdo i need to install some plugin for that too
18:06:59poopBotcuz atm i can wirte any garbage stuff and it dosent mark any error or anything
18:07:32shashlickPerhaps use ale
18:14:26*nsf quit (Quit: WeeChat 2.4)
18:17:39*hoijui joined #nim
18:20:21*rnrwashere joined #nim
18:23:52leorizepoopBot: yea, you'd need some plugin for that
18:24:32leorizenimsuggest would provide a bit of this info as part of the highlighting (red background/white text/depends on your colorscheme)
18:25:21leorizeso far there's ALE and neomake. I don't know much about this field because I never use this function
18:25:52*xet7 quit (Quit: Leaving)
18:26:01*sacredfrog joined #nim
18:33:25*rnrwashere quit (Remote host closed the connection)
18:45:06*rnrwashere joined #nim
18:49:05*rnrwashere quit (Remote host closed the connection)
18:50:13*rnrwashere joined #nim
18:50:25*rnrwashere quit (Remote host closed the connection)
18:51:00*rnrwashere joined #nim
18:52:16*rnrwashere quit (Remote host closed the connection)
18:52:32*rnrwashere joined #nim
18:59:10*rnrwashere quit (Remote host closed the connection)
19:07:36*xet7 joined #nim
19:07:56*PrimHelios quit (Quit: ZNC - https://znc.in)
19:08:12*PrimHelios joined #nim
19:10:38*rnrwashere joined #nim
19:11:44*rnrwashere quit (Remote host closed the connection)
19:13:36*rnrwashere joined #nim
19:15:14*jjido joined #nim
19:16:48*rnrwashere quit (Remote host closed the connection)
19:19:25*jjido quit (Client Quit)
19:28:05*rnrwashere joined #nim
19:28:14*rnrwashere quit (Remote host closed the connection)
19:28:34*rnrwashere joined #nim
19:28:52*jjido joined #nim
19:32:03*sacredfrog quit (Ping timeout: 268 seconds)
19:39:52poopBothow to clear list before refill :)
19:40:54narimiranwhy does it have to be "clear"?
19:40:58rayman22201This is probably an Araq or a Krux02 question, is there a way to demangle nim function names from C / asm? I'm working on Godbolt support for Nim...
19:41:27poopBot PokerTable = object
19:41:28poopBot 25 deck52:seq[Card]
19:41:49narimiranpoopBot: do not paste multiple lines here. use some pasting service
19:42:02rayman22201@leorize, `passC:-g` worked btw
19:42:31poopBotsorry i frogot this no discord cant redit xD, hmm when i create an object like this is deck 52 done as let or var or do i need to manly specify for each?
19:44:48narimirancan you change it? (this is a question that you should ask yourself) yes you can. (this is the answer you need to test by yourself) it is a var. (this is the conclusion that you would come up with)
19:45:14rayman22201also, philosophical question, should I hide nim runtime functions in Godbolt, or leave them shown? I.E. initStackBottomWith, PreMain, etc...
19:46:10narimiranrayman22201: it's great to hear that somebody is working on godbolt support!! bravo!
19:46:13*xace quit (Remote host closed the connection)
19:46:13FromGitter<jrfondren> showing's better. it's a compiler explorer after all. you want to see what's going on. that said, I don't know how it looks with all that.
19:46:56rayman22201@narimiran :-) It's a project I have been thinking about for a while. I decided to just say screw it and dive in.
19:47:05poopBot'pt.deck52' cannot be assigned to
19:47:22poopBoti tryed deck52= newSeq(Card)
19:47:30rayman22201@jrfonden, I'm inclined to agree with you, but I wanted to get some other opinions
19:47:32FromGitter<jrfondren> poopBot, so you probably want a var then
19:48:04poopBotthats why i asked when i make objects is it let or var by default
19:48:07*xace joined #nim
19:48:19FromGitter<jrfondren> there's no default. they mean different things
19:48:56poopBotwhen i create
19:49:05narimiranpoopBot: here is my test, it works: http://ix.io/1Jf2
19:49:07poopBot Person = object
19:50:15rayman22201I'm very sad because I think I'm going to have to make a new nim syntax highlighting config file for godbolt... Godbolt uses monaco, which is what vscode uses, and yet the syntax format is completely different (┛ಠ_ಠ)┛彡┻━┻
19:50:22poopBotproc fill_deck(pt:PokerTable)= << hmm i am using it in proc meybe thats why is coplaing
19:50:40poopBotdo i need to do proc fill_duck(var pt:PokerTable) ?
19:50:50FromGitter<jrfondren> not as a rule
19:50:56FromGitter<jrfondren> it depends on how you're using the arg
19:51:02FromGitter<jrfondren> but yeah with that name, probably
19:51:37poopBoti wanted to just pass it as reference
19:51:45narimiranpoopBot: yes, use `var` there
19:52:04FromGitter<jrfondren> if you just want to pass it as reference, change the type to ref object
19:52:30*Jesin quit (Quit: Leaving)
19:53:01narimiranpoopBot: updated example: http://ix.io/1Jf4
19:53:36narimiranbut i feel like all these questions could be answered (faster) if you just experimented and tried stuff on your own
19:53:57poopBothmm i want to have a Poker Table object that will be a var, but i want to have proc that effects that object so i just need to pass ref of it rihg
19:54:10narimiranpoopBot: yes, use `var` there
19:56:33*sacredfrog joined #nim
20:01:18*sacredfrog quit (Ping timeout: 258 seconds)
20:01:50poopBotty it worked, where can i read about seq functions, i am trying to empty/clear it
20:02:17narimiranpoopBot: but why you need to clear it before filling it up again?
20:02:53narimiranlook at my example posted above, i didn't clear `x.b` seq before calling `fill`
20:02:54poopBotcuz each round i dont collect old cards for players i just drop them create new deck and remix
20:03:12poopBotor at least that was the plan :)
20:04:07poopBottough i can probbaly do it other whey do buy just assinging card form deck to player whiout really removing it form deck
20:04:08narimiranyou can use `setLen` if you want to start from an empty seq: http://nim-lang.github.io/Nim/system.html#setLen%2Cseq[T][T]%2CNatural
20:04:25poopBotbut i thinked its easy operation so nothing to lose
20:04:41*rnrwashere quit (Remote host closed the connection)
20:08:10FromDiscord<exelotl> wow the View type in https://github.com/zielmicha/collections.nim is really good. Basically essentially when you want to interpret some bytes as an array of some type without performing a copy
20:08:12*nsf joined #nim
20:08:18FromDiscord<exelotl> *essential
20:09:20*rnrwashere joined #nim
20:10:09*Jesin joined #nim
20:13:11*narimiran quit (Ping timeout: 258 seconds)
20:23:29clyybbergood night
20:23:31*clyybber quit (Quit: WeeChat 2.4)
20:24:09Zevvwhat the blip is <//> ?!
20:24:29FromGitter<jrfondren> @Zevv that's 'owned'
20:25:26Zevvwhy not use something more obvious, like, ehm, "owned"?
20:26:56FromGitter<jrfondren> something about 0.19 compatibility.
20:27:11*rnrwashere quit (Remote host closed the connection)
20:27:20FromGitter<jrfondren> I don't believe it's going to be the syntax you use normally. "it's allowed to be ugly" was part of the selection criteria
20:27:34leorizeAraq said it's temporary
20:27:38*rnrwashere joined #nim
20:29:27Zevvah ok, that makes sense :)
20:29:57ZevvI was curious how linked lists would be solved in the new runtime, that's where I ran into this
20:32:52Zevvbut it seems that the details are not yet in place
20:34:03leorizeyea, see https://github.com/nim-lang/Nim/issues/11217
20:35:27Zevvah yes, thanks
20:36:07*sz0 quit (Quit: Connection closed for inactivity)
20:39:41*sacredfrog joined #nim
20:41:20poopBothmm is there any inbuild or modul to shuffle/randomize a seq?
20:41:44ZevvI still miss some pieces of the puzzle - how will this work? appending an item to a doubly linked list, the new item will be owned by the next pointer of the tail, and will overwrite the tail of te list itself. The new item passed to the append() proc needs to be owned, but how do you reference an owned type in an 'unowned' way?
20:43:17Zevvand how does append() indicate to the caller that the object passed is now owned by the list?
20:44:00*sacredfrog quit (Client Quit)
20:46:27*rnrwashere quit (Remote host closed the connection)
20:48:50*rnrwashere joined #nim
20:49:03*rnrwashere quit (Remote host closed the connection)
20:50:01*rnrwashere joined #nim
20:52:39*rnrwashere quit (Remote host closed the connection)
20:54:22rayman22201There was a long discussion about this on the original RFC thread, but I can't find it now. Did the RFC repo go away?
20:55:12rayman22201append() has to takes ownership of the object basically
20:55:30*natrys quit (Quit: natrys)
20:59:03poopBotso to randomize list i should write some custom coperator in sort?
20:59:52FromGitter<jrfondren> there's a random.shuffle
21:00:14rayman22201found it: https://github.com/nim-lang/RFCs/issues/144#issuecomment-478721735
21:01:18*nsf quit (Quit: WeeChat 2.4)
21:01:55poopBotoh there is shuffle in random, lol waht a waste of time
21:08:08*rnrwashere joined #nim
21:11:32*hoijui quit (Ping timeout: 252 seconds)
21:12:38*rnrwashere quit (Remote host closed the connection)
21:13:00*hoijui joined #nim
21:19:16*lritter quit (Quit: Leaving)
21:26:15poopBotnarimiran[m], how to fold back unfolded?
21:26:27poopBoti asked on nevim but still no reply :(
21:29:32poopBotdoes nim have like python take [:3]
21:31:34FromGitter<jrfondren> !eval echo "hello"[0..2]
21:31:55poopBotthat can wokr too :)
21:37:39*rnrwashere joined #nim
21:43:39*solitudesf quit (Ping timeout: 258 seconds)
21:53:14*FromGitter quit (Remote host closed the connection)
21:53:14*oprypin quit (Quit: Bye)
21:53:30*oprypin joined #nim
21:53:41*FromGitter joined #nim
22:03:24*oprypin quit (Quit: Bye)
22:03:31*oprypin joined #nim
22:03:35*rnrwashere quit (Remote host closed the connection)
22:10:57*hoijui quit (Ping timeout: 250 seconds)
22:13:44poopBotwhy i cant assing?
22:19:35FromGitter<jrfondren> I don't see a screenshot there.
22:22:44poopBothow i just opend it
22:23:02poopBotif scroll bot it says ps.card_1 cannot be assigned to
22:33:18*rnrwashere joined #nim
22:36:25FromGitter<jrfondren> alright, it's some anti-adblock stuff that makes the website lie about whether there's a screenshot available.
22:37:54FromGitter<jrfondren> if you use a code pastebin, like http://ix.io/ or https://gist.github.com/ , it'd be easier for me to copy&paste that and try it locally
22:38:10FromGitter<jrfondren> I don't see the problem there.
22:38:18FromGitter<jrfondren> try running 'nim check' against your file instead.
22:38:33FromGitter<jrfondren> or trying to compile it, rather than using those warnings.
22:48:11*cyberjpn joined #nim
22:54:25*ng0 quit (Quit: Alexa, when is the end of world?)
23:04:24*smitop joined #nim
23:05:14smitopIs it possible to invoke the Nim compiler from within Nim (or during compiletime)? I want to have a server written in C that serves HTML+JS written in Nim
23:06:20FromGitter<jrfondren> there's hot code loading support in the compiler but I don't know how it's used. inim is a pre-compiler-support example.
23:07:01*rutenl joined #nim
23:07:46rutenlanyone know maximum recursion depth in nim? using -d:release
23:08:36rutenlmy program gives no output with recursion depth above about 10000, 8000 and below works fine
23:12:22FromGitter<jrfondren> in principle that can't be a single number; it depends on how much of the stack you're consuming on each recursive call.
23:14:20*rnrwashere quit (Remote host closed the connection)
23:15:39*nif_ quit (Ping timeout: 248 seconds)
23:15:48*nif joined #nim
23:16:06FromGitter<jrfondren> without -d:release I get ... 126 recursive calls before stack overflow, on a function that takes no arguments. with -d:release, I get 262k recursive calls with the same code
23:18:44FromGitter<jrfondren> without tail tail optimization, avoid recursion :/ you can write iterative code and work with an explicit stack data structure, instead.
23:21:03FromDiscord<exelotl> holy shit concepts are cool
23:21:48*rnrwashere joined #nim
23:22:39rutenlthanks for the replies, the release flag makes the compiler use tail call optimisation though right?
23:23:24rutenli'm just messing around a bit implementing the game of nim in nim
23:24:30FromGitter<jrfondren> rutenl, a proc that just increments a global variable and calls itself until that variable exceeds 100mil can't run to completion on -d:release, so I reckon TCO doesn't happen in general.
23:25:51FromGitter<jrfondren> ... TCO *does* happen for funcs though
23:26:07FromGitter<jrfondren> so you need {.noSideEffect.} for it
23:26:14rutenlhmm yea, this case it's minimax, where the recursion is guaranteed to end, but I don';t know if the compiler can be expected to know that
23:26:31rutenland it does have a side effect for now as it uses a transposition table (cache)
23:26:49FromGitter<jrfondren> if you use `func` instead of `proc` you'll get TCO. it might work to pass that table around as a parameter
23:27:09rutenli'll try that
23:27:12FromGitter<jrfondren> in devel you can use {.noSideEffect.}: blocks
23:27:42FromGitter<jrfondren> so in a func body, {.noSideEffect.}: blatantlyModifyGlobalTranspositionTable()
23:28:19FromGitter<jrfondren> unrelatedly, I'd appreciate it if anyone has a better way to do this: https://gist.github.com/jrfondren/e9d60761ce727acabc6256ebd22e6115
23:30:08FromGitter<jrfondren> it's not just needing 8 variations of the query, it's also needing to give it different arguments depending on the query.
23:34:06shashlicksmitop: you can use staticExec
23:36:23*couven92 quit (Quit: Client Disconnecting)
23:38:01*sacredfrog joined #nim
23:41:49FromGitter<jrfondren> for a start a varargs template works well here...
23:46:50rutenlif i have a table Table[(int, int), (int, int)] i should be able to do table[(intA, intB)] = (intC, intD) right?
23:47:12rutenlit's giving me a type mismatch
23:48:12*rnrwashere quit (Remote host closed the connection)
23:49:23rutenlhttps://gist.github.com/RuurdBijlsma/e81c2a4be85ba4d441f0e98432169ca6 is the code if anyone would like to help, at line 30 nim gives me a type mismatch I can't figure out
23:58:23FromGitter<jrfondren> @rutenl, add a 'var' before the Table parameter in negaMax()
23:59:29FromGitter<jrfondren> `Error: type mismatch: got <Table[tuple of (int, int), tuple of (int, int)], tuple of (int, int), tuple of (int, int)>` ⏎ `proc `[]=`A, B (t: var Table[A, B]; key: A; val: B)`
23:59:53FromGitter<jrfondren> parameters are immutable, see.