<< 07-12-2020 >>

00:07:47FromDiscord<Quibono> If you had like a dozen-100 websockets you wanted to listen to, would a loop be able to handle that okay or would you need something fancier like threads?
00:08:52disruptekwell, you can't use ioselectors on more than 64 handles, but you could chunk them.
00:09:06FromDiscord<cabboose> Heya; does anyone know with @treeforms fidget package, are you able to define components which you can just create instances of? This is my first time using figma so a lack of documentation is hamstringing my progress
00:09:19disruptek!requires fidget
00:09:20disbotfidget: 11treeform[roffy,3nim_emscripten_tutorial,3fidget], 11juancarlospaco/3fision, 11Knaque/3spinner, 11MnlPhlp/3TicTacToe 76 total
00:09:46FromDiscord<Quibono> Disruptek so by default I can only have 64 open websockets?
00:09:56*Jesin quit (Ping timeout: 240 seconds)
00:10:07disruptekyou can only select on 64 handles at once.
00:10:28disruptekread the module documentation.
00:10:46disrupteki'm not saying it cannot be done, i'm saying you'll need another layer of indirection.
00:11:39disruptekor, use cps.
00:11:41disruptek!repo cps
00:11:41disbothttps://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 40⭐ 2🍴
00:12:01disruptekread the paper. i think they have like 10,000 clients. something like that.
00:12:48FromDiscord<treeform> @cabboose fidget is still in heavy development
00:12:53FromDiscord<treeform> I do want to based it components
00:13:37FromDiscord<cabboose> so for the moment I'll carry on without that feature; I'm fine with that.
00:15:01FromDiscord<dom96> > you can only select on 64 handles at once.
00:15:02*luis1 quit (Ping timeout: 260 seconds)
00:15:05FromDiscord<dom96> Where in the docs does it say this?
00:15:27*luis1 joined #nim
00:21:49FromDiscord<dom96> @Quibono to answer your question, you should be able to handle that easily with async/await.
00:22:33disruptekyeah, async/await is always a good choice.
00:22:41FromDiscord<cabboose> can macros and templates be nested inside of each other? Using templates for fidget to mimic component logic is what I'm aiming for, but I understand that fidget uses templates and macros heavily
00:22:46disruptekyes.
00:22:50FromDiscord<cabboose> sik
00:23:58FromDiscord<dom96> For IO it's just about the only choice
00:24:08disruptekdon't get me started.
00:24:09mipriselect() is the most limited selector, only going up to FD_SETSIZE (1024). If anyone ever used poll after epoll, larger numbers of fds would be supported but annoying as you'd have to scan the entire array on each event. epoll reorders the array so you only have to scan an eventing subarray
00:24:27FromDiscord<martinium> anyone know how to get rid of the too many open files error on linux?
00:24:32miprithe selectors default on Linux is epoll.
00:24:47disrupteki think it might have more to do with setData but i don't remember the details.
00:25:09disruptekthe point is, you cannot naively assume that you can add an unlimited number of handles to the event.
00:25:51FromDiscord<dom96> of course, there are limits to everything, but definitely not 64
00:25:53mipriyou can't assume that anyway since RAM isn't infinite. if you're doing proper networking you've got to pay for at least separate send/recv buffers for each connection
00:26:29disruptekthanks for reminding me about infinite ram and how hard it is to come by.
00:26:29FromDiscord<dom96> also, the underlying implementation for cps isn't going to be any different, it'll use epoll/kqueue too
00:26:33FromDiscord<ElegantBeef> In the current develop branch of Nim where would one put this? 😄 https://play.nim-lang.org/#ix=2GVE
00:26:50disruptekright, but cps can thread the listeners automatically.
00:28:44mipriElegantBeef: lib/system/setops.nim probably
00:29:31FromDiscord<dom96> @martinium open less fds or set the limits higher, hard to say as it's not clear what is causing it for you
00:30:47disruptekhmm, i can't find this in my notes, but i think the limit i ran into was 64.
00:30:58disruptekanyway, if it works for you, great. enjoy.
00:45:36*Cthalupa quit (Ping timeout: 240 seconds)
00:47:31*Cthalupa joined #nim
00:48:24*Kaivo quit (Quit: WeeChat 2.9)
01:03:16*luis1 quit (Ping timeout: 240 seconds)
01:05:31*luis1 joined #nim
01:10:00*a_chou joined #nim
01:10:52*Tanger joined #nim
01:11:26*luis1 quit (Ping timeout: 264 seconds)
01:29:16FromDiscord<shadow.> can the builtin set[] be used for integers
01:29:20FromDiscord<shadow.> im getting a `set too large` error
01:30:13FromDiscord<ElegantBeef> they have to be <= 16bit ordinals
01:30:17FromDiscord<shadow.> ohh ok i see
01:30:19FromDiscord<shadow.> hmm should work
01:30:26FromDiscord<ElegantBeef> so you have to do `{10u8}`
01:30:34FromDiscord<ElegantBeef> Or w/e your int size is
01:30:59FromDiscord<shadow.> ah ye i see
01:31:04FromDiscord<shadow.> hm
01:31:13FromDiscord<shadow.> if you check if a number under 0 is in it with `in` it raises an error?
01:32:12FromDiscord<shadow.> nvm whatever it worked fine with hashsets no reason to mess w it
01:32:17*luis1 joined #nim
01:32:34FromDiscord<Quibono> Is it faster to see if a string contains a substring, or convert the string to json and then read the value of a key?
01:33:04FromDiscord<ElegantBeef> Converting to json i think will be certainly vastly slower
01:33:25FromDiscord<ElegantBeef> @shadow. you want an `10i8` if you want negatives
01:34:49FromDiscord<shadow.> ohh ok
01:35:05FromDiscord<ElegantBeef> Depends on your range though
01:35:19*abm quit (Read error: Connection reset by peer)
01:35:28FromDiscord<ElegantBeef> you can use int16s or uint16s
01:36:36FromDiscord<shadow.> fair enough thanks
01:52:11*luis1 quit (Ping timeout: 246 seconds)
02:03:01*luis1 joined #nim
02:08:17*Jesin joined #nim
02:10:49*luis1 quit (Ping timeout: 272 seconds)
02:11:16*luis1 joined #nim
02:12:59FromDiscord<Quibono> This still the compiler?
02:17:35FromDiscord<Rika> no this is wendys
02:24:39FromDiscord<Quibono> Can I have a frosty and a chili?
02:27:46*mbomba joined #nim
02:29:54*a_chou quit (Quit: a_chou)
02:34:20FromDiscord<ElegantBeef> How do you run runnable examples?
02:34:28FromDiscord<ElegantBeef> I've never needed this knowledge before 😄
02:36:17FromDiscord<Rika> create the docs
02:36:19FromDiscord<Rika> afaik
02:36:21FromDiscord<ElegantBeef> Yea
02:40:02FromDiscord<shadow.> hmm
02:40:15FromDiscord<shadow.> does `packedsets` no longer exist?
02:42:03*mbomba1 joined #nim
02:43:45*mbomba quit (Ping timeout: 240 seconds)
02:44:46FromDiscord<shadow.> welp `intsets` works fine for this but still lol
02:57:48FromDiscord<ElegantBeef> What do you want?
03:02:01*rockcavera quit (Remote host closed the connection)
03:21:03FromDiscord<Avatarfighter> they wanted `packedsets`
03:21:11FromDiscord<Avatarfighter> but now they've found `intsets`
03:21:35FromDiscord<Rika> yeah but further context is needed
03:21:39FromDiscord<Avatarfighter> lmao
03:21:47FromDiscord<Avatarfighter> im trying my hardest 😭
03:22:50FromDiscord<Rika> try harder wimp
03:22:59disruptektough crowd.
03:34:07*vesper11 quit (Quit: ZNC 1.7.5 - https://znc.in)
03:35:29*vesper11 joined #nim
03:39:09*bozaloshtsh quit (Quit: ZNC 1.7.5 - https://znc.in)
03:39:17*bozaloshtsh joined #nim
03:39:17*bozaloshtsh quit (Changing host)
03:39:17*bozaloshtsh joined #nim
03:44:32*rockcavera joined #nim
03:45:30*vicfred quit (Quit: Leaving)
03:55:14*mbomba1 quit (Quit: WeeChat 3.0)
03:55:44*mbomba joined #nim
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:33*supakeen joined #nim
04:13:05*spiderstew quit (Ping timeout: 240 seconds)
04:14:11*spiderstew joined #nim
04:30:33*lritter quit (Ping timeout: 260 seconds)
04:30:55*lritter joined #nim
04:36:55*vesper joined #nim
04:37:25*vesper11 quit (Ping timeout: 264 seconds)
04:43:21*narimiran joined #nim
04:49:35FromDiscord<Xvip> m
04:49:36FromDiscord<Xvip> m
04:49:37FromDiscord<Xvip> m
04:49:38FromDiscord<Xvip> .
04:50:28FromDiscord<Xvii> hi
04:50:34FromDiscord<Xvip> hi
04:50:34FromDiscord<Xvis> hi
04:50:41FromDiscord<Xvip> oh shit hi xvi
04:50:46FromDiscord<Xvii> hi xvi
04:50:49FromDiscord<Xvis> hi xvi
04:50:53FromDiscord<Xvip> WAIT THEY HAVE AUTO PIC PERMS
04:51:01FromDiscord<Xvii> o yea
04:51:06FromDiscord<Xvip> https://media.discordapp.net/attachments/771772843230101564/777955377223434270/image1-1.jpg?width=511&height=680
04:51:10FromDiscord<Xvii> pog
04:51:18FromDiscord<Xvip> sent a long message, see http://ix.io/2GY9
04:51:21FromDiscord<ElegantBeef> @impbox might want to deal with this
04:51:27FromDiscord<Xvip> nigga
04:51:30FromDiscord<Xvis> stfu
04:51:31FromDiscord<Xvip> fucking snitch
04:51:35FromDiscord<Xvip> fuck u
04:51:35FromDiscord<Xvii> we didnt do anything?
04:51:38FromDiscord<ElegantBeef> Sure
04:51:42FromDiscord<Xvii> what did we do
04:51:45FromDiscord<Xvis> “Elegantbeef”
04:51:45FromDiscord<Xvii> explain
04:51:52FromDiscord<Xvis> he’s racists
04:51:55FromDiscord<ElegantBeef> Sure
04:51:56FromDiscord<Xvis> (edit) "racists" => "racist"
04:52:22FromDiscord<ElegantBeef> Thanks whoever it was 😄
04:53:01FromDiscord<impbox> hopefully that was everyone, and no one else got caught in the crossfire...
04:53:11FromDiscord<impbox> @ElegantBeef thanks
05:12:16*luis1 quit (Ping timeout: 256 seconds)
05:13:20*luis1 joined #nim
05:14:45*thomasross quit (Ping timeout: 256 seconds)
05:19:15*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:19:23*njoseph joined #nim
05:21:08*njoseph quit (Client Quit)
05:21:15*njoseph joined #nim
05:21:18*waleee-cl quit (Quit: Connection closed for inactivity)
05:23:14*a_chou joined #nim
05:37:17*luis1 quit (Ping timeout: 272 seconds)
05:37:26*a_chou quit (Quit: a_chou)
05:43:56*luis1 joined #nim
05:58:14*luis1 quit (Ping timeout: 264 seconds)
06:05:47*vicfred joined #nim
06:07:21FromDiscord<cabboose> @treeform does fidget support dropShadows? I'm not able to see it functioning as of yet, just want to know if i should keep blindly smashing different methods or leave shadows for when they're implemented
06:09:48FromDiscord<treeform> I am currently working on a complete rewrite of fidget right now. It support drop shaodws, but I don't think the old one did.
06:12:13FromDiscord<cabboose> How will API stability go?
06:13:07FromDiscord<cabboose> Actually that’s fine; I’ll keep the UI simple for its use case until further notice from you. Loving your work
06:24:08FromDiscord<treeform> The API will totally change.
06:39:06*luis1 joined #nim
06:45:03*luis1 quit (Ping timeout: 272 seconds)
06:50:21*kungtotte quit (Remote host closed the connection)
06:51:00*astronavt quit (Remote host closed the connection)
06:51:05*kungtotte joined #nim
06:51:24*astronavt joined #nim
06:59:58*habamax joined #nim
07:04:01FromDiscord<j-james> Nim doesn't allow returning multiple values, does it?
07:05:12FromDiscord<ElegantBeef> You can use anonymous tuples yes `(int, int)` for instance
07:05:30FromDiscord<ElegantBeef> you then access the values with `[]` and an index for the one you want
07:05:51*luis1 joined #nim
07:08:38FromDiscord<j-james> https://media.discordapp.net/attachments/371759389889003532/785402372896587816/pog.png
07:09:04FromDiscord<ElegantBeef> you can also unpack them like `let (a,b) = thingThatReturnsTuple`
07:09:27FromDiscord<j-james> Ooh, that's very nice
07:13:14*luis1 quit (Ping timeout: 264 seconds)
07:13:37*luis1 joined #nim
07:16:51FromDiscord<sealmove> Guys, I am passing a NimNode to a proc. Outside the proc it's nnkCall with 1 child, inside the proc it's just the child (without it being wrapped in an nnkCall). How is this possible?
07:17:23FromDiscord<j-james> My Day Seven is too recursive to compile: https://play.nim-lang.org/#ix=2GYx
07:17:27FromDiscord<ElegantBeef> Show the code?
07:17:41FromDiscord<sealmove> Ah ok w8 I'll make a minimal example
07:18:58mipriwhat do you mean "too recursive to compile"? it compiles fine.
07:20:58miprithe big problem with it is that you're opening a file on each call to the function, and the call tree goes deeper than ulimit will let you open files
07:21:19*^Q-Master^ joined #nim
07:21:49*Q-Master quit (Ping timeout: 264 seconds)
07:22:35FromDiscord<sealmove> oh what the heck
07:22:49FromDiscord<ElegantBeef> I'm uncertain if it's even possible to make something so recursive nim cannot output the C equivlent
07:23:14FromDiscord<sealmove> i am using a `case x` statement and because I am changing the value of `x` in the first branch, it goes through more than 1 branches!
07:23:22FromDiscord<sealmove> is this expected behavior?
07:23:30FromDiscord<sealmove> looks like a language bug to me
07:23:43miprihere you go: https://play.nim-lang.org/#ix=2GYz . now you get a nice call depth limit reached (in debug mode) or a segfault in release.
07:25:27FromDiscord<ElegantBeef> Seal i'll say yes as i dont have any code to say no 😄
07:25:47miprino, that's not expected behavior.
07:26:31FromDiscord<ElegantBeef> Well i mean yes it's a bug if so
07:27:42mipriif it were expected behavior, you'd see it here: https://play.nim-lang.org/#ix=2GYB
07:28:04FromDiscord<j-james> mipri: much appreciated 😄
07:28:28FromDiscord<sealmove> yes, i did this test just now
07:28:45FromDiscord<sealmove> hmm, maybe I am missing something and something else is happening.
07:29:53mipricould be. where's the code?
07:30:49FromDiscord<sealmove> trying to reproduce in minimal example. by the time I do I'll probably realize it's something silly
07:36:06FromDiscord<sealmove> Ok it was funny business with node pointers. Guys srsly always use .copyNimTree...
07:37:49FromDiscord<ElegantBeef> Why would we always use it?
07:38:31FromDiscord<sealmove> sometimes you are using a node in more than 1 places and you think you are not going to modify it, but then you do.
07:39:00FromDiscord<Cohjellah> Yo guys, so I'm wondering - why do I have to import so many damn libraries that are basic like tables, sequences, etc
07:39:21FromDiscord<Cohjellah> Wouldn't larger projects just get unnecessarily big import statements at the top?
07:39:39FromDiscord<sealmove> well, you get to pick exactly what you need, isn't this nice?
07:43:52FromDiscord<ElegantBeef> I mean the import noise that Nim gives is whole modules and not the selective stuff that is the standard in places like java
07:46:07mipria larger project doesn't mean every single file has to have all these imports. you just have more files that still need their own inputs.
07:46:44FromDiscord<ElegantBeef> Also remember that idiomatic Nim code doesnt really use qualified symbols so it reduces chance for symbol collisions
07:46:59mipribuf if you ***really*** wanted, you could have a module in the project that does nothing but import and export everything the project needs. Then you just have 'import everything' or whatever across the project's files.
07:47:43*audiofile joined #nim
07:47:48FromDiscord<ElegantBeef> ^is how some packages manage exposing the modules they want to
07:49:25mipriI don't find it onerous anyway. one import std/[strutils, re, tables, sets] and such, then one import npeg, lrucache, karax or whatever.
07:51:10audiofileis it recommended to do a search if other common packages use overload an operator?
07:51:19audiofilelike can my package also overload % when json package does that too
07:52:00FromDiscord<ElegantBeef> Yes
07:52:29FromDiscord<ElegantBeef> Worst comes to worst the overlap will mean you do `import x except '%'`
07:52:50miprino the worst case would be someone wanting both operators in the same file.
07:53:33FromDiscord<ElegantBeef> Yea which means you decide which api you want to be qualified and cry internally
07:53:52mipriit's not just symbols are in conflict though. it's not "oh that module uses % so I had better not", it's the signature of the proc. json has a bunch of prefix % on common types like string and int, so you generally won't want to make a prefix % on the same common types
07:53:59audiofileyes that's precisely the case im referring to!
07:54:00audiofilehow to handle
07:54:02audiofile?
07:54:19mipripick the module you like the least and don't use its operator
07:54:34audiofilethat's like asking to pick a favourite child
07:54:39FromDiscord<ElegantBeef> alternatively use procs instead of operators 😄
07:54:44*audiofile sad older kid noises
07:54:53*PMunch joined #nim
07:54:56audiofileah right there's always that
07:55:01audiofileheya PMunch
07:55:11audiofilewe were just talking about you
07:55:24PMunchHi :)
07:55:28PMunchNothing too bad I hope
07:55:38FromGitter<gogolxdong> What's the usage of coro.nim?
07:56:10Zevvdon't
07:56:15Zevvit's old and should die
07:58:55miprijson.%: https://play.nim-lang.org/#ix=2GYG
08:00:22miprithat coro's old really comes across very well from the source
08:03:12FromDiscord<ElegantBeef> Clearly we need to be able to write `json%` which gets transform into `json.'%'(a)` 😛
08:03:39miprisome situations are inherently ugly and deserve an ugly syntax.
08:14:37*Cthalupa quit (Ping timeout: 264 seconds)
08:15:13*Cthalupa joined #nim
08:16:34*vicfred quit (Quit: Leaving)
08:17:04*audiofile quit (Quit: Connection closed)
08:20:15*audiofile joined #nim
08:23:24FromDiscord<starl0rd> sent a code paste, see https://play.nim-lang.org/#ix=2GYO
08:24:14mipriwhat's the problem?
08:24:25FromDiscord<starl0rd> (edit) "https://play.nim-lang.org/#ix=2GYO" => "https://play.nim-lang.org/#ix=2GYP"
08:24:35FromDiscord<starl0rd> editied
08:24:42FromDiscord<starl0rd> (edit) "editied" => "edited"
08:25:26FromDiscord<starl0rd> how can it be type safe and unsafe at the same time ?
08:28:41mipriit's a description that involves specific type casts, vs. a description of type casts in general.
08:30:20mipri!eval echo cast[int]("this is harder to use safely")
08:30:22NimBot94433936965152
08:32:17FromDiscord<ElegantBeef> Also worth noting that the cast that they demonstrate is to a `cint` which is required for interop with C/C++
08:32:56FromDiscord<starl0rd> i understand that type cast look at the exact bits stored for the source type and tries to interpret it as bits of target type
08:33:08*mbomba quit (Quit: WeeChat 3.0)
08:33:17FromDiscord<starl0rd> and that'll be unsafe anyway you look at it if not careful
08:33:17FromDiscord<ElegantBeef> That entire use case seems to be for C/C++ programmers who are used to constant ints or'd together
08:33:53FromDiscord<ElegantBeef> It probably should be `f.cint`, and not using cast
08:34:02FromDiscord<ElegantBeef> Cast is only really used for lowlevel/interop
08:34:05narimiranPMunch: will you stream your today's AoC solving? i really enjoyed your stream yesterday!!
08:34:21PMunchWell, I'm at work at the moment..
08:34:21mipriyou still wouldn't want to throw cast[cint]() in your code, because although it has this defined use, it doesn't come with a check--it's not going to throw an error if you cast a float to cint instead of an enum set
08:34:26FromDiscord<starl0rd> but from the example, i do not understand how are they converted to powers of 2 ?
08:34:42PMunchIt would need to be after work, but I've already solved part1 :P
08:35:19FromDiscord<ElegantBeef> a set is a bitset by default it's powers of 2
08:35:42narimiranPMunch: you have a complete opposite approach than me: read carefully (with extra care for the highlighted stuff), think about the task, and only then solve it (on the first try). in contrast to my: quick quick quick, fail fail fail
08:35:54FromDiscord<starl0rd> also, another side question, if i use cint or cast int in my code, would it affect how to code compiles in other targets like js, obj c etc ?
08:36:16PMunchnarimiran, well I just read through it once pretty much
08:36:17FromDiscord<ElegantBeef> !eval echo {1u8,2,4} == 7
08:36:18NimBotCompile failed: /usercode/in.nim(1, 16) Error: type mismatch: got <set[uint8], int literal(7)>
08:36:21PMunchAnd then solve it :P
08:36:35PMunchMaybe I go back to check so I don't make an invalid assumption
08:36:38FromDiscord<ElegantBeef> !eval echo {1u8,2,4}.int == 7
08:36:39NimBotCompile failed: /usercode/in.nim(1, 15) Error: type mismatch: got <set[uint8]> but expected 'int'
08:36:50FromDiscord<ElegantBeef> interesting
08:37:03mipri7's also an odd number.
08:37:18miprioh misread the 1 as an 8 :/
08:37:24FromDiscord<starl0rd> i think sets work diff for enums than ints ?
08:37:29FromDiscord<ElegantBeef> No
08:37:31FromDiscord<ElegantBeef> They're bitsets
08:37:37FromDiscord<starl0rd> sure but
08:37:48narimiranPMunch: if you decide to stream today, please ping me, i'd love to watch. (today is not hard, but also not trivial)
08:37:51FromDiscord<starl0rd> !eval sizeof {1,2,4}
08:37:52NimBotCompile failed: /usercode/in.nim(1, 8) Error: expression '8192' is of type 'int' and has to be used (or discarded)
08:38:09FromDiscord<ElegantBeef> !eval echo sizeof {1u8,2,4}
08:38:10FromDiscord<starl0rd> (edit) "!eval ... sizeof" added "echo"
08:38:11NimBot32
08:38:24mipri!eval echo (sizeof(set[int8]), sizeof(set[int16]))
08:38:26NimBot(32, 8192)
08:38:43FromDiscord<ElegantBeef> it's 32 cause a bitset can hold 0..256
08:38:52FromDiscord<ElegantBeef> (edit) "0..256" => "0..255"
08:39:18FromDiscord<starl0rd> !eval type Lol = enum l,O,L,z; echo sizeof {l,O,L}
08:39:19NimBotCompile failed: /usercode/in.nim(1, 24) Error: identifier expected, but got ';'
08:39:22FromDiscord<ElegantBeef> !eval echo sizeof {fmread}`
08:39:23NimBotCompile failed: /usercode/in.nim(1, 22) Error: identifier expected, but got '[EOF]'
08:39:28FromDiscord<ElegantBeef> !eval sizeof {1,2,4}
08:39:29NimBotCompile failed: /usercode/in.nim(1, 8) Error: expression '8192' is of type 'int' and has to be used (or discarded)
08:39:31PMunchnarimiran, just completed part2, so it would just be me showing off my solution pretty much..
08:39:31FromDiscord<ElegantBeef> fuc
08:39:38FromDiscord<ElegantBeef> !eval echo sizeof {fmread}
08:39:39PMunchBut I guess that might be interesting
08:39:40mipriyou can try this stuff in inim, locally
08:39:40NimBot1
08:39:41FromDiscord<starl0rd> !eval type Lol = enum l,O,L,z; echo sizeof {l,O,L};
08:39:42NimBotCompile failed: /usercode/in.nim(1, 24) Error: identifier expected, but got ';'
08:39:52narimiranPMunch: ah, i thought you wouldn't open it until the afternoon
08:40:06PMunchOh no, I was already half done when you asked me
08:40:23PMunchProblem is I kinda want to solve them fast for the leaderboard :P
08:40:26ZevvPMunch: please do show off
08:40:37PMunchOtherwise I could've just waited until after work and solve them on stream
08:41:12FromDiscord<ElegantBeef> !eval echo sizeof set[0..7]
08:41:13FromDiscord<ElegantBeef> Last one
08:41:14NimBot1
08:41:22PMunchIf you're just curious about my solution I have part1: http://ix.io/2GYU and part2: http://ix.io/2GYV
08:41:39FromDiscord<ElegantBeef> the bitset for an enum is just a set of the enum range
08:42:06PMunch(And yes, I know my looping in part1 is ugly :P)
08:42:17FromDiscord<ElegantBeef> When you say `set[uint8]` you're really saying `set[0..255]`
08:42:28FromDiscord<starl0rd> sure
08:43:20FromDiscord<starl0rd> its a bitvector for all numbers in the range
08:43:45FromDiscord<starl0rd> if a enum has 4 values, it needs 4 bits ?
08:43:56FromDiscord<starl0rd> but 8 is a nim ?
08:43:56FromDiscord<ElegantBeef> Well isnt a vector a dynamically size type?
08:44:02FromDiscord<starl0rd> (edit) "nim ?" => "min"
08:44:47FromDiscord<starl0rd> yea, Araq: said sets probably need a little looking at
08:44:49narimiranPMunch, Zevv oh you cool kids and your fancy npeg stuff
08:45:02narimiranand i'm here in 19th century with scanf
08:45:44PMunchOnce you get the hang of npeg it's really nice
08:45:45*^Q-Master^ quit (Ping timeout: 240 seconds)
08:45:51PMunch(and that doesn't take long)
08:46:19FromDiscord<ElegantBeef> I couldnt catch it, i tried multiple times and went yea, cool 😄
08:46:38FromDiscord<ElegantBeef> Still want to make a sugar version of `scanf` that doesnt need you to predeclare the variables
08:46:48PMunchnarimiran, how did you do all of the restrictions with scanf?
08:47:03ZevvPMunch: it's just shameless promotion
08:47:27FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2G77 i did make this as a proof of concept, and it makes scanf nicer to use imo
08:47:29PMunchI just really like npeg :D
08:47:36FromDiscord<ElegantBeef> Although i should use the parse that scanf uses
08:47:42Zevv:)
08:47:42narimiranPMunch: `"$+ bags contain $+"` and then for each bag `"$i $+ bag"`
08:47:45Zevv:et
08:47:53ZevvLet's see how many people switch to npeg over the month :)
08:48:00Zevv2 down, 999.999 to go
08:48:08PMunchnarimiran, ah, so you did it in stages
08:48:09disruptekit's pretty great.
08:48:13narimiranZevv: nim has 1,000,001 users? wow
08:48:29FromDiscord<ElegantBeef> No 999.999 that's a decimal point 😛
08:48:30Zevvdisruptek: down, boi
08:48:33PMunchNo we have 1001 and one almost convinced user
08:48:48narimiran:D
08:48:53PMunchHaha :P
08:49:29FromDiscord<starl0rd> uhm, whats a npeg ?
08:49:33PMunchI mean just look at the pretty railway diagrams it puts out, how can you not like npeg? :D
08:49:36ZevvPMunch: {'a'..'z'} -> Alpha, {'1'..'9'} -> Digit
08:49:38narimiran2.1
08:49:39FromDiscord<ElegantBeef> !repo npeg
08:49:40disbothttps://github.com/zevv/npeg -- 9npeg: 11PEGs for Nim, another take 15 131⭐ 7🍴
08:49:58PMunchZevv, yeah I thought about that
08:49:59FromDiscord<ElegantBeef> Pmunch i dont like it cause i dont know how to use it
08:50:15ZevvElegantBeef: that's a pretty good reason, actually
08:50:24PMunchUnderstandable
08:50:35PMunchI liked it even before I knew how to use it though
08:50:50PMunchJust looking at what Zevv was able to do with it, watching him with envy
08:50:58disruptekbeef: just look at some example usages.
08:50:58FromDiscord<ElegantBeef> I mean it seems cool, but it's pretty unwieldy if you dont know how it does what it does
08:51:01FromDiscord<ElegantBeef> I did
08:51:04disruptek!requires npeg
08:51:06disbotnpeg: 11disruptek[luu,3gully,3atoz,3gcplat,3gitlab,3openapi,3github,3nimph], 11mildred[3nimnews,3newswebjs,3accountserver], 11sealmove/3nimitai, 11zevv/3nim-arduino, 11rishavs/3fea, 11pseudo-lang/3pseudolang, 11jrfondren/3modsec, 11Yardanico/3ircord, 11logic-state/3logicstate, 11khchen/3wAuto, 11thomastay/3prop_logic_simplifier, 11liquid600pgm/3nadio, 11juancarlos
08:51:06FromDiscord<ElegantBeef> They're very non descript imo
08:51:42PMunchWait, is that all the packages in nimble which requires a certain library?
08:51:44disruptekfind something similar to what you want to do.
08:51:54disruptekPMunch: what else?
08:51:57FromDiscord<ElegantBeef> Like i was toying with automating js parsing, and i couldnt even get it to just parse the name/args
08:52:07ZevvPMunch: not all, it's truncated after "juancarlos"
08:52:23PMunchdisruptek, I was just surprised you've bothered to calculate that
08:52:29disrupteki had to truncate jc because he was too long. 👀
08:52:29narimirandisruptek: (how) can we add new stuff to disbot? i want it to have an entry for `rtfm` and `ninp` (nim is not python)
08:52:31PMunchMeans cloning every single package, no?
08:52:47disrupteknarimiran: we do need an rtfm.
08:52:47PMunch~rtfm is read the fucking manual
08:52:48disbotrtfm: 11read the fucking manual
08:52:53PMunch~rtfm
08:52:53disbotrtfm: 11read the fucking manual -- PMunch
08:52:57disruptekPMunch: no, it uses codesearch in real-time.
08:53:07FromDiscord<ElegantBeef> no rtfm should point to `rtfm div operator`
08:53:22narimiran~rtfm is https://nim-lang.org/documentation.html
08:53:22disbotrtfm: 11read the fucking manual
08:53:22disbotrtfm: 11https://nim-lang.org/documentation.html
08:53:52disruptekwe need an !rtfm that tries to find the /manual/ section and then maybe a separate command to bring up docs for a particular manual or import, which could extend to online package docs.
08:53:59narimiran~ninp is nim is not python!!
08:53:59disbotninp: 11nim is not python!!
08:54:10disruptekspelign
08:54:15PMunchOh it doesn't tell you who made the comment when there is more than one?
08:54:29PMunchOh wait, it's because he set it
08:54:31disruptekit only reveals the caller's name so as not to ping.
08:54:39narimiran~rtf,
08:54:39disruptek~pmunch
08:54:39disbotno footnotes for `rtf,`. 🙁
08:54:39disbotPMunch: 11a metaprogramming aficionado and long time Nim user who can be found at peterme.net
08:54:39disbotPMunch: 11streaming at https://twitch.tv/pmunche
08:54:41narimiran~rtfm
08:54:41disbotrtfm: 11read the fucking manual
08:54:41disbotrtfm: 11https://nim-lang.org/documentation.html -- narimiran
08:55:12PMunchRiight
08:55:30PMunchSo if someone put something rude in there then we would have no way to tell who said it :P
08:55:48narimiranno one would do something like that
08:55:50disruptek!repo disbot
08:55:52disbothttps://github.com/atomicptr/disbot -- 9disbot: 11Hubot Adapter for discord.js 15 2⭐ 2🍴 7& 29 more...
08:55:58disruptek!repo disruptek/disbot
08:55:58disbothttps://github.com/disruptek/disbot -- 9disbot: 11disbot data 15 0⭐ 0🍴
08:56:00PMunchBut yeah, something like !rtfm tables to auto-link the tables page for example would be great
08:56:15disruptekdisbot data stores the footnotes.
08:57:01disruptek~manual
08:57:02disbotmanual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek
08:57:02disbotmanual: 11just good to Ctrl+F in cases like this
08:58:04PMunchThat's a bit nicer than
08:58:07PMunch~rtfm
08:58:08disbotrtfm: 11read the fucking manual -- PMunch
08:58:08disbotrtfm: 11https://nim-lang.org/documentation.html
08:58:31FromDiscord<ElegantBeef> Also zevv i do wanna say since i'm a numpty that it'd be nice to see some more basic applications of npeg on things like (10-20-30) or getting specific parts of a datetime stamp
08:58:42*Vladar joined #nim
08:59:01disrupteknimph uses it to parse semver.
08:59:04disruptek!repo nimph
08:59:05disbothttps://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 89⭐ 5🍴 7& 1 more...
08:59:08disruptekjust rtfc
08:59:55FromDiscord<ElegantBeef> I mean sure disruptek, but i'm probably not going to be the only one that wants a smaller example that's less confusing, hence why i'm mentioning it
09:00:15disruptekdetermining date from hyphenated numbers was one of the secret-online-interview questions i got from google.
09:00:40FromDiscord<ElegantBeef> lol
09:00:46ZevvElegantBeef: makes sense. I've started a npeg cookbook a few times, but never got enough motivation to finish it
09:01:00ZevvI also tried to make some videos, but then I remembered I do not only hate _watching_ videos, but also hate _making_ them
09:01:27FromDiscord<ElegantBeef> Yea i've looked at the Json parser/http header parsers and it's just a slight understanding mixed with pure lack of understanding 😄
09:02:29disruptekjust do something simple and then you'll have the confidence to believe you can learn it fully.
09:02:44disrupteki don't like to hear you talking like this.
09:03:03FromDiscord<ElegantBeef> I was trying to use it to parse the name of a javascript function
09:03:22FromDiscord<ElegantBeef> I couldnt get it to capture the name after "function "
09:04:06disruptek~paste
09:04:06disbotpaste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek
09:04:56FromDiscord<ElegantBeef> I've since replaced it with scanf, then deleted it
09:05:28*Q-Master joined #nim
09:05:38disruptek!repo gully
09:05:39*luis1 quit (Ping timeout: 272 seconds)
09:05:39disbothttps://github.com/disruptek/gully -- 9gully: 11a code comment formatter 15 3⭐ 0🍴
09:05:49disruptekthis one has an npeg parser that reads nim syntax.
09:06:50Zevvwait what you parse full Nim?
09:07:17disruptekno, just for determining comments.
09:07:22*luis1 joined #nim
09:07:53disruptekit knows about multiline and different languages, though.
09:08:30disruptekotherwise i would just use the nim parser, most likely.
09:09:10PMunchHmm, I've got QMK working on my custom keyboard now
09:09:24PMunchI wonder how much work it would be to write it in Nim
09:09:52ZevvReal men write a USB client implementation from scratch at least once in their life
09:10:00Zevvget out your HDLC bit stuffer
09:10:05Zevvgo write your descriptors
09:11:39PMunchHaha, I mean I was fully planning on making use of this: https://www.pjrc.com/teensy/td_keyboard.html
09:11:48PMunchAnd not implement my own USB client
09:12:11FromDiscord<ElegantBeef> I imagine wouldnt be too hard with that
09:12:14*Tanger quit (Quit: Leaving)
09:12:23Zevvyeah, that's why I said "real men", right
09:12:48PMunch<_<
09:13:06ZevvWhat does that one mean
09:13:12*luis1 quit (Ping timeout: 260 seconds)
09:14:00FromDiscord<ElegantBeef> Depending on the the teensy you get pmunch you can always store the inputs in a file 😄
09:14:12PMunchI've got the Teensy 2.0
09:14:25FromDiscord<ElegantBeef> still got 32kb of flash 😄
09:14:27PMunchWell, I have a bunch of controllers
09:14:49PMunchI mean I could throw an ESP8266 in there and have built-in WiFi :P
09:15:09disrupteki did make the bloom filter work while watching a movie: http://ix.io/2GZ3/nim lemme know if you can improve it before i put it into production.
09:16:09ZevvMan if I'd to bed after 04:15 it would cost me 4 days to recover
09:16:24disruptekyeah, yeah.
09:16:40disruptekyou probably don't have a biological clock set to Mars time.
09:16:55Zevvyou could just switch to europe time
09:17:15disruptekit will be night here in 12hrs.
09:17:25disruptekhow about you?
09:17:34Zevvdepends on what you call "night"
09:17:53disruptekafter civil twilight ends, night begins.
09:18:14disrupteki tend not to be especially civil during twilight, though. just sayin'.
09:20:46PMunchSo it'll be night here at 2PM then..
09:22:14FromDiscord<ElegantBeef> Suns two hours fast for you pmunch 😄
09:22:44PMunchHuh?
09:22:52PMunchSun isn't up at all
09:23:02PMunchCivil twilight is as bright as it gets here now
09:24:47disruptek!repo marcazar/bitvector
09:24:47disbothttps://github.com/MarcAzar/BitVector -- 9BitVector: 11BitVector Implementation in Nim 15 13⭐ 2🍴
09:24:52disruptekincludes a bloom filter.
09:25:29disruptekprobably will impl a cuckoo filter. that one is new to me.
09:28:56*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:29:54Araqcuoco filter? won't make you happy
09:34:00*luis1 joined #nim
09:37:09FromDiscord<ElegantBeef> But it will make an annoying noise every 30 minutes
09:37:47FromDiscord<ElegantBeef> ~~I guess it's not spelled or pronounced that way, so i'm daft as usual~~
09:38:16FromDiscord<Rika> nope its spelled cuckoo clock if thats what youre referring to
09:38:37FromDiscord<ElegantBeef> I mean i was sorta hoping the pronouncation was close
09:40:27FromDiscord<Rika> i mean disrup.tek did say cuckoo
09:43:01Araq"use nimlint to enforce best practices"
09:43:16Araqok that's good I guess. No idea what nimlint is
09:43:28FromDiscord<ElegantBeef> I think it's a github action?
09:44:46FromDiscord<Rika> idk why but nimlint sounds like a food
09:44:48FromDiscord<flywind> Yeah, that's not ready, now just for hinting some advices from `timotheecour` and I.
09:44:59FromDiscord<ElegantBeef> Nimlint is what i get when i scratch my belly button
09:45:04FromDiscord<ElegantBeef> It's the king of the lint hence nim
09:45:17FromDiscord<flywind> see https://github.com/timotheecour/Nim/issues/415
09:45:19disbotRFC: nimlint: automate enforcing best practices in code ; snippet at 12https://play.nim-lang.org/#ix=2GZd
09:47:39Araqwill "don't use 'defer'" make it into Nimlint :P
09:48:21FromDiscord<flywind> lol
09:49:35*luis1 quit (Ping timeout: 246 seconds)
09:49:35Araqor "don't use break/continue/return"?
09:49:57supakeenwow
09:50:07supakeenmrm all of those can be done with goto!
09:51:00Araqnarimiran, please backport https://github.com/nim-lang/Nim/pull/16279, progress of csources_v1 depends on it
09:51:01disbotOSX: support for M1 [backport:1.0]
09:51:21narimiranok
09:51:41FromDiscord<flywind> Yeah, I think `nimlint` is not for making codes better. Instead it makes code more maintainable.
09:51:46FromDiscord<Rika> i dont see the alternatives to break and continue
09:52:07FromDiscord<Rika> can someone explain to me who has one braincell
09:52:31*luis1 joined #nim
09:53:31AraqRika: it cannot always be avoided
09:53:41Araqwell ok, it can but it sucks
09:53:54Araqbut it's frequently over-used
09:54:06FromDiscord<Rika> it sucks to always avoid it, i see, but when can it be avoided?
09:54:22AraqI often see 'if cond: continue else: stuff()'
09:54:28FromDiscord<ElegantBeef> `for x in 0..100: if x == e: continue`
09:54:45FromDiscord<ElegantBeef> that e is supposed to be a 0 😄
09:54:52FromDiscord<Rika> isnt that 'if not cond: stuff'?
09:55:02FromDiscord<Rika> that's pretty insane lol
09:55:13FromDiscord<ElegantBeef> A lot of people do that
09:55:18FromDiscord<Rika> okay so you just mean those and not some weird new way to look at for loops without continues and breaks
09:55:27FromDiscord<ElegantBeef> I know i did a lot of `if cond: return` in C# and carried it over a bit in Nim
09:55:28FromDiscord<lqdev> gosh that's just terrible
09:55:30FromDiscord<lqdev> why the else
09:55:51FromDiscord<lqdev> i mean `if cond: return` or `if cond: break` or `if cond: continue` is perfectly acceptable imo
09:57:03FromDiscord<ElegantBeef> One thing i can see is that since we have an implict result using `return` could cause unintended issues
09:57:07FromDiscord<lqdev> i know 4raq doesn't particularly like them but tbh i prefer a `continue` over an extra indent level thus even lessening my line column real estate
09:57:29Araqyeah yeah, indent levels are bad
09:57:33FromDiscord<flywind> This benchmark is not correct https://github.com/nim-lang/Nim/pull/16193#issue-529458872
09:57:34disbottoXXAscii use xor op, saving 30%~50% time ; snippet at 12https://play.nim-lang.org/#ix=2G2L
09:57:35FromDiscord<lqdev> damn that last part sounds like i had a stroke
09:57:57Araqwe should go back to asm with gotos, no indentation problems
09:58:11Araqno "column real estate" problems
09:58:14FromDiscord<lqdev> Araq: i'm not saying they're bad, i'm saying that two for loops immediately followed by an if inside of them look horrible
09:58:17FromDiscord<ElegantBeef> Clearly break,continue, and return should just take a condition 😛
09:58:22FromDiscord<Rika> too many indent levels are bad of course
09:58:34FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2GZe
09:59:00FromDiscord<Rika> speaking of two for loops followed by an if inside
09:59:04Araqthe 'if' inside a loop is a filter, the indentation is simply reflecting your code
09:59:17Araqit's stupid to mind it IMO
09:59:20FromDiscord<Rika> that made me laugh a littly
09:59:22FromDiscord<Rika> e
09:59:43FromDiscord<lqdev> but i believe an `if x: continue` better signals the filterness
09:59:57FromDiscord<ElegantBeef> vs `if not x`?
10:00:09FromDiscord<Rika> you one of those "return early" folks?
10:00:12Araqit seems wiser to mind nested for loops, the iteration space can be seen as not very interesting
10:01:10FromDiscord<ElegantBeef> Well sometimes return early is pretty hard to pass up 😄
10:01:31AraqI do it too, but rarely and when I do I feel dirty
10:01:34Araq:P
10:01:36FromDiscord<Rika> i mean yeah definitely i love it
10:01:41FromDiscord<ElegantBeef> Looks at my `withSome`/`withNone` macros in pmunch's `\optionutils`
10:01:51FromDiscord<Rika> i'd prefer that over a long indent
10:02:09FromDiscord<Rika> i guess i prefer that because it looks nicer
10:06:58*abm joined #nim
10:08:59*Torro joined #nim
10:09:07ForumUpdaterBotNew thread by Spamsalty: Passing template's argument to children template?, see https://forum.nim-lang.org/t/7215
10:19:08ForumUpdaterBotNew thread by B3liever: Can I rename my nimble package?, see https://forum.nim-lang.org/t/7216
10:19:09audiofilem1 support!!!!
10:19:14audiofilenice
10:28:49FromDiscord<Rika> ?
10:35:29Araqspeaking of which, can I buy these M1 based laptops anywhere?
10:35:47narimiran@Rika: https://github.com/nim-lang/Nim/pull/16279
10:35:48disbotOSX: support for M1 [backport:1.0]
10:36:18FromDiscord<Rika> i believe the m1 laptops are for sale now
10:36:26FromDiscord<Rika> i dont see why you cant
10:37:04Araqhmm my supplier doesn't have them
10:37:07FromDiscord<Rika> lol that was the easiest addition of support ive ever seen though i guess its just a matter of telling another compiler what to do
10:37:09ForumUpdaterBotNew thread by Mantielero: C++ wrap - let/var behaviour, see https://forum.nim-lang.org/t/7217
10:39:22AraqRika: it's untested and the work in on-going
10:39:50FromDiscord<Rika> Ah yeah I see, I'm a bit short sighted today it seems
10:51:25*lritter quit (Ping timeout: 272 seconds)
10:54:12*^Q-Master^ joined #nim
10:55:33*Q-Master quit (Ping timeout: 260 seconds)
10:57:17*Tanger joined #nim
11:01:39*lritter joined #nim
11:08:06FromDiscord<sealmove> Any idea what " Error: named expression expected" could be? I'm getting when using `quote do`.
11:12:14FromDiscord<lqdev> not enough information.
11:12:14FromDiscord<lqdev> how are you using quote do?
11:13:05FromDiscord<sealmove> In a macro, to generate the result
11:13:17FromDiscord<lqdev> no shit.
11:13:30FromDiscord<lqdev> i'm not asking where
11:13:36FromDiscord<lqdev> i'm asking how are you calling it
11:13:39FromDiscord<lqdev> what are you passing to it
11:14:11FromDiscord<sealmove> let `name` = (get: `readerName`, put: `writerName`)
11:14:28FromDiscord<lqdev> hm
11:14:37FromDiscord<sealmove> (discord hides the backquotes)
11:14:40FromDiscord<lqdev> ik
11:14:57FromDiscord<lqdev> where does the error message point to?
11:15:30FromDiscord<sealmove> at `get:`
11:15:40FromDiscord<lqdev> give me a sec
11:16:58FromDiscord<lqdev> works for me https://play.nim-lang.org/#ix=2GZO
11:17:07FromDiscord<ache of head> > no shit.↵you're turning into disruptek
11:17:55FromDiscord<lqdev> is that a good thing or bad thing?
11:18:15FromDiscord<sealmove> genSym(nskProc)
11:18:24FromDiscord<sealmove> sorry https://play.nim-lang.org/#ix=2GZP
11:19:08FromDiscord<lqdev> yea still works with genSym
11:19:27FromDiscord<lqdev> this happens because your procs are undeclared
11:19:55FromDiscord<lqdev> if i declare the procs inside the quote do, it works as expected :p
11:24:33audiofileAraq what do you mean by your supplier? It's available on the apple store for sale...?
11:24:52audiofiledo you have a cool dude who hooks you up with laptops in shady alleys?
11:25:04audiofileremember, the first laptop is always free...that's how they get you
11:29:14ForumUpdaterBotNew thread by Serge: What is the use of reference (ref) types in Nim. What is ref normally used for in Nim?, see https://forum.nim-lang.org/t/7218
11:31:21Araqaudiofile, exactly :-)
11:31:56Araqmy guy guy gave me a laptop guy and my laptop guy doesn't deliver
11:32:07*audiofile54 joined #nim
11:32:51audiofile54time to fire the laptop guy
11:33:45FromDiscord<Rika> You need a guy guy guy
11:34:05FromDiscord<Recruit_main707> Araq, I’ve been looking a bit into move semantics, can’t they be used to mix manually managed memory libraries with arc/orc?
11:34:54Araqwhat do you mean? that's why they exist. much better interop with the manual MM world
11:35:31FromDiscord<Recruit_main707> Ok, perfect, I was just making sure I understood :p
11:36:15audiofile54can someone eli5 what those two brainy fellers above just said?
11:37:21FromDiscord<Recruit_main707> I will only add that they are an extremely good idea then :)
11:37:37FromDiscord<Rika> Move semantics is the "not much runtime impact gc" that rust made popular I believe
11:37:43supakeenaudiofile54: "It seem useful to copy memory to interact with external libraries."
11:38:39audiofile54oh hmm not sure why that is useful but I guess I'm missing some context, thanks supakeen
11:38:44ForumUpdaterBotNew post on r/nim by cpbotha: Updated Dash docset to Nim v1.4.2, see https://forum.nim-lang.org/t/5050#45577
11:39:12supakeenaudiofile54: Because if Nim thinks it owns some memory and an external library also thinks it owns some memory you need to be careful not to put something else there from either side.
11:39:34FromDiscord<Recruit_main707> Rika, yes, but I was talking about how they are/can be used in Nim
11:39:44audiofile54ohhh I see hmm so does nim like block off the memory it uses somehow
11:39:48FromDiscord<Rika> I was trying to explain to audio
11:40:12FromDiscord<Recruit_main707> Ah, sorry 😅
11:40:16supakeenNo, which is why they were discussing move semantics which define how memory is copied (and if) :)
11:40:23FromDiscord<Rika> If two programs think it owns the same piece of memory, a double free might happen
11:40:54FromDiscord<Rika> Or a lot more reallt
11:40:59FromDiscord<Recruit_main707> Or a free and then a read
11:43:14audiofile54is this move semantics somehow related to copy/reference semantics
11:44:12FromDiscord<Recruit_main707> sent a long message, see http://ix.io/2GZV
11:44:44FromDiscord<Recruit_main707> Bruh, why would it think it was code
11:51:39Zoom[m]Today's aoc is completely unrealistic. Real world rules would be at least 50% cyclic.
11:52:02PMunchHaha
11:52:37Zoom[m]PMunch: have you seen my d4 solution? Managed to do it with just std/pegs
11:54:52Zoom[m]Now I have a comparison point for npeg, if I get to try it
11:55:12PMunchNo I haven't seen that one
11:55:21PMunchI've seen Zevv's version with npeg though
11:56:01*luis1 quit (Ping timeout: 246 seconds)
11:56:29FromDiscord<sealmove> omg i found the problem
11:56:38FromDiscord<sealmove> i imported modules `options`
11:56:49FromDiscord<sealmove> and nim is thinking `get` from that module
11:57:32FromDiscord<sealmove> @lqdev
11:57:45FromDiscord<lqdev> aah
11:57:51FromDiscord<lqdev> damn, that sounds like a bug
11:58:01*luis1 joined #nim
11:58:45FromDiscord<sealmove> @PMunch I am going full rework on binaryparse 😛 I think it's going to fork because I want to add syntax
11:59:14PMunchWhy a full fork?
12:00:20FromDiscord<sealmove> well, it might not be kept minimal as you like it. I am thinking https://github.com/PMunch/binaryparse/issues/14
12:01:44FromDiscord<sealmove> The changes are heavy, if you are ok with it I have no reason to fork, but I think it will need effort to supervise
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:07PMunchI had some questions to that actually
12:06:12PMunchBut I will put them in the issue
12:06:30FromDiscord<sealmove> great, happy to discuss this
12:06:35*supakeen joined #nim
12:07:07PMunchBut in short I think all that you're trying to do could be achieved already, and in a similar way to how you did the other plug-ins
12:09:06FromDiscord<sealmove> Ok I found out 2 major problems with the macro-wrapping-macro approach
12:10:54FromDiscord<sealmove> 1. It's non-modular. For example I made a `createSizedParser`, a `createConditionalParser` and a `createPositionedParser`, but what if you combinations of them?↵2. These are _parser_ options, not _field_ options. The latter is much better because you can reuse the same parser for many fields, some of which might be conditional, positioned etc.
12:11:55FromDiscord<sealmove> I've tried many DSL and they all have similar features for a reason
12:27:35PMunchHmm, that is a fair point
12:48:48audiofile54http://vpaste.net/MpMY9?bg=dark&nu can someone tell me what is wrong in my code? syntactically
12:49:25audiofile54can I not change override operator precedence with parentheses? compiler seems to be complaining about tuple
12:51:14audiofile54nvm i think i got it
12:52:18TangerHey folks, does anybody have any tips for hitting "Too many files open" when using threads? Do I need to resolve threads in batches?
12:53:25audiofile54someone pls explain *this*
12:53:35audiofile54!eval not 5
12:53:36NimBotCompile failed: /usercode/in.nim(1, 1) Error: expression '-6' is of type 'int literal(-6)' and has to be used (or discarded)
12:53:46audiofile54!eval echo(not 4)
12:53:48NimBot-5
12:53:51audiofile54wtf
12:54:12audiofile54!eval echo(not 8)
12:54:14NimBot-9
12:58:05FromDiscord<InventorMatt> it's flipping all of the bits in the binary of the number
12:58:55audiofile54ohhh is that the 2's complement thingy
12:59:00FromDiscord<InventorMatt> yes
12:59:06audiofile54thank you inventory matt
12:59:41FromDiscord<InventorMatt> no problem you can check what it looks like here https://play.nim-lang.org/#ix=2H0D
13:00:45audiofile54oh boy that ufcs looks sexy there
13:01:01audiofile54keep forgetting to use it, thanks for showing and oh boy did you solve the leap year >_>
13:01:47audiofile54i like that .bool instead of bool(...)
13:26:20audiofile54inventorymatt you there?
13:26:40FromDiscord<InventorMatt> yeah, still here
13:27:31FromDiscord<InventorMatt> ufcs can be really nice for making clean code
13:27:41audiofile54do you prefer typcasting like .type instead of type(...)?
13:28:14narimiranaudiofile54: sometimes you might also want to do `foo bar` instead of `foo(bar)` or `bar.foo` ;)
13:28:31*Kaivo joined #nim
13:28:32audiofile54what is that first syntax
13:28:36audiofile54never seen that before?
13:28:40narimiranand for me, it depends on the context which i would use
13:28:56narimiranaudiofile54: you never echo-ed anything in nim? ;)
13:29:03FromDiscord<InventorMatt> typically yes, but its probably because it is easier to write .type instead of adding parenthesis
13:29:08audiofile54'abc'.echo B)
13:29:17narimirantype error
13:29:48FromDiscord<shadow.> lol
13:29:48audiofile54!eval "abc".echo
13:29:50NimBotabc
13:29:53FromDiscord<shadow.> there we go
13:29:54audiofile54^good bot
13:30:07audiofile54sorry, I'm used to python where ' and " are more or less same
13:30:12audiofile54but funny that .echo works!
13:30:16FromDiscord<shadow.> audiofile omitting parentheses is command syntax iirc
13:30:26audiofile54!eval bool 2
13:30:28NimBotCompile failed: /usercode/in.nim(1, 6) Error: expression 'bool(2)' is of type 'bool' and has to be used (or discarded)
13:30:33FromDiscord<shadow.> or maybe its just considered part of ufcs
13:30:42audiofile54so 3 ways are possiblee in ufcs??
13:30:51FromDiscord<InventorMatt> yes, there are 3 ways
13:30:55audiofile54!eval (bool 2).echo
13:30:57NimBottrue
13:31:01audiofile54lmaooo
13:31:14audiofile54feeels like i've committed several cardinal sins at once
13:31:19audiofile54and some warcrimes
13:31:24FromDiscord<shadow.> !eval 2.bool.echo
13:31:26NimBottrue
13:31:30FromDiscord<shadow.> there ya go
13:31:31FromDiscord<shadow.> lmao
13:31:32audiofile54B R U H
13:31:40FromDiscord<shadow.> it's nice for things such as .type and .len
13:31:45FromDiscord<shadow.> disruptek wrote a nice writeup on it
13:31:50FromDiscord<shadow.> https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d
13:31:52audiofile54ngl it is easier to read from left to right like that
13:32:01FromDiscord<Recruit_main707> Stop this
13:32:03FromDiscord<Recruit_main707> It hurts
13:32:14FromDiscord<InventorMatt> the only thing missing from that is case insensitivity
13:32:16audiofile54thanks for link
13:32:26audiofile54is disrupt the dude who is working on a nim fork
13:32:46FromDiscord<shadow.> !eval 0_0u8.INT.UINT_64.BOOL.eChO
13:32:47FromDiscord<shadow.> LMAO
13:32:48NimBotCompile failed: /usercode/in.nim(1, 6) Error: undeclared field: 'INT' for type system.uint8 [declared in /playground/nim/lib/system/basic_types.nim(9, 3)]
13:32:52FromDiscord<shadow.> darnnn
13:33:01FromDiscord<shadow.> !eval 0_0u8.UInT_64.BOOL.eChO
13:33:04NimBotCompile failed: /usercode/in.nim(1, 6) Error: undeclared field: 'UInT_64' for type system.uint8 [declared in /playground/nim/lib/system/basic_types.nim(9, 3)]
13:33:11FromDiscord<shadow.> rip
13:33:19FromDiscord<InventorMatt> !eval 0_0u8.iNT.uINT_64.bOOL.eChO
13:33:19audiofile54whoa you can mix case like that?
13:33:22NimBotfalse
13:33:26FromDiscord<shadow.> LMAO
13:33:27FromDiscord<shadow.> yeah
13:33:29audiofile54reads liike the spongebob retard talk lol
13:33:34FromDiscord<shadow.> you can mix case and put underscores anywhere you want
13:33:40audiofile54wait WHAT
13:33:42FromDiscord<shadow.> in identifiers they don't really matter
13:33:43FromDiscord<InventorMatt> except for the first letter
13:33:45FromDiscord<shadow.> yeah
13:33:52FromDiscord<shadow.> ohh that's why mine didn't work haha
13:34:10audiofile54!eval 2.b_o_ol.ecHO
13:34:13NimBottrue
13:34:16FromDiscord<shadow.> ye
13:34:20FromDiscord<shadow.> lol
13:34:25audiofile54now why would it be allowed
13:34:28FromDiscord<shadow.> i guess that allows people to use camelCase or snake_case
13:34:30audiofile54trying to figure out le usecase
13:34:34audiofile54ah
13:34:38audiofile54but on standard types?
13:34:42audiofile54i mean like your types
13:34:45FromDiscord<shadow.> camelCase is preferred
13:35:04FromDiscord<shadow.> rah this aoc is rly tripping me up lmao
13:35:10FromDiscord<shadow.> im using bfs but my answer is too high somehow
13:35:13FromDiscord<shadow.> dfs
13:35:21FromDiscord<InventorMatt> it's also incredibly useful if you ever forget to capitalize the second word
13:35:34FromDiscord<shadow.> true
13:35:43FromDiscord<shadow.> like `openarray` `openArray`
13:35:53FromDiscord<InventorMatt> one of the reasons I stopped learning java years ago was because I kept messing up capitalizations
13:35:58FromDiscord<lqdev> also `open_array`
13:36:15FromDiscord<lqdev> it eases the transition to a new language a little bit
13:36:22FromDiscord<shadow.> also because `thisCouldLegitimatelyBeAClassNameFactoryInitializer`
13:36:27FromDiscord<shadow.> lmfao
13:36:31FromDiscord<lqdev> but tbh i prefer to write Nim with camelCase, it looks weird with snake_case
13:36:36FromDiscord<shadow.> yeah i agreew
13:36:37FromDiscord<shadow.> agree
13:36:41FromDiscord<lqdev> like, C looks just fine
13:36:41FromDiscord<lqdev> C++ too
13:36:44FromDiscord<lqdev> python - eh
13:36:50FromDiscord<lqdev> but Nim - camelCase for life
13:36:56audiofile54i propos SpOnGeBoBcAsE
13:36:58FromDiscord<shadow.> it's weird in c++ they say camelCase but stl uses snake_case
13:37:04FromDiscord<shadow.> to be fair c++ stl is pretty garbage
13:37:07audiofile54s/propos/propose
13:37:10FromDiscord<lqdev> who says camelCase in C++
13:37:15audiofile54java
13:37:19FromDiscord<lqdev> i'mma go scold them
13:37:36FromDiscord<shadow.> most people say camelCase for functions and variables lol
13:37:39FromDiscord<shadow.> and PascalCase for classes ofc
13:37:43audiofile54system.out.print.is.somewhere.in.this.package('hello world') <- java be like
13:37:45FromDiscord<InventorMatt> I sometimes change it based on what the word combo is and what looks best
13:37:54FromDiscord<shadow.> rah
13:37:59FromDiscord<shadow.> the only important thing is to be consistent
13:38:07FromDiscord<shadow.> mixing and matching is a nono in every language
13:38:08FromDiscord<shadow.> except for
13:38:09FromDiscord<shadow.> nim
13:38:09FromDiscord<shadow.> LMAO
13:38:29FromDiscord<InventorMatt> that's why we have style insensitivity so we can be inconsistent
13:38:39FromDiscord<shadow.> ye
13:38:47*tiorock joined #nim
13:38:47*tiorock quit (Changing host)
13:38:47*tiorock joined #nim
13:38:47*rockcavera is now known as Guest20776
13:38:47*Guest20776 quit (Killed (hitchcock.freenode.net (Nickname regained by services)))
13:38:47*tiorock is now known as rockcavera
13:38:51FromDiscord<InventorMatt> besides the editor usually autocompletes it for you anyways
13:38:58FromDiscord<shadow.> nimsuggest is pretty spicy
13:38:59audiofile54i bet people have set up formatters to format other people's code to their tastes
13:39:08FromDiscord<shadow.> ye
13:39:23audiofile54not sure if there's a formatter that can do the underscore casing to camel hmm
13:39:24FromDiscord<shadow.> hmm
13:39:28FromDiscord<shadow.> this aoc is trippppingg me up
13:39:39FromDiscord<shadow.> yeah ofc lmao it wouldn't be too hard to make your own
13:39:43audiofile54no politics >:(
13:39:47audiofile54jk
13:39:47FromDiscord<shadow.> what-
13:39:57FromDiscord<shadow.> im not talking abt the politician lmfao
13:40:05audiofile54aoc is a monitor and a us politician
13:40:12FromDiscord<shadow.> and advent of code?
13:40:13FromDiscord<shadow.> 2020
13:40:14FromDiscord<shadow.> lmao
13:40:16audiofile54oh
13:40:20FromDiscord<InventorMatt> https://forum.nim-lang.org/t/6497 you can always nuglify your code for optimal appearance
13:40:22FromDiscord<shadow.> that's what im referring to
13:40:25FromDiscord<shadow.> LOL
13:40:29FromDiscord<shadow.> WHAT
13:40:38FromDiscord<shadow.> love that
13:40:53*tiorock joined #nim
13:41:19audiofile54it's crazy!
13:41:25audiofile54I approve
13:41:38audiofile54looks like something out of a cheese-fuelled nightmare
13:41:55FromDiscord<shadow.> lmao
13:42:15audiofile54what is 4raq's reply saying below that?
13:42:20audiofile54the \x codes
13:42:21audiofile54are they hex?
13:42:46FromDiscord<shadow.> ascii?
13:42:48FromDiscord<shadow.> iirc
13:43:16*rockcavera quit (Ping timeout: 240 seconds)
13:43:51audiofile54inventorymatt do you havea any more cool links like that?
13:44:06FromDiscord<shadow.> lmao
13:44:16FromDiscord<shadow.> did you look at the ufcs writeup i sent?
13:44:23audiofile54yeeeee
13:44:35FromDiscord<shadow.> nvm those were unicode escape sequences
13:44:41audiofile54good guidelines
13:44:51FromDiscord<shadow.> you could try aoc ;)
13:44:55FromDiscord<Rika> hello
13:45:00FromDiscord<Rika> oh man nuglifier
13:45:03FromDiscord<shadow.> yes
13:45:08FromDiscord<InventorMatt> I don't have any links I can think of at least for nim
13:45:13FromDiscord<Rika> i was there when it was being made lol
13:45:16FromDiscord<shadow.> lmaoo
13:45:33FromDiscord<shadow.> aoc day 7 is proving to be much much harder than day 6
13:45:33audiofile54i expect people who used solarized to write code like that xD
13:45:37FromDiscord<shadow.> or maybe im just making a dumb mistake
13:45:38FromDiscord<shadow.> i can tell
13:45:41FromDiscord<Rika> because nim is totally one of the languages where the source code is the binary /s
13:45:44FromDiscord<shadow.> cant
13:45:46FromDiscord<shadow.> lmfao
13:45:48FromDiscord<Rika> ehemjavascriptehem
13:45:48audiofile54im still on aoc 0
13:45:54FromDiscord<shadow.> rip
13:45:57FromDiscord<shadow.> you mean day !?
13:45:58FromDiscord<shadow.> 1?
13:46:03FromDiscord<Rika> day nil
13:46:04audiofile54haven't started yet lmaooo
13:46:07FromDiscord<shadow.> smart
13:46:12audiofile54planning to start in 2025
13:46:17FromDiscord<shadow.> smh
13:46:20FromDiscord<Rika> 2025 will not come
13:46:29audiofile54should give me enough time to complete other stuff im procrastinating
13:46:30FromDiscord<Rika> we will all be dead by 2022 because of economic collapse
13:46:37FromDiscord<shadow.> fair
13:46:38audiofile54wow, cant wait!
13:47:00FromDiscord<Rika> ive been watching too many economics videos as you can tell
13:47:11FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H0S
13:47:33FromDiscord<shadow.> the answer is too high
13:47:38FromDiscord<Rika> let me read one moment
13:47:40FromDiscord<shadow.> kk
13:48:12FromDiscord<Rika> its messy to read because of the multiple intertwining of variables
13:48:33*NimBot joined #nim
13:48:36FromDiscord<Rika> !eval echo "im okay"
13:48:38NimBotim okay
13:48:40FromDiscord<Rika> lol
13:48:44audiofile54lmao he bacc
13:48:50FromDiscord<Rika> not for u tho
13:48:53audiofile54the bot left for a bit
13:48:58FromDiscord<Rika> i dont see the gg
13:49:04audiofile54yeah that's why I did gg
13:49:09audiofile54cuz it left irc
13:49:22FromDiscord<Rika> has to take a break
13:49:42FromDiscord<Rika> bots have rights too you know
13:49:46FromDiscord<shadow.> rip
13:49:52FromDiscord<shadow.> should i put my code on hatebin?
13:49:54FromDiscord<shadow.> or ix
13:50:12audiofile54hatebin?
13:50:15FromDiscord<Rika> ixbin
13:50:22FromDiscord<shadow.> https://play.nim-lang.org/#ix=2H0V
13:50:24FromDiscord<Rika> hateix
13:50:24audiofile54is there an s missing there or nah
13:50:29FromDiscord<Rika> no
13:50:29FromDiscord<shadow.> nope
13:50:32FromDiscord<shadow.> there's hastebin
13:50:33FromDiscord<shadow.> pastebin
13:50:33audiofile54lmao rly?
13:50:34FromDiscord<shadow.> and hatebin
13:50:37FromDiscord<Rika> shatebin
13:50:39FromDiscord<Rika> xd
13:50:41FromDiscord<shadow.> lol
13:50:43audiofile54hatebin for hatespeech
13:50:46FromDiscord<shadow.> lmk if there's an obvious flaw in the second part
13:50:53FromDiscord<shadow.> if it's not obvious ill just dig into it myself
13:50:58FromDiscord<Rika> basedbin
13:51:03FromDiscord<shadow.> lmamo
13:51:05FromDiscord<shadow.> lmaoo
13:51:10FromDiscord<Rika> day one??? damn let me read the proble
13:51:14FromDiscord<shadow.> nono
13:51:16FromDiscord<shadow.> this is day 7
13:51:22audiofile54he dissing you m8
13:51:23FromDiscord<shadow.> LMAO
13:51:25FromDiscord<shadow.> solvePartOne
13:51:26FromDiscord<shadow.> my bad
13:51:48FromDiscord<Rika> man fuck not this again i dont wanna do aoc again aaa
13:51:50FromDiscord<shadow.> i woke up at 7am not my fault :blobpain:
13:51:54FromDiscord<shadow.> rahh
13:51:57FromDiscord<Rika> i fizzled out last year because its not my thing
13:51:58FromDiscord<shadow.> no worries
13:52:03FromDiscord<shadow.> ill figure out why my answer is
13:52:05FromDiscord<shadow.> too high
13:52:06FromDiscord<shadow.> lol
13:52:07FromDiscord<Rika> so whats the issue
13:52:40FromDiscord<Rika> you know tuples can be var in nim
13:52:50FromDiscord<Rika> you dont need to remake the tuple in line 7 and 8
13:52:56FromDiscord<Rika> its not python
13:53:08FromDiscord<shadow.> lemme look
13:53:25FromDiscord<shadow.> wdym?
13:53:32ForumUpdaterBotNew thread by V3ss3n: Nim Lang requires a proper standard for coding, see https://forum.nim-lang.org/t/7219
13:53:54FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=2H0W
13:54:21FromDiscord<shadow.> oh yeah i know
13:54:30FromDiscord<shadow.> but parsed should be a tuple not seq right
13:54:33FromDiscord<shadow.> and that would make it a seq
13:54:42FromDiscord<starl0rd> uhm, can i generalize that if its not a ref or ptr object, it will probably be a value type ?
13:54:43FromDiscord<shadow.> because split() returns seq
13:54:44FromDiscord<Rika> oh i see
13:54:47FromDiscord<Rika> i misunderstood
13:54:52FromDiscord<shadow.> yeah i really needa make an unpack macro somehow lmao
13:55:14FromDiscord<shadow.> or somethin idk
13:55:25FromDiscord<Rika> have fun figuring it out
13:55:30FromDiscord<Rika> because i aint xddddddddddddddddddddddddddddd
13:56:31FromDiscord<shadow.> lmaoo
13:56:41FromDiscord<shadow.> i've never been good at these type of questions
13:56:49FromDiscord<shadow.> i saw a competitive programmer solving something similar with airline flights
13:56:58FromDiscord<shadow.> and i was just
13:57:01FromDiscord<shadow.> my brain stopped functioning
13:57:11FromDiscord<Rika> my brain works its just not fun
13:57:19audiofile54brain?
13:57:25FromDiscord<shadow.> whats that
13:57:26FromDiscord<Rika> oof
13:57:54FromDiscord<Rika> i mean i guess some organisms live without an actual brain
13:58:42FromDiscord<Rika> man i can type so fast sometimes that my thinkpad's keyboard cant keep up
13:59:03FromDiscord<Rika> it does this beeping thing indicating the keystroke is (sometimes almost) ambiguous
13:59:13FromDiscord<shadow.> lmfao same my phone does that
14:08:07audiofile54how check string uppercase?
14:08:14audiofile54isupperascii is only for char
14:08:26audiofile54!eval "abc".isupperascii.echo
14:08:27NimBotCompile failed: /usercode/in.nim(1, 6) Error: undeclared field: 'isupperascii' for type system.string [declared in /playground/nim/lib/system.nim(34, 3)]
14:08:37narimiranaudiofile54: you write a for loop?
14:08:39audiofile54!eval import strutils; "abc".isupperascii.echo
14:08:41NimBotCompile failed: /usercode/in.nim(1, 23) Error: type mismatch: got <string>
14:08:51audiofile54no single function for strings?
14:08:57FromDiscord<shadow.> make one
14:09:01audiofile54or is there something like all() from python
14:09:10audiofile54all(<str>, isupperascii)
14:09:13FromDiscord<shadow.> i mean we don't have generators so
14:09:13narimiran~ninp
14:09:14disbotninp: 11nim is not python!! -- narimiran
14:09:24FromDiscord<InventorMatt> you could probably use map to get it in one line
14:09:29FromDiscord<shadow.> aaaa please don't
14:09:30FromDiscord<shadow.> lmao
14:09:35FromDiscord<shadow.> there's zero reason to condense shit into one line
14:09:38audiofile54yes but why not??
14:09:41audiofile54>:(
14:09:46FromDiscord<shadow.> because it's harder to read
14:09:49narimiranaudiofile54: it is ambiguous
14:10:01narimiranaudiofile54: is "THIS HERE" upper ascii?
14:10:01audiofile54oh ok
14:10:15audiofile54...space but yes
14:10:28FromDiscord<shadow.> doesn't it just check that there's no lower ascii in it?
14:10:31narimiranaudiofile54: is "THIS_HERE!?" upper ascii?
14:10:39audiofile54nien
14:10:40audiofile54nein
14:10:54narimiranso, space is upper? but `_?!` aren't?
14:11:00audiofile54space isn't!
14:11:22FromDiscord<shadow.> lmao
14:11:23audiofile54i mean, ideally i was looking for a function to just check if the alphabets are uppercase
14:11:33FromDiscord<shadow.> then just loop through every letter
14:11:40FromDiscord<shadow.> and ensure it's not `isLowerAscii()`
14:11:48audiofile54life is too short to loop through every letter T-T
14:11:49FromDiscord<starl0rd> .
14:11:56FromDiscord<shadow.> that's what every function does
14:11:59FromDiscord<Rika> thestr.toUpperAscii() == thestr
14:12:00FromDiscord<starl0rd> (edit) "." => "anyone ?"
14:12:00FromDiscord<Rika> or whatever
14:12:00narimiranaudiofile54: also too short to write python in nim
14:12:23FromDiscord<shadow.> true
14:12:25FromDiscord<Rika> i believe you also have to add that its not a var object
14:12:25audiofile54just looking for equivalent my dudes, no need for pitchforks now
14:12:52FromDiscord<starl0rd> ?
14:13:04FromDiscord<shadow.> var T
14:13:07FromDiscord<shadow.> as type
14:13:15narimiranaudiofile54: maybe this will help? https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
14:13:20FromDiscord<Rika> like `proc a(b: var int)` is passed by pointer
14:15:12audiofile54Any downside to ` thestr.toUpperAscii() == thestr` ?
14:16:20FromDiscord<shadow.> uhhhh
14:16:34audiofile54extra memory?
14:16:36mipriit requires allocation, which you can avoid
14:16:44audiofile54yeee ok!
14:16:56FromDiscord<Rika> sequtils has an all i believe
14:17:05miprifor c in thestr: if c in {'a'..'z'}: return false
14:17:14FromDiscord<Rika> https://nim-lang.org/docs/sequtils.html#all%2CopenArray%5BT%5D%2Cproc%28T%29
14:17:14audiofile54so i set a bool flag to true and if anywhere in the loop i see nonuppercase i set to false and break ?
14:17:28FromDiscord<Rika> all(thestr, isUpperAscii)
14:17:30FromDiscord<Rika> i think
14:17:34audiofile54oh hm
14:17:38FromDiscord<shadow.> well that wouldn;t
14:17:40FromDiscord<shadow.> wouldnt
14:17:43audiofile54yeah *that's* what i was looking for!
14:17:44FromDiscord<shadow.> ignore non letters
14:17:48audiofile54oh why not hm
14:17:49FromDiscord<Rika> that is true
14:17:53audiofile54wdym
14:17:59audiofile54pll explain
14:17:59FromDiscord<shadow.> just do like
14:18:04FromDiscord<shadow.> here lemme make one one sec
14:18:09audiofile54kk
14:18:15FromDiscord<Rika> in the docs, 7 is not upper ascii
14:18:26audiofile54this is weird man what do you consider ascii
14:18:31FromDiscord<Rika> so youll have to distinguish alphabetic and non alphabetic
14:18:33audiofile54alphanumeric?
14:18:34FromDiscord<shadow.> you can do that
14:18:35FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H17
14:18:53FromDiscord<shadow.> and import sequtils ofc
14:18:54FromDiscord<Rika> 7 is still not lower ascii
14:19:00FromDiscord<shadow.> exactly
14:19:15FromDiscord<shadow.> i think he would consider "I AM 7 YEARS OLD" upper ascii
14:19:16FromDiscord<Rika> hm i guess that works yeah
14:19:28FromDiscord<shadow.> he just wants to make sure there are no lowercase letters
14:19:33FromDiscord<shadow.> which in that case my solution should work
14:19:52FromDiscord<Rika> okay
14:19:58FromDiscord<Rika> i'm a bit oxygen deprived
14:20:10audiofile54wots wrong https://play.nim-lang.org#ix=2H19
14:20:12FromDiscord<shadow.> lmao
14:20:22audiofile54Rika are you underwater
14:20:30FromDiscord<shadow.> strutils
14:20:33FromDiscord<shadow.> you needa input strutils lol
14:20:38audiofile54oh damn
14:20:43FromDiscord<Rika> no i biked for a few km a few minutes ago
14:20:43audiofile54looks like im the one who needs O2
14:21:43audiofile54ah https://play.nim-lang.org#ix=2H1a
14:21:46FromDiscord<shadow.> also you dont need the parentheses in this case
14:21:49FromDiscord<shadow.> `echo all("abcd", c => not c.isLowerAscii)` works
14:22:10audiofile54i wish compiler would suggest missing imports from stdlib
14:22:15audiofile54or is that nimsuggest's job
14:22:27narimiranhow would that work
14:22:59audiofile54ayo you missed X
14:23:04audiofile54and X is here lmao
14:23:10FromDiscord<shadow.> wha
14:23:16narimiranhow would that work
14:23:32FromDiscord<shadow.> i mean it has been done in languages in java
14:23:33FromDiscord<shadow.> auto import
14:23:37audiofile54if I do all(...) compiler be like "ayo all is in sequtils lol"
14:23:44FromDiscord<shadow.> i mean
14:23:45narimiranhow would that work
14:23:49FromDiscord<shadow.> LMAO
14:23:53audiofile54huh?
14:23:57FromDiscord<shadow.> im guessing he wants it to search every proc in every package every time you make a keystroke
14:24:03FromDiscord<shadow.> lmao
14:24:13audiofile54just need to check stdlib for overlap
14:24:18FromDiscord<shadow.> i mean to be fair it has been done in java
14:24:20audiofile54store in a hashmap or something idc
14:24:25audiofile54yeah
14:24:31audiofile54just sayin
14:24:35FromDiscord<shadow.> but im surprised a python dev is asking for this
14:24:36FromDiscord<Rika> itll bloat compile time
14:24:43audiofile54im not a python dev?
14:24:48FromDiscord<shadow.> hmmm
14:24:51FromDiscord<shadow.> biggest lie ive ever heard
14:24:56FromDiscord<shadow.> lol
14:25:06FromDiscord<shadow.> what language do you come from?
14:25:12audiofile54C++ -> Java -> Python -> Go -> Brainfk -> Nim
14:25:12FromDiscord<InventorMatt> it could be done only if a proc is missing which wouldn't mess up most compiletimes
14:25:18audiofile54among other detours which I shall not mention
14:25:21FromDiscord<shadow.> why would you include brainfuck
14:25:25narimiran"just need to check stdlib for overlap". yeah, "just"
14:25:33audiofile54that's what nim feels like to me now xD
14:25:35FromDiscord<shadow.> what is the largest project you have made in brainfuck
14:25:47audiofile54hm I think printing 42 to stdout
14:25:54FromDiscord<shadow.> then dont include it
14:25:57FromDiscord<shadow.> lmao
14:26:00audiofile54ok sire
14:26:09audiofile54pretty sure I wrote a brainfk compiler in one of those languages
14:26:15audiofile54but yeeee whatever
14:26:33audiofile54i like piet too
14:27:01FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H1d
14:27:02FromDiscord<shadow.> "yeah im a brainfuck dev"
14:27:03FromDiscord<shadow.> lmao
14:27:14FromDiscord<shadow.> i suppose it is turing complete
14:27:17FromDiscord<shadow.> so say what you will lmao
14:30:53*haxscramper joined #nim
14:31:05FromDiscord<shadow.> idk why im talking i just made a brainfuck interpreter in nim like 2 days ago
14:31:39*haxscramper left #nim (#nim)
14:32:27FromDiscord<Esbeesy> Alright, day 7.
14:32:36FromDiscord<ache of head> dang
14:32:48FromDiscord<ache of head> discord has syntax highlighting for brainf?
14:33:16FromDiscord<shadow.> e
14:33:17FromDiscord<shadow.> ye
14:33:20FromDiscord<shadow.> you're trying it?
14:33:23FromDiscord<Esbeesy> Yeah, it uses CodeHilite and Pygment
14:33:24FromDiscord<shadow.> also i figured out my issue rika
14:33:40FromDiscord<shadow.> i think it was if one bag had multiple child bags it was still counting
14:33:52FromDiscord<Esbeesy> Just finished it shadow - Whipped out that npeg library again 😂 Thanks zevv
14:33:58FromDiscord<shadow.> damnn
14:34:00FromDiscord<shadow.> i really need to learn npeg
14:34:03FromDiscord<shadow.> but i dont understand it lmao
14:34:10FromDiscord<shadow.> it'll click eventually
14:34:27FromDiscord<shadow.> im guessing its easier than my janky regex / strscans approach
14:34:38PMunch@Esbeesy, did you just finish todays AoC in about a minute?
14:34:40FromDiscord<Esbeesy> I don't tbf, there were a few matches I wrote that didn't work, for example +(word Space) didn't match anything but (word Space)[2] worked every time
14:35:37FromDiscord<shadow.> rip solved it
14:35:45FromDiscord<Esbeesy> God no pmunch, took me about half an hour to figure out the npeg parsing, an hour to do part 1, and then smashed part 2 in like 10 seconds haha
14:35:48FromDiscord<shadow.> welp
14:35:54FromDiscord<shadow.> the parsing took me about 2 minutes
14:35:57FromDiscord<shadow.> but this last part
14:36:02PMunchHaha, okay :P
14:36:02FromDiscord<shadow.> had me tripped up for 30 mins
14:36:08FromDiscord<shadow.> before i realized one parent bag only counted for one point
14:36:16narimiranbest task this year?
14:36:18FromDiscord<shadow.> man do i love iterative dfs / bsf
14:36:26FromDiscord<shadow.> bfs
14:36:34FromDiscord<shadow.> i used dfs here but it makes no difference lmao
14:36:50PMunchAccording to my filesystem I downloaded input.txt at 9:01, then part2 was compiled at 9:38
14:37:02FromDiscord<shadow.> LMAO
14:37:04PMunchSo it took me just over half an hour to solve the whole thing
14:37:07FromDiscord<shadow.> i really needa learn npeg rahh
14:37:14FromDiscord<shadow.> alr lemme see part two
14:37:21PMunchhttp://ix.io/2GYV
14:38:20FromDiscord<shadow.> oh no i meant lemme take a stab at it
14:38:23FromDiscord<shadow.> i havent even tried it yet lmao
14:38:26narimiranPMunch: i needed half an hour just for part2, because at 6am only thing i know is iteration, and my logic was wrong :)
14:38:57narimiranbut generally, part2 feels easier than part1
14:39:12FromDiscord<shadow.> hmm
14:39:18FromDiscord<shadow.> im guessing bfs will work here lmao
14:39:28FromDiscord<Esbeesy> https://github.com/sambeckingham/advent-of-code-2020/blob/main/day7/day7.nim↵↵Compare notes?
14:40:18narimiran`("bags" | "bag")` -- is it ever just "bag"?
14:40:31*audiofile quit (Quit: Connection closed)
14:40:55*audiofile54 quit (Quit: Connection closed)
14:41:00FromDiscord<Esbeesy> Yeah if it's got a count of 1
14:41:11FromDiscord<shadow.> damn
14:41:11FromDiscord<shadow.> hmm
14:41:19PMunchnarimiran, yup
14:41:22narimiranoh, right.
14:41:26FromDiscord<Esbeesy> https://media.discordapp.net/attachments/371759389889003532/785516319730303016/unknown.png
14:41:26PMunchAt least in my input set
14:41:35narimirangood thing i used scanf and ignored that
14:41:39PMunchHaha :P
14:42:01FromDiscord<Esbeesy> Man I butchered it with scanf, immediately fell back to npeg.
14:42:03PMunchI think part2 just feels easier because you have a good solution to part1
14:42:21FromDiscord<Esbeesy> Yeah it was just totalling the counts, super easy
14:42:28PMunchIf you do something weird that makes part1 super non-exandable then you basically have to rewrite the whole thing for day2
14:42:31PMunchpart2*
14:43:07Zevvi usually hack together day one, put some effort in day2 which then often accomodates part1 more nicely
14:43:47FromDiscord<Esbeesy> Did that for day 6. I find you can usually guess where part 2 is gonna go in advance, but Day 6 totally caught me off guard
14:44:06FromDiscord<Esbeesy> I'd also never come across countTable when I was doing part 1, but it made both parts super easy
14:44:48FromDiscord<shadow.> for day 6?
14:44:50FromDiscord<shadow.> or day 7
14:47:15FromDiscord<Esbeesy> 6
14:47:53FromDiscord<Esbeesy> http://ix.io/2H1q
14:48:28FromDiscord<shadow.> ohh ok
14:48:36FromDiscord<shadow.> day 6 was surprisingly easy
14:48:41FromDiscord<shadow.> i finished day 7 part 1 lol
14:48:44FromDiscord<shadow.> ima switch to npeg after
14:49:30PMunch@Esbeesy, ah I see you just wrote a parser for a single line and then just loop that
14:49:35narimiranCountTable for day 6?
14:50:19PMunchAnd I guess I was a bit more strict about my ','s :P
14:51:11*Tanger quit (Remote host closed the connection)
14:51:31PMunchWhat does `inc acc, count * multi` do?
14:52:48narimiranincreases acc by count*multi?
14:53:12PMunchReally? I thought `inc` was a unary
14:53:31PMunchSo it's just another way to write `acc += count*multi`?
14:53:47FromDiscord<Esbeesy> Inc has a default param set to 1
14:53:54FromDiscord<Esbeesy> Yeah exact my that
14:54:00FromDiscord<Esbeesy> (edit) "exact my" => "exactly"
14:55:14*waleee-cl joined #nim
14:55:31FromDiscord<Esbeesy> @Narimiran yeah CountTable for day 6 😂 I’m new to Nim, everything’s a shiny new toy for me
14:55:34PMunchHuh, TIL
14:56:36PMunchUpdated my repo by the way, just missing day 4.. https://github.com/PMunch/aoc2020
14:58:01FromDiscord<shadow.> im so confused about day 7 part 2 lmao
14:59:00PMunchJust a simple recursion once you have the rules parsed ;)
14:59:20PMunchOop, I've gotta go
14:59:31FromDiscord<shadow.> ahh ok i see
14:59:40*PMunch quit (Quit: leaving)
14:59:45*hoijui joined #nim
15:00:41narimiranyou can do it even without recursion :P
15:00:47narimiranbut don't :D
15:05:10FromDiscord<shadow.> lmao
15:05:13FromDiscord<shadow.> i never use recursion
15:05:38FromDiscord<shadow.> i probably just wasted so much memory with this solution but idc
15:05:42FromDiscord<shadow.> lmaoo
15:06:11FromDiscord<shadow.> kk solved it
15:06:25FromDiscord<shadow.> wow im 41 now yay
15:06:47FromDiscord<shadow.> im coming for you pmunch https://media.discordapp.net/attachments/371759389889003532/785522702085652580/unknown.png
15:07:00FromDiscord<shadow.> alr time to learn npeg
15:08:08*Cthalupa quit (Ping timeout: 260 seconds)
15:09:06FromDiscord<lytedev> thanks, PMunch! didn't realize you can pass peg a block! mine's wrapped in a string haha https://github.com/lytedev/advent-of-code/blob/master/2020/src/day7.nim
15:09:22*Cthalupa joined #nim
15:10:56FromDiscord<Esbeesy> Shadow how did you do it without recursion?
15:11:54FromDiscord<shadow.> for part one?
15:12:26FromDiscord<shadow.> https://play.nim-lang.org/#ix=2H1J
15:12:38FromDiscord<shadow.> welp that's part two
15:12:59FromDiscord<shadow.> i know i should have used math instead of having some 1gb wide queue
15:13:01FromDiscord<shadow.> but idc
15:13:02FromDiscord<shadow.> lol
15:13:03FromDiscord<shadow.> cba rn
15:13:23FromDiscord<shadow.> https://play.nim-lang.org/#ix=2H1L
15:13:27FromDiscord<shadow.> there i added part one
15:17:57FromDiscord<shadow.> 1gb memory is better
15:17:59FromDiscord<shadow.> smh
15:18:07FromDiscord<shadow.> i have 24gb might as well use it 🙄 🙄
15:18:19FromDiscord<shadow.> reminds me of when i made an n-puzzle-solver and i opened my ram usage and it was at like 4gb LMAO
15:18:32FromDiscord<shadow.> @Esbeesy how did you make your parser?
15:18:34FromDiscord<shadow.> im interested in learning npeg
15:28:37Zevvso what would you need for that
15:30:43FromDiscord<shadow.> hmm
15:30:48FromDiscord<shadow.> a manual or docs
15:30:55FromDiscord<shadow.> im reading the github page rn
15:31:00FromDiscord<shadow.> but im guessing i should learn normal pegs first?
15:33:10Zevvthere's not such thing as "normal" pegs
15:33:13*habamax quit (Ping timeout: 264 seconds)
15:33:17narimiran:)
15:33:19Zevvand the nim pegs lib is not harder or easier then npeg
15:34:13Zevvtake the example from the quickstart
15:34:20Zevvcopy it into your file, and start from there
15:34:27Zevvdoes all of that example make sense?
15:34:47FromDiscord<shadow.> lemme take a look
15:34:58FromDiscord<lytedev> looks like npeg more easily lets you build your AST, though
15:35:28FromDiscord<lytedev> or I misunderstand how to use pegs =D
15:35:47FromDiscord<lytedev> pegs also limits you to 20 captures within a single parse since it's using PCRE
15:35:53Zevvbuilding ASTs is always a bit fiddly, I have not found one single way that works for everything.
15:36:13AraqbuildAst
15:36:16Araqnew in fusion
15:36:17FromDiscord<shadow.> oh hey araq
15:36:25Araqhey
15:36:43FromDiscord<shadow.> hm alr zevv ill take a look at the quick start lol
15:37:50FromDiscord<lytedev> that's for Nim's AST specifically, right? I meant the AST from a parser such as was useful for AoC today
15:38:19FromDiscord<shadow.> im confused on the significance of "pairs"?
15:38:35FromDiscord<shadow.> like passing it to the peg function
15:39:15Araqlytedev: ah yeah
15:40:07Zevvshadow.: it's just a collection of named rules that call eachother. The top level (aka "main") rule is the one named in the peg definition.
15:40:17Zevvso "pairs" is the rule where parsing starts in the example
15:40:27FromDiscord<shadow.> ahh i see ok
15:40:35FromDiscord<shadow.> hmm
15:40:35*hoijui quit (Quit: Leaving)
15:40:57FromDiscord<shadow.> ahh im starting to get it
15:43:45FromDiscord<shadow.> if + means one or more is there something for just one?
15:44:45Zevvright. that's all in the manual, pretty elaborate
15:44:57Zevvread https://github.com/zevv/npeg#syntax
15:45:00FromDiscord<shadow.> ty
15:49:01FromDiscord<Esbeesy> With great difficulty 😂 There were things that I thought would work that didn't, like +(+Alpha Space) not matching when (+Alpha Space)[2] did.
15:49:45FromDiscord<shadow.> hmm
15:49:56FromDiscord<shadow.> yeah im working on it rn haha
15:50:09FromDiscord<Esbeesy> Cause I thought +(+Alpha Space) would be equivalent to (+Alpha Space)[1 .. infinity] essentially
15:50:17FromDiscord<Esbeesy> But apparrently not
15:50:24FromDiscord<shadow.> yeah i would assume the same that's weird
15:50:44FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H28
15:50:50FromDiscord<shadow.> and idek if that's correct lol
15:50:59FromDiscord<shadow.> now i needa make children
15:51:50FromDiscord<shadow.> ok that was not the way to phrase that
15:51:54FromDiscord<Esbeesy> Lmao
15:52:00FromDiscord<shadow.> LOL
15:52:23*Torro left #nim ("bye")
15:52:40FromDiscord<shadow.> what happens when you put a colon after a line?
15:52:41FromDiscord<shadow.> what does that do
15:53:29Zevv+(+Alpha Space) is a sytnax error
15:53:39Zevvyou mean +(+Alpha * Space)
15:53:44FromDiscord<Esbeesy> Lol I was just about to ask you if you could explain what I was doing wrong
15:53:48FromDiscord<Esbeesy> YEah that#s what I meant
15:53:57Zevvwhich indeed means 'one or more times (one or more Alpha followed by one space)
15:54:04FromDiscord<Esbeesy> http://ix.io/2H1p
15:54:26FromDiscord<Esbeesy> Actually that's a mistake, the top string should have " bags" after it
15:54:37FromDiscord<lytedev> then that's why =D
15:54:49narimiranspace after beige missing?
15:54:58FromDiscord<Esbeesy> lmao no I was just trying to send an example for Zevv to illustrate the point
15:55:02FromDiscord<Esbeesy> but in my haste fucked it up
15:55:13Zevvright. space missing
15:55:33narimiranlmao yes :P
15:56:05Zevvbut to be clear: they both do match
15:56:08Zevvbut don't match the full subject
15:56:27Zevvpegs don't care if they don't match all, if you don't ask for that explicitly
15:58:18*hnOsmium0001 joined #nim
15:58:18*luis1 quit (Ping timeout: 244 seconds)
15:58:41*luis1 joined #nim
15:59:39FromDiscord<Esbeesy> https://play.nim-lang.org/#ix=2H1L
16:00:08narimiranoh you didn't!
16:00:22FromDiscord<Esbeesy> So the second one, which doesn't match, I would have thought would match?
16:00:24narimiranyou add to queue N times of the same thing? madlad!
16:00:38FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H2d
16:01:23FromDiscord<shadow.> can i use variables inside of it?
16:01:32FromDiscord<Esbeesy> yes
16:01:36FromDiscord<shadow.> oh damn
16:02:32FromDiscord<shadow.> so my color (key) and child (digit) are in diff blocks
16:02:38FromDiscord<shadow.> so how would i set ruleMap[color] = digit
16:02:48Zevvrulemap[$1] = $0
16:03:00Zevvif you have them in 2 places, save one in a tmp var
16:03:10FromDiscord<shadow.> ahh ok i see
16:03:11FromDiscord<shadow.> lemme try
16:03:38FromDiscord<shadow.> vars are accessible cross-block?
16:03:44FromDiscord<shadow.> not sure how this (macro?) works sorry
16:03:53Zevvfor simple things you can just use variables from outer scopes, or if youre a purist, you can pass a var of a type of your own choice as parser state, but that's for advanced usage
16:04:03Zevvshadow.: really, look in the examples
16:04:04Zevvit's all there
16:04:23FromDiscord<shadow.> ahh ok thanks
16:04:33FromDiscord<shadow.> can you send a link to the examples
16:04:42Zevvin the manual
16:04:42FromDiscord<lqdev> !repo npeg
16:04:43disbothttps://github.com/zevv/npeg -- 9npeg: 11PEGs for Nim, another take 15 131⭐ 7🍴
16:04:47FromDiscord<shadow.> oh alr
16:05:09ZevvI feel the manual is a bit top-heavy for new users
16:05:25Zevvthere should probably be a tutorial-style thing as well
16:05:29Zevvbut I can't bother to write one
16:05:36FromDiscord<Esbeesy> Haha, I know that feeling
16:06:01FromDiscord<Esbeesy> The docs still provide good coverage though
16:06:06FromDiscord<lytedev> yeah it assumes the user knows a good bit about parsers
16:07:21FromDiscord<shadow.> yeahh ive really only worked with regex lol
16:07:23FromDiscord<shadow.> but ill figure it out
16:08:36FromDiscord<Esbeesy> Just realised I didn't even do the coolest part: Generate a diagram!
16:09:36*hmmmmm joined #nim
16:10:03disruptekweird.
16:10:28disruptekcuckoo filter /does/ make me happy.
16:10:36Zevvyou are a funny man
16:11:40hmmmmmdoods how do I scribble-scrabble the manifest of my exe so I can have my spiffy gorilla.ico showing on the icon
16:11:41Zoom[m]<narimiran "best task this year?"> I actually think it's the worst problem yet. The problem screams 'recursion' and parsing the input doesn't add anything meaningful to the task, just complicates it.
16:12:38FromDiscord<lqdev> hmmmmm: there's https://github.com/electron/rcedit
16:12:43FromDiscord<Esbeesy> I was saying this to a friend, I feel more like I'm exercising my input parsing skills than figuring out how to solve problems. Which is fine but I want to learn Nim
16:13:01Zevvbut now everyone is learning npeg \o/
16:13:05FromDiscord<Esbeesy> Not just.. npeg.
16:13:10Zevvmuhahaa
16:13:15FromDiscord<Esbeesy> Lmao I love it though
16:13:31disruptektoo bad so much effort is spent to obfuscate input.
16:13:44narimiranZoom[m]: from what i can tell, most of the solutions i've seen use only one Table (`{bag: smallerBags}`)
16:14:03FromDiscord<Esbeesy> Any of you folks used Elm? That has a really interesting parser
16:14:09FromDiscord<lytedev> IMO, a tiny parser to extract the bits you need makes perfect sense
16:14:09narimirani went with two tables, and now i'm questioning my choice :D
16:14:23FromDiscord<lytedev> I've used Elm a handful of times
16:14:23hmmmmmgreat lqdev, this tool helps with bundling the resources files of my app into the exe too?
16:14:34narimiranZevv: give it a few more days, and maybe even i start learning it. what have you done??
16:15:01Zevvpayed Eric Wastl well
16:15:06FromDiscord<lqdev> hmmmmm: nope, just the metadata
16:15:16FromDiscord<lqdev> but you can embed resources easily using slurp()
16:15:21FromDiscord<Esbeesy> Ah fuck narimiran I just checked your repo, "Bagushkas" 😂
16:15:22Zoom[m]I solved the 4th day with std/pegs only, and used it on d7 to parse the input, but that `eventParser` template contrived and I still don't understand if it would be useful :P
16:15:28FromDiscord<Esbeesy> Sprayed coffee out my nose
16:15:30hmmmmmoh really? very interesting :o
16:15:37*omn1present_ joined #nim
16:15:41narimiranZevv: btw, am i reading your solution correctly? you assumed the longest chain is 10, and that's it? :D
16:15:54narimiran@Esbeesy haha, thanks :) glad somebody noticed it :)
16:16:20Zevvnarimiran: I have proven the longest was only 5, and doubling that "for safety"
16:16:33Zevvcmon I can be lazy, that's a right
16:16:44Zoom[m]<narimiran "Zoom: from what i can tell, most"> What do you mean? Is it wrong?
16:17:00narimiranZevv: and here i am, foolishly building `bag -> larger` and `bag -> smaller` tables
16:17:23ZevvI could also just iterate until no new ones are found. But that adds a line or two
16:17:23narimiranZoom[m]: well, i thought it would be very slow that way. but it isn't
16:17:38*omn1present_ quit (Client Quit)
16:18:26Zoom[m]I'd very much prefer to solve it with trees or something instead of recursion, but in this case recursion is much much easier than anything I can think of
16:18:55narimiranZoom[m]: see here for my (over-engineered?) solution: https://github.com/narimiran/AdventOfCode2020/blob/master/nim/day07.nim
16:20:38Zoom[m]Hm, I think I liked all your solutions until today :)
16:21:28narimiranhaha
16:21:34narimiranbut it makes sense
16:24:35FromDiscord<shadow.> LMAO
16:24:42FromDiscord<shadow.> also i got the parser working lol
16:25:01*omn1present_ joined #nim
16:26:56*omn1present_ quit (Client Quit)
16:27:12narimiranZoom[m]: i've tried a quick'n'dirty solution using just `bag -> smallerOnes` table, and it is ~4x slower than mine :/
16:27:15*theo_ joined #nim
16:27:28Zoom[m]I actually thought I'd receive some hateful comments on my solutions, but no feedback of any kind yet.
16:27:35*theo_ quit (Client Quit)
16:27:50Zoom[m]I'll read into yours in a bit
16:27:53ForumUpdaterBotNew thread by HJarausch: Pop for a set - is there something prettier?, see https://forum.nim-lang.org/t/7220
16:27:53*theo_ joined #nim
16:28:18theo_IRC gang'
16:28:41Zoom[m]I expect parsing with pegs to be the slowest part :)
16:28:49Zoom[m]... in mine
16:29:12FromDiscord<shadow.> hey if you want to see bad practice all you have to do is look at my part two
16:29:15FromDiscord<shadow.> its 100 times worse than yours zoom
16:29:19*habamax joined #nim
16:29:32FromDiscord<shadow.> https://play.nim-lang.org/#ix=2H2s
16:31:36*theo_ quit (Client Quit)
16:31:37FromDiscord<shadow.> alr zevv after understanding how this works now npeg is one of the coolest things i have ever used
16:33:32Zoom[m]@shadow. eh, nothing sticks out except copying ruleMap into queue? Is it what you meant?
16:34:24Zevvshadow.: cool. send me your money now
16:35:35Zoom[m]@shadow. have you actually seen mine to say yours is 100 times worse? 😀
16:35:43narimiranZoom[m]: i tried your p1 algorithm with my code, and yes, it is ~4x slower
16:36:08narimiran(but it looks nicer, indeed; especially when you hide some for-loops behind `map` and such :P)
16:36:13Zoom[m]I think this is a win for me. Just 4x...
16:39:39Zoom[m]I measured the previous day and my solution with bitopts is faster than the same approach but with IntSet by like x200
16:40:36*tiorock is now known as rockcavera
16:40:37*rockcavera quit (Changing host)
16:40:37*rockcavera joined #nim
16:40:40Zoom[m]I was left with the conclusion that something gets optimized out and timeIt doesn't measure properly.
16:41:16Zoom[m]But I left it at that
16:41:46Zoom[m]I'm not sure I'm familiar enough with Nim to focus on optimizations
16:43:11FromDiscord<shadow.> no zoom
16:43:13Araqso ... our IntSet is 200x faster, right?
16:43:13FromDiscord<shadow.> the issue is that
16:43:15FromDiscord<shadow.> in part two
16:43:25FromDiscord<shadow.> instead of using math im just adding each child the amount of times
16:43:31FromDiscord<shadow.> so my queue is gonna become like fuckin 100gb in width
16:44:33narimiranAraq: faster than the built-in bit-set? i wouldn't say so :)
16:45:17narimiranZoom[m]: you're really a fan of zero_functional, huh? :)
16:45:39FromDiscord<Esbeesy> I benchmarked mine out of curiosity, just under 2x a slow as yours Narimiran
16:45:51narimiranlink?
16:46:11FromDiscord<Esbeesy> https://github.com/sambeckingham/advent-of-code-2020/blob/main/day7/day7.nim
16:46:58narimiranwhy `deduplicate seq` instead of using a set?
16:47:20FromDiscord<Esbeesy> 👀 Truth be told I was trying to use set but
16:47:59FromDiscord<Esbeesy> I dumbed out. Are the sets in Nim as simple as set[string]?
16:48:06FromDiscord<lqdev> no
16:48:14narimiransee https://nim-lang.github.io/Nim/sets.html
16:48:17FromDiscord<lqdev> a `set` is a bitset
16:48:29FromDiscord<lqdev> yeah what narimiran linked is what you're looking for
16:48:32FromDiscord<Esbeesy> Fuck
16:48:41FromDiscord<Esbeesy> So I saw that page and thought it was the bitsets still
16:48:54FromDiscord<Esbeesy> Ah this is dangerous, I fuckin love hash sets man
16:49:16FromDiscord<Esbeesy> Gonna start jamming FP into my Nim code 😂
16:51:24Zoom[m]<narimiran "Zoom: you're really a fan of zer"> Nah, it's far from ergonomic and doesn't behave as expected in some cases.
16:52:17Araqtry sugar.collect
16:52:22AraqI love it
16:53:08Araqit's like somebody understood what FP's maps and filters really try to do and threw away the FP parts
16:53:30Araqand focussed on turning for loop *statements* into *expressions*
16:56:08Zoom[m]In my mind collect is just a consumer for an iterator. I don't like that a lot of things that are a natural fit for iterators work with seqs or are just macroses like sugar/collect
16:56:47FromDiscord<shadow.> YESSIR
16:56:51*luis1 quit (Ping timeout: 256 seconds)
16:56:54FromDiscord<shadow.> sometimes im just like
16:57:06FromDiscord<shadow.> "yk i could write 10 lines with creating new variables and appending and blah blah blah"
16:57:09FromDiscord<shadow.> or...
16:57:15FromDiscord<shadow.> i could just write 1 huge line of unreadable fp crap
16:58:09FromDiscord<shadow.> but yeah sugar collect is pretty sick
16:58:15FromDiscord<Esbeesy> sugar.collect is siiiiick wtf
16:58:18FromDiscord<shadow.> yeahh
16:58:23disruptekZevv: i think you and i have a different definition for "proof."
16:58:28FromDiscord<shadow.> i made a comprehension template with it really easily lol
16:58:53*luis1 joined #nim
16:59:16*sagax quit (Remote host closed the connection)
16:59:32disruptek~Esbeesy is "sugar.collect is siiiiick wtf"
16:59:33disbotEsbeesy: 11"sugar.collect is siiiiick wtf"
16:59:42FromDiscord<shadow.> wonderful
17:01:35hmmmmm~hi disbot
17:01:35disbotno footnotes for `hi`. 🙁
17:01:40hmmmmm:|
17:02:00disruptek~Zevv is "I have proven the longest was only 5, and [I'm] doubling that 'for safety.'"
17:02:20disruptekyou broke disbot's brain.
17:02:26hmmmmm:|
17:02:35disruptekdisbot: you okay, buddy?
17:02:36disbotyep. 😊
17:02:40disruptek~Zevv is "I have proven the longest was only 5, and [I'm] doubling that 'for safety.'"
17:02:41disbotZevv: 11"I have proven the longest was only 5, and [I'm] doubling that 'for safety.'"
17:02:43hmmmmmyour bot can't handle "hi" I don't know what kind of bot it even is
17:03:04disruptekanti-social, what else?
17:03:10hmmmmmhehe
17:03:13hmmmmmfitting I suppos'
17:03:41FromDiscord<shadow.> id try it but i think disrupted made him ignore me
17:03:42FromDiscord<shadow.> rip
17:03:43FromDiscord<shadow.> lmao
17:03:48FromDiscord<shadow.> disruptek
17:04:20FromDiscord<Esbeesy> me after reading that sugar module:
17:04:23FromDiscord<Esbeesy> https://media.discordapp.net/attachments/371759389889003532/785552296439185498/unknown.png
17:04:24disruptekhmm what does this look like on your screen: :disruptek:
17:04:25hmmmmmit would be hilarious if the bot corrected people when they misspelled dirupté
17:04:47FromDiscord<shadow.> it looks like nothing
17:04:51disruptekrude.
17:04:54FromDiscord<shadow.> \:disruptek:
17:04:55FromDiscord<shadow.> try that
17:05:05disruptekgood idea.
17:05:08disruptek\:disruptek:
17:05:11FromDiscord<shadow.> rip
17:05:13FromDiscord<shadow.> still didn't work
17:05:17disruptekweird.
17:05:23FromDiscord<shadow.> that's quite odd
17:05:30FromDiscord<shadow.> :disruptek: what does this look like for you? just the colons?
17:05:32disruptekit's almost like the chucklehead that wrong the bot didn't think things through...
17:05:40FromDiscord<shadow.> oop
17:05:45disrupteks/wrong/wrote/
17:05:51disrupteki may be a little stoned right now.
17:05:57FromDiscord<shadow.> you're good
17:06:01FromDiscord<shadow.> im glad to find someone else uses sub for edits
17:06:02disruptektell me about it.
17:06:09disrupteki love hearing about how great i am.
17:06:13FromDiscord<shadow.> ofc
17:06:17FromDiscord<shadow.> and how great your testes are
17:06:23disruptekyou like my testes?
17:06:26disrupteknice, right?
17:06:31FromDiscord<shadow.> yes, very colorful
17:06:31FromDiscord<Esbeesy> Oh not this again 😂
17:06:37disruptekit's a little more spammy now than it was.
17:06:44FromDiscord<shadow.> true
17:06:46FromDiscord<shadow.> very spammy testes
17:06:52disruptekalways has been.
17:06:55FromDiscord<shadow.> ~~the females might like that~~
17:07:02FromDiscord<shadow.> anyways
17:07:03hmmmmmdisruptek can u make a noob style guide for when to return and when to result
17:07:08FromDiscord<shadow.> uhh
17:07:11disrupteksure.
17:07:23disrupteknever return unless using result will make you look like an asshole.
17:07:26FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H2M
17:07:30hmmmmm:|
17:07:37disruptekthat's literally the style i use.
17:07:46FromDiscord<shadow.> i mean yeah always result unless it looks stupid
17:08:00disruptekuse result for any >1-statement proc.
17:08:15FromDiscord<shadow.> hmm so
17:08:17disruptekuse named block instead of temporaries.
17:08:23FromDiscord<shadow.> true
17:08:43FromDiscord<Esbeesy> Is there a page or book on idiomatic Nim anywhere?
17:08:50disruptekuse if exprs for one-liners only when it makes the code easier to read; think multiline statement expressions.
17:08:58disruptekindent if exprs on a new line.
17:09:27disruptekuse try expressions only if there is no except clause.
17:09:42hmmmmmwat
17:09:50disruptekuse case elif sparingly; it's easy to overlook for the reader.
17:10:04hmmmmmplease take all this stuff into a proper doc my brain is exploding
17:10:24hmmmmmmy idiomatic nim is limited to using 1..high right now
17:10:25disruptekjust look at whatever i'm writing recently.
17:10:36disruptek1..high?
17:10:43disrupteki think maybe two of us are high.
17:10:47hmmmmmlol
17:10:56hmmmmmI mean the double dot to mean from a to b
17:11:05hmmmmmI find it pretty spiffy and I use it all the time
17:11:10disruptekoh, what would you use otherwise?
17:11:14disruptekcountUp?
17:11:31hmmmmmI'm sure I was usinge something else on python but can't even remember lol
17:12:04hmmmmmoh it was the range thing
17:12:06disruptekwe should be able to `for x in 40 to 50:`
17:12:19disruptekthat would be siiiiick.
17:12:22FromDiscord<Esbeesy> That would be nice, I like it when it's wordy
17:12:31FromDiscord<Esbeesy> Which is weird cause I despise VB
17:12:31disruptekyeah baby, i'm almost there.
17:12:34FromDiscord<shadow.> sadly no character operators
17:12:44FromDiscord<shadow.> rip
17:12:50FromDiscord<shadow.> text
17:12:57hmmmmmalso I find the strange inc 1 very fascinating but never had occasion to use it
17:13:15FromDiscord<shadow.> wdym
17:13:20disruptekyou can use 🙅 as an operator.
17:13:43disrupteki think we all know what it means.
17:14:22Zevvdisruptek: I have proven that for my data set. and I have 10 fingers
17:14:23FromDiscord<Esbeesy> I love inc too. I wrote this as part of my day 6 solution, ix.io/2H2P, and I literally guessed reset
17:14:29Zevvthat is a perfectly good reason
17:14:42FromDiscord<Esbeesy> Like is that just a thing it can do, and it is, mind ==blown
17:15:42FromDiscord<Esbeesy> For me it's that it makes your code readable in an actual linguistic sense. Like I could show "Inc total, clear table, reset group" to my 80 year old nan and I'm sure she'd have an idea what it did
17:17:15*Vladar quit (Quit: Leaving)
17:18:14disruptek~ufcs
17:18:15disbotufcs: 11a misnomer. See https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d for one set of opinions. -- disruptek
17:18:45disruptekdo you want more style opinions?
17:18:57FromDiscord<Esbeesy> Yeah uniform function call syntax baybeee
17:19:49disruptekare you my brother?
17:20:05FromDiscord<Esbeesy> I thought I was an only child
17:20:12FromDiscord<Esbeesy> Did our mothers lie to us?
17:20:13disrupteknot anymore.
17:20:21FromDiscord<Esbeesy> https://media.discordapp.net/attachments/371759389889003532/785556314838663258/unknown.png
17:20:31FromDiscord<Esbeesy> My friend after showing him sugar.collect haha
17:20:42FromDiscord<Esbeesy> He was doing AoC in Scala
17:20:42disruptekwhat is he doing it in?
17:20:50disruptekTHIS
17:20:50disruptekIS
17:20:52disruptekSCALA
17:21:15disrupteki don't really know scala but i think of it as the nim of java.
17:21:43hmmmmmso it's a faster python with types? :o
17:22:01FromDiscord<Esbeesy> Wait, if Go has Gophers, and Python has Pythonistas, Rust has Rustaceans and C# has White Boomers
17:22:07FromDiscord<Esbeesy> Please tell me Nim is Nimphs
17:22:08disrupteknah, it's more like, "clever and tasteful"
17:22:24disruptekwhite boomers; that's hilarious.
17:22:37hmmmmmnim has nimteks
17:22:40disruptekthat's not true though, really.
17:22:51disrupteki'm a nimion.
17:22:59disruptek!repo nimph
17:22:59disbothttps://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 89⭐ 5🍴 7& 1 more...
17:23:02hmmmmmi'm a nimlet
17:23:03disruptekis already a thing.
17:23:13disruptekyou seem more like a nimpleton to me.
17:23:16hmmmmmD:
17:23:22hmmmmmI upgraded from that
17:23:29FromDiscord<Esbeesy> or Nimrods 😂
17:23:32disrupteknext stop: nimp
17:23:37FromDiscord<Esbeesy> Yes!
17:23:43hmmmmmnimp like nimpleasant?
17:23:55disrupteka nimp is a clever nimian.
17:24:00hmmmmmoh
17:24:01FromDiscord<Quibono> Nim-nuts?
17:24:02hmmmmmI'm not that
17:24:21FromDiscord<Quibono> I think I’m a nimpleton
17:24:44FromDiscord<shadow.> i am a nimpieceofcrap
17:24:47disruptekmy github profile features a nimskull.
17:24:56FromDiscord<Quibono> Wanna be a Night some day.
17:25:02FromDiscord<Esbeesy> Nimcompoops
17:25:28FromDiscord<Quibono> _uses trumpcase because there’s no K on the front_
17:25:41FromDiscord<Quibono> We are the nights of Nim!
17:26:00disrupteki think that's a porno.
17:26:02FromDiscord<shadow.> didn't nim use to be called nimrod
17:26:10disruptekit's a secret.
17:26:14FromDiscord<shadow.> ahh right right
17:26:18FromDiscord<shadow.> lmao
17:26:37FromDiscord<shadow.> to be fair i wasnt even born then so i cant say i know from firsthand experience
17:26:56disruptekwell, i didn't think you were that old.
17:27:05disrupteknimrod is old even by /my/ standards.
17:27:14FromDiscord<shadow.> i thought nimrod was released like 2004?
17:27:38FromDiscord<Quibono> Shadow you’re making me feel old
17:27:48FromDiscord<shadow.> rip
17:28:02FromDiscord<shadow.> to be fair im probably one of the youngest in the server so it might just be me
17:28:19FromDiscord<Quibono> _cries in mid 20s_
17:28:24FromDiscord<shadow.> seems nim has a different audience then something such as python where it's just a clan of 12 year olds trying to code sneaker bots
17:28:34FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2H2W
17:28:39FromDiscord<Quibono> Wait, does this mean shadow. Is the future? 😮
17:28:52disruptekshhh, you'll make avatarfighter blush.
17:29:23FromDiscord<shadow.> lmfao
17:29:44FromDiscord<shadow.> well yes there's the . trick but that's no fun
17:29:59*hmmmmm quit (Quit: brb)
17:30:39disrupteki bet there actually are a ton of kids trying to deal in supreme.
17:30:58disrupteki just have a feeling it's a bigger market than you might think.
17:31:12FromDiscord<Quibono> I’ve got a brilliant idea, we should sponsor coding camps for kids in Nim, grow the audience from below
17:31:29FromDiscord<Quibono> Quick, what game are the youngins playing?
17:31:29disrupteki'm thinking about teaching at a local school.
17:31:33FromDiscord<Quibono> We must make mods
17:31:53FromDiscord<Quibono> Disruptek permission to take the piss?
17:31:54FromDiscord<shadow.> disruptek you do realize i could name at least 5 people i know that try to bot supreme
17:31:55FromDiscord<shadow.> it's quite sad
17:32:04FromDiscord<shadow.> they're like "ayo you know how to use that selenium shit bruh?"
17:32:05FromDiscord<shadow.> ...
17:32:07FromDiscord<shadow.> LMAO
17:32:14disrupteki mean, fighter wanted me to code on his bot.
17:32:24FromDiscord<shadow.> ah
17:32:26disrupteki was like, "no dough, no go."
17:32:44FromDiscord<Quibono> What is this supreme?
17:32:47disruptekyeah.
17:32:51FromDiscord<Esbeesy> https://play.nim-lang.org/#ix=2H2Y↵↵Improved readability a little
17:32:58FromDiscord<Esbeesy> 😂
17:33:09FromDiscord<Quibono> Also disruptek I’m surprised they let you in schools irl. 😮
17:33:22disruptekwell, i will be changing my identity again.
17:33:24FromDiscord<Esbeesy> .. Fortnim?
17:33:32disruptekshould be pretty clean this time.
17:33:45FromDiscord<Quibono> ... @Esbeesy I feel like if I get the joke it’s too old
17:33:48disrupteki've learned a lot since i starting this gig.
17:34:13*vicfred joined #nim
17:34:30FromDiscord<haxscramper> Need to repost this in telegram channel, they just recently had some go/nim discussion
17:35:04disruptekfor i in a ..< b: ...
17:35:38disruptekyou could at least use it in the iterator, yeesh.
17:36:05FromDiscord<Esbeesy> All in good spirits I hope, Go community is generally quite welcoming. Unlike a certain other community when you mention Go... _cough🦀cough_
17:36:17FromDiscord<shadow.> lmfao
17:36:26FromDiscord<Quibono> I want to like Go so badly, I just can’t read the syntax.
17:36:50disrupteki like purposeful design of the language but i have no use for it anymore.
17:36:57FromDiscord<shadow.> fair enough
17:37:01FromDiscord<Esbeesy> That's interesting - It's designed exactly for that purpose 😂
17:37:03FromDiscord<shadow.> yeah the syntax is kinda ugly and i dont see the use cases above nim
17:38:06FromDiscord<Quibono> Well I’m dyslexic af so that might be why, like I try to read C code and I’m just like wrf
17:38:17FromDiscord<Esbeesy> I like it because it stops my colleagues from being absolute 🔔 🔚 s
17:38:20disrupteki understand the argument against generics, for them, but i wonder how they are going about adding them. so to speak.
17:38:41disrupteklike are generics a rewrite implementation or what?
17:39:07disruptekanyone know?
17:39:24FromDiscord<Esbeesy> What do you mean by rewrite implementation?
17:39:44FromDiscord<shadow.> c is...interestnig
17:39:46disrupteklike do they just rewrite generics into existing code semantics.
17:39:48FromDiscord<shadow.> interesting
17:40:15FromDiscord<Esbeesy> Yeah the current draft is backwards compat + they're going to migrate the stdlib to it
17:40:28disruptekoh that's neat.
17:40:46FromDiscord<Esbeesy> Coming from C# I was dead against generics in Go but the design they're going with currently is actually just right. I implemented Erlang's set library using them and it was excellent
17:41:01disrupteki guess it's sorta like our <\\> operator.
17:41:08FromDiscord<Esbeesy> Wtf is that
17:41:20disruptek`owned`
17:41:22FromDiscord<Esbeesy> More god tier Nim shit that's going to solve all of my problems, no doubt
17:41:57FromDiscord<shadow.> idk i dont like the limits of the go stl
17:42:04FromDiscord<shadow.> it was quite small and kinda meh imo
17:42:07FromDiscord<shadow.> but still an interesting language
17:42:19FromDiscord<Quibono> I just want goroutines.
17:42:25FromDiscord<Esbeesy> THIS ^
17:42:32FromDiscord<Esbeesy> The one thing I miss in Nim, is go routines
17:42:41FromDiscord<shadow.> lmao fair enough
17:42:45disruptek!repo cps
17:42:46disbothttps://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 40⭐ 2🍴
17:42:56disruptekthis is the basis for goroutines in nim.
17:42:58FromDiscord<Esbeesy> Isn't CPS the foundation of CSP
17:43:00FromDiscord<Esbeesy> YEah
17:43:24FromDiscord<Quibono> Lol so when will I have my nimroutines Dis?
17:43:46disrupteki dunno, i should probably be working on it right now, but i'm trying to find a job instead.
17:43:56FromDiscord<Quibono> Lol fair.
17:44:02disruptekit's pretty cold here and i'm hungry af.
17:44:42FromDiscord<InventorMatt> is there a less dumb way to do this https://play.nim-lang.org/#ix=2H36 ?
17:45:17disruptekthat's actually pretty cute.
17:45:35disrupteki mean, it's like you're writing c here.
17:45:53FromDiscord<Quibono> Wait wait I think I know
17:46:03disruptekyou can just use a template.
17:46:05*Vladar joined #nim
17:46:56FromDiscord<shadow.> true
17:47:29FromDiscord<Quibono> Couldn’t you just do for x in a..e?
17:48:21FromDiscord<shadow.> well they want addresses
17:48:35FromDiscord<InventorMatt> i don't think you can iterate through variables like that
17:48:46FromDiscord<shadow.> yeah no lmao
17:48:53FromDiscord<shadow.> that's only for slices
17:48:57FromDiscord<shadow.> won't work for variable names
17:49:13FromDiscord<shadow.> but yeah you could do like
17:49:18FromDiscord<shadow.> lemme whip something up
17:50:47FromDiscord<Quibono> Why not make a seq of vars then?
17:50:57FromDiscord<shadow.> well i think he wants to do dynamic variable names
17:51:01FromDiscord<shadow.> idk why you wouldn't just use a table
17:51:40FromDiscord<Quibono> Like make it a seq and then do map...
17:51:41FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H3c
17:51:44FromDiscord<shadow.> that can be used for dynamics if you want
17:51:54FromDiscord<shadow.> but i don't recommend it?
17:52:14FromDiscord<InventorMatt> i was transposing the code and when I got to the end they did something like that and I didn't want to have to redo all of that
17:52:39FromDiscord<shadow.> ahh
17:52:40FromDiscord<shadow.> i see
17:53:28FromDiscord<shadow.> i mean yeah you could do like
17:54:05FromDiscord<shadow.> soemthing like that
17:54:06FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H3d
17:54:13FromDiscord<shadow.> lmao
17:54:24FromDiscord<shadow.> again, wouldn't recommend it but that should work
17:54:41FromDiscord<shadow.> wait
17:54:44FromDiscord<shadow.> you need the addr thing one sec
17:54:52FromDiscord<shadow.> maybe?
17:54:53FromDiscord<shadow.> (edit) "https://play.nim-lang.org/#ix=2H3d" => "https://play.nim-lang.org/#ix=2H3e"
17:54:57FromDiscord<InventorMatt> the variables in the code I have are much more varied than 'a'..'b' that was just an example
17:55:01FromDiscord<shadow.> ohhh
17:55:04FromDiscord<shadow.> so then what do you need
17:55:16FromDiscord<shadow.> retrieving the value of a var by its name in a string? or
17:55:19FromDiscord<shadow.> a list of variables
17:55:23FromDiscord<shadow.> and incrementing them all
17:55:24FromDiscord<shadow.> by 5?
17:55:26FromDiscord<Quibono> So again why can’t you add the variables to a sequence when you use them?
17:55:48disruptekactually, keeping a const seq of the variables makes a lot of sense to me.
17:56:05disruptekor just an array, really.
17:56:30FromDiscord<Quibono> Wait something I said made some sense?
17:56:35FromDiscord<Quibono> Dafuq?
17:56:41FromDiscord<InventorMatt> I can It's just not worth it to redo the code as it is when this is just a stepping stone of code for a full rewrite I just wanted to test the translation to nim first
17:56:44Zevvdisruptek is trying to make you feel good. he does that occasionaly
17:57:23disruptekwell, think about how the template writes it. could it really be faster than a static array of the exact values you need, one after another in memory?
17:57:30FromDiscord<Quibono> Then why do I feel unclean?
17:57:36FromDiscord<shadow.> hmm
17:57:37disruptekit might all come out in the wash.
17:57:51FromDiscord<shadow.> because when disruptek gives a compliment it's kind of like a thief putting a gold bar in your hand
17:57:53FromDiscord<shadow.> can't be legitimate
17:57:59FromDiscord<ache of head> XDDDD
17:58:00disrupteklol
17:58:30FromDiscord<shadow.> well
17:58:32FromDiscord<shadow.> unless it's too himself
17:58:37FromDiscord<shadow.> then it is very much legitimate
17:58:43FromDiscord<shadow.> to
17:58:45FromDiscord<exelotl> I was hoping this would work: https://play.nim-lang.org/#ix=2H3g
17:58:59FromDiscord<shadow.> well
17:58:59FromDiscord<exelotl> not sure if it's supposed to or not
17:58:59disrupteki /do/ love my big penis.
17:59:07FromDiscord<shadow.> you're modifying the items in the array
17:59:13FromDiscord<shadow.> but since you're copying them into the array by value
17:59:16FromDiscord<shadow.> you're not modifying the variables
17:59:22FromDiscord<shadow.> since there's no pointers iirc
18:00:00FromDiscord<exelotl> it's an array of `var int` which as I understand should be hidden pointers to ints
18:00:20FromDiscord<shadow.> also use `arr.mitems` or disruptek's ufcs guide will bite you
18:00:26FromDiscord<shadow.> ohhh var int
18:00:27FromDiscord<shadow.> hmm
18:00:49FromDiscord<shadow.> not sure you can do that
18:00:52disruptekyeah, you don't want to run counter to disrupstyle.
18:00:59FromDiscord<shadow.> nope
18:01:08*thomasross joined #nim
18:01:42FromDiscord<exelotl> @shadow. here's the page on it, but it's still rather experimental https://nim-lang.github.io/Nim/manual_experimental.html#view-types
18:02:00FromDiscord<shadow.> lemme take a look
18:02:08FromDiscord<exelotl> so maybe it's supposed to work in the future but just doesn't right now
18:02:14FromDiscord<shadow.> oh i know what the `var T` tyep is
18:02:22FromDiscord<shadow.> i just think like
18:02:48FromDiscord<shadow.> maybe once you put them into the `[a, b, c, d, e]` they're copied by value and maybe those `var` refs are just references to the items in the array and not the actual vars? i've no idea tbh
18:02:59FromDiscord<shadow.> something's being lost in the array definition
18:03:56FromDiscord<treeform> In a macro, how does one know if current symbol refers to a global variable, or to a local variable? Is there a way to get symbols scope?
18:04:10disruptekdeclaredInScope()
18:04:19FromDiscord<shadow.> spicy
18:04:50FromDiscord<treeform> on its in system module
18:04:50FromDiscord<exelotl> @shadow. note: I'm not sure how you can take a mutable view to anything at the moment, even this simple example segfaults https://play.nim-lang.org/#ix=2H3k
18:04:51disruptekbut you can't, like, query the scope and fetch it as a table or something.
18:04:58FromDiscord<exelotl> but I'm really hoping it will work in the future
18:05:14disruptekwere you the one that asked about it yesterday?
18:05:15FromDiscord<shadow.> hmm
18:05:23disruptekoh, i think it was deech.
18:05:23FromDiscord<shadow.> i mean how does it work when you accept arg as `var T` in a proc?
18:05:25FromDiscord<shadow.> is it any different
18:05:39disruptekdifferent than what?
18:05:45FromDiscord<shadow.> than by assignment
18:05:47disrupteki think the answer is, "no."
18:05:54FromDiscord<shadow.> then why does the assignment one fail?
18:06:01disruptekwhat do you mean?
18:06:14FromDiscord<shadow.> in exelotl's example
18:06:21FromDiscord<exelotl> `var T` in a function parameter is always passed as a hidden pointer - that feature has been in the language for a long time and it works great
18:06:21disruptekoh, i didn't read the code.
18:06:28FromDiscord<shadow.> ohh right
18:06:32FromDiscord<treeform> declaredInScope does not help me... always returns false
18:06:42FromDiscord<exelotl> but first-class `var T` is a new thing
18:06:45FromDiscord<shadow.> ohh
18:06:49FromDiscord<shadow.> hmm
18:07:12FromDiscord<shadow.> yeah i would assume if it doesn't raise an error when you specify type as mutable view then it's doing it correctly
18:07:18FromDiscord<shadow.> so idk why the nil read error is still happening then
18:07:19FromDiscord<treeform> i'll ask on the forums
18:07:23disruptektreeform: are you saying it doesn't do what it's supposed to?
18:07:47disrupteki don't know anything about views yet.
18:07:52disrupteki haven't messed with them.
18:08:39FromDiscord<shadow.> ah rip
18:09:06disrupteki should probably just deprecate support for earlier nims in all my stuff.
18:09:22ZevvI think so to
18:09:23Zevvo
18:09:44Zevvno one particulary cares for 1.0 in practice
18:09:57disrupteklike, i'll put in a requirement for the nim version and then tag it and bag it.
18:10:12disruptekjust live at head and anyone using old software... can use old software.
18:10:28disruptekmakes a ton of sense.
18:10:29Zevvthat's what I do.
18:10:36Zevvevery now and then I get a complaint
18:10:39Zevvand then I fix it
18:10:43Zevvbut I'm checkinf myself
18:10:50disrupteki'm a developer. i should just develop and leave tags as artifacts.
18:10:57Zevvif no one is complaining, no one is using my stuff with old versions
18:11:01disruptekpeople can always fork if they need to.
18:11:16disruptekoh, you do the testing yourself?
18:11:28Zevvhardly
18:11:38disruptekbut that makes a lot of sense, too.
18:12:07Zevvthe good thing is: I have zero bugs found or reported in NPeg up to now
18:12:16FromDiscord<shadow.> damn
18:12:17disruptekhmm, i think what i want is "tests pass if head passes; the rest are mearly advisory."
18:12:26disruptekmerely, too.
18:12:28FromDiscord<shadow.> time to go find a bug in npeg
18:12:38ZevvI'm a one trick pony
18:12:42disruptekZevv: zero bugs? wow.
18:12:43Zevvbetter make it a good trick
18:13:09disruptekyou make me want to compete but i don't believe it's efficient to do so.
18:13:15FromDiscord<treeform> disruptek, I don't think I can use this one. It takes an unypted but I have NimNode.
18:13:33disruptektreeform: use it in the code you generate, no?
18:13:35FromDiscord<treeform> NimNode kind Symbol.
18:14:55FromDiscord<treeform> https://forum.nim-lang.org/t/7221#45607
18:16:10ForumUpdaterBotNew thread by Treeform: In macros, is there a way to know if a symbol as global?, see https://forum.nim-lang.org/t/7221
18:19:05disruptektreeform: if you want to know if it's global, look at what declaredInScope does. .global is something you could check for.
18:20:00FromDiscord<treeform> DeclaredInScope is magic ... never can find how magic is done...
18:20:19disruptekmostly waving of hands and deep-throated utterance.
18:20:48disrupteki do this thing with my fingers that i've been told is quite magical.
18:21:02PrestigeIs there interop with c++, or only c?
18:21:07disruptekyes.
18:21:11FromDiscord<treeform> yes c++
18:21:18PrestigeCool, ty
18:21:28FromDiscord<treeform> https://github.com/nim-lang/Nim/search?q=DeclaredInScope&type=code how do I find magic implantation?
18:21:44disruptekwe don't use that word.
18:23:04disrupteksee ~line 1905 in semexprs.nim; semDeclared()
18:24:03FromDiscord<treeform> thanks, this looks like more of what I need
18:24:06FromDiscord<Vindaar> and in general look at the string in the source file and add a `m` to the front. Should give you something to grep for: https://github.com/nim-lang/Nim/blob/devel/compiler/semexprs.nim#L2208
18:24:37FromDiscord<treeform> thanks I did not know about the m-trick.
18:25:28FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H3p
18:25:32FromDiscord<shadow.> this is for aoc day 2
18:25:43FromDiscord<shadow.> nvm its gonna be hard to explain without sending my input ill figure it out lmao
18:30:10*luismanfroni joined #nim
18:45:31ZevvYou match one single digit
18:45:48Zevvso numbers with more then one digit do not match
18:45:50ZevvMake that >+Digit
18:45:51FromDiscord<shadow.> oh shoot
18:45:52FromDiscord<shadow.> thanks
18:46:00FromDiscord<shadow.> i forgot there were digits over 10 in that one ll
18:46:01Zevvrun with `-d:npegTrace` to see how it eats your data
18:46:03FromDiscord<shadow.> lol
18:46:09FromDiscord<shadow.> oh ty
18:46:40Zevvalso, when posting on the playground, dump complete running programs
18:46:41Zevvthat helps
18:47:22FromDiscord<shadow.> kk
18:47:24FromDiscord<shadow.> i will
18:55:52FromDiscord<Sendell> Hey guys, small question: how to get rid of a "locks: <unknown>" attached to a proc ?
18:57:17FromDiscord<Sendell> not doing anything special in that proc, but since it has "unknown" instead of "0" it's not considered the same type as other procs I want to it with
18:58:49FromDiscord<Sendell> is it safe to just force it with {. locks:0.} ?
18:59:19disruptekyes.
19:02:53leorize[m]1it doesn't really matter 99% of the time
19:05:12FromDiscord<Avatarfighter> hacktoberfest outdid themselves this year
19:05:16FromDiscord<Avatarfighter> the shirts are actually comfy
19:08:31FromDiscord<shadow.> my friend said the same thing lol
19:08:44FromDiscord<Sendell> ok thx guys 🙂
19:09:17FromDiscord<Idefau> i didnt even claim my hacktoberfest prize
19:09:27FromDiscord<Idefau> chaotic evil
19:10:45FromDiscord<Avatarfighter> chaotic neutral
19:11:18FromDiscord<Idefau> i wanted to claim it
19:11:20FromDiscord<Idefau> but i forgot
19:11:23FromDiscord<Idefau> until it was too late
19:11:26FromDiscord<Gibson> hi
19:11:49FromDiscord<Gibson> is there a way to pass a nim procedure as a function pointer to c code?
19:15:38FromDiscord<sealmove> probably stupid question but what if you have a `set` of an object type (it happens to be an object variant)
19:15:41FromDiscord<sealmove> how would it work?
19:16:14FromDiscord<sealmove> should I keep a set of the variant enum and the object separately?
19:16:24FromDiscord<sealmove> objects
19:17:31FromDiscord<Gibson> sent a code paste, see https://play.nim-lang.org/#ix=2H3J
19:18:08*luismanfroni quit (Remote host closed the connection)
19:18:22FromDiscord<shadow.> any reason you cant pass the actual object?
19:18:24FromDiscord<haxscramper> @Gibson you need to use `{.cdecl.}` calling convention for a functions that you will be passing to C code,
19:18:25FromDiscord<shadow.> nvm c function
19:18:30FromDiscord<shadow.> lol
19:18:32*luismanfroni joined #nim
19:20:03FromDiscord<haxscramper> And then your wrapped code should have something like `cProccWithCallback(callback: proc() {.cdecl.})`
19:20:12*hmmm joined #nim
19:21:07*habamax quit (Quit: leaving)
19:22:28FromDiscord<haxscramper> You want to use a set (multiple enum values) for single object branch?
19:22:31FromDiscord<Gibson> ah ok
19:22:33FromDiscord<haxscramper> Or something else
19:22:38FromDiscord<sealmove> oh, Nim doesn't even allow you to have a set of object, it must be an ordinal
19:22:42FromDiscord<Gibson> is that the right way to assign a function pointer?
19:22:46FromGitter<iffy> Trying to track down a bug in sdl2/opengl/x11 on Linux and I don't know where the problem is. Running `nim check` shows no problems on macOS and Windows but shows numerous errors with `--os:linux` (as shown): https://play.nim-lang.org/#ix=2H3K
19:23:15disrupteksealmove: use a hashset.
19:23:22FromDiscord<sealmove> I was going for something like this https://play.nim-lang.org/#ix=2H3O
19:23:22FromDiscord<Gibson> sent a code paste, see https://play.nim-lang.org/#ix=2H3P
19:23:28FromDiscord<sealmove> yeah hashset sounds right
19:24:49FromGitter<iffy> I'm happy to file a bug or even fix it... but I don't know where to start. Seems like maybe it's in the x11 lib?
19:24:51*haxscramper joined #nim
19:25:18FromDiscord<sealmove> wait, why does `HashSet` only take 1 type parameter?
19:25:44*sagax joined #nim
19:26:36narimiranwhat would be the other?
19:26:50FromDiscord<sealmove> one for key type and one for value type?
19:27:35Araqit's a *set*
19:27:45Araqnot a *table*
19:27:54Araqwe have these as well
19:28:26FromDiscord<sealmove> right, so how would it work with non-ordinal types? how does it know if it should replace or add new entry?
19:28:59FromDiscord<InventorMatt> the object you are using for the hashset should have a unique hash for it
19:29:06FromDiscord<InventorMatt> that decides that
19:29:25disruptekiffy: it looks like your version is not in sync with the wrapper.
19:29:37FromDiscord<Gibson> sent a code paste, see https://play.nim-lang.org/#ix=2H3T
19:30:07FromGitter<iffy> disruptek: version of X11? or opengl?
19:30:12FromDiscord<sealmove> @InventorMatt ok sounds good, in Java you would override some `hash` method for this, how do you do it in Nim?
19:32:10FromDiscord<shadow.> wdym
19:32:17FromDiscord<shadow.> most builtins work with hash sets
19:32:20FromDiscord<shadow.> if not you can use the hashes lib
19:32:32FromDiscord<sealmove> yeah I want it for custom object
19:32:39FromGitter<iffy> I've reduced it to this `nim check --os:linux`: ⏎ ⏎ ```import opengl ⏎ discard glSetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1)``` [https://gitter.im/nim-lang/Nim?at=5fce8357fb7f155587ae330a]
19:32:44FromDiscord<shadow.> try it and see if it compiles then
19:32:59FromDiscord<shadow.> if it doesn't use this https://nim-lang.org/docs/hashes.html
19:33:08FromDiscord<sealmove> thx
19:33:32FromDiscord<shadow.> np
19:33:55FromDiscord<Recruit_main707> @Gibson you can do it without ptr: https://play.nim-lang.org/#ix=2H3V
19:34:11FromDiscord<Vindaar> @sealmove an example for a variant object: https://github.com/Vindaar/ggplotnim/blob/master/src/ggplotnim/dataframe/value.nim#L508-L524
19:34:32FromDiscord<sealmove> nice, that's exactly what I am trying to do
19:35:58FromDiscord<sealmove> wait, you just define the hash proc and Nim automatically knows to apply it to your HashSet?
19:36:03FromDiscord<Gibson> yeah, can't be passed to a c function that takes a `pointer` then though
19:36:06FromDiscord<sealmove> you don't have to pass the proc somewhere?
19:36:34FromDiscord<Vindaar> nope, as long as the `hash` proc is defined in the scope you want to use the `HashSet` or `Table` it's all that's needed
19:36:43FromDiscord<sealmove> wow that's magic
19:38:56FromDiscord<shadow.> well, it's a generic
19:38:59FromDiscord<shadow.> but close enough
19:38:59FromDiscord<shadow.> :)
19:40:02FromDiscord<shadow.> what language do you come from? i'd assume most high-level languages have something similar to this
19:40:13FromDiscord<shadow.> where a function uses an object's method in a generic
19:40:27hmmmdudes I'm trying to pack a png in my precious gui app exe, are we sure I need to use slurp() I get a bunch of garbled nonsense :|
19:40:51FromDiscord<shadow.> slurp() is a compile-time file read
19:40:58FromDiscord<shadow.> is that what you need?
19:41:04FromDiscord<shadow.> if not then no
19:41:15hmmmI don't know, I need to have my image inside the exe so I don't need to ship it around
19:41:20FromDiscord<shadow.> i mean
19:41:29FromDiscord<shadow.> im fairly certain slurp() returns a string
19:41:32FromDiscord<shadow.> how do you want the image stored
19:41:36hmmmI'm noticing :o
19:41:39FromDiscord<sealmove> @shadow. I've only done such things in Java
19:41:39FromDiscord<shadow.> seq[seq[uint24]]?
19:41:42FromDiscord<shadow.> ohh i see
19:41:49FromDiscord<shadow.> wait of all languages i'd assume java is fairly generic-heavy lmao
19:42:00FromDiscord<ElegantBeef> slurp returns a string, as that's a binary stream
19:42:12FromDiscord<shadow.> hmmm: what data type do you need the image as
19:42:33hmmmshadow it's a png and needs to stay like that, I just want it embedded in the exe :o
19:42:41FromDiscord<shadow.> "png" is not a nim data type
19:42:44FromDiscord<sealmove> Java has same feature but you need to override the hash method in your class, so it's obvious how it knows where to apply it.
19:42:52FromDiscord<ElegantBeef> So then load it as a const then convert it to a png on start
19:42:54hmmmoh
19:42:58hmmmhmm
19:42:59FromDiscord<shadow.> yup
19:43:11FromDiscord<shadow.> how is this png represented in your code
19:43:15FromDiscord<shadow.> can you send that code?
19:43:19hmmmI think bitmap
19:43:28FromDiscord<shadow.> so a matrix of uint32?
19:43:38FromDiscord<ElegantBeef> I mean typically you're going to have a `toImage` or `fromFile` which returns the png
19:43:51FromDiscord<ElegantBeef> (edit) "I mean typically you're going to have a `toImage` or `fromFile` which returns the ... png" added "parsed"
19:44:04FromDiscord<shadow.> hmmm: can you echo the type of the "png" variable when you don't slurp it?
19:44:09FromDiscord<shadow.> however you were doing it that was working before
19:44:20FromDiscord<shadow.> or rather how were you getting the png before
19:44:32hmmmhmm actually I don't know what happens behind the scenes I just feed my png to loadFromFile("gorilla.png") and it does some magick :o
19:44:34FromDiscord<ElegantBeef> Well just look at how you were doing it before, see which proc your used and see if it has any overrides for raw data
19:44:40hmmmin nigui
19:44:41FromDiscord<shadow.> there we go
19:44:49FromDiscord<shadow.> and that function doesn't work compile time im guessing
19:45:01FromDiscord<lqdev> seq[seq[T]] for storing images is a sin against humanity.
19:45:02hmmm:o
19:45:06FromDiscord<shadow.> @lqdev how dare you
19:45:12FromDiscord<shadow.> smh
19:45:21FromDiscord<lqdev> imagine cache efficiency
19:45:22FromDiscord<shadow.> in all seriousness, what would you prefer?
19:45:26FromDiscord<lqdev> now imagine using nested seqs
19:45:28FromDiscord<ElegantBeef> nigui seems to only have loadfromfile 😦
19:45:32FromDiscord<sealmove> doesn't work as expected :/ https://play.nim-lang.org/#ix=2H40
19:45:34FromDiscord<shadow.> weird
19:45:38FromDiscord<shadow.> well look at how nigui loads the data
19:45:40FromDiscord<shadow.> then make your own proc
19:45:43FromDiscord<shadow.> lmao
19:45:56FromDiscord<shadow.> im going to assume that loadFromFile() doesnt work compile-time?
19:46:01FromDiscord<lqdev> hmmm you can always write to a temp file and load from that if your lib doesn't let you load files from mem directly
19:46:14FromDiscord<ElegantBeef> I mean certainly not, it relies on gtk stuff
19:46:18FromDiscord<shadow.> ahh ok
19:46:38FromDiscord<shadow.> how big is that function hmmm
19:46:40FromDiscord<ElegantBeef> Yea do what lqdev says make a mmap file then use that to load the image
19:46:46FromDiscord<ElegantBeef> It's only like 10 lines
19:46:56FromDiscord<shadow.> hmm
19:47:05FromDiscord<ElegantBeef> But you need one for windows and one for gtk
19:47:09FromDiscord<ElegantBeef> https://github.com/trustable-code/NiGui/blob/e5c4ca054f4e285dd5f78babd14735624a8407f0/src/nigui/private/gtk3/platform_impl.nim#L712
19:47:10FromDiscord<shadow.> ah
19:47:28FromDiscord<ElegantBeef> https://github.com/trustable-code/NiGui/blob/e5c4ca054f4e285dd5f78babd14735624a8407f0/src/nigui/private/windows/platform_impl.nim#L800
19:48:24FromDiscord<ElegantBeef> The making a temp file is the easier option since you can make a mmap file in all of .2 seconds 😄
19:49:02FromDiscord<Recruit_main707> @Gibson pretty sure proc is already considered a function pointer when its a type
19:49:15hmmmBeefy i'll try just that, never tried before so it will take some years, I'll be sure to report back :o
19:52:04FromDiscord<sealmove> hum why doesn't this work? https://play.nim-lang.org/#ix=2H40
19:53:03FromGitter<iffy> Hmm... it seems to be a problem with running `nim check --os:linux` on macOS. When I run `nim check` or `nim c` on an actual Linux box, everything is fine. Is that a bug in `nim check`?
19:53:52leorize[m]1what's the error?
19:54:08FromGitter<iffy> leorize: https://play.nim-lang.org/#ix=2H3K
19:57:33FromDiscord<Vindaar> @sealmove because you're allowed to have hash collisions iiuc. Define an equality operator in addition: https://play.nim-lang.org/#ix=2H46 Using the default equality operation these objects are different. I think that's why
19:57:49*Vladar quit (Quit: Leaving)
19:58:22FromDiscord<sealmove> oh great thx. so could it be that I don't `hash` at all?
19:58:51FromDiscord<Vindaar> well you certainly hash, otherwise you couldn't use the `HashSet`
19:59:03FromDiscord<Vindaar> but a hash is not a measure for equality
19:59:33FromDiscord<sealmove> hmm, i see, thanks again
19:59:43FromDiscord<Vindaar> no worries
20:03:04leorize[m]1@iffy yea it looks like a bug but I don't have a mac here to test
20:09:38*luismanfroni quit (Remote host closed the connection)
20:09:58*luismanfroni joined #nim
20:10:11FromDiscord<sealmove> oh ok now I understand `hash`. `equal` only applies to object with same hash.
20:10:22FromDiscord<sealmove> objects
20:13:55*vsantana joined #nim
20:14:18FromDiscord<sealmove> so to be equal 2 objects must produce same hash _and_ `==` must return true.
20:17:23*siulManfroni joined #nim
20:18:10*luismanfroni quit (Remote host closed the connection)
20:18:31ForumUpdaterBotNew thread by Stefan_Salewski: When (compiles do: import a): is very broken, see https://forum.nim-lang.org/t/7222
20:20:49hmmmhmm interesting
20:20:54*xet7 quit (Ping timeout: 272 seconds)
20:21:03hmmmhow does nim know I want the open from memfiles and not the normal open()?
20:21:28*xet7 joined #nim
20:21:29*spiderstew quit (Quit: Konversation terminated!)
20:21:38hmmmit must be some kind of magick I'm sure
20:22:20*spiderstew joined #nim
20:22:47*xet7 quit (Remote host closed the connection)
20:23:10*xet7 joined #nim
20:24:17FromGitter<bung87> you may want two programs share same memfiles
20:25:33*vsantana quit (Quit: Leaving.)
20:26:37*^Q-Master^ quit (Ping timeout: 260 seconds)
20:27:55FromDiscord<Gibson> ahh, got it figured out
20:28:03FromDiscord<Gibson> i was allocating memory in the wrong way
20:32:00FromGitter<bung87> zevv how to detect capture length and get capture in group after `:` in npeg
20:34:04*narimiran quit (Ping timeout: 260 seconds)
20:36:37FromDiscord<shadow.> i mean if you're capturing into a group like $1 you can always do `($1).len`
20:36:49FromDiscord<shadow.> in the block below
20:37:47FromGitter<bung87> I wanna know captures.len
20:38:35FromGitter<bung87> I have a group that contains capture and that group is optional
20:38:58FromDiscord<shadow.> send your code
20:40:42FromGitter<bung87> https://play.nim-lang.org/#ix=2H4r
20:41:09reversem3If I have a huge file of strings (1 per line) all numbers. I want to find the amount the total amount of strings in that file. I did a readAll then a for loop then a len(readAll) but got some weird length
20:41:29FromDiscord<shadow.> you wanna get the length of mime?
20:41:38FromDiscord<shadow.> im confused
20:41:50FromGitter<bung87> no , I wanna see if there is number
20:42:12reversem3like how wc -l gets a length of how many lines there are
20:42:29FromDiscord<shadow.> ah i see
20:42:32FromDiscord<shadow.> i mean
20:42:35FromGitter<bung87> and that code currently only one capture, so I can't get number and check there there's number
20:42:46FromDiscord<shadow.> you can check if `$2` raises an NPegException
20:43:50FromGitter<bung87> hmm, that's a workaround, yeah should work
20:44:46FromDiscord<shadow.> ye
20:45:08FromDiscord<shadow.> i mean with what's given that's all i can think of
20:46:56FromGitter<bung87> I dont know whether npeg has some like captures.len can be use there.
20:48:02FromGitter<bung87> still a powerful tool, fews lines do work same as my 100 lines parser..
20:50:13FromDiscord<shadow.> >"Because friends don't let friends write parsers by hand"
20:50:18FromDiscord<shadow.> (edit) ">"Because" => "> "Because"
20:52:18FromGitter<bung87> wait , after I do try catch there, .captures() all empty
20:53:32*Q-Master joined #nim
20:54:51FromGitter<bung87> nvm
20:55:58*spiderstew quit (Quit: Konversation terminated!)
20:56:57*spiderstew joined #nim
21:08:14*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
21:10:20*ehmry joined #nim
21:10:26*PMunch joined #nim
21:16:45FromDiscord<sealmove> `captures().len`?
21:18:39FromDiscord<sealmove> "When a grammar rule ends with a colon :, the next indented block in the grammar is interpreted as Nim code, which gets executed when the rule has been matched. Any string captures that were made inside the rule are available to the Nim code in the injected variable capture[] of type seq[Capture]:
21:19:14FromDiscord<sealmove> So `capture.len` I guess.
21:20:28FromDiscord<shadow.> yes
21:20:30FromDiscord<sealmove> @bung87 (in case you didn't find it yet)
21:20:31FromDiscord<shadow.> wait
21:20:45FromDiscord<shadow.> captures?
21:20:50FromDiscord<shadow.> lemme look at ur code
21:20:54FromDiscord<sealmove> `capture` not `captures`
21:21:05FromDiscord<shadow.> where is capture defined?
21:21:10FromDiscord<sealmove> in npeg
21:21:12FromDiscord<shadow.> oh wait
21:21:13FromDiscord<shadow.> are you saying
21:21:14FromDiscord<sealmove> it's injected automatically
21:21:16FromDiscord<shadow.> the match object?
21:21:17FromDiscord<shadow.> or
21:21:18FromDiscord<shadow.> oh
21:21:23FromDiscord<sealmove> $1 is syntax sugar for it
21:21:28FromDiscord<shadow.> ah yeah thats what i use
21:25:54*haxscramper quit (Remote host closed the connection)
21:47:23*tane joined #nim
21:52:19*VijayMarupudi[m] joined #nim
22:02:43*fowl quit (*.net *.split)
22:02:43*clemens3 quit (*.net *.split)
22:04:01*pbb quit (Ping timeout: 272 seconds)
22:05:37*luis1 quit (Quit: WeeChat 2.9)
22:06:00*pbb joined #nim
22:11:02*clemens3 joined #nim
22:15:05*mbomba joined #nim
22:15:37FromDiscord<shadow.> hola
22:17:45FromDiscord<shadow.> i know peg's aren't a nim-specific concept, but why are they less prevalent in other languages?
22:17:53*PMunch quit (Quit: leaving)
22:17:54FromDiscord<shadow.> is it because nim has macros so it's easier to implement ?
22:29:11*tane quit (Quit: Leaving)
22:30:58*fowl joined #nim
22:36:40miprithey're just new.
22:37:00miprirelatively speaking. D has a good library as well, and Rust has one that's probably good.
22:37:16FromDiscord<shadow.> ahh i see
22:37:28FromDiscord<shadow.> well i certainly think this is the cleanest way i've found to parse thus far lol
22:37:39*siulManfroni quit (Remote host closed the connection)
22:37:42FromDiscord<shadow.> i suppose i was always too lazy to learn anything other than regex and scanf
22:38:21disrupteknim is well-suited to dsls and dsls are well-suited to pegs libraries.
22:39:59FromDiscord<shadow.> fair enough
23:14:35*hmmm quit ()
23:31:35FromDiscord<shadow.> does anyone know if this https://github.com/alehander92/comprehension package still works?
23:31:43FromDiscord<shadow.> doesn't seem to work for me
23:35:59mipriit passes its tests.
23:36:07mipriwhat are you doing that doesn't work?
23:37:02FromDiscord<shadow.> lemme write some example code one sec
23:37:06miprievery single example is a comprehension over a table, mind. not one seq[T]
23:37:13FromDiscord<shadow.> yeah seq comprehension
23:37:28mipriit says "seq comprehension" but it's used with a table. it produces a seq
23:37:49FromDiscord<shadow.> odd
23:38:02FromDiscord<shadow.> it can't be used with a seq as the iterable?
23:38:18miprisimple test fails for me, and again every single example and test is with a table
23:38:46FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/785651543810637834/unknown.png
23:38:46FromDiscord<shadow.> yeah
23:38:48FromDiscord<shadow.> let me try with a table
23:39:32FromDiscord<shadow.> lmao it works when you're iterating over a table, but not a seq
23:39:34FromDiscord<shadow.> interesting
23:40:37FromDiscord<shadow.> i guess that's all it was made for i suppose
23:40:44FromDiscord<shadow.> fair enough ill make my own
23:45:55FromDiscord<dorei> how stable is nim? i mean, if start learning it, will the language change in a few months?
23:46:05FromDiscord<dorei> stable is not the right word i guess
23:48:26FromDiscord<shadow.> quite stable
23:48:33FromDiscord<shadow.> one sec
23:48:45FromDiscord<shadow.> > How stable is Nim?↵> ↵> The compiler and stdlib are actively under development and have a suite of test cases to ensure ongoing stability. Regular releases are posted every three to six months that can be used as a base for projects requiring a stable foundation. Breaking changes are rare but are documented in detail and can typically be managed with minimal effort. The compiler also highlights deprecated features to provide suffi
23:48:55mipriit has a 1.x version number and a compiler flag to emulate 1.0 exactly.
23:49:45FromDiscord<dorei> oh, i see, i think i'll give nim a try 🙂
23:51:02FromDiscord<shadow.> sounds good
23:51:39FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2H5A
23:53:28*lritter quit (Quit: Leaving)
23:59:38FromDiscord<shadow.> nvm