00:15:41 | * | Quix joined #nim |
00:16:01 | * | Quix quit (Remote host closed the connection) |
00:16:25 | * | QVal joined #nim |
00:16:54 | FromDiscord | <nikki> i've also declared the var in nim before then done |
00:17:24 | FromDiscord | <nikki> `{.emit: theVar, " = coolStuff();".}` |
00:39:12 | jonjitsu[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:25 | FromDiscord | <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:36 | TaintedString | So 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:46 | FromDiscord | <ElegantBeef> Could you provide more code? |
01:49:00 | TaintedString | Yep. https://play.nim-lang.org/#ix=2DgR |
01:50:42 | jonjitsu[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:48 | FromDiscord | <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:23 | FromDiscord | <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:53 | FromDiscord | <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:21 | TaintedString | Okay, so always use seq[T] |
01:56:40 | FromDiscord | <ElegantBeef> Well like i do there where i explictly state the type |
01:56:48 | * | TomDotTom quit (Quit: leaving) |
01:56:57 | FromDiscord | <ElegantBeef> you were making a proc that looked like `proc doThing(a: seq[T]): seq[T]` |
01:57:06 | FromDiscord | <ElegantBeef> so it couldnt return anything but the input type |
01:57:16 | TaintedString | ahhhh |
01:57:18 | TaintedString | Gotcha. |
01:57:46 | FromDiscord | <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:19 | TaintedString | Yeah 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:39 | FromDiscord | <ElegantBeef> Yea explict types will seem confusing, but nim's type system is also a godsend |
01:59:00 | FromDiscord | <ElegantBeef> For instance you could use `openArray[string]` as your input and that'd let you accept arrays and seqs of strings |
02:02:16 | TaintedString | Yeah 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:39 | jonjitsu[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:25 | Prestige | Are the fidget examples failing for anyone else? |
06:05:44 | Prestige | I'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:27 | FromDiscord | <cabboose> Which example? |
06:09:45 | Prestige | https://github.com/treeform/fidget/blob/master/examples/demo/demo.nim |
06:14:08 | FromDiscord | <cabboose> Confirming you have followed the steps described on the homepage? |
06:14:29 | FromDiscord | <cabboose> Nim is most recent version? |
06:16:47 | Prestige | Yeah 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:10 | Prestige | {.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:02 | mipri | pass 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:53 | FromDiscord | <flywind> Can I overload `[]=` for `cstring` type? |
10:47:36 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2DiD |
10:51:31 | mipri | when you assign a char instead, and chance c to char, the []= goes unused. so there's somethign else there. |
10:54:35 | FromGitter | <offbeat-stuff> Hi |
10:54:55 | FromGitter | <offbeat-stuff> I want an object to store another object |
10:55:05 | FromGitter | <offbeat-stuff> 's address |
10:56:00 | Zevv | I'll allow it |
10:56:17 | Zevv | but for this time only |
10:56:41 | FromGitter | <offbeat-stuff> But be able to treat it as a var |
10:57:30 | FromGitter | <offbeat-stuff> How do declare types without implementing them |
10:57:53 | FromGitter | <offbeat-stuff> type a = object |
10:58:11 | FromGitter | <offbeat-stuff> a:b |
10:58:27 | mipri | you 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:35 | FromGitter | <offbeat-stuff> type b= object β β ``` b:a``` [https://gitter.im/nim-lang/Nim?at=5fa67ddaf2fd4f60fc5c15b6] |
10:59:03 | mipri | it'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:05 | FromGitter | <offbeat-stuff> But they are different and I need them to be seperate variables |
10:59:09 | Zevv | he's not asking about mutual recursion, is he |
10:59:47 | mipri | well I'm practically resorting to occult practices to discern a question |
11:00:03 | * | leorize quit (Ping timeout: 240 seconds) |
11:00:05 | FromGitter | <offbeat-stuff> Should I just use a ptr |
11:00:06 | mipri | I think he still might be. |
11:00:07 | FromGitter | <offbeat-stuff> and cast it |
11:00:21 | Zevv | offbeat-stuff: ask your question better. What did you try, and what did not work? Show a complete snippet of what you did. |
11:00:38 | Zevv | your problem statement is too vague |
11:00:49 | mipri | if 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:22 | FromDiscord | <Recruit_main707> any examples on how to create a directory and create a file inside it at compile time? |
11:01:40 | FromGitter | <offbeat-stuff> https://play.nim-lang.org/#ix=2DiM |
11:01:56 | mipri | there, see? mutual recursion. |
11:02:08 | Zevv | Recruit_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:44 | FromDiscord | <Recruit_main707> to create the directory ill need to use the command line? ok |
11:03:00 | Zevv | offbeat-stuff: https://play.nim-lang.org/#ix=2DiO |
11:03:05 | Zevv | "ref" is the word |
11:03:22 | Zevv | and since you *are* doing mutually recursive stuff, make sure to put them both in the same `type` block. |
11:03:22 | mipri | https://nim-lang.org/docs/nimscript.html#mkDir%2Cstring |
11:06:02 | Zevv | mipri: nimscript != compile time |
11:06:45 | mipri | ah, so |
11:13:33 | FromGitter | <offbeat-stuff> How do i convert and obj to ref obj |
11:17:41 | * | leorize joined #nim |
11:23:48 | FromDiscord | <Recruit_main707> ref is a managed pointer, your example can work with normal ptrs, just change the var with ptr |
11:28:37 | mipri | you *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:16 | ForumUpdaterBot | New 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:17 | Zevv | offbeat-stuff: http://zevv.nl/nim-memory/ |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:18 | FromDiscord | <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:20 | FromDiscord | <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:39 | FromDiscord | <haxscramper> Not necessarily for "what macro to use as example", something else might do as well |
12:25:20 | ForumUpdaterBot | New 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:32 | bung | found use nimpretty and nimfmt both will cause initNimSuggest throw error |
12:39:00 | FromDiscord | <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:05 | FromDiscord | <alehander42> π |
12:57:25 | * | leorize joined #nim |
13:03:16 | FromDiscord | <haxscramper> Write parser generator with that also declares AST types and then use pattern matching on generated AST |
13:03:48 | FromDiscord | <haxscramper> Some kind of DSL would be nice, but I'm completely out of (simple) ideas |
13:03:50 | FromDiscord | <alehander42> yeah |
13:03:57 | FromDiscord | <alehander42> basically that's what macros do anyway |
13:04:04 | FromDiscord | <alehander42> so an example of a macro would be good |
13:04:14 | FromDiscord | <alehander42> and also some kind of data processing maybe |
13:04:19 | FromDiscord | <alehander42> not sure about the last one |
13:04:28 | FromDiscord | <haxscramper> Oh, I know |
13:06:00 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Dji |
13:06:37 | FromDiscord | <alehander42> hmm |
13:06:41 | FromDiscord | <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:56 | FromDiscord | <alehander42> maybe that's ok |
13:06:59 | FromDiscord | <haxscramper> This is like shell piping basically - awk is poor man's pattern matching |
13:07:05 | FromDiscord | <alehander42> some kind of iterator support tho would be so good |
13:07:13 | FromDiscord | <alehander42> what happened to @timothee 's idea |
13:07:29 | FromDiscord | <alehander42> i remember he wanted to do something like ranges composable |
13:07:52 | FromDiscord | <haxscramper> Yeah, it will be just as zerofunctional - convert into single loop with call chain |
13:08:11 | FromDiscord | <haxscramper> Well, maybe a little more complicated |
13:08:36 | FromDiscord | <haxscramper> And this is for article example, so it should be simple anyway |
13:08:45 | FromDiscord | <alehander42> keep it simple |
13:08:46 | FromDiscord | <alehander42> π |
13:08:57 | FromDiscord | <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:47 | FromDiscord | <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:10 | FromDiscord | <krisppurg> (edit) "pipe:1`?" => "pipe:1`, then return the std out?" |
13:51:34 | * | mmohammadi9812 quit (Quit: Quit) |
13:53:31 | ForumUpdaterBot | New thread by HJarausch: Local types - how to, see https://forum.nim-lang.org/t/7049 |
13:57:24 | FromDiscord | <haxscramper> @krisppurg https://nim-lang.org/docs/os.html#execShellCmd%2Cstring for simple use cases this should be enough |
13:57:37 | FromDiscord | <haxscramper> !repo shell |
13:57:39 | disbot | https://github.com/inim-repl/INim -- 9INim: 11Interactive Nim Shell / REPL / Playground 15 368β 18π΄ 7& 28 more... |
13:57:59 | FromDiscord | <haxscramper> no this one |
13:58:09 | FromDiscord | <haxscramper> https://github.com/Vindaar/shell - this |
14:02:47 | FromDiscord | <krisppurg> @haxscramper I want the output given as I said "return the std out" |
14:12:43 | FromDiscord | <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:24 | FromDiscord | <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:01 | FromDiscord | <krisppurg> but what about std libs? |
14:14:19 | FromDiscord | <krisppurg> i mean ive found execProcess and I wonder if I should either use that? |
14:14:22 | FromDiscord | <krisppurg> (edit) "that?" => "that" |
14:16:24 | FromDiscord | <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:30 | FromDiscord | <krisppurg> hax? |
14:20:06 | FromDiscord | <haxscramper> yes? |
14:20:17 | FromDiscord | <krisppurg> did you listen to what I said? |
14:20:32 | FromDiscord | <krisppurg> sorry if I sound rude |
14:21:31 | FromDiscord | <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:37 | FromDiscord | <lqdev> but it can be a bit verbose |
14:22:01 | FromDiscord | <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:02 | FromDiscord | <krisppurg> I just want to make sure what procedure I'm using is better. |
14:22:11 | FromDiscord | <lqdev> oh cool `peekableOutputStream` is a new thing in 1.4 |
14:22:12 | FromDiscord | <haxscramper> What @lqdev just linked basically |
14:22:25 | FromDiscord | <krisppurg> I will try startProcess |
14:22:30 | FromDiscord | <lqdev> there |
14:22:34 | FromDiscord | <lqdev> there's also https://nim-lang.org/docs/osproc.html#execCmdEx%2Cstring%2Cset%5BProcessOption%5D%2CStringTableRef%2Cstring%2Cstring |
14:22:38 | FromDiscord | <lqdev> which is easier to use |
14:22:50 | FromDiscord | <lqdev> gosh these doc URLs are insane |
14:23:02 | FromDiscord | <krisppurg> if you think thats insane |
14:23:16 | FromDiscord | <krisppurg> https://media.discordapp.net/attachments/371759389889003532/774640113728749568/unknown.png |
14:23:35 | FromDiscord | <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:12 | FromDiscord | <lqdev> yes krisppurg, we know about this issue. |
14:26:25 | FromDiscord | <lqdev> gosh somebody push the changes to stable |
14:26:41 | FromDiscord | <lqdev> or give me back my 1.2 docs |
14:27:07 | FromDiscord | <krisppurg> f |
14:28:40 | FromDiscord | <exelotl> I still think something like this would be better https://cdn.discordapp.com/attachments/371759389889003532/769216888168251413/unknown.png |
14:29:22 | FromDiscord | <lqdev> 100% agreed |
14:29:38 | FromDiscord | <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:34 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2DjG |
14:31:01 | FromDiscord | <lqdev> yes |
14:32:40 | FromDiscord | <Rika> Why even repeat the procedure name |
14:33:58 | FromDiscord | <haxscramper> Reuse mangling algorithm for proc generation to make shorter links |
14:34:12 | FromDiscord | <haxscramper> proc/type/etc url generation |
14:36:23 | FromDiscord | <krisppurg> might be a dumb question but how would i write a binary data to stream? |
14:37:15 | * | narimiran joined #nim |
14:41:27 | FromDiscord | <Clyybber> > gosh somebody push the changes to stableβ΅done already, its your browser's cache |
14:42:27 | narimiran | how about converting those ideas into a PR? |
14:42:42 | narimiran | (about making TOC prettier) |
14:43:51 | narimiran | but 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:05 | FromGitter | <matrixbot> `ache-of-head` bonjour |
15:52:33 | FromGitter | <matrixbot> `ache-of-head` i'm trying out element πΏ |
15:53:19 | FromDiscord | <lqdev> ache-of-head are you rarted |
15:53:22 | FromDiscord | <lqdev> dude |
15:53:32 | FromDiscord | <lqdev> you know that matrix has an irc bridge, right? |
15:53:34 | FromGitter | <matrixbot> `ache-of-head` π |
15:53:41 | FromGitter | <matrixbot> `ache-of-head` wdym |
15:54:05 | FromDiscord | <lqdev> i mean that your messages display like this on IRC https://media.discordapp.net/attachments/371759389889003532/774662968414830612/unknown.png |
15:54:17 | FromDiscord | <lqdev> because you're going through matrixβgitterβIRC |
15:54:23 | FromDiscord | <ache of head> bruh |
15:54:23 | FromDiscord | <lqdev> you can just do matrixβIRC |
15:54:30 | FromDiscord | <ache of head> how do i do that doe |
15:54:31 | FromDiscord | <ache of head> lmao |
15:54:58 | FromDiscord | <lqdev> hold on |
15:55:53 | FromDiscord | <lqdev> you search in freenode rooms |
15:56:14 | FromDiscord | <lqdev> https://media.discordapp.net/attachments/371759389889003532/774663510663757865/unknown.png |
15:56:18 | FromDiscord | <lqdev> iirc leorize also set up a community |
15:56:32 | FromGitter | <matrixbot> `ache-of-head` ah |
15:56:34 | FromDiscord | <ache of head> okay maybe i wont write through there anymore |
15:56:38 | FromDiscord | <ache of head> my mistake, sorry |
15:56:44 | FromDiscord | <lqdev> it's fine dude |
15:56:56 | FromDiscord | <lqdev> didn't mean to sound rude :( |
15:57:09 | FromDiscord | <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:35 | ache-of-head[m] | how about this π³ |
15:57:43 | FromDiscord | <ache of head> yay it works |
15:58:26 | FromDiscord | <lqdev> yaaaaaay |
15:58:38 | FromDiscord | <Rika> What if lq wanted it to be birch and not oaky |
15:58:46 | FromDiscord | <ache of head> π |
15:59:00 | FromDiscord | <ache of head> all i do is disappoint everyone at every stage of my life |
15:59:19 | FromDiscord | <ache of head> okay this is #main after all |
15:59:21 | FromDiscord | <ache of head> let's not spam |
16:04:19 | disruptek | Zevv: mp, it's cute. almost makes me want to abandon the nim parser. |
16:06:33 | Zevv | I once started making a nim parser that emits NimNodes |
16:06:36 | Zevv | but I got bored |
16:07:23 | * | leorize quit (Ping timeout: 240 seconds) |
16:08:49 | disruptek | i need to break up some of my larger projects so i can actually make progress. |
16:10:26 | Zevv | that's generally good advice, life-wise |
16:11:10 | disruptek | you mean, like, chewing? |
16:12:09 | Zevv | to name one, yes |
16:13:05 | * | tane joined #nim |
16:13:50 | * | PMunch joined #nim |
16:16:09 | PMunch | Hi everyone, got any good beginner videos for non-programmers? Got a friend who is bored out of their mind during Corona :P |
16:17:27 | Zevv | Friends don't let their friends do that kind of thing |
16:18:32 | PMunch | Do what? Start programming? |
16:20:34 | Zevv | yeah |
16:22:48 | disruptek | i'm curious to see something like that. |
16:23:37 | disruptek | the video i point non-programmers to in order to explain nim is "growing a language". |
16:24:46 | disruptek | but why don't you record something? aren't you a streamer now? |
16:27:24 | PMunch | Haha, I guess I could |
16:27:42 | Zevv | his streams are lame. It's all programming and talk and talk and programming |
16:28:00 | Zevv | The beard tho, man, that's glorious |
16:28:26 | Zevv | and - this really has to be sad - the man knows how to get his sound proper |
16:28:54 | Zevv | I get goosebumps the second I put up my headphones, with pmunch intimately whispering into my ears |
16:29:40 | Zevv | and my wife asking me what I'm watching there, with red cheeks and dilated pupils |
16:29:45 | Zevv | "Yeah, that's just pmunch streaming" |
16:29:54 | Zevv | you think she beleives that? |
16:30:22 | PMunch | Haha :P |
16:30:43 | PMunch | Let me know and I'll record an apology for her |
16:31:00 | Zevv | but seriously, it's great stuff PMunch, really |
16:31:47 | PMunch | Thanks :) |
16:33:08 | disruptek | i wish i could watch. |
16:33:24 | Zevv | what kind of pipe are you on now then? |
16:33:39 | disruptek | maybe i should try out this youtube-dl thing everyone has their panties in a twist over. |
16:33:52 | Zevv | I cna mail you the DVDs? |
16:33:59 | PMunch | Only one of them have made it onto YouTube so far |
16:34:08 | disruptek | only one? |
16:34:10 | disruptek | link? |
16:34:12 | PMunch | The plan is to start uploading more of them once the quality is higher |
16:34:27 | disruptek | you can just delete low-quality ones later. |
16:34:30 | disruptek | who gives a shit. |
16:35:09 | * | leorize joined #nim |
16:35:54 | PMunch | True |
16:36:56 | PMunch | https://www.youtube.com/watch?v=Ow1uqY4fR3c This is the one that's uploaded by the way |
16:37:09 | disruptek | if i were worried about quality i'd have never started streaming. |
16:37:25 | disruptek | but i guess you knew that. |
16:40:28 | PMunch | Haha, not sure if I've ever seen any of your streams |
16:44:32 | PMunch | Great.. I've got an old radio that I've retrofitted to have a Chromecast inside |
16:44:43 | PMunch | But it has an alarm in it that goes off once a day |
16:44:55 | PMunch | And to disable alarm, you need the remote, which I don't have -_- |
16:47:03 | * | abm joined #nim |
16:51:26 | Zevv | disruptek: tell him about the music |
16:52:04 | * | ache-of-head joined #nim |
16:52:36 | ache-of-head | poggers, does this work? |
16:52:45 | FromDiscord | <ache of head> it does π |
16:53:35 | disruptek | i have picture but it's like 45sec of "Please stand by" so far. |
16:54:41 | blueberrypie | Is is possible to define a distant type using a few (non-linear) items such as "a", "g", and "x" |
16:55:05 | FromDiscord | <lqdev> distant type? |
16:55:17 | blueberrypie | distinct type sry |
16:57:15 | blueberrypie | hmmm this appears close enough https://github.com/nim-lang/Nim/blob/version-1-4/lib/system/basic_types.nim#L32 |
16:57:23 | disruptek | i would probably use an enum, but it's technically possible to do it with strings. |
16:57:30 | PMunch | disruptek, yeah that's before I started streaming, lasts for a while |
16:57:48 | disruptek | i'd raise your font size. |
16:57:49 | blueberrypie | ok thanks |
16:58:01 | PMunch | Even further? |
16:58:04 | disruptek | note that you can specify the "string value" for enums. |
16:58:11 | disruptek | yeah; i couldn't read it at 360p. |
16:58:22 | disruptek | i mean, are you going to have >80char lines? |
16:58:32 | blueberrypie | disruptek: perfect |
16:58:36 | blueberrypie | works good for me |
16:58:37 | PMunch | Ah yes, I increase it further into the video |
16:58:49 | disruptek | cool. |
16:59:33 | PMunch | At 10:27 |
17:02:57 | disruptek | PMunch: you make me want to shave |
17:03:03 | disruptek | my balls. |
17:03:07 | disruptek | i mean, my face. |
17:04:20 | PMunch | Haha |
17:04:38 | disruptek | the problem is that everyone is watching television in the US, so there's no fucking bandwidth left for me to watch you. |
17:04:52 | disruptek | whatfer biden-wins reasons. |
17:06:48 | disruptek | your desym code doesn't work. |
17:06:56 | disruptek | whatfer gensym reasons. |
17:06:59 | PMunch | Yes it does.. |
17:07:14 | disruptek | you need to use repr to render a gensym with its unique identifier trash. |
17:07:44 | disruptek | it might work fine in this code; it's just an fyi. |
17:07:51 | PMunch | Aah right |
17:07:53 | blueberrypie | disruptek: is there a built in way to convert the string value to the enum value? |
17:07:56 | PMunch | I'll keep that in mind |
17:08:05 | disruptek | parseEnum[MyEnumType](someString) |
17:08:09 | PMunch | We should really add something like this to the stdlib though.. |
17:08:10 | disruptek | see strutils module. |
17:08:11 | blueberrypie | thanks |
17:09:02 | disruptek | i 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:26 | Zevv | bah now I even added function overloads |
17:09:29 | disruptek | another unpopular disruptek opinion. |
17:09:30 | Zevv | overengineering again :/ |
17:09:46 | disruptek | i use zevv's filter pattern in like 90% of my rewrite code. |
17:10:09 | Zevv | what's "zevv filter pattern"? |
17:10:35 | disruptek | NodeFilter, you called it. |
17:10:52 | Zevv | I don't know what that is |
17:10:59 | Zevv | oh it's a macro thingy right |
17:11:12 | Zevv | ah, diner! |
17:11:12 | disruptek | it runs the fn arg on the ast node or its children. |
17:11:47 | FromDiscord | <Clyybber> disruptek: adding to macros.nim is less dangerous tho |
17:11:53 | FromDiscord | <Clyybber> also Hi :D |
17:12:02 | disruptek | sup dawg |
17:12:28 | * | ache-of-head quit (Quit: Leaving) |
17:12:31 | disruptek | we risk nothing by letting the ecosystem evolve the solutions for us. |
17:12:57 | disruptek | much more interesting problems in the compiler that we can't screw up so easily. |
17:13:15 | FromDiscord | <Clyybber> I finished the core of the untyped fix btw |
17:13:33 | PMunch | This was something that when I mentioned it it seemed like everyone had implemented their own version of it though |
17:13:37 | FromDiscord | <Clyybber> now I only gotta add shadowscoping and fix the exponential mem usage |
17:13:50 | PMunch | Would be nice to have a right way |
17:13:55 | disruptek | PMunch: true; so we have several different impls and i've already shown that they aren't all correct. |
17:14:03 | disruptek | no reason to think that mine is any different. |
17:14:03 | PMunch | That can be fixed by whoever makes changes elsewhere |
17:14:08 | FromDiscord | <Clyybber> yeah, but we have one correct |
17:14:49 | disruptek | clyybber: "untyped fix"? |
17:14:50 | FromDiscord | <Clyybber> its in some test |
17:15:03 | FromDiscord | <Clyybber> disruptek: Yeah, the one where symbols leak out |
17:15:34 | disruptek | which one is that? |
17:15:38 | FromDiscord | <Clyybber> https://github.com/nim-lang/Nim/issues/14844 the root cause of https://github.com/nim-lang/Nim/issues/14404 |
17:15:41 | disbot | β₯ `foldr` raises IndexError when called on sequence ; snippet at 12https://play.nim-lang.org/#ix=2DkE |
17:15:49 | disruptek | ahh |
17:16:05 | disruptek | i thought this was already solved months ago. |
17:16:17 | FromDiscord | <Clyybber> no, I kept working on it on and off |
17:16:37 | FromDiscord | <Clyybber> even tho in hindsight its quite simple |
17:16:43 | disruptek | your avatar change is blowing my mind right now. |
17:16:49 | FromDiscord | <Clyybber> its a real showstopper IMO; and I seen a few people stumble upon it |
17:16:57 | disruptek | yes, it's clearly wrong. |
17:16:59 | FromDiscord | <Clyybber> disruptek: Lol, do you see that? |
17:17:03 | disruptek | this is exactly what i'm talking about, though. |
17:17:14 | FromDiscord | <Clyybber> oh github avatar yeah |
17:17:14 | disruptek | this stuff is very poorly defined. |
17:17:22 | disruptek | we shouldn't be fucking with the stdlib yet. |
17:17:28 | FromDiscord | <Clyybber> I changed it to my gitlab one :D |
17:17:30 | disruptek | there's no standard, by definition. |
17:18:00 | FromDiscord | <Clyybber> yeah, in this case I'm grateful that this wasn't in the spec |
17:20:29 | disruptek | i guess araq was right again. |
17:21:06 | FromDiscord | <Gyllou> hey, does anyone know of any xxHash implementations for nim? |
17:21:30 | disruptek | PMunch: can notifishower completely replace my mako? |
17:21:57 | disruptek | gyllou: there's a 3rd-party hashing module you could try. |
17:22:26 | disruptek | shashlick made a meowhash wrapper, too. perhaps useful to you. |
17:22:40 | disruptek | !repo hashes |
17:22:41 | disbot | https://github.com/jangko/nimSHA2 -- 9nimSHA2: 11Secure Hash Algorithm 2 15 21β 6π΄ 7& 18 more... |
17:22:46 | disruptek | !repo hash |
17:22:47 | disbot | https://github.com/jangko/nimSHA2 -- 9nimSHA2: 11Secure Hash Algorithm 2 15 21β 6π΄ 7& 22 more... |
17:22:50 | disruptek | doh. |
17:22:50 | FromDiscord | <Clyybber> disruptek: in what way? |
17:22:58 | disruptek | !repos hashes |
17:22:59 | disbot | https://github.com/jangko/nimSHA2 -- 9nimSHA2: 11Secure Hash Algorithm 2 15 21β 6π΄ |
17:22:59 | disbot | https://github.com/OpenSystemsLab/hmac.nim -- 9hmac.nim: 11HMAC-SHA1 and HMAC-MD5 hashing in Nim 15 12β 6π΄ |
17:23:00 | disbot | https://github.com/onionhammer/sha1 -- 9sha1: 11SHA-1 produces a 160-bit (20-byte) hash value. 15 7β 5π΄ 7& 16 more... |
17:23:12 | disruptek | well, i dunno, scroll around for it. |
17:23:15 | disruptek | clyybber: what? |
17:23:21 | disruptek | !repo meow |
17:23:22 | disbot | https://github.com/ucpr/meow -- 9meow: 11:cat: { meow, meow 15 0β 0π΄ 7& 1 more... |
17:23:33 | FromDiscord | <Clyybber> disruptek: being right |
17:23:37 | disruptek | !repo disruptek/meow |
17:23:37 | disbot | https://github.com/disruptek/meow -- 9meow: 11meow hash in nim 15 0β 0π΄ |
17:24:04 | disruptek | well, he didn't like the original fix and he was right to wait for you to arrive at the cheaper solution. |
17:25:14 | PMunch | disruptek, mako? |
17:25:19 | disruptek | PMunch: it's dunst for sway |
17:25:26 | disruptek | dude, you did your config in npeg? |
17:25:30 | disruptek | you're a madman. |
17:26:12 | PMunch | Haha, you find me a command line parser that supports my pattern and I'll switch :P |
17:26:24 | PMunch | Ah notifishower only works on X I'm afraid |
17:26:28 | disruptek | what's the pattern? |
17:26:49 | PMunch | https://github.com/PMunch/notifishower/blob/master/src/options.nim |
17:27:41 | disruptek | i mean, i would rather write the code to hack in support for my pattern than write yet another parser. |
17:27:52 | disruptek | not like you don't have options. |
17:27:54 | FromDiscord | <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:03 | disruptek | yeah. |
17:28:05 | FromDiscord | <Clyybber> i was just messing around there |
17:28:16 | FromDiscord | <Clyybber> now I'm slowly arriving at a good design |
17:28:27 | FromDiscord | <Gyllou> whoops didnt hear the notifications |
17:28:44 | FromDiscord | <Gyllou> going back through you mentions @disruptek |
17:28:52 | supakeen | disruptek: 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:56 | supakeen | one day it will be usable |
17:29:15 | disruptek | in npeg? |
17:29:20 | supakeen | si |
17:29:22 | supakeen | https://github.com/supakeen/clip/blob/master/tests/test.nim |
17:29:24 | supakeen | is what it does so far |
17:29:36 | disruptek | does it work as a grammar library for npeg? |
17:29:40 | disruptek | that would be super useful. |
17:29:41 | supakeen | that's the plan |
17:29:45 | disruptek | nice. |
17:30:04 | supakeen | that 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:10 | supakeen | to do stuff like mutually exclusive and subcommands |
17:30:14 | disruptek | yeah. |
17:30:22 | disruptek | you can just extend the grammar. |
17:30:27 | supakeen | si |
17:30:42 | disruptek | well, i still think PMunch is a madlad. |
17:30:46 | supakeen | maybe i have some time again tomorrow, i've been doing some improvements around the house |
17:30:46 | FromDiscord | <Gyllou> ah gotcha yea those are mostly sha stuff im looking for a specific hashing implementation |
17:30:58 | disruptek | gyllou: i figured. |
17:31:13 | disruptek | ignore those, though. |
17:31:29 | disruptek | there's /yet another one/ on github that offers several hashing routines. |
17:31:45 | supakeen | There's not a lot of consensus yet in the ecosystem :) |
17:31:45 | FromDiscord | <Gyllou> gotcha |
17:32:07 | FromDiscord | <Gyllou> yea im trying to port SLIDE to nim using arraymancer and i need a high performing hash algo |
17:32:12 | disruptek | !repo apense/shimsham |
17:32:12 | disbot | https://github.com/apense/shimsham -- 9shimsham: 11Collection of hash functions built in pure Nim 15 8β 1π΄ |
17:32:17 | FromDiscord | <Gyllou> otherwise, yea id just usmeow |
17:32:22 | supakeen | It's reasonably likely if you have a non-common hashing algorithm that nobody has made an implementation yet |
17:32:23 | disruptek | !repo khchen/hashlib |
17:32:24 | disbot | https://github.com/khchen/hashlib -- 9hashlib: 11Hash Library for Nim 15 10β 1π΄ |
17:32:36 | disruptek | meow is really fast. |
17:32:42 | disruptek | 16 bytes per cycle. |
17:32:58 | disruptek | if you can beat that for the same guarantees, i'm very interested. |
17:33:02 | FromDiscord | <Gyllou> yea i think city has is reasonably fast too |
17:33:13 | FromDiscord | <Gyllou> city hash |
17:33:20 | disruptek | !repo skrylar/skyhash |
17:33:21 | disbot | https://github.com/Skrylar/skyhash -- 9skyhash: 11Hashes for Nim. 15 0β 0π΄ |
17:33:22 | supakeen | Doesn't help much if you need $hashsomething to interact with another thing :) |
17:33:43 | disruptek | what do you mean? |
17:33:46 | FromDiscord | <Gyllou> yea id like to get SLIDE into nim and see if we can outperform the C implementation |
17:34:14 | supakeen | disruptek: 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:24 | disruptek | haha right. |
17:34:36 | supakeen | !repo supakeen/simba |
17:34:37 | disbot | https://github.com/supakeen/simba -- 9simba: 11PRNGs for Nim. 15 2β 0π΄ |
17:34:39 | supakeen | I like this bot. |
17:35:58 | FromDiscord | <Gyllou> @disruptek@supakeen xxhash is faster by an order of magnitude or so though |
17:36:21 | disruptek | neat. |
17:36:23 | FromDiscord | <Gyllou> i need primarily fast throughput as collisions would effect this algo dramatically |
17:36:32 | FromDiscord | <Gyllou> wouldnt |
17:38:46 | disruptek | well, i don't see a comparison, but meowhash appears to be just as fast. |
17:39:20 | disruptek | it appears to be around twice as fast. |
17:40:26 | disruptek | oh wait, here's a comparison: https://github.com/Cyan4973/xxHash/wiki/Performance-comparison#benchmarks-concentrating-on-small-data- |
17:40:29 | FromDiscord | <Gyllou> thats because im retarded and got it confused with murmur somehow |
17:40:35 | FromDiscord | <Gyllou> lol |
17:40:44 | disruptek | roughly the same but looks like xxh3 would be superior. |
17:42:14 | disruptek | we should totally use this for stdlib. |
17:42:35 | disruptek | did you already start impl'ing it? |
17:45:04 | FromDiscord | <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:19 | disruptek | gyllou: ^ this looks really good to me. |
17:45:36 | FromDiscord | <krisppurg> rather than getting the entire output |
17:45:42 | FromDiscord | <Gyllou> yea im going to go through and test a few of them |
17:45:54 | FromDiscord | <haxscramper> @krisppurg Example I linked does literally that |
17:45:55 | disruptek | krisppurg: you need something like sealmove's nimitai |
17:46:16 | FromDiscord | <haxscramper> Read chunks of stdout, not everything at once |
17:46:21 | FromDiscord | <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:32 | FromDiscord | <Gyllou> then I'll test the different hashing algos |
17:46:48 | disruptek | using the one nim provides, right? |
17:46:53 | FromDiscord | <Gyllou> im hoping to incorporate convolutional layers with |
17:46:54 | FromDiscord | <Gyllou> yea |
17:46:58 | disruptek | right. |
17:47:07 | Zevv | man npeg is so popular |
17:47:14 | FromDiscord | <Gyllou> i need a baseline bc i will probably want to publish my results for this |
17:47:17 | Zevv | I wish I was that popular when I was a kid |
17:47:34 | Zevv | but no, there I was, on my attick. pounding away at the keyboard. |
17:47:38 | Zevv | see what it brought me in life |
17:47:48 | disruptek | it brought you me. |
17:47:51 | disruptek | you lucky devil. |
17:47:59 | Zevv | lucky me |
17:48:17 | disruptek | i think my vm is going to have to be stack based. |
17:48:26 | FromDiscord | <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:34 | FromDiscord | <krisppurg> @haxscramper Do none of the nim std lib modules not do that? |
17:49:07 | disruptek | gyllou: super interested in this. |
17:49:09 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2DkP |
17:49:36 | FromDiscord | <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:55 | FromDiscord | <krisppurg> hm |
17:50:03 | FromDiscord | <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:16 | disruptek | yeah. |
17:50:25 | FromDiscord | <haxscramper> @krisppurg In particular you might be interested in https://nim-lang.org/docs/streams.html#readData%2CStream%2Cpointer%2Cint |
17:50:26 | disruptek | it's like a huge muscle that no one knows how to use. |
17:50:35 | FromDiscord | <Gyllou> that package is ridiculous, its so fast |
17:50:44 | FromDiscord | <Gyllou> same with weave |
17:50:48 | disruptek | it's just a matter of time before it gets discovered. |
17:51:19 | FromDiscord | <Gyllou> yea ive mentioned it to my colleagues at my consulting gig and they are pretty interested in it |
17:51:47 | disruptek | there will be some sexy demo and then nim will explode. |
17:52:00 | FromDiscord | <Gyllou> alright, gonna get back to it, as usual thanks for the help @disruptek |
17:52:09 | disruptek | sure thing. |
17:59:25 | disruptek | PMunch: are you familiar with NestedText? |
18:02:43 | FromDiscord | <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:41 | disruptek | async doesn't use threads. |
18:04:19 | disruptek | because there's only one thread, nothing can release the lock. |
18:04:43 | FromDiscord | <krisppurg> @haxscramper can I also just do something like `outputStream[sequence]` for example `outputStream[0]`, `outputStream[1]`, `outputStream[2]` |
18:12:39 | FromDiscord | <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:27 | FromDiscord | <krisppurg> yeah like data at position N |
18:15:36 | FromDiscord | <krisppurg> because I thought that setPosition would possibly effect the stream |
18:15:42 | FromDiscord | <krisppurg> like setLen |
18:15:46 | FromDiscord | <krisppurg> (edit) "like setLen ... " added "for seq" |
18:18:23 | FromDiscord | <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:54 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2DkZ |
18:21:34 | FromDiscord | <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:14 | FromDiscord | <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:33 | FromDiscord | <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:49 | FromDiscord | <krisppurg> I have to send an opus frame like every 20ms |
18:27:32 | FromDiscord | <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:16 | FromDiscord | <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:28 | FromDiscord | <krisppurg> @haxscramper I am unsure about sizes, but I could just calculate the size to split with file byte size. |
18:30:58 | FromDiscord | <krisppurg> the ffmpeg does dump opus data into stdout |
18:32:56 | FromDiscord | <krisppurg> I want to do something like on a loop of 20ms, the buffer chunk is sent to the udp socket. |
18:34:05 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2Dl2 |
18:35:51 | FromDiscord | <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:02 | FromDiscord | <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:10 | Zevv | disruptek: what vm was you building again? |
18:38:14 | Zevv | and why |
18:40:57 | FromDiscord | <krisppurg> hmm |
18:42:02 | FromDiscord | <krisppurg> I've seperated the chunks for an easier look and some chars were chopped |
18:42:02 | FromDiscord | <krisppurg> https://play.nim-lang.org/#ix=2Dl4 |
18:44:44 | FromDiscord | <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:34 | FromDiscord | <haxscramper> @krisppurg off-by-no-enough-sleep error - https://play.nim-lang.org/#ix=2Dl6 |
18:51:30 | FromDiscord | <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:15 | FromDiscord | <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:36 | FromDiscord | <William_CTO> Nevermind |
19:31:41 | FromDiscord | <William_CTO> I think I figured it out |
19:32:09 | * | hnOsmium0001 joined #nim |
19:33:39 | * | xet7 joined #nim |
19:33:57 | Zevv | I have this great idea for Npeg, but it's hell to make it |
19:34:34 | disruptek | what is it? |
19:34:38 | Zevv | I want to visualize matching in progress by showing the subject getting processed by the graphs |
19:34:53 | Zevv | for debugging your parsers |
19:35:02 | disruptek | doesn't seem that hard, actually. |
19:35:27 | Zevv | well, not "hell". But graphs are compile time only now |
19:35:53 | Zevv | so I need to move that up, and from there it is possibly only highligting all elements in the current call stack |
19:35:53 | disruptek | oh, i was thinking just a single line on the screen that you rewrite. |
19:36:00 | * | PMunch quit (Quit: leaving) |
19:36:28 | disruptek | you're going to slow it down, right? |
19:36:44 | Zevv | you think? |
19:37:05 | Zevv | it's supposed to go interactive / single stepping |
19:37:22 | Zevv | it's a debugging tool. So each step the vm makes it will redraw the graph |
19:37:36 | Zevv | it'll slow down by a factor of a million, at least |
19:37:52 | Zevv | it's utterly useless, but it'll sell great |
19:38:14 | disruptek | a million won't be enough. |
20:04:18 | FromDiscord | <Recruit_main707> what are the compile time, counter parts of nimscript functions like mkDir, copyDir, etc? |
20:04:27 | FromDiscord | <Recruit_main707> (edit) "time," => "time" |
20:10:23 | * | narimiran quit (Ping timeout: 260 seconds) |
20:10:55 | FromDiscord | <haxscramper> https://nim-lang.org/docs/nimscript.html#rmDir%2Cstring - for compile-time |
20:11:19 | FromDiscord | <haxscramper> https://nim-lang.org/docs/os.html#copyDir%2Cstring%2Cstring - for rutime |
20:12:16 | FromDiscord | <Recruit_main707> but thats w/ nimscript |
20:12:26 | FromDiscord | <Recruit_main707> how can i do it from within a macro, for example |
20:18:19 | FromDiscord | <haxscramper> I don't think it is possible to create a directory from macro without just calling shell `mkdir` |
20:25:18 | disruptek | Zevv: 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:21 | disruptek | pmunch: 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:45 | Zevv | disruptek: what the hell are you talking about |
20:57:53 | Zevv | vm runs in a continuation that can be serialized to/from the cloud |
20:58:24 | disruptek | which part don't you get? |
20:58:42 | Zevv | whyyyyy |
20:59:06 | disruptek | 'cause i want to run tierra at scale. |
20:59:43 | * | leorize quit (Ping timeout: 240 seconds) |
20:59:50 | Zevv | well, let's first fix the continuations then, shell we |
21:00:19 | disruptek | we have to wait for clyybber to finish his sym dupe/leak. |
21:00:36 | disruptek | i'm supposed to be working on ic right now. |
21:01:32 | Zevv | says who |
21:06:52 | Zevv | call 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:15 | disruptek | i feel that. |
21:15:19 | FromDiscord | <lqdev> Zevv: don't give in to their propaganda!! |
21:15:36 | FromDiscord | <lqdev> you can change the default branch name back in github's settings |
21:15:40 | disruptek | henceforth all my branches will be Mean branches. |
21:15:54 | Zevv | lqdev: yeah I did that. |
21:16:01 | Zevv | I ain't got no slave branches anyways, right |
21:16:15 | Zevv | and I nicely killed all the KKK guys in RDR2 the other day, so I'm good |
21:16:17 | disruptek | you haven't lived. |
21:22:24 | * | fredrikhr joined #nim |
21:29:29 | FromDiscord | <notchris> How do you pass in a procedure as a parameter of another procedure |
21:29:38 | FromDiscord | <notchris> on creation do you just assign the proc? |
21:29:48 | idf | proc foo(a: proc(a, b: int)) |
21:29:56 | idf | then foo(sum(a, b)) or something |
21:30:12 | FromDiscord | <notchris> hmmm |
21:30:18 | FromDiscord | <notchris> Ahhh |
21:30:38 | FromDiscord | <notchris> what if you dont know what the procedure will take |
21:31:05 | idf | then use a template i guess |
21:31:08 | notchris | hmm |
21:31:34 | notchris | basically i want the user to define their own callback |
21:32:19 | * | natrys quit (Ping timeout: 246 seconds) |
21:33:59 | FromDiscord | <lqdev> use generics? |
21:34:35 | ForumUpdaterBot | New thread by O24: Returning objects from func with ARC, see https://forum.nim-lang.org/t/7050 |
21:34:57 | FromDiscord | <notchris> @lqdev hmm how does that work? |
21:35:16 | FromDiscord | <lqdev> proc foo[T: proc](a: T) |
21:35:25 | FromDiscord | <lqdev> and then you can pass in any procedure to foo |
21:35:32 | FromDiscord | <notchris> Ah thats exactly what i wanted |
21:37:01 | FromDiscord | <notchris> sorry @lqdev |
21:37:07 | FromDiscord | <notchris> how do i write that in a proc constructor |
21:37:16 | FromDiscord | <notchris> for instance |
21:37:17 | FromDiscord | <notchris> `proc newAlert(text: string, cb: ): Alert =` |
21:37:19 | FromDiscord | <notchris> for 'cb' |
21:39:53 | FromDiscord | <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:43 | FromDiscord | <ElegantBeef> That should work i believe, it |
21:49:11 | FromDiscord | <ElegantBeef> 'll make it generic so whenever it's invoked it'll make a proc underneath afaik |
21:53:13 | FromDiscord | <notchris> hmmm |
21:53:39 | FromDiscord | <Gyllou> has anybody used msgpack4nim on here? |
21:55:24 | FromDiscord | <Recruit_main707> i have |
21:55:59 | FromDiscord | <Gyllou> do you have an example of packing writing to file, loading and unpacking something like a simple array? |
21:56:20 | FromDiscord | <Gyllou> im trying to pack arraymancer 2d tensors into msgpack |
21:56:43 | FromDiscord | <Recruit_main707> i might have something on github |
21:57:04 | FromDiscord | <Gyllou> i would really appreciate it if you link, ive been fiddling with it for too long now |
21:57:18 | disruptek | !repo frosty |
21:57:19 | disbot | https://github.com/disruptek/frosty -- 9frosty: 11serialize native Nim types to strings, streams, or sockets β 15 16β 0π΄ |
21:57:59 | FromDiscord | <Gyllou> @disruptek is that cross language? |
21:58:04 | disruptek | no. |
21:58:14 | FromDiscord | <Recruit_main707> i jut remembered, i stopped using msgpack4nim, i can still try to show you an example tho |
21:58:15 | FromDiscord | <Gyllou> kk, ill probably still use it |
21:58:19 | disruptek | there's an example of msgpack4nim in golden. |
21:58:21 | disruptek | !repo golden |
21:58:22 | disbot | https://github.com/disruptek/golden -- 9golden: 11a benchmark for compile-time and/or runtime Nim π 15 23β 0π΄ |
21:58:39 | disruptek | i'm not a fan of it; perhaps you can see what i don't like about it. |
21:59:05 | FromDiscord | <Recruit_main707> tbh, the msgpack readme has an example for pretty much everything |
21:59:23 | FromDiscord | <Gyllou> msgpack4nim is not impressive, i mainly want the msgpack file type |
21:59:47 | FromDiscord | <Recruit_main707> msgpack doesnt is not a file type |
21:59:57 | FromDiscord | <Recruit_main707> doesnt have/is not |
21:59:58 | FromDiscord | <Gyllou> its a bin format |
22:00:13 | FromDiscord | <Gyllou> like hdf5 or parquet |
22:00:17 | FromDiscord | <Recruit_main707> ok |
22:01:03 | * | leorize quit (Ping timeout: 240 seconds) |
22:01:15 | FromDiscord | <Gyllou> i need a compressed way to store ann weight vectors, vectorized input data, adjaceny matrices, |
22:01:24 | FromDiscord | <Gyllou> and other stuff without it being huge |
22:01:32 | disruptek | what we're using for ic is what i'd recommend. |
22:01:34 | FromDiscord | <Gyllou> do you disagree? do you have some other idea of what it is? |
22:01:57 | disruptek | !repo guzba/supersnappy |
22:01:58 | disbot | https://github.com/guzba/supersnappy -- 9supersnappy: 11Dependency-free and performant Nim Snappy implementation. 15 15β 0π΄ |
22:02:23 | disruptek | we freeze with frosty, then compress with snappy. |
22:02:46 | FromDiscord | <Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=2Dm0 |
22:03:20 | disruptek | i 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:36 | FromDiscord | <Gyllou> i got msgpack4nim working the way i want |
22:10:41 | FromDiscord | <Gyllou> def user error |
22:10:49 | disruptek | nice. |
22:10:53 | FromDiscord | <Gyllou> still, i dont really like the nim implementation |
22:11:13 | FromDiscord | <Recruit_main707> i think its pretty clean, havent used any other though |
22:11:31 | disruptek | i didn't really look at it. |
22:11:43 | FromDiscord | <Gyllou> i think it might just be dealing with nim streams, a little different for me |
22:12:01 | FromDiscord | <Gyllou> so looks like snappy is a compression format |
22:12:20 | FromDiscord | <Gyllou> would be appropriate to do snappy(mymsgpackfile)? |
22:12:31 | disruptek | yeah; that's what i do with frosty. |
22:12:38 | FromDiscord | <Gyllou> okay cool |
22:12:47 | FromDiscord | <Gyllou> jsut checking, i hadnt really heard of snappy |
22:12:58 | FromDiscord | <Gyllou> i usually use msgpack for interlanguage ipc over zmq |
22:13:00 | disruptek | it's literally, `compress(freeze <some rando object>)` |
22:13:13 | FromDiscord | <Gyllou> basically anything that isnt a string or numpy array ill pack and send |
22:13:22 | disruptek | sure. |
22:13:28 | disruptek | i'm just too old for this shit. |
22:13:37 | FromDiscord | <Gyllou> lol |
22:13:37 | * | mbomba quit (Quit: WeeChat 2.9) |
22:13:48 | disruptek | the abstraction i want is "freeze(foo)" .. "thaw(foo)". |
22:14:03 | disruptek | "i don't care." -- araq, 2020 |
22:14:26 | FromDiscord | <Gyllou> ill take a look at the nim specific serialization implementation |
22:14:31 | FromDiscord | <Gyllou> are you araq? |
22:14:37 | disruptek | what a strange question. |
22:14:48 | FromDiscord | <Gyllou> idk who you are lol |
22:15:01 | FromDiscord | <Gyllou> nobody said theyve gotta have the same username |
22:15:05 | * | disruptek points to Araq. |
22:15:13 | disruptek | Araq, meet Gyllou. |
22:15:20 | FromDiscord | <Gyllou> oh i |
22:15:20 | disruptek | Gyllou, meet Araq. |
22:15:34 | FromDiscord | <Gyllou> figured theyd be in the moderator list |
22:15:50 | disruptek | they are. |
22:16:05 | disruptek | get a real chat client. |
22:16:10 | FromDiscord | <Gyllou> oh maybe on irc |
22:16:15 | FromDiscord | <Gyllou> damn |
22:19:26 | FromDiscord | <ElegantBeef> There arent any strong feelings chat clients here |
22:20:05 | FromDiscord | <Recruit_main707> we have 2@Araqs |
22:20:17 | FromDiscord | <Recruit_main707> and the bridge pings the fake one :P |
22:20:37 | FromDiscord | <ElegantBeef> Well the discord versions of the irc peoples are ploys! |
22:21:25 | FromDiscord | <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:00 | FromDiscord | <Gyllou> i havent used irc in over a decade, good memories though |
22:22:13 | FromDiscord | <Gyllou> makes me miss playing ut99 actually |
22:22:26 | FromDiscord | <ElegantBeef> I really need to make something like mumble to embed into element so i can abandon discord for the most part π |
22:22:48 | disruptek | why would you want to support a closed platform? |
22:22:56 | FromDiscord | <ElegantBeef> Element isnt closed? |
22:23:11 | FromDiscord | <ElegantBeef> Nor would my voip implementation |
22:23:13 | FromDiscord | <Gyllou> i finally started messing with discord earlier this year to get away from steam chat and psn |
22:23:24 | FromDiscord | <Gyllou> ended up using it mostly for programming stuff |
22:23:40 | disruptek | it's dumb. |
22:23:47 | FromDiscord | <Gyllou> lol |
22:23:51 | FromDiscord | <Gyllou> somebody is grumpy |
22:24:03 | disruptek | it's pretty much my default setting. |
22:24:22 | FromDiscord | <ElegantBeef> I dont really like discord due to not being OSS and also not permitting 3rd party clients |
22:24:24 | FromDiscord | <Gyllou> fair, im usually set to indifferent |
22:24:33 | disruptek | who cares? |
22:24:59 | FromDiscord | <ElegantBeef> Nah he's not grumpy, this is his happy |
22:25:05 | FromDiscord | <Gyllou> lol |
22:25:15 | disruptek | it only goes downhill from here. |
22:25:45 | FromDiscord | <Gyllou> getting my friends onto steam was a epic feat, i think trying to get them on irc is hopeless. |
22:25:51 | FromDiscord | <Gyllou> most of them are computer illiterate |
22:25:53 | FromDiscord | <ElegantBeef> Eh IRC is ugh |
22:26:00 | FromDiscord | <ElegantBeef> It does what it sets out to well |
22:26:23 | FromDiscord | <ElegantBeef> But i dont like what it does, matrix is much more interesting, so something like element is nice |
22:26:41 | FromDiscord | <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:02 | disruptek | #hack was fun for awhile. |
22:27:28 | FromDiscord | <Gyllou> i mainly hung out there for game stuff |
22:28:01 | FromDiscord | <Gyllou> im glad there is twitch, bc now all the people i dont want to talk to have moved there |
22:28:29 | FromDiscord | <ElegantBeef> But you're talking to me right now... |
22:28:36 | disruptek | that's how i feel about my cell phone. |
22:28:55 | disruptek | i 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:06 | FromDiscord | <Gyllou> lol fair, im assuming you use twitch, but its not for me. if i wanna watch gameplay i goto youtube |
22:29:07 | disruptek | it's sorta idea. |
22:29:09 | disruptek | ideal. |
22:29:19 | FromDiscord | <ElegantBeef> I dont use twitch, the joke was you probably dont want to speak to me |
22:29:25 | FromDiscord | <Gyllou> yea im terrible with mine |
22:29:33 | FromDiscord | <Gyllou> lol gotcha, you seem nice enough |
22:29:46 | FromDiscord | <Gyllou> im just not interested in talking about dota or fortnite |
22:29:57 | disruptek | beef comes from good stock, but somewhere along the line he just picked up some bad habits. |
22:30:11 | FromDiscord | <dom96> pretty sure most people keep their phone on silent mode. I tend to hate those that don't. |
22:30:19 | FromDiscord | <Gyllou> agreed |
22:30:21 | FromDiscord | <ElegantBeef> When disruptek says i have bad habits... does that mean i just bathe too much π |
22:30:25 | FromDiscord | <Cloudperry> hi, I think I've ran into a Nim bug and I want to know if this is actually a bug |
22:30:50 | disruptek | hold your laptop a little closer to your router; i can't quite make out what's on your screen. |
22:30:53 | FromDiscord | <Cloudperry> so I wanted to limit a length of a string to make it usable as a file name |
22:31:03 | disruptek | oh yeah? |
22:31:16 | FromDiscord | <Cloudperry> and for some reason I tried using setLen on the string |
22:31:21 | FromDiscord | <ElegantBeef> Easiest way to see if you found a bug is to post a minimal example here https://play.nim-lang.org/ |
22:31:23 | disruptek | wait, are you coding this on an ipod or something? |
22:31:34 | FromDiscord | <ElegantBeef> They arent technisha |
22:31:47 | disruptek | what's a typical filename length? |
22:32:27 | FromDiscord | <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:05 | disruptek | native nim strings don't have terminators per se. |
22:33:11 | FromDiscord | <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:38 | disruptek | well, setLen will set the length to whatever you tell it to. |
22:33:46 | * | nekits07 quit (Read error: Connection reset by peer) |
22:34:07 | disruptek | setLen(min(mystring.len, myMaxLength)) |
22:34:36 | * | nekits07 joined #nim |
22:34:44 | disruptek | there's probably even a truncation proc or something. |
22:34:44 | FromDiscord | <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:57 | FromDiscord | <Cloudperry> that shouldn't ever happen right? |
22:35:00 | disruptek | because setLen will grow the string as necessary. |
22:35:03 | FromDiscord | <dom96> it's expected |
22:35:08 | FromDiscord | <dom96> setLen will fill with \0 |
22:35:15 | FromDiscord | <Cloudperry> oh right |
22:35:25 | FromDiscord | <Cloudperry> well good to know its not a bug then |
22:35:37 | FromDiscord | <Cloudperry> I already found a much better way to cap string length |
22:36:24 | FromDiscord | <Cloudperry> now I'm using string[0..min(lenLimit, string.high)] |
22:36:38 | FromDiscord | <Cloudperry> instead of string.setLen(lenLimit) |
22:36:40 | disruptek | that'll copy it, though. |
22:37:10 | FromDiscord | <Cloudperry> yeah I meant string = string[0 .. min(lenLimit, string.high)] |
22:37:23 | FromDiscord | <Cloudperry> it works |
22:38:58 | * | solitudesf quit (Ping timeout: 258 seconds) |
23:00:19 | FromDiscord | <Cloudperry> I'm tired and I didn't tell what my code was actually doing |
23:00:41 | disruptek | i have a bad feeling about your code. |
23:01:13 | FromDiscord | <Cloudperry> the problem was that it was doing testString.setLen(lenLimit) and the length of the string was under the limit |
23:01:24 | FromDiscord | <Cloudperry> so it filled it up to lenLimit with zeroes |
23:01:59 | FromDiscord | <Cloudperry> this is what I actually wanted to do: testStr.setLen(min(testStr.len, lenLimit)) |
23:02:25 | FromDiscord | <Cloudperry> now it probably doesn't even do a copy |
23:02:44 | disruptek | right. |
23:03:22 | FromDiscord | <Cloudperry> cmon dude u have only seen one line that I wrote in a really dumb way π |
23:03:45 | FromDiscord | <Cloudperry> I will notice those really fast the next day since my project isn't that big |
23:04:03 | disruptek | i'm agreeing with you. |
23:04:18 | FromDiscord | <Cloudperry> also I had a couple of weeks break from writing Nim |
23:04:26 | disruptek | i was pretty sure you knew this; that's why i didn't mention it. |
23:04:47 | FromDiscord | <Cloudperry> yeah its alright |
23:04:53 | FromDiscord | <Cloudperry> I'm going to bed now |
23:04:55 | FromDiscord | <Cloudperry> bye |
23:05:01 | disruptek | peace |
23:06:23 | * | leorize quit (Ping timeout: 240 seconds) |
23:15:20 | FromDiscord | <notchris> has anyone used wraptool? |
23:20:29 | * | leorize joined #nim |
23:27:19 | * | tane quit (Quit: Leaving) |
23:32:04 | FromDiscord | <cabboose> My mind went straight to WAPtool and then WAP. Society is dying |
23:35:30 | FromDiscord | <exelotl> ah yes, wireless access points |
23:51:14 | FromDiscord | <dom96> ouch, `cstring` is freaking dangerous |
23:52:03 | FromDiscord | <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) |