<< 08-10-2020 >>

00:03:43*leorize quit (Ping timeout: 240 seconds)
00:04:08*abm quit (Ping timeout: 258 seconds)
00:04:47*leorize joined #nim
00:12:19*onionhammer quit (Quit: WeeChat 2.6)
00:13:48*Onionhammer joined #nim
00:16:56*onionhammer1 joined #nim
00:17:31*onionhammer1 quit (Client Quit)
00:21:29*axion joined #nim
00:22:58*krux02 quit (Remote host closed the connection)
00:23:41*onionhammer1 joined #nim
00:26:26FromDiscord<PizzaFox> `memfiles` seems like a much grosser api than `streams` when working with files, is there a reason to use memfiles instead of `streams`?
00:32:25FromDiscord<Elegant Beef> When you want memory mapped files
00:34:16FromDiscord<PizzaFox> sad
00:36:48FromDiscord<PizzaFox> unrelated question
00:37:24FromDiscord<PizzaFox> `--app:console|gui|lib|staticlib` what happens if you make a gui app without specifying `--app:gui`
00:37:57*ldlework quit (Ping timeout: 260 seconds)
00:41:44FromDiscord<Elegant Beef> Think it only matters on windows as it'll open the cmdprompt or equivlent
00:42:55*onionhammer1 quit (Quit: WeeChat 2.6)
00:50:52*axion quit (Quit: WeeChat 2.9)
00:54:10*skrzyp joined #nim
00:56:45*giaco quit (Ping timeout: 240 seconds)
00:57:30*giaco joined #nim
01:02:33FromDiscord<zannzen> so I'm sure this gets asked a lot but: is there a practical example of having an array with a custom index range of negative indicies? or is it just a side effect of allowing custom indicies?
01:02:41FromDiscord<zannzen> (edit) removed 'just'
01:03:59*skrzyp quit (Read error: Connection reset by peer)
01:10:34*giaco quit (Remote host closed the connection)
01:10:58*giaco joined #nim
01:12:58FromDiscord<exelotl> I suppose it could be useful in signal processing or image processing. For example you could blur an image using a 21x21 matrix with indices -10..10, -10..10
01:16:28*Tanger joined #nim
01:17:11FromDiscord<zannzen> ah ok thanks, so in areas where you'd normally be subtracting some offset from the index you can bake it into the index value. that makes more sense
01:19:49FromDiscord<PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2A2U
01:20:02FromDiscord<PizzaFox> (edit) 'https://play.nim-lang.org/#ix=2A2U' => 'https://play.nim-lang.org/#ix=2A2V'
01:20:16FromDiscord<PizzaFox> (edit) 'https://play.nim-lang.org/#ix=2A2V' => 'https://play.nim-lang.org/#ix=2A2W'
01:23:48FromDiscord<exelotl> lol nimsuggest got too painful for me. My computer would grind to a halt every 15 minutes so I just turned off nimsuggest in the vscode plugin
01:25:42*ldlework joined #nim
01:28:12FromDiscord<flywind> I also disable `nimsuggest`, use `tabnine` plugin and make life better.
01:32:54FromDiscord<PizzaFox> will try
01:41:43*apahl quit (Ping timeout: 272 seconds)
01:42:31FromGitter<BeboBBM> Hello guys
01:43:02*apahl joined #nim
01:44:03FromDiscord<flywind> hello
01:49:45FromGitter<BeboBBM> If you don't mind my question
01:50:08FromGitter<BeboBBM> If nim which has a lot of features generate C89 code which is an old version of c and doesn't has the features nim has ⏎ So how nim express this features using C89 code
01:57:23*leorize quit (Ping timeout: 240 seconds)
02:00:28FromDiscord<shashlick> it's like assembly not having object oriented capabilities but that doesn't stop C++
02:01:29*leorize joined #nim
02:02:46*Tanger quit (Ping timeout: 256 seconds)
02:04:01FromDiscord<Avatarfighter> I'm not exactly sure but this gives a rough idea of how the compiler works https://nim-lang.org/docs/intern.html
02:04:33FromDiscord<Avatarfighter> BeboBBM: Someone more versed in the compiler will probably answer
02:05:58FromGitter<BeboBBM> Thanks :)
02:11:03*opal quit (Ping timeout: 240 seconds)
02:13:17*opal joined #nim
02:50:22*muffindrake quit (Ping timeout: 260 seconds)
02:52:14*muffindrake joined #nim
03:05:33*Tanger joined #nim
03:13:53FromDiscord<shashlick> @leorize - how do we build csources today?
03:21:38*arecacea1 quit (Remote host closed the connection)
03:22:01*arecacea1 joined #nim
03:27:41FromDiscord<shashlick> looks like the csources directory is not shipped with nightlies anymore
03:28:53TangerHey folks, I have an issue (this is for INim) where I'm including a source file in an "embedded code" source file (see https://github.com/inim-repl/INim/blob/master/src/inimpkg/embedded.nim)
03:29:20TangerMy problem is that when you download the binary through nimble, it loses that file structure and so it fails to include that file
03:30:04TangerI'm wondering if there's a way to statically bundle the file into the nimble binary somehow
03:34:19FromDiscord<shashlick> is that the only file you want to include?
03:34:31FromDiscord<shashlick> see installDir, installFiles, installExt in the nimble docs
03:42:41*apahl quit (Ping timeout: 272 seconds)
03:43:15*apahl joined #nim
03:47:55FromDiscord<PizzaFox> htmlgen/compiler bug with `\`div\`` proc?
03:47:56FromDiscord<PizzaFox> (edit) 'htmlgen/compiler bug with `\`div\`` proc? ... ' => 'htmlgen/compiler bug with `\`div\`` proc?https://play.nim-lang.org/#ix=2A3q'
03:48:00FromDiscord<PizzaFox> (edit) '`\`div\``' => '`div`'
03:49:01FromDiscord<PizzaFox> (edit) 'https://play.nim-lang.org/#ix=2A3q' => 'echo div("a")'
03:49:08FromDiscord<PizzaFox> (edit) 'echo div("a")' => 'https://play.nim-lang.org/#ix=2A3r'
03:51:03FromDiscord<flywind> !eval import htmlgen; echo `div`("a", "b")
03:51:06NimBot<div>ab</div>
03:51:10FromDiscord<PizzaFox> How
03:51:20FromDiscord<PizzaFox> do i have to use the backticks
03:51:37FromDiscord<PizzaFox> i do
03:51:38FromDiscord<PizzaFox> what the hell
03:52:09Tangershashlick, Thanks for that mate, I wasn't sure how those worked with binary releases, but it looks like (from cursory tests) it works
03:52:19FromDiscord<Rika> because `div` is an "operator"
03:52:27FromDiscord<Rika> needs stropping
03:52:54FromDiscord<flywind> !eval import htmlgen; echo "a" div "b"
03:52:57NimBot<div>ab</div>
03:53:02FromDiscord<PizzaFox> ?????
03:53:14FromDiscord<PizzaFox> nim syntax has gone too far this time
03:53:21FromDiscord<PizzaFox> first python style indentation, now whatever this is
03:53:59FromDiscord<Rika> why are you still here then
03:54:10FromDiscord<PizzaFox> nim syntax is usually p cool
03:54:13FromDiscord<PizzaFox> except now
03:54:20FromDiscord<PizzaFox> this is not cool in my opinion
03:54:24FromDiscord<Rika> okay
03:54:40FromDiscord<Rika> there is a reason
03:54:52FromDiscord<PizzaFox> i sorta understand why
03:56:52*sealmove joined #nim
03:57:12FromDiscord<Elegant Beef> Do you sorta or completely?
03:58:57sealmoveHey what do you using TOML instead of YAML for nimitai is a good idea?
03:59:20FromDiscord<Elegant Beef> Rewrite please 😄
03:59:38FromDiscord<Rika> Got no opinion, I don't like either but shrug*
04:00:42FromDiscord<PizzaFox> i understand that its happening because of a name conflict with the division operator `div`
04:01:06FromDiscord<PizzaFox> which is defined with the funny backticks so nim doesnt recognize it as an overload
04:02:46sealmoveIt's simpler, works at compile-time, and I think capable of describing the same data.
04:03:49FromDiscord<Rika> If it's easier to make a parser for then sure
04:04:27FromDiscord<Rika> As an operator, not an overload
04:05:03*mmohammadi981266 joined #nim
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:02*arecacea1 quit (Remote host closed the connection)
04:06:29*arecacea1 joined #nim
04:06:45*supakeen joined #nim
04:10:26FromDiscord<Elegant Beef> The reason it's required is that `div` is a nim keyword, so there is an overlap
04:10:35sealmoveThere is already a working CT parser for TOML. It's dead-simple compared to YAML, and the syntax is equally nice.
04:12:39FromDiscord<Elegant Beef> Here is the full rundown https://play.nim-lang.org/#ix=2A3y
04:12:56FromDiscord<Elegant Beef> So if there was an html tag that was `if` we'd have an issue here as you can see
04:15:02*arecacea1 quit (Remote host closed the connection)
04:15:22FromDiscord<Rika> sealmove: then i'm up for it if it's not as hellish as yaml parsing is
04:15:41*arecacea1 joined #nim
04:19:06*FromDiscord quit (Remote host closed the connection)
04:19:22*FromDiscord joined #nim
04:21:09sealmoveGreat, I'll get to it. Nimitai will probably progress finally...
04:21:35sealmoveThis breaks compatibility with Kaitai Struct, but at this point I don't care.
04:21:59*muffindrake quit (Quit: muffindrake)
04:23:16sealmoveSince compatibility is broken, other cool stuff can happen, like Nim using expressions instead of some ad-hoc DSL-expressions.
04:23:29sealmoveusing Nim expressions*
04:23:52*mmohammadi981266 quit (Quit: I quit (╯°□°)╯︵ ┻━┻)
04:41:44*waleee-cl quit (Quit: Connection closed for inactivity)
05:00:08TangerNimble keeps throwing errors about paths. I've used installDirs to add some folders, but they go into "inimpkg/<files>", rather than the "src/inimpkg/<files>" that nimble appears to be looking for
05:00:31TangerI have a scrDir directive that points to the "src" folder in my project root
05:00:52TangerAnd installDirs set to ".", as it seems to add dirs relative to whatever srcDir is
05:01:51TangerI don't know why it's still looking for stuff in my "src/*" dir though, especially when it's not explicitly declared anywhere
05:02:05FromDiscord<acek7> how is everyone
05:02:39sealmove good, you?
05:02:46*solitudesf joined #nim
05:03:04FromDiscord<acek7> doin pretty alright
05:31:42sealmovehmm toml won't work, block nesting follows a dot notation instead of some tree-like one
05:34:38sealmovethis looks promising https://github.com/vstakhov/libucl
05:36:03ZevvI got a type that is defined in one of my source files, but also in an external lib that I happen to use. No I need to qualify each and every use of that type. Is there a way to tell to use _this_ version when ambiguis, unless stated explicitly?
05:36:49sealmoveHmm I don't think there is
05:37:23ZevvHmm. Time to rename my type then :(
05:37:55sealmoveDid you try to enforce full names for your external lib?
05:38:06sealmove`from x import nil`
05:38:17Zevvhmm
05:38:18sealmovethen maybe there won't be a conflict, not sure
05:38:19Zevvnot bad, not bad
05:40:52sealmoveZevv what do you think of UCL as an alternative to YAML for nimitai?
05:41:50Zevvit don't even know what that is
05:42:04sealmovepretty much just json sugar: https://github.com/vstakhov/libucl
05:49:30Zevvyeaah, we need more of these I guess
05:50:22sealmovecrafting an npeg grammar should be a matter of couple hours
05:50:29sealmoveor even minutes
05:50:37Zevvyeah
05:50:42Zevvjut pick the json from examples
05:50:44Zevvand hack it
05:51:05sealmoveit's perfect (*_*) nimitai can finally progress
05:51:14Zevvha
05:51:24Zevvwere you really stuck on the yaml?
05:51:35sealmoveyeah, screw yaml, I am done
05:51:43Zevvhooray for sealmove
05:51:56Zevvyou just made an important step in your career
05:52:01sealmovehaha
05:52:12Zevvbeing able to tell crap
05:52:25ZevvI am so sicking tired of people *not* being able to tell crap
05:52:38ZevvI am so sick and tired of *all* the discussions I have these days
05:52:58Zevvtrying to tell people they made crap, and how they should shove it out and make things *simple* again
05:53:56Zevvand after weeks of talking, someone pops up and says: hey guys, I just had this totally bright idea! We can just throw out fluentbit, kafak, elasticsearch, kibana and grafana, and just put it in syslog!
05:54:19sealmoveo.O wut
05:55:28Zevvyeah, wut
05:55:50Zevvand that's one case out of many
05:56:12*narimiran joined #nim
05:56:24sealmoveYou should write blog pages for these ideas. Will be totally entertaining!
06:00:09Zevvno man, people will read it
06:00:16Zevvthey still need to pay my bills
06:00:32Zevvtyping on #nim is already risky :)
06:05:08FromDiscord<Elegant Beef> Clearly you just need to shadow author
06:05:22FromDiscord<Elegant Beef> Vvez a totally unique name with no relation
06:05:37Zevvgood enough
06:11:46*a_chou joined #nim
06:12:26AraqZevv: import foo except TheType
06:14:31Zevvaah right
06:16:34*a_chou quit (Remote host closed the connection)
06:24:09FromDiscord<Elegant Beef> Damn i should've suggested that then
06:28:18Zevvalso one of these things I hate _soo_ much. They make me work with slack. That beast takes 20 seconds to load and render on my i5.
06:28:21Zevvwho wants that
06:35:29*jaens[m] quit (Quit: killed)
06:35:29*k0mpjut0r quit (Quit: killed)
06:35:29*GitterIntegratio quit (Quit: killed)
06:35:29*lnxw37d4 quit (Quit: killed)
06:35:32*reversem3 quit (Quit: killed)
06:35:37*leorize[m] quit (Quit: killed)
06:35:39*ee7[m] quit (Quit: killed)
06:35:44*planetis[m] quit (Quit: killed)
06:35:45*solitudesf1 quit (Quit: killed)
06:35:47*brainbomb[m] quit (Quit: killed)
06:35:48*VijayMarupudi[m] quit (Quit: killed)
06:35:48*Helios quit (Quit: killed)
06:35:50*MTRNord[m] quit (Quit: killed)
06:35:51*stisa[m] quit (Quit: killed)
06:35:52*unclechu quit (Quit: killed)
06:35:52*silvernode[m] quit (Quit: killed)
06:35:56*guelosk[m] quit (Quit: killed)
06:35:56*hnOsmium0001[m] quit (Quit: killed)
06:35:57*leorize[m]1 quit (Quit: killed)
06:35:57*BitPuffin quit (Quit: killed)
06:40:08*hyiltiz quit (Ping timeout: 272 seconds)
06:44:16*leorize[m] joined #nim
06:46:08*hyiltiz joined #nim
06:46:08*hyiltiz quit (Changing host)
06:46:08*hyiltiz joined #nim
06:46:46*mmohammadi981266 joined #nim
06:52:43*leorize quit (Ping timeout: 240 seconds)
06:58:02ZevvHm stdlib needs a `<=>` for use with sort()
06:59:29*leorize joined #nim
07:01:55FromDiscord<Rika> which is that
07:02:00FromDiscord<Rika> what* 0 iq rn
07:02:25idflesser, equal or greater
07:02:46FromDiscord<Rika> you mean cmp
07:02:48FromDiscord<Rika> ?
07:02:58idfi found this
07:03:00idfhttps://stackoverflow.com/questions/47466358/what-is-the-operator-in-c
07:03:06FromDiscord<Rika> https://nim-lang.org/docs/system.html#cmp%2CT%2CT ?
07:03:51idfso yeah cmp i guess
07:09:30*stisa[m] joined #nim
07:09:30*BitPuffin joined #nim
07:09:30*MTRNord[m] joined #nim
07:09:30*jaens[m] joined #nim
07:09:31*Helios joined #nim
07:09:31*codic joined #nim
07:09:31*k0mpjut0r joined #nim
07:09:31*unclechu joined #nim
07:09:31*hnOsmium0001[m] joined #nim
07:09:31*planetis[m] joined #nim
07:09:31*leorize[m]1 joined #nim
07:09:31*reversem3 joined #nim
07:09:31*lnxw37d4 joined #nim
07:09:31*GitterIntegratio joined #nim
07:09:31*brainbomb[m] joined #nim
07:09:37*VijayMarupudi[m] joined #nim
07:09:37*silvernode[m] joined #nim
07:09:37*solitudesf1 joined #nim
07:09:37*ee7[m] joined #nim
07:09:38*guelosk[m] joined #nim
07:11:43*codic left #nim ("Kicked by @appservice-irc:matrix.org : Idle for 30+ days")
07:11:54Zevvyeah but <=> is nicer
07:12:49FromDiscord<Rika> i dont agree, but you can always make one yourself
07:13:47idfyou can make a template for it
07:14:21Zevvyeah yeah sure
07:14:35Zevvbut cool stuff should go into the 'coolstuff' module
07:14:50Zevvand then get imported by system by default
07:15:34FromDiscord<Rika> feel free to patch your own install and make a pr 🙂
07:15:49idfi guess you could PR it into the `sugar` modules
07:16:00ZevvI will fork nim over this, you hear!
07:16:11supakeennivv
07:16:34Zevvnivv compiles a million lines per second on a commodore 64!
07:16:38FromDiscord<Rika> vvim xdddd
07:16:49idfimagine how epic would Nim on C64 would be
07:17:01idfi said would twice, it would be THAT epic
07:17:51FromDiscord<Rika> would would would would would would would would
07:18:07idfWould would Would a woulder woulding wool
07:22:59*PMunch joined #nim
07:33:00*VijayMarupudi[m] quit (*.net *.split)
07:33:00*planetis[m] quit (*.net *.split)
07:33:00*leorize[m] quit (*.net *.split)
07:33:00*lnxw37d4 quit (*.net *.split)
07:33:00*jaens[m] quit (*.net *.split)
07:33:00*dsrw quit (*.net *.split)
07:33:00*noonien quit (*.net *.split)
07:33:01*enthus1ast quit (*.net *.split)
07:33:11*dsrw joined #nim
07:33:28*noonien joined #nim
07:35:38*rockcavera quit (Ping timeout: 260 seconds)
07:35:41*VijayMarupudi[m] joined #nim
07:35:43*planetis[m] joined #nim
07:36:30*leorize[m] joined #nim
07:36:59*jaens[m] joined #nim
07:38:30*enthus1ast joined #nim
07:42:22*solitudesf quit (Remote host closed the connection)
07:42:48*solitudesf joined #nim
07:46:00ZevvWell, running nim *on* the c64 doesn't make sense, but I guess if you can find yourself a proper C compiler for the 6502 family you're set to run *nim programs* on the C64
07:46:08Zevvwe run on the atmel, that is fine as well
07:49:28FromDiscord<PizzaFox> is it more efficient to concat a bunch of arrays and turn that into a set or convert all the arrays to sets and add them together
07:50:23FromDiscord<Rika> the latter
07:51:34FromDiscord<Elegant Beef> It does depend on if we're talking about bit sets or hash sets i believe
07:51:47FromDiscord<PizzaFox> hash sets
07:53:29FromDiscord<Elegant Beef> Then it might be more efficient to do the latter
07:53:52FromDiscord<Elegant Beef> The real answer is test it
07:54:20FromDiscord<PizzaFox> ugh
07:54:49FromDiscord<PizzaFox> what if i just made the arrays into a really big csv and use str.find every time i wanted to check if something was included
07:54:54FromDiscord<PizzaFox> that would be good i think
07:55:00FromDiscord<Elegant Beef> Wouldnt be efficient
07:55:02FromDiscord<PizzaFox> 1 string allocation faster than 2-3 arrays
07:55:04FromDiscord<PizzaFox> 1 < 2
07:55:07FromDiscord<PizzaFox> simple math really
07:55:56*letto quit (Quit: Konversation terminated!)
07:57:59FromDiscord<Rika> :HyperYuunaBox:
08:00:04*letto joined #nim
08:02:01*krux02 joined #nim
08:14:01*hnOsmium0001 quit (Quit: Connection closed for inactivity)
08:15:04FromDiscord<shad0w> > Clearly you just need to shadow author↵@Elegant Beef i approve.
08:15:26FromDiscord<Elegant Beef> we know now that shadow searches for shadow when checking discord 😛
08:15:43FromDiscord<kodkuce> i want to die :(
08:15:51FromDiscord<kodkuce> go to pengine haven
08:15:54FromDiscord<shad0w> i've actually never done that
08:16:09FromDiscord<shad0w> it just happens lol
08:20:11PMunchIs jester broken on the latest stable? http://ix.io/2A4c
08:20:31FromDiscord<kodkuce> i am 90% sure somethign is bonkers with this asyncClose
08:21:46FromDiscord<kodkuce> https://media.discordapp.net/attachments/371759389889003532/763677503025709056/2020-10-08_101926.png
08:22:27FromDiscord<kodkuce> so i get https://media.discordapp.net/attachments/371759389889003532/763677674496983070/2020-10-08_102012.png
08:23:04PMunchAh, I had a cfg file for something else that must've enabled some weird setting
08:23:32FromDiscord<kodkuce> https://media.discordapp.net/attachments/371759389889003532/763677950775132160/2020-10-08_102119.png
08:23:51FromDiscord<kodkuce> https://media.discordapp.net/attachments/371759389889003532/763678025408839700/2020-10-08_102140.png
08:25:02FromDiscord<kodkuce> so it goes Why good for both connection, then jumps to WhyYYYY meaning it excapes try: except and crashes serwer
08:25:55supakeenI'm sorry, but what exceptions does isClosed/.close riase?
08:26:25FromDiscord<kodkuce> non
08:26:48FromDiscord<kodkuce> you see there is no output "failed to close" in console
08:27:48FromDiscord<kodkuce> basicly i have 3 async loops, 1 for connection wit h players 1 for conneciton with matchimakign and 1 for gamelogic
08:28:52FromDiscord<kodkuce> when i close player connection from GameLogickLoop it crashes whole app
08:30:43FromDiscord<kodkuce> see i get "Why good" thats is in process_player_ws callback, but as soo as it except i return whole callback so nothing else should rise exception
08:31:30supakeenThis is hard to tell without line numbers and in screenshots.
08:38:25FromDiscord<PizzaFox> why cant i↵```nim↵dir not in blocklistDirs↵```
08:38:39FromDiscord<Yardanico> notin
08:38:44FromDiscord<Yardanico> without space
08:39:02FromDiscord<PizzaFox> hmmmm
08:41:01FromDiscord<kodkuce> here if you want to look
08:41:02FromDiscord<kodkuce> http://ix.io/2A4g
08:42:42*arecacea1 quit (Remote host closed the connection)
08:43:35*arecacea1 joined #nim
08:44:41FromDiscord<kodkuce> here with error output at bot
08:44:42FromDiscord<kodkuce> http://ix.io/2A4h
08:44:54FromDiscord<kodkuce> i go chill my eye for 5 min it hurts
08:59:15*Vladar joined #nim
09:06:28*letto quit (Quit: Konversation terminated!)
09:08:52*Tanger quit (Quit: Leaving)
09:22:03*letto joined #nim
09:26:28*fowl quit (Ping timeout: 260 seconds)
09:26:46*fowl joined #nim
09:27:03*abm joined #nim
09:33:18*Trustable joined #nim
09:45:43*letto quit (Quit: Konversation terminated!)
09:46:11PMunchAny particular reason why my fixes to openssl hasn't been merged into stable?
09:47:52AraqPMunch, link?
09:48:01Araqand what is "stable"? 1.2 or 1.0?
09:53:03PMunchIt's in neither
09:53:19FromDiscord<Yardanico> Maybe you mean version-1.4 branch?
09:53:30FromDiscord<Yardanico> oh sorry didn't read
09:53:34*supakeen reads
09:53:53*idf cant read
09:54:06PMunchhttps://github.com/nim-lang/Nim/pull/14137
09:54:07disbotAdd RSA key reading and encrypt/decrypt to openssl
09:54:12PMunchhttps://github.com/nim-lang/Nim/pull/14223
09:54:13disbotAdd procedures to read RSA keys from BIO format
09:54:16PMunchI mean they are both merged
09:54:46FromDiscord<Yardanico> But you didn't say backport :P
09:55:14PMunchhttp://ix.io/2A4w
09:55:21supakeenSpeaking of, is this a weird functionality that I'd expect it to work that way: https://github.com/nim-lang/Nim/pull/15483 ?
09:55:21disbotasyncftpclient onProgressHandler always start/end.
09:58:17FromDiscord<Yardanico> @PMunch well, you usually tag the PR or commit with [backport] so Miran then backports it
10:03:23PMunchWell it should still have been in 1.2.6 no?
10:07:03FromDiscord<Yardanico> Why?
10:07:14*D_ quit (Ping timeout: 272 seconds)
10:07:48FromDiscord<Yardanico> Most commits are only available in new minor versions, not in previous ones
10:11:53PMunchWell these PRs were made between 1.2.0 and 1.2.2
10:12:29FromDiscord<Yardanico> Well I just mean that if you want a PR to be backported, you usually mark it as such :)
10:12:56*giaco quit (Ping timeout: 272 seconds)
10:12:57FromDiscord<Yardanico> and if there are no backport tags, it's not usually backported
10:13:29*giaco joined #nim
10:14:22narimiranPMunch: "these PRs were made between 1.2.0 and 1.2.2" -- that's already nim 1.3 period
10:14:44narimiranonce 1.x.0 is released, we're working on 1.x+1.0
10:14:59PMunchAh, so they will be in 1.3, but not in 1.2.x unless I specify backport?
10:15:28narimiranPMunch: yes, part of the next minor (not patch) stable release. in this case: 1.4.0
10:22:14PMunchAh right, we're skipping the odd ones there as well
10:31:55PMunchHmm, I have a folder of files, what's the best way to pick one at random?
10:32:30*D_ joined #nim
10:32:54FromDiscord<Yardanico> use random.sample on a seq of file names?
10:42:13PMunchGood idea!
10:44:29PMunchHmm, no easy way to list the contents of a folder though..
10:49:58*letto joined #nim
11:00:27FromDiscord<Yardanico> With walkDir it's like 3 lines though
11:02:37PMunchWith execCmdEx it's one line
11:02:56PMunch`file = execCmdEx("find " & folder & " -type f -name *.priv").output.splitLines[0..^2].sample`
11:03:15PMunchUgly as sin, but this is only a small script to create and send some DNS requests
11:07:03*leorize quit (Ping timeout: 240 seconds)
11:07:53*Vladar quit (Quit: Leaving)
11:08:53*leorize joined #nim
11:14:12*narimiran quit (Ping timeout: 258 seconds)
11:16:03*leorize quit (Ping timeout: 240 seconds)
11:17:16FromGitter<gogolxdong> What does this mean `Error: system module needs: echoBinSafe`
11:17:58FromDiscord<Yardanico> show the command you're using for compilation
11:18:22FromGitter<gogolxdong> nim c -r --hints:off --warnings:off -d:genode dagfs_repl.nim
11:19:14FromDiscord<Yardanico> Seems like genode target doesn't support echo
11:19:37FromDiscord<Yardanico> also you should use --os:genode
11:21:01FromDiscord<Yardanico> Also you should use cpp backend for genode
11:21:13FromDiscord<Yardanico> I hope you're not mistaking nodejs for genode :)
11:21:21FromDiscord<Yardanico> These are two entirely different things
11:21:28idfgenode is cool
11:22:03FromDiscord<Yardanico> it is, and Nim support is there
11:22:43FromGitter<gogolxdong> Have no idea about genode
11:22:49ehmrynot well supported, I need to fix it up
11:23:42FromDiscord<Yardanico> @gogolxdong why did you do -d:genode then? :(
11:23:44FromDiscord<Yardanico> :)*
11:23:51FromDiscord<Yardanico> genode isn't related to nodejs
11:25:41ehmrygogolxdong: what are you trying to build?
11:26:32FromGitter<gogolxdong> https://github.com/refaqtor/dagfs
11:30:03ehmrylooks like something I wrote a while ago, that was replaced with https://git.sr.ht/~ehmry/blobsets
11:30:19FromDiscord<hobbledehoy> Is that like IPFS?
11:30:29FromGitter<gogolxdong> yes
11:31:05idfi guess he just mistook the compiler flags
11:31:07idfmistook?
11:31:08idfmistaken?
11:31:09ehmryi tried to reimplement IPFS but decided I didn't like it so I did something simpler
11:31:45*rokups joined #nim
11:32:06ehmryidf: running geminim on genode is on my TODO list
11:32:17idfniceee
11:32:20idflet me know how it goes
11:32:44idfreally curious
11:33:43FromGitter<gogolxdong> @ehmry, reimplement IPFS in Nim? Why you don't like IPFS, just curious.
11:34:38FromDiscord<Yardanico> @ehmry what do you think of genode as an OS (framework) for a workstation? Are there any genode-based desktop oriented OSes?
11:34:48ehmrygogolxdong: i thought that is was too-extensible and overengineered
11:35:46FromGitter<gogolxdong> I'm working on something like IPFS as well, maybe we can do it together.
11:36:10ehmryYardanico: there is sculpt which I used for about a year, but I don't like the way things are configured
11:37:12*Sembei quit (Ping timeout: 258 seconds)
11:37:19ehmrygogolxdong: I've stopped doing FS stuff, I'd like to get back to it, but not for a while. but if you have any questions about this old code please ask
11:37:39FromGitter<gogolxdong> blobsets lookes like dagfs :)
11:37:54idfi was thinking of learning about doing FS stuff
11:38:03ehmryyea, was the next iteration, with a flat layout
11:39:00ehmrygenode is constant yak-shaving, right now I'm working on a dhall-interpeter in nim, so I can generate genode configurations on-target with a high-level language
11:39:49ehmrywhen I finish that I can test the nim/genode toolchain again
11:43:31Araqwhy not use Nim macros to generate these configurations?
11:43:42FromDiscord<jseb> ok… in the category WTF we have the Ale plugin (linter for vim) which stops all activities when there is a .nims associated to the source currently edited
11:45:44ehmryAraq: I don't mean generate toolchain configurations, but I will probably use some nimscript with dhall
11:52:37Araqno idea why you would use dhall, it's like JSON, but even worse
11:55:38ehmryI like dhall because you have to implicitly write schemas as types, which I think is scaleable because types can compose, or something like that
11:56:05ehmrythe dhall has to conveted to something like JSON, I wouldn't want to embed the interpreter into everything
11:56:58Araqlet Prelude =
11:56:58Araq https://prelude.dhall-lang.org/v11.1.0/package.dhall great so the config subsystem must be able to perform downloads
11:58:19supakeenNot specifically the worst, UCL allows this as well but with signing and it's kind-of nice there.
11:58:28supakeen(removes a lot of need for configuration management systems ...)
11:59:17ehmryyea, which is why you wouldn't want it embedded. I don't like the downloads, but everything can be frozen and cached offline if the imports have hash checks
12:00:48ehmrycontent addressed imports seems like a hack to avoid making another package manager
12:01:01supakeenI'd like it more if we could do (in UCL) a `section or { url }` where if the URL can't be found/validated the section gets used but hey.
12:01:13supakeenPerhaps the world is ready for yet another configuration language ;)
12:01:20Araqthe type system is nice but under-specified. is 'Integer' 32 bits?
12:01:50*a_b_m joined #nim
12:03:30ehmryAraq: its arbitrary, so bignum
12:04:57Araqok
12:05:05*abm quit (Ping timeout: 240 seconds)
12:05:12ehmrythere is no comparision of strings or conversion from strings to numbers, which is strange
12:05:45*rockcavera joined #nim
12:05:48Araqthere are also apparently no binary strings
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:29ehmryyes, and there are rules on strings like no non-printing runes
12:06:41*supakeen joined #nim
12:06:58Araqusing Unicode ≡ but then also || and && is a strange choice, but that's nitpicking
12:07:17Araqah I am misreading
12:07:22Araqthey use ==
12:08:30ehmryno, ≡ is equivalent to === but not ==
12:08:48ehmrycode can be in unicode, ascii, or binary form (CBOR)
12:09:09ehmrythe binrary form is used for the semantic hashes and caching
12:11:47Araqit's a decent design, I give it a B. I still mind the Turing incompleteness.
12:12:49Araq"Here is a proof that is always terminates" - "Here is the Ackermann function in dhall. It terminates in one billion years." - "la la la, I'm not listening"
12:13:49ehmryyea, its hard to write code that accidentally takes a billion years to solve but easy to import
12:13:57Araqjust add an instruction count limit to the VM, bam, done. You need it *anyway*...
12:16:23Araqthe much better design is to not support functions at all. Like JSON does it... But then that's not covered by a cargo-cult CS term, so we get "a total programming language" instead.
12:21:00ehmryI think functions are necessary but some people will try to do to much with the language
12:26:29ehmryI need to finish the type checker and put some porcelain on top and this thing is done
12:27:48Araqthe following configuration formats get by without functions: YAML, JSON, ini files, the Windows registry, the Gnome registry.
12:29:48Araqin fact, before dhall it kinda was the defining aspect of a "configuration" language. :-)
12:31:03supakeentoml!
12:31:14idfcsv
12:31:19supakeenxml!
12:31:32FromDiscord<Yardanico> toml
12:31:41Araq^ yes. Thank you.
12:32:46supakeenIf that's a configuration language then my next project will use LD_PRELOAD for configuration.
12:33:48FromDiscord<kodkuce> why am i now getting this
12:33:49FromDiscord<kodkuce> expression 'hangup(p.conn)' has no type (or is ambiguous)
12:33:55idfi dont know much about dhall but I would rather have a configuration langauge that is either turing complete or not at all
12:33:59supakeenHenceforth my programs shall not just have `--config` arguments but also `--config-binary` which can output the config.
12:34:09FromDiscord<Yardanico> Show the whole line @kodkuce
12:34:12supakeenThat way people can write their configuration binary in any language they like :)
12:34:14FromDiscord<kodkuce> how can it have no type when i defind p : WebSocket
12:34:30FromDiscord<kodkuce> /home/me/Documents/Projects/grammergame/src/minimal.nim(44, 28) Error: expression 'hangup(p.conn)' has no type (or is ambiguous)
12:34:40FromDiscord<Yardanico> i mean whole source code line
12:34:49FromDiscord<Yardanico> You're probably trying to discard void
12:34:51FromDiscord<kodkuce> https://media.discordapp.net/attachments/371759389889003532/763741190931218432/2020-10-08_143243.png
12:35:07FromDiscord<Yardanico> hangup returns nothing
12:35:10FromDiscord<Yardanico> You can't await it
12:35:10FromDiscord<kodkuce> oh
12:35:11FromDiscord<kodkuce> ye
12:35:12FromDiscord<kodkuce> sorry
12:35:14FromDiscord<kodkuce> :)
12:38:19*leorize joined #nim
12:47:35idfwhy stop at binary configuration files? make your executable require a .so or .dll with your configuration
12:47:59supakeen:)
12:50:46FromDiscord<Yardanico> that's what he meant
12:50:52FromDiscord<Yardanico> At least I understood it this way
12:52:10*a_b_m quit (Read error: Connection reset by peer)
12:52:31*a_b_m joined #nim
13:01:23PMunchI had a pretty interesting discussion about this with alehander back when I was working on using NimScript for configurations
13:03:10*NimBot joined #nim
13:10:54*waleee-cl joined #nim
13:16:16FromDiscord<kodkuce> yo
13:16:17FromDiscord<kodkuce> yo
13:16:18FromDiscord<kodkuce> yooo
13:17:56FromDiscord<kodkuce> http://ix.io/2A5U
13:18:17FromDiscord<kodkuce> so this when i run on desktop work no poblem
13:18:59FromDiscord<kodkuce> but when i run it on raspbery pi 4 behind nginx SSL i get
13:19:12FromDiscord<kodkuce> Exception message: File descriptor not registered.↵Exception type: [ValueError]
13:19:28FromDiscord<kodkuce> ofc you need to make connection to test
13:19:34FromDiscord<kodkuce> https://www.websocket.org/echo.html
13:19:37FromDiscord<kodkuce> i used this
13:19:56FromDiscord<kodkuce> so basicly code work just goes bonkers on nginx rpi4 ssl
13:20:09FromDiscord<kodkuce> so anyway to narrow this down
13:20:25FromDiscord<kodkuce> http://ix.io/2A5V
13:20:38FromDiscord<kodkuce> here same with no nuberd lines
13:20:49FromDiscord<kodkuce> so i am not tarderd something else is tarding me
13:28:13FromDiscord<kodkuce> anyone else running an rpi4?
13:29:28FromDiscord<kodkuce> dont think i am missing any lib it would compain and it runs, guess that file discriptior thingy has something to do with io but duno what
13:37:43FromDiscord<kodkuce> ofc am talking about when connection closes, my issue that i am dealing last 2 days
13:37:48FromDiscord<kodkuce> will post on forum too
13:37:54*rockcavera quit (Remote host closed the connection)
13:40:04*axion joined #nim
13:44:31PMunchHuh, seems like readFile can overflow the amount of open files
13:44:38PMunchPossibly when it fails too often
13:50:03FromDiscord<kodkuce> this heppends evry thime on rpi4
13:50:08FromDiscord<kodkuce> 10 of 10 runs i thikn
13:51:55FromDiscord<kodkuce> just tryed 3 times in a row it heppends evry time
13:55:21FromDiscord<kodkuce> hmm will open port directly to app running to see if ngixn is making some issue tough dont think if it should be any
13:56:27*natrys joined #nim
13:56:28*noonien quit (Quit: Connection closed for inactivity)
13:59:24Oddmongerhuuumm… if i have a variable in a switch(…) of a nims, nimsuggest stops working
13:59:50Oddmongerthat is: switch( "hints", want_hints) #die
14:00:05Oddmonger switch( "hints", "off") #works
14:00:47Oddmongerso it breaks alaviss :(
14:01:25Oddmongerwell… Makefile is not so bad after all
14:01:42Yardanicomeh
14:02:48idfnake
14:02:59Yardaniconimlsp with vscode-nim-lsp extensions works ok for me
14:03:01Yardanicoeven with a nims file
14:03:07Yardanicoand nimlsp uses nimsuggest
14:03:10*mmohammadi981266 quit (Quit: I quit (╯°□°)╯︵ ┻━┻)
14:05:56Oddmongeryes i use nimlsp
14:06:49Oddmongerbut it seems nimsuggest doesn't like nims whose tasks need variables
14:09:56*PMunch quit (Quit: leaving)
14:12:22Yardanicoidk, doesn't crash for me on latest develk
14:13:27Oddmongernimble install nimsuggest ?
14:13:28*muffindrake joined #nim
14:14:05Yardaniconimsuggest is a part of nim installation
14:14:55Oddmongerah ? so not that ? http://ix.io/2A66
14:16:03Oddmongernim -v says 1.2.6 because stable, so i should install something else ?
14:16:31Yardanicoseems like excercism is doing some of their tooling in nim
14:16:34Yardanicohttps://github.com/exercism/tooling-webserver
14:16:36Yardanicohttps://github.com/exercism/canonical-data-syncer
14:17:51FromDiscord<kodkuce> OK so when i run this not behind nginx it does not crash, so its ssl issue or nginx issue, tough still dont get why one relates to other code crash
14:18:22Yardanicohttps://github.com/exercism?language=nim
14:18:35YardanicoOddmonger: I don't think it'll help you
14:19:02FromDiscord<kodkuce> i like exercism
14:19:32OddmongerYardanico: ah i was about to install 1.3.5
14:19:40YardanicoI mean you can try
14:19:49Yardanicobut nimlsp uses nimsuggest not as a binary
14:19:55Yardanicobut as a nim module
14:20:45Oddmongerwell i can try , when in doubt…
14:30:55Oddmongerok no change
14:31:07Oddmongerlet's go home with make
14:31:41Yardanicoyou don't have to use a config.nims
14:31:56Yardanicoyou can just use nims as standalone
14:32:00Yardanicoand then "nim e myfile.nims"
14:35:43*leorize quit (Ping timeout: 240 seconds)
14:36:20Oddmongerah with the source file as paramter in setCommand
14:36:36Oddmongerthank you for the suggestion
14:36:46FromDiscord<hugogranstrom> I'm getting different numerical results in NumericalNim with the 1.4RC than in 1.2.6 (error is 1e-13 instead of 1e-15). Is there anything that has changed in how floats are handled? Specifically float literals?
14:41:15Yardanicoi don't recall anything like that, and didn't find anything like that in the changelog at least :P
14:41:34Yardanicomaybe you could provide a self-contained snippet showing that difference?
14:42:28FromDiscord<hugogranstrom> I'll give it a try 🙂
14:48:19FromDiscord<hugogranstrom> Here is a "simple" example: https://play.nim-lang.org/#ix=2A6g
14:48:54Yardanicothe result is the same though?
14:48:59FromDiscord<hugogranstrom> It echos `-1.110223024625157e-15` on 1.2.6 and `-2.220446049250313e-16` on devel
14:49:08Yardanicoon my pc (latest devel) and on playground for 1.2.6
14:49:17Yardanicoboth -1.110223024625157e-15
14:49:30FromDiscord<hugogranstrom> Strange :/
14:49:40FromDiscord<hugogranstrom> I updated devel yesterday
14:49:40Yardanicomaybe architecture difference? or different cpus or something?
14:49:44Yardanicoor maybe you hit a CPU bug? :D
14:50:13FromDiscord<hugogranstrom> Perhaps, but use the same cpu for both 😛
14:50:20FromDiscord<hugogranstrom> *but I use
14:50:40FromDiscord<hugogranstrom> It's only the Nim version that's different
14:51:22Yardanicowell, it's really strange, I get the normal value on my pc as I said
14:53:57FromDiscord<hugogranstrom> Ok, thanks 🙂 I'll try and see if I can find something
14:54:04FromDiscord<shashlick> @Yardanico - how did you reproduce that nimsuggest bug yesterday
14:54:12Yardanicowhich one exactly?
14:58:42*hnOsmium0001 joined #nim
15:05:33*Vladar joined #nim
15:11:37*tane joined #nim
15:22:39*narimiran joined #nim
15:36:22*leorize joined #nim
15:42:16FromDiscord<For Your Health> Is there a way to write a compile time map?
15:42:42FromDiscord<Yardanico> what do you mean exactly? a table?
15:42:49FromDiscord<Yardanico> do you want to use it later at runtime but generate at compile time?
15:43:12*nature joined #nim
15:43:38FromDiscord<kodkuce> so anywya know why this file discript error heppends when i close if i use nginx to proxy pass to it?
15:44:34FromDiscord<kodkuce> https://forum.nim-lang.org/t/6903
15:44:54FromDiscord<kodkuce> hmm to switch to HA proxy, or am i missing soemthing
15:44:59FromDiscord<For Your Health> I want to document at compile time about 150 keyboard keys and their corresponding keycodes and then use that information at runtime to check if certain keys are pressed
15:45:55FromDiscord<Yardanico> yeah it's entirely possible
15:46:53FromDiscord<For Your Health> What would be the best way to do that? I'm new to nim so I don't know my way around yet. Ideally I think it would be a mapping between an enum and the keycode
15:47:23FromDiscord<For Your Health> I know a pure enum could probably be used but I'm also wondering about if it just so happened that I wasn't mapping to an int
15:47:44FromDiscord<Yardanico> well, I still didn't understand a bit - what exactly do you mean by "keys and their keycodes"?
15:47:47FromDiscord<shashlick> @Yardanico - https://github.com/nim-lang/Nim/issues/12684
15:47:49disbotnimsuggest crash with import after encountering undeclared type ; snippet at 12https://play.nim-lang.org/#ix=2A6I
15:48:15FromDiscord<Yardanico> @shashlick I mean the same way as in the issue
15:48:32FromDiscord<Yardanico> @For Your Health do you mean like "K key": VK_K (windows keycode) or something
15:48:47FromDiscord<shashlick> i tried yesterday, nothing happened
15:49:11FromDiscord<Yardanico> it won't work if you don't have pkg/compiler/nimeval
15:49:12FromDiscord<For Your Health> So for instance, they keyboard key A has a keycode of 65. I would like to be able to do something like: keyIsPressed(KeyboardKey::A) or something like that
15:49:30FromDiscord<For Your Health> (edit) 'they' => 'the'
15:49:32FromDiscord<Yardanico> you can assign enum members to specific int values
15:49:40FromDiscord<Yardanico> you don't even need a map in this case 🙂
15:49:44FromDiscord<shashlick> i don't
15:50:04FromDiscord<Yardanico> @shashlick try↵var x: Undeclared↵import compiler/nimeval
15:50:41FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2A6J
15:51:11FromDiscord<For Your Health> Out of curiosity, how would it be done with a map?
15:51:21FromDiscord<Yardanico> in nim maps are tables
15:51:24FromDiscord<shashlick> still worked fine - doesn't crash
15:51:29FromDiscord<Yardanico> with nimsuggest?
15:51:32FromDiscord<Yardanico> nimsuggest file.nim
15:51:33FromDiscord<shashlick> ya
15:51:34FromDiscord<Yardanico> chk file.nim
15:52:07FromDiscord<Yardanico> @For Your Health well, you can do it with a table where keys are enum members and values are ints
15:52:12FromDiscord<Yardanico> or where keys are strings and values are ints
15:52:20FromDiscord<Yardanico> but the solution with the enum is the cleanest for this usecase imo
15:52:47FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2A6K
15:52:56FromDiscord<Yardanico> so here it'll print 67 since C is 65 + 2
15:53:02FromDiscord<For Your Health> Yeah the enum solution is decent, the only annoying thing is that the keyboard keycodes jump around sometimes
15:53:09FromDiscord<For Your Health> They aren't always in +1 order
15:53:31FromDiscord<For Your Health> So if I want to construct an array of all of the keyboard press states, there are going to be gaps in it
15:53:42FromDiscord<Yardanico> well enums with holes in nim are allowed but some operations on them can't be done
15:53:45FromDiscord<Yardanico> but they'll work for your use case
15:55:01FromDiscord<For Your Health> The way I would do it in a different language is to have an enum with all of the key variants, and then have a function that takes a variant of that enum and spits out an int
15:55:11FromDiscord<For Your Health> The only problem with that is that I end up having to write all of the keynames down twice
15:55:32FromDiscord<For Your Health> Which is annoying when there are 150 ish of them
15:55:34FromDiscord<Yardanico> well, you can do the same in nim, but enum values can be converted to int directly as you've seen
15:55:59*renfield joined #nim
15:56:03FromDiscord<Yardanico> it would probably be even better if you define your keyIsPressed as proc keyIsPressed(key: KeyboardKeys)
15:56:11FromDiscord<Yardanico> and convert enum member to an int inside of that proc
15:56:24FromDiscord<Yardanico> so you don't have to write "KeyboardKey.C.int" each time you call keyIsPressed
15:56:54FromDiscord<For Your Health> Yeah that is the ideal solution, a proc that you pass a keyboard key enum variant to to check if it is pressed
15:57:31FromDiscord<lqdev> keycodes are a well-defined standard
15:57:35FromDiscord<lqdev> scancodes, however, are not
15:58:07FromDiscord<For Your Health> I am specifically working with the windows API only so for my case the values are defined
15:58:20FromDiscord<Yardanico> can't you just use winim?
15:58:48FromDiscord<Yardanico> https://github.com/khchen/winim/ https://github.com/khchen/winim/blob/d300192c588f73dddef26e3c317f148aa23465c3/winim/inc/winuser.nim#L1223
15:59:30FromDiscord<For Your Health> I will look into that. I'm new to nim so I barely know any libraries and things at the moment
16:00:40FromDiscord<For Your Health> So say I had to do a compile time map between some enum variant and something that wasn't conveniently an int. What would I do then?
16:00:47FromDiscord<For Your Health> Just out of curiosity
16:02:23FromDiscord<For Your Health> (edit) 'variant' => 'variants'
16:03:37FromDiscord<Yardanico> @For Your Health enums can also map to strings
16:03:43FromDiscord<Yardanico> but for other types you can just use tables module
16:04:12FromDiscord<Yardanico> or an array
16:04:15FromDiscord<Yardanico> or a proc
16:04:25FromDiscord<For Your Health> Alright I will look into it. I think at some point I need to map between an enum variant and a custom object
16:14:25*Prestige quit (Quit: Prestige)
16:15:42*Prestige joined #nim
16:40:31*rockcavera joined #nim
16:45:22*rockcavera is now known as Guest59075
16:45:22*rockcavera joined #nim
16:48:19*Guest59075 quit (Ping timeout: 246 seconds)
16:50:00*tiorock joined #nim
16:51:05*a_b_m quit (Read error: Connection reset by peer)
16:51:28*rockcavera quit (Ping timeout: 246 seconds)
16:54:16*tiorock quit (Ping timeout: 246 seconds)
17:00:21*arecacea1 quit (Read error: Connection reset by peer)
17:00:52*arecacea1 joined #nim
17:03:08*abm joined #nim
17:06:44FromDiscord<kodkuce> @dom96 i see you https://github.com/nim-lang/Nim/issues/12526 head this similar issue bad file discriptor
17:06:46disbotasynchttpserver "Bad file descriptor" crashes ; snippet at 12https://play.nim-lang.org/#ix=27vG
17:07:14FromDiscord<kodkuce> hmm do you maybe know why would this heppend to me only when i use Nginx proxy_pass
17:11:24*rokups quit (Quit: Connection closed for inactivity)
17:23:42FromDiscord<kodkuce> why good why
17:26:48FromGitter<brentp> how does one create a TableRef from a Table?
17:40:25FromGitter<brentp> found answer here: https://forum.nim-lang.org/t/322
17:41:29*vicfred joined #nim
17:42:49FromDiscord<kodkuce> "File descriptor not registered." "File descriptor not registered." "File descriptor not registered." "File descriptor not registered." "File descriptor not registered."
17:42:57FromDiscord<kodkuce> "File descriptor not registered." "File descriptor not registered." "File descriptor not registered." "File descriptor not registered." "File descriptor not registered."
17:43:24FromDiscord<kodkuce> Can somone explain me what Nginx has to do with "File descriptor not registered." in app?
17:43:25*Cthalupa quit (Ping timeout: 264 seconds)
17:45:05*renfield quit (Ping timeout: 245 seconds)
17:47:55FromDiscord<kodkuce> from what i get "File descriptor not registered." means that on close() its trying to close an FD that does not exist ? doesnt ngxin just pass connection i am not trying to close Nginx FD right?
17:56:35*rockcavera joined #nim
18:10:02*rockcavera is now known as Guest52206
18:10:03*rockcavera joined #nim
18:11:27*Guest52206 quit (Ping timeout: 240 seconds)
18:22:02*Vladar quit (Quit: Leaving)
18:24:14FromDiscord<kodkuce> doom
18:45:41*Cthalupa joined #nim
19:04:39leorize@kodkuce it means that the file descriptor is not registered in Nim's dispatcher
19:04:51leorizenote that nginx does not pass the connection fd over
19:05:12leorizeit insteads relays
19:05:41leorizemost of the time you get "not registered" when the fd is unregistered twice
19:10:57FromDiscord<kodkuce> i tought ngix makes his fd that recives data and send to my backend app >> then my backend app has FD that recives that data and sends to ngix that sends to clinet
19:11:16*vicfred quit (Ping timeout: 256 seconds)
19:12:05leorizewell did you adopt the fd anywhere in your app?
19:12:33leorizeif you don't have any code that explicitly grab an fd somewhere and use it, then you're not using any fd from nginx
19:12:47FromDiscord<kodkuce> hmm did you saw my forum post i am running ws example
19:13:08FromDiscord<kodkuce> i am guessing treefrom/ws lib is opening it
19:13:16FromDiscord<kodkuce> asynchttpserwer
19:13:34FromDiscord<kodkuce> https://forum.nim-lang.org/t/6903
19:14:11FromDiscord<kodkuce> here so when i run this app with no ngix infort it works normal it closes connection but it does not crash
19:15:07FromDiscord<kodkuce> but when i run Nginx infront with proxy_pass to my app, it crashes with this :File descriptor not registered.
19:15:11leorizenah, nginx is not passing any fd to you
19:15:13*qeeg quit (Remote host closed the connection)
19:15:39*qeeg joined #nim
19:15:45leorizeas a reverse proxy, nginx basically made the connection to your app then relay informations it receives over
19:15:55leorizeno fd passing magic here
19:16:04FromDiscord<kodkuce> then why it crashes
19:16:20FromDiscord<kodkuce> how to fix it, and why its giving that error
19:18:46leorizecan you link the ws library you're using?
19:18:54FromDiscord<kodkuce> treefrom/ws
19:19:12FromDiscord<kodkuce> https://github.com/treeform/ws
19:22:44FromDiscord<kodkuce> it heppends even on hangup()
19:27:03leorize[m]1all server examples seem to not close the socket
19:27:06leorize[m]1ping @treeform
19:27:14leorize[m]1my guess is that asynchttpserver manages that fd
19:27:46leorize[m]1and by closing the socket earlier, it errors out when asynchttpserver close the socket itself
19:28:43FromDiscord<kodkuce> https://nim-lang.org/docs/asyncnet.html#AsyncSocket
19:29:05FromDiscord<kodkuce> tcpSocket -> AysncSocket -> close()
19:29:35FromDiscord<kodkuce> there is this AsyncDF
19:29:39FromDiscord<kodkuce> *FD
19:31:44FromDiscord<kodkuce> @treeform should i ping you :) , hope you wont kill me for harassing you all time
19:32:27FromDiscord<Rika> Inb4 they file a restraining order
19:35:21Yardanicotime to add more nim examples to godbolt and possibly update their nim version to 1.2.6
19:35:29Yardanicojust felt like I should improve nim on godbolt lol
19:40:27*rockcavera quit (Ping timeout: 240 seconds)
19:41:30narimiranYardanico: why to 1.2.6 if you can wait a bit and do the update to 1.4.0?
19:41:44Yardanicowell right now I just want to add a few simple examples they seem to have for other languages
19:41:53Yardanicoalso add --debugger:native to nim options by default
19:42:02Yardanicoso you can actually see what source line corresponds to what assembly line
19:42:16YardanicoI did the first PR about fixing the simplest square example
19:42:33Yardanicoit doesn't use exportc and it's not called so it just doesn't appear in the assembly
19:42:45Yardanicoand godbolt examples seems to favour exporting it, so I just did exportc
19:42:50Yardanicozig does the same
19:47:53Yardanicoalso I'm not sure if I should use seq or an openArray for the "sum over array" example
19:48:11Yardanicobecause if I want to do real nim arrays, then the code is generic so even with exportc nothing will be generated :P
19:48:23*tdc joined #nim
19:48:38YardanicoI guess a seq will be enough for now
19:49:58*rockcavera joined #nim
19:52:26*rockcavera quit (Remote host closed the connection)
19:57:23*narimiran quit (Ping timeout: 240 seconds)
19:57:34Yardanicohttps://i.imgur.com/20vvuoj.png looks good enough
19:58:11Yardanicoone of the examples which a lot of the languages there have - replacing smaller elements in the first "array" from the second by the index
19:58:15Yardanicoin-place in most of the implementations
20:00:11Yardanicoalso, maybe we should add some kind of -d: for --passC:"-march=native" ?
20:05:32Yardanicoalso curious (but kinda expected) thing from that example above - if I use "for i, elem in mpairs(x):" the assembly is 100% the same for "-d:danger"
20:05:41Yardanicobut guess I'll keep the "simpler" version
20:06:23*rockcavera joined #nim
20:15:56Yardanicoso I don't know if I should use seq or openArray - both work with exportc, but openArray version makes more assembly :P
20:16:55FromDiscord<Recruit_main707> Make both :p
20:17:32Zevvrequest for data structure advice. I have a huge number of things that have a start and end float64 time (which can be the same). I need to look up very often and fast if there are any of these things in a given range (t1..t2). Bonus if I know how many there are
20:18:31Zevvoh dang am I stupid
20:19:44Zevvnevermind :)
20:22:36*egorbelibov joined #nim
20:28:03FromDiscord<Cloudperry> I'm having some problems with using HashSets as a field of an object (I'm not very experienced with Nim's objects)
20:29:05FromDiscord<Cloudperry> in my reddit post offline-saving app I need to use a HashSet as an object field, and then I need to modify that set from a proc
20:29:56Yardanicookay, how is your object defined?
20:29:58FromDiscord<Cloudperry> but for some reason I just can't modify that set from inside a proc
20:30:19Yardanicoif you define your object as "myobj = object" then you need to have it as argument "var Object"
20:30:22FromDiscord<Cloudperry> sent a long message, see http://ix.io/2A8k
20:30:50FromDiscord<Cloudperry> that is probably it
20:30:58FromDiscord<Cloudperry> wait a sec
20:31:00*egorbelibov quit (Remote host closed the connection)
20:31:22*egorbelibov joined #nim
20:31:24Yardanicoyeah in your case you need to add "var" to "test: var Test" in modifyTest
20:31:31Yardanicoor make your Test a ref object
20:31:34FromDiscord<Cloudperry> so I need to put it as proc a(var RedditPost)?
20:31:39Yardanico"test: var Test"
20:31:47Yardanico"post: var RedditPost"
20:31:53FromDiscord<Cloudperry> now I have it as proc a(redditPost: RedditPost)
20:31:58Yardanicoalso if your object is ~more than 3-4 fields, it might be better to use "ref object"
20:32:04FromDiscord<Cloudperry> and a is the proc that needs to modify it
20:32:08Yardanicoproc a(redditPost: var RedditPost)
20:32:25FromDiscord<Cloudperry> oh yeah I tried RedditPost var before
20:32:34FromDiscord<Cloudperry> cause ints and others have it after
20:32:37Yardanicoalso your object itself has to be declared with "var"
20:32:48Yardaniconot let
20:32:52Yardanicoso it can be modified
20:33:00Yardanicoor, as I said, you can use ref object :P
20:33:20*abm quit (Read error: Connection reset by peer)
20:33:44*abm joined #nim
20:35:31FromDiscord<Cloudperry> hmm its now erroring with type var var is not allowed
20:35:52FromDiscord<Cloudperry> wait I can give some generic code that does the exact same thing as my app (without being so long)
20:36:14Yardanicoproc a(redditPost: var RedditPost)
20:36:19FromDiscord<Cloudperry> sent a code paste, see https://play.nim-lang.org/#ix=2A8n
20:36:19Yardanicovar myRedditPost = RedditPost()
20:36:39FromDiscord<Cloudperry> soo this inim test does the exact same thing as my actual code
20:37:19FromDiscord<Cloudperry> in my real app initTest is called parsePostObj and it parses a reddit post into an obj
20:37:51Yardanicoas I said
20:37:57YardanicomodifyTest should be
20:38:00Yardanicoproc modifyTest(test: var Test) =
20:38:12Yardanicoalso how many fields does your RedditPost have?
20:38:17YardanicoI mean object fields
20:39:17*egorbelibov quit (Remote host closed the connection)
20:39:21FromDiscord<Cloudperry> quite many
20:39:23*Trustable quit (Remote host closed the connection)
20:39:24*tdc quit (Ping timeout: 240 seconds)
20:39:30Yardanicothen it might be easier for you to just use "ref object" really
20:39:31FromDiscord<Cloudperry> like 4 or 5
20:39:36*egorbelibov joined #nim
20:39:59Yardanicoah that's not a lot, but anyway with "ref object", if you mutate your object a lot, you wouldn't need to add "var" to arguments in procs
20:39:59FromDiscord<Cloudperry> yeah I'll try that next
20:40:11FromDiscord<Cloudperry> oh yeah that is nice
20:40:13Yardanicobut with "ref object" you're adding a bit of overhead because it's a reference
20:40:23*Trustable joined #nim
20:40:47YardanicoI mean it's negligible for 99.9% of cases, it only matters if you really want to squeeze out every last bit of performance :)
20:42:04FromDiscord<haxscramper> Nim example on view types should fail or compile? The one with `main(@[11, 22, 33])` from https://nim-lang.github.io/Nim/manual_experimental.html#view-types
20:42:29FromDiscord<haxscramper> `Error: 'y' borrows from location 'x' which does not live long enough`
20:44:59YardanicoI think that view types are still pretty much WIP
20:46:16*a_chou joined #nim
20:52:12FromDiscord<Cloudperry> hmm maybe I will post the relevant parts of my actual code because I was actually able to do my small inim test without errors
20:52:23FromDiscord<Cloudperry> but I wasn't able to fix my actual code
20:53:09FromDiscord<Cloudperry> sorry that I only ask for help here when I'm tired and want to get something implemented fast 😄
20:54:33FromDiscord<Cloudperry> sent a code paste, see https://play.nim-lang.org/#ix=2A8q
20:55:09FromDiscord<Cloudperry> sent a code paste, see https://play.nim-lang.org/#ix=2A8r
20:55:44FromDiscord<Cloudperry> you can probably ignore the parsePostToObj proc (also I left the imports out)
20:56:08YardanicogetMediaProviderLinks should have "var RedditPost" if you keep it an "object"
20:56:12FromDiscord<Cloudperry> (edit) 'https://play.nim-lang.org/#ix=2A8r' => 'https://play.nim-lang.org/#ix=2A8s'
20:56:28Yardanico"var" signifies mutability
20:56:35Yardanico"I want a mutable version of that argument"
20:58:28FromDiscord<Cloudperry> yeah I know about var, let and const, and I tried putting var only in the declaration of this object and the getMediaProviderLinks proc
20:58:53FromDiscord<Cloudperry> I also tried putting it basically everywhere the object is declared
20:58:58FromDiscord<Cloudperry> (edit) 'declared' => 'mentioned'
20:59:08Yardanicoso what's the problem?
20:59:17FromDiscord<Cloudperry> /data/roni/Nextcloud/Programming/Nim/TerminalApps/RedditOffline/src/postDownloader.nim(31, 40) Error: type mismatch: got <HashSet[system.string], string>↵but expected one of:
20:59:25Yardanicopaste the full error please :)
20:59:27FromDiscord<Cloudperry> this is the exact error
20:59:29Yardanicono
20:59:35Yardanicofull error, inim doesn't show full error
20:59:51Yardanicoyou know, errors from the compiler can have multiple lines
20:59:57FromDiscord<Cloudperry> yeah uploading full now to somewhere
21:00:06Yardanicoyou can just paste it here
21:00:10FromDiscord<Cloudperry> also its from nim compiler this time wait
21:00:12Yardanicothe bridge will handle it okay
21:00:16FromDiscord<Cloudperry> no its over discord limit
21:00:21Yardanicoah
21:00:55FromDiscord<Cloudperry> https://media.discordapp.net/attachments/371759389889003532/763868549860032582/log.txt
21:01:16FromDiscord<Cloudperry> idk if that goes over to irc
21:01:43Yardanicoyour error is much simpler
21:01:52Yardanicoyou shouldn't think that it's really complex
21:02:00Yardanicothe compiler says to you that there's no "add" proc for a hashset
21:02:02Yardanicothere's "incl"
21:02:03Yardaniconot "add"
21:02:07Yardanicohttps://nim-lang.org/docs/sets.html
21:02:48Yardanicoit basically shows you all possible "add" procs available in the place where you call it, and says that neither of them accepts hashset as the first argument
21:02:55FromDiscord<Cloudperry> yeah, sorry I used incl before and I'm now getting closer to fixing it
21:03:09FromDiscord<Cloudperry> its just that I went between seq and HashSet to see if that would help
21:03:18FromDiscord<Cloudperry> thats why its add...
21:04:14FromDiscord<treeform> @kodkuce I started seen this error too, I think its some thing new with the async stuff. I just ignore it.
21:05:07*FromDiscord quit (Remote host closed the connection)
21:05:23*FromDiscord joined #nim
21:05:44FromDiscord<Cloudperry> sent a code paste, see https://play.nim-lang.org/#ix=2A8A
21:06:06Yardanicoyou're trying to run incl for a RedditPost
21:06:18Yardanicobut incl needs a hashset :)
21:06:27Yardanicoso it's redditPost.yourHashSetField.incl
21:06:36Yardanicoor incl(redditPost.yourHashSetField, ...)
21:06:50Yardanicowhatever you like the most
21:08:02FromDiscord<Cloudperry> yeah fixed it, always forget to edit some part
21:08:14FromDiscord<Cloudperry> I think I'm going to get this whole thing fixed very soon
21:16:00*gorbelibove joined #nim
21:16:20FromDiscord<Cloudperry> okay, got it fixed now
21:16:47FromDiscord<Cloudperry> its obvious now that I only needed to have my redditPost obj as var in the proc arguments
21:17:33FromDiscord<Cloudperry> I was just not thinking clearly and started spamming var everywhere, even when its not needed
21:18:32FromDiscord<Cloudperry> I only need to modify this redditPost object first when parsing the post, and then finding media links from its text part
21:19:14FromDiscord<Cloudperry> I will probably post this thing on gitlab, when its finished
21:19:56FromDiscord<Cloudperry> its going to be a reddit post offline saver, that also doubles as a terminal viewer for the saved reddit posts
21:20:25*nature quit (Ping timeout: 240 seconds)
21:20:45FromDiscord<Cloudperry> it also saves all the media in a reddit post locally, and gives easy access to it in the terminal viewer
21:22:58FromDiscord<Cloudperry> this discord is always so helpful 👍
21:23:01FromDiscord<Cloudperry> bye
21:26:47*a_chou quit (Ping timeout: 240 seconds)
21:28:49*a_chou joined #nim
21:33:23*solitudesf quit (Ping timeout: 240 seconds)
21:38:21*gorbelibove quit (Remote host closed the connection)
21:38:48*gorbelibove joined #nim
21:41:13FromDiscord<Avatarfighter> Cloudperry are you making a reddit library ?
21:41:53*gorbelibove quit (Remote host closed the connection)
21:44:50*sealmove quit (Read error: Connection reset by peer)
21:49:21*gorbelibove joined #nim
21:50:13*gorbelibove quit (Remote host closed the connection)
21:50:37*gorbelibove joined #nim
21:50:47*egorbelibov left #nim (#nim)
21:51:11*gorbelibove quit (Remote host closed the connection)
21:51:29*egorbelibov joined #nim
21:53:34*egorbelibov quit (Remote host closed the connection)
21:58:21*tane quit (Quit: Leaving)
22:00:19*egorbelibov joined #nim
22:06:00*egorbelibov quit (Remote host closed the connection)
22:06:23*egorbelibov joined #nim
22:09:39*egorbelibov left #nim (#nim)
22:10:19*natrys quit (Quit: natrys)
22:12:04*a_chou quit (Ping timeout: 240 seconds)
22:12:09*egorbelibov joined #nim
22:19:08*rockcavera quit (Remote host closed the connection)
22:19:37*a_b_m joined #nim
22:22:15*egorbelibov left #nim ("#worldchat")
22:22:27*abm quit (Ping timeout: 240 seconds)
22:22:47*egorbelibov joined #nim
22:28:48*Trustable quit (Remote host closed the connection)
22:41:35*Jesin quit (Quit: Leaving)
22:46:02*a_chou joined #nim
22:56:59*Jesin joined #nim
23:28:33*a_chou quit (Remote host closed the connection)
23:28:54*a_chou joined #nim
23:34:54*vicfred joined #nim
23:46:27*bunbunbunbunny joined #nim