<<01-04-2020>>

00:02:33blackbeard420LOL vim³ looks awesome!
00:02:48rayman22201lmao, I saw that on HN, and I didn't even realize it was written in Nim.
00:03:14axionI need some help.
00:03:15dom96:o
00:03:18axionLemme make a playground
00:03:28rayman22201axion, you are correct. inject makes the variable "dirty". It injects it into the parent scope instead of gensyming a clean variable name.
00:05:01*dadada__ quit (Ping timeout: 264 seconds)
00:05:46rayman22201wow, the dude wrote a Nim editor by wrapping libvim. Who is this guy and why isn't he on irc? lol https://github.com/paranim/paravim
00:05:52axionhttps://play.nim-lang.org/#ix=2gaF
00:06:14*dadada joined #nim
00:06:38*dadada is now known as Guest1269
00:08:44rayman22201looking and thinking ^
00:13:47*Guest1269 quit (Ping timeout: 260 seconds)
00:14:10rayman22201seems to just work? https://play.nim-lang.org/#ix=2gaH
00:15:15axionnope...
00:15:35axionhttps://play.nim-lang.org/#ix=2gaI
00:15:50axionoh wait...you mapped vec2 differently
00:16:32axionYeah ok, that seems to work. Thanks!
00:16:41rayman22201👍
00:17:17axionideally i'd want the template to expand to 2 templates. no need for function overhead there
00:17:25axionwonder if that will cause any problems
00:19:05*silvernode joined #nim
00:20:41rayman22201like this? https://play.nim-lang.org/#ix=2gaL
00:20:41rayman22201feels like premature optimization. I would expect those functions to get inlined anyway? but you can do it I believe.
00:21:02axionCool. How do I expand a template? expandMacros doesn't seem to be doing anything
00:21:16*dadada__ joined #nim
00:21:45rayman22201good question... I'm not sure if we have a way to expand templates...
00:22:17axionAh hmm
00:22:22madpropsthe nim package in ubuntu is practically useless if it's too old
00:22:59rayman22201poke the ubuntu people to upgrade?
00:23:32madpropswell no use if im running an LTS release
00:23:35axionIf you care about stability, use a Debian derivitive. If you're a developer, don't.
00:24:15madpropswould be ok if nimble could update everything somehow
00:24:41Yardanicochoosenim exists :P
00:25:02madpropsoh forgot about that
00:25:55rayman22201I think expandMacros **should** work on templates, but I'm not sure
00:26:17axionWell I'd like to see an example of that working, because I am then doing something entirely wrong.
00:27:06rayman22201oh, it's working for me?
00:27:31rayman22201The output gets put in the compiler output, not the output of the program.
00:27:49rayman22201https://play.nim-lang.org/#ix=2gaO
00:27:49axionoh so you can't use nim playground to see it anyway?
00:28:03rayman22201you can. click on the button that shows "Showing: output"
00:28:11rayman22201it will switch to "showing: debug"
00:28:14rayman22201it's a toggle switch
00:28:16*rnrwashere joined #nim
00:28:21axionoh :)
00:28:40rayman22201probably need better docs for that :-)
00:28:42axionNo idea how I missed that.
00:29:10rayman22201NP. it's not entirely obvious
00:29:53axionnow it would be super nice if it worked recursively
00:30:09axionBecause that would really be the only use for expanding a template...to see the final code gen
00:30:34axionie; instead of printing the inner template calls...expand those too
00:30:49rayman22201The VM is really sensitive to recursion, that's why it doesn't
00:31:13rayman22201You can embed "expandMacro" statements in your macro to simulate it though.
00:31:43axionIn Lisp we have macroexpand-1 (which this is doing) and macroexpand (which is what I want). Oh well
00:35:11moerm_- Back -
00:35:20rayman22201It's not a bad feature request? Start here: https://github.com/nim-lang/Nim/blob/version-1-0/lib/core/macros.nim#L507, and then make a version that traverses the node and collects the reprs instead of just getting the single node.
00:36:55rayman22201just be careful about the VM. it has a low recursion limit. I would probably unroll the recursion into a loop.
00:37:20axionThanks. It'll be a while before I get to hacking on the language, but I do plan on bringing some niceties over from Lisp sometime soon. For now, just writing lots of code to really get to know the language
00:38:32rayman22201fair enough. 😉
00:40:28FromGitter<zetashift> Isn't there a switch that increases that recursion limit?
00:41:47*rnrwashere quit (Remote host closed the connection)
00:42:26rayman22201yes, but if you want to add a feature to the core of the language, you aren't going to rely on increasing the limit
00:43:30rayman22201I was proposing adding to the std lib. As a nimble package / personal utility, sure, go ham lol.
00:44:53*dwdv quit (Ping timeout: 250 seconds)
00:45:14moerm_See you all tomorrow
00:45:23*moerm_ quit (Quit: Leaving)
00:53:48FromGitter<zetashift> gnight moerm_
00:54:35axionrayman22201: interesting...
00:55:08axionif i change the procs to templates like you did, the expansion doesn't have the * for exporting them
00:55:45axionand i indeed do get compile errors when trying to access the members across modules
00:55:53rayman22201sure enough... that's a bug. please report!
00:58:36axionI will, even though my bug reports don't seem to get any replies :)
00:59:28FromGitter<zetashift> limited manpower
01:00:03FromGitter<zetashift> I don't think that means they go unnoticed axion
01:00:06axionI'm not knocking on Nim, but I do think the 1.0 stability guarantee was a few years premature
01:00:41leorizestable just means that your code won't break in updates :)
01:00:44rayman22201*cough* I agree *cough* pre-mature marketing *cough*
01:00:48axionJust in my first library I'm finding a lot of compiler bugs
01:01:07*rnrwashere joined #nim
01:01:16leorizethe original plan was to pause it until we got rid of all the bugs :)
01:01:35FromGitter<zetashift> I found it too, but more people using Nim (because of 1.0) might also mean more bugs being discovered
01:02:55leorizeyep, 1.0 was the main gatekeeper for people to not use Nim, so in the end the decision was to tackle that :p
01:03:00rayman22201The problem is, soooo many Hacker News junkies and the "trend followers" were complaining that they wouldn't touch Nim because it was "beta" and "experimental" forever. It was just another excuse to not use the language.
01:03:05axionThat is a valid point. There are never no bugs. users.inc if you ever think so
01:03:47FromGitter<zetashift> I do hope Nim decides to do a like an 'Autumn of tooling' or winter of fixing bugs(which I guess is hacktorberfest) to work more on those areas
01:03:49leorizeI find it interesting that no one complains about style insensitivity any more
01:03:53FromGitter<zetashift> YES
01:04:37rayman22201lol. lets hope it stays that way :-P
01:05:58FromDiscord<Benumbed> Personally, IRT the 1.0 stuff, I just wanted the grammar to be stable, that's why I waited
01:06:00*dadada__ quit (Ping timeout: 265 seconds)
01:06:21leorizeit was stable
01:06:24leorize:P
01:07:11leorizesince 0.19 IIRC
01:07:12FromDiscord<Benumbed> Ok, well, I never heard or read that 🙂
01:07:21FromGitter<zetashift> You were one of the few then Benumbed, I saw a lot of comments that couldn't introduce it in their team/work because of no 1.0
01:07:29FromDiscord<Rika> oof
01:07:33rayman22201It was FUD honestly
01:07:37FromDiscord<Benumbed> Not saying it wasn't communicated, just that I didn't actually see a "no more grammar changes"
01:07:41FromGitter<zetashift> I don't think anyone asked if the grammar was stable :P
01:07:58FromDiscord<Benumbed> And I came back because I assumed it was in 1.0, haha 😄
01:08:11leorizeit's still not stable btw :)
01:08:54leorizeit's not like the language is gonna turn upside down in just a release :P
01:08:58FromDiscord<Benumbed> Regardless, I'm using it seriously now though, if only for personal stuff
01:09:14leorizeunless you're julia-lang, they messed up their 1.0 hard
01:09:19FromGitter<zetashift> How's the ride so far?
01:09:21rayman222011.0 brought some kind of "stability guarantee" (whatever that means) lol. The best thing it brought was a more measured approach to maintaining backwards compatibility. Deprecation paths are taken more seriously now.
01:09:52FromDiscord<Benumbed> That's really all you can ask for too
01:09:58FromDiscord<Rika> what happened with julia's 1.0?
01:09:58rayman22201talking about Nim. I don't know jack about Julia. (sorry, got irc snipped)
01:10:10FromDiscord<Benumbed> I just don't want my code that I worked so hard to to randomly break in odd ways 🙂
01:10:20leorizejulia removed all deprecated things when they release 1.0
01:10:35leorizebreaking a tons of libraries
01:10:49rayman22201lol. fail
01:11:20FromGitter<zetashift> wasn't that because 0.6 was basically the road to 1.0
01:11:21FromDiscord<Rika> how much time did they give for the deprecated things though
01:11:25axionhttps://github.com/nim-lang/Nim/issues/13828
01:11:39FromGitter<zetashift> so that basically the jump to 0.6 to 1.0 was non-existant
01:12:02rayman22201Then again, we always kind of cared about backwards compatibility. Nim still tries to keep examples from a 3 year old book still working...
01:12:22FromDiscord<Rika> deprecated things should disappear some update no?
01:12:33FromDiscord<Rika> it just depends how much time itll take
01:12:54axionThe people in my circle won't touch Nim because "it doesn't offer anything over Rust". Sigh
01:13:06leorizerust is the new hip thing now
01:13:10FromDiscord<Benumbed> IMO they should warn, then error, with a switch to turn on the old behavior, then disappear, so far Nim seems to handle that pretty well from what I've seen
01:13:26rayman22201yup. exactly what nim does
01:13:39rayman22201sigh... Nim offers waaayyy better ergonomics than Rust
01:13:40leorizeyea, we got that ever since packages testing was brought into CI
01:13:51axionI'm actually looking forward to Jai though, if it ever comes out of vaporware
01:14:15rayman22201axion, for your usecase in particular, I don't blame you.
01:14:22FromDiscord<Benumbed> Rust makes you scale a concrete wall with rusty nails pointing out at you for their learning curve
01:14:42axionrayman22201: what do you mean for my usecase?
01:14:46rayman22201games
01:14:46leorizeI just dislike their grammar
01:14:51axionOh yeah :)
01:15:00FromDiscord<Benumbed> Still plan on learning more of it one of these days, but Nim is actually pleasant to use most of the time, vs Rust or Go
01:15:07leorizethough I haven't looked at rust for quite sometime
01:15:17FromDiscord<Benumbed> Also the Nim community is nice, vs Rust, they tended toward the rabid side
01:15:24FromDiscord<Benumbed> and Go people and their idoms...
01:15:26FromDiscord<Benumbed> lord
01:15:47FromGitter<zetashift> I think that kind of happens when a community get's too big for it's own good
01:15:51*rnrwashere quit (Remote host closed the connection)
01:16:09leorizeonce Nim is big enough you'll see that kind of things too
01:16:09FromDiscord<Benumbed> agreed
01:16:20FromDiscord<Benumbed> Which is why I'm ok that it's small right now! 😄
01:16:24FromGitter<zetashift> haha
01:16:32rayman22201Dr. Nim + arc gives Nim equivalent guarantees as Rust (arguably the potential to have even better guarantees.)
01:16:55FromDiscord<Benumbed> and why I'm trying to contribute by writing useful libraries, even if I'm slow as hell at it atm
01:16:57FromGitter<zetashift> I hope they document those stuff for beginners. One thing Rust did really well is their book
01:17:04axionWhat is Dr. Nim, and what is CFG? I've seen both mentioned here this week a lot but I am clueless :)
01:17:21rayman22201https://github.com/nim-lang/Nim/blob/version-1-0/lib/core/macros.nim#L507
01:17:25FromGitter<zetashift> book/documentation they made the entry really low even tho it's such a hard to learn language
01:17:33rayman22201Dr. Nim is embedding a proof checker into Nim
01:17:39rayman22201Ada Spark style
01:17:45leorizeaxion: CFG is control flow graph
01:17:57FromGitter<zetashift> Using Z3
01:18:18FromGitter<zetashift> whoops forgot this: https://github.com/Z3Prover/z3
01:18:22axionAh yeah. I had to use z3 to solve a really complex control flow graph in my game engine. Good stuff
01:18:55leorizethe compiler also got itself a CFG for destructors injection
01:18:57FromGitter<zetashift> I think it used Zevv's z3 bindings as a base?
01:19:10leorizethough it's not used anywhere else yet
01:19:24leorizemaybe we can finally fix `not nil` with it :P
01:19:43leorize@zetashift: yea
01:19:43rayman22201CFG can also be used to optimize async :-)
01:20:49FromGitter<zetashift> Is DrNim slated for 1.2?
01:23:36rayman22201not sure
01:25:55FromGitter<zetashift> Oh well I'm looking forward to it
01:26:03FromGitter<zetashift> Goodnight y'all
01:27:27*chemist69 quit (Ping timeout: 252 seconds)
01:27:29rayman22201gn o/
01:27:38axionrayman22201: Quick question. With your playground code, how come I'm not allowed to do `Quat.genAccessors(w, 0)` ?
01:28:12rayman22201Quat is a type. UFC syntax doesn't work on types
01:28:23axionAh ok
01:28:25rayman22201a `typedesc`
01:29:26*chemist69 joined #nim
01:32:55leorize[m]rayman22201: ufcs does work on typedesc
01:33:18rayman22201oh? then why doesn't axion's example work?
01:33:38leorize[m]someone even used that to simulate python's forced module qualifier in Nim
01:34:13*rnrwashere joined #nim
01:34:19rayman22201actually, you are totally right. I just tried it, and it works
01:35:06rayman22201@axion. what error do you get?
01:35:15rayman22201https://play.nim-lang.org/#ix=2gb0
01:36:36leorizethe issue you might be facing is how untyped param don't bind too well with UFCS
01:38:23rayman22201It's a template though, it's all untyped?
01:38:44axionerror| cannot use symbol of kind 'type' as a 'param'
01:41:17rayman22201axion. see my nim playground link. It works there.
01:41:32axionyeah i'm trying to find a repro. it doesnt in my code
01:41:34axionone sec
01:42:54axionOh I see
01:43:38axionhttps://play.nim-lang.org/#ix=2gb4
01:43:59axionI changed `q` to `t` since it isn't specific to Quat now. Non-ucs works, but not ucs
01:44:48FromDiscord<Rika> you're getting symbol collision i think
01:45:00axionBut only with UCS. weird
01:45:12FromDiscord<Rika> yeah works when you rename t to ty
01:45:38axionalso works if for the below 3 calls using `t`, just not ucs
01:46:14rayman22201oh yeah, in templates, it will replace the param everywhere. so "proc(t:t)" expands to "proc(Quat: Quat)"
01:46:19rayman22201probably not what you want
01:47:21axionYeah I wasn't going to stay with it. Was just trying to figure out why it only doesnt work with UCS
01:47:43axiontbh I'm going to convert this into a real macro anyway so I can iterate over a string of characters instead of having many calls
01:49:55FromDiscord<Varriount> Araq: Regarding macros for types, it's a shame the macro can't emit other data, like procedure implementations
01:54:14*lritter quit (Ping timeout: 256 seconds)
01:55:00*lritter joined #nim
01:58:47*sleepyqt_ quit (Ping timeout: 260 seconds)
02:03:59axionHow do I write a macro with `quote do` inside a for loop to generate N forms?
02:04:22axionStruggling to get it to emit any code here...
02:17:03*silvernode quit (Ping timeout: 265 seconds)
02:18:21*hax-scramper quit (Ping timeout: 258 seconds)
02:20:31rayman22201stupid example but here: https://play.nim-lang.org/#ix=2gba
02:22:07*Asgaroth_ joined #nim
02:22:43axionThanks
02:25:23*Asgaroth quit (Ping timeout: 260 seconds)
02:26:41axionWhat's wrong here? https://play.nim-lang.org/#ix=2gbb
02:32:39*endragor joined #nim
02:33:31rayman22201a is a runtime string.
02:33:33rayman22201https://play.nim-lang.org/#ix=2gbe
02:33:47rayman22201that works, though might not do what you expect. (It prints the individual chars)
02:34:49axionAha, so it has to be annotated as static. That is the answer to an hour of trying to emit _something_.
02:39:59*muffindrake quit (Ping timeout: 272 seconds)
02:41:37*muffindrake joined #nim
02:42:40rayman22201Glad I could help.
02:43:07axionThank you for all your help today :)
02:43:12rayman22201Static in macros is not the best documented feature...
02:43:21rayman22201Np 😊
02:44:16axionIt's unintuitive behavior like this that has caused me to struggle with macros coming from Lisp where I am very familiar with them
02:44:36axionLike, why not produce any output at all if it's not static? A warning would suffice at least
02:45:55Yardanicodom96: sorry for pinging, but really want to know if there's any ETA to then next nimforum update will be rolled out? AFAIK the forum still runs the (frontend) version compiled in 2018, not sure about backend
02:46:04Yardanicos/then/the
02:47:43rayman22201It's hard to tell if there is no output in the general case. The problem is that the macro took your runtime string just fine. It treaded it as a typed ast node with a len of 0. So the for loop "worked". It just had 0 iterations.
02:47:57rayman22201Treated*
02:48:29axionI see. It seems this structure won't work for what I need it for anyway
02:48:45axionI'd like to produce proc definitions
02:49:34rayman22201you just make your result node a nnkstatementlist, and add the list of proc definitions.
02:50:19*lritter quit (Ping timeout: 256 seconds)
02:50:37axionI tried that
02:50:58*rnrwashere quit (Remote host closed the connection)
02:52:35rayman22201If you remember that crazy macro I showed you for lifting bool procs, I do exactly this: https://gist.github.com/rayman22201/bfc4ce11fa15e57176130c4855407199#file-liftboolprocs-nim-L137
02:52:58rayman22201well, it makes macros, not procs, but there is no difference really. (Just the ast node type)
02:53:29axionhttps://play.nim-lang.org/#ix=2gbl
02:53:48*thomasross is now known as Guest52070
02:53:48*thomasross_ joined #nim
02:53:48*Guest52070 quit (Killed (livingstone.freenode.net (Nickname regained by services)))
02:53:48*thomasross_ is now known as thomasross
02:53:56rayman22201off topic. I know how to get rid of the experimental thing now. (I know how to use typedescs better.) But I don't want to spend more time on it :-P
02:54:10axionThat's ok :)
02:55:11rayman22201https://play.nim-lang.org/#ix=2gbm
02:55:15rayman22201You don't need `ident`
02:55:43axionwithout it i got Error: identifier expected, but found '"x"'
02:56:30*waleee-cl quit (Quit: Connection closed for inactivity)
02:56:38rayman22201oh, hold on.
02:56:40rayman22201easy fix
02:59:03rayman22201https://play.nim-lang.org/#ix=2gbn
02:59:12rayman22201two things. 1. you need static again
02:59:22rayman222012. you can't call ident inside quote do
02:59:56axionlet's see if i can beat myself to death with static today
03:00:17leorizethat's a lot of statics :P
03:00:20rayman22201lol. I can see why it's not intuitive for a lisper :-P
03:00:23*hax-scramper joined #nim
03:00:33axionWell thanks. That should be enough to get me going
03:00:57rayman22201np 🚀
03:03:24axionThe most confusing thing for a lisper is that ` means quasiquote in Lisp, whereas ` is "unquote" within the quasiquote form quote do :)
03:03:31axionI keep getting tripped up by that
03:04:41rayman22201it's inverted? interesting.
03:04:51axion`(1 2 ,(+ 1 2)) ; => (1 2 3)
03:05:05axioncomma is the unquote in lisp
03:05:24rayman22201that makes some elisp code I was looking at make more sense now lol
03:07:31rayman22201unfortunately Nim's quasiquote is a little less ergonomic. You can only embed variables, not full expressions. But it forces you to name unquoted things, so arguably an ok tradeoff.
03:08:34FromDiscord<Rika> some of us bullshit our variable names though...
03:08:36axionIt's also inverted in the fact that macros are unhygeinic by default, whereas in Nim you supply the inject pragma to make it unhygeinic
03:08:43FromDiscord<Rika> < - - - - - -
03:08:49axionin Lisp, you manually gensym what you want
03:09:03FromDiscord<Rika> i think thats a good thing
03:09:07rayman22201that is definitely a good thing imo
03:09:12axionIt is
03:09:27rayman22201isn't that schemes whole schtick? hygenic macros?
03:09:46rayman22201the common lisp vs. scheme split
03:09:46axionYes. I dislike it very much for that reason and more
03:10:00FromDiscord<Rika> it -> scheme?
03:10:11FromDiscord<Rika> why dont you like hygienic macros?
03:10:14*rnrwashere joined #nim
03:10:42axionYes, I don't like Scheme. When I say "Lisp" I mean Common Lisp.
03:10:55axionScheme is pretty much an entirely different language for a lot of reasons
03:11:10axionElisp is closer to CL than Scheme by far
03:12:13axionI don't like them because they don't allow for very expressive code, and syntax-case etc make "safe" macros very hard to write comparatively speaking
03:13:21axionrayman22201: Part of it. The bigger reason is the Lisp-1vs Lisp-2 case
03:14:51axionLisp-2 means that functions and variables live in a different namespace. In Scheme, you can't use the name of an existing function, user-defined or builtin, as a variable, so it forces you to think and is the source of a lot of bugs...also not very expressive.
03:15:00axionSo Scheme, is a Lisp-1
03:15:53FromDiscord<Rika> sounds like ass
03:16:07axionIn Common Lisp, symbols are actually objects that include a variable binding and function binding member (amoung other members)
03:17:53axionand there's full runtime support for querying all the different information about a symbol, such as applying its currently bound function to something, or getting it's string name, etc. The whole language is sort of designed to be as useful for code generation as it is for runtime manipulation of the language.
03:21:17axionCL is a very interesting language. I used it for so long because of the extensive introspection support like this, which comes in handy when modifying a game as it's running without stopping to recompile. Anyway, enough off-topic for that tangent :)
03:28:08axionI really like Nim and I'm trying to forget about CL :) I haven't actually used an Algol derivitive before, unless you count a brief Python experience some 20 years ago or so
03:31:18FromDiscord<Rika> is nim an algol derivative?
03:33:31axionYes
03:33:55*thomasross quit (Remote host closed the connection)
03:34:13*thomasross joined #nim
03:37:21axionhttp://blog.daveastels.com.s3-website-us-west-2.amazonaws.com/images/languages/PLchart.png
03:37:24FromDiscord<Yardanico> @Rika https://en.wikipedia.org/wiki/Generational_list_of_programming_languages#ALGOL_based
03:37:24FromDiscord<Yardanico> https://cdn.discordapp.com/attachments/371759389889003532/694752249049776259/2020-04-01-06-37-06_grim.png
03:37:57axionNim would be somewhere far to the right within the huge cluster of Algol derivatives
03:45:15FromDiscord<Rika> Huh, does nim share a lot with Oberon? Or is there a different way of measuring if something is under another language
03:49:27leorizeiirc 4raq say that Nim have a lot more in common with modula 3
03:53:34*Asgaroth_ quit (Ping timeout: 256 seconds)
03:53:46rayman22201Yeah. Iirc 4raq's idea was to try and bring a lisp like macro system to modula. Something like that.
03:57:16axionHow do I make an identifier `foo=` to be used as a proc name, given an existing ident foo?
03:57:28FromDiscord<Rika> In quote do?
03:57:28*rnrwashere quit (Remote host closed the connection)
03:57:57FromDiscord<Rika> You need to make an accquoted nimnode I think, then use that in quote do
03:58:41axiontrying to fix the second proc in test2: https://play.nim-lang.org/#ix=2gbz
04:01:06FromDiscord<Rika> https://play.nim-lang.org/#ix=2gbA
04:01:20FromDiscord<Rika> ah wait, made a mistake
04:03:18FromDiscord<Rika> https://play.nim-lang.org/#ix=2gbB
04:03:23FromDiscord<Rika> axion ^
04:03:44axionah a new node type to look up. Thanks :)
04:04:16*rnrwashere joined #nim
04:05:17*narimiran joined #nim
04:10:24axionWhat are the [] and []= names even called btw? I'm writing a new proc and need to name that ident something better than what i have?
04:12:26FromDiscord<Rika> id just call them bracket getters and setters
04:14:48*moerm joined #nim
04:15:16axionok
04:17:23*opal quit (Ping timeout: 240 seconds)
04:17:53*moerm quit (Client Quit)
04:20:37*opal joined #nim
04:20:47axionwell my first non-trivial macro seems to work.
04:20:52axionthanks for all the help!
04:25:32*rockcavera quit (Remote host closed the connection)
04:30:36*voltist joined #nim
04:33:08*silvernode joined #nim
04:37:19*nsf joined #nim
04:42:03axion@Rika This is what I came up with. I do have 1 question regarding a small change if you can help: https://play.nim-lang.org/#ix=2gbK
04:44:39axionOr rayman22201 for that matter. I'm pretty close to how I want it
04:45:55*silvernode quit (Ping timeout: 265 seconds)
04:46:19voltistCould anyone recommend a Nim image manipulation library?
04:49:01rayman22201voltist: https://nimble.directory/search?query=Image
04:49:42rayman22201axion: what is your question?
04:50:23*opal quit (Ping timeout: 240 seconds)
04:50:46axionrayman22201: For line 37, it would be nice if the high level code didn't see an array of strings. I'd like to somehow modify the macro so the call looks like: genAccessors [x, y] without the stringified items in the caller. I tried a static array of symbols, but the compiler yelled at me and said to use NimNode instead. Tried that, and it errors deep inside the compiler in seminst.nim
04:53:43*opal joined #nim
04:57:52FromDiscord<Rika> https://play.nim-lang.org/#ix=2gbT best i could think of, axion
04:58:35voltistrayman22201: If I wanted a list of image libraries I would have asked for one. I'm wondering if anyone has any recommendations.
04:59:12FromDiscord<Rika> sorry, got no recommendations
04:59:26FromDiscord<Rika> only one i used was nimpng but that was more "parsing" than "manip"
04:59:38axion@Rika tried running it and it errors
04:59:49FromDiscord<Rika> oh no did i fuck up
04:59:51FromDiscord<Rika> lets see if i did
05:00:00rayman22201Why don't you give some details on what features you actually want? Image library is pretty freaking general
05:00:07rayman22201Also don't be an ass hole
05:00:08FromDiscord<Rika> what errors axion
05:00:10voltistrayman22201: Sorry, that came out a little harsh.
05:00:22axion@Rika just click Run :)
05:00:33FromDiscord<Rika> aw shite
05:00:36FromDiscord<Rika> ill fix em sorry
05:00:55voltistI'm looking specifically for a library that has the ability to draw text onto an image
05:01:23*opal quit (Ping timeout: 240 seconds)
05:02:21FromDiscord<Rika> OH i missed one of the calls, axion, do you mind "Quat.genAccessors(w, x, y, z)" instead of the bracketed one
05:03:11axionCan I call it like `Quat.genAccessors w, x, y, z` without the parens?
05:03:22FromDiscord<Rika> dont know, i think you can
05:03:30FromDiscord<Rika> testing right now
05:03:47axionThat's what I'm looking for. I'm being anal because this macro is practice for an unrelated DSL i eventually want to write
05:03:52FromDiscord<Rika> yeah you can
05:04:02axionbrackets don't matter then
05:04:20FromDiscord<Rika> https://play.nim-lang.org/#ix=2gbV
05:05:28axionWhat did you change besides the signature?
05:05:33rayman22201Sorry, on mobile. @voltist, I think this wrapper might be the best we have. Nothing native unfortunately GitHub - zedeus/nimagemagick: ImageMagick wrapper for Nim (MagickCore/MagickWand) (https://github.com/zedeus/nimagemagick)
05:06:32axionOh I see. the $ for idents
05:06:36FromDiscord<Rika> yeah
05:06:39axionThanks. exactly what i was looking for
05:06:48zedeusnimagemagick is an outdated wrapper, this native one is great https://github.com/SolitudeSF/imageman
05:08:04voltistrayman22201: Ah well, even if it where an updated library, I may as well just go for a python library that can do what I need rather than implementing the image processing myself.
05:08:13axionoh very nice. starred
05:09:27voltistrayman22201: Thanks for the help though. Sorry again for being harsh just earlier, I don't know what came over me.
05:12:11rayman22201NP. All good. Sorry we couldn't be more helpful 👍
05:13:05zedeusvoltist: maybe combining imageman/flippy and this? https://github.com/treeform/typography
05:13:16axionThanks for the macro help everyone. Really appreciate it. I got a decent amount done today. Will finish tomorrow. o/
05:13:54*opal joined #nim
05:14:28voltistzedeus: I'll have a look at that for future consideration. Right now I'm just going to pass all this data to Python's matplotlib instead of making my own raster plots
05:15:08rayman22201Oh, we have ggplot
05:15:29zedeusmaybe consider this https://github.com/Vindaar/ggplotnim
05:15:38rayman22201https://github.com/Vindaar/ggplotnim/blob/master/README.org
05:15:49rayman22201Sniped again lol
05:18:19voltistrayman22201: Yeah I saw that, but I'm trying to make a very niche type of raster plot for use in neuroscience research which is already supported by matplotlib, so I may as well use it
05:19:27rayman22201Fair enough
05:31:19*dddddd quit (Ping timeout: 250 seconds)
05:31:43*opal quit (Ping timeout: 240 seconds)
05:34:59*opal joined #nim
05:35:16*rnrwashere quit (Remote host closed the connection)
06:19:54*voltist quit (Quit: Leaving)
06:25:06*rnrwashere joined #nim
06:27:52*solitudesf joined #nim
06:44:49*PMunch joined #nim
06:50:58FromDiscord<Varriount> Hrm, this is an interesting PR - https://github.com/nim-lang/Nim/pull/13813
06:53:48FromDiscord<Varriount> I'm not entirely comfortable with how we keep adding bits and pieces to the VM's available procedures... But I don't know of a good alternative
06:54:00*deepend_ joined #nim
06:54:58*deepend quit (Ping timeout: 265 seconds)
06:56:54*aEverr quit (Ping timeout: 240 seconds)
06:57:49*aEverr joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:05:03*gmpreussner joined #nim
07:11:23axion@Variount you on mumble?
07:12:03axion@Varriount *
07:20:26*liblq-dev joined #nim
07:22:29*rnrwashere quit (Remote host closed the connection)
07:23:42FromDiscord<Varriount> Axion: I can get on
07:36:59FromGitter<Vindaar> @voltist: not sure if you're still around, but I just saw your posts and did this: https://gist.github.com/Vindaar/9c32c0676ffddec9078e4c0917861fcd
07:37:08*sagax quit (Remote host closed the connection)
07:45:20*jjido joined #nim
07:47:47*sagax joined #nim
07:51:32*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:54:47*jjido joined #nim
08:05:08*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:08:11YardanicoFinally a worthy first April's joke knome.org
08:08:57*kenran joined #nim
08:09:13*kenran quit (Client Quit)
08:09:34*natrys joined #nim
08:10:07*kenran joined #nim
08:21:57madpropssomething weird happened today. apparently compiling a binary using a specific version of glibc, won't work on systems with an older version of glibc .. which kinda defeats the point of a compiled program
08:28:49PMunchYardanico, haha that's nice
08:39:49*hax-scramper quit (Ping timeout: 264 seconds)
08:40:11livcdmadprops: Nim program?
08:40:13*fanta1 joined #nim
08:43:49madpropsyeah
08:43:49*zslkhmctpfr is now known as cfhklmprstz
08:45:28livcdmadprops: Could you do this? https://scripter.co/nim-deploying-static-binaries/
08:46:52*hax-scramper joined #nim
08:52:29madpropsi migh try that, thanks livcd
08:57:25*dadada joined #nim
08:57:49*dadada is now known as Guest16200
08:58:49livcdthanks kaushalmodi :-)
09:01:23*dwdv joined #nim
09:02:40*hax-scramper quit (Read error: Connection reset by peer)
09:03:50*hax-scramper joined #nim
09:05:15*Vladar joined #nim
09:06:47*rmt joined #nim
09:06:53FromDiscord<Recruit_main707> this guy... XD https://github.com/oakes/vim_cubed
09:08:17*hax-scramper quit (Ping timeout: 256 seconds)
09:08:39rmtembeddable vim for games .. I like it! :)
09:08:54rmtOr boss mode. :)
09:10:00*JustASlacker joined #nim
09:10:07*hax-scramper joined #nim
09:12:35dom96Yardanico: new nimforum will be rolled out when I get the time and will to look at a bug that the new categories have
09:12:44dom96(and fix it of course)
09:18:15PMunchRecruit_main707, maybe that's how I should stream my coding
09:18:36FromDiscord<Recruit_main707> probably ngl
09:18:59PMunchI like the README as well, "How do I stop the cube from spinning?" "No"
09:20:17skrylar[m]so i saw we have an experimental option to make macros that override for loops
09:20:27skrylar[m]and remembered people were asking about tqdm clones
09:21:41PMunchMacros that override for loops?
09:22:05PMunchThis paravim stuff is actually pretty neat
09:23:03*rnrwashere joined #nim
09:26:06*abm joined #nim
09:26:55federico3https://lemire.me/blog/2020/03/31/we-released-simdjson-0-3-the-fastest-json-parser-in-the-world-is-even-better/ we need a fast parser like this in Nim
09:27:43*rnrwashere quit (Ping timeout: 260 seconds)
09:27:46FromDiscord<Recruit_main707> lets just wrap this one :smart:
09:28:02*chemist69 quit (Ping timeout: 246 seconds)
09:28:07*solitudesf quit (Ping timeout: 256 seconds)
09:29:14*chemist69 joined #nim
09:33:05skrylar[m]@PMunch https://nim-lang.org/docs/manual.html#macros-for-loop-macro looks almost made for tqdm lol
09:37:48PMunchHuh, that is actually pretty cool
09:38:11PMunchNot 100% sure what it offers over just an iterator though..
09:38:22PMunchShort of allowing some optimisations
09:42:43*Guest16200 is now known as dadada
09:44:19skrylar[m]eeh well tqdm is a python package that wraps over an iterator to automatically do a progress bar for it
09:44:35dadadawith experimental dotOperators you can't use macros as I noticed while testing https://play.nim-lang.org/#ix=2gdf
09:45:07skrylar[m]basically sugar over having to make the prog bar and update it in a loop, you just `for x in tqdm(whatever you were already looping)`
09:46:00dadadaI had an idea in mind that's not possible with this limitation, wanted to build a special wrapper using this method
09:51:24*NimBot joined #nim
09:51:36skrylar[m]altho if tqdm can't figure out what the length is it just makes it an indeterminate progress bar (still counts iterations per minute)
09:54:10*Mister_Magister joined #nim
09:54:25PMunchSorry for not streaming yesterday by the way.. I procrastinated shovelling snow, and when I finally did it and was done with it it had gotten a bit late..
09:57:03FromDiscord<Varriount> It's fine. I was busy pretty much all day
09:58:41dadadaAraq: would it be possible to add support for macros to work with dotOperators? the thing I've in mind is creating a wrapperobject that uses this to automatically forward all dot operator operations to the wrapped object
09:58:58*couven92 joined #nim
09:59:05AraqI don't know
09:59:36dadadafiar
09:59:39dadadafair
09:59:40Araqexplain the issue in an issue
10:00:01Araqor maybe even in an RFC
10:09:47*wgetch joined #nim
10:11:15*hax-scramper quit (Ping timeout: 250 seconds)
10:18:35*JustASlacker quit (Ping timeout: 260 seconds)
10:27:12PMunchWell I mean this works dadada: https://play.nim-lang.org/#ix=2gdp
10:27:55PMunchI think this might be a regression TBH
10:28:01PMunchI could have sworn that this used to work..
10:28:34PMunchHmm, maybe not
10:28:38PMunchTried with an older version
10:30:11dadadaPMunch: what do you mean? the example 2gdp seems to work, right? Maybe my example is just buggy?
10:30:46PMunchYeah, that works, but try to add a `.` proc that takes a Test and any other type
10:31:43dadadayeah, then I get undeclared identifier y/x
10:34:11*cfhklmprstz is now known as qwertfisch
10:34:15dadadaso the issue is that proc`.` prevents from macro`.` from being considered somewhere in the resolution process
10:35:37PMunchYeah
10:35:44PMunchWhich I think is a bug
10:36:28dadadame too :-)
10:41:20FromGitter<Vindaar> just doing some pandas comparisons over here
10:41:30FromGitter<Vindaar> (https://files.gitter.im/nim-lang/Nim/rJmQ/bench_create_column_openmp.png)
10:41:57FromGitter<Vindaar> ugh, forgot to give that a white background
10:42:26FromDiscord<Rika> hard to read indeed
10:44:45FromGitter<Vindaar> (https://files.gitter.im/nim-lang/Nim/F4Ng/bench_create_column_openmp.png)
10:45:00FromDiscord<Recruit_main707> when are wikipedia stats updated?
10:45:01FromGitter<gogolxdong> How to append sequence safely from threads?
10:45:36FromDiscord<Recruit_main707> Viddaar: is that logaritmic scale?
10:45:48stefantalpalaruIs there a way to access all the C compiler options passed to {.passc: .} from Nim code?
10:46:00FromDiscord<Rika> please choose more distinct colors 😦
10:47:32FromGitter<Vindaar> @Recruit_main707: yup. x axis is 10^label in column size. y is obviously logarithmic
10:47:45Araqgogolxdong: you need a 'SharedSeq'
10:48:13FromGitter<Vindaar> if it wasn't clear "pd_" are pandas benchmarks, "df_" my own
10:48:17FromGitter<gogolxdong> What's that , how to make it?
10:54:58*sleepyqt_ joined #nim
10:56:08*silvernode joined #nim
10:56:41Araqgogolxdong: can you use --gc:arc already?
10:56:42*hax-scramper joined #nim
10:58:52*JustASlacker joined #nim
10:59:56FromDiscord<HutchyBen> Im looking to learn nim what kind of programs does it specialize at making
11:00:21FromDiscord<Recruit_main707> what would you like to do?
11:00:29FromDiscord<Rika> its pretty general
11:00:29FromDiscord<Recruit_main707> nim can do pretty much anything
11:00:42FromDiscord<HutchyBen> oh nice
11:00:56FromDiscord<Recruit_main707> if C can, Nim can, (with more or less effort)
11:01:14FromDiscord<HutchyBen> and c can do almost anything so cool
11:01:45PMunchAnd if JS can, Nim can as well
11:01:57PMunchSo you should be set to create pretty much anything
11:01:59FromDiscord<Recruit_main707> true
11:02:39FromDiscord<Recruit_main707> would the js backend be deprecated if a wasm one was ever created?
11:03:09FromDiscord<Rika> likely not
11:03:16FromDiscord<Rika> is wasm useful for nodejs
11:03:33FromDiscord<Recruit_main707> idk XD
11:07:37FromGitter<lxdong007> not sure about CMP, I am working on another project.
11:09:20PMunchHutchyBen, where did you hear of Nim since you wanted to try it by the way?
11:09:24PMunchJust out of curiosity :)
11:11:06FromGitter<lxdong007> I was about to ask, I noticed there is a shared heap together with arc, I think it's possible to access global varibale from threads with arc. And yes I am using arc. The project I posted is working with arc.
11:11:54PMunchYes, using a shared heap and global variables should be possible with ARC
11:18:59FromGitter<lxdong007> Is shared heap state of art usage of arc? Is there any example?
11:19:20FromGitter<alehander92> https://news.ycombinator.com/item?id=22743267
11:19:35FromGitter<alehander92> nim on hacker news
11:23:48PMunchHaha, didn't realise that repo has so many funny issues as well
11:24:10go|dfishit was #1 on r/programming for most of yesterday too
11:24:54FromDiscord<Rika> its great though
11:25:18PMunchWhat, vim3?
11:27:17FromDiscord<HutchyBen> im trying to set ip vim3
11:27:39FromDiscord<HutchyBen> it cant recognise a dll tho >.<
11:28:12FromGitter<alehander92> rayman22201
11:28:20FromGitter<alehander92> do you plan on providing async executors
11:28:28FromGitter<alehander92> if you guys make an async with state machines
11:28:57livcdi tried to compile parsetoml with arc :-[
11:28:59livcdno luck
11:29:17FromGitter<alehander92> like i dont understand them very well, but i think i would love to have custom async engines
11:29:29FromGitter<alehander92> so one can like customize how async is running for its domain/app
11:29:36FromGitter<alehander92> e.g. https://os.phil-opp.com/async-await/#cooperative-multitasking-1
11:30:05FromGitter<alehander92> (and a custom executor if i am understanding corretly)
11:31:25PMunchHutchyBen, what dll?
11:31:35PMunchlivcd, :( what went wrong with it?
11:32:19liblq-devPMunch, @HutchyBen it's vim³™, not any ordinary vim3
11:32:39PMunchVim³, happy?
11:32:44FromGitter<alehander92> https://blog.yoshuawuyts.com/state-machines/
11:32:56FromGitter<alehander92> araq do you mean this for typestate in rust
11:32:58PMunchJust forgot how to type ³ on this layout
11:33:19FromGitter<alehander92> i imagine you can do it with `requires`
11:33:26FromGitter<alehander92> but no overloading on requires
11:33:47FromGitter<alehander92> i imagined before that one can overload using annotation like that but probably too confusing
11:33:55FromDiscord<Recruit_main707> .b and .a were the equivalent to [0] and [1]?
11:34:00FromGitter<alehander92> and requiring z3 support always
11:35:11PMunch@HutchyBen, in case it didn't highlight you before: What dll is the issue?
11:36:35FromGitter<alehander92> https://github.com/oakes/vim_cubed/issues/22
11:36:38FromGitter<alehander92> i think this one
11:37:22*tane joined #nim
11:39:43FromDiscord<Recruit_main707> this code doesnt compile on 1.1.1 https://play.nim-lang.org/#ix=2gdG
11:39:44PMunchYeah I realised
11:40:36FromDiscord<Recruit_main707> its an issue with the pair.a and pair.b thing
11:40:42FromDiscord<Recruit_main707> has it been changed?
11:41:09FromDiscord<Recruit_main707> (note that someone gave me this code)
11:41:54*silvernode quit (Ping timeout: 240 seconds)
11:44:14PMunchRun likes a charm on Linux this vim³ thing :(
11:44:16PMunch:)*
11:46:12PMunchI like the description in the .nimble file. Vim for masochists
11:51:14livcdPMunch: something with deep copy :O
11:51:23livcdPMunch: sorry I have not really investigated more as I did not need arc
11:51:39jkenThat forum post about rewriting in python got me :D
11:52:04*hax-scramper quit (Ping timeout: 256 seconds)
11:52:31*couven92 quit (Read error: Connection reset by peer)
11:52:36PMunchjken, link?
11:52:55*couven92 joined #nim
11:53:04jkenhttps://forum.nim-lang.org/t/6136
11:55:10PMunchOh man
11:55:31PMunchThrowing shade on Python/C hybrid projects as well, nice :P
12:02:58*rokups joined #nim
12:04:11*vycb[m] joined #nim
12:05:04*hax-scramper joined #nim
12:08:35FromDiscord<djazz> I for one welcome our (C)Python overlords!
12:12:20*Vladar quit (Quit: Leaving)
12:14:49FromDiscord<Recruit_main707> this almost got me lol.
12:14:51FromDiscord<Recruit_main707> i was like, wtf have they done!
12:15:06PMunchHaha :P
12:15:22narimiran:)
12:16:21AraqXD
12:16:44Araqand I thought I could have been more subtle
12:17:25federico3Araq: perhaps by suggesting pypy
12:17:54*dddddd joined #nim
12:23:04*dadada quit (Ping timeout: 256 seconds)
12:24:24*rockcavera joined #nim
12:24:34dom96finally an april fool's joke
12:24:39*dadada joined #nim
12:24:40dom96took us long enough :)
12:24:59FromDiscord<Recruit_main707> have yall searched Bing in Google yet?
12:25:03*dadada is now known as Guest5205
12:26:40dom96narimiran, your tweet could have been much shorter and much more click baity
12:26:54dom96"Big announcement: we're rewriting Nim in Python"
12:27:03PMunchWhat does "./koch boot -d:release" actually do?
12:27:19narimirandom96: eh, probably, but i find that too click-baity and less-believeable
12:27:43PMunchRecruit_main707, anything supposed to happen?
12:27:46narimiranPMunch: is this a start of some joke?
12:27:51PMunchHaha, nope
12:28:13PMunchSomeone on HN asked how fast Nim was at compiling
12:28:18FromDiscord<Recruit_main707> PMuch: internet prank to google
12:28:23PMunchI thought I'd cite him how fast it compiled Nim
12:28:48narimiranPMunch: it bootstraps the compiler, but it takes several iterations to do that
12:28:59narimiranmaybe `koch temp` would be better to use as an example?
12:29:27dom96narimiran, it's just the tweet doesn't even say that Nim will be rewritten in Python
12:29:37dom96the forum thread even says that
12:30:25PMunchnarimiran, yeah that's what I was wondering
12:33:19*krux02_ is now known as krux02
12:34:06FromGitter<alehander92> i honestly often do nim -d:release compiler/nim.nim
12:34:10FromGitter<alehander92> with some other flags
12:38:36AraqIMHO 'koch boot' should now default to -d:release
12:39:32*rockcavera quit (Remote host closed the connection)
12:39:32AraqI use 'koch temp' when I'm after stack traces
12:45:34FromDiscord<Recruit_main707> so koch is used to build your local nim compiler in case you edit it?
12:50:42*nsf quit (Quit: WeeChat 2.7)
13:08:11*waleee-cl joined #nim
13:08:44*sunwukong joined #nim
13:11:09liblq-devam I the only one who strongly prefers `import module for a, b, c` instead of `from module import a, b, c`?
13:11:26liblq-devI first saw that in Wren and imo it's a shame that Nim doesn't have a syntax like this
13:12:37liblq-devthe thing that pisses me off with `from x import y` is that it doesn't line up with other imports
13:14:00FromGitter<gogolxdong> createShared, resizeShared,freeShared
13:14:04FromDiscord<mratsim> Python does the same
13:16:40liblq-devI have to fix that in rod :P
13:16:50liblq-devwhen I get to imports, of course.
13:17:11liblq-devright now I'm burnt out after my battle with generics
13:19:18Araqliblq-dev: it's a good point, 'from x import y' is inferior
13:20:08liblq-devin my eyes it just looks bad next to my other imports
13:20:19liblq-devthat's why I avoid using it
13:20:45liblq-devI can always reference the module explicitly anyways
13:25:33PMunchliblq-dev, that syntax is actually pretty nice
13:25:40liblq-devwhich one?
13:26:04PMunchThe `import module for a, b, c`
13:26:27*lritter joined #nim
13:27:12liblq-devyeah, and it doesn't waste another keyword, it just reuses `for`
13:32:42*Vladar joined #nim
13:40:25FromGitter<alehander92> Araq
13:40:31FromGitter<alehander92> i am working on the sourcemap PR
13:40:51FromGitter<alehander92> from an old comment of yours, i see i shouldn't use a command for it (i guess its for when compileOp)
13:41:06FromGitter<alehander92> it still doesnt make sense to use one right, just a option flag
13:41:48Araqoption flag seems fine or attach it to the existing --debuginfo flag
13:43:21FromGitter<alehander92> can i reserve a separate sourcemap one? seems useful if we add different options or even different kinds of sourcemaps one day
13:45:01Araqplease don't, the proliferation of flags and options is killing me
13:46:16FromGitter<alehander92> well then it can be just `--sourcemap:on/off` : if one has a sourcemap for e.g. C<->nim in the future, it can be reused
13:46:23FromGitter<alehander92> ok
13:56:18PMunchHmm, I wonder if I can take an ASCII art generator and feed it Vim³ so I can run it in my terminal..
14:02:10FromGitter<alehander92> Araq, one more thing : should it be `sourcemap` `source-map` or `source_map` in options/flag and `Sourcemap` or `SourceMap` in code
14:04:01FromGitter<alehander92> guys what do you think of https://sulami.github.io/posts/common-lisp-restarts/
14:05:42FromDiscord<Kiloneie> why is sleep() an unknown identifier for me ?
14:06:04FromGitter<alehander92> import os ?
14:06:10FromDiscord<Kiloneie> ooh
14:06:15FromDiscord<Kiloneie> ups
14:06:31FromGitter<alehander92> you're still sleeping :)
14:06:33FromDiscord<Kiloneie> forgot os is not default imported
14:06:42FromDiscord<Kiloneie> i thought it was for some reason
14:06:59FromGitter<alehander92> yeah, you can write your own `common` file
14:07:05FromGitter<alehander92> to import if you usually use the same imports
14:07:13FromGitter<alehander92> which exports such imports
14:07:18FromGitter<alehander92> e.g. `import os ... export os `
14:07:48FromDiscord<Kiloneie> nice trick okay
14:08:01FromGitter<alehander92> i think local people call it prelude
14:08:07FromGitter<alehander92> e.g. i think karax had it
14:08:21FromGitter<alehander92> but not sure overally
14:08:26dom96Nim has it
14:08:27FromDiscord<Kiloneie> im just, play 2 games, make a program(which i can then use for my planned playlist of How to X program or something like that...)
14:08:29dom96include prelude
14:08:50FromDiscord<Kiloneie> i think people would like that idk, probably help with some examples for the docs
14:09:06Araqalehander92: the style says sourceMap
14:09:09FromDiscord<Kiloneie> which are quite empty in some modules
14:09:22FromGitter<alehander92> Araq ok, but my question is because
14:09:32FromGitter<alehander92> all the flags seem to use lowercase
14:09:37FromGitter<alehander92> e.g. nilcheck
14:10:02FromGitter<alehander92> nilseqs etc
14:10:31FromGitter<alehander92> dom96 but import prelude would be better, right
14:11:06FromGitter<alehander92> as one can just export from prelude: i just try to use `import` if i can, but in this case i agree probably it's ok
14:11:54dom96sure, but IIRC you cannot export modules
14:12:49FromGitter<alehander92> you can
14:16:46*fanta1 quit (Quit: fanta1)
14:23:32*endragor quit (Remote host closed the connection)
14:33:46*solitudesf joined #nim
14:33:48FromGitter<mratsim> @Araq @Andrewrk: were is the joined April’s Fool? https://github.com/nim-lang/Nim/pull/13757
14:33:56FromGitter<mratsim> where*
14:34:09*dinu99 joined #nim
14:43:31*endragor joined #nim
14:48:09*endragor quit (Ping timeout: 265 seconds)
14:54:18*PMunch quit (Ping timeout: 256 seconds)
15:01:16Yardanico@mratsim something like "We decided to combine Zig and Nim into one programming language which'll be the best"?
15:02:33FromGitter<mratsim> called Zim
15:03:42YardanicoZim name is already taken :P https://en.wikipedia.org/wiki/Zim_(software)
15:03:57FromGitter<mratsim> doesn’t matter, Nig is a bit awkward
15:04:02Yardanicooof
15:04:04FromGitter<mratsim> and it’s only for a day
15:04:13narimiranYardanico: i use Zim, btw
15:04:31FromGitter<deech> https://animesuperhero.com/wp-content/uploads/2017/04/invader_zim_render_by_neonstartapeinvasion-d9m3yz6.png
15:05:42*liblq-dev quit (Ping timeout: 256 seconds)
15:05:59FromGitter<alehander92> dont like 1 april jokes, but i'd like some zig features
15:06:00FromGitter<alehander92> :D
15:06:08Yardanicome too *hides*
15:07:20dom96Zimrod :D
15:09:36*PMunch joined #nim
15:09:59*sentreen_ quit (Read error: Connection reset by peer)
15:10:43*sentreen_ joined #nim
15:12:34*SunDwarf quit (Ping timeout: 240 seconds)
15:12:59FromGitter<alehander92> yardanico dont hide
15:13:13FromGitter<alehander92> the borders are closed anyway, Araq can't fight us :D
15:16:36*deepend_ is now known as depepend
15:16:42*depepend is now known as deepend
15:17:05*SunDwarf joined #nim
15:17:23FromGitter<mratsim> Zigrod :p
15:17:55FromGitter<alehander92> guys
15:18:01FromGitter<alehander92> do we have nim syntax support in chrome
15:18:26*Vladar quit (Remote host closed the connection)
15:18:44FromGitter<alehander92> sorry i got confused , we dont :D
15:19:41Yardanicowdym in chrome? like an extension?
15:22:22FromGitter<alehander92> in developer console
15:27:59*dinu99 quit (Remote host closed the connection)
15:29:18*filcuc joined #nim
15:37:23FromGitter<rishavs> How can I add new items to a set? ⏎ ⏎ ``` var walledDoors: set[Directions] ⏎ walledDoors.add(West)``` [https://gitter.im/nim-lang/Nim?at=5e84b533a61b811a4f7528ed]
15:37:54*kenran quit (Ping timeout: 240 seconds)
15:38:14FromGitter<Yardanico> maybe you want HashSet, not the built-in "set" type?
15:38:34FromGitter<Yardanico> check out https://nim-lang.org/docs/sets.html
15:42:20FromGitter<rishavs> the way the document is written is pretty confusing but I want the mathematical sets, where I only have unique values
15:42:47narimiranuse `incl`, not `add`
15:42:52narimirana.k.a. read the docs
15:43:49FromGitter<rishavs> aye. found it. :D
15:44:12FromGitter<rishavs> Thanks
15:44:19*Vladar joined #nim
15:51:43*JustASlacker quit (Quit: Leaving)
15:54:01*couven92 quit (Ping timeout: 250 seconds)
15:54:24*rokups quit (Quit: Connection closed for inactivity)
15:59:26*sunwukong quit (Quit: Leaving)
16:02:28*liblq-dev joined #nim
16:11:08rayman22201alehander92: just waking up. You pinged me?
16:12:24rayman22201We have custom async executors already. We call it "the event loop". See httpbeast for an example of a custom one.
16:14:47FromGitter<zetashift> Is there a scenario where you would use sets and not HashSets?
16:15:04FromGitter<zetashift> ah nvm it's right under there, sets are used for bit flags
16:15:40leorizethat's the C FFI use case
16:15:54leorizethough it's used for writing flags in Nim too :P
16:16:24*abm quit (Quit: Leaving)
16:28:15FromGitter<zetashift> leorize do you even sleep
16:28:35leorizemaybe :)
16:32:14*inv2004 joined #nim
16:33:04inv2004Hello, are there any way to write in script-style, but with async?
16:33:21leorizescript-style?
16:33:38inv2004I mean that I do not want to define main() {.async.}, but still want to use async.
16:34:02leorizeI don't think you should/can
16:34:10leorizedo you have an example usecase in mind?
16:35:48inv2004@leorize, it is quite simple - if you use nim like bash - you do not want to define functions without reasons
16:36:18FromGitter<kayabaNerve> JS has has this debate for a long time. The problem with doing it at the top-level, in Nim, is you'd need to transform the file itself.
16:36:39FromGitter<kayabaNerve> File-wide macros aren't a thing unless you put the entire file in a block. Araq hates the idea, although I personally like it.
16:37:02FromGitter<kayabaNerve> And as the Nim filter system goes line by line, you can't replace line endings with `\r\n ` and compensate.
16:37:46inv2004@leorize, probably you can write just two lines: let resp = await client.request; let data = await resp.body(); echo data.parseJson().pretty. but defining waitFor main() would add two more lines :)
16:38:05FromGitter<kayabaNerve> If you're going to put the entire file in a block just so you don't have to define `proc main() {.async.}; waitFor main()`... why
16:38:40FromGitter<kayabaNerve> But I mean, hey, if you want to write a macro `asyncMain:` to expand to those two statements, go ahead.
16:39:16leorizeinv2004: or you can write it like this: let resp = waitFor client.request; let data = waitFor resp.body() :p
16:39:22dom96yeah, you can't
16:39:31dom96but if you're writing scripts, why even use async?
16:39:55inv2004@dom96, good question - I did not think about it, because I can :)
16:41:23dom96lol
16:41:24inv2004@leorize, nice idea, thank you!
16:41:39dom96well if the amount of typing bothers you, just don't use it
16:42:44*inv2004 quit (Quit: Leaving)
16:46:12*filcuc quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/)
16:48:10*jjido joined #nim
16:48:37*xet7 quit (Remote host closed the connection)
16:50:22*xet7 joined #nim
16:52:30leorize\o/ macros in typedef is now a thing
16:56:30FromDiscord<Benumbed> *sigh* I just spent the last hour slamming my head on an issue that turned out to be StringStream taking `0XCE` and treating it as 32b instead of 8b
16:57:21FromDiscord<Benumbed> I'm sure that makese sense at some point, but I haven't slept and omg did that throw me for a loop
16:58:17leorizeyea you should sleep :)
16:58:18FromDiscord<Benumbed> Esp since the `0xCE` was the termination byte for a network frame, and so the server would then try to read the next 7 bytes and pitch a fit about how everything was zero
16:58:31*inv2004 joined #nim
16:58:47FromDiscord<Benumbed> I sat there staring at Wireshark thinking I'd lost it
16:58:50*inv2004 quit (Client Quit)
16:58:53*zacharycarter joined #nim
16:59:02FromDiscord<Benumbed> I would sleep if I could, bad insomnia for the last 3 days 😦
16:59:07*inv2004 joined #nim
17:00:17leorizenot looking at the screen is a good way to change that :)
17:02:14FromGitter<geotre> Are there any libraries for async/await on js backend (apart from asyncjs) ?
17:03:55FromDiscord<Benumbed> leorize: I went to bed at 2am as usual and laid there until 5am, no lights, no screens
17:04:04FromDiscord<Benumbed> just brain that won't sleep
17:05:19leorizethat doesn't sound good :(
17:05:44FromDiscord<Benumbed> Story of my life, haha
17:05:57leorizewell go see a doctor I suppose :)
17:06:09FromDiscord<Benumbed> I have, multiple times
17:06:18FromDiscord<Benumbed> Oh and sleep aids generally don't work on me
17:06:47FromDiscord<Benumbed> My doctor calls me 'an interesting anomaly'
17:08:42FromGitter<kayabaNerve> Is there a way I can force a ref to be freed?
17:09:02leorizekayabaNerve: yes, but no
17:09:22FromGitter<kayabaNerve> I didn't think so outside of reference count manip
17:09:56leorizewell the idea of the GC is that you don't do this kind of "forcing free"
17:10:25leorizebut if it's the last reference (ie. not referenced elsewhere by anything)
17:10:33leorizeset the ref to nil, then run GC_fullCollect()
17:10:46leorize(please never do that in real programs)
17:11:43leorizethe memory held by the ref might be freed
17:12:24leorizethough any finalizer will still be called if it's not freed
17:13:41leorizemight be freed because the GC can and does keep a pool of small memory segments
17:14:09leorizeit will accumulate the "freed" memory for a big free()
17:14:16leorizeand can also reuse them irrc
17:14:18leorizeiirc*
17:15:54FromGitter<kayabaNerve> leorize: I'm creating duplicates of 512 MB objects somehow, despite using refs, and need to clear them in my tests
17:16:34FromDiscord<Recruit_main707> how can i pass a function to a template/macro, and get the name of that function?
17:17:10leorizeRecruit_main707: wdym by passing a function? like this? `macro(foo)`
17:17:23FromDiscord<Recruit_main707> yes
17:17:30leorizethen the node will depend on the type of the param
17:17:56FromDiscord<Recruit_main707> the param is the function?
17:18:05leorizeif it's a typed, then it'll resolve into an nnkSymbol. You can use it directly for any expression since it'd be solved
17:18:14leorizegetting the name is as simple as .strVal :)
17:18:26leorizeif it's an indent, well kinda same story :P
17:19:04leorizekayabaNerve: refc is not really deterministic
17:19:14leorizeyou'd really want arc for that
17:21:41FromDiscord<Recruit_main707> leorize i didnt understand a shit, sorry, let me show you my code so that i can understand: https://play.nim-lang.org/#ix=2gg4
17:21:41FromDiscord<Recruit_main707> its a very specific problem, it will be shorter if you dont ask why i do it ;)
17:24:06leorizehttps://play.nim-lang.org/#ix=2gg7
17:24:18leorizethe magic of emit :)
17:24:53*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:26:02FromDiscord<Recruit_main707> lmao, i didnt know about those XD
17:26:05FromDiscord<Recruit_main707> thanks
17:26:26leorizehttps://play.nim-lang.org/#ix=2gg9
17:26:27FromDiscord<Varriount> Hm. Araq, how do other languages handle the aliasing situations that the Nim spec currently says are not allowed?
17:26:37leorizeand here's the macro version if you'd like to know how to get the name
17:27:28FromDiscord<Recruit_main707> lovely, thank you very much, i am finally seeing the potential of metaprogramming.
17:29:11*rockcavera joined #nim
17:36:37FromGitter<kayabaNerve> I think I found the problem. I'm defining the types as: ⏎ ⏎ ```X {.importc: "x", header: "x.h", incompleteStruct.} = object ⏎ Y* = ptr X``` ⏎ ⏎ When Nim clears the wrapper ref object, the pointer isn't properly deallocated. [https://gitter.im/nim-lang/Nim?at=5e84d12461967448380eedf4]
17:37:11FromGitter<kayabaNerve> That's my theory at least, given that I'm setting the wrapper ref to nil and calling GC_fullCollect() to no effect.
17:37:44*Trustable joined #nim
17:38:08*couven92 joined #nim
17:38:38*rnrwashere joined #nim
17:41:04leorizedo you have a finalizer to deallocate the pointer?
17:41:08FromGitter<kayabaNerve> Though I'm not entirely sure how to check that. I guess register a destructor for the ref?
17:41:20FromGitter<kayabaNerve> ... nope. Nim won't do it automatically either.
17:41:22FromGitter<kayabaNerve> That's my fault.
17:41:25FromGitter<kayabaNerve> Thanks.
17:41:56leorizeyou can write a destructor and it'll be transformed into a finalizer automagically
17:42:41FromGitter<kayabaNerve> Yep
17:48:00*solitudesf- joined #nim
17:49:44shashlickAraq: curious why proc pragmas are at a different place in the AST compared to types
17:50:12*solitudesf quit (Ping timeout: 256 seconds)
17:50:44leorizefinally I can make my `ctype` macro and it wouldn't look weird :)
17:51:41zacharycarterdoes anyone use kakoune with Nim?
17:59:50*rnrwashere quit ()
18:03:34solitudesf-yes
18:04:10zacharycarterNice! Do you use the kak plugin system?
18:04:27zacharycarterplug.kak or whatever?
18:04:33solitudesf-nope
18:05:03zacharycarterah okay - I have the LSP plugin and just added Nim to the list of languages to set options for, but I have a feeling I'm going to need to do more configuration to get it to work
18:05:36solitudesf-you dont need plug.kak for that
18:06:40solitudesf-only thing needed is to do launch kak-lsp and run lsp-enable
18:06:58zacharycarterokay I'm doing that - so hopefully it's just working already and I'm unaware :)
18:07:55rayman22201Hey zacharycarter. Been a while since we've seen you on irc. Hope all is well!
18:08:14solitudesf-there is lsp-capabilities command to check if its working
18:11:21zacharycarterI'll try that, thanks
18:11:37zacharycarterHey rayman22201: Thanks! All is good, just getting settled into my new digs in Austin
18:11:55rayman22201nice! great timing lol
18:12:10zacharycarterHaha yeah! Just in time to really really settle into them
18:12:36zacharycarterhope you are doing well too!
18:12:57FromGitter<zetashift> great to see you again zachary :D
18:13:25zacharycarterHi zetashift! Likewise!
18:20:41FromGitter<alehander92> zacharycarter how are youu
18:20:57FromGitter<alehander92> rayman22201 so hm
18:22:04FromGitter<alehander92> i need to write a custom async module? i think sometimes tweaking how async macro works is also needed, but maybe thats too much
18:24:41*inv2004 quit (Ping timeout: 265 seconds)
18:25:47*inv2004 joined #nim
18:29:10*kenran joined #nim
18:33:17rayman22201alehander92 sorry. I need more context. what are you trying to do?
18:33:31rayman22201I only half read your ping when I woke up lol
18:35:40*rayman22201 sometimes feels like I'm the only one who sleeps around here lol
18:36:23FromGitter<alehander92> well i just read about https://os.phil-opp.com/async-await/#cooperative-multitasking-1 implementation a bit :D
18:36:59FromGitter<alehander92> but honestly just the idea to write custom ways that futures are executed with seems useful, but you're right this might be already possible here
18:37:09FromGitter<alehander92> ah here it is evening
18:38:37*Vladar quit (Remote host closed the connection)
18:38:54*inv2004 quit (Ping timeout: 240 seconds)