<< 30-10-2020 >>

00:21:46ForumUpdaterBotNew thread by Treeform: Is there a way for case objects to have cases share fields?, see https://forum.nim-lang.org/t/7011
00:26:23FromGitter<jrfondren> not that much of a pain to reduce actually: https://github.com/nim-lang/Nim/issues/15778
00:26:25disbotβž₯ Viewtype codegen error turns a single proc call into two ; snippet at 12https://play.nim-lang.org/#ix=2Crw
00:28:45sealmoveis there a way to resolve ambiguous call? if 2 procs match, specify which one will be used (set priority)
00:29:26FromDiscord<ElegantBeef> named parameters is one way
00:29:47FromDiscord<ElegantBeef> you can also use a qualified call of `moduleName.procName`
00:31:29sealmovemaybe there is a better solution to my problem. to avoid X-Y problem: what I am trying to do is create a more lenient `==`. For example be able to compare a seq[int] with a seq[uint32]
00:32:52sealmoveso I defined a 'proc `==`*[T: SomeInteger, U: SomeInteger](a: seq[T], b: seq[U]): bool', but when T and U is the same type, it conficts with system modules's.
00:33:11sealmoveand I can't know beforehands if T is same as U.
00:36:08FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Cry
00:36:09FromGitter<jrfondren> the module using this can import system except `==`
00:36:10FromDiscord<ElegantBeef> Ehh?
00:36:37FromGitter<jrfondren> ElegantBeef: try it with the == in its own module
00:36:37sealmovejrfondren oh that might just work
00:37:01sealmoveElegantBeef thanks, I'll try it
00:37:06FromDiscord<ElegantBeef> Ah yes the importing of it would make it the same as system
00:37:31FromDiscord<ElegantBeef> Could always use something like `~=` be it uglier
00:39:13sealmovelol ElegantBeef, I was thinking of using exactly `~=`
00:40:02sealmoveyeah the name conflict is not a problem if I use your type inspection idea (when T is Y)
00:40:05FromDiscord<ElegantBeef> Well it's not too silly since a `seq[byte]` isnt really equal to a `seq[int]`
00:40:14sealmoveyes I like it
00:40:36sealmovei want to avoid using same symbol anyways, just didn't think of inspecting type with the `is` operator
00:40:47FromDiscord<ElegantBeef> Ah
00:41:04FromDiscord<ElegantBeef> Me actually suggesting a proper solution, that's the first πŸ˜„
00:46:12FromDiscord<nikki> @ElegantBeef nah i think you've brought up some good stuff here before 8)
00:52:56sealmoveended up with this https://play.nim-lang.org/#ix=2Crz
00:54:12FromDiscord<ElegantBeef> Why are you using auto?
00:54:35sealmovewhich can work recursively now that I think of it: https://play.nim-lang.org/#ix=2CrA
00:55:05sealmovewell, I am using it in a test suite for testing equality against anything
00:55:39FromDiscord<ElegantBeef> Doesnt this just work? https://play.nim-lang.org/#ix=2CrC
00:55:49FromDiscord<ElegantBeef> Ah shit that length is an issue
00:55:51FromDiscord<ElegantBeef> Shit run!
00:56:18FromDiscord<ElegantBeef> It'll fail on tables and arrays though
00:56:39sealmovehmm
00:56:39FromDiscord<ElegantBeef> The auto is useless it can just be `[T, U]` afaik
00:56:55sealmoveah right yeah of course
00:57:04sealmovethx for the suggestion
00:57:44*Zectbumo joined #nim
00:58:34sealmovethe language I am testing doesn't have arrays and tables so I think I'm ok :>
00:58:43FromDiscord<ElegantBeef> ok
01:12:59*waleee-cl quit (Quit: Connection closed for inactivity)
01:19:05*mbomba quit (Ping timeout: 258 seconds)
01:30:41sealmoveany ideas for symbols for a custom division proc?
01:30:58sealmovei thought `//` but it's used by rationals module
01:42:49*abm quit (Read error: Connection reset by peer)
01:43:50*TomDotTom quit (Ping timeout: 264 seconds)
01:50:46*hnOsmium0001 quit (Read error: Connection reset by peer)
01:51:39*hnOsmium0001 joined #nim
01:52:47*whaletechno quit (Quit: ha det bra)
01:57:48FromDiscord<tinygiant> When using `parsecfg`, is there an easy way to loop a specific section within a cfg? If I know the section name, can I get (or check) all the values within only that section when the instance is loaded via `loadConfig`, of do I need to `open` the file and loop every line until I find what I'm looking for?
01:59:49sealmoveyou have a `Config = OrderedTableRef[string, OrderedTableRef[string, string]]`
02:00:56sealmoveif i am not mistaken the keys of the outer OrderedTable correspond to sections.
02:01:07sealmoveso you can just do `for s in myConfig.keys`?
02:02:17sealmoveand if you want to get all values in a section then `for k, v in myConfig[mySection]`
02:02:48FromDiscord<tinygiant> sealmove, thanks for the data, sounds promising, I'll do some looking into that. This will be my first foray into config files and tables, so ... much to learn. In you example, is `myConfig` the name of the OrderedTableRef?
02:03:02sealmovejust lookup Nim's table semantics ;)
02:03:07FromDiscord<tinygiant> Wilco.
02:03:48sealmoveyes, myConfig would be what `loadConfig` returns to you
02:04:11sealmoveand `mySection` would be a string
02:06:23FromDiscord<tinygiant> Ok, confusion resolved, for some reason I completely missed this: `Config = OrderedTableRef[string, OrderedTableRef[string, string]]`, thinking it was you pointing me to creating a table from that data, when in fact, it is the definition of the `Config` type. That resolves a lot of problems. Thanks for helping me realize how slow I am tonight!
02:06:52sealmovehappy to help
02:16:14*apahl quit (Ping timeout: 264 seconds)
02:17:46*apahl joined #nim
02:29:33*Prestige quit (Quit: Prestige)
02:32:49*Prestige joined #nim
02:34:45*jwm224 quit (Ping timeout: 260 seconds)
02:40:33*waleee-cl joined #nim
02:42:47*Zectbumo quit (Remote host closed the connection)
02:50:59FromGitter<gogolxdong> @shashlick ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5f9b7f937cac87158f75acd9]
02:51:18FromDiscord<nikki> is using vcc as the main / default compiler well-supported? / how does one say to default to vcc when installing nim with choosenim? like if i wanted to use it for the compiler itself and everything. if that makes sense
02:52:02FromDiscord<ElegantBeef> I could be wrong, but i believe you'd just modify the nim.cfg file wherever that is πŸ˜„
03:17:48*muffindrake quit (Ping timeout: 268 seconds)
03:19:27*muffindrake joined #nim
03:23:34*unihernandez22 joined #nim
03:29:52*Zectbumo joined #nim
03:31:39*vicfred joined #nim
03:38:40*Zectbumo quit (Remote host closed the connection)
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:33*supakeen joined #nim
04:15:50leorize[m]1@nikki you can set that in the config but afaik Nim CI does not test vcc so ymmv
04:17:51FromDiscord<nikki> ah i see. i may just keep using mingw since it should be fine. main thing is i want to use msvc in a particular project but i'm already just using nim compleOnly + cmake for that haha
04:21:17*mbomba joined #nim
04:39:09FromDiscord<tinygiant> If I can retrieve an existing JArray (`let jarray = json[key].getElems`, which correctly returns `@["elem1","elem2"]`, how can I add an element to this array? `.getElems` returns a `seq[JsonNode]`, where I'm trying to add a `JsonNode` with `.add`. This line throws an error: `jarray.add(%value)`, but this line works fine when I'm starting with an empty array (`newJArray`). Thanks!
04:43:23FromDiscord<ElegantBeef> Uhh https://play.nim-lang.org/#ix=2Csd
04:45:49FromDiscord<ElegantBeef> Oh you're using `let` that makes it immutable
04:49:01FromDiscord<tinygiant> Hrm. So I was trying to retrieve the value (an array), then modify and put back in, when the right answer was to modify in place. Ok, I got that concept and it worked in my code. Changing `let` to `var` didn't fix my earlier attempt, but that's a good catch. A mistake I've made quite often as I learn this new language.
04:50:07FromDiscord<ElegantBeef> Well jsonnodes are reference objects so you can do this https://play.nim-lang.org/#ix=2Cse
04:52:24FromDiscord<ElegantBeef> Just to show how you'd do it with `getElems` https://play.nim-lang.org/#ix=2Csf
04:52:42FromDiscord<ElegantBeef> I think i covered all bases πŸ˜„
04:55:11FromDiscord<tinygiant> sent a code paste, see https://play.nim-lang.org/#ix=2Csg
04:56:01*mbomba quit (Quit: WeeChat 2.9)
04:56:14FromDiscord<ElegantBeef> Just need to learn how to wrangle the types πŸ˜„
04:58:52FromDiscord<tinygiant> Yeah, I'd say that's been a weakness as I work through some of my battles. So it seems the `.add` works, but is there an easy way to remove one of the elements? Didn't see a method for that in json.nim. Iterate through the arrays .mitems?
04:59:23sealmovethere is delete()
04:59:36sealmovewhich works for any seq type
04:59:51FromDiscord<ElegantBeef> Well wont for a jarray
05:00:05FromDiscord<ElegantBeef> But yea delete will work if working with sequences
05:00:51FromDiscord<tinygiant> Since `getElems` returns `seq[JsonNode]`, delete will work on it. Good to know. My mind isn't crossing module borders yet.
05:01:12FromDiscord<ElegantBeef> Worth noting that for loop is actually redundant(Didnt think to check) `data["arr"] = % arDat` works πŸ˜„
05:01:24sealmoveJArray is just an alias for seq[JsonNode]
05:01:34FromDiscord<ElegantBeef> No it's not
05:01:44sealmoveno yeah my bad
05:01:51FromDiscord<ElegantBeef> It's an object variat
05:01:51sealmoveit's an enum value
05:01:54FromDiscord<ElegantBeef> (edit) "variat" => "varinat"
05:01:58FromDiscord<ElegantBeef> variant even πŸ˜„
05:02:21FromDiscord<ElegantBeef> https://nim-lang.org/docs/json.html#JsonNodeObj just for completions sake
05:02:52sealmovei even used it today lol i am stupid
05:02:58sealmoveor just tired
05:04:01FromDiscord<tinygiant> sent a code paste, see https://play.nim-lang.org/#ix=2Csl
05:04:32FromDiscord<ElegantBeef> Oh i was going off the example where you use get elms add it to the seq then add it to the json node πŸ˜„
05:04:42FromDiscord<ElegantBeef> This un https://play.nim-lang.org/#ix=2Csm
05:05:15FromDiscord<tinygiant> Ah, ok. Yeah, there's a whole bunch of version of this in my cranium now. I hope to eventually end up at a point where I can take the input seq[strings] and add only the ones that aren't already in the JArray. Baby steps.
05:05:44FromDiscord<ElegantBeef> Same, probably added a bit of confusion with my endless variations
05:06:11FromDiscord<ElegantBeef> Message me in a few minutes and i'll create new variation to compound any confusion πŸ˜„
05:06:17FromDiscord<tinygiant> Maybe. I can learn from reading, but seeing all the variations helps cement it.
05:19:46*waleee-cl quit (Quit: Connection closed for inactivity)
05:25:20*vicfred quit (Quit: Leaving)
05:44:12*unihernandez22 quit (Quit: Leaving)
05:50:04*narimiran joined #nim
05:51:41bungcould nimlsp support nim file outline?
05:56:27Prestigebung: technically it can support anything in the lsp specification https://microsoft.github.io/language-server-protocol/specifications/specification-current/
05:56:58Prestigebut nimlsp just uses nimsuggest, so I think the support would have to be there first. Not sure on that
06:01:14bungI haven't seen a extension that support nim outline , let me check nimsuggest first, if not I might use regex searching procs
06:02:19Prestigebuilding a plugin or something?
06:02:43PrestigeI think regex would be easy to implement for it, if it's not supported
06:08:42bungit has outline command , I may create a PR for nimlsp
06:09:34Prestigeis that part of the lsp specification tho?
06:10:39leorize[m]1disruptek: is your CPS macro an AST-AST transformation that doesn't rely on backend features?
06:12:10bungPrestige dont know , let me check, just thought it is basic IDE feature
06:12:32Prestigehm well document symbols is one
06:12:40Prestigeand nimlsp hasn't implemented it
06:13:54bungit's textDocument/documentSymbol
06:14:07bungyeah
06:16:39bungmy project grows and serveral files about 1k lines, so I actually need this feature now
06:21:55Prestigeyou using vim?
06:25:57bungI use vscode
06:26:27Prestigeah, can't help you there
06:35:34bungI'll create PR of this for nimlsp
06:55:28*solitudesf joined #nim
07:12:24*mwbrown quit (Ping timeout: 240 seconds)
07:19:32*mwbrown joined #nim
07:42:31*rockcavera is now known as Guest14700
07:42:32*tiorock joined #nim
07:42:32*Guest14700 quit (Killed (tolkien.freenode.net (Nickname regained by services)))
07:42:32*tiorock is now known as rockcavera
07:53:43bungdoes the nimsuggest outline command provide proc args info ?
07:59:35*hnOsmium0001 quit (Quit: Connection closed for inactivity)
07:59:43FromDiscord<lqdev> nope
08:06:39bungoh, I noticed it has no template in results
08:08:51*oculux quit (Quit: blah)
08:09:26*oculux joined #nim
08:09:36*oculux quit (Client Quit)
08:10:09*oculux joined #nim
08:18:21*oculux quit (Quit: blah)
08:22:06*oculux joined #nim
08:32:29bungI've create a PR for this https://github.com/PMunch/nimlsp/pull/58
08:32:29disbotβž₯ textDocument/documentSymbol support
08:43:23PrestigeOh nice bung
08:44:06bung:)
08:49:31ForumUpdaterBotNew thread by ElAfalw: Get all procs in given module, see https://forum.nim-lang.org/t/7012
08:58:14*letto quit (Remote host closed the connection)
09:00:05*solitudesf1 quit (Quit: Idle for 30+ days)
09:02:07*letto joined #nim
09:03:11*letto quit (Client Quit)
09:05:43*JustASlacker joined #nim
09:07:02*letto joined #nim
09:10:15FromGitter<gogolxdong> @shashlick ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5f9bd8772a60f731f7247b4f]
09:29:56*letto quit (Quit: Konversation terminated!)
09:31:00Araqsince it keeps coming up: any good solutions for the problem that people want their favorite helper procs in the stdlib but if we add anything we would be drowning in helpers?
09:31:58FromDiscord<haxscramper> Redirect everything to fusion? Isn't that what it supposed to be for anyway
09:34:07*letto joined #nim
09:34:12Araqit's hardly a solution, then we have same problem in fusion
09:34:39Araqat least it doesn't have the precious 'std/' then
09:39:47FromDiscord<mratsim> "moduletraits"
09:40:14FromDiscord<lqdev> std/coolstuf
09:40:16FromDiscord<lqdev> (edit) "std/coolstuf" => "std/coolstuff"
09:40:29FromDiscord<mratsim> The talk by deech last year was about listing imported proc, and there is also a RFC of feature request about that iirc
09:45:56Yardanicowhy not make a community-maintained package akin to nim-stew?
09:45:59Yardanicofor all those "helper" procs
09:47:19Araqmaybe but then people want to use these helpers in the compiler too
09:47:30Araqand then it must be available for bootstrapping
09:57:22bungoranize some people vote for that , take it into or not
10:02:33*xet7 quit (Remote host closed the connection)
10:03:17FromDiscord<flywind> hash value differs in compile time and runtime, is it intended behaviour?
10:03:54FromDiscord<flywind> (edit) "time" => "time(nimvm)"
10:04:03*xet7 joined #nim
10:22:52*lritter joined #nim
10:25:29FromDiscord<flywind> I guess `hash` function for JS backend needs some changes.
10:34:45FromGitter<gogolxdong> There isn't tsNodeType() anywhere in nimterope nor Nim compiler, where is it from?
10:34:54YardanicotsNodeType?
10:35:02Yardanicocan you link to the line where it is called?
10:35:06Yardanicoand what project?
10:35:24*PMunch joined #nim
10:35:34Yardanicoah found it
10:35:42AraqPMunch, /socketstreams.nim(144, 14) Error: type mismatch: got <proc (s: Stream){.gcsafe, locks: <unknown>.}> but expected 'proc (s: Stream){.nimcall, gcsafe.}'
10:35:42Araq.tag effects differ
10:35:42Araq.tag effects differ
10:35:45FromGitter<gogolxdong> https://github.com/nimterop/nimterop/blob/master/nimterop/toastlib/tshelp.nim#L46
10:36:04PMunchYeah I know, can't figure it out..
10:36:20Yardanicoit's from treesitter
10:36:37AraqPMunch, can you reproduce it?
10:37:03PMunchLocally?
10:37:45FromGitter<gogolxdong> error comes from $node, before .tsNodeType()
10:38:02Yardanicowell I'm not sure what you're asking
10:38:05YardanicotsNodeType is from treesitter
10:38:17YardanicoI think it's generated by https://github.com/nimterop/nimterop/blob/master/nimterop/treesitter/tsgen.nim
10:38:40Yardanicoah lol
10:38:43Yardanicohttps://github.com/nimterop/nimterop/blob/master/nimterop/treesitter/api.nim#L152
10:38:48Yardanicocase insensitivity right ;)
10:41:36FromGitter<gogolxdong> errors on `$` for enum type definition when using nimterop to translate C project.
10:42:05Yardanicowell you might want to ask shashlick and describe the issue for him precisely :)
10:43:27Araqalso try c2nim
10:45:31PMunchAraq, yeah I'm able to reproduce locally
10:59:14FromDiscord<scott> sent a code paste, see https://play.nim-lang.org/#ix=2Cty
10:59:43PMunchHow did you trigger that?
11:00:25FromDiscord<scott> i don't have a minimal reproduction of it. just trying to compile a small project
11:00:41FromDiscord<scott> it's a bug?
11:01:16PMunchYeah, it's a bug in the compiler. Those are really quite hard to find nowadays..
11:01:22PMunchWhat Nim version?
11:02:40FromDiscord<scott> 1.4.0, --threads:on
11:02:57FromDiscord<scott> I'm good at breaking compilers lol
11:04:42PMunchHaha, evidently
11:05:14PMunchI'm not too versed in the compiler error messages, so I can't really help without a minimal example..
11:06:01FromDiscord<scott> well here is the whole example, I'll try to whittle out parts of it. https://github.com/dscottboggs/drives/blob/master/src/drivespkg/menu.nim
11:09:58PMunchHmm, I just get this error when I try to compile that: https://github.com/dscottboggs/drives.git
11:10:04PMunchOops: drives/src/drivespkg/find_drives.nim(41, 23) Error: undeclared identifier: 'rex'
11:10:39FromDiscord<scott> the project depends on `regex` sorry I forgot to put that in the thing
11:11:02FromDiscord<scott> this project is not anywhere near done sorry it's a mess
11:15:29FromDiscord<scott> sent a code paste, see https://play.nim-lang.org/#ix=2CtE
11:16:07FromGitter<gogolxdong> `c2nImport("c:/FFmpeg/fftools/ffplay.c", recurse=true,flags="--skipcomments --concat",nimFile="c:/ffplay/ffplaytest.nim")`
11:18:51FromGitter<gogolxdong> skipcomments doesn't skip comments in this context, it does in a smaller test.
11:22:14*apahl quit (Ping timeout: 264 seconds)
11:23:00*apahl joined #nim
11:25:39PMunch@scott, why have you tagged eventListener with nimcall?
11:27:09*abm joined #nim
11:27:46PMunchOh and by the way, the "rex" thing was just my installed regex library was out of date
11:32:53FromDiscord<scott> the compiler said that `createThread` required that argument to have that pragma
11:33:03FromDiscord<scott> I was actually just about to ask what that means
11:34:46PMunchhttps://nim-lang.org/docs/manual.html#types-procedural-type
11:34:51PMunchIt's the default for Nim
11:35:03PMunchPretty much just the same as fastcall
11:35:26PMunchBut without forcing it for compilers that don't support it
11:36:28FromDiscord<scott> so...why does that make it illegal to capture some var?
11:38:30PMunchNot a clue..
11:39:27FromDiscord<flywind> `uint64` doesn't work in VM with JS backend?
11:39:55FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2CtJ
11:40:10FromDiscord<flywind> Gave: 2025677871↡-1598805830
11:40:39PMunchAh, @scott, your issue was declaring the channel as `var` in the tuple
11:40:41FromDiscord<lqdev> @scott because it's not a closure
11:40:44PMunchhttp://ix.io/2CtK <- this works
11:41:09*superbia joined #nim
11:41:14PMunchOr rather, it compiles, whether it works or not I have no idea :P
11:41:30superbiais anybody streaming atm?
11:41:43PMunchsuperbia, no, any reason we should?
11:41:59superbiaI don't want to ask stupid questions on stream :P
11:42:08PMunchOh, you said streaming :P
11:42:13PMunchI thought you said screaming :P
11:42:25superbiaso somebody IS streaming ?
11:42:33PMunchNot AFAIK
11:42:46superbiaok, perfect, I can talk freely now
11:43:06FromDiscord<scott> Oh, I see, you have to make the whole tuple var. Well, I was hoping to leave menu immutable to the thread but whatever
11:43:18superbiawell first quick question
11:43:22PMunchHaha, if someone was streaming they would probably only react to related questions
11:43:24superbiaPMunch: in your code you new return? why ?
11:43:30PMunchscott, why would you want the channel to be a var?
11:43:31superbianew result*
11:43:43PMunchI think you might misunderstand the mutability thing here..
11:43:47FromDiscord<scott> wait, no, `data` isn't var, how is this compiling? I thought `send()` requires var
11:44:37PMunchsuperbia, because I'm creating a ref object. `new` will allocate that kind of object for me
11:45:03PMunchIf it was just object I wouldn't need it, and if it was ref object and I didn't do it I would get null pointer exceptions if I tried to access the fields
11:45:15PMunch@scott, no the channel itself doesn't have to be var
11:45:29FromDiscord<Rika> send only needs a var channel
11:45:32FromDiscord<Rika> what?
11:45:37FromDiscord<scott> https://nim-lang.org/docs/channels.html all take a `var Channel[T]`
11:45:43superbiaPMunch: ok makes sense
11:45:43PMunchOh..
11:46:05PMunchHmm, typically you need to pass channels with `ptr` to a thread if I'm not mistaken
11:46:06FromDiscord<Rika> because `eventStream` is var,
11:46:09PMunchOherwise it will send a copy
11:46:11FromDiscord<Rika> though `data[1]` isnt
11:46:39FromDiscord<Rika> unless you already made the tuple var
11:47:09FromDiscord<Rika> in which case, i think doing `data[1]` makes a copy...
11:47:42PMunchNo passing it to a thread will always make a copy IIRC
11:48:12PMunchHave a look at this: https://nim-lang.org/docs/channels.html#example-passing-channels-safely
11:48:13FromDiscord<scott> can I just ask how to properly use a channel to communicate between two threads where one is created with `createThread`?
11:48:45PMunch(be sure to read the text in the beginning first)
11:49:10FromDiscord<scott> yeah I see
11:50:01PMunchI this case I'd just set the channel as a global
11:50:18PMunchIt's by far the easiest
11:52:19FromDiscord<scott> yup that compiles thanks
11:53:00PMunchTo be fair though, you use the channel in a `while true` loop that only quits when the program ends as far as I can tell. So it should be safe to just pass a pointer to your local variable. It won't be GCed
11:55:23FromDiscord<scott> fair enough
11:55:36FromDiscord<scott> thanks for the help
11:56:05PMunchNo problem, working with threads in Nim can be a bit tricky
11:56:25PMunchMostly because not a lot of people do it, so the documentation and libraries are a bit lacking
12:04:32Zevvsealmove: what was with precedence?
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:32*supakeen joined #nim
12:11:21sealmovehttps://play.nim-lang.org/#ix=2Cu5 instead of https://play.nim-lang.org/#ix=2Cu6
12:13:53FromDiscord<shashlick> @gogolxdong just got on - please open an issue - and again, use nimterop on h files, not c
12:19:34PMunch@scott, created an issue for you: https://github.com/nim-lang/Nim/issues/15793
12:19:34disbotβž₯ Illegal type in tuple passed to Thread generic crashes the compiler
12:19:49PMunchWell, not so much for you, but from your issue
12:22:12Zevvsealmove: aah right
12:22:16Zevvnice job
12:22:31Zevvdude who can ever understand that kind of stuff
12:26:27sealmovethe one who uses them I guess :P
12:26:42FromDiscord<mratsim> I'm innocent
12:26:44*TomDotTom joined #nim
12:27:00*mathsaey quit (Remote host closed the connection)
12:28:07FromDiscord<Rika> doubt
12:30:57FromDiscord<scott> Thank you very much PMunch
12:31:00*superbia quit (Quit: WeeChat 2.9)
12:31:19PMunchNo problem
12:44:21PMunchHmm, did the unused imports error become more (a bit too) aggressive?
12:44:48PMunchI get a bunch of errors saying cef_dynlib is unused: https://github.com/jangko/nimCEF/blob/devel/cef/cef_import.nim
12:45:13PMunchEven though that's where CEF_LIB_NAME comes from, and removing the import throws an error that it is not defined..
12:51:58FromDiscord<flywind> !eval proc hello(result: int): auto = discard; hello(12)
12:52:00NimBotCompile failed: /usercode/in.nim(1, 1) Error: redefinition of 'result'; previous declaration here: /usercode/in.nim(1, 12)
13:02:34PMunchHaha, ouch
13:02:39PMunchmacros.nim(586, 33) Error: type mismatch: got <cstring, cint, ptr cef_string_utf16>
13:02:48PMunchBy the way, what are up with these error messages?
13:02:54PMunchCompletely useless..
13:04:58Araqguys, esp. Yardanico reducing this program https://github.com/nim-lang/Nim/issues/15753 would be most helpful
13:05:00disbotβž₯ Program SIGSEGV when using '--gc:orc' ; snippet at 12https://play.nim-lang.org/#ix=2Cul
13:13:11*natrys joined #nim
13:21:00*JustASlacker quit (Remote host closed the connection)
13:30:53FromDiscord<tomck> Hello - i'm writing a networked application, and have a nimble package with 2 binaries - 'client' and 'server'
13:31:08FromDiscord<tomck> is there any way to specify nimble dependencies depending on the binary?
13:31:32FromDiscord<tomck> e.g. I want to require some graphics rendering dependencies if you're building the client, but if you're building the server those aren't needed
13:32:06FromDiscord<tomck> I'm currently running with `nimble run client` and `nimble run server`, i have `client` and `server` listed in nimble's `bin` array
13:34:45FromDiscord<krisppurg> What do you call `-d:somethingDefinable`, do you call it a defined variable or a defined word?
13:35:33FromDiscord<tomck> afaik it's just a 'define', i don't think it's a variable
13:36:19FromDiscord<tomck> unless nim specifically calls it a 'word' somewhere, i'd get 'word' confused with 'machine word', i.e. https://en.wikipedia.org/wiki/Word_(computer_architecture)
13:36:46FromDiscord<krisppurg> I want to make a section for my library docs for example:↡Definable words:↡↡- `-d:discordCompress`, `-d:discordv8`, `-d:dimscordDebug` etc
13:36:59FromDiscord<krisppurg> (edit) "I want to make" => "sent" | "section for my library docs for example:↡Definable words:↡↡- `-d:discordCompress`, `-d:discordv8`, `-d:dimscordDebug` etc" => "long message, see http://ix.io/2Cut"
13:37:14FromDiscord<tomck> Yeah just call it 'defines' or 'options'
13:37:31FromDiscord<krisppurg> alright
13:51:08*mmohammadi9812 quit (Quit: Quit)
14:04:09PMunch@tomck, I don't think you can declare dependencies like that. What you probably want is two separate .nimble files
14:06:27FromDiscord<tomck> alright thanks
14:06:32FromDiscord<tomck> can i have 2 nimble files in the same dir?
14:06:51FromDiscord<tomck> i don't want to have to fuck around with 3 packages, one for server, one for client, one for shared definitions
14:07:10Araqnot the same dir, but in the same git repo
14:07:34FromDiscord<tomck> ok so i probably end up with 3 pkgs?
14:07:50FromDiscord<tomck> i'll see how it goes with the graphics dependency in the server binary
14:09:54FromDiscord<tomck> I'm using 'netty' to send reliable data over UDP, but it only lets me send strings through it's api - https://github.com/treeform/netty↡↡Is this normal? does nim treat strings as just a generic owned storage of bytes? Or should i edit this? I'm assuming a `string` is always allocated?
14:10:24FromDiscord<tomck> so if i can serialise on the stack b/c i know the size of everything beforehand, this api will force me to allocate & copy, right?
14:11:17FromDiscord<Rika> would be better if it had a proc for openarray i guess
14:11:50FromDiscord<tomck> can i add arbitrary bytes into a string? or will there be some utf8 encoding going on?
14:12:06FromGitter<jrfondren> Nim strings can have arbitrary data on them. UTF8 is required by operations rather than the type, so that's not a problem
14:14:23FromDiscord<tomck> so how would i go about appending a 4-byte int to a string?
14:14:50FromDiscord<tomck> `cast[array[uint8,4]](123123)` to get it to a byte array, then...?
14:14:56FromDiscord<tomck> concat with `&`?
14:17:10*mmohammadi9812 joined #nim
14:19:02FromGitter<jrfondren> https://play.nim-lang.org/#ix=2CuH - you can pipe that to |od -c to see the bytes
14:19:15FromGitter<jrfondren> you probably want to switch the endianness though
14:19:54FromGitter<jrfondren> std/endians has swapEndianXX procs that you can use for that
14:20:01FromDiscord<tomck> interesting, so you can go from int -> uint8[4], but not from int -> uint8[4]?
14:20:15FromDiscord<tomck> or does the `&` proc for `string` only work with `ptr array[uint8, n]`?
14:23:13FromGitter<jrfondren> do you mean, "you can go from ptr int -> ptr array[4, char] but not int -> array[4, char]" ? maybe you can do the latter, but to me a bare int might be in a register and not really make sense to 'cast' to bytes, but an int in memory always can be.
14:24:05PMunchHmm, did typed macros use to output their input by default?
14:24:07FromGitter<jrfondren> casting ptrs makes more sense to me, and I've done a lot of that in the last few days and this has worked fine. f.e. to go the other way around I might `cast [ptr UncheckedArray[T]](buffer[0].addr)[0]`
14:24:58FromGitter<jrfondren> i.e., dereference from address of the 0th element of a string as if it were a ptr to arrays of some T
14:25:25FromDiscord<tomck> makes sense, thanks
14:28:33PMunchAppears so..
14:32:06*jxy joined #nim
14:34:27FromGitter<jrfondren> come to think of it `cast[ptr T](s[0].addr)[]` is an easier way to do that... UncheckedArrays still work for 'rithmetic
14:37:27*mathsaey joined #nim
14:39:32*mmohammadi9812 quit (Ping timeout: 272 seconds)
14:48:57*mathsaey quit (Quit: mathsaey)
14:49:16*mathsaey joined #nim
14:50:58FromDiscord<tomck> Hmmm is there no way to convert to network / host endian?
14:51:05FromDiscord<tomck> i see only big/little and swap endian functions in std/endian#
14:51:06FromDiscord<tomck> (edit) "std/endian#" => "std/endians"
14:52:24*mmohammadi9812 joined #nim
14:52:34FromDiscord<tomck> or do i use cpuEndian and manually do it?
14:53:00FromGitter<jrfondren> network is bigendian; I test cpuEndian and conditionally call swapEndianXX
14:53:52FromGitter<jrfondren> it might be more convenient for you to pull htonl/htons from C FFI
14:57:37PMunchDecided to stream again after having made and eaten dinner
14:57:41PMunchJust a heads up
14:57:54PMunchWill probably be in about 1-2 hours
15:00:30FromDiscord<Idefau> nice
15:01:57*Q-Master joined #nim
15:05:32*mathsaey_ joined #nim
15:07:25*mathsaey quit (Ping timeout: 240 seconds)
15:13:09*waleee-cl joined #nim
15:13:39*mathsaey joined #nim
15:16:48*mathsaey_ quit (Ping timeout: 256 seconds)
15:21:06FromDiscord<tomck> hmm, so i have an openArray[byte]
15:21:32FromDiscord<tomck> i want to get a pointer into that array, so i'm trying `arr[0].addr`, but it's complaining about the openArray[byte] not having an address
15:21:54FromDiscord<tomck> if i make it `var openArray[byte]`, it's complaining about `openArray[byte]` being an invalid type for a `var`
15:21:58FromDiscord<tomck> so i just use `unsafeAddr`?
15:22:37FromDiscord<Clyybber> yep
15:23:31FromDiscord<tomck> alright cool - will usnafeAddr always be fine for an openarray?
15:23:53FromDiscord<Clyybber> yeah
15:23:57FromDiscord<tomck> brill
15:24:01FromDiscord<Clyybber> in the future arr[0].addr might work too
15:24:06FromDiscord<Clyybber> but for now just use unsafeAddr
15:27:28*vicfred joined #nim
15:30:32*mathsaey quit (Quit: mathsaey)
15:47:40*NimBot joined #nim
15:48:03FromDiscord<tomck> Hmm, how to convert an openArray[byte] to a string?
15:49:25FromDiscord<tomck> doesn't ened to be \0 terminated
15:49:56FromGitter<jrfondren> ah, that problem came up for me too, I don't know if there's an easy way. I ended up doing newString() and inserting bytes in a loop
15:50:05FromDiscord<tomck> yeesh
15:50:40FromGitter<jrfondren> I'm not an expert, and I haven't asked yet. There might be a ready proc lying around somewhere.
15:50:41FromDiscord<tomck> is `string` defined to us? or is it opaque, only the compiler knows?
15:50:48FromGitter<jrfondren> it's going to require copying anyway
15:50:52FromDiscord<tomck> as in, can i create the `string` container myself?
15:51:08FromDiscord<tomck> yes, but i'd rather do it with a pre-allocated buffer & a memcpy rather than looping over bytes
15:51:09FromGitter<jrfondren> "only the compiler knows", but Araq's said that it's always going to be laid out the same as seq[char]
15:51:22FromDiscord<tomck> is char == byte?
15:51:23FromGitter<jrfondren> ah well you can certainly do that still
15:51:27FromGitter<jrfondren> with newString() and then copyMem
15:51:50FromDiscord<tomck> ah i see, didn't realise you could initialise it with some capacity
15:53:08FromGitter<jrfondren> yes, char == byte == uint8. There's not even performance implications to it, like D's autodecoding. AIUI which you go with is more of a question of how many free type conversions your code will have in the end, to use procs that require one type or the other
15:53:20*rokups joined #nim
15:54:25*mathsaey joined #nim
15:54:36FromGitter<jrfondren> I remember that people using different types made crypto work a little bit annoying, not sure how that shaked out.
15:56:42*hnOsmium0001 joined #nim
15:57:32FromGitter<jrfondren> and this just came up, which might be useful for you: https://github.com/treeform/flatty/blob/master/src/flatty/binny.nim
15:58:15FromGitter<jrfondren> ... that completely assumes a little endian arch though.
16:01:42*tane joined #nim
16:31:25*rockcavera quit (Remote host closed the connection)
16:37:34ForumUpdaterBotNew thread by Freeflow: Nim update failure, see https://forum.nim-lang.org/t/7013
16:50:42*superbia joined #nim
16:51:39*superbia quit (Client Quit)
16:55:15*superbia joined #nim
17:05:28*rusua joined #nim
17:07:39*vicfred quit (Quit: Leaving)
17:10:39PMunchOkay, I'm back and ready
17:10:41PMunchStream is up
17:11:06FromDiscord<Recruit_main707> link?
17:11:06PMunch~PMunch is streaming at https://twitch.tw/pmunche
17:11:07disbotPMunch: 11a metaprogramming aficionado and long time Nim user who can be found at peterme.net
17:11:07disbotPMunch: 11streaming at https://twitch.tw/pmunche
17:11:28FromDiscord<Recruit_main707> twitch.tw?
17:11:33PMunchCrap
17:11:37PMunch~PMunch is streaming at https://twitch.tv/pmunche
17:11:37disbotPMunch: 11a metaprogramming aficionado and long time Nim user who can be found at peterme.net
17:11:37disbotPMunch: 11streaming at https://twitch.tv/pmunche
17:15:37*vicfred joined #nim
17:29:05*superbia quit (Quit: WeeChat 2.9)
17:30:56Zevvdude the beard
17:32:31FromDiscord<lqdev> it's cool
17:32:53*Jesin quit (Quit: Leaving)
17:32:55Zevvsuch much
17:35:26*Kaivo quit (Ping timeout: 258 seconds)
17:35:57FromDiscord<AmjadHD> Hello, are there any sublime text users here interested in improving the user experience with nim in this editor ?↡For now the only plugin that provides syntax highlighting is the the apparently unmaintained Nimlime https://packagecontrol.io/packages/NimLime
17:37:43*Kaivo joined #nim
17:38:15FromDiscord<AmjadHD> It uses the old tmLanguage format and does not follow scope naming guidelines https://www.sublimetext.com/docs/scope_naming.html
17:38:51FromDiscord<AmjadHD> In many places.
17:40:53supakeenNice setup PMunch :)
17:41:44Yardanico@AmjadHD you can also use nimlsp with sublimetext for autocompletion and stuff, but syntax definition is an issue
17:44:16FromDiscord<AmjadHD> I'm aware of lsp, and one of the reasons i'm not satisfied with Nimlime is that it tries to fill lsp's role.
17:45:04Yardanicowell, nimlime is mostly unmaintained IIRC
17:46:52FromDiscord<AmjadHD> Well I don't understand why there isn't any initiative of a decent Nim syntax for sublime text.
17:47:22FromDiscord<Idefau> because there is an initiative for lsp that works with most editors
17:47:40FromDiscord<AmjadHD> No I mean syntax.
17:47:47disruptekleorize[m]1: yes.
17:48:33ZevvPMunch: you shoud integrate with some ioselector
17:48:47Zevvor add a sleep for a few ms, but you should be ashame of yourself if you do that
17:49:17*rockcavera joined #nim
17:49:23Yardanico@AmjadHD because not enough people use sublimetext with nim in the first place :)
17:49:29Yardanicoand sublimetext is losing popularity in general
17:49:48Yardanicoand RAM usage isn't that *much* smaller than with VSCode really, sublimetext is like at least ~300mb ram
17:50:04FromGitter<yglukhov> disruptek: hey, trying to wrap my head around atoz/s3 + digitalocean. is it possible?
17:50:18disruptekof course.
17:50:43disruptekisn't DO just a host?
17:50:56FromGitter<yglukhov> yep. how can i change it?
17:51:13disrupteki think i don't understand.
17:51:22disruptekyou want to speak s3 protocol to DO?
17:51:33disruptekthey have an open-s3 type deal?
17:51:36FromGitter<yglukhov> how do i specify the host? it seems to be hardcoded as far as i understand
17:51:57FromGitter<yglukhov> oh, no, DO has s3 buckets
17:51:57disruptekahh. you can hack individual calls if you want.
17:52:14FromDiscord<AmjadHD> All editor are losing popularity to vscode, but that doesn't justify abandoning them
17:52:16FromDiscord<dom96> PMunch: you should rename your stream, it's "test stream" right now πŸ™‚
17:52:45FromDiscord<dom96> AmjadHD: if you care about Sublime then by all means make Nim work well with it πŸ™‚
17:52:47disruptekyglukhov: you need to look at the openapi docs; that's where i demo hacking the api frameworks.
17:53:03disruptekyou can override individual hosts, create your own api interface, whatever.
17:53:17FromGitter<yglukhov> thanks, will do
17:53:44disrupteklemme know if you still have questions after you see that stuff. i just got power back so i don't even have a web-browser yet. 😁
17:54:06FromGitter<yglukhov> alright :)
18:01:08FromDiscord<dom96> yglukhov: what you working on? πŸ™‚
18:04:32*haxscramper joined #nim
18:05:31FromDiscord<AmjadHD> @dom96 I don't know how that's why I came here to ask if there are any sublime users.↡It's just I find it weird that the one can simply neglect all the users of one of the top text editors just like that.
18:07:06FromDiscord<reilly> What's the most convenient way of getting the last `n` characters of a string?
18:07:21disrupteks[^10 .. ^1]
18:07:38FromDiscord<reilly> Where 10 is n?
18:07:43disruptekwhat else?
18:08:00FromDiscord<reilly> Fair.
18:09:30FromDiscord<nikki> @AmjadHD no one is neglecting sublime users on purpose or something. this isn't some kind of antagonistic situation. people are just working on the things they're interested in, and using the things they want to. it's all open source. and you're welcome to help too πŸ˜…
18:10:02disruptekhey, that's not fair.
18:10:09FromDiscord<nikki> your first question was whether there are other sublime users here in this chat rn; and it seems like no
18:10:11disrupteki am definitely antagonizing.
18:10:42FromDiscord<nikki> maybe in some sublime community, you could find people that would be interested in helping you support nim? or if you put some effort into it it may inspire others
18:11:03FromDiscord<nikki> oh word disruptek. well. carry on then πŸ˜„
18:11:03FromDiscord<Idefau> i am antagonizing non-emacs users
18:11:38disruptekrude.
18:11:47disruptekif you don't use neovim, you're dead to me.
18:11:50FromDiscord<nikki> disruptek do u use ed
18:12:05FromDiscord<Idefau> ed - the standard editor
18:12:07FromDiscord<nikki> i'm vim8 all the way
18:12:07disruptekwhy would i ever need to edit anything? whatever i type is perfect.
18:12:19FromDiscord<nikki> yeah could just use cat
18:12:24FromDiscord<nikki> or echo
18:12:25FromDiscord<Idefau> just use echo
18:13:07FromDiscord<Idefau> just cat /dev/tty > code.nim
18:13:32FromDiscord<nikki> could also use a heredoc
18:16:24FromGitter<yglukhov> dom96: it's just a game. nothing too interesting ;)
18:17:27FromDiscord<nikki> yglukhov: the nimsl lib was cool. do you end up using it much?
18:18:39FromDiscord<dom96> yglukhov: all you need is DO ;P
18:18:54FromDiscord<Idefau> Destroy gO?
18:19:04FromDiscord<Idefau> i agree
18:19:59haxscramperIf I compiler tests for fusion pattern matching on nim 1.0.10 it just dies with codegen error. If I do this on 1.2.0+ it all works as expected. Diff between two generated files is approximately 30k lines, while c source *itself* is about the same size. I did a quick comparison is not just in something like names - 1.0.0 is missing several fields for objects too. This is basically the reason why code fails: I have something like `type A
18:20:00haxscramper= object hidden: float` and `func public(a: A): string = $a.hidden`. 1.0.10 just fails with `error: ... has no member named β€˜hidden’`. And the `nimln_` points exactly int the `public` function, so I'm probably looking in the right place.
18:20:00haxscramper
18:20:00haxscramperSo the question is: what can I do to make up for this difference in codegen between 1.0.10 and 1.2.0 - it is basically so different that test suite just simply fails to compile. Everything works on 1.2.0.
18:21:11disruptekwrite more tests.
18:22:06haxscramperAnd I'm kind of stuck - nim code is right, but 1.0.0 is just so wrong on codegen level that I don't even know where to start. And I can't reproduce it standalone. Haven't tried just deleting parts of the test suite though, so I should probably try that. To at least minimize things.
18:22:40FromGitter<yglukhov> nikki: well it is being used because there's some old code using it. Not that we're writing a lot of new code using it. vulkan kinda messed it all up)
18:22:53disruptekto help, we need specific information. to provide that, you need smaller tests.
18:23:33FromGitter<yglukhov> disruptek: it seems the problem is in atozSign. it only likes aws stuff...
18:23:38FromDiscord<nikki> yglukhov: it seems like glsl -> spirv -> ... is still a thing and maybe even the normal khronos way tho right
18:23:54disruptekthat makes sense.
18:24:17disruptekyou can reimplement atozHook.
18:24:33FromGitter<yglukhov> oh man
18:24:52FromDiscord<nikki> yglukhov: does nimsl target any specific glsl version? like is it more about "attribute / varying" than "in / out" or does it support both. i've been working on sth. that should run in both webgl1 and opengl3 and so on haha
18:25:06FromGitter<yglukhov> disruptek: whats your vision about atoz in general? how high level should it be in the end?
18:25:16disruptekor reimpl atozSign, i guess.
18:25:26disruptekprobably you need to do the hook, though.
18:25:51disrupteki needed atoz, so i wrote openapi. but i expect people to use these as the basis for their own apis.
18:26:01*Jesin joined #nim
18:26:12disrupteklike, i have a more idiomatic cloud api called `nigel` that does this.
18:27:09disruptek!requires atoz
18:27:10disbotatoz: 11epiphone/erverless-nim-sample 71 total
18:29:06*bung quit (Quit: Lost terminal)
18:29:21FromGitter<yglukhov> disruptek: i don't think I can "do the hook". atozHook is a method of the Call class. and there's no way i can substitute existing impl of it. only subclass. but then i have to recreate all the callable instances
18:30:11disruptekfair point.
18:30:11FromGitter<yglukhov> i guess i'll use a different sdk for now...
18:30:27disruptekyou can just write your own s3 generator using the one from atoz as an example.
18:30:57FromGitter<yglukhov> eemm... it kinda seems too much of a hassle at this point)
18:31:02disruptekokay.
18:31:47haxscramperNim <= 1.0.10 cannot properly handle identically-named types, defined in different scopes - https://play.nim-lang.org/#ix=2CvV . So if I have `block: type A = object` multiple times, it will only work for first type. And second will have codegen errors on fields.
18:32:10disrupteksounds like you know what the problem is and how to solve it.
18:32:10FromGitter<yglukhov> but hey, i'll be glad to test it once it's fixed ;)
18:32:26disruptekit's fixed.
18:32:56FromGitter<yglukhov> okay :)
18:34:16disruptekit hasn't changed appreciably in over a year. maybe get yourself a cloud provider with better support.
18:34:41FromGitter<yglukhov> right. with aws domain names :)
18:35:00disrupteknow you're talkin'. πŸ˜€
18:38:13FromGitter<yglukhov> nikki: i don't really remember at this point. i believe it's just one version, that works "everywhere".
18:38:38FromGitter<yglukhov> only attribute / varying
18:41:20FromDiscord<nikki> ah i see. i thiiiink that version doesn't work on macos anymore 😐 but may be wrong
18:41:46FromDiscord<nikki> may not be hard to change the codegen for those parts if i end up using it tho
18:42:15FromGitter<yglukhov> it does work on macos. and ios too. tested every day :)
18:45:54FromDiscord<nikki> oh nice! how do you do the gl context setup in the tests πŸ€” in the repo test i only see tests for string comparison without running on gpu / or for cpu emulation
18:46:56FromGitter<yglukhov> it is being tested manually :) it's part of the project i'm working on
18:51:27*rokups quit (Quit: Connection closed for inactivity)
18:53:17*Kaivo quit (Ping timeout: 268 seconds)
18:55:10*Kaivo joined #nim
18:57:54ForumUpdaterBotNew thread by AmjadBHD: Sublime Text user experience, see https://forum.nim-lang.org/t/7014
19:03:26leorize[m]1haxscramper: try to see if the fix is in a newer nim, then request a backport for it to 1.0.x
19:06:15leorize[m]1disruptek: how are you supposed to use the cps macro?
19:06:58leorize[m]1I'm gonna test this thing on JS for you :P I need closure iterators and we don't have them here
19:25:20disruptekhow are you supposed to use it?
19:26:27Zevvyeah, how are we supposed to use that, disruptek?!
19:27:12disruptekthis is zevv's department.
19:27:28Zevvwell, currently we are not using it
19:27:32Zevvbecause it is broookeeen
19:27:42disruptek0.0.13 works.
19:27:47Zevvbut it sucks
19:27:59disruptekjs won't know the difference.
19:28:59Zevvand anyway, stash/* is broken on 0.0.13
19:29:10Zevvand those were all I cared about
19:29:43disruptekhuh.
19:30:22disruptekleorize[m]1: whining at clyybber won't help, but it will show you are ONE OF US.
19:30:24Zevvah unreachable code after return is an ERROR these days
19:30:42Zevvyes. whining at clyybber will not help. we tried that
19:33:56YardanicoZevv: it's not
19:34:04Yardanicoin fact it's the opposite
19:34:13Yardanicounreachable code was an error, but it's a warning now
19:34:34Yardanicosee https://github.com/nim-lang/RFCs/issues/240
19:34:35disbotβž₯ Make "unreachable statement" error a warning ; snippet at 12https://play.nim-lang.org/#ix=2q6i
19:35:26Yardanicohttps://play.nim-lang.org/#ix=2Cwc
19:35:29FromDiscord<reilly> I don't know how to async. I have two async procs that I want to run in tandem. How can I do this?
19:35:30ZevvYardanico: yeah you're right, I'm on the wrong machine
19:35:37Yardanico/usercode/in.nim(3, 8) Warning: unreachable code after 'return' statement or '{.noReturn.}' proc [UnreachableCode]
19:35:49Zevv0.0.13 indeed kind of works
19:35:49Yardanico@reilly wdym by "tandem"
19:35:56Zevvbut we want typed. we want typed.
19:35:57Yardanicoasync is mostly relevant for IO-related stuff
19:36:21*rockcavera quit (Remote host closed the connection)
19:36:29Yardanicoyou can just use asyncCheck proc1(); asyncCheck proc2() but this might not do what you want
19:36:39disruptekasyncCheck is for chumps.
19:36:42disrupteknever use it.
19:36:51Zevvuse cps instead
19:36:54Zevvthe typed version
19:36:56Zevvoh no wait
19:36:58Zevvthat's broken
19:37:01disruptekleorize[m]1: how does "kinda works" sound to you?
19:37:17Zevvit also "kinda works" in js, is that better?
19:37:17disruptekZevv: maybe the problem is that araq doesn't care.
19:37:48FromDiscord<reilly> These two procedures should both run forever. I've tried just doing it with threads, but either Nim doesn't like that, or I'm doing something wrong, so I'm trying async instead.
19:38:06Yardanicoasync won't help you if you're not doing IO
19:38:14Yardanicoplease provide more context
19:38:22Zevvdisruptek: yeah that's funny, he really doesn't, does he
19:38:56leorize[m]1disruptek: I'll let you know once I try it
19:38:58ZevvI read somewhere in the 0.14 notes a new async is underway anyway, so I guess cps is no longer needed
19:39:19disrupteki can't wait for 0.14.
19:39:28FromDiscord<reilly> This is IO. To oversimplify a bit, one procedure waits to receive requests and the other sends them.
19:40:07Yardanicowell, then then you can use async provided you use async versions of receiving/sending procedures
19:40:22Yardanicoe.g. AsyncHttpClient instead of HttpClient
19:40:28Yardanicoadd {.async.} pragma, "await" where needed, etc
19:40:41disruptekyou're blowin' my mind right now.
19:43:00FromDiscord<reilly> I'm using what are, as far as I can tell, pre-made event loops. I need to run both of them simultaneously.
19:43:25disruptekfucking nuts.
19:43:31Zevvreilly: maybe you don't need async
19:43:50disruptekZevv: did you not hear?
19:44:16disruptekpre-made event loops running simultaneously.
19:44:41FromDiscord<nikki> https://www.reddit.com/r/nim/comments/jgtogh/how_to_do_type_inference_on_proc_return/ga6wyqx/ <-- huh is there any reason typedesc params should be 'slower' than passing types explicitly as `foo[T1, T2]` πŸ€” i don't see why but this comment mentions it and i'm new to this stuff so jw
19:45:12Yardanicotypedesc can't be "slow" really
19:45:16Yardanicothey don't exist at runtime anyway
19:45:31FromDiscord<nikki> yeah i don't understand what the comment is getting at about typedesc then haha
19:46:43Yardanicoi think they haven't run the program like 10-30 times to average the times
19:46:44FromDiscord<ElegantBeef> Do they mean faster to type?
19:46:49Yardanicono
19:46:52Yardanicothey explicitly mention runtime
19:46:59YardanicoI mean runtime timings
19:47:07FromDiscord<ElegantBeef> Ah yea didnt see the comments
19:47:30FromDiscord<nikki> i'm currently just using it as a way to prevent needing to do `obj.foo[:Type](arg)` and instead do `obj.foo(Type, arg)`
19:48:48disruptekyuck.
19:50:51FromDiscord<nikki> it's not for u disruptek, it's for me >:)
19:51:41disrupteksorry; it's just a reaction to seeing beef in the chat.
19:51:57FromDiscord<nikki> are you vegan?
19:52:03disruptekno.
19:52:27Zevvthere's beef in gelatine, right?
19:52:29FromDiscord<Rika> now say yuck a second time
19:52:45FromDiscord<nikki> Zevv: idk maybe we should ask beef
19:56:59FromDiscord<ElegantBeef> Gelatine is typically scrapings off of the skin and remnants of the full animal
19:57:04FromDiscord<Daniel> 0/ new user here πŸ‘‹
19:57:06FromDiscord<ElegantBeef> Disruptek dont act like you dont like me
19:57:08FromDiscord<ElegantBeef> Yellow
19:57:15FromDiscord<ElegantBeef> Welcome to the greatest language no one uses πŸ˜›
19:57:43FromDiscord<Daniel> Thanks↡Why no one uses it?
19:58:24FromDiscord<ElegantBeef> It's just a joke due to the relatively low usage numbers compared to the very popular langauges
20:00:00FromDiscord<Daniel> Sounds good. I started by reading this guide http://ssalewski.de/nimprogramming.html#_statements
20:00:18FromDiscord<Daniel> I am using notepad++, but it doesnt support nim...or does it?
20:00:30Yardanicoit supports nim highlighting
20:00:41Yardanicoalso there's https://narimiran.github.io/nim-basics/ which is quite similar to salewski's work
20:00:43Yardanicothey're both good
20:00:45Prestigewow, really?
20:01:01YardanicoPrestige: why wouldn't it?
20:01:17Yardanicobut it's listed as "nimrod" iirc
20:01:23Yardanicoi haven't used it in ages
20:01:24FromDiscord<Daniel> alright, so which one is more preferred salewski's or narimiran?
20:01:30Prestigenotepad++ supporting nim syntax? I just didn't expect anything of that program lol
20:01:34Yardanico@Daniel you can read both :)
20:01:40YardanicoPrestige: notepad != notepad++
20:01:53Yardaniconotepad++ is an open source program, not related to MS's notepad
20:02:01PrestigeYeah Ik
20:02:04FromDiscord<Daniel> yes, i could read everything on internet, but thats waste of time....which one is more preffered?
20:02:12Yardanicothere's no "more preferred"
20:02:15FromDiscord<nikki> i followed the "nim in action" book for the past couple weeks and it was great
20:02:28Prestigestill don't expect anything of it, didn't think ppl actually used it
20:02:31FromDiscord<ElegantBeef> The most perferred method is the one that you do πŸ˜„
20:02:52FromDiscord<nikki> yeah whatever you find fun and makes you happy about coding πŸ™‚
20:03:15FromDiscord<Daniel> well, lets put it like this...i dont want to read about topics such as: What is an Operating System?↡What is Computer Programming?↡What is a Computer Program?
20:03:40FromDiscord<nikki> i think you are best equipped to glance over a read and find out if it's the one for you
20:03:44FromDiscord<Daniel> since i already know this, as i am using operating system, i am using computer...etc
20:03:56Yardanicowell salewski's book covers CS topics more
20:04:01Yardanico"nim basics" is just an intro to nim
20:04:09YardanicoI mean more than nim basics
20:04:21Yardanicoreally just check https://nim-lang.org/learn.html
20:04:38FromDiscord<nikki> i have liked nim in action + nim manual itself (it's more spec'y / rigorous but i like that stuff) + reading the various articles like the one on destructors on the main website
20:04:53FromDiscord<nikki> eg. https://nim-lang.org/docs/destructors.html
20:05:01FromDiscord<nikki> lots of really solid info around
20:05:29FromDiscord<nikki> also, cloning the nim repo itself and using lsp and navigating around it
20:05:39FromDiscord<nikki> plus, reading the generated C output of things you make
20:05:58FromDiscord<nikki> these are ideas; again only you are equipped with the personal context that makes any of these ideas the one for you
20:06:21FromDiscord<reilly> I haven't had any luck trying to do it with threads. If my thread's proc isn't annotated with `{.async.}`, the `startSession()` event loop suddenly becomes an undeclared identifier. If I do make it `{.async.}`, now thread's proc is an undeclared identifier.
20:06:45FromDiscord<nikki> @reilly i believe threads and async are separate things (they can interact, but they aren't about the same system)
20:07:03FromDiscord<nikki> async afaict is actually for single threaded asynchronous mostly i/o things (or event dispatch on that thread for other reasons like timers)
20:07:18FromDiscord<nikki> and the container type is `Future[T]`. which is diff from `FlowVar[T]` for the thready things
20:07:25FromDiscord<nikki> still kind of a nim noob tho so may be off
20:07:33FromDiscord<reilly> Well there has to be some way of running two different async things at the same time.
20:07:54FromDiscord<Daniel> i mean, i posted some similar post on forum here https://forum.nim-lang.org/t/6964#43615↡Stefan_Salewski first responded, but by page 20, to me it seems to wide and general
20:08:04FromDiscord<nikki> yes what that means is that, they are simultaneously blocked on something they are waiting on, so the appearance of the execution counter across them is simultaneous
20:08:05Yardanicoif they're not "async" on the nim side, you can't really call it asynchronously from nim
20:08:09Yardanicowell, not without threads
20:08:10FromDiscord<nikki> eg. JS has async but is single threaded
20:08:18Yardanicoand please show more context
20:08:20Yardanicowhat event loops
20:08:54Yardanicoare they declared in nim code? or not?
20:09:00Yardanicohow are they declared (async, normal procs, etc)
20:09:30FromDiscord<reilly> I am using an AsyncHttpServer and a dimscord.DiscordClient.
20:09:48Yardanicothen I don't see the problem :)
20:09:49FromDiscord<nikki> @Daniel cool. people (including myself) have already recommended some resources above. let us know what you think of those
20:09:58Yardanicoyou can easily run both of them asynchronously
20:10:05FromDiscord<Daniel> will, tnx for the info
20:10:07Yardanicoin ircord for example I run both the discord and IRC clients
20:10:11Yardanicoand also do some http(s) requests
20:10:12FromDiscord<Daniel> (edit) "will," => "will do,"
20:10:13FromDiscord<nikki> highly rec "nim in action" the book
20:10:20FromDiscord<Daniel> will google it
20:10:27FromDiscord<nikki> there's some out of date stuff; but there's an errata somewhere about 'em
20:10:57FromDiscord<reilly> Okay, but how? That's what I asked at the beginning.
20:11:48Yardanicoinstead of await discord.run() you would do asyncCheck discord.run()
20:11:48Yardanicoetc
20:12:05Yardanico"await" blocks the current procedure till the async proc returns something or fails
20:12:26YardanicoasyncCheck doesn't "block" the current procedure so you can call more async stuff
20:12:30Yardanicoand then just runForever()
20:12:53Yardanicoe.g. check https://github.com/Yardanico/ircord/blob/master/src/ircord.nim#L502
20:13:10Yardanicomost of the code at the bottom
20:14:11Yardanicodimscord has startSession
20:14:33Yardanicoso you either asyncCheck it or asyncCheck the proc that awaits the proc that calls startSession
20:17:15disruptekdon't use asyncCheck.
20:17:52Yardanicodo use asyncCheck where it's useful
20:18:21Yardanicoit's just a helper to set a callback which raises the error if future has raised an exception
20:18:26Yardaniconothing out of ordinary
20:19:22disrupteksome lessons cannot be taught.
20:19:29disruptekfor the others, there's disruptek.
20:21:05FromDiscord<Daniel> Are these bots able talk to each other in infinite loop?
20:21:18FromDiscord<ElegantBeef> These arent bots
20:21:24FromDiscord<ElegantBeef> Those are people talking over a bridge
20:21:40Yardanico@Daniel funny joke :)
20:22:10FromDiscord<ElegantBeef> They may have the personality of robots but sadly they arent
20:22:15Yardanicobut it's far from the first time that we hear it
20:22:25FromDiscord<Daniel> I assumed it was bot, since it has this tag https://media.discordapp.net/attachments/371759389889003532/771831392031342662/unknown.png
20:22:37Yardanicoyes, but there's no way to remove it
20:22:41Yardanicothat's just how discord webhooks work
20:22:43Yardanico!repo ircord
20:22:44disbothttps://github.com/Yardanico/ircord -- 9ircord: 11Discord <-> IRC bridge in Nim 15 11⭐ 1🍴
20:23:01Yardanicoyou clearly see "IRC" though :)
20:23:07FromDiscord<Daniel> oh i see, thank you for the explanation, quite interesting
20:23:09FromDiscord<ElegantBeef> You're currently chatting to Gitter, IRC, Matrix, and discord
20:23:22disruptekhttps://github.com/Yardanico/ircord/issues/3
20:23:22disbotβž₯ support direct messaging
20:23:28Yardanicoi know
20:23:29FromDiscord<Daniel> That's actually awesome, everything is interconnected.
20:23:50FromDiscord<ElegantBeef> Increases our community size, and allows us to shittalk people we would've never met otherwise, like that disruptek guy
20:23:55disrupteklike STDs. i fucked magic johnson once and i didn't even get AIDS.
20:24:13FromDiscord<ElegantBeef> Not what they meant by interconnected
20:24:26disruptekwell, never mind then.
20:27:21FromDiscord<Daniel> alright the book "nim in action" seems to be from 3 years ago....i guess maybe tiny bit is out of date after 3years
20:27:29Yardaniconot really
20:27:35Yardaniconot much have changed in the core language
20:27:41Yardanicoactually almost nothing
20:27:58Yardanicothat's the whole errata, and most of it is about warnings
20:27:59Yardanicohttps://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html
20:29:46FromDiscord<Daniel> Thank you for the errata, helps πŸ‘
20:29:58Yardanicoit's not mine :)
20:33:19FromDiscord<Daniel> it may not be yours, but you provided the link to it, which helps, thank you
20:42:01FromDiscord<nikki> @Daniel having followed the entire book in the past 2 weeks, i can confirm that it's basically entirely up to date and accurate and a good experience
20:42:09ForumUpdaterBotNew thread by Niminem: Neural Networks From Scratch in Nim, see https://forum.nim-lang.org/t/7015
20:42:24FromDiscord<nikki> i think the main snag i hit was the to utc time thing which i found through the errata
20:42:58FromDiscord<nikki> don't worry about all that too much, just dive in and have fun πŸ˜‰
20:51:07*astronavt joined #nim
20:56:40*superbia joined #nim
20:56:53*superbia quit (Client Quit)
21:00:32FromDiscord<Daniel> already in it πŸ˜„
21:00:57FromDiscord<Daniel> thank you for the guidance
21:03:13*kwilczynski quit (Ping timeout: 272 seconds)
21:03:32*fowl quit (Ping timeout: 260 seconds)
21:03:54*rusua quit (Read error: Connection reset by peer)
21:04:05FromDiscord<reilly> After poking around for a bit, I've gotten something that works, but barely. I think this would be infinitely better if I could use a separate thread.
21:04:20*kwilczynski joined #nim
21:04:23*rusua joined #nim
21:04:43FromDiscord<reilly> It's worth adding that I've switched to using only the event loop for Dimscord, the other turned out to be unnecessary.
21:06:04*fowl joined #nim
21:06:51FromDiscord<reilly> From trying before, Nim doesn't seem to like it if you try and run an async proc as a new thread.
21:08:43FromDiscord<dom96> @Daniel you can always ping the author (me) if you run into any problems πŸ™‚
21:10:09PMunchZevv, any suggestions for ioselector integration?
21:11:35FromDiscord<dom96> PMunch: maybe I can help?
21:11:51PMunchMaybe, did you watch the stream?
21:12:16FromDiscord<dom96> only a small bit
21:14:01*mbomba joined #nim
21:21:23PMunchBasically in the start I implemented a timeout thing for my notifications
21:21:46PMunchBut I realised that XNextEvent would block, so I couldn't check the time without an XEvent
21:22:28PMunchSo I switched to check XPending and added a small sleep(100) at the end of the loop to avoid 100% CPU utilisation
21:23:29FromDiscord<reilly> I have an `{.async.}` proc. The only error Nimsuggest is giving me is that, when attempting to `createThread()` with this proc, said proc is an undeclared identifier. It definitely isn't. What can I do about this?
21:23:39*narimiran quit (Ping timeout: 260 seconds)
21:29:52FromDiscord<reilly> https://play.nim-lang.org/#ix=2CwL
21:31:14*astronavt quit (Quit: Leaving)
21:33:56*natrys quit (Quit: natrys)
21:40:30FromDiscord<krisppurg> hey guys so↡on `from helpers import libVer` whenever I mention libVer it gets an error
21:40:42disruptekdon't do that.
21:40:59FromDiscord<krisppurg> how come?
21:41:18disruptekit's crashing my compilation and i couldn't figure out why.
22:01:33FromDiscord<lqdev> @krisppurg what error...
22:02:11FromDiscord<krisppurg> undeclared identifier: 'libVer'
22:02:20FromDiscord<lqdev> that's odd
22:02:24FromDiscord<lqdev> are you sure libVer is exported?
22:16:01FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=2CwV
22:16:38FromDiscord<enthus1ast> it does work in the if and elif case but not in else
22:19:23*ehmry quit (Read error: Connection reset by peer)
22:19:34*rusua quit (Quit: Connection closed for inactivity)
22:20:55FromDiscord<Rika> Well it shouldn't work for any of them
22:21:07FromDiscord<Rika> If you remove the else, does it compile
22:21:12FromDiscord<enthus1ast> yes
22:21:22FromDiscord<Rika> It shouldn't AFAIK
22:21:49*ehmry joined #nim
22:23:17FromDiscord<enthus1ast> mh yeah makes kinda sense BUT ( πŸ˜‰ ) it makes my code ugly, 😦
22:23:24FromDiscord<ache of head> Lmao
22:23:54*lritter quit (Quit: Leaving)
22:24:06FromDiscord<enthus1ast> i'll try to assign it in the object constructor
22:28:14*solitudesf quit (Ping timeout: 264 seconds)
22:30:14FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=2CwY
22:30:25FromDiscord<enthus1ast> thank you @Rika
22:32:07FromDiscord<dom96> @PMunch how does this event loop work? Is there an FD you could await on?
22:32:21PMunchOh yeah, already implemented it :P
22:32:41FromDiscord<dom96> @reilly you can't `createThread` on an async proc, it needs to be marked with {.thread.}
22:33:09FromDiscord<dom96> PMunch: then you shouldn't need `sleep`, you should be blocking your thread on the async dispatch `poll`
22:34:00PMunchOh yeah, I do now
22:34:11PMunchI implemented the selector logic since your last message :P
22:35:56FromDiscord<dom96> lol
22:40:59FromDiscord<reilly> @dom96 that code must be inside of an `{.async.}` proc. Marking it as both `{.async, thread.}` still leaves it as an undeclared identifier.
22:43:53FromDiscord<dom96> Weird that you get an undeclared identifier, but what is your high level goal here?
22:43:57FromDiscord<dom96> Why are you using threads?
22:45:28FromDiscord<reilly> Because having everything run asynchronously on a single thread is too slow.
22:45:50FromDiscord<dom96> what's "everything"?
22:47:36FromDiscord<reilly> My main thread is handling a terminal-based GUI, and the second thread is a Discord bot.
22:51:34FromDiscord<reilly> I've already tried running everything on one thread asynchronously, and as far as I could tell the Discord part was being seriously inhibited from functioning properly.
22:52:12FromDiscord<dom96> That shouldn't be the case, but if you really want another thread you should run the async loop there. To do that you don't need {.async, thread.}
22:52:49FromDiscord<dom96> Just waitFor your main async proc in the {.thread.}
23:04:16*vicfred_ joined #nim
23:04:50FromDiscord<reilly> Not making the proc async makes setting event procs impossible and makes the `startSession()` proc an undeclared routine. See https://play.nim-lang.org/#ix=2Cx7
23:04:51PMunchHmm, anyone got an icon idea for notifishower?
23:07:21*vicfred quit (Ping timeout: 268 seconds)
23:08:29FromDiscord<reilly> Obligatory @dom96 since he seems to be the only one helping me out.
23:11:28*haxscramper quit (Remote host closed the connection)
23:14:50PrestigePMunch: what about a notification itself?
23:15:11PMunchWhat do you mean?
23:15:36PrestigeThe icon could resemble a notification window with text
23:16:00PMunchWell, the problem is that notifishower is designed to be as flexible as absolutely possible
23:16:26PMunchSo there is really nothing that would resemble any of its notifications
23:16:39AxiomaticAn exhausted courier from the Pony Express collapsing while handing the observer a letter, horse keeled over dead in the background.
23:18:42PMunchHaha, that might be slightly too hard
23:19:09AxiomaticYeah, a little busy for an icon I guess
23:19:24PMunchFor context this is the logo for notificatcher: https://github.com/PMunch/notificatcher/blob/master/notificatcher.png
23:22:40AxiomaticHmm, very clean. Ok. picture this: silver platter, top lifted to reveal a letter on the platter on offer.
23:23:36PMunchOoh, that's not a bad idea
23:23:39FromDiscord<Clyybber> @reilly You mean removing {.async.} from the proc that contains "waitFor bot.startSession()" ?
23:23:55FromDiscord<dom96> @reilly you sure {.thread.} is to blame here?
23:24:01*mbomba quit (Ping timeout: 260 seconds)
23:24:10*abm quit (Quit: Leaving)
23:24:27FromDiscord<reilly> It's not {.thread.} that's the issue, it's the lack of {.async.}.
23:24:30PMunchSure beats this: https://uploads.peterme.net/2020-10-31-002351_130x195_scrot.png :P
23:24:52FromDiscord<dom96> @reilly huh, nothing in that case needs {.async.}
23:24:57FromDiscord<dom96> (edit) "case" => "code"
23:25:09FromDiscord<reilly> Nimsuggest disagrees.
23:25:18FromDiscord<dom96> compile your code instead of relying on nimsuggest
23:25:30AxiomaticHaha, that's.... suggestive. Invites too many, unclean thoughts. Distracting.
23:25:48PMunchHaha :P
23:26:27PMunchI mean I'm open to change the name of the program as well
23:26:46PMunchIf that meant getting a better icon and a name that doesn't sound like a shower..
23:27:30AxiomaticNotifishower is better than Notifiexposer. There's worse names.
23:27:43PMunchHaha
23:27:46PMunchNotifipresent
23:27:58PMunchCould have the notification looking like a present
23:30:36AxiomaticA letter making it past snow, rain, heat (sun) and gloom of night (moon).
23:30:57AxiomaticIt does what the postal service no longer can. TM
23:31:14FromDiscord<Clyybber> PMunch: perhaps notifair
23:31:22PMunchnotifair?
23:32:08FromDiscord<Clyybber> since it shows your notifications
23:32:18FromDiscord<Clyybber> so its like a fair for notifications
23:32:41FromDiscord<reilly> I've done some tweaks now, but I can't be sure if they're really going to do anything for me since I'm having memory safety issues. Calling `startSession()` is not thread-safe, despite being completely unrelated to anything outside of the proc.
23:33:47PMunchClyybber, ah that kind of fair
23:33:55FromDiscord<reilly> Er, well, I guess that's not exactly true. It looks like it's because it works with global memory in the Dimscord module, not something I can really do anything about.
23:34:02FromDiscord<Clyybber> notiflash
23:34:03PMunchI thought you meant like: Look at these fair icons
23:34:32FromDiscord<Clyybber> :D
23:34:51FromDiscord<Clyybber> notiflount
23:34:57AxiomaticNotifish (notify shell)/fish icon and Notificatcher/fish net.
23:35:12PMunchBut why fish?
23:35:25AxiomaticNotifi-sh sh for shell
23:35:29FromDiscord<reilly> This would probably work if I could have the bot on the main thread instead, but afaik you can only echo on the main thread, so my terminal-based GUI would have to go.
23:35:32PMunchNotificatcher catcher notifications, and has the icon of a dreamcatcher, such a nice combo
23:35:59PMunchHmm, well it doesn't have to be in the shell..
23:36:07AxiomaticYeah, it's hard to beat.
23:36:21PMunch@reilly, I think you can echo from any thread
23:36:25PMunchYou just risk interlacing
23:36:48FromDiscord<reilly> I think I might have gotten the wrong impression from Nim in Action, then...
23:38:08FromDiscord<Clyybber> PMunch: I kinda like the shower idea tbh
23:38:27FromDiscord<Clyybber> its so contrarian to notificatcher in the sense that it doesn't make any sense
23:38:45PMunchHaha, that's kinda why I started making it :P
23:39:29FromDiscord<Clyybber> its catchy
23:39:52FromDiscord<lqdev> please don't change the name
23:39:58FromDiscord<lqdev> it's great
23:40:04PMunchNotifishower?
23:40:09FromDiscord<lqdev> yeah
23:40:10FromDiscord<Clyybber> yeah
23:40:17FromDiscord<Clyybber> just go with the shower idea all way through
23:40:32FromDiscord<reilly> I've switched which half is on the second thread, but neither works for the same reason: some necessary function call accesses global memory in the module itself.
23:43:07FromDiscord<Clyybber> @reilly So afaict your issue is that the dimscord API is not thread safe?
23:43:16FromDiscord<reilly> It would seem so.
23:43:35FromDiscord<reilly> Neither Dimscord nor Illwill are thread-safe.
23:43:39FromDiscord<Clyybber> Then just dedicate one thread to dimscord and one to illwill
23:43:48FromDiscord<reilly> That's what I'm trying to do.
23:43:59FromDiscord<Clyybber> How are you communicating between the two?
23:44:07FromDiscord<reilly> At the moment, I'm not.
23:45:05mipriif the only problem is access global memory, check out the Heap chart on https://nim-lang.org/docs/gc.html . maybe you can just --gc:boehm and call it a day.
23:45:49*xace quit (Ping timeout: 264 seconds)
23:46:32*astronavt joined #nim
23:46:41FromDiscord<reilly> That doesn't seem to have worked.
23:47:00FromDiscord<Clyybber> both threads are accessing the same global memory?
23:47:37FromDiscord<reilly> Nope! The crux of the issue seems to be that each module is trying to access some variable declared in its own global scope.
23:48:05FromDiscord<reilly> In my code, there is no shared memory between the two.
23:48:29FromDiscord<reilly> `dimscord.startSession()`, which I have to run to start the bot, is not memory safe. `illwill.display()`, which I have to run to update the screen, is not memory safe.
23:48:55FromDiscord<Clyybber> can you try with --gc:arc
23:49:12FromDiscord<Clyybber> or --gc:orc should also work
23:49:20FromDiscord<Clyybber> if you are on #devel
23:50:32FromDiscord<reilly> Both arc and orc still say that it's not gc-safe.
23:50:47FromDiscord<Clyybber> oh? So your problem is that it doesn't compile
23:50:53FromDiscord<Clyybber> I thought it was a runtime problem
23:51:05FromDiscord<reilly> Sorry, I should have made that more clear.
23:51:40FromDiscord<Clyybber> try {.gcsafe.}: bodyOfYourProc
23:51:58FromDiscord<Clyybber> gcsafe analysis is pessimistic
23:51:59FromDiscord<reilly> I currently have Illwill running in the `guiHandler()` thread proc. guiHandler is not gc-safe because it calls display. display is not safe because it accesses "gPrevTerminalBuffer," which is global.
23:52:08FromDiscord<reilly> I will try that now.
23:52:21FromDiscord<Clyybber> if you are sure only one thread accesses it it should be fine
23:52:31*xace joined #nim
23:53:03FromDiscord<reilly> I figured that would be the case, but that won't get me anywhere if Nim is forcing me to be gc-safe anyway.
23:53:13FromDiscord<dom96> you should also still be able to just tell the compiler to be quiet with --threadAnalysis:off
23:53:23FromDiscord<dom96> although I do remember hearing Araq wanting to remove that ability
23:53:28FromDiscord<reilly> The road to hell is paved with good intentions...
23:53:59FromDiscord<Clyybber> @reilly a {.gcsafe.}: ... block asserts that you are sure that its gcsafe
23:54:18FromDiscord<Clyybber> so that the compiler doesn't have to pessimistically assume you are going to access globals that you shouldn't
23:54:50FromDiscord<reilly> I had {.thread, gcsafe.} a minute ago, but I guess it has to be just {.gcsafe.}.
23:59:47FromDiscord<reilly> Lookin' good. Hopefully from here on this shouldn't be nearly as headache-inducing.