<< 09-07-2019 >>

00:34:07FromDiscord_<Mind> Hey, i was wondering what IDE most people use with Nim?
00:38:28*Voltist joined #nim
00:39:06rayman22201VSCode, followed by Vim
00:40:42FromGitter<zetashift> yea VSCode sometimes spacemacs
00:40:56VoltistHi all. How would I go about piping two processes together in by their input and output streams in Nim?
00:41:12FromDiscord_<Mind> from what i've tried with VSCode, it doesnt seem to complete members of modules. at least with version 0.20
00:41:41rayman22201@Voltist https://nim-lang.org/docs/osproc.html
00:42:57Voltist@rayman22201 The osproc documentation shows me how to find the input and output streams of a process, but not how to link them
00:43:46VoltistIt will be somewhere in the streams library but I don't know what to look for
00:43:53rayman22201@Mind you need something like nim-lsp for that to work: https://github.com/PMunch/nimlsp
00:43:55rayman22201it's not built in
00:44:11rayman22201@voltist, what do you mean by "link them"?
00:44:43rayman22201You want to pipe the stdout of one into the stdin of the other?
00:44:56VoltistYeah
00:47:29rayman22201you just iterate over one stream and send the result to the other. There is no built in proc for this.
00:47:46rayman22201maybe a nimble package for it? idk
00:48:45VoltistOk
00:49:08*lf-araujo joined #nim
00:49:47rayman22201no nimble nimble package that I can find. Yeah. should be pretty simple to write though
00:49:58shashlickmaybe use https://nim-lang.org/docs/selectors.html
00:52:05rayman22201why? That doesn't look like it does anything for piping?
00:57:59*lf-araujo quit (Ping timeout: 252 seconds)
01:06:05shashlickwell, at least to move data from one handle to the other
01:25:53rayman22201I think they wanted a proc that did the data marshalling automatically. I.e 'pipe(inputStream, output Stream)' but that doesn't exist so might as well just use the stdlib unless you really need the performance of something low level like epoll.
01:28:52*Tanger quit (Remote host closed the connection)
01:30:39*Virxes quit (Remote host closed the connection)
01:35:22*Mister_Magister quit (Ping timeout: 246 seconds)
01:36:30VoltistSo how could I do this with selectors?
01:36:52*Mister_Magister joined #nim
01:44:47*dwdv quit (Quit: quit)
01:45:27rayman22201You probably shouldn't. You get the low level file handles for the input and output streams with this: https://nim-lang.org/docs/osproc.html#inputHandle,Process, and then you register the stdin FD and a callback with https://nim-lang.org/docs/selectors.html#registerHandle%2CSelector%5BT%5D%2C%2Cset%5BEvent%5D%2CT
01:45:27rayman22201then in the callback, write the data to the stdout handle.
01:45:58rayman22201selectors are just a low level way to do async io. They have nothing to do with streams or processes.
01:46:42rayman22201if you are going to go that route, you might as well just use nim async/await, which does the selector epoll nonsense for you.
01:52:57rayman22201oh yeah, don't forget that you then have to run an event loop by calling selector.select() in a loop :-P https://nim-lang.org/docs/selectors.html#select%2CSelector%5BT%5D%2Cint
01:54:06rayman22201which async does for you
01:55:27*lf-araujo joined #nim
02:03:37*lf-araujo quit (Ping timeout: 252 seconds)
02:05:39shashlickif you have a higher level api, certainly use that
02:07:00rayman22201Fun fact. What I described is pretty much how would go about it in C. Nim has no problem acting like a "prettier version of C" if that's what you really want to do 😝
02:08:00*Tanger joined #nim
02:13:30*Voltist quit (Remote host closed the connection)
02:13:58*lf-araujo joined #nim
02:16:51rayman22201@shashlick sorry! I couldn't resist poking a bit of fun at you. You do some very cool stuff with low level APIs.
02:29:24*lf-araujo quit (Remote host closed the connection)
02:32:19*chun joined #nim
02:36:25*chun_ joined #nim
02:39:26*chun quit (Remote host closed the connection)
02:44:42*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
02:44:56shashlickno worries πŸ™‚ I had to do this select loop for my python proxy a while back - https://github.com/genotrance/px/blob/master/px.py#L900
02:45:25*laaron joined #nim
03:07:07rayman22201neat! but also, I'm sorry! A select loop is not something I ever want to write by hand if I can help it lol.
03:09:33shashlickit wasn't fun for sure - especially since there's error handling which makes it into a mess
03:13:40*fjellfras joined #nim
03:24:06rayman22201I can imagine! Error handling with callbacks like that quickly gets really messy.
03:28:29*lritter quit (Ping timeout: 244 seconds)
03:29:04*lritter joined #nim
03:39:07*alexander92 quit (Ping timeout: 268 seconds)
03:40:48*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:46:16*lritter quit (Ping timeout: 246 seconds)
04:18:55*lf-araujo joined #nim
04:22:15*chun__ joined #nim
04:23:13*chun__ quit (Client Quit)
04:25:16*chun_ quit (Remote host closed the connection)
04:30:17*lf-araujo quit (Ping timeout: 252 seconds)
04:33:33*nsf joined #nim
04:33:35*gmpreussner quit (Ping timeout: 244 seconds)
04:49:45FromGitter<zacharycarter> well the nuklear bindings *should* be working - but they're not for the opengl glfw3 example. I'm on windows now though and I really don't feel like troubleshooting this crap, since I'll be using bgfx. I just finished putting together a bgfx backend for nuklear, and I'm going to test it this evening. if it works I'll consider the binding update finished and let others worry about testing / adding more backends
04:51:16*fjellfras quit (Ping timeout: 268 seconds)
04:52:28*leorize quit (Ping timeout: 260 seconds)
04:55:10*lf-araujo joined #nim
04:55:52*dddddd quit (Remote host closed the connection)
04:56:10*fjellfras joined #nim
04:58:34*fjellfras quit (Remote host closed the connection)
04:58:47*fjellfras joined #nim
04:59:15*stefanos82 joined #nim
05:01:11*leorize joined #nim
05:07:35*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
05:10:02*laaron joined #nim
05:16:13*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
05:16:34*laaron joined #nim
05:20:58*alexander92 joined #nim
05:35:40*lf-araujo quit (Ping timeout: 276 seconds)
05:37:55*narimiran joined #nim
05:43:16*NimBot joined #nim
05:49:29*alexander92 quit (Ping timeout: 258 seconds)
05:50:51*gmpreussner joined #nim
05:56:59*fjellfras_ joined #nim
05:57:04*fjellfras quit (Ping timeout: 272 seconds)
05:57:24*fjellfras_ quit (Max SendQ exceeded)
05:57:48*fjellfras_ joined #nim
06:04:15*lf-araujo joined #nim
06:09:40*lf-araujo quit (Ping timeout: 264 seconds)
06:16:19*traviss joined #nim
06:16:25*Travis__ joined #nim
06:16:30*lf-araujo joined #nim
06:16:56*Travis__ quit (Client Quit)
06:19:56*purebadger joined #nim
06:24:33*purebadger quit (Ping timeout: 248 seconds)
06:28:22*lf-araujo quit (Ping timeout: 252 seconds)
06:39:14*PMunch joined #nim
06:42:54*solitudesf joined #nim
06:58:12*traviss quit (Quit: Leaving)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:45*krux02 joined #nim
07:04:34*gmpreussner joined #nim
07:05:42*lf-araujo joined #nim
07:13:52*lf-araujo quit (Ping timeout: 264 seconds)
07:14:57*purebadger joined #nim
07:25:12*lf-araujo joined #nim
07:30:04*lf-araujo quit (Ping timeout: 276 seconds)
07:32:57*Senketsu quit (Quit: WeeChat 2.5)
07:39:10*lf-araujo joined #nim
07:48:04*lf-araujo quit (Ping timeout: 264 seconds)
07:54:34*solitudesf quit (Ping timeout: 244 seconds)
07:59:02*abm joined #nim
08:16:48PMunchHmm, I'm back to trying to create the safeoptions part of my optionsutils
08:17:37PMunchWhich essentially imports the Options type, but only the safe access pattern macros from the optionsutils module and not the getters from the options module
08:20:59PMunchStill having the issue where my macro can't use unsafeGet because it expands in the scope where that isn't available
08:23:01FromGitter<mratsim> bindSym?
08:23:54PMunchI don't know why, but it's not working
08:25:03PMunchIs it because my return type is untyped?
08:28:14PMunchHas discardable been removed?
08:28:20*floppydh joined #nim
08:33:16PMunchHmm, apparently not..
08:33:34PMunchBut I get: Error: invalid pragma: discardable
08:35:17*dwdv joined #nim
08:39:46*lf-araujo joined #nim
08:42:38PMunchAha
08:42:54PMunchSo apparently bindSym doesn't work when it's a nnkDotExpr
08:44:09*lf-araujo quit (Remote host closed the connection)
08:44:11PMunchI was trying to do ":tmp120398.unsafeGet.doSomething()", which didn't work, saying "undeclared field: 'unsafeGet'". Changing it to "unsafeGet(:tmp120398).doSomething()" worked fine
08:52:57*couven92 joined #nim
08:54:32PMunchHow do I do the same thing in a template though?
08:55:21*stefanos82 quit (Quit: Quitting for now...)
08:56:00*Senketsu joined #nim
09:03:08*fjellfras_ quit (Remote host closed the connection)
09:03:27*fjellfras_ joined #nim
09:03:42*fjellfras_ quit (Max SendQ exceeded)
09:04:09*fjellfras_ joined #nim
09:05:20FromGitter<zah> recently, I had to write the following in a macro: ⏎ ⏎ ```let bindSym = bindSym "bindSym"``` ⏎ ⏎ Then the Nim crown appeared over my head, I had levelled up :P [https://gitter.im/nim-lang/Nim?at=5d2458d0f5dd145742525f2b]
09:14:37*alexander92 joined #nim
09:14:44alexander92#nim-offtopic
09:14:55alexander92ops my irc skills
09:19:16FromGitter<zah> Is there a reason why no overflow checks are performed for `uint` values? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d245c14d0e06b66757280fa]
09:21:05FromGitter<mratsim> because they are the same as uint in C
09:24:14PMunchzah, haha :P
09:30:17PMunchIs there a way to do something similar to what bindSym does in a macro in a template?
09:33:12PMunchHuh, apparently converting that to a call as well seems to work
09:33:27PMunchSo the unified call syntax breaks down in this case..
09:35:36*zyklon joined #nim
09:35:42*uvegbot quit (Ping timeout: 252 seconds)
09:37:29FromGitter<mratsim> in template always use the call syntax
09:38:58FromDiscord_<Stuffe> Does anyone know to make a proc with side effects act like it doesn't have side effects? debugEcho style
09:39:10FromDiscord_<Stuffe> Im overloading assert() because it's too hard to read with all the irrelevant output, and I want to add console colors
09:41:48alexander92i am not sure if this should be possible
09:41:58FromGitter<mratsim> {.noSideEffect.}:
09:42:12alexander92after all, this means we need a {.noSideEffectExceptThisIgnoredOne.}
09:42:23FromGitter<mratsim> you can then use a block of code with sideeffect and the compiler will not enforce on that part
09:43:05alexander92but if its possible, please define a different assert function
09:43:16alexander92(are those asserts in foreign code?)
09:43:31FromDiscord_<Stuffe> {.noSideEffect.} is to enforce that the function doesnt have side effects I think
09:43:44FromGitter<mratsim> It's possible, see: https://github.com/numforge/laser/blob/83d043c7d80d62c5ed8f2391ca9c15c8a5433932/laser/lux/ast/ast_compiler.nim#L199
09:43:46FromDiscord_<Stuffe> the only "side effect" is to change the color of the text in the console
09:43:48alexander92notice the : use it like
09:44:00alexander92ye ^
09:44:12FromDiscord_<Stuffe> And I make sure to change it back, so for all intents and purposes it doesn't have side effects
09:44:15alexander92Stuffe i agree, your usecase is good, but i am a bit worried
09:44:19FromGitter<mratsim> I was accessing a compile-time global "let", but let globals are considered sideeffect
09:44:21alexander92in principle
09:44:32FromDiscord_<Stuffe> interestingly, quit() is not seen as having side effects (seems like a bug)
09:44:57alexander92because i cant know if the user really used it as a workaround for a lang limitation or did he introduce additional actuall effects
09:45:06FromGitter<mratsim> ```func foo() = ⏎ {.noSideEffect.}: ⏎ echo "mySideEffect``` [https://gitter.im/nim-lang/Nim?at=5d246222acab0914d8d731fa]
09:46:15FromDiscord_<Stuffe> mratsim, oh that worked
09:46:46alexander92eh thats a good example: i'd even go as far as forbidding this without {.noEffectNotChecked.} or something like that
09:46:52FromDiscord_<Stuffe> i did: func foo() {.noSideEffect.} =
09:47:01FromDiscord_<Stuffe> which didnt
09:47:04FromGitter<mratsim> func implies noSideEffect ;)
09:47:09alexander92so that the language enforces that people reading the signature can take a note
09:47:57FromGitter<mratsim> your version applies to the function signature. then the proc body is checked and enforced no sideeffect
09:48:18FromGitter<mratsim> my code block just means "trust me, this part has no sideeffect"
09:48:24alexander92exactly
09:48:31FromDiscord_<Stuffe> alexander, I really hope nim keeps letting us "play in the deep end". The whole reason I like nim so much is because it gives good programmers the freedom to make mistakes instead of always prioritizing the lowest common denominator
09:48:33alexander92{.trust.}
09:48:40FromDiscord_<Stuffe> let them have excel
09:48:48alexander92Stuffe, i absolutely want this to be possible
09:49:11alexander92all i am saying is that the language should require annotating the fact in the signature
09:49:21alexander92this way one gets the best of both worlds
09:49:51FromDiscord_<Stuffe> Yes, agreed
09:49:54alexander92one can define a noSideEffect function for whatever he needs, but the user of the API can still know to be a bit more cautious with some of those
09:50:29FromGitter<mratsim> {.tag: "noSideEffectButNotExactly".} ?
09:50:55alexander92:P {.trust.} sounds catchy
09:51:17FromGitter<mratsim> I wonder if someone used the tag/effect system for more than toy examples already
09:51:33alexander92{.noSideEffectManual.}
09:51:50alexander92i remember the yaml parser lib used it
09:52:15alexander92i use it for annotating that i invoke a certain python interop
09:52:34alexander92but honestly not using that info a lot yet
09:52:49alexander92but the noSideEffect effects should be useful
09:54:55FromGitter<mratsim> I'm very annoyed with higher order functions forcing me to tag {.nimcall, gcsafe, locks: 0.} and what not ...
09:58:50*lf-araujo joined #nim
10:05:56*fjellfras_ quit (Ping timeout: 258 seconds)
10:07:36*lf-araujo quit (Ping timeout: 252 seconds)
10:11:04Araqdid I miss something? Nim has "general purpose" effects, they are called .tags
10:24:41*fjellfras joined #nim
10:24:42*fjellfras quit (Read error: Connection reset by peer)
10:25:03*fjellfras joined #nim
10:28:20FromDiscord_<Stuffe> Araq: I don't know if you missed much, but shouldn't "quit()" be considered as having side effects? Seems like a bug, rigth?
10:33:11*purebadger quit (Ping timeout: 244 seconds)
10:40:10*purebadger joined #nim
10:59:48ehmryisn't quit noreturn?
11:00:14*Vladar joined #nim
11:01:02*fjellfras quit (Quit: Leaving)
11:02:41FromDiscord_<Stuffe> I guess yes but "echo" has is marked as having side effects
11:02:53PMunchIs there a way to export everything except a defined set from a module?
11:13:45FromGitter<mratsim> have an additional module that import foo except bar; export foo
11:14:58leorizePMunch: `export <modulename> expect <symbols>`
11:15:53PMunchThanks :)
11:16:14PMunchMaybe that should be mentioned here: https://nim-lang.org/docs/manual.html#modules-export-statement ?
11:16:18narimiranleorize: i expect that to not work :P
11:16:35leorizeyea, it's except :p
11:16:47leorizewas a tad bit sleepy :p
11:19:26Araqwell there is a definition of what "has side effect" means and quit() doesn't have any
11:19:44Araq(quit doesn't access a global variable)
11:20:01*lf-araujo joined #nim
11:20:41Araqhowever, procs can "choose" to be effectful and 'echo' did that and 'quit' didn't. The idea was that clearly echo accesses 'stdout' implicitly
11:20:50Araqso it should count as a side effect.
11:23:04*Snircle joined #nim
11:27:14Araqnon-local control flow isn't an effect in Nim, exceptions are tracked separately
11:28:16*lf-araujo quit (Ping timeout: 264 seconds)
11:30:25alexander92but then i cant be sure calling a random func wouldnt self-terminate my program down 3 calls deep the line
11:31:35alexander92wait, so the compiler calculates a lot of effects itself: is there a way currently to show the "calculated" effects in an editor for a file?
11:31:43Araq1. you never are (signals? Fatal errors?)
11:32:00Araq2. you can introduce a 'terminates' tag on your own.
11:32:18alexander92eh obviously there is a diffence between external reason and my own code deliberately quitting
11:32:30alexander92but yeah, not a big deal, just wondering
11:32:56alexander92yeah, i can call it `halts` :P
11:33:05*lf-araujo joined #nim
11:33:06alexander92and let the compiler solve the problem
11:33:09Araqthere is an .effects pragma to make the compiler output the computed effects
11:33:48alexander92so if a push it on the top of the file, it can be used
11:34:25alexander92is there a way to push globally a pragma? (e.g. somehow by a compiler on/off switch)
11:35:11alexander92this way i can make my compiler save somewhere the info and visualize it somehow in my ide/editor
11:35:43Araqhttps://gist.github.com/Araq/d19bdecbe691be38789ea73329dfb92a
11:36:00Araqas you can see, it currently doesn't list the .sideEffect
11:39:14*theelous3 joined #nim
11:42:07*lf-araujo quit (Ping timeout: 250 seconds)
11:42:42narimiranPMunch: https://play.nim-lang.org/ ?
11:43:06narimiran!eval echo "hello"
11:43:07NimBotCompile failed: <no output>
11:46:50PMunch!eval echo "hello"
11:47:33PMunchHmm
11:47:50NimBotCompile failed: <no output>
11:48:39narimiranPMunch: playground is back online, but it seems like it cannot compile anything
11:49:54PMunch!eval echo "Hello"
11:49:58NimBotHello
11:55:15PMunchNot really sure what happened, but it seems to be back now
11:55:57*Cadey quit (*.net *.split)
11:55:57*vqrs_ quit (*.net *.split)
11:55:57*golechwi1 quit (*.net *.split)
11:55:57*qwertfisch quit (*.net *.split)
11:55:57*LyndsySimon quit (*.net *.split)
11:55:57*r4vi quit (*.net *.split)
11:55:58*l1x quit (*.net *.split)
11:55:58*euantor quit (*.net *.split)
11:55:58*odc quit (*.net *.split)
11:55:58*MD87 quit (*.net *.split)
11:56:28narimiran:+1:
11:57:35alexander92Araq: hm, so there is no way to get that info currently
11:59:17Araqmaybe ask narimiran which effects would make nimpretty bugfixing simpler
12:00:26*lf-araujo joined #nim
12:00:58alexander92thats not hard to add to `listEffects`
12:01:28*Cadey joined #nim
12:01:29*vqrs_ joined #nim
12:01:29*golechwi1 joined #nim
12:01:29*qwertfisch joined #nim
12:01:29*LyndsySimon joined #nim
12:01:29*r4vi joined #nim
12:01:29*l1x joined #nim
12:01:29*euantor joined #nim
12:01:29*odc joined #nim
12:01:29*MD87 joined #nim
12:03:22Araqand which effect would help us find the nimsuggest leaks?
12:03:39Araqa UsesTooMuchMem tag?
12:04:16alexander92i am trying to think of ways to visualize what effects are inferred at all
12:04:32alexander92exactly to be able to see with my own code if there is something that helps
12:04:48Araqand then what? after you have visualized it the effect still don't help you to program
12:05:06FromDiscord_<Skaruts> how do I get the type of a variable?
12:05:09alexander92my purpose is to find if they are useful at all
12:05:17Araqthey are not.
12:05:54leorizeSkaruts: typeof()
12:06:11alexander92well, one possible theory i had is that its annoying to annotate them everywhere, but if we just could see what is inferred, they might make more sense
12:06:19Araqesp if you come from a FP mindset where CPU usage and memory handling by definition is never a "big deal"
12:07:00alexander92"X doesnt solve those 2 of 50 possible classes of problems" doesnt mean X is bad
12:07:09alexander92the same as with error handling
12:07:14*stefanos82 joined #nim
12:07:26Araq"X doesn't solve *my* problems at all" does mean it's useless
12:07:32Araqto me.
12:07:35FromDiscord_<Skaruts> Error: undeclared identifier: 'typeof'
12:07:38FromDiscord_<Skaruts> ?!?
12:07:48Araquse a recent Nim that has typeof
12:07:55FromDiscord_<Skaruts> ah
12:08:04alexander92maybe
12:08:19FromDiscord_<Skaruts> well I'm 0.19.4, is it too outdated already?
12:08:20alexander92but i still think something similar to an effect/custom type-like stuff system
12:08:22alexander92can be useful
12:08:28narimiranSkaruts: yeah
12:08:36FromDiscord_<Skaruts> :S
12:08:40FromDiscord_<Skaruts> thanks
12:08:45narimiranis there something preventing you from upgrading?
12:08:49Araqalexander92, it can be useful when you finally start to measure what needs to be measured.
12:09:02Araqwhich is: resource consumption.
12:09:03FromDiscord_<Skaruts> I don't think so, just laziness
12:09:10narimiranif so: take a look at `typetraits` module, it has what you want
12:09:13Araqcontrol flow complexity.
12:09:14alexander92even for stuff like memory/cpu: in a hypothetical lang, you can encode upper limits to memory/cycles etc and somehow prove some limitations
12:09:22*lf-araujo quit (Ping timeout: 252 seconds)
12:09:29alexander92but not sure how scalable to bigger programs that would be
12:09:38*dddddd joined #nim
12:10:01narimiranSkaruts ok if it is just laziness, then you should definitely upgrade, 0.20 brings lots of goodies
12:12:40Araqalexander92, yeah but then if you're like "well a loop is just some tail recursion", you won't get far
12:13:09Araqfor i in N: for j in M: stuff() # N*M* costOf(stuff)
12:13:23Araqwith recursion ... well good luck.
12:13:57alexander92wow, i remember now a built a very simple version of algo-complexity type system
12:14:01alexander92last autumn
12:14:07alexander92yeah, it basically worked like that
12:14:16alexander92but never even got to the crazy recursion stuff
12:15:01alexander92https://github.com/pseudo-lang/pseudolang#for-now
12:15:47*nsf quit (Quit: WeeChat 2.4)
12:15:59alexander92but complexity is even harder as its basically <=> a lot of symbolic math, numerical cost of resources might be somehow reasonabl
12:16:01*go|dfish quit (Ping timeout: 248 seconds)
12:17:41FromDiscord_<Skaruts> @narimiran will do, hopefully the libs I'm using won't complain
12:18:11FromDiscord_<Skaruts> (only using nim-csfml and libtcod_nim)
12:18:43FromDiscord_<Skaruts> is there a changelog for 0.20?
12:18:48*go|dfish joined #nim
12:19:37Araqdamn. over 1000 commits went into 0.20, but we forgot the changelog
12:19:39Araq:P
12:21:03alexander92but recursion can use some heuristics to guess max depth or even one can run the cost system in different scenarios with different parameters to show cost graph for different cases
12:21:15FromDiscord_<Skaruts> https://nim-lang.org/blog/2019/06/06/version-0200-released.html
12:21:21FromGitter<kaushalmodi> Skaruts: https://github.com/nim-lang/Nim/blob/devel/changelogs/changelog_0_20_0.md
12:21:29FromDiscord_<Skaruts> Araq you made me have to fight my laziness!
12:21:30FromGitter<kaushalmodi> yeah :)
12:21:32FromDiscord_<Skaruts> I will not forget that!
12:21:45alexander92after all if smart testing/fuzzing works for dangling refs, why not apply it to this kind of flow-based estimations
12:22:14FromDiscord_<Skaruts> <https://nim-lang.org/blog/2019/06/06/version-0200-released.html>
12:25:20Araqer... because smart testing/fuzzing is actually admitting that the static mechanism came to its limits?
12:25:31alexander92well yes?
12:25:57Araqso now you moved the goal from "static cost analysis" to "dynamic cost analysis"?
12:26:04Araqfine with me, but then say so.
12:26:34alexander92well , is then the newruntime ref/pointer safety not static?
12:27:18Araqit's not and the heavy opposition happened because of that
12:28:08FromDiscord_<Zim> oi
12:28:12FromDiscord_<Zim> quick question
12:28:21FromDiscord_<Zim> can i use else if rather than elif?
12:28:31FromDiscord_<Zim> or does the syntax ignore that
12:28:47Araqyou can use
12:28:49Araqelse:
12:28:55alexander92yeah, but my point is that pointer safety is usually even more central to stuff, so if its a good fit to add dynamic element to it, it might make sense for a cost system as well
12:28:58Araq if # watch the indentation
12:29:36Araqalexander92, but then you inject some 'inc pc' statements into the proc body via a macro and you are done.
12:29:50narimiranZim what's the problem with `elif`?
12:32:24alexander92actually yeah
12:32:32alexander92thats a good method as well
12:32:40alexander92you can run different input sizes of your programs
12:33:40alexander92and record costs for them: for 1 2 3 .. 100 on some scales and based on that statistic to infer a parametric cost
12:34:07alexander92e.g. big O , size as function(x memory) etc
12:34:24alexander92but probably sounds good, doesnt work
12:34:26FromDiscord_<Skaruts> @Zim no `else if` doesn't work
12:34:48*clyybber joined #nim
12:54:42Araqclyybber, !
13:03:40*laaron quit (Remote host closed the connection)
13:05:21*laaron joined #nim
13:13:51Araqclyybber, ?
13:14:11clyybberAraq: Hi
13:16:59Araqwhat's the status?
13:18:23clyybberAraq: I can't say for sure, travis is refusing to start
13:18:46clyybberAnd locally the tests are kinda wonky
13:19:43clyybberNevermind, I think it's because `koch test` is not using nim_temp
13:23:54*solitudesf joined #nim
13:26:13Araq # callback will be called only once, let GC collect them now
13:26:13Araq callbacks.next = nil
13:26:13Araq callbacks.function = nil
13:26:56Araq^ not my code, but it shows the problem: reachability != liveness
13:34:42*lf-araujo joined #nim
13:41:44*vlad1777d__ quit (Ping timeout: 258 seconds)
13:43:36*lf-araujo quit (Ping timeout: 252 seconds)
13:47:52*PMunch quit (Remote host closed the connection)
13:52:05*solitudesf quit (Ping timeout: 258 seconds)
14:04:55Araqhmmm what's Firejail?
14:05:24*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
14:05:39*laaron joined #nim
14:05:47Araq"Firejail wrapper for Nim, Isolate your Production App before its too late!"
14:05:52Araqah ok
14:06:53*lf-araujo joined #nim
14:07:34Araqasyncmacro.nim(36, 36) Error: '=' is not available for type <owned FutureBase>; requires a copy because it's not the last read of 'next433457'; another read is done here: asyncmacro.nim(41, 12)
14:08:19Araqthat's true...
14:09:41clyybberI'm getting a lot of those too, in the failing tests that is
14:09:55Araqmy tests are green :P
14:10:09clyybbermine aren't haha
14:10:31clyybberI mean the tests of my PR are red
14:11:57clyybberand still some segfaults ugh
14:12:04*lf-araujo quit (Ping timeout: 264 seconds)
14:22:18*vlad1777d joined #nim
14:28:33*lf-araujo joined #nim
14:36:29*lf-araujo quit (Remote host closed the connection)
14:37:02*purebadger quit (Ping timeout: 272 seconds)
14:41:41*purebadger joined #nim
14:44:16*arecaceae quit (Remote host closed the connection)
14:44:36*arecaceae joined #nim
14:46:57*purebadger quit (Ping timeout: 248 seconds)
14:48:59clyybberNow this error doesn't make any sense to me at all: https://0bin.net/paste/CMpph0vXy+bspi-y#fXZBKUpvCbrAbwnZbvRZWqhLYUcsEnFGUd74PiZ79ft
14:50:22clyybberclearly b is NOT an rvalue
15:07:32*couven92 quit (Quit: Client disconnecting)
15:10:44*lritter joined #nim
15:13:08*floppydh quit (Quit: WeeChat 2.5)
15:18:18clyybberUgh, its due to the type conversion
15:18:27clyybberAraq: Any idea on what to do?
15:19:21clyybberThis is a reduced Cpp sample to illustrate the issue more clearly: https://godbolt.org/z/QiMl0R
15:27:07*Amun_Ra quit (Quit: brb)
15:30:13*Amun_Ra joined #nim
15:36:29*nsf joined #nim
15:42:49FromDiscord_<Skaruts> is there a technical name for a variable that only ever stores 1 or -1?
15:53:40FromDiscord_<Sporgity> Hi,
15:53:40FromDiscord_<Sporgity> you know when you install Nim, what destination should I extract all files?
16:06:31*theelous3 quit (Ping timeout: 268 seconds)
16:07:05FromGitter<ratiotile> @Skaruts: sounds like a boolean
16:12:20*seni joined #nim
16:18:42FromGitter<Varriount> Sporgity: What OS are you using?
16:19:18FromDiscord_<Sporgity> Windows
16:24:37*alexander92 quit (Ping timeout: 245 seconds)
16:29:54*disruptek wipes away a tear.
16:40:40*solitudesf joined #nim
16:52:10FromGitter<Varriount> Sporgity: It shouldn't really matter then
16:55:30FromDiscord_<Skaruts> @ratiotile a boolean would 0 and 1
16:55:55FromDiscord_<Skaruts> 0 or 1
16:56:00narimiranthis is `bool * 2 - 1` :P
16:57:05FromDiscord_<Skaruts> in the context of my use case the variable marks a direction, up or down (incrementally speaking)
16:57:17FromDiscord_<Skaruts> that's why it 1 or -1
16:58:39FromDiscord_<Skaruts> the value 1 or -1 doesn't represent the increment (it's determined locally, in my case it's actually val*2 or val/2, if 1 or -1 respectively)
16:59:58disruptekSkaruts: what you want is an enum.
17:00:26FromDiscord_<Skaruts> I named it `dir` as in `direction`, but was wondering if there's a name for this
17:01:15disruptekthere was, but directions were removed from Nim in version 0.12.
17:02:05FromDiscord_<Skaruts> so I call `change_cell_size(-1)` to reduce the cells on screen, or change_cell_size(1) to make them bigger
17:02:50narimiranas disruptek said: you want `enum`, with `shrink` and `enlarge`
17:05:59FromDiscord_<Skaruts> never heard of that
17:07:58*Trustable joined #nim
17:33:34FromDiscord_<Skaruts> oh I see what you mean
17:34:06FromDiscord_<Skaruts> but it would still lead me to the question of what to call the variable that will hold it
17:34:17clyybberdirection I guess
17:34:42FromDiscord_<Skaruts> yea I called it `dir` in the meanwhile
17:34:48solitudesfd
17:34:57FromDiscord_<Skaruts> this isn't a big deal at all, I was just wondering about it
17:35:57Araqwait what?
17:36:13Araq"directions were removed from Nim in version 0.12"?
17:36:29Araqmust be before I used Nim
17:36:37clyybberhaha
17:36:41FromDiscord_<Skaruts> lol
17:37:13clyybberAraq: Did you see the above issue?
17:37:25Araqyeah but I'm lost too
17:37:32*sagax quit (Ping timeout: 272 seconds)
17:37:43FromDiscord_<Skaruts> what are these "directions" people are talking about tho?
17:38:11Araqclyybber, you can stream and then I can tell you your mistake. maybe
17:39:43Araqbtw I'll stream tonight
17:41:09Araqclyybber, also ... can we get some benchmarks? I wonder if =move is optimized as well as =sink is
17:41:44Araqthe C code is terrible either way but the optimizer shouldn't sweat
17:51:09FromGitter<ratiotile> @Araq: I have new task benchmark results, using -d:release --x:off, compared to c++=1: if/else = 1, closures = 1.2, await = 6. The iterator closures are a bit trickier to use, but optimize to be much faster than asyncdispatch.
17:52:11Araqnote that we can cheat and map Nim's closure iterators to C++'s solution
17:52:16AraqPRs are welcome
17:52:18ZevvI do like the idea on the forum to add an operator for creating tables. proc `%`[T,G,H](a : array[T,(G,H)]) : Table[G,H] or the like. I guess this has been brought up and burned down a few times?
17:52:33*sagax joined #nim
17:52:41AraqZevv, no but the % is already used for Json construction
17:53:05Zevvyeah, that's why I said 'or the like'. Although it doesn't seem to clash at this time, but its confusing as hell of course.
17:55:22AraqI think table construction in Nim doesn't come up as often as it does in Python and doesn't need a shortcut tbh
17:55:47Araqif you know it at compile-time, use an enum for the index and use an array
17:56:11Araqrecently array constructors with explicit indexes made it into the manual... *cough*
17:56:38Zevvoh? let me find that
17:58:07Zevvwell isn't that nice
17:58:37Araqit's super old stuff
17:58:50Araqrecently we figured it was never documented :P
17:59:05Zevvtranslates one on one to C `[valA] = "A"` ?
17:59:23Araqnah, why would it
17:59:33Zevvno idea :)
17:59:41ZevvAnyway, this helps, never knew it was possible
17:59:49Araqwe don't need C syntax sugar in a codegen
18:00:04Zevvno, but if you have a sparse array it cuts down on the generated code size
18:00:27AraqI doubt it
18:02:34Araqbtw I'm looking for VS code plugin that lists the recently used commands as "buttons" or something
18:02:56*nsf quit (Quit: WeeChat 2.4)
18:03:05Araqso that I can quickly issue the same command without this stupid UP-UP-DOWN-ENTER-SWEAR dance
18:03:14Zevvah I see, you can't even make sparse arrays. "Invalid order in array constructor"
18:06:15Zevv!eval let t = [ 10: "A", 11: "B", 12: "C" ]; echo t[10]
18:06:17NimBotCompile failed: /usercode/in.nim(1, 45) Error: index 10 not in 0 .. 2
18:06:21Zevvis that a bug?
18:06:31FromGitter<ratiotile> sparse arrays would have to be hash tables or trees, won't they?
18:07:05rayman22201mapping closure iterators to C++ closure iterators sounds awesome in theory! :-D
18:07:25Zevvdepends on your interpretation of sparse I guess. You can make a traditional, sparsely popuplated array, but then most people will not call it sparse
18:08:22clyybberAraq: Yeah sure, benchmarks I don't have ready yet, but if you want to take a look yourself, you can do `git fetch origin pull/11248/head:sink2move; git checkout sink2move` to try
18:08:51Araqclyybber, you will hate me for this but ...
18:09:04*absolutejam1 joined #nim
18:09:14Araqhow about we write the code so that we can switch between both easily?
18:10:52clyybberI think that will get very very messy
18:11:27AraqI agree
18:13:39Araqanyone?
18:13:46Araqdoes such a VS extension exist?
18:16:05clyybberAraq: In twidgets_unown, line 59, the 'b' in 'w.add b' gets interpreted as a call? Thats not normal right?
18:16:16Araqit's not a call
18:16:22Araqit's a renderer.nim bug
18:16:30Araqit's some implicit type conversion node
18:16:39Araqbbl
18:16:46clyybberAh, alright. Thanks
18:18:30*purebadger joined #nim
18:31:38*tiorock joined #nim
18:31:38*tiorock quit (Changing host)
18:31:38*tiorock joined #nim
18:31:38*rockcavera is now known as Guest68167
18:31:38*tiorock is now known as rockcavera
18:32:47clyybberAraq: Well, then I know what the issue is. The implicitly-type-conversed gets moved into a temporary, which is then passed to w.add; the problem is that =move takes a var parameter, while the result of the type conversion is an rvlaue (which is why Cpp complains)
18:35:10*Guest68167 quit (Ping timeout: 272 seconds)
18:46:12*natrys joined #nim
18:48:54*lf-araujo joined #nim
18:52:48*purebadger quit (Ping timeout: 244 seconds)
18:53:46*lf-araujo quit (Ping timeout: 252 seconds)
18:55:31*lf-araujo joined #nim
18:58:47*lf-araujo quit (Remote host closed the connection)
19:14:41*theelous3 joined #nim
19:30:53*purebadger joined #nim
19:36:15*nsf joined #nim
19:49:28*copygirl quit (*.net *.split)
19:49:28*SunDwarf quit (*.net *.split)
19:49:39*Eyess joined #nim
19:57:28FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/eO7m/image.png)
19:57:30FromGitter<zacharycarter> yayyy nuklear is rendering something w/ bgfx
20:08:03*nsf quit (Quit: WeeChat 2.4)
20:08:36FromGitter<alehander42> ,
20:12:57FromGitter<zacharycarter> I think I produced a very similar image a couple of years ago
20:13:01FromGitter<zacharycarter> I just don't remember how I fixed it haha
20:17:08*alexander92 joined #nim
20:23:17*lf-araujo joined #nim
20:24:06*purebadger quit (Ping timeout: 272 seconds)
20:28:06*Jesin quit (Quit: Leaving)
20:31:14*Trustable quit (Remote host closed the connection)
20:31:37*purebadger joined #nim
20:35:11rayman22201you have sooo many panes and tabs in your vscode editor @zacharycarter. I would go crazy lol.
20:35:22*lf-araujo quit (Read error: Connection reset by peer)
20:35:38FromGitter<zacharycarter> :P
20:35:40*Jesin joined #nim
20:36:14*kungtotte quit (Quit: WeeChat 2.5)
20:37:07*kungtotte joined #nim
20:41:40*lf-araujo joined #nim
20:49:47*lf-araujo quit (Remote host closed the connection)
20:50:42*lf-araujo joined #nim
20:50:52*narimiran quit (Ping timeout: 245 seconds)
20:52:43AraqI'm streaming https://www.twitch.tv/araq4k
20:53:11*Vladar quit (Remote host closed the connection)
20:54:52alexander92oh i can stream later
20:55:22alexander92brings some discipline
20:58:55stefanos82Araq: did you typed foO() on purpose?
20:59:37stefanos82yep, you just answered my question lol
21:09:49FromGitter<Kvothe87> L
21:11:10dom96That's a late time to be streaming :o
21:15:00*jjido joined #nim
21:17:07*purebadger quit (Ping timeout: 245 seconds)
21:18:46*jjido quit (Client Quit)
21:19:34*gangstacat quit (Quit: Ĝis!)
21:20:17rayman22201is it just me or is Araq's volume very low? I can barely hear him
21:23:04FromGitter<Kvothe87> ...
21:31:05rayman22201nvm.... I have a short in my headphones :/
21:37:20FromGitter<dawkot> Why is Nim not checking ranges when accessing stuff on the JS backend?
21:46:29*laaron- joined #nim
21:50:16*laaron quit (Ping timeout: 260 seconds)
22:28:52Araqrayman22201, oh sorry
22:29:05Araqthe mic is always too far away on my desk, I think
22:29:25rayman22201no worries. It wasn't you. My headphones broke :(
22:29:50rayman22201I put you through my speaker, and you were very loud.
22:30:07Araqah damn
22:30:14Araqnow I remember what I wanted to implement
22:30:36rayman22201quick. write a note so you don't forget again!
22:30:46rayman22201and then go to sleep
22:30:58Araqcaching of 'nim c -r foo.nim' results.
22:31:06Araqonly recompile that if something changed
22:31:18Araqso that I can always use 'nim c -r' without paying the price for it :p
22:32:10rayman22201hrmmm. good idea but you might want a "force-recompile" flag to override the cache then
22:32:32disruptekthat already exists.
22:32:53Araqyeah, exactly.
22:33:00rayman22201ah. cool. nvm then
22:33:09Araq-f or --forceBuild
22:33:13Araqjust fyi
22:33:26disruptekyou're right that this is a good use for it, though.
22:33:39*gangstacat joined #nim
22:35:38rayman22201for when I can't allow my compile time turing complete cellular automata to be cached! :-P
22:38:19*natrys quit (Quit: natrys)
22:40:03*solitudesf quit (Ping timeout: 245 seconds)
22:50:10*lf-araujo quit (Quit: lf-araujo)
22:50:26*lf-araujo joined #nim
22:51:49*abm quit (Quit: Leaving)
22:52:47*clyybber quit (Quit: WeeChat 2.5)
23:08:15*stefanos82 quit (Quit: Quitting for now...)
23:29:05*lf-araujo_ joined #nim
23:29:52*lf-araujo quit (Ping timeout: 252 seconds)
23:29:55*lf-araujo_ is now known as lf-araujo
23:30:56*absolutejam1 quit (Ping timeout: 272 seconds)
23:54:34*lf-araujo quit (Ping timeout: 268 seconds)
23:57:26*krux02_ joined #nim