<< 07-11-2020 >>

00:15:41*Quix joined #nim
00:16:01*Quix quit (Remote host closed the connection)
00:16:25*QVal joined #nim
00:16:54FromDiscord<nikki> i've also declared the var in nim before then done
00:17:24FromDiscord<nikki> `{.emit: theVar, " = coolStuff();".}`
00:39:12jonjitsu[m]I guess it's not possible to create a macro for `op cls(0x0000, machine: Machine) = machine.display.clear()`?
00:47:39*NimBot joined #nim
01:03:51*TomDotTom joined #nim
01:15:25FromDiscord<ElegantBeef> jonjitsu what does the macro need to do? πŸ˜„
01:16:18*QVal quit (Remote host closed the connection)
01:30:36*leorize joined #nim
01:39:56*pbb quit (Remote host closed the connection)
01:41:07*TaintedString joined #nim
01:41:12*pbb joined #nim
01:41:36TaintedStringSo I'm getting an error for this function where it expects a taintedstring but is getting a float, and i'm confused. https://play.nim-lang.org/#ix=2DgO
01:46:46FromDiscord<ElegantBeef> Could you provide more code?
01:49:00TaintedStringYep. https://play.nim-lang.org/#ix=2DgR
01:50:42jonjitsu[m]I was just playing with macros, to see what's possible. I was thinking of creating a DSL for defining machine instructions (or ops) for an emulator.
01:54:48FromDiscord<ElegantBeef> TaintedString i highly suggest using `seq[T]` where T is the type to ensure you get/send data properly https://play.nim-lang.org/#ix=2DgS
01:55:23FromDiscord<ElegantBeef> I assume what was happening is that `seq[T]` was getting inferred so it became a generic and the return was inferred with it
01:55:53FromDiscord<ElegantBeef> So the best thing to do is avoid using `seq` unless you want it to accept all seqs/return the same type
01:56:21TaintedStringOkay, so always use seq[T]
01:56:40FromDiscord<ElegantBeef> Well like i do there where i explictly state the type
01:56:48*TomDotTom quit (Quit: leaving)
01:56:57FromDiscord<ElegantBeef> you were making a proc that looked like `proc doThing(a: seq[T]): seq[T]`
01:57:06FromDiscord<ElegantBeef> so it couldnt return anything but the input type
01:57:16TaintedStringahhhh
01:57:18TaintedStringGotcha.
01:57:46FromDiscord<ElegantBeef> Atleast i assume that's what happened, the `seq` makes it generic and it inferrs what the return type was based off the input
01:58:19TaintedStringYeah no that does seem right, the code runs perfectly with your change. Thank you, I'm coming from python so this is all confusing.
01:58:39FromDiscord<ElegantBeef> Yea explict types will seem confusing, but nim's type system is also a godsend
01:59:00FromDiscord<ElegantBeef> For instance you could use `openArray[string]` as your input and that'd let you accept arrays and seqs of strings
02:02:16TaintedStringYeah I like it, I just have no intuitive sense of it.
02:12:46*TaintedString quit (Remote host closed the connection)
02:23:59*apahl_ quit (Ping timeout: 244 seconds)
02:24:40*mbomba joined #nim
02:26:11*apahl joined #nim
02:36:47*mbomba quit (Quit: WeeChat 2.9)
02:46:26*abm quit (Read error: Connection reset by peer)
03:03:15*mmohammadi981266 joined #nim
03:08:56*muffindrake quit (Ping timeout: 244 seconds)
03:11:25*muffindrake joined #nim
03:20:23*leorize quit (Ping timeout: 240 seconds)
03:26:24*leorize joined #nim
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:32*supakeen joined #nim
04:11:06*vicfred quit (Quit: Leaving)
04:11:39jonjitsu[m]I guess there are no bcd conversion functions somewhere in the standard lib?
04:25:50*apahl quit (Ping timeout: 264 seconds)
04:26:48*apahl joined #nim
05:06:43*leorize quit (Ping timeout: 240 seconds)
05:09:08*a_chou joined #nim
05:12:07*leorize joined #nim
05:13:06*vicfred joined #nim
05:37:23*leorize quit (Ping timeout: 240 seconds)
05:40:36*mmohammadi981266 quit (Quit: I quit (β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻)
06:04:52*leorize joined #nim
06:05:25PrestigeAre the fidget examples failing for anyone else?
06:05:44PrestigeI'm getting "fidget/src/fidget/openglbackend.nim(134, 32) Error: undeclared field: 'typeface' for type font.Font [declared in /home/avahe/.nimble/pkgs/typography-#head/typography/font.nim(35, 3)]"
06:09:27FromDiscord<cabboose> Which example?
06:09:45Prestigehttps://github.com/treeform/fidget/blob/master/examples/demo/demo.nim
06:14:08FromDiscord<cabboose> Confirming you have followed the steps described on the homepage?
06:14:29FromDiscord<cabboose> Nim is most recent version?
06:16:47PrestigeYeah I'm on 1.4.0
06:18:03*leorize quit (Ping timeout: 240 seconds)
06:18:28*a_chou quit (Remote host closed the connection)
06:23:11*mbomba joined #nim
06:23:32*mbomba quit (Client Quit)
06:24:36*dddddd quit (Ping timeout: 272 seconds)
06:25:55*dddddd joined #nim
06:27:26*solitudesf joined #nim
06:45:35*leorize joined #nim
06:53:02*waleee-cl quit (Quit: Connection closed for inactivity)
06:55:24*narimiran joined #nim
07:33:48*vicfred_ joined #nim
07:34:25*mmohammadi9812 quit (Ping timeout: 240 seconds)
07:36:35*vicfred quit (Ping timeout: 256 seconds)
07:42:01*mmohammadi9812 joined #nim
08:15:04*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
08:15:11*njoseph joined #nim
08:15:16*bung quit (Quit: Lost terminal)
08:19:23*leorize quit (Ping timeout: 240 seconds)
08:20:10Prestige{.experimental: "codeReordering".} only affects the current file I assume - is there a way to set this for the entire compilation?
08:21:29*leorize joined #nim
08:22:46*natrys joined #nim
08:27:43*leorize quit (Ping timeout: 240 seconds)
08:34:06*habamax joined #nim
08:45:06*leorize joined #nim
08:49:43*leorize quit (Ping timeout: 240 seconds)
08:52:02mipripass an --experimental: flag to nim, on the commandline or through other means
09:00:15*jaens[m] quit (Quit: Idle for 30+ days)
09:00:20*solitudesf1 quit (Quit: Idle for 30+ days)
09:00:20*guelosk[m] quit (Quit: Idle for 30+ days)
09:00:20*VijayMarupudi[m] quit (Quit: Idle for 30+ days)
09:06:44*leorize joined #nim
09:18:10*tane joined #nim
09:28:43*leorize quit (Ping timeout: 240 seconds)
09:46:31*leorize joined #nim
10:00:23*leorize quit (Ping timeout: 240 seconds)
10:03:23*vicfred_ quit (Quit: Leaving)
10:09:39*hnOsmium0001 quit (Quit: Connection closed for inactivity)
10:18:01*leorize joined #nim
10:24:00*mmohammadi9812 quit (Ping timeout: 272 seconds)
10:24:26*mmohammadi9812 joined #nim
10:46:53FromDiscord<flywind> Can I overload `[]=` for `cstring` type?
10:47:36FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2DiD
10:51:31mipriwhen you assign a char instead, and chance c to char, the []= goes unused. so there's somethign else there.
10:54:35FromGitter<offbeat-stuff> Hi
10:54:55FromGitter<offbeat-stuff> I want an object to store another object
10:55:05FromGitter<offbeat-stuff> 's address
10:56:00ZevvI'll allow it
10:56:17Zevvbut for this time only
10:56:41FromGitter<offbeat-stuff> But be able to treat it as a var
10:57:30FromGitter<offbeat-stuff> How do declare types without implementing them
10:57:53FromGitter<offbeat-stuff> type a = object
10:58:11FromGitter<offbeat-stuff> a:b
10:58:27mipriyou can't. if you're wanting mutual recursion among types, just put them all under the same 'type' definition and it'll work.
10:58:35FromGitter<offbeat-stuff> type b= object ⏎ ⏎ ``` b:a``` [https://gitter.im/nim-lang/Nim?at=5fa67ddaf2fd4f60fc5c15b6]
10:59:03mipriit's a common complaint that this is inconvenient for types that are wanted to be defined in separate modules, and the common workaround is to have a 'types' module dedicated to type declarations
10:59:05FromGitter<offbeat-stuff> But they are different and I need them to be seperate variables
10:59:09Zevvhe's not asking about mutual recursion, is he
10:59:47mipriwell I'm practically resorting to occult practices to discern a question
11:00:03*leorize quit (Ping timeout: 240 seconds)
11:00:05FromGitter<offbeat-stuff> Should I just use a ptr
11:00:06mipriI think he still might be.
11:00:07FromGitter<offbeat-stuff> and cast it
11:00:21Zevvoffbeat-stuff: ask your question better. What did you try, and what did not work? Show a complete snippet of what you did.
11:00:38Zevvyour problem statement is too vague
11:00:49mipriif you want to store an address, a ptr's one way, but I don't know when you think you would need to cast it. it'd just be a ptr MyObject and you'd store myobject.addr to it, no casting.
11:01:22FromDiscord<Recruit_main707> any examples on how to create a directory and create a file inside it at compile time?
11:01:40FromGitter<offbeat-stuff> https://play.nim-lang.org/#ix=2DiM
11:01:56miprithere, see? mutual recursion.
11:02:08ZevvRecruit_main707: I don't think that can be done, portable. You can just run command at compile time, so if you're targeting one OS you should be fine doing that
11:02:44FromDiscord<Recruit_main707> to create the directory ill need to use the command line? ok
11:03:00Zevvoffbeat-stuff: https://play.nim-lang.org/#ix=2DiO
11:03:05Zevv"ref" is the word
11:03:22Zevvand since you *are* doing mutually recursive stuff, make sure to put them both in the same `type` block.
11:03:22miprihttps://nim-lang.org/docs/nimscript.html#mkDir%2Cstring
11:06:02Zevvmipri: nimscript != compile time
11:06:45mipriah, so
11:13:33FromGitter<offbeat-stuff> How do i convert and obj to ref obj
11:17:41*leorize joined #nim
11:23:48FromDiscord<Recruit_main707> ref is a managed pointer, your example can work with normal ptrs, just change the var with ptr
11:28:37mipriyou *don't* convert between an 'object' and a 'ref object'. A type is either one or the other. The latter are passed by reference and need explicit initialization.
11:31:16ForumUpdaterBotNew thread by R3c: Avoid adding `m_type` field in JS Objects?, see https://forum.nim-lang.org/t/7047
11:39:08*narimiran quit (Ping timeout: 256 seconds)
11:43:28*mmohammadi9812 quit (Ping timeout: 260 seconds)
11:44:33*mmohammadi9812 joined #nim
11:52:17Zevvoffbeat-stuff: http://zevv.nl/nim-memory/
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:18FromDiscord<Varriount> @offbeat-stuff ^
12:06:36*supakeen joined #nim
12:13:03*leorize quit (Ping timeout: 240 seconds)
12:13:56*leorize joined #nim
12:18:20FromDiscord<haxscramper> I'm thinking about writing an article on using a new pattern matching library - something like "introduction to nim macros with pattern matching". I wanted to take `class` macro from nim by example, and reimplement it using pattern matching & comment on how different patterns are used, but maybe someone has better idea?
12:18:39FromDiscord<haxscramper> Not necessarily for "what macro to use as example", something else might do as well
12:25:20ForumUpdaterBotNew thread by Mrhdias: Nim threads on different processor core, see https://forum.nim-lang.org/t/7048
12:29:12*bung joined #nim
12:31:36*lritter joined #nim
12:32:32bungfound use nimpretty and nimfmt both will cause initNimSuggest throw error
12:39:00FromDiscord<Varriount> @haxscramper Perhaps a for-loop macro?
12:52:01*WilhelmVonWeiner joined #nim
12:52:48*tane quit (Quit: Leaving)
12:55:03*leorize quit (Ping timeout: 240 seconds)
12:56:05FromDiscord<alehander42> πŸ™‚
12:57:25*leorize joined #nim
13:03:16FromDiscord<haxscramper> Write parser generator with that also declares AST types and then use pattern matching on generated AST
13:03:48FromDiscord<haxscramper> Some kind of DSL would be nice, but I'm completely out of (simple) ideas
13:03:50FromDiscord<alehander42> yeah
13:03:57FromDiscord<alehander42> basically that's what macros do anyway
13:04:04FromDiscord<alehander42> so an example of a macro would be good
13:04:14FromDiscord<alehander42> and also some kind of data processing maybe
13:04:19FromDiscord<alehander42> not sure about the last one
13:04:28FromDiscord<haxscramper> Oh, I know
13:06:00FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Dji
13:06:37FromDiscord<alehander42> hmm
13:06:41FromDiscord<haxscramper> Can be made into simple example, and I get to show pattern matching for both ast and inside of the generated code
13:06:56FromDiscord<alehander42> maybe that's ok
13:06:59FromDiscord<haxscramper> This is like shell piping basically - awk is poor man's pattern matching
13:07:05FromDiscord<alehander42> some kind of iterator support tho would be so good
13:07:13FromDiscord<alehander42> what happened to @timothee 's idea
13:07:29FromDiscord<alehander42> i remember he wanted to do something like ranges composable
13:07:52FromDiscord<haxscramper> Yeah, it will be just as zerofunctional - convert into single loop with call chain
13:08:11FromDiscord<haxscramper> Well, maybe a little more complicated
13:08:36FromDiscord<haxscramper> And this is for article example, so it should be simple anyway
13:08:45FromDiscord<alehander42> keep it simple
13:08:46FromDiscord<alehander42> πŸ˜„
13:08:57FromDiscord<alehander42> not easy to have limits in that stuff
13:25:15*bung quit (Quit: Lost terminal)
13:27:23*leorize quit (Ping timeout: 240 seconds)
13:38:41*leorize joined #nim
13:42:47FromDiscord<krisppurg> what procedure should I use in order to execute a command like for example: `ffmpeg -i bruh.mp3 -ac 2 -ar 48k -f s16le -acodec libopus pipe:1`?
13:43:10FromDiscord<krisppurg> (edit) "pipe:1`?" => "pipe:1`, then return the std out?"
13:51:34*mmohammadi9812 quit (Quit: Quit)
13:53:31ForumUpdaterBotNew thread by HJarausch: Local types - how to, see https://forum.nim-lang.org/t/7049
13:57:24FromDiscord<haxscramper> @krisppurg https://nim-lang.org/docs/os.html#execShellCmd%2Cstring for simple use cases this should be enough
13:57:37FromDiscord<haxscramper> !repo shell
13:57:39disbothttps://github.com/inim-repl/INim -- 9INim: 11Interactive Nim Shell / REPL / Playground 15 368⭐ 18🍴 7& 28 more...
13:57:59FromDiscord<haxscramper> no this one
13:58:09FromDiscord<haxscramper> https://github.com/Vindaar/shell - this
14:02:47FromDiscord<krisppurg> @haxscramper I want the output given as I said "return the std out"
14:12:43FromDiscord<haxscramper> https://github.com/Vindaar/shell#error-reporting - default version returns stdout + stderr in one piece, this one allows to configure what is begin debug-printed and get output separately
14:13:24FromDiscord<haxscramper> If you are dealing with 1000-switch commands like ffmpeg you can also try https://github.com/haxscramper/hmisc#hmiscotherhshell
14:13:41*liblq-dev joined #nim
14:14:01FromDiscord<krisppurg> but what about std libs?
14:14:19FromDiscord<krisppurg> i mean ive found execProcess and I wonder if I should either use that?
14:14:22FromDiscord<krisppurg> (edit) "that?" => "that"
14:16:24FromDiscord<haxscramper> https://github.com/haxscramper/hmisc/blob/fa2ad4fce2397b64313e0a01df938bd5d6220d3c/src/hmisc/other/hshell.nim#L332 - should be sufficient to get started, `ShellExpr` is just a `distinct string`. There was a good standalone example on playground, but I couldn't find it in this chat.
14:18:30FromDiscord<krisppurg> hax?
14:20:06FromDiscord<haxscramper> yes?
14:20:17FromDiscord<krisppurg> did you listen to what I said?
14:20:32FromDiscord<krisppurg> sorry if I sound rude
14:21:31FromDiscord<lqdev> @krisppurg i had success intercommunicating with ffmpeg using https://nim-lang.org/docs/osproc.html#startProcess%2Cstring%2Cstring%2CopenArray%5Bstring%5D%2CStringTableRef%2Cset%5BProcessOption%5D
14:21:37FromDiscord<lqdev> but it can be a bit verbose
14:22:01FromDiscord<haxscramper> No problem. From what I can tell you need to execute `ffmpeg ... ` command and get stdout/stderr separately (or something like that). I'm not sure about `execProcess`, but I provided `startProcess` use example
14:22:02FromDiscord<krisppurg> I just want to make sure what procedure I'm using is better.
14:22:11FromDiscord<lqdev> oh cool `peekableOutputStream` is a new thing in 1.4
14:22:12FromDiscord<haxscramper> What @lqdev just linked basically
14:22:25FromDiscord<krisppurg> I will try startProcess
14:22:30FromDiscord<lqdev> there
14:22:34FromDiscord<lqdev> there's also https://nim-lang.org/docs/osproc.html#execCmdEx%2Cstring%2Cset%5BProcessOption%5D%2CStringTableRef%2Cstring%2Cstring
14:22:38FromDiscord<lqdev> which is easier to use
14:22:50FromDiscord<lqdev> gosh these doc URLs are insane
14:23:02FromDiscord<krisppurg> if you think thats insane
14:23:16FromDiscord<krisppurg> https://media.discordapp.net/attachments/371759389889003532/774640113728749568/unknown.png
14:23:35FromDiscord<krisppurg> https://media.discordapp.net/attachments/371759389889003532/774640193340571658/unknown.png
14:25:13*d10n quit (Quit: why all the #hashtags #lol #hackers #overheard)
14:25:27*d10n joined #nim
14:25:27*d10n quit (Changing host)
14:25:27*d10n joined #nim
14:26:12FromDiscord<lqdev> yes krisppurg, we know about this issue.
14:26:25FromDiscord<lqdev> gosh somebody push the changes to stable
14:26:41FromDiscord<lqdev> or give me back my 1.2 docs
14:27:07FromDiscord<krisppurg> f
14:28:40FromDiscord<exelotl> I still think something like this would be better https://cdn.discordapp.com/attachments/371759389889003532/769216888168251413/unknown.png
14:29:22FromDiscord<lqdev> 100% agreed
14:29:38FromDiscord<lqdev> what's the flippin' point of having a million tiny categories that waste space https://media.discordapp.net/attachments/371759389889003532/774641715512344576/unknown.png
14:30:34FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2DjG
14:31:01FromDiscord<lqdev> yes
14:32:40FromDiscord<Rika> Why even repeat the procedure name
14:33:58FromDiscord<haxscramper> Reuse mangling algorithm for proc generation to make shorter links
14:34:12FromDiscord<haxscramper> proc/type/etc url generation
14:36:23FromDiscord<krisppurg> might be a dumb question but how would i write a binary data to stream?
14:37:15*narimiran joined #nim
14:41:27FromDiscord<Clyybber> > gosh somebody push the changes to stable↡done already, its your browser's cache
14:42:27narimiranhow about converting those ideas into a PR?
14:42:42narimiran(about making TOC prettier)
14:43:51narimiranbut this "TOC over main content" shouldn't happen anymore. try clearing your cache
14:47:41*krux02 joined #nim
14:49:40*krux02 quit (Client Quit)
14:59:43*leorize quit (Ping timeout: 240 seconds)
15:17:23*leorize joined #nim
15:34:39*waleee-cl joined #nim
15:52:05FromGitter<matrixbot> `ache-of-head` bonjour
15:52:33FromGitter<matrixbot> `ache-of-head` i'm trying out element πŸ—Ώ
15:53:19FromDiscord<lqdev> ache-of-head are you rarted
15:53:22FromDiscord<lqdev> dude
15:53:32FromDiscord<lqdev> you know that matrix has an irc bridge, right?
15:53:34FromGitter<matrixbot> `ache-of-head` πŸ˜”
15:53:41FromGitter<matrixbot> `ache-of-head` wdym
15:54:05FromDiscord<lqdev> i mean that your messages display like this on IRC https://media.discordapp.net/attachments/371759389889003532/774662968414830612/unknown.png
15:54:17FromDiscord<lqdev> because you're going through matrix→gitter→IRC
15:54:23FromDiscord<ache of head> bruh
15:54:23FromDiscord<lqdev> you can just do matrix→IRC
15:54:30FromDiscord<ache of head> how do i do that doe
15:54:31FromDiscord<ache of head> lmao
15:54:58FromDiscord<lqdev> hold on
15:55:53FromDiscord<lqdev> you search in freenode rooms
15:56:14FromDiscord<lqdev> https://media.discordapp.net/attachments/371759389889003532/774663510663757865/unknown.png
15:56:18FromDiscord<lqdev> iirc leorize also set up a community
15:56:32FromGitter<matrixbot> `ache-of-head` ah
15:56:34FromDiscord<ache of head> okay maybe i wont write through there anymore
15:56:38FromDiscord<ache of head> my mistake, sorry
15:56:44FromDiscord<lqdev> it's fine dude
15:56:56FromDiscord<lqdev> didn't mean to sound rude :(
15:57:09FromDiscord<ache of head> nah it's oaky
15:57:26*liblq-dev quit (Quit: WeeChat 2.9)
15:57:27*ache-of-head[m] joined #nim
15:57:35ache-of-head[m]how about this 😳
15:57:43FromDiscord<ache of head> yay it works
15:58:26FromDiscord<lqdev> yaaaaaay
15:58:38FromDiscord<Rika> What if lq wanted it to be birch and not oaky
15:58:46FromDiscord<ache of head> πŸ˜”
15:59:00FromDiscord<ache of head> all i do is disappoint everyone at every stage of my life
15:59:19FromDiscord<ache of head> okay this is #main after all
15:59:21FromDiscord<ache of head> let's not spam
16:04:19disruptekZevv: mp, it's cute. almost makes me want to abandon the nim parser.
16:06:33ZevvI once started making a nim parser that emits NimNodes
16:06:36Zevvbut I got bored
16:07:23*leorize quit (Ping timeout: 240 seconds)
16:08:49disrupteki need to break up some of my larger projects so i can actually make progress.
16:10:26Zevvthat's generally good advice, life-wise
16:11:10disruptekyou mean, like, chewing?
16:12:09Zevvto name one, yes
16:13:05*tane joined #nim
16:13:50*PMunch joined #nim
16:16:09PMunchHi everyone, got any good beginner videos for non-programmers? Got a friend who is bored out of their mind during Corona :P
16:17:27ZevvFriends don't let their friends do that kind of thing
16:18:32PMunchDo what? Start programming?
16:20:34Zevvyeah
16:22:48disrupteki'm curious to see something like that.
16:23:37disruptekthe video i point non-programmers to in order to explain nim is "growing a language".
16:24:46disruptekbut why don't you record something? aren't you a streamer now?
16:27:24PMunchHaha, I guess I could
16:27:42Zevvhis streams are lame. It's all programming and talk and talk and programming
16:28:00ZevvThe beard tho, man, that's glorious
16:28:26Zevvand - this really has to be sad - the man knows how to get his sound proper
16:28:54ZevvI get goosebumps the second I put up my headphones, with pmunch intimately whispering into my ears
16:29:40Zevvand my wife asking me what I'm watching there, with red cheeks and dilated pupils
16:29:45Zevv"Yeah, that's just pmunch streaming"
16:29:54Zevvyou think she beleives that?
16:30:22PMunchHaha :P
16:30:43PMunchLet me know and I'll record an apology for her
16:31:00Zevvbut seriously, it's great stuff PMunch, really
16:31:47PMunchThanks :)
16:33:08disrupteki wish i could watch.
16:33:24Zevvwhat kind of pipe are you on now then?
16:33:39disruptekmaybe i should try out this youtube-dl thing everyone has their panties in a twist over.
16:33:52ZevvI cna mail you the DVDs?
16:33:59PMunchOnly one of them have made it onto YouTube so far
16:34:08disruptekonly one?
16:34:10disrupteklink?
16:34:12PMunchThe plan is to start uploading more of them once the quality is higher
16:34:27disruptekyou can just delete low-quality ones later.
16:34:30disruptekwho gives a shit.
16:35:09*leorize joined #nim
16:35:54PMunchTrue
16:36:56PMunchhttps://www.youtube.com/watch?v=Ow1uqY4fR3c This is the one that's uploaded by the way
16:37:09disruptekif i were worried about quality i'd have never started streaming.
16:37:25disruptekbut i guess you knew that.
16:40:28PMunchHaha, not sure if I've ever seen any of your streams
16:44:32PMunchGreat.. I've got an old radio that I've retrofitted to have a Chromecast inside
16:44:43PMunchBut it has an alarm in it that goes off once a day
16:44:55PMunchAnd to disable alarm, you need the remote, which I don't have -_-
16:47:03*abm joined #nim
16:51:26Zevvdisruptek: tell him about the music
16:52:04*ache-of-head joined #nim
16:52:36ache-of-headpoggers, does this work?
16:52:45FromDiscord<ache of head> it does 😎
16:53:35disrupteki have picture but it's like 45sec of "Please stand by" so far.
16:54:41blueberrypieIs is possible to define a distant type using a few (non-linear) items such as "a", "g", and "x"
16:55:05FromDiscord<lqdev> distant type?
16:55:17blueberrypiedistinct type sry
16:57:15blueberrypiehmmm this appears close enough https://github.com/nim-lang/Nim/blob/version-1-4/lib/system/basic_types.nim#L32
16:57:23disrupteki would probably use an enum, but it's technically possible to do it with strings.
16:57:30PMunchdisruptek, yeah that's before I started streaming, lasts for a while
16:57:48disrupteki'd raise your font size.
16:57:49blueberrypieok thanks
16:58:01PMunchEven further?
16:58:04disrupteknote that you can specify the "string value" for enums.
16:58:11disruptekyeah; i couldn't read it at 360p.
16:58:22disrupteki mean, are you going to have >80char lines?
16:58:32blueberrypiedisruptek: perfect
16:58:36blueberrypieworks good for me
16:58:37PMunchAh yes, I increase it further into the video
16:58:49disruptekcool.
16:59:33PMunchAt 10:27
17:02:57disruptekPMunch: you make me want to shave
17:03:03disruptekmy balls.
17:03:07disrupteki mean, my face.
17:04:20PMunchHaha
17:04:38disruptekthe problem is that everyone is watching television in the US, so there's no fucking bandwidth left for me to watch you.
17:04:52disruptekwhatfer biden-wins reasons.
17:06:48disruptekyour desym code doesn't work.
17:06:56disruptekwhatfer gensym reasons.
17:06:59PMunchYes it does..
17:07:14disruptekyou need to use repr to render a gensym with its unique identifier trash.
17:07:44disruptekit might work fine in this code; it's just an fyi.
17:07:51PMunchAah right
17:07:53blueberrypiedisruptek: is there a built in way to convert the string value to the enum value?
17:07:56PMunchI'll keep that in mind
17:08:05disruptekparseEnum[MyEnumType](someString)
17:08:09PMunchWe should really add something like this to the stdlib though..
17:08:10disrupteksee strutils module.
17:08:11blueberrypiethanks
17:09:02disrupteki think macros are so poorly spec'd right now that adding anything is dangerous. people should write this stuff until they get to the point where they are sharing their code.
17:09:26Zevvbah now I even added function overloads
17:09:29disruptekanother unpopular disruptek opinion.
17:09:30Zevvoverengineering again :/
17:09:46disrupteki use zevv's filter pattern in like 90% of my rewrite code.
17:10:09Zevvwhat's "zevv filter pattern"?
17:10:35disruptekNodeFilter, you called it.
17:10:52ZevvI don't know what that is
17:10:59Zevvoh it's a macro thingy right
17:11:12Zevvah, diner!
17:11:12disruptekit runs the fn arg on the ast node or its children.
17:11:47FromDiscord<Clyybber> disruptek: adding to macros.nim is less dangerous tho
17:11:53FromDiscord<Clyybber> also Hi :D
17:12:02disrupteksup dawg
17:12:28*ache-of-head quit (Quit: Leaving)
17:12:31disruptekwe risk nothing by letting the ecosystem evolve the solutions for us.
17:12:57disruptekmuch more interesting problems in the compiler that we can't screw up so easily.
17:13:15FromDiscord<Clyybber> I finished the core of the untyped fix btw
17:13:33PMunchThis was something that when I mentioned it it seemed like everyone had implemented their own version of it though
17:13:37FromDiscord<Clyybber> now I only gotta add shadowscoping and fix the exponential mem usage
17:13:50PMunchWould be nice to have a right way
17:13:55disruptekPMunch: true; so we have several different impls and i've already shown that they aren't all correct.
17:14:03disruptekno reason to think that mine is any different.
17:14:03PMunchThat can be fixed by whoever makes changes elsewhere
17:14:08FromDiscord<Clyybber> yeah, but we have one correct
17:14:49disruptekclyybber: "untyped fix"?
17:14:50FromDiscord<Clyybber> its in some test
17:15:03FromDiscord<Clyybber> disruptek: Yeah, the one where symbols leak out
17:15:34disruptekwhich one is that?
17:15:38FromDiscord<Clyybber> https://github.com/nim-lang/Nim/issues/14844 the root cause of https://github.com/nim-lang/Nim/issues/14404
17:15:41disbotβž₯ `foldr` raises IndexError when called on sequence ; snippet at 12https://play.nim-lang.org/#ix=2DkE
17:15:49disruptekahh
17:16:05disrupteki thought this was already solved months ago.
17:16:17FromDiscord<Clyybber> no, I kept working on it on and off
17:16:37FromDiscord<Clyybber> even tho in hindsight its quite simple
17:16:43disruptekyour avatar change is blowing my mind right now.
17:16:49FromDiscord<Clyybber> its a real showstopper IMO; and I seen a few people stumble upon it
17:16:57disruptekyes, it's clearly wrong.
17:16:59FromDiscord<Clyybber> disruptek: Lol, do you see that?
17:17:03disruptekthis is exactly what i'm talking about, though.
17:17:14FromDiscord<Clyybber> oh github avatar yeah
17:17:14disruptekthis stuff is very poorly defined.
17:17:22disruptekwe shouldn't be fucking with the stdlib yet.
17:17:28FromDiscord<Clyybber> I changed it to my gitlab one :D
17:17:30disruptekthere's no standard, by definition.
17:18:00FromDiscord<Clyybber> yeah, in this case I'm grateful that this wasn't in the spec
17:20:29disrupteki guess araq was right again.
17:21:06FromDiscord<Gyllou> hey, does anyone know of any xxHash implementations for nim?
17:21:30disruptekPMunch: can notifishower completely replace my mako?
17:21:57disruptekgyllou: there's a 3rd-party hashing module you could try.
17:22:26disruptekshashlick made a meowhash wrapper, too. perhaps useful to you.
17:22:40disruptek!repo hashes
17:22:41disbothttps://github.com/jangko/nimSHA2 -- 9nimSHA2: 11Secure Hash Algorithm 2 15 21⭐ 6🍴 7& 18 more...
17:22:46disruptek!repo hash
17:22:47disbothttps://github.com/jangko/nimSHA2 -- 9nimSHA2: 11Secure Hash Algorithm 2 15 21⭐ 6🍴 7& 22 more...
17:22:50disruptekdoh.
17:22:50FromDiscord<Clyybber> disruptek: in what way?
17:22:58disruptek!repos hashes
17:22:59disbothttps://github.com/jangko/nimSHA2 -- 9nimSHA2: 11Secure Hash Algorithm 2 15 21⭐ 6🍴
17:22:59disbothttps://github.com/OpenSystemsLab/hmac.nim -- 9hmac.nim: 11HMAC-SHA1 and HMAC-MD5 hashing in Nim 15 12⭐ 6🍴
17:23:00disbothttps://github.com/onionhammer/sha1 -- 9sha1: 11SHA-1 produces a 160-bit (20-byte) hash value. 15 7⭐ 5🍴 7& 16 more...
17:23:12disruptekwell, i dunno, scroll around for it.
17:23:15disruptekclyybber: what?
17:23:21disruptek!repo meow
17:23:22disbothttps://github.com/ucpr/meow -- 9meow: 11:cat: { meow, meow 15 0⭐ 0🍴 7& 1 more...
17:23:33FromDiscord<Clyybber> disruptek: being right
17:23:37disruptek!repo disruptek/meow
17:23:37disbothttps://github.com/disruptek/meow -- 9meow: 11meow hash in nim 15 0⭐ 0🍴
17:24:04disruptekwell, he didn't like the original fix and he was right to wait for you to arrive at the cheaper solution.
17:25:14PMunchdisruptek, mako?
17:25:19disruptekPMunch: it's dunst for sway
17:25:26disruptekdude, you did your config in npeg?
17:25:30disruptekyou're a madman.
17:26:12PMunchHaha, you find me a command line parser that supports my pattern and I'll switch :P
17:26:24PMunchAh notifishower only works on X I'm afraid
17:26:28disruptekwhat's the pattern?
17:26:49PMunchhttps://github.com/PMunch/notifishower/blob/master/src/options.nim
17:27:41disrupteki mean, i would rather write the code to hack in support for my pattern than write yet another parser.
17:27:52disrupteknot like you don't have options.
17:27:54FromDiscord<Clyybber> disruptek: Oh, I don't remember the original fix, I think it has been this way forever; but I didn't like the earlier implementations either
17:28:03disruptekyeah.
17:28:05FromDiscord<Clyybber> i was just messing around there
17:28:16FromDiscord<Clyybber> now I'm slowly arriving at a good design
17:28:27FromDiscord<Gyllou> whoops didnt hear the notifications
17:28:44FromDiscord<Gyllou> going back through you mentions @disruptek
17:28:52supakeendisruptek: i'm (slowly) working on a collection of parsers that parse to a generic format which can then be constrained for command line options
17:28:56supakeenone day it will be usable
17:29:15disruptekin npeg?
17:29:20supakeensi
17:29:22supakeenhttps://github.com/supakeen/clip/blob/master/tests/test.nim
17:29:24supakeenis what it does so far
17:29:36disruptekdoes it work as a grammar library for npeg?
17:29:40disruptekthat would be super useful.
17:29:41supakeenthat's the plan
17:29:45disrupteknice.
17:30:04supakeenthat you can re-use the parsers for various formats and/or just plug your own format parser in there and still able to use the constraint/representation that will come afterwards
17:30:10supakeento do stuff like mutually exclusive and subcommands
17:30:14disruptekyeah.
17:30:22disruptekyou can just extend the grammar.
17:30:27supakeensi
17:30:42disruptekwell, i still think PMunch is a madlad.
17:30:46supakeenmaybe i have some time again tomorrow, i've been doing some improvements around the house
17:30:46FromDiscord<Gyllou> ah gotcha yea those are mostly sha stuff im looking for a specific hashing implementation
17:30:58disruptekgyllou: i figured.
17:31:13disruptekignore those, though.
17:31:29disruptekthere's /yet another one/ on github that offers several hashing routines.
17:31:45supakeenThere's not a lot of consensus yet in the ecosystem :)
17:31:45FromDiscord<Gyllou> gotcha
17:32:07FromDiscord<Gyllou> yea im trying to port SLIDE to nim using arraymancer and i need a high performing hash algo
17:32:12disruptek!repo apense/shimsham
17:32:12disbothttps://github.com/apense/shimsham -- 9shimsham: 11Collection of hash functions built in pure Nim 15 8⭐ 1🍴
17:32:17FromDiscord<Gyllou> otherwise, yea id just usmeow
17:32:22supakeenIt's reasonably likely if you have a non-common hashing algorithm that nobody has made an implementation yet
17:32:23disruptek!repo khchen/hashlib
17:32:24disbothttps://github.com/khchen/hashlib -- 9hashlib: 11Hash Library for Nim 15 10⭐ 1🍴
17:32:36disruptekmeow is really fast.
17:32:42disruptek16 bytes per cycle.
17:32:58disruptekif you can beat that for the same guarantees, i'm very interested.
17:33:02FromDiscord<Gyllou> yea i think city has is reasonably fast too
17:33:13FromDiscord<Gyllou> city hash
17:33:20disruptek!repo skrylar/skyhash
17:33:21disbothttps://github.com/Skrylar/skyhash -- 9skyhash: 11Hashes for Nim. 15 0⭐ 0🍴
17:33:22supakeenDoesn't help much if you need $hashsomething to interact with another thing :)
17:33:43disruptekwhat do you mean?
17:33:46FromDiscord<Gyllou> yea id like to get SLIDE into nim and see if we can outperform the C implementation
17:34:14supakeendisruptek: Oh I meant that it doesn't matter if meow is faster/better if the thing you need to talk to does xxhash.
17:34:24disruptekhaha right.
17:34:36supakeen!repo supakeen/simba
17:34:37disbothttps://github.com/supakeen/simba -- 9simba: 11PRNGs for Nim. 15 2⭐ 0🍴
17:34:39supakeenI like this bot.
17:35:58FromDiscord<Gyllou> @disruptek@supakeen xxhash is faster by an order of magnitude or so though
17:36:21disruptekneat.
17:36:23FromDiscord<Gyllou> i need primarily fast throughput as collisions would effect this algo dramatically
17:36:32FromDiscord<Gyllou> wouldnt
17:38:46disruptekwell, i don't see a comparison, but meowhash appears to be just as fast.
17:39:20disruptekit appears to be around twice as fast.
17:40:26disruptekoh wait, here's a comparison: https://github.com/Cyan4973/xxHash/wiki/Performance-comparison#benchmarks-concentrating-on-small-data-
17:40:29FromDiscord<Gyllou> thats because im retarded and got it confused with murmur somehow
17:40:35FromDiscord<Gyllou> lol
17:40:44disruptekroughly the same but looks like xxh3 would be superior.
17:42:14disruptekwe should totally use this for stdlib.
17:42:35disruptekdid you already start impl'ing it?
17:45:04FromDiscord<krisppurg> when executing a shell command process is there anyway to get the output stream like doing `ffmpeg ...` and then you either receive chunks of streams?
17:45:19disruptekgyllou: ^ this looks really good to me.
17:45:36FromDiscord<krisppurg> rather than getting the entire output
17:45:42FromDiscord<Gyllou> yea im going to go through and test a few of them
17:45:54FromDiscord<haxscramper> @krisppurg Example I linked does literally that
17:45:55disruptekkrisppurg: you need something like sealmove's nimitai
17:46:16FromDiscord<haxscramper> Read chunks of stdout, not everything at once
17:46:21FromDiscord<Gyllou> i will most likely use murmur and recreate SLIDE and test it with arraymancer first to see what the baseline gains are
17:46:32FromDiscord<Gyllou> then I'll test the different hashing algos
17:46:48disruptekusing the one nim provides, right?
17:46:53FromDiscord<Gyllou> im hoping to incorporate convolutional layers with
17:46:54FromDiscord<Gyllou> yea
17:46:58disruptekright.
17:47:07Zevvman npeg is so popular
17:47:14FromDiscord<Gyllou> i need a baseline bc i will probably want to publish my results for this
17:47:17ZevvI wish I was that popular when I was a kid
17:47:34Zevvbut no, there I was, on my attick. pounding away at the keyboard.
17:47:38Zevvsee what it brought me in life
17:47:48disruptekit brought you me.
17:47:51disruptekyou lucky devil.
17:47:59Zevvlucky me
17:48:17disrupteki think my vm is going to have to be stack based.
17:48:26FromDiscord<Gyllou> ideally id like to build up deep reinforcement and graph neural network tooling in nim because we will need it in our work, ill post it later on whenever it gets to a release state
17:48:34FromDiscord<krisppurg> @haxscramper Do none of the nim std lib modules not do that?
17:49:07disruptekgyllou: super interested in this.
17:49:09FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2DkP
17:49:36FromDiscord<haxscramper> And here is your output stream, from which you can read in any way you like - chunks, lines or all at once
17:49:55FromDiscord<krisppurg> hm
17:50:03FromDiscord<Gyllou> ill keep you guys posted, id love to push nim in as a deep learning player, thank god for arraymancer, mratsim did alot of the heavy lifitng
17:50:16disruptekyeah.
17:50:25FromDiscord<haxscramper> @krisppurg In particular you might be interested in https://nim-lang.org/docs/streams.html#readData%2CStream%2Cpointer%2Cint
17:50:26disruptekit's like a huge muscle that no one knows how to use.
17:50:35FromDiscord<Gyllou> that package is ridiculous, its so fast
17:50:44FromDiscord<Gyllou> same with weave
17:50:48disruptekit's just a matter of time before it gets discovered.
17:51:19FromDiscord<Gyllou> yea ive mentioned it to my colleagues at my consulting gig and they are pretty interested in it
17:51:47disruptekthere will be some sexy demo and then nim will explode.
17:52:00FromDiscord<Gyllou> alright, gonna get back to it, as usual thanks for the help @disruptek
17:52:09disrupteksure thing.
17:59:25disruptekPMunch: are you familiar with NestedText?
18:02:43FromDiscord<William_CTO> I have an async proc which acquires (and later releases) a lock within it, but I find my program becomes unresponsive and killing it shows it stuck at the line where I call acquire lock.↡I am not experienced in using locks, so please bear with me. Can someone explain why my program becomes unresponsive? It happens when the async function gets called quickly
18:03:41disruptekasync doesn't use threads.
18:04:19disruptekbecause there's only one thread, nothing can release the lock.
18:04:43FromDiscord<krisppurg> @haxscramper can I also just do something like `outputStream[sequence]` for example `outputStream[0]`, `outputStream[1]`, `outputStream[2]`
18:12:39FromDiscord<haxscramper> You need to either peek or read raw data from stream - by using low-level procs like `readData` or more high-level wrappers like `readLine`, `readInt` and so on. After that you are free to do whatever you need. Although I don't quite understand what do you mean by `outputStream[0]` - I assume something like `outputStream[<data at position N>]`
18:13:54*kinkinkijkin quit (Remote host closed the connection)
18:14:27FromDiscord<krisppurg> yeah like data at position N
18:15:36FromDiscord<krisppurg> because I thought that setPosition would possibly effect the stream
18:15:42FromDiscord<krisppurg> like setLen
18:15:46FromDiscord<krisppurg> (edit) "like setLen ... " added "for seq"
18:18:23FromDiscord<haxscramper> There is `getPosition`, but only shows how far stream has advanced. For file stream like stdout of the process I don't think `setPosition` would not work you need to maintain own buffer. Example -https://play.nim-lang.org/#ix=2DkY - gives runtime error
18:18:54FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2DkZ
18:21:34FromDiscord<haxscramper> What are ultimately trying to do? E.g. I understand the part of reading data from `ffmpeg` output, but it does not seem all that useful for me (on it's own reading particular bytes from stdout of some command), so I'm wondering
18:24:14FromDiscord<haxscramper> Maybe just doing `readAll` and then indexing into string buffer will be sufficient (I know `ffmpeg` can dump tons of data though), or reading line-by-line and maintaining FIFO buffer for lines to be processed (for example `std/deques`) - I do something similar in https://github.com/haxscramper/hmisc/blob/fa2ad4fce2397b64313e0a01df938bd5d6220d3c/src/hmisc/other/hshell.nim#L436
18:25:33FromDiscord<krisppurg> Alright, what I'm trying to do is sending encrypted audio opus data on a discord voice channel using a UDP socket which is basically playing encrypted audio.
18:25:49FromDiscord<krisppurg> I have to send an opus frame like every 20ms
18:27:32FromDiscord<haxscramper> And `ffmpeg -i bruh.mp3 -ac 2 -ar 48k -f s16le -acodec libopus pipe:1` dumps opus data into stdout? I'm not familiar with this, but do frames have the same sizes? Then `readData` is your best bet
18:28:16FromDiscord<haxscramper> E.g. if I understand correctly it does exactly what you would want - read chunk of data of specified size from output of the running process
18:30:28FromDiscord<krisppurg> @haxscramper I am unsure about sizes, but I could just calculate the size to split with file byte size.
18:30:58FromDiscord<krisppurg> the ffmpeg does dump opus data into stdout
18:32:56FromDiscord<krisppurg> I want to do something like on a loop of 20ms, the buffer chunk is sent to the udp socket.
18:34:05FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2Dl2
18:35:51FromDiscord<haxscramper> It discards the actual number of bytes read, and you might want to use `readData` with `pointer` for buffer, but otherwise it should be close enough
18:37:02FromDiscord<haxscramper> For dynamically changing sizes you might want to get a little more fancy with buffer handling, but I don't know anything about how opus frames are structures, so I just used fixed size.
18:38:10Zevvdisruptek: what vm was you building again?
18:38:14Zevvand why
18:40:57FromDiscord<krisppurg> hmm
18:42:02FromDiscord<krisppurg> I've seperated the chunks for an easier look and some chars were chopped
18:42:02FromDiscord<krisppurg> https://play.nim-lang.org/#ix=2Dl4
18:44:44FromDiscord<krisppurg> @haxscramper also btw mention for any replies I have the Nim server muted and I may miss
18:45:15*xet7 joined #nim
18:49:34FromDiscord<haxscramper> @krisppurg off-by-no-enough-sleep error - https://play.nim-lang.org/#ix=2Dl6
18:51:30FromDiscord<krisppurg> ah
18:54:06*xet7 quit (Ping timeout: 256 seconds)
19:02:42*xet7 joined #nim
19:05:15*fredrikhr quit (Read error: Connection reset by peer)
19:16:52*xet7 quit (Remote host closed the connection)
19:21:09*xet7 joined #nim
19:27:15FromDiscord<William_CTO> sent a code paste, see https://play.nim-lang.org/#ix=2Dlk
19:31:23*xet7 quit (Remote host closed the connection)
19:31:36FromDiscord<William_CTO> Nevermind
19:31:41FromDiscord<William_CTO> I think I figured it out
19:32:09*hnOsmium0001 joined #nim
19:33:39*xet7 joined #nim
19:33:57ZevvI have this great idea for Npeg, but it's hell to make it
19:34:34disruptekwhat is it?
19:34:38ZevvI want to visualize matching in progress by showing the subject getting processed by the graphs
19:34:53Zevvfor debugging your parsers
19:35:02disruptekdoesn't seem that hard, actually.
19:35:27Zevvwell, not "hell". But graphs are compile time only now
19:35:53Zevvso I need to move that up, and from there it is possibly only highligting all elements in the current call stack
19:35:53disruptekoh, i was thinking just a single line on the screen that you rewrite.
19:36:00*PMunch quit (Quit: leaving)
19:36:28disruptekyou're going to slow it down, right?
19:36:44Zevvyou think?
19:37:05Zevvit's supposed to go interactive / single stepping
19:37:22Zevvit's a debugging tool. So each step the vm makes it will redraw the graph
19:37:36Zevvit'll slow down by a factor of a million, at least
19:37:52Zevvit's utterly useless, but it'll sell great
19:38:14disrupteka million won't be enough.
20:04:18FromDiscord<Recruit_main707> what are the compile time, counter parts of nimscript functions like mkDir, copyDir, etc?
20:04:27FromDiscord<Recruit_main707> (edit) "time," => "time"
20:10:23*narimiran quit (Ping timeout: 260 seconds)
20:10:55FromDiscord<haxscramper> https://nim-lang.org/docs/nimscript.html#rmDir%2Cstring - for compile-time
20:11:19FromDiscord<haxscramper> https://nim-lang.org/docs/os.html#copyDir%2Cstring%2Cstring - for rutime
20:12:16FromDiscord<Recruit_main707> but thats w/ nimscript
20:12:26FromDiscord<Recruit_main707> how can i do it from within a macro, for example
20:18:19FromDiscord<haxscramper> I don't think it is possible to create a directory from macro without just calling shell `mkdir`
20:25:18disruptekZevv: the idea is that my vm runs in a continuation that can be serialized to/from the cloud. but i want the stack for introspection reasons.
20:26:21disruptekpmunch: didn't we talk about storing your shit in /tmp at fosdem? hah!
20:26:44*mmohammadi9812 joined #nim
20:33:53*NimBot joined #nim
20:46:07*oprypin quit (Quit: Bye)
20:46:15*oprypin joined #nim
20:50:05*FromGitter quit (Remote host closed the connection)
20:50:06*oprypin quit (Client Quit)
20:50:25*oprypin joined #nim
20:50:36*FromGitter joined #nim
20:51:40*lritter quit (Quit: Leaving)
20:53:53*a_chou joined #nim
20:55:08*habamax quit (Quit: leaving)
20:57:45Zevvdisruptek: what the hell are you talking about
20:57:53Zevvvm runs in a continuation that can be serialized to/from the cloud
20:58:24disruptekwhich part don't you get?
20:58:42Zevvwhyyyyy
20:59:06disruptek'cause i want to run tierra at scale.
20:59:43*leorize quit (Ping timeout: 240 seconds)
20:59:50Zevvwell, let's first fix the continuations then, shell we
21:00:19disruptekwe have to wait for clyybber to finish his sym dupe/leak.
21:00:36disrupteki'm supposed to be working on ic right now.
21:01:32Zevvsays who
21:06:52Zevvcall me an imperialist if you want, but I can't get used to my master branch being called "main"
21:07:36*leorize joined #nim
21:11:15disrupteki feel that.
21:15:19FromDiscord<lqdev> Zevv: don't give in to their propaganda!!
21:15:36FromDiscord<lqdev> you can change the default branch name back in github's settings
21:15:40disruptekhenceforth all my branches will be Mean branches.
21:15:54Zevvlqdev: yeah I did that.
21:16:01ZevvI ain't got no slave branches anyways, right
21:16:15Zevvand I nicely killed all the KKK guys in RDR2 the other day, so I'm good
21:16:17disruptekyou haven't lived.
21:22:24*fredrikhr joined #nim
21:29:29FromDiscord<notchris> How do you pass in a procedure as a parameter of another procedure
21:29:38FromDiscord<notchris> on creation do you just assign the proc?
21:29:48idfproc foo(a: proc(a, b: int))
21:29:56idfthen foo(sum(a, b)) or something
21:30:12FromDiscord<notchris> hmmm
21:30:18FromDiscord<notchris> Ahhh
21:30:38FromDiscord<notchris> what if you dont know what the procedure will take
21:31:05idfthen use a template i guess
21:31:08notchrishmm
21:31:34notchrisbasically i want the user to define their own callback
21:32:19*natrys quit (Ping timeout: 246 seconds)
21:33:59FromDiscord<lqdev> use generics?
21:34:35ForumUpdaterBotNew thread by O24: Returning objects from func with ARC, see https://forum.nim-lang.org/t/7050
21:34:57FromDiscord<notchris> @lqdev hmm how does that work?
21:35:16FromDiscord<lqdev> proc foo[T: proc](a: T)
21:35:25FromDiscord<lqdev> and then you can pass in any procedure to foo
21:35:32FromDiscord<notchris> Ah thats exactly what i wanted
21:37:01FromDiscord<notchris> sorry @lqdev
21:37:07FromDiscord<notchris> how do i write that in a proc constructor
21:37:16FromDiscord<notchris> for instance
21:37:17FromDiscord<notchris> `proc newAlert(text: string, cb: ): Alert =`
21:37:19FromDiscord<notchris> for 'cb'
21:39:53FromDiscord<notchris> right now im doing `proc newAlert(text: string, cb: proc ): Alert =` which seems to not error?
21:40:23*leorize quit (Ping timeout: 240 seconds)
21:44:13*a_chou quit (Ping timeout: 246 seconds)
21:46:37*mbomba joined #nim
21:47:54*leorize joined #nim
21:48:43FromDiscord<ElegantBeef> That should work i believe, it
21:49:11FromDiscord<ElegantBeef> 'll make it generic so whenever it's invoked it'll make a proc underneath afaik
21:53:13FromDiscord<notchris> hmmm
21:53:39FromDiscord<Gyllou> has anybody used msgpack4nim on here?
21:55:24FromDiscord<Recruit_main707> i have
21:55:59FromDiscord<Gyllou> do you have an example of packing writing to file, loading and unpacking something like a simple array?
21:56:20FromDiscord<Gyllou> im trying to pack arraymancer 2d tensors into msgpack
21:56:43FromDiscord<Recruit_main707> i might have something on github
21:57:04FromDiscord<Gyllou> i would really appreciate it if you link, ive been fiddling with it for too long now
21:57:18disruptek!repo frosty
21:57:19disbothttps://github.com/disruptek/frosty -- 9frosty: 11serialize native Nim types to strings, streams, or sockets β›„ 15 16⭐ 0🍴
21:57:59FromDiscord<Gyllou> @disruptek is that cross language?
21:58:04disruptekno.
21:58:14FromDiscord<Recruit_main707> i jut remembered, i stopped using msgpack4nim, i can still try to show you an example tho
21:58:15FromDiscord<Gyllou> kk, ill probably still use it
21:58:19disruptekthere's an example of msgpack4nim in golden.
21:58:21disruptek!repo golden
21:58:22disbothttps://github.com/disruptek/golden -- 9golden: 11a benchmark for compile-time and/or runtime Nim πŸ† 15 23⭐ 0🍴
21:58:39disrupteki'm not a fan of it; perhaps you can see what i don't like about it.
21:59:05FromDiscord<Recruit_main707> tbh, the msgpack readme has an example for pretty much everything
21:59:23FromDiscord<Gyllou> msgpack4nim is not impressive, i mainly want the msgpack file type
21:59:47FromDiscord<Recruit_main707> msgpack doesnt is not a file type
21:59:57FromDiscord<Recruit_main707> doesnt have/is not
21:59:58FromDiscord<Gyllou> its a bin format
22:00:13FromDiscord<Gyllou> like hdf5 or parquet
22:00:17FromDiscord<Recruit_main707> ok
22:01:03*leorize quit (Ping timeout: 240 seconds)
22:01:15FromDiscord<Gyllou> i need a compressed way to store ann weight vectors, vectorized input data, adjaceny matrices,
22:01:24FromDiscord<Gyllou> and other stuff without it being huge
22:01:32disruptekwhat we're using for ic is what i'd recommend.
22:01:34FromDiscord<Gyllou> do you disagree? do you have some other idea of what it is?
22:01:57disruptek!repo guzba/supersnappy
22:01:58disbothttps://github.com/guzba/supersnappy -- 9supersnappy: 11Dependency-free and performant Nim Snappy implementation. 15 15⭐ 0🍴
22:02:23disruptekwe freeze with frosty, then compress with snappy.
22:02:46FromDiscord<Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=2Dm0
22:03:20disrupteki did some tests... i wanna say i turned 4meg of memory into a 200k file. something like that.
22:06:50*leorize joined #nim
22:10:36FromDiscord<Gyllou> i got msgpack4nim working the way i want
22:10:41FromDiscord<Gyllou> def user error
22:10:49disrupteknice.
22:10:53FromDiscord<Gyllou> still, i dont really like the nim implementation
22:11:13FromDiscord<Recruit_main707> i think its pretty clean, havent used any other though
22:11:31disrupteki didn't really look at it.
22:11:43FromDiscord<Gyllou> i think it might just be dealing with nim streams, a little different for me
22:12:01FromDiscord<Gyllou> so looks like snappy is a compression format
22:12:20FromDiscord<Gyllou> would be appropriate to do snappy(mymsgpackfile)?
22:12:31disruptekyeah; that's what i do with frosty.
22:12:38FromDiscord<Gyllou> okay cool
22:12:47FromDiscord<Gyllou> jsut checking, i hadnt really heard of snappy
22:12:58FromDiscord<Gyllou> i usually use msgpack for interlanguage ipc over zmq
22:13:00disruptekit's literally, `compress(freeze <some rando object>)`
22:13:13FromDiscord<Gyllou> basically anything that isnt a string or numpy array ill pack and send
22:13:22disrupteksure.
22:13:28disrupteki'm just too old for this shit.
22:13:37FromDiscord<Gyllou> lol
22:13:37*mbomba quit (Quit: WeeChat 2.9)
22:13:48disruptekthe abstraction i want is "freeze(foo)" .. "thaw(foo)".
22:14:03disruptek"i don't care." -- araq, 2020
22:14:26FromDiscord<Gyllou> ill take a look at the nim specific serialization implementation
22:14:31FromDiscord<Gyllou> are you araq?
22:14:37disruptekwhat a strange question.
22:14:48FromDiscord<Gyllou> idk who you are lol
22:15:01FromDiscord<Gyllou> nobody said theyve gotta have the same username
22:15:05*disruptek points to Araq.
22:15:13disruptekAraq, meet Gyllou.
22:15:20FromDiscord<Gyllou> oh i
22:15:20disruptekGyllou, meet Araq.
22:15:34FromDiscord<Gyllou> figured theyd be in the moderator list
22:15:50disruptekthey are.
22:16:05disruptekget a real chat client.
22:16:10FromDiscord<Gyllou> oh maybe on irc
22:16:15FromDiscord<Gyllou> damn
22:19:26FromDiscord<ElegantBeef> There arent any strong feelings chat clients here
22:20:05FromDiscord<Recruit_main707> we have 2@Araqs
22:20:17FromDiscord<Recruit_main707> and the bridge pings the fake one :P
22:20:37FromDiscord<ElegantBeef> Well the discord versions of the irc peoples are ploys!
22:21:25FromDiscord<dom96> Don't worry, now that I'm on Discord it's only a matter of time before Araq makes his way here too πŸ˜›
22:22:00FromDiscord<Gyllou> i havent used irc in over a decade, good memories though
22:22:13FromDiscord<Gyllou> makes me miss playing ut99 actually
22:22:26FromDiscord<ElegantBeef> I really need to make something like mumble to embed into element so i can abandon discord for the most part πŸ˜„
22:22:48disruptekwhy would you want to support a closed platform?
22:22:56FromDiscord<ElegantBeef> Element isnt closed?
22:23:11FromDiscord<ElegantBeef> Nor would my voip implementation
22:23:13FromDiscord<Gyllou> i finally started messing with discord earlier this year to get away from steam chat and psn
22:23:24FromDiscord<Gyllou> ended up using it mostly for programming stuff
22:23:40disruptekit's dumb.
22:23:47FromDiscord<Gyllou> lol
22:23:51FromDiscord<Gyllou> somebody is grumpy
22:24:03disruptekit's pretty much my default setting.
22:24:22FromDiscord<ElegantBeef> I dont really like discord due to not being OSS and also not permitting 3rd party clients
22:24:24FromDiscord<Gyllou> fair, im usually set to indifferent
22:24:33disruptekwho cares?
22:24:59FromDiscord<ElegantBeef> Nah he's not grumpy, this is his happy
22:25:05FromDiscord<Gyllou> lol
22:25:15disruptekit only goes downhill from here.
22:25:45FromDiscord<Gyllou> getting my friends onto steam was a epic feat, i think trying to get them on irc is hopeless.
22:25:51FromDiscord<Gyllou> most of them are computer illiterate
22:25:53FromDiscord<ElegantBeef> Eh IRC is ugh
22:26:00FromDiscord<ElegantBeef> It does what it sets out to well
22:26:23FromDiscord<ElegantBeef> But i dont like what it does, matrix is much more interesting, so something like element is nice
22:26:41FromDiscord<Gyllou> i liked it back in the day because of the type of people that were there as opposed to idk 90's chat rooms or something horrid
22:27:02disruptek#hack was fun for awhile.
22:27:28FromDiscord<Gyllou> i mainly hung out there for game stuff
22:28:01FromDiscord<Gyllou> im glad there is twitch, bc now all the people i dont want to talk to have moved there
22:28:29FromDiscord<ElegantBeef> But you're talking to me right now...
22:28:36disruptekthat's how i feel about my cell phone.
22:28:55disrupteki keep it on do-not-disturb all the time. basically, if you're calling me, i don't want to talk to you.
22:29:06FromDiscord<Gyllou> lol fair, im assuming you use twitch, but its not for me. if i wanna watch gameplay i goto youtube
22:29:07disruptekit's sorta idea.
22:29:09disruptekideal.
22:29:19FromDiscord<ElegantBeef> I dont use twitch, the joke was you probably dont want to speak to me
22:29:25FromDiscord<Gyllou> yea im terrible with mine
22:29:33FromDiscord<Gyllou> lol gotcha, you seem nice enough
22:29:46FromDiscord<Gyllou> im just not interested in talking about dota or fortnite
22:29:57disruptekbeef comes from good stock, but somewhere along the line he just picked up some bad habits.
22:30:11FromDiscord<dom96> pretty sure most people keep their phone on silent mode. I tend to hate those that don't.
22:30:19FromDiscord<Gyllou> agreed
22:30:21FromDiscord<ElegantBeef> When disruptek says i have bad habits... does that mean i just bathe too much πŸ˜„
22:30:25FromDiscord<Cloudperry> hi, I think I've ran into a Nim bug and I want to know if this is actually a bug
22:30:50disruptekhold your laptop a little closer to your router; i can't quite make out what's on your screen.
22:30:53FromDiscord<Cloudperry> so I wanted to limit a length of a string to make it usable as a file name
22:31:03disruptekoh yeah?
22:31:16FromDiscord<Cloudperry> and for some reason I tried using setLen on the string
22:31:21FromDiscord<ElegantBeef> Easiest way to see if you found a bug is to post a minimal example here https://play.nim-lang.org/
22:31:23disruptekwait, are you coding this on an ipod or something?
22:31:34FromDiscord<ElegantBeef> They arent technisha
22:31:47disruptekwhat's a typical filename length?
22:32:27FromDiscord<Cloudperry> and then if the string is over the limit that I set using setLen(limit), the string will have terminating zeroes in the middle
22:33:05disrupteknative nim strings don't have terminators per se.
22:33:11FromDiscord<Cloudperry> so like if I do echo repr(filenameStr) I will get \0\0\0\0 in the middle of the repr of the string
22:33:38disruptekwell, setLen will set the length to whatever you tell it to.
22:33:46*nekits07 quit (Read error: Connection reset by peer)
22:34:07disrupteksetLen(min(mystring.len, myMaxLength))
22:34:36*nekits07 joined #nim
22:34:44disruptekthere's probably even a truncation proc or something.
22:34:44FromDiscord<Cloudperry> but for some reason if I append something to the string after setLen, it leaves \0\0\0\0 in the middle of my string
22:34:57FromDiscord<Cloudperry> that shouldn't ever happen right?
22:35:00disruptekbecause setLen will grow the string as necessary.
22:35:03FromDiscord<dom96> it's expected
22:35:08FromDiscord<dom96> setLen will fill with \0
22:35:15FromDiscord<Cloudperry> oh right
22:35:25FromDiscord<Cloudperry> well good to know its not a bug then
22:35:37FromDiscord<Cloudperry> I already found a much better way to cap string length
22:36:24FromDiscord<Cloudperry> now I'm using string[0..min(lenLimit, string.high)]
22:36:38FromDiscord<Cloudperry> instead of string.setLen(lenLimit)
22:36:40disruptekthat'll copy it, though.
22:37:10FromDiscord<Cloudperry> yeah I meant string = string[0 .. min(lenLimit, string.high)]
22:37:23FromDiscord<Cloudperry> it works
22:38:58*solitudesf quit (Ping timeout: 258 seconds)
23:00:19FromDiscord<Cloudperry> I'm tired and I didn't tell what my code was actually doing
23:00:41disrupteki have a bad feeling about your code.
23:01:13FromDiscord<Cloudperry> the problem was that it was doing testString.setLen(lenLimit) and the length of the string was under the limit
23:01:24FromDiscord<Cloudperry> so it filled it up to lenLimit with zeroes
23:01:59FromDiscord<Cloudperry> this is what I actually wanted to do: testStr.setLen(min(testStr.len, lenLimit))
23:02:25FromDiscord<Cloudperry> now it probably doesn't even do a copy
23:02:44disruptekright.
23:03:22FromDiscord<Cloudperry> cmon dude u have only seen one line that I wrote in a really dumb way πŸ˜„
23:03:45FromDiscord<Cloudperry> I will notice those really fast the next day since my project isn't that big
23:04:03disrupteki'm agreeing with you.
23:04:18FromDiscord<Cloudperry> also I had a couple of weeks break from writing Nim
23:04:26disrupteki was pretty sure you knew this; that's why i didn't mention it.
23:04:47FromDiscord<Cloudperry> yeah its alright
23:04:53FromDiscord<Cloudperry> I'm going to bed now
23:04:55FromDiscord<Cloudperry> bye
23:05:01disruptekpeace
23:06:23*leorize quit (Ping timeout: 240 seconds)
23:15:20FromDiscord<notchris> has anyone used wraptool?
23:20:29*leorize joined #nim
23:27:19*tane quit (Quit: Leaving)
23:32:04FromDiscord<cabboose> My mind went straight to WAPtool and then WAP. Society is dying
23:35:30FromDiscord<exelotl> ah yes, wireless access points
23:51:14FromDiscord<dom96> ouch, `cstring` is freaking dangerous
23:52:03FromDiscord<dom96> Nim happily converts `string` to it and if you store it then read it somewhere you get garbage memory read back
23:58:04*lbart quit (Ping timeout: 240 seconds)