<< 18-03-2020 >>

00:06:51*krux02_ joined #nim
00:07:28FromDiscord<Skaruts> yea I didn't know about insert until a moment ago...
00:08:33FromDiscord<Skaruts> there's also `del` if you don't care about the item order -- O(1) according to docs
00:09:43*krux02 quit (Ping timeout: 246 seconds)
00:12:48axionWhat should I use instead of newIdentNode? The compiler is telling me it's deprecated, but jumping to the definition doesn't have any documentation telling me what to use instead.
00:13:46*zedeus quit (Ping timeout: 250 seconds)
00:19:30leorizeaxion: ident"ident here"
00:20:19axionHow do I create an ident node from an untyped argument?
00:20:30axioni'm struggling here, even with the deprecated way
00:23:30*zedeus joined #nim
00:25:18rayman22201an ident is just a nimNode with the type "nnkIdent", so you could construct it directly
00:25:27leorizeaxion: untyped argument are ident by default :P
00:25:54leorizeyou have two ways to force it to be nnkIndent: either with expectIdent
00:26:04axionYeah I tried that...
00:26:16leorizeor with the less documented feature of `arg: untyped{nkIdent}`
00:26:29axioni can't even make an ident node from a string type
00:26:36axioni have a bit to learn it seems
00:27:17rayman22201static[string]?
00:27:31rayman22201what are you trying to do?
00:27:55leorizeI'd say be absolutely careful when using static[T] with macros
00:28:09axionone sec
00:29:49axionhttps://play.nim-lang.org/#ix=2exA
00:30:05axiontrying to get rid of the hard-coded "<" infix op
00:36:32*dadada joined #nim
00:36:56*dadada is now known as Guest39039
00:37:50*dwdv quit (Ping timeout: 256 seconds)
00:40:24*ftsf quit (Read error: Connection reset by peer)
00:42:05rayman22201https://play.nim-lang.org/#ix=2exD
00:42:10rayman22201static string works in this case
00:42:57axionI actually want to pass it in as an identifier and not a string
00:46:25rayman22201Nim tries to parse the the expression passed to the macro before it sends to the macro, so just doing `foo(<, v1, v2)` errors. :-/
00:46:31rayman22201hrmmmm. not sure how to get around that
00:47:16Yardanicofor < you need backticks
00:47:18Yardanico`<`
00:47:23*Hideki_ joined #nim
00:47:32rayman22201ah, duh
00:47:55rayman22201https://play.nim-lang.org/#ix=2exH
00:48:38axionAh thanks!
00:48:38*zedeus quit (Ping timeout: 246 seconds)
00:49:00rayman22201operators must have backticks, I always forget. one of those silly things
00:52:00*Hideki_ quit (Ping timeout: 256 seconds)
00:52:41*Zectbumo quit (Remote host closed the connection)
01:00:07*clyybber quit (Quit: WeeChat 2.7.1)
01:05:25*Zectbumo joined #nim
01:08:22*Guest39039 quit (Ping timeout: 250 seconds)
01:08:49FromGitter<zetashift> So I'm not familiar with CI's, but last days everytime I browse Nim on GitHub I see some comment on CI blocking stuff, is that normal?
01:10:14*dadada__ joined #nim
01:12:04FromGitter<Knaque> Hey, out of curiosity, is `--d:release` basically the equivalent of 02 in C?
01:13:01Yardanicowell kinda yeah, but Nim itself uses -O3 for compiled C (I mean when it passes C code to the C compiler).
01:13:07Yardanico-d:danger is like C's -O3
01:13:25Yardanicoall checks disabled
01:15:02FromGitter<Knaque> But it's still stable even though its O3?
01:15:09Yardanicoyes
01:15:15FromGitter<Knaque> Nice.
01:16:36*Skaruts quit (Ping timeout: 240 seconds)
01:21:17*zedeus joined #nim
01:23:43*opal quit (Ping timeout: 240 seconds)
01:27:07*opal joined #nim
01:31:20*zedeus quit (Ping timeout: 246 seconds)
01:38:01FromDiscord<Rika> ive been whining about this for months now but
01:38:15FromDiscord<Rika> im still irked by the fact that space indentation is enforced in nim
01:39:17leorizezetashift: no, the CI service we are using was broken then
01:39:34leorizeI managed to push a walkaround so things work again
01:39:59*zedeus joined #nim
01:40:01leorizeand now we have a fallback pipeline so if the main ever die again we won't get blocked
01:51:30*zedeus quit (Ping timeout: 256 seconds)
01:56:07*krux02_ quit (Remote host closed the connection)
02:03:37*gangstacat quit (Ping timeout: 272 seconds)
02:05:01*gangstacat joined #nim
02:06:16dadada__is the linenoise package from nimble working for anybody? just installed and imported it
02:06:27dadada__and it doesn't find the symbols
02:06:30*dadada__ is now known as dadada
02:06:48dadadaError: undeclared identifier: 'linenoisePrompt'
02:07:29dadadanimble install linenoise
02:07:34dadadaimport linenoise in a nim file
02:07:44dadadaand put a call linenoisePrompt("test") there
02:08:45FromDiscord<Rika> linenoise is stdlib
02:09:02FromDiscord<Rika> what package are you talking about?
02:09:17FromDiscord<Rika> dadada ^
02:09:32dadadathe one that I found on nimble
02:09:52dadadahttps://nimble.directory/pkg/linenoise
02:10:14shashlickSomeone ported it recently wholesale
02:11:16FromDiscord<Rika> you can just use `std/linenoise` and then it's `readLine` instead of `linenoisePrompt`
02:11:54dadadaRika: did they also port the original linenoise code to nim?
02:12:36FromDiscord<Rika> no, its just a wrapper
02:12:41FromDiscord<Rika> the stdlib one
02:13:04dadadaok, I'm missing a way to timeout the readLine proc
02:13:13FromDiscord<Rika> dont think you can
02:13:24dadadayeah, I noticed it from googling around :-(
02:13:31FromDiscord<Rika> i ported linenoise to pure-ish-not-really nim
02:14:56FromDiscord<Rika> https://github.com/de-odex/linenoise-nim if you want to adapt it, i'm pretty sure there are still some bugs in the code but it mostly works
02:15:10FromDiscord<Rika> i estimate around like 70% of it works but oh well it was just an experiment
02:16:25dadadaplease take this experiment to something useful :D
02:16:57dadadaif you add a way to timeout the readline, I'm for sure going to use that!
02:17:07FromDiscord<Rika> i dont know of any bugs right now, afaik hints and completion work, history works (not the same as linenoise, but similar)
02:17:32FromDiscord<Rika> oh yeah btw the stdlib doesnt have hints or mask mode
02:17:49FromDiscord<Rika> which is interesting, maybe that linenoise needs a bit of updating
02:18:11dadadathe linenoise c library has regular activity on github, I just saw it
02:18:27FromDiscord<Rika> anyway, timing out the readline sounds maybe doable? i dont know how i'd implement
02:18:36FromDiscord<Rika> *it, maybe you can dadada
02:19:05FromDiscord<Rika> it's almost idiomatic nim, aka not like raw C-converted nim
02:19:10FromDiscord<Rika> so yeah maybe you can do it
02:19:13FromDiscord<Rika> i have to sleep
02:19:19FromDiscord<Rika> ill consider doing it if you cant
02:19:23FromDiscord<Rika> anyway see you
02:19:43dadadagood night!
02:19:48dadadathanks for the chat
02:32:53*ilyacher joined #nim
02:33:22*ilyacher left #nim (#nim)
02:36:59*zedeus joined #nim
02:40:03*chemist69_ joined #nim
02:42:50*chemist69 quit (Ping timeout: 250 seconds)
02:47:47*rockcavera quit (Remote host closed the connection)
03:09:16*muffindrake quit (Ping timeout: 246 seconds)
03:11:34*muffindrake joined #nim
03:54:23*Zectbumo quit (Remote host closed the connection)
04:05:22*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
04:50:19*nsf joined #nim
05:16:47dadadaRika: did you see this? https://github.com/jangko/nim-noise
05:33:32*dddddd quit (Ping timeout: 246 seconds)
05:38:52*narimiran joined #nim
05:40:00*silvernode-mobil joined #nim
05:44:24*silvernode-mobil quit (Ping timeout: 256 seconds)
05:48:58*silvernode-mobil joined #nim
05:53:03*opal quit (Ping timeout: 240 seconds)
05:53:04*silvernode-mobil quit (Ping timeout: 250 seconds)
05:57:30*silvernode joined #nim
06:01:56*opal joined #nim
06:14:03*opal quit (Ping timeout: 240 seconds)
06:17:24*opal joined #nim
06:24:16silvernodeso I think if I want to create an inventory system, I probably want to use tables and hashes instead of seqs but I am not sure. I just found out there were tables in Nim.
06:34:01*solitudesf joined #nim
06:41:45*zahary joined #nim
06:53:08FromDiscord<Elegant Beef> Well sequences dont give you the a -> b logic that tables do, indicies dont indicate exactly what the value represents
06:54:07*MarderIII joined #nim
06:57:13*silvernode quit (Ping timeout: 264 seconds)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:50*gmpreussner joined #nim
07:09:27*silvernode-mobil joined #nim
07:11:28*gmpreussner quit (Ping timeout: 246 seconds)
07:13:07FromGitter<gogolxdong> build Nim got error `undefined reference to `__builtin_saddll_overflow'`
07:16:31FromGitter<gogolxdong> with gcc-4.8.5
07:23:34FromGitter<gogolxdong> (https://files.gitter.im/nim-lang/Nim/jDui/image.png)
07:23:54*zahary quit (Quit: Leaving.)
07:24:32FromGitter<gogolxdong> Does this mean gcc 6.56 is needed at least?
07:25:56*PMunch joined #nim
07:44:58FromGitter<timotheecour> that was my suspicion, that we need to detect whether `builtin_saddll_overflow’` is available
07:46:30*zahary joined #nim
07:47:25FromGitter<timotheecour> @gogolxdong see https://github.com/nim-lang/Nim/issues/13645
07:47:27disbotGenerate c code cannot compile with recent devel version ; snippet at 12https://play.nim-lang.org/#ix=2ecR
07:48:59*silvernode-mobil quit (Ping timeout: 246 seconds)
07:49:15*tdog joined #nim
07:49:20*silvernode-mobil joined #nim
07:57:04*zahary quit (Quit: Leaving.)
08:04:14*zahary joined #nim
08:17:02*zahary quit (Quit: Leaving.)
08:17:20AraqGCC is at version 9 now
08:17:30AraqI think we're fine with requiring at least GCC version 6
08:19:04*MarderIII quit (Quit: Leaving)
08:21:15*zahary joined #nim
08:25:46*zahary quit (Client Quit)
08:30:29FromGitter<kristianmandrup> Trying to make a React 16 minimal sample app. Getting `Error: undeclared identifier: 'document'` even though I `import dom`. What am I missing?
08:31:31FromDiscord<Varriount> Hi Araq
08:32:37*zahary joined #nim
08:35:01PMunchHmm, is there a way to ignore overflow errors?
08:37:37*zahary quit (Quit: Leaving.)
08:40:59*endragor joined #nim
08:43:05PMunchmratsim, your video is now up at the FOSDEM site: https://fosdem.org/2020/schedule/event/nimultralowoverheadruntime/
08:43:21PMunchApparently the guy in charge of putting the links up got married and was busy with that :P
08:44:09PMunchkristianmandrup, that does indeed sound strange, do you have any example code?
08:55:09dadadaisn't when false: supposed to be effectively like commented out code?
08:55:31dadadaI've something in there that generated a syntax error
08:56:18*crem joined #nim
08:56:54dadadaPMunch: thanks, I'm watching mratsim's presentation now
08:56:55FromGitter<kristianmandrup> I solved it by importing `document` directly
08:57:19FromGitter<kristianmandrup> Still having loads of issues simply operating on the dom
08:57:21FromGitter<kristianmandrup> https://github.com/kristianmandrup/react-16.nim/issues/1#issuecomment-600497229
08:57:22disbot[Error] rtype.nim errors
08:57:31dadadafirst thing I learned is that I need a nim shirt
08:58:03PMunchdadada, yes `when false` is like commented out code to the compiler, a syntax checker should still look at it as it's still code.
08:58:23PMunchdadada, have you seen the other talks as well?
08:59:33PMunchkristianmandrup, how did you import document directly?
08:59:44PMunchYou probably ended up only importing document..
09:00:00PMunchBut I still think you're doing something weird, it should just work with import dom
09:01:59FromGitter<kristianmandrup> `from dom import document, Element, Document`
09:04:54PMunchYeah, no wonder that doesn't work. You haven't imported the `getElementById` procedure.
09:05:39FromGitter<kristianmandrup> Got it working no with `import dom` like you said. Not sure why I had issues before
09:05:51FromGitter<kristianmandrup> I have this weird problem now
09:05:51PMunchNim doesn't have classes in the same way that most OO languages have. So when you import `Document` you don't import a class with all it's procedures, you're just importing the `Document` type itself.
09:05:52FromGitter<kristianmandrup> var ⏎ React*{.importc, nodecl.}: ReactGlobal ⏎ ReactDOM*{.importc, nodecl.}: ReactDOMGlobal
09:06:00FromGitter<kristianmandrup> proc render*(reactDom: ReactDOMGlobal, node: Document, el: Element)
09:06:23FromGitter<kristianmandrup> using `ReactDOM.render(makeTopLevel(), content)` it complains
09:06:38FromGitter<kristianmandrup> type mismatch: got <ReactDOMGlobal, ReactNode, Element> ⏎ but expected one of: ⏎ macro `.()`(obj: JsObject; field: untyped; args: varargs[JsObject, jsFromAst]): JsObject ⏎ first type mismatch at position: 1 ⏎ required type for obj: JsObject ... [https://gitter.im/nim-lang/Nim?at=5e71e49eb720913bec9e04bd]
09:07:37PMunchYou seem to be missing the render procedure. Those errors are generated by a macro `.()` that rewrites itself whenever you have a unknown procedure call
09:08:04PMunchAnd please don't paste code into Gitter, it comes through to IRC as completely unreadable and fills up the channel.
09:08:09PMunchUse a paste site instead
09:08:24PMunchLike ix or hastebin
09:09:11FromGitter<kristianmandrup> ok
09:09:48PMunchIf you don't need it you can probably do import jsffi except `.()` to avoid having that error.
09:10:01PMunchIt still won't work, but at least you might get a better error message
09:14:09FromGitter<kristianmandrup> solved it now. Helped a lot to know that was the cause of the error, a missing import
09:14:16FromGitter<kristianmandrup> Tanks PMunch
09:14:28PMunchNo problem :)
09:14:58*Zectbumo joined #nim
09:17:43Araqdadada, 'when false' still requires syntactically valid Nim code
09:17:47Araqthat's kind of its point
09:18:19*Vladar joined #nim
09:18:34*dwdv joined #nim
09:19:03*Zectbumo quit (Remote host closed the connection)
09:23:22PMunchHmm "Error: illegal capture 'ipAddr_str' because ':anonymous' has the calling convention: <inline>" is this a new error?
09:24:05*tane joined #nim
09:24:17Araqnot really but it makes sense, right?
09:30:06PMunchWell, this project used to build, and has been running in production for a while now. So why did it use to work?
09:38:13Araqthe compiler was less picky in previous versions
09:42:11PMunchBut it worked, that's what I'm curious about
09:42:32PMunchWas that procedure just never inlined because it couldn't be?
09:42:42Araqyup
09:42:53Araqthe compiler turned it into a .closure under your hood
09:43:10PMunchAh okay, so it's just the compiler now telling you that you're doing something dumb :P
09:57:19*disbot quit (Ping timeout: 258 seconds)
09:57:38*disruptek quit (Ping timeout: 256 seconds)
09:59:44*junland_ joined #nim
09:59:55*shashlick_ joined #nim
10:01:22*d10n_ joined #nim
10:03:10*luis_ joined #nim
10:04:48*dom96 quit (*.net *.split)
10:04:48*d10n quit (*.net *.split)
10:04:48*yumaikas quit (*.net *.split)
10:04:48*mwbrown quit (*.net *.split)
10:04:49*shashlick quit (*.net *.split)
10:04:49*junland quit (*.net *.split)
10:05:17*mwbrown joined #nim
10:05:35*dom96 joined #nim
10:05:35*dom96 quit (Changing host)
10:05:35*dom96 joined #nim
10:06:06*yumaikas joined #nim
10:06:21*clyybber joined #nim
10:11:50*krux02 joined #nim
10:23:11*luis_ quit (Quit: luis_)
10:23:40*luis_ joined #nim
10:27:43*luis_ quit (Client Quit)
10:29:14xacedoes `nim c` have an option for running `strip -s` on the resulting binary?
10:30:45Araqnah
10:40:47clyybberAraq: AFAICT the first snippet here: http://ix.io/2ezf does the same thing (effectively) as the second one
10:41:12clyybberDo we not analyze closure captures like in the second case or are we overly pessimistic in the first?
10:43:55*silvernode-mobil quit (Ping timeout: 246 seconds)
10:45:52Araqthese snippets are not comparable
10:49:09livcdAraq can you help Ward with arc ? :-)
10:50:20Araqlink?
10:56:59livcdhttps://forum.nim-lang.org/t/6072
10:57:33Araqfixed on devel
11:05:55*silvernode-mobil joined #nim
11:06:45*narimiran quit (Ping timeout: 250 seconds)
11:33:49*NimBot joined #nim
11:34:17*ng0 is now known as nikita`
11:34:39*wowaname joined #nim
11:35:23*opal quit (Ping timeout: 240 seconds)
11:49:48*nsf quit (Quit: WeeChat 2.7)
11:58:20*rockcavera joined #nim
12:12:56PMunchmacroutils package now available on the playground: https://play.nim-lang.org/#ix=2ezy
12:19:57*zahary joined #nim
12:26:16FromGitter<kaushalmodi> PMunch: Can playground nimble install all the "popular" nimble packages, at least the ones in nim test suite?
12:29:04PMunchkaushalmodi, you mean like these ones? https://play.nim-lang.org/#ix=2ezF
12:30:12PMunchPRs welcome to this list to add new packages: https://github.com/PMunch/nim-playground/blob/master/docker/packages.nimble
12:31:47*narimiran joined #nim
12:34:24PMunchThat list was seeded with the important_packages list, but some things were dropped (like some GUI stuff that didn't make sense to run on the playground).
12:34:39FromGitter<kaushalmodi> PMunch: Awesome! I didn't know that. Thanks!
12:35:12*nsf joined #nim
12:36:35PMunch:D
12:38:27FromDiscord<demotomohiro> There is /playground/nimble/nimcuda. That means Nim playground server has nvidia GPU?
12:38:59PMunchHehe, no
12:39:08PMunchIt's just a package that hasn't been pruned yet
12:41:12FromDiscord<demotomohiro> iirc, you cannot use CUDA without nvidia GPU.
12:43:09Araqtrue
12:45:08FromGitter<alehander92> @kristianmandrup
12:45:14FromGitter<alehander92> did you fix your react code
12:47:33*Hideki_ joined #nim
12:52:56clyybberPMunch: Is superQuote a replacement for quote?
12:53:04clyybberWithout quote's issues?
12:53:23PMunchWell, it rewrites to a quote statement. But the idea is for it to fix the issues with quote, yes
12:53:49Araqha, many have tried
12:53:53Araqmany have failed :P
12:53:56PMunchThe only one it does now though is to lift the contents of the quotes out as variables so you're able to put more than simple identifiers in there.
12:54:49PMunchAraq, I already managed to fix the "result" in quote issue ;) And that could've been done in a macro like this instead of my PR to the Nim repo.
12:55:18PMunchSo I'm optimistic that I'll be able to apply various fixes and workarounds this way
12:55:24AraqCloning into 'Nim'...
12:55:24Araq+ cd Nim
12:55:24Araq+ git checkout -q 670735e4436976eb82c121d47d4617dcd303ba89
12:55:24Araqerror: Your local changes to the following files would be overwritten by checkout:
12:55:24Araq tests/tools/second.nim
12:55:25AraqPlease commit your changes or stash them before you switch branches.
12:55:29Araqwhat up with this shit?
12:55:43PMunchYeah I got that on the playground as well
12:55:44AraqI only changed the newlines in there to LF
12:56:05Araqprobably because
12:56:06Araq# tests expects the text files associated with them have LF only as EOL
12:56:06Araq**/test*/**/* text eol=lf
12:56:09PMunchgit clone https://github.com/nim-lang/Nim; cd Nim; git checkout v1.0.6
12:56:13PMunchCaused a similar issue
12:56:19Araqin our new .gitattributes
12:56:26PMunchI just changed it to "git checkout -f v1.0.6" though
12:57:24Araqno idea how to do that with build.ht.rs
13:04:40*silvernode-mobil quit (Ping timeout: 250 seconds)
13:05:00*silvernode-mobil joined #nim
13:07:53*endragor quit (Remote host closed the connection)
13:09:01*endragor joined #nim
13:12:25*lritter joined #nim
13:13:40*smitop joined #nim
13:14:01*endragor quit (Ping timeout: 264 seconds)
13:27:54*Tungki joined #nim
13:29:20*dddddd joined #nim
13:29:31*Tungki quit (Read error: Connection reset by peer)
13:29:38clyybberAraq: Hmm, is an infinite recursion with nimDestroyAndDispose a bug?
13:30:21*zahary quit (Quit: Leaving.)
13:30:41clyybberwith --gc:arc that is
13:39:44Araqclyybber, yeah but not the bug you think it is
13:39:47Araqit's a corruption
13:41:35AraqI'm about to merge my scope based destruction branch but will disable the logic
13:41:43Araqin order to prevent it from bitrotting
13:44:14*junland_ quit (Ping timeout: 246 seconds)
13:44:56*d10n_ quit (Ping timeout: 246 seconds)
13:45:52*d10n joined #nim
13:46:59*d10n quit (Changing host)
13:46:59*d10n joined #nim
13:49:10*junland joined #nim
13:53:20FromGitter<gogolxdong> centos7 ships gcc-4.8.5 or have to build from source
13:55:08*zahary joined #nim
13:55:47leorizeAraq: is --staticBoundChecks array-only?
13:56:33leorizeor do we have plans to extend it to range[]?
13:57:05*Hideki_ quit (Remote host closed the connection)
13:58:15*Hideki_ joined #nim
13:58:41*Hideki_ quit (Remote host closed the connection)
13:58:56*Hideki_ joined #nim
14:01:23*silvernode-mobil quit (Ping timeout: 250 seconds)
14:06:13*sacredfrog quit (Quit: ZNC 1.7.5 - https://znc.in)
14:10:34*Vladar quit (Quit: Leaving)
14:11:46*Zectbumo joined #nim
14:12:01*sacredfrog joined #nim
14:23:31*Hideki_ quit (Remote host closed the connection)
14:24:14*Hideki_ joined #nim
14:25:38*jjido joined #nim
14:28:34*Hideki_ quit (Ping timeout: 256 seconds)
14:30:27*disruptek joined #nim
14:31:08*xet7 quit (Quit: Leaving)
14:31:33*disbot joined #nim
14:37:50*Hideki_ joined #nim
14:41:18*natrys joined #nim
14:42:50*silvernode-mobil joined #nim
14:44:04*nsf quit (Quit: WeeChat 2.7)
14:48:24axionSigh. I think I need help fixing up my macro.
14:49:02FromDiscord<Rika> sure
14:49:06FromDiscord<Rika> what's it doing?
14:49:28axionWell I have to extend it a little. Let me make a playground
14:50:45*skrylar[m] quit (Ping timeout: 245 seconds)
14:51:09*Demos[m] quit (Ping timeout: 245 seconds)
14:51:35*reversem3 quit (Ping timeout: 245 seconds)
14:52:03*skrylar[m] joined #nim
14:52:43*mattmurr quit (Disconnected by services)
14:52:51*mattmurr joined #nim
14:54:29*Demos[m] joined #nim
14:55:34axion@Rika: https://play.nim-lang.org/#ix=2eAH
14:55:42*reversem3 joined #nim
14:55:57FromDiscord<Rika> i can run it right now?
14:56:06FromDiscord<Rika> i mean it runs in playground?
14:56:18axionYeah
14:56:35FromDiscord<Rika> whats the issue exactly
14:56:59*mattmurr quit (Client Quit)
14:57:12axionthe TODO
14:58:03FromGitter<russmack> Oh, I didn't know there was a nim playground :)
14:58:15FromDiscord<Rika> one moment then ill think
14:58:32Yardanico@russmack it's available for quite a while now :)
14:58:34axion@Rika also should probably be a pragma macro but i couldnt figure that out
14:59:13FromGitter<russmack> Nice. I've only been Nimming for a month or two.
15:00:36FromGitter<russmack> What is an example of using an exception where the finally block executes without subsequent code running? ie this answer doesn't seem applicable to Nim: https://stackoverflow.com/questions/50618/what-is-the-point-of-the-finally-block
15:01:12*shashlick_ quit (Quit: quit)
15:01:14Yardanico"If there is a finally part, it is always executed after the exception handlers."
15:01:20FromDiscord<Rika> axion, you want the same macro to handle both infix and prefix
15:01:28FromGitter<russmack> right, but so is the next bit of code
15:01:30Yardanicoso for example in try you open a socket, in "except" you catch an exception, and in "finally" you always close the socket
15:01:34*shashlick joined #nim
15:02:00Yardanico@russmack but if an exception occurs code after exception won't be called
15:02:02Yardanicobut finally will
15:02:12Yardanico"The exception is consumed in an except part. If an exception is not handled, it is propagated through the call stack. This means that often the rest of the procedure - that is not within a finally clause - is not executed (if an exception occurs)." from tutorial 2
15:02:16Yardanicohttps://nim-lang.org/docs/tut2.html#exceptions-try-statement
15:02:24axionRika: Yes, and I want to get rid of the duplication in the proc definition. It should be able to tell how to call the macro based on the proc signature...which is why I thought to use a pragma
15:02:48axionRika: I forgot to add the usage with echo's: https://play.nim-lang.org/#ix=2eAM
15:03:01FromDiscord<Rika> one moment, i need to remember some macro stuff
15:03:12FromDiscord<Rika> its been a week since i wrote macro nim code
15:03:42FromGitter<russmack> ah got it, thanks @Yardanico
15:04:09Yardanicothe link you gave also provides an answer like that
15:04:13Yardanico"Depends on the language as there might be some slight semantic differences, but the idea is that it will execute (almost) always, even if the code in the try block threw an exception."
15:05:22FromGitter<russmack> yeah, my issue was that in my examples subsequent code was always executing too. But, fixed now. Thanks.
15:11:41FromDiscord<Rika> ok axion, a few issues: 1) your macro only handles procs that return booleans
15:11:50FromDiscord<Rika> is that intended?
15:11:58FromDiscord<Rika> not a few, just one i think
15:12:00FromDiscord<Rika> sorry
15:12:16axionFor the time being it's fine. I think I only have these 3 predicates
15:13:20FromDiscord<Rika> give me a proc that's prefix and returns boolean (do you need a not for a vec??)
15:14:43FromDiscord<Rika> OH i think i misunderstood
15:14:48FromDiscord<Rika> okay okay okay
15:17:53axionRika the ~= in that code
15:18:27FromDiscord<Rika> yeah yeah sorry i misunderstood HEAVILY
15:18:51axionNo prob. It's probably me. I'm not fully awake yet
15:21:17*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:27:08*xet7 joined #nim
15:27:16*Hideki_ quit (Remote host closed the connection)
15:28:25*Hideki_ joined #nim
15:32:33*smitop quit (Quit: Connection closed for inactivity)
15:32:57*Hideki_ quit (Remote host closed the connection)
15:33:09*Hideki_ joined #nim
15:33:29dadadamicrosoft has started to support vt terminals, stuff like tmux and midnight commander now work under stock Windows, not a windows user here, however as a dev who was pissed of at MS for not supporting enough standards this is a welcome change
15:34:28dadadait means that writing portable terminal apps has just become a lot easier, since you can basically develop and run them anywhere
15:34:48dadadaanywhere being, Windows, Mac and any Unixy system
15:34:58*Hideki_ quit (Remote host closed the connection)
15:35:02dadadaonly question is, what took them so long :D
15:35:02FromDiscord<Rika> windows not under 10 20smthsmth*
15:35:23dadadawho cares, this is just a question of time now, eventually everybody moves to a newer system
15:35:41dadadasupporting older systems only makes sense if you have paying customers who want that
15:36:01FromDiscord<Rika> axion i have nonworking code but its almost there, i dont know how to solve this last problem
15:36:05Araqha!
15:36:08*Hideki_ joined #nim
15:36:10FromDiscord<Rika> "how to get the size of the Vec being used"
15:36:14axionRika: Ok thanks!
15:36:23FromDiscord<Rika> WAIT im dumb
15:36:27FromDiscord<Rika> sorry that was very dumb
15:36:27axion`len`?
15:36:37Araqthat's like saying "supporting 40 different Linux distros only makes sense if you have paying customers who want that"
15:36:39krux02dadada, does the terminal replace all terminal activity on windows?
15:36:39FromDiscord<Rika> ah no
15:36:52dadadahttps://www.golem.de/news/microsoft-das-windows-terminal-bekommt-mauseingabe-2003-147335.html
15:36:54FromDiscord<Rika> still not sure how to do this, you'd have to move the for loop from compiletime to runtime
15:37:19*Hideki_ quit (Remote host closed the connection)
15:37:21Araqhint: often you have zero people on Linux who pay for anything whatsoever... *cough*
15:37:24axionThat would be surprising if you have to do that with Nim :)
15:37:30axionMy Lisp code does not
15:37:36*Hideki_ joined #nim
15:38:43FromDiscord<Rika> its probably because of lack of knowledge
15:39:23*Hideki_ quit (Remote host closed the connection)
15:39:29disruptekthat's why i don't pay for anything: i'm too stupid.
15:40:09*Hideki_ joined #nim
15:40:24dadadaAraq: I think you're missing my point, I was distinguishing systems that are older, surely no linuxer would say it's reasonable to support fedora 26, when we'll soon have fedora 33, and upgrading is not only free, but dead easy
15:40:29FromDiscord<Rika> https://play.nim-lang.org/#ix=2eAX what i got so far axion
15:41:02FromDiscord<Rika> upgrading is not dead easy when you have software that frequently changes
15:41:11*Hideki_ quit (Remote host closed the connection)
15:41:25*Hideki_ joined #nim
15:41:37Yardanicodisruptek: I spend like $20 monthly on subscriptions/servers/internet :P
15:41:39FromDiscord<Rika> you have to update all older software to work with the new version (esp. if the upgrade is between major versions) and this can take a lot of time if the older software was large
15:41:56Yardanicohetzner 3 euro, youtube premium ~$2.5, nim donation $5, home internet + mobile plan ~$7.5
15:41:59FromDiscord<Rika> companies are not willing to spend resources for what they think are "minor improvements"
15:43:02dadadaRika: okay, well I'm upgrading my system every half year when there's a new fedora release, in my experience its dead easy and software problems, if any, are minor, most of the time there aren't any, that's my experience, sorry if yours differs
15:43:12*Hideki_ quit (Remote host closed the connection)
15:43:27FromDiscord<Rika> its noy my experience, mine is fine
15:43:33FromDiscord<Rika> i upgrade literally every few weeks
15:43:39FromDiscord<Rika> (rolling release operating systems)
15:43:43YardanicoI run xbps-install -Su almost daily
15:43:45*Hideki_ joined #nim
15:43:45Yardanicorolling too
15:44:02disrupteki've run emerge @world twice since this convo started.
15:44:11FromDiscord<Rika> but companies dont like updating
15:44:12Yardanicowhat beastly CPU do you have
15:44:19FromDiscord<Rika> because that potentially means money loss
15:44:20Yardanicotwo EPYC 7742 ?
15:44:34disruptekjust teasing you knuckleheads.
15:44:34krux02Windows 10 is a rolling release, too. At least that is what I understood.
15:44:54Yardanicowell I wouldn't really say so, it's still separated in releases
15:44:57Yardanicoit has versions
15:45:06axionI do a rolling upgrade every day and been running the same install (on some PC's) since 2000. Issues are rare, but they are time consuming to solve, often requiring coding patches yourself or waiting for upstream.
15:45:22*smitop joined #nim
15:45:49krux02what distro are you using since 2000?
15:45:56axionArch, since beta days.
15:46:04krux02In 2000 I din't even know Linux is a thing
15:46:05dadadaaxion: the trick is to always upgrade to a stable branch, that's basically what a Fedora release is, and an upgrade cycle of every half a year, while not as great as Arch, is still decent
15:46:16YardanicoIn 2000 I didn't even know what knowing is :P
15:46:18axionBefore that Slackware for many years
15:46:25krux02interesting.
15:46:26axionI guess I'm old
15:46:40dadadastarted with Linux in roughly 2000, I think
15:46:48krux02probably. I am too young for Linux in the 90s, I used Windows 3.11 and 95
15:47:09krux02it was buggy and had a lot of blue screens. But Windows back then wasn't slow.
15:47:17FromDiscord<Rika> i wasnt alive in 2000
15:47:26Yardanicoyou mean wasnt born*
15:47:29disrupteklinux in the 90s was more of a mindfuck because the potential was just so explosive.
15:47:37FromDiscord<Rika> still works
15:47:50Yardanicoi was born in 2000 :P
15:48:09krux02I really wonder what people did in the 90s with Linux, as for what I've known so far it was a slow and incomplete experience.
15:48:10FromDiscord<Rika> yardanico-nii-san
15:48:27axionkrux02: It was faster.
15:48:28Yardanico:insert_bruh_emote_here:
15:48:40disruptekdid a lot of programming, email, the early web browsers, etc. whatever you do now.
15:49:06krux02yea probably.
15:49:12disruptekit was more hardware-sensitive then, but i wouldn't say it was slow.
15:49:15krux02emacs and vim already were a thing back then.
15:49:16axionWe didn't have the bloat problem. A complete graphical system ran in under 50MB of ram on my PC's in the late 90's.
15:49:43Araqgreat but I had 8MB of RAM... after an upgrade
15:49:43dadadakrux02: depends, Mandrake had a pretty nice GUI for setting up things, as did SuSe, then there were very barebones distributions as well, I started with Mandrake/SuSe, so it was a manageable experience, then I setup my own Linux From Scratch and that was when I knew that I had gone too deep down the rabbit hole :D
15:49:45disruptekbuilt kernels with 4mb of memory. sure, it grew to take all day, but it was the only way.
15:50:26*nsf joined #nim
15:50:45Araqhmm I remember booting Linux in the 90ies. we were like "yeah, take that M$! we are running Linux now"
15:50:45krux02yay what an experience.
15:50:57krux02lol
15:50:59Araqwe did that for an afternoon
15:51:29Araqafter that afternoon we knew what "operating system" meant. Hint: it's for running *other* software
15:51:36disruptekwe ran MUDs and email, so we were locked in.
15:51:38dadadawell, in the 90s I was a Windows user I must admit, but that's also the reason why I'm not anymore, because my experience with Windows back then was terrible
15:51:46*Zectbumo quit (Remote host closed the connection)
15:51:46krux02I think I had a happier life for not knowing about Linux in the 90s.
15:52:05krux02All I cared about back then was playing Games.
15:52:49dadadato be fair, there were also a few nice games and applications on Windows, but the limitations of the system were very apparent, and crashes :D
15:53:20Araqthe crashes of KDE were very apparent too fwiw
15:53:51FromDiscord<Lantos> lol krud
15:53:51disrupteklinux crashed back then, too. admittedly, not as often.
15:53:53FromDiscord<Lantos> krux
15:54:04FromDiscord<Lantos> I was also happier not knowing about linux
15:54:04FromDiscord<Rika> krud
15:54:32dadadaAraq: I used IceWM for a long time, it was extremely stable, and later I used the stable OpenBox
15:54:33*Hideki_ quit (Remote host closed the connection)
15:55:00dadadaOpenBox is extremely configurable btw, great underestimated little thing
15:55:15*Hideki_ joined #nim
15:56:08disruptekpulseaudio is pretty mature yet i triggered crash bugs in it yesterday. also a nim compiler bug, fwiw.
15:56:17disruptekeveryone writes bugs.
15:56:23shashlickdid you still need a wrapper? got some time now
15:56:41disrupteki mean, i would use it, but i would never impose upon you. 😉
15:56:53shashlickokay lets see how easy it is
15:57:33disrupteki am using dbus and i got it lookin' pretty cute.
15:57:37disrupteki dunno, may delete later.
15:57:52disruptek!repo disruptek/pulseauto
15:57:53disbothttps://github.com/disruptek/pulseauto -- 9pulseauto: 11setup pulseaudio stream levels via app names or pids 15 0⭐ 0🍴
15:58:02krux02disruptek, That reasoning is why `rust` became a thing and popular.
15:58:15disruptekwell, it's not wrong.
15:58:33disrupteknow if we could just get everyone writing /comments/ too...
15:59:11krux02disruptek, have you ever written elisp with flycheck enabled?
15:59:18disrupteknope.
15:59:23krux02It tells you to write comments and how to write them.
15:59:40disrupteki haven't written lisp in like 15 years now, i'm ashamed to admit.
15:59:41*Hideki_ quit (Ping timeout: 250 seconds)
16:00:03krux02well at least you did write lisp 15 years ago
16:00:06FromDiscord<Rika> dadada hows the port
16:00:06disruptekalso i left tech for more than a decade, so...
16:00:26dadadaRika: what do you mean?
16:00:39FromDiscord<Lantos> 15 years ago..
16:00:46FromDiscord<Lantos> how old where you when you started coding?
16:00:51disrupteki have to look into this flycheck thing.
16:00:54FromDiscord<Rika> you were the one who needed the timeout thing on linenoise right? did you figure out how to add it?
16:01:13disrupteki started with basic when i was 8.
16:01:36krux02The linter for elisp (flycheck) will tell you how to write the comments and it will ensure that you include all arguments in the first in the correct formatting. It will ensure that you start with a capital letter and that you end the sentence with a full stop.
16:01:55krux02I can't remember if it also has some grammar checking in there.
16:02:08krux02but it really pushes you to write comments in a consistent style.
16:02:37krux02Nim could do the same thing.
16:03:08dadadaRika: no, I moved on to a few other things... I'm thinking it would probably be nice to have generalized extremely easy way (perhaps with a macro) to define a timeout for any function call.
16:03:32disruptekwe could have an editor command that adds a comment block to the current proc and sets up a line each for arguments and formats them in rst.
16:03:33FromDiscord<Rika> i dont think thats trivial
16:03:50Yardanicomaybe there's some vscode extension for this? :P
16:04:47disruptekflycheck supports rust, python, haskell, c++, D... hmmph.
16:05:20disrupteki'm looking for an animated demo of comments.
16:06:04disrupteki've been programming for a long time, but i'm a terrible programming.
16:06:07disruptekprogrammer, too.
16:06:23disrupteki just enjoy it.
16:06:49*Trustable joined #nim
16:07:05FromDiscord<Lantos> all that matters is you enjoy it
16:07:31disruptekyep.
16:07:53dadadaright
16:08:05krux02Well, I don't enjoy fixing other people's bugs.
16:08:30disruptekyep, this is why we have so many.
16:08:38krux02But when I live in my own bubble where I am surrounded by code that is just my code, I am a happy programmer.
16:09:22krux02well actually I am currentliy trying to fix bugs in Nim.
16:09:44*zahary quit (Quit: Leaving.)
16:09:51krux02It is just when I fix sometheng here, something somewhere else completely unrelated breaks.
16:10:22disruptekit's maddening that the stream manager lets you edit the title of your stream but doesn't give you a way to /save/ the edit.
16:11:13disrupteki jut don't understand... does no one test this shit?
16:11:38Yardanicoin twitch?
16:11:43YardanicoI think it should save automatically
16:11:59disruptekit doesn't.
16:12:18Yardanicoah nvm, where are you editing it?
16:12:39Yardanicothere should be a pencil button under your stream (on your twitch page) on twitch.tv/disruptek
16:12:50disruptekyep, that's the only place you can edit it.
16:12:50Yardanicounder the buttons in the video on the right
16:12:55Yardanicowell, there's a "Done" button
16:13:00disruptekyes.
16:13:04Yardanicopress it :P
16:13:07disruptekbut not in the Stream Manager.
16:13:10disruptekya feel?
16:13:16disruptek~stream
16:13:17disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
16:13:21disrupteki'll show you if you really want...
16:13:50krux02disruptek: alwas this music
16:14:00disruptekwhat?
16:14:18krux02In your stream
16:14:21disruptekwe almost never hear badu.
16:14:22krux02you always have music
16:14:25disruptekwhat do you want to hear?
16:14:37Yardanicokrux02: music is good :P
16:14:45krux02yea not complaining
16:14:50krux02it is just something I realized
16:15:25krux02but isn't music a problem with licensing and stuff?
16:15:29disrupteki need music because no one is on live audio chat.
16:15:36disruptekthey just mute my videos.
16:15:38disrupteki don't give a shit.
16:15:41krux02I don't have mumble
16:17:05*ljoonal quit (Quit: ljoonal.xyz)
16:19:02FromDiscord<Lantos> I'm not sure why more people don't use discord over mumble/irc
16:19:19FromDiscord<Lantos> is irc just easier ?
16:20:10dadadaLantos: IRC is oldschool as f*** and irssi is a client that is perfection in my view
16:20:17Yardanico@Lantos Electron
16:20:25Yardanicoand using it in a web browser is meh
16:20:51*ljoonal joined #nim
16:21:00vegaidiscord is an incredible pain to use
16:21:11dadadaLantos: I used IRC for almost two decades, saying that I should use something else is making my roll my eyes, this is a time tested protocol, at best I'll use something additionally, but never to replace IRC
16:21:12vegaithat's my reason anyway :)
16:21:17Yardanicoalso IRC is entirely open :P
16:21:27YardanicoI mostly use IRC and Telegram
16:22:19axiondadada: +1
16:23:31dadadairc.freenode.org is one of the nicest places on the internet, if not the best one ... so many fond memories
16:23:33vegaiMatrix is capable of replacing IRC for me, if a decent client comes by and people actually start using it
16:23:34axionIRC is older than the web. I cannot stand all those GUI chat services. All you need is a TUI to communicate effectively, and arguably moreso. THE SNR is very low with all those emojis, avatars, and the like
16:23:40vegaigomuks is almost there already
16:24:05Yardanicoaxion: 🙂
16:24:40shashlickdisruptek: here's a quick and dirty wrapper - http://ix.io/2eBl/nim
16:24:47FromDiscord<Lantos> ah, the open part is a plus
16:25:13shashlicknot a full-fledged rapper that downloads and builds since i presume you will use this on linux only and use the package manager to install it
16:25:29axionMatrix is horrible. One of our dev channels has a bridge and messages are constantly arriving/received minutes, sometimes hours later.
16:25:38shashlickpulseaudio wrapper ^^
16:27:05krux02Araq, Simon the Sorceror is great
16:27:17disruptekshashlick: thanks!
16:27:17Araqlol
16:28:35disruptekthis is the whole wrapper?
16:28:44disruptekjust this one file and the nimterop import?
16:28:47shashlickthe output yes
16:28:50disruptekis this the new codepath?
16:29:04shashlickthe wrapper is http://ix.io/2eBn/nim
16:29:06shashlickgenerator
16:29:22shashlickif you have pulseaudio installed, you can use getHeader() with -d:pulseaudioStd
16:29:35axionWhat's the most idiomatic way to write a for loop that iterates over every N indices of an array? Like if I had an array of length 16, i'd like to do something on indices 0,5,10,15, where N is 4 in this case
16:30:08shashlicknew codepath is around 80% done compared to current functionality
16:30:20axionor well 5 i suppose :)
16:30:23shashlicknot counting bugs of course
16:31:03axionThat is it post-increments (starts at 0)
16:32:10krux02disruptek, still struggling with mumble, first time usage.
16:32:21dadadaaxion: I'd write an iterator probably
16:32:31Yardanicodisruptek: im here as well
16:32:39axiondadada: For a one off usage of a large array? Seems like overkill
16:32:54Yardanicodisruptek: for showing IRC/twitch messages on your stream
16:32:58Yardanicois it an OBS plugin?
16:34:36dadadaaxion: why not a while loop?
16:34:51PMunchaxion, the most idiomatic would be to use countup
16:34:56axionThis is one thing I miss from lisp: (loop :for x :by 5 ...)
16:35:30Yardanicothere's countup though
16:35:58axionI'll check it out, thanks
16:36:28PMunchhttps://play.nim-lang.org/#ix=2eBt
16:36:54Yardanicoyeah, countup has an optional step argument
16:36:57Yardanicoso does countdown
16:51:09*Hideki_ joined #nim
16:51:23*nsf quit (Quit: WeeChat 2.7)
17:00:51FromDiscord<Kiloneie> You guys tell me i shouldn't make too many videos per week, but the analytics say otherwise D:
17:01:23Yardanicowdym?
17:02:41FromDiscord<Kiloneie> the bigger the gap between my videos, the less views i get, it doesn't grow, it declines. Then a jump when a new video is uploaded which raises the views for the following days, but it decays with every day.
17:02:56FromDiscord<Rika> thats natural
17:03:02narimiranyou're too obsessed with views and potential financial gains from it
17:03:16FromDiscord<Rika> were not saying youll get more views by slowing down
17:03:24stefantalpalaruThey could be radioactive. Just saying...
17:03:27disruptekyou make the videos once. make them as well as you can. you reap the dividends indefinitely.
17:03:29FromDiscord<Rika> we're saying that its healthier to slow down
17:04:08FromDiscord<Kiloneie> I know, i sadly cant get the mic setup atm, so i will have to do quite some fixing on quite a few videos once i do
17:04:16narimiranbtw, how many view did you get when you had a long break because you had a burnout? :P
17:04:25FromDiscord<Kiloneie> ummm still a lot...
17:04:36FromDiscord<Kiloneie> first video was about 400-500 views
17:04:40FromDiscord<Kiloneie> now it's 2400
17:04:54FromDiscord<Kiloneie> subs ? i think about 65, now it's 153 ?
17:05:01FromDiscord<Kiloneie> it kept growing...
17:05:20narimiranso, you don't have a relevant information about the newest videos, right? because it is much much newer than that one
17:05:41FromDiscord<Kiloneie> what do you mean ?
17:06:19narimirannewest video = 3 days old; oldest video = 90 days old (i just invented those numbers)
17:06:40FromDiscord<Kiloneie> well the newest are getting more views than i did back then
17:06:56FromDiscord<Kiloneie> 100 in a week, then it slows down a ton
17:07:35FromDiscord<Kiloneie> but, when i first started, average views and watch duration went up with every video. I am making the too slow atm
17:07:51FromDiscord<Kiloneie> i did take time to think trough how i want to go on with this
17:08:20FromDiscord<Kiloneie> and i know why the views are what they are atm, we don't really have many beginners to programming at all
17:08:28FromDiscord<Kiloneie> that's what the surveys say
17:09:31FromDiscord<Kiloneie> Also on the potential financial part, well im broke D:, fcking corona crap.
17:10:06narimiranbroke or not, don't count on the idea that your videos will make you significant amount of money
17:10:25Yardanicowell yeah, actual programming videos won't earn you money :P
17:10:30FromDiscord<Kiloneie> i know they won't, not until years from now
17:11:09FromDiscord<Rika> i dont think they ever do
17:11:34Yardanicoi wouldn't like a programming video showing ads :P patreon or something like that will be better
17:11:54FromDiscord<Kiloneie> i know, i wouldn't do that
17:12:13FromDiscord<Kiloneie> i would only do maybe at the end, and some easy ones you get at the bottom of the screen most people do
17:12:23FromDiscord<Kiloneie> patreon is the way to go
17:12:29*sealmove quit (Ping timeout: 250 seconds)
17:12:56FromDiscord<Kiloneie> but till any of that, i need hundreds of videos that not only cover the beginner spectrum but also intermediate, and more advanced
17:13:15FromDiscord<Kiloneie> something maybe any of you could find useful
17:13:27FromDiscord<Rika> does nim have a counterpart to python's `string.decode()`
17:13:28*Hideki_ quit (Ping timeout: 256 seconds)
17:13:35Yardanicono, since nim strings are just bytes
17:13:43FromDiscord<Rika> i mean
17:13:46FromDiscord<Rika> in nimble perhaps
17:13:47FromGitter<Kvothe87> Hi guys i'm trying to run a program that leorize helped yesterday, but i get the following error: Error: unhandled exception: Error: cannot open: (kind: pcFile, path: "C:\\Users\\**\\**\\**\\**\\**\\**\\***.csv") [CsvError]
17:14:06FromDiscord<Rika> thats one hell of a path
17:14:10Yardanico@Rika for what?
17:14:13FromDiscord<Kiloneie> im gonna start making videos on nim's standard library now, been planning that for a while
17:14:23YardanicoI mean why you need .decode
17:14:24*sealmove joined #nim
17:14:43YardanicoThere's https://nim-lang.org/docs/encodings.html if you need to encode/decode stuff
17:14:50Yardanicowith different encodings
17:15:05FromGitter<Kvothe87> where in the error i receive all the slashes are doubled
17:15:14Yardanicothat's okay
17:15:15FromDiscord<Rika> im converting a python library
17:15:29Yardanicowell most of the time you wouldn't need stuff like that in nim
17:15:36Yardanicoand it was probably written for python 2
17:15:52Yardanicoin Python 3 strings are UTF-8 by default too, so you need encode/decode only when actually dealing with different encodings
17:16:00FromGitter<Kvothe87> is this a problem of opening the file or is it of passing a wrong type ?
17:16:07FromDiscord<Rika> it says it deals with 'utf-8-sig'
17:16:32Yardanicois that lib open source?
17:16:56FromDiscord<Rika> ill just
17:16:57FromDiscord<Rika> hu
17:16:58FromDiscord<Rika> uh*
17:17:01FromDiscord<Rika> remove the code
17:17:08FromDiscord<Rika> i dont think its significamnt
17:17:14FromDiscord<Rika> im pretty sure its not significant the decode part
17:28:55*sealmove quit (Ping timeout: 272 seconds)
17:30:36*sealmove joined #nim
17:54:00leorizeKvothe87: can we see the code?
17:59:52*oculux quit (Ping timeout: 256 seconds)
18:02:33*smitop quit (Quit: Connection closed for inactivity)
18:08:48shashlickquestion - how do you default initialize a ref object param to nil in a proc signature?
18:09:09disruptekfoo: Something = nil
18:11:02*silvernode-mobil quit (Ping timeout: 264 seconds)
18:12:01leorizeor foo = Something(nil)
18:16:05shashlickthanks
18:44:12*Zectbumo joined #nim
18:44:46rayman22201@axion, if you are still around. Here is the fix to your macro: https://play.nim-lang.org/#ix=2eC6
18:45:00rayman22201you can treat infix operators as prefix. They are just normal function calls.
18:45:03rayman22201very lisp like
18:45:15rayman22201just remember the backticks :-P
18:45:35rayman22201!last axion
18:45:36disbotaxion spoke in 12#nim 2 hours ago
18:47:25FromDiscord<Rika> rayman22201, uh, i think they want the macro to generate a proc that allows for 3 parameters if the given proc has 3 parameters
18:47:38FromDiscord<Rika> and if only 2, use infix, if more, use prefix
18:48:38rayman22201I'm not sure if that is what they are asking. But it's also unnecessary
18:49:03rayman22201the Nim compiler allows you to treat all operators as function calls, and does the right thing in the backend anyway
18:52:57FromDiscord<Rika> he wants to be able to use the extra "tolerance" parameter when needed
18:53:06FromDiscord<Rika> and use the regular infix version if not needed
18:55:20axionrayman22201: Inspecting, thanks
18:55:53clyybberPMunch: With which version did you build your macroutils docs?
18:56:00clyybberDid you use that RST script?
18:56:08clyybberBecause its missing dark-mode
18:56:38PMunchWhich docs?
18:57:10rayman22201ok, that's just a matter of passing an optional arg to a function. pretty easy to do in a macro if it's just generating a function call.
18:59:01FromDiscord<Rika> its generating the function body
18:59:11FromDiscord<Rika> consisting of function calls
18:59:29FromDiscord<Rika> eh i think my solution was overkill yeah
19:00:51rayman22201I see what you are saying though.
19:01:18axionYeah I need to be able to pass the tolerance arg in too, and work for any predicate with arbitrary number of args
19:02:19rayman22201I see. That will get a bit more complicated. The macro will have to look up the proc definition of `op` and pull are the arguments, then add maching parameters to the output ast.
19:02:38rayman22201*all the arguments
19:03:00axionI see
19:04:01FromDiscord<Rika> w-was my solution even looked at
19:04:09axionI didn't expect this to be so hard. I suppose I'm just too used to there being no difference between code and AST as with Lisp. The macro in Lisp is just a couple lines
19:04:17*zahary joined #nim
19:04:27axionOh well, not a big deal.
19:04:59FromDiscord<Rika> ;;
19:05:06FromDiscord<Rika> i guess it wasnt looked at lmao
19:05:21clyybberPMunch: https://uploads.peterme.net/macroutils.html <- these ones
19:05:22axionYeah it was
19:06:56*muffindrake quit (Ping timeout: 246 seconds)
19:08:20PMunchOh those, that was just meant as a teaser of the real thing :P
19:08:32PMunchBut they should've been made with 1.0.6 or devel
19:08:50rayman22201Rika, I didn't see it. sorry, just skimmed the irc history. You have the right idea.
19:08:57clyybberoh ok, wheres the real thing?
19:09:24*muffindrake joined #nim
19:09:40FromDiscord<Rika> it relies on the assumption that the signature on the pragma'd proc is the same as the scalar proc
19:10:25axionI didn't get a chance to try it yet, because I've been in the middle of refactoring 3000 lines all day trying to get back to working status :)
19:10:35*Hideki_ joined #nim
19:10:49FromDiscord<Recruit_main707> ok, id need some help, when i compile with --NoMain to a dll (having a DllMain function), using a tool, the only function i can call is NimMain, why?
19:11:07FromDiscord<Recruit_main707> (id post this in off topic but bridge is down
19:11:12FromDiscord<Rika> its ***nonworking*** but the last hurdle is figuring out the length of the Vec being used on compile time (which afaik is the wrong approach i think)
19:11:17PMunchclyybber, well I was hoping it would've been built by the directory. But alas: https://nimble.directory/docs/macroutils
19:11:29PMunchfederico3, am I doing something wrong with my packages?
19:12:27federico3https://nimble.directory/pkg/macroutils --> install test
19:12:56axionPMunch: I'll need these for matrices too: Mat[R,C: static[int]] = array[R*C, float32]
19:13:17axionBut I'd just use the N or R*C type parameters to get the length
19:13:36PMunchfederico3, wait, you're not building with 1.0.6?
19:14:01axionPMunch: err sorry, Rika I meant
19:14:18PMunchHaha, I was confused there for a second
19:15:07*Hideki_ quit (Ping timeout: 250 seconds)
19:15:07federico3no, 1.0.4 but I'll backport .6
19:15:33FromDiscord<Rika> i really have no idea what to do for the macro vector length issue, maybe pmunch can actually help there
19:16:43PMunchUhm, what is the issue?
19:17:46FromDiscord<Rika> https://play.nim-lang.org/#ix=2eAX <-- has an issue regards getting "N"
19:17:56FromDiscord<Rika> which is the length of the vec being worked on
19:17:58rayman22201Rika, oohhhhh. I see what you mean now. won't work
19:18:13FromDiscord<Rika> i dont know of any solutions for that issue
19:18:15axionWe can hold off on thinking about it until I make a first commit and anyone interested can help me simplify the final API with a macro :)
19:18:16rayman22201It works in the original because of the generic param
19:18:20FromDiscord<Rika> yeah
19:18:26rayman22201you need this: https://nim-lang.org/docs/macros.html#bindSym%2C%2CBindSymRule
19:18:29rayman22201experimental feature
19:18:29axionBecause this macro should be able to be called with 2 vectors, or 2 matrices, which have different type signatures
19:19:09FromDiscord<Rika> i dont know if you want to add an experimental feature to your lib
19:19:23rayman22201Problem is, you want to do things with the types (formal proc args in this case) but macros run before type checking
19:20:17axionProbably not. I just want to write this and be done with it, rather than rewrite a good portion of the library if that feature doesn't make it to a release
19:20:39rayman22201Rika, your solution pulls out the ast, and "guesses" the params will be the same. But you loose the generic N (which comes from the type checking)
19:20:41FromDiscord<Recruit_main707> is the creator of winim in here?
19:20:43axionI see
19:21:09rayman22201You need to bind the symbol, so that you can find the type, so you can actually look up the correct args
19:21:22rayman22201I think this can be solved, it's just a PITS
19:21:25rayman22201PITA even
19:21:49axionWell for another time when I can better specify what I want with actual code commited :)
19:22:14FromDiscord<Rika> it really is a PITA i think
19:22:25axionThat playground code is just a subset of what I need, so probably not worth trying to solve it now if it's a PITA
19:22:36FromDiscord<Rika> rayman, i did say that it relies on the assumption that ... (see log)
19:23:15rayman22201yeah, I saw, I'm just telling you why the N doesn't work
19:24:18rayman22201we need a higher level macro wizard like mratsim to help lol
19:24:27axionI appreciate all the help though! Hopefully I'll have an initial revision of my first Nim library pushed soon, and we can go from there.
19:24:46rayman22201Macros can write macros, so I wonder if you can do it in stages
19:25:04rayman22201It's a fun problem :-)
19:25:09FromDiscord<Rika> rayman, i know N doesnt work, i just copied the code from the old macro
19:25:27rayman22201but you said you didn't know why
19:25:52FromDiscord<Rika> i dont know how
19:26:02FromDiscord<Rika> i mean how to get N
19:26:11FromDiscord<Rika> i know why N doesnt work i just dont know how to get it
19:26:18rayman22201the only way to get that N is through the type pass. A.K.A you need the `[N: static[int]]` part
19:28:33shashlickare regular comments not stored in the AST?
19:28:39shashlicki don't see any node type for it
19:28:42shashlickonly documentation comments
19:28:51rayman22201long standing debate. no they are not :-P
19:29:13shashlickugh, nimterop will lose the comment feature then
19:32:18FromDiscord<Rika> F
19:32:49FromGitter<dumjyl> axion: Haven't really been following, but you might need the template swizzle trick: https://play.nim-lang.org/#ix=2eCl
19:38:21*luis_ joined #nim
19:39:17rayman22201axion, you want to pass the extra "tolerance" down to the generated proc right?
19:39:35rayman22201"tolerance" argument
19:41:54*wowaname is now known as opal
19:44:43*zahary quit (Quit: Leaving.)
19:48:02axionYeah, optionally since it is a named parameter.
19:48:14axionor one with a default value, rather
19:48:43axionBut, not limited to 1 argument. If I write another predicate that has 2 extra arguments, it should be possible to use them both.
19:50:17rayman22201right. you want it generic. You basically want to "lift" the types of the first two args into some higher collection type while keeping the rest.
19:53:25*luis_ quit (Ping timeout: 246 seconds)
19:53:44Araqrayman22201, how is your async going? I'm looking forward to it
19:54:09rayman22201lol. How goes the arc fixes for the current async?
20:15:14axionWhere in the nim source tree is the sequtils module stored?
20:16:05FromDiscord<Rika> huh?
20:16:11FromDiscord<Rika> `import sequtils`
20:16:42axionThat wasn't my question :)
20:16:43FromGitter<kaushalmodi> axion: You can go to https://github.com/nim-lang/Nim, hit `t` and type `sequtils`
20:16:55axionI'm trying to find the actual source files on github
20:16:59FromDiscord<Rika> ah
20:17:05FromDiscord<Rika> its in pure
20:17:07FromDiscord<Rika> im pretty sure
20:17:14FromGitter<kaushalmodi> axion: You will find it in `lib/pure/collections/sequtils.nim`
20:17:32axionThanks
20:17:44PMunchaxion, the official docs have a "source" button below each procedure that takes you to the GitHub sources :)
20:17:53FromGitter<kaushalmodi> axion: If you are using Emacs/projectile or similar packages in other editors, you don't need to remember the path
20:17:54axionOh good to know
20:18:42axionI ask because sequtils is a good example of good documentation, and I haven't written any markup languages in a while so I'd like to see the documentation comments :)
20:21:18axionWhat is the difference between `foo` and ``foo``? Not seeing any difference in rendering, but seeing the latter used a lot.
20:21:49FromDiscord<Rika> they look identical to me
20:22:17axionIndeed. My question is why sequtils uses a mixture of both. I don't know the rules of this markup language.
20:23:01FromDiscord<Rika> how do you know theyre different?
20:23:19axionI do not. I'm asking if and how they are.
20:23:30axionand why sequtils comments use both if they are not.
20:24:02FromDiscord<Rika> im not sure i'm understanding what you mean, let me take a look
20:25:39FromDiscord<Rika> i dont see what you mean after reading both the docs and the code
20:25:45FromGitter<kaushalmodi> axion: you mean difference between single backquoting and double-backquoting?
20:26:11axionFor example, line 166 uses single backticks for `n`. Line 180 uses double backticks for ``isSorted`` and ``true``.
20:26:24FromGitter<kaushalmodi> the docs were originally strictly rst format which requiring double-backquoting
20:26:49FromGitter<kaushalmodi> later on, changes were made in the nim docgen, so now we have a hybrid format support: markdown + rst
20:26:57FromGitter<kaushalmodi> so now single-backquoting works too
20:27:05FromGitter<kaushalmodi> in rst, single-backquoting is italics
20:27:06FromDiscord<Rika> discord doesnt show the double and single backticks
20:27:45FromGitter<kaushalmodi> in rst, wrapping in single stars is also italics
20:28:05axionI see
20:28:09FromGitter<kaushalmodi> so I would use the single star wrapping for italics and markdown style single backquoting for code markup
20:28:46axionWhat is double backquote in RST?
20:29:00FromGitter<kaushalmodi> code markup
20:29:30axionSo then I should probably use single star for italics, and double backquote (rather than single as you said) for code, so it renders in both as intended?
20:29:36FromGitter<kaushalmodi> in the latest nim docgen both both single and double backquoting does code markup
20:30:10FromGitter<kaushalmodi> axion: you can.. it's my bias towards more markdown like doc syntax that makes me say that
20:30:34axionThanks
20:30:41FromGitter<kaushalmodi> for the rst syntax that nim doc gen understands, see https://forum.nim-lang.org/about/rst
20:31:07axionI'm really not familiar with RST at all. Just gfmd
20:31:20FromGitter<kaushalmodi> then use markdown!
20:31:28FromGitter<kaushalmodi> and it will still Just Work :)
20:31:37axionGot it
20:31:50FromGitter<kaushalmodi> and it's easy to test your edits..
20:32:05FromGitter<kaushalmodi> edit foo.nim and run `nim doc foo.nim` and see the generated HTML in a browser
20:32:19axionYup been doing that
20:36:07lqdev[m]yeah rst is really picky when it comes to syntax mistakes
20:36:46lqdev[m]but one upside is that your documents are still readable as ASCII
20:37:05axionwhat is this runnableExamples thingy?
20:37:11PMunchI find markdown just as readable..
20:37:27lqdev[m]axion: it's for automated testing when you generate documentation
20:37:30FromGitter<kaushalmodi> `nim doc` will fail if the code under `runnableExamples:` fails
20:37:41Demos[m]I like markdown more because it works better with flexable width fonts
20:37:42PMunchaxion, runnableExamples is examples that end up in your documentation that is also compiled and executed during documentation generation
20:37:44lqdev[m]you can write examples and they will be semchecked on `nim doc`
20:37:46FromGitter<kaushalmodi> that allows the doc examples to stay current
20:37:47axiondo i have to import that from somewhere?
20:37:53PMunchSo it makes sure that your examples can actually run
20:38:08lqdev[m]no, it's in system
20:38:12axionawesome
20:38:20PMunchI like markdown better because it's actually possible to write on the first try
20:38:23axionNim is becoming more awesome by the minute
20:38:39FromGitter<kaushalmodi> axion: you might like the doc examples here too: https://github.com/kaushalmodi/elnim/blob/master/src/elnim.nim
20:38:53FromGitter<kaushalmodi> (as I believe that you have somewhat fondness for lisp)
20:39:03*PMunch quit (Quit: leaving)
20:39:25axionha cool
20:40:41axionSo with runnableExamples, I might even be able to remove all my nimble unit tests
20:40:52FromGitter<kaushalmodi> yes
20:41:12axionThey took me days to write...time to port them to the actual documentation :)
20:41:25FromGitter<kaushalmodi> then you just have Travis or your favorite CI run nim doc and you have testing+doc generation happen in one go
20:42:39*shadowbane quit (Ping timeout: 250 seconds)
20:44:53axionkaushalmodi: what is the difference between doAssert and assert? I just saw you using doAssert for the first time
20:45:08Demos[m]doAssert always runs
20:45:13FromGitter<kaushalmodi> yep
20:45:26axionwhen does assert not?
20:45:42FromGitter<kaushalmodi> they can be disabled using a nim switch
20:45:48axionAh ok
20:46:17FromGitter<kaushalmodi> ```> nim --fullhelp | rg assert ⏎ -a, --assertions:on|off turn assertions on|off``` [https://gitter.im/nim-lang/Nim?at=5e728899190ad049722ac02b]
20:46:53FromGitter<kaushalmodi> axion: Also, if you haven't already, bookmark https://nim-lang.github.io/Nim/theindex.html
20:47:14FromGitter<kaushalmodi> you can Ctrl+F any stdlib proc/macro/etc on that page.. e.g. Ctrl+F doAssert
20:47:25axionNice
20:49:44axionHmm. I cant get runnableExamples to work
20:50:48FromDiscord<Rika> what's wrong
20:50:57lqdev[m]axion: keep in mind that you must import any other modules you use in all runnableExamples sections too
20:51:13axioneven those I import the module that has the Vec4 type, I get this: https://gist.github.com/mfiano/b1533071f15cba9027b09b2acc18789c
20:51:42narimiranVec vs Vec4?
20:52:05FromDiscord<Rika> Vec: for any size
20:52:05lqdev[m]is Vec4 in the same module?
20:52:09axionI can use Vec4.init anywhere else besides runnableExamples
20:53:21FromGitter<kaushalmodi> axion: save this to a foo.nim file and run `nim doc foo.nim` ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e728a418efb7417d7c89006]
20:53:46FromGitter<kaushalmodi> now flip one of those doAsserts and run `nim doc foo.nim` and you will see it fail
20:54:24axionI understand. I just can't get it to see my types
20:55:17FromGitter<kaushalmodi> can you share a snippet?
20:55:31narimiranaxion: see lqdev[m]'s question above
20:56:23FromGitter<kaushalmodi> axion: nevermind I saw the lqdev is already helping you based off your snippet
20:56:30FromGitter<kaushalmodi> s/the/that
20:56:43FromDiscord<Rika> "the lqdev"
20:57:10FromGitter<kaushalmodi> may be he is *the* lqdev around here :)
20:57:35axionsec
20:57:46lqdev[m]gotta make a new game and call it "i wanna be the lqdev"
20:58:26clyybberlike no one ever was
20:58:27axionhttps://play.nim-lang.org/#ix=2eCV
20:59:22clyybberaxion: Does it work when you import the file yourself in the runnableExamples?
20:59:56Araqclyybber, I merged my PR
20:59:58axionclyybber: Yep
21:00:06Araqbut it's disabled (scope based destruction)
21:00:08axionThat is rather unfortuante I have to do that for every example
21:00:09narimiranaxion: it works for me locally
21:01:36disruptekmiran: you still sick?
21:01:55narimirandisruptek: i'm feeling fine currently
21:02:24disruptek👍
21:03:47axionMy type definition is in another file from the init proc, and at the top of the file I do import types.nim. So my examples don't see it because apparantly runnableExamples doesn't import the same module
21:03:59axionSo is there a way around that apart from importing in every single example?
21:04:22FromGitter<kaushalmodi> axion: I confirm that your example works for me on devel fb641483f0e2ed974b89d629ea5ec28e5e6145ce as well
21:04:41axionRight but did you put the type definition in another file that is imported?
21:04:43lqdev[m]axion: no, each runnableExamples has to import your module
21:05:44axionI fixed it by putting `export types` after I import it.
21:05:53narimiran(`include` might do the trick)
21:09:57axion`include` is wrong here because the generated documentation will duplicate what is included.
21:10:15*oculux joined #nim
21:13:36clyybberAraq: Ah, nice. I'll have a go at it once I figure out this corruption
21:13:51*narimiran quit (Ping timeout: 250 seconds)
21:16:18FromDiscord<Spy653> Does nim have anything in the works regarding on metal development
21:16:35disruptekwell, it works.
21:16:46disruptek--os:any --gc:none etc.
21:17:01disruptekor it's --os:ansi_c ... i cannot remember.
21:17:38Zevvhttps://nim-lang.github.io/Nim/nimc.html#nim-for-embedded-systems
21:19:51FromDiscord<exelotl> It's generally good for it. You will need to generate C code if you want to store data in ROM though (besides a few trivial cases, like numeric LUTs)
21:21:03clyybberZevv: ping
21:21:24clyybberZevv: It looks like --threads:on --gc:arc --d:useMalloc doesn't work
21:27:55*blackbeard420 quit (Quit: ZNC 1.7.5 - https://znc.in)
21:28:15*blackbeard420 joined #nim
21:28:58*tdog quit (Ping timeout: 246 seconds)
21:32:17FromDiscord<Recruit_main707> i am pretty sure there is a big issue with winim
21:32:37FromDiscord<Recruit_main707> are there any other wrappers for kernel32?
21:36:57FromDiscord<Recruit_main707> how can i install this?
21:36:57FromDiscord<Recruit_main707> https://nim-lang.org/0.11.0/windows.html
21:36:59*natrys quit (Quit: natrys)
21:37:28leorizeRecruit_main707: what's you problem with winim?
21:37:32leorizeI think it works kinda well
21:37:47FromDiscord<Recruit_main707> u see, hModule is just a typedef of LPVOID
21:38:23FromDiscord<Recruit_main707> but if i try to pass hModule to something expecting LPVOID, i cant, (which its what i see being done in c++)
21:38:34leorizewhat's the error message?
21:38:42leorizewhat's your code?
21:39:01Araqclyybber, https://github.com/nim-lang/Nim/pull/13685
21:39:02disbotenable --tlsEmulation:on for --gc:arc
21:41:29FromDiscord<Recruit_main707> leorize: https://play.nim-lang.org/#ix=2eD7
21:42:05leorizeif you believe that they are interchangable just convert it?
21:43:19leorizeI'm pretty sure HMODULE is distinct from LPVOID is to prevent you from mixing it up
21:43:27leorizeHMODULE is typed and LPVOID is not
21:43:43leorizewelcome to the superior type system
21:43:56leorize:P
21:44:20leorizenote that for pointers, you don't really have to cast
21:44:28leorizejust LPVOID() is enough
21:45:37disruptek~stream
21:45:38disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
21:45:43disruptekleorize: come explain ryu.
21:45:50Araqleorize, where is the PR?
21:46:05leorize?
21:47:21FromDiscord<Recruit_main707> LPVOID(hModule) doesnt work :/
21:47:37leorizecast then?
21:47:50FromDiscord<Recruit_main707> but even if it worked that way, c++ doesnt do all of this
21:47:52disruptekleorize: for ryu.
21:50:52FromDiscord<Recruit_main707> leorize: which doesnt work bc i tried :p
21:51:08leorizethat sounds wrong, what's the error when you tried
21:51:47FromDiscord<Recruit_main707> well, first of all, that i do need an hModule in my function
21:53:07FromDiscord<Spy653> Sorry boys and girls got busy after sending the last one
21:53:16FromDiscord<Recruit_main707> and also errors at runtime if i dont use it
21:55:23FromDiscord<Spy653> I'm an entry level OS developer and currently use rust as my main language but am wondering which is realistically better or if they compliment each other well
21:56:07FromDiscord<Rika> what do you mean metal, metal as in baremetal or metal as in OSX's lib
21:56:14FromDiscord<Rika> oh
21:56:16FromDiscord<Rika> baremetal
21:58:17FromDiscord<Recruit_main707> anyway, how would i install this module windows thing?
21:58:17FromDiscord<Recruit_main707> https://nim-lang.org/0.11.0/windows.html
21:58:36leorizeit's not there anymore
21:58:42leorize!packages windows
21:58:43disbothttps://github.com/ba0f3/subhook.nim -- 9subhook: 11subhook wrapper
21:58:43disbothttps://github.com/trustable-code/NiGui -- 9nigui: 11NiGui is a cross-platform, desktop GUI toolkit using native widgets.
21:58:43disbothttps://github.com/ba0f3/uibuilder.nim -- 9uibuilder: 11UI building with Gnome's Glade 7& 10 more...
21:58:48leorizeyea it's dead
21:59:05FromDiscord<Recruit_main707> u gotta be kidding D:
21:59:42FromDiscord<Rika> get it from the master branch, it MIGHT be there lmao
22:00:51FromDiscord<Recruit_main707> where is it though
22:02:08FromDiscord<Rika> theres a search in github
22:04:34leorizeRecruit_main707: HMODULE is not LPVOID btw
22:04:44leorizeit's an int
22:04:45FromDiscord<Recruit_main707> its typedef of LPVOID
22:04:48FromDiscord<Recruit_main707> ?
22:04:53leorizewhat's the C code that you base your code from?
22:05:41FromDiscord<Recruit_main707> cpp (i know its a bit shady, but i am not using it with malicius purposes)
22:05:46FromDiscord<Recruit_main707> https://pastebin.com/ywA9qzCg
22:07:01leorizehttps://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types
22:07:04leorizeno they aren't the same
22:07:08leorizeHMODULE is not LPVOID
22:07:42leorizeit's based on HANDLE and HANDLE is an int
22:07:47FromDiscord<Recruit_main707> they do use it as so
22:08:36*federico2 joined #nim
22:09:24FromDiscord<Recruit_main707> `CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)HackThread, hModule, 0, nullptr));`
22:09:48leorizeif it works that's luck :P
22:09:57leorizetry passing the addr to hmodule
22:10:22*federico2 quit (Client Quit)
22:10:39leorizedoes that C code actually runs?
22:10:59FromDiscord<Recruit_main707> not only it runs, everyone uses it like that
22:11:05leorizeyou can read on this here: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createthread
22:11:16leorizelpParameter should be a pointer to the argument
22:11:27leorizeyou can `cast` if you insist
22:11:28FromDiscord<Recruit_main707> i know
22:11:48leorizeif you're uncertain just check the C code
22:12:23FromDiscord<Recruit_main707> it seems ill have to
22:13:19clyybberoh oh :/
22:13:30leorizeoh yea this part is really really crucial
22:13:31clyybberI think I might ruin the release date
22:13:35leorizehave you called NimMain?
22:13:47leorizeif you don't call that the GC won't be initialized
22:13:58FromDiscord<Recruit_main707> yep, manually in fact, its the only one i can call
22:14:28leorizeclyybber: what? :P
22:14:41FromDiscord<Recruit_main707> with an injector
22:14:46FromDiscord<Recruit_main707> oh, nvm
22:15:18leorizewhat does your winapi pragma resolves into?
22:15:36leorizelooks like I get what they are doing now
22:15:43leorizethis is pure luck
22:16:03leorizehModule has the same size as a pointer
22:16:14FromDiscord<Recruit_main707> i see
22:16:16*federico3_ joined #nim
22:16:19leorizeand it will be passed verbatim to your thread proc
22:16:29leorizewhich is why it worked out for them
22:16:32leorizethis is why I hate C
22:16:56FromDiscord<Recruit_main707> hmm, can i stick to this bad way of doing it in Nim?
22:16:56clyybberAraq: Thanks!
22:17:03FromDiscord<Recruit_main707> to keep things simple?
22:17:16leorizejust cast and it should work
22:17:27leorizeyour bigger problem is why doesn't it work
22:17:38leorizewhat does your {.winapi.} pragma resolves into?
22:17:38FromDiscord<Recruit_main707> and then cast it back inside my function?
22:17:49leorizeyou don't have to, luckily
22:19:16leorizethe part that matters would be why won't your function run
22:19:30FromDiscord<Recruit_main707> ok, then related to it not running...
22:19:31leorizeah... you're playing with fire here
22:19:49leorizeGC-ed memory inside a thread not spawned by the stdlib
22:20:24FromDiscord<Recruit_main707> using echo could be the issue then?
22:20:37leorizeyep, try --gc:arc instead
22:20:44FromDiscord<Recruit_main707> no devel :(
22:20:48*federico3_ quit (Client Quit)
22:20:55leorizeif you're in an older version of nim, then call setupForeignThreadGc()
22:21:02leorizein the thread before anything else
22:21:16leorizeremember to compile with --threads:on
22:21:46leorizenote that you don't have to exportc your MyThread, but make sure that it's stdcall
22:22:21FromDiscord<Recruit_main707> where should i put that line?
22:22:32leorizefirst thing in the thread
22:22:37leorizein MyThread
22:22:56FromDiscord<Recruit_main707> and compile with gc:none?
22:23:11leorizeyou may use the GC after you call that
22:23:15*federico3_ joined #nim
22:23:53leorizebut remember, no passing GC-ed data between threads
22:24:16*solitudesf quit (Ping timeout: 246 seconds)
22:24:18Araqjust use --gc:arc
22:25:13FromDiscord<Recruit_main707> is there a little guide on how to install in windows?
22:25:26FromDiscord<Recruit_main707> i definetely will
22:25:44leorizehttps://github.com/nim-lang/nightlies/releases
22:25:52leorizethere you go, or you can compile it yourself
22:26:15FromDiscord<Recruit_main707> fingers crossed
22:26:30FromDiscord<Recruit_main707> (that didnt work btw)
22:26:41leorizewhat didn't work :P
22:26:57FromDiscord<Recruit_main707> setupForeignThreadGc()... thing
22:27:45leorizewhat does your {.winapi.} pragma resolves into?
22:29:15FromDiscord<Recruit_main707> idk, i just use it wherever its used in cpp
22:29:23FromDiscord<Recruit_main707> it doesnt seem to do much
22:29:34leorizeofc it did nothing
22:29:35FromDiscord<Recruit_main707> code fails the same way if i dont use it
22:29:38leorizeyou didn't give it a meaning
22:29:52leorizeWINAPI means `{.stdcall.}` in Nim
22:30:24leorizeif you wanna keep `{.winapi.}`, then create a custom pragma with: `{.pragma: winapi, stdcall.}`
22:31:15leorizewe need error messages for using a pragma that is not declared
22:31:28FromDiscord<Recruit_main707> winapi is a winim macro
22:31:37leorizeah ok then
22:31:39leorizephew
22:32:23leorizewell add {.stdcall.} just to be sure
22:32:32leorizehttps://github.com/khchen/winim/blob/d300192c588f73dddef26e3c317f148aa23465c3/winim/inc/winimbase.nim#L21
22:32:38FromDiscord<Recruit_main707> have it just in case ;)
22:32:40leorizebecause winapi doesn't mean stdcall in winim :)
22:33:37leorizewith stdcall in place you might see less errors
22:33:57leorizelooks like the winapi macro was an internal thing for winim :P
22:34:41FromDiscord<Recruit_main707> it didnt really even do nothing, ill get it out
22:34:45leorizemaybe you can make a pr to winim to add stdcall into it so that it resembles the real thing: https://stackoverflow.com/questions/2348442/what-does-winapi-in-main-function-mean
22:35:49FromDiscord<Recruit_main707> o_0 Error: expression cannot
22:35:49FromDiscord<Recruit_main707> be cast to pointer
22:36:13leorizewell the full message would be nicer
22:36:20FromDiscord<Recruit_main707> thats it XD
22:36:31leorizewith line info and where is it lol
22:37:02FromDiscord<Recruit_main707> seems to be a problem with winim
22:37:19leorizeI don't think so
22:37:25FromDiscord<Recruit_main707> winim-3.2.4\winim\winstr.nim(319, 14)
22:37:38leorizeah ok now it is :P
22:39:11leorizewell just keep looking to see what go wrong :P
22:39:56FromDiscord<Recruit_main707> i might have done something wrong in installation
22:40:08FromDiscord<Recruit_main707> will run koch also
22:41:01*tane quit (Quit: Leaving)
22:43:01FromDiscord<Recruit_main707> ok, now it worked
22:43:09FromDiscord<Recruit_main707> compiled*
22:45:21FromDiscord<Recruit_main707> no luck
22:45:33FromDiscord<Recruit_main707> well, at least now i have nim 1.1.1
22:45:36leorize:P what's the problem now?
22:45:43FromDiscord<Recruit_main707> same as b4
22:45:53FromDiscord<Recruit_main707> gimme a sec and i copy the message
22:47:00FromDiscord<Recruit_main707> `Force load module failed:failed finding address of msvcrt!__dllonexit`
22:47:08FromDiscord<Recruit_main707> from injector
22:47:13clyybberaaaaargh, I'm so stupid
22:47:42leorizeRecruit_main707: that doesn't sound like your problem...
22:47:54leorizedoes it work with other dlls on your machine?
22:48:10clyybberput a manual `=destroy` in a wrong location and spent hours searching for the bug
22:48:26FromDiscord<Recruit_main707> leorize, i do get it to run until CloseHandle(CreateThread(...))
22:49:03FromDiscord<Recruit_main707> so essentially, yes, injector works fine, and code runs
22:50:13leorize[m]have you tried googling that error message?
22:50:22leorize[m]you can try to compare the generated C code too
22:51:48FromDiscord<Recruit_main707> only injector related issues, will look into the cache, is it impossible to trick the compiler and just run it without casting and all that?
22:53:02leorize[m]cast looks like an operation to you, but it literally means nothing
22:53:13leorize[m]it just tell the compiler to shut up because you know better
22:54:38leorize[m]besides, the passed hmodule is just a parameter, you aren't even touching it in your thread
22:54:51leorize[m]so it's not related to it
22:57:09*federico3_ quit (Quit: WeeChat 2.7.1)
22:57:18FromDiscord<Recruit_main707> if i dont create a thread and just call the function it works
22:57:59*federico3_ joined #nim
22:58:35*federico3_ quit (Client Quit)
22:59:24leorize[m]how does your code look like atm?
22:59:37leorize[m]and have you compared the C code?
23:00:04leorize[m]use the --nimcache parameter to specify where should the compiler generates it
23:01:24FromDiscord<Recruit_main707> sorry, was trying things
23:08:06leorize[m]I don't know if you can just use the stdlib facilities to spawn a thread instead of doing all this by yourself :p
23:08:30FromDiscord<Recruit_main707> in the cache, every time HMODULE should appear, `NI` appears, is that alright?
23:09:10leorize[m]yep, it's the same type
23:12:06*Hideki_ joined #nim
23:12:15FromDiscord<Recruit_main707> can i modify the cache code and then compile it?
23:16:22FromDiscord<Recruit_main707> c++ NULL = nil,
23:16:22FromDiscord<Recruit_main707> c++ nullptr = nil?
23:16:34FromDiscord<Recruit_main707> ptr nil?
23:17:01*Hideki_ quit (Ping timeout: 264 seconds)
23:17:45FromDiscord<Recruit_main707> ill do the only reasonable thing to do in this situation, individually wrap every function i use and make sure it does what i want
23:25:59*Trustable quit (Remote host closed the connection)
23:41:38*lritter quit (Ping timeout: 256 seconds)
23:59:49*clyybber quit (Quit: WeeChat 2.7.1)