<< 03-11-2020 >>

00:00:16*abm quit (Ping timeout: 256 seconds)
00:05:22*mbomba joined #nim
00:18:11FromDiscord<Relix> is this the right channel to ask for help?
00:26:26FromDiscord<Yardanico> yes
00:28:45FromDiscord<Relix> sent a code paste, see https://play.nim-lang.org/#ix=2CPS
00:28:47FromDiscord<Yardanico> hmm, interesting, I didn't work with nimgl but I'll try to run this, how would I go about calling that proc?
00:28:59FromDiscord<Yardanico> also yeah, I've seen you typing this on your stream :)
00:32:40*mbomba quit (Quit: WeeChat 2.9)
00:35:05lmariscalHi Relix
00:35:22lmariscalI'm the maintainer (need to maintain more) of nimgl
00:39:27lmariscal@Relix what I'm seeing different from some other of my projects is that you are passing the addr of the data directly instead of the first object addr
00:39:33FromDiscord<Relix> turns out i was trying to create an image before initializing opengl, false alarm ๐Ÿ™‚
00:40:37lmariscalOh, okay. If you still have issues with the image data try passing it with `data[0].addr`
00:40:50lmariscal๐Ÿ‘
00:41:15FromDiscord<Relix> but apparently it still crashes on linux, and i think you were right, that was also one of the problems ๐Ÿ™‚ thank you!
00:43:04FromDiscord<Yardanico> @lmariscal yeah that fixed crashes on linux :P
00:44:18lmariscalYeah, I should make more precise typing, but as auto-generated bindings it is still too difficult ๐Ÿ˜ will have to experiment some
00:44:26lmariscalBtw, where is Relix streaming atm?\
00:45:28FromDiscord<Yardanico> https://www.twitch.tv/moscowwbish
01:28:17*Tanger joined #nim
01:42:50*krux02 quit (Remote host closed the connection)
01:52:23*opal quit (Ping timeout: 240 seconds)
01:55:21FromDiscord<notchris> Hey all, im getting an error on this procedure, I think it's because of the nesting? I included the error, any idea how to work around it? https://play.nim-lang.org/#ix=2CQ8
01:55:22*opal joined #nim
01:55:44ForumUpdaterBotNew post on r/nim by Lassii-: How to get the text inside a tag from parsed HTML?, see https://www.reddit.com/r/nim/comments/jn1hnn/how_to_get_the_text_inside_a_tag_from_parsed_html/
01:55:44FromDiscord<notchris> `illegal capture 'cb' because 'innercallback' has the calling convention: <cdecl>`
01:56:53FromDiscord<notchris> If i remove the for statement, and just echo a string, it doesn't complain
01:58:00mipricb closes over the 'this' variable in watch
01:58:08mipriwhich makes it a closure, a function + environment
01:58:12mipriC doesn't support such things.
01:58:49mipriso you need to find some other way to pass that information to the callback
01:59:17FromDiscord<notchris> ugh
01:59:22FromDiscord<notchris> I was afraid of that
01:59:33notchristy mipri
02:01:36FromDiscord<Yardanico> @notchris one way would be to have a global variable
02:01:41FromDiscord<Yardanico> that's how it's usually done in C I think
02:01:52FromDiscord<Yardanico> well, some libs provide special arguments you can use for your own data
02:01:55FromDiscord<Yardanico> but some don't
02:02:57FromDiscord<notchris> @Yardanico I was doing that originally, but I wanted to have the logic within the init procedure. It's not out of the question though, since it looks like a better way might be hard to find
02:03:17FromDiscord<Yardanico> well you can use the {.global.} pragma, but having an explicit global var would look better
02:03:27FromDiscord<Yardanico> I mean it'll work more predictably
02:04:43FromDiscord<notchris> That's true
02:11:42*apahl quit (Ping timeout: 260 seconds)
02:13:16*apahl joined #nim
02:25:57ForumUpdaterBotNew post on r/nim by asdaat: Multi-Insert Postgres Module, see https://www.reddit.com/r/nim/comments/jn1yxg/multiinsert_postgres_module/
02:41:30FromDiscord<dk> templates and async still don't mix well
02:43:17FromDiscord<Yardanico> use mixin
02:43:57FromDiscord<UNIcodeX> @Yardanico thanks. Was one char in middle of string. Had to go take care of a last minute client request so I didn't have time to keep at it.
02:44:14FromDiscord<Yardanico> well maybe you didn't get what I mean
02:44:21FromDiscord<Yardanico> if you have "mystrCHARmystr" then you can just do
02:44:23FromDiscord<Yardanico> "mystr$+mystr"
02:44:29FromDiscord<Yardanico> $+ will mach for 1 char too
02:44:33FromDiscord<Yardanico> (edit) "mach" => "match"
02:52:51FromDiscord<Theodore> @Theodore@PMunch yes
02:53:26FromDiscord<Theodore> IRC is good and that means bad
02:55:32FromDiscord<UNIcodeX> I was trying `"$i$+$i` to match something like "8e5", for example. I think it was possibly parsing properly at that point, but I'm not sure I had the correct type passed into `scanf`. It was giving me a type error on variable set to `char` type.โ†ต I'll probably mess with it some more tomorrow.
02:56:23FromDiscord<UNIcodeX> (edit) "`"$i$+$i`" => "`"$i$+$i"`"
03:04:35FromDiscord<Yardanico> you know you can parse floats right?
03:04:47FromDiscord<Yardanico> I mean strscans has $f for parsing a float
03:04:49disrupteksince when?
03:05:16FromDiscord<Yardanico> since the module was created
03:05:22disruptekall this time?
03:05:26FromDiscord<Yardanico> yes
03:05:34disruptekholy shit, we should tell someone.
03:05:35FromDiscord<Yardanico> https://github.com/nim-lang/Nim/commit/b357e8083340ac707acd466493f36e6422ecff07#diff-41b140463ade4172a3e99093d63aca84dbac00662419fc28e0d0b5f14887634eR35
03:09:11FromDiscord<UNIcodeX> It's not a float. Looks like one though. It's short for 1/8 note, E, 5th octave.
03:09:43disruptekare you rewriting S.C.O.R.E?
03:12:57*muffindrake quit (Ping timeout: 260 seconds)
03:14:52*madpata_ joined #nim
03:15:12FromDiscord<UNIcodeX> This post came across my browser and I thought it looked like it would be fun to play around with. https://zserge.com/posts/nokia/
03:15:12*muffindrake joined #nim
03:17:54FromDiscord<notchris> Is there a way to say, capture a webcam stream via nim, looking at os
03:18:04disrupteklooking at os?
03:18:26*madpata quit (Ping timeout: 256 seconds)
03:18:48FromDiscord<notchris> Ah sorry, that's the part of the doc im currently looking in, wasn't sure if it was already built in somewhere
03:23:35FromDiscord<Yardanico> well not via the stdlib for sure, maybe opencv or something
03:38:18FromDiscord<Avatarfighter> if you're on UNIX I wouldn't be surprised if you can open the file descriptor for the camera and read the data straight from it tbh
03:38:33disruptekthe what
03:38:42FromDiscord<Avatarfighter> idk the terms
03:38:48FromDiscord<Avatarfighter> /device/somethinghere
03:39:17FromDiscord<Avatarfighter> /dev/video I guess
03:40:00FromDiscord<Avatarfighter> I guess what would've been more correct is you can open the file path for the camera and just read raw data from it
03:40:06notchrishmmmm
03:40:36FromDiscord<notchris> @Avatarfighter But how would i invoke capture?
03:41:27FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5fa0d167f2fd4f60fc4dc77c]
03:41:59FromDiscord<Avatarfighter> @notchris I think its just as easy as opening the device with `open("path_to_device")` and reading
03:42:52FromDiscord<Avatarfighter> You can probably take this https://gist.github.com/mike168m/6dd4eb42b2ec906e064d and convert it straight to nim
03:43:07FromDiscord<Avatarfighter> but that's linux specific so idk if you're on linux
03:43:21FromGitter<gogolxdong> Any way to raise singal correctly with Sighandler?
03:49:24FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5fa0d344dc70b5159aeb3812]
03:49:48FromGitter<gogolxdong> seems have to use {.noconv.} pragma?
03:53:03*eburk quit (Quit: WeeChat 2.9)
04:03:42FromDiscord<notchris> Hey all, not sure what happened, I'm on OSX, whenever I try to run a nim app, im now getting `error: unable to open output file '/Users/chris/.cache/nim/main_d/stdlib_system.nim.c.o':โ†ต 'Operation not permitted'` out of the blue
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:34*supakeen joined #nim
04:09:22jonjitsu[m]What's the easiest way to turn a homogenous tuple of strings into a seq/array to run strutils.join on?
04:19:06FromDiscord<ElegantBeef> Uncertain if this is a good method but i'd imagine something like this is fine https://play.nim-lang.org/#ix=2CQs
04:23:11FromDiscord<notchris> Ah fixed, it was my cache
05:28:24*apahl quit (Ping timeout: 240 seconds)
05:29:34*apahl joined #nim
06:06:00*Tlangir joined #nim
06:08:37*Tanger quit (Ping timeout: 264 seconds)
06:17:24*waleee-cl quit (Quit: Connection closed for inactivity)
06:18:53*narimiran joined #nim
06:37:30*solitudesf joined #nim
07:05:05*tane joined #nim
07:12:04FromDiscord<tinygiant> sent a long message, see http://ix.io/2CQN
07:15:03FromDiscord<ElegantBeef> `var.typeof`
07:15:36FromDiscord<ElegantBeef> Unless i misunderstand
07:17:07FromDiscord<tinygiant> @ElegantBeef thanks. I'm done for the night, but I'll try again in the morning. I did a lot of searching and never hit on that one. I guess my search skills are waning in my old age.
07:24:34FromDiscord<nikki> is there a reasonable way to return a 'readonly view' into a seq that's in an object?
07:25:01FromDiscord<nikki> could return `openArray[Elem]` with the new view borrow stuff ... but i haven't enabled that
07:25:44FromDiscord<nikki> i guess `seq` is already by reference so i could just return that and just strongly recommend not modifying it :p
07:34:17*Vladar joined #nim
07:34:47FromDiscord<ElegantBeef> Isnt `lent` just a feature of 1.4.0?
07:46:05FromDiscord<nikki> i'm not sure but i think returning a view type counts as 'assigning to a local variable' in https://nim-lang.github.io/Nim/manual_experimental.html#view-types -- or at least, i just get "result can't be assigned to"
07:46:13FromDiscord<nikki> so; that would need the experimental feature
07:47:01FromDiscord<ElegantBeef> Ah yea it seems you're right, i havent read much about the ownership system
07:48:11FromDiscord<ElegantBeef> Clearly you just make a distinct type and override assignment to say "Bitch you thought"
08:01:39*lritter joined #nim
08:06:21*lritter quit (Client Quit)
08:06:39*lritter joined #nim
08:07:30*vicfred quit (Remote host closed the connection)
08:07:56*vicfred joined #nim
08:10:31*krux02 joined #nim
08:28:44*apahl quit (Ping timeout: 240 seconds)
08:31:02*apahl joined #nim
08:35:08*PMunch joined #nim
08:38:39*tane quit (Quit: Leaving)
08:44:11PMunchHmm @dom96, what happened to my IRCLogs redesign?
08:49:23*vicfred quit (Quit: Leaving)
08:53:20Yardanico!status
08:53:22FromDiscordUptime - 1 week, 6 days, 13 hours, and 16 minutes
08:59:25PMunchThis DBUS bug still annoys me..
09:19:59PMunchAh, it appears to be a threading bug
09:20:18PMunchApparently the dbus library is threaded, but the Nim dbus wrapper doesn't take this into account
09:22:38PMunchSo the seq in the object that is only passed around by a pointer is at some point touched by the GC and that messes things up
09:22:42PMunchWhich makes sense
09:23:06PMunch--gc:arc makes the bug disappear, but I'm not confident it's not just hiding..
09:23:57FromDiscord<Varriount> Gotta make sure to increment and decrement those references at the right time
09:24:49FromDiscord<Varriount> Surely dbus has some sort of mechanism to free user allocated memory at the correct time?
09:24:56FromDiscord<lqdev> how does tuple comparison work? so, for instance, how am i able to do `NimVersion >= (1, 4, 0)`? what does `>=` return in that case?
09:27:08PMunchVarriount, well it's a bit of a mess. I can pass it a void* into it's handler thing. Then when it calls any of the registered procedures it will call the procedure with that pointer as the argument
09:27:28PMunchCurrently the implementation has a sequence in the object it passes along with the nil pointer
09:29:52PMunchIt has a maxWatches of 128 though, so I could really just allocate a 128 pointer array...
09:33:46narimiran@lqdev we ususally do `when (NimMajor, NimMinor) >= (1, 3)`, and it works by comparing the first fields, then the second fields, then the third, etc.
09:34:13FromDiscord<lqdev> yea i found it in system.nim's source
09:34:19FromDiscord<lqdev> i half-expected it to be a magic
09:40:21*Tlangir quit (Quit: Leaving)
09:44:42*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:46:44FromDiscord<Varriount> PMunch: Can't you just increment the reference count of the reference object holding the sequence?
09:46:58PMunchThere is no reference object
09:47:23PMunchThis is the code: https://github.com/zielmicha/nim-dbus/blob/master/dbus/loop.nim#L4
09:48:19PMunchAs you can see in create (L28-L40) it calls `create` on MainLoop (and changing it to `createShared` doesn't help) and then passes that pointer to the dbus procedure)
09:49:27FromDiscord<Varriount> Where is the MainLoop object created?
09:51:29*David0 joined #nim
09:52:02*David0 quit (Remote host closed the connection)
09:52:02FromDiscord<Varriount> I mean, I see `create(MainLoop)`, but that appears to be a infinitely recursive call
09:53:32PMunchNo, that is create from system
09:53:45PMunchWhich takes a typedesc and allocates memory
09:53:54PMunchBut it is owned by the current thread
09:54:30ZevvDon't do threading kids. It's bad for you
09:54:36Zevvmkaaaay
09:55:30PMunchHaha :P
09:55:44PMunchUnfortunately this is wrapping a C library, so I don't have much choice in the matter
09:55:46FromDiscord<Varriount> PMunch: Would incrementing the reference count of the sequence work?
09:55:54PMunchDunno, maybe
09:56:19PMunchBut the fact that I don't know kinda rubs me the wrong way
09:56:20FromDiscord<Varriount> ^ The universal answer
09:56:35PMunchAnd where would I increase it?
09:56:40FromDiscord<Varriount> Isn't there some sort of GC debug define?
09:56:57PMunchGood question actually
09:59:48PMunchThis works: http://ix.io/2CRq
10:00:02PMunchSimply by not using GCed memory in that object
10:00:39PMunchBut this should potentially have some `setupForeignThreadGC` statements sprinkled around as well..
10:00:51PMunchNot quite sure what dbus' threading model is
10:01:23FromDiscord<Varriount> Another way would be to have a double reference to the sequence
10:02:27FromDiscord<Varriount> One reference in the object, that is incref'd, and which references memory that contains the sequence.
10:02:57PMunchBut how would you keep track of when to deref it?
10:03:11PMunchNot that the MainLoop object is ever free'd..
10:03:46FromDiscord<Varriount> type SeqRef[T] = ref Seq[T]
10:04:22FromDiscord<Varriount> PMunch: To be honest, I would try to rewrite all that code to be a bit more safe.
10:04:50FromDiscord<Varriount> No calls to create, just allocate a regular reference
10:05:11PMunchYeah.. The whole thing is a bit hairy..
10:05:40FromDiscord<Varriount> cast the pointer to a reference when dbus calls the callback, though that assumes it's calling it in the correct thread
10:05:59PMunchMhm, which it might not afaik
10:06:45PMunchOh wait..
10:06:59PMunchDbus itself doesn't actually seem to be threaded..
10:07:30PMunchBut why does it mess up the seq then?
10:09:27PMunchBecause the seq is directly in the object?
10:10:17FromDiscord<Varriount> Does create return zero'd memory?
10:10:29PMunchYup
10:10:43PMunchAnd it messes it up mid-program
10:11:04PMunchAll of a sudden the seq reports a len of 121 and some of the arguments are obviously corrupted
10:11:39FromDiscord<Varriount> Also, I'm unclear what happens to the reference count when, say, `add` is called on a sequence that is nil, and so it allocates the sequences
10:11:58Araqseqs in arc don't have a refcount btw
10:11:59FromDiscord<Varriount> allocates memory for the sequence
10:12:21FromDiscord<Varriount> Because MainLoop is a pointer
10:12:23Araqalso we need a good name for the "hash table of bitsets"
10:12:28Araqsee https://github.com/nim-lang/Nim/pull/15564
10:12:29disbotโžฅ Make IntSet a generic ordinal set OrdSet[A]
10:12:45AraqI think BitSet is a bit too misleading, system.set is a bitset
10:12:54FromDiscord<Varriount> BitSoup
10:13:03Araqour IntSet is a two level data structure
10:13:20FromDiscord<Varriount> BitTable?
10:14:07PMunchWhat do you mean they don't have a refcout?
10:14:09Araqwell the interface is set-like, not table-like
10:14:17FromDiscord<Varriount> PMunch: I don't know if you saw it, but I made a comment above
10:14:30AraqPMunch, well they don't. it's not like they need it, you know
10:14:54PMunchWell, I don't know.. I haven't really read up on how ARC actually works
10:15:03PMunchAt the moment I just treat is as dark magic
10:15:36FromDiscord<Varriount> PMunch: If `add` is called on a nil sequence, it allocates memory for the sequence and increments its reference count.
10:16:26FromDiscord<Varriount> But that might not hold true, when the sequence is being held in memory pointed to by a pointer
10:16:57FromDiscord<Varriount> Araq would know
10:17:20FromDiscord<Varriount> Goodnight
10:17:41PMunchOh yeah, I know that part
10:17:43PMunchGood night
10:17:47AraqHashBitSet?
10:17:53PMunchHmm, a RefSeq didn't work..
10:18:04PMunchHashedBitSet?
10:19:11PMunchHmm, GC_ref on the RefSeq works, but that's nasty
10:19:23PMunchStill not 100% sure why this is a problem though
10:19:33PMunchOh wait
10:19:57PMunchIs it because since MainLoop is allocated with `create` it can't be traversed by the GC?
10:20:06PMunchSo it never finds the reference to the seq and frees it
10:24:08FromDiscord<lqdev> FastSet?
10:26:11FromDiscord<ElegantBeef> HashFlags, BitFlags, HashBitSet
10:30:53*madpata_ quit (Ping timeout: 260 seconds)
10:31:12FromDiscord<Varriount> SetBucket, BitBuckets (heh)
10:32:12FromDiscord<Varriount> Maybe something using the noun "sheet" (like spreadsheet)?
10:32:27FromDiscord<Varriount> BitSheet?
10:36:03FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2CRE
10:36:52FromDiscord<flywind> This is rendered results from `liftLambdas` function.
10:50:38Araqwell it's a nkVarSection so that's where the C codegen handles it
10:51:50FromDiscord<flywind> Thanks! Could JS backend handle clousre?
10:52:22*Tanger joined #nim
10:54:10FromDiscord<flywind> Yea JS backend can't handle closure after `liftLambdas`.
10:54:54FromDiscord<flywind> I will look into `vmgen` instead.
10:57:21ForumUpdaterBotNew thread by Fxn: Idiomatic function call coding style?, see https://forum.nim-lang.org/t/7025
11:13:43FromDiscord<Recruit_main707> how can you skip the next iteration of a for loop?
11:14:47FromDiscord<lqdev> `continue`
11:15:44FromDiscord<Recruit_main707> doesnt `continue` skip the rest of the current one?
11:16:15FromDiscord<Rika> it skips everything in the for but below the continue
11:16:23FromDiscord<Rika> (edit) "but" => "that is also"
11:28:07*madpata joined #nim
11:39:13FromDiscord<Yardanico> @Recruit_main707 for that you'll need to have some intermediate variable
11:39:16FromDiscord<Yardanico> Like I
11:39:19FromDiscord<Yardanico> i
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:32*supakeen joined #nim
12:17:07*Vladar quit (Remote host closed the connection)
12:23:39*Vladar joined #nim
12:36:45FromDiscord<tinygiant> sent a code paste, see https://play.nim-lang.org/#ix=2CSb
12:36:57FromDiscord<tinygiant> (edit) "https://play.nim-lang.org/#ix=2CSb" => "https://play.nim-lang.org/#ix=2CSc"
12:38:11FromDiscord<Rika> what issues are you having?
12:38:15FromDiscord<Rika> like errors i mean
12:40:43FromDiscord<tinygiant> sent a code paste, see https://play.nim-lang.org/#ix=2CSf
12:41:03FromGitter<gogolxdong> https://play.nim-lang.org/#ix=2CSg
12:41:29FromGitter<gogolxdong> Isn't cstring array expected to work with [] indexing operator?
12:43:35FromDiscord<Rika> gogolxdong yes it should, thats a strange error you are getting
12:44:00FromDiscord<Rika> @tinygiant well what is the error exactly?
12:51:09*mmohammadi9812 quit (Quit: Quit)
12:51:24*mmohammadi9812 joined #nim
12:52:39*mmohammadi9812 quit (Client Quit)
12:52:55*mmohammadi9812 joined #nim
13:05:47*abm joined #nim
13:06:12*mmohammadi9812 quit (Ping timeout: 260 seconds)
13:09:00*mmohammadi9812 joined #nim
13:11:49FromDiscord<tinygiant> One sec, have to step away for an unexpected occurrence. Be back in about 45 minutes. Thane for the replies.
13:17:14PMunchSorry everyone, my bedroom is on fire, AFK
13:17:56ZevvIf that came from disdruptek I would not be worried
13:18:02FromDiscord<Rika> pmunch are you serious
13:18:06FromDiscord<Vindaar> "my bedroom is on fire" eh, I hope you're kidding, otherwise all the best mate!
13:18:18PMunchHaha, it's an old IRC meme :P
13:18:25FromDiscord<Vindaar> oh haha
13:18:37PMunchhttp://bash.org/?60469
13:19:03Zevvooh he knows bash.org
13:19:28PMunchPfft, I keep a local copy of the top 200 in case the site goes doewn :P
13:19:40PMunchhttp://bash.org/?top http://bash.org/?top2 <- for the uninitiated
13:20:18FromDiscord<lqdev> oh yes bash.org
13:21:10Zevvhow do all the kids know that stuff
13:21:11FromDiscord<lqdev> the second top one reminds me of r/SUBREDDITNAME
13:21:27PMunchI still use hunter2 for all my throwaway and default passwords :P
13:21:31FromDiscord<lqdev> Zevv: idk, somebody posted it somewhere and that's how i found out about it
13:21:41FromDiscord<lqdev> i don't remember
13:21:57PMunchHaha, what is that subreddit :P
13:22:28PMunchI think they teach it in history classes now Zevv
13:22:53PMunchI'm actually surprised the site is still up
13:26:12Oddmongerdisruptek , excuse me to disturb you but i have an issue with gitnim : a nimble package tests if nim's version >= 1.4.0 . I'm using the latest available on gitnim (1.4rc) , but this one returns 1.3.7 as version number. What can i do (except modify the check in the nimble package config) ? Thank you
13:33:28Zevvdisruptek is asleep
13:34:21FromGitter<gogolxdong> How to declare an empty enum?
13:35:19mipria type with no possible values? why?
13:36:52*mipri tries it with 'void' ... void gets redefined as the single value of the enum
13:37:30FromGitter<gogolxdong> because enum with values are in a invalid order, and it's an field of an object.
13:38:22mipriI don't follow. so you do have an enum that does have values?
13:39:01FromGitter<gogolxdong> actually an unordered enum would help. Is there unordered enum?
13:39:47miprido you mean a *range* of enum values that doesn't have to be ordered? no. but maybe you can make do with a set of enum
13:42:58PMunchgogolxdong, what are you trying to do?
13:48:51FromDiscord<Vindaar> @tinygiant I don't quite understand the problem you have. Why are the accessors generic if `FieldType` is just an enum? This works: https://play.nim-lang.org/#ix=2CSz
13:52:06*Tlangir joined #nim
13:54:38*Tanger quit (Ping timeout: 264 seconds)
14:18:43jonjitsu[m]is it possible to name a module the same as a core module? Like can I create my own sequtils module and call it that and still be able to import it somehow?
14:19:51*NimBot joined #nim
14:25:59narimiranyes
14:29:22jonjitsu[m]so if I create my own sequtils.nim and want to import the core sequtils how would I reference it? It gives me a circular dependency error...
14:30:16FromDiscord<Rika> `import std/sequtils`
14:33:08*Vladar quit (Remote host closed the connection)
14:35:27jonjitsu[m]thx
14:46:05ForumUpdaterBotNew thread by Vitaliy: SIGSEGV on Android, see https://forum.nim-lang.org/t/7026
14:48:07jonjitsu[m]How do we run runnableExamples?
14:48:22Yardanicojonjitsu[m]: nim doc file.nim
14:48:31Yardanicothey are tested when you make documentation
14:48:38*Tlangir quit (Ping timeout: 264 seconds)
14:54:53*JStoker quit (*.net *.split)
14:55:45*madpata quit (Ping timeout: 240 seconds)
14:55:53*JStoker joined #nim
14:56:10*JStoker quit (Max SendQ exceeded)
14:56:34*JStoker joined #nim
14:57:09*unclechu quit (Ping timeout: 246 seconds)
14:57:26*themoon[m] quit (Ping timeout: 268 seconds)
14:57:26*BitPuffin quit (Ping timeout: 240 seconds)
14:57:29*lum[m] quit (Ping timeout: 270 seconds)
14:57:29*Avatarfighter[m] quit (Ping timeout: 244 seconds)
14:57:30*leorize[m]1 quit (Ping timeout: 270 seconds)
14:57:30*leorize[m] quit (Ping timeout: 270 seconds)
14:57:37*lnxw37d4 quit (Ping timeout: 260 seconds)
14:57:57*Helios quit (Ping timeout: 272 seconds)
14:59:07*reversem3 quit (Ping timeout: 244 seconds)
14:59:15*planetis[m] quit (Ping timeout: 246 seconds)
14:59:37*nikki93[m] quit (Ping timeout: 246 seconds)
14:59:37*hnOsmium0001[m] quit (Ping timeout: 246 seconds)
14:59:56*MTRNord[m] quit (Ping timeout: 240 seconds)
15:00:35*GitterIntegratio quit (Ping timeout: 244 seconds)
15:00:40*jonjitsu[m] quit (Ping timeout: 244 seconds)
15:00:40*ee7[m] quit (Ping timeout: 244 seconds)
15:00:40*Jitty[m] quit (Ping timeout: 244 seconds)
15:00:45*jrhawley[m] quit (Ping timeout: 240 seconds)
15:00:56*inamiyar[m] quit (Ping timeout: 240 seconds)
15:16:30*waleee-cl joined #nim
15:26:42*themoon[m] joined #nim
15:26:59*lnxw37d4 joined #nim
15:27:03*unclechu joined #nim
15:27:24*lum[m] joined #nim
15:27:27*Avatarfighter[m] joined #nim
15:27:32*leorize[m] joined #nim
15:27:55*leorize[m]1 joined #nim
15:29:44*tane joined #nim
15:30:22*nikki93[m] joined #nim
15:31:54*planetis[m] joined #nim
15:32:04*BitPuffin joined #nim
15:32:10*Helios joined #nim
15:35:22*natrys joined #nim
15:41:57*jrhawley[m] joined #nim
15:42:03*ee7[m] joined #nim
15:42:08*Jitty[m] joined #nim
15:42:12*jonjitsu[m] joined #nim
15:42:19*inamiyar[m] joined #nim
15:43:38*reversem3 joined #nim
15:47:01*lnxw37d4 quit (Quit: Bridge terminating on SIGTERM)
15:47:02*unclechu quit (Quit: Bridge terminating on SIGTERM)
15:47:02*leorize[m] quit (Quit: Bridge terminating on SIGTERM)
15:47:02*lum[m] quit (Quit: Bridge terminating on SIGTERM)
15:47:02*leorize[m]1 quit (Quit: Bridge terminating on SIGTERM)
15:47:02*themoon[m] quit (Quit: Bridge terminating on SIGTERM)
15:47:02*Avatarfighter[m] quit (Quit: Bridge terminating on SIGTERM)
15:47:03*BitPuffin quit (Quit: Bridge terminating on SIGTERM)
15:47:03*planetis[m] quit (Quit: Bridge terminating on SIGTERM)
15:47:05*ee7[m] quit (Quit: Bridge terminating on SIGTERM)
15:47:05*jonjitsu[m] quit (Client Quit)
15:47:09*nikki93[m] quit (Quit: Bridge terminating on SIGTERM)
15:47:09*jrhawley[m] quit (Quit: Bridge terminating on SIGTERM)
15:47:09*inamiyar[m] quit (Client Quit)
15:47:09*Helios quit (Quit: Bridge terminating on SIGTERM)
15:47:10*Jitty[m] quit (Quit: Bridge terminating on SIGTERM)
15:47:10*reversem3 quit (Client Quit)
15:49:13FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5fa17bf9dc70b5159aed2c3d]
15:51:29*vicfred joined #nim
15:57:06FromGitter<gogolxdong> and koch errors ``` โŽ /mnt/c/Nim/koch temp c ffplay.nim โŽ /mnt/c/Nim/tools/kochdocs.nim(200) kochdocs โŽ /mnt/c/Nim/lib/pure/os.nim(2139) getDocList โŽ /mnt/c/Nim/lib/pure/includes/oserr.nim(94) raiseOSError ... [https://gitter.im/nim-lang/Nim?at=5fa17dd1d37a1a13d68401c6]
15:59:15*inamiyar[m] joined #nim
16:03:40*habamax joined #nim
16:12:27FromDiscord<tinygiant> @Vindaar It's an enum, but the accessor function uses it to define a pointer. The data is kept in a binary file and different types of data are stored in different areas of the files. Sending the type tells the accessor tells the function where to look within the binary file for that particular type of data.
16:12:37disruptekoddmonger: the latest gitnim release is 1.4, not 1.4rc.
16:12:52FromDiscord<tinygiant> (edit) "tells" => "to"
16:13:01Yardanicowho is disruptek
16:13:04disruptekoddmonger: i'm not allowed to talk about nimble bugs anymore.
16:13:29FromDiscord<Vindaar> @tinygiant sorry, without more context I don't understand
16:13:50FromDiscord<tinygiant> Yep, I'm going to try a couple more experiments and then write up a better problem statement.
16:13:58FromDiscord<Vindaar> sounds good!
16:15:16*natrys quit (Ping timeout: 246 seconds)
16:20:27*narimiran quit (Ping timeout: 260 seconds)
16:21:42disruptekoddmonger: i just pushed 1.0.10, 1.2.8, 1.4.1, 1.5.1 releases.
16:22:44*themoon[m] joined #nim
16:22:44*hnOsmium0001[m] joined #nim
16:22:44*brainbomb[m] joined #nim
16:22:45*reversem3 joined #nim
16:22:45*lnxw37d4 joined #nim
16:22:45*planetis[m] joined #nim
16:22:45*Helios joined #nim
16:22:45*leorize[m]1 joined #nim
16:22:45*stisa[m] joined #nim
16:22:45*BitPuffin joined #nim
16:22:45*Avatarfighter[m] joined #nim
16:22:45*MTRNord[m] joined #nim
16:22:45*unclechu joined #nim
16:22:45*leorize[m] joined #nim
16:22:45*jaens[m] joined #nim
16:22:45*GitterIntegratio joined #nim
16:22:45*k0mpjut0r joined #nim
16:22:50*solitudesf1 joined #nim
16:22:51*ee7[m] joined #nim
16:22:51*nikki93[m] joined #nim
16:22:51*jonjitsu[m] joined #nim
16:22:51*guelosk[m] joined #nim
16:22:51*Jitty[m] joined #nim
16:22:51*lum[m] joined #nim
16:22:52*jrhawley[m] joined #nim
16:22:52*VijayMarupudi[m] joined #nim
16:30:16disruptekalso removed 1.4rc tag since i guess it confuses people.
16:31:08*natrys joined #nim
16:43:48Oddmongerthank you disruptek
16:46:33*habamax quit (Ping timeout: 265 seconds)
16:53:45*hnOsmium0001 joined #nim
17:02:56*NimBot joined #nim
17:07:14*TomDotTom quit (Ping timeout: 264 seconds)
17:15:06FromDiscord<Recruit_main707> toSeq could convert an iterator to a sequence right?
17:17:25FromDiscord<traveledit> fat discord mods
17:17:45FromDiscord<traveledit> dead server
17:18:19FromDiscord<Zachary Carter> I think you mean phat discord mods
17:20:21FromDiscord<Zachary Carter> @Recruit_main707 yes
17:20:34FromDiscord<Zachary Carter> it will transform iterables to sequences
17:21:35FromDiscord<Recruit_main707> ok thanks
17:21:40FromDiscord<Zachary Carter> No problem
17:39:51*PMunch quit (Quit: leaving)
17:40:43FromDiscord<exelotl> phat bass
17:40:53FromDiscord<Avatarfighter> Has anyone here used nim-libp2p and have written code with it
17:55:11*NimBot joined #nim
18:00:55FromDiscord<Avatarfighter> lmao did <@!529028553896099850>join to shit on the mods and leave
18:00:56*narimiran joined #nim
18:01:15FromDiscord<Zachary Carter> well in all fairness, he shit on the server as well
18:01:34FromDiscord<Zachary Carter> (edit) "he" => "they"
18:01:35FromDiscord<Recruit_main707> he didnt leave though
18:01:42FromDiscord<Avatarfighter> yeah he did
18:01:42FromDiscord<Recruit_main707> so ban him :P
18:01:44FromDiscord<Zachary Carter> they logged off apparently
18:01:55FromDiscord<Avatarfighter> https://media.discordapp.net/attachments/371759389889003532/773245585032871936/Screen_Shot_2020-11-03_at_10.01.50_AM.png
18:02:03FromDiscord<Recruit_main707> if you can ping him he is inside i think
18:02:06FromDiscord<Avatarfighter> no
18:02:13FromDiscord<Avatarfighter> its because I pinged manually
18:02:15FromDiscord<Zachary Carter> meh, I don't think what they did was necessarily a bannable offense
18:02:23FromDiscord<Recruit_main707> @dtracers#1111
18:02:27FromDiscord<Avatarfighter> this is a manual ping `<@214051108107059200>`
18:02:30FromDiscord<Recruit_main707> ah
18:02:42FromDiscord<Avatarfighter> replace the numbers with the users discord id
18:02:50FromDiscord<Avatarfighter> and then it'll ping
18:02:54FromDiscord<Avatarfighter> you can also do channels
18:02:59FromDiscord<Avatarfighter> like this
18:03:02FromDiscord<Avatarfighter> #moderator-only
18:03:12FromDiscord<Recruit_main707> oof
18:03:25FromDiscord<Avatarfighter> `#moderator-only`
18:03:30FromDiscord<Avatarfighter> that is for channels
18:04:00FromDiscord<Recruit_main707> how do you get the numbers though
18:04:31FromDiscord<Avatarfighter> turn on developer mode in discord and then right click on anything and do "Copy ID"
18:05:56FromDiscord<Yardanico> @Zachary Carter we had two similar ones
18:06:07FromDiscord<Zachary Carter> ah
18:07:11disruptekOddmonger: i didn't realize someone was using gitnim or i'd be more religious about tracking releases and nightlies, etc.
18:07:45FromDiscord<Recruit_main707> is Oddmonger speaking?
18:08:28FromDiscord<Yardanico> no, disruptek is replying to old messages
18:08:51Zevvhe's a bit slow
18:08:56FromDiscord<Recruit_main707> lol
18:09:32disruptekit's hard to internet without electricity.
18:09:55Zevvon cloudy days disruptek is at 300bps
18:10:05FromDiscord<Recruit_main707> make your hamster run faster
18:10:31FromDiscord<nikki> is there a way to get the refcount of a given ref, if i'm using arc? or is that just not exposed
18:10:44Oddmongerdisruptek: i'm sure i'm not the only one to use it :)
18:10:56Oddmongeri've found gitnim very handy and easy to use
18:10:56ForumUpdaterBotNew thread by CHEEMS96: How exactly do i start?, see https://forum.nim-lang.org/t/7027
18:11:13disruptekneat.
18:11:28disruptekhas it ever not worked?
18:12:59disruptekadfbe7c664c619980779f30ebd64c2db63c13d49 was the first 1.5.1 dist, btw.
18:13:29*habamax joined #nim
18:14:01disrupteknikki: there are some templates to interact with the rc. in the manual, i think.
18:14:24disruptek~gitnim
18:14:25disbotgitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek
18:14:32disruptekmore use reports, please. super fun.
18:15:37Zevvon cloudy days disruptek is at 300bps
18:15:49FromDiscord<nikki> will look ... another possibility is also if you can have a weak ref that can "know" its target was destroyed
18:15:55disruptekhow'd you know it was cloudy?
18:16:14disruptekno, we don't have those really-rather-not-weak refs.
18:16:31FromDiscord<nikki> the usecase is to have a cache of resoursces by name that i can return a ref from in the "manager," but if everyone else dropped refs then the manager drops it from the cache
18:16:50disruptekwell, again, you can look at the counter.
18:16:58FromDiscord<nikki> i could just remove from cache in the =destroy of the resource ๐Ÿค” and keep the cache one a cursors
18:17:02FromDiscord<nikki> yeah will check that out
18:20:18disruptekclyybber: i made a new project that demonstrates one of the typed macro problems. it's of much narrower scope than cps, so you may find it helpful.
18:20:21disruptek!repo carnac
18:20:22disbothttps://github.com/disruptek/carnac -- 9carnac: 11magical function memoization across runtimes 15 0โญ 0๐Ÿด
18:23:17disruptekor maybe i will find it helpful, if you can point out my mistake.
18:23:25disruptekit's cloudy today.
18:25:44FromDiscord<Avatarfighter> disruptek: are you using cellular for internet ?
18:25:54disrupteknope.
18:26:27FromDiscord<Avatarfighter> Have you considered getting a plan at Straight Talk or Google Fi for basically unlimited data?
18:26:55disruptekno, lte service is very spotty here.
18:27:08FromDiscord<Avatarfighter> Straight Talk caps at 2TB of data while Google Fi unlimited plan is unlimited till they decide you've used too much, you'll probably get better speeds that what you currently have
18:27:15FromDiscord<Avatarfighter> T-Mobile is spotty where you're at?
18:27:47disruptekafaik, yes. but i haven't researched it very deeply because it's pointless.
18:28:01disruptekall my hopes and prayers rest with starlink.
18:28:12FromDiscord<Avatarfighter> Dude I'm so hyped for starlink
18:28:30FromDiscord<Avatarfighter> I'm literally moving to the middle of nowhere in a forest if it works well
18:28:42disruptekyeah, that's about where i am.
18:29:19FromDiscord<Avatarfighter> So what I'm hearing is I'm moving in with you ๐Ÿ˜›
18:29:21disruptekthinking about digging a hole to canada, depending on how this thing goes.
18:29:43*opal quit (Ping timeout: 240 seconds)
18:29:46disruptekthis forest isn't big enough for the both of us.
18:30:00FromDiscord<Avatarfighter> ๐Ÿ™„
18:30:20disruptekdon't worry, as far as you're concerned, that's a good thing.
18:31:05FromDiscord<Avatarfighter> lmaooo
18:31:43*opal joined #nim
18:32:16disruptekthis is crazy.
18:32:23disruptekhow do i not have inkscape installed?
18:32:36FromDiscord<Avatarfighter> this is a great question
18:32:45FromDiscord<Avatarfighter> better warm up that 300kbps connection to get it
18:33:00disruptekhell no, that's 1.5hrs on the bike.
18:33:15FromDiscord<Avatarfighter> rip
18:33:23disruptekno software is worth pedalling. i save my bandwidth for porn.
18:33:43FromDiscord<Avatarfighter> How far are you from a net cafe disruptek
18:33:49disrupteka what?
18:33:59FromDiscord<Avatarfighter> and that answers my question
18:34:07FromDiscord<Avatarfighter> lmaoo
18:34:22disruptekkids today.
18:34:44FromDiscord<Avatarfighter> my bad
18:34:56supakeenok gramps
18:35:33supakeenhuh i guess disruptek *is* the gramps of the nim community
18:35:48FromDiscord<Avatarfighter> don't disrespect our elders supakeen smh
18:36:08supakeenalways a bit angry, doesn't like new things, has been here forever
18:36:39disrupteki will be two in nim years in april.
18:36:51disruptekthe terrible twos, they call it.
18:37:32FromDiscord<Avatarfighter> i wonder when i first appeared in the irc logs
18:37:41FromDiscord<Avatarfighter> i think its been like a year and half since
18:38:19Zevvirc/2019/01/18:08:29 #nim: < FromDiscord_> <Avatarfighter> Is there an equivalent of getattr from python in nim? What I'm trying to do is get a type's field with a string version of the fields name but i'm having trouble actually using the string to get anything from the type.
18:38:29FromDiscord<Avatarfighter> lmao
18:38:32FromDiscord<Avatarfighter> welp that's embarrasing
18:39:20disrupteki had to read it three times before i understood it.
18:39:26FromDiscord<Avatarfighter> same
18:39:27FromDiscord<Avatarfighter> I think someone told me that with templates I can do `type.fields`
18:39:40Zevvirc/2017/07/13:12:50 #nim: < Zevv> Hi, is the documentation on https://nim-lang.org/docs/httpclient.html#AsyncResponse compatible with Nim 0.16.0? I'm trying to get async HTTP requests working, but I get the error "Error: invalid pragma: async"
18:39:41FromDiscord<Avatarfighter> English has never been my strongest language
18:39:54FromDiscord<Avatarfighter> awwww
18:40:02FromDiscord<Avatarfighter> Zevv's first steps with async ๐Ÿ˜
18:40:17Zevvthat's how it all got started. That was my first hour if Nim :)
18:40:19FromDiscord<lqdev> Zevv: i wanna know where i appeared
18:40:28FromDiscord<lqdev> when
18:40:29Zevvyou had too many nicks
18:40:35FromDiscord<lqdev> lqdev was my first one
18:40:53disruptekwhat's the significance of liquid?
18:41:05disrupteki can almost grok the meaning of `dev`.
18:41:21FromDiscord<lqdev> it's none. it's just a word that sounded cool to me back in 2014.
18:41:46disruptekman, you have so many more cool words in store for you.
18:41:46FromDiscord<Avatarfighter> I cannot wait for when nim-libp2p gets detailed docs
18:41:52Zevvnot liquid600pgm?
18:41:57disruptektry this one: RIM JOB
18:42:06disrupteki mean, it's two words, really.
18:42:12disruptekbut, awesome, right?
18:42:15FromDiscord<lqdev> Zevv: that may be the case
18:42:18Zevvirc/2019/03/05:17:50 #nim: < FromGitter> <liquid600pgm> hello!
18:42:20FromDiscord<lqdev> yeah i think you're right
18:42:29Zevvsee, that's a friendly guy
18:42:41FromDiscord<Avatarfighter> hey disruptek have you used nim-libp2p
18:42:48disrupteknope.
18:43:02disrupteki'm gonna port gun.
18:43:14disruptekthat will be my p2p lib.
18:43:23FromDiscord<Avatarfighter> gun?
18:43:29disruptekyeah.
18:43:31FromDiscord<Avatarfighter> 9mm or a real library
18:44:01FromDiscord<Avatarfighter> 5.56 or 7.62 or .45 ?
18:44:04disruptekhttps://gun.eco/
18:44:24*casaca quit (Remote host closed the connection)
18:44:35FromDiscord<Avatarfighter> ah so its not a firearm
18:44:45disrupteknot this one.
18:44:51disruptekyou said person to person, right?
18:45:11FromDiscord<Avatarfighter> yeah
18:45:12disrupteki don't gun p2p. i'm more of a ratta-tatt-tatt-blamo.
18:45:14FromDiscord<Avatarfighter> peer-to-peer
18:45:18FromDiscord<Avatarfighter> :L
18:45:37disruptekoh, fuck my peers. what have they ever done for me?
18:47:58FromDiscord<Avatarfighter> good question
18:52:59ForumUpdaterBotNew thread by G5becks: Nim control flow based type analysis, see https://forum.nim-lang.org/t/7028
18:59:16disruptekwhen you use gitnim, you don't have a single version of nim. you have all versions of nim.
19:03:49PrestigeThe code in that thread is weird, I'm curious about it, too
19:04:30disruptekwhat thread?
19:04:35Prestigehttps://forum.nim-lang.org/t/7028
19:05:17FromDiscord<Avatarfighter> good thing the nimions are on it
19:05:26disruptekit's a guy trying to reduce a test.
19:05:32Prestigeah I see
19:07:10FromDiscord<Avatarfighter> i am so excited for nim-libp2p guys
19:07:27disruptekoh yeah?
19:08:02FromDiscord<Avatarfighter> im literally reading the code as if its a book
19:08:07FromDiscord<Avatarfighter> im SO excited
19:08:33FromDiscord<Avatarfighter> as soon as the DHT capabilities are added I'm done in life
19:10:24FromDiscord<Avatarfighter> im going to make the worst p2p chat client known to man once DHT is supported
19:10:38*MultDiv joined #nim
19:11:44MultDivDoes anyone know what algorithm is used for floating point multiplication/division in Nim?
19:11:58MultDivI tried to look into the source code and couldn't really tell.
19:13:03FromDiscord<lqdev> it's CPU-dependent
19:14:40MultDivOkay, gotcha. Was just absentmindedly profiling them to see if there is a way to get speed gains.
19:15:24disruptekthere is, but they beat you to it: change the cpu.
19:16:38MultDivlol, fair.
19:17:22MultDivI'm used to python so Nim is blazing fast, hell I think I could code using an arduino and I'd still think nim was performant as hell.
19:17:41disruptekyeah, when you come from python there's a shitload of headroom.
19:19:06disruptekwhat's great about nim, though, is that you can write idiomatic code /and it's fast/ -- it's fast to read, fast to write, and runs fast.
19:19:37disruptekit's not like you're paying penalties to write what you want.
19:19:49disruptekthat's what drove me nuts about python.
19:20:08disrupteki can either write elegant, expressive code, or i can write fast code. never both.
19:26:17MultDivYeah I do like that idiomatic code is fast. I'm just playing around with learning closer to realtime/high frequency stuff so I'm trying to be conscious of speed.
19:30:49disruptekit makes sense. nim is a game of cycles.
19:30:57disruptek!repo criterion
19:30:58disbothttps://github.com/LemonBoy/criterion.nim -- 9criterion.nim: 11Statistic-driven micro-benchmark framework 15 37โญ 4๐Ÿด 7& 1 more...
19:31:05disruptek!repo disruptek/criterion
19:31:05disbothttps://github.com/disruptek/criterion -- 9criterion: 11statistics-driven micro-benchmarking framework 15 8โญ 0๐Ÿด
19:31:08disruptekuse my fork.
19:31:37FromDiscord<Avatarfighter> lmao
19:31:59MultDivlol what's in your fork that isn't in the original?
19:32:08FromDiscord<Avatarfighter> his name top left
19:32:23MultDivlol
19:32:30FromDiscord<Avatarfighter> jokes ofc
19:32:36disrupteki fixed a couple things, and it's in important packages so we can keep it working.
19:32:58disrupteklemonboy is the finest nim programmer that i've ever seen.
19:33:08MultDivYeah I was using nimbench but I like that this gives more data.
19:34:27FromDiscord<Avatarfighter> looks like lemonboy is using zig now
19:34:35disruptekyeah.
19:34:47FromDiscord<Recruit_main707> who?
19:35:06FromDiscord<Avatarfighter> https://github.com/LemonBoy
19:36:43FromDiscord<Recruit_main707> i have opposite but strong feelings right now, he made a hombrew loader for the wii, used nim, but uses zig....
19:36:56FromDiscord<Recruit_main707> (edit) "hombrew" => "homebrew"
19:37:00narimiranhe was a great contributor to nim
19:38:46FromDiscord<Rika> Did he just move on or did something specific happen
19:38:49FromDiscord<nikki> how strict are the rules for accessing unexported (no ``) fields outside of the module? it seems like ... i'm able to access it
19:39:03narimiranpolitics
19:39:06FromDiscord<Rika> Youโ€™re not supposed to be able to access it
19:39:33FromDiscord<Rika> Nikki did you include it or import it
19:39:45FromDiscord<nikki> import
19:40:47disruptekthat would be very odd if true.
19:40:55FromDiscord<nikki> i have a global `var` of type `T` exported out of a module, and `T` has some unexported field that i'm able to access
19:41:10FromDiscord<nikki> lemme see if i can make a minimal repro case that i can post
19:44:08FromDiscord<nikki> ah hmm is it bc. the code is written in a body passed to a template that's defined in that module ๐Ÿ˜ฎ
19:44:47disruptektemplates aren't dirty by default.
19:45:09disruptekbut that said, it could be a bug.
19:45:19FromDiscord<nikki> yeah repro'd with the template thing in a minimal example
19:45:45disruptekhmm, that's... really tricky.
19:46:13disruptekyou can put any code you want in there.
19:46:19disruptekspooky action at a distance.
19:47:46FromDiscord<nikki> https://gist.github.com/nikki93/1081cb653455b7bb2145db4af04b46f3
19:47:47FromDiscord<nikki> the example
19:48:19FromDiscord<nikki> disruptek: do you know if i can somehow explicitly tell the template to ... not do that
19:48:22disruptekif i bindsym in a passed template body... where am i bindsym'ing?
19:48:31disruptekit has to be the original code, right?
19:48:51disruptekwhere else?
19:48:57*mbomba joined #nim
19:49:26disruptekso now i can import that into your module and monkey-patch it.
19:49:50*lritter quit (Ping timeout: 264 seconds)
19:50:45FromDiscord<nikki> by 'original' do you mean the use-site or the defn-site of the template
19:51:08FromDiscord<nikki> depends on perspective haha so can't tell
19:51:11disrupteki guess we can control this with typed/untyped.
19:51:53*MultDiv quit (Remote host closed the connection)
19:51:58FromDiscord<nikki> hmm. i guess if i did this as a `do` parameter to a proc then it wouldn't have the issue
19:52:35disruptekyou pull these bound symbols in at the declaration site, so that's fine. they will fail in a typed version.
19:53:25FromDiscord<nikki> oh interesting, yeah in 'typed' it works out
19:53:35FromDiscord<nikki> i should really read up on the difference across those...
19:54:01disruptektyped is the exciting part, but it's a super tiny needle right now.
19:54:29disrupteki should probably stream bugfixing it.
19:54:31*TomDotTom joined #nim
19:54:42FromDiscord<Avatarfighter> yes
19:54:44FromDiscord<Avatarfighter> yes you should
19:54:55FromDiscord<Avatarfighter> disruptek when is the youtube channel getting created ๐Ÿค”
19:55:08disruptekstarlink first.
19:55:24FromDiscord<Avatarfighter> ok
19:55:36FromDiscord<Avatarfighter> did you sign up for the public beta?
19:55:45disruptekyeah.
19:55:51disrupteka couple times. ๐Ÿ˜
19:56:08FromDiscord<Avatarfighter> ok that's exciting I hope they pick you for the next rounds of the beta
19:56:24FromDiscord<nikki> maybe i should just make everything typed until i find that i'm not able to write some code i want to write with some given template xD
19:56:51disruptekmost people don't even give their templates argument types.
19:57:14disruptekmaybe i look like an asshole for doing it.
19:57:21FromDiscord<nikki> i see. so ... my usecase here was kind of for a control structure, that doesn't really do anything anaphoric or anything
19:57:40disruptekhold-on, lemme look up anaphoric.
19:57:52mipriunhygienic macro
19:57:59disruptekahhh, triple-letter, double word score.
19:58:09FromDiscord<nikki> do i win
19:58:17disruptekit would be hard for me to catch up.
19:58:26FromDiscord<nikki> i'll remember this one
20:20:18notchrisdom96: is it expected that nim open-cv cant access the osx camera
20:22:22FromDiscord<dom96> Possibly, wouldn't be surprised if Apple has locked down things
20:22:38FromDiscord<dom96> But that wouldn't be specific to Nim
20:24:05FromDiscord<Avatarfighter> opencv can in python
20:24:09FromDiscord<Avatarfighter> its probably the wrapper
20:26:40FromDiscord<dom96> I would find a sample in C and compare to the Nim version
20:26:42FromDiscord<Avatarfighter> Or Python's opencv wrapper has custom code but idk
20:26:47FromDiscord<Avatarfighter> yeah
20:26:48FromDiscord<dom96> (assuming the C one works)
20:40:46FromDiscord<nikki> is it safe to remove elements from a `Table[T, U]` by key while iterating through it
20:41:21mipriit should be, but I believe there's an assertion that'll complain
20:41:47mipriyou can push to-be-removed keys to a seq and remove elements in a separate pass
20:47:41FromDiscord<notchris> @dom96 I think it'd because it uses new methods to access the camera, there was a warning about the current wrapper having deprecated methods
20:47:52FromDiscord<notchris> (edit) "it'd" => "it's"
20:48:27FromDiscord<notchris> And to be clear it didn't error, it simply just came back nil for the camera source
20:50:00FromDiscord<notchris> I feel like Apple has locked things down though, I was telling my coworkers today about how I cant run execProcess or execCmd to start an application and keep it running, it will instantly close
20:50:09FromDiscord<notchris> while in a normal shell (outside of vscode) it works fine
20:50:25FromDiscord<notchris> Thats after giving vscode full permissions etc
20:50:51FromDiscord<dom96> The wrapper is like 4 years old+, but updating shouldn't be too bad. PRs appreciated
20:51:04FromDiscord<notchris> Ill do my best, might be above my skill level
20:51:17FromDiscord<notchris> Ill try and check it out after work today
20:55:30*narimiran quit (Ping timeout: 258 seconds)
21:06:34*habamax quit (Ping timeout: 260 seconds)
21:14:13*casaca joined #nim
21:14:43FromDiscord<nikki> is there a way to specify flags like `--gc:arc` from within the file itself? would be nice for one-off test files in this sandbox directory where i'm playing with nim
21:14:49FromDiscord<nikki> like some sort of pragma or sth
21:16:01*casaca quit (Remote host closed the connection)
21:16:30disrupteknot yet.
21:16:53mipriyou can put that in a nim.cfg in the directory with that file
21:16:53FromDiscord<Recruit_main707> no, i just make a main file that compiles and runs the code i want to test with different flags
21:17:07FromDiscord<Yardanico> yes, you can do that
21:17:22FromDiscord<nikki> @Yardanico how?
21:17:43FromDiscord<nikki> mipri: oh yeah; aware of that approach. just wanted to see if there was a lightweight within-file way for silly test files
21:17:46FromDiscord<Yardanico> oh
21:17:48FromDiscord<Yardanico> there's no way for that
21:18:18mipriif you use nimcr you can pass flags on the second line
21:18:27miprihttps://github.com/PMunch/nimcr - last part, Options for the nim compiler
21:18:50FromDiscord<nikki> oh cool ๐Ÿ˜ฎ
21:19:29*natrys quit (Quit: natrys)
21:19:59miprithe final thing you can do is throw tasks in a yourmod.nimble that selfExec to compile with whatever flags
21:20:22disruptekthat would be too obvious.
21:20:42FromDiscord<nikki> disruptek: i wasn't able to find a way to get the rc on nim refs, but i did a wrapper 'holder' object with the referred obj maintaining my own refcount: https://play.nim-lang.org/#ix=2CVK
21:21:11FromDiscord<nikki> the usecase is basically for resources in this game engine thing; where game objects can ask the graphics manager for an image handle given a file path, and if the image is already loaded it just returns a handle to that
21:21:56FromDiscord<nikki> i want to do the pass of going over and clearing away 0-refcount images explicitly in a cleanup phase at the end of the frame, so the common scenario of exiting a scene and loading a new one doesn't lead you to unload and reload images that are common between the scenes
21:22:15FromDiscord<nikki> (or eg. it still stores images around in the cache for a few frames / some time or something)
21:22:38FromDiscord<nikki> still a nim n00b so the code probs sux in some ways lolz
21:24:00*casaca joined #nim
21:24:18FromDiscord<lqdev> you could just assign the values nil
21:24:31FromDiscord<lqdev> and load them lazily
21:24:41FromDiscord<lqdev> but i guess then unloading is a problem
21:25:05FromDiscord<nikki> which values? but yeah unloading is half or more than half of the point of the impl
21:25:13FromDiscord<lqdev> values in the table
21:25:28FromDiscord<lqdev> like {"myresource": nil}
21:25:32FromDiscord<lqdev> and fetching would load the resource
21:25:32FromDiscord<nikki> ah and then load if not loaded when rendering? sure that's fine
21:25:56FromDiscord<lqdev> i generally prefer loading resources at the start of the application
21:26:07FromDiscord<nikki> but yeah unloading automatically when game objects don't exist anymore is definitely part of the idea
21:26:08FromDiscord<lqdev> it's an easier approach that has faster performance
21:26:31FromDiscord<nikki> oh ok. that's interesting bc. your suggestion was to make it lazy haha
21:26:31FromDiscord<lqdev> but uses more memory
21:26:32*madpata joined #nim
21:26:41*ChanServ quit (shutting down)
21:27:05FromDiscord<nikki> yeah the main thing is to give a flexible api where; if you wanted to load everything upfront you just create and have a bunchof holders that live forever
21:27:35FromDiscord<nikki> maybe i'll just do the load everything approach now tho -- not sure bc. the art in the game is a lot of hand-drawn stuff that is kinda high-res
21:30:00FromDiscord<nikki> this is more for the gpu texture resource than the image data in memory itself. i might still just have all the image data in memory at start anyways
21:38:05FromDiscord<whisperdev> I just noticed D has a crown on it on reddit
21:44:15*mbomba quit (Quit: WeeChat 2.9)
21:50:01*solitudesf quit (Ping timeout: 264 seconds)
22:09:11*tane quit (Quit: Leaving)
22:22:40FromDiscord<ElegantBeef> Anyone else think that โ†ต`import module` instead of `import module` followed by `export module` is a nice idea?
22:26:26*krux02 quit (Quit: Leaving)
22:28:09*Jesin quit (Quit: Leaving)
22:37:09*Jesin joined #nim
22:39:33FromGitter<jrfondren> is there something lost in translation there?
22:39:51FromGitter<jrfondren> are those two 'import module's not supposed to be the same?
22:43:41FromDiscord<ElegantBeef> I mean my point is using the export marker instead of the follow up of export
22:43:58FromDiscord<ElegantBeef> When using the entire module/exporting it it reduces redundant typing but contains the same information
22:44:35FromGitter<jrfondren> ok, so what's lost in translation is an asterisk
22:45:01FromDiscord<ElegantBeef> ah yes irc logs show a > instead
22:45:25FromGitter<jrfondren> I don't have any strong feelings about it.
22:46:37FromDiscord<ElegantBeef> I suppose a more reasonable alternative is simply just a `ximport` or similarly named macro
22:47:24FromGitter<jrfondren> I'd see that a much less reasonable alternative actually. how many times a day are you exporting modules?
22:48:03FromDiscord<ElegantBeef> I dont think that matters as much as the fact it's sort annoying to have to rewrite what you've already written but slightly different
22:48:13FromGitter<jrfondren> well the nice thing with templates is that you can define them on the spot where you use them
22:48:47FromDiscord<ElegantBeef> Well a template wouldnt work afaik since the import needs a path and the export is just the module name
22:49:31FromGitter<jrfondren> ah yeah
22:49:34FromDiscord<ElegantBeef> But eitherway was more of a question of "What's the feeling towards an import/export"
22:56:00FromDiscord<ElegantBeef> It's very much just a case of as i'm working on this game project i have a lot of `import` followed by `export` without any selective exporting, so seems very redundant
23:00:26FromGitter<sealmove> what are all the available types for a discriminator?
23:01:08FromGitter<sealmove> int from 0 to 65535, string, what else?
23:01:47FromDiscord<ElegantBeef> For object variants?
23:03:10FromDiscord<ElegantBeef> sent a long message, see http://ix.io/2CWi
23:03:15FromGitter<sealmove> yes
23:03:30FromDiscord<ElegantBeef> So seems ordinals and strings?
23:03:50miprian enum. not a pointer. if you're wanting to discriminate on a pointer being null, look at the source to std/options
23:04:10FromGitter<sealmove> i know you can only use ordinals in range 0 .. 65535 and that you can also use strings
23:05:24FromGitter<sealmove> wait, does string work? not sure actually
23:07:55*mbomba joined #nim
23:08:03FromGitter<sealmove> hmm ok I guess only ordinal in range 0 .. 65535; basically intended for enums only
23:10:50FromDiscord<ElegantBeef> Yea and bools only work due to the fact they're actually ordinals
23:11:23FromGitter<sealmove> yeah, and specifically in range 0 .. 65535
23:11:59FromGitter<sealmove> Is there an alternative to object variants for runtime typing?
23:12:16FromGitter<sealmove> I really love them but this limitation is important for my use case
23:12:23mipriOOP, I suppose.
23:12:44FromGitter<sealmove> methods don't work at CT
23:13:51FromGitter<sealmove> oh never mind
23:14:09FromGitter<sealmove> hmm ok I will check if OOP is suitable, thx
23:22:01FromGitter<jrfondren> ah man, what a painful error
23:22:18FromGitter<jrfondren> I changed an array[4096, char] out for a newString(4096)
23:22:27FromGitter<jrfondren> but still passed buf.addr as the thing to be written to
23:31:55FromDiscord<Gyllou> hiya
23:39:20FromDiscord<ElegantBeef> Hello
23:46:35FromGitter<sealmove> hmm i can create artificial enums that correspond to specific values of the "real" discriminator
23:48:39FromGitter<sealmove> for example if I want to switch types depends on whether a string has the value "hey", "hoy" or "hiy", I could make an `artificialEnum = enum case0, case1, case2` and when creating the object, if the string has the value "hey" then I use artificialEnum.case0, if it has the value "hoy" then use artificialEnum.case1, and so on.
23:49:44FromDiscord<ElegantBeef> Time to go make the macro to make the (string, enum) table, and the enums ๐Ÿ˜„
23:50:39FromGitter<sealmove> yup, takes more work to generate this kind of code, but it gives true type switching with a discriminator or arbitrary type
23:57:16FromGitter<sealmove> this kind of code: https://play.nim-lang.org/#ix=2CWq