<< 09-12-2020 >>

00:00:48FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/786019479825285130/unknown.png
00:00:49FromDiscord<shadow.> here?
00:00:52FromDiscord<shadow.> on the line below?
00:01:22miprihmm, or rather, I wouldn't do that at all.
00:01:30FromDiscord<shadow.> wdym?
00:01:38mipriit removes your ability to select another gc
00:02:06FromDiscord<shadow.> true, but ive used refc all this time with no issues, so surely using orc instead wouldnt really pose an issue?
00:02:41FromDiscord<shadow.> i can always delete the line if i have issues, right
00:02:44mipriin any case, yeah that's the line I meant
00:02:50FromDiscord<shadow.> alr thanks
00:03:01FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/786020038762430484/unknown.png
00:03:02FromDiscord<shadow.> seems to have worked
00:03:48mipriyou can confirm by compiling `when defined(gcOrc): echo "it worked"`
00:04:25FromDiscord<shadow.> yeah, also the line length is dif
00:04:27FromDiscord<shadow.> it worked, thanks
00:04:39disruptek!repo disruptek/grok
00:04:40disbothttps://github.com/disruptek/grok -- 9grok: 11spelunking gear 15 0⭐ 0🍴
00:04:48disrupteksee the star.nim
00:05:07FromDiscord<shadow.> what about it?
00:05:18FromDiscord<shadow.> interesting code
00:08:43FromDiscord<Quibono> I think I’m going to make a web crawler.
00:09:37*vicfred joined #nim
00:11:15FromDiscord<shadow.> nice
00:11:23FromDiscord<shadow.> `httpclient` and `htmlparser`
00:11:25FromDiscord<shadow.> are your friends
00:11:39FromDiscord<shadow.> also i suggest https://github.com/GULPF/nimquery
00:13:19FromDiscord<sealmove> oh, you can specify object variant after object construction
00:13:23FromDiscord<sealmove> nice
00:14:42FromDiscord<shadow.> ye
00:14:49*mbomba joined #nim
00:19:25disruptekyou should use two-space indentation, chucklehead.
00:30:53FromDiscord<Quibono> For split, how do I split by "?
00:31:40mipri!eval import strutils; echo """a"b"c"d""".split("\"")
00:31:43NimBot@["a", "b", "c", "d"]
00:32:19FromDiscord<Quibono> Thank you
00:34:55FromDiscord<Quibono> Hrm when I try three quotes in the split it freaks out at me
00:35:06FromDiscord<Quibono> Because it's expecting another triple quote
00:35:14*wowaname joined #nim
00:35:23*opal quit (Ping timeout: 240 seconds)
00:35:25*wowaname is now known as opal
00:35:37mipriwhat I typed there was doublequote, backslash, doublequote, doublequote
00:36:04FromDiscord<Quibono> Ahhhh.
00:39:59FromDiscord<sealmove> discord messes it up
00:40:17miprithat, and * coming from discord to IRC
00:40:40miprithere aren't even 0x7F values that should be round-tripped through this thing.
00:49:32FromDiscord<Cypheriel> Are the IntelliJ IDEs any good for Nim yet? I saw there was an update to the plugin but I haven't checked it out yet
00:49:46FromDiscord<shadow.> i mean if it has nimsuggest then id assume so
00:50:02FromDiscord<ElegantBeef> The highlighting isnt amazing from when i checked yesterday
00:50:11FromDiscord<Cypheriel> ah. RIP
00:50:12FromDiscord<ElegantBeef> It now is intelligent across files afaik
00:50:23FromDiscord<Cypheriel> I'd much rather use Jetbrains than VSCode
00:50:59FromDiscord<ElegantBeef> And i'd rather use the editor i have in my head 😛
00:51:06FromDiscord<Cypheriel> oh no
00:51:09FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/786032149529755698/unknown.png
00:51:22FromDiscord<Cypheriel> That is such weird highlighting
00:51:23FromDiscord<ElegantBeef> I have a hypothetical editor idea, but i cannot be arsed to make it 😄
00:51:33FromDiscord<shadow.> lmfao fair enough
00:51:44FromDiscord<shadow.> yeah i kinda hate jetbrains highlighting ngl
00:51:51FromDiscord<shadow.> the theme in general lmao
00:51:59FromDiscord<Cypheriel> You can change the theme easily
00:52:03FromDiscord<Cypheriel> I use the One Dark theme
00:52:05FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/786032385040973824/unknown.png
00:52:06FromDiscord<shadow.> same
00:52:09FromDiscord<shadow.> one dark is sexy as fuck
00:52:13FromDiscord<Cypheriel> you can also use the uh
00:52:17FromDiscord<Cypheriel> background image thing
00:52:20FromDiscord<ElegantBeef> Ayu-mirage > anything 😄
00:52:25FromDiscord<shadow.> one dark
00:52:26FromDiscord<shadow.> <3
00:52:26FromDiscord<Cypheriel> it's so good, I usually use like space/particle images
00:52:34FromDiscord<shadow.> i feel like that'd distract me
00:52:41FromDiscord<Cypheriel> Not really, honestly
00:52:47FromDiscord<Cypheriel> Well maybe it differs from person to person
00:53:01FromDiscord<Cypheriel> but I find it oddly helpful
00:53:02*disbot quit (Remote host closed the connection)
00:54:57*disbot joined #nim
00:59:45FromDiscord<shadow.> fair
01:02:10FromDiscord<sealmove> vim in transparent terminal with desktop wallpaper
01:04:09FromDiscord<Cypheriel> Ah I was just talking about with the people in PyDis about Vim
01:04:22FromDiscord<Cypheriel> It sounds really cool, right? but idk if I wanna learn it for programming
01:04:44mipriwhat, vim? it takes 15 minutes. just run through vimtutor
01:04:58FromDiscord<sealmove> yeah sure lol, nah not worth learning
01:06:18FromDiscord<sealmove> whatever plugins you use it never reaches the usability of a GUI editor/IDE for programming
01:06:48FromDiscord<sealmove> it's fun for editing data though
01:08:53FromDiscord<Rika> depends on you really
01:09:07FromDiscord<Rika> i never really needed the various uses of an ide
01:09:20FromDiscord<Rika> and its pretty bloated with the boot time and stuff
01:09:42FromDiscord<j-james> my vim setup replicates vscode
01:10:00FromDiscord<j-james> including staying in insert mode by default
01:10:18FromDiscord<j-james> makes switching between them very nice
01:13:51*Tanger joined #nim
01:22:46*letto_ quit (Quit: Konversation terminated!)
01:24:41*letto joined #nim
01:30:32*xet7 quit (Ping timeout: 258 seconds)
01:30:47*xet7 joined #nim
01:41:14*mbomba quit (Quit: WeeChat 3.0)
02:01:55*letto quit (Quit: Konversation terminated!)
02:03:43*letto joined #nim
02:11:57*abm quit (Read error: Connection reset by peer)
02:18:08FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=2HeX
02:19:40FromDiscord<Rika> ngl the lack of chaining hurts me but you do you
02:20:16FromDiscord<Rika> i dont see anything wrong per se
02:20:31FromDiscord<Rika> is this strutils or re?
02:20:38FromDiscord<Rika> ah dumb question
02:21:01FromDiscord<Rika> `multiReplace(split(rule, " contain ")[1], {" bags", " bag", "."})` -> `multiReplace(split(rule, " contain ")[1], " bags", " bag", ".")`
02:21:18*casaca quit (Remote host closed the connection)
02:21:54FromDiscord<Rika> how'd it go?
02:22:07FromDiscord<j-james> the compiler isn't happy with that either
02:22:18*vicfred quit (Ping timeout: 256 seconds)
02:22:28FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=2HeZ
02:22:43FromDiscord<ElegantBeef> Yall people need jesus
02:22:44FromDiscord<Rika> whats the error?
02:22:51FromDiscord<Rika> ikr beef
02:22:57FromDiscord<Rika> this hurts but ill try helping anyway
02:23:09FromDiscord<Rika> even if it takes significantly longer for me to understand this code
02:23:19FromDiscord<ElegantBeef> this is nim we have ufcs do `rule.replace(x).replace(y).split(z)` 😄
02:23:55FromDiscord<Rika> so whats the error j-james
02:24:03FromDiscord<j-james> there's no error on that last block
02:24:17FromDiscord<j-james> what i'm trying to do is convert it to use the multiReplace proc
02:24:21FromDiscord<Rika> i mean with the multireplace
02:24:29FromDiscord<Rika> oh
02:24:30FromDiscord<Rika> i see
02:24:33FromDiscord<Rika> im a dumb
02:25:05FromDiscord<j-james> oh, d'oh↵the multiReplace error is `Error: type mismatch: got <string, string, string, string>`
02:25:34FromDiscord<Rika> this is hard to understand
02:25:45FromDiscord<Rika> very very hard to understand, wait please
02:25:48FromDiscord<j-james> i'll rewrite it as beef suggested
02:26:06FromDiscord<ElegantBeef> I mean i'd suggest using strscan personally
02:26:11FromDiscord<ElegantBeef> do you want to see my implementation for that day
02:26:19FromDiscord<ElegantBeef> It's not perfect but it's much more readable imo 😄
02:26:25*vicfred joined #nim
02:26:38FromDiscord<Rika> `rule.split(" contain ")[1].replace(" bags").replace(" bag").replace(".").split(", ")`
02:26:41FromDiscord<Rika> this makes no sense
02:26:51FromDiscord<Rika> replace needs three arguments
02:26:54FromDiscord<Rika> you only give 2
02:26:58FromDiscord<Rika> i am still confused
02:27:02FromDiscord<j-james> i'm removing those elements
02:27:14FromDiscord<Cypheriel> oh no
02:27:17FromDiscord<Cypheriel> is this day 7
02:27:19FromDiscord<j-james> that's the only way i know how 😅
02:27:22FromDiscord<j-james> yup
02:27:23FromDiscord<Rika> yeah so this is what you have to write:
02:27:34FromDiscord<j-james> the rest of my code is better i swear
02:27:38FromDiscord<Rika> `multiReplace(split(rule, " contain ")[1], {" bags", " bag", "."})` -> `multiReplace(split(rule, " contain ")[1], {" bags": "", " bag": "", ".": ""})`
02:28:05FromDiscord<ElegantBeef> My version if you want to see https://media.discordapp.net/attachments/371759389889003532/786056542679728158/SPOILER_unknown.png
02:28:11FromDiscord<Cypheriel> ohh you can split by space and use index to get the meat
02:29:06FromDiscord<j-james> ohhh, that's what the `varargs[(string, string)]` means
02:29:37FromDiscord<ElegantBeef> Yep a replaced by b
02:29:40FromDiscord<shadow.> beef
02:29:47FromDiscord<shadow.> why use scanf when you can use npeg
02:29:48FromDiscord<shadow.> smh
02:29:53FromDiscord<ElegantBeef> Cause i have smol brain
02:29:56FromDiscord<Cypheriel> woah
02:29:58FromDiscord<shadow.> rip
02:29:59FromDiscord<ElegantBeef> scanf go brrrt
02:30:00FromDiscord<shadow.> lemme whip out mine
02:30:16FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/786057092922343445/SPOILER_unknown.png
02:30:33FromDiscord<ElegantBeef> Yep that's ancient greek to me
02:30:36FromDiscord<shadow.> LMAO
02:30:45FromDiscord<shadow.> !repo zevv/npeg
02:30:46disbothttps://github.com/zevv/npeg -- 9npeg: 11PEGs for Nim, another take 15 135⭐ 7🍴
02:30:54FromDiscord<ElegantBeef> I know what npeg is
02:30:56FromDiscord<ElegantBeef> I've read the docs
02:30:59FromDiscord<shadow.> ohh you've read docs
02:31:00FromDiscord<shadow.> nvm then
02:31:21FromDiscord<j-james> `rules <- rule`
02:31:22FromDiscord<j-james> what
02:31:31FromDiscord<Rika> rules is many rule
02:31:35FromDiscord<Rika> thats what it means
02:31:45FromDiscord<shadow.> 0 or more
02:31:54FromDiscord<shadow.> ye
02:32:02FromDiscord<shadow.> i prolly shoulda done + but eh
02:32:07FromDiscord<j-james> that backwards arrow is scary
02:32:12FromDiscord<shadow.> i mean
02:32:14FromDiscord<shadow.> custom operator in a macro
02:32:16FromDiscord<shadow.> lol
02:32:18FromDiscord<Rika> <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <-
02:32:20FromDiscord<Rika> spooky
02:32:22FromDiscord<shadow.> its just used for defining capture groups
02:32:23FromDiscord<shadow.> or somethin
02:32:25FromDiscord<Rika> wooo backwards arrow <- <- <- <-
02:32:30FromDiscord<shadow.> wooo <-<-<-<-
02:32:32FromDiscord<j-james> here's mine: https://play.nim-lang.org/#ix=2Hf1
02:32:43FromDiscord<ElegantBeef> I mean it's less of a custom operator and more of just a segment of zevv's DSL afaik 😄
02:32:45FromDiscord<j-james> recursion ftw
02:32:54FromDiscord<shadow.> thats
02:32:57FromDiscord<shadow.> surprisingly small
02:33:03FromDiscord<ElegantBeef> That's what she said
02:33:08FromDiscord<shadow.> https://play.nim-lang.org/#ix=2Hf2
02:33:10FromDiscord<shadow.> heres mine
02:33:15FromDiscord<shadow.> yeah, sadly you're not wrong beef
02:33:18FromDiscord<shadow.> anyhow
02:33:23FromDiscord<j-james> all thanks to the line 5 monstrosity
02:33:26FromDiscord<shadow.> lmfao yeah
02:33:31FromDiscord<shadow.> if you indented it it'd be like
02:33:35FromDiscord<shadow.> a whole essay of code
02:34:09FromDiscord<Cypheriel> You guys did it so differently than I did
02:34:13FromDiscord<Cypheriel> parsing at least
02:34:46FromDiscord<ElegantBeef> Did you use npeg for day 8 shadow?
02:34:52FromDiscord<shadow.> day 8?
02:34:58FromDiscord<shadow.> gosh no
02:35:01FromDiscord<ElegantBeef> Lol
02:35:06FromDiscord<shadow.> indexing
02:35:11FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hf4
02:35:22FromDiscord<shadow.> and then a case statement
02:35:30FromDiscord<ElegantBeef> god i'm lazy
02:35:31*casaca joined #nim
02:35:49FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/786058489680101376/unknown.png
02:36:49FromDiscord<shadow.> damn
02:36:52FromDiscord<shadow.> lmao
02:37:10FromDiscord<shadow.> all mine r on github
02:37:12FromDiscord<ElegantBeef> it'd be even less code with the `whenScanf`
02:37:17FromDiscord<shadow.> !repo shadowninja55/aoc2020
02:37:19disbotno results 😢
02:37:22FromDiscord<shadow.> what-
02:37:29FromDiscord<ElegantBeef> inb4 it's private
02:37:33FromDiscord<shadow.> wait
02:37:34FromDiscord<shadow.> nope
02:37:37FromDiscord<shadow.> /repo shadowninja55/aoc-2020
02:37:41FromDiscord<shadow.> !repo shadowninja55/aoc-2020
02:37:43disbothttps://github.com/shadowninja55/aoc-2020 -- 9aoc-2020: 11My attempt at Advent of Code 2020 in Nim. 15 1⭐ 0🍴
02:37:45FromDiscord<Cypheriel> What even is `scanf`?
02:37:46FromDiscord<shadow.> there we go
02:37:52FromDiscord<shadow.> parses a string into variables
02:37:54FromDiscord<shadow.> using simple data types
02:37:58FromDiscord<Cypheriel> Ohh, interesting
02:38:04FromDiscord<ElegantBeef> It's a cooler regex really
02:38:05FromDiscord<shadow.> https://nim-lang.org/docs/strscans.html
02:38:06FromDiscord<shadow.> ehh
02:38:11FromDiscord<shadow.> less flexible, better for parsing
02:38:13FromDiscord<shadow.> by rule of them is like
02:38:28FromDiscord<shadow.> (edit) "them" => "thumb"
02:38:34FromDiscord<ElegantBeef> I've used it a shitton for aoc
02:38:39FromDiscord<shadow.> flexible pattern matching - regex↵simple parsing - scanf↵flexible pattern matching and parsing - npeg
02:38:44FromDiscord<shadow.> yeah i used it for day 2
02:38:46FromDiscord<shadow.> the rest i used npeg
02:39:00FromDiscord<shadow.> well ↵day 2 - scanf ↵day 4 - regex ↵day 7 - npeg
02:39:19FromDiscord<ElegantBeef> scanf for all those for me
02:39:22FromDiscord<Cypheriel> Ohh, I see
02:39:34FromDiscord<Cypheriel> How cool
02:39:51FromDiscord<shadow.> npeg is more gamerer
02:40:10FromDiscord<Cypheriel> I stopped using Nim for the AoC solutions because I didn't know enough to translate from Python
02:40:20FromDiscord<shadow.> rip
02:40:26FromDiscord<Cypheriel> Things started getting pretty complicated on day 5
02:40:27FromDiscord<Cypheriel> (edit) "5" => "4"
02:40:51FromDiscord<shadow.> just a big case statement tbh
02:41:16FromDiscord<Cypheriel> yeah idk, I could barely understand in Python, so using Nim would be much harder for me
02:41:20FromDiscord<shadow.> fair
02:41:49FromDiscord<shadow.> idk i found nim easier than py
02:41:51FromDiscord<Cypheriel> I still have yet to do day 8 part two
02:42:09FromDiscord<shadow.> i tried in py, nim, and c++ for day one and tbh i found nim easiest
02:42:18FromDiscord<Cypheriel> It probably is to an extent, honestly. but I still have to learn it
02:42:23FromDiscord<shadow.> fair
02:42:30FromDiscord<shadow.> time to plug doms book
02:42:42FromDiscord<Cypheriel> There's a book?
02:42:51FromDiscord<shadow.> nim in action
02:42:54FromDiscord<Cypheriel> Oh yeah
02:42:58FromDiscord<ElegantBeef> in a nix server there is someone doing them both in Python and Nim, and keeps getting caught up on the type system and not exactly knowing how to navigate it
02:43:06FromDiscord<shadow.> rip
02:43:12FromDiscord<shadow.> wym?
02:43:17FromDiscord<shadow.> its pretty simple
02:43:35FromDiscord<ElegantBeef> I mean their main issue is with sets
02:43:43FromDiscord<shadow.> i mean i only touched nim a month ago and id i understand it well enough to use it as flexibly as python for aoc
02:43:49FromDiscord<shadow.> id say
02:44:02FromDiscord<Cypheriel> Sets were... fun
02:44:05FromDiscord<ElegantBeef> they tried a set for the computer challenge and cause they attempted a set of an int it wasnt working properly
02:44:09FromDiscord<shadow.> what type of sets?
02:44:10FromDiscord<ElegantBeef> Sets are super easy to use and work well
02:44:18FromDiscord<shadow.> is it that hard to `import intsets`
02:44:33FromDiscord<Cypheriel> yeah idk in Python there's really only 2 main types of set
02:44:39FromDiscord<Cypheriel> set() and frozenset()
02:44:41FromDiscord<shadow.> set and frozenset?
02:44:42FromDiscord<shadow.> yeah
02:44:43FromDiscord<Cypheriel> yep
02:45:01FromDiscord<shadow.> iirc py sets r hash sets so slower than int sets (which are bit sets internally?)
02:45:21FromDiscord<shadow.> dont quote me
02:45:28FromDiscord<Cypheriel> I think that sentence alone is enough to explain how it could be a lot more complicated in Nim
02:45:34FromDiscord<shadow.> lmao
02:46:34FromDiscord<shadow.> to store something in a set you need to hash it with a function but since in a sense ordinals (int-based vars) are already hashed they're more efficient
02:46:49FromDiscord<shadow.> since you can just use bitsets
02:46:55FromDiscord<shadow.> idk if i explained that well
02:46:57FromDiscord<Cypheriel> Yeah, all of that flew right over my head
02:47:21FromDiscord<ElegantBeef> You have hashsets which are just look up tables where the key to look it up is the value
02:47:21FromDiscord<shadow.> rip
02:47:34FromDiscord<ElegantBeef> Then you have bitset where you have a bit per each possible value
02:47:43FromDiscord<ElegantBeef> Nim's builtin set is the latter
02:47:54FromDiscord<shadow.> and to make the key you needa run a hash function so thats even more time added on the hash set
02:48:01FromDiscord<Cypheriel> I guess that explains why both dictionaries and sets are denoted with `{}`
02:48:13FromDiscord<shadow.> yeah bc they work internally as hashmaps
02:48:31FromDiscord<shadow.> (id assume)
02:48:37FromDiscord<shadow.> python has some weird abstractions so
02:48:40FromDiscord<shadow.> im not sure
02:49:02FromDiscord<Cypheriel> I'm considering quitting the AoC to give myself the room to learn more stuff
02:49:09FromDiscord<shadow.> hm
02:49:13FromDiscord<Cypheriel> I can't help but feel pressured while it's going on
02:49:28FromDiscord<shadow.> well if you need beginners resources feel free to dm me lol i can send some stuff i used
02:50:01FromDiscord<Cypheriel> Got it
02:52:02FromDiscord<ElegantBeef> Why do you feel pressured?
02:54:17*vicfred_ joined #nim
02:54:21FromDiscord<Rika> because leaderboards
02:54:41FromDiscord<ElegantBeef> The entire leaderboard is about who gets there first, that's the only metric
02:55:02FromDiscord<Rika> is that not pressuring?
02:55:14FromDiscord<ElegantBeef> Not to me
02:56:12FromDiscord<ElegantBeef> They're fun little challenges, that's it to me
02:56:17FromDiscord<shadow.> yeah same
02:56:48FromDiscord<shadow.> i'm just doing it to see what gaps the unrealism of leetcode has left in my problem solving abilities
02:57:09*vicfred quit (Ping timeout: 260 seconds)
03:04:42FromDiscord<Cypheriel> I mean I'd eventually come back to them
03:05:39FromDiscord<speckledlemon> AoC last year was how I learned Nim
03:05:52FromDiscord<Cypheriel> I heard last year was harder than this year
03:06:02FromDiscord<Cypheriel> something about... intcode something something intcode
03:06:24FromDiscord<speckledlemon> I am proud of my Nim Intcode computer
03:06:58FromDiscord<Cypheriel> ngl I haven't even installed Nim on this... uh OS(?) yet
03:17:40FromDiscord<Rika> intcode was ok
03:24:33*vicfred_ quit (Quit: Leaving)
03:31:03*a_chou joined #nim
03:40:31*disruptek throbs.
03:47:35FromDiscord<Quibono> So I pushed changes to a private repo from VSCode, and my real name is on the commit. Anyone know how to fix that in the future?
04:01:58FromDiscord<ElegantBeef> change your git name
04:02:29FromDiscord<j-james> `git config --global user.name "your-name"`
04:02:32FromDiscord<nikki> git config --global user.name
04:02:41FromDiscord<nikki> jinx
04:02:44FromDiscord<ElegantBeef> Or legally change your name
04:02:46FromDiscord<j-james> haha
04:02:53FromDiscord<ElegantBeef> The latter is more comical of a solution
04:02:55FromDiscord<j-james> nikki's command also tells you what your current one is
04:03:35FromDiscord<nikki> implement a breaking change to unicode, then influence github to use it, so that your name is rendered differently
04:03:35FromDiscord<j-james> when run without an argument
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:34*supakeen joined #nim
04:06:42*a_chou quit (Quit: a_chou)
04:10:14FromDiscord<Quibono> lol
04:11:33*spiderstew quit (Ping timeout: 260 seconds)
04:11:58FromDiscord<Cypheriel> So how exactly am I meant to get Nimble on Linux?
04:12:14FromDiscord<Cypheriel> I did the `install.sh` but I uh don't have Nimble
04:12:31FromDiscord<j-james> Is it in your package manager?
04:12:42FromDiscord<Cypheriel> Oh, it might be
04:12:43*spiderstew joined #nim
04:13:18FromDiscord<Cypheriel> Oh yep. `sudo pacman -S nimble`
04:13:46FromDiscord<shadow.> i feel so excluded as a windows kiddy
04:13:58FromDiscord<shadow.> i dont get easy cmd installs 😔
04:14:01FromDiscord<ElegantBeef> Eh dont use your pkg manager
04:14:07FromDiscord<ElegantBeef> use choose nim then add the nimble dir to your path
04:14:14FromDiscord<ElegantBeef> as choosenim tells you
04:14:40FromDiscord<shadow.> what abt gitnim
04:14:46FromDiscord<shadow.> !repo disruptek/gitnim
04:14:47disbothttps://github.com/disruptek/gitnim -- 9gitnim: 11choosenim for choosey nimions 15 6⭐ 0🍴
04:14:47FromDiscord<ElegantBeef> or use gitnim
04:14:50FromDiscord<shadow.> gamer
04:15:06disruptekyou can use gitnim on windows.
04:15:09FromDiscord<j-james> (I'd still recommend pacman)
04:15:45FromDiscord<j-james> Dealing manually with paths is like↵the worst thing ever
04:15:54FromDiscord<ElegantBeef> Why would you use the package manager for nim, so it's a pain in the arse to switch to a different nim version?
04:15:56FromDiscord<shadow.> I CAN USE GITNIM ON KIDDY OS?
04:16:04FromDiscord<shadow.> this is excellent news
04:16:06FromDiscord<ElegantBeef> It's `nano ./.bashrc` and add a single line
04:16:08*waleee-cl quit (Quit: Connection closed for inactivity)
04:16:21disruptekgitnim is designed to be cloned for any os you want.
04:16:31FromDiscord<shadow.> btw disruptek did we ever figure out why the tests failed on 1.0-1.2
04:16:32FromDiscord<Cypheriel> uh
04:16:44FromDiscord<Cypheriel> time to figure out what choosenim is
04:16:49disrupteki didn't look, but you have the code.
04:16:50FromDiscord<shadow.> nim installer
04:16:51FromDiscord<j-james> I have had to switch Nim versions exactly once, and don't expect to do it again
04:17:00FromDiscord<shadow.> !repo pmunch/choosenim
04:17:01disbotno results 😢
04:17:04FromDiscord<ElegantBeef> it's dom
04:17:09FromDiscord<shadow.> ohh
04:17:11FromDiscord<j-james> and even then it was just `sudo pacman -U oldnimpackage`
04:17:13FromDiscord<shadow.> right
04:17:28FromDiscord<ElegantBeef> whatabout new versions or devel commits?
04:17:29FromDiscord<shadow.> !repo dom96/choosenim
04:17:29disbothttps://github.com/dom96/choosenim -- 9choosenim: 11Tool for easily installing and managing multiple versions of the Nim programming language. 15 300⭐ 38🍴
04:17:35FromDiscord<shadow.> there we go
04:17:39FromDiscord<ElegantBeef> Choosenim lets you change to any version of nim and even build from head
04:17:54FromDiscord<ElegantBeef> gitnim is probably equally as smart but just uses git instead of ssl 😄
04:18:27disruptekno, gitnim is much simpler. that's the point.
04:18:30FromDiscord<j-james> `sudo pakku -S nim-git`
04:18:35FromDiscord<Cypheriel> uh I don't see the reason to need anything but the latest stable, though
04:18:45FromDiscord<Cypheriel> well... not yet
04:18:47disruptek~gitnim
04:18:48disbotgitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek
04:19:09FromDiscord<ElegantBeef> bugs/packages that rely on older nim 😄
04:19:17FromDiscord<shadow.> haha yeah
04:19:30disrupteki'm about to stop supporting earlier nims and just live at head.
04:19:44FromDiscord<shadow.> disruptek: i tried useVersion:1.0 and it worked fine but ig ill try installing 1.0 and see the issue
04:19:51disruptekokay.
04:20:02FromDiscord<shadow.> yeah fuck it, screw old nimions just merge expect lol
04:20:12FromDiscord<shadow.> jk
04:20:59FromDiscord<Cypheriel> what on Earth are nimions
04:21:27FromDiscord<shadow.> programmers with brains
04:21:56FromDiscord<shadow.> in contrast to say the white boomers of c#↵- elegantbeef
04:22:55FromDiscord<ElegantBeef> why am i a boomer?
04:23:38FromDiscord<shadow.> no werent you the one who said c# was white boomers
04:23:43FromDiscord<shadow.> i was quoting you
04:23:51FromDiscord<shadow.> not calling you a boomer
04:23:58*narimiran joined #nim
04:24:21FromDiscord<shadow.> im convinced java programmers are just professional typists who need an excuse to type entire essays of meaningless words
04:25:57FromDiscord<j-james> what, you don't like typing `public static void main(String[] args) {}` every time you want to run a quick scrap of code?
04:26:02FromDiscord<Cypheriel> "Wait, if Go has Gophers, and Python has Pythonistas, Rust has Rustaceans and C# has White Boomers" - Esbeesy
04:26:53FromDiscord<shadow.> ahh esbeesy not beef my bad
04:27:38FromDiscord<shadow.> i dont mind needing a class and a main function, what i mind is ThisCouldActuallyBeAValidSTLClassName
04:28:39FromDiscord<Cypheriel> Well. I tried getting choosenim
04:28:48FromDiscord<Cypheriel> I don't understand what the heck I've done but I don't think it worked
04:28:52FromDiscord<Quibono> lol
04:28:57FromDiscord<Quibono> I'm laughing with you
04:28:57FromDiscord<shadow.> gitnim is sexier
04:29:04FromDiscord<shadow.> sexier approach is better
04:29:08FromDiscord<Quibono> nimble is the og sexy
04:29:13FromDiscord<shadow.> therefore gitnim is the way
04:29:17FromDiscord<shadow.> no, nimph
04:29:17FromDiscord<j-james> `sudo pacman -S nim` will always be there for you
04:29:30FromDiscord<shadow.> nimph is sexier
04:30:03FromDiscord<shadow.> idk why i plug disruptek repos so much but they are pretty useful
04:30:42FromDiscord<Cypheriel> uh
04:30:46FromDiscord<Cypheriel> What've I done
04:30:50FromDiscord<ElegantBeef> Yea shadow i knew something was up cause i'd never say that
04:33:37FromDiscord<shadow.> yeah it was esbeesy whoops
04:34:31FromDiscord<Cypheriel> Why do I feel like learning Linux is harder than learning any programming language
04:34:33FromDiscord<Cypheriel> My brain hurts
04:35:32FromDiscord<Cypheriel> Never mind! I did something
04:35:39FromDiscord<shadow.> there we go
04:35:50FromDiscord<Cypheriel> apparently adding the export thing to `~/.profile` wasn't enough
04:35:58FromDiscord<Cypheriel> I had to add it to `~/.bashrc`
04:36:13FromDiscord<j-james> `~/.profile` should be enough, you'd just need to reboot
04:36:14FromDiscord<shadow.> at least you're not on windows where you need a windows search, 4 popup layers, and gui just to edit path
04:36:24FromDiscord<Cypheriel> Oh, that would make a lot of sense
04:36:37FromDiscord<Cypheriel> Welp time to remove it from `~/.bashrc`
04:36:49FromDiscord<j-james> or type `source ~/.profile` into each terminal instance
04:37:58FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HfH
04:38:42FromDiscord<shadow.> (edit) "https://play.nim-lang.org/#ix=2HfH" => "https://play.nim-lang.org/#ix=2HfJ"
04:39:53FromDiscord<Cypheriel> Technically, yeah
04:41:23FromDiscord<Rebel> you can just use powershell to edit path lol
04:41:39FromDiscord<shadow.> smart
04:44:50*cypheriel_ joined #nim
04:48:33*cypheriel_ left #nim (#nim)
04:49:20FromDiscord<ElegantBeef> Make it the `winblows` nim package
05:02:25*thomasross quit (Ping timeout: 240 seconds)
05:25:26*habamax joined #nim
05:27:33*fowl quit (Ping timeout: 272 seconds)
05:28:14*kwilczynski quit (Ping timeout: 264 seconds)
05:28:52*fowl joined #nim
05:29:18*kwilczynski joined #nim
05:46:44FromDiscord<mikabozu> Hiya, all. Just finished AoC Day 9
05:47:01FromDiscord<mikabozu> Glad that 8 & 9 weren't so bad after the nightmare that was day 7
05:47:14FromDiscord<mikabozu> Took me 3.5 hours >.>
05:48:27FromDiscord<ElegantBeef> Grats, 3.5 hours for all three?
05:48:58FromDiscord<mikabozu> Just for 7 😦
05:49:03FromDiscord<ElegantBeef> Oh
05:49:37FromDiscord<mikabozu> Others were like 20 min.. but I guess I'm missing some cs knowledge that I needed for that day
05:50:00FromDiscord<ElegantBeef> Yea 7 was a bit of work, took me the longest i think
05:50:06FromDiscord<ElegantBeef> Have you looked at other solutions?
05:50:17FromDiscord<mikabozu> Not yet. Any recommendations?
05:50:23FromDiscord<mikabozu> Did zevv use npeg
05:50:27FromDiscord<ElegantBeef> Yea
05:50:40FromDiscord<ElegantBeef> Well here is mine if you want to read it https://play.nim-lang.org/#ix=2Hg1
05:50:51FromDiscord<mikabozu> Thanks! Will do
05:54:01FromDiscord<j-james> Day 7 was a pain, yeah
05:54:11FromDiscord<j-james> This is what my cleaned-up solution looked like: https://play.nim-lang.org/#ix=2Hf1
05:55:58FromDiscord<j-james> (also, today's: https://play.nim-lang.org/#ix=2Hg4)
05:56:45ForumUpdaterBotNew thread by Jiyinyiyong: Any way to extra version info from <project>.nimble file?, see https://forum.nim-lang.org/t/7231
05:57:04FromDiscord<bark> what do you folks recommend for making an android app in nim?
05:57:48FromDiscord<bark> (I j hate the android sdk, it doesn't have to be close to it. I really would use SDL rather than the SDK if I have to)
05:58:16FromDiscord<bark> (edit) "to)" => "any choice)"
05:58:31FromDiscord<ElegantBeef> Well you could try nimx or fidget, they both can publish to mobile afaik
05:58:37FromDiscord<ElegantBeef> although fidgets api is going to change soon
06:00:08FromDiscord<bark> what about accessing OS specific components?
06:00:39FromDiscord<bark> like setting an alarm? (that wakes up the app from sleep, if possible even from a phone turned off)
06:00:46FromDiscord<bark> or pushing notifications
06:00:58FromDiscord<ElegantBeef> You'll have to use java and the like to glue together
06:02:59FromDiscord<bark> I see
06:08:15FromDiscord<bark> oh I found android JS, where you can electron android apps
06:08:35FromDiscord<bark> I could do the noob developer move 🤔
06:37:48FromDiscord<Rebel> Kotlin is also an option
06:54:39FromDiscord<Idefau> cant you use ndk for OS specific stuff too?
06:57:23*kungtotte quit (Read error: Connection reset by peer)
07:00:15*kungtotte joined #nim
07:37:15*PMunch joined #nim
07:47:39FromGitter<offbeat-stuff> Hi
07:47:48FromGitter<offbeat-stuff> How to throw errors in nim
07:48:15mipri!eval raise newException(ValueError, "example")
07:48:16NimBot/usercode/in.nim(1) in↵Error: unhandled exception: example [ValueError]
08:04:59FromDiscord<bark> thatt still means java code
08:05:08FromDiscord<Idefau> a
08:08:57*JustASlacker quit (Remote host closed the connection)
08:17:34*Tanger quit (Remote host closed the connection)
08:22:03FromDiscord<lqdev> b
08:22:10*PMunch quit (Ping timeout: 260 seconds)
08:22:29*PMunch joined #nim
08:26:31FromDiscord<ache of head> c
08:29:37*Vladar joined #nim
08:30:46FromDiscord<j-james> d
08:30:57PMunche
08:37:20FromGitter<sealmove> f
08:37:40*mbomba joined #nim
08:42:08FromDiscord<Rika> g
08:42:25narimiranh
08:45:08FromDiscord<ElegantBeef> i
08:50:20FromDiscord<Vindaar> j
08:54:54Clonkk[m]k
08:55:28FromDiscord<haxscramper> l
09:21:38FromDiscord<kenran> sent a long message, see http://ix.io/2HgP
09:22:30FromDiscord<ElegantBeef> Is there a way in the stdlib to iterate a slice of an openArray without making a new one?
09:24:16FromDiscord<ElegantBeef> I'm not expert in threading, but just follow the threading manual. https://nim-lang.org/docs/threads.html I suppose channels would be the best for that thread communication but i could be wrong
09:26:58FromDiscord<ElegantBeef> Something like this is my question https://play.nim-lang.org/#ix=2HgT
09:32:14*audiofile joined #nim
09:32:23FromDiscord<hugogranstrom> @ElegantBeef are you also on the openarray track for todays AoC?
09:32:42FromDiscord<ElegantBeef> I'm done, but toying around optimizing it made me think about that
09:32:53FromDiscord<lqdev> @kenran there's also an easier API you can use for threading https://nim-lang.org/docs/threadpool.html
09:32:56narimiranhehe, i'm also using OA today
09:33:13FromDiscord<hugogranstrom> Experimental gang B)
09:33:25narimirandoesn't `for x in xs.toOpenArray(lo, hi):` work for you?
09:33:40FromDiscord<hugogranstrom> Isn't the overhead in creating a new openArray quite small?
09:34:06*PMunch quit (Ping timeout: 256 seconds)
09:34:15narimirani have a version with OAs without the need for experimental flag
09:34:16FromDiscord<ElegantBeef> I was doing normal `data[low..high]`
09:34:30FromDiscord<ElegantBeef> with a seq and not an openarray
09:34:32audiofilehi is orc > arc
09:34:48FromDiscord<lqdev> depends
09:35:48FromDiscord<ElegantBeef> Like with `seq[slice]` it returns a new seq, which i was attempting to avoid
09:35:56narimiranaudiofile: yes, 'o' > 'a'
09:35:56FromDiscord<hugogranstrom> oh so that's possible as well 😮
09:37:21FromDiscord<ElegantBeef> would `toOpenArray` work as a replacement for my example?
09:37:36narimiranit works in my code :)
09:37:38FromDiscord<hugogranstrom> I think so
09:38:26FromDiscord<hugogranstrom> Oh so if I don't assign my openArray to an lvalue I don't need the experimental flag?
09:38:48narimiranyep
09:39:06FromDiscord<ElegantBeef> Ah it does work as a replacement in my example, but it's very unclear to why it's being used 😄
09:39:32narimiranmy today's motto: if it is ugly but it works.......
09:39:34FromDiscord<ElegantBeef> the name `toOpenArray` is weird
09:39:40FromDiscord<ElegantBeef> Well i mean just in general
09:39:54FromDiscord<hugogranstrom> I see, that's pretty neat. Think I'll keep my experimental version though hehe
09:40:00FromDiscord<hugogranstrom> haha
09:40:07FromDiscord<ElegantBeef> I honestly feel like `items` should take a `Hslice` but yea good luck getting that accepted
09:40:38*PMunch joined #nim
09:40:46FromDiscord<hugogranstrom> Or some way to take a `lent` slice of an seq
09:41:00FromDiscord<ElegantBeef> well i mean `items(slice)` seems fairly straightforward what it's dooing
09:41:02PMunchI'm still waiting with my AoC so I can stream it later :)
09:41:10*hmmmmm joined #nim
09:41:12*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:41:16PMunchIt's kinda torture :P
09:41:18hmmmmmg'day fellas
09:41:24PMunchHi hmmmmm
09:41:29hmmmmmexplain this to me: pls https://play.nim-lang.org/#ix=2Hh6
09:41:31FromDiscord<Rika> good day hm+
09:41:32hmmmmmhi munchie!
09:41:43FromDiscord<ElegantBeef> That hmm has more Ms it's an imposter
09:41:53narimiranhmmmmm: floating points are not exact
09:41:53FromDiscord<ElegantBeef> That's aurl 😄
09:42:00FromDiscord<lqdev> damn this makes me want a `slice` iterator in stdlib https://play.nim-lang.org/#ix=2Hh7
09:42:05FromDiscord<ElegantBeef> floating point impercision
09:42:10narimiranhmmmmm: you know that `0.1 + 0.2 != 0.3`, right?
09:42:12PMunchhmmmmm, that's just how floating point numbers work
09:42:24FromDiscord<ElegantBeef> @lqdev glad it's not me
09:42:24hmmmmm:0
09:42:27FromDiscord<ElegantBeef> (edit) "@lqdev glad it's not ... me" added "just"
09:42:51PMunchnarimiran, isn't that only for single precision?
09:43:01FromDiscord<Rika> any sort of binary representation of all fractional values are imprecise in some range of value i believe
09:43:06FromDiscord<ElegantBeef> @lqdev https://play.nim-lang.org/#ix=2Hh8 use mine and make a PR to get shot down 😛
09:43:29FromDiscord<ElegantBeef> I guess it should be a Slice instead
09:43:38PMunch@sealmove, are you around?
09:43:54FromDiscord<sealmove> @PMunch yeah
09:43:56FromDiscord<Rika> they are not around, theyre sealmove duh
09:44:00FromDiscord<Rika> cant u read smh smh
09:44:10FromDiscord<ElegantBeef> I do really think there should be a more clear non allocating slice iterator for all types
09:44:29FromDiscord<lqdev> yeah
09:44:33PMunch@sealmove, I'm looking at your new stuff for binaryparse, and I like what I see
09:44:36FromDiscord<lqdev> like a{1..2} that could be used :p
09:44:56FromDiscord<ElegantBeef> I did kinda want `^[]` but yea
09:44:58PMunchBut I was thinking, would it be able to make this more plug-able/extendable?
09:44:58FromDiscord<sealmove> @PMunch this makes me happy 🙂
09:45:04FromDiscord<ElegantBeef> the `^` is a point, so it makes sense 😛
09:45:17FromDiscord<lqdev> well you can do that
09:45:43FromDiscord<ElegantBeef> You sure?
09:45:45FromDiscord<sealmove> well I am open to ideas, do you have something other way in mind?
09:46:03PMunchI mean the original binaryparse can parse any binary format as it allows you to mix in custom parsers
09:46:20PMunchSo all this is really just adding convenience for certain kinds of things
09:46:29FromDiscord<sealmove> but if everything has to be custom then it doesn
09:46:35FromDiscord<sealmove> t serve its purpose well
09:46:38PMunchTrue
09:46:47PMunchBut typically you end up in a mix
09:47:16FromDiscord<sealmove> with my features making the tuple by hand will be extremely rare
09:47:17FromDiscord<lqdev> @ElegantBeef https://play.nim-lang.org/#ix=2Hhb
09:47:30FromDiscord<ElegantBeef> Ah
09:47:36PMunchFor example your Option type parsing could easily be implemented with a small shim custom parser that returns either none(<type>) or calls a parser and returns some(value)
09:48:09narimiran@lqdev we're talking about slices of openArray
09:48:14PMunchSome for the looping thing, that can easily be done by calling a custom parser that just loops another parser
09:48:15FromDiscord<ElegantBeef> I mean i wasnt
09:48:22FromDiscord<ElegantBeef> I was talking about slices of arrays/sequences
09:48:28FromDiscord<ElegantBeef> Non allocating ones
09:48:32narimiransomething less verbose than `for x in xs.toOpenArray(lo, hi):`
09:48:38FromDiscord<ElegantBeef> yea
09:48:43narimiranwhere `xs` is already an openArray
09:48:50PMunchSo I was thinking, what if the {} syntax was simply a way to hook these small wrapper procedures around that parsing step
09:49:06FromDiscord<ElegantBeef> Again in my case xs is a seq, or an array
09:49:22narimiranOA covers those too ;)
09:49:52FromDiscord<sealmove> PMunch, that's essentially what is happening, but to wrap _fields_ instead of parsers, it has to be in the codegen
09:50:18PMunchWell it doesn't *have* to be
09:50:47PMunchI mean the generator could just generate a sub-parser and wrap it
09:51:08FromDiscord<ElegantBeef> AH i see the issue, didnt notice lqdev left out the openarray 😄
09:51:32FromDiscord<ElegantBeef> is the `slice` iterator too unclear? 😄
09:51:57PMunchThat way people could also write their own
09:51:59FromDiscord<sealmove> indeed. your idea could work but I doubt it would be easier to implement. also the main repo will need support for the {} syntax anyway
09:52:13hmmmmmok and how about this now
09:52:14hmmmmmhttps://play.nim-lang.org/#ix=2Hhe
09:52:14PMunchOh yeah, it won't be easier to implement :P
09:52:46FromDiscord<ElegantBeef> Again
09:52:47FromDiscord<ElegantBeef> Floats
09:52:54hmmmmmb-b-but
09:52:55hmmmmmround!
09:53:01FromDiscord<ElegantBeef> but floats
09:53:04hmmmmm:|
09:53:20FromDiscord<ElegantBeef> If you want a value to be exact use an int
09:53:31FromDiscord<ElegantBeef> floats are a bastardized version of base 10 slid into base 2 😄
09:53:48FromDiscord<sealmove> what are the real benefits of the approach?
09:53:57PMunchhmmmmm, https://docs.python.org/3/tutorial/floatingpoint.html
09:54:17FromDiscord<ElegantBeef> Look at it this way for 32bits 0-4294967296 is all the possible values of ints, but floats say you can have -inf to inf
09:54:38FromDiscord<ElegantBeef> You're going to lose accuracy across that range
09:55:22FromDiscord<sealmove> I mean, let's say we do implement it as you propose. What's the difference?
09:55:51PMunchsealmove, well the extensions you have now aren't universally needed (I for one have never needed any of them for the binary formats I have parsed with binaryparse). And by making them plugable we allow the user to write their own extensions without having to contribute to binaryparse
09:56:04FromDiscord<lqdev> @sealmove you can now have a decimal point
09:56:15FromDiscord<lqdev> oh you were talking to pmunch
09:56:22PMunchHaha
09:56:32FromDiscord<lqdev> i thought you were arguing with beef XD
09:56:52hmmmmmok then, explain this: https://www.online-python.com/H1IsNhTR5q
09:56:56hmmmmm:|
09:57:05FromDiscord<ElegantBeef> Python uses different floats
09:57:17FromDiscord<Rika> python still uses imprecise floats
09:57:21FromDiscord<Rika> they just hide it from you
09:57:33FromDiscord<Rika> at least thats what i recall what python does
09:57:38hmmmmmhmmm
09:57:43FromDiscord<sealmove> oh, so you say use will somehow be able to define option keys
09:57:45hmmmmmI want the python version :|
09:57:48FromDiscord<hugogranstrom> Beef has a beef with everyone (I'll find my way to the door myself (: )
09:57:49FromDiscord<sealmove> hmm this is interesting
09:58:03FromDiscord<Rika> it isnt going to change anything other than how its shown to you
09:58:11FromDiscord<Rika> errors will still accumulate
09:58:11FromDiscord<lqdev> hmmmmm: https://github.com/JohnAD/decimal128
09:58:42FromDiscord<Rika> i have to go, the shop im visiting is about to close
09:58:45FromDiscord<ElegantBeef> !eval import strformat; echo fmt"{70.43:2}"
09:58:47hmmmmmoh lqdev that seems interesting
09:58:49NimBot70.43
09:58:56FromDiscord<ElegantBeef> There you go bub 😄
09:59:11hmmmmmbeefy what is that sorcery :o
09:59:21FromDiscord<ElegantBeef> strformat let's you cutoff decimals
09:59:27hmmmmm:O
09:59:31FromDiscord<Rika> !eval import strformat; echo &"{0.1+0.2:2}"
09:59:34NimBot0.3
09:59:42FromDiscord<Rika> !eval echo 0.1+0.2
09:59:43hmmmmm:O
09:59:45NimBot0.3
09:59:45FromDiscord<ElegantBeef> Huzah we hid the following 0s
09:59:53FromDiscord<Rika> well its still hidden here
09:59:54FromDiscord<ElegantBeef> !eval echo 70.43
09:59:56NimBot70.43000000000001
09:59:59FromDiscord<ElegantBeef> Nope
10:00:10FromDiscord<Rika> do we hide subnormal errors?
10:00:24FromDiscord<Rika> i really gtg lmao
10:00:54FromDiscord<ElegantBeef> Buh bye
10:01:14FromDiscord<ElegantBeef> So where would be the best place for those slice iterators?
10:01:44FromDiscord<ElegantBeef> Cause i'm looking at the `iterators` module, but i know that the system stuff is typically off limits 😄
10:02:35FromDiscord<kenran> oh, when and where are you streaming if I may ask?
10:03:08FromDiscord<ElegantBeef> Pmunch ^
10:03:17FromDiscord<ElegantBeef> ~~Discord replies dont do anything for those distant folks~~
10:03:34PMunch@kenran, as soon as I'm done at work pretty much
10:03:44PMunchSo 3:15PM UTC
10:04:04FromDiscord<ElegantBeef> But it's 3am here 😛
10:04:18FromDiscord<kenran> ah dang, too early for me then. are they being recorded?
10:04:31FromDiscord<kenran> and where is it, twitch?
10:04:35FromDiscord<sealmove> @PMunch Hmm, how could we implement this? We need an API for allowing user to define wrappers in a generic way (not bound to any particular parser)
10:04:48supakeendecorators?
10:05:04FromDiscord<ElegantBeef> Nah they're too expensive for my tastes
10:06:14PMunch@kenran, Twitch and YouTube, and they are recorded on YouTube
10:06:25PMunchSo far I've only streamed 6 and 8 though
10:06:40PMunchBut I think I'll try to stream all the coming ones
10:07:05PMunch@sealmove, yeah, something similar to how custom parsers are
10:08:35PMunchI guess it could be very similar to how the current custom parsers work, but you need to get a procedure to call to parse that exact field
10:09:03PMunchAnd some way to make sure that the sub-byte positions and such are updated properly in the main parser
10:09:22FromDiscord<Cypheriel> Is there any reason to use MS VSCode over VSCodium for Nim? I know the pacman `code` doesn't have the Nim extension for some reason
10:10:18FromDiscord<Cypheriel> ah nvm. VSCodium doesn't either
10:10:27FromDiscord<ElegantBeef> They use an open source registry now
10:10:29PMunchHmm, that's weird
10:10:33PMunchAh
10:10:41PMunchSo the Nim plug-in should be put in that registry as well?
10:10:46FromDiscord<ElegantBeef> Yea
10:10:53FromDiscord<sealmove> ok noted, I'll try to do it, although I am a bit scared :3 sounds hard
10:10:57FromDiscord<Cypheriel> There's one there, but it's not the "official" one
10:11:03FromDiscord<Cypheriel> Should I just use that?
10:11:08FromDiscord<ElegantBeef> What is it?
10:11:10PMunch@sealmove, good things usually are hard
10:11:18PMunchErr, that came out wrong...
10:11:19FromDiscord<Cypheriel> Um it looks like the exact same thing but it's a different author
10:12:06FromDiscord<ElegantBeef> https://open-vsx.org/
10:12:13FromDiscord<ElegantBeef> There's the opensource code registry now
10:12:39FromDiscord<Cypheriel> https://i.imgur.com/r6DhijP.png
10:13:10FromDiscord<ElegantBeef> Yea it's probably just a reupload by someone
10:13:17FromDiscord<Cypheriel> Funnily enough this one has had updates as late as november
10:13:41FromDiscord<Cypheriel> https://i.imgur.com/eHKkSHl.png
10:14:08FromDiscord<ElegantBeef> Can always get the nimlsp powered one from here https://marketplace.visualstudio.com/items?itemName=bung87.nim
10:14:33FromDiscord<Cypheriel> except I would assume that means I have to use the MS branded VSCode
10:14:37FromDiscord<ElegantBeef> Nope
10:14:46FromDiscord<ElegantBeef> Oh i meant to link the git
10:14:59FromDiscord<Cypheriel> Oh, lol
10:15:23FromDiscord<ElegantBeef> It's on that page, if you want to build it, but the one you got is probably fine
10:16:30FromDiscord<Cypheriel> No clue, it may or may not even end up being better than the current one
10:16:38FromDiscord<Cypheriel> considering that one hasn't been updated since March
10:17:37PMunch!eval proc ᚛ᚅᚔᚋ᚜= echo "᚛ᚅᚔᚋ᚜"; ᚛ᚅᚔᚋ᚜()
10:17:40NimBot<no output>
10:18:10FromDiscord<Cypheriel> oh my
10:23:14*Vladar quit (Quit: Leaving)
10:25:38FromDiscord<kenran> ah, that looks promising as well, but the `channels` module says it's not fit to be used with `spawn` yet I think
10:25:53FromDiscord<lqdev> i'm not sure why though
10:26:09FromDiscord<lqdev> i guess the only reason is that it's not tested very well
10:28:00FromDiscord<kenran> I'm not sure that I want to use channels for sharing data between the threads anyway, but as you can see I know next to nothing wrt concurrency/parallelism in low-level languages 😄
10:28:18FromDiscord<j-james> @Cypheriel ohh it's a different registry
10:28:39FromDiscord<j-james> i have literally been wondering for months where all my extensions went in the sidebar
10:28:44FromDiscord<kenran> I could probably do it with channels first and see how that goes, then try using a mutable var and a lock perhaps and compare those methods?
10:28:51FromDiscord<j-james> that makes so much SENSE
10:29:16FromDiscord<kenran> I'm a bit irritated because channels deep-copy the objects that are sent, and I'd probably send the whole state of the application.
10:29:18FromDiscord<Cypheriel> Haha at first I thought maybe it was because I was on Linux but then I remembered that other people here use Linux too
10:30:19FromDiscord<sealmove> @PMunch for now I will focus on implementing core features and parse the `{option: value}` syntax into a `Table[string, NimNode]` and do nothing with it. Then we can think about the API you proposed. Would you merge the changes after core features are implemented?
10:30:35FromDiscord<sealmove> I will update the documentation to explain the plugin idea
10:31:13PMunchWhat core features are you thinking about?
10:34:16*Cthalupa quit (Ping timeout: 240 seconds)
10:35:56*Cthalupa joined #nim
10:36:49FromDiscord<sealmove> Everything that's not in {Options}. first part (Type) is unchanged but I want some changes in the last part - sequences and assertion
10:38:20FromDiscord<sealmove> Other than specific number of repetition, I want to allow terminating sequence by arbitrary condition. Also assertions should allow for testing against a Nim expression, not just ints and strings
10:40:13FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2Hhw
10:41:46FromDiscord<sealmove> Do you like this?
10:47:38PMunchYeah that's fine
10:48:07PMunchOr, hmm
10:48:27PMunchThat could also be implemented as a custom wrapper over a parser..
10:49:20FromDiscord<sealmove> it's not that easy in this case, because the syntax is more firm. Options will be key-value pairs and user will be able to define the keys.
10:49:52PMunchOh for sure
10:49:58FromDiscord<sealmove> sure we could implement repetition as plugins, this is how kaitai does it
10:50:19FromDiscord<sealmove> for example `{repeat: until, repeat-expr: stream.atEnd}`
10:50:33PMunchI was just saying that the repetition stuff is something that can be written as a custom parser. Which you probably want to do if you have some complex logic there anyways
10:50:36FromDiscord<sealmove> do you prefer this (I think I don't)
10:51:52PMunchOh no, I definitely don't prefer that
10:52:28FromDiscord<sealmove> cool, then it has to be in core features :ρ
10:56:35*abm joined #nim
10:57:08FromDiscord<Cypheriel> ah, yes. How have I not heard of format strings earlier? This is great
10:58:10FromDiscord<sealmove> Btw @PMunch I don't know how to do this thing with doc generation. Would you mind doing it yourself (or not at all) after we merge the PR?
10:58:55PMunchdoc generation?
10:59:28FromDiscord<sealmove> this thing with `nim doc2 binaryparse.nim` and nimtorst
10:59:31PMunchOh, to generate the README from the source file?
10:59:37FromDiscord<sealmove> yup
10:59:45PMunchAh, it's not actually using the output of that
10:59:52PMunchThe nimtorst script is all you need
11:00:00PMunchJust run that and it should update the README
11:00:33narimiran@ElegantBeef, @hugogranstrom now i have a version without any `toOpenArray`. and it is twice as fast as before :D :D
11:00:47PMunchIt's basically some silly sed logic that pulls out all lines that starts with unindented ##
11:01:01FromDiscord<sealmove> will markdown work?
11:01:59PMunchUhm, no?
11:02:57FromDiscord<hugogranstrom> narimiran: wow, what did you change it to? :o
11:03:13FromDiscord<sealmove> ok so I have to convert my README.md to rst and then add it at the top of binaryparse.nim and add `##`s
11:03:52PMunchPretty much
11:04:21narimiran@hugograntrom i changed my logic a bit (in several places), but now everything is `for i in lo..hi:` and then use `mySeq[i]`
11:04:49narimiranbut i think the main speedup is *not* from removing toOpenArray
11:05:07supakeenHow do I get 'around' a "is not GC-safe": https://bpa.st/raw/DY3Q
11:05:17narimirani was creating some unnecessary stuff in my original version
11:05:25supakeenI am wanting to wait on a few Redis keys with the blocking pop in threads.
11:05:31*Vladar joined #nim
11:05:36FromDiscord<haxscramper> You can use `## .. include:: <otherfile>.rst` to avoid pasting whole thing as comment
11:06:36FromDiscord<sealmove> wha...
11:07:08PMunchEeeh
11:07:10PMunchNot for this
11:07:17PMunchIt doesn't actually hook into Nims tooling...
11:07:21PMunchUnfortunately
11:07:24FromDiscord<haxscramper> It does
11:07:41PMunchDoes GitHub support that?
11:08:18FromDiscord<haxscramper> What kind of support we are talking about?
11:08:58supakeenOr is the `nim-lang/redis` package not a working option if I want to use `redis` in threads.
11:10:10FromDiscord<haxscramper> https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/pegs.nim#L15 nim stdlib uses this for some modules too
11:10:53PMunchYes, but this doesn't use the Nim doc parsing/rendering
11:11:15PMunchIt just rips the module doc comment out into an rst file and lets GitHub display it
11:14:46FromDiscord<haxscramper> Well, I don't really understand what exactly do you mean by that, but my point was only about ability to just write regular rst file and include it in documentation, without need to prefix everything with `##` (or wrap in `##[ ]##`)
11:15:32FromDiscord<haxscramper> And then edit said file like normal rst, with all syntax highlighting of proper rst
11:15:42PMunchYes, and I was saying that since this isn't the Nims rst tooling that might not be supported..
11:16:15PMunchI guess the binaryparse.nim file could `.. include:: README.rst` though
11:19:34FromDiscord<hugogranstrom> narimiran: oh that's a pretty obvious way to do it now that you say it
11:19:41narimiran:)
11:20:00supakeenMrm.
11:20:59FromDiscord<hugogranstrom> Would be interesting to see what difference toOpenArray does on its own as well.
11:21:21FromDiscord<hugogranstrom> Will see if I can test it on my version later today
11:22:44supakeenNope, I thought I found it but I just wasn't familiar with multisync.
11:22:58FromDiscord<hugogranstrom> I did check my current version excluding the loading of the file and parsing the numbers and it was sub 0.1ms with -d:danger so perhaps it won't be noticable at all
11:24:29supakeenIn this proc: https://bpa.st/7DZQ what makes it not pass gcsafe? :)
11:37:40*mbomba quit (Quit: WeeChat 3.0)
11:42:32FromDiscord<skyhawk172> anyone know how to create a IntSet of values from 0 to 1023? I've tried `[0..1023].toIntSet()` and other variations thereof and keep getting a type mismatch error: `proc toIntSet(x: openArray[int]): IntSet↵ first type mismatch at position: 1↵ required type for x: openArray[int]↵ but expression '[0 .. 1023]' is of type: array[0..0, HSlice[system.int, system.int]]`
11:42:41FromDiscord<skyhawk172> (edit) "a" => "an"
11:44:00FromDiscord<lqdev> `0..1023` constructs a slice
11:44:11FromDiscord<lqdev> so you're creating an array with a single slice inside of it
11:45:17FromDiscord<InventorMatt> it may not be the most efficient way to do it but https://play.nim-lang.org/#ix=2HhX this works
11:47:02FromDiscord<skyhawk172> Thanks @InventorMatt, I was hoping to avoid that but if there's no better way..
11:47:23FromDiscord<skyhawk172> (edit) "that" => "the intermediate sequence"
11:48:22FromDiscord<sealmove> ok @PMunch, I laid out the idea. check the updated README.
11:51:04FromDiscord<InventorMatt> if you want to keep it simple and just 1 line I don't think there is a better way but you could just use a for loop and populate that way which is what toseq does behind the scenes
11:56:01*antranigv quit (Remote host closed the connection)
11:56:09*Perkol joined #nim
11:56:54*antranigv joined #nim
11:57:25narimiran@hugogranstrom how do you measure it without loading and parsing? you time it in your code and execute only once?
11:58:36FromDiscord<hugogranstrom> I load and parse it once in the beginning. Then I ran it in a loop and passed the parsed numbers to the procs
11:59:51FromDiscord<hugogranstrom> var numbers = parseInput()↵timeit:↵ runPart1(numbers)↵ runPart2(numbers)
11:59:56FromDiscord<hugogranstrom> Kinda like this
12:00:27narimiran`timeit` is from some nimble package?
12:03:04narimirani usually run my program 100 times with `perf`. now i removed both parts (only input parsing remains), and compared to my full program. less than 0.1ms difference, just like you
12:03:12FromDiscord<hugogranstrom> Yes, I used my own from Numericalnim but there are surely better ones out there
12:04:21FromDiscord<hugogranstrom> Oh that's also a neat way to do it :) I'm on windows so I don't have any fancy `perf`
12:05:32FromDiscord<hugogranstrom> This one looks promising: https://github.com/xflywind/timeit
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:35*supakeen joined #nim
12:10:25*rockcavera quit (Read error: Connection reset by peer)
12:10:51*rockcavera joined #nim
12:14:22narimiranheh, last time that one was mentioned, somebody was getting some microsecond-number, because (i suppose) the code got optimized out on repetitions
12:15:47narimiran(using `perf`, the same code was in a millisecond-range)
12:17:37ForumUpdaterBotNew thread by LeFF: Windows to Mac OSX cross compiler? , see https://forum.nim-lang.org/t/7232
12:19:12FromDiscord<hugogranstrom> oh that's interesting
12:20:27FromDiscord<hugogranstrom> I think I saw somewhere a `keep()` template but I can't remember where
12:23:39FromDiscord<hugogranstrom> can't find where I saw it now but its purpose was to make sure the variable wasn't optimized away
12:34:35FromDiscord<Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=2Hii
12:36:08Zoom[m]Hm, why doesn't openArray doesn't work for Deques?
12:36:33Zoom[m]How can I implement a function with a view into a deque?
12:36:54Zevvbecause it isnt
12:37:11PMunch@sealmove, what's the deal with n/r?
12:37:30Zoom[m]Zevv: "The underlying implementation uses a seq."
12:37:49Zevvyeah, but it has head and tail pointers chasing each other
12:37:59Zevvso the contents of the underlying seq might be "5 6 . 1 2 3 4"
12:38:10Zevvwhat would you expect from indexing [0] in this case?
12:38:14FromDiscord<sealmove> @PMunch I couldn't come up with better names for bit endianness since `l` and `b` are reserved for _typical_ endianness.
12:38:52ZevvZoom[m]: if you feel brave you could access the dequees 'data' member with a cast
12:38:54Zevvbut then what
12:39:00narimiranZoom[m]: is this for today's AoC?
12:39:01PMunchbit-endianess?
12:39:19Zoom[m]narimiran: Yep. Doing it the dumb way
12:39:26narimiran:X
12:41:04FromDiscord<hugogranstrom> @Vindaar never heard of it before but it seems to seal the deal
12:41:10Zoom[m]Zevv: I just want to look into every item, in no particular order and don't want my function to require copying
12:43:00FromDiscord<hugogranstrom> I did also use a deque for part1 and just looping over it did it for me
12:43:18FromDiscord<sealmove> @PMunch eh we briefly discusses this before. https://github.com/PMunch/binaryparse/pull/8
12:43:19disbotEndian control
12:43:23FromDiscord<hugogranstrom> `int`s get copied either way
12:44:57FromDiscord<sealmove> when fields are not byte-aligned, the extra bits can be parsed in either direction
12:45:01PMunchAh rigt
12:47:07Zoom[m]So, how to get a view into a deque? I think I'll get by with {.inline.} for now, but it's not good.
12:47:30ZevvThe implementation does not expose the seq
12:47:51Zevvso if you really need to you can cast the dequeue to a seq, because I happen to know the seq is the first element of the object type
12:48:54FromDiscord<pietroppeter> https://github.com/treeform/benchy
12:49:42FromDiscord<hugogranstrom> Zoom: why do you need a view into it in the firs place?
12:50:10FromDiscord<hugogranstrom> @pietroppeter that was it! Thanks 🙂
12:52:10FromDiscord<pietroppeter> You are welcome. I have tried also criterion which also does a weird trick to avoid optimizing away stuff. Also there is golden but it is for benchmarking execution and compilation and not for measuring parts of code.
12:52:57Zoom[m]@hugogranstrom Why do you need any view? Visit the contents from a function
12:53:54ZevvI assume he wants to avoid the copies that might happen
12:54:21FromDiscord<hugogranstrom> Doesn't the copy only happen if you modify it?
12:55:01hmmmmmjeebus
12:55:05hmmmmmfloats are hairy
12:55:41hmmmmmstill python makes them somewhat easier to the eye
12:55:58hmmmmmthey hide the 0.000001 unpleasentries and their round() works
12:57:08PMunchOur round also works..
12:57:23FromDiscord<hugogranstrom> @pietroppeter I'll take a look at criterion as well 🙂
12:57:39Zoom[m]That's the thing. Nim compiler is described as smart, but if the situation is simple I'd like to just say "don't copy, we're just visiting" and don't scan the docs/resulting C to understand if the copying has actually taken place or not
12:57:47hmmmmmwell our manual says it's unreliable, also it didn't work for my 70.43 case, while python gobbles it easy peasy
12:58:12PMunchBut it did work for 70.43, Python just hides some stuff from you
12:59:00*planetis[m] joined #nim
12:59:32hmmmmmwell apparently the standard way to handle this stuff is comparing the float to a very small delta, close enough is proxy for equal
12:59:37PMunchAnd IMO the manual there is wrong, it's completely reliable
12:59:38FromDiscord<hugogranstrom> Zoom: I'm perhaps coming at this from a differerent point of view. Do you want to pass the deque to a proc or do you want to return it as a view FROM a proc?
12:59:57PMunchBut it might not give you what you expect, if you don't expect the intricacies of floats
13:00:08FromDiscord<hugogranstrom> If you want to pass it, can't you pass it as a `var` parameter?
13:00:35FromDiscord<hugogranstrom> Even if you don't get the benefit of immutability
13:01:10Zoom[m]@hugogranstrom Yeah, I want to pass it, but var is the complete opposite semantically so it's a no-no
13:01:26planetis[m]Zoom: this is fixed with arc and lent annotation
13:01:56hmmmmmmunchie: https://play.nim-lang.org/#ix=2Hiq
13:02:17FromDiscord<Rika> what is wrong
13:02:20FromDiscord<Rika> i see nothing wrong
13:02:28hmmmmmround should result 70.43 as in python
13:02:32PMunchhmmmmm, yeah that is exactly what I would expect
13:02:37PMunchNo it shouldn't
13:02:41hmmmmm:|
13:02:48PMunchIt rounds a nuber, it doesn't change it's string representation
13:02:51FromDiscord<Rika> python prints it as 70.43 but in mmeory its the same as nim
13:02:54Zoom[m]planetis: I suppose it is, but I haven't used lent one single time yet, I get it's for getters, but I'd like a "lent" for function arguments much more
13:03:03FromDiscord<Rika> use fmt rounding if you want to print it rounded
13:03:04FromDiscord<hugogranstrom> Zoom: Fair enough 🙂 but in a "simple" situation like this it is easy to see that you don't modify it
13:03:58hmmmmmRika yes I used fmt, it worked, but still looks a bit ugly, while python are like 2 lines of code. I don't doubt correctness but I had to spend ugly patchy hacky lines on that stuff :|
13:04:20FromDiscord<Rika> what is ugly about `&"{var:2}"`?
13:04:23PMunchWell the alternative is the language hiding the truth for you
13:04:28PMunchWhich Nim tends not to do
13:04:28FromDiscord<Rika> its just as short as python?
13:04:52FromDiscord<Rika> i do not see anything ugly patchy or hacky in fmt rounding
13:04:53hmmmmmwell I had a seq of that stuff, so I made a function lol :D
13:05:03planetis[m]for parameters the compiler chooses between addr or copy with this formula: `if sizeof(T) > 3*sizeof(int): passbyaddr else: passbyvalue`
13:05:18Zoom[m]@hugogranstrom I suppose I could, but it's a hack and I'm completely against it, so I'd better just inline my function.
13:05:24FromDiscord<Rika> i'd argue python's way is ugly and hacky.
13:05:39FromDiscord<Rika> you'd accumulate errors larger than epsilon without realising
13:05:48hmmmmmthat might be true
13:05:57hmmmmmstill beauty is beauty :D
13:06:11FromDiscord<lqdev> some call perl beautiful
13:06:23FromDiscord<hugogranstrom> Zoom: I skipped the function all together and just wrote everything in the same place. A template then perhaps?
13:06:27FromDiscord<Rika> some call C++ beautiful
13:06:45planetis[m]sealmove: dont want to be showoff-y but: https://github.com/planetis-m/breakout/blob/master/breakout/serialize.nim
13:06:46FromDiscord<lqdev> idk about others but i can never read comprehensions in python
13:06:51FromDiscord<lqdev> they just look so awkward and out of place
13:06:53*planetis[m] dancing_banana.gif
13:06:59FromDiscord<lqdev> and read backwards
13:07:03FromDiscord<lqdev> unlike anything else
13:07:16FromDiscord<Rika> i got used to it after a year or two back when i still used python
13:07:37Zoom[m]planetis: thanks, I vaguely remembered it, just expected openArray to work and think some kind a view could be provided
13:07:40FromDiscord<lqdev> still you read it backwards to figure out what the loop variable is
13:07:55FromDiscord<Rika> i mean yeah its still backwards
13:08:03FromDiscord<lqdev> which just goes against any rules of scoping and reading left-to-right, top-to-bottom
13:08:08FromDiscord<Rika> but you get used to pain after a few hours of it
13:08:08Zoom[m]I probably focus on unimportant things again
13:08:16FromDiscord<lqdev> rika lol
13:10:02planetis[m]i have an idea to build a web-store backend using ecs arch instead of using a database
13:10:10planetis[m]please stop me if it's stupid
13:10:25*narimiran quit (Ping timeout: 264 seconds)
13:10:45FromDiscord<Rika> stupid ideas can be turned into genius with enough iterations
13:11:05FromDiscord<sealmove> @planetis is your area of interest game dev?
13:11:48*narimiran joined #nim
13:11:51planetis[m]well not really, I was experimenting for creating a traffic simulation
13:12:22FromDiscord<sealmove> can't figure out from your repos, you have many different things. do you have a particular area of interest?
13:12:32FromDiscord<sealmove> just curious
13:13:11planetis[m]nope, my father says build me a webstore, i build a webstore
13:13:14planetis[m]im a simpleton
13:13:48FromDiscord<shadow.> brute forcing today's aoc part 2 feels so wrong
13:14:22planetis[m]he has no idea how complex that is, but anyway
13:14:43FromDiscord<sealmove> aha, I guess it's nice not being obsessive and working on whatever is useful at the time 😛
13:15:12FromDiscord<shadow.> there has to be a better way to solve this rahh
13:15:29hmmmmmalso why fmt{number:9.f} stuffs in there a bunch of unneeded whitespace, i just want the juice!
13:15:40narimiran~rtfm
13:15:40disbotrtfm: 11read the fucking manual
13:15:40disbotrtfm: 11https://nim-lang.org/documentation.html -- narimiran
13:15:54hmmmmmboing D:
13:16:03hmmmmmrtfm'd by nari :|
13:16:25planetis[m]sealmove: well i used to, but i got over its
13:16:32supakeenit's ok i've been reading the docs and they document a function as "if you dont know what this is dont use it"
13:16:51FromDiscord<Rika> i really dont understand why you think writing `&"{num:9.f}"` is too much "boilerplate"
13:17:15hmmmmmit's just because I'm a spoiled python kid that didn't have to handle that stuff before lol
13:17:29FromDiscord<Rika> well this is nim
13:17:35hmmmmmik ik
13:17:38FromDiscord<Rika> you didnt have to deal with static typing before
13:18:04hmmmmmwell st is useful, my python stuff approach vertical spaghetti after 200 lines so I find it very useful
13:19:02FromDiscord<Rika> idk man i think its such a minor nitpick
13:19:08FromDiscord<Rika> regards the float printing
13:20:11hmmmmmye I know Rika, I just spent 1 hour on it and it works just the same, didn't expect I had to deal with it because I literally didn't know stuff anything about float representation
13:20:32*Perkol quit (Remote host closed the connection)
13:22:56narimiranhmmmmm: here you go, you lazy bastard: https://play.nim-lang.org#ix=2Hiw
13:23:21narimiran"oh i put 9 in there, and then it uses 9 spaces, stupid nim"
13:23:22hmmmmmhmm what is this alien tech
13:23:30hmmmmmOH
13:23:40hmmmmmI SEE :o
13:23:52FromDiscord<Rika> pff
13:24:50supakeenI'm trying to run nim-lang/redis in threads but am encountering some gcsafe things, what gives: https://bpa.st/raw/DY3Q, the relevant proc it points to is: https://bpa.st/7DZQ
13:28:19FromDiscord<Rika> i believe you have to open a connection per thread
13:29:14FromDiscord<Rika> ah wait
13:31:31FromDiscord<Rika> i dont understand the context
13:31:34FromDiscord<Rika> what is your code?
13:34:00supakeenLet me make a small example that exhibits this behaviour instead of pasting a lot of lines :)
13:37:16supakeenHere's the idiom that causes this: https://bpa.st/4UIQ
13:39:09supakeenI understand what the error means, but I don't know how to solve it and I have a hard time indicating what in the readNext proc actually is shared heap?
13:40:29FromDiscord<shadow.> pmunch: if you're here have you done today's aoc yet
13:40:44FromDiscord<shadow.> im interested to see how people did today's
13:41:12*hmmm joined #nim
13:45:24narimiranhe said he'll stream his solving later
13:48:26PMunchYeah, I haven't looked at it yet
13:48:52PMunchBut I will stream it when I'm done at work (in about 1½ hour)
13:49:05FromDiscord<shadow.> ohh nice nice
13:50:42FromDiscord<shadow.> also i have a question, when done a ton of times which would be faster: running popFirst() and addLast() on a deque or reassigning a seq to a new slice?
13:51:09Zoom[m]Could anyone tale a peek at my yesterday's solution?
13:54:34hmmmmunchie can you do an [educational] day1/day2 aoc for the rest of the nimplebs :> day6 was hurting my brain only to look at it
13:54:51FromDiscord<InventorMatt> supakeen: I don't know if it is safe or not but if you add the {.gcsafe.} pragma to the readnext proc it will no longer give that error
13:55:22PMunchhmmm, as a video?
13:55:26hmmmyay
13:55:32PMunchYou can always check out my solutions here: https://github.com/PMunch/aoc2020
13:55:35FromDiscord<Rika> i read "nimplebs" as "nimple bs"
13:55:41hmmmI've seen your solutions :>
13:55:46PMunchAh okay :P
13:55:49supakeenInventorMatt, yes but nim-lang/redis is not under my control :)
13:56:02supakeenBut perhaps the answer is that that library is the wrong one to use if I want to use threads.
13:57:18FromDiscord<InventorMatt> you can always modify it locally or create an issue on the repo. but other than that maybe a different library may be the answer
13:57:26FromDiscord<Rika> its not exactly safe
13:57:41FromDiscord<Rika> until we determine which proc in readnext is causing the gcsafe issue
13:57:54Zoom[m]narimiran: I look at your D8 and think I overcomplicated mine a bit. Also, expected to deal with loops in the P2 so used CountTable instead of just a set and forgot to replace it later.
13:58:03supakeenRika: how would I go about finding out?
13:58:08narimiranZoom[m]: link to yours?
13:58:16Zoom[m]https://github.com/ZoomRmc/aoc2020_nim/blob/main/src/aoc08.nim
13:58:18supakeenAnd how do I manually verify if something is gcsafe; I don't really see shared state in the readNext proc?
13:58:31FromDiscord<Rika> im trying to figure it out
13:59:12narimiranZoom[m]: this "overcomplication" might be useful for some later task
13:59:24narimiranspeaking of which.... Zevv, where's my beer?
13:59:38FromDiscord<Rika> im not exactly sure how to determine it
13:59:41Zoom[m]He-he
13:59:46FromDiscord<Rika> is it not further into the error?
14:00:19hmmmalso aoccers please comment your code so it's easier to understand what happens :3
14:00:26Zoom[m]I go for much greater function granularity. Probably my human RAM is just too small
14:00:46narimiranhmmm: our codes are self-documenting :P
14:00:50supakeenIt could be, I'm very clueless as to how Nim approaches this and might've misread the error? The small example should give you the same error (with --threads:on).
14:00:55hmmmYEYE I'M SURE NARI
14:00:56hmmm:D
14:01:16hmmmbtw you leave some notes around nari, I like that
14:01:27narimirando i? ok :)
14:01:35hmmmyes in the introduction page
14:01:43hmmm"Small check elif s[i] + s[j] < 2020: makes the whole program ~4x faster."
14:01:47narimiranah, but this year i keep that one quite short
14:01:54narimirani was more verbose before
14:01:56Zoom[m]hmmm: I have notes on some days
14:01:58hmmmoh
14:02:00hmmmwhat year?
14:02:16narimiranhmmm: last year definitely, but that one was in ocaml
14:02:20Zoom[m]Not exactly sure what to add for yesterday or today, though.
14:02:25narimirani had an essay for each day basically :D
14:02:29hmmmlol
14:02:38hmmmyou should have done it on nim too :p
14:02:56FromDiscord<shadow.> hmm i can do one if you'd like lol
14:03:04hmmmshadow do that
14:03:05FromDiscord<InventorMatt> just attaching the gsafe pragma on the readnext proc fixes it and the proc just returns nil reference objects so Idon't know other than the nil part what could cause the error @Rika
14:03:13FromDiscord<shadow.> like what just explaining the solutions?
14:03:32hmmmno just explaining what is the general approach and then commenting the most important lines
14:03:37hmmmnothing fancy :p
14:03:43FromDiscord<shadow.> hmm
14:03:47FromDiscord<shadow.> well it seems that aoc is about
14:03:54FromDiscord<shadow.> 1/3 general problem solving
14:03:55FromDiscord<shadow.> 1/3 parsing
14:03:57FromDiscord<shadow.> and 1/3 algorithms
14:04:12FromDiscord<shadow.> parsing just comes with time and knowing yours tools (split, regex, strscans, peg's) etc
14:04:19narimiranhmmm: if you go through my solutions and find something unclear, you can ask me here about it
14:04:29FromDiscord<shadow.> i think he wants to know how we get to that point
14:04:35FromDiscord<shadow.> like our approach?
14:04:39FromDiscord<shadow.> correct me if im wrong
14:05:16Zoom[m]hmmm: It's even better to compare different solutions. They've been very much alike.
14:05:27hmmmyea like what basic CS concept is the problem about and how your algos work
14:05:27Zoom[m]Excluding Zevv, of course
14:05:37FromDiscord<shadow.> !repo shadowninja55/aoc-2020
14:05:38disbothttps://github.com/shadowninja55/aoc-2020 -- 9aoc-2020: 11My attempt at Advent of Code 2020 in Nim. 15 1⭐ 0🍴
14:05:40FromDiscord<shadow.> you can compare with pmunch
14:06:01FromDiscord<shadow.> and anyone else doing them
14:06:47Zoom[m]@shadow. Why do you use a table for swapping?
14:06:57PMunchToday might be interesting.. I'm so tired today it feels like I'm literally dying
14:07:20PMunchSo no promises it won't hurt to watch me try to solve todays puzzle
14:07:25Zoom[m]PMunch: do you work remote or commute, if it's ok to ask?
14:07:48PMunchWell typically I would be in our office, but now under Corona I've moved to working from home
14:08:04FromDiscord<shadow.> table for swapping?
14:08:10FromDiscord<shadow.> ohh idk i find it more concise even tho it might be a little slower
14:08:36FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HiI
14:08:45FromDiscord<shadow.> my day 9 solution is quite pretty
14:09:48*waleee-cl joined #nim
14:09:48FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2HiJ
14:09:49FromDiscord<lqdev> problem solved
14:10:05Zoom[m]@shadow. I mean, why not just a `case`?
14:10:32FromDiscord<shadow.> hmm
14:10:36FromDiscord<shadow.> fair enough haha
14:10:41FromDiscord<shadow.> brain was not really
14:10:49FromDiscord<shadow.> working that day lol
14:10:57FromDiscord<shadow.> like today i just went massive brain somehow
14:11:05FromDiscord<shadow.> but for that one no
14:11:07FromDiscord<shadow.> solution was quite messy
14:11:19FromDiscord<shadow.> i think day 4 my brain just hopped out of my head lol
14:11:57hmmmhmm apparently pmunch day1 is more brain friendly than nari day1
14:12:12hmmmnari day1 is a big nest of stuffy stuff
14:12:41PMunchWhere is nari's day1?
14:12:56hmmmhttps://github.com/narimiran/AdventOfCode2020/blob/master/nim/day01.nim
14:13:35narimiranthis just in: for-loops are not brain friendly
14:13:41hmmm:p
14:13:42FromDiscord<shadow.> my day 1 is like
14:13:47FromDiscord<shadow.> probably the simplest possible
14:13:54FromDiscord<shadow.> idk how efficient
14:14:03FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HiL
14:14:23hmmmwhat is var seen = initIntSet()
14:14:33narimiran~rtfm
14:14:34PMunchWait, isn't that pretty much exactly what I have?
14:14:35FromDiscord<shadow.> i make an integer set to keep track of the numbers ive already seen
14:14:38FromDiscord<shadow.> really?
14:14:42FromDiscord<shadow.> i thought you used nested loops
14:15:07FromDiscord<shadow.> so apparently using the deque instead of slice seq reassignments takes 2/3 the time thats good to know
14:15:26PMunchHmm, did disbot die?
14:15:47narimirandisbot: you here?
14:15:51Zoom[m]<narimiran "this just in: for-loops are not "> Loops can be totally unfriendly. Depends on how nested they are and how many exit points do they have.
14:15:54hmmmwell I go eat, dudes pls comment your day ones I'll give you cookies
14:16:13FromDiscord<shadow.> i know esbeesy has some nifty solutions as well
14:16:15FromDiscord<shadow.> you could check those out
14:16:29Zoom[m]You don't promise one a cookie and not deliver
14:16:30narimirani will never have a comment in my code explaining what `var seen = initIntSet()` is, sorry
14:16:34FromDiscord<shadow.> lmao yeah
14:16:52ee7[m]Is this a bug? https://play.nim-lang.org/#ix=2HiM
14:17:35*habamax quit (Ping timeout: 258 seconds)
14:17:58FromDiscord<shadow.> well
14:18:05FromDiscord<shadow.> hmmm
14:18:11FromDiscord<shadow.> i have a suspicion lemme test locally
14:18:28FromDiscord<shadow.> nope, no message
14:18:29FromDiscord<shadow.> hm
14:19:15FromDiscord<shadow.> i think because bar is passed it's allowed to use it since it's passed?
14:19:16FromDiscord<shadow.> im not sure
14:19:32FromDiscord<shadow.> it would still be global-state mutation so idk
14:27:11ZevvZoom[m]: Don't try this at home: https://play.nim-lang.org/#ix=2HiP
14:27:23FromDiscord<shadow.> oh no
14:27:51FromDiscord<shadow.> why
14:27:56FromDiscord<shadow.> why have you done this
14:28:15Zevvbecause I live in the land of freedom and unlimited posibilities
14:28:48Zoom[m]Zevv: that could be useful, but its nastiness overshadows this
14:29:47Zoom[m]It's even worse than passing with a var. But it could be wrapped in a friendly view iterator or something like that
14:30:25Zevvyou get what you ask for
14:30:34Zevvyou could also just add one single '*' to your local nim lib dequeue
14:31:40Zoom[m]If it was a life-or-death matter, I could just include the whole thing and completely destroy it from inside :D
14:34:31FromDiscord<a depressed person uwu> sent a code paste, see https://play.nim-lang.org/#ix=2HiU
14:34:52FromDiscord<shadow.> has to be inside a macro
14:34:53FromDiscord<shadow.> iirc
14:34:59FromDiscord<a depressed person uwu> mk
14:35:00FromDiscord<shadow.> wait no
14:35:05FromDiscord<shadow.> the function is just
14:35:06FromDiscord<a depressed person uwu> wat
14:35:07FromDiscord<shadow.> ident()
14:35:13FromDiscord<shadow.> nnkIdent is the node type
14:35:24FromDiscord<a depressed person uwu> k
14:35:24FromDiscord<shadow.> in a macro, you can just do `newCall("test")`
14:36:10FromDiscord<a depressed person uwu> and how do i get the params of the function inside it
14:36:20FromDiscord<shadow.> wdym?
14:36:22FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HiW
14:36:35FromDiscord<shadow.> sorry could you explain that again
14:37:10*NimBot joined #nim
14:37:24FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HiY
14:37:26FromDiscord<a depressed person uwu> o ok
14:37:30FromDiscord<a depressed person uwu> thx for ur help
14:37:33FromDiscord<shadow.> np
14:37:41FromDiscord<shadow.> btw, in this case a template might be easier
14:37:50FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HiZ
14:37:55FromDiscord<shadow.> depends on what you're doing
14:38:35FromDiscord<a depressed person uwu> hm ok
14:39:00FromDiscord<shadow.> what's your end goal?
14:41:49FromDiscord<a depressed person uwu> just making some test discord bot
14:41:52FromDiscord<a depressed person uwu> nothing much tbh
14:42:17*reyqn joined #nim
14:42:49FromDiscord<shadow.> i see
14:42:52FromDiscord<shadow.> dimscord?
14:43:17FromDiscord<a depressed person uwu> yup
14:43:20FromDiscord<shadow.> nicee
14:43:33FromDiscord<a depressed person uwu> making a command handler that automatically loads every command
14:43:45FromDiscord<shadow.> ahh i see
14:43:48FromDiscord<shadow.> using a macro?
14:43:53FromDiscord<a depressed person uwu> ye
14:43:55FromDiscord<shadow.> smart
14:44:01FromDiscord<a depressed person uwu> i dont have any other idea on calling the commands
14:44:05FromDiscord<a depressed person uwu> :p
14:44:07FromDiscord<shadow.> well
14:44:27FromDiscord<shadow.> you could just make a macro that transforms the commands into message event arg cases?
14:44:27FromDiscord<shadow.> idk
14:45:04FromDiscord<a depressed person uwu> sent a code paste, see https://paste.rs/gUt
14:46:22FromDiscord<shadow.> yeah that would work
14:47:03FromDiscord<a depressed person uwu> imagine making discord bots in alot of different langs tho
14:47:10FromDiscord<shadow.> wdyym
14:47:16FromDiscord<shadow.> i mean ive done py and js before
14:47:28FromDiscord<shadow.> for dapi
14:47:32FromDiscord<a depressed person uwu> i have done in py, js, lua, rust and now making in nim
14:47:37FromDiscord<shadow.> lol nice nice
14:47:44FromDiscord<a depressed person uwu> ~~i basically have no life~~
14:47:46FromDiscord<shadow.> dja isnt bad if you know java
14:47:55reyqnHi. I don't really get how to run nim-gdb. It seems like the exe from .nimble tries to call himself in .choosenim (where it doesn't exist). I'm running windows. Does someone know what I am doing wrong?
14:48:08FromDiscord<shadow.> you think you're alone w that statement? lol
14:48:15FromDiscord<shadow.> this is a programming server after all
14:48:31FromDiscord<a depressed person uwu> epik
14:49:03FromDiscord<shadow.> lmao
14:49:32FromDiscord<sealmove> string interpolation doesn't work with backquoted idents in quote do?
14:49:40FromDiscord<shadow.> show the code
14:49:41FromDiscord<shadow.> in question
14:50:16FromDiscord<shadow.> strformat?
14:50:48FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2Hj4
14:50:50FromDiscord<shadow.> hmm
14:51:20FromDiscord<shadow.> are they just interpreted as literals?
14:51:51FromDiscord<Zeus> Hello everyone
14:51:54FromDiscord<shadow.> hey
14:52:07FromDiscord<sealmove> the backquote substitution doesn't seem to happen, I get 'undeclared identifier'
14:52:11FromDiscord<shadow.> i see
14:52:13FromGitter<HJarausch_gitlab> Is there something like *StringStream* which can be passed to a procedure which takes an argument of type *File* ⏎ Many thanks for a hint.
14:52:15FromDiscord<shadow.> hmmm
14:52:19*hmmm quit (Quit: brb)
14:52:22FromDiscord<shadow.> stringstream?
14:52:26FromDiscord<shadow.> i mean theres the streams lib
14:52:32FromDiscord<shadow.> https://nim-lang.org/docs/streams.html
14:52:36FromDiscord<shadow.> and that works with files
14:53:32FromDiscord<shadow.> im not sure then
14:53:41FromDiscord<shadow.> have you tried with concatenation?
14:53:52FromDiscord<sealmove> with concatenation it works
14:54:00FromGitter<HJarausch_gitlab> I have tried ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ but I get ... [https://gitter.im/nim-lang/Nim?at=5fd0e5083dd3b251a4f6744d]
14:55:57FromDiscord<shadow.> what did you expect to happen lmao
14:56:04FromDiscord<shadow.> you passed a stringstream to a proc that accepts a file
14:57:23FromGitter<HJarausch_gitlab> I'd like something *in memory* and I have to pass it to a proc which requires a *File* (it's part of ncurses.nim and it cannot changed by me).
14:57:43PMunchSave your file in /tmp
14:57:58PMunchOr just create a FIFO
15:01:39FromGitter<HJarausch_gitlab> As far as I know, a FIFO connects *two* processes. I just need some *memory mapped file* which can be passed to a *File* parameter.
15:03:05PMunchOkay, ready to stream in about 10 minutes
15:03:38FromGitter<HJarausch_gitlab> */tmp* is fine on Linux, but I want my program to run on *Android Termux*, as well.
15:04:36FromDiscord<shadow.> nicee
15:04:42FromDiscord<shadow.> ill tune in
15:05:27PrestigeIsn't that linux as well? Is there no /tmp dir?
15:06:38PMunchEven without /tmp you should be able to do a FIFO
15:08:49FromGitter<HJarausch_gitlab> @Prestige Only the kernel is Linux. There might be a */tmp* folder but I am definitely not allowed to create a file there.
15:09:23FromDiscord<shadow.> hmm
15:09:23PrestigeWell yeah, Linux is a kernel. You're sure you can't?
15:09:48*reyqn quit (Remote host closed the connection)
15:10:07PMunchAny reason in particular why you don't want to use a FIFO?
15:10:09FromDiscord<lqdev> @HJarausch_gitlab have you tried?
15:10:33ZevvHJarausch_gitlab: getenv(TMPDIR)
15:10:33FromDiscord<lqdev> ah
15:10:35Zevvit's properly setup in termux
15:10:41FromDiscord<lqdev> there is no /tmp in termux
15:11:19Zevvor os.tempDirDefault(), which does the same thing under the hood on linux
15:11:24PMunchTwitch is live: https://www.twitch.tv/pmunche
15:11:28ZevvI guess your termux build goes for a linux flavor
15:11:33PMunchOr should be at least..
15:12:19FromDiscord<shadow.> llol ill tune in
15:12:37ZevvAah, it's time to relax. You know what that means. A glass of wine, your favorite easy chair, and of course, PMunch's soothing voice playing on your home stereo.
15:12:38FromDiscord<shadow.> hmm
15:12:41PMunchIs it working?
15:12:41FromDiscord<shadow.> offline
15:12:45FromDiscord<shadow.> nope
15:12:51FromDiscord<shadow.> now it is
15:12:56FromDiscord<shadow.> standby
15:13:00PMunchAh yeah
15:13:19PMunchYouTube is also live: https://www.youtube.com/watch?v=aFueLZOBs7I
15:13:22PMunchAlthough with the wrong title
15:13:30FromDiscord<shadow.> ah true
15:19:32ZevvI *hate* how nim does not allow lines().toSeq().mapIt()
15:19:54FromDiscord<shadow.> yeahhh
15:20:52*audiofile quit (Quit: Connection closed)
15:21:04FromDiscord<lqdev> any ideas on why i can't read `nim check` output via lua's `io.popen()`?
15:21:53FromDiscord<lqdev> hmm, i think it's due to it outputting to stdout
15:21:58FromDiscord<lqdev> erm, stderr
15:22:00FromDiscord<lqdev> and not stdout
15:26:06ZevvI also *hate* how you sit and think and run once and have it right. You would have thrived in the age of punch cards.
15:29:21FromDiscord<shadow.> yeah
15:29:22FromDiscord<shadow.> i prefer the
15:29:28FromDiscord<shadow.> mash the keyboard and fix all compiler errors
15:29:30FromDiscord<shadow.> approach
15:32:24*lritter joined #nim
15:38:35PrestigeLol Zevv
15:44:16FromDiscord<dom96> Zevv: Be empowered to be the change you want to see in the world.
15:45:22Zevvnah, I'm too old for that shit
15:45:37ZevvI'm starting that period in life where I can be grumpy and complain and cling to what I know
15:48:21FromDiscord<dom96> Being old is no excuse to avoid change
15:53:17Zevvooh yes it is. You're just not old enough to realize that
15:53:26FromDiscord<shadow.> lol
15:53:40FromGitter<HJarausch_gitlab> @PMunch Thanks, a *FIFO* seems to work
15:54:10PMunchNice
15:54:27PMunchJust keep in mind that both sides need to be open before you can read/write to the FIFO
15:55:53FromDiscord<dom96> lol
15:56:57*PMunch quit (Quit: leaving)
16:03:01*opal quit (Remote host closed the connection)
16:03:33*opal joined #nim
16:06:24*hmmmmm quit (Quit: brb)
16:13:14reversem3anyone use moe for an editor ?
16:16:55*fredrikhr quit (Read error: Connection reset by peer)
16:17:53FromDiscord<shadow.> does anyone know a good nim debugger for vscode?
16:18:06FromDiscord<shadow.> or just any way to quickrun from vscode
16:19:11FromDiscord<shadow.> alr so i can use the nim extension nvm
16:19:14FromDiscord<shadow.> but how do i run using that?
16:20:57FromDiscord<shadow.> nvm figured it out
16:26:36*Kaivo quit (Ping timeout: 240 seconds)
16:27:53FromDiscord<fwsgonzo> is ORC the most memory efficient GC in Nim?
16:28:46FromDiscord<shadow.> https://nim-lang.org/docs/gc.html
16:29:14*Kaivo joined #nim
16:30:22reversem3vscode no , I only use ldb or gdb sorry
16:31:41*habamax joined #nim
16:40:04FromDiscord<mratsim> @fwsgonzo not allocating memory is always more efficient 😉
16:40:20FromDiscord<mratsim> then it's the stack
16:40:33FromDiscord<mratsim> then reusing buffers
16:42:38FromDiscord<Esbeesy> Well day 9 wasn't too challenging.
16:42:49FromDiscord<Esbeesy> Does anyone know of an actor framework for nim?
16:43:29FromDiscord<mratsim> There was Nimoy, and someone called monster on the forum also wanted to do an Akka one.
16:43:35FromDiscord<mratsim> but none maintained AFAIK
16:43:57FromDiscord<mratsim> If I had the time I would write one for learning purpose as well
16:44:40FromDiscord<Esbeesy> I noticed in search results it used to be std lib around .11-.17, guessing it was removed
16:45:03FromDiscord<Esbeesy> From someone who has working experience in Erlang/Elixir/Akka - Please not Akka.
16:45:33FromDiscord<mratsim> inspired by
16:45:56FromDiscord<mratsim> In my case, I looked underneath Actix, and I also happen to have quite a good idea of Pony internals.
16:47:04FromDiscord<mratsim> I did some experimentation on top of Weave, but Actors for CPU-bound workloads are meh and Weave does not address the latency needs of IO bounds workloads.
16:52:00FromDiscord<mratsim> @Esbeesy what kind of things are looking for in an actor framework
16:52:04*JustASlacker joined #nim
16:52:12FromDiscord<mratsim> What was nice to solve using actors?
16:52:19FromDiscord<Esbeesy> Making films
16:52:21FromDiscord<Esbeesy> I jest
16:52:36FromDiscord<mratsim> ideally, is there something I can use to showcase actors if I ever implement them?
16:52:42JustASlackerfirst time working on a nim project in months \o/
16:52:50*JustASlacker tries to remeber how nim works
16:53:06JustASlackerbasically python I guess
16:53:21FromDiscord<mratsim> for example, for multithreading, I use a 100 lines raytracing C++ demo that I ported to Nim https://github.com/mratsim/weave/tree/master/demos/raytracing
16:53:53*tane joined #nim
16:55:41FromDiscord<Esbeesy> So, I work in the online gambling industry, and the issue many of these companies face is database contention when they scale - Because sporting events end at the same time, you can have hundreds of thousands of bets on that one data point. You now have to calculate all of these bets and update the user accounts accordingly. And this is going on constantly, all the events around the world, users with bets on multiple events, non stop
16:56:04FromDiscord<Esbeesy> So effectively, you want a system that has as little locking behaviour as possible
16:57:01FromDiscord<shadow.> rah i hate async error messages
16:57:13FromDiscord<shadow.> they're like hieroglyphics
16:57:13disruptekshhh.
16:57:31FromDiscord<shadow.> rip
16:57:34FromDiscord<Esbeesy> Whenever I explore a new language, I always like to see if there's a distributed actor system since it's one of the best tools to scale high traffic platforms
16:57:49FromDiscord<shadow.> sounds like rst
17:01:54FromDiscord<mratsim> I see. No unfortunately Nim doesn't have that yet. Though we do have an Energy trading company that use Nim in a high-scaling + ultra-low latency environment.
17:02:10FromDiscord<Esbeesy> shadow: Problem with Rust, Actix doesn't have a distributed feature, meaning you have to rely on another system for communication between actor systems. This is what makes Erlang/Elixir so powerful
17:02:20*hnOsmium0001 joined #nim
17:02:55FromDiscord<Esbeesy> https://proto.actor/ This is a very interesting idea from the person who made Akka actually
17:03:10FromDiscord<Esbeesy> Akka.NET
17:03:11FromDiscord<mratsim> What about that C++ Actor Framework, thoughts?
17:03:26FromDiscord<Esbeesy> CAF?
17:03:29disruptekwe'll have csp. it's practically the same thing.
17:03:43FromDiscord<mratsim> yes
17:03:55disruptekunfortunately, no one gives a shit.
17:04:16FromDiscord<mratsim> I don't know anything about actors so I don't know how to evaluate a good library from a one that doesn't solve the right problems
17:04:24FromDiscord<mratsim> @disruptek, I care about CSP.
17:04:29FromDiscord<Esbeesy> csp isn't the same
17:04:35Zevvdisruptuk: we should market CSP and crowdsource CSP
17:04:41FromDiscord<Esbeesy> Similar ball park
17:04:45FromDiscord<Esbeesy> and I definitely want nim routines
17:04:45disrupteklol
17:04:54Zevvbest case you have income and a cool project
17:04:56FromDiscord<Esbeesy> https://www.quora.com/How-are-Akka-actors-different-from-Go-channels-How-are-two-related-to-each-other↵↵Good thread on it
17:04:57Zevvworst case it'll be like V
17:05:08FromDiscord<mratsim> that's why I asked about it here: https://forum.nim-lang.org/t/7199#45485
17:05:09ZevvI hereby offer the first $250
17:05:20Zevvand that's for CPS only, not CSP
17:05:58FromDiscord<mratsim> yeah there is confusion here
17:05:58FromDiscord<Esbeesy> The person who created Akka.NET has created this: https://proto.actor
17:06:18FromDiscord<mratsim> disruptek is talking about CPS (Continuation Passing Style) while CSP is (Communicating Sequential Process)
17:06:27disruptekno, i'm talking about csp.
17:06:28FromDiscord<Esbeesy> Essentially, building the actor system from the distribution method rather than the code
17:06:33disruptekcps is already done afaic.
17:06:38FromDiscord<mratsim> ah
17:06:57Zevvyou heard me disruptek. crowdfund that stuff, you got your first customer.
17:06:58FromDiscord<Esbeesy> I might make nim bindings for proto actor actually 🤔
17:07:02FromDiscord<mratsim> well I care about CSP as well. This is why Weave is channel-based instead of shared memory
17:07:06disrupteki mean, it may not be properly impl, but i'm satisfied with the research.
17:07:07Zevvnow I will eat soup. bye.
17:07:11disruptekzevv: okay, thank you.
17:08:03disruptekhonestly, i think cps is ahead of its time for nim.
17:08:36*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
17:09:55disrupteki am working on csp for nigel. it's just hard to find time because, y'know, i don't have a job and it's fucking snowing here.
17:10:24*Lord_Nightmare joined #nim
17:10:39disrupteki have these lambdas running continuations that i serialize into the cloud. csp is just a matter of rendezvous.
17:11:23disruptekthe poor-man's rendezvous is just another process that mutates the two continuations before resuming them simultaneously.
17:11:55FromDiscord<krisppurg> I mean like in C↵↵https://man7.org/linux/man-pages/man2/read.2.html
17:12:04disruptekthousands of simultaneous executions in separate nodes is no problem.
17:12:46disruptekeach such execution has 10gig of memory to work with, and commensurate CPU.
17:16:22disruptekthey run in their own little network with a shared filesystem and access to a cache. they are /practically/ a unified cluster, just with extraordinarily poor synchronicity/reliability.
17:16:54disruptekbut you can purchase time on this cluster in increments of 100ms, which is kinda huge.
17:17:18disruptekand it's as large or small as your code demands.
17:18:08disrupteknow i will make coffee.
17:22:55FromDiscord<shadow.> enjoy
17:28:37FromDiscord<dom96> I'd love to see csp in action, but I'm not sure where to look
17:28:52FromDiscord<dom96> or cps I don't know anymore
17:29:07FromDiscord<shadow.> lmfao
17:29:12FromDiscord<shadow.> cps is continuation passing style
17:29:22FromDiscord<shadow.> csp is communicating sequential process
17:29:24FromDiscord<shadow.> which of those
17:29:27FromDiscord<shadow.> do you want to see in action
17:29:32FromDiscord<Quibono> Not really sure what either of them is but I think I want them if they give us good parallelism
17:29:39FromDiscord<shadow.> !repo disruptek/cps
17:29:40disbothttps://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 40⭐ 2🍴
17:29:44FromDiscord<shadow.> there's an example
17:29:57FromDiscord<shadow.> i have to plug all of disruptek's repos while hes making coffee
17:30:56FromDiscord<mratsim> @Quibono, none are really about parallelism though. CPS is about composition of Nim primitives (iterators, macros, templates, closures, ...) and CSP is about composition of processes/event loops/services.
17:31:12FromDiscord<Quibono> Lol so weave is still my god?
17:31:31FromDiscord<mratsim> CSP builts on top of a multithreading framework.
17:31:44FromDiscord<mratsim> so you need a foundation, it's another layer
17:32:36FromDiscord<mratsim> I do mention CSP quite often in Weave or one of the RFC
17:33:44FromDiscord<Quibono> I don’t really need parallelism yet for anything, but I want to need it lol
17:35:40FromDiscord<mratsim> Also the references at the end of Synthesis (Weave State machine code generator) might be a fun read: https://github.com/mratsim/Synthesis#references
17:36:22FromDiscord<mratsim> Communicating Finite State Machine, Petri Nets, Kahn Process Networks, and the extras which are slides from courses.
17:37:52*rockcavera quit (Read error: Connection reset by peer)
17:38:19*rockcavera joined #nim
17:40:32FromDiscord<mratsim> If you base actors on one of those theories, you can formally verify properties of your distributed systems which is very powerful for reliability.
17:43:05FromDiscord<dom96> So how do I replace my async/await programs with it?
17:44:43*junland quit (Quit: %ZNC Disconnected%)
17:45:29FromDiscord<zetashift> iirc go just uses the `go` keyword
17:45:33*junland joined #nim
17:46:16*junland quit (Remote host closed the connection)
17:47:04*junland joined #nim
17:47:51*hmmmmm joined #nim
17:48:51hmmmmmdudes if I have 8 lines in a try block and it fails at line 7, what happens to the first lines? they get executed?
17:49:12FromDiscord<zetashift> oops my bad Go uses CSP and not CPS
17:49:53FromDiscord<zetashift> yes, they do, do you have an code example?
17:49:56*JustASlacker quit (Ping timeout: 272 seconds)
17:50:44disruptekthe cps repo features examples.
17:51:27disruptekcps is, imo, already superior to async/await because though we haven't bothered to put it in the example dispatcher, it lets you move continuations between threads arbitrarily.
17:52:01disruptekthis synergizes nicely with arc's shared heap and isolate.
17:52:17FromDiscord<dom96> Are there any examples showing sockets usage?
17:52:21disruptekit lets us thread i/o instead of having colored functions.
17:52:38disrupteki think there is a socket example.
17:52:45FromDiscord<shadow.> !help
17:52:47FromDiscord<shadow.> rip
17:52:54disruptekno help for discord users.
17:52:59FromDiscord<shadow.> sad
17:53:04disruptekuse a real chat client or bug yard to fix the bot.
17:53:10FromDiscord<shadow.> hmm
17:53:15FromDiscord<shadow.> bet
17:53:31*shadowninja55 joined #nim
17:53:41shadowninja55boom
17:53:43FromDiscord<dom96> NimBot can handle discord users 🙂
17:53:48shadowninja55!help
17:53:52shadowninja55there we go
17:54:02disruptekdom96: how does it send them private messages
17:54:16FromDiscord<dom96> It avoids needing to
17:54:22disruptekwell, that's what !help does.
17:54:42disrupteki personally don't want to be spammed by the help all the time.
17:54:46FromDiscord<shadow.> well i just hopped on irc and got help anyways so its cool lol
17:54:56disruptekhurray.
17:55:10disruptek~notes
17:55:10disbotnotes: 11https://gist.github.com/disruptek/41100bf20978de9a3cff55b23fcfe44e -- disruptek
17:55:15disrupteki think there's some help in there.
17:55:20*shadowninja55 quit (Client Quit)
17:55:37FromDiscord<shadow.> fair
17:55:43hmmmmmwoah they really get executed :|
17:55:50FromDiscord<shadow.> im programming something like this for personal use so i just wanted inspiration for commands lmao
17:56:12disruptekyou probably want to look at my porn bot.
17:56:30FromDiscord<dom96> > i think there is a socket example.↵I can't find any, do you have a link?
17:56:35FromDiscord<shadow.> what api?
17:56:39FromDiscord<shadow.> or do you scrape porn like a real gamer
17:57:34disruptekit has a lot of nuance.
17:57:34disruptekit started out as !faster and !harder but i ended up impl a custom sexytalk language.
17:57:35disruptekdom96: it would be in examples, stash, or tests.
17:57:36disruptekbut you shouldn't need a socket example to evaluate the merits of the technique.
17:58:02FromDiscord<dom96> I need a socket example to be able to use it
17:58:07FromDiscord<dom96> which is what I would like to do
17:58:29disruptekwell, you should be able to make one using the existing dispatcher.
17:59:29FromDiscord<dom96> someone will need to create a high-level socket API for this, otherwise it won't get used
17:59:41FromDiscord<reilly> So I'm making some API calls, and I need to access a field containing a date. It's stored in what I can only assume to be Unix time. For example, `1596605484971` should be August 5th, 2020. By the looks of it, though, `member["joined"].getInt().fromUnix().local()` seems to read it as June 31, 52,564.
17:59:46disrupteki think you're missing the point.
17:59:49FromDiscord<dom96> all I see so far is very low-level code
18:00:08disruptekthere /is no/ api.
18:00:26disruptekyou will write normal synchronous code. it turns into asynchronous code.
18:00:58Zoom[m]when? 😎
18:01:04disruptekcompile-time.
18:01:27FromDiscord<dom96> Right, but an API is needed for the synchronous code
18:01:29hmmmmmhow can I structure my try block to execute only if none of the lines fail
18:01:37Zoom[m]Right. That's exactly what I was asking
18:01:37disruptekwe already have synchronous sockets.
18:06:14*junland quit (Quit: %ZNC Disconnected%)
18:08:22disruptekZoom[m]: didn't you tell me that you read the 1011 paper?
18:08:28disruptekand you enjoyed it, right?
18:08:32hmmmmm~bentley
18:08:33disbotbentley: 11https://imgur.com/gallery/yEXiWWG
18:08:33disbotbentley: 11a good boy
18:08:44hmmmmm:3
18:09:04disruptekstop looking at my dog's cock.
18:09:07hmmmmm:|
18:09:18hmmmmm~disruptke
18:09:18disbotno footnotes for `disruptke`. 🙁
18:09:22hmmmmmmeh
18:09:26hmmmmmyou are lazy
18:13:10disruptekdom96: read 1011. if you aren't sold, we can't be friends.
18:14:46Zoom[m]<disruptek "and you enjoyed it, right?"> I'm interested, but I'm not sold until I understand how to use it. And I probably won't invest in investigating further until it at least 3/4 production-ready.
18:15:30FromDiscord<dom96> disruptek: based on the description so far it seems very similar to Go's approach, so I'm not sure I would learn much from reading the paper
18:15:59disruptekgo is csp.
18:16:05FromDiscord<Esbeesy> ^ this
18:16:55FromDiscord<dom96> So what's the TL;DR of CSP vs. CPS?
18:17:22disruptekcps inverts control flow, csp is continuation composition.
18:17:55Zoom[m]On one hand I have a luxury to be an early adopter of promising techniques, but on the other, I don't code anything serious, so I'm no use as a tester. I can only annoy with unimportant questions and FRы orthogonal to the current project focus.
18:18:14Zoom[m]So I don't think you really need to get me interested.
18:18:18disrupteklook at the end of this file:
18:18:20disruptekhttps://github.com/disruptek/cps/blob/master/experiments/chain.nim
18:18:25disrupteklines 190+
18:18:28Zoom[m]But you should get Dom interested
18:18:53FromDiscord<mratsim> @dom96 quoting myself "CPS is about composition of Nim primitives (iterators, macros, templates, closures, ...) and CSP is about composition of processes/event loops/services."
18:19:00Zoom[m] * On one hand I have a luxury to be an early adopter of promising techniques, but on the other, I don't code anything serious, so I'm no use as a tester. I can only annoy with unimportant questions and FRs orthogonal to the current project focus.
18:19:49disruptekthat's everyone who uses nim.
18:21:18*junland joined #nim
18:21:42*thomasross joined #nim
18:23:36Zevvdom96: cps is the building block. It's like the async macro, it splits procs in pieces and lifts the locals
18:23:45Zevvthese locals go into an object together with a pointer to the function
18:23:56disruptekdom96: the reason you'll learn something from the paper is that it's about impl CPS in C for use in a torrent server aimed at service tens of thousands of clients simultaneously.
18:24:21Zevvthe resulting object with vars + fn is called a closure
18:24:26Zevvand you can juggle mad things with these
18:24:37Zevvyou can call them in any order, store them in the fridge, send them to disruptekts cloud, whatever
18:24:40Zevvthat's CPS
18:24:48Zevvit's pretty basic, we got that working, albeit in a deplorable state
18:24:53Zevvthen next there's CSP
18:25:06ZevvCSP is a higher abstraction layer, typically built on top of CPS
18:25:12Zevvthe acronyms are amazingly confusing
18:25:14disruptekwell, our cps is already more advanced than the cps demonstrated in the paper. i wouldn't say it's /deplorable/, exactly.
18:25:24Zevvvar a: int = 3
18:25:52Zevvok, not deploarble. odious
18:25:58disruptekodious, lol
18:26:42ZevvCSP is basically kind of what Go does.
18:26:47Zevvyou make things and you connect them with tubes
18:26:51Zevvshove stuff in, get stuff out
18:26:51disruptekit's exactly what go does.
18:26:57Zevvbut onder the hood, the tubes are an illusion
18:26:59Zevvthey are not there
18:27:02Zevvthe compiler makes them go away
18:27:12disruptekexactly this. it's a semantic designed for the programmer.
18:27:17Zevvit's not like a pipe or a channel or a socket or a fifo
18:27:29Zevvit *looks* like it, but it will evaporate
18:28:08Zevvdoes that make sense, dom96?
18:28:08disruptekthing is, i'm not really convinced a pipe is even the right magical object to give the programmer.
18:28:30Zevvit might not be, but it's what people expect in 2021
18:28:33Zevvso lets start with that
18:28:54disruptekwe can give them a pipe, but when they look inside they might see my magic 8-ball.
18:29:20ZevvCSP: Ceci n'est pas une pipe
18:29:35disruptekoui oui, this is the way.
18:30:14ZevvI don't give a single blip about CSP for now. I would like to have a solid and robust CPS first
18:30:19Zevvthat would solve 99% of my problems
18:30:30Zevvthat makes me do async I/O on an AVR with 256 bytes of RAM
18:30:40Zevvthat gives me lua-style coroutines
18:30:40disruptektell you what. i will work on it.
18:30:50Zevvcroudfund that shit
18:30:53Zevvwhere to I send my money
18:31:04disrupteki hate those things.
18:31:09Zevvhaha me too :)
18:31:34Zevvbut what is still offputting is that the c words keep on buzzing around
18:31:40disrupteksomeone bought me a coffee recently. it was awesome, except that it goes directly to my credit-card debt, so, like, i didn't get any coffee.
18:31:51Zevvbut I still haven't met anyone here *actually* willing to look into all that
18:31:57disruptekall what?
18:32:10Zevvc-words. cps csp
18:32:29disrupteki just said i would fix the compiler bug.
18:32:38Zevvit's not /you/ i'm talking a bout
18:32:43disruptekoh.
18:32:49Zevvit's everybody else. you all hear me?! you! and you! yes and you!
18:32:50disruptekwell, that's why i said it's ahead of nim's time.
18:32:54Zevvy'all know who I mean
18:32:56Zevv<_<
18:33:01disruptek>_>
18:33:01supakeenSorry, I went a bit AFK did someone look into the thingy with redis + threads still?
18:33:02FromDiscord<dom96> I think I get it
18:33:12Zevvright!
18:33:23disruptekredis/threads?
18:33:28FromDiscord<Vindaar> hey Zevv, feel free to make my day have 30 h or so and then I'll gladly help 😛
18:33:30FromDiscord<dom96> But from my perspective it seems to be fixing a somewhat niche thing (supporting embedded devices)
18:33:33supakeendisruptek: I'm trying to run nim-lang/redis in threads but am encountering some gcsafe things, what gives: https://bpa.st/raw/DY3Q, the relevant proc it points to is: https://bpa.st/7DZQ
18:33:42FromDiscord<dom96> It sounds like CPS is a reimplementation of what we already have with closure iterators
18:33:55supakeenI can't determine well which part of `readNext` is shared heap, if I understand gcsafe correctly?
18:33:59ZevvVindaar: funny, how you answer to that outcry to the anonymous masses. makes me think you have a guilty concience
18:34:15supakeenAlso here's a small program one can compile to get that message: https://bpa.st/4UIQ
18:34:28FromDiscord<Vindaar> I do, cause there's too many things I want to do / work on etc, but always fail to get even 20% of that done 😦
18:34:30disrupteksupakeen: gcsafe is just a fence to keep idiots out.
18:34:35Zevvdom96: no, CPS does'nt work on top of closures, nor iterators
18:34:37disruptekyou can ignore it if you know better.
18:34:42FromDiscord<dom96> And based on what Zevv has said it seems that CSP is also the plan forward, so knowing what I know about how Go works does help me
18:34:59FromDiscord<dom96> Zevv: yes, I know. I'm saying that it replaces those.
18:35:03supakeendisruptek: How would I ignore it in this case or how would I 'fix' this in nim-lang/redis (which would probably be a better approach).
18:35:11FromDiscord<krisppurg> any help?
18:35:11Zevvdom96: right!
18:35:31FromDiscord<krisppurg> msg ^
18:35:45disruptekdom96: it's a more general solution; more composable, more powerful.
18:36:02Zevvso, then there were discussions about doing this in userland (macros) or in the compiler, I think in the end the almighty A also acknowledged that macros would be the most appropriate path forward, for now
18:36:06disrupteksupakeen: are you using zedeus's redis pool?
18:36:13supakeendisruptek: I am using nim-lang/redis.
18:36:17FromDiscord<dom96> Right, so I'm writing a ESP32 program right now and I'm not planning to use async await. To be honest, I think the ESP-IDF library exposes enough to deal with the IO in a reasonably nice way
18:36:41Zevvsure, async is typically totally overkill on embedded stuff.
18:37:05FromDiscord<dom96> You mentioned above that you would like to use this for embedded stuff though, no?
18:37:07ZevvBut having the posibility to write your code linear, concurrent, and _not needing any kernel or os support_ for taking care of your concurrency
18:37:12Zevvthat is pretty nifty, imho
18:37:19supakeenNote that I'm fine using a different library but I'm also trying to learn *why* this is happening :)
18:37:39disruptekcps is to concurrency what arc is to memory management, basically.
18:38:06ZevvCPS is nothing but moving the stack to the heap and cutting your functions in pieces at the resume/yield border
18:38:14disrupteksupakeen: well, i don't use either lib, i just know that zedeus made his thing to solve a redis client problem.
18:38:49Zevvthe stack is an illusion. because we have support from the compiler and make it part of the language we don't need a full real stack per context.
18:38:53disrupteksupakeen: to ignore gcsafe you just take stuff with .gcsafe to get rid of compiler warnings.
18:38:56*Jesin quit (Quit: Leaving)
18:38:58disrupteks/take/tag/
18:39:03FromDiscord<dom96> Zevv: right, so it's a reimplementation of closure iterators that gives more control over the allocation
18:39:08disruptekyes.
18:39:15Zevvright.
18:39:17disruptekbut it's not limited to iterators.
18:39:45supakeendisruptek: Yes, but that'd involve patching nim-lang/redis so I'd like to know which part of it is causing the compiler to mark it as problematic :)
18:39:47ZevvAnd interestingly, a few weeks ago timothee came with a rfc out of the blue - that was not actually an rfc - where he noted that Nim could implement interators in Nim without having support from the language
18:40:04Zevvif he would have payed attention, he would have noticed this is exactly what disruptek had been doing
18:40:28disruptekas far as timmy is concerned, libraries aren't a thing.
18:40:34*Jesin joined #nim
18:40:57disrupteksupakeen: look for potential memory taint between threads.
18:41:10FromDiscord<nikki> in cps can you continue from the same frame multiple times
18:41:13supakeenSure, I'll search for taints.
18:41:16FromDiscord<nikki> or once continued is it lost
18:41:17disruptekyes.
18:41:25disruptekyou can just "fork".
18:41:29FromDiscord<nikki> cool. can you duplicate 'em. serialize 'em
18:41:30FromDiscord<nikki> cool
18:41:33disruptekyes.
18:41:34Zevvnikki: it's up to the user of the continuation
18:41:38Zevvyou can continue and throw away
18:41:44Zevvor you can continue twice, and then you have 2 code flows.
18:41:47Zevvsome people call that fork
18:41:52FromDiscord<nikki> can you kinda implement sth like common lisp consitions / restarts over it
18:41:59FromDiscord<nikki> conditions
18:41:59disruptekyes.
18:42:28FromDiscord<lqdev> wip nim linter for rxi/lite https://www.youtube.com/watch?v=S1ssBConEBc
18:42:36disrupteki'm hoping to apply cps to my testes.
18:42:41Zevvyou can zip() them, fold() them, map() them, all that
18:42:44*mika_ joined #nim
18:42:55FromDiscord<nikki> i like for loops
18:43:07disruptekhttps://github.com/disruptek/testes/issues/9
18:43:07disbotuse cps to clone env and run longer tests under criterion in another thread
18:43:08Prestigezip fold and map disruptek's testes?
18:43:26disrupteki've zipped my testes before.
18:43:29disruptekcannot recommend.
18:43:45disruptekfolding is fine, though it doesn't increase the performance.
18:44:01disruptekthe reduction in size is an illusion.
18:44:18FromDiscord<zetashift> cps doesn't work on Windows, it seems cross-platform concurrency seems to be really hard 😦
18:44:44disruptekit'll work. flywind ported a wheel timer to windows so we can use that selectors impl there.
18:44:58disruptekbut, really, cps has nothing to do with platform.
18:45:01FromDiscord<zetashift> oh nice!
18:45:09disruptekthat's merely a dispatcher feature.
18:45:40disruptekwe expect that many dispatchers will be developed. maybe we'll provide a toolset so you can build adhoc dispatchers really trivially.
18:46:14disruptekin most cases, your dispatcher can be written from scratch and it won't have any boilerplate to it.
18:46:26dom96async/await supports windows just fine 👀
18:46:36FromDiscord<shadow.> oh no
18:46:39FromDiscord<shadow.> not another async war
18:47:08disruptekthere's nothing to fight about. it's like bringing a knife to a gun fight.
18:48:27FromDiscord<zetashift> the papers look like a nice read, I hope I understand it when I go through it
18:49:16disruptekimagine it's playboy and just look at the pictures and ignore the articles.
18:49:25*hmmmmm quit (Quit: brb)
18:49:47FromDiscord<zetashift> That's how I go through life anyways
18:50:25*Cthalupa quit (Ping timeout: 240 seconds)
18:51:21*Cthalupa joined #nim
18:51:28Zoom[m]@lqdev looks cool!
18:51:35dom96So the problem for me with CPS/CSP is that it will be a very disruptive change. It needs to have more of an advantage than just removing colors from functions and making passing continuations around threads easier.
18:52:05dom96I'm by no means ruling it out, but as it is right now I don't think it's ready for action.
18:52:10disruptekit doesn't /need/ anything. it's a library. don't use it if you don't want to.
18:52:36*mika_ quit (Ping timeout: 240 seconds)
18:54:48dom96If it needs a dispatcher for windows then it does need something
18:55:45disruptekyou supply the dispatcher yourself.
18:55:51disruptekwe just happen to have written one for linux.
18:55:55dom96It's like me telling you to use nimkernel, it doesn't need anything, just a WM, drivers for ethernet, mouse, keyboard VGA, and whatever else you actually need to use it as an OS
18:56:27disruptekdom96: cps is designed for nim programmers.
18:56:44Zevvalso, it's a building block. I use it to make coroutines
18:56:46disruptekif you cannot bring rudimentary skills to bear, i don't know what to tell you.
18:56:46Zevvor exceptions
18:56:48Zevvor goto
18:56:51disrupteki hear there's a book on nim available.
18:56:58Zevvyou can use it to *make* async. But you don't have to
18:57:08dom96You need those building blocks to get started
18:57:13disrupteknah.
18:57:14dom96Someone has to make the first move
18:57:28disruptekthis is why you need to invest a little more time reading, some day.
18:57:34Zevvanyway, like disruptek said. It's a library. use it if you want, or not.
18:57:52disruptek!rfc cps
18:57:52disbothttps://github.com/nim-lang/RFCs/issues/295 -- 3next steps for CPS 7& 2 more...
18:57:57dom96Saying it can already replace async/await is simply misleading without these building blocks
18:58:00disruptekcomplete cps within.
18:58:07disruptekall the building blocks you need.
18:58:12disruptekfeel free to copy my code.
18:58:50dom96I'd love to use it, but I'm not going to reimplement an async dispatcher for all platforms for the third time
18:58:53disrupteklet's talk again once you've learned a bit more.
18:59:12dom96I expect most people feel that way
18:59:43ZevvI don't think anyone is forced to.
19:00:05zedeussupakeen: I've since forgotten exactly what I did, but my fork of the redis library is improved in various ways, including being quite a bit more efficient
19:00:27zedeusredpool works with the original and my fork
19:00:40supakeenzedeus: nice, i'll take a look at it tomorrow :)
19:01:21zedeusI was planning on extending the fork to match popular redis clients for other languages, but then real life happened
19:01:42supakeenas it does
19:09:06FromDiscord<adokitkat> Hello, is there any way to access fusion/smartptrs? I can't find it on 1.4.2 nor devel build. Thank you.
19:09:15disruptekzedeus: you should just take over nim-lang/redis.
19:09:50FromDiscord<dom96> @adokitkat do you have fusion HEAD installed?
19:12:16FromDiscord<adokitkat> @dom96 Thanks, that was the problem... I didn't know about the nimble package.
19:12:46disruptekthis boggles my mind.
19:18:21Zevvyour mind is easily boggled, of course
19:25:01*habamax quit (Ping timeout: 258 seconds)
19:25:01FromDiscord<mratsim> @dom96, I'm well on my way to implement bigint for the 4th time https://github.com/status-im/nim-stint/pull/104
19:25:04disbot[WIP] Refactor to use an array backend ; snippet at 12https://play.nim-lang.org/#ix=2HkS
19:25:50FromDiscord<mratsim> 1st was wrapping a C++ library, 2nd was Stint, 3rd was constantine, bigint for cryptography, 4th is refactoring stint with learnings.
19:26:16FromDiscord<dom96> @mratsim if I was getting paid to work on this stuff I would gladly reimplement async 100 times until perfection 🙂
19:27:23FromDiscord<mratsim> doing something 100 times is the best way to get disgusted by it
19:28:07FromDiscord<mratsim> anyway, my plan for tonight is seeing if I can reimplement Arraymancer in 2 different ways at the same time
19:28:33*Jesin quit (Quit: Leaving)
19:28:39FromDiscord<Daniel> Doing something many times can make you an expert in that field 🤔
19:29:07FromDiscord<mratsim> Some stuff you only need to do them once.
19:29:08FromDiscord<nikki> i think it takes 10k times to be expert?
19:29:15FromDiscord<mratsim> 10k hours
19:29:19FromDiscord<mratsim> not times
19:29:21FromDiscord<nikki> o ya
19:29:38FromDiscord<shadow.> does that mean im an expert at being alive
19:29:41FromDiscord<nikki> do thing for one hour 10k times
19:29:48FromDiscord<Zeus> That's if you subscribe to the Gladwellian idea of experience
19:29:49FromDiscord<nikki> @shadow. kinda
19:29:59FromDiscord<shadow.> so you become an expert at living when you're 1 year and 2 months old
19:30:01FromDiscord<shadow.> or around there
19:30:05FromDiscord<Zeus> (edit) "experience" => "expertise"
19:30:16FromDiscord<mratsim> some people have 10 times 1 year of experience you mean?
19:30:28FromDiscord<mratsim> instead of 10 years of experience
19:30:37*Jesin joined #nim
19:30:51FromDiscord<lqdev> @shadow. what if i'm dead inside
19:31:05FromDiscord<shadow.> that's a you problem
19:34:15FromDiscord<Vindaar> what are you gonna try?
19:35:12FromDiscord<zetashift> He is gonna try and write it in Rust /s
19:35:31FromDiscord<exelotl> You become an expert at staying alive for an hour :P
19:35:49FromDiscord<shadow.> damn
19:36:01FromDiscord<shadow.> is there any way to make constant re strings?
19:36:37FromDiscord<shadow.> `Regex` objects
19:37:36FromDiscord<nikki> pcre? probs not bc. c
19:37:49FromDiscord<nikki> i think nim-regex or w/e could do it tho
19:37:55mipriwith re you can only build them at module initialization time. with nim-regex const's an option I believe.
19:42:28FromDiscord<mratsim> @Vindaar Your PR for Laser and trying this for minitorch: https://forum.nim-lang.org/t/7230
19:42:52FromDiscord<mratsim> @zetashift tried Rust for 3 months, you don't want to use it for scientific computing
19:43:03FromDiscord<Vindaar> Oh I see. I thought it might be those 2, but "in 2 different ways" sounded more dramatic, haha
19:43:08FromDiscord<mratsim> @shadow. use npeg
19:43:16FromDiscord<shadow.> lmao
19:43:20FromDiscord<shadow.> is that the only way
19:43:55FromDiscord<mratsim> sent a long message, see http://ix.io/2Hl2
19:43:58FromDiscord<shadow.> nim regex?
19:43:59FromDiscord<shadow.> nre?
19:44:10FromDiscord<shadow.> or this
19:44:11FromDiscord<shadow.> https://github.com/nitely/nim-regex
19:44:13FromDiscord<mratsim> no nre is another pcre3 wrapper I think
19:44:17FromDiscord<shadow.> ahh ok
19:44:35FromDiscord<mratsim> but for compile-time support you need a pure Nim solution or loading C library at compile-time
19:44:51FromDiscord<shadow.> nim-regex is pure nim right
19:44:52FromDiscord<shadow.> so should work
19:44:55*tiorock joined #nim
19:44:55*tiorock quit (Changing host)
19:44:55*tiorock joined #nim
19:44:55*rockcavera quit (Killed (kornbluth.freenode.net (Nickname regained by services)))
19:44:55*tiorock is now known as rockcavera
19:45:00FromDiscord<shadow.> only thing is that's another dependency on the lib oof
19:45:06FromDiscord<mratsim> ah, you can also use staticExec/gorgeEx and use bash as your compile-time regex but that's even more hacky that compile-time libFFI
19:45:12FromDiscord<shadow.> yeahh
19:45:31FromDiscord<mratsim> Nim is flexible 😉
19:46:15FromDiscord<zetashift> @mratsim, I know haha, I've read your blogpost about Rust for scientific stuff
19:46:17mipriif you're doing this for performance, I'd stick with re and just put a let block at module toplevel. The little bit of runtime work you'd save, you'll lose on not having libpcre do the study/jit thing to your regexes.
19:46:22FromDiscord<zetashift> I was making a joke!
19:46:30FromDiscord<shadow.> that's exactly what im doing rn haha
19:46:45FromDiscord<shadow.> it just doesn't feel right having a var used by only one function top level
19:46:52FromDiscord<shadow.> but ig ill do that for nowp
19:46:53FromDiscord<shadow.> (edit) "nowp" => "now"
19:47:02FromDiscord<mratsim> Don't program in C or for embedded :p
19:47:13FromDiscord<shadow.> hm?
19:47:29FromDiscord<mratsim> for embedded you use a lot of globals
19:47:51FromDiscord<mratsim> and C also (or DEFINE) for library constants.
19:48:14FromDiscord<shadow.> ohhh fair enough
20:15:30FromDiscord<shadow.> !eval echo @[0] & @[1]
20:15:32NimBot@[0, 1]
20:15:35FromDiscord<shadow.> nice
20:25:05*hmmm joined #nim
20:25:28hmmm~areweCPSyet?
20:25:29disbotno footnotes for `areweCPSyet?`. 🙁
20:25:33hmmm:|
20:25:36*narimiran quit (Ping timeout: 256 seconds)
20:27:52*Jesin quit (Quit: Leaving)
20:33:22*Jesin joined #nim
20:33:31*spiderstew quit (Quit: Konversation terminated!)
20:34:24*spiderstew joined #nim
20:36:23*Vladar quit (Quit: Leaving)
20:38:54FromDiscord<shadow.> are there any cycle types?
20:38:58FromDiscord<shadow.> like for cycling through values
20:39:13FromDiscord<shadow.> can be in stl or nimble
20:39:32disruptekthere's a unicycle for when you only have one value and a bicycle for when you have two. i'm working on a tricycle but it's not ready for prime-time yet.
20:40:47mipriI have no idea at all what you mean by that.
20:41:25disruptekwell, the tricycle requires a fundamentally different approach because it completely omits procession.
20:41:25FromDiscord<shadow.> ah makes sense disruptek
20:41:36FromDiscord<shadow.> oh mipri like
20:41:43FromDiscord<shadow.> if i had a cycle of lets say `[1, 2, 3, 4, 5]`
20:41:51FromDiscord<shadow.> i could call next() on the cycle and it'd return the next value and so on
20:42:07FromDiscord<shadow.> it'd be easy to implement myself i just dont wanna do it if it has been made already
20:42:44mipriyou mean, next() on that array? not next() on a 5 of that type?
20:42:58FromDiscord<shadow.> well here
20:43:00FromDiscord<shadow.> let me make an example
20:43:28FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hlo
20:43:30FromDiscord<shadow.> something like that
20:43:32FromDiscord<shadow.> basically a circular list?
20:43:36FromDiscord<shadow.> maybe that's a better way to describe it
20:43:47FromDiscord<shadow.> ah i found one
20:43:49mipri...
20:43:50FromDiscord<shadow.> singularly linked ring
20:43:59FromDiscord<shadow.> what lol
20:44:08miprithat is a third completely separate thing
20:44:17FromDiscord<shadow.> im sure it could be used as one, no?
20:44:27FromDiscord<shadow.> id just have to use the next field on a node
20:45:20FromDiscord<shadow.> and keep track of currnode
20:45:48FromDiscord<kenran> Can I give a label to a `while true:` loop somehow? I have an inner `for` loop and wish to `break` out of it and the containing `while`. Or do I have to wrap a block around the `while`?
20:45:57disruptekwrap the while.
20:46:10FromDiscord<kenran> ty
20:46:53disruptekshadow.: if you can't rotate a deque yet, you should PR that feature.
20:48:46FromDiscord<shadow.> `deque.addFirst deque.popLast`?
20:49:17*mika_ joined #nim
20:49:33disrupteknot as such, but yes. rotateFront/rotateBack or whatever.
20:49:52disruptekprobably Head and Tail, i guess. i dunno. let some other knuckleheads bikeshed the name.
20:50:35FromDiscord<shadow.> yeah theres no rotate proc
20:50:58disruptekpoint is, rotation on a deque shouldn't require push/pop.
20:51:06FromDiscord<shadow.> ahh right
20:51:56FromDiscord<shadow.> something like `rotateBack(n: int)`
20:52:24disruptekmaybe you do rotate(), rotate(2), and rotate(^3).
20:52:28disruptekthat seems best to me.
20:52:33FromDiscord<shadow.> oh fair
20:53:16FromDiscord<shadow.> time to find where deques is in the repo
20:54:05*mika_ quit (Ping timeout: 256 seconds)
20:54:18FromDiscord<shadow.> found it
20:56:06*muffindrake joined #nim
20:56:41FromDiscord<Quibono> Rotate(-42)
20:57:11*mbomba joined #nim
20:57:18FromDiscord<shadow.> oh yeah that might make more sense lmao
20:57:27FromDiscord<shadow.> negative instead of negative index
20:57:37disrupteksupport both.
20:57:43FromDiscord<shadow.> ew they dont use fcs
20:57:44FromDiscord<shadow.> ufcs
20:57:49FromDiscord<shadow.> > `emptyCheck(deq)`
20:57:56FromDiscord<shadow.> `destroy(deq.data[deq.tail])`
20:57:59FromDiscord<shadow.> blech
20:58:05FromDiscord<shadow.> im guessing i should be consistent in style and naming?
20:58:07FromDiscord<InventorMatt> in algorithms there is a couple of rotation procs for openarrays they tend to use rotateleft and rotate right for it
20:58:27FromDiscord<shadow.> ah fair
20:58:45FromDiscord<shadow.> wait no
20:58:48FromDiscord<shadow.> they only have rotateLeft
20:58:54FromDiscord<shadow.> you just supply a negative
20:58:55FromDiscord<shadow.> for right
20:59:22FromDiscord<Quibono> Ewww
20:59:25FromDiscord<lytedev> bitops I think has rotate{Left,Right}
20:59:31FromDiscord<shadow.> fair
20:59:51FromDiscord<shadow.> alr well ill get to coding
20:59:57FromDiscord<lytedev> (edit) "rotate{Left,Right}" => "rotate{Left,Right}Bits"
21:00:11disrupteki guess it's okay to have two different names as long as they both support +/-/^ overloads.
21:00:54FromDiscord<lytedev> rotate vs shift rubs me the wrong way, though...
21:00:59FromDiscord<shadow.> well stl seems to only do rotateLeft
21:01:03FromDiscord<shadow.> which is odd but i want to be consistent
21:01:14FromDiscord<lytedev> just do rotateLeft then 👍
21:01:16FromDiscord<shadow.> yeye
21:03:24FromDiscord<shadow.> ohhhh
21:03:24FromDiscord<shadow.> i see
21:03:29FromDiscord<shadow.> you just shift head and mask
21:03:38FromDiscord<shadow.> and change first?
21:03:40FromDiscord<shadow.> or something like that
21:03:47disruptekyes.
21:03:54FromDiscord<shadow.> i see
21:04:07disruptekdon't worry about consistency.
21:04:26FromDiscord<shadow.> oh ok
21:05:01FromDiscord<Quibono> If I had my own language nothing would get done because I’d want everything to be consistent.
21:05:01FromDiscord<shadow.> `emptyCheck deq` it is
21:05:05FromDiscord<shadow.> lmao
21:06:31FromDiscord<Quibono> Like any circular stuff would use rotate(), any line type object would do shift(), etc.
21:06:47FromDiscord<shadow.> fair
21:06:56FromDiscord<lqdev> then make PRs to your repo and review your own PRs
21:07:05FromDiscord<lqdev> to make sure what you wrote makes sense
21:08:22FromDiscord<shadow.> ye
21:08:46FromDiscord<Quibono> Lol just make PRs to every inconsistency in Nim lol
21:09:09FromDiscord<Quibono> I don’t think I’m anywhere near at the point where I’d feel comfortable making a PR on someone’s stuff
21:09:21FromDiscord<shadow.> hmm
21:09:23FromDiscord<shadow.> idk how to test this
21:09:30FromDiscord<shadow.> bc im making a seperate file for now to test
21:09:33FromDiscord<shadow.> and the fields are private
21:10:05mipricall some procs that have access to those fields.
21:10:47mipriby doing so, your test can resemble the code that users of the library will write.
21:10:53FromDiscord<shadow.> oh fair
21:11:25disruptekuse `include` as a hack, but yeah, don't.
21:12:15FromDiscord<shadow.> or i could just edit the deques source and make them public but nah
21:12:17FromDiscord<shadow.> lmao
21:12:30FromDiscord<shadow.> might as well code how the users will
21:13:35FromDiscord<mratsim> you can use "include"
21:13:46FromDiscord<shadow.> dont think ive used that before, how does it wok?
21:13:47FromDiscord<shadow.> (edit) "wok?" => "work?"
21:13:56disruptekmagic pixie dust.
21:14:03FromDiscord<mratsim> it's as if you copy pasted the code
21:14:07FromDiscord<shadow.> ahh i see
21:14:08mipriit's C's #include
21:14:12FromDiscord<shadow.> how do you use it?
21:14:16miprijust like import.
21:14:18FromDiscord<mratsim> include foo
21:14:22disrupteksprinkle liberally.
21:14:28FromDiscord<shadow.> ohh ok
21:14:30FromDiscord<mratsim> but include in general beyond test is problematic
21:14:48FromDiscord<shadow.> fair
21:14:50FromDiscord<shadow.> yeah
21:14:54FromDiscord<mratsim> even for test it will not help you test visibility issue or will hide some if you use generics and templates.
21:15:29FromDiscord<mratsim> but should be good enough for starter I think the PR for importing private field is just around the corner
21:15:46mipriand it's not appropriate for this test either. You're adding a proc and want to ensure that it works as expected. So instantiate the type and call methods on it and confirm that those methods give you answers you expect. You should absolutely not be worrying about private fields here.
21:16:12FromDiscord<shadow.> fair enough
21:16:18disruptekthat PR is dumb, imo.
21:16:47FromDiscord<shadow.> hmm ok so i know i can at least shift stuff around by changing head, but i will need to edit the data seq in some way right, or no
21:16:54disrupteknah.
21:16:58FromDiscord<shadow.> damn alr
21:17:02FromDiscord<shadow.> time to figure that out
21:17:05disrupteknot unless i'm wrong.
21:17:12miprino, of course not.
21:17:12disruptekand, y'know, that never happens.
21:17:19FromDiscord<shadow.> true
21:17:34mipriyou're testing the behavior of the library. Use the library.
21:17:47disruptekcray cray
21:18:33FromDiscord<shadow.> ive certainly used it, just haven't had to worry about the internals but yeah i'll go learn how the backend is implemented
21:19:07mipriyou still don't have to worry about the internals, because you're writing a test.
21:20:11FromDiscord<shadow.> fair enough
21:20:44mipriif I'm writing a SuperImprovedDeque that has the same interface as this library but is implemented completely differently, I should be able to take its tests and change the import statement and use them without any other changes. Does rotateLeft work as expected? Put some numbers and rotate them and then pull them out and see if I get the rotated result.
21:21:47mipriinternal access isn't completely inappropriate for tests, but it's where I'd stuff something like expensive asserts that I don't in the library proper.
21:30:20FromDiscord<shadow.> im guessing i wont need to adjust tail for this, just head
21:30:33FromDiscord<shadow.> actually wait
21:30:33FromDiscord<shadow.> hm
21:35:51FromDiscord<shadow.> ok i got something but it def will fail 80% of the time
21:37:52FromDiscord<shadow.> for a rotation of one, could you just set the deq[tail] = deq[head] and then move up head by one?
21:38:00FromDiscord<shadow.> nvm
21:38:03FromDiscord<shadow.> that would move the data up one
21:38:06FromDiscord<shadow.> ima have to think abt this lol
21:39:45FromDiscord<kenran> sent a code paste, see https://play.nim-lang.org/#ix=2HlM
21:39:54FromDiscord<kenran> (edit) "https://play.nim-lang.org/#ix=2HlM" => "https://play.nim-lang.org/#ix=2HlN"
21:40:19FromDiscord<shadow.> i mean remove the parentheses
21:40:30FromDiscord<shadow.> but
21:40:40FromDiscord<kenran> I'm coming from languages where it's quite usual to use local `let`-bindings
21:42:59FromDiscord<InventorMatt> if you only need the value of x and y then that should be fine
21:45:03FromDiscord<treeform> @pietroppeter @hugogranstrom keep was interesting. I started with a very complex solution. I was very happy when I discovered a very simple way and it worked! https://github.com/treeform/benchy/blob/master/src/benchy.nim#L42
21:47:21FromDiscord<hugogranstrom> @treeform That's always a great feeling when you really nail it down 😄
21:47:27FromDiscord<shadow.> so i've got the rotation to work, but it does shift the deq data forwards which is a non
21:47:28FromDiscord<shadow.> (edit) "non" => "nono"
21:47:32FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HlR
21:47:34FromDiscord<shadow.> if this is happening am i doing it the wrong way?
21:47:41mipriyou can create a scenario with destructors where the style matters, but as a rule it's fine
21:56:46FromDiscord<shadow.> hmm
21:56:58FromDiscord<shadow.> i dont see how i can do this without shifting the data seq's head up by one
22:06:57FromDiscord<mratsim> modulo is your friend
22:08:07FromDiscord<shadow.> hmm yeah
22:08:11FromDiscord<shadow.> for multiple rotations right?
22:08:16FromDiscord<shadow.> im just gonna do one for now to get it odwn
22:08:18FromDiscord<shadow.> down
22:09:19FromDiscord<shadow.> oh wait i see
22:13:39FromDiscord<UNIcodeX> @treeform getting some visual artifacts a fidget example. Not sure if it's just my machine though.
22:14:19FromDiscord<UNIcodeX> the boxes have funny circles at the bottom left and right corners and some odd curved line at the top right corner. https://media.discordapp.net/attachments/371759389889003532/786355070945329202/unknown.png
22:15:45*FromGitter quit (Remote host closed the connection)
22:16:04*FromGitter joined #nim
22:16:07FromDiscord<UNIcodeX> (edit) @treeform getting some visual artifacts on a fidget example. Not sure if it's just my machine though.
22:16:18*azed joined #nim
22:18:09FromGitter<ynfle> Anyone use the `regex` packe?
22:18:17FromGitter<ynfle> Is the creator in here?
22:19:18mipriyes. dunno. ask a question about it.
22:30:39FromGitter<ynfle> Why doesn't this work? https://play.nim-lang.org/#ix=2Hm3
22:30:45FromGitter<ynfle> Any idea how to make it work?
22:31:31FromGitter<ynfle> @mipri
22:33:47miprihttps://play.nim-lang.org/#ix=2Hm4
22:35:09miprihttps://play.nim-lang.org/#ix=2Hm5
22:35:39FromGitter<ynfle> Thanks
22:36:09miprithe other change in the second link is removing a trailing space from the regex
22:37:12FromGitter<ynfle> Right
22:49:50FromGitter<ynfle> Stupid question but does it have to match the whole string?
22:50:56FromGitter<ynfle> Shouldn't it just match any such substring
22:51:22miprihttps://play.nim-lang.org/#ix=2Hm7
22:52:05miprifor some reason, I can only assume a sickness of the spirit, or hostile manipulations of otherworldly beings, people insist on making regex APIs that imply anchors into your regex.
22:52:35mipriso you have to read the docs to see what the alternative is that doesn't do this. for nim-regex it's find(); for re it's contains()
22:52:52FromGitter<ynfle> :shrug:
22:53:50FromGitter<ynfle> Thanks for your help
22:53:56FromGitter<ynfle> That wasn't obvious
22:54:20mipriif you're not aware of it, grab inim
22:54:24mipriyou can test this stuff interactively
22:57:54FromDiscord<shadow.> !repo inim-repl/inim
22:57:55disbothttps://github.com/inim-repl/INim -- 9INim: 11Interactive Nim Shell / REPL / Playground 15 378⭐ 18🍴
22:58:13FromGitter<ynfle> Ya I have it thanks
22:58:18*tane quit (Quit: Leaving)
22:59:18FromDiscord<adokitkat> Hi again. Is there a way to optimize Nims JS output for size? (Karax output)? ↵Or maybe a way to bypass this bug (I think it is this one at least) https://github.com/nim-lang/Nim/issues/7126↵I am running AsyncHTTPServer on ESP32 via nesper byt response bigger than 25+- kB will cause an exception and reboots it. I think Nim wants to access too large memory at once in `await reg.respond()`.
22:59:19disbotNo way to process async HTTP response in chunks
23:01:04FromGitter<ynfle> Not sure your issue, but try compile with `--opt:size`
23:02:22FromDiscord<adokitkat> thats not working really well unfortunately
23:02:26FromDiscord<ElegantBeef> Could you not run jsminifier on it?
23:03:46FromDiscord<adokitkat> @ElegantBeef oh thanks that shaved like 50 kB
23:03:52*Prestige quit (Quit: Prestige)
23:04:18FromDiscord<ElegantBeef> Seriously? 😄
23:05:03FromDiscord<adokitkat> original size is 143 Kb and output from online minfier is 93kB
23:06:28*Prestige joined #nim
23:08:39FromDiscord<adokitkat> compressed with gzip it has 17kB (the 143kB original was 22kB gzipped)
23:08:52FromDiscord<adokitkat> thats nice, thanks for a tip
23:33:01FromGitter<ynfle> @mipri Thanks, I worked it out. Inim is hard for debugging regex because it doesn't show you why it failed
23:35:40FromGitter<fish-face> Is there a stdlib way to perform a `map` in which the proc takes the index as well as the value?
23:37:20FromGitter<ynfle> You can do `toSeq(sequence.pairs)` Which will give you the index
23:38:00FromGitter<fish-face> ah yes
23:38:52FromDiscord<ElegantBeef> ynfle what are you parsing?
23:39:27FromGitter<ynfle> @fish-face You could also do `zip(toSeq(1..2), [1, 2])`
23:39:30*disruptek throbs.
23:39:51FromGitter<ynfle> @ElegantBeef I'll give you 25 guesses 😉
23:40:09FromDiscord<ElegantBeef> aoc bag problem?
23:41:19FromGitter<ynfle> Ya day 7
23:41:31FromGitter<ynfle> Only getting to it now cause of school
23:41:46FromGitter<ynfle> I started off using parseutils, but it got complicated quickly
23:41:50FromDiscord<ElegantBeef> Ah, i've just been jumping to strscan for aoc 😄
23:42:40FromDiscord<ElegantBeef> If curious of my super intelligent and not dumb impl https://play.nim-lang.org/#ix=2Hmo
23:42:44FromGitter<ynfle> Seemse really cool
23:42:56FromGitter<ynfle> I'll look at it once I'm done mine
23:43:17FromGitter<ynfle> Is it lighter weight than regex?
23:43:25FromDiscord<ElegantBeef> Less annoying imo
23:43:41FromGitter<ynfle> Not hard to beet
23:44:01FromDiscord<ElegantBeef> For instance `line.strscan("$i-$i", a ,b)` will have a and b both containing the integers at those positions in the `line`
23:44:15FromDiscord<ElegantBeef> Although you do currently have to predeclare the variables
23:44:22FromGitter<ynfle> Nice
23:44:56FromDiscord<ElegantBeef> I do have a PR which will probably die that injects the variables by using the pattern to find the type 😄
23:46:19FromGitter<fish-face> @ynfle I am doing AoC in Nim. My friend wrote a parser in Rust's PEGS equivalent to do Day 7
23:46:24FromGitter<fish-face> (I used regex)
23:46:26FromGitter<ynfle> Do you get to choose the variable names
23:46:37FromGitter<ynfle> Nice
23:46:44FromGitter<ynfle> That seems overkill
23:46:50FromGitter<ynfle> The regex is simple
23:46:55FromGitter<fish-face> Yes
23:46:56*lbart quit (Ping timeout: 240 seconds)
23:47:04FromGitter<fish-face> but it's a learning exercise so.. whatever you want to learn
23:47:14FromGitter<ynfle> But I guess overkill is a programmers other title
23:47:16FromGitter<ynfle> Ya
23:47:46FromGitter<ynfle> There were cool visualizations for the plane one on the subreddit
23:49:01*lritter quit (Quit: Leaving)
23:51:51*vicfred joined #nim
23:52:54FromDiscord<ElegantBeef> Yea zevv used npegs for his
23:53:03FromDiscord<ElegantBeef> I think it was that one, or one of them