<< 03-01-2020 >>

00:01:43disruptekprobably nimbus.
00:03:22disrupteksmaller than i expected, actually.
00:03:55disruptekit's about 11k looks like. hell, nimph might actually be larger.
00:04:21disrupteknimph = openapi + github + gittyup + nimph + bump + cutelog + ...
00:04:26disruptekshit adds up.
00:04:29dom96have you measured all its deps?
00:04:48disrupteknope.
00:05:11disruptekbut my github api alone is 26k, iirc.
00:06:08dom96ooh, godbolt has Nim support now :O
00:06:15FromDiscord<mratsim> I would be surprised if you have more deps than nimbus: https://github.com/status-im/nim-beacon-chain/tree/master/vendor
00:06:51disruptekwhen you build it, how many lines does nim say it built?
00:07:50FromDiscord<mratsim> we silence all those useless information :p
00:07:59stefantalpalaru"cloc" says that the Nim compiler (and standard library) have 243698 lines of Nim code.
00:08:40disrupteknim on nimph says 472k.
00:10:37stefantalpalarucloc excludes empty lines and comments.
00:11:23*tane quit (Quit: Leaving)
00:11:34stefantalpalaru`cloc --exclude-dir=nimbus-build-system,nimcache .` in Nimbus finds 106317 lines on Nim code.
00:12:37disrupteknimph: 118586
00:15:08disruptek116k. had a couple test clones in there.
00:16:41stefantalpalaruSame command in nim-beacon-chain (huge submodule overlap with Nimbus) gives 182049 lines of Nim code.
00:17:26disruptekso i have some work to do.
00:18:06disruptekhmm, s3 is only 11k. gonna have to bulk up somehow.
00:19:46stefantalpalaru`cloc .` counts only 4921 lines of Nim code in https://github.com/disruptek/nimph
00:20:37disruptekmost of the code is in the deps.
00:28:06*Hideki_ joined #nim
00:28:23*JustASlacker joined #nim
00:32:54*xet7 quit (Remote host closed the connection)
00:33:29*JustASlacker quit (Ping timeout: 258 seconds)
00:33:52*xet7 joined #nim
00:37:37*couven92 quit (Quit: Disconnecting)
00:38:39*matlock joined #nim
00:40:32matlockI just wanted to mention that I maintain the snaps for Nim and I could always use some extra testing. I maintain snaps for nim stable, nightly, and 1.x LTS. https://github.com/sirredbeard/nim_lang_snap
00:41:54matlockIf you install nim nightly via snap you will always get the latest nim nightly automatically, around 7pm EST.
00:55:23shashlickYou use the nightlies releases?
00:59:21matlockNot usually. I have them installed alongside the others. I am still learning nim and using stable for now.
01:04:08shashlickno i mean for the packaging
01:06:05shashlickdisruptek: Nim's output includes all stdlib stuff too
01:06:43shashlick3 line file resulted in 16k lines from Nim
01:06:54shashlickheh nimterop is only 4.2k
01:08:54matlockThe nightly is built directly from the GitHub master branch https://github.com/sirredbeard/nim_lang_snap/blob/master/nightly/snap/snapcraft.yaml#L36
01:13:23*nsf quit (Quit: WeeChat 2.6)
01:14:42shashlickmatlock: so you are building your own nightly
01:15:02shashlickyou might be better served to leverage the official nightlies - https://github.com/nim-lang/nightlies/releases
01:15:12shashlickthey are tested releases
01:16:13shashlickif you don't prefer the binaries then you can still leverage the source since it has the benefit of test again
01:20:42matlockI was not aware of the nightly releases. I will look at switching to those. The would also fix the arm64 gap.
01:23:12shashlickthanks for maintaining these 🙂
01:26:39matlockTo build or repackage the nightlies I would have to poll and parse the GitHub API to get the release data. It is made easy by a consistent naming scheme on the LTS (https://github.com/sirredbeard/nim_lang_snap/blob/master/.github/workflows/lts-1.yml#L19). I may be a bit more complicated for the official nightly releases, they have a lot more going on, but I will give it a shot.
01:30:01shashlicklet me know if you need any help from the nim nightlies side
01:31:32matlockNo problem. I really like Nim, still learning. I thought Nim would be useful for IoT stuff on Ubuntu Core but needed to snap it to get it on there for testing. I used it as an opportunity to figure out building snaps on GitHub Actions. Thank you, I will let you know.
01:32:13shashlickcool
01:40:08*oculux quit (Ping timeout: 265 seconds)
01:44:49*ng0 quit (Quit: leaving)
01:45:58FromDiscord<Clyybber> Araq: I'll work on init elision and on putting the destroy out of sink and asgn tomorrow
02:12:01*NimBot joined #nim
02:30:33*endragor joined #nim
02:46:22*Hideki_ quit (Remote host closed the connection)
02:47:12*Hideki_ joined #nim
02:51:14*Hideki_ quit (Ping timeout: 240 seconds)
02:57:20*Hideki_ joined #nim
02:57:36FromDiscord<Fern & Simula (They/Them)> is there any way to dump an entire nim file after macro expansion? similar to `--expandMacro` but for the entire file
02:58:00*dddddd quit (Ping timeout: 258 seconds)
03:01:09FromDiscord<Fern & Simula (They/Them)> nvm, don't need it anymore
03:07:31*Hideki_ quit (Remote host closed the connection)
03:12:34*dwdv quit (Ping timeout: 258 seconds)
03:13:41*Hideki_ joined #nim
03:18:03*Hideki_ quit (Ping timeout: 260 seconds)
03:19:48*endragor quit (Remote host closed the connection)
03:19:55*endragor joined #nim
03:40:35*rockcavera quit (Remote host closed the connection)
03:41:49sealmoveFern & Simula (They/Them): wrap the contents in a `expandMacros` block?
03:50:32*Hideki_ joined #nim
03:54:37*Hideki_ quit (Remote host closed the connection)
03:54:52*Hideki_ joined #nim
03:58:12leorizesealmove: it's easy to reduce highlighting
03:58:21sealmovehow?
03:59:35leorizesealmove: these are the default "links" I defined for each symbol nimsuggest gave me: https://github.com/alaviss/nim.nvim/blob/5f227e1befbe9795af531ae4517ee88bc393b50f/syntax/nim.vim#L148-L169
04:00:11leorizeto override these, add `highlight link <group name> <other group name or NONE>` to your neovim configuration
04:00:33leorizeyou can even customize these colors if you'd like
04:01:08leorize`:h highlight` for more information
04:02:23*muffindrake quit (Ping timeout: 245 seconds)
04:02:55sealmoveI see
04:03:35sealmovewell honestly I don't like highlighting based on nimsuggest
04:03:46sealmoveotherwise your plugin is badass!
04:04:16sealmovei love the autocompletion part
04:04:36*muffindrake joined #nim
04:05:36sealmovefor example "Keyword" is a single color, while you want to have different colors for different keywords
04:06:13disruptekwut
04:06:25leorizesealmove: wut?
04:07:32sealmoveproc, of, string they all look the same with nimsuggest highlighting
04:07:42leorizeuhmm, no?
04:07:54leorizeyou need a better plugin
04:07:59leorizecolorscheme*
04:08:04leorizegimme an example file
04:08:12leorizeI'll let you see how it looks with my setup
04:10:15sealmovesorry my bad, not all keywords, but for example `proc` looks same as `PNode`
04:11:10sealmovebut you are right, i had a bad colorscheme, overriding vim highlights should do the trick! :) thanks
04:12:37*Hideki_ quit (Remote host closed the connection)
04:12:59leorizesealmove: default setup: https://ibb.co/SX6h4bG
04:15:08sealmoveI like keywords like `proc` to be white bold
04:15:40leorizeyea you need to brew your own colorscheme :P
04:17:29*Hideki_ joined #nim
04:18:07sealmovebut... if I make a colorscheme specifically for combining with your plugin, then the colorscheme will be just vim highlights overrides?
04:18:21disruptekit only hurts for a minute.
04:18:39leorizesealmove: yep :P
04:18:49leorizeusually it's better to use a proper color scheme
04:20:05sealmovehave been avoiding making one, seems too much work
04:20:15sealmovebut no pain no gain
04:21:00leorizehttps://ibb.co/cyL230W
04:21:06leorizemore pictures to convince you
04:21:38sealmoveI am convinced :) using it with challenger_deep now
04:22:28sealmovehttps://ibb.co/x3nLrZ3
04:24:25leorizecheckout `:h group-name`
04:24:59leorizethose are the groups that syntaxhl authors would use
04:25:15leorizeif your colorscheme can't get those right then you'll only see bad colors :P
04:27:39sealmoveok the highlighting is too damn good *_* might not even need ALE with it
04:34:17leorizeglad I helped :)
04:39:42*chemist69_ quit (Ping timeout: 246 seconds)
04:42:00*chemist69 joined #nim
04:46:39sealmovedo you know how to make custom autocompletion for a binary you make, say for fish shell?
04:47:30sealmoveit's a simple one, I want fish to look for files in a specific folder
04:48:16leorizesealmove: https://fishshell.com/docs/current/index.html#completion-own
04:48:17sealmovei run my program like this `myprogram file` where file is transformed to -> somefolder/file.ext
04:48:48leorizeit's always easier to just refer to the shell documentations :P
04:49:17sealmovetrue, silly me :3
05:21:16*Hideki_ quit (Ping timeout: 268 seconds)
05:24:53sealmoveI did it :)
05:49:59*Hideki_ joined #nim
06:00:15*Hideki_ quit (Remote host closed the connection)
06:01:00*Hideki_ joined #nim
06:05:27*Hideki_ quit (Ping timeout: 258 seconds)
06:16:11*marmotini_ joined #nim
06:31:50*narimiran joined #nim
06:35:20*Hideki_ joined #nim
06:46:50*Hideki_ quit (Ping timeout: 240 seconds)
06:59:07*Hideki_ joined #nim
07:00:47*Hideki_ quit (Remote host closed the connection)
07:01:20*Hideki_ joined #nim
07:06:01*Hideki_ quit (Ping timeout: 258 seconds)
07:09:22*sealmove quit (Quit: WeeChat 2.7)
07:12:04*jjido joined #nim
07:26:50*narimiran quit (Ping timeout: 240 seconds)
07:33:01*solitudesf joined #nim
07:55:19*matic joined #nim
07:55:25*endragor quit (Remote host closed the connection)
08:00:00*gmpreussner quit (Quit: kthxbye)
08:02:04*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:05:10*gmpreussner joined #nim
08:07:46*marmotini_ quit (Ping timeout: 265 seconds)
08:12:03*PMunch joined #nim
08:30:19*Vladar joined #nim
08:30:21*endragor joined #nim
08:30:58*jjido joined #nim
08:34:26*endragor quit (Ping timeout: 240 seconds)
08:38:28*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:44:48*marmotini_ joined #nim
08:56:11*JustASlacker joined #nim
09:03:56*tane joined #nim
09:11:18*vqrs_ quit (Ping timeout: 246 seconds)
09:12:13*hp-yc9 joined #nim
09:12:31*hpyc9 quit (Ping timeout: 258 seconds)
09:18:19*vqrs joined #nim
09:48:25*Trustable joined #nim
09:57:12*uu91 joined #nim
10:00:04*nsf joined #nim
10:00:12*marmotini_ quit (Remote host closed the connection)
10:14:59*Vladar quit (Quit: Leaving)
10:40:18*marmotini_ joined #nim
10:54:13*krux02 joined #nim
10:56:55*narimiran joined #nim
10:57:03*prometheus2 joined #nim
10:57:43*marmotini_ quit (Ping timeout: 260 seconds)
10:59:50*prometheus quit (Ping timeout: 265 seconds)
11:04:08FromGitter<alehander92> Praise God, new year
11:04:25FromGitter<alehander92> so many ideas
11:04:36FromGitter<alehander92> for example, about the godbolt thing
11:05:21FromGitter<alehander92> it should be kinda easy to have both a C and an asm mapping (thats what we also try to do in our debugger project for this kind of "view")
11:06:38FromGitter<alehander92> but i am not sure how does the godbolt api works: it should be possible to get info from dwarf somehow i guess, if all those languages have asm support
11:07:21FromGitter<alehander92> https://github.com/mattgodbolt/compiler-explorer/pull/1711/files
11:07:23disbotFix ASM output for the zig compiler
11:13:06*dwdv joined #nim
11:14:46FromGitter<alehander92> http://ix.io/26gU
11:15:05FromGitter<alehander92> this is the very unfinished monaco(monarch?) syntax thing that we're using
11:15:20FromGitter<alehander92> (as we also use monaco)
11:16:06FromGitter<alehander92> i guess it started after the python one , but with nim keywords , this should be PR-ed i guess
11:16:33FromGitter<alehander92> http://ix.io/26gU/js
11:19:01FromGitter<alehander92> ok guys otherwise you need `--debugInfo --lineDir:on`
11:19:30FromGitter<alehander92> and it catches up the colored asm, but it somehow doesnt color the nim program..
11:19:52FromGitter<alehander92> raynman22201 oh i just saw your syntax PR sorry!
11:22:14*endragor joined #nim
11:25:08*couven92 joined #nim
11:27:28*endragor quit (Ping timeout: 260 seconds)
11:39:16FromDiscord<Clyybber> sealmove: Cligen does it automatically for you
11:39:52*ng0 joined #nim
11:41:49*endragor joined #nim
11:53:33FromGitter<alehander92> `--debugInfo --lineDir:on ` flags in godbolt gives me the colors after all mratsim
11:55:25*narimiran quit (Ping timeout: 265 seconds)
11:55:58*hp-yc9 quit (Quit: ZNC 1.7.5 - https://znc.in)
11:56:34*hpyc9 joined #nim
11:58:10*kungtotte quit (Quit: WeeChat 2.7)
11:58:13*nsf quit (Quit: WeeChat 2.7)
12:01:04*lritter joined #nim
12:07:02*kungtotte joined #nim
12:13:59*mbomba joined #nim
12:17:55*mbomba quit (Quit: WeeChat 2.7)
12:19:02*rockcavera joined #nim
12:23:09FromDiscord<Clyybber> Araq: I'm working on implementing isFirstWrite with the dfa
12:23:29FromDiscord<Clyybber> Its kinda tricky though, since we have to walk up the dfa
12:23:40FromDiscord<Clyybber> Tricky wrt fork and goto
12:27:32FromDiscord<Clyybber> Hmm, I could also start at 0 and walk up to pc..
12:42:35*sagax quit (Write error: Connection reset by peer)
12:46:03*ng0 quit (Quit: leaving)
12:51:18*ng0 joined #nim
12:51:18*ng0 quit (Changing host)
12:51:18*ng0 joined #nim
12:55:31*hohlerde joined #nim
12:59:03AraqClyybber: it's also the "first" write if there is no other
12:59:17Araqwhich is easier to compute and might be good enough
13:02:13Araqer, yeah
13:02:28Araqas you said, start at position 0 and see if it's the first write
13:04:34FromDiscord<Clyybber> Yeah, I'm doing that now, now comes the moment of truth..
13:05:44Araqyou need to watch out for:
13:05:49Araq if cond:
13:05:55Araq x = val
13:06:04Araq x = valB # not the first write!
13:06:51Araqthat means on a fork you need to split your state
13:07:00Araqand on a join you can join your states
13:07:14Araqwhich is kinda the point of the DFA, to make this really simple
13:07:29FromDiscord<Clyybber> Yep
13:08:04FromDiscord<Clyybber> I also have to account for the splits destination offsets. So in a split I go from pc until instr + dest
13:08:17*marmotini_ joined #nim
13:11:53FromDiscord<Clyybber> Tests pass, except for the one that should, heh. Guess my analysis is overly pessimistic or just plain wrong
13:13:54Araqalso cooldome's solution might already be the 80-90% solution
13:14:10Araqand maybe your time is better spent on removing wasMoved+destroy pairs
13:14:22FromDiscord<Clyybber> Thats what I'm doing along the way
13:14:43FromDiscord<Clyybber> Ah,
13:14:50Araqnice, I'm fixing C backend bugs
13:15:00FromDiscord<Clyybber> Nice
13:15:21Araqwe need to fix C++ exception handling for good
13:15:34Araqkinda embarrassing how bad it is
13:16:35FromDiscord<Clyybber> if you get around to it, can you try https://github.com/nim-lang/Nim/issues/12282 ? SInce you marked it as easy. Its also the source of some other bugs
13:16:36disbotvar param with type conversion doesn't work in VM ; snippet at 12https://play.nim-lang.org/#ix=22XY
13:16:41AraqI've been thinkning about the "raise inside finally/destructor" problem
13:16:47FromDiscord<Clyybber> And?
13:17:07Araqso far the best solution I've come up with is this:
13:17:44Araq"raise e inside a raise handling" causes currentExceptionB = e
13:17:51Araqand then we continue
13:18:04FromDiscord<Clyybber> makes sense to me
13:18:07Araqlike we do for the "quirky exceptions"
13:18:19Araqbut only if currentExceptionB == nil
13:18:42Araqso we remember the first error and ignore the others
13:18:43FromDiscord<Clyybber> Hmm
13:26:01Araqthe most common problem seems to be finally: destroy(a); destroy(b)
13:26:25Araqand if 'destroy(a)' raises it's better to destroy(b) than not to destroy it
13:28:54*Vladar joined #nim
13:28:59*marmotini_ quit (Remote host closed the connection)
13:29:33*marmotini_ joined #nim
13:33:15*marmotini_ quit (Read error: Connection reset by peer)
13:33:28*marmotini_ joined #nim
13:36:33FromDiscord<Clyybber> and if destroy(b) depends on destroy(a) succeeding?
13:36:38FromDiscord<Clyybber> And then will raise too
13:37:54Araqmore likely: destroy(b) is independent
13:38:00Araqand can complete
13:38:24Araqmost destructors are about memory, dealloc(mem) hardly can fail
13:38:47Araqso the chances are high we have destruction independence
13:39:03FromDiscord<Clyybber> Sure, I just wonder what happens in the above case
13:40:50*oculux joined #nim
13:42:30*marmotini_ quit (Remote host closed the connection)
13:47:53Araqbtw here is a nice problem:
13:48:19Araq x.add x # sets x to nil because it's the last read
13:48:25Araqcausing the 'add' to fail
13:49:00FromGitter<alehander92> huhmm
13:49:01AraqI'm not sure what it implies. that we must traverse nkCall backwards and forwards to determine 'lastReadOf'?
13:54:05FromDiscord<Clyybber> I think so
13:54:22FromDiscord<Clyybber> In general our lastReadOf analysis for nkCall needs to be very smart
13:59:12*marmotini_ joined #nim
13:59:38*Kaivo joined #nim
14:00:20*dddddd joined #nim
14:00:51FromDiscord<Fern & Simula (They/Them)> is there a compiletime version of `os.createDir()`?
14:02:12Araqwhy is everything done at CT these days?
14:02:34Araqare you all so happy with binaries that run nowhere else and encode /home/yournameHere
14:03:25FromDiscord<Fern & Simula (They/Them)> i'm a masochist
14:03:31FromDiscord<Fern & Simula (They/Them)> you gave us this power. you created monsters
14:03:52FromDiscord<Fern & Simula (They/Them)> also the code does literally everything at compiletime lmao
14:08:36Araqlol
14:11:51FromDiscord<Fern & Simula (They/Them)> it produces a binary that just exits :^)
14:14:18PMunchHaha, why?
14:14:35FromDiscord<mratsim> fun is a powerful driver :p
14:16:25couven92Araq, compileTime is runtime complexity amortization. Since you don't count compileTime in runtime complexity you can technically write O(0) software that takes until the heat death of the universe to compile. That's fun! :D
14:17:17*sagax joined #nim
14:19:34FromDiscord<Rika> Programs that run by compiling
14:19:39FromDiscord<Rika> God, sounds terrible
14:19:59FromDiscord<Fern & Simula (They/Them)> it is
14:20:18couven92@Rika no no! Running is only printing the answer! Compilation involves creating the answer! :P
14:20:30FromDiscord<Fern & Simula (They/Them)> i just compiled nim with nimHasLibFFI and it worked! except now i can't evaluate errno at compiletime :^)
14:20:35FromDiscord<Rika> I mean, you can print on compile though
14:20:54FromDiscord<Fern & Simula (They/Them)> printing is IO and thats side effects
14:21:03couven92Right.... return STATUS_SUCCESS!
14:21:06FromDiscord<Fern & Simula (They/Them)> ~~ignore that im literally creating directories at compiletime with staticExec~~
14:22:44couven92"I like writing macros" basically means that you like writing code that produces more code... Hmmm....
14:23:24FromDiscord<Rika> Make a program that writes nim code onto a file and then runs the nim compiler on that file
14:23:27FromDiscord<Fern & Simula (They/Them)> using macros and slurp to produce a quine
14:23:33FromDiscord<Rika> "runtime macros"
14:23:38FromDiscord<Fern & Simula (They/Them)> i've considered it tbh
14:25:15*nsf joined #nim
14:28:57FromDiscord<mratsim> Nim needs an official Xzhibit meme for compile-time/macros
14:29:25*prometheus2 quit (Quit: Leaving)
14:30:30FromDiscord<mratsim> in that vein https://pics.me.me/metadog-i-heard-you-like-c-metaprogramming-so-i-put-52315785.png / https://www.yesodweb.com/blog/2010/09/yo-dawg-template-haskell
14:34:00Araqbug https://github.com/nim-lang/Nim/issues/12964 looks like a pita
14:34:02disbotARC/newruntime: Adding inherited var ref object to seq with base type causes segfault ; snippet at 12https://play.nim-lang.org/#ix=26hC
14:35:16FromDiscord<mratsim> I think you can deprecate inheritance and ask people to just do everythin at compile-time nowadays
14:36:38lqdev[m]don't
14:36:44FromDiscord<Fern & Simula (They/Them)> plz do not
14:40:31FromDiscord<Clyybber> Araq: How are loops encoded in the dfa?
14:44:35*PMunch quit (Quit: Leaving)
14:54:38AraqClyybber: by Sutter's transformation
14:54:52Araqevery loop is unrolled 3 times
14:55:16Araqsome day we need to prove it's correct for our purposes but I'm quite sure
15:00:31FromDiscord<Clyybber> ah
15:00:37FromDiscord<Clyybber> that explains the bugs I was seeing
15:01:01FromDiscord<Clyybber> *am
15:01:48*abm joined #nim
15:02:57Araqhey, does that mean I'm wrong? :P
15:03:32FromDiscord<Clyybber> I don't think so, but it is tricky.
15:03:33FromDiscord<Clyybber> for i in 0..10:
15:03:43FromDiscord<Clyybber> var a = B()
15:03:59FromDiscord<Clyybber> I do have to generate sink here
15:04:03FromDiscord<Clyybber> or rather, destroy a
15:04:09FromDiscord<Clyybber> if its not zeroed out
15:05:41FromDiscord<Clyybber> Araq: With the loop unrolling var a = B() will occur 3 times right?
15:06:01FromDiscord<Clyybber> Or is the var a = B() extracted out of the loop?
15:06:44Araqit isn't
15:06:58Araqthat it done later in injectdestructors.nim
15:07:15Araqhowever, there is a c.inLoop flag
15:07:26FromDiscord<Clyybber> Yeah, thats what cooldome was using
15:07:27Araqbut you're right, it seems tricky
15:08:02FromDiscord<Clyybber> Araq: I know how it can be solved: Since we look to prove its a firstWrite or def, we gotta search from the end to top
15:08:03*abm quit (Quit: Leaving)
15:08:24FromDiscord<Clyybber> search for `var a = B()` that is
15:08:26*abm joined #nim
15:09:16*ng0_ joined #nim
15:09:16*ng0_ quit (Changing host)
15:09:16*ng0_ joined #nim
15:10:09Araqok if you say so
15:10:35Araqall I know that reasoning from backwards is a mindfuck
15:10:55FromDiscord<Clyybber> heh
15:11:11FromDiscord<Clyybber> it works \o/
15:12:02*ng0 quit (Ping timeout: 240 seconds)
15:12:17FromGitter<alehander92> Araq
15:12:53FromGitter<alehander92> i think jsffi should provide a `var` [] overload for JsAssoc similar to the table one in tables
15:12:57FromGitter<alehander92> should I PR eventually
15:17:27FromDiscord<Clyybber> Araq: Hey, the sink_counter in tmisc_destructor is now at zero
15:18:52FromDiscord<mratsim> reasoning from backward: foo(bar(baz(x))) instead of x.baz().bar().foo()
15:20:50*JustASlacker quit (Remote host closed the connection)
15:23:09AraqClyybber: fine with me
15:23:15Araqalehander92: fine with me
15:29:27AraqI hope you know about
15:29:29Araqkoch temp -d:toDebug=bug c --gc:arc -r temp
15:30:11FromDiscord<mratsim> what is this toDebug flag?
15:33:22Araqit outputs the DFA and AST after the injectdestructor pass for the proc named 'bug'
15:35:03FromDiscord<Clyybber> oooh, I always just manually changed toDebug in in injectdesctructor
15:36:55FromDiscord<mratsim> you should put a small compiler dev flags, I remember that there is a flag to output the semantic checking pass in YAML/tree format as well
15:37:11FromDiscord<mratsim> small README for compiler dev flags
15:37:41FromDiscord<Clyybber> grep strdefine
15:39:08FromDiscord<mratsim> there are booldefine as well
15:39:11FromDiscord<mratsim> and intdefine
15:39:21FromDiscord<Clyybber> hmm
15:39:23FromDiscord<Clyybber> right
15:39:28FromDiscord<mratsim> and some may not be aware of those
15:39:42FromDiscord<mratsim> knowledge on IRC is a bit tricky
15:40:18FromDiscord<Clyybber> declare the irc logs the official wiki
15:40:18FromDiscord<Clyybber> lol
15:41:10*ng0_ is now known as ng0
15:42:30Araqbug #12964 is yours I think
15:42:31disbothttps://github.com/nim-lang/Nim/issues/12964 -- 3ARC/newruntime: Adding inherited var ref object to seq with base type causes segfault ; snippet at 12https://play.nim-lang.org/#ix=26hC
15:42:49Araqit doesn't 'wasMoved(token)' because of the subtype relation
15:43:02Araqcausing a double free
15:44:32Araqso ... now after these months I can definitely say that destructors are so much easier to debug than GC bugs that it's not even funny and I'll never write a GC in my life ever again :P
15:46:36FromDiscord<Clyybber> Araq: Where does subtype relation influence wasMoved generation??
15:47:13*nsf quit (Quit: WeeChat 2.7)
15:48:17*leorize quit (Quit: WeeChat 2.6)
15:53:22stefantalpalaruWhat about performance? Very fine-grained garbage collection, like reference counting, usually has a higher overhead that state-of-the-art tracing strategies.
15:53:34stefantalpalaru*than
15:55:39*Vladar quit (Quit: Leaving)
15:57:00FromDiscord<mratsim> Better throughput than Boehm
15:57:12stefantalpalaruAlso, isn't ARC the main cause of Swift's terrible performance?
15:57:13FromDiscord<mratsim> not sure where the benchmarks aare to reproduce though
15:57:22FromDiscord<mratsim> yes
15:57:37FromDiscord<mratsim> but implementation "details" matter 😉
15:58:01stefantalpalaruThis is what the JVM people were doing in 2004: https://www.infoq.com/articles/G1-One-Garbage-Collector-To-Rule-Them-All/
15:58:20stefantalpalaruHow far behind are we?
15:58:45FromGitter<deech> How do you call a function using UFCS when it's in another module? eg. I want to call `f` in module `m` with `a` and I can't do `a.m.f`, I also tried `a.`m.f``
15:59:14YardanicoI think you can't
15:59:28Yardanicohm
16:01:52stefantalpalaru"Reference counting is simple, lends itself well to incremental collection, and the collection process tends to have good locality of reference, but it is rarely used in production garbage collectors for a number of reasons, such as its inability to reclaim unreachable cyclic structures (objects that reference each other directly or indirectly, like a circularly linked list or a tree that contains back-pointers to the parent node)."
16:01:52stefantalpalaru- https://www.ibm.com/developerworks/library/j-jtp10283/index.html
16:02:10stefantalpalaru"None of the standard garbage collectors in the JDK uses reference counting; instead, they all use some form of tracing collector."
16:02:22Yardanicowell, there's a cycle collector in development for ARC afaik
16:02:26Yardanicoin nim
16:02:43stefantalpalaruIt's mandatory, since ARC in itself is not enough.
16:05:10stefantalpalaruReference counting was introduced by a 1960 paper (section 2): https://www.seas.harvard.edu/courses/cs252/2016fa/16.pdf
16:05:30stefantalpalaru"McCarthy’s LISP does not originally allow cyclic data structures"
16:05:53FromDiscord<Clyybber> its not that hard to help destroy the cycle
16:06:19FromDiscord<Clyybber> and then you don't need a cycle collector
16:08:32stefantalpalaruSo we're about 60 years behind CS research ;-)
16:10:43Araqthank you for lecturing me on thing I already know
16:12:08*marmotini_ quit (Ping timeout: 260 seconds)
16:15:07FromDiscord<Clyybber> stefantalpalaru: Nim provides you with `=` `=sink` and `=destroy` hooks so you can implement newer more specialized techniques yourself
16:15:35AraqI also studied every GC algorithm under the sun, they all trade memory for speed and assume a closed world where you know the roots. I dunno about you but in my world this GC_ref/unref business was rather unpleasant
16:15:40FromDiscord<Clyybber> And IMO its a good thing that the foundations we build upon are simple and deterministic
16:18:42stefantalpalaruExperiment with any GC algorithm you want, Araq, but don't make the mistake to consider your latest revelation a replacement for all the others. Keep the infrastructure for implementing and using various GCs well maintained, because you'll need it too, when you'll chase the next fad.
16:22:03FromDiscord<mratsim> it won't be replaced
16:22:29FromDiscord<mratsim> now, if you have a benchmark repo to share, it would be nice 🙂
16:23:11Araqfor me 'nim c -d:release --gc:arc tests/gc/gcbench' wins over Boehm, refc and mark&sweep
16:23:37Araqand the "GC latency" test has so low numbers that comparisons are ridiculous
16:24:10FromDiscord<Rika> how do i get a c-style switch statement (those with no breaks in them) in nim?
16:24:28AraqRika: via a list of 'if' statements
16:24:41FromDiscord<Rika> ***aaaaaa***
16:24:50FromDiscord<Rika> life is pain
16:24:53FromDiscord<Rika> okay thanks
16:25:46stefantalpalaruGC_ref/unref is a half-arsed public API that's only supported by less than half of Nim's GCs, without a generic fallback. I've seen it used in Nimbus-related projects, which means I can't test BoehmGC with it.
16:26:12Araqmake it a nop for BoehmGC
16:26:23stefantalpalaruIt already is and that's a problem.
16:27:07Araqwell good to know, but my point about GC_ref was about the closed world assumption, C# has "object pinning" instead
16:27:17stefantalpalaruBecause people use GC_ref() in the wild to make sure that a memory location won't be freed when doing fancy stuff with it, like passing it through the FFI.
16:27:21Araqwhich is not "half-arsed" but shows the very same problem
16:27:46stefantalpalaruSo if GC_ref() is a no-op, it sabotages that assumption.
16:27:52*narimiran joined #nim
16:28:52stefantalpalaruI remember Zahary proposing a global array/seq that's a GC root where a generic GC_ref() could add these pointers that need protection.
16:29:20stefantalpalaruWould be the lesser evil, now that Nim users assume that all GCs support references.
16:29:54FromDiscord<Clyybber> hmm, thats an interesting idea actually
16:30:46FromDiscord<Fern & Simula (They/Them)> @Rika could always write a macro :P
16:31:39FromDiscord<Clyybber> if vs of, both have two characters
16:31:42FromDiscord<Clyybber> not that bad, is it?
16:32:56Araqyou mean like https://github.com/nim-lang/Nim/blob/devel/lib/system/gc_ms.nim#L172 ?
16:33:05Araqhow do you think GC_ref works?
16:33:36stefantalpalaruI want something generic that works for all GCs. What you linked only works in one.
16:33:45stefantalpalaruBut yes, same mechanism.
16:35:46FromDiscord<mratsim> I sense @Rika is trying to implement Duff's Device
16:36:14FromDiscord<Clyybber> @StefanSalewski Why are you closing your issues?
16:36:30FromDiscord<Clyybber> Are they fixed?
16:37:41Araqit's likely a duplicate of the bug that I fixed
16:38:13Araqstefantalpalaru, I dunno why we need a generic mechanism when all we need is a patch for Boehm
16:38:27FromDiscord<Rika> i dont even know what duff's device is XD
16:40:17stefantalpalaruIt's not just BoehmGC that doesn't support it.
16:43:00stefantalpalaru"--gc:refc|markAndSweep|boehm|go|none|regions" - out of these, I think only the first two (and gc2, was it renamed?) implement GC_ref().
16:44:25FromDiscord<Fern & Simula (They/Them)> @Rika duff's device is an atrocity and i love it: https://en.wikipedia.org/wiki/Duff%27s_device
16:44:41FromDiscord<Fern & Simula (They/Them)> nowadays, you almost *never* need it because compilers optimize things
16:45:14FromDiscord<Rika> i just searched it
16:45:25FromDiscord<Rika> and "ok wtf" is my reaction
16:46:08FromDiscord<Fern & Simula (They/Them)> as it should be
16:49:08disruptekhearts and minds, people; hearts and minds!
16:51:39FromDiscord<Rika> im pretty confused, is that like an automessage or something disruptek
16:53:56Yardanicothat's "something disruptek"
16:54:30FromDiscord<Rika> i mean "...something? disruptek" to ping him
16:54:42FromDiscord<Rika> or maybe "...something, disruptek?"
16:54:52Yardanicosomething? disruptek!
16:55:31FromDiscord<mratsim> You can use Duff's device to build coroutines by the way. https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html it might be even faster than greenlet (cc @treeform)
16:55:41FromDiscord<mratsim> it's very hacky
16:56:12*WilhelmV2nWeiner joined #nim
16:56:13disruptektrust your compiler.
16:56:28*WilhelmV2nWeiner quit (Remote host closed the connection)
16:56:43disruptekotherwise you're just raising a middle finger at everyone that comes after you.
16:56:51FromDiscord<Clyybber> @mratsim Is it used in libmill? For some reason I had that link open already
16:57:11FromGitter<alehander92> Araq we realized we need `[]: var V` only for reference js types in jsffi, i'll keep an eye on it
16:57:16disruptek!issue author:disruptek exception
16:57:17disbothttps://github.com/nim-lang/Nim/issues/11081 -- 3DateTime field on Exception produces inconsistent C/++ handling 7& 2 more...
16:57:18FromGitter<alehander92> we can have*
16:57:28disruptekyou can test that on --exceptions:goto
16:57:29FromDiscord<mratsim> not sure, I didn't check mill besides beside looking how many ASM file they required to support multiple platforms
16:58:03FromDiscord<Clyybber> hmm, I guess thats the "convinience" of having 400 tabs open
16:58:13*couven92 quit (Ping timeout: 260 seconds)
16:59:53*matic quit (Quit: Leaving)
17:04:34stefantalpalaruYou need to get down to ASM to implement platform-specific efficient register saving on greenlet switch.
17:06:06FromDiscord<treeform> @mratsim yeah that's how many tutorials for build-a-scheme compilers do for call/cc.
17:07:41FromDiscord<treeform> @mratsim what drew me to cgreenlet is that stack trace remains "sane" and you can follow execution of the greenlet better. Should also work with c code that has no notion of stack switching it just gets plain boring stack... c code does not know it can be switched.
17:08:04*marmotini_ joined #nim
17:09:09*solitudesf quit (Quit: Leaving)
17:09:32*solitudesf joined #nim
17:11:05FromDiscord<mratsim> @araq is that normal that the gcbench takes only 27ms? that seems very prone to OS/background application noise
17:11:30disruptekcoz
17:16:59FromDiscord<Clyybber> Araq: Tests are passing \o/: https://github.com/nim-lang/Nim/pull/13021
17:17:00disbotContinue #13002
17:17:08*nsf joined #nim
17:23:10disruptek11081 currently produces a c++ error in `cpp --gc:arc`.
17:25:20disruptekstefantalpalaru: how about a tag for unittest2?
17:26:19stefantalpalaruSure, disruptek. Hang on.
17:26:29disruptekwhenever. and thanks. 😉
17:26:39disruptekarnetheduck: how about a tag for result?
17:27:12FromGitter<alehander92> %search works clyybber
17:27:13FromGitter<alehander92> for firefox
17:27:22FromGitter<alehander92> search for shortcuts there they have many
17:31:18stefantalpalarudisruptek: unittest2-0.0.1 tagged.
17:31:27disruptek🎉
17:32:02FromDiscord<Clyybber> alehander92: I discovered that but typing coroutine into the search bar
17:32:08FromDiscord<Clyybber> the open tab that is
17:36:21disruptekstefantalpalaru: wow, is that a signed tag or what?
17:36:51Araqmratsim: it takes 0.3s on my machine
17:37:25Araqwe should probably increase some numbers in there though :-)
17:38:29stefantalpalaruYeah, disruptek, it's signed.
17:38:43disruptekawesome, you revealed a nimph bug.
17:39:11disruptekjust output, but still. i don't have enough bugs.
17:39:21stefantalpalaruCreated with `git tag -s -m "release 0.0.1" v0.0.1`.
17:39:45disrupteki'm about to impl signing because it's the only way to create tags with a given timestamp.
17:40:09disruptek(i want to be able to retroactively tag projects with correct timestamps.)
17:42:31FromDiscord<mratsim> I yes it's O.27 not 0.027
17:44:19Araqit's reproducible for me though all the time and on two different machines
17:45:06Araqgood enough for me to base Nim's future on it given that I spent about 5 years on this and always lost against Boehm :P
17:45:22*salewski joined #nim
17:46:01salewski16:36:14 FromDiscord <Clyybber> @StefanSalewski Why are you closing your issues?
17:46:03*Kaivo quit (Quit: WeeChat 2.7)
17:46:22*Kaivo joined #nim
17:46:26Araqwith 'nim cpp --cc=vcc' I got even better results
17:46:39salewskiWell there are more important issues, rtree is really hard, and I have no idea what exactly is the problem...
17:47:54salewskiAnd I was not able to reduce it to minimal examples. So I will wait a few weeks and try again then...
17:48:34FromDiscord<Clyybber> Ah ok
17:48:49Araqwe have the test in our test suite already anyway
17:49:16salewskiMaybe will try cdt again, araq has fixed one issue, so it may work. But I have to learn about cursor.
17:49:21FromDiscord<Clyybber> Araq: Can we merge this: https://github.com/nim-lang/Nim/pull/13021
17:49:22disbotContinue #13002
17:49:24FromDiscord<Clyybber> ?
17:49:56Araqdo you really think our tests are good enough for this stunt?
17:50:07FromDiscord<Clyybber> Yeah, I think so 😄
17:50:17Araqit's impressive they are green but you didn't add a carefully crafted one trying to break it
17:50:22salewskiAraq, do you have latest version of rtree with bulkloading in test suite?
17:50:45Araqunlikely but I know you'll remember me
17:50:48salewskiI think the bulkloading is the hard part for gc.
17:51:00FromDiscord<Clyybber> Araq: It breaks pretty easily when you change a thing, like replacing `<` in the while loop with `<=,
17:51:00salewskiBye.
17:51:07FromDiscord<Clyybber> salewski: Bye
17:51:10Araqbye
17:51:15*salewski quit (Quit: WeeChat 2.6)
17:51:27FromDiscord<Clyybber> Araq: But I'm pretty sure its correct now 😄
17:51:35FromDiscord<Clyybber> At least I think its more solid that what we had before
17:51:51Araqhow can init+=sink not be really solid?
17:52:35disrupteki think he means he understands it better. 😀
17:52:49FromDiscord<mratsim> Somehow Weave on windows is really slow, and it's not just the tlsEmulation
17:52:49Yardanicolol
17:53:04FromDiscord<mratsim> I think Windows memory management needs different assumptions
17:53:20disruptekwell, you can start by assuming it will be slow.
17:53:42FromGitter<deech> Which Windows compiler?
17:53:43FromDiscord<mratsim> even the mimalloc paper had some paragraph about how different windows reserve memory
17:53:49FromDiscord<mratsim> all
17:53:54*marmotini_ quit (Remote host closed the connection)
17:54:04FromDiscord<Clyybber> Araq: Solid is the wrong word I guess. But I'd rather use the dfa for this kind of stuff
17:54:27*marmotini_ joined #nim
17:56:59*marmotini_ quit (Remote host closed the connection)
17:57:15*marmotini_ joined #nim
17:58:06Araqclyybber: any chance we can mark the PNodes in a single pass?
17:58:29Araqinstead of quering the DFA for every single variable?
18:02:32FromDiscord<Clyybber> Hmm, maybe, but we call it from the p()/moveOrCopy() procs so I think it will be a bit complicated.
18:02:32*couven92 joined #nim
18:04:43FromDiscord<Clyybber> Definitely a thing we should keep in mind, if the compile times are bad. But I don't think its worth it rn.
18:05:09FromDiscord<Clyybber> Definitely a thing we should keep in mind, if the compile times get worse. But I don't think its worth it rn.
18:05:31FromDiscord<Clyybber> ah, sorry for the edit, discord understands s/../.. apparently
18:08:40Araquse IntSets and compute it once for all variables/instructions in one pass
18:09:01Araqanyhow, I'll let you sleep over it and merge it tomorrow
18:09:10FromDiscord<Clyybber> cool, thanks
18:09:53FromDiscord<Clyybber> Araq: Hmm, so I recurse twice?
18:10:22FromDiscord<Clyybber> First with pCollectVars and then with p?
18:11:22*JustASlacker joined #nim
18:12:02Araqno you move from N-1 to 0 over the DFA marking the first writes in a HashSet[(PSym, PNode)]
18:12:21FromDiscord<Clyybber> Aah, I see.
18:12:33FromDiscord<Clyybber> Yeah, we could do the same for last read right?
18:12:39Araqyep
18:12:47FromDiscord<Clyybber> Ok, I'll try it
18:12:57*Vladar joined #nim
18:12:58Araqthough last read is easier as the forward pass that we currently do
18:22:42*oculux quit (K-Lined)
18:24:31FromDiscord<Clyybber> Araq: What to do about otherRead though..
18:25:39FromDiscord<Clyybber> Hmm, I could always point to the true last read then
18:25:46FromDiscord<Clyybber> The error message that is
18:28:14Araqah bummer
18:28:15FromDiscord<Clyybber> I think I will need a ordered set, since there could be multiple lastReads of a variable and then you would want the error message in a case where `=`{.error.} to point to the right one..
18:28:25Araqbah
18:28:30Araqwell
18:28:42Araqfor the error message we can always run the DFA once again
18:28:59FromDiscord<Clyybber> Hmm, right
18:29:01Araqit doesn't matter how slow it is since afterwards we're done with the compilation anyway
18:29:06FromDiscord<Clyybber> Yeah
18:30:39*nsf quit (Quit: WeeChat 2.7)
18:36:14*marmotini_ quit (Remote host closed the connection)
18:36:47*marmotini_ joined #nim
18:37:18FromDiscord<Clyybber> Araq: Since there can be multiple reads it might make more sense to have a set which contains PNodes indexed by PSyms
18:38:00FromDiscord<Clyybber> *multiple last reads
18:38:01FromDiscord<mratsim> (when an official compiletime Hash for NimNode)
18:38:57FromDiscord<Clyybber> Not a set, sorry, more like a sparse array indexed by PSyms
18:39:05Araqmratsim: equality on NimNodes is tricky and the hash function must always reflect the equality
18:39:37FromDiscord<Clyybber> Araq: What I want is store a seq of PNodes for a given PSym
18:39:56FromDiscord<Clyybber> Hmmm
18:39:58FromDiscord<mratsim> for me they are ref objects so you can just use their address
18:40:13FromDiscord<Clyybber> Yeah, but I'm not sure its safe to rely on that
18:40:24FromDiscord<Clyybber> Their adresses being the same that is
18:40:50*marmotini_ quit (Ping timeout: 240 seconds)
18:40:54Araqmratsim: if there is one thing in the Nim compiler I long to change it's this.
18:41:05Araq'refs' everywhere
18:41:25FromDiscord<mratsim> apparently that worked for java :p
18:41:28Araqcauses aliasing problems and GC pressure
18:42:41FromDiscord<mratsim> anyway, compile-time hashtable and sets are quite useful and currently everyone needs to rediscover how to hash the NimNode.
18:42:58disruptekit always feels like an abstraction that exists to get around the fact that you need some way to get around the abstraction.
18:43:05FromDiscord<mratsim> I have my scheme that seems to work, but something in sugar/macro would be useful for others
18:43:25FromDiscord<mratsim> That's called Gang of Four 😉
18:43:34FromDiscord<mratsim> or design patterns
18:45:33*notevil left #nim (#nim)
18:46:52FromDiscord<Clyybber> How does a hashset with seq work? Does it hash the seqs adress or its contents?
18:48:56FromDiscord<Clyybber> Its contents as it seems 😦
18:49:10FromDiscord<Clyybber> Which is how it should work, but not how I need it to work rn 😄
18:54:53FromDiscord<mratsim> wrap in a custom type and pass the seq.addr as a Hash
18:55:37FromDiscord<Clyybber> Yeah, that will work.
18:57:22Araqexcuse me? seqs can be reallocated
18:57:52disruptekrelax, this only needs to work in the tests.
18:57:52Araqseq.addr as the hash is a terrible idea and so is seq[0].addr
18:58:26*JustASlacker quit (Ping timeout: 240 seconds)
18:59:49FromDiscord<Clyybber> Araq: How to store various PNodes for PSyms then? I guess I could do seq[(PSym, seq[PNode])]
19:00:33FromDiscord<Clyybber> And then search for the appropriate PSym everytime
19:00:37FromDiscord<Clyybber> not exactly great either
19:01:12AraqI usually use Table[int, T] and sym.id as the key
19:01:29Araqif that's your question
19:02:12FromDiscord<Clyybber> Ah, yeah, That should work. thanks
19:02:35FromDiscord<Clyybber> forgot about sym.id
19:04:59disruptekatoz works with --gc:arc 👍
19:05:01FromDiscord<Clyybber> What is interesting is that after a lastRead the next write can be considered a firstWrite
19:05:15FromDiscord<Clyybber> At least in theory
19:05:40Araqhmm indeed, good point
19:05:43Araq ... CMake Error at CMakeLists.txt:15 (CMAKE_MINIMUM_REQUIRED):
19:05:43Araq ... CMake 3.5.1 or higher is required. You are running version 3.1.0
19:05:43Araq ... -- Configuring incomplete, errors occurred!
19:05:54Araqdisruptek, :-(
19:05:59Araqcmake requirements?
19:06:09disruptekblame libgit2.
19:07:32disruptekalso, don't use HEAD right now. i'm still porting it to gittyup-2.
19:10:07*laaron quit (K-Lined)
19:12:21*JustASlacker joined #nim
19:19:15Araqwhat to use instead?
19:19:23Araqand does it run on Windows?
19:19:23disruptek0.6.6
19:19:33disruptekCI says it does.
19:19:58*JustASlacker quit (Quit: Leaving)
19:20:49disruptekactually, i don't even know if the tests build nimph. seems like an oversight.
19:20:58AraqSuccess: nimph installed successfully.
19:21:12disrupteki don't believe it. with no symlinks?
19:21:31FromDiscord<mratsim> is `=destroy` respected when we don't pass any specific flags on devel?
19:22:01FromDiscord<mratsim> ah yes it is, I remember the =sink bug
19:22:07Araqmratsim: yes, however
19:22:15Araqthe old seqs do not respect it
19:22:30*Jjp137 quit (Ping timeout: 265 seconds)
19:25:29*couven92 quit (Ping timeout: 268 seconds)
19:27:17*chemist69 quit (Ping timeout: 260 seconds)
19:28:17*chemist69 joined #nim
19:30:57*endragor quit (Remote host closed the connection)
19:33:36*laaron joined #nim
19:44:40disruptekopenapi works under arc, no changes.
19:45:37FromDiscord<Clyybber> nice
19:45:43Araqgreat :-)
19:46:20AraqClyybber: I have a node of kind nkObjDownConv but injectdestructors.nim doesn't touch it, any idea?
19:46:34Araqand by that i mean the explicit cases dealing with nkObjDownConv are not triggered
19:50:44FromDiscord<Clyybber> Araq: Hmm, not sure, does it not even touch its childs?
19:52:10FromGitter<Albus70007> how do you convert an string to int16?
19:52:12FromDiscord<Clyybber> Argh, the loop unrolling makes this really tricky
19:52:26FromDiscord<Clyybber> Albus70007: Do you mean parsing the content?
19:52:36FromDiscord<Clyybber> Or literally converting a two byte string to an int16?
19:52:49Araqfeel free to change the loop unrolling and add an loop opcode
19:53:04AraqopcForkLoop or something like that
19:53:22FromDiscord<Clyybber> Hmm, maybe c.inLoop will be good enough
19:53:32FromDiscord<Clyybber> ah nope.
19:53:39FromGitter<Albus70007> clybber, could you show me both ways just in case?
19:55:11FromDiscord<Clyybber> Albus70007: Sure, for parsing: `someInt = parseInt(someString).int16` and for converting `someInt = cast[int16](someString[0])`
19:55:33FromDiscord<Clyybber> Not sure if that last one really works, with alignment and stuff
19:56:02FromGitter<Albus70007> ok, ill tell you if it works
19:58:37FromDiscord<Clyybber> Araq: Do you have a link to herb sutters claim?
19:58:51FromDiscord<Clyybber> Maybe that will enlighten me
19:59:22FromDiscord<mratsim> by the way, the fact that `=` is applied for the init/newFoo proc is a bit annoying
20:00:12FromDiscord<Clyybber> special casing it would be even more annoying I think
20:00:27FromDiscord<mratsim> constructors would not have this issue 😉
20:00:42FromDiscord<mratsim> not sure of the baggage they bring though
20:02:23Araqmratsim: in devel that's not true anymore
20:02:53Araqwe optimize the =sink to a copyMem
20:02:57FromDiscord<Clyybber> true
20:04:18Araqand it would really be nice if 2020 were the year of fewer snarky, but incorrect remarks
20:07:19*Jesin quit (Quit: Leaving)
20:07:33FromDiscord<Clyybber> Araq: We could also encode a loop as a fork with a negative dest and handling that via comesFrom
20:08:10Araqno matter how you encode it, you need to watch out for not running into endless loops
20:08:29Araqthe unrolling solves that in the most elegant way imaginable
20:09:34FromDiscord<Clyybber> oh
20:09:51FromDiscord<Clyybber> the example I had in my head that I thought wouldn't work with unrolling works
20:09:56FromDiscord<Clyybber> I think
20:10:02FromDiscord<Clyybber> It went something like this:
20:10:13FromDiscord<Clyybber> while true:
20:10:23FromDiscord<Clyybber> var a = ...
20:10:38FromDiscord<Clyybber> sinkingProc(a)
20:11:00FromDiscord<Clyybber> But that shouldn't be a problem now that I think about it
20:11:44Araqit even says
20:11:46Araqstarting point for token() is 3 nkObjDownConv
20:12:00Araqso it does handle nkObjDownConv, somehow
20:12:04FromDiscord<Clyybber> hmmm
20:12:56AraqisAnalysableFieldAccess() also handles it, maybe it's done there
20:14:21FromDiscord<mratsim> Did I miss something obvious? https://play.nim-lang.org/#ix=26jE
20:14:44FromDiscord<Clyybber> Ah, the bad example is ```
20:14:45FromDiscord<Clyybber> while true:
20:14:45FromDiscord<Clyybber> var a = ...
20:14:45FromDiscord<Clyybber> dontSink(a)
20:14:45FromDiscord<Clyybber> ```
20:15:29Araqmratsim: also give it a =sink
20:16:18Araqand the optimization was merged today so dunno if the playground already has it
20:16:44FromDiscord<mratsim> I'll update on my machine, it's showstopper for me :/
20:18:01FromDiscord<Clyybber> @mratsim x is global, thus it is not sinked
20:18:21FromDiscord<mratsim> but why would it loop?
20:18:22FromDiscord<Clyybber> Even if you make initBars argument a sink arg
20:18:33FromDiscord<Clyybber> @mratsim Because you call `=` ?
20:18:42FromDiscord<mratsim> system.`=`
20:19:10FromDiscord<Clyybber> Doesn't matter I think. Its a type bound op
20:19:25FromDiscord<mratsim> in the past you could escape the overloading with system.=
20:19:37FromDiscord<Clyybber> hmm, maybe I'm wrong
20:20:30FromDiscord<Clyybber> @mratsim https://play.nim-lang.org/#ix=26jG
20:20:49Araqmratsim: ouch, that's caused by "fix"
20:21:01Araqeasy to revert though
20:21:29FromDiscord<mratsim> strange, so it's the fact that it's a global
20:21:39FromDiscord<Clyybber> yeah, globals don't get analyzed
20:21:41FromDiscord<mratsim> it happens on the current devel as well
20:22:06FromDiscord<mratsim> I see, it's an issue because it's for a type that users can manipulate.
20:22:22FromDiscord<mratsim> I'll open an issue on the tracker
20:22:36Araqok, thanks
20:25:28FromDiscord<mratsim> and so it seems like with locals initial assignment doesn't trigger the `=` (due to the lack of sink I guess)
20:26:30*nsf joined #nim
20:29:07*Kaivo quit (Quit: WeeChat 2.7)
20:35:54*couven92 joined #nim
20:40:50FromDiscord<Clyybber> Araq: When is `dest == comesFrom` false??
20:41:17*couven92 quit (Ping timeout: 265 seconds)
20:43:33FromDiscord<mratsim> ugh, this is ugly, when using both `=sink` and `=` I have to forward declare one of them otherwise I get: Error: cannot bind another '=' to: ProducersLoopPromises; previous declaration was constructed here implicitly: .../nim-#devel/lib/system.nim(471, 16)
20:45:48FromDiscord<Clyybber> Araq: I don't get how the loop unrolling was even working till now: ```
20:45:48FromDiscord<Clyybber> if cond:
20:45:48FromDiscord<Clyybber> body
20:45:49FromDiscord<Clyybber> if cond:
20:45:49FromDiscord<Clyybber> body
20:45:49FromDiscord<Clyybber> if cond:
20:45:49FromDiscord<Clyybber> body
20:45:49FromDiscord<Clyybber> ```
20:46:05FromDiscord<Clyybber> When body is an assignment the last body would have been sinked no?
20:47:50FromDiscord<mratsim> see: https://github.com/nim-lang/Nim/issues/13025
20:47:52disbotForced to forward declare when overloading `=` and `=sink` ; snippet at 12https://play.nim-lang.org/#ix=26jR
20:54:10*Kaivo joined #nim
20:55:33FromDiscord<mratsim> @Clyybber I think you trick doesn't work across modules or something :/ I still get the infinite recursion here: https://github.com/mratsim/weave/blob/dataflow-graph-parallelism/weave/datatypes/promises.nim#L119
20:57:18FromDiscord<Clyybber> Makes sense, producers can't be sinked as its accessed later on
20:59:05FromDiscord<mratsim> ah no
20:59:17FromDiscord<mratsim> it doesn't work if you add a `=sink`
20:59:31FromDiscord<mratsim> your stuff works across modules but I can't add a sink
21:01:04FromDiscord<mratsim> https://github.com/nim-lang/Nim/issues/13024#issuecomment-570696820
21:01:07disbotAssignment overloading for globals: infinite recursion even with system.`=` ; snippet at 12https://play.nim-lang.org/#ix=26jV
21:03:51*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
21:04:59FromDiscord<mratsim> and I have a third infinite loop because removing the sink is not enough in my codebase
21:08:26*ng0 quit (Remote host closed the connection)
21:09:54*ng0 joined #nim
21:09:54*ng0 quit (Changing host)
21:09:54*ng0 joined #nim
21:17:09Araqthe infinite loop is a new regression caused by cooldome's sempass2 patch
21:17:27Araqit's a one line fix, however
21:18:02Araqplease understand that calling system.`=` inside your own `=` is not in our test suite for a reason
21:18:25Araqyou're supposed to have a 'ptr' inside your object and use fieldwise assignments
21:18:37Araqbecause why else would you ever overload '='?
21:19:23FromDiscord<Clyybber> Araq: Do you know the answer to why the loop unrolling doesn't cause issues with isLastRead?
21:19:39*ehmry joined #nim
21:20:48FromDiscord<Clyybber> Ah, its special cased
21:20:57FromDiscord<Clyybber> Basically, hmmm
21:21:19FromDiscord<Clyybber> Yeah, I think a loop instruction is really the best way to go about this
21:21:42Araqagreed, the factor of 3 for every loop body can't be too wise
21:22:02Araqfor long procs with nested loops
21:22:09Araq:-)
21:22:16*Jjp137 joined #nim
21:24:00FromDiscord<Clyybber> hehe zevv
21:24:21FromDiscord<mratsim> isn't that how I'm supposed to do atomic refcounting? https://github.com/mratsim/weave/blob/dataflow-graph-parallelism/weave/datatypes/promises.nim#L73-L76
21:28:53Araqno, you should do
21:29:03Araqdst.p = src.p
21:29:04Araqinstead
21:29:17*MightyJoe quit (Ping timeout: 258 seconds)
21:30:00Araqand your =sink is also incorrect, you need to destroy dst first before overwriting the pointer
21:31:38Araqand your destructor needs to check for prom.p != nil
21:32:14FromDiscord<Clyybber> Araq: So basically I generate ```
21:32:15FromDiscord<Clyybber> loop:
21:32:15FromDiscord<Clyybber> cond
21:32:15FromDiscord<Clyybber> body
21:32:15FromDiscord<Clyybber> join loop
21:32:15FromDiscord<Clyybber> ...
21:32:16FromDiscord<Clyybber> ```
21:32:31Zevvclybber: zup?
21:32:36FromDiscord<mratsim> if it's nil there is a count of zero
21:32:42ldleworkmratsim, is there anyway to interact or fine-tune gpt2 models with arraymancer
21:32:44FromDiscord<Clyybber> But its a bit wrong, since cond gets in both cases no?
21:32:47FromDiscord<mratsim> it's a bug if there is a refcount of 1
21:33:04Araqplus your refcounting is slow, there is no need to fetchSub the RC for the common case of uniqueness
21:33:06FromDiscord<Clyybber> Zevv: Sup, was just thinking of npeg when araq said long procs with nested loops 😄
21:33:36FromDiscord<mratsim> @Idlework, no, I didn't work on deep-learning related Arraymancer stuff for the past year. Not enough time :/
21:33:39*cyraxjoe joined #nim
21:33:51AraqClyybber: 'join loop'? how about 'goto loop'?
21:34:12FromDiscord<mratsim> My idea was to write a compiler so that I could implement things faster (especially gradient), but then I had trouble with multithreading and it's a rabbit hole
21:34:13FromDiscord<Clyybber> Araq: Oh, but loop is a fork?
21:34:22FromDiscord<Clyybber> What would the difference be?
21:34:44FromDiscord<Clyybber> I don't want to make it recurse infinitely
21:34:48*ng0 quit (Quit: leaving)
21:34:53Araqa fork is paired with a join
21:35:04FromDiscord<Clyybber> Yeah, and loop is a variation of fork
21:35:10Araqyou don't have a fork, ergo it can only be a 'goto'
21:35:20Araqoh you mean 'loop' is a new opcode?
21:35:25FromDiscord<Clyybber> Yeah
21:35:31AraqI thought it's a label
21:35:32ldleworkmratsim have you seen AI Dungeon
21:35:34Araqhmm ok
21:35:47FromDiscord<mratsim> So the next best thing is once Weave is ready for use with Arraymancer, I'll change the internals so that you can convert to numpy/pytorch (including GPU) without copy
21:36:00Araqbetter use loop and joinLoop maybe
21:36:04FromDiscord<mratsim> this hopefully will unblocks people
21:36:32FromDiscord<mratsim> no I don't know AI dungeon
21:37:01ldleworkmratsim, someone fine-tuned the largest GPT2 model on choose-your-own-adventure material and made an infinite text-adventure
21:37:04ldleworkit's surprisingly good
21:37:14FromDiscord<mratsim> ah looks interesting
21:37:20ldleworkeerily uncanny sometimes how well it understands some things you say
21:37:34disruptekhow the heck did mratsim escape learning about ai dungeon.
21:37:42FromDiscord<Clyybber> I saved my first run
21:37:52FromDiscord<Clyybber> Because it was very... interesting
21:37:52Araqmaybe he is working
21:37:54FromDiscord<mratsim> if you want to work with transformers right now, I recomment huggingfaces
21:38:33FromDiscord<Clyybber> Araq: Hmm, ok, It cant cause ambiguities though, and I guess less instructions == better ?
21:38:52FromDiscord<mratsim> (matrix multiplications disagree)
21:46:22*ng0 joined #nim
21:46:22*ng0 quit (Changing host)
21:46:22*ng0 joined #nim
21:46:34Araqhttps://github.com/nim-lang/Nim/pull/13023 give Timothee some credit
21:46:36disbotmaybe: allows optional chaining of field access and indexing when LHS i snil ; snippet at 12https://play.nim-lang.org/#ix=26k9
21:47:01Araqby telling him your opinion
21:47:58Araqremarkable piece of code
21:48:21Araqit's more beautiful than Swift's builtin support
21:50:54FromGitter<timotheecour> haha thx, so I’ll close the superseded one then https://github.com/nim-lang/Nim/pull/13014
21:50:56disbot[superseded] add `.?` operator for optional chaining: allows field access even with nil objects ; snippet at 12https://play.nim-lang.org/#ix=26k9
21:51:41disrupteki like it, i just think it needs an operator so the syntax is more notable.
21:53:18FromGitter<timotheecour> problem with using an operator is it’d require parser/lexer changes (see PR for details) ; can always be done in subsequent PR’s if needed but for now we have a solution wo such invasive changes
21:53:36disrupteki get it, i'm just sad about it. 😉
21:54:03disruptekdoesn't need to be the last impl, just the first.
21:55:13FromGitter<timotheecour> now, if only https://github.com/nim-lang/Nim/pull/11992 could get some reviewer attention … that would be truly great -:)
21:55:15disbotevery symbol becomes 1st class; defines 0-cost lambda and aliases; inline iterators/templates/etc can be passed to any routine ; snippet at 12https://play.nim-lang.org/#ix=250A
21:56:32FromGitter<deech> Dumb q, is there something in the standard lib that let's me chain iterators?
21:56:40FromGitter<deech> I'm doing `to
21:56:42disrupteknope.
21:56:44FromGitter<deech> Seq` all the time.
21:56:54FromGitter<deech> ok, thanks.
21:57:22disruptekare you afraid of dependencies?
21:57:55FromGitter<deech> No, just don't know the std. lib well enough to know if I'm missing something. Which one do you recommend?
21:57:55Araqdeech: sugar.collect, new in devel
21:58:19FromGitter<deech> ooooh
21:58:27disruptekzero-functional might be more to taste.
21:58:38Araqtimotheecour: that's exactly the stuff that caused us so much pain over the years
21:59:00Araqit's "only" a new type I don't understand
21:59:07Araq*cough* tyTypeDesc
21:59:45FromDiscord<Clyybber> It feels like a workaround IMO
22:00:27FromGitter<timotheecour> what do you mean? you mean `tyAliasSym` (from 11992) or `tyTypeDesc` ?
22:00:39Araqif you want aliases and templates are not good enough, can't we improve templates so that they do work?
22:00:54AraqtyAliasSym, yes
22:01:20Araqthe aliasing handling in lookups.nim that you built upon is dead code
22:01:39AraqI mean, it's not dead yet
22:01:56Araqbut iirc I can remove it since .deprecated is deprecated
22:01:57FromGitter<timotheecour> I’ve explored the template route extensively, it’s a dead end that is inherently ambiguous and cannot be fixed
22:02:08Araqaha
22:02:14Araqwhy?
22:02:53FromGitter<timotheecour> lots of edge cases; eg can’t alias a number of things (eg templates w all default params, certain iterators etc)
22:03:43FromGitter<timotheecour> furhtermore, u can’t pass a template to a proc/generic; so u can’t do the thing i’m doing in `speed benefit` section
22:06:29Araqalright, so assuming skAlias stays but isn't it enough, why has this to become a *type*
22:06:54Araqtypes are more complex than anything else in Nim
22:07:49Araqand already getType() is a pita to use where you need to care about all these edge cases when in reality at runtime it's just a bunch of integers and pointers
22:08:41FromGitter<timotheecour> makeing it a type is what allows you to forward a template to a proc/generic as I’m doing in here eg: ⏎ ⏎ ```func isSorted2*[T, Fun](a: openArray[T], cmp: Fun): bool = … ⏎ isSorted2(s, (a,b)~>a<b)``` [https://gitter.im/nim-lang/Nim?at=5e0fbb69865af87363b3c4db]
22:08:49FromDiscord<mratsim> Ok I've fixed my `=` and `=sink` woes, thanks
22:09:28Araqmratsim: your refcounting is still a bit bad though, start with RC == 0, and don't decref for the common case
22:09:54Araqif atomicRead(rc) == 0: dealloc(p)
22:10:00Araqelse: atomicDec(rc)
22:10:25Araqis how to do reference counting
22:12:10FromDiscord<mratsim> Well I just copy pasted boost: https://www.boost.org/doc/libs/1_57_0/doc/html/atomic/usage_examples.html#boost_atomic.usage_examples.example_reference_counters
22:12:45Araqwell maybe I researched it for a couple of years
22:13:02*Trustable quit (Remote host closed the connection)
22:16:26AraqBoost cannot do it this way because they also have to support weak_ptr iirc
22:17:49FromDiscord<mratsim> well your way makes sense, loads are much cheaper than a moRelease fetchSub
22:23:19*oculux joined #nim
22:24:19FromDiscord<Clyybber> Araq: Sorry for the dumb question, but I think I need to define a hash proc for PSym, at least thats what the compiler tells me when trying to use HashSet[(PSym, PNode)]
22:29:42*narimiran quit (Quit: leaving)
22:33:40*couven92 joined #nim
22:33:59*a_b_m joined #nim
22:34:38*gangstacat quit (Quit: Ĝis!)
22:35:14*a_b_m quit (Client Quit)
22:35:31*jjido joined #nim
22:36:13*abm quit (Ping timeout: 268 seconds)
22:37:10*gangstacat joined #nim
22:38:10*NimBot joined #nim
22:40:10*lritter quit (Quit: Leaving)
22:42:54*smitop joined #nim
22:45:44*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:47:40FromGitter<zetashift> those server costs for AI Dungeon tho, yikes
22:49:56skrylar[m]it comes from a family of developers who think better design is dumb just brute force it with more cycles :shrug:
22:50:09*Vladar quit (Quit: Leaving)
22:50:17FromDiscord<mratsim> what does?
22:50:32skrylar[m]ai dungeon is from GPT which is an obscenely large network
22:50:53FromDiscord<mratsim> well yes, natural language processing is very complex
22:51:00FromDiscord<mratsim> the only rule is that there are no rules
22:51:12FromDiscord<mratsim> learning the absence of rules is pretty much wild wild west 😉
22:51:19skrylar[m]hmm i dunno i haven't seen google or openai working on primitives
22:51:29skrylar[m]usually they throw out some huge network and then someone smaller makes the same thing work on half the hardware
22:51:39skrylar[m]there was uhh
22:51:50FromDiscord<mratsim> Yes that's what happened with squeezenet
22:51:55FromDiscord<mratsim> and mobilenet
22:51:55skrylar[m]baidu super optimized a wavenet impl and then others made that lighter wavernn and later glow
22:52:14FromDiscord<mratsim> PyTorch Glow is in limbo state right now
22:52:33skrylar[m]i haven't read any new papers the past year or so
22:52:45FromDiscord<mratsim> PyTorch Glow is supposed to be a JIT but PyTorch v1.0 was released with another JIT
22:52:59FromDiscord<mratsim> so i'm not sure what the glow team is doing
22:53:26FromDiscord<mratsim> and Google stoled many core devs from Facebook
22:53:27skrylar[m]https://github.com/NVIDIA/waveglow i think this was the one i read about last
22:53:38FromDiscord<mratsim> ah I didn't know about this one
22:54:10skrylar[m]yeh there is a WaveRNN which i think is much smaller than wavenet? and then waveglow also came out and was supposed to be very good for less compute
22:54:29skrylar[m]my general impression is the big boys are just brute forcing random shit with their huge budget and letting the rest of the industry make it actually useful
22:54:38*solitudesf quit (Ping timeout: 260 seconds)
22:54:40skrylar[m]but then nobody hears about the smaller ones :rofl:
22:54:42FromDiscord<mratsim> Google is guilty of that
22:54:59FromDiscord<mratsim> they call something that can be trained on "only" 16 GPUs a small network
22:55:01skrylar[m]well also things like mycroft and mozilla are using tacocron because why
22:55:20skrylar[m]oh well. i wrote voiceloop in arraymancer once but i kept hitting bugs
22:55:40FromDiscord<mratsim> For RNN Arraymancer has many problems
22:55:48FromDiscord<mratsim> one it only has GRUs
22:55:57FromDiscord<mratsim> 2, OpenMP makes it slower
22:56:04skrylar[m]voiceloop is only sort of an rnn
22:56:26skrylar[m]it stores state in a window of like ten previous states which slide down a stack and then you refer back to that, more than any actual hidden state
22:56:34skrylar[m]BUT
22:56:48skrylar[m]it runs real-time on cpus and clones voices from ten second samples /shrug
22:56:57skrylar[m]tacotron still requires hours of training samples
22:57:33*jjido joined #nim
22:57:42FromDiscord<mratsim> Actually my main motivation behind Laser and Weave was that I got seriously stuck when trying to implement an AI that played pong: https://github.com/numforge/agent-smith/blob/master/examples/ex02_00_pong_cem.nim
22:58:12FromDiscord<mratsim> I needed lot more stuff, especially efficient for loops on more than 3 tensors at a time
22:58:59disruptekwho else is using nimph on windows, here?
23:03:01*tane quit (Quit: Leaving)
23:06:27*nsf quit (Quit: WeeChat 2.7)
23:07:15disruptekgittyup now bugging out on devel due to arc. i guess it could be cooldome's infinite loop?
23:08:01Araqunlikely
23:08:09Araqmaybe it's my exception handling :P
23:08:28disruptekhttps://api.travis-ci.org/v3/job/632470755/log.txt -- scroll to the end.
23:08:51FromDiscord<treeform> Why does Nim need the very mangled names like `parent_259357` why can't it just do `parent` `parent_1`, `parent_2` ... ?
23:09:34Araqsometimes we do just that
23:09:57Araqbut you'd be surprised how complex mangling can be when it was an afterthought
23:10:28disruptekwhen 259,357 parents really love each other...
23:11:33FromDiscord<treeform> hmm there is only 1 `parent_#` in the whole code base, it should have been just `parent`.
23:13:04Araqyeah and this is how compilers work: First they grep over everything to see if "there is only 1"
23:13:26skrylar[m]unrelatedly here was a good facepalm: someone saying that binary protocols were bad because variable length fields require turing machines, but text protocols are good (apparently text protocols don't read varying numbers of bytes '_')
23:13:57disruptekbytes are so passe.
23:14:00FromDiscord<treeform> Araq, this is mainly a problem for me for the JS backend. Maybe I can write a script to demangle the names.
23:15:09FromDiscord<treeform> I had a script that would generate source maps, but then this PR got made ( https://github.com/nim-lang/Nim/pull/7508 ), but then it was never finished!
23:15:10disbotSourcemap for JS
23:15:23FromDiscord<Clyybber> Araq: Do I have to define a hash proc for PSym and PNode for this to work?
23:15:35AraqClyybber: yeah but it's bad
23:15:45Araqinstead of the PSym, use the sym.id at least
23:15:50FromDiscord<Clyybber> Yeah
23:16:07AraqI dunno what to use for the PNode's hash for now
23:16:22Araqyou can hash the ref via cast[int](node)
23:16:27*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:16:31Araqbut it's ugly
23:18:21Araqskrylar[m], most people who use "Turing" in the sentence have no clue about anything
23:19:16Araqalso known as "X is impossible because of the halting problem"
23:24:15skrylar[m]Araq: i gave up after .. four hours i think i wasted?
23:24:43disruptekdisbot: have my baby.
23:24:44disboton it. 👍
23:24:57skrylar[m]they wanted to check user logins against ??? and translate the response in to user groups, but LDAP was bad because it wasn't a text protocol and also databases are bad
23:25:05skrylar[m]i guess.
23:25:34disrupteki keep my data in my wallet next to my password prophylactic.
23:30:19Zevv"prophylactic", thats not a good password
23:31:42*chemist69 quit (Ping timeout: 260 seconds)
23:32:30*chemist69 joined #nim
23:33:04*krux02 quit (Remote host closed the connection)
23:34:04disruptekit's not?
23:34:33disruptekhere's a better arc error message: https://api.travis-ci.com/v3/job/272281741/log.txt
23:38:51Araq*shrug*, I'm sorry this feature is still in development and we spent all of our resources on it already
23:40:26Araqif you want to help, reduce it to a test case and submit a bug report
23:42:09disruptekkk
23:43:17disrupteki only mention it because it worked yesterday.
23:43:30Araqinteresting
23:43:32disrupteki will see if i can narrow it down a bit.
23:43:38Araqyes please
23:55:18*MightyJoe joined #nim
23:55:18*cyraxjoe quit (Ping timeout: 260 seconds)