<< 05-12-2020 >>

00:03:51FromDiscord<Quibono> Okay, figured out what it was/
00:10:59FromDiscord<treeform> disruptek, should I add jason to my bench mark?
00:11:02FromDiscord<ElegantBeef> Someone make a jsparser for extracting the `name` of functions, arguements and if it returns objects πŸ˜„
00:11:23FromDiscord<ElegantBeef> Npeg is hard to understand πŸ˜„
00:12:52FromDiscord<Esbeesy> I've just done my own Npeg based on zevvs
00:12:54FromDiscord<Esbeesy> Since mine didn't work
00:13:01FromDiscord<Esbeesy> (edit) "mine" => "it" | "itdidn't work ... " added "for me"
00:13:11FromDiscord<Esbeesy> https://github.com/sambeckingham/advent-of-code-2020/blob/main/day4/day4npeg.nim
00:13:18FromDiscord<ElegantBeef> It's not like he has a "Js parser" laying about πŸ˜„
00:25:40*luis quit (Ping timeout: 246 seconds)
00:36:21FromDiscord<Cohjellah> Real talk. How do I get a C compiler onto Windows
00:36:26FromDiscord<Cohjellah> this seems unnecessarily complex
00:37:14FromDiscord<Avatarfighter> @fwsgonzo i can't remember but `cast[ByteAddress]addr(callback)` should give the address i think
00:37:50FromDiscord<Avatarfighter> (edit) "`cast[ByteAddress]addr(callback)`" => "`cast[ByteAddress](addr(callback))`"
00:44:47FromDiscord<fwsgonzo> This worked for me: `let farg = cast[ptr int](unsafeAddr(callback))[]`
00:45:51FromDiscord<Avatarfighter> idk why but what you wrote looks like it should be a crime πŸ˜›
00:46:01FromDiscord<Avatarfighter> im glad it works ahah
00:46:08FromDiscord<fwsgonzo> you should have seen the Rust startup code I wrote once then
00:46:22FromDiscord<fwsgonzo> "it doesn't look like Rust", I was told
00:46:33FromDiscord<fwsgonzo> but that's just what bare metal glue looks like all the time
00:46:52FromDiscord<Avatarfighter> rip
00:47:02FromDiscord<Avatarfighter> yeah that's exciting.
00:47:05FromDiscord<Avatarfighter> What are you working on?>
00:47:09FromDiscord<fwsgonzo> not that I'm assuming that my version of "getting the address of a function" is the best answer πŸ˜‰
00:48:37FromDiscord<fwsgonzo> I'm trying to pass a function address from one VM to another. The storage I have at my disposal is 2 registers. And so, with that I can pass one trampoline function address, and another function that is just a regular nim function. The trampoline would call into Nim so that Nim thinks that everything is normal again.
01:02:04FromDiscord<shadow.> mingw64 comes with nim
01:02:06FromDiscord<shadow.> or 32
01:02:41FromDiscord<Cohjellah> Cheers. Going to get WSL up
01:10:40*krux02 quit (Remote host closed the connection)
01:15:23*abm joined #nim
01:20:17FromDiscord<Quibono> How do I put a { in fmt without it thinking I'm trying to slip in a var?
01:30:38FromDiscord<Quibono> nvm
01:44:17mipri{{ is one char shorter than nvm yk
01:44:27FromDiscord<Cohjellah> So arrays are fixed. If I have the size of an array changing constantly do I use a list?
01:44:38FromDiscord<Cohjellah> Fixed length
01:44:49mipriuse a seq instead
01:45:21mipri!eval echo [1,2,3].typeof
01:45:24NimBotarray[0..2, int]
01:45:28mipri!eval echo @[1,2,3].typeof
01:45:30NimBotseq[int]
01:45:49mipri!eval var x = @[1,2]; x.add 3; echo x
01:45:51NimBot@[1, 2, 3]
01:46:01FromDiscord<Cohjellah> Rightio
01:46:22FromDiscord<Cohjellah> See I'm trying to do AoC and this is dead easy in Python, but in Nim I'm confused aye. Trying to do it in a python way
01:47:51mipriI've seen a lot of Python solutions that would translate pretty easily to Nim, main exception's list comprehension use.
01:47:57*Vladar quit (Quit: Leaving)
01:48:16mipribut if you do it in a Nim way you've got enums, which you can parseEnum into from a string, and you've got case statements
01:48:25mipriI've had a pretty easy time so far. Tonight it might finally get interesting
01:54:50disrupteki've been saying that for the last 4 months.
01:55:44disruptektreeform: yeah.
01:56:20disrupteki put flatty in a frosty benchmark.
01:56:31disrupteki think it's published.
02:02:53disruptekfwsgonzo: is it working?
02:04:21FromDiscord<Rebel> disruptek glad to see you are back πŸ˜„
02:04:59disrupteksup dawg.
02:05:37FromDiscord<Rebel> Still working on that problem I described days ago πŸ˜… been bogged down with other stuff but I know roughly what I need to do lol.
02:05:47disruptekuse threads?
02:05:52FromDiscord<Rebel> Yes I plan to lol
02:05:58disruptekweird.
02:05:58FromDiscord<Rebel> I've seen the light
02:06:09disruptekam i dreaming?
02:06:23FromDiscord<Rebel> Look if you really want I could link it but my code has been roasted enough by dom 😒
02:06:35disrupteki'm good, thanks. i just ate.
02:06:49FromDiscord<Rebel> Ok it's not that bad lol
02:07:03disruptekwell, let me tell you something about being old:
02:07:11FromDiscord<Rebel> Just a massive switch statement with modularity at the forefront guess I could have applied DRY more
02:07:26disruptekwhen you've eaten vomit even once, and even if it's your own vomit, you develop a certain distaste for the activity.
02:07:30disruptekso to speak.
02:07:49FromDiscord<Rebel> Oh shit did you get inspiration from the vomit cake?
02:08:07disruptekplease. i never ate vomit cake.
02:08:15disruptekit was more of a stew.
02:09:12FromDiscord<Rebel> ohhhh
02:09:14FromDiscord<Rebel> it's a video lol
02:09:17FromDiscord<Rebel> papa franku
02:09:35FromDiscord<Rebel> Just watch the last one in the series (human cake) you can skip hair and vomit cake
02:09:47disruptekum, okay, thanks.
02:09:53disruptekhow did i get so lucky...
02:10:15FromDiscord<Rebel> HOLY SHIT
02:10:18FromDiscord<Rebel> youtube actually removed it
02:11:03FromDiscord<Rebel> F you can only watch it in 360p of the reupload; although, there is probably an archive somewhere
02:11:36disrupteki like my vomit at 1080p.
02:14:36FromDiscord<Rebel> Any chance you know about quantum computing lol
02:15:46disruptekfwsgonzo: if you use methods, you could probably use the existing string-based dispatch.
02:16:15disruptekquantum vomit isn't a thing. yet. hmm, maybe i should register the domain just in case.
02:18:35FromDiscord<Rebel> I will show you in offtopic lol
02:19:16FromDiscord<treeform> disruptek, your branch mark animation is hard to read. I can't tell who is faster it animate too fast.
02:19:23FromDiscord<treeform> benchmark
02:19:36disruptekthe benchmarks are in the test directory, iirc.
02:19:59disrupteki think flatty is faster for some writes and slower for some reads, which surprised me.
02:20:10FromDiscord<treeform> this animation: https://github.com/disruptek/frosty/blob/master/docs/bench.svg
02:20:35disruptekbut also i think frosty does more work, which lets it support more structures. they aren't targetting the same thing.
02:20:39FromDiscord<Daniel> noob question.↡What does export do? https://media.discordapp.net/attachments/371759389889003532/784605122042396723/unknown.png
02:20:45FromDiscord<Daniel> In nim docs i found this https://nim-lang.org/docs/manual.html#procedures-export-marker
02:20:49disrupteklets you use the symbol in an outside module.
02:20:52FromDiscord<Daniel> But i am not sure if thats the answer
02:20:58disruptekno, that's the answer.
02:21:03FromDiscord<treeform> disruptek, yeah I don't support case objects because I try not to use macros
02:21:19disruptekahh, are there case objects in intsets?
02:21:21FromDiscord<treeform> case objects just seem to never work out for me
02:21:25disrupteki didn't even realize.
02:21:31FromDiscord<treeform> I don't know about intsets
02:21:41FromDiscord<treeform> i probably don't support sets
02:21:45FromDiscord<treeform> i should
02:22:10FromDiscord<Daniel> I still dont understand that export part....i know does exporting
02:22:35disruptekwhen you export a symbol, you make it available to scopes that /import/ the module in which the symbol is /exported/.
02:23:21disruptektreeform: frosty isn't fully optimal (copy-free) because i'm lazy, but it's pretty close.
02:23:28FromDiscord<Daniel> Yea, but what does he use on line 2 export all those modules, ....for example he imports jester, then in next line he export jester
02:23:39disruptekit needs cps to be finished. i think i mentioned that at least once today, though. sorry.
02:23:40FromDiscord<Daniel> (edit) "what" => "why"
02:24:03disruptekto make jester's symbols available to those who import /that/ module.
02:24:23disruptekit's just an irritation, if dom wrote it, or it's genius if i wrote it.
02:24:57disruptekfighter: where is my svg for nigel?
02:26:33FromDiscord<shadow.> @mipri you can always use comprehension or sugar collect
02:27:04FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GFr
02:27:19FromDiscord<shadow.> (edit) "https://play.nim-lang.org/#ix=2GFr" => "https://play.nim-lang.org/#ix=2GFs"
02:27:43FromDiscord<shadow.> (edit) "https://play.nim-lang.org/#ix=2GFs" => "https://play.nim-lang.org/#ix=2GFt"
02:29:15disruptektreeform: i slowed down the benchmark for ya.
02:30:03FromDiscord<treeform> why is it even an animation? give table or list
02:30:24FromDiscord<treeform> i'll get my own frosty benchmarks soon
02:30:35disrupteki dunno how to automate it.
02:30:59disrupteki mean, automate embedding it in the readme. it's... annoying to do markup.
02:31:21disrupteki could make it static, i guess.
02:31:56disruptekit works like this because it's copied from other projects that feature longer benchmarks, like jason.
02:32:43disruptektreeform: get to feature parity and then we can really compete.
02:33:26FromDiscord<treeform> I am just giving feed back, if you like the animation dont change it
02:33:46FromDiscord<Quibono> Would it be weird to have a separate file for just types? I can't for the life of me decide how Nim projects should get formatted.
02:34:03FromDiscord<treeform> I usually have a common file with all my types and common procs.
02:34:11FromDiscord<treeform> then all the other files build on that
02:34:34FromDiscord<Quibono> So shared stuff, then specific files for specific stuff, and a main file?
02:35:22FromDiscord<shadow.> hmm nimble sure is taking long to install frosty
02:35:27FromDiscord<shadow.> if only i had some amazing new package manager
02:35:30FromDiscord<shadow.> made by disruptek
02:35:32FromDiscord<shadow.> starting with an n
02:35:38FromDiscord<shadow.> i should probably go install that...
02:42:18*Ekho quit (Ping timeout: 244 seconds)
02:43:54FromDiscord<Avatarfighter> tf
02:44:03FromDiscord<Avatarfighter> disruptek has a package?
02:44:12FromDiscord<Avatarfighter> disruptek: what you packin'
02:44:43*Ekho joined #nim
02:44:51FromDiscord<exelotl> @Daniel if module foo exports jester, then when I import foo I can use everything from jester without having to explicitly import jester.
02:47:06FromDiscord<exelotl> in other words, the export marker `` lets you export symbols that are defined in the current module, but the `export` keyword lets you export symbols that are defined in other modules
02:47:44FromDiscord<exelotl> see: https://nim-lang.org/docs/manual.html#modules-export-statement
03:02:01*casaca quit (Remote host closed the connection)
03:09:06*abm quit (Quit: Leaving)
03:13:18*ee7[m] quit (*.net *.split)
03:13:19*Clonkk[m] quit (*.net *.split)
03:13:20*planetis[m] quit (*.net *.split)
03:13:22*rayman22201 quit (*.net *.split)
03:13:22*nikki93 quit (*.net *.split)
03:13:24*mipri quit (*.net *.split)
03:18:43*ee7[m] joined #nim
03:18:43*Clonkk[m] joined #nim
03:18:43*planetis[m] joined #nim
03:18:43*rayman22201 joined #nim
03:18:43*nikki93 joined #nim
03:18:43*mipri joined #nim
03:19:01*casaca joined #nim
03:20:12FromDiscord<Daniel> i thought does pretty much everything when it comes to exporting, this seems more complicated, my system2 sees spaghetti
03:21:11FromDiscord<ElegantBeef> And i checked `import module` will not be accepted πŸ˜„
03:21:45FromDiscord<ElegantBeef> It's nicer than making a macro for `importExport module`, but alas
03:30:50FromDiscord<Rika> Why not
03:31:01FromDiscord<Rika> Spec issues?
03:36:33FromDiscord<ElegantBeef> More that didnt want to make macros have to support yet another derivation
03:36:41FromDiscord<ElegantBeef> And it already supports it
03:37:05FromDiscord<ElegantBeef> https://github.com/nim-lang/RFCs/issues/282
03:37:06disbotβž₯ Less Redundant Import/Export ; snippet at 12https://play.nim-lang.org/#ix=2Dx2
03:45:49PrestigeBeef: I'd also like that feature tbh
03:47:12FromDiscord<ElegantBeef> Well the suggestion as you can see is to make a macro and import it πŸ˜„
03:47:32FromDiscord<ElegantBeef> So maybe we can make a macro and petition for it to be in the system stdlib? πŸ˜„
03:48:02PrestigeI'd like that. Having a way to automatically export would be so nice
03:48:13FromDiscord<ElegantBeef> Yea but what do we name it?
03:49:01FromDiscord<ElegantBeef> `expose` `exImport` `share`
03:49:15Prestigei was going to say expose
03:50:20Prestigeor maybe includePublic, or similar
03:50:23FromDiscord<Daniel> just using asterisk would make more logic to my brain
03:50:37FromDiscord<ElegantBeef> Yea but the boss dislikes it
03:50:48FromDiscord<Daniel> using import export one after another turns my brain into mush
03:51:12FromDiscord<ElegantBeef> Well i dont like it either but `share/expose` isnt too bad
03:51:17FromDiscord<Daniel> i have a small brain tho, as many other ppl
03:51:42Prestigeintegrate :P
03:51:59Prestigeshould get the most buzzword type of word possible. Lol
03:52:35FromDiscord<Daniel> in any case, for a newcomer this current concept is very confusing, it is just not intuitive as it should be
03:52:35Prestigeoh what about, sharedImport?
03:52:53FromDiscord<Daniel> (edit) "in any case, for a newcomer this current ... concept" added "import/export"
03:53:53PrestigeI'm liking sharedImport a lot, Beef. Up to you, though
03:54:10FromDiscord<ElegantBeef> It's like the same length as `import` and `export` πŸ˜„
03:54:28Prestigesounds nicer though, don't think length is really an issue
03:54:39FromDiscord<Cypheriel> sent a code paste, see https://play.nim-lang.org/#ix=2GFN
03:54:52FromDiscord<Cypheriel> I'm trying to use `asyncnet.connect()` but it keeps giving this error
03:54:56FromDiscord<Cypheriel> and I am so confused
03:55:24FromDiscord<exelotl> @Daniel you might find this article helpful: https://narimiran.github.io/2019/07/01/nim-import.html
03:56:30mipriCypheriel: you've got a ref object that's nil.
03:57:23FromDiscord<exelotl> It doesn't cover the `export` keyword but it does a good job of explaining the design behind imports
03:59:08FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=2GFP
03:59:45FromDiscord<treeform> oops got to change the labels to freeze/thaw
04:00:57FromDiscord<Cypheriel> mipri: I really have no idea what that means :/ I'm so confused
04:01:24FromDiscord<Cypheriel> I'm getting some of the weirdest errors all of a sudden
04:02:22mipriit's really important to know what that means. Nim has value types and reference types, and reference types can be nil and misusing them results in errors like this.
04:02:29mipriin short, anyway: you're not initializing something.
04:03:44FromDiscord<Cypheriel> uh. I'm pretty sure I am, though
04:03:55mipriok then.
04:04:13FromDiscord<Cypheriel> I'm so confused
04:04:27FromDiscord<ElegantBeef> Providing code is better than words
04:05:22FromDiscord<Cypheriel> sent a code paste, see https://play.nim-lang.org/#ix=2GFU
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:35*supakeen joined #nim
04:07:33mipriso, where's initSocketClient come from?
04:08:51FromDiscord<Cypheriel> sent a code paste, see https://play.nim-lang.org/#ix=2GFW
04:09:10disruptekprestige, beefcake: there's a "superstar" in grok that you might like.
04:09:13disruptek!repo disruptek/grok
04:09:15disbothttps://github.com/disruptek/grok -- 9grok: 11spelunking gear 15 0⭐ 0🍴
04:10:17mipri... so, where's SocketClient coming from?
04:10:56FromDiscord<Cypheriel> It's the name of the object type
04:11:09FromDiscord<Cypheriel> I'll make a hastebin
04:13:39FromDiscord<Cypheriel> https://hastebin.com/odawatefif.nim
04:14:07FromDiscord<Cypheriel> (edit) "https://hastebin.com/odawatefif.nim" => "https://hastebin.com/upaqefecud.kotlin"
04:14:18FromDiscord<Cypheriel> (edit) "https://hastebin.com/upaqefecud.kotlin" => "https://hastebin.com/upaqefecud.nim"
04:16:45mipriok, not the first one
04:17:21disruptekyou aren't setting the socket field when you instantiate the result.
04:17:58FromDiscord<Cypheriel> \:facepalm:
04:18:19FromDiscord<Cypheriel> How on Earth did I not see that
04:18:42FromDiscord<Cypheriel> I've changed so many things trying to debug the error
04:18:56FromDiscord<Cypheriel> That's such an ambiguous error D:
04:19:15FromDiscord<Cypheriel> Well. Thank you!
04:19:17mipriit's not ambiguous, I told you above
04:19:17disruptekwell, i dunno what the error was, but i can guess. 😁
04:19:39mipribut an `echo client` probably would've helped you a lot
04:19:44FromDiscord<Cypheriel> I mean I understand what the error means
04:19:58FromDiscord<Cypheriel> I actually did that, but I didn't bother checking if `socket` existed
04:20:05FromDiscord<Cypheriel> Right I just replied to a bot
04:20:10miprithat echo would've shown that it was nil
04:20:44FromDiscord<Cypheriel> When I did that, I was more-so checking if maybe something was wrong with the init not creating a socket
04:20:50FromDiscord<Cypheriel> I mean an object
04:20:56disruptekdon't sweat it.
04:21:05disruptekmost of mipri's bugs are like this.
04:21:26disruptekrarely do the pros make serious errors.
04:21:49FromDiscord<Cypheriel> also tbf it didn't say it was nil, it said this `socket: ...`
04:21:57miprihmm yeah, just noticed that.
04:22:12FromDiscord<Cypheriel> which... I would just see as "maybe this doesn't have a string representation"
04:22:33mipriright, which is probably the case anyway
04:22:52FromDiscord<ElegantBeef> You can always roll the die and `echo refObject[]`
04:22:59FromDiscord<Cypheriel> Oh, it is
04:23:11miprithat's a bit lame then.
04:23:54mipriyou'd have gotten a warning about the unused variable if not for the wrapSocket
04:23:55PrestigeWhat's this grok business
04:24:28FromDiscord<Cypheriel> Ah yeah, makes sense
04:24:45FromDiscord<Cypheriel> I can't believe I missed that, though
04:24:51FromDiscord<Cypheriel> I was so confused for the longest time
04:27:09FromDiscord<ElegantBeef> grok seems to be disrupteks version of sugar πŸ˜„
04:28:08Prestigeah
04:28:24disruptekit's garbage i don't want to type twice.
04:28:59disruptekbut there's a conditional exporter that you might want to hack.
04:34:05*lritter quit (Ping timeout: 240 seconds)
04:35:07*lritter joined #nim
04:41:04*narimiran joined #nim
04:45:05*waleee-cl quit (Quit: Connection closed for inactivity)
04:51:35leorize[m]1dude you're back
04:52:22disrupteki know, it's pissing me off, too.
04:52:36leorize[m]1glad to have you around tho
04:52:45disruptek😘
04:52:53disruptekis github fixed, btw?
04:55:51Prestigeit's all downhill from herez
04:57:18FromDiscord<Cypheriel> Y'all going to do AoC day 5?
05:00:11disrupteknope.
05:03:51FromDiscord<Rebel> ^
05:04:40FromDiscord<Rebel> Also Disruptek I am testing out the threading solution in a bit will let you know the results.
05:04:53disruptekthat's okay; i know what the results are.
05:05:54FromDiscord<Rebel> In hindsight if this was in Python I would've just used asyncio.queue + coroutines + asyncio.gather + uvloop
05:06:07disruptekyeah, that's super fun.
05:06:28FromDiscord<Rebel> Should've maybe used coroutines in Nim but didn't feel like it
05:06:51disruptekwhich coroutines in nim?
05:07:03FromDiscord<Rebel> Unstable coro module
05:07:03disruptekfeel free to weigh in on the cps rfc:
05:07:08disruptek!rfc cps
05:07:09disbothttps://github.com/nim-lang/RFCs/issues/295 -- 3next steps for CPS 7& 2 more...
05:07:33disruptekit's unstable because no one uses it.
05:07:49FromDiscord<Rebel> Yeah I can see why
05:08:16FromDiscord<Rebel> Looked too complicated at first glance and would make my binary bigger not sure by how much though
05:08:40disruptekconsidering you are already using async, i doubt it matters.
05:09:41FromDiscord<Rebel> Interesting
05:10:14disruptekare you looking at my grindr profile?
05:10:31FromDiscord<Rebel> Um no don't swing that way lol
05:10:39FromDiscord<Rebel> Go to offtopic
05:10:46FromDiscord<Rebel> And check out thr vid
05:10:48FromDiscord<Rebel> The
05:10:53disruptekofftopic is too spammy for me.
05:11:01FromDiscord<Rebel> It's not atm lol
05:11:03disrupteki prefer to saturate #nim with my bullshit.
05:17:19FromDiscord<Rebel> Any chance you've done syscalls in Nim?
05:17:38disruptekyeah, there's a library for them, but it's a little out of date.
05:17:47disruptek!repo syscall
05:17:48disbothttps://github.com/def-/nim-syscall -- 9nim-syscall: 11Raw system calls for Nim 15 19⭐ 3🍴 7& 3 more...
05:17:52FromDiscord<Rebel> Sorry should've clarified
05:17:57disruptekwindows?
05:18:00FromDiscord<Rebel> Windows syscalls
05:18:10disruptekfuck no, do i look like a moron?
05:18:32FromDiscord<Rebel> Hmmm maybe I could just write a Nim wrapper for hell's gate.
05:19:05disruptekis that what the kids are calling it these days?
05:19:43FromDiscord<Rebel> https://github.com/am0nsec/HellsGate
05:21:42disruptekseems simple enough.
05:22:03disruptekthat's what i said about my first threesome, though.
05:23:48FromDiscord<Rebel> Ok spinning up the vm
05:23:51FromDiscord<Rebel> Time to test out the thread theory
05:24:00disruptekyeah, great.
05:24:05FromDiscord<Rebel> once I actually code it into main codebase lol
05:24:08disrupteklet's see if they still work after all these years.
05:25:00FromDiscord<Rebel> YEp
05:25:01FromDiscord<Rebel> (edit) "YEp" => "Yep"
05:25:03FromDiscord<Rebel> this is the plan
05:25:04FromDiscord<Rebel> https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L39
05:26:56FromDiscord<Rebel> btw out of curiosity was I right?
05:27:11FromDiscord<Rebel> Do you read Nietzsche?
05:27:31disruptekno, but i laughed at `dumb and dumber`.
05:27:50disrupteknietzsche is a book about nothing.
05:28:07disruptekfuck that, i can watch seinfeld if i'm in the mood.
05:28:19disruptekamericans don't read.
05:28:38FromDiscord<Rebel> Ever seen the Eric Andre seinfield skit?
05:28:45FromDiscord<Rebel> (edit) "seinfield" => "seinfeld"
05:28:50disruptekno, i actually don't watch seinfeld.
05:29:03FromDiscord<Rebel> lol neither do I
05:29:32FromDiscord<Rebel> Here I posted it in your favorite spammy channel
05:30:00disruptekgreat, just think of how much time this is saving me.
05:30:04PrestigeSeinfeld is god
05:30:08Prestigegood*
05:30:33FromDiscord<Rebel> well vmware is updating...
05:30:38disruptekthe problem is his porsche collection.
05:30:45disrupteki don't really want to rant about it, though.
05:31:53Prestigewhat's the problem with his porche collection?
05:32:16disruptekdid i stutter?
05:32:41Prestigedid your fingers trip?
05:32:49disruptekdid yours?
05:33:00Prestigelike, constantly
05:33:03disruptekno one said anything about porches, stoops, or patios.
05:33:17Prestigehaha
05:33:33Prestigewhat's the problem with his porsche collection?
05:34:14FromDiscord<Rebel> We could talk about quantum crypto instead πŸ˜›
05:42:44*thomasross quit (Ping timeout: 256 seconds)
05:50:47FromDiscord<Rebel> Is there a way to force a proc to be gcsafe?
05:51:06FromDiscord<Rebel> oh nvm guess I can just use a threadvar
05:51:39FromDiscord<Rebel> ` Error: cannot create a flowVar of type: Table[system.string, system.string]` πŸ€”
05:53:55FromDiscord<Rebel> huh well this is quite the conundrum
05:55:17disruptekwhat's the problem now?
05:55:29disruptekwhy do you think you want a flowvar?
05:55:40FromDiscord<Rebel> ?????
05:55:45FromDiscord<Rebel> I linked you what I was basing my own off of lol
05:55:54FromDiscord<Rebel> I went the threadpool route
05:55:58disrupteki don't read dom's code.
05:56:18disruptekwhy do you need a threadpool?
05:56:19FromDiscord<Rebel> well it uses a threadpool lol
05:56:29FromDiscord<Rebel> idk man I just want whatever is easiest lol and it looked easy
05:56:31FromDiscord<Rebel> ugh
05:56:35FromDiscord<Rebel> time to comment all my thread code
05:56:36disruptekare you writing code because other people write code?
05:56:39FromDiscord<Rebel> (edit) "comment" => "uncomment"
05:56:46FromDiscord<Rebel> what?
05:56:49FromDiscord<Rebel> of course not
05:56:51FromDiscord<Rebel> don't be foolish
05:56:54disruptekjust write one you need. ignore these knuckleheads.
05:57:04FromDiscord<Rebel> I thought this would work lol
05:57:06FromDiscord<Rebel> I got jebaited
05:57:39FromDiscord<Rebel> oh man I didn't know a flowvar can't be a table
05:57:41FromDiscord<Rebel> this sucks on nice
05:57:43FromDiscord<Rebel> (edit) "nice" => "ice"
05:57:52disruptekyou don't need it.
05:57:58FromDiscord<Rebel> correct
05:58:05FromDiscord<Rebel> going back to plan c I guess
05:58:08FromDiscord<Rebel> ugh
05:58:22disrupteki told you exactly what to do a week ago.
05:59:16FromDiscord<Rebel> oh well
05:59:19FromDiscord<Rebel> I'll do this one day
05:59:21FromDiscord<Rebel> I'm going back to C#
05:59:30FromDiscord<Rebel> I have more fun things to do there
05:59:37disruptekmakes sense.
06:04:14FromDiscord<InventorMatt> are there any nontrivial examples for a use of cps?
06:04:24disruptekyes, read the paper.
06:04:41FromDiscord<InventorMatt> i mean written in the current implementation in nim
06:04:53disrupteknothing i can share.
06:05:23FromDiscord<InventorMatt> okay, thanks
06:05:27disrupteki have a thing that serializes continuations into the cloud and runs them on lambda.
06:09:50FromDiscord<Rebel> If you are curious disruptek as I most likely won't be touching it again for a while here is my current thought process with threading, if this threadpool implementation would've worked I think this was it but alas here we are, feel free to laugh at the code I know it's not the best: || https://pastebin.com/gLLdmCeX pw: Xi5bC1EQeD||
06:10:29disruptekbut what's threadpool for?
06:13:26*a_chou joined #nim
06:13:46FromDiscord<Rebel> because it was a suggestion
06:14:00FromDiscord<Rebel> and meant I didn't have to deal with locks, or joining threads
06:14:29disruptekwhat's hard about locks?
06:14:36disruptekor joinThread()?
06:15:25FromDiscord<Rebel> nothing
06:15:45FromDiscord<Rebel> the hardest part was described
06:15:53FromDiscord<Rebel> and figuring out where best to fit that piece into the puzzle
06:16:11FromDiscord<Rebel> I will attempt to fit that piece in a bit I am going back to C# and getting things done
06:16:27disruptekwell, it seems much more complex than i envisioned it.
06:17:48disruptekto me it's just createThread, have the thread check a boolean to see if it should do anything, and join the thread at the end of the program. when the thread works, it uses a lock to mutate data in the shared heap. your main thread can just use the lock to read the data. that's it.
06:18:38disruptekone lock, one proc, two calls, and a boolean. i think i saw a porno with this plot line, now that i think about it.
06:26:01Zevvdude. at least *try*
06:27:12disrupteki /am/ trying. 😭
06:30:03FromDiscord<Rebel> hmmmm yeah I will try to do it that way I guess my current threaded implementation uses channels
06:30:11FromDiscord<Rebel> Don't think they're needed
06:30:21disruptekno.
06:30:56disrupteklook, you can always add complexity when you need it.
06:31:02disruptekwhy not start with something that works?
06:32:27*j-james joined #nim
06:32:50j-jameshey, what's nim's exponent function?
06:33:16disruptekit's the function that raises to the power of its argument.
06:33:24FromDiscord<Rebel> that's what I've been trying to do bruh
06:33:42disruptekrebel: what did i tell you about listening to the chuckleheads?
06:33:46FromDiscord<Rebel> occam's razor ftw win I guess lol
06:34:15FromDiscord<flywind> !eval import math; echo pow(2.0, 3.0); echo 2 ^ 3
06:34:17NimBot8.0↡8
06:34:32j-jamesoh that makes more sense, i've been using it for division this whole time
06:34:38disrupteki think people just don't trust me in here. maybe i should go under cover.
06:34:46*disruptek is now known as keisterfish
06:34:51FromDiscord<Rebel> ok well to be fair
06:34:57FromDiscord<Rebel> now that you understand the full scope of the problem
06:35:01FromDiscord<Rebel> you see what I kind of mean now
06:35:06j-jamesah pow
06:35:21FromDiscord<Rebel> Did you end up puking from the code? πŸ˜›
06:35:38FromDiscord<Rebel> might be just a bit too big to fit in one proc πŸ˜…
06:35:50keisterfishlet's just say i had my cake and now i get to eat it, too.
06:36:31keisterfishthe one proc is your new thread.
06:37:36*j-james quit (Remote host closed the connection)
06:53:43*a_chou quit (Remote host closed the connection)
06:57:57*ajf joined #nim
06:58:18*ajf quit (Remote host closed the connection)
06:58:37*nerdrage joined #nim
07:03:15FromDiscord<ElegantBeef> Any ideas on how to handle a js function that uses js promises?
07:05:19FromDiscord<ElegantBeef> Ah there is a `asyncjs` module
07:15:01FromDiscord<ElegantBeef> Any clues on how to properly get the instantiated recorder from inside the `GetMediaRecorder` function ? https://play.nim-lang.org/#ix=2GGy
07:23:02*letto quit (Ping timeout: 256 seconds)
07:35:13*letto joined #nim
07:46:45keisterfishask nicely.
07:47:19keisterfishcall getMediaRecorder(), it yields a future, await the future to receive the recorder.
07:51:10*j-james joined #nim
07:53:30*j-james quit (Remote host closed the connection)
07:56:16*keisterfish is now known as disruptek
07:59:05*nerdrage quit (Remote host closed the connection)
08:00:03*opal quit (Ping timeout: 240 seconds)
08:02:00*opal joined #nim
08:05:53*opal quit (Remote host closed the connection)
08:06:20*opal joined #nim
08:11:41FromDiscord<ElegantBeef> Well i mean i wrote that so yea i know what it does, the thing is it cannot be awaited
08:39:33*habamax joined #nim
08:39:44*mbomba joined #nim
08:49:36*opal quit (Remote host closed the connection)
08:50:48*opal joined #nim
08:56:12FromDiscord<tamashungary> nigger nigger nigger i hate jews
08:56:16FromDiscord<tamashungary> nigger
08:56:28FromDiscord<tamashungary> bombing run over tel aviv
08:56:48FromDiscord<ElegantBeef> @treeform might wanna ban this guy
08:56:49FromDiscord<tamashungary> flossing at the holocaust memorial
08:57:00FromDiscord<tamashungary> holocaust 2 electric boogaloo
08:57:10FromDiscord<ElegantBeef> What it'd be like to be 12 again
08:57:21FromDiscord<tamashungary> i hate israel
09:00:51FromDiscord<treeform> I don't think its age related, probably just a script spamming stuff.
09:16:36*narimiran quit (Ping timeout: 240 seconds)
09:20:04FromDiscord<Rika> I wonder what happened.
09:20:49FromDiscord<ElegantBeef> I mean if you want to know there are ways to learn
09:22:20FromDiscord<Rika> I know, I can't be assed to check myself though
09:23:16FromDiscord<ElegantBeef> Racist/anti semetic shit
09:32:20FromDiscord<kaletaa> I'm anti-semantic
09:39:18*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:51:24planetis[m]I have seen the Israel-Palestine reconciliation videos, and most of the
09:51:24planetis[m]Israelis taking part, look to me like either actors or cold hearted murderers.
09:51:24planetis[m]Not that I take anyone's side but damn.
09:57:48planetis[m]I hope something can change for the better, because it seems to me everyone is
09:57:48planetis[m]trying to start WW3 in the middle east
10:00:42planetis[m]my country is planning to spent almost 10bil on weapons in a year, we will make
10:00:42planetis[m]Americans, French and Germans richer but we might get bankrupt again, with
10:00:42planetis[m]these assholes in the goverment
10:00:59FromDiscord<Rika> #offtopic / #nim-offtopic
10:10:28planetis[m]sure if you don't care about the common people dying for megalomanics leaders
10:10:28planetis[m]and expansionism, you can all kindly go fuck yourselves.
10:10:35*planetis[m] left #nim ("User left")
10:17:17mipriyeah, among hundreds of people, you're the only one who has a moral position that others might not want to hear about.
10:17:45*j-james joined #nim
10:19:12supakeenwhat a nice morning
10:20:46j-jamesso uh
10:21:12j-jameson-topic: do any of you have advice for cleaning this code up?
10:21:14j-jameshttps://play.nim-lang.org/#ix=2GHC
10:22:52j-jamesis there a `count(string, char): int` style method i'm unaware of?
10:23:40miprithat'd have you looping over the string three times though
10:24:08miprisequtils has that, a count()
10:28:46miprihttps://play.nim-lang.org/#ix=2GHG <- I'd do something like this
10:32:48miprithe row and column stuff seems unimportant in the first part, but it's repeated in the second part which I don't really follow.
10:33:06mipriyou could pull that out into a template
10:33:26miprier, an iterator
10:33:44j-jamesi was hoping to do something like this: https://play.nim-lang.org/#ix=2GHJ
10:33:59j-jamesa better iterator for the first part would be nice
10:34:46j-jamessomething like `split()` but for string positions
10:35:31miprisomething like distribute() in sequtils?
10:36:56j-jamesyeah, but if it took a string
10:37:06j-jamesoh dumb me
10:37:36FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2GHL
10:37:58j-jamesstrings can probably be converted to seqs
10:38:31mipri{.push hint[XDeclaredButNotUsed]: off.}
10:38:34mipri{.pop.}
10:39:39mipri!eval echo @"hi"
10:39:41NimBot@['h', 'i']
10:41:47*mbomba quit (Quit: WeeChat 3.0)
10:47:31*waleee-cl joined #nim
10:49:17*gangstacat quit (Quit: Ĝis!)
10:49:57supakeenerm
10:50:11supakeenexcuse me but why have i been writing toSeq("hi".items) all my life then?
10:50:39supakeentime to rewrite some code, brb
10:51:15Zevv`@` does not work for iterables
10:51:40supakeenbut it seems I could've written @"hi" all along?
10:51:58miprifor anything's that an openArray, yes.
10:54:09supakeenThe whole `seq[char]`, `openArray[char]`, `string` variations still confuse me :)
10:55:09j-jamesmipri: thanks, this is much cleaner: https://play.nim-lang.org/#ix=2GHP
10:56:42*gangstacat joined #nim
10:59:34*j-james quit (Remote host closed the connection)
11:07:46supakeenmrm, did something change between 1.4.0 and 1.4.2 regarding `seq[var T]`?
11:08:40supakeengheh, no
11:36:33*lum quit (Quit: Lum: Bye!)
11:39:08*lum joined #nim
11:39:35*narimiran joined #nim
11:55:10*zahary_ joined #nim
11:57:24*zahary quit (Ping timeout: 272 seconds)
11:57:26*zahary_ is now known as zahary
11:57:38*stefantalpalaru quit (Remote host closed the connection)
11:57:47*stefantalpalaru joined #nim
11:58:36*stefantalpalaru quit (Changing host)
11:58:36*stefantalpalaru joined #nim
11:58:47*fowl quit (Ping timeout: 272 seconds)
11:59:00*fowl joined #nim
11:59:55FromDiscord<dom96> ooh, I may have found a 13 year old bug https://media.discordapp.net/attachments/371759389889003532/784750895404679168/unknown.png
12:04:53*luis1 joined #nim
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:17*krux02 joined #nim
12:06:34*supakeen joined #nim
12:42:16*Vladar joined #nim
12:47:33*luis1 quit (Ping timeout: 272 seconds)
12:48:38*Q-Master quit (Ping timeout: 256 seconds)
12:48:59FromDiscord<Sendell> hey guys πŸ™‚ Am I doing something wrong or are asserts kept in release builds ? Oo
12:49:59narimiran-d:danger will remove them for sure
12:51:28FromDiscord<Sendell> ok so that's expected behavior ?
12:51:49FromDiscord<Sendell> -d:release keeps asserts
12:51:51FromDiscord<Sendell> ?
12:52:06FromDiscord<Sendell> can't find that specified in the docs
12:52:30narimiranlook at `config/nim.cfg
12:52:50narimiran`assertions:off` are there only for `danger`, not for `release`
12:53:12FromDiscord<Sendell> didnt know that file, i'll take a look
12:53:13FromDiscord<Sendell> thx πŸ™‚
13:02:45federico3What's the difference between --cpu=nimvm and --cpu=vm ?
13:15:53FromDiscord<krisppurg> @ElegantBeef I will. Theres already a PR on dimscord and currently voice is taking longer to push and im busy irl.
13:17:14*audiofile joined #nim
13:20:18*Q-Master joined #nim
13:24:36*lritter quit (Ping timeout: 240 seconds)
13:25:35*PMunch joined #nim
13:28:28*sepples joined #nim
13:31:54*lritter joined #nim
13:39:25ForumUpdaterBotNew thread by Serge: Is somebody working on a Fyne-like GUI lib for Nim?, see https://forum.nim-lang.org/t/7205
13:49:04*hmmm joined #nim
13:49:09hmmmg'day
13:53:19FromDiscord<dom96> hello
14:03:38FromDiscord<fwsgonzo> is there a standard HTTP library for Nim? which library has the best HTTP header manipulation design?
14:06:37*junland quit (Quit: %ZNC Disconnected%)
14:11:01*Q-Master quit (Ping timeout: 256 seconds)
14:11:08*junland joined #nim
14:12:09*junland quit (Client Quit)
14:15:28*junland joined #nim
14:17:38Zoom[m]Is it possible to set a required quantity of an expression in `pegs`? Now I'm doing `E E E E E E E E E ...`
14:18:05PMunchZoom[m], yes that is possible
14:18:12*junland quit (Client Quit)
14:18:35PMunchHave a look at the two last operators here: https://github.com/zevv/npeg#syntax
14:18:51Zoom[m]Actually, I'm working with pegs in std
14:19:00PMunchOh
14:19:04PMunchFor that one I don't know
14:19:07PMunchHaven't used it much
14:19:47Zoom[m]If I use zevv's npeg everyone will say I just copied his solution, and I'm not trying to look at any, until I'm done
14:21:38*junland joined #nim
14:22:00FromDiscord<ajusa> is there any way to make a loop parallel if it is reading from stdin? eg making `for line in stdin.lines:` parallel
14:22:59FromGitter<xflywind> Are there builtin functions to compare two Nim identities in runtime(eqIent is in CT)
14:24:33PMunch@ajusa, well you can make the execution of whatever is in the loop parallel
14:25:08PMunch@xflywind, I don't think Nim has idents on runtime
14:25:13PMunchWhat're you trying to do?
14:26:19FromDiscord<ajusa> PMunch good point, I assume you mean I basically spawn a bunch of stuff within the loop and then process it after the loop is done?
14:26:37PMunchPretty much
14:26:45PMunchOr rater you start processing while the loop is running
14:26:57PMunchBut it will continue until it is done
14:27:25FromDiscord<ajusa> would I need channels for that then, to have a work queue of some sort?
14:27:31PMunchWhat you probably want to do though is to start N number of worker threads, each trying to read from a channel
14:27:53PMunchThen in your main thread you loop over stdin and put every line into the channel
14:27:54FromGitter<xflywind> Yeah I could use compilerapi instead
14:28:05PMunchThe threads will read from the channel and process the inputs
14:28:43PMunch@ajusa, channels are the easiest option I think
14:28:43FromGitter<xflywind> timothee and I am doing a nimlint for reviewing PR.
14:28:59PMunchI mean you could also spin up a new thread for each line
14:29:06PMunchBut that is likely to just slow stuff way down
14:29:18FromDiscord<ajusa> I'm worried about the memory usage in that scenario though, as I think I would have a non-trivial amount of the file in memory. My use case involves parsing logs, so after seeing a line I store some data into a table and move on.
14:29:29FromDiscord<ajusa> (edit) "memory." => "memory (through the channel)."
14:34:30PMunchWell you can set maxItems on the channel
14:34:42PMunchThat means the writer will block when the channel is full
14:34:59PMunchEffectively putting an upper bound on its memory usage
14:35:30FromDiscord<ajusa> oh I missed that completely. Just to double check, I can't use channels with spawn, right?
14:35:41PMunch(well, if you are putting strings in you could theoretically put infinitely long strings in. But if you cap the length of a line the memory consumption would be bound)
14:36:04PMunchNo that's apparently a bad idea
14:36:07PMunchNot entirely sure why
14:36:16PMunchThink they might be copied or something
14:37:01FromDiscord<ajusa> Alright, thanks! hopefully I can speed up my program a bit with this πŸ˜„
14:37:28Zevvajusa: you could have one thread doing the actual reading of stdin
14:37:40Zevvand find the line boundaries -> ptr + len
14:37:52Zevvuse a thread pool to pick lines from a queue and work on them
14:38:31Zevvcomplication is memory management, how to clean up parts that are done
14:38:49Zevvif you want to go zero-copy
14:39:35*abm joined #nim
14:40:19FromDiscord<ajusa> I'm not too concerned about memory usage so long as I can cap it like PMunch suggested. Just didn't want to end up in a scenario where the entire log file is read into memory some how.
14:40:31Zevvconsider memFiles
14:41:20FromDiscord<ajusa> Can I use memFiles with stdin?
14:41:27Zevvno :(
14:42:02FromDiscord<ajusa> 😦 I use grep to filter my logs first so I need to read over stdin
14:42:57FromDiscord<ajusa> I do wish that there was an easier automatic way of doing this though lol. Seems like weave and spawn are supposed to abstract away having to figure out how many threads to allocate based on the cpu, etc
14:43:32ZevvNim doesn't have a solid threading story, still
14:43:55Zevvthe primitives are there, but there's now one-solution-fits-all glue for you yet
14:44:41*Q-Master joined #nim
14:45:35FromDiscord<ajusa> Yeah, I last tried doing threading in nim in 2017, at least things are better now.
14:46:42ZevvI practically never use threads, except when using Golang
14:47:18ZevvI decided I'm not smart enough to do it right, so I might as well just not do it at all
14:47:48PMunchThreads are always fun <_<
14:47:53FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=2GJf
14:48:43PMunchYeah unless you're doing a lot of work for each line there isn't much optimising to do when reading from a file
14:49:53FromDiscord<ajusa> Exactly. My current (non-threaded) solution is only 4 times slow than just dumping everything to /dev/null so I figured it was time to look into multithreading
14:49:58*Q-Master quit (Ping timeout: 256 seconds)
14:50:37PMunchTo put some stuff into perspective: https://cdn.mos.cms.futurecdn.net/LC7jNpbXZu5L462NHq4DnA.jpg
14:51:26Zevv'physical system reboot. 5m'
14:51:27Zevvdude
14:52:27PMunchNot sure if you think that's fast or slow :P
14:52:43Zevvif you got a full cabinet with 90's raid controllers, sure
14:52:46Zevvthen it's pretty accurate
14:53:32PMunchOr just a normal Windows install :P
14:54:25FromDiscord<Rika> Windows can reboot in a minute or less for me
14:55:35FromDiscord<Rika> L0 cache access is what tho πŸ‘€
14:56:07lainin a macro that accepts a 'typed' argument (statement list), is there an easy way to find all statements that might modify a given variable?
14:56:42PMunch@Rika, because RAM is so slow the CPU has levels of caches where it tries to pre-load stuff from memory
14:56:57FromDiscord<Rika> I know
14:57:05PMunchOh :P
14:57:08FromDiscord<Rika> Maybe reread my message
14:57:15PMunchI thought you asked what L0 was :P
14:57:28FromDiscord<Rika> I see
15:06:39FromDiscord<dom96> @ajusa for your use case it sounds like it might be worthwhile to investigate how grep tools handle stdin
15:09:35ForumUpdaterBotNew thread by Inventormatt: Nimbotics, see https://forum.nim-lang.org/t/7206
15:19:36ForumUpdaterBotNew thread by Deech: Statically Check If An Object Is A Subtype Of Another Object, see https://forum.nim-lang.org/t/7207
15:24:42FromDiscord<shadow.> is there any way to set the low or high of a slice?
15:25:36*Q-Master joined #nim
15:28:33FromDiscord<lqdev> yes
15:28:36FromDiscord<lqdev> slice.a = 10
15:28:39FromDiscord<lqdev> slice.b = 20
15:31:01FromDiscord<shadow.> oh nice thanks
15:34:57*Kaivo quit (Quit: WeeChat 2.9)
15:35:02FromDiscord<shadow.> is there a way to assign a function to a variable?
15:35:17*Kaivo joined #nim
15:35:17FromDiscord<shadow.> and change which function it's associated with
15:35:22FromDiscord<shadow.> as long as yk same return type and args?
15:35:34narimiranhave you tried it?
15:35:48FromDiscord<shadow.> yeah
15:36:20FromDiscord<shadow.> invalid type none for var
15:40:38FromDiscord<krisppurg> maybe a dumb question, but is there a way to read bytes from string?
15:40:52FromDiscord<lqdev> yeah just iterate over it
15:41:06FromDiscord<lqdev> a char is always a single byte in Nim
15:41:37FromDiscord<shadow.> oh hey krisppurg
15:41:43FromDiscord<krisppurg> sup shadow
15:41:47FromDiscord<shadow.> i was just talking about dimscord yesterday lol
15:41:52FromDiscord<krisppurg> I saw
15:42:14FromDiscord<shadow.> oh wait u accepted my pr
15:42:15FromDiscord<shadow.> haha
15:42:40FromDiscord<shadow.> wait nvm
15:42:42FromDiscord<shadow.> i think im being dumb
15:42:43FromDiscord<shadow.> lol
15:43:22FromDiscord<krisppurg> dont want offtopic chat in main rn, but feel free to dm me if you want.
15:43:31FromDiscord<shadow.> oh ok
15:53:19FromDiscord<ajusa> Doesn't Nim in Action have an example where channels and spawn were used? Is that one of those things that doesn't work anymore but worked back then?
15:55:31Zevvit still does, the book is still relevant, make sure to find the errate
15:58:43FromDiscord<ajusa> errate?
15:59:39FromDiscord<ajusa> oh nevermind the book has two threads finish before looking at the stuff in the channel, that isn't what I was trying to do
15:59:50FromDiscord<InventorMatt> https://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html
15:59:59FromDiscord<InventorMatt> this is the errata for it
16:00:04*Helios quit (Quit: Idle for 30+ days)
16:03:13FromDiscord<starl0rd> Hi all
16:03:28FromDiscord<starl0rd> sent a code paste, see https://play.nim-lang.org/#ix=2GJH
16:03:59FromDiscord<starl0rd> is there a better way to init a seq with default values for its type repeated a number of times ?
16:04:05*hmmm quit (Ping timeout: 240 seconds)
16:04:56FromDiscord<starl0rd> probaly something like those list comprehensions in python ?
16:05:56FromDiscord<Vindaar> @starl0rd there's `newSeqWith` (in sequtils I think)
16:06:08narimiranyou have off-by-one error, i think
16:06:15narimiranand you can do it like this: https://play.nim-lang.org#ix=2GJJ
16:06:29narimiranalternatively: https://nim-lang.github.io/Nim/sequtils.html#newSeqWith.t%2Cint%2Cuntyped
16:08:10*hmmm joined #nim
16:08:34FromDiscord<Vindaar> but if you only want the default value of `Bit` anyway, you don't even have to explicitly assign anything. Just doing `newSeq[Bit](size)` already initializes with the default value, no?
16:08:46narimirantrue
16:09:48FromDiscord<shadow.> @starl0rd you can also use sugar collect or repeat
16:14:30FromDiscord<starl0rd> Thanks guys
16:14:42FromDiscord<starl0rd> sent a code paste, see https://play.nim-lang.org/#ix=2GJR
16:14:44FromDiscord<starl0rd> These both work
16:14:49FromDiscord<shadow.> rip me
16:15:01FromDiscord<starl0rd> ?
16:15:04FromDiscord<shadow.> nvm lol
16:15:08FromDiscord<shadow.> i think i misread what you were tryna do
16:15:25FromDiscord<shadow.> ohh yeah you can do ↡`var ba2 = repeat(size, bit)`↡as well
16:15:36FromDiscord<shadow.> tho that requires sequtils so newSeqWith() prolly makes more sense
16:16:14*NimBot joined #nim
16:16:23FromDiscord<starl0rd> ba one has the advantage in that i dont need to import anything, but it is less readable than newSeqWith
16:16:33FromDiscord<shadow.> yeah that was my thought
16:16:50FromDiscord<shadow.> i mean you can always just make a template for repeat if you want it more readable
16:17:07FromDiscord<starl0rd> havent got around to templates just about yet
16:17:12FromDiscord<shadow.> ohh ok
16:17:33FromDiscord<starl0rd> i am doing the tutorial on the official site
16:18:03FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GJT
16:18:04FromDiscord<shadow.> (if you need it)
16:18:08FromDiscord<shadow.> if not yeah newSeqWith works fine
16:19:52FromDiscord<shadow.> is there a way to strip a seq of a character from front and tail ends?
16:20:45FromDiscord<shadow.> element not character
16:21:19FromDiscord<shadow.> if not ill just make one
16:21:22FromDiscord<starl0rd> i know the functional way to do this, coming from haskell
16:21:25FromDiscord<shadow.> haha
16:21:31FromDiscord<starl0rd> you use the take and drop functions
16:21:50FromDiscord<shadow.> does this make you happy
16:21:51FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GJZ
16:21:51FromDiscord<shadow.> LOL
16:21:55FromDiscord<shadow.> as a haskell dev
16:22:04FromDiscord<shadow.> that was in one of my aoc's lol
16:22:27FromDiscord<shadow.> eh whatever ill just make a function
16:22:35FromDiscord<starl0rd> that's just my first instinct now. reach for map or filter
16:22:39FromDiscord<krisppurg> Is this how you would read the bytes https://play.nim-lang.org/#ix=2GJX ?
16:23:06FromDiscord<lqdev> well…yeah
16:23:10FromDiscord<shadow.> lol
16:23:12FromDiscord<shadow.> char == byte
16:23:18FromDiscord<lqdev> not exactly equal tho
16:23:21FromDiscord<shadow.> well
16:23:24FromDiscord<lqdev> you can convert from byte to char
16:23:27FromDiscord<shadow.> all chars are a byte
16:23:29FromDiscord<shadow.> in size
16:23:29FromDiscord<lqdev> and vice versa
16:23:35FromDiscord<shadow.> well yeah
16:23:40FromDiscord<shadow.> they're different representations of the same bits
16:23:54FromDiscord<shadow.> but the idea is that iterating over a string yields chars which are all bytes
16:24:10FromDiscord<shadow.> i mean if you really want the "bytes" of a string you could cast it to a byte array
16:24:11FromDiscord<lqdev> if you need unicode characters use `unicode.runes`
16:26:40FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=2GK3
16:27:12FromDiscord<shadow.> rust chars are 4 bytes
16:27:16FromDiscord<shadow.> lmao
16:27:24FromDiscord<shadow.> that's most likely why you need casting
16:27:28FromDiscord<shadow.> or whatever tf that is
16:27:35FromDiscord<lqdev> it's not casting
16:27:43FromDiscord<lqdev> just reading into a byte array
16:27:46FromDiscord<shadow.> fair enough
16:32:19FromDiscord<shadow.> boom
16:32:21FromDiscord<shadow.> finished aoc day 5 lol
16:33:46FromDiscord<shadow.> hmm i have an opinion based question
16:34:06FromDiscord<shadow.> if you can ensure that x is a Natural and you need to check if x is not 0, do you use > for readability or !=
16:38:22FromDiscord<Vindaar> imo depends on the meaning of 0 in the context. I'd possibly go with `!= 0` if I mean to say "hey, this is unequal the special case here" (and of course < 0 cannot happen)
16:38:30FromDiscord<Vindaar> but normally just `> 0`
16:39:05FromDiscord<shadow.> fair enough
16:39:10FromDiscord<shadow.> im going to assume the speed difference is miniscule
16:47:11FromDiscord<Vindaar> in the vast, vast majority of use cases the speed difference here certainly would not matter I'd say
16:47:29FromDiscord<shadow.> lmfao yeah kk
16:47:41FromDiscord<shadow.> time to upload my aoc to github
16:47:44*Kaivo quit (Quit: switching to wifi)
16:48:48*Kaivo joined #nim
16:48:51ForumUpdaterBotNew post on r/nim by richardd08: Running into problems trying to submit C code generated by Nim to a programming contest, see https://www.reddit.com/r/nim/comments/k7ats7/running_into_problems_trying_to_submit_c_code/
16:51:55*habamax quit (Read error: Connection reset by peer)
17:01:10FromDiscord<Vindaar> damn you were all fast answering that person!
17:02:23FromDiscord<starl0rd> sent a code paste, see https://play.nim-lang.org/#ix=2GKi
17:02:37FromDiscord<starl0rd> would this copy the input and mutate the copy
17:02:51FromDiscord<starl0rd> or would this mutate the original seq ?
17:03:07FromDiscord<Vindaar> nope, sequences have value semantics, i.e. assignments copy
17:03:10FromDiscord<starl0rd> (edit) "https://play.nim-lang.org/#ix=2GKi" => "https://play.nim-lang.org/#ix=2GKk"
17:03:32FromDiscord<starl0rd> and the original would be gc'ed when its done right ?
17:03:45FromDiscord<starl0rd> And there are no more refs
17:04:07FromDiscord<Vindaar> nope, the original continues to live a happy life until its scope comes to a sudden end πŸ™‚
17:04:29FromDiscord<starl0rd> but if im adding 1000 times
17:04:44FromDiscord<starl0rd> and bitarray is global scope
17:04:49FromDiscord<Vindaar> then this is probably not a very smart procedure to write
17:04:54FromDiscord<starl0rd> i'd have 1000 bit arrays in mem ?
17:04:56FromDiscord<Vindaar> so you want to mutate the global one
17:05:08FromDiscord<starl0rd> not really : P
17:05:12FromDiscord<Vindaar> it depends on where the result is assigned to
17:05:17FromDiscord<starl0rd> i'd rather write this as a `func`
17:05:37FromDiscord<Vindaar> if you overwrite the input again, then of course it won't result in you having 1000 seqs
17:05:57FromDiscord<starl0rd> ofc
17:05:59FromDiscord<Vindaar> a naive functional proc like this will have serious performance problems though
17:06:13FromDiscord<Vindaar> that's why e.g. clojure data types are quite non trivial (but pretty amazing)
17:06:33FromDiscord<starl0rd> the language ?
17:06:39FromDiscord<starl0rd> or the pragma ?
17:07:03FromDiscord<Vindaar> PMunch has ported over the clojure vector that allows for this in an efficient manner https://github.com/PMunch/nim-persistent-vector
17:07:24FromDiscord<Vindaar> the Clojure the language
17:07:48*habamax joined #nim
17:07:51FromDiscord<starl0rd> immutable lists are pretty dope in general
17:08:01FromDiscord<Vindaar> agreed
17:08:13FromDiscord<starl0rd> i miss the cons operator here
17:08:31FromDiscord<starl0rd> i even searched for nim cons operator
17:08:35FromDiscord<starl0rd> on google
17:08:41FromDiscord<starl0rd> didn't get very far
17:09:22FromDiscord<starl0rd> comming back, when i call this func with an actual seq argument
17:09:30FromDiscord<starl0rd> is that copied over in the parameter ?
17:10:12FromDiscord<Vindaar> the parameter is passed by reference if the passed object exceeds a (relatively small, don't have the number in my head) sizo
17:10:25FromDiscord<Vindaar> you don't have to worry about that at least πŸ™‚
17:10:55FromDiscord<starl0rd> and is then implicitly dereferenced in the proc ?
17:11:06FromDiscord<starl0rd> (edit) "and is ... then" added "that"
17:11:09FromDiscord<Vindaar> yep
17:11:30FromDiscord<starl0rd> means i do have to make a copy in the proc ?
17:11:47FromDiscord<Vindaar> if you want a copy yes, otherwise no. Not sure what you mean sorr
17:11:57FromDiscord<starl0rd> if i never want to mutate the original
17:12:07FromDiscord<Vindaar> then sure, you need to make a mutable copy
17:12:08FromDiscord<starl0rd> if its a ref, i'd mutate it
17:12:46FromDiscord<Vindaar> yes, but as I said, you don't have to worry about that. If you have a raw `object` (not `ref object`) it might be passed by reference, but for you everything is still just a value object
17:13:14FromDiscord<starl0rd> hang on
17:13:16FromDiscord<starl0rd> : P
17:15:32FromDiscord<Vindaar> my arms are getting tired πŸ˜›
17:26:20*audiofile quit (Ping timeout: 272 seconds)
17:28:21*abm quit (Quit: Leaving)
17:30:12FromDiscord<starl0rd> you're saved from more typing by the compiler
17:30:26FromDiscord<starl0rd> it WONT let me mutate : p
17:30:38FromDiscord<starl0rd> unless i shadow the variable with itself
17:30:52FromDiscord<starl0rd> which i remember reading from the tutorial is an idom
17:35:53FromDiscord<haxscramper> What are the recommendations for using `std/distros` for providing better error messages? I want to make wrapper that somehow detects missing library for linking, and provides relevant fix suggestions. (like "cannot find hunspell library, please install it using apt-get ... etc")
17:36:35FromDiscord<haxscramper> make C library wrappers that requires static linking
17:37:37FromDiscord<Vindaar> yes, of course you cannot mutate it. I thought that much was clear to you, sorry
17:38:15FromDiscord<Vindaar> or rather that's what I was trying to get across when I said "don't worry about it" (it being mutating it accidentally)
17:38:35FromDiscord<starl0rd> it kindda was, but i wasn't sure if it was a ref or value and if i can EVER accidently mutate the orignal
17:38:44FromDiscord<starl0rd> no matter the size
17:39:05FromDiscord<Vindaar> you can, but then you need to do unsafe things πŸ˜‰ So yes, Nim is great here
17:39:10FromDiscord<starl0rd> i like working with pure functions, much easier to reason about for me
17:41:51FromDiscord<Vindaar> so you can do this: https://play.nim-lang.org/#ix=2GKz
17:42:20FromDiscord<Vindaar> but of course you don't want to do such a thing usually haha. But it's useful in particular when dealing with C libraries
17:43:57FromDiscord<shadow.> how can i do a single discard in macros?
17:44:02FromDiscord<shadow.> like instead of discarding an expr
17:44:04FromDiscord<shadow.> do i just do empty?
17:44:17FromDiscord<shadow.> nvm figured it out
17:48:20FromDiscord<shadow.> i present to you
17:48:24FromDiscord<shadow.> the bad idea pragma
17:48:30FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GKC
17:48:45FromDiscord<shadow.> function creating errors? just wrap it with badIdea!
17:49:48FromDiscord<InventorMatt> the only thing it is missing is a way to log the error
17:49:53FromDiscord<shadow.> hm true
17:50:02FromDiscord<shadow.> is there a way to except any exception under a var?
17:50:05FromDiscord<shadow.> ik u can do except Exception as e
17:50:08FromDiscord<shadow.> but what abt for any error
17:51:12FromDiscord<lqdev> var e = getCurrentException()
17:51:30FromDiscord<shadow.> ohh
17:51:36FromDiscord<haxscramper> Just found funny bug - `std/distros` uses ``"sun" in `<uname -a shell output>` `` to detect if current OS is a solaris. So on sundays, you can be detected as arch linux and solaris at the same time.
17:52:24FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GKD
17:52:46FromDiscord<starl0rd> yay
17:52:54FromDiscord<starl0rd> wrote a rudimentary bloom filter
17:52:56FromDiscord<starl0rd> https://play.nim-lang.org/#ix=2GKE
17:53:32FromDiscord<starl0rd> ^ways i could do this better \ critique ?
17:53:43FromDiscord<starl0rd> (edit) "do" => "have done"
17:54:23FromDiscord<shadow.> camelCase
17:54:48FromDiscord<shadow.> maybe make the number used in the hash function a parameter
17:54:52FromDiscord<shadow.> instead of making 3 different functions
17:55:38FromDiscord<zetashift> also you for multiple variable declaration after each other you can do https://nim-lang.org/docs/tut1.html#the-var-statement also goes for let and const
17:55:58FromDiscord<starl0rd> usually they'd be 3 very different functions. didn't feel like typing them out : P
17:56:30FromDiscord<zetashift> usually Nim peeps use the implicit `result = ba2` for example
17:56:55FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2GKF
17:57:02FromDiscord<shadow.> dont take my word on it
17:57:40FromDiscord<starl0rd> yea, i could do that. thanks
17:57:49FromDiscord<shadow.> yeah i think my version of initBitArray should work lol
17:57:55FromDiscord<shadow.> since in nim everything is auto-zeroed
17:58:10FromDiscord<starl0rd> is it necessary ? or just prefered
17:58:17FromDiscord<zetashift> preferred!
17:58:28FromDiscord<zetashift> But since your init is camelCase, why not the rest too? haha
17:58:41FromDiscord<shadow.> yeah
17:58:52FromDiscord<shadow.> in addition, underscores and caps dont really affect things iirc
17:58:55FromDiscord<shadow.> so do_this_thing`
17:59:03FromDiscord<starl0rd> it would! but i like it nice and explicit so i dont have to use my brain when i read it back a week from now on.
17:59:05FromDiscord<shadow.> (edit) "do_this_thing`" => "`do_this_thing` is equal to `doThisThing`"
17:59:08FromDiscord<zetashift> yes users that will use your bloomfilter can use both casing
17:59:10FromDiscord<shadow.> fair enough
17:59:32FromDiscord<starl0rd> i hope no one does : p
17:59:52FromDiscord<zetashift> haha, for future data structures who knows!
18:00:20FromDiscord<zetashift> sadly don't know much about bloom filters so I can't help you that much except style
18:00:20FromDiscord<starl0rd> i just read a wikipedia article on it yesterday, thought i'd be a nice nifty thing to make as i read the seq section in the nim tutorial
18:00:41FromDiscord<starl0rd> its just a learning tool
18:00:53FromDiscord<starl0rd> (edit) "its just a learning tool ... " added "here"
18:01:06FromDiscord<zetashift> yea looks good
18:01:07FromDiscord<starl0rd> but i really didnt want to write another tree
18:01:15FromDiscord<zetashift> also nothing is imported so nobody can use it either wya
18:01:26FromDiscord<starl0rd> win
18:01:28FromDiscord<zetashift> exported
18:01:59FromDiscord<starl0rd> i just might read the bloom spec and make it a proper package next weekend if i get the time
18:02:29FromDiscord<starl0rd> publishing a package would get me introduced to nimble confs and stuff
18:04:33*thomasross joined #nim
18:10:18FromGitter<deech> What is the difference between `copyNimNode` and `copyNimTree` and are they deep copies? https://github.com/nim-lang/Nim/blob/devel/lib/core/macros.nim#L414
18:11:37FromDiscord<lqdev> i believe that copyNimNode is a shallow copy and copyNimTree is a deep copy
18:14:01FromDiscord<shadow.> sounds about right
18:53:42FromDiscord<Quibono> sent a code paste, see https://play.nim-lang.org/#ix=2GKX
18:53:54FromDiscord<Quibono> Three dots makes more sense.
18:54:03FromDiscord<Quibono> _three dot gang_
19:02:05FromDiscord<haxscramper> Because we also have `..<` and `...<` is too much
19:02:20FromDiscord<haxscramper> And besides, you can make own `...` operator
19:02:21FromDiscord<lqdev> i mean `..<` is your `...`
19:05:03FromDiscord<shadow.> !eval echo (0f).type
19:05:06NimBotfloat32
19:05:10FromDiscord<shadow.> perfect
19:05:15FromDiscord<lqdev> yes
19:06:02FromDiscord<shadow.> yes
19:08:20FromDiscord<Quibono> So why not have ... be the default and then keep ..<
19:08:37FromDiscord<Quibono> because ellipses are literally the symbol for what .. is now.
19:08:41*Adeon quit (Ping timeout: 265 seconds)
19:09:38Zevvsure that might have been better, but its not what it is now
19:10:29*Adeon joined #nim
19:10:46FromDiscord<lqdev> `..<` is more readable because it implies lowering the RHS value
19:10:54FromDiscord<lqdev> dot dot less
19:10:57FromDiscord<lqdev> is how you read that
19:11:27FromDiscord<Quibono> Right, so keep that, and just so ... for the normal one. Never too late to change, it could be in the 1.5 version
19:11:44FromDiscord<Quibono> Then depreciate .. in 1.6
19:14:34ZevvId say make an RFC for that and put up an PR
19:15:20Zevvbut trust me, nothing gets deprecated. what runs in 1.0 must run in 1.x
19:15:46FromDiscord<Quibono> How does one make an RFC?
19:16:03Zevvcreate an issue in the nim rfc repo at github
19:16:41Zevvi wish you the best but i dont think you'll get much support
19:16:57Zevvwe got worse problems to fix then an subjectively bad choice for an operator
19:17:47FromDiscord<shadow.> lmao
19:17:49FromDiscord<shadow.> i prefer .. tbh
19:18:04FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/784861162511794237/unknown.png
19:18:09FromDiscord<shadow.> this looks awkward
19:18:15FromDiscord<shadow.> maybe in discord font it looks good
19:18:16FromDiscord<shadow.> but in ide no
19:18:28Zevvbikeshedding
19:19:02FromDiscord<shadow.> fair enough
19:19:29FromDiscord<Quibono> I get it’s a trivial issue but it can’t be that hard to add
19:19:47Zevvit isnt
19:20:26Zevvshould be 2 minutes of work
19:20:41FromDiscord<InventorMatt> you could always make a template for it and use that for all of your own projects
19:21:30FromDiscord<Quibono> True, but part of why I like Nim is it has good syntax. 1..10 feels like bad syntax.
19:21:34FromDiscord<Quibono> I’ll make the RFC
19:22:45Zevv"feels like" -> subjective
19:22:55Zevvbut ill shut up now
19:23:08FromDiscord<Quibono> Isn't all syntax subjective lol.
19:23:24Zevvright. so thats why it is what it is
19:23:33Zevvthere are parts i hate. there are parts i love
19:23:42Zevvbut i actually dont care too much
19:24:16Zevvif you actually use stuff, it doesnt matter
19:24:38Zevvpeople whine about indenting, complain about style/case insensitivity
19:25:28FromDiscord<Quibono> _uses stuff and still prefers ..._
19:25:36Zevvi think i hate all languages i use equally
19:29:58FromDiscord<Quibono> https://github.com/nim-lang/Nim/issues/16263
19:29:59disbotβž₯ Add 1...10 in place of 1..10 in order to better match English syntax.
19:30:01FromDiscord<Quibono> Let the hate begin
19:30:03FromDiscord<haxscramper> sent a code paste, see https://paste.rs/EBk
19:30:43FromDiscord<haxscramper> This is not a RFC repo btw - correct one is https://github.com/nim-lang/RFCs/issues
19:31:09FromDiscord<Quibono> Lol can I move it or do I need to delete and remake it?
19:31:45FromDiscord<haxscramper> And to make it universally accessible it would have to be added in `std/system` which basically no-go under any circumstances, especially considering little practical value of such addition.
19:31:59FromDiscord<haxscramper> Delete and remake probably
19:32:34FromDiscord<Quibono> Why is it a no-go to add it to std/system?
19:32:53Zevvbecause of this
19:33:10Zevvwhat would happen if every single new idea ended up there
19:33:31FromDiscord<haxscramper> Because it is a 3k+ line file, with 2k+ more lines of 'mandatory necessary stuff'
19:33:50FromDiscord<haxscramper> with 2k+ `include`s
19:34:21FromDiscord<haxscramper> I just have `hmisc` package where I dump all of my ideas in such cases, and drag it around for all projects
19:34:44FromDiscord<Quibono> Alright, I won't resubmit.
19:35:58Zoom[m]Hey, I thought I've caught up with AOC. How is it it's still Dec the 5th but the 6th day is already on?
19:37:03Zoom[m]That's a real πŸ€¦β€β™‚οΈmoment. That's the timer counting to the 6th day...
19:48:38*sschwarzer joined #nim
19:54:04disrupteki think i hate all languages zevv uses equally.
19:55:06sschwarzerdisruptek: Which languages were you talking about?
19:55:29disrupteklanguages zevv uses.
19:56:08sschwarzerdisruptek: oookay. I meant, which languages specifically?
19:56:37disruptekjust the ones he uses.
19:57:02disruptekif he uses it, i think i hate it.
19:57:09sschwarzerdisruptek: I see. Everything's crystal clear now. Thank you very much! ;-)
19:57:59*a_chou joined #nim
19:58:42*a_chou quit (Remote host closed the connection)
19:59:12*a_chou joined #nim
19:59:29sschwarzerIs it possible to store an AST for later processing at runtime? For example, in https://play.nim-lang.org/#ix=2GLd , I would like to store the AST that can be visualized with `dumpTree` in a const or let "variable". Somehow I think this should be easy, but don't see how.
20:00:02disruptekwhy not?
20:00:51sschwarzerdisruptek: You mean why it shouldn't be easy? Or why I don't see it? :)
20:01:06sschwarzerI mean, how can I do it in Nim?
20:01:24FromDiscord<InventorMatt> Do you want to store it as a string?
20:01:41disruptekwhat is it you want to store? nim nodes? a string representing the code? or just the semantic relationships?
20:01:56sschwarzerInventorMatt: No, I want to store it as a tree, similar to JSON or `XmlNode`s
20:02:12sschwarzerI want to store the AST data structure.
20:02:36sschwarzerThe same that a macro in place of `dumpTree` would see.
20:02:41FromDiscord<InventorMatt> Its possible to store it but only during compile time.
20:02:43disruptekyou can't store a ref as a const. or maybe timmy got his wish and now you can.
20:03:23sschwarzerdisruptek: good point. I'd also be fine with storing it with let as ref.
20:03:43disrupteki think you can let refs now.
20:04:11disruptekas a hack, you could de/serialize it with frosty.
20:05:37FromDiscord<dom96> disruptek: who's timmy?
20:07:00disruptektimothee
20:07:28FromDiscord<fwsgonzo> is there a nim executable option to make the name of the nimcache .json file a known filename?
20:07:37FromDiscord<fwsgonzo> (edit) "is there a nim executable option to make the name of the nimcache .json file a known filename? ... " added "it'"
20:07:47FromDiscord<fwsgonzo> (edit) "it'" => "it's a little bit annoying to have to translate x.nim into x.json"
20:07:54disruptekdude, keep us posted on your work. it's pretty interesting.
20:09:16disruptekthere's a proc to change a file extension. i think it's called changeFileExt.
20:11:22sschwarzerdisruptek: What dude and work?
20:12:02disruptekgonzo is doing some pretty interesting stuff with cache vms.
20:13:09disruptekmaybe i can find the medium posts.
20:13:47disruptekhttps://fwsgonzo.medium.com/virtual-machines-for-multi-tenancy-in-varnish-1c619ea3276
20:16:23sschwarzerdisruptek: thanks
20:16:44disruptekclyybber: ^
20:17:48disruptekwe should probably have a bloom filter package. i will improve this one and if no one wants to maintain it, i guess i will.
20:20:40*narimiran quit (Quit: leaving)
20:22:43*a_chou quit (Quit: a_chou)
20:27:57FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2GLn
20:29:14FromDiscord<fwsgonzo> Just to clarify, the above is working code
20:30:04*sschwarzer quit (Quit: leaving)
20:31:07disrupteki mean, there are really great ways to do this in nim.
20:31:39disruptekyou can make a macro that produces a unique symbol that is shared by both pieces of code but won't be clobbered by anything else.
20:32:33disruptekmacros are perfect for setting up complex compile-time logic, but you can even use a template for something this simple.
20:36:54*unclechu quit (Ping timeout: 244 seconds)
20:36:54*L[m] quit (Ping timeout: 244 seconds)
20:36:57*guelosk[m] quit (Ping timeout: 246 seconds)
20:37:00*leorize[m] quit (Ping timeout: 246 seconds)
20:37:29*ee7[m] quit (Ping timeout: 244 seconds)
20:37:29*Clonkk[m] quit (Ping timeout: 244 seconds)
20:37:32*jonjitsu[m] quit (Ping timeout: 260 seconds)
20:37:33*Zoom[m] quit (Ping timeout: 260 seconds)
20:37:33*leorize[m]1 quit (Ping timeout: 260 seconds)
20:37:33*GitterIntegratio quit (Ping timeout: 260 seconds)
20:37:35*Jitty[m] quit (Ping timeout: 268 seconds)
20:37:36*ache-of-head[m] quit (Ping timeout: 268 seconds)
20:37:36*BitPuffin quit (Ping timeout: 268 seconds)
20:37:44*jaens[m] quit (Ping timeout: 240 seconds)
20:37:44*reversem3 quit (Ping timeout: 240 seconds)
20:37:47*MTRNord quit (Ping timeout: 260 seconds)
20:37:50*lnxw37d4 quit (Ping timeout: 264 seconds)
20:38:12*lytedev[m] quit (Ping timeout: 268 seconds)
20:38:21*pixtum[m] quit (Ping timeout: 246 seconds)
20:38:49*Avatarfighter[m] quit (Ping timeout: 268 seconds)
20:45:54*hnOsmium0001 joined #nim
20:48:46hmmmwtf happened :o
20:57:00Prestigehmmm: hmm?
20:58:24*habamax quit (Ping timeout: 265 seconds)
20:58:28*reversem3 joined #nim
20:59:21lainis the order of macro evaluation well-defined in nim?
20:59:28disruptekyes.
21:00:03*pixtum[m] joined #nim
21:00:17*leorize[m] joined #nim
21:00:43*jaens[m] joined #nim
21:01:16*guelosk[m] joined #nim
21:02:14*unclechu joined #nim
21:03:44lainis it just the order they're encountered in (so, top-down, left-to-right?)
21:04:31*lytedev[m] joined #nim
21:04:46*L[m] joined #nim
21:04:52disruptekit depends on whether their inputs are typed or not; untyped passes can be evaluated earlier than typed passes.
21:05:07lainah right
21:05:16*BitPuffin joined #nim
21:06:08*ee7[m] joined #nim
21:06:59*Jitty[m] joined #nim
21:07:28*Northstrider[m] joined #nim
21:08:48*Avatarfighter[m] joined #nim
21:08:55*ache-of-head[m] joined #nim
21:12:27*jonjitsu[m] joined #nim
21:12:56*leorize[m]1 joined #nim
21:14:15*MTRNord joined #nim
21:17:05*lnxw37d4 joined #nim
21:18:32*Clonkk[m] joined #nim
21:18:47*Zoom[m] joined #nim
22:24:16*asie joined #nim
22:55:04FromDiscord<Digitalcraftsman> sent a long message, see http://ix.io/2GMn
22:55:46FromDiscord<Digitalcraftsman> (edit) "http://ix.io/2GMn" => "http://ix.io/2GMo"
22:56:01FromDiscord<lqdev> the reason is that the current behavior prevents many bugs.
22:56:09FromDiscord<lqdev> and is stricter.
22:56:31FromDiscord<lqdev> what bugs? ask Araq, he said that ._.
22:57:33disruptekdefaulting to immutability is obviously more conservative.
22:57:43*Vladar quit (Remote host closed the connection)
22:58:25FromDiscord<Digitalcraftsman> But a=20 and b=30 are known at compile time. In case of a proc call such as foo(a=bar(), b=buzz()) I would expected this.
22:58:41disruptekyes, they are known to be static and immutable.
22:59:19disruptekergo, the signature does not match. you feel me?
23:01:22FromDiscord<Digitalcraftsman> I can understand this stricter behavior if you want to prevent bugs with all kinds of function call variations.
23:01:39disruptekgood.
23:03:43*hmmm quit ()
23:05:32FromDiscord<Digitalcraftsman> The drawback with this behavior in my AoC implementation is that I had to declare the variables bottom, bottom2, top and top2 for calling `binSearch()` but I don't use them afterwards. See https://github.com/digitalcraftsman/advent-of-code-2020/blob/main/05/part2.nim
23:06:37FromDiscord<Digitalcraftsman> Is there a better way for calling a proc with variables parameters as in my case?
23:07:02disruptekwhy do you pass them as mutable at all?
23:07:21FromDiscord<Esbeesy> Yeah the bounds can't ever change can they?
23:07:38disruptekwell, as soon as the proc returns they are unused, so...
23:07:41FromDiscord<Esbeesy> Oh no wait they do
23:07:56FromDiscord<Digitalcraftsman> that's the point
23:08:06disruptekwhat's the point?
23:08:29disruptekproc binSearch(bottom, top: int; ...) = var bottom = bottom; var top = top; ...
23:08:51disruptekthen you just binSearch(0, 128, ...) ... binSearch(0, 8, ...)
23:08:58disruptekthis is a nim idiom.
23:09:07FromDiscord<Digitalcraftsman> The parameters top and bottom always stay in the range they define at the beginning. I wanted to make top and bottom mutable so I don't have to declare another two mutable vars inside binSearch
23:09:21disruptekwelcome to abstraction.
23:09:57disruptekthey aren't additional if you're declaring them in any event, right?
23:11:06disruptekin fact, you only need to declare top. bottom is synonymous with `result` here.
23:11:37disruptekand diff can be a template if it pleases you.
23:11:51FromDiscord<Digitalcraftsman> top and bottom have to be set depending on the usecase. Since I use binSearch twice with difference range bounds I moved the code into proc
23:12:35disruptekwell, i stand by my statements, but you can write the code any way you want.
23:14:39FromDiscord<Digitalcraftsman> I had a version where I used result directly instead of bottom. the compiler warned about variable shadowing. But with the current of my code I dont get any compiler warnings anymore. I'll replace bottom with result then
23:15:28FromDiscord<Digitalcraftsman> I'll have a look at templates. It's just one of the more advanced features that I haven't used so far
23:15:35FromDiscord<Digitalcraftsman> (edit) "advanced" => ""advanced""
23:15:56disruptekthey can be useful trivially, too.
23:16:20disruptektemplate diff: int = foo - bar
23:18:09disruptekyou probably got a shadowing warning because you shadowed the special symbol `result`; it shouldn't be redeclared, and then you won't be warned about reuse of the identifier.
23:18:34FromDiscord<shadow.> !eval echo (1..10).type
23:18:36NimBotHSlice[system.int, system.int]
23:18:40FromDiscord<shadow.> ah ok
23:19:36disruptek!eval import os; echo "goatse".addFileExt "cx"
23:19:39NimBotgoatse.cx
23:19:46disruptekinteresting.
23:20:00FromDiscord<shadow.> lol
23:20:13FromDiscord<Digitalcraftsman> yeq that was in one of the earlier iterations where I declared var (foo, result) = (bottom, top) inside the proc.
23:20:40FromDiscord<shadow.> what's the correct type so that you can pass `0..10` or `20..50` to a function
23:20:48FromDiscord<shadow.> hslice and slice aren't working
23:21:08FromDiscord<shadow.> wait nvm
23:21:10FromDiscord<shadow.> im being dumb
23:24:08FromDiscord<Digitalcraftsman> (edit) I had a version where I used result directly instead of bottom. the compiler warned about variable shadowing. But with the current iteration of my code I dont get any compiler warnings anymore. I'll replace bottom with result then
23:24:30FromDiscord<Digitalcraftsman> (edit) top and bottom have to be set depending on the usecase. Since I use binSearch twice with different range bounds I moved the code into proc
23:24:56FromDiscord<Digitalcraftsman> (edit) yep that was in one of the earlier iterations where I declared var (foo, result) = (bottom, top) inside the proc.
23:28:37FromDiscord<ElegantBeef> Congrats, you figured it out πŸ˜„
23:29:27FromDiscord<Recruit_main707> Lol
23:42:43*vicfred quit (Quit: Leaving)
23:46:30FromDiscord<shadow.> yes
23:46:35FromDiscord<shadow.> the issue was i was being dumb
23:47:14FromDiscord<ElegantBeef> Dont worry i'm incapable of figuring out how to properly await a asyncJS future πŸ˜„
23:47:48FromDiscord<shadow.> lmfao
23:48:13*jaggz joined #nim
23:49:03FromDiscord<ElegantBeef> `Error: undeclared identifier: 'await'` the most infuriating error
23:49:32FromDiscord<shadow.> loll
23:50:35*PMunch quit (Quit: leaving)
23:53:45disrupteki know. it means you're using threads wrong.
23:53:58FromDiscord<ElegantBeef> I mean it's javascript so i hope not πŸ˜„
23:54:31disruptekif it's javascript, i guarantee you're using threads wrong. 😁
23:54:51FromDiscord<ElegantBeef> Well i'm not using threads i'm attempting to get a media recorder, but that uses a promise to be constructed
23:55:01FromDiscord<ElegantBeef> So it's just a pain
23:56:16FromDiscord<ElegantBeef> I suppose i could try using the asyncJs promises, but i'd really just like to get it linearized
23:57:58FromDiscord<ElegantBeef> Also annoyingly it seems that a `newJsObject` outputs `[{}]`
23:58:20FromDiscord<ElegantBeef> Ah guess that's fine?
23:58:40disrupteki wouldn't tolerate that shit.
23:58:45disruptekmake someone pay.