<< 14-12-2020 >>

00:08:35FromDiscord<ElegantBeef> `discard`
00:11:54FromDiscord<Avatarfighter> Hello hello everyone
00:17:30FromDiscord<nikki> ๐Ÿ‘‹
00:17:50FromDiscord<nikki> wrote some nim again today after 3 weeks and it feelsgoodman.jpg
00:18:34FromDiscord<Avatarfighter> @nikki im getting nim to run on my robot rn, the compiler errors feel so nice to see
00:18:59FromDiscord<nikki> nice
00:19:25FromDiscord<nikki> i disabled nimsuggest / nimlsp in my editor for now cuz i saw it take a lot of cpu a few times and i'm also tryna see if i can just remember everything
00:19:55FromDiscord<nikki> i have a terminal open with a watch-build cycle usually so i see the build output immediately and the errors from that are often better than from nimsuggest anyways
00:20:14FromDiscord<ElegantBeef> Writing Nim without suggestions when it has a ufcs, way to live wild ๐Ÿ˜›
00:20:44FromDiscord<nikki> i feel like suggestions get wilder with ufcs haha
00:21:04FromDiscord<nikki> the watch-build window is helpful tho
00:25:55*mbomba joined #nim
00:26:46FromDiscord<Quibono> Psst, @shadow. has a question
00:27:43FromDiscord<Avatarfighter> @ElegantBeef what is ufcs?
00:28:06FromDiscord<ElegantBeef> The unform function calling syntax, or as it's listed in the manual, the method call syntax
00:28:13FromDiscord<Avatarfighter> oh
00:28:24FromDiscord<Avatarfighter> I keep forgetting the meaning
00:28:45FromDiscord<Avatarfighter> i think ive genuinely asked 4 times in the span of a month on what it meant ๐Ÿ˜ญ
00:29:29FromDiscord<shadow.> lmao
00:29:47FromDiscord<shadow.> f(a, b) == a.f(b) == a.f b
00:30:03FromDiscord<Avatarfighter> yeah i know what it is I just meant the meaning of "ufcs" ๐Ÿ˜›
00:30:08FromDiscord<shadow.> haha fair
00:31:55FromDiscord<Quibono> See, part of me just likes f(a,b) a.f b looks kinda...
00:34:16FromDiscord<ElegantBeef> I mean it depends on the proc for me
00:39:00FromDiscord<Quibono> Fair.
00:39:47FromDiscord<Avatarfighter> I really enjoy putting all the possible call syntax in a chain of methods lol
00:39:56FromDiscord<Quibono> ... please no.
00:40:06FromDiscord<Quibono> Also, the Nim hate in other spaces drives me nuts
00:40:15FromDiscord<Avatarfighter> nim hate!?
00:40:33FromDiscord<shadow.> ive never heard anyone hate on nim
00:40:54FromDiscord<Avatarfighter> well
00:41:04FromDiscord<shadow.> tbh the only thing ppl dislike is eco and thats a chicken and the egg type of thing
00:41:11FromDiscord<Quibono> Just had someone say it was a one off that will die in a few years, lol.
00:41:12FromDiscord<Avatarfighter> I know some rust users have stronger feelings than most
00:41:16FromDiscord<Quibono> F that.
00:44:37FromDiscord<ElegantBeef> Nim gets a lot of hate due to being so different when it comes to system programming languages
00:45:02FromDiscord<ElegantBeef> It doesnt have namespaces, it doesnt enable strict oop, and it encourages UFCS
00:46:07FromDiscord<JSGRANT> @Avatarfighter https://external-preview.redd.it/Ikj0dtD2q1f70pJtxZEJahFAJH0LkkcdtNuxMWT8Dl0.jpg?width=960&crop=smart&auto=webp&s=a8f8318d25569318691e6347b5d844db5fafee6a it's a meme but I remember pre-1.x and that vibe was real and only became more real after a bit -- RIIR (rewrite it in rust!) was "the catchphrase" in that community for a LOOOOONG time much to the behest of a lot of 3rd-party opensource contributors. lol
00:47:24FromDiscord<ElegantBeef> I've seen people dislike that it's "transpiled" and also disbelieve it can be as fast as Rust if not faster
00:49:06FromDiscord<JSGRANT> @ElegantBeef Well it's also categorically 'hard' to place. It "looks" like Python; So people expect it to basically be in the same relationship Crystal has with Ruby... even though most actual users know it's (I think rather obviously) more Pascaly all-in-all. A lot think a GC is disqualifying for a systems-programming language without looking into and/or listening about "the good word" (lol) about ARC/ORC, etc.
00:51:04FromDiscord<JSGRANT> Transpiled felt weird initially; Pretty much all on me -- and my expectations of it being "more pure" if the IR was LLVM or something. Got over that quickly, when I realized the first-class FFI Nim has ... that I'm not convinced you'd also "get for free" if we went LLVM :^P
00:51:34FromDiscord<himu> Oh. man . FFI was so easy for even a noob like me.
00:51:41FromDiscord<Avatarfighter> the issue is that a lot of people dont actually try out the language which sucks because they judge nim by its syntax.
00:53:28FromDiscord<ElegantBeef> Well ARC is an issue cause people see it and think it's like swifts and not like Rust's GC
00:54:13FromDiscord<Avatarfighter> yeah
00:54:30FromDiscord<Avatarfighter> that's just because of the name ๐Ÿ˜ญ
00:54:31FromDiscord<JSGRANT> @ElegantBeef re: Perception of it not being "as fast"; Think a lot it has to do is people view Rust "as a C++ replacement" and as-said, I think wrongly Nim "as a Python replacement" so it's unfortunate but expected people also draw these comparisons in terms of performance. A "faster Python" ... I mean, a 2x - 3x speedup would be a BIG DEAL; They think it's at this tier -- marginally better ... not that Nim beats the ever-loving ssssss (
00:57:14FromDiscord<JSGRANT> Beeeeiiiilllve me; I feel like I talk about Lisp a lot in here (I do. lol) but yeah, sadly most people take a quick glance at the syntax of a language and make WIDE assumptions based on it.
00:57:43FromDiscord<Avatarfighter> yeah
00:58:30FromDiscord<JSGRANT> And really they just overhear certain things; Don't even look into it AT ALL. And repeat these (actually wrong) truisms ad naseum -- the amount of times I've heard people call LISP ('Common Lisp') a functional-language .... loooooool
00:58:53*krux02 quit (Remote host closed the connection)
00:59:55FromDiscord<JSGRANT> That being said being syntactically similar enough to Python where you have more eyes on Nim just because people assume it's a "Python-like 'systems language' " is not the WORST problem to have.
01:00:18FromDiscord<Quibono> Yeah I initially came over because it was fast python lol
01:00:34FromDiscord<Avatarfighter> The issue I see is that because people assume its a Python-like language they assume we're running the latest and greatest interpreter from 2010 and think we're slow ๐Ÿ˜ฆ
01:00:36FromDiscord<JSGRANT> Retention rate might be somewhat low -- but that doesn't matter if there's a lot more people looking into it generally.
01:03:06FromDiscord<ElegantBeef> I think that is a slight issue as it isnt "fast python", atleast in my view
01:03:58FromDiscord<Avatarfighter> Does anyone have nimterop experience ?
01:04:08FromDiscord<Avatarfighter> if so may I borrow your knowledge for a bit
01:04:37FromDiscord<JSGRANT> This is about what I was going to say; it depends who we were going after -- and I think this (people who get into Nim as a "faster python") is a secondary market at best.
01:07:56FromDiscord<himu> sent a long message, see http://ix.io/2HWF
01:08:35FromDiscord<ElegantBeef> I mean you can do recursive module imports, you just have to do it properly
01:09:11leorize[m]once ic is out recursive modules might be implemented
01:09:24FromDiscord<Avatarfighter> I remember when I had a circular import with python I think that took a week to figure out why
01:09:45FromDiscord<himu> what's ic?
01:09:50FromDiscord<ElegantBeef> Incremental compiler
01:09:51FromDiscord<Avatarfighter> incremental compilation
01:10:13FromDiscord<Avatarfighter> https://en.wikipedia.org/wiki/Incremental_compiler
01:10:29leorize[m]it has little to do with the feature but more to do with the massive refactoring of the backend
01:10:31FromDiscord<JSGRANT> sent a long message, see http://ix.io/2HWJ
01:11:14FromDiscord<himu> okay. that would be a great thing.
01:11:25FromDiscord<ElegantBeef> Well you cannot really ever say "It's nim all the way down" due to the fact no one is going to rewrite Opengl/vulkan in pure nim ๐Ÿ˜„
01:11:45FromDiscord<himu> it also improves compile times I guess?
01:12:12FromDiscord<Avatarfighter> yeah, if you have a big project it'll only compile the parts that were updated instead of the whole project each time you compile @himu
01:12:39FromDiscord<JSGRANT> @ElegantBeef Well .... you can do some cool DSLs there to hide some the more ugly stuff; Also don't challenge @disruptek loooool
01:13:05FromDiscord<Avatarfighter> disruptek is nimginer
01:13:16FromDiscord<Avatarfighter> (edit) "nimginer" => "nimgineer"
01:13:45FromDiscord<JSGRANT> @ElegantBeef Since you mentioned it earlier; I forgot to ask -- is your opinion still that namespaces in Nim would be a "good thing โ„ข๏ธ " ?
01:15:00FromDiscord<ElegantBeef> I'm very adamant about writing non repetitive code, so i dont really want namespaces as much as a way to easily make a module that has imports/exports without manually making it
01:15:33FromDiscord<ElegantBeef> That view is the whole reason `devel` now has `scanTuple` ๐Ÿ˜„
01:15:49FromDiscord<ElegantBeef> Using scanf during aoc caused me to want something that could infer the types
01:18:09FromDiscord<JSGRANT> Also that reminds me ... I completely forgot until now; I forked NimSL like 2-3 months ago and literally haven't even made a single commit to it. Was going to use it to learn GLSL generally. Wish I had one of these "wow I'm bored" Covid experiences -- so many stuff I wanted to get to this year, but have just been exhausted .... had a friend literally contact me yesterday and complained about how boooored he was watching Anime marathons fo
01:19:05*rockcavera joined #nim
01:19:22FromDiscord<Avatarfighter> is anyone able to build the most recent version of nimterop?
01:19:44FromDiscord<Avatarfighter> getting `Error: find has no param matching "help" key "recurse"` when building
01:19:54FromDiscord<JSGRANT> @ElegantBeef I think that's fair; Guess you could make a "prelude" styled import cabal everytime ... but yeah, seems like overkill. Not sure if you could reasonably do the eqv for exports
01:20:26FromDiscord<ElegantBeef> If you say shashlick three times avatar someone might appear ๐Ÿ˜›
01:20:52FromDiscord<himu> one more thing I wanted to ask is how does Nim handle lambda lifting and C FFI?
01:20:59FromDiscord<Avatarfighter> I don
01:21:15FromDiscord<Avatarfighter> I wanna say shasklick shasklick shasklick but I'm unsure if it'll work ๐Ÿ˜›
01:21:34FromDiscord<ElegantBeef> Well nim's compiler doesnt compile modules that arent imported so the "namespace" thing is pretty much impossible to implement gracefully
01:21:45FromDiscord<Avatarfighter> just rewrite the compiler /s
01:21:53FromDiscord<Avatarfighter> (edit) "just rewrite the compiler ... /s" added "again"
01:47:20FromDiscord<Quibono> If anyone algotrades I'm writing a SDK for Alpaca.
01:49:45*astronavt joined #nim
01:50:07FromDiscord<Quibono> Probably going to do one for Oanda too but it's painful and slow lol
02:11:50EvolverQuibono: Alpaca sounds great. What's the URL?
02:12:13FromDiscord<Quibono> https://github.com/QuixoticValentine/Nimpaca
02:12:17FromDiscord<Quibono> PRs more than welcome.
02:13:00FromDiscord<Quibono> right now my paper-trading keys are in there just for ease of testing
02:13:24EvolverI would .gitignore .DS_Store
02:13:29FromDiscord<19> its weird i am building an executable in debug mode it throws some depth exceptions for recursions but in release mode it keeps running forever
02:13:48FromDiscord<19> (edit) "its weird i am building an executable in debug mode it throws some depth exceptions ... for" added "and crashes"
02:14:08EvolverMaybe it can only debug so much
02:14:45FromDiscord<19> so i am forever limited in debug mode?
02:15:06FromDiscord<19> im using some funky sdl2 callback. maybe thats what's causing the recursions
02:15:34FromDiscord<19> i mean, its a game loop that's supposed to go on and on
02:15:36FromDiscord<Quibono> I feel like we need a finance community section
02:17:13FromDiscord<Quibono> Also if anyone has comments on making the API SDK better I'd appreciate it
02:17:16leorize[m]@himu c ffi is done by basically compiling to c :p
02:18:39leorize[m]and I'm pretty sure in the compiler source there's something called liftlocals.nim that do the lambda processing
02:58:03*tiorock joined #nim
02:58:03*tiorock quit (Changing host)
02:58:03*tiorock joined #nim
02:58:03*rockcavera quit (Killed (beckett.freenode.net (Nickname regained by services)))
02:58:03*tiorock is now known as rockcavera
02:58:09disruptekcircular imports can happen in 1.8, in theory. i think it's a pretty minor feature that could go in earlier but it would probably confuse the ic testing too much to mix the two.
03:11:32*mbomba quit (Quit: WeeChat 3.0)
03:20:11*a_chou joined #nim
03:32:23disruptekclyybber: afterCallActions doesn't get called after my macro, so, yeah, that's a bummer. i am looking at pragma processing now, even though we know it's not pragmas per se that are the problem.
03:50:14EvolverCan I have a leading underscore in a module name? If I can, how do I import it?
03:56:27disruptekno.
03:59:02FromDiscord<Rika> you cannot
04:01:00disruptekrude.
04:02:05FromDiscord<Rika> lol
04:02:32*spiderstew_ joined #nim
04:03:13FromDiscord<ElegantBeef> Leading underscore makes me think you come from python
04:03:18disruptekclyybber: it does get called after `carnac:` form, but weirdly, that doesn't help. i tried wrapping in a couple typed macro blocks and it /still/ doesn't sem those identifiers.
04:03:20FromDiscord<Rika> lmao
04:04:43*leorize quit (Ping timeout: 240 seconds)
04:05:37*spiderstew quit (Ping timeout: 246 seconds)
04:05:50FromDiscord<ElegantBeef> also i dont know what the issue is `leadingunderscoremodule` is a valid name ๐Ÿ˜„
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:32*supakeen joined #nim
04:20:22*thomasross quit (Ping timeout: 260 seconds)
04:22:19*leorize joined #nim
04:26:17disruptekclyybber: carnac works, but for all the wrong reasons.
04:26:47disruptekclyybber: look at this: https://github.com/disruptek/carnac/blob/master/tests/test.nim#L35
04:27:06FromDiscord<Avatarfighter> damn this disruptek kid sure has a lot of libraries
04:27:39disruptekthat guy is an asshole.
04:28:00FromDiscord<Avatarfighter> i bet he uses linux what a need
04:28:02FromDiscord<Avatarfighter> Nerd
04:28:02FromDiscord<Avatarfighter> fuck
04:28:22FromDiscord<Rika> Need
04:28:49disrupteki have a /need/.
04:28:54disrupteka /need/ to use linux.
04:30:20EvolverIs there a way to write this more succinctly: if foo == "x" or foo == "y"
04:30:20EvolverShould I write it as: if foo in ["x", "y"]
04:35:34FromDiscord<Rika> you can yeah
04:35:44FromDiscord<Rika> prolly negligible difference in performance
04:36:16disrupteki write it the second way because it's easier to read.
04:38:16FromDiscord<ElegantBeef> should write it `{"x", "y"}`
04:38:33FromDiscord<ElegantBeef> Whoops as chars
04:39:27FromDiscord<ElegantBeef> Atleast if it's an ordinal that's capable of being placed in a built-in set
04:39:28EvolverOK. My actual values are of another type.
04:40:04Evolverbut I guess I'll keep the set in mind for a bigger number of items
04:45:05*a_chou quit (Remote host closed the connection)
04:45:25disruptekbuiltin sets hold ordinals up to 16bit. IntSets hold ints. other types go into HashSets.
04:45:47disruptekPackedSets are a generic form of IntSets for any ordinal.
04:46:49disruptekthe set syntax that's useful is {x, y, z} == {0} or such...
04:47:20disrupteksets compose /really/ nicely with nim's enums.
04:47:55EvolverI see
04:51:35*narimiran joined #nim
04:56:32*waleee-cl quit (Quit: Connection closed for inactivity)
05:00:09*spiderstew joined #nim
05:02:25*spiderstew_ quit (Ping timeout: 240 seconds)
05:18:26*a_chou joined #nim
05:34:11*a_chou quit (Quit: a_chou)
05:34:37*a_chou joined #nim
05:34:46*a_chou quit (Client Quit)
06:55:38*habamax joined #nim
07:40:14*krux02 joined #nim
07:47:42ZevvI tried to optimize sets once becasue Npeg uses them extensively
07:47:52ZevvI failed. The are utterly optimized already.
07:57:44FromDiscord<ElegantBeef> Well they're bitsets, i dont know how you can do much better
07:57:59FromDiscord<ElegantBeef> Short of being more efficient on memory but using ranges
07:58:08FromDiscord<mratsim> There is already a topic about this, it all depends on what you need
07:58:10FromDiscord<ElegantBeef> (edit) "but" => "bye"
07:58:15FromDiscord<ElegantBeef> god damn i cannot type
07:58:47FromDiscord<mratsim> for memory, unless you care about 1 byte vs 2-byte they are optimal
07:58:55FromDiscord<mratsim> for speed, also
07:59:16FromDiscord<mratsim> for random pop they aren't so if random sampling from a set is important you need tow rite your own.
07:59:32FromDiscord<mratsim> different tradeoffs.
07:59:44FromDiscord<mratsim> Also they are threadsafe which is quite interesting.
08:00:01FromDiscord<mratsim> and they work at compile-time
08:02:04*PMunch joined #nim
08:03:23ForumUpdaterBotNew thread by Archnim: Nim for mobile, see https://forum.nim-lang.org/t/7251
08:14:52*Zoom[m] quit (Ping timeout: 260 seconds)
08:15:00*Zoom[m] joined #nim
08:16:54*supakeen quit (*.net *.split)
08:16:54*rockcavera quit (*.net *.split)
08:16:54*oculux quit (*.net *.split)
08:16:54*clemens3_ quit (*.net *.split)
08:16:54*bozaloshtsh quit (*.net *.split)
08:16:54*nickster quit (*.net *.split)
08:16:54*bacterio quit (*.net *.split)
08:19:30*idf31 joined #nim
08:22:20*supakeen joined #nim
08:22:20*rockcavera joined #nim
08:22:20*oculux joined #nim
08:22:20*clemens3_ joined #nim
08:22:20*bozaloshtsh joined #nim
08:22:20*nickster joined #nim
08:22:20*bacterio joined #nim
08:24:25FromDiscord<kenran> I found a couple of topic regarding this but nothing that looks recent: do you know of any existing freetype bindings (or anything else that's performant if I want to render text in OpenGL) for Nim?
08:31:27*kenran joined #nim
08:45:42FromDiscord<kenran> Or would it be easy to write bindings to just the functions I need maybe.. gotta find out
08:52:31PMunch@kenran: https://nimble.directory/search?query=freetype
08:55:06kenranPMunch: ah yes, I stumbled over that one, but https://forum.nim-lang.org/t/4898 mentions that it "does not work", whatever it means. I might try and see how to use it anyway (which might result in more newbie questions here...)
08:56:40PMunchAh, yeah I see that the last commit was 4 year ago..
08:57:33FromDiscord<mratsim> When csize is removed, all bindings from before 2019 will stop working
08:58:33PMunchWill that happen anytime soon? And is there a switch to bring it back?
09:02:33FromDiscord<mratsim> The only reasonable thing to do is only remove it on Nim 2.0
09:05:39kenranI used {.importc: "some_function", header: "<stdlib.h>".} to import some POSIX functions that were not already present. Can I do the same for freetype when it is installed, or is stdlib.h a special example?
09:06:21PMunchNo you can do that with anything
09:11:16*letto quit (Ping timeout: 256 seconds)
09:15:34*letto joined #nim
09:19:00*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:35:34Araqkenran: thereare also pure Nim font rendering libraries around
09:35:48Araqiirc fidget uses one, please check it out
09:36:24Araqalso SDL2 works with openGL and offers some primitive font rendering
09:39:58FromDiscord<kenran> Araq, thanks, I didn't even think to search for one! It seems to use https://github.com/treeform/typography which looks great. Let's see if I manage to use it, since I have no idea of this stuff yet. But pure Nim is surely easier to use than C stuff.
09:43:12PMunchI don't think typography does direct OpenGL rendering though
09:43:18PMunchI was about to suggest it earlier
09:43:55FromDiscord<ElegantBeef> Well it draws to images so draw ontop of the opengl frame buffer ๐Ÿ˜„
10:25:45*Q-Master quit (Ping timeout: 240 seconds)
10:25:52ForumUpdaterBotNew thread by Giga84: IS there any beginner friendly tutorial for nim with examples like "Python crash course" etc.?, see https://forum.nim-lang.org/t/7252
10:34:35FromDiscord<sealmove> @PMunch hey, can you explain the stuff with fixed-length strings?
10:35:08FromDiscord<sealmove> I don't get it, why`s: myString[10]` instead of `s80: myString`? the latter works
10:36:55PMunchCurrently the way binaryparse works is that strings are always 8 bit per character, and you specify the amount of characters to read by the [] notation.
10:37:27FromDiscord<sealmove> oh, ok I completely changed this. New implementation doesn't need arrays for this.
10:37:45PMunchI would expect s80: myString to read a one character string where the character uses some fictional 80-bit character literals
10:38:31FromDiscord<sealmove> but isn't this confusing? why not keep same rules for strings as other fields?
10:39:13PMunchIt is the same rule
10:39:37PMunchThe number sets the size of the unit, the brackets sets the length to read of that unit
10:40:57PMunchA string is basically just an array of characters
10:41:36FromDiscord<sealmove> :S then you would do `u8: myString[10]`
10:41:57FromDiscord<sealmove> string is a string, not seq[char]
10:42:00PMunchu8? That would be to read 10 unsigned 8-bit integers
10:42:56PMunchWell string isn't always a string. Many formats uses fixed length strings, but maybe it's a NULL-terminated string
10:43:21FromDiscord<lqdev> btw pmunch
10:43:31FromDiscord<lqdev> how do you parse a length-prefixed string
10:43:35PMunchFor example what if my format has a u8: strLen field and then a s: myStr[strLen]
10:43:42FromDiscord<lqdev> didn't see that in your readme
10:43:48PMunchlqdev, like that ^
10:43:50FromDiscord<sealmove> well i find the design you are describing confusing. currently [] notation is used for producing a seq[] of whatever is on the left side
10:43:52FromDiscord<lqdev> oh cool
10:43:59FromDiscord<sealmove> and `s` means string
10:44:20PMunchWhich is a sequence of characters
10:44:32FromDiscord<sealmove> `s` without size is null-terminated, `s` with size (for example `s80`) is string of that length in bits
10:44:56FromDiscord<sealmove> yes sure it's a seq[char] but to Nim it maps to `string`, isn't this more natural?
10:44:56PMunchBut easier to compare against other strings that = @['h', 'e', 'l', 'l', 'o']
10:45:44PMunchBut now you can't do the kind of length-prefixed strings lqdev just asked about..
10:47:48FromDiscord<sealmove> oh, so it's useful because you can use size as a value (potentially found in prev fields), i understand now
10:48:01PMunchYup
10:48:10FromDiscord<sealmove> ok, i'll have to think about this
10:48:35PMunchI used this when parsing DNS for example
10:48:43PMunchIt uses length-prefixed strings
10:49:57PMunchWe could theoretically also support s7: oldString[10] to read pre-ASCII strings
10:50:29FromDiscord<Clyybber> disruptek: Hmm, so why does it work?
10:51:10FromDiscord<sealmove> ok, so the implementation for strings needs work, but I still don't like using [] notation for this. it's simply used to make a seq out of your type, and it working differently for strings will be confusing
10:51:19PMunchWell not really pre-ASCII, it was originally 7 bits long as well
10:51:38PMunchIt's not really working differently, and IMO is the most intuitive
10:51:56FromDiscord<sealmove> what if you want seq of strings?
10:52:01PMunchNo one has complained about this yet :P
10:52:16PMunchThen you need a sub-parser
10:53:15PMunchBut I haven't come across any formats with multiple strings after each other
10:53:44PMunchWell, DNS does it, but with length-prefixed strings, so it would've needed a sub-parser anyways
10:53:58PMunchAnd it has it's weird compression scheme
10:54:30PMunchMost often strings are used as small fixed-size magic elements
10:55:26*Q-Master joined #nim
10:55:35PMunchOr length-prefixed strings
10:57:37FromDiscord<sealmove> ok so basically a good implementation is `s: x[10]` to work in similar way as: string( `u8: x[10]`)
10:58:07PMunchYeah that's pretty much how it works now
10:58:13FromDiscord<sealmove> and `s: x[]` for null terminated?
10:58:18PMunchYup
10:58:25FromDiscord<sealmove> good good, I'll fix it ๐Ÿ˜‰
10:58:32PMunchGreat :)
10:58:54FromDiscord<sealmove> thx for the review btw
10:59:18PMunchOf course, I always review PRs to my repos .)
10:59:23PMunch:)*
11:02:24FromDiscord<sealmove> about seqs that are terminated on specific value... do you think we need to have a way to allow user to either include or discard the matched value?
11:02:40PMunchAh yes, I meant to discuss this as well
11:02:47PMunchThe current system allows this
11:02:53FromDiscord<sealmove> how?
11:03:21PMunchu8: mySeq[]; u8: magicEnd = 255'u8
11:03:27PMunchu8: mySeq[]; u8: _ = 255'u8
11:03:30PMunchLike that
11:04:02FromDiscord<sealmove> but magicEnd is not included in the seq? but given as separate field?
11:04:16PMunchAh yes, it's a separate field
11:04:47PMunchBut that is the thing I wanted to discuss, I find the current way easier to reason about
11:05:02FromDiscord<sealmove> we can do better, currently `{}` is used for terminating on arbitary condition (and include last elem). we could use for example `()` for doing the same but excluding last elem
11:05:32PMunchYou can simply read the lines one by one and have an idea for how many bytes will be read. With the until syntax I need to also read the end of sequence statements to see if they have an until condition
11:07:48FromDiscord<sealmove> can you elaborate?
11:09:50PMunchWell currently if I'm translating a spec it's often written as a diagram of the fields. This maps nicely to the DSL where each line is a field. With the until syntax this pattern breaks and I can now technically have a "hidden" field in the magic.
11:10:25FromDiscord<sealmove> so basically you want it as separate field
11:10:48PMunchI find it more intuitive to read at least
11:11:09PMunchBesides, with the previous system you could have a magic of another size that the element size
11:11:23PMunchs/that/than
11:12:19FromDiscord<sealmove> hmm ok i see
11:12:34PMunchs: myString[]; u1: _ = 1 for example would read a string only as long as the low 7 bits where used, and stop when any character higher than 127 was found
11:13:43PMunchI've never come across this though, so keeping that behaviour isn't super-important
11:14:07PMunchYou can also do s: myString[]; s: _ = "END" for example
11:14:33FromDiscord<sealmove> we can both do this and keep the {} until syntax
11:14:39*Vladar joined #nim
11:14:46FromDiscord<kodkuce> am i retarded or duno how to write regex for nim, i just want 0-9 a-f
11:15:18FromDiscord<kodkuce> i tryed [0-3] and gived "32425" and it give me true wtf i have 4 and 5
11:15:25PMunch@sealmove, that is true
11:15:54PMunchTry ^[0-3]*$
11:16:12PMunch@kodkuce ^
11:16:43FromDiscord<sealmove> PMunch this is not specific to strings right?
11:16:48PMunch[0-3] matches the '3' in "32425", so it does match, just not the whole string
11:17:06PMunch@sealmove, nope, this is true for all arrays
11:17:35PMunchWhen the next field is magic then it will peek that before adding things to the array
11:18:02FromDiscord<sealmove> oh wait, so you do add it to the array
11:18:13FromDiscord<kodkuce> yep i think i dont know this regex magic does $ mean each letter?
11:18:17FromDiscord<sealmove> but what if it's can't be added (different type)
11:18:19FromDiscord<kodkuce> (edit) "letter?" => "char?"
11:18:59FromDiscord<sealmove> @kodkuce `` means '0 or more times'
11:19:02PMunch@sealmove, no it isn't added
11:19:27PMunch@kodkuce, the $ means the end of the string
11:19:35FromDiscord<kodkuce> ^ << front
11:19:46FromDiscord<kodkuce> so from from to end :)
11:19:51FromDiscord<kodkuce> ty
11:20:26PMunch^[0-3]*$ breaks down to ^: start of string, [0-3]: any character in the range 0-3, *: zero or more times, $: end of string
11:20:57PMunchNote that it also matches the empty string
11:21:17PMunchIf you want at least one character you can do ^[0-3]+$
11:22:20FromDiscord<sealmove> ok. last but not least, about bit-endian. unaligned data really don't have the concept of regular endian, because regular endian has to do with byte ordering
11:22:22*Torro joined #nim
11:23:08PMunchWell if the data is byte-sized it would still apply
11:23:36PMunchu4: start; lu32: littleEndian; u4: stop
11:24:06PMunchThat for example, the littleEndian number there is still 4 bytes long and can have byte ordering just fine
11:24:07FromDiscord<sealmove> i guess in theory yes
11:24:56FromDiscord<sealmove> but in practice is this ever the case? when ppl use regular endian they have aligned bytes
11:26:05PMunchNot necessarily
11:26:25FromDiscord<sealmove> i mean, in the case you are describing, using little bit-endian will weird the same result
11:26:59FromDiscord<sealmove> mixing the concept of normal is and bit endian is very confusing for no reason i think
11:27:04PMunchIf I was on a small endian machine I could simply do bit-shifting like I would normally do and end up with a little-endian number in that format
11:27:26PMunchTBF I have never seen other bit-endianes
11:27:31PMunchOnly byte-endianes
11:30:31FromDiscord<sealmove> PMunch, applying little bit-endianness to a 32-bit long unaligned bitfield will give you the same little endian number you would get if it was aligned
11:31:02PMunchUhm, no it wouldn't
11:31:47PMunchLittle endian is DCBA instead of ABCD where the letters are bytes that are ordered the same way in both cases
11:38:39FromDiscord<sealmove> hmm yes you are right. my previous statement is completely wrong ๐Ÿ˜› so you are saying we shouldn't assume a number is a bitfield instead of a byte-sized number based on alignment
11:39:05FromDiscord<sealmove> well, kaitai for example uses `b` notation for bitfields and `u` for integers
11:39:06PMunchCorrect
11:39:23FromDiscord<sealmove> so you would write `b32` and it would be different
11:39:25PMunchI typically parse my bitfields into separate u1's
11:40:12FromDiscord<sealmove> would you like to use `b` also? it would simply things a lot since bit fields map to different read proc
11:40:21FromDiscord<sealmove> simplify
11:41:12PMunchWhy are they different?
11:41:56FromDiscord<sealmove> the underlying reads?
11:42:02PMunchI'm not sure if I understand what you mean by bitfields..
11:45:55FromDiscord<sealmove> well, here is the situation. aligned reads use `streams` modules regular reads, so `readUInt32` etc. These are wrapped by procs like `readUint32Be` and `readUint32Le` which just swap endianness or not based on your system's endiannes. For unaligned data special procs are used. There is `readBitsBe` and `readBitsLe`.
11:47:30FromDiscord<sealmove> so an aligned 32bit int will be mapped to a different read proc compared to a 32bit unaligned int
11:48:07PMunchAha
11:48:18PMunchIn my original implementation everything went through the same read procs
11:48:56PMunchAnd it basically just know the current bit offset and made sure to read the right about and shift it around
11:50:01FromDiscord<sealmove> is it possible to keep track of the offset even when custom parsers are used?
11:50:26PMunchNo those need to be aligned I think
11:50:37PMunchI mean it would be possible to allow it
11:50:52FromDiscord<sealmove> i don't keep track of offset within the compiler at all. it's taken care by the bistream structure
11:51:04PMunchI thought that was what your bitstream thing did
11:51:23FromDiscord<sealmove> yes, but it's external to the compiler
11:51:28PMunchI thought that would just expose an API of "read N bits" and it would handle the rest
11:51:51PMunchExternal to the compiler?
11:52:58FromDiscord<sealmove> i mean binaryparse has no info about offset, it's considered at runtime by bitstream object. no, bitstream doesn't expose 1 generic read proc, although it could.
11:53:25PMunchAh I see what you mean
11:55:18FromDiscord<sealmove> so basically, although not necessary, it would help if the user specify `b` to indicate a special kind of read...
11:56:01PMunchBut as far as the user is concerned there's nothing special about that field
11:56:19PMunchBesides, 'b' is already used for big-endian
11:57:11FromDiscord<sealmove> oh right lol
12:01:27FromDiscord<sealmove> hmm ok so basically the implementation I am using assumes big byte endian for unaligned data i guess, and we need to support little endian too, then allow the use of l/b along with n/r
12:05:24FromDiscord<sealmove> no, it uses system's endianness
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:32*supakeen joined #nim
12:10:11FromDiscord<sealmove> ok, if this is true, it's just a matter of detecting if it's byte-sized, and then using `swapEndian` if needed.
12:10:52PMunchPretty much
12:16:39FromDiscord<sealmove> what about bit-endian on aligned reads? does it still make sense in that context?
12:17:49PMunchWhy wouldn't it?
12:18:11PMunchIn as far that it makes sense to begin with
12:18:16FromDiscord<sealmove> standard reads use big bit-endian?
12:18:27*xet7 quit (Remote host closed the connection)
12:19:07FromDiscord<sealmove> readUInt32 for example is big bit-endian + `cpuEndian` byte-endian?
12:19:22PMunchI think so
12:24:37FromDiscord<sealmove> ok... damn these stuff are so confusing to me :S
12:28:07PMunchThere's a reason why I wanted to put this all in a library
12:28:15PMunchSo that i wouldn't have to worry about it later :P
12:35:45*xet7 joined #nim
12:35:58FromDiscord<sealmove> Well now they are in a library ;)
12:35:59FromDiscord<kodkuce> lol i was like wtf why is my aoc not working and just now saw i put 0-8 in regrex insted 0-9 life sux
12:36:00*FromDiscord quit (Remote host closed the connection)
12:36:18*FromDiscord joined #nim
12:40:12*natrys joined #nim
12:46:07mipri\d
12:48:30PMunch@kodkuce, should've used npeg ;)
12:48:33PMunchOr \d I guess
13:01:03*opal quit (Ping timeout: 240 seconds)
13:03:02*opal joined #nim
13:18:30*haxscramper joined #nim
13:19:19haxscrampernarimiran: can you please also merge my other package https://github.com/nim-lang/packages/pull/1747 ?
13:19:20disbotโžฅ Add package htsparse
13:19:51narimiranhaxscramper: of course
13:26:42*fanta1 joined #nim
13:28:46*lritter joined #nim
13:37:57*nyaayaya joined #nim
13:39:01*nyaayaya quit (Client Quit)
13:39:24*nyaayaya joined #nim
13:43:40narimiranhey AoC-ers, does anybody have some fast technique for part 2? my converting to string and back zillion times is meh
13:47:28mipriI just straightforwardly turned everything to numbers when reading the input. The challenge for part 2 is that the part 1 example is extremely scary (2^34 addresses for the one mask) but the actual input and the part 2 examples are much more tractable
13:49:01mipripart2 was just: loop over the 'X'es in the mask: loop over the addresses so far: set the corresponding X bit to 1 and then add a new address with that same bit set to 0
13:50:52narimiranmipri: recursion?
13:50:58miprino, just two loops
13:51:16narimiranmipri: do you have your code in some repo?
13:56:41miprino, for the inner loop I loop over indices, so I can safely mutate (to set 1 bits) and extend (to add copies with 0 bits) it for that 'X'
14:02:46*idf31 quit (Ping timeout: 256 seconds)
14:13:49mipriso the inner loop doubles the length of the array each time it's run, which is once per 'X', with the original member of the array the modified value from the input.
14:28:25*Torro quit (Quit: bye)
14:28:36FromDiscord<hugogranstrom> I did something similar to @pietroppeter I think. Feels nice to learn about the nitty gritty bitops. Knew nothing about them before AoC this year
14:31:48FromDiscord<pietroppeter> yeah, I knew just bitops existed before today ๐Ÿ™‚
14:31:51kenranHum, one thread mentioned the freetype bindings wouldn't work. I've at least gotten it to compile and init with it. So let's see if it's possible to actually render anything.
14:35:15FromDiscord<hugogranstrom> That's really all one needs, to know of something. 'Cause then you can learn it. Yesterday I hadn't even heard of CRT before so I was lucky someone mentioned it ๐Ÿ™‚
14:36:03FromDiscord<hugogranstrom> Next step with bitops is not using `setBit` and `clearBit` all the time I guess
14:37:43FromDiscord<shadow.> lol
14:37:58FromDiscord<shadow.> i do setBit with `num = num and not (1 shl bit)`
14:38:03FromDiscord<shadow.> nvm
14:38:04FromDiscord<shadow.> thats clear bit
14:38:15FromDiscord<shadow.> set bit is `num = num or (1 shl bit)`
14:38:26FromDiscord<hugogranstrom> wow ๐Ÿ˜ฎ
14:38:41FromDiscord<hugogranstrom> that's a bit of magic
14:38:45FromDiscord<shadow.> eh not really
14:38:55FromDiscord<shadow.> 1 is 1
14:38:58FromDiscord<shadow.> so when you shl
14:39:01FromDiscord<shadow.> by the amount of bits
14:39:06FromDiscord<shadow.> index of bit
14:39:08FromDiscord<hugogranstrom> that's a BIT of magic ๐Ÿ˜›
14:39:11FromDiscord<shadow.> ahhh
14:39:12FromDiscord<shadow.> i see
14:39:14FromDiscord<shadow.> lol
14:39:32FromDiscord<hugogranstrom> hehe ๐Ÿ™ƒ
14:39:36FromDiscord<mratsim> 0b00000001 shl 3 is 0b00001000.
14:39:42FromDiscord<shadow.> yeah
14:39:45FromDiscord<hugogranstrom> yeah
14:39:50FromDiscord<shadow.> so then when you do the or mask
14:39:59FromDiscord<shadow.> it essentially forces the nth bit to be 1 because 1 or anything is 1
14:40:07FromDiscord<shadow.> does that make sense lol?
14:40:17FromDiscord<hugogranstrom> Okay thanks ๐Ÿ‘ makes sense ๐Ÿ™‚
14:40:20FromDiscord<shadow.> haha ye
14:40:29FromDiscord<shadow.> idk that's how i figured it in my head, idk if there's a better way tho
14:41:12FromDiscord<mratsim> Most calculators on Linux have a "programming" mode where you can play with shifts and see the bit representation
14:41:17FromDiscord<shadow.> oo
14:41:30FromDiscord<shadow.> im still tryna understand part two
14:41:35FromDiscord<hugogranstrom> Oh so that's what it's for ๐Ÿ˜ฎ
14:41:40FromDiscord<shadow.> i can already tell it's going to need recursion / frontier usage lmao
14:42:32FromDiscord<mratsim> Bitsets are basically application or setBit clearBit and getting if a bit is 0 or 1
14:42:40FromDiscord<shadow.> ohhh nice
14:42:53FromDiscord<hugogranstrom> Some sort of loopy thing at least. I made an iterator
14:43:04FromDiscord<hugogranstrom> Oh
14:43:05FromDiscord<shadow.> ah fair fair
14:43:10FromDiscord<shadow.> i needa understand this better lmfao
14:44:42FromDiscord<hugogranstrom> Is it the floating part that's tricky?
14:44:55FromDiscord<shadow.> ye i mean i can do that but
14:45:01FromDiscord<shadow.> im not really
14:45:06FromDiscord<shadow.> too focused rn bc im also in class
14:45:11FromDiscord<shadow.> so its hard to rly grasp the problem rn lol
14:46:06FromDiscord<hugogranstrom> hahaha xD
14:46:18FromDiscord<hugogranstrom> Perhaps good that you don't grasp it yet
14:46:50FromDiscord<hugogranstrom> Would've coded instead of doing classy things ๐Ÿ˜›
14:47:18FromDiscord<shadow.> welll
14:47:25FromDiscord<shadow.> we're doing essay planning for an essay i've already started
14:47:29FromDiscord<shadow.> so it's not important
14:47:33FromDiscord<shadow.> but i can't exactly mute it yk
14:49:07Araqbah I'm an idiot
14:49:22Araqnested two for loops with 'i' counters
14:49:37Araq:-/
14:49:50FromDiscord<mratsim> that's why you should use map/fold/filter.
14:50:05FromDiscord<mratsim> embrace Haskell
14:50:11FromDiscord<mratsim> no more loop problems
14:50:29AraqI could also make my compiler complain about nesting
14:50:55FromDiscord<hugogranstrom> @shadow. oh I see, better make use of the time then lol
14:51:11FromDiscord<mratsim> wasn't there a related discussion on shadowing and it was chosen to only warn for "result" ?
14:51:17Araqproblem is that I also often re-use identifiers in order to avoid bugs (cannot accidentically use the other version)
14:51:32FromDiscord<shadow.> ye, just tryna comprehend the problem rn i suppose
14:51:42FromDiscord<sealmove> if I have a uint32 and i only care for the 24 least significant bits, can I cast it to a seq[byte] of size 3 without losing info?
14:52:05FromDiscord<mratsim> casting to a GC-ed type is a recipe for disaster
14:52:07FromDiscord<shadow.> casting to byte seqs are weird
14:52:10FromDiscord<shadow.> try an array instead
14:52:15FromDiscord<mratsim> cast to array[4, byte] yes
14:52:25FromDiscord<shadow.> or `array[3, byte]` should also work
14:52:30FromDiscord<shadow.> iirc
14:52:30FromDiscord<sealmove> unfortunately i don't know the length i care about at CT
14:52:34FromDiscord<shadow.> ahh i see
14:52:37FromDiscord<mratsim> only on little-Ednian platforms
14:52:43FromDiscord<shadow.> but you said you only care about the 24 bits, no?
14:53:07FromDiscord<mratsim> cast[ptr UncheckedArray[byte]](myInt.addr)
14:53:12FromDiscord<sealmove> yes, i want to cast to array/seq so i can use reverse() on it, but it must have the correct size, so i don't reverse 0 bytes
14:53:20Araqdom96, shashlick, I love 'nimble develop'. :-)
14:53:59PMunchsealmove, I doubt that'll work very well..
14:54:02FromDiscord<mratsim> use generics and cast[array[sizeof(MyInt), byte]](myInt)
14:54:18AraqI know it's a rather old by now, but it's excellent, thanks again for this feature
14:54:26FromDiscord<mratsim> or use swapBytes from the endians module.
14:54:26PMunchI think swapEndian and shifting is probably your best option
14:54:36FromDiscord<hugogranstrom> Good idea, it's always a bad idea to run straight into AoC problems without understanding what you're doing. Better to write correct code from the beginning then trying to find the bugs in a faulty code
14:54:43FromDiscord<sealmove> swapEndian only works for 16, 32, and 64 bit ints
14:55:01FromDiscord<sealmove> ah shift, hmm
14:55:05PMunchYeah, that's why you should shift it afterwords ;)
14:55:13PMunchOr before
14:55:36PMunchBy the way, new AoC stream in a little while :)
14:55:51FromDiscord<mratsim> Find implementation to I2OS and OS2I in any good cryptographic library, they basically do that :p
14:56:01PMunchPeople seem to have struggled a bit on this one, so I'm curious >_<
14:56:19FromDiscord<shadow.> i mean
14:56:21FromDiscord<shadow.> part two a lil bit
14:56:23FromDiscord<shadow.> part one was quite eas
14:56:24FromDiscord<shadow.> (edit) "eas" => "easy"
14:56:43FromDiscord<mratsim> here is mine @sealmove: https://github.com/mratsim/constantine/blob/master/constantine/io/io_bigints.nim#L64-L118
14:59:20FromDiscord<hugogranstrom> Yeah part1 is usually easy but if you're lucky you can reuse parts of it in part2 as well
14:59:33FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2I1U
15:00:44FromDiscord<sealmove> it works ๐Ÿ™‚
15:03:43FromDiscord<shadow.> @pietroppeter you ever tried npeg?
15:03:48FromDiscord<shadow.> your solution could prolly be much more concise with it haha
15:04:11PMunchStream is live: https://www.twitch.tv/pmunche https://www.youtube.com/watch?v=4WpHK4U_Jvc
15:06:43FromDiscord<hugogranstrom> Npeg is the deal! โญ
15:07:08FromDiscord<shadow.> yessir
15:08:07FromDiscord<sealmove> PMunch, endianness is fixed already ๐Ÿ™‚ mixing byte and bit endianness is possible for ints that are multiples of a byte!
15:08:10FromDiscord<pietroppeter> shadow: I like npeg a lot but still do not know it enough for using in AoC. Also I like to have more control for debugging and I am not aiming at conciseness. I split stuff also to test them separately.
15:08:16FromDiscord<shadow.> fair
15:08:29FromDiscord<shadow.> my npeg was something like
15:08:30FromDiscord<shadow.> `maskSet <- "mask = " >36:`
15:08:34FromDiscord<shadow.> `memSet <- "mem[" >+Digit "] = " >+Digit:`
15:08:38FromDiscord<shadow.> obvi more than that but that's the core
15:08:45Zevvsend me money
15:08:45Zevvlots
15:08:46FromDiscord<pietroppeter> yeah, btw I was surprised you could do >36
15:08:54FromDiscord<shadow.> gotchu
15:08:56FromDiscord<pietroppeter> I did not find it in docs...
15:09:00FromDiscord<shadow.> really?
15:09:03FromDiscord<shadow.> n
15:09:05FromDiscord<shadow.> matches n characters
15:09:10FromDiscord<shadow.> i think thats in docs haha
15:09:14FromDiscord<sealmove> oh great, aoc is more bits and bytes lol
15:09:19FromDiscord<pietroppeter> ah yeah, did not look for it that well then ๐Ÿ˜„
15:09:23FromDiscord<shadow.> haha
15:09:33*waleee-cl joined #nim
15:10:31FromDiscord<pietroppeter> see, I know too little npeg yet to use it now and I have already my plate full with aoc and nimib to start learning it now. But I enjoy looking at solutions using it (like yours :)); it's a way to start learning...
15:11:43FromDiscord<pietroppeter> for example when I tried npeg on day6 I was stuck here and quickly changed gears: https://github.com/pietroppeter/adventofnim/blob/master/2020/day06npeg.nim
15:13:32FromDiscord<pietroppeter> but I keep it as an issue open on my repo ๐Ÿ˜„ https://github.com/pietroppeter/adventofnim/issues/1
15:13:33disbotโžฅ Regexes? no, learn Npeg!
15:17:55FromDiscord<shadow.> true
15:18:13FromDiscord<shadow.> tbh npeg shouldn't be too hard if you put your mind to it
15:18:21FromDiscord<shadow.> i learned it on aoc day 7 lol
15:18:23FromDiscord<shadow.> been using it ever since
15:23:48FromDiscord<pietroppeter> well, can you tell me what's wrong here? https://play.nim-lang.org/#ix=2GP3
15:32:35FromDiscord<shadow.> lemme take a look
15:33:50FromDiscord<pietroppeter> thanks!
15:34:55FromDiscord<shadow.> hmm
15:35:14FromDiscord<shadow.> i have not used the builtin peg macro, is it any different?
15:37:19FromDiscord<Quibono> So npeg is regex without the evil?
15:37:32FromDiscord<shadow.> well
15:37:35FromDiscord<shadow.> regex but
15:37:37FromDiscord<shadow.> - more readable
15:37:41FromDiscord<shadow.> - nim code can be embedded
15:37:44FromDiscord<shadow.> - uses macro instead of string
15:37:44FromDiscord<Quibono> Lol so without the evil.
15:37:58FromDiscord<Quibono> _wants npeg tutorial_
15:38:00FromDiscord<shadow.> - capture groups are referenceable
15:38:01FromDiscord<shadow.> lmao
15:38:51FromDiscord<shadow.> which problem was this?
15:38:54FromDiscord<shadow.> i can find my npeg for this one
15:39:08FromDiscord<pietroppeter> shadow: not sure what you mean, I see peg used in one of the solution you shared earlier. Take into account that was my first try with npeg after reading about it the day before.
15:39:17FromDiscord<pietroppeter> day6
15:39:51FromDiscord<shadow.> hmm ok
15:39:58FromDiscord<shadow.> do you want to try making one for day 7?
15:40:03FromDiscord<shadow.> might be easier to help on that since ive already made one for it
15:40:04FromDiscord<shadow.> lol
15:40:20FromDiscord<pietroppeter> not at the moment ๐Ÿ™‚
15:40:22FromDiscord<shadow.> rip
15:41:12FromDiscord<shadow.> https://play.nim-lang.org/#ix=2I2h
15:41:15FromDiscord<shadow.> is this what you wanted?
15:42:19FromDiscord<pietroppeter> yes!
15:42:32FromDiscord<hugogranstrom> `` is tricky
15:42:34FromDiscord<shadow.> haha yeah
15:42:42FromDiscord<shadow.> use + when you can, it's more readable imo
15:42:53FromDiscord<shadow.> i think it's because you did any amount of answers
15:42:57FromDiscord<shadow.> when answers should be 1
15:43:07FromDiscord<hugogranstrom> sent a code paste, see https://play.nim-lang.org/#ix=2I2j
15:43:19FromDiscord<pietroppeter> damn I thought was 1 one or more and + was zero or more while it is the other way around...
15:43:23FromDiscord<shadow.> haha yeah
15:44:01*Cthalupa quit (Ping timeout: 264 seconds)
15:44:02FromDiscord<shadow.> you've done today's already right?
15:44:05FromDiscord<pietroppeter> (I did associate and + with their identity operator-wise)
15:44:12FromDiscord<pietroppeter> yes I did
15:44:19FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2I2k
15:44:19FromDiscord<shadow.> npeg really helped here
15:44:21FromDiscord<pietroppeter> anyway thanks for the catch
15:44:38FromDiscord<shadow.> idk how i woulda done it without it lol
15:44:48FromDiscord<shadow.> maybe a mix of strscans, regex, split, and strutils
15:44:57FromDiscord<shadow.> or even indexing lmfao
15:44:58*Cthalupa joined #nim
15:44:59FromDiscord<pietroppeter> yeah, altough I would probbly never do the job in the parsing blocks. I would always output some parse structure
15:45:03FromDiscord<shadow.> fair
15:45:19FromDiscord<pietroppeter> oh, well yeah it was a very simple parsing with startswith and scanf for the mem part
15:45:29FromDiscord<shadow.> fair fair
15:45:43FromDiscord<shadow.> idk i kinda like having structure in my parsing
15:45:51FromDiscord<shadow.> and i feel like when i throw various methods together it doesn't feel as organized
15:45:54FromDiscord<shadow.> so i stick with npeg
15:47:46FromDiscord<pietroppeter> I know my solutions are not sexy at all (and they are very verbose), but I can tell when they do not work. ๐Ÿ˜„ I actually put echos for unexpected stuff that would not match so I get a warning (not bothering with raising error since this is throwaway code anyway) https://github.com/pietroppeter/adventofnim/blob/master/2020/day14.nim#L46
15:47:54FromDiscord<shadow.> fair
15:48:03FromDiscord<shadow.> my answers are typically quite sexy but not the easiest to debug
15:48:05FromDiscord<pietroppeter> anyway that helped reinstate a bit more confidence on my understanding of npeg ๐Ÿ™‚
15:48:11FromDiscord<shadow.> ofc
15:48:34FromDiscord<shadow.> gotta say i kinda love my solution for yesterday lol
15:48:35FromDiscord<shadow.> https://github.com/shadowninja55/aoc-2020/blob/main/13/day13.nim
15:49:35FromDiscord<hugogranstrom> it's so small ๐Ÿ˜ฎ
15:50:02FromDiscord<shadow.> haha yeah that's generally how i do stuff
15:50:20FromDiscord<shadow.> i finally got to use defer lol
15:50:22FromDiscord<pietroppeter> yep, looks very nice, congrats!
15:50:32FromDiscord<shadow.> thanks!
15:50:32FromDiscord<shadow.> https://github.com/shadowninja55/aoc-2020/blob/main/03/day3.nim
15:50:36FromDiscord<shadow.> this one was just ridiculous-
15:52:06FromDiscord<hugogranstrom> haha
15:52:15AraqI still wish we copied Python's with statement instead of Go's defer
15:52:43FromDiscord<hugogranstrom> Not having the tests does make all mine seem much smaller as well ๐Ÿค”
15:53:07FromDiscord<shadow.> lmfao yeah i have like
15:53:09FromDiscord<shadow.> zero asserts
15:53:12FromDiscord<shadow.> do the minimum possible
15:53:18FromDiscord<shadow.> it's the most awful code ever
15:53:21FromDiscord<shadow.> but it sure looks pretty
15:53:41FromDiscord<hugogranstrom> haha yeah sure do
15:53:54FromDiscord<hugogranstrom> And Nim code always looks pretty ๐Ÿ˜‰
15:53:56FromDiscord<shadow.> day 12 was sexy too
15:54:03FromDiscord<shadow.> swapping y and x then y -1
15:54:08FromDiscord<shadow.> was a nice discovery
15:54:27Zevvnpeg is just a tool. it's not magic and you can do without
15:54:42Zevvit makes some things easier, and some things not
15:54:48Zevvso, hey, pick your poison
15:55:55FromDiscord<hugogranstrom> that's clever, I made it much more verbose... Using complex numbers would probably have been even sexier
15:56:04FromDiscord<shadow.> haha
16:03:24*hnOsmium0001 joined #nim
16:04:59Araqif I import 'x as y' should 'x' still be in the scope?
16:05:57PMunch@shadow., pfft, part2 wasn't that hard
16:06:40FromDiscord<Quibono> Like should you be allowed to do import random as r and then reference random?
16:06:49Araqyeah
16:06:55FromDiscord<Quibono> Iโ€™d say no
16:07:07*krux02 quit (Remote host closed the connection)
16:07:08Araqhttps://play.nim-lang.org/#ix=2I2x yeah
16:07:28Araqok, so that's the cause of my regression
16:07:40FromDiscord<myphs> Are there any resources on how to get into win32 programming with Nim or maybe a lib?
16:08:08FromDiscord<Quibono> Like why specify โ€œasโ€ it youโ€™re just going to try and use it the original way.
16:08:36Araqthere are nimble packages, myphs, but iirc they are bad
16:08:58Araq"bad" because not idiomatic Nim code, emulating VB or something
16:08:58FromDiscord<shadow.> @PMunch well i still havent done it ๐Ÿ˜” ]
16:09:23FromDiscord<shadow.> myphs winim isnt that bad
16:09:33Araqyou should start with reading the stdlib's winlean.nim module. while not perfect, it's a start
16:09:33FromDiscord<shadow.> but yeah its not nimion
16:10:49*matthias_ joined #nim
16:11:53PMunch@shadow. well it's a bit tricky if you aren't used to a lot of bit-stuff
16:12:27FromDiscord<shadow.> im use to that, just the recursion part is hard to understand for me lol
16:12:28FromDiscord<shadow.> ill get it soon
16:12:32FromDiscord<shadow.> once im not thinking of class too
16:12:38FromDiscord<Quibono> Beyond the basic style guide, is there a move towards a more expansive style guide?
16:13:28PMunchRecursion?
16:13:36FromDiscord<myphs> We'll look into that. Thanks guys!
16:14:33FromDiscord<shadow.> some people said recursion was needed idek
16:14:35FromDiscord<shadow.> lmao
16:14:39FromDiscord<shadow.> or maybe it was nested loops
16:14:40FromDiscord<shadow.> im not sure
16:15:15matthias_Is it idiomatic to call one macro from another, and is there a way to pass along values (in this case, a symbol)? E.g. `let foo = macroOne(SomeObj)` and then `macroOne` calls `macroTwo(SomeObj)` which receives the original `SomeObj` nnkSym.
16:19:04FromDiscord<Klaufir> sent a code paste, see https://play.nim-lang.org/#ix=2I2F
16:19:15FromDiscord<Klaufir> (edit) "https://play.nim-lang.org/#ix=2I2H" => "https://play.nim-lang.org/#ix=2I2G"
16:19:23FromDiscord<Klaufir> (edit) "https://play.nim-lang.org/#ix=2I2G" => "https://play.nim-lang.org/#ix=2I2I"
16:20:41FromDiscord<Rika> @Quibono what would you like to see in the style guide
16:21:47FromDiscord<Quibono> Mhmm, just more clarity on exactly what is Nim-ish
16:22:00FromDiscord<Rika> Like for what constructs I mean
16:22:51FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2I2M
16:23:18FromDiscord<Quibono> Like is UFCS the default or just a nice thing sometimes?
16:23:26FromDiscord<shadow.> default when applicable
16:23:37FromDiscord<shadow.> for instance `a.high` over `high(a)`
16:23:43FromDiscord<Rika> What do you mean, UFCS is a feature
16:23:46FromDiscord<Quibono> Disruptekโ€™s style guide is kinda what I mean, like itโ€™s super opinionated
16:23:47FromDiscord<Rika> Not a syntax style
16:24:00FromDiscord<Rika> It is composed of multiple syntax styles
16:24:04FromDiscord<Quibono> But which features we use and when
16:24:04FromDiscord<shadow.> i think he means is it more idiomatic to `a.f` instead of `f(a)`
16:24:08FromDiscord<shadow.> and other stuff like that
16:24:09FromDiscord<Quibono> Yeah
16:24:11FromDiscord<Rika> It depends
16:24:13FromDiscord<Quibono> That.
16:24:14FromDiscord<shadow.> yeah
16:24:26FromDiscord<shadow.> depends on how complex the function is, if it has side effects, stuff like that
16:24:31FromDiscord<Rika> Nim is not a language that imposes a lot of stylistic opinions
16:24:39FromDiscord<shadow.> yeah it's really flexible
16:24:46FromDiscord<shadow.> so it's kinda whatever you think looks good lol
16:24:49FromDiscord<Rika> And I believe it's intentional
16:24:56miprialthough it does completely eliminate the eternal problem of C programmers putting { on its own line
16:25:03FromDiscord<Klaufir> thank you!
16:25:04FromDiscord<shadow.> lmfao yeah
16:25:10FromDiscord<Quibono> Lol i guess I just want a benchmark for โ€˜goodโ€™ Nim.
16:25:44FromDiscord<Rika> Why would it have UFCS and partial style insensitivity if it were to just restrict that with a style guide anyway
16:27:00FromDiscord<Rika> Good nim is nim that can be read easily.
16:27:07FromDiscord<Rika> And that is dependent on the person
16:27:10AraqRika: because the community demands it
16:27:20FromDiscord<Rika> Beauty in the eye of the beholder ig
16:27:40FromDiscord<haxscramper> ~disrupstyle
16:27:41disbotdisrupstyle: 11tips for writing code that won't provoke ๐Ÿ˜  rants ๐Ÿคฌ on irc: https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d
16:28:15FromDiscord<Rika> Araq well I guess that makes sense now that I've thought about it for a while
16:28:33FromDiscord<haxscramper> But more extensive style guide will basically mean there will be non-stop opinion sharing
16:28:39FromDiscord<Quibono> Lol Like I donโ€™t love how Black styles Python code but I use it because standardization.
16:28:56FromDiscord<Rika> Eh
16:28:58Araqmethod call syntax and SI were introduced before Golang came along to show us the light, fascism is superior, nothing else "scales" as well
16:29:14FromDiscord<haxscramper> Instead of actually writing code, so you should just stick to whatewher you like, as long as it stays withing this value 'use common sense' boundaries
16:29:14FromDiscord<Quibono> Araq +1 for you dictatorially writing a style guide and enforcing your will.
16:29:29FromDiscord<Quibono> ++1 for fascism in syntax.
16:29:43FromDiscord<Rika> I am having difficulty distinguishing sarcasm
16:29:47FromDiscord<Rika> Right now
16:29:59FromDiscord<haxscramper> No sacrasm
16:30:13AraqI'm glad programmers have little political power
16:30:34Araqtheir way of thinking is utterly broken.
16:30:48FromDiscord<haxscramper> works for me (TM)
16:31:09FromDiscord<Quibono> @Rika Iโ€™m being serious, I prefer like a The Elements of Style approach to programming.
16:31:38Araqoh no, somebody used an old word that I don't understand, I'm confused, we must purge the world of code from this word
16:31:56FromDiscord<haxscramper> But on the topic of style guide - I mysefl still have troubles remembering what style I like, so I just write code that looks like adjacent code on the screen
16:32:05FromDiscord<Quibono> Lol, fair
16:32:50Araqoh no, somebody painted his roof blue, all roofs must be red, inconsistent! I cannot live in this city
16:33:31FromDiscord<Quibono> Lol so Araq is this your way of saying Nim is antifa in itโ€™s syntax? :p
16:33:38FromDiscord<shadow.> its
16:33:39FromDiscord<shadow.> ๐Ÿ™„,,
16:33:45FromDiscord<shadow.> inconsistent.
16:33:49FromDiscord<shadow.> shall i make an english grammar style guide?
16:33:50FromDiscord<Quibono> Fascist!
16:33:54FromDiscord<Quibono> Lol
16:36:47*NimBot joined #nim
16:37:15FromDiscord<Quibono> But yeah my bad on the its.
16:39:00FromDiscord<shadow.> how big is default int?
16:39:17FromDiscord<shadow.> i was being facetious
16:39:42FromDiscord<shadow.> my point is that with something like grammar where that was actually incorrect people can still understand you
16:39:48FromDiscord<shadow.> so with something like style that makes no actual difference
16:39:53FromDiscord<shadow.> who cares what you stylize it as
16:39:56FromDiscord<shadow.> as long as you can read it it works
16:42:12FromDiscord<Quibono> But grammar is just an artificial style
16:42:12FromDiscord<Quibono> Like ainโ€™t is only wrong because we think AAVE is non-standard.
16:42:12FromDiscord<lqdev> hm ARC doesn't seem to like my value representation
16:42:57FromDiscord<shadow.> try writing it an essay on why it should like it
16:43:51FromDiscord<lqdev> 1. it works on --gc:refc
16:43:56FromDiscord<lqdev> end of essay
16:44:43FromDiscord<lqdev> something seems to cause corruption
16:44:50Araqlqdev: report it on github.
16:44:57FromDiscord<lqdev> easier said than done
16:45:04FromDiscord<lqdev> i'll try making it reproducible first
16:45:05Araqand avoid the system.add that takes an openArray
16:45:11FromDiscord<lqdev> oh?
16:45:18Araqit's broken and I'm sorry it made it into 1.4.2 this way
16:45:19FromDiscord<lqdev> is it broken?
16:45:39Araqyes
16:45:51*rockcavera quit (Remote host closed the connection)
16:45:54FromDiscord<lqdev> ok i'll try rewriting some of my code that uses it
16:46:07Araqcreate a PR instead please
16:46:15Araqrevert it to the old non-sink version
16:47:28Araqwe're still discussing internally what 'sink openArray' actually means :-/
16:48:07FromDiscord<Avatarfighter> Hello everyone how are you all?
16:49:02Araqfine
16:49:36FromDiscord<Rika> coarse
16:50:31FromDiscord<Avatarfighter> damn thats rough
16:51:12FromDiscord<Rika> of coarse
16:52:21FromDiscord<ache of head> XDDD
16:52:47FromDiscord<shadow.> does anyone know pmunch's github?
16:53:05FromDiscord<shadow.> nvm got it
16:53:44FromDiscord<Rika> congratulations
16:53:46FromDiscord<lqdev> damn my VM really screws up with ARC/ORC :/
16:54:02FromDiscord<lqdev> i'll debug it some but first i'll do that un-sinking PR
16:54:55FromDiscord<lqdev> Araq: the docs don't seem to mention that the `openArray` version accepts a `sink openArray`
16:55:28FromDiscord<lqdev> ah
16:55:33FromDiscord<lqdev> it's only for destructors-based GCs
16:56:13FromDiscord<shadow.> wait a minute...
16:56:19FromDiscord<shadow.> to generate every binary combination for n bits
16:56:23FromDiscord<shadow.> isnt it just like
16:56:31FromDiscord<shadow.> every number from 0b0 to 0b1(n)
16:56:38*thomasross joined #nim
16:56:53FromDiscord<shadow.> like for 3 bits every number between 0 and 0b111?
16:59:48FromDiscord<lqdev> Araq: should i just remove the `when defined` branch for gcDestructors completely, or do sth like `when false`, orโ€ฆ?
17:00:48Araq'when false', eventually a variant of it will be implemented
17:01:30FromDiscord<lqdev> ok
17:01:59Araqthere is also some arc test that then will start to fail
17:02:09Araqyou need to disable that one too and reopen the original issue
17:04:18FromDiscord<lqdev> are you referring to #15511 ?
17:04:19disbothttps://github.com/nim-lang/Nim/issues/15511 -- 3[ARC] Crash when adding openArray proc argument to a local seq ; snippet at 12https://play.nim-lang.org/#ix=2zYW
17:04:24FromDiscord<lqdev> that's the only one i could find
17:04:43miprishadow., yeah, it's 2^n where n=number of X bits, in part 2
17:07:30Araqlqdev: iirc there was another one but ok
17:10:10*Vladar quit (Quit: Leaving)
17:10:21FromDiscord<lqdev> anyways, now to get rid of choosenim because i can't run tests.
17:12:04FromDiscord<ache of head> yeah, i think that's how it works
17:13:11Araqnarimiran, https://gist.github.com/haxscramper/ad781ebd5a343b53197bf538a1252f83 another one coming from a native language lacking articles
17:13:11FromDiscord<lqdev> ah shit
17:13:20FromDiscord<haxscramper> How exactly `const QIcon &icon` should be mapped to nim types?
17:13:24FromDiscord<lqdev> how can i temporarily change my Nim to the one from git
17:13:29FromDiscord<haxscramper> For wrappers
17:13:39FromDiscord<haxscramper> Just ` icon: QIcon` is enough, or there is more to it
17:13:54Araqhaxcramper: make the QIcon *type* .byref
17:14:45FromDiscord<haxscramper> `QIcon` is a wrapper for `C++` object, and it might be used without `&` as well
17:15:57FromDiscord<haxscramper> Or this won't make a difference, and `impl(const QIcon &icon)` and `impl(QIcon icon)` would be handled correctly?
17:15:58Araqyeah .byref and .bycopy is insufficient, we need even better wrapping support
17:16:20FromDiscord<shadow.> lit
17:16:31Araqfor now it's not too bad as .importcpp means Nim uses the C++ header
17:16:48Araqand C++ linking is type safe
17:17:01Araqgetting it a little bit wrong doesn't matter. for now :-)
17:17:29*Vladar joined #nim
17:17:38FromDiscord<haxscramper> Alright, then I will just leave `icon: QIcon` for now
17:18:33FromDiscord<haxscramper> I decided to just leave fully-automatic full-project wrapping implementation `hcparse` and just wrap things one-by-one
17:18:55FromDiscord<haxscramper> And now finally starting qt wrapper
17:19:53Araqso ... afterwards we will have a high quality, type-safe Nim wrapper? madness
17:20:49FromDiscord<haxscramper> I'm hoping to do this. I've added support for custom post-processing pass on wrappers, where you can plug in custom logic that operates on generated nim code
17:21:02FromDiscord<haxscramper> in addion to working on PNode instead of string codegen
17:21:20*matthias_ quit (Quit: matthias_)
17:21:22Araqthat's what c2nim does too, some postprocessing
17:21:29Araqon the PNode structure
17:21:58Araqplease at least copy its code if you cannot use/patch c2nim
17:22:14FromDiscord<haxscramper> I made second layer of abstraction on top of this, so you can do things like `procDecl.exported = true`
17:22:34FromDiscord<haxscramper> Instead of messing with `nnkPrefix(ident(""))` all over the place
17:23:42Araq*cough*
17:23:54AraqI was young
17:24:17FromDiscord<haxscramper> And postprocessing callbacks work on these objects, which have about ten trillion knobs and switches for different things
17:24:28Araqcouldn't be bothered to create an API that makes sense :P
17:24:55*muffindrake joined #nim
17:25:02FromDiscord<haxscramper> Well, actually, after writing this "nim ast wrapper" I'm not so sure it really that much better in general case
17:25:08ForumUpdaterBotNew thread by HJarausch: One more "collect" question (bug?), see https://forum.nim-lang.org/t/7253
17:25:30Araqback then the question was "can this work at all". I was happy when I proved this to be true.
17:26:25Araq(this was before Elixir, Haxe and Rust existed...)
17:27:22FromDiscord<haxscramper> It is really convenient to use for codegen, but it is that much more complex API, I mean nim object declaration turned into three separate types, mutually recursive, with cases all over the place
17:28:25Araqyeah, your stuff is likely worse :P
17:33:39*azed joined #nim
17:40:15FromDiscord<sealmove> @PMunch I updated README demonstrating proposed design for the features we discussed. Let me know if it looks good to you.
17:50:58*habamax quit (Ping timeout: 265 seconds)
17:51:48*Vladar quit (Quit: Leaving)
17:51:55FromDiscord<XxDiCaprioxX> how do I append something at the end of a sequence?
17:52:48PMunch@sealmove, I'm off to go climbing right now. Will look at it later today or tomorrow
17:53:04PMunch@shadow., haha well you can guess once what my GitHub is :P
17:55:01FromDiscord<InventorMatt> @XxDiCaprioxX the .add proc
17:55:28*PMunch quit (Quit: leaving)
17:56:49FromDiscord<XxDiCaprioxX> Are variables of types always immutable?
17:57:53FromDiscord<XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2I3n
17:58:15FromDiscord<XxDiCaprioxX> I cant manipulate that variable after initializing a variable to that type
17:58:33FromDiscord<lqdev> you need to do `var x = Foo()`
17:58:37FromDiscord<lqdev> `let` makes it immutable
17:59:01FromDiscord<lqdev> also, FYI to avoid confusion simply refer to these "object variables" as "fields"
17:59:48FromDiscord<XxDiCaprioxX> okay, i didnt know that was the term for it
18:00:21*fredrikhr quit (Read error: Connection reset by peer)
18:00:36FromDiscord<XxDiCaprioxX> but that doesnt work, I have `var x = Foo()` and then I try `x.bar += "something"` and it wont let me change that
18:01:28FromDiscord<lqdev> ah
18:01:37FromDiscord<lqdev> in nim you use `x.add("something")` to append to strings
18:01:41FromDiscord<lqdev> or `x &= "something"`
18:01:47FromDiscord<lqdev> if you prefer operators
18:02:24FromDiscord<XxDiCaprioxX> no, I just wrote that out of routine cuz I did Java for some time and got used to that
18:02:28disruptekuse add; it's more performant.
18:02:44FromDiscord<XxDiCaprioxX> I actually have `x.bar.add("something)` but still it won't work
18:03:04FromDiscord<lqdev> what's the error?
18:03:07*rockcavera joined #nim
18:03:54FromDiscord<XxDiCaprioxX> type mismatch, required seq[T] but seq[T] is immutable
18:03:59FromDiscord<shadow.> wait wt
18:04:01FromDiscord<shadow.> wtf
18:04:03FromDiscord<shadow.> part two was so easy
18:04:14FromDiscord<shadow.> i thought it wanted to branch out from each index that branched out from the first one LMAO
18:04:19FromDiscord<shadow.> i didnt realize it was one-depth
18:04:21disruptekyour x is immutable.
18:04:42FromDiscord<InventorMatt> @XxDiCaprioxX does yours look something like this https://play.nim-lang.org/#ix=2I3p ?
18:04:56FromDiscord<XxDiCaprioxX> yes
18:05:46FromDiscord<InventorMatt> that runs so I don't know what would cause the error on your end then
18:05:56*abm joined #nim
18:06:01FromDiscord<XxDiCaprioxX> I have seq[T] not string ,would that change anything?
18:07:02FromDiscord<Avatarfighter> Has anyone recently tried building nimterop and has had issues with it failing to install?
18:07:36FromDiscord<InventorMatt> @XxDiCaprioxX it shouldn't make a difference https://play.nim-lang.org/#ix=2I3s
18:08:41FromDiscord<XxDiCaprioxX> maybe because my seq is of a type that inherits from object?
18:09:16dom96<Araq> dom96, shashlick, I love 'nimble develop'. :-)
18:09:18FromDiscord<lqdev> are you sure that `x` is a var and not a let?
18:09:18dom96yay
18:09:48dom96Although I do wonder why you need it now that local deps is a thing
18:09:51FromDiscord<XxDiCaprioxX> FOUND MY MISTAKE
18:09:56FromDiscord<lqdev> what was it
18:10:08FromDiscord<XxDiCaprioxX> I have x initialized in a proc that comes after where I try to change it
18:10:24FromDiscord<XxDiCaprioxX> nvm
18:10:27FromDiscord<XxDiCaprioxX> still not working
18:13:03Araqdom96, in my branch plenty of "important packages" are failing and I do 'nimble develop packageX'
18:13:16Araqto reproduce locally, works fine
18:13:21FromDiscord<shadow.> is there any package (stl or nimble) that handles bitsets?
18:13:25FromDiscord<shadow.> like setBit clearBit
18:13:31FromDiscord<shadow.> using bitops rn is kinda hard to read
18:13:32FromDiscord<lqdev> yeah
18:13:34FromDiscord<lqdev> `set[T]`
18:13:53Araqfor sets these are incl/excl, the 'in' operator etc
18:14:05FromDiscord<lqdev> https://nim-lang.org/docs/manual.html#types-set-type
18:14:05FromDiscord<shadow.> but does it have the necesarry operations? like how can i convert `5` to a bitset
18:14:10FromDiscord<lqdev> cast
18:14:21FromDiscord<shadow.> hm
18:14:24FromDiscord<shadow.> and setBit?
18:14:32FromDiscord<nikki> incl
18:14:37FromDiscord<shadow.> OHH
18:14:48Araqdom96, in this case local deps have not yet been required
18:14:51dom96Araq, ahh so it's for quick testing, nice
18:15:01FromDiscord<shadow.> so a bitset would just be set[anything]?
18:15:12FromDiscord<shadow.> nvm
18:15:13FromDiscord<shadow.> set[int]
18:15:25FromDiscord<nikki> yeah some large enough ordinal
18:15:26Araquse HashSet[int] instead
18:15:33FromDiscord<shadow.> why's that?
18:15:43*krux02 joined #nim
18:15:53FromDiscord<shadow.> i thought generally set[int] > IntSet > HashSet[int]
18:16:12Araqwell 'set[int]' doesn't even compile
18:16:30FromDiscord<shadow.> should i use intset then?
18:18:25FromDiscord<nikki> if you want 5 bits you can do set[0..4]
18:18:28FromDiscord<lqdev> `set[int16]` is the maximum you can use
18:18:42FromDiscord<shadow.> ah i need 36 bits for this problem
18:18:48FromDiscord<ElegantBeef> Ah aoc
18:18:53FromDiscord<shadow.> yup
18:19:18FromDiscord<ElegantBeef> Used sets + bitops for pt1
18:19:21FromDiscord<shadow.> i was just using
18:19:25FromDiscord<shadow.> yeah
18:19:33FromDiscord<shadow.> i just used like uint64 + bitops
18:20:09FromDiscord<ElegantBeef> well i make a `set[0..35]`, then cast it to an int then use the `setMasked` and `clearMasked`
18:20:22disruptekof course. what else?
18:20:35FromDiscord<shadow.> ahh fair enough beef
18:22:39*leorize quit (Quit: WeeChat 2.9)
18:23:18FromDiscord<shadow.> ohh yeah that works well
18:24:05*Vladar joined #nim
18:25:50FromDiscord<shadow.> is there any elegant way to do int powers, or do you just have to cast args to float64 then cast result to int
18:26:10FromDiscord<ElegantBeef> `(1 shl i)`
18:26:39FromDiscord<Avatarfighter> is there a way to upgrade all nimble packages?
18:27:00Araqmath.`**` also exists, not sure
18:27:13disruptekshhh
18:27:16disruptekthis is more fun.
18:27:39FromDiscord<shadow.> ohh ok
18:28:26FromDiscord<shadow.> wait `` exists?
18:29:01FromDiscord<shadow.> `2 i` how would i do that with bitops?
18:29:13FromDiscord<ElegantBeef> it's literally `1 shl i`
18:29:18FromDiscord<shadow.> oh lmfao-
18:29:32FromDiscord<shadow.> ah right because
18:29:34FromDiscord<shadow.> times 2 i amount of times
18:29:38FromDiscord<shadow.> since binary is base 2
18:29:40FromDiscord<shadow.> got it
18:29:58FromDiscord<ElegantBeef> Well you're moving the 1 into the i's place
18:30:31FromDiscord<shadow.> yeah
18:30:58FromDiscord<shadow.> but shifting 1 to the left by 1 is the same as multiply 1 by base, no?
18:31:14FromDiscord<shadow.> so 1 shl i is 1 base, i times
18:31:22FromDiscord<shadow.> (edit) "1" => "`1" | "i" => "i`"
18:31:36FromDiscord<ElegantBeef> No
18:31:52FromDiscord<ElegantBeef> 1 = 2^0, 2 = 2^1, 4 = 2^2
18:32:57FromDiscord<ElegantBeef> it's the same as shifting the 1 left in base 10, 10 ^ 0 = 1, 10^1 = 10, 10^2 = 100
18:35:05FromDiscord<Clyybber> disruptek: for what wrong resaons does carnac work
18:36:20*habamax joined #nim
18:41:50FromDiscord<fwsgonzo> does Nim have parameter packs?
18:42:23FromDiscord<ElegantBeef> What does that mean, are they like wolves?
18:44:14FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2I3R
18:44:20disruptekclyybber: look at the README.md or the test.nim
18:44:47disrupteknote the comments. i had to build up symbols to get the sem to work over the entire proc body.
18:45:02FromDiscord<fwsgonzo> but I'm not really after all of that, even if it would be nice to be able to say that Nim really does everything, I'm just after anything that is close enough
18:45:13FromDiscord<ElegantBeef> we've got `varargs` ๐Ÿ˜„
18:46:08*azed quit (Read error: Connection reset by peer)
18:46:11FromDiscord<fwsgonzo> (edit) "enough" => "enough.โ†ตThe code above takes a function call, prepends an argument to it, and then repacks the type so it can be called with something else. That's the short version."
18:46:30FromDiscord<ElegantBeef> But that requires homogeneous types, you can make a macro to emulate it
18:46:38disruptekclyybber: btw, afterAllWhatever seems to only run in carnac: but not .carnac.
18:48:52FromDiscord<fwsgonzo> doesn't look like varargs will work in this case
18:49:27*azed joined #nim
18:49:53FromDiscord<fwsgonzo> maybe the worst thing that still works is something like calling a C function that takes a function pointer and ...โ†ต`void (void() (), ...)`
18:50:44FromGitter<fish-face> is there a version of `foldl` for iterators? and similar things in general?
18:50:54FromDiscord<ElegantBeef> Well yea i said it requires homogeneous values, you can make a `injectTypes` macro which will replace the args of procs declared below it with the types requested of it
18:51:35FromDiscord<ElegantBeef> you can `toSeq(iter)` but i dont think there are sequtil variants that work on iterators, although that'd be nice
18:51:40FromDiscord<fwsgonzo> looks like Nim supports a varargs pragma that lets you call it like printf
18:51:57disruptekgonzo: this seems pretty easy for a macro.
18:52:28FromDiscord<fwsgonzo> so the thing I really want is to check that the arguments you pass to ... fits the function you pass to void () ()
18:52:37FromDiscord<fwsgonzo> (edit) "()" => "(), that is, type-checking the arguments against the functions type"
18:52:46FromGitter<fish-face> Yeah I know the `toSeq` thing but that's not lazy :P
18:53:01FromGitter<fish-face> no need to instantiate the entire seq unnecessarily
18:53:19FromDiscord<ElegantBeef> Well if you dont want to be lazy start to make sequtils that works on iterators ๐Ÿ˜›
18:53:34FromDiscord<fwsgonzo> (edit) "..." => "`...`" | "void" => "`void" | "(), that is," => "()` <-.- can be a Nim function too, I suppose, then"
18:54:04disruptekgonzo: a nim macro can read the types of procs, etc.
18:54:04FromDiscord<ElegantBeef> Eventually we might be capable of `iterator[T]` so using templates for this kinda stuff might go away
18:55:15FromGitter<fish-face> yes, it seems difficult to treat iterators as types given that as I understand it they are implemented as templates
18:55:46FromDiscord<ElegantBeef> Well i've done it, so if i can anyone can ๐Ÿ˜„
18:55:55haxscramperI want to specify retyn type of the generic based on argument type, but do so using custom expression with `when` e.g. `when arg is int: string else: int`. I tried https://play.nim-lang.org/#ix=2I3U , but actual type of the `arg` when specifying return type is `GenericParam` - https://play.nim-lang.org/#ix=2I3V . I can use `auto`, but since I have **exactly two** possible return types I would like to have some more constrained solution
18:55:58FromDiscord<ElegantBeef> Actually i misunderstood that
18:56:16FromGitter<fish-face> I see someone else was looking for `<<` above - what is the reason it is spelt as `shl` in nim?
18:56:56*Fish-Face joined #nim
18:57:06Fish-Faceah that's better
18:57:11FromDiscord<ElegantBeef> If you havent noticed most operators are shortened english, so probably stolen from a language that did as such
18:57:13disruptekthank you.
18:57:25*azed quit (Ping timeout: 246 seconds)
18:57:27disruptekhaxscramper: seems a waste of time.
18:57:37FromDiscord<fwsgonzo> I'm not too familiar with macros in Nim, but I'm looking at them now
18:57:51disruptekhaxscramper: use a template for your proc body impl.
18:58:15FromDiscord<Avatarfighter> disruptek: does nimph allow the mass upgrade of installed packages?
18:58:20disruptekyes.
18:58:25Fish-FaceI only know of like... tcl which does that
18:58:34FromDiscord<Avatarfighter> You've converted me disruptek
18:58:52disruptekdoubtful.
18:59:59FromDiscord<ElegantBeef> Well free pascal also uses `shl` and `shr`
19:00:02disruptekto restate, it lets you upgrade your /requirements/ within the project's net-net acceptable version ranges.
19:00:39FromDiscord<Avatarfighter> disruptek: that's still fine by me ๐Ÿ˜„
19:00:42FromDiscord<Avatarfighter> thanks !
19:00:57disrupteksee `update` and `upgrade` subcommands.
19:01:05disrupteker, `outdated` and `upgrade`.
19:01:11FromDiscord<Avatarfighter> ill check it out once nimph is installed
19:01:18disruptekGLWT
19:01:37disruptekpretty sure it doesn't build anymore due to nimterop.
19:02:49FromDiscord<Avatarfighter> does nimterop not build for you either?
19:03:31FromDiscord<Avatarfighter> well it does build https://media.discordapp.net/attachments/371759389889003532/788118989658259476/Screen_Shot_2020-12-14_at_11.03.21_AM.png
19:03:36FromDiscord<Avatarfighter> nimph does
19:03:39disrupteknice.
19:03:55*mbomba joined #nim
19:07:20FromDiscord<inv> Hi. Any recomendations on decimal lib for nim? I know nimble search, but, like with mongo - probably better to ask ๐Ÿ™‚
19:07:35disrupteki think people like decimal128.
19:07:45FromDiscord<inv> thx!
19:07:54FromDiscord<inv> thx!
19:08:00disrupteksee what you think and report back, please.
19:08:03disruptek!repo decimal128
19:08:05disbothttps://github.com/JohnAD/decimal128 -- 9decimal128: 11A Decimal128 IEEE 754 2008 number library for the Nim programming language. 15 16โญ 1๐Ÿด
19:13:24Zevvsoo disruptek, arq is sitting behind his keyboard waiting for you to tell him what bugs to fix!
19:16:57disruptekhe thinks the carnac demo's bug is due to the result sym; addResult() in semstmts. i don't see how, but that's the latest word from the mountaintop.
19:17:34disrupteki'm working on finding a job. no time to code.
19:17:38Zevvright so!
19:18:06disruptekwhat do you make of his rfc comments?
19:18:11Zevvlemme read up
19:18:19ZevvI like the "Enough of the talking" part
19:19:29Zevvnot sure if I like weave to be pulled in as the appointed scheduled
19:19:43disrupteki told him you'd say that.
19:19:45Zevvfeels a bit over the top to start with, but it'll make a nice test case
19:20:10Zevvi wonder if you and I can work together with mratsim; he kind of lives on another plane, not sure if he has the patience to deal with us
19:20:29disrupteki say we just make him write a dispatcher and call it good.
19:20:38Zevvright. *a* dispatcher
19:20:46disruptekright.
19:21:08Zevvbecause I'm not sure if weave will run on pmunch's atmega32
19:21:20disruptekthis is really araq's problem.
19:21:41Zevvand still I don't see how seqs and strings will fit in here
19:21:50Zevvbut that's just me not understanding basic essential stuff
19:22:25disruptekeh they are fine but, look, weave's channels aren't csp.
19:22:48disrupteklet's not lose sight of the real conceptual goal here.
19:23:12Zevv*your* goal
19:23:15disruptekseqs/strings are fine because isolate.
19:23:15Zevvis not by goal, boi
19:23:19Zevvyeah, that
19:23:22Zevv"because of isolate"
19:23:30Zevvwill that look like a magic wand
19:23:35Zevvdoing *poof* and everything is ok?
19:23:44disruptekit's pretty simple, yes.
19:23:48Zevvi don't understand it
19:23:59disruptekit's /really/ simple.
19:24:05Zevvif you weren't hunting jobs, you could explain to me as if I'm 5yo
19:24:07disruptek!rfc isolate
19:24:08disbothttps://github.com/nim-lang/RFCs/issues/244 -- 3'isolated' data for Nim 7& 2 more...
19:24:21Zevvwhere's the mutex
19:24:27disruptekjust, make sure the memory graph is /isolated/ from other memory graphs.
19:24:35disruptekthat's it.
19:24:42Zevvwe want to pass a string from thread a to thread b
19:24:46Zevvor is that not what wer'e doing here
19:24:54disruptekyou can do that, yes.
19:24:58Zevvwhere's the mutex
19:25:04disruptekthere is none.
19:25:11Zevvthen you can't pass a string from thread a to thread b
19:25:14disruptekyou don't /need/ one.
19:25:16Zevvthe police will come
19:25:19Zevvand will take you away
19:25:20FromDiscord<Clyybber> Zevv: Its a move
19:25:28FromDiscord<Clyybber> it won't be shared
19:25:34Zevvdoesn't matter
19:25:36Zevvyou need a mutex
19:25:37Zevvpoint
19:25:40disruptekno.
19:25:43Zevvdudes
19:25:46disruptekdude.
19:25:50FromDiscord<Clyybber> only one thread can have it at a time
19:25:53Zevvyou have data on a core. with NUMA memory, cache lines, whatever
19:25:57Zevvyou want to pass it to antoher thread
19:26:14Zevvthe mutex takes care of making sure the memory is actually valid & available at the other core
19:26:22Zevvyou can not just do that without a memory barrier or mutex
19:26:22Zevvreally
19:26:32disruptekthat's not part of isolate.
19:26:41Zevvright
19:26:51Zevvthat clears it up for me.
19:26:57disruptekokay ๐Ÿ‘
19:27:16Zevvso isolate makes sure that thread a gives it away to thread b, and then isn't even *able* to have a reference to it anymore
19:27:19Zevvthat's it right
19:27:25disruptekyes.
19:27:36Zevvok. I think I understand that
19:27:38disruptekit's a box that seals completely.
19:27:40FromDiscord<Clyybber> yep
19:27:45disrupteksimple.
19:27:48Zevvok. but then someone needs to have the mutex :)
19:27:55disruptekyes, but this is a dispatcher problem.
19:28:05Zevvnot really. thread a creates a strings, writes in it
19:28:12Zevvit should hold the mutex while doing that
19:28:26Zevvthen release it, give it to b. b holds the mutex, and only then can read the string
19:28:42disruptekonly the rz needs a mutex.
19:28:46Zevvso while writing the data, you already need to know you will be passig it to another thread later on
19:28:54disruptekwhy?
19:28:57Zevvthat's how it works
19:29:05Zevvi recently had 2 seniors fired over exactly this
19:29:06FromDiscord<Clyybber> the writes have to be finished
19:29:13disruptekyou can have a barrier.
19:29:19Zevvthere you go
19:29:27FromDiscord<Clyybber> but thats not an Isolate problem
19:29:36ZevvClybber: true
19:29:37disruptekagain, you only need to worry about this at the rz.
19:30:00Zevvwhat is rz
19:30:07disruptekrendezvous
19:30:32disrupteki think it's french for `fucking`.
19:30:39Zevvaah
19:30:56FromDiscord<Avatarfighter> Hey ! That's not true
19:31:00Zevvbut still. memory barriers are expensive as hell, as you're not saying *what* you are barriering
19:31:06Zevvso that is where the mutex typically comes in
19:31:13Zevvbut mratsim is the only one truly understanding this stuff
19:31:14disrupteklook, "i don't care."
19:31:21disruptekit's not part of my design.
19:31:24Zevvtrue, true
19:31:29Zevv(reading time)
19:32:04FromDiscord<Avatarfighter> So what type of job are you looking to get disruptek?
19:32:15FromDiscord<19> does anyone know a nice Valgrind alternative for windows for nim?
19:32:19disruptekhooking is hard in the midst of a pandemic.
19:32:28disruptek19: no.
19:32:57FromDiscord<19> k thx
19:33:42disruptek19: let me put it this way, araq uses valgrind on linux to find leaks... and he's a windows user.
19:33:47FromDiscord<Clyybber> Zevv: This could also be the job of channels
19:33:51FromDiscord<Clyybber> I think
19:34:02disruptekclyybber: yes, this is the role for csp.
19:34:16FromDiscord<19> imma get a virtual machine then
19:34:44FromDiscord<19> thanks disruptek
19:34:53disruptekhope it helps.
19:35:54FromDiscord<Clyybber> or atomics
19:36:33*Jesin quit (Remote host closed the connection)
19:36:39FromDiscord<mratsim> I don't suppose there is a way to cast openarray[char] to openarray[byte] in a manner that works at compileTime :?
19:37:20FromDiscord<mratsim> @Zevv @disruptek sure i can write a dispatcher for IO, I wanted to write a WeaveIO anyway.
19:37:47*Jesin joined #nim
19:37:52disruptekyay ๐Ÿ˜
19:37:55disruptekjob done.
19:38:11FromDiscord<Clyybber> :D
19:38:34FromDiscord<Clyybber> @mratsim don't think so
19:38:37disrupteki want to just look for IOEffect and CPSify the calls.
19:38:44disrupteksimple.
19:46:43disruptekclyybber: whaddya think about user-supplied expr pragmas?
19:47:53Zevvclyybber: right, channels seems like the only way
19:48:15Zevvso we share nothing.
19:48:35FromDiscord<shadow.> nah
19:48:37Zevvthis is one thing that still confuses me after years
19:48:46FromDiscord<shadow.> it's easy to setup a linux subsys on windows
19:48:51FromDiscord<shadow.> just do that
19:48:53FromDiscord<shadow.> way easier than a vm lmao
19:49:08ZevvI have two threads. A creates and writes to an object, while not holding any locks. How can A pass this memory safely to B
19:52:58disrupteklet me ask you a question by way of answer.
19:53:22disruptekwhat makes you think it's unsafe for B to access this data? so what if the memory is already in the core's cache.
19:53:52Zevvthere are no guarentees the memory is available to B. The compiler might have reordered stuff.
19:53:58Zevvyou need a memory barrier
19:54:02Zevvbut these are expensive as hell
19:54:24disruptekif it's not available, fetch it.
19:54:38FromDiscord<19> @shadow. i read somewhere that valgrind doesnt work with wsl
19:54:40FromDiscord<19> ill check it out
19:54:46FromDiscord<shadow.> ohhh
19:54:52FromDiscord<shadow.> might be the case then
19:54:55FromDiscord<mratsim> You know that my talk from June addresses this @ Zevv
19:55:09Zevvrefresh my bookmarks mratsim
19:55:23FromDiscord<shadow.> i think it should work tbh
19:55:25ZevvI still feel stupid because I keep having these discussions with people, and they all think I'm mad
19:55:35FromDiscord<shadow.> i dont see why it wouldnt
19:55:47FromDiscord<mratsim> is your data a machine word at most?
19:55:54ForumUpdaterBotNew thread by Mantielero: C++ Smart pointers 101 and FFI, see https://forum.nim-lang.org/t/7254
19:55:57disrupteklook, you're not wrong, but i think you might be applying some assumptions that aren't necessarily correct.
19:56:10FromDiscord<mratsim> in that case you can use atomics to ensure that you don't have torn read
19:56:17Zevvmratsim: My data is complex data. Say a seq of strings
19:56:25Zevvjust real life stuff
19:56:52Zevvnim allocated, for simplicity, say we're running arc
19:57:28FromDiscord<mratsim> then you need some way to synchronize the thread
19:57:34FromDiscord<mratsim> tell them that the data is ready
19:57:37Zevvright
19:57:41FromDiscord<mratsim> the default should be a channel
19:57:49FromDiscord<mratsim> and otherwise locks
19:57:52FromDiscord<19> @shadow. looks like it does.. ill give it a shot
19:57:53FromDiscord<mratsim> and otherwise atomics
19:58:05Zevvbut with locks, you _need_ to take the lock _before_ modifying the data from A, right?
19:58:13FromDiscord<mratsim> and otherwise there is a way to have a critical section without lock or atomics.
19:58:22FromDiscord<shadow.> gl
19:58:25FromDiscord<mratsim> like the Pederson lock or the lamport Bakery algorithm
19:58:38Zevvyou know I don't know all these terms :)
19:58:51FromDiscord<mratsim> but you can wikipedia them :p
19:59:13FromDiscord<mratsim> it's basically a lock for platforms that don't support locks, like say the Playstation 2 Cell CPU
19:59:21Zevvyeah no, one step back
19:59:28Zevvthe writer _holds the lock while writing the data_
19:59:33FromDiscord<mratsim> yes
19:59:46Zevvbut what if A has data that was written while not holding the lock
19:59:53Zevvand later decides it wants to share the data with B
20:00:07Zevvobvious is tkae a lock, *copy* the data, and send that to B
20:00:13Zevvbut if you don't want the copy
20:00:17disruptekif you copy the data, you don't need the lock.
20:00:25Zevvright. but you don't want that. We want a move
20:00:52disruptekmove is a misnomer.
20:01:15FromDiscord<mratsim> IDon't use a seq, use a linkedlist that hold strings?
20:01:27ZevvNo, you're evading the answer
20:01:29disruptekdoesn't matter.
20:01:37FromDiscord<mratsim> because if your seq needs to be resized in a new buffer, you will have a thread that points to invalid memory
20:01:43FromDiscord<myphs> Sorry for this probably nooby question, but nim's error message doesn't help me: So I wanted to try out `wNim`, but it says `C:\nim-1.4.0\lib\windows\winlean.nim(14, 8) Error: cannot open file: utils` when installing it and I can't find anything leading to this issue. Any hints?
20:01:54disruptekthe memory will be invalidated already.
20:02:14Zevvmratsim: but ok, let's take just a plain solid memory block of bytes
20:02:17ZevvA writes there without holdign the lock
20:02:22Zevvand now wants B to have the data
20:02:39Zevvwhat is the primitive needed to make this safe, under all circumstances
20:02:46FromDiscord<mratsim> a channel
20:02:46disruptekyes, this is a problem we /do/ need to solve.
20:02:54*vicfred joined #nim
20:02:57Zevvmratsim: so, what *is* a channel
20:03:01disruptekbut what is this mythical channel.
20:03:06FromDiscord<mratsim> but a channel basically encapsulate a solution to this problem
20:03:10Zevvyeah
20:03:11Zevvnice
20:03:12Zevvdude
20:03:13disruptekbut what /it is/
20:03:17*sirn quit (Ping timeout: 260 seconds)
20:03:29ZevvI don't wnat to encapsulate. I want to *understand*
20:03:35Zevvbecause to me, a channel is a thing that actually *copies* data
20:03:37disrupteki don't want our existing channels, which are just copies.
20:03:43Zevvright
20:03:44Zevvso
20:03:44FromDiscord<mratsim> It's a way to transfer either a data or ownership (represented by a sinked pointer) from thread to thread.
20:03:49*kwilczynski quit (Read error: Connection reset by peer)
20:03:49Zevvyeaaaah
20:03:49Zevvbut
20:05:42Zevvhow does it
20:05:42Zevvwok
20:05:42Zevvrk
20:05:42disrupteklol
20:05:42FromDiscord<mratsim> Weave uses ownership channels internally to avoid copies
20:05:42*sirn joined #nim
20:05:42Zevvare you trolling me :)
20:05:42disruptekjesus.
20:05:42*kwilczynski joined #nim
20:05:42Zevvwhat primitives does it rely on
20:05:42Zevvwhat makes it tick
20:05:42FromDiscord<mratsim> A channel is queue, except that the producer(s) and consumer(s) are in different thread
20:05:42disruptekassume you can move the pointer for free, what about the data?
20:05:42FromDiscord<mratsim> you assume that the pointer was the only way to access the data
20:05:42Zevvmratsim: ok, but what makes it safe for B to read the memory that was written by A
20:05:42Zevvthere might be caching involved, or reordering
20:05:42disruptekhow can you ensure the entire block is invalidated on B's cache?
20:05:42FromDiscord<mratsim> the pointer sinked into the channel is the only way to read:write the data
20:05:53Zevvyes but mratsim please
20:05:59FromDiscord<mratsim> the channel uses locks or atomics inside
20:06:08Zevvok, so there is a lock on the *pointer*
20:06:13Zevvbut there was never a lock on the original data
20:06:16Zevvright?
20:06:19FromDiscord<mratsim> This is the simplest channel you can have: https://github.com/mratsim/weave/blob/master/weave/cross_thread_com/channels_spsc_single_ptr.nim#L13-L45
20:06:21FromDiscord<mratsim> no
20:06:30Zevvhow can that work then? what do I miss?
20:06:31disrupteki don't see how this can work.
20:06:35disrupteklol
20:06:45FromDiscord<mratsim> no as in you're right no lock on the original data
20:06:47disruptekZevv: ima walk the dog. i don't think you need me for this. ๐Ÿ˜
20:06:56FromDiscord<mratsim> the yes/no between countries is a bit strange
20:07:22FromDiscord<mratsim> https://github.com/mratsim/weave/blob/master/weave/cross_thread_com/channels_spsc_single_ptr.nim#L70-L109
20:07:43FromDiscord<mratsim> the trySend and tryRecv transfer a pointer that represent the ownership over the data transferred
20:08:06FromDiscord<mratsim> you take a lock or atomics just to put or remove that from the channel
20:08:11Zevvbut there is no memory barrier involved. I think I have a mental problem at some level
20:08:27ZevvI have done embedded work on arm cores, where share things really requires me to flush my dcaches
20:08:28FromDiscord<mratsim> https://github.com/mratsim/weave/blob/master/weave/cross_thread_com/channels_spsc_single_ptr.nim#L82
20:08:53FromDiscord<mratsim> moAcquire and moRelaxed are reordering barrier and also forces the CPU to sync the core caches
20:09:02Zevvrrriight
20:09:08Zevv /that/ was the thing I was looking for
20:10:02FromDiscord<mratsim> if you have time, the talk from Herb Sutter, Weapons of <Atomic> destruction is good.
20:10:13FromDiscord<mratsim> or <std::Atomic>
20:10:26FromDiscord<mratsim> but it's 2 part 1h30 per part :p
20:10:27ZevvI will watch that tonight
20:11:09FromDiscord<mratsim> and this is a channel that copy in its buffer: https://github.com/mratsim/weave/blob/master/weave/cross_thread_com/channels_spsc_single.nim#L45-L47
20:11:33Zevvsure, that makes sense
20:11:57FromDiscord<mratsim> it can only hold one item, if you want more you need either a bounded array or a way to reallocate while multiple threads read:write the data
20:12:26Zevvok
20:12:52*opal quit (Remote host closed the connection)
20:12:54FromDiscord<mratsim> and so there are many types of channels/queues:โ†ตmulti producer, multi consumer, single producer, single consumer, linked list based, array based.
20:13:14FromDiscord<mratsim> mix all together: http://www.1024cores.net/home/lock-free-algorithms/queues
20:13:34*opal joined #nim
20:13:58FromDiscord<mratsim> and then you have the progress guarantees (lock-based, lock-less, obstruction-free, lock-free, wait-free)
20:15:03*narimiran quit (Ping timeout: 256 seconds)
20:19:33FromDiscord<19> @shadow. valgrind online wsl
20:20:23FromDiscord<shadow.> nice
20:21:58*habamax quit (Ping timeout: 260 seconds)
20:24:32*vicfred quit (Ping timeout: 256 seconds)
20:28:35Zevvsure mratsim, but I only wanted to know what these are built on
20:28:44Zevvso its either locks or barriers
20:33:48*fanta1 quit (Quit: fanta1)
20:43:17*vicfred joined #nim
20:46:46disrupteklocks don't help afaict.
20:49:49FromDiscord<mratsim> they do
20:49:56FromDiscord<mratsim> locks or atomics
20:50:47disruptekbut how does the lock affect stale data in the receiving core?
20:50:48FromDiscord<mratsim> This one is lock-based and plenty fast: https://github.com/mratsim/weave/blob/v0.1.0/unused/channels/channels_legacy.nim#L31
20:51:34disrupteki don't have the bandwidth to use github.
20:52:15disruptekanyway, i'm not worried about speed. ๐Ÿ˜
20:52:55FromDiscord<mratsim> When you read data, your CPU will check if there is a cache reload needed.
20:53:24FromDiscord<mratsim> The lock implementation in the kernel should trigger the "invalidate all cache" primitive.
20:53:27disruptekjust based on whether the lock has tainted?
20:53:31FromDiscord<mratsim> which is a memory barrier
20:53:37disruptekokay, that makes sense.
20:53:53disrupteki would say that i'm in favor of locks, then.
20:54:22disruptekthey are fast and reliable.
20:54:30FromDiscord<mratsim> If you use heavy data structures like seq of strings, lock are much eaier to reason about.
20:54:38disruptekyes.
20:54:46FromDiscord<mratsim> but the risk is that deadlocks can happen.
20:55:01disruptekwe can code those out eventually.
20:55:05FromDiscord<mratsim> atomics are a pain to get right, but deadlocks can't happen
20:55:23FromDiscord<mratsim> As a general purpose, Nim should use locks first
20:55:38disruptekagree.
20:55:40FromDiscord<mratsim> and use atomics in very specific cases with a well tested implementation
20:56:01FromDiscord<mratsim> As an example it took me a month + formal verification to get my channels right.
20:56:29FromDiscord<mratsim> well, single consumer single producer channel are easy to do, there are only 2 threads to synchronize so using atomics is very easy
20:56:48disruptekwhat we can do to help weave's dispatcher is include some CPS metadata in the generated procs.
20:56:50FromDiscord<mratsim> but the multi producer that enqueue data and single consumer ... that was a time sink
20:57:47disrupteki think it will be MPMC to start. at least, that's what araq is working on with isolate.
20:58:31FromDiscord<mratsim> Basically I encapsulate what I send to other core in a Task data structure, it has: a proc {.nimcall.} of the code block to execute, a environment (max 144 bytes) and the rest is metadata for Weave scheduler (loop counter, start, stop, parent task, ...)
20:58:33disruptekif you tell me what you'd want to know about the continuation, i can include it in the procdef.
20:59:00disruptekso you want the originating call?
20:59:06FromDiscord<mratsim> so really, the only thing I need is that the continuation is proc {.nimcall.} + an environment to execute
20:59:19FromDiscord<mratsim> I can call the continuation from CPS
20:59:29disruptekcan the environment just be a pointer or does it have to be a complete value?
20:59:33FromDiscord<mratsim> as long as it ends up executing the code block
21:00:38FromDiscord<mratsim> It can but I prfer it to be a complete value because the way I do it, the environment and Task metadata are put together in a 256 bytes memory block
21:00:54FromDiscord<mratsim> and I use a memory pool to allocate:deallocate those in a fast manner.
21:01:51Zevvproblem is mratsim, that all of the stuff you are doing is soo way overoptimized for the "normal" use cases. people just want to share nim data
21:02:00FromDiscord<mratsim> Also I use the first 8 bytes of the environment to put a pointer to a channel/future/flowvar that can be waited to get a result.
21:02:05Zevvwe can't sell this stuff if you have to pointer case your way out of the nim allocators
21:02:12Zevv s/case/cast/
21:02:17disruptekso maybe we have a "large" env and a "fast" env.
21:02:38FromDiscord<mratsim> Well as I said multiple times, Weave doesn't fit the IO usecase
21:02:43disruptekthe alloc and pooling stuff doesn't bother me, but we will need to disambiguate.
21:03:03FromDiscord<mratsim> if you have a large env, put it on the heap and a pointer to it.
21:03:06Zevvmratsim: right. So who will tell araq.
21:03:09FromDiscord<mratsim> in the "fast env
21:03:23Zevvbecause I feel the same thing.
21:03:25disruptekdo you keep a pointer to the exceptions?
21:03:26FromDiscord<mratsim> What I can do is make Weave able to execute the continuations
21:03:34disruptekexactly; this is what we're working on.
21:03:45FromDiscord<mratsim> but it shouldn't be the main executor
21:03:52FromDiscord<mratsim> because CPS primary use case is async/IO
21:03:55Zevvok, so we're all on the same page
21:04:07Zevvbut CPS /can be/ a nice addition to weave
21:04:16disruptekwhen you say, "first 8 bytes", do you mean "first object field" or do you literally mean "first 8 bytes of the alloc"?
21:04:42FromDiscord<mratsim> also Weave doesn't have any way to ensure latency fairness, it focus on expediting the total work, but the first one to enqueue the work might very well be the last to get a response
21:04:51disruptekdon't care.
21:05:02FromDiscord<mratsim> my Task object are type erased
21:05:08FromDiscord<mratsim> so the environment is just raw bytes.
21:05:09disruptekokay.
21:05:40Zevvso
21:05:42disruptekthis will be challenging to make work but i think we can do it.
21:05:50FromDiscord<mratsim> which makes it a bit of a pain to organize the code so that the type are kept in the public API.
21:05:56disruptekyeah.
21:06:14FromDiscord<mratsim> but Nim Flowvars have the same issue.
21:06:42Zevvlong story short. weave should be able to cooperate with CPS by executing its continuations. So for certain use cases that will be cool.
21:07:17disruptekyes, but it will need a special weave-friendly continuation type that both works with CPS and works with weave.
21:07:27FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2I4J
21:07:39disruptekthat will be good for us, because it will force us to keep the interface correct.
21:08:11FromDiscord<mratsim> It must be a stack object and N <= 144. If there are more bytes in the environment, it's likely a good idea to have some heap alloc anyway
21:08:12Zevvdisruptek: let me start nagging about this once more: you insist on your concepts, but what does that bring for now, in practical terms
21:08:27Zevvbecause in practice, a continuation is an *object* with a proc and data. Why the abstracion
21:08:39Zevvmratsim: what is magic about 144?
21:09:02FromDiscord<mratsim> It leaves me 112 bytes of metadata for Weave ๐Ÿ˜›
21:09:04disruptekit brings the fact that a weave Task could be a continuation even if it doesn't look like our typical Env types.
21:09:28disruptekthe main thing is that it lets the user define their continuation types.
21:09:31FromDiscord<mratsim> And 256 bytes is a nice power of 2 for a memory allocator
21:09:44FromDiscord<mratsim> I don't mind the concept.
21:13:00FromDiscord<mratsim> It would be nice if the C++ folks always output nice PDF instead of text: but I guesss it would be easy on disruptek data: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0443r14.html
21:13:19disruptekZevv: let me start nagging about this once more: you insist on your `fn` but what does that bring, in a world where calls are invoked against static types?
21:13:32FromDiscord<mratsim> I didn't have time to read the C++ executor latest proposal but they have been thinking on the API/interface around task, async, thread for 20 years.
21:14:28*Jesin quit (Quit: Leaving)
21:14:32disruptekjesus.
21:14:42FromDiscord<mratsim> Also AFAIK from scheme, continuations (call/cc) can be used as primitives to execute closures, async, thread spawns, state machines.
21:16:02FromDiscord<mratsim> so if a continuation concept is just (fn + env) with the machinery provided by CPS. We can build plenty of things on top.
21:16:10*Jesin joined #nim
21:16:14disruptekyes, of course.
21:16:15FromDiscord<mratsim> even npeg ๐Ÿ˜‰
21:18:22FromDiscord<mratsim> anyway, I think the best way to discuss is to actually have code ๐Ÿ˜‰
21:19:05disruptekthe thing is, i usually throw away most of the bullshit that these other implementations demand.
21:19:18disruptekthe result is something more abstract and, to my mind, more desireable.
21:19:26disruptekbut that might not be the case for everyone's application.
21:20:06Zevvdisruptek: fair enough
21:20:52disruptekZevv: what if your continuation is just an env. you run it through a function and the result is a pointer to the /next/ function.
21:21:02disrupteki don't really see the problem.
21:21:13Zevvnot a problem
21:22:04FromDiscord<mratsim> I don't see a problem with something abstract here, given how core it is and also because it's rooted in theory
21:22:17Zevvtrue
21:22:35FromDiscord<mratsim> Abstract thing from theory have less chance of become obsolete and then causing deprecation woes.
21:22:44FromDiscord<mratsim> I mean, if haskell had to deprecate Monad ...
21:23:25disruptekwell, i think the limits should be those of nim, not some design that was predicated on someone else's constraints.
21:23:36FromDiscord<mratsim> yes
21:24:03FromDiscord<mratsim> that said I have to investigate more on continuation because I thought the minimum needed was function + environment
21:24:07FromDiscord<mratsim> not just environment
21:24:28disruptekthe dispatcher needs the fn but i've never cared about it.
21:24:37FromDiscord<mratsim> Ok
21:24:40Zevvdisruptek was always two steps ahead of me
21:24:52Zevvon /some/ parts :)
21:25:01disruptekwell, i just have a different idea about composition, i think.
21:25:30Zevvthe reason I don't care about all that is that I just want concrete, working, functional CPS first
21:25:33Zevvbut I don't mind
21:25:42FromDiscord<mratsim> well, the minimum a dispatcher/executor/scheduler needs is:โ†ตa function to call, an environment to pass to that function, and a channel to communicate the result if the function has a return value.
21:26:01FromDiscord<mratsim> call that channel Flowvar or Future if you want.
21:26:07ZevvI don't get the last bit
21:26:41FromDiscord<mratsim> if you send a+b on another thread, you need a way to get that result.
21:26:54disrupteklook at how we do the `let x = result-of-CPS()`. we just create a new env that contains `x` with the value of `result-of-CPS` and we invoke it whenever, wherever.
21:27:01FromDiscord<mratsim> solution a: the user put that on shared memory and deal with synchronization
21:27:49FromDiscord<mratsim> solution b: you have a way to safely pass data between threads, you use it (a channel), but you call that what everyone calls it, i.e. a future
21:28:22Zevvsolution c: treat the return value as part of the environment and just pass it around like before
21:28:58FromDiscord<mratsim> it's actually the same because you need to pass the channel address to the function.
21:29:09FromDiscord<mratsim> or at least Weave uses b+c
21:29:12Zevvsure, but re-uses the same mechanism
21:29:34FromDiscord<mratsim> the first 8 bytes of the environment are the channel address
21:30:26FromDiscord<mratsim> so this means that Weave and CPS use the same return value mechanism
21:31:28disruptekwe can, but i hope to get to a point where CPS's processes are implemented entirely statically, in the type system.
21:31:44Zevvwhat do you mean by "processes"
21:31:53disruptekprocess == "channel address"
21:32:23Zevvright
21:32:53disruptekanyway, the action item is to make Task a CPS-able continuation.
21:33:04FromDiscord<mratsim> I'm unsure we can, because we likely have to type-erase the environment and so the return type.
21:33:04disruptekalso, to make typed CPS work.
21:33:19Zevvthat, especially
21:33:25FromDiscord<mratsim> or we can make task embed CPS continuation.
21:33:26Zevvbecause untyped it is not usable
21:33:40disrupteki am not sure return type is a thing, but i could be wrong about that.
21:34:00disrupteklike, i'm not sure it /ever/ means anything to me.
21:34:08ZevvI'm hopping out ppl, dump any conclusions in the RFC thread, if you find any
21:34:13disruptekaight, peace.
21:34:16FromDiscord<mratsim> but Task has to be untyped because I need to be able to enqueue Tasks from various proc calls/envs
21:34:35disruptekuntyped?
21:34:40FromDiscord<mratsim> so high-level is typed and low-level that is dispatched is untyped.
21:34:45FromDiscord<mratsim> type erased
21:34:49disruptekoh, of course.
21:40:09FromDiscord<mratsim> hoho, found the C++ PoC for unified executors: https://github.com/facebookexperimental/libunifex, https://www.youtube.com/watch?v=tF-Nz4aRWAM
21:44:45FromDiscord<Quibono> Is there a good pointers for dummies resource?
21:46:07ZevvQuibono: using or understanding?
21:46:54FromDiscord<Quibono> I get that pointers are memory references, but not really why the hell id use them or how.
21:47:27Zevvhttp://zevv.nl/nim-memory/
21:47:44Zevvwhat's your background, what languages do you come from?
21:47:58FromDiscord<Quibono> Python loll
21:48:12Zevvin python, everything is a pointer
21:48:41Zevvso you have a var a pointing to something
21:48:44Zevvyou do 'b = a'
21:48:52Zevvnow you have two pointers to the same thing
21:49:31FromDiscord<Quibono> Okay, so when I assign something in python Iโ€™m really just referencing it, not copying
21:49:40FromDiscord<Quibono> Right? Or am I off already
21:49:58*natrys quit (Ping timeout: 246 seconds)
21:50:04Zevvthat's it
21:50:12Zevvso in nim, you would use a "ref" for that
21:50:35Zevvwhich means "A pointer managed by nim"
21:52:11FromDiscord<Quibono> Okay.
21:52:43Fish-Facepointer fun with binky?
21:52:45FromDiscord<mratsim> Maybe it's clearer if instead of reference you use the term location?
21:53:03FromDiscord<mratsim> a pointer is the location of some data in memory.
21:53:40FromDiscord<Quibono> So, I guess my question is, why use pointers directly for anything?
21:53:44FromDiscord<mratsim> If you want people to enjoy that data, either you share the location (copy the reference) or you copy the data.
21:54:21FromDiscord<mratsim> It's an escape hatch for low-level programming, because deep down, everything is either data or location of data
21:55:14FromDiscord<mratsim> I'm not joking. In assembly, all instructions either take add(data, data) or add(memory, data) or add(data, memory)
21:55:30FromDiscord<mratsim> with data being a CPU register at hardware level.
21:55:43FromDiscord<Quibono> Right. Iโ€™ve heard using pointers can be used to make code faster?
21:56:00disruptekif you don't have to copy data to share it, yes, that's faster.
21:56:03FromDiscord<mratsim> it's not magic
21:56:29FromDiscord<mratsim> Nim ref object avoid copy as well.
21:56:58FromDiscord<mratsim> Another way to make them faster is because pointers are completely unchecked, meaning if there is a bug you are alone to find it.
21:56:59FromDiscord<Quibono> So if I say B = C, am I copying data by default?
21:57:19FromDiscord<mratsim> if B is an integer, yes, if it's an array yes, if it's a ref object no
21:57:45FromDiscord<mratsim> the difference is captured by the term "value semantics vs reference semantics"
21:59:01*mbomba quit (Quit: WeeChat 3.0)
22:04:03FromDiscord<kenran> sent a code paste, see https://play.nim-lang.org/#ix=2I50
22:04:10FromDiscord<kenran> (edit)
22:05:10FromDiscord<kenran> I'm not really sure if I'm using `ortho` correctly, following the tutorial code at https://github.com/JoeyDeVries/LearnOpenGL/blob/master/src/7.in_practice/2.text_rendering/text_rendering.cpp
22:05:19FromDiscord<kenran> (edit) "following" => "trying to follow"
22:07:26FromDiscord<kenran> ah shit, already see my error. my `glUseProgram` came too late
22:12:40*Vladar quit (Quit: Leaving)
22:29:38*mbomba joined #nim
22:35:39*mbomba quit (Quit: WeeChat 3.0)
22:37:33FromDiscord<shadow.> you can break on `case`, right?
22:42:57*haxscramper quit (Remote host closed the connection)
22:43:27FromDiscord<dom96> Every day I get closer and closer to making my own version of `black` for Nim
22:43:38disruptekwhat?
22:43:46*kenran quit (Remote host closed the connection)
22:49:01FromDiscord<Quibono> ... ๐Ÿ™‚
22:49:09FromDiscord<Quibono> @dom96 +1
22:52:19FromDiscord<Quibono> Disruptek Black is basically Python's version of your coding syntax guide, it controls all the minutiae of your code formatting
22:52:39FromDiscord<Quibono> Super opinionated and washes everything in its goodness.
22:53:53disruptekthat's harder to impl then you might think, and i certainly don't think it's worthwhile as long as it's easy to write (and rewrite) code to whatever style you like.
22:54:42disrupteki don't rewrite a lot of my code to whatever my current style is, and i don't rewrite much compiler code that i work on.
22:54:51disruptekit's far more important that the code works.
22:55:48FromDiscord<Quibono> It just adds to readability and consistency
22:56:01FromDiscord<Quibono> Any python project that uses Black, has similar looking source code.
22:56:19disruptekyeah, it sounds nice. if it were free, i'd use it.
22:57:17FromDiscord<Quibono> Yeah I mean I certainly wouldn't write it
22:57:45FromDiscord<Quibono> But I'd use it
22:58:09disruptekanyone have any feedback about my style shit?
22:58:26disrupteki don't think i've heard any + or - on any of it.
22:59:12FromDiscord<Quibono> Mhmm, I'd love it if you rewrote the guide to be more... IDK, clear? It feels like rules come up randomly.
22:59:31FromDiscord<Quibono> _is going to go back to reading it and will comment._
23:00:22disruptekyes, they were added randomly. there's a lot of bleed between return/result and the preceding section. but that's not easy to avoid.
23:01:30disruptekcommenting on the gist itself might not be a bad idea, either.
23:02:15FromDiscord<Quibono> Can you relink it?
23:03:13disruptek~disrupstyle
23:03:13disbotdisrupstyle: 11tips for writing code that won't provoke ๐Ÿ˜  rants ๐Ÿคฌ on irc: https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d -- disruptek
23:04:50FromDiscord<Quibono> So why are you against ending with result = x?
23:05:08disrupteki'm not.
23:05:15FromDiscord<Quibono> Lol then carry on
23:05:34FromDiscord<dom96> huh, guess I'm new to Nim
23:06:09disruptekhi!
23:07:08FromDiscord<Quibono> So Dom when do you start? ๐Ÿ˜ฎ
23:13:41Fish-FaceMy rust friend beat my for speed on AoC :(
23:21:01FromDiscord<juan_carlos> Some people say that continue and break are just a named GOTO.
23:21:15disruptekthey are.
23:21:50FromDiscord<j-james> crabs are fast little buggers
23:22:19disruptekthey all die in the kerosene, though.
23:23:32FromDiscord<Quibono> Napalm disruptek, it's gotta start with N
23:24:17disrupteki'm not putting napalm on my junk; i don't care how reliable it is.
23:25:22FromDiscord<Quibono> ... you're putting kerosene on your junk?
23:25:31FromDiscord<Quibono> Dude you've got more problems then I thought lol
23:25:31disruptekbest way to get rid of crabs.
23:25:50FromDiscord<Quibono> I think they've got meds for that.
23:26:10disrupteki don't have healthcare.
23:26:13disruptekyou know what i have?
23:26:15disruptekkerosene.
23:26:31FromDiscord<Quibono> Lol okay but I think crabs are better than kerosene-junk
23:26:41disruptekyou've never had crabs.
23:29:09FromDiscord<j-james> what's wrong with my regex here?
23:29:13FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=2I5q
23:31:48FromDiscord<Adalogic> How would one update their Nim version? I see that `choosenim` has a command for it, but I did not install using `choosenim` and attempting to install it with Nimble produces a quite indecipherable error (unless I'm not supposed to install choosenim that way and I'm just small-brain).
23:36:03FromDiscord<ElegantBeef> To install choosenim follow this https://github.com/dom96/choosenim#installation
23:37:19FromDiscord<ElegantBeef> You may also want to remove nim from however you installed it before hand as it would probably interfere
23:38:43FromDiscord<martinium> Choosenim ๐Ÿ™Œ๐Ÿฝ
23:38:49FromDiscord<martinium> Very useful
23:39:01FromDiscord<martinium> Reminds me of Rustโ€™s rustup
23:40:25FromDiscord<ElegantBeef> Well we also have gitnim
23:40:42FromDiscord<ElegantBeef> Or w/e disrupteks version is called
23:40:47disruptek~gitnim
23:40:48disbotgitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek
23:41:17FromDiscord<ElegantBeef> Rumour has it disruptek sits by waiting for mention of his software to pounce at the chance to show it ๐Ÿ˜„
23:42:08disruptekand you ask me why i don't sleep at night.
23:42:46disruptekactually, gitnim is about to grow into a proper distribution.
23:43:41FromDiscord<ElegantBeef> Do you have plans to have a shippable binary to make it not require sourcing Nim before using?
23:45:21disruptekdo you have plans to read the readme?
23:46:03*aHaquer joined #nim
23:46:07aHaquerEllo
23:46:19FromDiscord<dom96> that is what inspired choosenim ๐Ÿ™‚
23:47:02FromDiscord<ElegantBeef> I mean your installation states you build it using `nim c`
23:47:17*krux02 quit (Remote host closed the connection)
23:47:17disruptekchoosenim is what inspired gitnim. if it didn't suck a big donkey dick, i'd probably never have written it.
23:47:47FromDiscord<ElegantBeef> Ah didnt see that it shipped a prebuilt nim binary
23:49:42*aHaquer left #nim (#nim)
23:50:06*aHaquer joined #nim
23:59:03*aHaquer left #nim (#nim)