<< 06-11-2020 >>

00:00:23disruptekyou can convert X to Box-holding-X-or-Y-or-Z and then you have a HashSet[Box].
00:00:39Prestigeah.
00:00:59disruptekif you want to unbox automagically, you can do that, too.
00:03:13*astronavt quit (Ping timeout: 260 seconds)
00:08:02*krux02 quit (Quit: Leaving)
00:10:23ForumUpdaterBotNew thread by Fxn: SIGILL: Illegal operation with an var parameter, see https://forum.nim-lang.org/t/7039
00:22:28*mbomba joined #nim
00:37:47*astronavt joined #nim
00:41:13FromDiscord<tinygiant> Iterating over a sequence, I need to delete some entries after evaluation. Deleting in place throws an error. I can think of a couple different ways to mark them for deletion after the loop completes, but wondering if there's a best practice way to do this in nim.
00:49:34miprino, the best option obviously depends on the data. if you don't want to think about I'd just add what should be saved to a new seq.
00:51:20FromDiscord<tinygiant> That's was going to be my goto. It's just a set of keys (strings). Thanks!
00:52:33FromDiscord<ElegantBeef> Curious about the data you have/logic to remove
00:54:05*nekits07 quit (Ping timeout: 240 seconds)
00:55:31FromDiscord<ElegantBeef> @tinygiant cause depending on your data there is the `sequtils` which can filter out unwanted values in more elegant matter
00:56:51PrestigeI have a hashset with a single item. When I iterate over the set and compare if item == myItem, it is true. After, I check if mySet.contains(myItem), it is false. What's up with this? My item is a ref object, if that matters here
00:58:14FromDiscord<tinygiant> Essentially need to compare a sequence in one file with the same sequence in another file. If both have the sequence existing, combine them, if one is missing, neither should have them, so have to delete that sequence member. But if it's from the one I'm iterating over, it throws an error. @ElegantBeef
01:00:18PrestigeIt seems like the object is cloned or something, instead of using the same ref?
01:00:29FromDiscord<ElegantBeef> What's your hash func?
01:00:49Prestigehmm it's using the pointer
01:01:00Prestigeer, unsafeAddr
01:01:19FromDiscord<tinygiant> @ElegantBeef That sounded odd after I read it. I'll try again. I have two files, both with the same set of keys, but different values. Some of the values are themselves sequences. Some files have these sub-sequences, some don't. If they both have the key with a sub-sequence, I need to combine the sub-sequences into one and put it into the first file. If the second file is missing the sub-sequence, but the first one has it, need to
01:01:28FromDiscord<ElegantBeef> The address of the ref, dont you want `t[].unsafeaddr`?
01:01:32FromDiscord<ElegantBeef> where T is your object
01:02:29Prestigeaha, that was it. Thanks
01:02:40PrestigeI didn't realise I was getting the wrong addr
01:04:13FromDiscord<ElegantBeef> Hey i'm surprised i caught it myself https://play.nim-lang.org/#ix=2Dbd
01:04:39FromDiscord<ElegantBeef> Was just making sure i was right with that link
01:05:02PrestigeYeah I hadn't thought about it, great catch. Was driving me crazy
01:05:49*abm quit (Quit: Leaving)
01:06:25FromDiscord<ElegantBeef> @tinygiant ah yea that specialized logic is something you'll need to write
01:06:47FromDiscord<ElegantBeef> If it was just keeping values based off conditions, sequtils has you covered πŸ˜„
01:07:41FromDiscord<tinygiant> @ElegantBeef Copy thanks. It's already done, just wanted to get a feel for the "nim-right" way to mark the keys for deletion. sequtils has the delete procedure, but I don't think I'll know the indices. Thanks for your time.
01:08:30FromDiscord<ElegantBeef> No problem
01:12:47*Q-Master quit (Read error: Connection reset by peer)
01:13:01*Q-Master joined #nim
01:22:22*Tanger joined #nim
01:24:10*TomDotTom quit (Remote host closed the connection)
01:25:09*TomDotTom joined #nim
01:28:40FromDiscord<AmjadHD> sent a code paste, see https://play.nim-lang.org/#ix=2Dbh
01:29:12FromDiscord<ElegantBeef> Cause block is scoped
01:29:38FromDiscord<ElegantBeef> The () behaviour is weird
01:30:00FromDiscord<AmjadHD> Yeah it doesn't feel right
01:30:25FromDiscord<ElegantBeef> what you wrote doesnt compile
01:30:36FromDiscord<ElegantBeef> the `let name =`
01:30:50FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Dbi
01:32:30FromDiscord<AmjadHD> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2Dbj
01:33:26FromDiscord<AmjadHD> I wrote it on the phone
01:36:35ForumUpdaterBotNew thread by Skylabin: Psutil package creation for ARM on Raspberry Pi OS, see https://forum.nim-lang.org/t/7040
01:38:28PrestigeI'm trying to use a glob in a nimble task to run tests multiple directories down - it works in my shell, but not from a nimble task. Is there a better way to do this, or have it behave as if it were ran from my shell? I'm using:
01:38:30Prestigefor i in tests/**/*.nim; do nim c -r --multimethods:on "$i"; done
01:38:55PrestigeIt seems to only get the files in the first level of tests
01:47:36disruptekwell, yeah, glob isn't a think despite attempts to pr otherwise.
01:47:42disrupteks/think/thing/
01:48:16disruptekjust write a 3-line walkdir.
01:48:23*bunbunbunbunny joined #nim
01:48:42FromDiscord<ElegantBeef> @AmjadHD well if you can get a runnable example i'd like to see it πŸ˜„
01:55:05FromDiscord<ElegantBeef> Assuming you mean something like this https://play.nim-lang.org/#ix=2Dbo
01:55:29FromDiscord<ElegantBeef> `()` can be used for grouping logic visually but as the AST shows it doesnt do anything aside from taht
02:03:40*nekits07 joined #nim
02:13:38FromDiscord<nikki> hmm seems like there's no way to mark parameters as `{.cursor.}` right πŸ€”
02:14:09FromDiscord<nikki> i guess i could take a `ptr` and do `.addr`
02:22:29*apahl_ joined #nim
02:25:30*apahl quit (Ping timeout: 260 seconds)
02:34:40*dom96 quit (Ping timeout: 256 seconds)
02:35:14*go|dfish quit (Ping timeout: 256 seconds)
02:38:45*dom96 joined #nim
02:38:45*dom96 quit (Changing host)
02:38:45*dom96 joined #nim
02:40:26*go|dfish joined #nim
02:46:04FromDiscord<treeform> @disruptek and @Clyybber , So I wrote this: https://github.com/treeform/uriiy thoughts?
02:57:49Prestigelooks useful
03:10:14*muffindrake quit (Ping timeout: 264 seconds)
03:11:19FromDiscord<Rebel> Hypothetically speaking is it possible to write a linux rootkit in Nim? If possible hypothetically speaking of course how hard would it be to write on a scale from 1-10?
03:11:19bungCan I simply get table's data bytes size ?
03:12:16*muffindrake joined #nim
03:22:57Prestige@Rebel depends on what your rootkit is doing, and your experience with writing them :P
03:23:41FromDiscord<Rebel> Translating from C to nim while following a pretty decent guide?
03:24:39PrestigeStill depends on what the rootkit does. Should just give it a shot
03:26:23FromDiscord<ElegantBeef> Why does it matter prestige?
03:27:41PrestigeDoing things like altering specific memory addresses might be annoying, or learning how to disable the GC and manually manage the memory
03:28:03PrestigeIf you already have C experience it might be easier to just write it in C
03:28:37FromDiscord<Rebel> ftrace hooking, backdooring root (by hooking kill), backdooring PRNGs by interfering with char devices, hiding kernel modules from userspace, and hiding directories.
03:29:37FromDiscord<Rebel> I know I can write in C lol just curious if it was possible to write in Nim for fun?
03:30:06PrestigeShould be possible afaik
03:32:34FromDiscord<Rebel> Guess you gotta just give it the old scientific method.
03:33:55FromDiscord<ElegantBeef> It's possible
03:34:02FromDiscord<ElegantBeef> You can always use Nim like C with fancy features
03:34:49*mbomba quit (Quit: WeeChat 2.9)
03:35:17FromDiscord<nikki> yeah u can basically call out to any C function or even just emit particular C code from nim
03:35:37FromDiscord<nikki> and i think the 0-10 difficulty would be mostly composed of the difficulty of the topic itself vs. the C / Nim difference in this case
03:58:21*vicfred quit (Quit: Leaving)
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:33*supakeen joined #nim
04:28:14FromDiscord<iWonderAboutTuatara> is there a way for me to get the sha 256 of a file?
04:29:05FromDiscord<iWonderAboutTuatara> I don't mind remaking the wheel, if it isn't as horrible as jpeg encoding
04:30:24FromDiscord<ElegantBeef> Nim's got a md5 module which gets the checksum
04:31:39FromDiscord<ElegantBeef> You could use the nimcrypto package possibly but idk, i know it has sha256
04:32:07FromDiscord<iWonderAboutTuatara> I'll look into both of those
04:32:22FromDiscord<iWonderAboutTuatara> actually that's a very good point, I don't need the hash necessarily I just need the checksum
04:32:25FromDiscord<iWonderAboutTuatara> md5 is enough
04:32:27FromDiscord<iWonderAboutTuatara> thanks!
04:32:31*mbomba joined #nim
04:33:06FromDiscord<ElegantBeef> No problem
04:58:59*astronavt quit (Ping timeout: 265 seconds)
05:02:36*Tlangir joined #nim
05:02:37*bunbunbunbunny quit (Ping timeout: 264 seconds)
05:04:27FromDiscord<tinygiant> WIth a `for xxx in yyy`, is it possible to make `xxx` mutable without introducing a new variable or is it always immutable?
05:05:06*Tanger quit (Ping timeout: 260 seconds)
05:07:30FromDiscord<Recruit_main707> There is a way, lemme search for the iterator
05:09:42*Jesin quit (Ping timeout: 256 seconds)
05:10:06FromDiscord<ElegantBeef> `for x in y.mitems` is the norm for the stdlib
05:10:18FromDiscord<Recruit_main707> Yes
05:10:19FromDiscord<ElegantBeef> most iterators in the stdlib have a `m` version which is mutable
05:10:21FromDiscord<tinygiant> Meh, I didn't make my question robust enough. In my case, I can't control the `yyy` (i.e. I can't iterate `yyy.mitems`) as it's the result of an assignment from a library I can't modify. I assume this means I can't have a mutable `xxx` without an additional assignment.
05:10:47FromDiscord<ElegantBeef> Well if the iterator doesnt exist you can make it possibly
05:10:52FromDiscord<ElegantBeef> What's the object?
05:13:05*bunbunbunbunny joined #nim
05:13:15FromDiscord<tinygiant> Recursing through a large set of `key:value` data. I thought about creating a custom iterator, but I'm not sure exactly what makes up the `yyy` (it's buried deep in the bowels of a proprietary library), so not sure I can create an iterator for it.
05:14:18FromDiscord<Recruit_main707> So, you can do for xxx in yyy:, but not for xxx in yyy.mitems: ?
05:15:12FromDiscord<ElegantBeef> the `mitems` isnt magical it requires to be implemented `for x in y` internally calls `items` so sadly seems there isnt a great way of handling it, what library is this if i may ask?
05:16:21FromDiscord<tinygiant> In house custom stuff, unfortunately. Would be nice if it was more accessible, but alas ...
05:17:27FromDiscord<ElegantBeef> Ah damn
05:17:40*bunbunbunbunny quit (Ping timeout: 246 seconds)
05:17:55FromDiscord<tinygiant> Heh, I say that constantly on this project.
05:18:09FromDiscord<tinygiant> Well, maybe with a different word.
05:21:28FromDiscord<tinygiant> Well, here's another one:↡↡If I have a `Type2` that is a ref object of `Type1`, is it possible to pass a mutable `Type2` into a procedure requiring a `var Type1`? I keep getting an error saying that it's expecting `Type1`, but got `Type2`. However, when I change the procedure to require a `Type1` instead of a `var Type1`, I can pass `Type2` all day long.
05:22:36FromDiscord<Recruit_main707> Pretty sure neither of those should work
05:22:55FromDiscord<ElegantBeef> Well var doesnt really matter for references
05:23:29FromDiscord<ElegantBeef> I guess the `var Type1` requires explict conversion whereas the `Type1` is implictly convertable
05:23:41FromDiscord<ElegantBeef> Probably for methods
05:23:48FromDiscord<ElegantBeef> And i guess procs
05:25:30FromDiscord<ElegantBeef> Point and proof i guess https://play.nim-lang.org/#ix=2DbW
05:26:05FromDiscord<Recruit_main707> His Type1 is not a ref object afaik
05:26:15FromDiscord<ElegantBeef> > If I have a Type2 that is a ref object of Type1
05:26:36FromDiscord<ElegantBeef> Inheritance really should be done with ref types in Nim as without it things get off
05:27:39FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2DbX
05:27:45FromDiscord<tinygiant> @ElegantBeef Thanks for that example, I'll see if that'll get my proc to work the way I want it to.
05:28:54FromDiscord<ElegantBeef> I dont know if what i posted is a bug or just not supposed to work
05:30:06FromDiscord<ElegantBeef> @tinygiant like i said though for ref objects var isnt needed
05:32:55FromDiscord<tinygiant> Well ---> `Error: unhandled exception: wanted to read 4 but only got 0 [IOError]` I don't even know what that means. ↡↡So, if `Type1 = ref object of RootObj` and `Type2 = ref object of Type1`, can I send a `Type2` into a procedure for modification, or would it have to be assigned as a return from the procedure? It's not accepting the implicit modification method (the `var Type1` method) when I send a `Type2` into it.
05:33:32FromDiscord<ElegantBeef> you can pass it into a procedure that doesnt have `var`
05:33:49FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Dc0
05:33:55FromDiscord<ElegantBeef> Implictly converted here
05:34:07FromDiscord<ElegantBeef> the `var` is the issue i guess
05:35:05FromDiscord<tinygiant> Yep, I want to modify the Type2, but need to receive a Type1 because the proc recurses itself on a Type1 field. Meh, I think I'll have to rework the design a bit. Thanks for your time. I failed, but I learned something.
05:35:49FromDiscord<ElegantBeef> Wait what's the issue?
05:36:07FromDiscord<ElegantBeef> You can look at methods or i can quickly show you something
05:36:18FromDiscord<tinygiant> What's that?
05:36:31FromDiscord<ElegantBeef> Methods or what i can show you?
05:36:40FromDiscord<tinygiant> Latter.
05:37:44FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Dc2
05:37:50FromDiscord<ElegantBeef> You can cast internally to the types
05:37:55FromDiscord<ElegantBeef> But i'd really just suggest methods
05:39:21*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:39:28*njoseph joined #nim
05:40:38FromDiscord<tinygiant> Which methods do you speak of?
05:40:57FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#methods
05:41:12FromDiscord<ElegantBeef> They're overridable dynamically dispatched procs basically
05:42:14FromDiscord<tinygiant> Got it. Thanks for the pointers and examples. Still learning and your help has been invaluable. I'll read through the methods and see if I can adapt the library and my code to get it to work out.
05:42:32FromDiscord<ElegantBeef> Lol no problem, you overstate my worth πŸ˜›
05:44:04FromDiscord<tinygiant> It's beddy bye time, have a good night!
05:44:19FromDiscord<ElegantBeef> Buh bye
05:52:08*a_chou joined #nim
05:52:44*bunbunbunbunny joined #nim
05:56:52*bunbunbunbunny quit (Client Quit)
06:00:44FromDiscord<tinygiant> @ElegantBeef Side note, your explicit conversion worked (i.e. `type2.type1.proc`. Turns out I was getting an error when I ran it because the files had become corrupted (unknown how, probably the continuous reading/writing while testing) just when I ran the first test to try it out. Rebuilt the files and all is good. I'm able to pass a mutable Type2 throughout the several recursive procedures and end up with the result I need to write
06:01:10FromDiscord<ElegantBeef> No problem, but your bed seems to be a development environment πŸ˜›
06:01:30FromDiscord<tinygiant> Maybe. Don't judge me.
06:07:01*habamax joined #nim
06:16:12*solitudesf joined #nim
06:19:18*mwbrown quit (Ping timeout: 260 seconds)
06:20:04*bunbunbunbunny joined #nim
06:20:56*narimiran joined #nim
06:24:30*bunbunbunbunny left #nim (#nim)
06:25:50*mwbrown joined #nim
06:30:38*mwbrown quit (Ping timeout: 264 seconds)
06:31:31*mwbrown joined #nim
06:42:33*a_chou quit (Quit: a_chou)
06:54:34*Tanger joined #nim
07:00:25*Tanger quit (Remote host closed the connection)
07:01:39*Tlangir quit (Read error: Connection reset by peer)
07:02:43*Tanger joined #nim
07:08:12*Jesin joined #nim
07:16:17*waleee-cl quit (Quit: Connection closed for inactivity)
07:21:00*sagax joined #nim
07:38:52*PMunch joined #nim
07:48:02*xace quit (Ping timeout: 256 seconds)
07:50:26*mbomba quit (Quit: WeeChat 2.9)
08:13:27*lum_but_somethin is now known as lum
08:15:52*tane joined #nim
08:49:48PMunchHmm, anyone up for a c2nim challenge?
08:50:36FromDiscord<ElegantBeef> Nope
08:50:59PMunchHaha, okay then
08:51:10FromDiscord<ElegantBeef> What're you wanting to wrap?
08:51:17FromDiscord<lqdev> what's the challenge PMunch
08:51:22*Tanger quit (Remote host closed the connection)
08:51:39PMunchhttps://bitbucket.org/chromiumembedded/cef/src/master/include/
08:51:51FromDiscord<ElegantBeef> Ah... that πŸ˜„
08:52:59FromDiscord<lqdev> it's c++, good luck wrapping tht
08:53:01FromDiscord<lqdev> (edit) "tht" => "that"
08:53:34PMunchI mean, it's been done before: https://github.com/jangko/nimCEF/tree/devel/cef
08:54:14PMunchIt still annoys me that you can't call GCC to read a source file and output a machine readable specification of what is in the file
08:54:32PMunchIt obviously need to understand how to call each procedure in the file..
09:13:28ForumUpdaterBotNew thread by Gekkonier: I just noticed some for me confusing on the frontpage https://nim-lang.org/, see https://forum.nim-lang.org/t/7041
09:16:26PMunchlqdev, oh wait, I just found out that there is a C API as well: https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/
09:16:32PMunchShould be vastly easier to wrap
09:19:23bungguys! please give some more stars to this https://github.com/bung87/amysql for encourage me. Thanks!
09:23:43*opal quit (Ping timeout: 240 seconds)
09:24:34FromDiscord<nikki> PMunch: i worked on a thing that used cef before. also embedded love2d + lua into it too lol. anyways cef-- would not recommend. but also it's the main way to do the thing it does, if you happen to need that thing
09:26:31FromDiscord<nikki> the c api was kinda workable. ended up just doing the c++ stuff tho
09:26:44FromDiscord<nikki> there's an example proj called "cef_simple_app" or something
09:27:36*opal joined #nim
09:28:11FromDiscord<nikki> if you want to embed video etc u ene up needing to link with gstreamer and whatnot
09:31:02PMunchHmm, well that's a shame
09:31:47PMunchBasically the goal was to create my own browser. But I don't actually care about any of the rendering websites stuff, I just want that handled for me so that I can focus on tab management and interface.
10:14:47FromDiscord<Kiloneie> https://media.discordapp.net/attachments/371759389889003532/774215193533743124/Screenshot_20201106_111435_com.discord.jpg
10:14:59FromDiscord<Kiloneie> What is causing offtopic not to be on my phone?
10:16:04FromDiscord<Kiloneie> It started yesterday night... Force stopping didnt fix it
10:16:42FromDiscord<lqdev> you've folded the primary category
10:16:50FromDiscord<Kiloneie> Oh...
10:17:04PMunchHaha :P
10:17:13FromDiscord<Kiloneie> Channels kept dissapearing lol
10:17:18FromDiscord<Kiloneie> xD
10:18:24*krux02 joined #nim
10:31:03*hnOsmium0001 quit (Quit: Connection closed for inactivity)
10:48:05*narimiran quit (Ping timeout: 258 seconds)
10:52:24*narimiran joined #nim
11:13:18FromDiscord<tomck> sent a code paste, see https://play.nim-lang.org/#ix=2DcQ
11:13:47FromDiscord<tomck> as in, a mechanic where i just implement one of these, then the use can use a macro if they want to use the other usage
11:13:57FromDiscord<tomck> (edit) "use" => "user"
11:15:57FromDiscord<lqdev> `dup` and `with`
11:17:31*NimBot joined #nim
11:18:47FromDiscord<tomck> can you give an example? i don't quite understand
11:20:37FromDiscord<lqdev> the idiomatic nim way would be to use the second option `myFoo.bar()`, `myFoo.baz()` and use either the `sugar.dup` or `with.with` macro
11:21:07FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2DcR
11:21:20*abm joined #nim
11:21:47FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2DcS
11:34:28FromDiscord<haxscramper> Is this code supposed to segfault - https://play.nim-lang.org/#ix=2DcV - I believe it qualifies as "The assignment of a non-view-type to a view-type", so in my understanding it should work? Note that I specifically want `lent seq[T]`, not `openarray[T]`.
12:00:53FromDiscord<tomck> ahhh thanks @lqdev , i think i tried it with `with` before where i actually wanted `dup`, so i got a `var` error, ty!
12:02:20FromDiscord<tomck> @haxscramper i'd expect that to segfault in c++, assuming `lent` is just a pointer here - this should maybe be a compile error as far as i understand nim's `lent` semantics?
12:03:00FromDiscord<tomck> but you're borrowing a `seq` which isn't actually owned anywhere, it'll just be freed immediately, no?
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:36*supakeen joined #nim
12:37:24*TomDotTom quit (Quit: Leaving)
12:37:40*TomDotTom joined #nim
12:43:35FromDiscord<tomck> When a pass a non-var value into a function, are all of its fields 'moved' into the function too? To be clear, i don't have a `ref object`, only an `object`, but i want the object to be 'moved' instead of 'copied' when i pass it to the function, but i can't specify an `object` parameter as `sink`
12:54:36*lritter joined #nim
13:04:50*xace joined #nim
13:06:34FromDiscord<lqdev> you need to use `move` at the callsite
13:19:08PMunchNew stream tonight, notifishower polish, and image handling in notificatcher. Will aim for 18UTC like last time (could start earlier though if people want to).
13:20:32FromDiscord<lqdev> ~~wait, you're adding Polish language support to notifishower?~~
13:21:02PMunchHaha :P
13:21:16PMunchWell you supply your own strings, so it should already support Polish
13:49:52jonjitsu[m]can quote do: be nested? I'm getting an `undeclared identifier` for an identifier created in the first quote do
13:50:16PMunchNo that won't work too well
13:53:25*mmohammadi9812 quit (Ping timeout: 240 seconds)
13:54:02jonjitsu[m]I'm basically following dom's book: https://livebook.manning.com/book/nim-in-action/chapter-9/306
13:54:20jonjitsu[m]Should I ask for a refund? :)
13:56:41PMunchThose aren't nested..
13:59:50jonjitsu[m]The previous section had a quote do, I now see this section wasn't suppose to be indented under that one
14:02:25*mmohammadi9812 joined #nim
14:04:35*rockcavera quit (Remote host closed the connection)
14:09:49*rockcavera joined #nim
14:18:21*clyybber joined #nim
14:18:41PMunchI have tried to nest quote do before, and it takes a parameter to change the escaping character, but I could never get it to work properly..
14:19:10*clyybber quit (Client Quit)
14:32:47FromDiscord<dom96> Does the book show nested quote do?
14:33:20PMunchNope
14:33:43PMunchHe just misunderstood how two snippets were meant to go together
14:35:06PMunchBy the way, the manning live preview links are totally messed up :P
14:40:16ForumUpdaterBotNew thread by Mrhdias: FastCGI vs HTTP server?, see https://forum.nim-lang.org/t/7043
14:40:21FromDiscord<tinygiant> Pmunch, new here, what's the purpose of the streams are where are they accessed?
14:40:41PMunchHuh?
14:40:56PMunchOh, my streams :P
14:41:03PMunchI thought you were talking about the streams module :P
14:41:27FromDiscord<tinygiant> Yep, bad wording on my part.
14:41:37PMunchPurpose is just to show off some Nim development and have fun
14:41:49PMunchThey are accesses at twitch.tv/pmunche
14:43:55FromDiscord<tinygiant> Awesome thanks. I'll try to check it out.
14:46:04*mmohammadi9812 quit (Ping timeout: 246 seconds)
14:47:57PMunchHmm, this linear algebra logic for layouting is tricky to get right..
14:49:09*EastByte quit (Ping timeout: 244 seconds)
14:49:14PMunchI feel like I make one thing work it breaks another
14:49:20PMunchif*
14:50:48*EastByte joined #nim
14:50:57*mmohammadi9812 joined #nim
14:52:24PMunchAnd just as I think I have something that works, something new comes along and breaks everything..
14:55:05*mmohammadi9812 quit (Ping timeout: 240 seconds)
14:56:12PMunchI think I'm getting closer though
14:56:58PMunchOne step at a time
15:02:18*mmohammadi9812 joined #nim
15:06:55ZevvI know its a common solution, but somehow I feel it's overkill
15:07:07Zevvlayouting is not that hard. its just stacking bounding boxes
15:07:20PMunchWell, the problem is to figure out which box goes where
15:07:44Zevvrecursively work your way from the inside out
15:08:33PMunchHmm, a simpler approach might actually work for my pattern
15:09:02PMunchI was looking at normal VFL when I implemented it. And it supports all sorts of constraints making elements the same size and such
15:09:20PMunchWhich my simplified version doesn't support
15:09:36PMunchNothing that stops it from supporting it though, just that I haven't baked it into the syntax
15:09:51FromDiscord<dom96> @PMunch how so?
15:09:56Zevvthe most complicated is having more then one box in a container that request a fill
15:10:36PMunch@dom96 assuming you asked about the manning thing? Click on his link, it takes me to some random place in chapter nine
15:10:54PMunchBut if you scroll down until the link is the same as his you will see that he tried to link to a specific portion
15:11:05FromDiscord<dom96> oh
15:11:23FromDiscord<dom96> "totally messed up" is a big exaggeration then lol
15:11:25PMunchZevv, well yeah, I guess the complexity sorta adds up fast
15:11:37PMunchAnd it might just be easier at some point to do it through linear algebra
15:12:01Zevvbut Ive made a handfull of guis and toolkits from scratch that never were mor complex then this
15:12:26PMunchWell, it's impossible to link to specific portions, I'd say that is pretty messed up for a link pattern
15:12:40Zevvfrom the inside out you ask each box its minimal size and prefered alighment
15:13:17Zevvthe solution that can do it all is probably np hard anyway :)
15:15:03PMunchYeah..
15:16:29PMunchI feel it's kinda the same as neural networks
15:16:46PMunchAn "easy" solution to a complex problem, but hard to reason about what's actually going on
15:16:54PMunchAnd hard to tweak to do what you want
15:17:43Zevvbut there's tons of trivial solutions that are "good enough" in practice
15:18:13Zevveven the npeg graphs kind of work like that. a tree of boxes in boxes
15:18:16PMunchFor a certain value of "good enough"
15:18:33Zevvjust abstract it so that you can easily change it later
15:18:52Zevvjust make something that you pass a thing and it tells you "it goes here"
15:19:07Zevvbut I bet you have that
15:19:09PMunchWell as you say, it's easy until you get to stuff like "this thing should be as big as that thing" or multiple things wanting to take up more space
15:19:29Zevvsure, but in practice, is that a problem?
15:19:48PMunchWell if you want to make a proper VFL, then yes
15:20:00Zevv"proper". There you have it, again :)
15:20:07ZevvIs it worth the effort _at this time_
15:20:11PMunchI mean my simple pattern has "variable spaces"
15:20:24PMunchThat are meant to take up the remaining space in the container
15:20:34PMunchDistributing it evenly between all such spaces in a container
15:23:38*waleee-cl joined #nim
15:23:43FromDiscord<dom96> just reimplement flex-box πŸ˜‰
15:25:15Zevvyeah, then you got 80% of your browser done
15:25:32PMunchHaha, I don't want to actually create the browser
15:25:34PMunchJust the UI
15:25:49Zevvyeah, sure, that's how it starts
15:26:22Zevvanyway, the time of "other" browser engines is behind us. At this state creating a new render enginge from scratch is virtually impossible
15:27:47PMunchYeah
15:27:57PMunchFor better or worse
15:28:46PMunchI don't miss having to design websites for 5 different engines though..
15:29:43ZevvLet's rename it the googleweb right way, to prevent any confusion
15:30:09PMunchHeh
15:30:31PMunchOne thing I realised about my browsing habits
15:30:39PMunchWhile thinking about making my own browser
15:31:00PMunchThe Nim documentation for example
15:31:27PMunchI find it easier to google "nim <module name>" than to navigate to the documents page and find it
15:32:20PMunchWhich isn't great..
15:32:22TomDotTom@zevv: Would you consider flutter a 'new rendering engine' ?
15:32:24ZevvIt probably is. But still I'm not doing it. I'm practically google free, my firefox+tridactyl allows for fast shortcuts.
15:33:56ZevvTomDotTom: I don't think so. I mean "browser engine". webkit. gecko.
15:34:01PMunchThat same thing would work with DDG as well though
15:34:29Zevvsure. But I have a 'n <...>' shortcut that searches the nim docs
15:34:35Zevvetc
15:34:41PMunchFair enough
15:34:45PMunchBut that requires setup
15:34:54PMunchI'm a big fan of the search don't sort paradigm
15:35:26*Kaivo quit (Ping timeout: 264 seconds)
15:35:32Zevvoh sure. I had 250K emails in one big box for ages.
15:35:40Zevvjust make sure your stuff is searchable _fast_
15:37:57*Kaivo joined #nim
16:00:02*vicfred joined #nim
16:07:10federico3https://surveys.jetbrains.com/s3/c18-python-developers-survey-2020 for those interested
16:07:25*Kaivo quit (Ping timeout: 264 seconds)
16:08:05FromDiscord<dom96> Is there a "What's your favourite language?" field in there? (or similar)
16:08:12FromDiscord<dom96> if so I'll do it just to write "Nim" πŸ˜›
16:08:15federico3close enogh
16:08:24federico3yes, go ahead
16:09:43*Kaivo joined #nim
16:10:02Zevvwell that was short
16:11:35FromGitter<sealmove> hey confirm something for me. `if ... else` is an expression but `if ... elif ... else` is not?
16:13:10Zevvit is
16:13:19Zevvhttps://play.nim-lang.org/#ix=2Dej
16:15:36FromDiscord<nikki> re: implementing flexbox
16:15:41leorize[m]1o/ everyone
16:15:47leorize[m]1anything cool recently?
16:15:48FromDiscord<nikki> yoga is a pretty reusable lib that impls it
16:15:54FromDiscord<nikki> no dependencies iirc
16:18:02FromGitter<sealmove> Zevv: hmm but you have to set a default value. `else: discard` won't work
16:18:15FromGitter<sealmove> so that's the problem
16:18:38Zevvsure. All branches need to evaluate to the same type
16:18:43leorize[m]1it's not an expression if there's a branch that can't have a value, isn't it
16:18:58leorize[m]1you can throw an exception if you don't want to set a value
16:19:13FromGitter<sealmove> understood, makes sense
16:19:21Zevvthe exception part doesnt
16:19:47Zevvfirst you had one problem. now you have two!
16:20:52FromGitter<sealmove> so then this means that `if ... elif` (without the `else` part) can't be an expression
16:22:19Prestigeit can: https://play.nim-lang.org/#ix=2Dem
16:22:50Prestigewell actually, I see what you mean now. Yeah
16:22:56FromGitter<sealmove> echo is a statement not expression
16:23:02PrestigeYou can't like assign to it
16:23:08FromGitter<sealmove> yup
16:24:09Zevvindeed, you need an else: https://play.nim-lang.org/#ix=2Deo
16:25:06FromGitter<sealmove> I have another question... is there any way to create an object and activate its object variant lateR?
16:25:41Zevvyou can reset it
16:26:16Zevvhttps://nim-lang.github.io/Nim/system.html#reset%2CT
16:26:18FromGitter<sealmove> hmm, but if you have passed it as a reference somewhere and then reset it, will there be a problem?
16:26:23Zevvno wiat that's not the one
16:26:33Zevvyes, it's tricky and discouraged afaik
16:26:50Zevvah look" Starting with version 0.20 system.reset cannot be used anymore to support object branch changes as this never was completely memory safe."
16:26:59FromGitter<sealmove> I really need to create the object and pass it as reference before the variant is determined. there is no other way :|
16:27:00Zevvso "No" is the answer
16:27:09Zevvthere is always another way
16:27:31Zevvyou can pass a lambda to retreive the object later
16:31:41*astronavt joined #nim
16:33:13*hnOsmium0001 joined #nim
16:44:31FromGitter<sealmove> here is the full situation: https://play.nim-lang.org/#ix=2Des
16:45:29FromGitter<sealmove> wait, need to optimize the example
16:48:02FromGitter<sealmove> here: https://play.nim-lang.org/#ix=2Det
16:48:49*habamax quit (Ping timeout: 264 seconds)
16:49:11FromGitter<sealmove> the discriminator depends on an object which when you read, you need to pass a reference of the current object
16:49:50FromGitter<sealmove> but if you make the object first, then you can't change the discriminator :S
16:50:11FromGitter<sealmove> i have no idea how the lambda idea you mentioned would work
16:53:23FromGitter<sealmove> sorry for the spam: trying to minify the example: https://play.nim-lang.org/#ix=2Dex
17:03:56*bouzu_ joined #nim
17:09:33*bouzu_ quit (Quit: Leaving)
17:20:59FromDiscord<Plas> sent a code paste, see https://play.nim-lang.org/#ix=2DeF
17:23:09*habamax joined #nim
17:27:36FromDiscord<Rika> do list? as in seqs? `var aVar: seq[int]`
17:27:44FromDiscord<Rika> python list == nim seq
17:28:42FromDiscord<Rika> for your second question, you box the types you want into a single type
17:28:52FromDiscord<Rika> (its kinda difficult to explain)
17:37:50FromDiscord<Plas> @Rika you mean like type aliases?
17:38:13FromDiscord<Rika> no, i mean case objects
17:38:22FromDiscord<Plas> ? sorry im newer to nim
17:42:55FromDiscord<Daniel> @federico3 @federico3 i sompleted the survey, wrote in the text box nim programing language πŸ‘
17:44:41ForumUpdaterBotNew thread by Kobi: New project: cs2nim, see https://forum.nim-lang.org/t/7044
17:47:15PMunchStream is live
17:49:25PMunchhttps://twitch.tv/pmunche <- Will start streaming at 18 UTC
17:53:08*tane quit (Quit: Leaving)
17:54:32PMunchHmm, I should get some elevator music to play while my "Please stand by image" shows
17:56:22ZevvYour lack of music is the main reason I do not attend
17:56:28ZevvI have been so spoiled by disruptek
17:56:43PMunchHe plays music?
17:56:48ZevvGood music
17:57:25ZevvWith disrupteks streams I always got this chilling-hanging-at-the-couch-at-a-friends-house vibe
17:57:48Zevvyou're just there, no one expects anything of you, but you're welcome to just curse and have a beer
17:58:13PMunchHaha, I should ask him for some tips then
17:58:16Zevvbut don't even bother, you'll never reach that level
17:58:22PMunchOn my streams I'm the only one drinking beer and cursing..
17:58:28Zevvhaha :)
17:59:18*natrys joined #nim
18:05:00*xet7 quit (Quit: Leaving)
18:08:11Zevvdisruptek: look at this beauty: https://github.com/zevv/mathpipe/blob/master/mp.nim
18:09:19FromDiscord<Vindaar> welp, would rather watch your stream PMunch, but guess I should work (:
18:09:32Zevvtextbook example. expression -> AST parser with variables, functions and proper precedence. The AST evaluator is 6 lines only. Stateful primitive functions for things like lowpass filtering, averaging, running standard deviation.
18:45:59*vicfred quit (Quit: Leaving)
18:46:22*vicfred joined #nim
19:12:42FromDiscord<tinygiant> sent a code paste, see https://play.nim-lang.org/#ix=2Dfq
19:18:22FromDiscord<tinygiant> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2Dfv
19:20:31FromDiscord<Rika> ??? jsonnode is a ref type so you dont need to make them var
19:23:16FromDiscord<nikki> @Clyybber re: the thing yday of preserving 'default `=destroy`' while implementing own `=destroy` -- i found that having a reusable `destroyFields` template that just iterates through `fieldPairs` and `=destroy`s the values seems to work πŸ€”
19:23:22FromDiscord<nikki> not sure if that misses anything
19:25:36FromDiscord<tinygiant> @Rika Thanks! It all seems to be accepting of what I'm trying to do. The whole reference thing has gotten me several times. Time to crack some more books.
19:34:23*natrys quit (Quit: natrys)
19:36:53FromGitter<sealmove> I ended up with this design: https://play.nim-lang.org/#ix=2DfC wrapping the variant field into a subtype
19:37:17FromGitter<sealmove> The API gets less convenient, but I think it's the only way
19:40:25Zevvhow would one do `lines("/dev/stdin")` on windows?
19:40:59Zevvoh that was stupid
19:41:16*TomDotTom quit (Quit: Leaving)
19:44:30*TomDotTom joined #nim
19:54:04FromDiscord<Rika> lol
19:54:37FromDiscord<Rika> @tinygiant btw the "???" was me wondering how you got "instancenode[k] is immutable"
19:54:49FromDiscord<Rika> i didnt know you could get those with ref types
19:55:30FromDiscord<tinygiant> I have no idea either. Didn't make sense to me, but that's all the information the compiler provided.
19:57:00ForumUpdaterBotNew thread by Mantielero: C++ FFI - basic example, see https://forum.nim-lang.org/t/7045
20:17:34*astronavt quit (Remote host closed the connection)
20:19:10*astronavt joined #nim
20:28:38*astronavt quit (Quit: Leaving)
20:31:01*astronavt joined #nim
20:41:18*habamax quit (Ping timeout: 256 seconds)
20:50:20*letto quit (Quit: Konversation terminated!)
20:52:20*letto joined #nim
20:57:48*narimiran quit (Ping timeout: 256 seconds)
20:59:42PMunchDamn it, forgot to record tonight's stream..
21:02:50Zevvhm is that not automatic on twitch, bummer
21:04:51Yardanicoit is automatic
21:04:54Yardanicoif you didn't disable it
21:04:57Yardanicothey save them for 30 days
21:05:49*TomDotTom quit (Ping timeout: 246 seconds)
21:09:43PMunchOh really?
21:10:44FromDiscord<Daniel> I would advise you to consider streaming on youtube, its easy and has better coverage.
21:10:55PMunchBetter coverage?
21:11:06FromDiscord<Daniel> Well, twitch is famous among gamers
21:11:16FromDiscord<Daniel> Youtube covers everything.
21:11:18PMunchDamn it, it was disabled..
21:11:23PMunchThat's true
21:11:31PMunchNot sure why I'm streaming on Twitch really
21:11:41PMunchJust what everyone else was using when I started out
21:12:31Zevvwhat's better
21:12:34FromDiscord<juan_carlos> http://restream.io forwards it to everywhere, youtube, twitch, vk, etc.
21:12:37FromDiscord<Daniel> thats the thing, twitch main argument back in the days was streaming, but since YouTube has it, not anymore
21:12:45*Kaivo quit (Ping timeout: 240 seconds)
21:12:55FromDiscord<Daniel> ^^or even that
21:12:57PMunchrestream requires another account though..
21:13:13FromDiscord<juan_carlos> No.
21:13:17PMunchYouTube: It takes 24 hours to activate your account for live streaming. Once activated, you can go live instantly.
21:13:25PMunchIt doesn't
21:13:28PMunch?*
21:15:30*Kaivo joined #nim
21:15:30*rockcavera quit (Remote host closed the connection)
21:19:01FromDiscord<Daniel> is it not this? https://www.youtube.com/live_dashboard
21:19:25FromDiscord<Daniel> i tried it few months ago, i know it was working fluently
21:19:38FromDiscord<Daniel> not sure if now is any different
21:20:39PMunchYeah, but apparently I had to activate my account for streaming first..
21:21:00PMunchHow does chats work between YouTube and Twitch though when using restream?
21:22:40FromDiscord<juan_carlos> Youtube chat has delay, you can see both platform stuff in your restream page.
21:22:58FromDiscord<juan_carlos> Like a lot of delay I mean.
21:23:33PMunchHmm
21:24:03PMunchI kinda want to get the chat as text so I can display it on screen though
21:24:27PMunchLike I do now with Twitch over IRc
21:24:35FromDiscord<juan_carlos> is free, no watermark
21:24:50FromDiscord<juan_carlos> Youtube chat is not IRC compatible
21:25:12FromDiscord<Daniel> Altho, youtube is the most popular platform, so thats a plus
21:25:32PMunchIt doesn't have to be IRC
21:25:40PMunchThat was just an easy way to get the chat as a text file
21:25:46FromDiscord<juan_carlos> I tried to register on VK, but I dont understand Russian to do it, but has the option to add it too.
21:27:40PMunchOh well, I'm off for tonight
21:27:45*PMunch quit (Quit: leaving)
21:31:17*abm quit (Remote host closed the connection)
21:31:40*abm joined #nim
21:32:47FromDiscord<Rika> Youtube chat can have min around 2 second delay if you opt for ultra low latency
21:33:06FromDiscord<Rika> Otherwise it is around 1 minute round trip latency or something
21:38:25*D_ quit (Ping timeout: 240 seconds)
21:39:48*D_ joined #nim
21:43:06*abm quit (Quit: Leaving)
21:44:14lainquick question about ARC in Nim, if I use --gc:arc (not orc!), will it detect and warn/error on potential cycles in my code during compile-time?
21:49:05Zevvnope
21:49:07Zevvit will leak
21:49:15lainahh ok
21:49:21lainthanks
22:28:26*astronavt quit (Ping timeout: 258 seconds)
22:52:12*solitudesf quit (Ping timeout: 256 seconds)
22:53:08*astronavt joined #nim
22:58:59*krux02 quit (Quit: Leaving)
23:14:09FromDiscord<Recruit_main707> `Error: unhandled exception: cannot open: output/TileState.nim [IOError]`↡when trying to do (at compile time): ↡`writeFile("output/TileState.nim", [data])`
23:25:28ForumUpdaterBotNew thread by JazzPlayer: Nims book question, see https://forum.nim-lang.org/t/7046
23:40:07*abm joined #nim
23:51:27FromDiscord<FreezerburnVinny> sent a long message, see http://ix.io/2Dgs
23:56:57*lritter quit (Quit: Leaving)
23:57:28FromDiscord<juan_carlos> codegenDecl