<< 20-02-2020 >>

00:13:13*tefter joined #nim
00:38:37*ng0 joined #nim
00:44:30*ng0 quit (Quit: ZNC 1.7.2+deb3 - https://znc.in)
00:47:01*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:50:15*rhenvar joined #nim
00:50:22rhenvarHello guys
00:50:38rhenvaranyone have experience building nim shared libraries w docker?
01:04:45*couven92 quit (Ping timeout: 240 seconds)
01:05:32FromDiscord<Rika> disruptek how else would I edit nodes other than with []?
01:05:40FromDiscord<Rika> And quote do
01:34:16FromGitter<Varriount> rhenvar: Do you mean, using Docker as a build environment, or building container images containing shared libraries?
02:15:32*chemist69 quit (Ping timeout: 248 seconds)
02:17:33*chemist69 joined #nim
02:32:34*casaca quit (Quit: leaving)
02:54:40disruptekrika: the point is that [3] imparts zero knowledge to the reader.
02:55:27disrupteksadly, /i/ am that clueless reader.
02:57:32disrupteka comment or two would be sufficient.
02:58:07disruptekmy openapi codegen is 1400 lines of macro crap and i cannot find a single case where i index a nimnode.
02:58:24disrupteki guess it's not a requirement, just a choice that another programmer foists upon us.
02:59:34FromDiscord<Elegant Beef> Just for clarity sake, what's the alternative?
03:09:55disruptekit varies.
03:11:09disrupteknot sure what it was i was looking at because, of course, it was just a random deref.
03:12:37disruptekbut, you could iterate, findChild, expect*, hasArgOfName, or write your own op.
03:20:02FromDiscord<Rika> I see
03:24:45leorizeis it possible to estimate the amount of bits needed for a multiplication?
03:25:13disrupteki would assume so.
03:25:27disruptekcertainly it's possible for some operations.
03:25:39disruptekeg. 2*n 😉
03:26:09leorizeyea except my problem is x * 5 ^ y :)
03:26:20disruptekyeah, those damned 5s.
03:26:46leorizeI'll just plug in the biggest boundary for x and y to wolfram alpha and get the bit count from there
03:27:34leorizeI'd certainly want a formula to estimate the bit count though
03:27:41disrupteki would just look up the work on the subject. i really don't think it should be hard.
03:28:09*muffindrake quit (Ping timeout: 272 seconds)
03:28:32FromDiscord<Elegant Beef> My enum generation works but it's happening ina manner that makes the compiler angry
03:28:41FromDiscord<Elegant Beef> Im glad im dull
03:29:08disruptekme too. i don't think i could handle being upstaged by a canuck.
03:29:48*muffindrake joined #nim
03:30:31FromDiscord<Elegant Beef> lol
03:31:10FromDiscord<Elegant Beef> because of the way i have this i basically have to compile components then the base component class then everything else
03:31:19FromDiscord<Elegant Beef> But i feel like that's just me being daft
03:31:39FromDiscord<Elegant Beef> base component file*
03:31:53disruptekwell, i won't tell if you don't.
03:32:22*skrylar joined #nim
03:32:24skrylarahoy
03:32:33FromDiscord<Elegant Beef> Well as much as i like cheeky comments, sadly they dont help 😄
03:32:59disruptekno one cares which order you put your socks on, as long as you put your shoes on last.
03:33:20FromDiscord<Elegant Beef> *Is this an implication you can actually control the compile order, and it's not silly?
03:33:21FromDiscord<Elegant Beef> *Is this an implication you can actually control the compile order, and it's not silly?*
03:33:29disrupteknope.
03:33:56disruptekbut if you hold your laptop closer to the router, i'd be happy to try.
03:34:11FromDiscord<Elegant Beef> Damn i dont have a laptop
03:34:20disruptekmaybe some other time, then.
03:35:27FromDiscord<Elegant Beef> so atm i call a macro on my sub components that subscribe them, then call another macro that makes the actual enum off these, that works fine but enforces a compile order
03:35:33*Prestige quit (Quit: Prestige)
03:36:07disruptekgood; otherwise, it wouldn't work.
03:41:00skrylarissues with compile orders?
03:41:19FromDiscord<Elegant Beef> Well i reference the created enum in other files and it cant find it
03:41:52FromDiscord<Elegant Beef> Because some files that rely on this compile before it is created
03:42:04*rockcavera quit (Remote host closed the connection)
03:42:24skrylarthat should only happen if you are not importing modules correctly or the macro is actually creating the enum privately (ex. foo instead of foo*)
03:42:57FromDiscord<Elegant Beef> Well the enum is created in a macro
03:43:15skrylarthat is fine, have you tried dumping the AST to make sure its creating a published enum though?
03:43:23FromDiscord<Elegant Beef> Yea it works in another file
03:46:45skrylaroh. trying to do component registration at compile time
03:47:42FromDiscord<Elegant Beef> Yea im trying to make an enum/LUT for runtime
03:47:53skrylaryea i'm not sure i would try to get the macro system to do that tbh
03:49:15skrylarwhen its done at runtime theres a chance to run the module initializers regardless of the actual compile order (which is how a lot of the c++ ones do it, afaik) to do it at compile time does require you to explicitly list them "somewhere" although there are some tricks
03:49:50FromDiscord<Elegant Beef> You can generate types at runtime? 😄
03:50:06skrylarnot really
03:50:21skrylarbut you're trying to use a hard wired method which necessarily means hard wiring some parts
03:50:33FromDiscord<Elegant Beef> Well i had an int generation setup before
03:50:49FromDiscord<Elegant Beef> that worked fine but not using *proper* bitflags
03:53:16skrylaryou can read text files and run programs during nim builds so you could have it read a list of types to hard wire in one file
03:53:46skrylaralthough tbh i would just generate the file the old way from a script for that
03:54:20FromDiscord<Elegant Beef> Well i mean i had a bit op based array of int32s before
03:54:32FromDiscord<Elegant Beef> Well i mean i had a array of int32s before for components
03:54:51FromDiscord<Elegant Beef> i'd just add a `exposeComponent(Type)`
03:54:59FromDiscord<Elegant Beef> and it'd instantly be added and i'd have data buckets
03:55:52FromDiscord<Elegant Beef> Ill probably just revert my changes
03:56:15FromDiscord<Elegant Beef> Comeback to this later
03:56:25skrylarokies
03:56:47FromDiscord<Elegant Beef> *how happy im i decided to use git for this* 😄
03:58:31skrylarslowly shoring up a janet wrapper on this end
03:58:40skrylarthen back to gtk/gdk, bleh
03:58:51*Cube30 joined #nim
04:03:18leorizedisruptek: turns out you can just sum up the amount of bits of every single components in the multiplication
04:04:12leorizetook me longer than expected to even reach step 3 of the "basic" converter
04:04:28leorizeit sure looked short on the paper
04:14:37rhenvarVarriount: Using nim in an intermediary build stage in docker to produce a shared library to be used in another build stage
04:24:27*nsf joined #nim
04:26:37rhenvarboth alpine linux images
04:27:15*Cube30 quit (Remote host closed the connection)
04:30:09leorizewhat problem are you running into?
04:37:21FromDiscord<Elegant Beef> so i know i was suggested to use this <https://github.com/zacharycarter/bgfx.nim> but im curious if anyone here's used it, cause i built bgfx, moved it to my /lib/ folder and the project folder, no cigar
04:37:48FromDiscord<Elegant Beef> Still complains about the build library
04:41:50FromGitter<Varriount> rhenvar: What problem are you having? Are you passing in compiler options to build a shared library?
04:44:50*hax-scramper quit (Ping timeout: 240 seconds)
04:47:32*LER0ever quit (Remote host closed the connection)
04:50:17*hax-scramper joined #nim
04:51:53*LER0ever joined #nim
04:54:31*hax-scramper quit (Read error: Connection reset by peer)
04:54:57*hax-scramper joined #nim
04:55:19*my_dude quit (Ping timeout: 260 seconds)
05:17:13*FromDiscord_ joined #nim
05:17:16*FromDiscord quit (Remote host closed the connection)
05:23:05*hax-scramper quit (Read error: Connection reset by peer)
05:23:14*hax-scramper joined #nim
05:34:31*hax-scramper quit (Read error: Connection reset by peer)
05:35:39*hax-scramper joined #nim
05:47:01*NimBot joined #nim
06:03:46*ptdel quit (Ping timeout: 240 seconds)
06:11:06*hax-scramper quit (Read error: Connection reset by peer)
06:11:22*hax-scramper joined #nim
06:12:47*narimiran joined #nim
06:16:36*marmotini_ joined #nim
06:22:01*hoijui joined #nim
06:26:06FromGitter<xflywind> Why when I use varargs[(string, string)] as macro parameters, the compiler crashed instead of informing me that varargs[(string, string)] can't appear in macro parameters?
06:36:31FromGitter<xflywind> When I use seq[(string, string)] or use proc version, all is right. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e4e28ef8b2d4664ef12ac96]
06:37:24*dddddd quit (Ping timeout: 248 seconds)
06:41:48*lritter joined #nim
07:17:32*marmotini_ quit (Remote host closed the connection)
07:17:42rhenvarVarriount: Correct - I'm adding options --app:lib to build a shared library for the first stage, but i'm trying to use the .so in the second stage but it doesn't recognize some of the exported functions for some reason
07:18:05*marmotini_ joined #nim
07:19:48rhenvarVarriount: for more context, I'm trying to use https://github.com/Taymindis/nginx-link-function with a nim built shared library, but it can't read the init function. It works on bare metal but not docker
07:21:05*marmotini_ quit (Read error: Connection reset by peer)
07:21:05rhenvarVarriount: nm and objdump within the container both show the expected functions labeled 'T'
07:21:17*marmotini_ joined #nim
07:32:18*solitudesf joined #nim
07:44:40*sigmapie8 joined #nim
07:54:41FromGitter<Varriount> rhenvar: Can you share the source code?
07:56:12FromGitter<Varriount> You have to use the dynlib and cdecl pragmas to export procedures, as well as possible build the runtime DLL depending on what gc you're using
07:58:37leorizeyou don't need the runtime dll if you don't share memory between Nim heaps
07:58:52leorizeheaps from different Nim dlls
08:00:00*gmpreussner quit (Quit: kthxbye)
08:05:00*gmpreussner joined #nim
08:12:58*endragor joined #nim
08:33:55*Vladar joined #nim
08:39:47*solitudesf quit (Ping timeout: 260 seconds)
08:48:27*kaputt is now known as qwertfisch
08:49:27vegaiis there some rationale(!) for making rationals not be the default non-whole numbers?
08:49:36vegaiI'm kinda missing that from various lisps ;/
08:50:08vegaiI know of the rationals lib, just wondering about the defaults
08:53:06skrylarthe docker talk reminds me i need to bother some folk since i emailed that nim patch to the listed maintainer and they seem to be asleep at the wheel after a week or two... courtesy periods over, probably time to go around them ^^;
08:53:49skrylaralso i'm not sure about the rationals; are they substantively different from floats?
08:55:19skrylar(i know sometimes doing the 'more correct thing' by default can get your language dinged; ex. Pharo will actually treat 1/4 as a request for a Fraction object which gives you correct math but makes the math slow and then you have to explain to everyone who walks by how to get the faster math people *usually* want but i dunno if that applies here)
08:55:47vegaidocker talk?
08:55:58skrylarearlier in chat
08:55:59vegaiskrylar: yeah, they are
08:56:10vegaiI'll get over it :) like I said, I just miss that default from the lisps
08:56:35vegaipossibly lisps are the only ones who do that though
08:57:02skrylarno, squeak/pharo will do rationa/fractions if you divide integers and floats if you divide floats
08:57:41vegaiat least nim doesn't do what python2 did by default :)
08:57:44vegai1/2 => 0
08:57:52skrylari really do like (declaim) style blocks or dialecting (red, janet, vaguely Ring) for this kind of thing, but ... meh
08:59:18skrylaradmittedly if you want to do macro legwork you can use the block parameter notation to have it intercept math and replace it with the more precise constructors
08:59:48skrylarwell just the constants would have to be ast patched
09:00:14skrylarheading off for now though
09:00:15*skrylar quit (Quit: WeeChat 2.7)
09:02:42*marmotini_ quit (Remote host closed the connection)
09:03:15*marmotini_ joined #nim
09:07:54*marmotini_ quit (Ping timeout: 258 seconds)
09:17:51*LER0ever quit (Remote host closed the connection)
09:18:16*marmotini_ joined #nim
09:20:31*LER0ever joined #nim
09:21:54*marmotini_ quit (Remote host closed the connection)
09:35:08FromDiscord_<clyybber> Araq: Regarding sup, the varargs[untyped] think doesn't work for block syntax
09:35:24*sigmapie8 quit (Quit: Leaving)
09:39:51*floppydh joined #nim
09:42:18*xd joined #nim
09:42:37*xd quit (Remote host closed the connection)
09:54:48*rokups joined #nim
09:58:22*couven92 joined #nim
10:16:52*Vladar quit (Remote host closed the connection)
10:17:14*Vladar joined #nim
10:35:17*couven92 quit (Read error: Connection reset by peer)
10:35:43*couven92 joined #nim
11:05:01*oculuxe joined #nim
11:07:07*oculux quit (Ping timeout: 240 seconds)
11:08:02*mipri joined #nim
11:10:45FromDiscord_<sveri> Araq: Hi, I have been looking into adding attributes to htmlgen an it's indeed easy. I just wonder, data-* are attributes that are user defined, so, there is an endless stream of possible attributes and I don't think it makes sense to add them statically to the source code.
11:10:45FromDiscord_<sveri> Is there a way to allow everything that starts with `data-`?
11:11:08*mipri left #nim (#nim)
11:12:25FromDiscord_<sveri> Or should I create a bug report for this discussion?
11:15:34*endragor quit (Remote host closed the connection)
11:16:35*endragor joined #nim
11:16:39*gangstacat quit (Quit: Ĝis!)
11:18:05*chemist69 quit (Ping timeout: 272 seconds)
11:18:33*chemist69 joined #nim
11:23:02*gangstacat joined #nim
12:02:36FromDiscord_<sveri> I created this bug report: https://github.com/nim-lang/Nim/issues/13444
12:02:38disbothtmlgen does not support `data-*` attributes ; snippet at 12https://play.nim-lang.org/#ix=2cdc
12:05:17*glassofethanol joined #nim
12:05:31*glassofethanol quit (Client Quit)
12:11:52*rockcavera joined #nim
12:13:02*Kaivo joined #nim
12:14:14*rokups quit (Quit: Connection closed for inactivity)
12:57:44*nsf quit (Quit: WeeChat 2.7)
13:10:01*dddddd joined #nim
13:10:20*endragor quit (Remote host closed the connection)
13:34:31*solitudesf joined #nim
13:36:16*dadada joined #nim
13:37:16dadadachoosenim devel , Downloading C Sources from GitHub, currently at 81mb and climbing, is this considered normal?
13:39:53FromDiscord_<clyybber> I think so, yeah
13:47:08*xet7 quit (Remote host closed the connection)
13:48:07*Vladar quit (Quit: Leaving)
13:48:20*xet7 joined #nim
13:51:03*krux02 joined #nim
13:58:55shashlickdadada: latest choosenim will delete the folder after bootstrap to save you space
14:11:17*zickzackv joined #nim
14:22:51*nsf joined #nim
14:27:04FromDiscord_<mratsim> Rust and most LLVM based project sit at 600+MB
14:28:12*hax-scramper quit (Ping timeout: 265 seconds)
14:29:37*hax-scramper joined #nim
14:49:29*lurker quit (Remote host closed the connection)
14:53:22FromDiscord_<clyybber> tbf csources is a bit bloated
14:53:27FromDiscord_<clyybber> and could be much smaller
14:57:00*glassofethanol joined #nim
14:59:28dadadathere are deprecated code examples on the macros documentation page
14:59:39narimiranPRs welcome
14:59:41dadadathis is the example:
14:59:43dadadavar res = findChild(n, it.kind == nnkPostfix and it.basename.ident == toNimIdent"foo")
14:59:49dadadatoNimIdent is deprecated
15:00:13dadadait.basename.ident probably also
15:01:18dadadathis example belongs to the findChild template, which itself is not deprecated
15:13:11*glassofethanol quit (Ping timeout: 260 seconds)
15:15:54*hax-scramper quit (Ping timeout: 258 seconds)
15:16:30*hax-scramper joined #nim
15:18:49*nsf quit (Quit: WeeChat 2.7)
15:20:35FromDiscord_<treeform> Elegant Beef, I tried using bgfx but I was not able to get it to work. It compiled and ran, but it would just render garbled screen.
15:20:46FromDiscord_<treeform> @Elegant Beef, I tried using bgfx but I was not able to get it to work. It compiled and ran, but it would just render garbled screen.
15:25:18*ptdel joined #nim
15:26:04FromDiscord_<exelotl> I was never able to compile it on windows with msys2/mingw64
15:31:48lqdev[m]dadada: `toNimIdent` is deprecated, `ident` is not
15:32:56*glassofethanol joined #nim
15:33:23dadadalqdev[m]: https://nim-lang.org/docs/macros.html#ident%2CNimNode
15:33:48dadadathere's a different ident which isn't deprecated, but the one I meant, seems to be
15:34:19dadadaand the compiler agrees with me
15:34:24FromDiscord_<Rika> yeah
15:34:27FromDiscord_<Rika> string ident is ok
15:34:31FromDiscord_<Rika> nimnode ident is not
15:37:18*gangstacat quit (Quit: Ĝis!)
15:39:22*gangstacat joined #nim
15:44:28dadadahow would I make a macro for a special infix macro/operator? the arguments to a macro are not sufficient to do that, right?
15:48:53FromGitter<alehander92> what do you mean
15:49:41dadadaalehander92: https://play.nim-lang.org/
15:50:03dadadaah, I destroyed my example
15:50:26*glassofethanol quit (Ping timeout: 240 seconds)
15:51:01*glassofethanol joined #nim
15:58:44FromGitter<alehander92> noo
16:02:11FromDiscord_<Rika> F
16:05:41*zedeus_ joined #nim
16:08:48*zedeus quit (Ping timeout: 258 seconds)
16:24:29dadadawell, it's possible after all, I got confused
16:24:40*zedeus_ is now known as zedeus
16:24:52dadadadoes somebody know if the color scheme on play.nim-lang.org is available in vscode?
16:26:41leorizethe color scheme is dracula iirc
16:27:00*solitudesf quit (Quit: Leaving)
16:29:47*leorize quit (Quit: WeeChat 2.6)
16:30:03dadadaleorize[m]: ty
16:45:52*ng0 joined #nim
17:02:06*glassofethanol quit (Ping timeout: 240 seconds)
17:03:06*floppydh quit (Quit: WeeChat 2.7)
17:06:12*Trustable joined #nim
17:07:01dadadahttps://play.nim-lang.org/#ix=2ceG
17:07:14dadadawant to make the above work without the global variable
17:10:22shashlickinject maybe
17:11:01*anakata joined #nim
17:11:29anakatahi all. Do you guys know how i can iterate over all keys / values for yaml?
17:12:09disruptekconvention suggests pairs().
17:12:30disruptekshashlick: don't hate my thumbs.
17:14:16*glassofethanol joined #nim
17:17:36disruptekpro-tip: if you hate stropping your identifiers in quote do:, try this one simple trick.
17:17:53disruptektemplate someid = ident"aRealIdentifier"
17:18:04disruptekthen you can simply quote do: echo someid
17:18:26*marmotini_ joined #nim
17:22:31disruptekah, nevermind. it's just gensym'ing in the background like a bastard.
17:23:09disruptekman i hate that.
17:24:37disruptekpmunch: you would make me so happy if you'd add a word-wrap button to toggle wrap on output panes.
17:27:59*zedeus_ joined #nim
17:30:46*zedeus quit (Ping timeout: 240 seconds)
17:32:54*anakata quit (Remote host closed the connection)
17:34:33FromGitter<Vindaar> @dadada https://play.nim-lang.org/#ix=2ceL
17:41:07dadadaVindaar: thank you ... I find your version also works without the block around it and it works without the intermediator it as well
17:44:45dadadaVindaar: only on play.nim-lang.org though
17:45:57*nsf joined #nim
17:47:47dadadaah, sry, stropping error
17:48:23lqdev[m]psst
17:48:44lqdev[m]people don't know this, but the `do` after `quote` is optional
17:48:47lqdev[m]and looks weird
17:49:00dadadagood to know, thanks
17:49:24disruptekit's convention.
17:49:33*zahary joined #nim
17:49:48*abm joined #nim
17:49:51lqdev[m]syntactically, `x:` and `x do:` are both an nnkCall(ident"x", nnkStmtList(...))
17:51:03disrupteki know which i grep for, though.
17:51:51*rockcavera quit (Remote host closed the connection)
17:52:37*zedeus joined #nim
17:53:20FromGitter<Vindaar> @dadada yes, it also works without the block, but then a second call of the macro will produce an error
17:53:52*zedeus__ joined #nim
17:55:57*zedeus_ quit (Ping timeout: 268 seconds)
17:57:16*zedeus quit (Ping timeout: 255 seconds)
17:58:07*zedeus joined #nim
18:01:07*zedeus__ quit (Ping timeout: 258 seconds)
18:02:01rhenvarVarriount: the library code is the example from right here: https://github.com/ba0f3/ngxcmod.nim
18:02:16rhenvarthis works without issue outside of docker
18:08:32*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
18:11:02*casaca joined #nim
18:11:49*kungtotte quit (Read error: Connection reset by peer)
18:12:50*kungtotte joined #nim
18:17:55FromGitter<nixfreakz_twitter> n00bie here -- so class in python is just a type in nim?
18:18:18FromGitter<nixfreakz_twitter> and *init*:self with python is just creating a new object with nim?
18:21:28FromGitter<zetashift> It's not really a class; type in Nim is more of a structure
18:22:10FromGitter<nixfreakz_twitter> I'm just looking at this .. https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
18:23:37FromGitter<zetashift> it's close enough for beginning learning Nim
18:23:50FromGitter<zetashift> but this post helped me out a lot more understanding types https://peterme.net/nim-types-originally-a-reddit-reply.html
18:27:21FromGitter<nixfreakz_twitter> awesome thanks
18:30:37*Jesin quit (Quit: Leaving)
18:32:57*Jesin joined #nim
18:38:47*solitudesf joined #nim
18:41:19FromGitter<nixfreakz_twitter> Thats a good read
18:56:16disrupteknice: https://blurha.sh/ https://github.com/woltapp/blurhash
19:06:54dadadaVindaar: hmm, I tried a second call of the macro, without the block, and there's no error, what am I doing wrong here?
19:08:03*rhenvar quit (Ping timeout: 240 seconds)
19:13:26*glassofethanol quit (Ping timeout: 240 seconds)
19:17:43*glassofethanol joined #nim
19:24:21*zedeus_ joined #nim
19:27:06*zedeus quit (Ping timeout: 240 seconds)
19:27:37*zedeus joined #nim
19:30:55*zedeus_ quit (Ping timeout: 268 seconds)
19:31:56*ptdel joined #nim
19:34:28*opal quit (Remote host closed the connection)
19:37:05*rockcavera joined #nim
19:41:50FromGitter<Vindaar> ehh, no idea. With my macro? I would have guessed it should trigger a "redeclared identifier" error, because the `var n` I declare will be declared again (assuming you call the macro in the same scope again)
19:42:30*opal joined #nim
19:43:58FromGitter<erhlee-bird> is there a way to write an anonymous proc type that doesn't have an output type? ⏎ e.g. `proc test(hook: (string) -> nil)`
19:44:00*sigmapie8 joined #nim
19:49:21disruptekproc test(hook: string) = ...
19:50:37FromGitter<erhlee-bird> Had omitted, but there are other arguments. I'm trying to pass in a callback function that doesn't have a return value
19:53:02*nsf quit (Quit: WeeChat 2.7)
19:53:35FromGitter<erhlee-bird> I want to express `proc test(arg1: string, hook: proc(string))`, but it doesn't seem like I can do this without providing a return type for the anonymous function
19:54:03*Jesin quit (Quit: Leaving)
19:54:34FromGitter<erhlee-bird> It works fine if I change it to `template test(arg1: string, hook: untyped)` but I think I lose some type safety with this workaround
19:57:21*Jesin joined #nim
19:58:13Araqthe syntax to use is proc test(arg1: string, hook: proc(string))
20:00:54Araqand no, you don't "lose" type safety via templates, the code is still checked, albeit after template instantiation
20:02:03FromGitter<erhlee-bird> Gotcha
20:02:49FromGitter<erhlee-bird> This is a contrived full example that doesn't compile. Is this something you'd expect to work that I should make an issue for? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e4ee5e88e726c7dc5b8c893]
20:03:15FromGitter<erhlee-bird> I'm running with Nim 1.0.4
20:04:48*rhenvar joined #nim
20:08:31*hax-scramper quit (Read error: Connection reset by peer)
20:08:47*hax-scramper joined #nim
20:09:54*rhenvar1 joined #nim
20:10:23rhenvar1also sorry if I missed anything Varriount, just switched networks. Working on ZNC
20:11:37*rhenvar quit (Ping timeout: 268 seconds)
20:11:50*rhenvar1 is now known as rhenvar
20:22:43*glassofethanol quit (Ping timeout: 268 seconds)
20:27:14FromGitter<alehander92> huh i didnt know
20:27:21FromGitter<alehander92> you can do proc(string)
20:27:28FromGitter<alehander92> i thought you can only proc(a: string)
20:29:06FromGitter<erhlee-bird> actually adding the `a: string` makes it work
20:29:10FromGitter<erhlee-bird> thanks @alehander92
20:30:26FromGitter<alehander92> ah ok
20:30:33FromGitter<alehander92> yeah i guess the other syntax is not supported
20:31:00*marmotini_ quit (Remote host closed the connection)
20:31:28FromDiscord_<clyybber> Yeah, because of f(a = "hey")
20:31:36*marmotini_ joined #nim
20:32:07FromGitter<alehander92> but as a type, what is the ambiguity
20:32:23FromGitter<alehander92> ah
20:32:23FromDiscord_<clyybber> because you wouldn't be able to call hook this way then
20:32:37FromGitter<alehander92> but sometimes i want people to not be able to do it
20:32:43FromGitter<alehander92> just to pass a predicate on string
20:32:45FromGitter<alehander92> or something
20:33:25disruptekwait, what?
20:33:41disruptekyou want to deny named param use?
20:34:05FromDiscord_<clyybber> insanity to me, insanity for you
20:34:21FromDiscord_<clyybber> nah, but seriously, I don't think its a good idea to deny that
20:34:32FromGitter<alehander92> no no
20:34:35FromGitter<alehander92> i use that a lot
20:34:38FromDiscord_<clyybber> and by all means not by passing it through an indirection
20:34:47FromGitter<alehander92> i meant when i have a *parameter* func
20:34:55FromGitter<alehander92> i usually dont care for *its* param name
20:35:10disruptekoh, right.
20:35:12FromGitter<alehander92> because i can pass funcs with all kinds of param name
20:35:46*marmotini_ quit (Ping timeout: 240 seconds)
20:42:40*letto quit (Quit: Konversation terminated!)
20:43:26*LER0ever quit (Ping timeout: 240 seconds)
20:44:09*LER0ever joined #nim
20:44:38*letto joined #nim
20:55:32*abm quit (Quit: Leaving)
21:08:12*sigmapie8 quit (Quit: Leaving)
21:14:32*solitudesf quit (Remote host closed the connection)
21:17:33dadadacan I define a macro so that it will only work inside a specific other macro?
21:19:00FromGitter<alehander92> yes
21:19:10FromGitter<alehander92> you can define a compile time variable with initial value
21:19:10dadadalet's say a macro named myFor can contain myContinue statements, and those statements are also implemented with macros, but I don't want myContinue to be allowed outside of myFor
21:19:19FromGitter<alehander92> which changes only inside the other macro
21:19:26FromGitter<alehander92> around internal invocations
21:19:56FromGitter<alehander92> so myContinue would check this compile time variable value
21:20:54*leorize joined #nim
21:21:30dadadabut that doesn't prevent name conflicts, right? Say there's a function which coindicidentally is also named myContinue
21:21:49dadadaoutside of myFor I'd like the myContinue function to be called
21:21:55FromGitter<alehander92> well this is about overloading
21:22:01*zickzackv quit (Ping timeout: 255 seconds)
21:22:09FromGitter<alehander92> if it sig matches first
21:22:13FromGitter<alehander92> it would be called indeed
21:22:18dadadainside of myFor I'd like the macro to be executed at compile time/but not outside
21:22:18FromGitter<alehander92> ah, i see
21:22:47FromGitter<alehander92> you can then just define myContinue inside the expanded code of myFor
21:22:56FromGitter<alehander92> something like what is supposed to happen for await in async
21:23:35FromGitter<alehander92> e.g. template myContinue: untyped = myContinueMacro(..)
21:24:32leorizeuse gensym
21:24:45leorizeit will generate an unique symbol for you that won't match anything else
21:25:04leorizeyou will need to pass the symbol node to whatever that you want to grant access to
21:25:57FromGitter<alehander92> but he still wants to match myContinue ?
21:26:29FromGitter<nixfreakz_twitter> Is anyone porting python3 scripts to nim ?
21:26:54disruptekwhy not just have the outer macro impl the inner behavior?
21:27:13FromGitter<alehander92> i still think its the same as async/await
21:30:25*narimiran quit (Ping timeout: 258 seconds)
21:31:50dadadadisruptek: the outer macro would then need to iterate through every contained statement/substatement, which could get somewhat complex, it seems much easier to delegate the task of replacing the code to a template/macro
21:32:10disruptekwhat do you think the difference is?
21:32:49*zahary quit (Quit: Leaving.)
21:33:08dadadathat the code gets easier to read/write for me is my hope here
21:33:19dadadaread/write/maintain
21:39:26*hoijui quit (Ping timeout: 240 seconds)
21:41:59*leorize quit (Remote host closed the connection)
21:42:40*leorize joined #nim
21:44:01*lurker148257 quit (Remote host closed the connection)
21:44:05dadadamanaged to do it :D
21:46:21*Trustable quit (Remote host closed the connection)
21:47:41disrupteknice.
21:50:58*uvegbot joined #nim
21:51:31*zahary joined #nim
21:52:03*sagax quit (Ping timeout: 272 seconds)
21:53:08*zyklon quit (Ping timeout: 248 seconds)
21:56:25*lritter quit (Quit: Leaving)
21:59:50*Jesin quit (Quit: Leaving)
22:03:30*Jesin joined #nim
22:06:33FromGitter<Varriount> dadada: Welcome to the world of macros. It's like the world of turtles, but everything is a tree structure
22:08:21*Jesin quit (Remote host closed the connection)
22:36:26*jjido joined #nim
22:36:32*rhenvar quit (Ping timeout: 268 seconds)
22:50:39*krux02 quit (Remote host closed the connection)
22:52:58Araqscope based destruction is beginning to work
22:53:20*NimBot joined #nim
22:53:22Araqand I found out why my async cycle workaround doesn't work
22:53:32Araqit never did work. surprise!
22:55:20FromDiscord_<clyybber> lol
22:55:25*ptdel quit (Ping timeout: 240 seconds)
22:56:06*ptdel joined #nim
23:00:45disruptekyou said that temporaries are lifted and destroyed; does this mean that top-level loop vars get re-init'd correctly now? or is that basically a vm problem?
23:01:13zedeusAraq: have you seen this? http://gallium.inria.fr/blog/incremental-cycle-detection/
23:01:30FromDiscord_<clyybber> disruptek: Its just a VM problem AFAIK
23:04:46Araqzedeus: no, interesting, thanks. not sure if it applies to GCs directly
23:07:02FromDiscord_<clyybber> it applies to gc:orc maybe?
23:07:47*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:11:08dadadais there a generalized way in nim to check for emptiness that works for strings/lists/sequences and all other types that can logically be empty?
23:11:23dadadawould len == 0 always work like in go?
23:11:36disruptek== to default(T)?
23:11:47FromDiscord_<Recruit_main70007> I was gonna say that, haven’t tried it though
23:12:03leorizelen == 0 is the way
23:12:05disrupteklen will work for those types, yes.
23:12:14disruptekbut for arbitrary types...
23:13:41disrupteki guess technically, you could have a type which defaults to some concept of "un-empty", from alloc0. so i guess there's no generic emptiness concept. impl len on your types.
23:14:11Araqzedeus: it doesn't apply
23:14:23Araqit does detect cycles, but not in a GC setting
23:14:52Araqand the trick with the pseudo-topological numbering is known to me
23:15:14zedeusah ok, it didn't mention garbage collection but I figured it was interesting enough to share
23:15:22AraqI mean, ok, ok you could use it for a GC
23:15:31Araqbut it's worse than my stuff
23:16:29FromDiscord_<clyybber> Araq: Is orc still buggy or is it working now?
23:16:55Araqdunno, too busy with arc
23:17:06Araqbut if it works, I know how to make it fast
23:17:25Araqand if it doesn't, I know other algorithms that do work
23:18:08Araqbut it remains in conflict with "deterministic" destruction
23:21:46disruptekthe current approach is in conflict?
23:21:53disruptekor other approaches?
23:22:56*rhenvar joined #nim
23:24:24*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
23:25:57FromDiscord_<treeform> Is there a way to cast a seq without copying it? I though casting would do no copy... but it does: https://play.nim-lang.org/#ix=2cgr
23:27:42leorizetake the address of it
23:28:02leorizeyou can't magically alias via casting :P that'd be too wrong
23:29:06leorizeand no, the cast didn't copy, the thing that was copied was the resulting seq from the cast
23:29:35FromDiscord_<treeform> I tried `var b = cast[ptr seq[uint64]](addr a)[]`
23:29:40FromDiscord_<treeform> still same thing?
23:29:52leorize`=` copies the seq to the result
23:30:00leorizethat's the part that copied
23:30:09leorizecast don't do any copying
23:30:48FromDiscord_<treeform> I just want to operating on ints (which are int64) like they are uint64...
23:31:53FromDiscord_<treeform> ok I think I got it to work: https://play.nim-lang.org/#ix=2cgu
23:32:21FromDiscord_<treeform> I see now as soon as I do c = b[] it copies
23:33:09FromDiscord_<clyybber> copies *what* though?
23:33:35FromDiscord_<clyybber> it doesn't deepcopy, unless you are on --gc:arc and its not a last read
23:35:37*azed joined #nim
23:37:08FromDiscord_<treeform> the elements of the array
23:48:45dadadawhy do expressions of type string ("""manylines""") have to be discarded ... they could be a convenient way of uncommenting code for dev purposes
23:48:53dadadalike ''' in python
23:49:05dadadasure Nim is not python, I know that ...
23:50:08shashlick#[
23:50:23dadadaI know... this one is inconvient to type on my keyboard
23:51:07FromDiscord_<Recruit_main70007> That’s a shame, but I don’t think they are changing it
23:52:47shashlickWhat editor
23:53:00dadadavscode
23:53:10dadadanew to it though
23:54:15FromDiscord_<Recruit_main70007> Personally, I really like it
23:54:26disruptekwhen false: is a better convention for commenting out code, i think. better than #[ ]#, anyway.