<< 15-08-2020 >>

00:08:28FromDiscord<drsensor👹> sent a code paste, see https://play.nim-lang.org/#ix=2uc0
00:08:44YardanicotoSeq
00:08:49Yardanicofrom sequtils
00:08:49FromDiscord<drsensor👹> (edit) 'https://play.nim-lang.org/#ix=2uc0' => 'https://play.nim-lang.org/#ix=2uc1'
00:09:02Yardanicoalso are you sure you want that?
00:09:05Yardaniconot key, but the value?
00:09:12disruptekdo you speak Mandarin?
00:09:47FromDiscord<drsensor👹> @Yardanico yups
00:09:59Yardanicothen toSeq from sequtils
00:10:15Yardanicobut it might be quite not efficient if you do it often and your table is big
00:10:43FromDiscord<drsensor👹> sent a code paste, see https://play.nim-lang.org/#ix=2uc2
00:10:58Yardanicoecho myval in toSeq(tables.values)
00:11:01Yardanicothat's how you should use it
00:11:06Yardanicosorry
00:11:12Yardanicoecho myval in toSeq(mytable.values)
00:12:08FromDiscord<drsensor👹> ah
00:16:34disruptekare there rules here against snakes?
00:16:54Yardanicotunnel snakes rule
00:16:57disruptekhow many of you own stringed instruments?
00:16:58Yardanicowe are tunnel snakes
00:17:09Yardanicohttps://www.youtube.com/watch?v=S0ximxe4XtU
00:18:35disruptekwhere do you stand on the corn argument? is corn a vegetable?
00:18:49YardanicoI don't know honestly
00:18:51Yardanicoand don't care
00:18:55Yardanicoall I know is that I can eat it or cook it
00:19:05disruptekthink about it.
00:23:23disrupteki feel bad about your neck.
00:24:59*krux02__ quit (Remote host closed the connection)
00:27:58FromDiscord<Rika> corn
00:37:09*NimBot joined #nim
00:37:29disruptekrika: when did you learn how to think?
00:37:38leorize[m]Yardanico: do you still have your version of nimforum running?
00:37:50Yardanicoyeah, seems like it's still running
00:38:01Yardanicohttps://forum.my-toolbox.xyz/
00:38:06leorize[m]where can I find it?
00:40:35YardanicoI didn't update it for a few months though
00:40:44disruptekgood thinking.
00:40:50YardanicoI mean it has my hackish opengraph addition though
00:40:55disrupteknice!
00:40:59Yardanicobut nimforum didn't get any real changes anyway
00:41:08Yardanicoah seems like it did
00:41:09leorize[m]at least you're running on up-to-date jester
00:41:12Yardanicohaha
00:41:54Yardanicoalso it's much snappier for me than the official instance, maybe because it has much less threads, idk :)
00:42:14leorize[m]like dom96 fix a zero-day in jester then proceed to not update the forum :P (not that it affects the forum, cloudflare protects against this stuff)
00:45:17FromDiscord<Rika> disruptek: i did?
00:49:09*vicfred quit (Quit: Leaving)
00:53:39*waleee-cl quit (Quit: Connection closed for inactivity)
00:53:56disruptekmy mistake.
01:02:57FromGitter<iffy> What's the best way to assert that an object implements a certain interface? Concepts?
01:03:03disruptekindeed.
01:03:20FromGitter<iffy> thanks!
01:03:27Yardanicobut don't forget that concepts are compile-time only
01:03:30Yardanicoyou can't store them in seqs, etc
01:03:36FromGitter<iffy> right; I like that part
01:03:39Yardanicothat said, they work just fine for proc arguments and stuff
01:04:59FromGitter<iffy> hmm... anyway to assert that a module defines a newMyObject proc? I have when defined(ios): ... elif defined(android):... stuff and want to make sure both branches have a newMyObject proc. Anything better than a unittest for that?
01:05:37disruptekuse a concept and see if the proc is defined for the type.
01:06:10FromGitter<iffy> okay, I'll play with that
01:32:25*abm quit (Quit: Leaving)
01:35:25*awe004 quit (Ping timeout: 240 seconds)
01:51:23FromDiscord<Varriount> Anyone know what the state of the `channels` module is?
01:51:29Yardanicowdym?
01:51:30Yardanicoit works
01:51:31*apahl_ joined #nim
01:52:42*ForumUpdaterBot quit (Remote host closed the connection)
01:52:51*ForumUpdaterBot joined #nim
01:54:11FromDiscord<Varriount> Yardanico: What is the performance like?
01:54:22YardanicoI don't know, but it should be enough?
01:54:26YardanicoI didn't see any benchmarks for it
01:54:27FromDiscord<Varriount> I ask, because I recall something about channels needing to be optimized
01:54:34*apahl quit (Ping timeout: 256 seconds)
02:02:57*audiofile joined #nim
02:27:57*bunbunbunbunny joined #nim
02:36:47*muffindrake quit (Ping timeout: 272 seconds)
02:38:24*muffindrake joined #nim
02:38:48*vicfred joined #nim
02:40:06FromGitter<iffy> Is there a way to get more information about why a concept doesn't match a thing?
02:40:30FromGitter<iffy> from `assert MyThing is MyConcept`
02:45:54*bunbunbunbunny quit (Quit: Lost terminal)
02:48:11*leorize joined #nim
02:53:43*leorize quit (Ping timeout: 240 seconds)
02:58:03*endragor joined #nim
03:02:05*endragor quit (Ping timeout: 240 seconds)
03:08:06FromDiscord<Admin> sent a code paste, see https://play.nim-lang.org/#ix=2ucy
03:08:18*surma quit (Ping timeout: 256 seconds)
03:09:33Yardanicoinstall xorg-devel
03:09:41Yardanicoxorg-dev rather
03:10:41FromGitter<iffy> Hey, that works great, disruptek: https://play.nim-lang.org/#ix=2ucz If I could find a way to eliminate the `nop` proc, that's be ideal, but it works, so I'll use it as-is
03:11:11FromDiscord<Admin> @Yardanico works ty buddy
03:11:29*r4vi quit (Read error: Connection reset by peer)
03:12:24*bunbunbunbunny joined #nim
03:12:58*r4vi joined #nim
03:12:58*surma joined #nim
03:17:31*r4vi quit (Read error: Connection reset by peer)
03:22:24*surma quit (Ping timeout: 256 seconds)
03:24:41*endragor joined #nim
03:25:39*surma joined #nim
03:29:38*endragor quit (Remote host closed the connection)
03:30:06*r4vi joined #nim
03:30:27*endragor joined #nim
03:30:54*bunbunbunbunny quit (Quit: leaving)
03:35:38*endragor quit (Ping timeout: 260 seconds)
03:39:36FromDiscord<Varriount> Hrm. I have no idea what I should work on.
03:39:56FromDiscord<Varriount> Anyone need help with something Nim-related?
03:41:50*endragor joined #nim
03:49:00FromDiscord<InventorMatt> Making an xml-rpc in nim?
03:52:48*bunbunbunbunny joined #nim
04:06:01*supakeen quit (Quit: WeeChat 2.8)
04:06:32*supakeen joined #nim
04:09:03FromDiscord<Varriount> @InventorMatt I would prefer not to be eaten alive by XML
04:09:49FromDiscord<Varriount> Anyway, I consider anything networking-related off the table until there's some sort of consensus on what Async will be.
04:11:23FromDiscord<InventorMatt> Understandable.
04:11:33FromDiscord<Varriount> I guess I could come up with my own Async framework prototype.
04:17:26*audiofile quit (Ping timeout: 256 seconds)
04:35:22*endragor quit (Remote host closed the connection)
04:35:49*endragor joined #nim
04:39:56*pulux quit (Quit: WeeChat 2.8)
04:40:11*bunbunbunbunny quit (Ping timeout: 240 seconds)
04:41:11*endragor quit (Ping timeout: 246 seconds)
04:52:00*bunbunbunbunny joined #nim
04:57:06*bunbunbunbunny quit (Ping timeout: 256 seconds)
05:06:04*bunbunbunbunny joined #nim
05:06:24*bunbunbunbunny quit (Client Quit)
05:17:29*justsomeguy joined #nim
05:49:12*arecacea1 quit (Read error: Connection reset by peer)
05:51:04*arecacea1 joined #nim
06:01:49*endragor joined #nim
06:05:43*solitudesf joined #nim
06:08:30*endragor quit (Ping timeout: 256 seconds)
06:17:34*JustASlacker quit (Ping timeout: 256 seconds)
06:36:08*justsomeguy left #nim (#nim)
06:58:19FromDiscord<vieru> hi does anybody know how you can limit your app to only one instance ?
06:58:36Yardanicowdym?
06:58:47YardanicoWhat does "app" and "instance" mean in your message?
06:58:51Yardanicois it related to some nim library?
06:58:56FromDiscord<vieru> no
06:59:03FromDiscord<vieru> the program i mean
06:59:11FromDiscord<vieru> executable
06:59:50FromDiscord<vieru> i just want to click 10000 times on the app icon and there should be only one app in the task manager
06:59:56FromDiscord<vieru> sry for my english lol
06:59:57FromDiscord<Elegant Beef> The dumbest method is to make a temporary file that if it exists exit out
07:00:39FromDiscord<vieru> yeah that could work but if the program studently stops it wont start again lol
07:01:12Yardanicofor windows you can check if there's a running process with the name of your app
07:01:13FromDiscord<vieru> there's a winapi method but i want to know if nim has something of its own
07:01:16Yardanicoand if so - exit
07:01:36Yardanicohttps://rosettacode.org/wiki/Determine_if_only_one_instance_is_running
07:01:49Yardanicothere are a few nim examples, although I guess they're somewhat outdated
07:01:56Yardanicoand they're both posix-specific
07:03:31FromDiscord<vieru> yeah i know about this but i want it to be my last resort method↵like i want to know if there's a method for it already implemented
07:03:37FromDiscord<vieru> if not ill just write my own
07:03:42Yardanicono, I don't think there is
07:03:47Yardanicoit's a quite specific problem :P
07:05:01FromDiscord<vieru> ik electronjs has something like this
07:05:32*rokups joined #nim
07:06:19FromDiscord<vieru> https://github.com/electron/electron/blob/master/docs/api/app.md#apprequestsingleinstancelock
07:07:00FromDiscord<vieru> and i dont think it searches for the name of the process or smth
07:08:06FromDiscord<vieru> this too
07:08:08FromDiscord<vieru> https://github.com/electron/electron/blob/v0.36.10/docs/api/app.md#appmakesingleinstancecallback
07:28:39*JustASlacker joined #nim
07:28:50*JustASlacker quit (Remote host closed the connection)
07:47:45*vqrs quit (Ping timeout: 272 seconds)
08:12:33FromDiscord<wiremoons> Hi - when running `nimble init` to setup a new Nim project - is there any nimble hook that allows the init process to also run some additonal setup commands? Like a local nimble system wide / per user config file perhaps, that would run an addtional Nimscript to perform extra init steps straight away? Basically a `nimble init` extention hook?
08:17:06*leorize joined #nim
08:23:30*awe004 joined #nim
08:24:43*leorize quit (Ping timeout: 240 seconds)
08:25:23*Prestige quit (Quit: Prestige)
08:25:45*Prestige joined #nim
08:51:08FromDiscord<Recruit_main707> I don’t think so
08:59:32*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:00:21*j4nvkvc quit (Quit: Idle for 30+ days)
09:01:15FromGitter<aachh> Hey, I’ve got a question: what do seqs compile to more or less?
09:01:33FromGitter<aachh> Are they something like dynamic arrays or more like linked lists?
09:01:40Yardanicojust heap-allocated dynamic arrays
09:01:44*Zambyte[m] quit (Quit: Idle for 30+ days)
09:01:46Yardanicothere are linked lists in the stdlib
09:01:54Yardanicoif you want to really know the internal memory structure of a seq, it's this:
09:01:54FromGitter<aachh> Great, thank you very much!
09:02:05Yardanicofor old runtime it's
09:02:16Yardanicolen, cap: int, data: pointer to dynamic array
09:02:18Yardanicofor new runtime:
09:02:29Yardanicolen: int, obj: pointer to object with cap: int and data: array
09:02:40Yardanicohttps://github.com/nim-lang/Nim/blob/devel/lib/system/seqs_v2.nim#L17
09:02:53FromGitter<aachh> Oh, great great! Thanks for the link!
09:02:54Yardanicothat's the internal memory layout of seqs for the new runtime (arc/orc)
09:03:11FromGitter<aachh> Thanks!
09:03:20Yardanicoalso strings have the exact same memory layout as seqs
09:03:28Yardanicoalthough this is more or less an implementation detail :P
09:04:13Yardanicoif you're interested in singly/doubly linked lists/rings - there's https://nim-lang.org/docs/lists.html
09:05:44FromGitter<aachh> No, I actually was looking for something more reminiscent of what you’ve shown me seqs are
09:05:49FromGitter<aachh> So that’s solved!
09:11:07FromDiscord<lqdev> i wonder why the seq layout was changed
09:15:18*rokups quit (Quit: Connection closed for inactivity)
09:22:38*krux02 joined #nim
09:29:33*endragor joined #nim
09:34:02*endragor quit (Ping timeout: 260 seconds)
09:36:15FromDiscord<Rika> i wonder too
09:36:42Yardanicomaybe @clyybber knows :P
09:47:55FromDiscord<Clyybber> why it was changed to pointer len pair?
09:48:15*Trustable joined #nim
09:48:43FromDiscord<Clyybber> because its one indirection less for getting the length
09:49:09FromDiscord<Clyybber> and it fits well with nil seq is empty seq
10:01:02*Kaivo quit (Quit: WeeChat 2.9)
10:15:23*Vladar joined #nim
10:15:28FromDiscord<lqdev> oh cool
10:20:42*leorize joined #nim
10:23:40*abm joined #nim
10:28:03*leorize quit (Ping timeout: 240 seconds)
10:31:26*leorize joined #nim
10:31:44*endragor joined #nim
10:39:43*leorize quit (Ping timeout: 240 seconds)
10:41:05*endragor quit (Ping timeout: 240 seconds)
10:45:40FromDiscord<LiteLotus> hey guys. i decided to dive back into nim but im struggling to import cpp libraries
10:46:06FromDiscord<LiteLotus> i dont understand how to use c2nim properly
10:46:13FromDiscord<LiteLotus> the documentation is alittle obtuse
10:47:57*arecacea1 quit (Remote host closed the connection)
10:48:21*arecacea1 joined #nim
10:49:09FromDiscord<Clyybber> c2nim doesn't really support cpp
10:49:16FromDiscord<LiteLotus> does it not?
10:49:29FromDiscord<Clyybber> nope, it requires manual work most of the time
10:49:37FromDiscord<LiteLotus> rip
10:49:43FromDiscord<LiteLotus> are there any alternatives?
10:51:00FromDiscord<Clyybber> theres nimterop but afaik it doesn't support cpp either (maybe to a certain degree); what do you want to wrap?
10:52:12FromDiscord<LiteLotus> https://github.com/drewnoakes/joystick
10:52:13FromDiscord<LiteLotus> this
10:53:05Yardanicocan't you just use SDL instead?
10:53:14FromDiscord<Clyybber> seems relatively small to me, could be done manually I think
10:53:21FromDiscord<Recruit_main707> c2nim has given me good results with cpp
10:53:22FromDiscord<Clyybber> @Zachary Carter and shashlick are the guys to ask
10:53:35FromDiscord<Recruit_main707> not with big libraries, but with small things it works pretty well
10:53:38Yardanicoyeah the API seems to be simple
10:53:42Yardanicocould be even wrapped manually
10:53:50FromDiscord<Clyybber> yeah, maybe c2nim will work for this case
10:54:27FromDiscord<LiteLotus> ok, so how would i go about wrapping it
10:54:35FromDiscord<LiteLotus> ive never done somethign like this before
10:54:54FromDiscord<LiteLotus> is there any guides / documentation?
10:55:12FromDiscord<LiteLotus> the C2Nim documentation is just hard to get my head around
10:55:49FromDiscord<flywind> See https://nim-lang.github.io/Nim/manual.html#importcpp-pragma-importcpp-for-objects
10:55:54FromDiscord<Clyybber> tbh this library seems so simple it might be worth it just rewriting it in nim directly
10:55:59FromDiscord<flywind> and https://github.com/kaushalmodi/std_vector/blob/master/src/std_vector.nim
10:56:18FromDiscord<Clyybber> because the object oriented aspect of that library really seems unneccessary to me
10:57:36FromDiscord<Clyybber> but if you still want to wrap it I think flywinds links are a good resource
10:57:54FromDiscord<Clyybber> or just try to run c2nim, it should have a good help message
10:58:09FromDiscord<LiteLotus> i mean i agree i may aswell rewrite it
10:58:25FromDiscord<LiteLotus> i just thought linux event streams were more complex than they actually are
10:58:32*filcuc joined #nim
11:07:14FromDiscord<LiteLotus> when i finish rewriting this how would i submit it to become a nimble addon?
11:07:28FromDiscord<Clyybber> nimble publish I think
11:07:35*leorize joined #nim
11:12:35Yardanico@LiteLotus well, first of all you need to make sure it has a correct nimble package structure :)
11:12:40Yardanicobut yeah, then it's just "nimble publish"
11:12:46FromDiscord<LiteLotus> cool
11:12:48FromDiscord<LiteLotus> thanks
11:13:12FromDiscord<LiteLotus> everyone is nicer than when i started using nim and was asking semi obvious wuestions
11:13:17FromDiscord<LiteLotus> (edit) 'wuestions' => 'questions'
11:30:01*endragor joined #nim
11:32:04*sagax quit (Ping timeout: 246 seconds)
11:39:29*s4mu3lbk joined #nim
11:42:48*fowl_ joined #nim
12:06:02*supakeen quit (Quit: WeeChat 2.8)
12:06:34*supakeen joined #nim
12:06:57*filcuc_ joined #nim
12:07:04*filcuc quit (Ping timeout: 246 seconds)
12:11:19*filcuc_ quit (Ping timeout: 256 seconds)
12:11:27*filcuc joined #nim
12:21:25*xet7 quit (Remote host closed the connection)
12:22:56*D_ quit (Remote host closed the connection)
12:23:51*D_ joined #nim
12:37:22FromDiscord<Recruit_main707> can you export a custom pragma?
12:38:01FromDiscord<Clyybber> nope, not yet
12:38:25FromDiscord<Recruit_main707> is there a pr to allow it?
12:38:55FromDiscord<Clyybber> nope
12:40:07FromDiscord<Recruit_main707> so its only planned
12:40:25FromDiscord<Recruit_main707> i guess include will do until then
12:49:27leorizetechnically you can just write a macro that adds pragmas into things
12:49:31leorizethen export that
12:55:38*s4mu3lbk quit (Quit: Leaving)
13:02:39FromDiscord<Zachary Carter> You can also check out Nim line
13:03:50FromDiscord<Zachary Carter> https://github.com/sinkingsugar/nimline
13:05:23*leorize quit (Ping timeout: 240 seconds)
13:05:44FromDiscord<Zachary Carter> Some things should stay in C++ world though... If you're dealing with multiple inheritance, have a need to override virtual functions or play with vtables, good luck!
13:06:49FromDiscord<Zachary Carter> Maybe eventually Nim will develop abilities to gracefully handle these situations
13:07:44FromDiscord<Zachary Carter> Doubtful though... The emit pragma is much better IMO than Python's solution(s)
13:08:15*leorize joined #nim
13:09:33FromDiscord<Zachary Carter> Another piece of advice - don't try to do OOP with Nim...
13:13:02FromDiscord<Zachary Carter> You'll be much better off with Nim programming using a procedural programming mindset. Pretend you're using a better C with a robust standard library and a garbage collector. YMMV.
13:13:18FromDiscord<Zachary Carter> (edit) removed 'programming'
13:14:52FromDiscord<Zachary Carter> Finally, I'd just use sokol, sdl2 or glfw depending on your needs.
13:16:33FromDiscord<Zachary Carter> @LiteLotus ^
13:18:01FromDiscord<Zachary Carter> @Recruit_main707 just put your custom pragma inside of a template
13:20:07FromDiscord<Zachary Carter> And export the template / call it in the module you want to use it in.
13:22:16FromDiscord<Zachary Carter> template pluginApis*() =
13:22:35FromDiscord<Zachary Carter> https://github.com/zacharycarter/junkers/blob/5e41d431b9faa27a56ff46b68f05dc0b9684bfa5/src/api.nim#L67
13:23:54*FromDiscord quit (Remote host closed the connection)
13:24:11*FromDiscord joined #nim
13:26:15FromDiscord<Zachary Carter> https://github.com/zacharycarter/junkers/blob/5e41d431b9faa27a56ff46b68f05dc0b9684bfa5/src/junkers.nim#L3
13:27:31FromDiscord<Zachary Carter> No need to include
13:27:34*sagax joined #nim
13:34:23*leorize quit (Ping timeout: 240 seconds)
13:42:37FromDiscord<Recruit_main707> ok, i will check this, thx
13:47:05*awe004 quit (Ping timeout: 256 seconds)
13:50:27*arecacea1 quit (Remote host closed the connection)
13:50:32FromDiscord<Zachary Carter> No problem.
13:50:51*arecacea1 joined #nim
13:55:43*awe004 joined #nim
14:13:41FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ueX
14:14:18disruptekYardanico: will you please fix that?
14:15:28FromDiscord<niv> hey. whats the canonical/official/recommended way to represent a bunch of non-printably/binary payload? string? seq[byte]? something else?
14:16:07disruptekprobably seq[byte] but i cannot fathom why string isn't fine. i always use string.
14:16:12FromDiscord<lqdev> i use `seq[uint8]`
14:16:33FromDiscord<niv> i use string as well because most c bindings can cast to/from easily, not so sure about seq[]
14:16:50FromDiscord<niv> how about distinct string, to indicate to the api user its not a printable?
14:18:11FromDiscord<niv> relatedly, is there a good way to cast a string to a seq[uint8] or back without a memcpy?
14:24:12*leorize joined #nim
14:29:23*leorize quit (Ping timeout: 240 seconds)
14:30:52FromDiscord<Zachary Carter> when interoping with C I use `seq[uint8]`
14:31:24FromDiscord<Zachary Carter> no I don't think you can cast to a seq without a memcopy
14:32:21FromDiscord<niv> alright, cheers
14:33:15FromDiscord<Zachary Carter> (edit) 'memcopy' => 'memcpy'
14:33:25*leorize joined #nim
14:40:01FromDiscord<lqdev> actually, you can
14:40:10FromDiscord<lqdev> it's a bit hacky but the mem layout is the same anyways
14:41:14FromDiscord<Zachary Carter> How?
14:48:43*leorize quit (Ping timeout: 240 seconds)
14:48:45FromDiscord<LiteLotus> whats the equivalent of a double in nim?
14:48:53FromDiscord<LiteLotus> i need an unsigned double & int
14:49:21*leorize joined #nim
14:50:52FromDiscord<Zachary Carter> float64
14:50:59FromDiscord<LiteLotus> ty
14:51:20FromDiscord<Zachary Carter> Np
14:52:30FromDiscord<LiteLotus> what about shorts?
14:53:10FromDiscord<LiteLotus> im guessing int16?
14:54:23FromDiscord<lqdev> yes
14:54:46FromDiscord<LiteLotus> 👌
14:59:02FromDiscord<Zachary Carter> @lqdev still interested in seeing the string to seq cast
15:00:27FromDiscord<lqdev> !eval echo cast[seq[uint8]]("123")
15:00:29NimBot@[49, 50, 51]
15:00:36FromDiscord<lqdev> @Zachary Carter
15:00:50Zevvthe memory layout is the same *for now*
15:00:57Zevvno guarentees for the futur
15:00:59Zevve
15:01:59Zevvi implemented sso in the compiler once, something like tht
15:02:05Zevvbreaks the compatibiliy
15:02:23Zevvar4q didnt like it at all so i nevercontinued with that thouhg
15:02:46*MyMind joined #nim
15:02:51Zevv\
15:02:53Zevv\
15:03:10Zevvtyping is hard
15:03:58*Sembei quit (Ping timeout: 260 seconds)
15:08:22disrupteksometimes the fox is nice.
15:12:23disrupteka proper chair is life-changing.
15:13:03*leorize quit (Ping timeout: 240 seconds)
15:17:52*sschwarzer joined #nim
15:19:51*sschwarzer quit (Client Quit)
15:23:50*waleee-cl joined #nim
15:25:03disrupteki just want one day without bugs.
15:25:17disruptektime to play video-games, i guess.
15:26:30FromDiscord<LiteLotus> im struggling to set up this data read from an input stream
15:26:37FromDiscord<LiteLotus> i feel linke im missing something
15:26:57disruptek~pate
15:26:57disbotno footnotes for `pate`. 🙁
15:26:59disruptek~paste
15:27:00disbotpaste: 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
15:27:18disruptek~pate is a really bad idea made worse by its implementation.
15:27:19disbotpate: 11a really bad idea made worse by its implementation.
15:27:34FromDiscord<LiteLotus> im trying to read 24bytes of data from a stream
15:28:04disruptekoh yeah?
15:28:40FromDiscord<LiteLotus> a c timeval (a posix timeval if im corect), 2 unsigned shorts and a unsigned int
15:29:07FromDiscord<LiteLotus> however i dont know how this fits into the stream.readData() proc
15:29:18FromDiscord<LiteLotus> ive created the object
15:29:23FromDiscord<LiteLotus> but cant read it
15:29:36FromDiscord<LiteLotus> use it to read it i mean
15:29:55FromDiscord<LiteLotus> i created the Type
15:30:04FromDiscord<LiteLotus> technically shouldnt be using objects
15:30:27FromDiscord<LiteLotus> according to zach
15:31:14disruptekif you share some code, we can probably identify the error.
15:32:11FromDiscord<LiteLotus> https://pastebin.com/6QrhicPj
15:33:06disruptekvar myobj: input_event; strm.read(myobj)
15:33:40disruptekie. alloc the object and then read into it from the stream.
15:33:55ZevvHa I got a cool ix short link
15:33:58Zevv"2ufo"
15:34:34FromDiscord<LiteLotus> @disruptek so do that every loop?
15:34:57FromDiscord<LiteLotus> how do i then get the data from that?
15:35:36disruptekwhat data?
15:35:47FromDiscord<LiteLotus> from the buffer
15:35:52FromDiscord<LiteLotus> that im reading from teh stream
15:36:07disrupteki'm not sure you're picking up what i'm laying down.
15:36:17FromDiscord<LiteLotus> probably not
15:36:28disruptekthe "data" isn't in the buffer.
15:36:53disruptekmyobj holds whatever types you've defined and their values as read from the stream.
15:37:09FromDiscord<LiteLotus> ah ok
15:37:12FromDiscord<LiteLotus> so its a buffer definition
15:37:19FromDiscord<LiteLotus> not the data itself?
15:37:27disruptekwhat the fuck?
15:37:38FromDiscord<LiteLotus> bro im confused
15:37:38disruptekyou define the structure of the data.
15:37:49disruptekyou read the values into that structure from the stream.
15:37:55FromDiscord<LiteLotus> yeah
15:37:56disruptekvar myobj: input_event; strm.read(myobj)
15:37:59FromDiscord<LiteLotus> thats what i was saying
15:38:03FromDiscord<LiteLotus> just not as elegantly
15:38:11disruptekokay.
15:38:17disruptekgive it a shot and then follow up with zevv.
15:38:24disrupteki have to go ice my head.
15:38:28FromDiscord<LiteLotus> xD
15:38:28FromDiscord<LiteLotus> ok
15:39:26*awe004 quit (Ping timeout: 260 seconds)
15:42:40ZevvLiteLotus: You got it to work then?
15:42:52FromDiscord<LiteLotus> no
15:43:14FromDiscord<LiteLotus> i still dont understand how i then use "myobj" from there
15:43:29FromDiscord<LiteLotus> this is my first time using stream
15:43:31FromDiscord<LiteLotus> (edit) 'stream' => 'streams'
15:43:38Zevvok, lemme check your snippet
15:44:13ZevvI'm slow today, I got a strnage computer that lacks all my shortcuts and hotkeys
15:44:28*awe004 joined #nim
15:44:43FromDiscord<LiteLotus> rip
15:44:58FromDiscord<LiteLotus> didnt put them in a dotfile git repo?
15:45:20ZevvYeah sure, but I've been carrying around stuff since 1992 I guess
15:45:30Zevvso there's always something amiss
15:45:37FromDiscord<LiteLotus> ah
15:45:45Zevvmy scripts use some custom made font that doesn't install on new ubuntu because it lacks bitmap fonts
15:45:48Zevvor whatever
15:45:51Zevvi'm fine :)
15:49:40FromDiscord<LiteLotus> so how am i supposed to use getData?
15:52:22Zevvhttp://ix.io/2ugG
15:52:26Zevvso this reads your object
15:52:45Zevvthere's no need to create your buffer on the heap (to 'new' it), you can just create a var of the type
15:52:53*Guest94576 joined #nim
15:53:16Zevvif you 'new' it, 'buffer' is not and input_event but a pointer to an input_event
15:53:27Zevvso `addr buffer` gives you the address of the pointer instead
15:53:31FromDiscord<LiteLotus> fuck
15:53:36FromDiscord<LiteLotus> yeah how did i not spot that
15:53:48Zevvno worries
15:53:55FromDiscord<LiteLotus> too much typescript
15:54:09Zevvrule of thumb is: don't ref or new unless you have to
15:54:24FromDiscord<LiteLotus> honestly ive been hopping through languages like im playing hopscotch lately
15:54:28Zevvso if you need multiple references to something, or have a dynamic pool of things, then you ref
15:54:37Zevvkeep doing that
15:54:38FromDiscord<LiteLotus> ok
15:54:52FromDiscord<LiteLotus> why?
15:54:55FromDiscord<LiteLotus> is it good?
15:54:58Zevvit's the best way to learn new stuff, new concepts
15:55:00Zevvits the best
15:55:06FromDiscord<LiteLotus> huh
15:55:09FromDiscord<LiteLotus> didnt know
15:55:12Zevvsticking to one thing and doing only that for the rest of your career is stupid
15:55:13FromDiscord<LiteLotus> makse sense tho
15:55:39Zevvand if you dare, go completely out of your league every now and then. Do Haskell. Do Clojur. Do Elixir. Do Rust.
15:55:50Zevvthey all are great in their own ways
15:56:34ZevvIf I were smart enough I would use one of those
15:56:40Zevvbut here I am, stuck with Nim
15:58:35FromDiscord<lqdev> >:(
16:01:06FromDiscord<LiteLotus> i tried rust
16:01:21FromDiscord<LiteLotus> but didnt have any projects that really meshed well with it
16:01:48Zevvthat's my problem with most languages
16:02:16FromDiscord<LiteLotus> ive been told so many times to try haskell
16:02:22Zevvreally, do
16:02:26Zevvyou will probably never *use* it
16:02:29FromDiscord<LiteLotus> i might give it a go some time soon
16:02:32Zevvbut it bends your brain in great ways
16:02:42Zevvyou pick great concepts from every new language
16:02:50Zevvgoing real functional is enlightening
16:03:06FromDiscord<LiteLotus> interesting
16:03:21FromDiscord<LiteLotus> also this data seems to be the wrong size.
16:03:32FromDiscord<LiteLotus> 16 bytes. not 24
16:04:33FromDiscord<LiteLotus> i think timeval is the culprit?
16:07:57Zevvor packing
16:08:29FromDiscord<LiteLotus> packing?
16:19:45FromDiscord<LiteLotus> its definatelyTimeval
16:19:54FromDiscord<LiteLotus> its half the size that im expecting
16:20:06FromDiscord<LiteLotus> its 8 bytes, im expecting 16
16:20:17FromDiscord<LiteLotus> also explains why the data is so incorrect
16:22:16*Guest94576 quit (Quit: Guest94576)
16:25:46FromDiscord<Zachary Carter> what is the content of `js0`?
16:26:04FromDiscord<LiteLotus> linux device event stream
16:26:11FromDiscord<Zachary Carter> can you gist it?
16:26:21FromDiscord<LiteLotus> its raw byte data
16:26:25FromDiscord<Zachary Carter> ah
16:26:39FromDiscord<Zachary Carter> well if you know the layout of data - just don't use the stdlib types
16:26:57FromDiscord<Zachary Carter> and this is the more idiomatic way to write this code
16:27:16FromDiscord<Zachary Carter> https://play.nim-lang.org/#ix=2ugP
16:27:17FromDiscord<LiteLotus> it should line up as a 16 byte timeval, 2 int16, and a unsigned int
16:27:44FromDiscord<Zachary Carter> so just inline the `timeval` into the `InputEvent` object
16:27:47FromDiscord<LiteLotus> but nims posix timeval is 8 bytes
16:27:52FromDiscord<Zachary Carter> I need to go to the beach - but I"ll be back later
16:27:54*lritter joined #nim
16:28:05FromDiscord<Zachary Carter> well - you can file a bug / PR it if it's incorrect
16:28:33FromDiscord<Zachary Carter> but please provide a link to the header it's defined in showing the correct type definition
16:28:38FromDiscord<Zachary Carter> anywho, bbl
16:28:47FromDiscord<LiteLotus> cya ❤️
16:31:05Zevvjust use libev
16:45:54*vegai left #nim (#nim)
16:50:01FromDiscord<LiteLotus> what do you mean?
16:50:12FromDiscord<LiteLotus> is that a nimble package? @zevv
16:50:50FromDiscord<Clyybber> its libevent
16:51:01FromDiscord<Clyybber> a c library
16:51:35FromDiscord<Clyybber> Zevv, disruptek: I think my fix is getting ready
16:51:43FromDiscord<Clyybber> the fix for the typed redefinition issue
16:57:33*superbia1 joined #nim
17:00:49*superbia quit (Ping timeout: 264 seconds)
17:04:07FromDiscord<LiteLotus> then i would be stuck importing something again
17:04:26FromDiscord<LiteLotus> (edit) 'then i would be stuck importing something again ... ' => 'then i would be stuck importing something again/ wrapping'
17:04:45FromDiscord<LiteLotus> (edit) 'then i would be stuck importing something again / wrapping ... ' => 'then i would be stuck importing something again / wrapping@Clyybber'
17:04:53*endragor quit (Remote host closed the connection)
17:06:33Zevvclyybber: yay, so we can finally start to drop the _clyybber!
17:07:27Zevvlitelotus: libevdev maybe? its in nimble
17:08:01FromDiscord<Recruit_main707> hmm, in the macros module, addPragma doesnt work with objects, shouldnt it do?
17:09:11*endragor joined #nim
17:09:42FromDiscord<Clyybber> clyybber: oh no :D(
17:13:25*endragor quit (Ping timeout: 240 seconds)
17:19:06*leorize joined #nim
17:21:39Zevvuntil we find the next bug we want you to fix
17:21:42FromDiscord<Clyybber> Zevv, disruptek: its green \o/ https://github.com/nim-lang/Nim/pull/15158
17:21:42disbotFix #5691
17:21:48Zevvwe'll call that one clyybber
17:21:52Zevvad infinitum
17:22:06FromDiscord<Clyybber> i'm fine with that
17:22:46*bung quit (Ping timeout: 246 seconds)
17:27:05Zevvgreen!
17:27:08Zevvmerge that stuff!
17:28:31FromDiscord<Clyybber> heh, its not quite finished yet
17:29:23*leorize quit (Ping timeout: 240 seconds)
17:30:02*leorize joined #nim
17:31:13Zevvcan't test it anyway. cps is always broken, you know.
17:32:36FromDiscord<Clyybber> heh
17:32:45FromDiscord<LiteLotus> i figured out why its 8 bytes instead of 16
17:32:53FromDiscord<LiteLotus> its x86
17:33:14Zevvthus I said: use libevent :)
17:33:14FromDiscord<LiteLotus> aparently its only 8 bytes on a 32bit system
17:33:24FromDiscord<LiteLotus> i was so close
17:33:33FromDiscord<LiteLotus> i didnt want to give up on my solution 😢
17:33:40Zevvor import the definitions from your local input.h, at least
17:33:58FromDiscord<LiteLotus> i can do that?
17:38:25Zevvthere's tooling for that, c2nim or nimterop
17:38:33Zevvbut fair enough, for one simple struct you're probably fine like thi
17:38:34Zevvs
17:39:49Zevvoh yeah I had this error that disruptek didn't have, altough we have the same version of everything
17:40:03Zevvwell, if all this cps does not fly in the end, at least we'll have improved nim by finding a lot of bugs
17:40:44FromDiscord<Clyybber> it will fly
17:40:49FromDiscord<Clyybber> and yeah, that ones a great benefit
17:41:28Zevvdisruptek: you here?
17:50:33Zevvclyybber: is it done enough for me to give it a try?
17:50:49Zevvand why don't you move to irc so I can tab expand you nick properly
17:53:19*clyybber joined #nim
17:53:28clyybberZevv: yeah its ready enough for that
17:54:08*hnOsmium0001 joined #nim
17:54:13*bung joined #nim
17:54:28Zevvcool
17:55:03*leorize quit (Ping timeout: 240 seconds)
17:55:16Zevvwho puts hashes in branch names
17:56:01Zevvoh bah I just realized why the booty has a tramp
17:56:15Zevvwe can't change the signature of the original definition :(
17:56:31clyybberwhy?
17:56:52clyybbercouldn't think of a better branch name this time
17:56:55Zevvunless I undestand it wrong, but: with typed you can't mutate the original nodes, right?
17:57:02clyybberyou can copy it
17:57:05Zevvso the original defined proc will always be there, you can only create new stuff
17:57:07clyybberand then modify it afaik
17:57:15clyybberZevv: No with my PR not
17:57:17Zevvthere is already a proc without return value, but we want to give it a return value
17:57:24Zevvoh, even that is fixed \o/
17:57:29clyybberthat *is* the bug
17:57:35clyybberits all the same thing :P
17:57:46ZevvWell, I thought the bug was that you can create new stuff, as long as it doesn't have the same *name*
17:58:17Zevvseems to do the job!
17:58:27ZevvI now get the normal disruptek induced errors
17:58:31Zevvwoot!
17:58:35clyybber\o//
17:59:02*bung quit (Ping timeout: 256 seconds)
18:04:17*NimBot joined #nim
18:07:15Zevvoh boy is arac not going to agree with your fix
18:07:39Zevvor do you probably undo the side effects during overload resolution already
18:07:43Zevvs/properly/
18:09:43FromDiscord<Clyybber> yeah, thats the remaining part
18:09:56FromDiscord<Clyybber> so that arg2 can't access symbols from arg1
18:11:27Zevvright
18:11:30Zevvwell, I don't care!
18:11:33Zevvwe'll just fork nim
18:29:48disruptekwhat do i have to do to make things work?
18:30:16Zevvstart with: run clybbers branch and pull cps, run with -d:cpsTrampBooty=false
18:30:49Zevvand drop _clybber on all the calls
18:31:20Zevvgit remote add clyybber https://github.com/Clyybber/Nim/
18:31:29Zevvgit co 'clyybber/fix#5691'
18:32:01Zevvnow I'm looking into "Error: internal error: environment misses: lo
18:32:44disruptekit's due to one of the issues i created.
18:32:50Zevvisn't it all
18:33:10Zevvyou create so many issues
18:34:03Zevvbut clyybbers fix now allows mutation of the orignal proc
18:34:11Zevvso the booty now returns the cont as it should
18:34:51Zevvoh #32, right
18:35:09Zevvhm that's a bit more then a "bummer" imho
18:35:22disruptekyeah, well...
18:35:39Zevvisn't it a friggin show stopper?
18:36:48*Vladar quit (Quit: Leaving)
18:36:50FromDiscord<Clyybber> hmm
18:36:57FromDiscord<Clyybber> I'm not sure they are intended to be syms
18:37:49Zevvhm is this even #32
18:37:53ZevvI'm looking at
18:38:17*bung joined #nim
18:38:20Zevvbecause this is not a .cps. proc param
18:38:23*endragor joined #nim
18:38:25Zevvit's a lifted local
18:40:32Zevvwell, apart from not finding `lo` and `hi` in the env, my iterator iterates again!
18:41:14disruptekdo you have a repro that refutes 32?
18:41:43Zevvwell, my iterator can now accept a value in its jield()
18:41:51Zevvisnt taht the same? It's an arg to a .cps. proc
18:42:05Zevvpull and run my iterator
18:42:06disruptekso i should use head?
18:42:16ZevvI hardcoded 0 and 3 for lo and hi
18:42:22Zevvyes, pull head typed
18:42:49*bung quit (Ping timeout: 264 seconds)
18:42:51Zevvand run with -d:cpsTrampBooty=false
18:43:04Zevvthat define should go out and that code path should be the default
18:43:14Zevvbut make sure to run clyybbers nim branch
18:43:21Zevvas per instructions above
18:43:37disruptekokay, it runs.
18:43:43Zevvcool bro
18:43:47disruptekbut, i'm still seeing idents for lo/hi.
18:44:29Zevvin the booty, you mean, or in the .cps'
18:45:02disruptekeverywhere.
18:45:27FromDiscord<Clyybber> is the proc generic?
18:45:30disrupteknah.
18:46:25*endragor quit (Ping timeout: 246 seconds)
18:46:48Zevvdisruptek: where do you mean then
18:47:15disruptekthey are arguments to the counter() and they don't get typed into syms.
18:48:27Zevvoh it's the booty generating the error
18:48:42Zevvit's hard to tell with the line numbers from the original source
18:49:07Zevvok sure its #32 then
18:49:41disrupteklook at --define:cpsTree
18:49:53*bung joined #nim
18:50:29Zevvah you have a define for that, I was just adding the treeRepr
18:51:02Zevvhmmm
18:51:04Zevvdang
18:52:35*dddddd quit (Ping timeout: 240 seconds)
18:54:30*bung quit (Ping timeout: 260 seconds)
18:56:09Zevvsoooo
18:56:30Zevv"I'm not sure they are intended to be syms"
18:56:38*bung joined #nim
19:00:50FromDiscord<Clyybber> I mean, is it some weird special edge case where they aren't?
19:00:53FromDiscord<Clyybber> or are they never?
19:01:05*bung quit (Ping timeout: 240 seconds)
19:01:31FromDiscord<Clyybber> probably a bug tho, but if you could extract something minimal, that'd help a lot
19:01:44Zevvlemmesee
19:02:22disrupteki'm burnt out.
19:04:50FromDiscord<Clyybber> you need water
19:04:54Zevvclyybber: http://ix.io/2uhs
19:05:00Zevvdisruptek: mentally or physically?
19:05:14FromDiscord<Clyybber> Zevv: Thanks!
19:05:17*bung joined #nim
19:05:31ZevvI wanted to update the #32 issue but I don't have my github credentials here
19:05:44disruptekwhy are you cloning the proc, though?
19:06:06Zevvcan't mutate because typed
19:06:13Zevvthat still stands, right
19:06:15disruptekis `a` a symbol in `n`?
19:06:23disrupteki don't care if it's mutated or not.
19:06:33disruptekwe're trying to establish that we're getting bad input.
19:06:58Zevvwell, this is the minimilazation of the same issue as #32 afaik
19:07:46disrupteknah.
19:08:33disruptekhttp://ix.io/2uht/nim
19:09:06*dddddd joined #nim
19:09:47*bung quit (Ping timeout: 240 seconds)
19:13:20disrupteki am going to start csp i guess.
19:13:35FromDiscord<Clyybber> start?
19:14:24disrupteki did some experiments but i think i have a better sense for how this should work now.
19:16:43*bung joined #nim
19:17:10FromDiscord<--HA--> Is there a merge or similar for Table (not CountTable)?
19:19:46disrupteknah.
19:21:04*bung quit (Ping timeout: 246 seconds)
19:23:23*bung joined #nim
19:25:52Zevvmake up your mind dude
19:25:55Zevvjah or nah
19:26:20FromDiscord<Clyybber> jein
19:29:58FromDiscord<Elegant Beef> Nyeno
19:30:10Zevvah that is more minimal indeed
19:30:19disruptekthe csp approach will be continuations at compile-time, basically. we form the algebra from code+data but we treat them as a single unit.
19:30:37Zevvoh there we go again
19:30:39disruptekthen at runtime, the code portion is simply omitted.
19:30:59disruptekthe data is, y'know, whatever you data is.
19:31:14disruptekwe just give you the algebra to operate on it at compile-time.
19:31:38disruptekno overhead of the environment.
19:31:46disruptekno special types.
19:31:55Zevvyou clearly have it all in your head
19:31:56disruptekno boxing or anything like that.
19:32:11*bung quit (Ping timeout: 240 seconds)
19:32:14FromDiscord<Elegant Beef> What about wrestling?
19:32:20Zevvand I feel I should make an effort of understanding it
19:32:39ZevvWWF style
19:32:45disruptekthere's really no reason to keep the fn around.
19:33:28Zevvdisruptek: do you have a clear enough picture to make this concrete with some examples?
19:33:36Zevvtake my iterator, for example
19:33:46Zevvwhat does it end up like, and hwo do you get there
19:34:03*bung joined #nim
19:34:18disrupteki don't really know how to exploit csp yet.
19:34:42Zevv"exploit" as in "use" it ?
19:34:58disruptekyeah, like i dunno what it's good for.
19:35:14Zevvwell, we know a few right
19:35:29FromDiscord<Clyybber> async?
19:35:30Zevvthese are good enouhg for me for now
19:35:32disruptekdo we?
19:35:35FromDiscord<Clyybber> yes
19:35:38disruptekwhat?
19:35:38Zevvyes
19:36:04Zevvlow overhead async, iterators, coroutines, funny control flow
19:36:18disruptekthat's cps.
19:36:26FromDiscord<Clyybber> what do you want?
19:36:33Zevvoh wait
19:36:35disruptekcsp 😁
19:36:37Zevvhes pulling our finger
19:36:40Zevvsoooo
19:36:43FromDiscord<Clyybber> classic disruptek
19:37:15disruptekcsp is communication via sequential processing or something.
19:37:35Zevvok I have a great iedea
19:37:42Zevvwe first frigging *finish* this
19:37:51Zevvand *then* you start your next adventure
19:38:13disrupteklook, cps is just the crude logic.
19:38:21Zevvright. finish it then
19:38:25*bung quit (Ping timeout: 240 seconds)
19:38:27Zevvmake it work
19:38:27disruptekthis is the actual application which, if it's correct, is universally applicable.
19:38:43Zevvsure
19:38:43disruptekthis is goroutines and core.async and whatever.
19:39:01disruptekcps is just, "oh look, explicit inverted control-flow."
19:39:16disruptekbig deal. it's how you compose cps that matters.
19:39:17Zevvyou have the same thing as I did right
19:39:25Zevvthis lack of euphory
19:39:47FromDiscord<Clyybber> yeah, cps is just inverted control flow
19:39:50FromDiscord<Clyybber> but thats pretty cool
19:40:00Zevvyour mid-code-crisis. it's nothing to be ashamed of, its pretty normal
19:40:16disruptekwell, fix more bugs and i will write more cps.
19:40:29disruptekwe are pretty well limited by nim at the moment, afaik.
19:40:32Zevvfair enough
19:40:36FromDiscord<Clyybber> whats the new idea you had tho disruptek
19:40:47disruptekwith regard to what?
19:40:52FromDiscord<Clyybber> something with algebra and compile time
19:40:54FromDiscord<Clyybber> and data and code
19:40:58FromDiscord<Clyybber> undecipherable :p
19:41:05Zevvlook at his little example project
19:41:24disruptekbasically, our continuations are an environment with some code that runs on that environment.
19:41:31disruptekwe get that, right?
19:41:48Zevvhttps://github.com/disruptek/cps/blob/master/experiments/chain.nim
19:42:11Zevvright
19:42:19disruptekeven if it's created at run-time, this relationship between the data and logic has some weight to it.
19:42:28disruptekit's an object, it holds the fn ptr and the data.
19:42:42Zevvright again
19:42:50disruptekbut if we were able to unwrap the data out of this object and store the fn "for free", then we have something more interesting.
19:43:07disruptekwe have arbitrary data that is "native"; a table is a table and also a continuation.
19:43:13disrupteka string is a string and also a continuation.
19:43:25disruptekthe association between the data and the fn ptr need only exist at compile-time.
19:43:32*bung joined #nim
19:43:51disruptekif so, it means you can compose both continuations and processes (in csp parlance) with all our existing "data" machinery.
19:44:05disruptekall our existing procs that operate on data will operate on continuations.
19:44:21disruptekall our future procs that operate on data will also be composable as csp processes.
19:44:31disruptekit's a big fucking deal.
19:45:02FromDiscord<Clyybber> what does it mean in practice?
19:45:20Zevvthis is your chain.nim, right?
19:45:25FromDiscord<Clyybber> how do you operate on continuations?
19:46:01disruptekin practice it means that we can rely on 40 year-old math to prove control-flow, not just of async code but any code.
19:46:35disruptekit gives us a level of indirection for processing that we don't currently enjoy, but which we have every ability to achieve.
19:46:54disruptekchain.nim is a demo of composition, yes.
19:47:26disruptekit demonstrates composing a continuation using two non-continuation things; a string and a proc that operates on strings.
19:47:41disruptekand yet, the result is a continuation that you can work with as you might any other.
19:47:46FromDiscord<Clyybber> ah, so basically a string is treated like a proc returning a string?
19:48:05disruptek"hello" + toUpperAscii == continuation
19:48:20disruptekcontinuation() == "HELLO"
19:49:00FromDiscord<Clyybber> ok, so lazy application?
19:49:07Zevvas well
19:49:42disruptekwhen you add csp algebra on top of this, you start to get some really interesting emergent properties.
19:50:06*bung quit (Ping timeout: 256 seconds)
19:50:33disruptekwe learned that cps primitives aren't really a thing, but csp primitives are.
19:50:41FromDiscord<Clyybber> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
19:50:43FromDiscord<Clyybber> wtf
19:50:52FromDiscord<Clyybber> is the difference between cps and csp in your mind
19:51:10disruptekcps is what we have now.
19:51:13Zevvand it all started with just a typo in my repo name :)
19:51:19FromDiscord<Clyybber> yeah, crazy
19:51:24disruptekcsp is composition we can apply to cps.
19:51:37FromDiscord<Clyybber> words is words
19:51:40FromDiscord<Clyybber> but what do they mean
19:51:54disruptekholdon
19:52:00disruptekhttps://en.wikipedia.org/wiki/Communicating_sequential_processes
19:52:42FromDiscord<Clyybber> aha
19:52:46FromDiscord<Clyybber> thanks
19:53:15disruptekwhat they call event, i just call data.
19:53:27disruptekin our cps, we call it env.
19:53:51*bung joined #nim
19:58:19disruptekin chain.nim, it's data. chain.nim is cps in which the continuations and their functions are generic.
19:58:22Zevvdude this is just npeg for continuations
19:58:36*bung quit (Ping timeout: 256 seconds)
19:58:43disruptekgood.
20:00:24Zevvso finally it starts to sink in here
20:01:13disruptekyeah, and we're really not that far from being able to do this stuff.
20:02:03disruptekcps lives in the dark corners. if we're able to impl csp just in the compile-time syntax you see here, all the |[]|{}()->, then we really have something amazing.
20:02:06*bung joined #nim
20:03:25disruptekprovably race-free async, let's say.
20:04:20FromDiscord<Clyybber> the transformation stays the same though, this is about scheduling with additional information and about the environment/continuation relation
20:04:24FromDiscord<Clyybber> right?
20:04:42disruptekscheduling?
20:05:15disruptekit's a semi-tight coupling between the data/code, which together is the continuation.
20:05:21FromDiscord<Clyybber> I mean when to execute stuff so that it doesn't interfere with each other
20:05:54disruptekyeah, it's about composition that is correct by construction.
20:06:02disruptekcomposition of continuations.
20:06:15*WilhelmVonWeiner quit (Read error: Connection reset by peer)
20:06:25*bung quit (Ping timeout: 240 seconds)
20:07:16*bung joined #nim
20:09:41Zevvok
20:09:51Zevvi do see finally where you're going
20:09:53Zevv*but*
20:10:29Zevvthis is yet another bulk of theory an background that will take some good time to all sink in and get acquiented with
20:10:49disrupteki know. like i said, i don't know how to use it yet.
20:10:51Zevvif theres nothing we can continue on with cps its cool, but if not i prefer we fnish that first
20:10:59disruptekbut it was the same with cps.
20:11:11Zevvfor cps it was clear from the start what to use it for
20:11:13Zevvto me at least
20:11:23*bung quit (Ping timeout: 240 seconds)
20:11:41Zevvfor csp it *really* is like a grammar for code flow
20:11:52disrupteki understand the iterators and stuff, but i didn't know how we would actually write cps software.
20:11:58disrupteknow that's clearer.
20:12:21FromDiscord<--HA--> for checking emtpy string is one of these better `str != ""` or `str.len > 0`?
20:12:35disrupteklength check is superior.
20:12:43FromDiscord<--HA--> thank you
20:12:57disruptekby an insignificant amount. 😉
20:12:57Zevvill think a bit about csp, or what I think it roughly is, and I think I can whip up a few things already
20:13:31disruptekyeah, the hard part is going to be figuring out if we can squirrel away things like semaphores somehow.
20:13:45ZevvHA: dont trust anyone, just measure if you want to make sure. run a million of iterations of both and you will know
20:14:06Zevvdisruptek: same goes for cps when doing magic threadpool stuff
20:14:10FromGitter<wltsmrz> If I have exported alloc0 from overrides.nim (and included it), will this override all alloc0 throughout system?
20:14:21Zevvand i stil think we do need serialization and copying for channel like stuff
20:14:29disruptekwhy?
20:14:35FromDiscord<--HA--> I have no code that is that time sensitive just noticed that I was typing checks for empty strings a few times and wondered which I should use as my default
20:14:37*bung joined #nim
20:14:45disruptekjust use channels if you want to copy. that's exactly what it does.
20:15:07Zevvchannels implementation have sucky parts, like, they must be global
20:15:43Zevvyou cant just create thousand things with their own channels stuck on
20:16:20disruptekhuh?
20:16:36Zevvmy little love affair the other day with whats-that-language-again taught me a new way of parallel programming I didnt know yet, but liked a lot
20:16:47Zevvuse channels for everything as if they cost naught
20:16:55disruptekthat's csp. 😉
20:17:00Zevvtens, hundreds, thousands
20:17:09disruptekyes, it's pretty great.
20:17:35Zevvthat can also be done with cps
20:17:39disrupteki've used go but i found it too limiting even for my inelegant shit.
20:17:47Zevvoh its very limiting
20:17:49FromDiscord<Clyybber> chill out
20:17:54Zevvbut *that* part is very cool
20:17:57disruptekyes.
20:18:05disruptekit's the story we need.
20:18:14FromDiscord<Clyybber> cps is not invalidated by csp
20:18:29FromDiscord<Clyybber> cps is still essential
20:18:29Zevvno cps is invalidated by nim bugs :)
20:18:34FromDiscord<Clyybber> yeah
20:18:37disruptekof course.
20:18:42Zevvit is, and Im eagerly waiting for it to be usable again
20:18:56Zevvbecause I just go started making real things when it broke very much
20:18:59FromDiscord<Clyybber> don't wait
20:19:06disruptekwell, use 0.0.13?
20:19:11*bung quit (Ping timeout: 246 seconds)
20:19:13Zevvboooring
20:19:40FromDiscord<Clyybber> so which bug is blocking you know
20:19:42FromDiscord<Clyybber> now
20:19:48FromDiscord<Clyybber> the indent one or a different one?
20:19:53FromDiscord<Clyybber> I have to ix.ios here
20:20:03Zevvi think the idents yes
20:20:28FromDiscord<Clyybber> I'm still on 5691, so it will have to wait a bit
20:20:54Zevvtime I have, I have still half my life ahead of me
20:21:10Zevvoh wait I was planning to get to 120 at least
20:21:21disruptekit's kinda funny that we started off with a working leak-free arc impl and now it doesn't even compile under arc, nor does it work anywhere else.
20:21:35FromDiscord<Clyybber> dig into the compiler people
20:21:41FromDiscord<Clyybber> I know you can
20:22:04disruptekevery time i go there i'm mired for days.
20:22:08FromDiscord<Clyybber> haha
20:22:09disruptekit really takes a lot out of me.
20:22:11Zevvyeah
20:22:33FromDiscord<Clyybber> used to be the same here, but then something snapped
20:22:36disruptekturns out that mangling only passes all but one stdlib test.
20:22:37FromDiscord<Clyybber> my sanity probably
20:22:47Zevvhaha
20:22:49FromDiscord<Clyybber> disruptek: why is it failign the last one?
20:22:58disruptekwho cares.
20:23:05disruptekit fails all over on the tests outside of stdlib.
20:23:09FromDiscord<Clyybber> I, otherwise I wouldn't have asked
20:23:10FromDiscord<Clyybber> oh
20:23:39disruptekit's jsonutils, probably due to something timmy invented to ruin my life.
20:23:51FromDiscord<Clyybber> lol
20:24:14Zevvand really, doing compiler stuff feels too much like my work
20:24:27Zevvits mrs and feedback and reviews and unit tests and discussions
20:24:50Zevvi know its important stuff to do, i really do, but i have to cope with all that stuff al week
20:24:56FromDiscord<Clyybber> nah, look at my prs; they don't get much reviews nor discussions :P
20:25:26*bung joined #nim
20:25:28FromDiscord<--HA--> Can I define a type for a specifc form of table? like this Table[int, tuple[name: string, full: string]]
20:25:34disruptekyes.
20:25:36Zevvand every time i pr something trivial i get bikeshedded into oblivion
20:25:40FromDiscord<Clyybber> and only digging in to find out what or where it fails is good enough
20:25:52FromDiscord<Clyybber> Zevv: The trick is to PR stuff that nobody understands
20:25:56ZevvHA sure you can
20:26:19FromDiscord<Clyybber> Zevv: if your stuff is trivial its gonna get bikeshed over pretty hard
20:26:38Zevvclybber: i know, i did some pretty deep stuf fwith the memory allocs stuff that touch 100% of everbodys codeand no one cared
20:27:11Zevvand the vm stuff
20:27:38FromDiscord<--HA--> Zevv, how would that look like? I only know the type definition where you have to use keys
20:27:44Zevvbut then i want ot add a tiny 1 line macro to the stdlib that would make life easier, but forget it
20:27:55FromDiscord<Clyybber> which one?
20:28:26Zevvi dont know, the new ref constructor or something like that
20:28:36FromDiscord<Clyybber> you didn't pr that
20:28:38FromDiscord<Clyybber> I like it tho
20:28:40Zevvi dont think i even PRed that, it died from a thousand papercuts on irc
20:28:47FromDiscord<Clyybber> doesn't even have to be a macro
20:28:49FromDiscord<Clyybber> just a template
20:28:52FromDiscord<Clyybber> Zevv: Did it?
20:29:16Zevvanyway, jsut ranting and whining
20:29:32ZevvAH: sorry, im currently typing on mobile, its hard to throw out code at thsi moment
20:30:41Zevvfor clarity i would split it up, define a separate type for your value-part
20:31:10Zevvand then just do `type Thing = Table[int, Otherthing]`
20:32:00Zevvdisruptek: wait was all this stuff just magically fixed because you switchedto typed?
20:32:02FromDiscord<--HA--> Oh I wasn't aware of that. I thought it had to be type thing = tuple/object
20:32:09Zevvor did you do actual work fro that
20:32:26ZevvHA: no, you can type your heart out
20:33:13*bung quit (Ping timeout: 264 seconds)
20:33:37disruptekclyybber: so i can't simply replace a sym with a dotexpr. :-(
20:33:46FromDiscord<--HA--> Works perfectly, thanks Zevv. I missed that in the tutorial
20:37:50disruptekZevv: no, i have more than a couple commits to the typed branch to make it work. 😉
20:38:12disruptekactually, i haven't impl tuples but i will do so soon. i have the code commented out iirc.
20:39:08Zevvcool
20:39:36*bung joined #nim
20:39:42disruptek34 could be another thorny one.
20:40:56FromDiscord<Clyybber> disruptek: When?
20:41:14*clyybber quit (Quit: WeeChat 2.9)
20:41:43FromDiscord<Clyybber> when can't you do that
20:43:46FromDiscord<Clyybber> oh, I see the issue now
20:44:09FromDiscord<Clyybber> I'll dig into it tomorrow, getting some sleep
20:44:10*bung quit (Ping timeout: 260 seconds)
20:44:11FromDiscord<Clyybber> gn8 fellas
20:44:14disruptekaight, gn
20:44:20disruptekthanks for hacking.
20:46:44disruptekthis tramp booty thing doesn't work.
20:46:56Zevvthanks again clyybber
20:47:02Zevvoh works for me?
20:47:16Zevvmy iterator iterates like it should?
20:48:16*arecacea1 quit (Remote host closed the connection)
20:48:28*bung joined #nim
20:49:14*arecacea1 joined #nim
20:51:40disruptekit's an ambiguous call for me.
20:52:45*bung quit (Ping timeout: 240 seconds)
20:53:16disruptekoh, i'm on the wrong nim. 🤣
20:53:58*bung joined #nim
20:54:09Zevvnim_temp :)
20:54:21Zevvor, as I called mine, nim_clyybber
20:58:05*bung quit (Ping timeout: 240 seconds)
20:58:25disruptekwell, it still doesn't work.
20:58:34disruptekcps/cps.nim(510, 23) Error: expression 'result = continuation' has no type (or is ambiguous)
20:58:47disruptekwe should probably be using result in any event.
21:01:05*Trustable quit (Remote host closed the connection)
21:03:49*bung joined #nim
21:08:37*bung quit (Ping timeout: 264 seconds)
21:15:29*bung joined #nim
21:16:55FromDiscord<Kiloneie> Aren't object variants just objects with a field of enums as a variable to make them variants?
21:18:13FromDiscord<Elegant Beef> Well they also have the whole cant get a field from the wrong variant
21:18:35FromDiscord<Elegant Beef> But yes they're just an object with an enum field to limit the abillity to access fields
21:20:01FromDiscord<Kiloneie> Thanks
21:20:01*bung quit (Ping timeout: 264 seconds)
21:20:17FromDiscord<Elegant Beef> Making an object variant tutorial?
21:21:55*bung joined #nim
21:26:31*bung quit (Ping timeout: 256 seconds)
21:27:09*bung joined #nim
21:27:19*opi joined #nim
21:27:43*opal quit (Ping timeout: 240 seconds)
21:32:15*opal joined #nim
21:33:47*bung quit (Ping timeout: 240 seconds)
21:34:11*bung joined #nim
21:38:38*bung quit (Ping timeout: 246 seconds)
21:39:46FromDiscord<Kiloneie> uhmm yes, after reference objects one(which was supposed to be today but i had to go pick potatoes for a friend...)
21:40:05FromDiscord<Kiloneie> so 2 videos tomorrow(hopefully)
21:40:09*solitudesf quit (Remote host closed the connection)
21:40:42*bung joined #nim
21:41:07FromDiscord<Zachary Carter> you might want to let folks know that object variants are similar to tagged or discriminated unions
21:41:16FromDiscord<Zachary Carter> maybe not semantically but functionally
21:44:44*solitudesf joined #nim
21:45:05*bung quit (Ping timeout: 240 seconds)
21:46:46FromDiscord<Kiloneie> Okay, just after i google what that means. xD...
21:48:53*bung joined #nim
21:53:38*bung quit (Ping timeout: 256 seconds)
21:56:55*bung joined #nim
22:00:00*opi quit (Quit: Leaving)
22:01:38*bung quit (Ping timeout: 260 seconds)
22:04:17*bung joined #nim
22:08:55*FromDiscord quit (Remote host closed the connection)
22:09:12*FromDiscord joined #nim
22:11:02*awe00 joined #nim
22:12:56*awe004 quit (Ping timeout: 246 seconds)
22:17:30*bung quit (Ping timeout: 256 seconds)
22:20:11*bung joined #nim
22:28:26*lritter quit (Ping timeout: 256 seconds)
22:33:49*solitudesf quit (Ping timeout: 264 seconds)
22:38:29*bung quit (Ping timeout: 246 seconds)
22:40:39*bung joined #nim
22:43:12*vicfred quit (Quit: Leaving)
22:46:46*awe001 joined #nim
22:48:02*awe00 quit (Ping timeout: 256 seconds)
23:23:25*endragor joined #nim
23:28:02*krux02 quit (Remote host closed the connection)
23:31:59*endragor quit (Ping timeout: 265 seconds)
23:34:53*vicfred joined #nim
23:51:34*bung quit (Ping timeout: 256 seconds)
23:57:18*bung joined #nim
23:59:36*vicfred_ joined #nim