<< 29-04-2020 >>

00:02:05*ftsf joined #nim
00:03:46FromGitter<bung87> cant easy provider example , I modfied the std libs...
00:03:56leorize[m]shashlick: yes you can
00:04:19leorize[m]--benchmarkVM or something like that will enable time functions
00:04:31zacharyc1rtersweet - I think my fiber based job system is working now
00:04:32leorize[m]check out --fullhelp
00:04:40zacharyc1rterat least context switching inside of a thread is
00:04:51zacharyc1rterat least context switching inside of a thread is
00:04:54zacharyc1rteroops sorry
00:05:09FromDiscord<Elegant Beef> You committed the cardinal sin, good bye
00:05:14zacharyc1rter:D
00:08:11FromDiscord<codic> sad
00:08:25zacharyc1rterwhat's sad?
00:08:42FromDiscord<codic> That you commited the cardinal sin
00:08:48zacharyc1rterah - I do it all the time
00:08:54FromDiscord<codic> lol
00:09:06FromDiscord<Elegant Beef> How do you even accidently resend a message on irc?
00:09:18zacharyc1rterpress the up arrow and then enter in irssi
00:09:26FromDiscord<codic> Alright, how do I add a button with nim's `ui`?
00:09:26Yardanicosame for quassel
00:09:27Yardanicosame for quassel
00:09:31FromDiscord<codic> That executes a proc when done
00:09:36FromDiscord<Elegant Beef> Ah so same way as discord but not editing πŸ˜„
00:09:44zacharyc1rterNim doesn't have a UI?
00:09:51FromDiscord<codic> Uh
00:09:52FromDiscord<Elegant Beef> Yea i was super confused
00:09:54Yardanicohe's referring to nim-lang/ui lib
00:09:54FromDiscord<Elegant Beef> Nigui?
00:09:55FromDiscord<codic> https://github.com/nim-lang/ui
00:10:01Yardanicodon't use that :P
00:10:04FromDiscord<codic> The libui wrapper
00:10:05FromDiscord<codic> Why?
00:10:07zacharyc1rterdafuq is this?
00:10:11Yardanicozacharyc1rter: libui wrapper
00:10:20Yardanicouse NiGui
00:10:21FromDiscord<codic> why shouldn't I use it?
00:10:22FromDiscord<codic> Oh
00:10:28Yardanicoor gintro if you want full-fledged GTK gui
00:10:34Yardanicogintro bindings to GTK are superb
00:10:44FromDiscord<codic> yeah, I just need a dialog box with two buttons
00:10:48FromDiscord<Elegant Beef> *or if you're daft like me use imgui* πŸ˜„
00:10:51Yardanicowell NiGui will work for you then
00:11:00FromDiscord<codic> looking at examples
00:12:06FromDiscord<codic> UCI is pretty cool btw
00:12:17FromDiscord<Elegant Beef> Xlib atoms are the most "how the hell do these work" i've ever seen
00:13:06FromDiscord<codic> Wow nigui is actually great
00:13:12FromDiscord<Elegant Beef> It is
00:20:30*oculuxe joined #nim
00:21:12*oculux quit (Ping timeout: 258 seconds)
00:21:39FromDiscord<codic> Anyone see a glaring problem with this? https://hatebin.com/ydlhahwmmw
00:22:01Yardanicoyes
00:22:17Yardanicoyou define "status" inside of if/else scopes so it's not accessible at global level
00:23:01FromDiscord<codic> oh, would I use let instead?
00:23:04FromDiscord<Elegant Beef> no
00:23:13Yardanicolemme show you
00:23:15FromDiscord<codic> just have the textbox in if?
00:23:17FromDiscord<Elegant Beef> those are both declarations which depend on variable scope
00:23:27FromDiscord<Elegant Beef> variables are only accessible in their indent and below
00:23:41FromDiscord<Elegant Beef> *Unless globally declared*
00:23:53FromDiscord<codic> how do i declare em glbally?
00:24:04FromDiscord<codic> hm wait
00:24:12FromDiscord<Elegant Beef> before any logic just do `var status = status`
00:24:19FromDiscord<Elegant Beef> second status is a string
00:24:21FromDiscord<Elegant Beef> Im just dumb
00:24:29FromDiscord<Elegant Beef> I'd also say use enums over strings for things like this
00:24:38FromDiscord<codic> Ok
00:24:38FromDiscord<codic> Why enums?
00:25:05FromDiscord<Elegant Beef> Cause they're nicely named integers, and cannot be mispelled
00:25:34FromDiscord<Elegant Beef> strings can easily be mispelled and i'd say should only ever be used in UI, and rarely used in logic
00:25:41Yardanicohttps://play.nim-lang.org/#ix=2jYg
00:25:47FromDiscord<codic> yeah but then
00:25:50Yardanicoat least it compiles now
00:26:15FromDiscord<codic> I have to rewrap my whole textbox in an if else
00:26:23FromDiscord<codic> which adds complexity
00:26:26Yardanico?
00:26:26FromDiscord<codic> Oh thanks yardanico
00:26:33FromDiscord<codic> What do you mean?
00:26:33Yardanicocheck the code I linked
00:26:36FromDiscord<codic> I did
00:26:42FromDiscord<codic> I was talking about using enums
00:26:46Yardanicooh
00:26:46FromDiscord<codic> instead of strings
00:26:53Yardanicowell you don't really need to
00:26:59Yardanicoenums can have strings as values
00:27:46FromDiscord<codic> oh
00:27:48FromDiscord<Elegant Beef> Enums are superior to string based logic, even without the abillity to store a ordinal + string value
00:52:22*sacredfrog quit (Quit: ZNC 1.7.5 - https://znc.in)
00:54:04*sacredfrog joined #nim
00:54:40*exelotl_ quit (Ping timeout: 246 seconds)
00:55:36*krux02_ is now known as krux02
00:59:35zacharyc1rterstill seems there's an issue with threads and `--gc:arc`
00:59:39*Kaivo quit (Quit: WeeChat 2.8)
00:59:43zacharyc1rterprogram randomly crashes and if I run with asan it crashes every time
01:00:02zacharyc1rterwhen I run with `--exceptions:setjmp and --tlsEmulation:off`
01:00:03disruptekbugs are expected.
01:00:20zacharyc1rteryeah I know, I just have no idea what is causing them nor how to fix
01:00:56disruptekwhat happens with setjmp and tlsEm:off?
01:01:42disruptekyou don't have any smaller repro, right?
01:02:37zacharyc1rterI'm trying to come up with one
01:02:49zacharyc1rterhttps://gist.github.com/zacharycarter/06d5a3effa0a23b12e9318eff9d5dc1f - is the backtrace
01:04:02zacharyc1rterit's definitely a `--gc:arc` issue though because it runs fine with the default gc
01:04:17FromGitter<bung87> found when the compress data string convert to cstring , it is truncated.
01:04:29Yardanicohow are you "converting" it?
01:04:49FromGitter<bung87> just string.cstring
01:05:16disruptekwe saw something like this before. i wonder if it's finding a null and assuming the string is finished.
01:06:11FromGitter<bung87> hmm not like python theres read binary mode
01:06:55FromGitter<bung87> I need read using `staticRead` which is string, then `.cstring`, the problem occurs...
01:07:13disruptekyou need to create a cstring with a certain length. then it should copy. i assume...
01:07:45Yardanicooh staticRead
01:07:47disruptekactually, i can't think why you'd need to specify the length.
01:07:58Yardanicothere might be an issue with staticRead
01:07:59krux02I just figured out, that I am not a member of nim-lang anymore.
01:08:17leorize[m]how so?
01:08:21krux02don't know
01:08:32krux02I wanted to tag an issue, can't do it anymore.
01:08:58Yardanicomight be https://github.com/nim-lang/Nim/issues/13786
01:09:00Yardanicofor staticRead
01:09:00disbotβž₯ staticExec removes trailing LF which interferes with binary output that happens to end with 0xA ; snippet at 12https://play.nim-lang.org/#ix=2jYr
01:09:04Yardanico@bung87 try reading at runtime
01:09:06Yardanicowith readFile
01:09:11Yardanicoand see if it works or not
01:09:13leorize[m]Araq might still be awake and can give it back
01:09:14disruptekyeah, that's the bug i was thinking of.
01:09:27disruptekit's like 2a his time.
01:09:47FromGitter<bung87> I 'm search my prevous code about string ,cstring things
01:10:01disruptekjust work the problem.
01:10:15disruptekit's just bytes.
01:14:13FromGitter<bung87> `readFile ` not work
01:15:18leorizecan I see the code?
01:16:23FromGitter<zetashift> Did something change with NimScript? https://play.nim-lang.org/#ix=2jYs
01:16:26krux02leorize, I don't think he is still awake, it is pretty late
01:16:51FromGitter<bung87> https://github.com/bung87/finder/blob/master/src/finder.nim
01:17:32leorizeuse `let`, not `const` :P
01:17:38*Hideki_ joined #nim
01:17:41zacharyc1rterwell - all the threading issues seem to stem from the new exceptions
01:18:01zacharyc1rterand just using setjmp doesn't help - if I use the commit hash before the new exceptions got introduced things work
01:18:10FromDiscord<flywind> https://github.com/nim-lang/Nim/pull/12860
01:18:11disbotβž₯ Undefine `paramCount` & `paramStr` in nimscript.nim for *.nims
01:18:13Yardanicook now I feel like my mathexpr lib is useless after https://github.com/zevv/npeg/blob/master/tests/precedence.nim :D
01:18:52Yardanicoit's a simple math evaluator in ~30 loc lol wtf
01:18:53FromGitter<zetashift> oof thanks flywind I didn't see those in changelog for 1.2
01:19:05FromGitter<bung87> I confirmed,
01:19:13Yardanicoworks at runtime?
01:19:24FromGitter<bung87> len not equals...
01:19:27leorizeYardanico: now if that thing is faster than your mathexpr lib it will be even funnier :P
01:19:35leorizewhat len not equal?
01:19:51FromGitter<bung87> string len 657,cstring len 19
01:19:52Yardanicoit probably is but lemme check with simple 2+2*2
01:19:59leorizebung87: use the string len
01:20:02leorizedon't use cstring len
01:20:14Yardanicoalthough mathexpr does more stuff like checking for functions and stuff
01:20:38zacharyc1rteractually, nevermind, even with the version of Nim before the exceptions change, if I run things through lldb I get a null pointer use exception
01:20:57FromGitter<bung87> ok , let me add a len param
01:21:17leorizebung87: you can just take a string then go from there
01:21:24disruptekit's just bytes.
01:21:57leorizeuse Nim types whenever you can
01:22:05Yardanicoah wait actually wtf
01:22:12Yardanicowhy my mathexpr is sooo much faster than this peg
01:22:15FromGitter<zetashift> So next version where nimscript `paramCount` was used you need to import OS if I understand this correctly?
01:22:26FromGitter<zetashift> import *
01:22:27leorizeyea, some stuff are unexported
01:22:30FromGitter<zetashift> os* jeez it's so late
01:22:53FromGitter<zetashift> @leorize was that towards me, just to be sure he? :p
01:22:59leorizeyep
01:23:04YardanicoI get 500k iters/s for npeg one and 10mil for mathexpr
01:23:05Yardanicofor 2+2*2
01:23:08FromGitter<zetashift> okay thanks! Could be worse change
01:23:21leorizeYardanico: maybe it's due to the differences in algorithm
01:23:45leorizealso make sure to put the whole thing in a proc
01:24:02YardanicoI use nimbench (yes its very old but I still haven't found a good simple alternative)
01:24:16disruptekhyperfine or golden
01:24:20FromGitter<bung87> ok pass string directly works ,no error now
01:24:35disruptekor criterion
01:24:40disruptek!repo criterion
01:24:41disbothttps://github.com/LemonBoy/criterion.nim -- 9criterion.nim: 11Statistic-driven micro-benchmark framework 15 38⭐ 4🍴
01:24:44Yardanicoit's archived
01:24:48disruptekuse my branch
01:25:04Yardanicoit has no new commits?
01:25:12disruptekno, but we're collecting any issues.
01:25:34disruptekiirc, it works but exposes a pragma bug.
01:25:38disruptekbut nothing too serious.
01:25:56disruptek!repo golden
01:25:56disbothttps://github.com/disruptek/golden -- 9golden: 11a benchmark for compile-time and/or runtime Nim πŸ† 15 17⭐ 0🍴
01:26:15Yardanicoand so how would I benchmark some operation repeated a lot of times for two libs?
01:26:27Yardanicodoesn't golden call the binary each time?
01:26:36disrupteksure.
01:26:46disruptekwrite two tests or use criterion.
01:26:52Yardanicoalso it failed to install on devel :D
01:27:01disruptekcriterion?
01:27:04Yardanicogolden
01:27:20disruptekah, i rarely test it because i think it's broken on arc.
01:27:25YardanicoError: undeclared identifier: 'paramCount'
01:27:28Yardanicoin https://github.com/xmonader/nim-terminaltables/blob/master/terminaltables.nimble
01:27:33disruptekomg
01:27:45disruptekthat guy uses crystal now, anyway.
01:27:50Yardanicohttps://github.com/nim-lang/Nim/pull/12860 ?
01:27:56disrupteki saw him in there when i was trolling.
01:27:56disbotβž₯ Undefine `paramCount` & `paramStr` in nimscript.nim for *.nims
01:28:07Yardanicobut where's backwards compat
01:28:51Yardanicoaren't we 1.0 release and stuff
01:28:56Yardanicoso no breaking changes like that are allowed
01:29:05FromGitter<zetashift> it's in devel not stable
01:29:14FromGitter<zetashift> only change needed is import os
01:29:21Yardanicowell but it'll be eventually in a new release
01:29:31Yardanicoand new releases still need to keep compat with 1.0 code
01:29:33FromGitter<zetashift> true, I dunno how they're gonna deal with it
01:29:47FromGitter<zetashift> usually there was a deprecation path
01:29:59FromGitter<zetashift> I also just ran into that error
01:30:05Yardanicooh nvm
01:30:05Yardanicohttps://github.com/nim-lang/nimble/pull/797
01:30:06disbotβž₯ Fix nimble because `paramCount` & `paramStr` for nimscript are now defined in os.nim
01:30:17FromGitter<zetashift> it's a nimble problem yea
01:30:28FromGitter<zetashift> cause godot-nim imports os everywhere
01:30:40disruptekit'll be a problem everywhere.
01:31:05FromGitter<zetashift> also for anyone who has 3 minutes to spare and hasn't installed godot-nim yet can one try to install it and set the GODOT_BIN environment and see if Nim picks it up? https://github.com/pragmagic/godot-nim/issues/58
01:31:13disbotβž₯ Can't build sample app on Mac, environment variable not working ; snippet at 12https://play.nim-lang.org/#ix=2jYt
01:31:22FromGitter<zetashift> I ran into it, restarted it and it works now but can't reproduce
01:39:41FromDiscord<codic> My gui so far. functionally it works. but what i'd like:
01:39:41FromDiscord<codic> - put close and enable next to each other
01:39:41FromDiscord<codic> - Make the "Tor is currently not running" non-editable.
01:39:41FromDiscord<codic>
01:39:42FromDiscord<codic> i'm using nigui https://play.nim-lang.org/#ix=2jYg
01:40:18FromGitter<bung87> @ disruptek @ leorize @ Yardanico thank you,finally it works out.
01:42:01zacharyc1rterare sequences nil by default with `--gc:arc`?
01:42:06Yardanicono?
01:42:10Yardanicothey're still just empty
01:42:14zacharyc1rterinteresting...
01:42:19zacharyc1rterlet me see if I can reproduce this then
01:43:30FromDiscord<codic> Figured out how to use a label
01:43:33FromDiscord<codic> just need to align the buttons
01:44:26FromDiscord<codic> (And how do I make nigui use the system font?)
01:45:33*endragor joined #nim
01:46:14FromDiscord<codic> the font is a bit to small for my taste
01:46:22FromDiscord<codic> and not the font family my system uses
01:46:43zacharyc1rterhttps://play.nim-lang.org/#ix=2jYz
01:47:24zacharyc1rterI don't know if this is worth filing an issue for or not - but I thought with `-d:useMalloc` asan would work
01:49:23FromDiscord<codic> Nooo I'm doomed
01:49:24FromDiscord<codic> No nigui docs
01:50:16Yardanicocheck out examples
01:50:23disrupteknim doc
01:50:26Yardanicothere's 17 of them
01:50:28Yardanicohttps://github.com/trustable-code/NiGui/tree/master/examples
01:51:15*chemist69 joined #nim
01:51:16Yardanicoand simple search already gives stuff like https://github.com/trustable-code/NiGui/blob/84a2b5c326658460d213b540e4f122b422deb5d6/examples/example_10_drawing.nim#L54
01:51:22Yardanicoto change font family and stuff
01:54:26*chemist69_ quit (Ping timeout: 260 seconds)
01:56:42FromDiscord<codic> oh, great
01:56:52FromDiscord<codic> Can't I get it to use the *system*'s tho
02:06:26FromDiscord<codic> or specify a ttf file
02:07:22*nickster0 joined #nim
02:07:40*nickster0 quit (Client Quit)
02:08:54*liblq-dev quit (Ping timeout: 246 seconds)
02:09:34*krux02 quit (Remote host closed the connection)
02:12:39*endragor quit (Remote host closed the connection)
02:12:45*endragor joined #nim
02:13:43zacharyc1rterhttps://github.com/nim-lang/Nim/issues/14156
02:13:46disbotβž₯ Sequences not initialized correctly with `--gc:arc` according to as an ; snippet at 12https://play.nim-lang.org/#ix=2jYK
02:19:32FromDiscord<KingDarBoja> πŸ™‚ Hi guys
02:19:36zacharyc1rterhi
02:20:58FromGitter<KingDarBoja> What's up? :D
02:23:24Yardanicohi, good night
02:23:31Yardanico5:23 AM πŸ€”
02:23:49FromDiscord<KingDarBoja> 9:23 PM
02:24:07disrupteklua is fast.
02:24:17Yardanicoluajit is lightning fast
02:24:39FromDiscord<KingDarBoja> Okay, Lua time it seems
02:24:52disruptekwell, i figured out my bug.
02:24:58Yardanicowhat was it?
02:26:58disruptekrelative stack index became invalid due to mutation needed in order to query that same index.
02:27:15disruptekkinda fucked up.
02:28:35zacharyc1rterluajit is also unmaintained
02:28:50*muffindrake quit (Ping timeout: 244 seconds)
02:28:52Yardanicothere's a maintained fork
02:28:58disruptekthe binding i'm using only supports 5.1. it's fine.
02:28:59Yardanicomoonjit
02:29:02zacharyc1rteryeah but without the original author
02:29:11zacharyc1rterwhatever his name is - mike something
02:29:23zacharyc1rterthat dude was a genius
02:29:26zacharyc1rteror is a genius
02:29:30zacharyc1rterno idea what he's up to now
02:29:40zacharyc1rterMike Pall
02:30:04Yardanicoyeah that's true
02:30:39disrupteki thought i was only gonna use this for data, but...
02:30:51Yardanicohttps://repo.or.cz/w/luajit-2.0.git
02:30:53Yardanicoseems to be not dead
02:30:56YardanicoHe actually makes commits
02:31:10*muffindrake joined #nim
02:31:11Yardanicohttps://repo.or.cz/luajit-2.0.git/commit/179cf2eb84fef2b9a524469c3c8cc49363b8fb10 10 hours ago
02:31:28zacharyc1rterthat's good
02:31:41disruptekiirc there's a 5.2 branch.
02:32:02leorizeI'd expect luajit to still be alive
02:32:14leorizeneovim is using it as it's internal scripting engine
02:32:28zacharyc1rterif I didn't have hot reloading working with my plugin system, I'd use luajit
02:33:29disruptekit hits a real sweet spot.
02:33:40zacharyc1rteryeah it's nice for sure
02:33:47Yardanicoi think luajit is one of the fastest if not the fastest JIT implementation for an interpreted language
02:33:56zacharyc1rterI think it is the fastest
02:34:33FromDiscord<KingDarBoja> What you guys doing?
02:34:49disruptek~stream
02:34:50disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
02:34:52disruptek~notes
02:34:53disbotnotes: 11https://gist.github.com/disruptek/41100bf20978de9a3cff55b23fcfe44e -- disruptek
02:35:01Yardanicoyour'e still streaming?!
02:35:02Yardanicowtf
02:35:10Yardanicoah nvm
02:35:13disrupteknah.
02:35:27disruptekby way of explanation...
02:35:43leorizedisruptek: can you make your github module not trying to add an Authorized header when I don't have GITHUB_TOKEN set?
02:35:57disruptekis that a good idea?
02:36:16leorizeyea, parts of the API don't need that
02:36:47disruptekhmm, maybe the swagger is wrong.
02:37:29disruptekyou can pass "Authorization" with whatever you want in it.
02:37:31*Hideki_ quit (Remote host closed the connection)
02:37:44leorizeI don't need it :P
02:37:57leorizeI'm just fetching the latest releases
02:38:20disruptekoh, do they puke on bad values?
02:38:27leorizeyea
02:38:31FromDiscord<codic> how do I require a file in a subfolder from another file not in the subfolder?
02:38:41Yardanicoyou mean import?
02:38:45FromDiscord<codic> yeah
02:38:45zacharyc1rterso I think the entire `--gc:arc` thread issue is related to the issue I Just found with seqs and asan
02:38:46Yardanicoimport folder/file
02:38:47*Hideki_ joined #nim
02:38:50FromDiscord<codic> o
02:38:57FromDiscord<codic> and `import file` to import the file in the current dir?
02:39:01Yardanicoyes
02:39:04leorizecodic: import "../another folder" / file
02:39:09FromDiscord<codic> but what if there is a module installed with nimble with the same name
02:39:13FromDiscord<codic> as the file
02:39:13zacharyc1rternevermind it's not
02:39:21FromDiscord<codic> which takes precedence, and how do I choose?
02:39:23leorizeyour file take precedence
02:39:23Yardanicoimport ./folder/file
02:39:47leorizeyou can choose the package via `import pkg / module_here`
02:40:09leorize`pkg` is a special prefix for packages
02:40:12FromDiscord<codic> o
02:40:14FromDiscord<codic> great
02:41:33FromDiscord<KingDarBoja> That's a lot of stuff
02:42:47FromDiscord<KingDarBoja> But awesome
02:43:18*Hideki_ quit (Ping timeout: 244 seconds)
02:43:38FromDiscord<KingDarBoja> You gained a new follower ❀️
02:44:48Yardanicoto see nim repos updated in last few days
02:44:48Yardanicohttps://github.com/search?o=desc&q=language%3Anim+pushed%3A%3E2020-04-27&s=updated&type=Repositories
02:44:53Yardanicosorted by last commit
02:45:00*Hideki_ joined #nim
02:46:00FromDiscord<KingDarBoja> Holy cr*p, look at arraymancer D:
02:46:14*Hideki_ quit (Remote host closed the connection)
02:46:18Yardanicoyes
02:46:23Yardanicoalso weave
02:46:59leorizemratsim's projects are always cool
02:48:14Yardanicozacharyc1rter: what happened with https://github.com/nim-lang/Nim/issues/14156 ?
02:48:16disbotβž₯ Disregard - not an issue
02:49:25Yardanicoalso btw I tried https://github.com/def-/nimes with --gc:arc and it segfaults at some array access?
02:49:36Yardanicoworks with default gc just fine even though no commits in 1.5 years :P
02:51:03*Hideki_ joined #nim
02:53:10*liblq-dev joined #nim
02:55:52*Hideki_ quit (Ping timeout: 265 seconds)
03:14:21disruptekleorize: github 1.0.4
03:14:43*azed quit (Quit: WeeChat 2.8)
03:20:33*Hideki_ joined #nim
03:24:49*Hideki_ quit (Ping timeout: 246 seconds)
03:29:42shashlick@gogolxdong in case you see this - https://github.com/Microsoft/msquic
03:33:26disruptekseems like nimph is broken in devel.
03:34:04disruptekwhat's weird is, it crashes deep in config parsing code from the compiler.
04:04:08FromDiscord<Zed> is it better to use when isMainModule or create a main proc and then call that?
04:04:24FromDiscord<Zed> im used to coding in c and having to use a main function
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:23disruptekit's better to use a main proc for very subtle are generally irrelevant reasons.
04:06:31disrupteks/are/and/
04:06:42*supakeen joined #nim
04:07:38FromDiscord<Zed> so mainly so you can import it from another file?
04:07:40disruptekshashlick: weirdly, it looks like gittyup was broken by devel this week. so everything is dead.
04:07:53disruptekno, other more subtle reasons.
04:08:09disrupteklike iterator vars not getting reset at toplevel scope.
04:08:36FromDiscord<Zed> ah ok
04:08:37disruptekand soon, increment compilation caching. 😁
04:08:47disruptekincremental, too.
04:17:28zacharyc1rteris there a way to manually increment a reference with `--gc:arc`?
04:18:11zacharyc1rterlike an equivalent of `gcRef`? Or should I just create a pointer to the object?
04:20:13leorizeI thought there's still GC_ref for arc?
04:20:20leorizeyea that's still there
04:20:24zacharyc1rterhmm
04:21:49voltistshashlick: You are genotrance right?
04:22:00shashlickYep
04:22:18leorizeZed: also an undocumented fact: your code runs faster in a main() proc
04:23:33voltistCool. I'm just updating a spare Manjaro machine I have so I can test to see if the choosenim issue is present. Manjaro is very much Arch based, so if it works there then the issue must arise from one of the few differences
04:23:54FromDiscord<Zed> ok dumb question,
04:23:54FromDiscord<Zed> i have 2 functions `proc initSomething*()` and `proc initOtherThing()`
04:23:55FromDiscord<Zed> I'm getting an error when trying to use the initOtherThing function inside of initSomething, do i have to import the function or something?
04:24:16shashlickYa I tested a docker image of Arch and couldn't reproduce the issue
04:24:22voltistAnd that difference should also be present in the Arch linux Docker image that you tested, so that might narrow things down a bit
04:24:23voltistYeah
04:24:29FromDiscord<Zed> leorize: why would that be, probably something interesting to look into
04:24:49leorizetop-level stuff are considered to be "global"
04:25:00leorizeso certain optimizations couldn't work there
04:25:00shashlickYa if you can get it to fail in a docker image, will be easy to root cause
04:25:20FromDiscord<Zed> ah yeah that makes sense
04:25:50shashlickWindows CI on Travis is so slow compared to Linux
04:26:14shashlick@leorize how's the performance on azure pipelines
04:26:22voltistshashlick: I tried the docker image as well (essentially recreated my new-ish install that it failed on) and couldn't reproduce the issue either
04:26:47leorizeshashlick: faster than travis could ever be
04:27:02leorizegithub actions also works if you don't want to sign up for a microsoft account
04:27:13shashlickAzure yml files seem a lot more complicated
04:27:22shashlickDon't feel motivated to sit and learn that
04:27:54leorizeit just separate things into steps
04:28:04shashlickCould you create something like https://gist.github.com/genotrance/fb53504a4fba88bc5201d3783df5c522 for azure
04:28:08leorizeazure model is pretty cool, you can create a template and everyone can reference it
04:29:12leorizeyes, and I can even put it on a public repo and everyone can reference it from their azure yml :)
04:29:21leorizeI'll give it a go later
04:29:44voltistshashlick: Here is one possible lead. The arch install it failed on was the using the image provided by Linode; perhaps the docker image is the 'true' version and the Linode one is broken.
04:30:10shashlickThat will be great - one stop shop to get azure working for Nim
04:30:24shashlickThanks in advance
04:31:07shashlick@voltist could be but it's weird nonetheless
04:31:20voltistIndeed
04:33:20voltistshashlick: What we really need is for more people who actually run Arch Linux to contribute to the troubleshooting
04:33:46voltistI've tried installing it in the past, and I do not want to go through that again :)
04:34:02*waleee-cl quit (Quit: Connection closed for inactivity)
04:34:49*zacharyc1rter quit (Ping timeout: 246 seconds)
04:35:10*zacharycarter quit (Ping timeout: 246 seconds)
04:35:35leorizenever thought that people running Arch would be a rare sight :P
04:36:13voltistYeah
04:37:00*rockcavera quit (Remote host closed the connection)
04:37:07voltistMaybe it's those three who just left IRC. They were the Arch users among us...
04:37:11voltist4 in fact
04:37:53FromDiscord<KingDarBoja> Guys, how can I use external std modules on nim playground?
04:37:59FromDiscord<KingDarBoja> Like unicodeplus
04:38:31FromDiscord<Yardanico> Wdym "external std"
04:38:54FromDiscord<Yardanico> And you can only use some packages which are available on playground
04:39:03leorize!repo nim-playground
04:39:05disbothttps://github.com/inim-repl/INim -- 9INim: 11Interactive Nim Shell / REPL / Playground 15 247⭐ 19🍴 7& 18 more...
04:39:13leorize!repo PMunch/nim-playground
04:39:14disbothttps://github.com/PMunch/nim-playground-frontend -- 9nim-playground-frontend: 11The front-end for https://play.nim-lang.org 15 11⭐ 4🍴
04:39:21leorize!repo PMunch/playground
04:39:22disbothttps://github.com/PMunch/nim-playground-frontend -- 9nim-playground-frontend: 11The front-end for https://play.nim-lang.org 15 11⭐ 4🍴
04:40:05leorizehttps://github.com/PMunch/nim-playground
04:40:10leorize^ PR welcome
04:40:23leorizealso disruptek, you should look into why disbot couldn't show me this one repo :P
04:40:26FromDiscord<Yardanico> https://github.com/PMunch/nim-playground/blob/master/docker/packages.nimble
04:40:41FromDiscord<KingDarBoja> I see Yard
04:40:52FromDiscord<Yardanico> And it actually has unicodeolus
04:40:57FromDiscord<Yardanico> *plus
04:41:14leorizeping PMunch to check for the packages when he come online then
04:42:31FromDiscord<KingDarBoja> Okay
04:42:53FromDiscord<KingDarBoja> I just checked source code of unicodeplus proc isAlpha
04:42:54FromDiscord<KingDarBoja> https://nitely.github.io/nim-unicodeplus/#isAlpha%2Cstring
04:43:24FromDiscord<KingDarBoja> Seems like if I provide a printable rune which is not an ascii letter, it will be true anyway
04:43:39FromDiscord<KingDarBoja> As it has an else branch to check by category πŸ€”
04:44:51leorizetry unicode.isAlpha i guess
04:44:54FromDiscord<KingDarBoja> Seems I better do the check with the int range
04:46:06FromDiscord<KingDarBoja> Yields true
04:46:18*zacharyc1rter joined #nim
04:46:18*zacharycarter joined #nim
04:46:50FromDiscord<KingDarBoja> Should better use rune.int is in range 65 - 90 or 97 - 122
04:50:10FromDiscord<KingDarBoja> It does -> (c.unicodeCategory() in ctgL or utmDigit+utmDecimal+utmNumeric in c.unicodeTypes())
05:07:39FromDiscord<KingDarBoja> Solved it πŸ˜„
05:08:10*zacharyc1rter quit (Ping timeout: 260 seconds)
05:08:10*zacharycarter quit (Ping timeout: 260 seconds)
05:11:17*hoijui joined #nim
05:11:24*narimiran joined #nim
05:18:41ZevvYardanico: yeah, don't use npeg for these kind of things if you're concerned about performance.
05:20:39FromGitter<gogolxdong> @shashlick, thanks for remembering that. It will be helpful.
05:21:35*liblq-dev quit (Quit: WeeChat 2.7.1)
05:21:55shashlickπŸ‘:skin-tone-3:
05:21:59*Hideki_ joined #nim
05:27:24*hoijui quit (Quit: Leaving)
05:29:18*Hideki_ quit (Remote host closed the connection)
05:29:28FromDiscord<KingDarBoja> How I can check installed package version, i.e. unicodeplus version
05:29:32*Hideki_ joined #nim
05:29:32FromDiscord<KingDarBoja> Using nimble
05:30:22FromDiscord<Zed> nimble list -i
05:30:45FromDiscord<Zed> lists all installed packages and their version
05:31:25shashlick`nimble list -i --ver`
05:31:41shashlickheh you don't need the --ver
05:32:23FromDiscord<Zed> How do you declare a function inforward declaration?
05:32:34FromDiscord<Zed> just the function header and then i fill it in later
05:32:47FromDiscord<KingDarBoja> I just noticed I can't declare `requires unicodeplus == 0.6.0` on mypackage.nimble file
05:32:54FromDiscord<KingDarBoja> Instead, I must use `>=`
05:35:09*dddddd quit (Ping timeout: 258 seconds)
05:37:58lqdev[m]you can use `requires "unicodeplus 0.6.0"`
05:52:00*liblq-dev joined #nim
05:59:45leorize[m]Zed: to forward declare, just write the function without the `=` at the end
06:01:06FromDiscord<Zed> yeah i realised that not long after sending it
06:12:28*leorize quit (Remote host closed the connection)
06:13:24*leorize joined #nim
06:22:25*solitudesf joined #nim
06:39:03*bab joined #nim
06:39:36*Hideki_ quit (Remote host closed the connection)
06:40:15*Hideki_ joined #nim
06:44:15*Hideki_ quit (Ping timeout: 240 seconds)
06:45:39*PMunch joined #nim
06:52:06*martinium quit (Remote host closed the connection)
06:53:51*Hideki_ joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:55*gmpreussner joined #nim
07:06:31*Hideki_ quit (Remote host closed the connection)
07:07:21*Hideki_ joined #nim
07:11:50*Hideki_ quit (Ping timeout: 260 seconds)
07:12:36*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
07:21:30*ryan_ joined #nim
07:23:50*number_two quit (Ping timeout: 256 seconds)
07:35:56FromGitter<bung87> https://github.com/nim-lang/zip/pull/52 can this get merged?
07:35:57disbotβž₯ add zip_source_buffer_create,zip_open_from_source to libzip,fromBuffe…
07:38:46*ryan_ is now known as tanger
07:40:24PMunchSpeaking of things that can be merged: https://github.com/nim-lang/packages/pull/1444
07:40:26disbotβž₯ Add ansiparse and ansitohtml packages
07:41:27*hax-scramper quit (Read error: Connection reset by peer)
07:41:47*hax-scramper joined #nim
07:45:06*Hideki_ joined #nim
07:53:01FromGitter<bung87> after nimble reinstall dep lib need more step? it still use old version
07:57:15FromGitter<bung87> ignore this.
07:57:56*Hideki_ quit (Remote host closed the connection)
07:58:35*Hideki_ joined #nim
08:03:07*Hideki_ quit (Ping timeout: 258 seconds)
08:05:26*CcxWrk quit (Ping timeout: 260 seconds)
08:07:00*ryan_ joined #nim
08:08:17FromGitter<Bennyelg> hey how can I remove nimcache from my project ? where does it placed ?
08:09:00FromGitter<Bennyelg> I suspect that there is a bug when running several delete statements on nim simple loop
08:09:49*tanger quit (Ping timeout: 264 seconds)
08:09:53*hax-scramper quit (Quit: Quit)
08:09:53FromGitter<Vindaar> @Bennyelg the cache is in `~/.cache/nim/<project>`
08:10:08FromGitter<Vindaar> but if unsure you can also just hand `-f` to your nim call to force a full rebuild
08:10:10*hax-scramper joined #nim
08:10:29FromGitter<Bennyelg> /Users/benny/.choosenim/toolchains/nim-1.2.0/lib/system/fatal.nim(49) sysFatal ⏎ Error: unhandled exception: index 1 not in 0 .. 0 [IndexError]
08:10:32FromGitter<Bennyelg> so wierd
08:10:51FromGitter<Bennyelg> @Vindaar Well so its not that
08:11:08FromGitter<Bennyelg> I run it ⏎ nim c -r "/Users/benny/DLM/backend/src/database/database.nim"
08:13:16FromGitter<Bennyelg> ```code paste, see link``` ⏎ ⏎ What Im doing wrong - looks like everything is deleted but fatal is raised [https://gitter.im/nim-lang/Nim?at=5ea9371b5cd4fe50a3da34a8]
08:13:56FromGitter<Vindaar> Since you're getting an index error, I assume the problem is in line `let tableName ...` ?
08:14:06FromGitter<Vindaar> Maybe one of those split calls doesn't do what you think it does
08:14:07*hax-scramper quit (Remote host closed the connection)
08:14:13FromGitter<Bennyelg> Output: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ea93754a9de3d01b1d8001a]
08:14:23*hax-scramper joined #nim
08:14:28FromGitter<Vindaar> see, it's complaining about line 22 :)
08:14:37FromGitter<Bennyelg> thanks I'll check
08:16:07*hax-scramper quit (Client Quit)
08:18:49*narimiran quit (Ping timeout: 264 seconds)
08:21:52*Hideki_ joined #nim
08:26:22*Hideki_ quit (Remote host closed the connection)
08:27:15*Hideki_ joined #nim
08:31:38*Hideki_ quit (Ping timeout: 260 seconds)
08:36:55*ftsf_ joined #nim
08:39:31*ftsf quit (Ping timeout: 265 seconds)
08:46:30*ryan_ is now known as Kongir
08:47:24FromDiscord<flywind> I want to import one module in nimble which has the same name in `stdlib`, when I use `import module` which one will be searched first?
08:48:42dom96stdlib
08:49:22FromDiscord<flywind> thanks, I will rename it.
08:54:05*couven92 joined #nim
08:55:35liblq-devI just tried to do something with soundio again, so I updated my wrapper to support latest nimterop but now for some reason I get a segv
08:55:51liblq-dev(that reason is that the write callback seems to be null, which is really weird)
08:56:17Araqliblq-dev, compile with --gc:arc and run valgrind
08:56:51liblq-devAraq: my code is incompatible with ARC, it has a bunch of pointer casting with refs which prevents destructors from being generated properly
08:57:04liblq-devshould I just create my own `destroy=` procs?
08:57:10liblq-devhow would I go about doing that?
08:57:39Araqwhat does that mean "prevent destructors from being generated properly"?
08:57:56Araqsounds like a bug you should have reported
08:58:12Araqin fact, it sounds like the bug I fixed yesterday...
08:58:13liblq-devAraq: Error: cannot bind another '=destroy' to: RAudioDeviceObj; previous declaration was constructed here implicitly: /home/daknus/Coding/Nim/rapid/src/rapid/audio/device.nim(41, 14)
08:58:30Araqoh that one, reorder your procs
08:59:22liblq-devhow should I reorder them?
08:59:47liblq-devlike, what order
08:59:56Araqit tells you, "was constructed here"
09:00:15Araqso that must move below your =destroy / finalizer
09:01:39liblq-devoh right
09:03:22liblq-devok, seems to compile now
09:05:38*hax-scramper joined #nim
09:05:45liblq-devwow, that valgrind output's really clean
09:05:58liblq-devI should use ARC a lot more
09:06:43*narimiran joined #nim
09:07:26liblq-devso it seems like there's an invalid write at https://github.com/nim-lang/Nim/blob/version-1-2/lib/system/threads.nim#L307 but I don't see anything else
09:07:55liblq-devhow can I disable segv checks?
09:08:05liblq-devso that valgrind can detect them
09:23:10Araqliblq-dev, compile with -d:noSignalHandler
09:24:31liblq-devwell, problem is that the backtrace points to createThread in the main thread, but the error actually occurs in another thread
09:25:51liblq-devthe backtrace that valgrind gives me, that is
09:26:34Araqthere are other sanitizers beyond valgrind
09:27:04AraqI don't have much experience with valgrind plus multi threading, sorry
09:27:25Araqoh and also use -d:useMalloc
09:27:25*clyybber joined #nim
09:27:38Araqotherwise valgrind is kinda blind
09:31:00*ccx quit (Ping timeout: 256 seconds)
09:31:56liblq-devcan you recommend a different memory sanitizer?
09:32:39PMunchWhat does Nim do when you don't have -d:useMalloc?
09:33:09hax-scramperI'm trying to concatenate `static` parameters in generic (proc takes two types with `array[N1, string]` and `array[N2, string]` as generic parameters and type of return is `array[N1 + N2, string]`). I'm getting compilation error `cannot instantiate U. got: <N1, static[type static[array[0..<invalid value>, string]]]([type node])>
09:33:10hax-scramperbut expected: <N, T>`. The code is here: https://play.nim-lang.org/#ix=2k0w
09:34:01AraqPMunch, it uses our own O(1) allocator
09:34:23Araq(which is usually faster, but not always)
09:34:45clyybberAraq: Were you talking about bugs with gc:orc? Does it work with async?
09:34:59*ccx joined #nim
09:35:28Araqhttps://github.com/nim-lang/Nim/issues/14079 this one for example
09:35:30disbotβž₯ algorithm.sortedByIt template corrupts tuple input under --gc:arc ; snippet at 12https://play.nim-lang.org/#ix=2k0A
09:35:43Araqor what about the bug that keeps 'koch boot --gc:arc' from working?
09:35:46clyybberOk, I will investigate
09:36:00Araqwell I'm on #14079 already
09:36:01disbothttps://github.com/nim-lang/Nim/issues/14079 -- 3algorithm.sortedByIt template corrupts tuple input under --gc:arc ; snippet at 12https://play.nim-lang.org/#ix=2k0A
09:36:05clyybberAh ok
09:36:15Araqbut it would be nice if 'koch boot' worked
09:36:20clyybberThe koch boot --gc:arc bug is because we have too much temporaries
09:36:37Araqwell fix it please
09:36:40clyybberAraq: Is there a proc in the compiler to tell wether a conversion returns an lvalue or rvalue?
09:36:42liblq-devAraq: well anyways, valgrind doesn't help much, but GDB gave me a useful stack trace and from what I can tell what happens is a null pointer function call
09:36:49liblq-devI'm just unable to track down why it happens
09:37:24Araqclyybber, no, I usually assume that conversions are lvalues fwiw
09:37:43clyybberOk
09:38:11Araqand once --gc:arc works for bootstrapping, we should test --gc:orc
09:38:24Araqbut I have a novel optimization for --gc:orc in the pipeline
09:38:31*chemist69 quit (Ping timeout: 272 seconds)
09:38:38PMunchHmm, I have more questions, but it hits me that it's probably just because I don't really know how memory allocation actually works low-level
09:38:57liblq-devso, for some reason it crashes on createThread on ARC
09:39:00PMunchI thought malloc was basically a kernel call
09:39:19*chemist69 joined #nim
09:39:36AraqPMunch, no the kernel call is usually 'mmap'. malloc is not in the kernel because it would be too slow
09:40:00Araqliblq-dev, also try --tlsEmulation:off please
09:40:27liblq-devnope, didn't do anything
09:40:57Araqand also --exceptions:setjmp
09:41:29liblq-devnothing
09:41:36Araqwhich OS are you on?
09:41:42liblq-devlinux
09:41:53liblq-devthe crash happens right here https://github.com/nim-lang/Nim/blob/15ba765ebd83e44d18a0a2c23016bdf3b4bbecca/lib/system/threads.nim#L307
09:42:13liblq-devwhich seems weird as it's just a memory allocation
09:43:13clyybberdom96: Is there a way to grep the irc logs?
09:43:25clyybberI wrote down some stuff on the bug I want to fix but forgot what it was
09:44:25dom96the only way is to look at each day and search it
09:44:34dom96manually :)
09:44:41clyybberdamn
09:47:25PMunchYeah.. I've been thinking about writing an indexing bot for exactly this usecase..
09:47:43PMunchAnd to create graphs and such
09:47:58*exelotl joined #nim
09:48:42dom96I need to modify NimBot to expose these as pure json
09:48:46dom96should make it easier
09:50:50*hax-scramper left #nim ("ERC (IRC client for Emacs 26.3)")
09:51:01*ccx quit (Quit: WeeChat 2.4)
09:51:20*CcxWrk joined #nim
09:52:07clyybberOh, I wrote it down on github too it seems
09:52:42*CcxCZ joined #nim
09:52:48*hax-scramper joined #nim
09:55:20*exelotl_ joined #nim
09:59:25*exelotl quit (Ping timeout: 272 seconds)
10:15:36FromDiscord<flywind> Today it seems travis had some problems with downloading Nim using choosenim.
10:15:55FromDiscord<flywind> https://travis-ci.org/github/iocrate/netkit/jobs/680904654
10:16:04FromDiscord<flywind> https://travis-ci.org/github/planety/prologue/jobs/680939844
10:16:52*liblq-dev quit (Quit: WeeChat 2.8)
10:17:46*solitudesf quit (Read error: Connection reset by peer)
10:18:12dom96looks like whoever is hosting the binaries is not liking the number of requests we are sending
10:18:14*liblq-dev joined #nim
10:18:54*solitudesf joined #nim
10:20:27*liblq-dev quit (Client Quit)
10:20:39*liblq-dev joined #nim
10:24:57*lritter joined #nim
10:28:49*Hideki_ joined #nim
10:32:41*NimBot joined #nim
10:34:51*liblq-dev quit (Quit: WeeChat 2.8)
10:39:07*liblq-dev joined #nim
10:43:08FromGitter<alehander92> PMunch yeah i wanted to see
10:43:23FromGitter<alehander92> how much i spam here
10:43:24FromGitter<alehander92> :D
10:43:26FromGitter<alehander92> show me a graph
10:45:13PMunchHaha, yeah things like that
10:45:16PMunchWho are the biggest posters
10:45:25PMunchHow long do new users stay in the channel
10:45:27PMunchetc.
10:47:15*Hideki_ quit (Ping timeout: 240 seconds)
10:48:17*Hideki_ joined #nim
10:49:39*Hideki_ quit (Remote host closed the connection)
10:49:42FromGitter<alehander92> yea
10:50:49*krux02 joined #nim
10:53:19FromDiscord<Recruit_main707> Zevv, can you use nim on an arduino emulator??
10:54:05*Hideki_ joined #nim
10:58:34*Hideki_ quit (Ping timeout: 260 seconds)
10:59:08PMunchRecruit_main707, I did manage to run it on the Arduboy emulator
10:59:34PMunchSo I'd say an arduino emulator shouldn't be a problem
10:59:40FromDiscord<Recruit_main707> how hard was it?
10:59:59Araqclyybber, or work on some other "showstopper" bug please
11:06:02clyybberAraq: This is a showstopper IMO. The actual bug is not exclusive to gc:arc either
11:07:31*Kaivo joined #nim
11:10:01*ryan_ joined #nim
11:12:49*Kongir quit (Ping timeout: 264 seconds)
11:15:13*Guest68929 quit (Ping timeout: 246 seconds)
11:16:31*dadada joined #nim
11:16:55*dadada is now known as Guest29432
11:22:42*Trustable joined #nim
11:27:56*Hideki_ joined #nim
11:38:27*rockcavera joined #nim
11:39:03Araqclyybber, which one?
11:39:47clyybberThis one:
11:39:49clyybbertype
11:39:50clyybber TPassContext = object of RootObj
11:39:52clyybber PPassContext = ref TPassContext
11:39:54clyybber PCtx = ref object of TPassContext
11:39:56clyybber a: int
11:39:58clyybber ModuleGraph = object
11:40:00clyybber vm: RootRef
11:40:02clyybberproc main() =
11:40:04clyybber var g = ModuleGraph(vm: new(Pctx))
11:40:06clyybber PPassContext(PCtx(g.vm)) = nil #This compiles, but crashes at runtime with gc:arc
11:40:08clyybber #PCtx(g.vm) = nil #This generates invalid C code
11:40:10clyybbermain()
11:40:12clyybber
11:40:24clyybberOh sorry, this is the case which only crashes with gc:arc
11:41:29clyybberThis is the one: http://ix.io/2k1p
11:41:44clyybberThis generates invalid C code regardless of which gc we choose
11:42:29Araqwell now you know what to work on. ;-)
11:42:48clyybberThats what I'm doing :)
11:49:53shashlick@liblq-dev: not sure if your crash is nimterop related but try `flags = "-H"` for your cImport call
11:50:07krux02Araq, It would have been nice if you told me that you are going to remove me from the Nim organization
11:50:08liblq-devwhat does that do?
11:50:08shashlickIf you are trying #head
11:52:11shashlickhttps://github.com/nimterop/nimterop/issues/169
11:52:12disbotβž₯ Skip `{.header.}` generation
11:52:46*Hideki_ quit (Ping timeout: 260 seconds)
11:52:59shashlickBasically -H adds the {.header.} pragma
11:53:09Araqkrux02, when I did that I had no idea I could still talk with you reasonably about anything
11:53:31shashlickIt was the default in 0.4.4 but is now opt in
11:54:26shashlickIf it fixes your issue then I'll have to reconsider since it will be the second crash
11:54:49shashlickHowever it could also be a wrapper gen bug but need more info to debug
12:06:02*supakeen quit (Quit: WeeChat 1.9.1)
12:06:47*supakeen joined #nim
12:07:19shashlick@Clyybber - your challenges with nimterop are hopefully fixed in master - it can now detect the config instead of depending on nimble
12:07:36shashlickAppreciate some testing when you get a chance
12:08:24*Vladar joined #nim
12:14:08*jegfish joined #nim
12:15:05liblq-devshashlick: but how would {.header.} affect runtime though?
12:16:30shashlickHaven't dug into it but it's worth checking
12:19:47shashlickhttps://nim-lang.github.io/Nim/manual.html#implementation-specific-pragmas-header-pragma
12:20:39shashlickBasically you are using the C type directly in the code so the size, etc will be exactly how it's defined
12:21:12clyybbershashlick: Nice, I'll test it later!
12:21:12shashlick@leorize suggested there are cases where headers hide details but I'm not sure how that works
12:21:34shashlickMy contention is that there could be a bug
12:21:56shashlickBut are you also testing when the new ast2 backend?
12:22:30shashlick`flags = "-f:ast2"`
12:22:39shashlickWith
12:32:11*dddddd joined #nim
12:38:07*jegfish quit (Quit: Leaving)
12:44:45*Hideki_ joined #nim
12:45:39ZevvRecruit_main707: I don't see why not
12:48:54*Hideki_ quit (Ping timeout: 240 seconds)
12:51:19*Hideki_ joined #nim
13:01:52disruptekshashlick: you're doing it again. bump more versions, please.
13:02:26clyybberHmm, this bug stems from the fact that lvalue casts are not a thing in C. Solution is to cast the address I guess.
13:02:35clyybberZevv: Would that violate strict aliasing rules?
13:03:48*tane joined #nim
13:04:58*Hideki_ quit (Remote host closed the connection)
13:05:29disruptekshashlick: something wacky this way comes: https://api.travis-ci.org/v3/job/680316448/log.txt
13:05:45*Hideki_ joined #nim
13:07:05Araqclyybber, it wouldn't
13:07:35Araqstrict aliasing is very subtle but don't worry about it, I'm gonna review your PR :P
13:08:08Araqspeaking of which... we compile without strict aliasing with --gc:arc we don't have to do that
13:10:15*Hideki_ quit (Ping timeout: 240 seconds)
13:13:03*sunwukong joined #nim
13:15:50*abm joined #nim
13:17:53*waleee-cl joined #nim
13:24:14*Hideki_ joined #nim
13:24:23*ftsf_ quit (Ping timeout: 246 seconds)
13:24:37shashlickdisruptek: it's a big release with breaking changes so i'm taking my time to tag
13:24:57shashlickwant to transition to ast2 carefully
13:25:30PMunchhttps://www.techspot.com/news/85020-lenovo-start-offering-thinkpads-linux-pre-installed.html
13:25:33PMunchNice!
13:26:38shashlickdisruptek: looks like i'll have to tag now thanks to that paramCount change
13:26:53shashlickthat's caused a lot of heartburn, what's the value in such a change
13:27:04PMunchparamCount change?
13:27:22*Vladar quit (Quit: Leaving)
13:27:27shashlickhttps://github.com/nim-lang/Nim/pull/12860
13:27:28disbotβž₯ Undefine `paramCount` & `paramStr` in nimscript.nim for *.nims
13:28:31Araqshashlick, I think we need to revert this change
13:28:48Araqbreaks too much code
13:31:01PMunchWait, so they just moved into the os module?
13:31:27PMunchWhy not have nimscript just automatically import them from there. Possibly with a deprecation warning?
13:32:35FromGitter<kaushalmodi> The main issue was that if someone did `import os`, nim complained of ambiguous imports.
13:32:52FromGitter<kaushalmodi> The upcoming PR proposed by @timotheecour should fix that issue.
13:33:36Araqfrom os import paramStr, paramCount
13:33:59Araqexport paramStr, paramCount
13:34:09FromGitter<kaushalmodi> Araq: Then the user has to keep a manual check on what `os` procs are defined in system + nimscript
13:34:17Araqshould do it, the compiler understands 'export' well and doesn't complain about ambiguous symbols
13:35:33FromGitter<kaushalmodi> After this is reverted, my `config.nims` will have `import os except existsDir, dirExists, existsFile, fileExists, findExe, paramCount, paramStr`
13:35:48FromGitter<kaushalmodi> the user should not need to manually track the ambiguous procs between os and system
13:35:59*xcm quit (Remote host closed the connection)
13:38:46*Hideki_ quit (Remote host closed the connection)
13:39:06*Hideki_ joined #nim
13:39:20*zacharycarter joined #nim
13:40:25Araqexactly my point...
13:40:33shashlickAraq: if it genuinely cleans the code, i think we can deal with it but i haven't looked at this with sufficient detail
13:43:52*xcm joined #nim
13:44:19*zacharyc1rter joined #nim
13:45:23Araqwell I'm not really into this problem but I don't see why we cannot simply use import+export
13:45:24*BohlAdmin joined #nim
13:45:34Araqso that code continues to work
13:46:08*BohlAdmin left #nim (#nim)
13:50:10disruptekCORRECT BY CONSTRUCTION
13:51:08FromDiscord<Rika> caps
13:51:42disruptekhell yeah caps
13:51:46Araqdisruptek, remember I said Nimscript causes ongoing costs?
13:51:54Araqand here we are. ;-)
13:53:35shashlickwhat's the problem with nimscript.nim today?
13:53:42shashlickwhy do you want to get rid of it?
13:53:54disrupteksometimes i wish this community had more focus.
13:54:18clyybbercommunity .. focus
13:54:21clyybberits antithetic
13:54:39disruptekdoesn't have to be.
13:55:10clyybberhas to be antithetic in a "free" community
13:55:21clyybberwhat should we focus on IYO?
13:56:31disruptekrowing in the same direction.
13:56:43clyybberin which direction?
13:57:05FromGitter<kaushalmodi> in the direction of config.nims
13:57:15*xcm quit (Remote host closed the connection)
13:58:49shashlickwhat disruptek is saying is that we pick a feature of the week or month and get it in shape as a team
13:59:29*xcm joined #nim
14:03:59*nisstyre quit (Quit: WeeChat 2.7)
14:04:27*PMunch quit (Quit: leaving)
14:05:35*nisstyre joined #nim
14:05:50*Hideki_ quit (Remote host closed the connection)
14:06:08disrupteki think the pipeline of features/fixes needs to be curated.
14:06:21disruptekfocussed.
14:06:38Araqwell it's my fault
14:06:41shashlicki agree with that
14:06:44*Hideki_ joined #nim
14:06:51disruptekyeah, let's pile on araq.
14:07:08AraqI did the PR week, trying to get as many PRs merged/rejected as I could
14:07:11shashlickbut it's not like we all know all parts of the ecosystem
14:07:17zacharycarterIf I'm using `--gc:arc` and I pass a ref object to another thread, I need to call `GC_ref` corect? When do I then call `GC_unref`?
14:07:21disruptekthat's why we need to work together.
14:07:29shashlicklike if Araq said it's --gc:arc week, i can only do some testing at best
14:07:35zacharycarterat the end of the threads execution or back in the main thread?
14:07:54disruptekit's not just about cohesive work, it's about /not/ working on things out of scope.
14:08:03disruptekso they stay in a control group.
14:08:20disrupteki can't even CI most of my stuff most of the time because it's failing for one reason or another.
14:08:23Araqzacharycarter, you don't need the GC_ref/unref dance anymore but you need to ensure you *move* the refs
14:08:40FromGitter<bung87> does nimble run pass compile flags?
14:08:44shashlickso a proclamation that only PRs for features X, Y and Z will be accepted?
14:09:00zacharycarterAraq: but what if I want to keep a copy of the object on the main thread as well? then I can't move right? Not until deepCopy works at least?
14:09:35Araqwhy would you do that though, it's a recipe for race conditions
14:09:48shashlickbung87 - yes per the help
14:09:55*sunwukong` joined #nim
14:10:25Araqif you want to do that, write a SharedRef[T]
14:10:27*sunwukong quit (Read error: Connection reset by peer)
14:10:55*Hideki_ quit (Ping timeout: 246 seconds)
14:10:59FromGitter<bung87> `nimble run -d:bundle='/var/folders/j_/rjvv27dx4z594dfdfl7q9_kh0000gn/T/zipBundle.zip' --threads:on ` `defined(bundle)` not true
14:11:10zacharycarterwell I was going to use sync primitives to try to prevent races but it is messy... I guess I need to look at my code and figure out a way to eliminate shared state if possible
14:12:46zacharycarterbut I also see what you mean that `deepCopy` and then `moving` makes no sense either
14:12:52*Hideki_ joined #nim
14:12:58FromGitter<bung87> o, I should look carefully
14:13:07clyybberdisruptek: What is out of scope for example?
14:13:25Araqclyybber, stuff that breaks somebody's code, I think.
14:13:41Araqunfortunately, our "important package" testing is still insufficient
14:14:20leorizehow do other projects handle this?
14:14:38clyybberBy not testing with the devel compiler I guess
14:15:25clyybberSimilarily to the csize_t thing I think reverting it now would cause even more hassle/work.
14:16:13leorizewe probably should see how other projects do their management
14:16:30leorizemaybe they have some tricks that we don't know of
14:16:56leorizeI don't think "man power" is an issue anymore for Nim
14:17:48Araqleorize, I think it is in the sense that we don't make good use of our man power
14:18:12disrupteki really want to write a ci that doesn't suck.
14:18:44AraqI thought about writing RFCs about what should be developed and spend roughly 100% of my time on code reviews
14:19:16disruptekroughly.
14:20:08disruptekthe thing is, i like the lesson of "it's not rocket science" but i just don't think it really captures the whole space.
14:20:18disruptekthe rust ci, i mean.
14:20:19leorizetoo much of nim is dependent on Araq :/
14:20:58leorizewhat happened to the entire code owners proposal btw?
14:21:41Araqthe other code owners don't get to work 10 hours every day on Nim, it's still a thing though
14:24:55leorizealso I think we should spend a lot more time fixing bugs
14:25:06leorizethe compiler just have too many of them
14:25:33leorizenew features are nice and all, but bugs when using Nim-specific features drive people away
14:26:23Araqit depends on the bug, most remaining bugs will cause regressions when fixed
14:26:41FromDiscord<Recruit_main707> is this doable? `proc check_packet_type(packet: JsonNode): GameState or Error =`
14:26:52disruptekfewer PRs, higher quality.
14:26:55leorizewe have 6 yrs old crashes
14:27:22leorizeI think regressions are fine if they can be justified
14:27:32leorizeie. tightening up some unspecified parts of the spec
14:28:15leorizecurrently the situation with macros/generics is: if it doesn't work, report a bug, then hunt for ways to make it work while you wait for the bug to be fixed
14:28:31disrupteknimph is only crash-free when built on 1.0 and it cannot determine prefixDir on 1.0, so it cannot function.
14:28:48disruptekso you build it with 1.0 but you run it against later compilers... that cannot build it.
14:29:10Araqdisruptek, we can fix the later compilers though
14:29:11clyybberWhy do you get crashes on 1.2?
14:29:26disrupteksome kinda openssl alloc bullshit, who cares.
14:29:36clyybberwell, you should?
14:29:44AraqRecruit_main707: use an Either[T, S] type
14:29:44FromDiscord<Rika> @Recruit_main707 no
14:29:51FromDiscord<Rika> what araq said yes
14:30:09disruptekgittyup failed its cron-job CI after less than a week because of some choosenim/nimterop bug.
14:30:25FromDiscord<Rika> you can also just make a Result[T, E], which is basically an Either
14:30:41FromDiscord<Rika> maybe add some helper procs for Result too like isError or something
14:31:13FromDiscord<Rika> you can also do what golang does, use a tuple
14:31:16FromDiscord<Rika> but i dont recommend that lol
14:31:41FromDiscord<Recruit_main707> how does this Either/Result work?
14:31:46Araqleorize, well ok, crashes are easier as the chance of regressions is lower
14:31:56FromDiscord<Rika> its an object variant im guessing
14:32:05Araqand I can give you the missing pieces of the spec too, I wrote them down somewhere
14:32:28leorizeI'm also seeing a huge amount of bugs assigned to zah
14:32:33leorizebut he is not active nowadays
14:32:45Araqbut that's again "omg, let's fix everything at the same time and also: the Nimble package ecosystem must grow and continue to work"
14:33:13FromDiscord<Rika> https://play.nim-lang.org/#ix=2k2D something like this i assume @Recruit_main707
14:33:23leorizeit's a bridge that we have to cross
14:33:33leorizegaining "maintained" packages are better than just packages
14:34:25FromDiscord<Recruit_main707> i think make both inherit from a Message packet is probably the best way
14:34:34FromDiscord<Recruit_main707> Message type*
14:34:34zacharycarterdoes this make sense? - https://play.nim-lang.org/#ix=2gcc
14:34:36leorizeand nothing drives people away more than "I try to do this thing with macros but it crashes on me instead"
14:35:23leorizeI think it's ok to spend a month just hunting down as many issues as possible
14:35:27leorizeiirc we did this for 1.0
14:35:56Araqwe need tick-tock releases
14:36:06Araqlike Intel did
14:36:09disruptekyes.
14:36:24disrupteki always do it and it's never a problem.
14:37:19leorizeour packages ecosystem is in a much better shape right now
14:37:49disruptekwe don't have to come up with the perfect improvement to the project, just some things to experiment with.
14:38:45Araqbut I do what I do because IMO a "fixed Nim v1" with all the bad parts regarding its threading story for me is an uncompetitive Nim.
14:39:08disruptekshashlick: would you write a spec for how pm should work in nim? then we can version it and make the compiler and pm work together always.
14:39:15Araqand if that means I spend less time on compiler crashes, so be it
14:39:36Araqnice side effect: I also don't get regressions due to compiler "fixes"
14:39:51clyybberdisruptek: Isn't nimph exactly that?
14:40:12disrupteknot as long as the compiler changes.
14:40:13leorizethe threading story is not gonna be perfect anytime soon
14:40:27leorizewhat happen to bugs while you're at it?
14:40:45companion_cubesince nim has such a pascal influence, what do you make of Ada tasks?
14:40:45Araqleorize, they become your job ;-)
14:41:07disrupteknew features really have to justify their existence.
14:41:23companion_cube(as a main model of threading I mean)
14:41:25leorizecan't you ask status to dedicate a personnel for fixing bugs? :P
14:41:33disruptekthey are increasingly expensive. so much so that some features that were cheap are now both unused and expensive to carry.
14:41:35clyybberdisruptek: Can you specify which compiler changes? Maybe its an easy fix
14:41:49leorizeI work on my own projects and what annoys me more than ever is the need to hunt compiler bugs
14:42:24disruptekwell, as an example, choosenim raised a bug in nimph, the "correct" solution of which was to change the compiler. so devel has this fix but 1.0 does not.
14:42:26companion_cubeI think kruxΓΈ2 has ideas about what features to remove :p
14:42:51zacharycarterI guess my `SharedRef[T]` works because I'm not leaking anything and I'm not encountering any NPE's. ASAN is also happy
14:43:12zacharycarterOh yeah - krux02 was saying last night that he's no longer a member of the Nim org on Github
14:43:22zacharycarterNot sure if that was a mistake or what
14:43:22clyybberdisruptek: So say you only support 1.2 and above? That doesn't work because you get crashes. So these must be fixed?
14:43:33companion_cubeoh so did he quit?
14:43:37disruptekthis isn't about my projects; i can handle them.
14:44:01zacharycartercompanion_cube: no... I dont think he removed himself
14:44:13Araqhe didn't quit, I removed him.
14:44:38zacharycarterokay then - not trying to stir anything up just wanted to mention that he had noticed and was trying to tag an issue or something
14:46:36Araqcompanion_cube, Ada tasks are most often mapped to threads
14:47:32narimiran" the other code owners don't get to work 10 hours every day on Nim" -> but there is a certain someone who opens 3 PRs/day, opens 5 issues/day, writes 50 comments/day, etc. maybe we could focus him on more important stuff? ;)
14:48:11narimiran(to my untrained eye, it looks like he spends 15+ hours/day on Nim :))
14:48:30clyybberThe threading story is a library only issue IMO.
14:48:40leorizethe entire compiler is owned by Araq :P
14:48:43FromDiscord<Rika> let's clone ar4a
14:48:44FromDiscord<Rika> q
14:48:50clyybber(discarding the fact that spawn is in the compiler :p)
14:48:59FromDiscord<Rika> damn fingers aint hitting well because my nails are long
14:49:08clyybberlol
14:49:16Araqclyybber, it's beginning to be a library issue because of arc/orc
14:49:23clyybberYeah
14:49:54FromDiscord<Recruit_main707> Rika: how did you miss the q for 4 though
14:50:09Araqzacharycarter, it wasn't a mistake, you cannot shit on me all day long and expect no reaction
14:50:48FromDiscord<Rika> @Recruit_main707 4 is intentional, i hit a instead of q
14:53:04*fredrik92 joined #nim
14:53:32*fredrik92 quit (Client Quit)
14:53:55FromGitter<Bennyelg> whats is wrong on with this pattern when I use os.walkfiles *_(\\d){8}_(\\d){4}.sql inside specific dir with 1 file (add_column_to_students_20200101_1000)
14:54:00FromGitter<Bennyelg> (add_column_to_students_20200101_1000.sql)
14:54:22Araqleorize, fix bugs, get bounties
14:55:11Araqdisruptek, I think the problem for you was mostly our lovely "we must check certificates for SSL" change
14:55:37Yardanicoso about arc - how do I debug its issues? :P for example nimes (nes emulator in nim) runs fine with default GC on devel but not with arc
14:55:50leorizewell where are the bounties? :P
14:55:50leorizewe stopped assigning them 2-3 years ago :P
14:56:18leorize-d:useMalloc and valgrind :p
14:56:28Yardanicoleorize: well it doesn't leak memory
14:56:32Yardanicoit segfaults at some array access
14:56:37Yardanicoas far as I can see
14:56:48Yardanicobut yeah I'll try
14:56:49clyybberHmm. Does valgrind not tell anything?
14:57:17leorizevalgrind is more than just a "memory leak checker" :p
14:58:46Yardanicowell the last valgrind message before the segfault (segfault has a full nim traceback btw) "Invalid read of size 8" ..call stack.. "Address 0x0 is not stack'd, malloc'd or (recently) free'd"
14:59:06clyybberAh, nice so its a use after destroy
14:59:10clyybberProbably
14:59:35Yardaniconimes is ~2k loc but I'll try to minimize it
15:00:52clyybberThanks <3
15:02:05zacharycarterAraq: is this similar to what you meant by a `SharedRef[T]`?
15:02:15zacharycarterhttps://play.nim-lang.org/#ix=2gcc
15:02:44Araqthat link doesn't work for me
15:02:53zacharycarterlet me try again
15:03:02zacharycarterhttps://play.nim-lang.org/#ix=2k2M
15:03:08Yardanicoalso nimes uses nim sdl2 wrapper so maybe that's an issue too
15:04:18clyybberShouldn't be
15:04:31Yardanicook, now it's 1.7k loc
15:05:37zacharycarterdoes that link work?
15:06:16Yardanicozacharycarter: the last one you sent? yes
15:06:23YardanicoI mean webpage opens :P
15:08:02zacharycartercool thanks :)
15:09:47Araqzacharycarter, hmm looks dangerous
15:10:35*Hideki_ quit (Remote host closed the connection)
15:11:47*Hideki_ joined #nim
15:16:10*Hideki_ quit (Ping timeout: 260 seconds)
15:17:21clyybberAraq: Do you think its better to always cast so as to preserve the lvalueness or should I only do it when theres a lfPrepareForMutation ?
15:18:30AraqI don't know
15:21:49clyybberHmm, its a bit of a tricky issue. Basically we have to know when generating the conversion wether we want an lvalue or not.
15:22:20clyybberSo I generate the casts so as to preserve lvalueness when possible.
15:22:29Araqpass it down via another flag in the TLoc, as you outlined
15:22:38clyybberOk
15:22:58Araq(if only the codegen was an AST to AST transformation...)
15:22:58clyybberIs there a helper proc to check wether a node is an lvalue or rvalue?
15:23:08Araqplenty
15:24:05Araqparampatterns.isLValue
15:26:08clyybberIs that ok to use in cgen?
15:26:40Araqyeah
15:29:01clyybberBtw, asking everyone here, whats your opinion on those CI badges?
15:29:14YardanicoI personally don't think they're so useful
15:29:17narimiranclyybber: probably the same as yours ;)
15:29:26Yardanicoit's just to boast "look my tests are passing"
15:29:33clyybberIMO they don't really have a purpose other than detracting potential users because of red CI and being advertisement for the CI s
15:29:38Yardanicook it seems to fail on this line "let n = mem.nes"
15:29:57Yardanicowhere mem is a ref object, and nes is its only field
15:30:04Yardanicooh maybe cyclic references
15:30:09AraqI like them fwiw
15:30:22Yardanicocan arc segfault because of cyclic references or not?
15:30:22AraqYardanico, they don't have any influence
15:30:26Yardanicoah ok
15:30:29Araqit cannot
15:30:30clyybberThe way the readme currently looks is a bit ugly
15:30:31FromDiscord<Rika> failing ci tests can be some sort of red flag or so
15:31:08clyybberRika: Exactly, and the CI's often fail due to unrelated (non nim) issues
15:31:15narimiranAraq: are you aware that we now have 7 of those badges?
15:32:32clyybberThis "devel: BIGBADGE 1.0: BIGBADGE" formatting doesn't look too good IMO
15:32:35zacharycarterAraq: what should I do then? Use `allocShared` and a counter or something?
15:33:51Yardanicoclyybber: so I have to look for some eqdestroy calls for the mem.nes field which is apparently 0 ?
15:33:57Yardanicoi mean it's zeroed somewhere
15:34:20clyybberYardanico: Yeah, its probably a double free/destroy
15:35:09clyybberYou don't have to look for them though, only minimize and report it :D
15:35:34leorizenarimiran: we can probably put all of those badges in a table :P
15:35:39leorizeor just get rid of them
15:35:51*solitudesf quit (Remote host closed the connection)
15:35:54leorizeI never understand the appeal
15:35:57narimirani like the latter solution ;)
15:36:09clyybberSame
15:36:11Yardanicowell there are 5 places where eqdestroy___hNmUe038zNCVJTLCEwmijA(&nes); is called
15:36:18Yardanicoin the C code
15:36:55Yardanicoah maybe that's on error
15:37:55*solitudesf joined #nim
15:40:21clyybberYardanico: Yeah, thats the bug in the compiler
15:40:53Yardanicoso I set =destroy hook for the CPU object in nimes and it was called twice, although there still was a segfault so it isn't the only place with double free or something
15:41:07Araqzacharycarter, https://github.com/nim-lang/Nim/pull/10485/files study this
15:41:08disbotβž₯ Draft of smart pointers library for Nim
15:41:13Yardanicobecause if I replace =destroy with my own hook which doesn't actually destroy the object it should've worked, so I'll try to add more =destroy hooks
15:41:50zacharycarterthanks Araq
15:43:25*Hideki_ joined #nim
15:44:17clyybberYardanico: Does nimes use custom =destroys ?
15:44:21Yardanicono
15:44:26Yardanicolast commit was 1.5 years ago ;)
15:44:43Yardanicobut it still works just fine with default gc on latest devel, only a few deprecation warnings
15:47:24leorizedoes it use finalizers?
15:48:05YardanicoI don't think so
15:48:35Yardanicoalso I'm down to 1.5k loc :D removing stuff not related to the bug
15:48:50Yardanicoand yes I still test with default gc to make sure it doesn't segfault
15:51:43*couven92 quit (Ping timeout: 246 seconds)
15:56:34Yardanicook lemme try to manually remove all these 5 destroy calls from the C code and see if it works :P
16:04:59*Vladar joined #nim
16:06:20*sunwukong` quit (Quit: Leaving)
16:08:00*Hideki_ quit (Ping timeout: 256 seconds)
16:08:15*solitudesf quit (Remote host closed the connection)
16:09:33*solitudesf joined #nim
16:17:27Yardanicodown to 700 loc :D
16:21:49Yardanicook I'm getting there, 300 loc
16:28:19clyybber\o/
16:29:56*couven92 joined #nim
16:30:06Yardanicoclyybber: will it be better for you if I put everything in 1 file or not?
16:30:41clyybberWould be better probably
16:30:45liblq-devdoes echo still flush stdout?
16:30:56clyybberYeah
16:31:04liblq-devhm
16:31:35clyybberAraq: If this is true https://github.com/nim-lang/Nim/blob/devel/compiler/ccgexprs.nim#L2470 it will probably be tyRef right?
16:35:46Yardanicook I think I can't minimize anymore, it's 178 lines of code (134 cloc)
16:36:10Yardanicoalso it requires a .nes file (although I'm using one of the emulator test ROMs available for download freely)
16:38:41FromDiscord<Recruit_main707> i see nes emulators are a popular project
16:38:46Yardanicowell kinda
16:38:50Yardanicobecause it's all documented and stuff
16:38:58Yardaniconimes is ~2k cloc
16:39:01Yardanicofull NES emulator
16:39:05FromDiscord<Recruit_main707> what are those test ROMs?
16:39:14Yardanicohttps://wiki.nesdev.com/w/index.php/Emulator_tests
16:39:15*liblq-dev quit (Ping timeout: 240 seconds)
16:39:23YardanicoI'm using the first one from branch_timing_tests here
16:39:32FromDiscord<Recruit_main707> because i _might_ have just grabbed the first ones i found
16:39:48Yardaniconimes will work for ~85% of all nes roms out there
16:39:54Yardanicoit won't work for roms which use some less known mappers
16:39:55FromDiscord<Recruit_main707> https://tenor.com/view/pewdiepie-9year-old-army-tgay-congratulations-for-legal-reasons-thats-ajoke-gif-13924557
16:40:33FromDiscord<Generic> I'm writing a 3ds emulator in Nim
16:41:13FromDiscord<Generic> though if it will ever start game (or even homebrew) is still unknown
16:41:16*liblq-dev joined #nim
16:41:21Yardanicoclyybber: https://file.io/itlqvV7k it's one self-contained file and a NES rom (taken from https://wiki.nesdev.com/w/index.php/Emulator_tests)
16:41:27Yardanicoi removed all sdl2 dependencies, it only depends on stdlib
16:41:43Yardanicothe "correct behaviour" for it is to do an endless loop and print "false", but with --gc:arc it segfaults
16:42:57Yardanicoah right
16:43:05Yardanicoit works if I remove " result.apu = initAPU(result)" line
16:43:19Yardanico(it enters an endless loop with --gc:arc just like with default gc which is "correct")
16:44:44Yardanicooh wait, I don't think it needs a rom at all
16:47:32Yardanicoshould I make an issue? it's 69 loc now https://gist.github.com/Yardanico/4f2d95d1e7df51cfb7a1d91ae65326ea
16:50:51leorize[m]yep, that looks clean
16:51:09Yardanicopoor nimes, i stripped everything I could :D
16:54:47Yardanicohttps://github.com/nim-lang/Nim/issues/14159 done
16:54:49disbotβž₯ [ARC] Segfault with cyclic references (?) ; snippet at 12https://play.nim-lang.org/#ix=2k3K
16:55:21dgbMaking a NES emulator in Nim? Nice.
16:55:28Yardanicodgb: no, it existed for a long time now
16:55:37Yardanicohttps://github.com/def-/nimes I was just trying to run it with --gc:arc
16:56:01dgbAhh, I see
17:00:57clyybberYardanico: Good job on that minification!
17:01:11Yardanicowell I hope I didn't mess something up while reducing it :P
17:01:19Yardanicothe error still seems to be the same as in the start though
17:01:29*rockcavera quit (Remote host closed the connection)
17:01:58FromDiscord<Recruit_main707> is it finished yet?
17:02:04Yardanicowhat?
17:02:11FromDiscord<Recruit_main707> nimes
17:02:15Yardaniconimes? it's finished for years
17:02:22FromDiscord<Recruit_main707> ah xD
17:02:36FromDiscord<Recruit_main707> so you are testing arc with it then?
17:02:38Yardanicoread readme in https://github.com/def-/nimes and https://hookrace.net/nimes/
17:02:39Yardanicoyes
17:02:45Yardanicoactually read https://hookrace.net/blog/porting-nes-go-nim/
17:03:15leorize[m]https://doc.rust-lang.org/error-index.html <- this is pretty useful
17:03:18leorize[m]maybe we can do something similar
17:03:38YardanicoI think someone talked about a bit similar idea
17:03:49Yardanicocreate a tool which will parse nim compiler error messages and give useful output baed on them
17:04:32Yardanicobased* my s key seems to be working badly
17:06:27*rockcavera joined #nim
17:08:27*rockcavera quit ()
17:15:27clyybberAraq: https://github.com/nim-lang/Nim/pull/14161
17:15:28disbotβž₯ Fix #14160
17:36:28*exelotl_ is now known as exelotl
17:39:41FromGitter<Bennyelg> what is wrong ? ⏎ let dt = "202001011000" ⏎ parse(dt, "yyyyMMddhhmmss")
17:40:49Yardanicoyou don't have seconds in this string
17:40:56YardanicoyyyyMMddhhmm works fine
17:41:05FromGitter<Bennyelg> oh bah yea thanks didnt notice :|
17:42:05Araqclyybber, nice and I have a fix for #14079
17:42:06disbothttps://github.com/nim-lang/Nim/issues/14079 -- 3algorithm.sortedByIt template corrupts tuple input under --gc:arc ; snippet at 12https://play.nim-lang.org/#ix=2k0A
17:42:50*xcm quit (Remote host closed the connection)
17:45:32*xcm joined #nim
17:50:04shashlickso i ran an execCmd() call that returned a value of ret = 256, when I use quit(ret), i get a value of 0 - what's going on?
17:50:27shashlickthis is only on osx
17:52:17leorizeoverflow :P
17:52:42leorizeexecCmd() does some magic to mask the return code so that it's similar to what a shell would return
17:52:43shashlickbut return value of execCmd() is defined as int, and for quit(), the param is int again
17:53:01leorizethe overflow is not in nim
17:53:14leorizeit's how macos works
17:53:44shashlickokay so what's my recourse
17:53:53shashlickif osx and val > 255, mod
17:54:05Araqonly use 0 and 1 as exit codes
17:54:24leorizeshashlick: looks like this is posix fault
17:54:37shashlicki'm calling nim which errors out with AssertionError and sets errorlevel = 256
17:55:27leorize> The value of status may be 0, EXIT_SUCCESS, EXIT_FAILURE, or any other value, though only the least significant 8 bits shall be available to a waiting parent process.
17:57:33*natrys joined #nim
17:57:57*rockcavera joined #nim
18:01:10shashlickokay `quit(ret mod 255)`
18:04:54*Hideki_ joined #nim
18:09:49*Hideki_ quit (Ping timeout: 264 seconds)
18:31:11zacharycartermratsim: would you be opposed to me working on - https://github.com/mratsim/weave/issues/88
18:31:12disbotβž₯ Latency-optimized / job priorities / soft real-time parallel scheduling
18:31:36zacharycarterand also updating the benchmarks to follow pointers for copyMem calls to get things working with `--gc:arc`?
18:35:12zacharycarteractually - I could use an example for the last thing I mentioned as to where this is an issue and what needs to change
18:37:38FromDiscord<Recruit_main707> once a thread ends the rest of them seem to die, why?
18:38:43zacharycarterdo you have an example?
18:39:20FromDiscord<Recruit_main707> https://play.nim-lang.org/#ix=2k4x
18:39:27FromDiscord<Recruit_main707> i didnt include the actual url
18:40:54FromDiscord<Recruit_main707> at line 97 the client thread should end, and the bot thread should start working (but it was already active)
18:43:46FromDiscord<mratsim> @zacharycarter, no problem
18:45:17FromDiscord<mratsim> Hint: instead of popFirst, do a popLast here: https://github.com/mratsim/weave/search?q=popFirst&unscoped_q=popFirst
18:46:02zacharycarterah yeah - I think the popFirst and thread local priority queue stuff is pretty straightforward
18:46:06FromDiscord<mratsim> and you probably need each worker to have a local priority queue as well: https://github.com/mratsim/weave/blob/master/weave/datatypes/context_thread_local.nim#L47
18:46:25zacharycarterI was a bit confused about the memcopy stuff and following pointers - is that an issue with Weave itself or just the bnechmarks?
18:47:41FromDiscord<mratsim> what's that memcopy stuff?
18:47:53zacharycarterrelated to gc:arc
18:48:13zacharycarteryou mentioned in IRC the other day:`Weave used to work with arc for all the benchmarks/test suite, the main unknown is Nim seq/strings`
18:48:21zacharycarter`well I'm pretty sure they don't work know because I use copyMem without following pointers but, would support be easy enough to add`
18:49:45FromDiscord<mratsim> arguments are memcpy naively not deep copied
18:50:24FromDiscord<mratsim> that means that for seq/strings without destructors I would have GC issue
18:50:52FromDiscord<mratsim> and with destructors I would need to make sure that the argument are "sink"
18:51:14FromDiscord<mratsim> so that we don't have 2 seq/strings actually "owning" the same memory
18:51:16FromDiscord<mratsim> https://github.com/nim-lang/Nim/blob/devel/lib/system/channels.nim#L334-L341
18:51:37FromDiscord<mratsim> but from the code there ^, with destructors copyMem shoud be good
18:52:45zacharycartergotcha
18:52:49zacharycarterthanks for the explanation
18:53:16Araqthe new string impl is still "pointer free" in the sense no additional indirection was introduced
18:55:30FromDiscord<mratsim> isn't it still ptr + len + reserved?
18:57:34Araqit's a (len, ptr) pair and the ptr pointing to cap + data
18:58:16FromDiscord<mratsim> I see
19:15:10FromGitter<Knaque> I'm writing yet another Git-related tool, and this time around, it needs to work with Github. What's the "best" solution/workaround to the username and password prompts, in the case of using `osproc.execProcess()` to run the commands?
19:24:40leorizeyou can write an interface to that iirc
19:27:06leorizeKnaque: https://git-scm.com/docs/gitcredentials.html
19:28:51FromGitter<Knaque> That essentially saves the username and password to disk, if I understand correctly?
19:29:13leorizeyou can provide a GIT_ASKPASS helper
19:29:35leorizewhich might be something that can notify your program to prompt for that
19:29:39disruptek!repo github
19:29:42disbothttps://github.com/disruptek/github -- 9github: 11github api v3 for nim 15 7⭐ 0🍴 7& 29 more...
19:32:19FromGitter<Knaque> @disruptek that is a *lot* of `call` procs
19:32:59leorizefor quick and dirty access to the api, it's the easiest way :P
19:33:08*natrys quit (Quit: natrys)
19:35:13FromGitter<Knaque> Access to the API isn't really what I'm looking for, I don't think. I'm taking a look at the `GIT_ASKPASS` thing, but I'm not sure if that's quite right. I should've mentioned this initially, but this is using a GUI instead of a terminal, so that makes things a bit trickier.
19:35:16disruptekawait is a template now?
19:35:20disruptekthat shit merged?
19:46:49*natrys joined #nim
19:51:17FromGitter<alehander92> yea?
19:51:32FromGitter<alehander92> is it breaking something?
19:52:00*filcuc joined #nim
19:55:26leorizeKnaque: on *nix, create an unix socket, then generate something that will communicate to that socket which will be run by git as GIT_ASKPASS
19:56:12*Guest29432 is now known as dadada
19:56:14leorizeactually you don't even need a socket, a simple FIFO should work, but if you work with many clients then a socket is recommended
19:59:54FromGitter<Knaque> Okay, to be entirely honest, I don't really know what most of those things are. I'm sure I have orders of magnitude less experience than you.
20:00:40*Trustable quit (Remote host closed the connection)
20:01:44*zacharycarter quit (Remote host closed the connection)
20:01:44*zacharyc1rter quit (Quit: Lost terminal)
20:01:44FromGitter<Knaque> Right now, I'm at a position where all I'm currently being prompted for is a password, so what I *think* would work is writing the password to stdin, or something like that... If only I had a clue on how I would do so.
20:02:07FromDiscord<Rika> sounds insecure
20:02:15FromGitter<Knaque> Of course, that's just a guess based on my loose understanding of how this stuff works.
20:02:27FromGitter<Knaque> And yeah, it's definitely going to be insecure.
20:03:21leorizeyes, you can just write it to stdin
20:03:35leorizeprocess.inputStream will get you the stdin stream
20:03:38leorizethen just write to it
20:04:10leorizeit's not that insecure tbh
20:04:15FromGitter<Knaque> I'm making this project for 2-3 people who don't really feel like learning proper Git, so security isn't really a priority. I just want something that works.
20:04:27leorizewhat os are you targeting?
20:04:52FromGitter<Knaque> They should be using Windows, but it'd be a nice touch if it worked on *nix as well.
20:04:53*natrys quit (Quit: natrys)
20:06:21leorize[m]https://github.com/Microsoft/Git-Credential-Manager-for-Windows/blob/master/Docs/Askpass.md
20:06:22leorize[m]don't handle the passwords then, let windows do it for you
20:08:26leorize[m]that thing even supports github 2FA :)
20:09:10*hax-scramper quit (Remote host closed the connection)
20:12:57FromGitter<Knaque> I *think* I get how GIT_ASKPASS is supposed to work? Correct me if I'm wrong, but it looks like all I really need to do is have a program just write the username and password to stdout, and askpass should just kind of... take care of it.
20:14:36FromGitter<Knaque> To reiterate, I really don't understand most of this stuff, so I'm essentially just guessing here.
20:15:16leorizeyep
20:15:33leorizegit call `$GIT_ASKPASS "Username: "`
20:15:49leorizethen it will take whatever echo-ed out as the input
20:16:30FromGitter<Knaque> Is there a specific format I need to follow?
20:16:48leorizeas written in the manpage, no
20:17:35leorize> A suitable prompt is provided to the program on the command line, and the user’s input is read from its standard output.
20:23:23*leorize quit (Ping timeout: 240 seconds)
20:25:09*leorize joined #nim
20:25:30FromGitter<Knaque> Well, it looks like it's half working. "Invalid username or password."
20:25:46FromGitter<Knaque> So, I must've written it wrong.
20:26:28FromGitter<Knaque> `stdout.write("coolusername\nsupersecretpassword")`
20:26:59FromGitter<Knaque> Does it need prefixes? i.e. `username: coolusername`
20:27:18FromGitter<Knaque> Sorry for all the questions, by the way. I'm just genuinely clueless.
20:27:31leorizeyou gotta experiment :)
20:27:36leorizeI'm as clueless as you are
20:27:46FromGitter<Knaque> ah, that's always fun (:
20:27:52FromGitter<Knaque> Wish me luck.
20:30:51FromGitter<Knaque> Ah, got it! So, evidently, the format is `password\nusername`
20:32:12*liblq-dev quit (Quit: WeeChat 2.8)
20:33:23*narimiran quit (Quit: leaving)
20:33:51*liblq-dev joined #nim
20:38:44*Vladar quit (Quit: Leaving)
20:39:00*filcuc quit (Ping timeout: 244 seconds)
20:42:25*liblq-devel joined #nim
20:45:01*liblq-dev quit (Ping timeout: 246 seconds)
20:49:13Araqbisecting for https://github.com/nim-lang/Nim/issues/14136 would be appreciated
20:49:15disbotβž₯ Semcheck regression when accessing a static parameter in proc ; snippet at 12https://play.nim-lang.org/#ix=2k5M
20:51:13YardanicoI'll try :P
20:52:49*casaca quit (Quit: leaving)
20:55:23YardanicoAraq: I don't know if that's correct, but git bisect says that it's https://github.com/nim-lang/Nim/commit/10eabec6d442cb32c2c74f7c56cc9fff3be40104
20:55:43YardanicoBisecting: 0 revisions left to test after this (roughly 0 steps) [10eabec6d442cb32c2c74f7c56cc9fff3be40104] fix #12864 static params were mutating arg types during sigmatch; fix #12713 ; refs #13529 (#13976)
20:55:45disbothttps://github.com/nim-lang/Nim/pull/13976 -- 6fix #12864 static params were mutating arg types during sigmatch; fix #12713 ; refs #13529
20:58:33leorize[m]same result here
20:58:38*liblq-devel quit (Quit: WeeChat 2.8)
20:59:22leorize[m]koch temp is awesome :P
20:59:27Yardanicoyep :D
20:59:44leorize[m]you can just plug that into `git bisect run` then you can just chill out
20:59:49Yardanicowait wat?!
20:59:53YardanicoI did it manually lol
21:00:14Yardanicooh I see
21:00:15Yardanicovery nice
21:00:36leorize[m]your computer is too fast compared to mine :P
21:01:00*liblq-dev joined #nim
21:01:43*leorize quit (Ping timeout: 240 seconds)
21:02:57*liblq-dev quit (Client Quit)
21:03:05*liblq-dev joined #nim
21:06:16*casaca joined #nim
21:06:50*Jesin quit (Quit: Leaving)
21:08:11*leorize joined #nim
21:11:01*leorize quit (Client Quit)
21:13:20*leorize joined #nim
21:15:25*casaca quit (Quit: leaving)
21:16:50*liblq-dev quit (Quit: WeeChat 2.8)
21:16:53*xcm quit (Ping timeout: 246 seconds)
21:19:04*Jesin joined #nim
21:19:16*casaca joined #nim
21:20:50*xcm joined #nim
21:34:01FromGitter<Bennyelg> from dateTime to only date ?
21:34:10FromGitter<Bennyelg> how I truncate the hh:mm:ss
21:35:13Yardanicohttps://nim-lang.org/docs/times.html#toTime%2CDateTime
21:35:24Yardanicobut it won't "truncate" them
21:35:46*lritter quit (Quit: Leaving)
21:36:05shashlickpoor man's cross-platform timeit to measure time taken for a command to run - https://github.com/nimterop/nimterop/blob/master/tests/timeit.nim
21:36:26Yardanicolol
21:37:17shashlickhere's a timing summary of nimterop tests - https://travis-ci.org/github/nimterop/nimterop/jobs/681167509#L10109
21:38:58FromGitter<Samrose-Ahmed> Hi, anyone encounter `undefined reference to `__builtin_ssubll_overflow` error when building nim from source?
21:39:17Yardanicothat happens if your C compiler is too old
21:39:23Yardanicowhat's it's version (I assume GCC)?
21:39:40FromGitter<Samrose-Ahmed> gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC)
21:39:57*exelotl_ joined #nim
21:41:43*exelotl quit (Ping timeout: 246 seconds)
21:45:58Yardanicoyeah that's a bit too old I think
21:46:40FromGitter<Samrose-Ahmed> Hm Yea makes sense I'll have to upgrade it. thx
21:59:03FromDiscord<Recruit_main707> the godot nim example is broken by default :)
22:02:01FromGitter<zetashift> @Recruit_main707 you mean the stub? I tried it yesterday on 1.2 and it worked for me
22:06:06*zacharycarter joined #nim
22:06:46*Hideki_ joined #nim
22:06:54FromDiscord<Recruit_main707> the dodgethenims
22:07:08FromDiscord<Recruit_main707> like the game example i mean
22:07:33Yardanicowell what's the error?
22:08:08FromDiscord<Recruit_main707> E 0:00:31.582 Unhandled Nim exception (NilAccessError): Could not access value because it is nil.
22:08:08*solitudesf quit (Ping timeout: 265 seconds)
22:08:48FromDiscord<Recruit_main707> proc onMobTimerTimeout*() {.gdExport.} = self.mobSpawnLocation.offset = rand(high(int32)).float64
22:09:01FromDiscord<Recruit_main707> thats the function that causes the error
22:09:02Yardanicowell maybe godot api changed or something
22:10:45*Hideki_ quit (Ping timeout: 240 seconds)
22:10:48FromGitter<zetashift> huh
22:10:57FromGitter<zetashift> that's my code but indeed I never updated that code
22:11:08FromGitter<zetashift> I think I even mentioned that in the readme haha
22:11:56FromGitter<zetashift> wait no dodgethenims was updated
22:13:22*tane quit (Quit: Leaving)
22:14:01FromDiscord<Recruit_main707> the api has not changed in that at least (PathFollow2D still has `offset=`
22:14:17FromGitter<zetashift> it might be because a packedscene isn't set in the editor correctly
22:14:24FromGitter<zetashift> I know that Godot sometimes "forgets" it
22:15:31FromGitter<zetashift> I'll check for you
22:15:46FromDiscord<Recruit_main707> thx
22:16:05FromDiscord<Recruit_main707> ill stay in discord, but i have to go to bed now
22:16:32FromGitter<zetashift> alright I'll ping or just PM you
22:23:14*xcm quit (Remote host closed the connection)
22:24:42FromGitter<iffy> Is there a good non-deprecated replacement for `{.define: mything.}`? When running `nimble test` I want some tests compiled with one flag and other tests compiled with another flag
22:25:22*NimBot joined #nim
22:25:25*xcm joined #nim
22:25:26Yardaniconimbot alive
22:26:28*Trustable joined #nim
22:27:32FromGitter<Bennyelg> how can I do someething like ⏎ ⏎ ```type ⏎ StudentModule = object ⏎ Students: proc ()``` ⏎ ⏎ and pass the function with some of the parameters and not all [https://gitter.im/nim-lang/Nim?at=5ea9ff549f0c955d7d9498f6]
22:29:27FromDiscord<Recruit_main707> I’m not sure what do you mean, you want to pass your prof certain args, but not all of them?
22:29:36FromGitter<zetashift> @Recruit_main707 `If you get a NilAccessError on the method onMobTimerTimeout please load the Mob scene in the editor on the Main Node. So select the Main node and in your Inspector you should see 'mob' as one of the script variables, load the Mob scene located in the scenes folder. You might have to restart your editor to see this after compiling the Nim source. And it might be gone after another restart. `
22:29:41FromGitter<zetashift> also added this to the README
22:29:43FromGitter<Bennyelg> yes
22:30:05FromGitter<Bennyelg> module which will act as a functions container
22:30:06Yardanicowell default values for arguments exisrt
22:30:09FromDiscord<Recruit_main707> zetashift: thank you very much
22:30:46FromDiscord<Recruit_main707> What Yaradinco said, you would need to give them default values probably
22:30:55FromDiscord<Rika> `Yaradinco` is a new one
22:31:04Yardanicoxdd
22:31:37FromDiscord<Recruit_main707> I’ve been reading it like that for so long πŸ˜‚
22:31:56FromDiscord<Recruit_main707> We will say that it’s because it’s late :p
22:40:48FromGitter<Bennyelg> we have a fast way to cast object to son ?
22:40:50FromGitter<Bennyelg> json*
22:41:06Yardanicoif you mean entire objects, no, use %* macro
22:42:06FromGitter<Bennyelg> %* on the object or on each variable inside the object
22:42:23Yardanicocheck docs ;)
22:42:27Yardanicohttps://nim-lang.org/docs/json.html#creating-json
22:42:52FromGitter<Bennyelg> Tried that
22:42:54FromGitter<Bennyelg> not working
22:42:58Yardanicowdy,
22:42:59Yardanicowdym*
22:43:04Yardanicoyou need to specify fields manually
22:43:07Yardaniconot just the object itself
23:11:12*abm quit (Quit: Leaving)
23:12:17*clyybber quit (Quit: WeeChat 2.8)
23:15:54*zedeus quit (Ping timeout: 260 seconds)
23:28:09*zedeus joined #nim
23:41:07FromDiscord<Gary M> ok so I'm trying to translate some C code to nim where it's reading a file into a `void *code = NULL`
23:41:21Yardanicowell do you really want to translate 1:1?
23:41:29Yardanicowhy not use normal nim IO functionality
23:41:38FromDiscord<Gary M> not really because I don't want to deal with malloc stuff
23:41:51FromDiscord<Gary M> but the way I'm doing it isn't working with the library I'm interfacing with
23:41:59Yardanicothat line sets code pointer to NULL afaik
23:42:09FromDiscord<Gary M> yes
23:42:15Yardanicoyou need "pointer" it's basically void *
23:42:30FromDiscord<Gary M> well hold on a sec
23:42:56FromDiscord<Gary M> I'm passing in a struct with the code size and a pointer to the code itself
23:43:11FromDiscord<Gary M> so I'm trying to read the code with readFile()
23:43:33FromDiscord<Gary M> but then for some reason it only wants a pointer of uint32
23:44:49FromDiscord<Gary M> ```
23:44:49FromDiscord<Gary M> VkShaderModuleCreateInfo* {.bycopy.} = object
23:44:50FromDiscord<Gary M> sType*: VkStructureType
23:44:50FromDiscord<Gary M> pNext*: pointer
23:44:50FromDiscord<Gary M> flags*: VkShaderModuleCreateFlags
23:44:50FromDiscord<Gary M> codeSize*: csize_t
23:44:50FromDiscord<Gary M> pCode*: ptr uint32
23:44:52FromDiscord<Gary M> ```
23:46:31FromDiscord<Gary M> so from the documentation, it says >
23:46:31FromDiscord<Gary M>
23:46:32FromDiscord<Gary M> codeSize is the size, in bytes, of the code pointed to by pCode.
23:46:32FromDiscord<Gary M>
23:46:32FromDiscord<Gary M> pCode is a pointer to code that is used to create the shader module. The type and format of the code is determined from the content of the memory addressed by pCode.
23:48:31*krux02_ joined #nim
23:52:25*krux02 quit (Ping timeout: 264 seconds)
23:52:46*zedeus quit (Ping timeout: 260 seconds)
23:54:43*zedeus joined #nim