<< 16-07-2019 >>

00:17:44*sealmove quit (Quit: WeeChat 2.5)
00:19:58*abm quit (Ping timeout: 268 seconds)
00:46:43blackbeard420for pqexecParams() how would i go about making the cstringArray from a seq[string] and also how would i create a ptr int32 from an array of ints?
00:51:22PMunchThe cstringArray needs some memory copying
00:51:32PMunchOr wait, maybe not..
00:51:44PMunchBut what do you mean a ptr int32 from an array of ints?
00:52:00PMunchLike an array of four int8s into an int32
00:55:32PMunchblackbeard420 ^
00:56:04blackbeard420pqexecParams expects a pointer to the start of an array of ints in the C call for paramFormats. but im not sure how to approach that from nim
00:56:23blackbeard420https://nim-lang.org/docs/postgres.html#pqexecParams%2CPPGconn%2Ccstring%2Cint32%2CPOid%2CcstringArray%2Cptr.int32%2Cptr.int32%2Cint32
01:01:39PMunchWell ptr int32 is easy, that would just be a call to addr on an array of int32
01:02:41PMunchIs there a reason you have a seq[string] in your code instead of a cstringArray?
01:03:33PMunchA cstringArray is an array of pointers to strings
01:03:36blackbeard420i got the cstringArray part working by using allocCstringArray on an openarray of ints
01:04:03blackbeard420but for the array of int32's its saying expression has no address
01:04:25blackbeard420s/openarray of ints/openarray of string/
01:04:26PMunchAh, that's because it's not mutable probably
01:04:44blackbeard420oh wow, thanks that was it
01:04:47blackbeard420thanks again!
01:04:49PMunch:)
01:04:56PMunchYou could also use unsafeAddr
01:05:38PMunchBut that's well unsafe
01:05:52PMunchOr rather more unsafe than regular addr
01:06:31PMunchBecause it will probably end up pointing to a position on the stack, so if your stack pops then the address will point to something else or be invalid
01:10:18*actuallybatman quit (Ping timeout: 272 seconds)
01:33:49*PMunch quit (Remote host closed the connection)
01:59:45*drprune joined #nim
02:00:36drpruneWhat have I done wrong?
02:00:37drprunebin/nim c koch
02:00:37drpruneHint: used config file '/home/eliot/src/Nim/config/nim.cfg' [Conf]
02:00:37drpruneHint: used config file 'koch.nim.cfg' [Conf]
02:00:37drpruneHint: system [Processing]
02:00:58drpruneNim/lib/system.nim(207, 11) Error: undeclared identifier: 'is'
02:01:29drpruneUsing current git master
02:07:02Tangerdrprune, did you run `sh build_all.sh` first? What OS as well>?
02:09:53TangerCompiled fine on mine
02:10:07TangerRunning ubuntu
02:14:36drprunedebian 9
02:15:18shashlickhow did you compile bin/nim
02:15:31shashlickand perhaps before that, how did you get the source
02:16:41drpruneRight now I'm re-running in a clean git checkout. Back in a couple of minutes
02:17:21shashlickyou want devel?
02:22:30drpruneYou mean I should check out devel?
02:22:49shashlickno i mean do you want devel or a release version?
02:22:57shashlickif you want release, get a tar.xz file
02:23:10shashlickif you want nightlies, get that tar.xz then
02:23:36drpruneI'm just following the Compile instructions from https://github.com/nim-lang/Nim
02:25:37*lritter quit (Ping timeout: 244 seconds)
02:27:15FromGitter<Obround> How do you import a file from a sibling directory? Something like this (https://stackoverflow.com/questions/54622024/import-a-library-which-is-in-a-sibling-of-the-current-folder/) except in Nim instead of Python?
02:30:49*yeetcannon joined #nim
02:31:38drpruneslashclick, I checkout out git head (v0.20), and that built fine. Strange. Will try 0.19.6 release archive for comparison.'
02:32:12drpruneoops 19.6 release, same problem: Nim-0.19.6/lib/system.nim(207, 11) Error: undeclared identifier: 'is'
02:33:42TangerObround: You can add a config.nims file to the folder your main app runs in with `switch("path", "..")`
02:34:05TangerThat sets the runtime path to be a step above and you can then import from the sibling directory like that
02:36:29shashlick@Obround: you can also `import ".."/file`
02:37:14shashlick@drprune - but are you running build.sh first?
02:41:19drprune@slashlick, build_all.sh clones csources and runs build.sh
02:43:10shashlickok so just to be clear, you downloaded the 0.19.6.tar.xz file, extracted, cd and build_all.sh?
02:43:16drprune@slashlick - I'm happy that 0.20.0 is building for me, from release tarball as well as git checkout.
02:43:25drpruneyes, download and build_all.sh
02:43:35drprunefailed for 0.19.[4,6]
02:43:43drpruneworked for 0.20.0
02:44:03shashlickcan you share the link? i'll try on my machine
02:44:33drpruneFrom https://github.com/nim-lang/Nim/releases
02:45:27drpruneI'd guess it is not a common problem if more people aren't complaining by now ;)
02:50:32shashlickokay i see why
02:50:45shashlickwhere did you see instructions to download that archive?
02:51:03shashlickyou are downloading v0.19.6 but are using latest csources
02:51:43drpruneThat is what build_all.sh does
02:52:20drprunealso here: https://github.com/nim-lang/Nim, the compile instructions call for git clone, which gets master branch which is approx 0.19.6
02:52:39drprunehttps://github.com/nim-lang/Nim
02:52:39shashlickyou want to download https://nim-lang.org/download/nim-0.19.6.tar.xz
02:52:51shashlickit contains the csources snapshot for that release of nim
02:52:54drprunegit clone https://github.com/nim-lang/Nim.git
02:52:54drprunecd Nim
02:52:54drprune# step 2 (posix) clones `csources.git`, bootstraps Nim compiler and compiles tools
02:52:54drprunesh build_all.sh
02:53:39shashlickNote: The following commands are for the development version of the compiler.
02:54:04drpruneOK
02:54:27shashlickuse choosenim or the link I provided instead
02:55:23drpruneI guess the summary is that the current build instructions on github do not work, because incompatible branches of Nim and nim_csources get checked out by default.
02:56:20drprunebuild instructions are those 4 pasted lines up there.
02:56:32drpruneYes, I will try the official download as you suggest
03:06:36*actuallybatman joined #nim
03:24:26*fjellfras joined #nim
03:27:07drprune@slashlick - thanks! bye...
03:27:18*drprune left #nim ("Leaving")
03:40:55shashlicklooks like `currentSourcePath` doesn't work in `nim doc`
04:14:52*dddddd quit (Remote host closed the connection)
04:24:16*nsf joined #nim
04:39:10*sniffdtek joined #nim
04:50:20*leorize joined #nim
04:52:31*brakmic joined #nim
04:56:23*brakmic_ joined #nim
04:57:02*brakmic__ joined #nim
04:57:04FromGitter<rtnlmeme-DestroyerOfDeath> If I do `nimble install nimsuggest` I get: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ should it work? [https://gitter.im/nim-lang/Nim?at=5d2d591f4f7f9e219c0061be]
04:57:35rayman22201@Zevv or @Dom96, either of you guys around? I was trying to do the lazy initing of the asyncEvent that @Dom96 suggested, but I'm having issues. Even when I override the `callback=` proc for FlowVar, it calls the FutureBase version.
04:57:54leorize@rtnlmeme-DestroyerOfDeath you should definitely not install nimsuggest that way
04:58:31FromGitter<rtnlmeme-DestroyerOfDeath> @FromIRC ah ok
04:59:37rayman22201which actually makes perfect sense: the async macro explicitly creates a FutureBase object, and the FlowVar is being downcast to a FutureBase (the parent class)...
05:00:02*brakmic quit (Ping timeout: 245 seconds)
05:00:28*brakmic_ quit (Ping timeout: 245 seconds)
05:00:40leorize@rtnlmeme-DestroyerOfDeath nimsuggest should be included in your Nim installation already, though
05:01:48*absolutejam joined #nim
05:08:06FromGitter<rtnlmeme-DestroyerOfDeath> @leorize yea, the output of `nimsuggest --version` is ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d2d5bb53be99c47865af952]
05:12:58rayman22201ughh. I think this is a "nim doesn't have vtables" problem :/
05:23:20Zevvrayman22201: here a bit
05:23:59rayman22201let me show you an example and see what you thing. give me 2 minutes
05:24:28Zevvgive me two hours, need to do morning chores and commute first :)
05:24:40rayman22201lol. I will be asleep then :-P
05:24:47Zevvbut it sounds like that problem indeed
05:24:57rayman22201but I will post an example for you to think about
05:24:59Zevvwhere's doms discussion about that, I think i missed it
05:25:10Zevvhttps://dlang.org/blog/2019/07/15/ownership-and-borrowing-in-d/
05:27:26*brakmic__ quit ()
05:27:44rayman22201Dom saying good ideas: https://irclogs.nim-lang.org/14-07-2019.html#15:45:42
05:27:47*brakmic joined #nim
05:29:15rayman22201I skimmed the D article earlier today. It's interesting. It feels similar to newruntime actually.
05:31:02FromGitter<rtnlmeme-DestroyerOfDeath> fixed my issue btw. It was just an emacs (spacemacs) path issue
05:36:09rayman22201@Zevv: http://ix.io/1ODd
05:36:18rayman22201see my comments
05:36:39rayman22201I guess I could have made it a gist. meh
05:37:05rayman22201That is from the macro expansion of the async macro
05:37:46*krux02 joined #nim
05:40:45*narimiran joined #nim
05:50:45*yeetcannon quit (Ping timeout: 258 seconds)
06:08:16*solitudesf joined #nim
06:19:40*absolutejam quit (Ping timeout: 244 seconds)
06:20:25Zevvah right doms idea is one step further, makes perfect sense
06:21:37Zevvoi thats indeed a nasty one, no clue how to get around this rayman22201
06:23:05rayman22201vtables fix it :-P
06:23:42rayman22201I think we might not be able to apply this optimization b/c of this limitation unfortunately
06:30:07Zevvevery time I forget about it, it comes back to bite me
06:30:21Zevvor you :)
06:31:26Zevvoh and I was wrong about that event thing losing events in the epoll selector, seems that was intended behaviori
06:31:36Zevvbut wrong in all other implementations
06:33:07*actuallybatman left #nim ("ERC (IRC client for Emacs 26.2)")
06:43:22rayman22201I saw that Araq said something about that, but I don't fully understand the issue.
06:46:24skrylar[m]i did something silly
06:46:41*actuallybatman joined #nim
06:47:05skrylar[m]discovered this `kiwix` program earlier.. offchute of the offline wikipedia stuff, now also does stack exchange and friends. anyway i poked at ripping the nim docs in to it
06:49:33skrylar[m]i suppose that just makes it similar to making a zeal docset. hmmh
06:51:32*jjido joined #nim
06:54:23*absolutejam joined #nim
06:57:47rayman22201@Zevv: I have a maybe silly idea. The async macro could be made "smarter". It could detect that it is awaiting a flowVar and adjust the iterator return type.
06:58:53rayman22201But I need to sleep now. gn 😁
06:59:02*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:59:22rayman22201Good morning to all of you Europeans 😝
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:23*gmpreussner joined #nim
07:07:00Zevvsweet dreams
07:29:11*clyybber joined #nim
07:32:11FromGitter<zacharycarter> well - I got a cube rendering in my project last night \o/
07:32:28FromGitter<zacharycarter> now to debug the terrain rendering - btw RenderDoc is a pretty awesome program
07:33:46Zevvcongrats zacharycarter!
07:34:31lqdev[m]renderdoc just crashes on me when I attempt to open a captured frame
07:34:46FromGitter<zacharycarter> thanks! usually once I have something rendering, I make pretty fast progress
07:34:52lqdev[m]I use apitrace, it fits my needs
07:35:12FromGitter<zacharycarter> getting something to render is the first hurdle
07:35:47FromGitter<zacharycarter> I'm finding it pretty easy this time around to port OpenGL API calls to BGFX API calls
07:36:42FromGitter<zacharycarter> I haven't used API trace before - I did use this Windows debugging program called PIX, which was also nice
07:36:49FromGitter<zacharycarter> but renderdoc works well fo rme
07:37:28lqdev[m]maybe renderdoc crashes because the version in the fedora repos is broken or something
07:47:24*solitudesf quit (Ping timeout: 272 seconds)
07:49:43FromGitter<zacharycarter> possibly
07:52:25FromGitter<zacharycarter> someone in the bgfx channel said it didn't work on mac - so maybe it only works on Windows? I don't know
07:52:47FromGitter<zacharycarter> nevermind - it says it does work on linux x64
07:53:57FromGitter<arnetheduck> is it possible to create an anonymous tuple with named fields? `(a, b, c)` will create field names `Field0` etc..
08:00:34*synshroud quit (Ping timeout: 248 seconds)
08:03:35*synshroud joined #nim
08:06:46*floppydh joined #nim
08:11:26lqdev[m]arnetheduck: what's the problem with using [0] etc?
08:12:18FromGitter<arnetheduck> @lqdev the same as identifying you by your location in the list of people in this channel
08:13:34lqdev[m]and why exactly do you need an anonymous tuple?
08:13:54*stefanos82 joined #nim
08:15:05lqdev[m]I don't think having fields named Field0 etc really solves the problem, since you're still specifying the index of the field, just in a different way
08:16:06FromGitter<arnetheduck> for example because they're handy when returning a subset of an object from a helper function: `func importantPart(x: SomeObject): auto = (x.a, x.b)` - it's doable now by spelling out the tuple.. the receiver of that function can the reflect on the tuple names which can be mapped to other name-requiring places, such as json or logs
08:17:23lqdev[m]I see
08:17:39FromGitter<JasperJenkins> what about `func importantPart(x: SomeObject): auto = (f1: x.a, f2: x.b)` ?
08:18:04lqdev[m]why not create a type like `type MyTuple = tuple[field1, field2: int]`?
08:21:48leorize!eval import json; echo %(1, "string)
08:21:51leorize!eval import json; echo %(1, "string")
08:21:52NimBotCompile failed: /usercode/in.nim(1, 24) Error: closing " expected
08:21:55NimBotCompile failed: /usercode/in.nim(1, 19) Error: type mismatch: got <tuple of (int, string)>
08:22:10leorizehmm, thought narimiran added tuple support to json
08:22:15*abm joined #nim
08:22:33narimiranit might have been added then removed later, i don't remember exactly
08:22:52leorize!eval echo (f1: 1, f2: "string")
08:22:57NimBot(f1: 1, f2: "string")
08:23:21leorize@arnetheduck ^ well you can construct named tuples this way
08:23:40leorizeor you can actually specify out the field name in the proc signature and do everyone a favor :p
08:28:05FromGitter<arnetheduck> I don't want to repeat the tuple in the signature because it only ever gets used once - like mentioned, it's part of a reflection thing. repeating the names serves only to make it harder to maintain in this situation.. I'm gonna try that above syntax, thanks! (I thought I had tried it and failed, but maybe I mistyped something)
08:37:22*absolutejam quit (Ping timeout: 248 seconds)
08:45:44*absolutejam joined #nim
08:54:58*absolutejam1 quit (Quit: WeeChat 2.5)
09:26:34*Vladar joined #nim
09:28:46*laaron joined #nim
09:30:42*absolutejam quit (Ping timeout: 248 seconds)
09:33:10*actuallybatman quit (Ping timeout: 272 seconds)
09:35:54*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
09:37:37*laaron joined #nim
09:41:22*absolutejam joined #nim
09:42:18*laaron quit (Client Quit)
09:42:38*laaron joined #nim
09:45:22*arecaceae quit (Ping timeout: 246 seconds)
09:52:28clyybberZevv: I was wrong yesterday actually.. The issue is in the C backend, to fix it in injectdestructors is more of a workaround, since it will generate a '(*value)', while it should actually generate 'value' to be correct
09:52:41clyybberIt still works without errors nonetheless for some reason
09:53:04clyybberfixing this correctly will be *fun* :p
09:54:00*laaron- joined #nim
09:54:04*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
09:56:17ZevvFun, as in "its fun to get a stapler to the forehead"?
09:58:43*solitudesf joined #nim
09:59:12clyybberyeah, fun as in https://dwarffortresswiki.org/index.php?title=DF2014:Fun&redirect=no
10:01:46Zevvbtw, how come you did pick this whole thing up, instead of Araq doing the implementation?
10:02:33Zevvoh I get the dwarffortress reference now :)
10:14:54FromGitter<akavel> ccccccjkutjuluebljuvticcvrvhdeljfjvurkkgklfi
10:15:04FromGitter<akavel> sorry, that was accidental
10:15:44FromGitter<akavel> Guys, I wanted to ask, what's the status of hot code reloading in the C backend in Nim 0.19?
10:16:20FromGitter<akavel> I expected this to become semi-official with the recent release, but now that I'm searching around, I can't seem to see any mention in the official docs
10:17:19FromGitter<akavel> Sorry, I mean in 0.20
10:18:14FromGitter<akavel> ahh
10:18:16FromGitter<akavel> ok
10:18:25FromGitter<akavel> Please disregard my question
10:18:35FromGitter<akavel> I mixed things up
10:18:45FromGitter<akavel> Google sent me to 0.19 nimc docs
10:18:47AraqI recently cleaned up its documentation
10:18:56Araq0.20.2 will have better docs
10:19:15FromGitter<akavel> and I somehow had in mind that 0.19 is the recently released version, while now I see it's 0.20
10:19:18FromGitter<arnetheduck> errr, so what's the https://github.com/nim-lang/Nim/blob/devel/lib/std/ folder for again? I see `editdistance`, variable length integers and new clock in there, and having trouble err... correlating them all conceptually
10:19:27FromGitter<akavel> and the 0.20 docs *do* have some info.
10:19:41FromGitter<akavel> I was just looking at the 0.19 docs and that led to confusion :(
10:20:11Araqarnetheduck: new stdlib modules go into there
10:20:18FromGitter<akavel> Gee, when Google leads you astray it's like with GPS leading you astray...
10:21:14FromGitter<akavel> You realize how much you got used to it, how amazingly well it usually works, yet how it's not perfect...
10:21:54FromGitter<zacharycarter> Zevv: I remember you saying recently that you may have figured out what was causing: https://github.com/nim-lang/Nim/issues/11718 - should I update the issue with what you found?
10:21:59FromGitter<zacharycarter> I can search through IRC logs to find your message
10:22:21FromGitter<zacharycarter> I just want to ensure that you're comfortable / sure that you think it's the cause of the issue, or at least a breadcrumb to follow
10:22:33FromGitter<arnetheduck> Araq, why?
10:23:30Araqso that 'import std / foo' doesn't clash with 'import foo' (where foo is project specific)
10:24:22Araqthe old way of doing 'import stdmodule' is discouraged, it should be 'import std / stdmodule'
10:24:50Araqnew modules enforce that by being in std/, the old ones are mapped into std/ so that you can use std/ consistently for every stdlib module
10:25:30Araqthere was some RFC about it and a looooong discussion
10:27:57FromGitter<arnetheduck> huh. so wouldn't it be reasonable to expect the same for nimble packages then? ie `import nimblepkg/module`? I mean the problem at the root is the same - once you start using code external to your project, namespacing things becomes pretty much inevitable
10:29:14Araqwell yes, that's what nimble enforces
10:29:44Araqthe only exception is a single module package so that you don't have to do 'import x / x'
10:30:43*fjellfras quit (Quit: Leaving)
10:30:48FromGitter<arnetheduck> https://github.com/nim-lang/Nim/blob/devel/lib/std/varints.nim looks pretty arbitrary as well - there are many "standard" variable length integer encodings out there, why would a particular one be singled out to be included in a standard lib?
10:31:34Araqthat's a good point but the particular implementation is both fast, simple and compatible with sqlite
10:31:48AraqI could have picked a better name though :-
10:31:55Zevvzacharycarter: not at all sure, it was late and I had some beers, but iirc it had to do with a function being declared static so it did not end up as a public symbol in de shared lib. I'd have to look into it again to be sure, though. But feel free to add something like that to the issue of course, as I'm sure it is a problem with run time linker not being able to find a function in a shared lib.
10:33:03*theelous3 joined #nim
10:35:10FromGitter<zacharycarter> okay, cool - thank you
10:35:24FromGitter<arnetheduck> well, it also oddly uses emit for the shifts, so it's not even generally usable (say at compile time) making it kind of unsatisfying and.. nothing special really (not even from a speed perspective).. fwiw, I only looked at it because I needed a varint decoder twice recently, and they both were incompatible with this one (protobuf and dwarf exception handling)..
10:36:09FromGitter<arnetheduck> for the longer term, I think it would be seriously useful to get some guidelines on what goes in std and what doesn't - like a QA mark so you can depend on the code that's in there and hope there are some guarantees surrounding it
10:36:38Araqthe emits are because Nim lacked system.ashr back then
10:36:44Araqwe can now remove them
10:37:20Araqand well varints does say "experimental" API.
10:38:02Araqif we do 'std / experimental / varints' then it's guaranteed to break, if we start with 'std / varints' it has a chance of not breaking anybody's code
10:38:18Araqindividual procs can then be .deprecated: "Use X instead"
10:39:23*absolutejam1 joined #nim
10:41:42FromGitter<arnetheduck> yeah, but from a project perspective, it's a bother to have to follow all that chatter in nim std lib, and inflexible at the same time. the approach in and of itself doesn't scale - even from a PR/review perspective..
10:41:57*shomodj joined #nim
10:46:04Araqwell I know your solution -- "ship Nim without a stdlib"
10:46:05FromGitter<arnetheduck> using varint as an example, it seems it would be nice to have in the std lib the building blocks to build a performant varint implementation - then allow the concrete instances happen in a decentralized way
10:47:05FromGitter<arnetheduck> well, sort of - not without, but with a line drawn
10:50:57Araqwell, we're also thinking about "nim cold fusion" which would be a Nim with even more stuff in it
10:51:12AraqNim + a selected set of packages
10:51:30Zevvand then make a good cleanup of the stdlib. sqlparser, duh
10:51:43Araqbut if we had that, we could also make a Nim with only the battle-tested stuff
10:52:28Araqif we have 2 different distributions, we might as well go ahead and make them both useful for the different audiences
10:53:02FromGitter<mratsim> cold fusion?
10:53:13Zevvin practice I guess the only people interested in the smaller distribution would be the compiler developers
10:53:17FromGitter<mratsim> Like the reactors that never get shipped? :p
10:53:20FromGitter<arnetheduck> well, yeah, and that makes a lot of sense, specially coupled with a policy to throw obsolete stuff out.. but it's also about managing responsibilities and maintenance. battle-tested stuff by definition needs less maintenance and causes less problems - has a better usefulness/code ratio
10:53:49Araqmratsim: the joke is like this "what's better than 'batteries included'?" - "Cold fusion."
10:54:12*dddddd joined #nim
10:54:51FromGitter<mratsim> depends, I'm interested in very thin wrappers over system resources to ensure control over memory, threads and allocations
10:55:09FromGitter<alehander42> Good joke
10:55:44FromGitter<alehander42> I think stuff that can run without os eg osdev order bare metal code
10:55:50FromGitter<arnetheduck> if the tooling and ecosystem worked fine, it would be a matter of distributing a list of extra packages to download.. to truly gain the benefits of a more dynamic development process, you'd have to keep an open mind to removing stuff from that cold fusion, or you'll just be bogged down in the same issues, just with less control
10:55:55FromGitter<alehander42> Would also benefit
10:56:32Araqarnetheduck: that doesn't work well for everybody, even assuming a perfect ecosystem.
10:56:47Araqsome devs are behind a firewall and can only use the Nim we ship
10:56:50Araqno Nimble packages.
10:58:03Araqand also I don't like it. a web of dependencies is inherently more complex to maintain.
10:59:47Araqand even assuming it works well, Python started with "batteries included" and *then* got the critical mass and *then* could think about trimming it. That's not a co-incidence IMO. The "batteries included" helped Python for a decade even if some libs were bad.
11:01:47FromGitter<arnetheduck> yeah, but times were different then as well. ie py2 was released in year 2000 - aka before `git`
11:02:58Araqsure. and having hardly any stdlib at all worked well for C++
11:04:42Araqfwiw I eventually switched from Lua to Python because it had a more useful library
11:04:43*Ivo joined #nim
11:05:49AraqZevv: what's wrong with the sqlparser?
11:06:47FromGitter<arnetheduck> what you need is a distribution mechanism for lots of code - you don't need to be the monolithic distribution mechanism yourself. for the people that need nim behind a firewall, an equally working solution is a tool that vendors code together with their own code, with the massive advantage that it stays local to them, rather than being a burden for everyone
11:08:59FromGitter<arnetheduck> `py3` is moving in the direction of trimming because maybe they learned something along the way, from say.. javascript, which btw, also comes without a (meaningful) std lib
11:09:18AraqI know.
11:09:35AraqPy3 will still ship with e.g. a JSON library
11:09:49Araqand async
11:10:06Araqand os, path handling ...
11:10:47Araqit's not just that Nim's stdlib has modules in it that a stdlib doesn't need.
11:11:05AraqNim's stdlib also has modules that it needs to have but which are of poor quality.
11:11:42*theelous3 quit (Ping timeout: 245 seconds)
11:12:36FromGitter<zacharycarter> cold fusion reminds me of that adobe product
11:12:38FromGitter<zacharycarter> which is turrible
11:13:00Araqyeah yeah, I know
11:13:06Araqwe need a different name
11:13:29ZevvAraq: nothing wrong, just that is it something that should be in the stdlib
11:13:43Araqwell no.
11:14:01Zevvwe dont have sha256, but we do hav an sql parser :)
11:14:08FromGitter<arnetheduck> Zevv, should or should not?
11:14:19Zevvgood question :)
11:14:36FromGitter<mratsim> ORM would be better :P
11:14:56FromGitter<zacharycarter> you could rename the slimmer version of nim to slimnim
11:15:00FromGitter<zacharycarter> and it would almost be slimjim
11:15:07Zevvniminal
11:15:16FromGitter<mratsim> unpronounceable :p
11:15:24FromGitter<zacharycarter> which is a delicious tube shaped meat product
11:15:46FromGitter<mratsim> Earthworm Nim :p
11:16:08FromGitter<zacharycarter> feel like we're getting somewhere
11:16:14FromGitter<mratsim> Sublinimal :p
11:16:16Zevvthe other day the idea came up to base it all on nimble - create a recommended-libs metapackage, et voila
11:16:33FromGitter<mratsim> or plain Animal
11:16:42FromGitter<mratsim> Animal, your companion Nim libraries
11:17:16FromGitter<zacharycarter> I guess this is kind of what anaconda is for python?
11:18:07FromGitter<mratsim> anaconda is domain specific
11:18:25FromGitter<mratsim> domain collections make sense
11:22:07FromGitter<mratsim> in any case, the very minimal that should be in the stdlib are things that abstracts OS differences, like IO, locks, networking, ...
11:22:12FromGitter<arnetheduck> well, whatever it's called it would be nice if it addressed some of these scalability problems that happen beyond a certain size - if it's business-as-usual, just with a fancy name and a nice script, it doesn't really improve on the scalability status-quo
11:23:13FromGitter<mratsim> then there is the interface/API layers, some stuff are basic and used in many places and the stdlib should standardize on that: ⏎ ⏎ 1) streams, ⏎ 2) crypto (cough) [https://gitter.im/nim-lang/Nim?at=5d2db3a13596f56f8cea8dc0]
11:23:40FromGitter<mratsim> and then there is the nice to have: ⏎ ⏎ 1) bigints ⏎ 2) actual implementation of crypto [https://gitter.im/nim-lang/Nim?at=5d2db3bc3e2c7e3970951a07]
11:23:48FromGitter<mratsim> (for example)
11:24:22FromGitter<arnetheduck> crypto doesn't *really* need an api specifically.. crypto is no differerent from other forms of compression and data-moving really
11:24:42FromGitter<arnetheduck> a hash is just a lossy zip :)
11:25:21FromGitter<mratsim> the type of your inputs, the order of the argument, the type of the return value
11:26:49FromGitter<mratsim> if a networking lib suddenly needs to interact with some file libraries and they were using the same base hash types, it avoids unnecessary conversion
11:32:21Araqarnetheduck: well but what are these "scalability problems"? the way I see it you want some guarantee that you only end up using modules that are production ready
11:32:38Araqand with a minimal distro that would be addressed.
11:33:08*hohlerde joined #nim
11:34:33hohlerdedo I need a full nim installation to use NimScript or is the bin folder sufficient?
11:39:22Araqdepends on how you "use" it
11:40:57hohlerdeI want to use it as bash/powershell replacement
11:41:22Araq'nim e myscript.nims' should do the job then
11:41:55hohlerdeso the nim binary is all I need? that's cool
11:42:42Araqwell the nim binary needs to be able to find the lib/
11:43:28FromGitter<arnetheduck> well, for one it's about promoting processes that encourage that development happens in parallel rather than in lock-step - you can make that more smooth with good tooling - ie git. batteries included is a crude way of expressing "this code works with that code", but the monolith approach means that "this code must be updated with that code".. take us for example, we can't update to 0.20 because of some random
11:43:28FromGitter... incompatibilities, even if there are parts of 0.20 that we'd already could and would use, and could have used even before 0.20 was out - this is all well for fast-moving leaf code, but then in the std lib we'd want a stable core that defines the very most basic building blocks from which applications can be constructed ... [https://gitter.im/nim-lang/Nim?at=5d2db85ff4fe94397119fa6b]
11:46:04FromGitter<arnetheduck> the last point is fundamentally incompatible with sticking leaf/feature code in the std lib - the stuff is not "timeless"- it changes every season.. that's why sql is a doomed library - every vendor has their own sql and the thing keeps moving - it's a high-churn project to try to maintain it at a decent level of quality, so now you get something that's a burden on more central pieces of nim being better developed,
11:46:04FromGitter... and at the same time of "low quality" because there's no reasonable way that it can be maintained in pace - specially since sql is out of fashion
11:46:50hohlerdeAraq: true, but overall the footprint on disk is rather low. thanks.
11:49:14Araqarnetheduck: speaking of which. we want to release 0.20.2 this week and it would be nice if NimBus worked with it.
11:49:44Araqwhat's left to be done to accomplish it?
11:54:57Araq> you can make that more smooth with good tooling - ie git. batteries included is a crude way of expressing "this code works with that code"
11:55:45Araqas long as github allows projects to be deleted and as long as the network is involved, some physical duplication of files makes a hell lot of sense.
11:57:34FromGitter<arnetheduck> fair - that's what vendoring does - copy the code to your repo. even better than a std lib, because it's generally applicable to all your dependencies :)
12:00:36Araqok, yes. However, there is one more argument for a cold-fusion-nim: it eliminates choice. There would be one obvious websockets implementation to use. The one we ship.
12:01:51FromGitter<mratsim> nimbus should take maybe a day of work to be able to run on 0.20.2
12:01:55FromGitter<arnetheduck> not too sure what's left on 0.20.x tbh - it should be fairly easy to test since we have the nim version pinned with a git submodule, if you just check out https://github.com/status-im/nimbus/
12:02:12FromGitter<mratsim> there is the -d:nimOldRightShift that is necessary
12:02:19FromGitter<mratsim> there is this annoying GCSafe: https://github.com/status-im/nim-json-rpc/issues/63
12:02:54FromGitter<arnetheduck> @mratsim I dunno about that, I remember that we decided to skip it because there were some pretty serious issues, if it was just a few patches it would have been done long ago
12:02:54FromGitter<mratsim> there is one another, small thing iirc.
12:03:20FromGitter<mratsim> ah, then maybe I'm confusing beacon-chain and nimbus
12:09:13FromGitter<arnetheduck> choice, yes. but that's about having a mechanism for curation and saying `we recommend library x` - that's where the curated list of "good" libraries comes in. if I know that `fancy-websockets` is the recommended ws lib out there, let me upgrade it independently of my nim version.. I also believe that a distributed community can work out consensus of the highest quality implementation of a particular topic well
12:09:13FromGitter... enough on its own - a bad option in the std lib is even likely delay this process
12:16:35*MrAxilus[m] joined #nim
12:17:32*nsf quit (Ping timeout: 258 seconds)
12:19:32*nsf joined #nim
12:23:06Araqwell the list of curated libs is what nim-cold-fusion would be, it would bundle the curated libs in a tarball.
12:24:48Araqincluding the .git subdir, so no history is lost
12:25:04Araqand you can update parts individually if you need to
12:25:15FromGitter<alehander42> i think a cold-fusion thing might be weird, e.g.
12:25:26FromGitter<alehander42> what if you have two differently designed but equally ok orm-s
12:25:39FromGitter<alehander42> or protocol api-s
12:25:39FromGitter<alehander42> etc
12:26:02Araqthen better not include it until the market decided which one to prefer
12:26:05FromGitter<alehander42> are they both inside, is just one chosen
12:26:16FromGitter<alehander42> smart
12:26:21FromGitter<alehander42> if its more minimal, makes sense
12:26:32FromGitter<alehander42> but still i agree that its good to have the mechanism
12:26:33FromGitter<alehander42> exposed
12:26:40FromGitter<alehander42> so i can generate my own "distro"
12:26:46FromGitter<alehander42> because the "behind firewall" argument
12:27:12FromGitter<alehander42> is exactly an argument for that: guy in company x might need X and Y packages which are just not inside the cold-fusion
12:27:34FromGitter<alehander42> so he either pushes to have them because of his usecase which is not general enough
12:28:15FromGitter<alehander42> or he can generate their own thing(but on the other hand, if he can download/run that, whats really stopping nimble from working: still not sure)
12:30:24Araqwell I don't encourage you to produce your own distro. but nothing stops you from doing that
12:32:23Araqnow the only important question is: how to name them?
12:32:30FromGitter<alehander42> (goes and creates nimubuntu)
12:32:38Araq1. NimBattle and NimFusion
12:32:57Araq2. NimCore and NimExtended
12:33:14FromGitter<alehander42> why not nimcore and nimfusion
12:33:33Araqsure, or that
12:34:37*solitudesf quit (Ping timeout: 245 seconds)
12:35:37dom96Araq: seen this? https://news.ycombinator.com/item?id=20441519
12:35:39*PMunch joined #nim
12:37:56Araqyeah, I read it
12:38:09dom96Thoughts?
12:38:35Araqit repeats Rust's mistake, the heap is not lexically scoped.
12:38:45Araqbut it's a step in the right direction
12:39:35dom96cool. So I think we should write up a blog post about Nim's new runtime, but only once we're sure it works :)
12:40:05Araqand it's also not clear yet if Rust's way is good enough and we "only" need to educate programmers to embrace it
12:40:28Araqor if it's inherently too limiting for many things.
12:49:43dom96I think Rust's popularity already disproves this
12:50:58*absolutejam1 quit (Quit: WeeChat 2.5)
12:53:27*laaron- quit (Remote host closed the connection)
12:53:33*laaron joined #nim
12:57:23Araqmaybe. I still haven't seen UIs done with Rust's ownership system.
12:57:42Araqyou can always use refcounting in Rust to get things done
12:59:33FromGitter<zetashift> There are a few UI toolkits for Rust, but using them ain't that ergonomic
13:01:31Araqwhen we discuss Rust's ownership system, it's important to focus on the ownership system. Not on what was "written in Rust" or what HN says about Rust.
13:02:21Araqif Rust has an ownership system and people instead use the Arc<T> everywhere in practice, it means the ownership system has failed.
13:02:32*couven92 quit (Quit: Client disconnecting)
13:03:07FromGitter<alehander42> but the question is if its possible to add just 1-2 extensions to it
13:03:15*Senketsu quit (Quit: WeeChat 2.5)
13:03:29FromGitter<kaushalmodi> nimble question: Is there a way to upgrade a nimble package and delete all old versions of that package?
13:03:30FromGitter<alehander42> which are enough to support similar datastructures in 80% of cases
13:03:32FromGitter<alehander42> or not
13:03:59FromGitter<kaushalmodi> right now, I cannot uninstall an old version of a package because 7 other packages depend on it
13:04:24FromGitter<alehander42> without runtime overhead
13:09:36Araqkaushalmodi: you can always 'rm' it, nimble doesn't mind
13:12:00FromGitter<kaushalmodi> I remember nimble getting confused if you rm'd packages
13:12:13FromGitter<kaushalmodi> it messed up some internal symlinks manages by nimble AFAIR
13:12:22FromGitter<kaushalmodi> *managed
13:13:05Araqrm -rf .nimble
13:13:13FromGitter<kaushalmodi> heh
13:15:45narimirani regularly manually delete packages, and i didn't experience any problem
13:16:52FromGitter<kaushalmodi> ok
13:17:03FromGitter<kaushalmodi> I'll try that out
13:17:21Zevvkaushalmodi: maybe for 'nim develop' packages?
13:18:13FromGitter<kaushalmodi> you mean 'nimble develop', but yes, I should consider that.
13:34:44FromGitter<kaushalmodi> I am now adding this to my `config.nims`: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Currently the stdlib packages are gating me from using `-d:strictMode` in my compilations. [https://gitter.im/nim-lang/Nim?at=5d2dd2743b41924785ccd517]
13:36:48Araqwhat's -d:strictMode ?
13:37:07Araqnv
13:37:12AraqI can see it on gitter
13:54:23*xet7 quit (Quit: Leaving)
13:57:54*clyybber quit (Ping timeout: 272 seconds)
13:58:42*xet7 joined #nim
14:04:33leorizeAraq: https://github.com/nim-lang/Nim/pull/11751 <- the issue you're fixing is #11747 not #11474
14:05:03Araqlol
14:17:11FromGitter<wsdjeg> hello, any one use vim as default editor of nim programming language?
14:17:20narimirancouple of us
14:17:46FromGitter<wsdjeg> which nim snippets do you use?
14:17:51narimiranwell, some of us use neovim, because of the great plugin by leorize, but you have some stubborn vim users too :)
14:18:16PMunchI use Vim
14:18:17FromGitter<wsdjeg> I am author of spacevim, I use lang#nim layer
14:18:30PMunchWith the LSP plugin and the nimlsp server
14:18:34narimiranoh, then we spoke on telegram before, i think
14:18:45Cadeyis niminst deprecated?
14:19:51Cadeyah it got moved to the main nim repo
14:20:00Cadeyit should be removed from the nimble packages list
14:20:25Araqwell yes. the nimble package is for others, the one in the main repo only for Nim itself
14:20:35Cadeyit doesn't build anymore
14:20:42FromGitter<wsdjeg> what is a mose use language spesific feature when edit nim code in vim?
14:22:02FromGitter<wsdjeg> I hope sameone can help maintain the lang#nim layer, in current version, code runner and repl are supported, of cause syntax highlight and indent is supported.
14:23:38shashlickcool to hear 0.20.2 is already on its way, it's been only a month since 0.20.0 tho
14:23:56FromGitter<wsdjeg> the layer page is https://spacevim.org/layers/lang/nim/
14:24:22shashlickanyway, @Araq - I made a c2nim PR that gets it working with 0.19.x - https://github.com/nim-lang/c2nim/pull/172
14:24:41*brakmic quit (Remote host closed the connection)
14:25:23FromGitter<alehander42> The
14:25:28*brakmic joined #nim
14:26:40*absolutejam quit (Read error: Connection reset by peer)
14:26:50Zevvwsdjeg: can the nim stuff be isolated from the rest of spacevim? I like my vim pretty bare bones
14:27:08Zevvor is that against the philosophy of spacevim
14:27:13*absolutejam joined #nim
14:28:40leorizehere's spacevim nim layer :p https://github.com/wsdjeg/vim-nim
14:32:09leorizelooks like it's a nvim-nim fork
14:44:25*vlad1777d joined #nim
14:48:08FromGitter<brentp> I have a nim wrapper of a c library. then ABI and API of the c library is changing. Is the best way to handle this (with backwards compatibility) to have 2 separate branches? or anyone have an example of something like this?
14:50:42*lritter joined #nim
14:51:58Araqthe best way then is to wrap via .header
14:52:18Araqso that the C compiler hopefully can detect errors and changes
14:52:39Araqbetter to compile it via C++ though, C type checking is broken beyond repair.
15:00:44*jmiven quit (Remote host closed the connection)
15:01:25*jmiven joined #nim
15:01:34FromGitter<brentp> you mean instead of using dynlib? the code in question is here: https://github.com/brentp/hts-nim/blob/master/src/hts/private/hts_concat.nim
15:02:07FromGitter<brentp> and you mean to distribute the C code with my lib?
15:03:34disruptek`niminal`. i love it.
15:05:32disruptekso, near as i can tell, the aws generated api `awsome` doesn't actually implement making calls or parsing results. everything else, sure, but not that.
15:05:40*absolutejam quit (Ping timeout: 272 seconds)
15:05:48narimiranZevv: spacevim and 'bare bones' don't really go together ;)
15:09:02Araqbrentp: I'm not sure. I think I do.
15:20:53*abm quit (Ping timeout: 245 seconds)
15:27:05*PMunch quit (Ping timeout: 268 seconds)
15:27:24*PMunch joined #nim
15:31:58*nsf quit (Quit: WeeChat 2.4)
15:32:01*solitudesf joined #nim
15:32:50*rockcavera quit (Remote host closed the connection)
15:34:55*rockcavera joined #nim
15:37:09*PMunch quit (Read error: Connection reset by peer)
15:42:17FromGitter<brentp> @Araq, ok. I'll consider it.
15:48:05lmariscal@dom96 opened a PR to fix the git submodules issue https://github.com/nim-lang/nimble/pull/677
15:48:12rayman22201@Araq, @dom96, did you guys see my ping or chat with @Zevv earlier today? Any thoughts?
15:48:14lmariscalwaiting for the CI
15:48:25dom96rayman22201 nope, link?
15:48:37dom96lmariscal thanks, I'll try to review tonight
15:49:27rayman22201https://irclogs.nim-lang.org/16-07-2019.html#04:57:35
15:51:08rayman22201Specifically this: http://ix.io/1ODd
15:51:42*PMunch joined #nim
15:51:44dom96wat, async event losing events is expected behaviour? Zevv?
15:52:21dom96yeah, we'd need to make `callback=` a method :/
15:52:49dom96hmmm
15:53:44dom96That really sucks
15:53:51dom96There must be a way to work around this though
15:54:03dom96Araq should have some ideas
15:54:43AraqI don't understand why it's necessary
15:55:43dom96One idea: inject `if next552035 of FlowVarBase: next552035.initAsyncEvent`
15:55:56rayman22201It allows us to optimize flowVar so that it only creates an async event when you are actually using async. If are doing spawn without async, why waste an FD?
15:55:59Araqlazy init of AsyncEvent seems to be a terrible idea anyway
15:56:08dom96but no, that won't work if someone doesn't want to use the async macro
15:56:29dom96rayman22201 explains it perfectly
15:57:29Araqso write an AsyncEvent that is not based on a FD.
15:57:49Araqin other words
15:58:02Araquse a single AsyncEvent + a unique ID
15:58:14rayman22201Zevv is doing that too in parallel to me
15:58:26Araqand then check for this ID, only if equal, it's a trigger you cared about
15:58:47dom96It's still an extra allocation which sucks
15:59:05Araqit's a couple of integers, I don't see an allocation
15:59:20dom96AsyncEvent is a ref, no?
15:59:47AraqI don't know. if it is, cache it in a .threadvar
15:59:58*salewski joined #nim
16:00:18rayman22201It's not that terrible, just seemed like a nice optimization.
16:00:29Araqlazy init for events seems to be a very bad idea for reliability
16:00:53rayman22201We will be fine without it. The better asyncEvent from @Zevv is much more important.
16:01:50dom96conceptually it makes more sense to init the async event when the FlowVar is awaited IMO
16:01:59dom96I don't understand what reliability problems this can introduce
16:03:49*laaron quit (Remote host closed the connection)
16:05:24Araqwhen the FlowVar is awaited it might have been completed already, it's racy
16:05:26salewskiDo we have any hint for this guy? https://github.com/StefanSalewski/gintro/issues/51
16:05:34salewskiAll these table impl error?
16:05:41salewskiAnd Dom, do you know the nimble command to install older package version? Seems he does not know, me two.
16:05:48salewskinimble install gintro@"= v0.5.1" or nimble install gintro@"= 0.5.1" or nimble install gintro@"v0.5.1"
16:05:54salewskiOver.
16:06:35*laaron joined #nim
16:08:16Araqsalewski: the table impl errors are meaningless
16:08:29salewskiOK, thanks.
16:08:35Araqthe first error is what counts, gintro-0.5.2/gintro/gtk.nim(49761, 23) Error: undeclared identifier: 'DBusProxyClass00'
16:08:58salewskiOK.
16:09:05Araqbtw ... line 49761 ?
16:09:38salewskiYes, that is the generated gtk.nim file. I have this symbol not :-(
16:10:16salewskiHe has a different gtk version, but he should also not have it.
16:10:26Araqwhy generate it at install time? I c2nim'ed gtk2 and lived with the result :P
16:10:45salewskiSo I suggested installing older version of gintro, but can not tell him exactly how to do.
16:11:43salewskiWe have discussed thatlong time ago, is because all the various versions. Is similar to the shashlick,
16:12:00salewskiyou have discussed it with him, about his tools.
16:12:08Araqyes. indeed.
16:12:15salewskinimteropt I think.
16:12:53salewskiLater I may provide ready made files, but on the fly generation for nimble install
16:13:22Araqnimteropt has very good CI coverage so I had to shut up about it.
16:13:29salewskigenerally works fine. We would need various gtk versions, 32/64 bit, win, mac, linux.
16:13:50rayman22201Good point about the race conditions @Araq. That can be accounted for, but it seems like it's easier just to leave the asyncEvent in the constructor
16:13:53salewskiThis gue is the only one with problems, ...
16:14:22Araqthe idea itself remains terrible IMO. So now everything depends on the local machine's setup.
16:14:37narimiransalewski: `nimble install pkgname@tag`
16:14:59Araqand then all you can do is "shrug, works on my machine"
16:15:30salewskinarimmiran, thanks. will try myself and tell him.
16:16:31Araq"various gtk versions, 32/64 bit, win, mac, linux" -- well guess what, if you truly support all these combinations, you gotta test for them.
16:16:38salewskiYes, maybe I can send him a ready made file. Have suggested using another GUI package already.
16:16:48salewskiBye.
16:16:50Araqbye
16:16:52*salewski quit (Quit: WeeChat 2.4)
16:20:55shashlick@salewski - are you looking to generate wrappers?
16:25:24*salewski joined #nim
16:26:08salewskishashlick, you know i made the gintro package, the gobject-introspection based packages
16:26:43salewskifor all that gtk related modules, high level. And before I made oldgtk with c2nim.
16:27:15salewskiI know you were talking about making one yourself, good look. Hope it will be high level and will work
16:27:27salewskiwith new runtime fine! :-)
16:27:49shashlicknaah, i've been stuck in c2nim/nimgen/nimterop world
16:27:57shashlickenabling people to build wrappers
16:28:18shashlickrather building wrappers that i don't use myself 🙂
16:29:17salewskiBut maybe better make a Qt one, seems to be more popular. I know you are fast, but it is work for you for a few yeras fulltime. :-)
16:29:26salewskiBye.
16:29:52shashlick👍
16:30:16*salewski quit (Quit: WeeChat 2.4)
16:32:24disruptekAraq: so why not `return`?
16:32:41disruptekyou seemed to be suggesting that you prefer not to.
16:35:40AlexMaxw/ 12
16:39:00shashlick@Araq - `nim doc` doesn't populate currentSourcePath - is this a bug that can be fixed?
16:39:02*theelous3 joined #nim
16:39:43dom96> when the FlowVar is awaited it might have been completed already, it's racy
16:39:44dom96Araq: that's something we have to check anyway
16:40:21dom96When setting the callback, if the FlowVar is already complete then we just call the callback immediately
16:40:34dom96No need for the AsyncEvent in that case either
16:46:30*sniffdtek quit (Remote host closed the connection)
16:46:43*theelous3 quit (Ping timeout: 245 seconds)
16:46:44*sniffdtek joined #nim
16:52:58rayman22201That's not what we do currently. We create both the asyncEvent and set the callback in the constructor. Before the spawn ever starts. No race condition, and no need to check for completion. If the spawn completes immediately, it just immediately calls the asyncEvent.trigger, which was guaranteed to already exist.
16:54:13*nsf joined #nim
16:55:34*PMunch quit (Remote host closed the connection)
16:56:16rayman22201The flowVar checks for immediate completion, just like Futures do, but we don't have to modify any of that code. By setting up the asyncEvent in the constructor, we get all that machinery for free. It all just works tm.
16:57:55rayman22201We can do the optimization. But the complexity of the code change goes way up.
16:59:54rayman22201This is on top of fixing the loss of type info bug, by either making the callback setter a method or modifying the async macro
17:00:09rayman22201Is the extra complexity worth it?
17:00:37Araqbtw I hate to be that guy but ... 90% of the effort comes after the initial implementation.
17:01:13Araqonce spawn "works with" async, you need to add tests and ensure they are green on all the supported platforms
17:01:21rayman22201Agreed.
17:01:56rayman22201I was willing to do the optimization if it was easy. But it's obvious not so easy, so I no longer think it's worth it.
17:02:14Araqand you need to be able to debug this. (Which is why I'm so excited about the new runtime.)
17:03:01*abm joined #nim
17:03:08dom96Sure. I agree that the complexity has gone too far
17:03:15*xace quit (Read error: Connection reset by peer)
17:03:17dom96Let's fix it by fixing async events
17:03:52rayman22201Yay. Go @Zevv, save the day 😝
17:08:16*UNIcodeX joined #nim
17:12:30*absolutejam joined #nim
17:13:30*Trustable joined #nim
17:15:43Zevvsup?
17:16:43Zevvbtw I closed the event PR, but actually I do not agree: there is a significant different behaviour between platforms, which I think is not acceptable
17:17:11Zevvwhatever the initial semantics of the design, this is just broken and leads to surprises
17:24:43dom96of course
17:24:50dom96Why is losing events acceptable though?
17:25:00dom96If anything your change makes most sense to me
17:26:10dom96Perhaps I misunderstand what you mean by "losing events"
17:26:25dom96s/losing/dropped/
17:26:42*absolutejam quit (Ping timeout: 245 seconds)
17:33:30Zevvi have been told thats the semantics of events, and my fix makes it into a semaphore - which is the exact behaviour of the other platforms
17:39:19*floppydh quit (Quit: WeeChat 2.5)
17:44:30*absolutejam joined #nim
17:45:57*actuallybatman joined #nim
17:50:59*Trustable quit (Remote host closed the connection)
18:02:21FromGitter<Obround> Is there something like python's exec statement in nim?
18:02:33*vlad1777d quit (Ping timeout: 245 seconds)
18:09:43*actuallybatman quit (Ping timeout: 246 seconds)
18:09:54*al_ joined #nim
18:26:30*al_ quit (Quit: al_)
18:31:17*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:31:26*stefanos82 quit (Quit: Quitting for now...)
18:45:58federico3see osproc
18:47:34federico3ah, no exec() is something else
18:48:29*actuallybatman joined #nim
18:55:30*absolutejam quit (Ping timeout: 248 seconds)
18:57:46AraqObround: you can import the Nim frontend+VM into your program, see the tcompilerapi test for details
19:09:59FromGitter<Obround> <Araq> -- Thanks, I ran the test and it worked :) The only thing is that I want a simpler api, like a proc that is built into some module; But if not, I think I would be fine with the tcompilerapi test:)
19:10:12rayman22201the event PR I was referring to was the uniqeID fix @Zevv. The "losing events" thing is separate I thought?
19:20:49*absolutejam joined #nim
19:21:51*laaron quit (Remote host closed the connection)
19:25:47Zevvyes, its separate. But when sending the ID through the pipe in our "fd leak fix" the behaviour changes to match the other impls
19:26:16Zevveach one trigger generates exactly one event.
19:27:50FromGitter<kaushalmodi> added an "fmt" target to my config.nims: https://github.com/kaushalmodi/nim_config/commit/c446fba79677e85d43b7520f98f5e1f05ac6fdd5
19:27:53FromGitter<kaushalmodi> works pretty well
19:27:55FromGitter<kaushalmodi> :)
19:28:13FromGitter<kaushalmodi> from anywhere in my git repo, I simply need to type "nim fmt"
19:28:49*sniffdtek quit (Remote host closed the connection)
19:29:04*sniffdtek joined #nim
19:30:15*jjido joined #nim
19:35:51dom96Zevv, can you elaborate on the behaviour currently on Linux vs. as a semaphore?
19:40:57*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:43:50*fjellfras joined #nim
19:45:14ZevvSee the snippe in pr#11728: ioselectors have SelectEvents, which you can .trigger(). On the _epoll implementation (linux default) this is implemented using eventfd(), which is basically a kernel-maintained counter. If you do 100 writes to the fd and only then handle the read end, you get only one read() result. (Nim does not use the counter value). The example snippet triggers 100 events, and counts how many
19:45:20Zevvevents are received. On linux this is 1, on all other platforms this is 100
19:46:01disruptekAraq: i hate to say it, but re.match seems to have a bug: it does not populate the var matches: openarray[string] with matches when matches is a seq, though it works fine when it's an array.
19:46:21Zevvcheatfate mentions in the PR that windows also acts like an event, but when I tested the windows version I also got a 100
19:47:39ZevvI *did* test on wine instead of a real windows, so if anyone with a windows machine could run the snippet in https://github.com/nim-lang/Nim/pull/11728, I'd be interested in the result.
19:47:59ZevvAnd now I'll leave this for what it is until someone decides what is right and what is wrong
19:49:22Zevvrayman22201: so whats the plan with the async stuff?
19:49:23dom96I see. In that case this makes sense, for the FlowVar use case this doesn't make a difference
19:49:34dom96but this needs to be consistent
19:50:05dom96hrm
19:50:09Zevvdom96: yes but no but yes but: the change rayman22201 and me made up will drop eventfd() and use a pipe on linux as well - changing the behaviour
19:51:07dom96To be honest this doesn't make sense. I would expect an async event to be "ready" forever as soon as it is triggered once
19:51:40dom96so I'm not sure your sample makes sense
19:51:54ZevvI'm not saying it makese sense, I'm just saying the behaviour is different and that is wrong
19:51:58dom96triggering an event more than once should have no effect
19:52:14dom96sure, but the behaviour you're expecting is wrong too
19:52:14ZevvI don't care if its either one, but it should behave the same on all platforms
19:52:50ZevvMy assumption was that epoll was wrong because that differs from select and poll - but that assumption turned out to be wrong, the other two are at fault
19:53:09dom96but maybe the way I'm thinking about it is wrong too
19:53:19rayman22201So we fix the other 2?
19:53:23dom96I find the idea that `select` changes the async event weird
19:53:39Zevv*but*: if we want to send multiple events trough one fd, we need to send the event IDs as data through the pipe. And then you can't coalesce, so one trigger gives one event
19:53:46dom96the triggered status shouldn't change when the event is selected
19:54:19ZevvIf you trigger event 1, 2, 3 and 2 again, there are 4 ints in the pipe, two of which are '2'
19:54:28*yeetcannon joined #nim
19:54:34*cyraxjoe joined #nim
19:54:52Zevvthe read and could mitigate this by flushing the whole pipe instead of only one int (As now happens in select and poll), then make a set of all events it found, and after that call the callbacks
19:54:55disruptekyer blowin' my mind right now.
19:55:14dom96the event numbers should probably be modelled as a set
19:55:25rayman22201Right. @dom96 we have added a layer of abstraction to asyncEvent. So select is not 1 to 1 with socket reads anymore
19:55:26dom96we need to come up with a proper API spec for this
19:55:53dom96rayman22201, not sure what you mean by the last sentence
19:56:24rayman22201Or I should say, asyncEvent triggers are not 1 to 1 with socket reads.
19:57:19dom96You're saying that an async event being triggered is not the same as a socket being /readable/?
19:57:38FromGitter<rtnlmeme-DestroyerOfDeath> g
19:58:02rayman222011 socket being readable = potentially many events being triggered
19:58:11*nsf quit (Quit: WeeChat 2.4)
19:58:20Zevvrayman22201: we're not making it any clearer i think :)
19:58:33Zevvdom96: should I elaborate here or should I write something down somewhere else?
19:58:43rayman22201Damnit lol. I need a brain to brain interface 😝
19:58:52dom96if you can do it in a sentence then do it here, otherwise write something :)
19:59:00dom96*...something somewhere else
19:59:41rayman22201You are right that the IDs should be a set, but I think a monotonically increasing counter is enough.
19:59:47Zevvok: we are talking two different issues, 1) the async events causing too many fds. 2) while fixing this, I figured the select events behave differently on the various backends
20:00:30Zevvit seems though that what I though was wrong - as it differed from the majority - seems to be right: N triggers result in only 1 readable-select
20:01:23disruptekthat's the point of select.
20:01:40dom96Okay, then I guess I am talking about a 3rd issue: it's weird that a single select(eventfd)/poll(eventfd)/epoll(eventfd) changes the eventfd's triggered state
20:01:45Zevvthe "fix" we came up with for the async events changes this bahaviour - we will now make only one file descriptor, and each trigger gets an unique ID that gets written into the pipe. The read end of the pipe will now get separate data for each trigger. If you send 5 events, you get 5 uint64s in the pipe.
20:02:22ZevvThe solution is pretty simple: instead of reading only 1 uint64 when the fd is ready, we read all N uints, put the IDs we find in a set, and when all data is flushed, only then we call the callbacks.
20:02:36Zevvso if event X is triggered Y times, we only call the X callback once
20:03:13rayman22201+1
20:03:45ZevvOne issue I can think up is that the pipe can get full when too many events are triggered. *BUT* this is already the case with the poll and select implementations since those are wrong anyway.
20:04:00dom96we don't use poll/select though
20:04:40Zevv elif defined(windows):
20:04:40Zevv include ioselects/ioselectors_select
20:04:49rayman22201I'm pretty sure we do lol
20:05:02dom96Why don't you simply use a single AsyncEvent + a set[int], trigger the AsyncEvent and add to the set when an event ID is triggered?
20:05:17dom96Zevv, rayman22201: the selectors module isn't used on Windows, IOCP is
20:05:28dom96(the logic for this is in asyncdispatch)
20:05:50Zevvpff ok I missed that one
20:05:54dom96I mean, I'm sure _someone_ uses the selectors module on Windows, but it's not what backs async await
20:06:15rayman22201Ok, but on Linux it's epoll.
20:07:01Zevvdom96: so do we send the set over the fd, or make the set shared memory?
20:08:04dom96Zevv, each thread has its own selector/dispatcher anyway
20:08:15dom96so you can just put it in the selector or dispatcher
20:08:28Zevvyeah, but it needs to be under a lock
20:08:37rayman22201But the unique id must be passed across thread boundaries
20:08:47dom96Why does it? Each thread has its own separate dispatcher
20:08:55Zevvhas it?
20:09:05dom96yes
20:09:09Zevvwtf
20:09:25dom96That's how threads work in Nim, each thread gets its own heap
20:09:53rayman22201Yes. But the whole point of spawn is that you need the new thread to communicate it's unique event is finished to the origin thread
20:10:01Zevvyes, but the whole point was that thread A can wait for a flowvar from thread B in A's async selector?
20:10:21disruptekthese concepts aren't exclusive, guys.
20:10:39Zevvright! ^
20:10:53rayman22201That's exactly what we are saying
20:12:16rayman22201Idk about @Zevv, but I knew that each thread gets it's own asyncdispatch.
20:12:19dom96As far as I understand the flowvar gets triggered in the thread which owns the AsyncEvent
20:12:24ZevvI shouldn't be doing this. I decided 10 years ago that I'm not smart enough to do anything with thread or concurrency :(
20:13:07rayman22201I have faith in you @Zevv
20:13:23rayman22201@Dom96, really? Interesting. How is that done?
20:13:39dom96I have no idea :)
20:13:47Zevvyeah of course each thread gets its own asyncdispatch - but a typical use case would be the main app doing async stuff, spawning a thread for some work and then receiving the flowvar from that thread in its async loop, right?
20:13:58rayman22201correct
20:14:07rayman22201I know flowVar has a semaphore in it.
20:14:14rayman22201But the other thread has to trigger the semaphore
20:14:38ZevvSo thread B needs to indicate to thread A that an event is ready. If there is also thread C or D, that does not change anything, but all threads need to be able to indicate these events in a set, which is a) in shared memory and under a lock or b) sent over the pipe
20:15:23Zevvif these threads want to do the same dance to the other side, then thread A pokes its event in the set of thread B
20:16:09Araqdisruptek: report it properly
20:16:18Zevvso each thread *can* have its own selector. But other threads need to be able to indicate an event. If the individual events can not go over the pipe, we need a sharedSet
20:16:35disruptekAraq: aight.
20:19:43rayman22201Yeah. I'm with @Zevv here. Using the pipe was a way to have to OS do the synchronization and sharing for us.
20:21:18dom96I feel like we're still misunderstanding each other
20:21:39dom96Main thread: let f = spawn foo() # `f` is in "main" thread
20:22:01dom96await f # you use main thread's dispatcher
20:22:14dom96`spawn` handles the inter-thread communication for you
20:22:59dom96Araq will know how that works, but I'm 90% sure the `signal` procedure that rayman22201 modified in his PR will be run in the "Main" thread
20:23:04dom96(under my example)
20:23:53rayman22201that's true, but what if you modify your example to have two `spawns`. How will the "Main" thread know which `signal` to trigger?
20:24:00AraqI didn't really follow your discussion, sorry
20:24:16FromGitter<akavel> Hi! I need to emit an extra binary artifact file during *compilation* of my Nim program (from some macros). Seeing that there's `staticRead` and `staticExec`, I thought there would be a *staticWrite* too, but I don't seem to see one. Is there some way I can do that? Or am I approaching this wrong? If so, what should I do instead?
20:24:22rayman22201Araq even suggested the same solution we are implementing earlier today...
20:24:36Araqhowever, please give yuriy's threadpool implementation a try
20:24:46Araqit doesn't use magics and is much easier to hack
20:25:06Araqand the stdlib's threadpool is moribund anyway
20:25:53dom96rayman22201, no idea, but somehow it does, otherwise this wouldn't be GC safe
20:25:58Araqakavel: static: writeFile(...) should work
20:26:13shashlickwhy does parentDir() not work at compile time?
20:26:20dom96Araq, how is the `signal` proc triggered for a flowvar?
20:26:24FromGitter<akavel> @Araq: oh, ok, thanks!
20:26:43Araqshashlick: I don't know
20:27:24Araqdom96: iirc the thread calls it when it's done with the given task
20:27:37*sniffdtek quit (Remote host closed the connection)
20:28:01dom96Araq, yeah, and it calls it outside the spawned thread? right?
20:28:08shashlickAraq: actually, parentDir() works with `nim c` but not with `nim doc`
20:28:11dom96it calls it from the thread that called `spawn`
20:28:14dom96right?
20:28:15shashlickat compile time
20:28:40*sniffdtek joined #nim
20:28:46Araqshashlick: strange... maybe 'nim doc' gets some internal setting wrong
20:30:02shashlickokay, so it works with `/` but not with `\`
20:30:34Araqdom96: I don't think so. the thread that is done with the task calls 'signal'
20:30:46Araqor rather nimFlowVarSignal
20:31:13FromDiscord_<j$> when importing the selectors module I get "../i686-w64-mingw32/bin/ld.exe: cannot find -lws2_32", has anyone run into this before?
20:31:26Araqthen triggers the "parent" thread to wake up and to get the result
20:31:52Araqj$: it's a mingw problem, you use the wrong mingw version
20:32:06dom96If that is the case then I don't understand how rayman22201's PR works
20:32:26rayman22201yeah, it's the slave that signals, see here: https://github.com/nim-lang/Nim/blob/devel/lib/pure/concurrency/threadpool.nim#L374
20:32:28dom96if the FlowVar is in the spawned thread then there is no way the async proc can set a callback on it
20:32:33FromDiscord_<j$> well Im just using the version that comes with nim
20:33:12rayman22201The FlowVar is in the main thread, you are correct @dom96. But the slave has to communicate with that main thread to say that it is done.
20:33:51*rayman22201 remembers the social justice warrior "slave" naming scandal a few months ago >.<
20:34:32dom96https://github.com/nim-lang/Nim/blob/7fac17eb5e3fc4c93093aae141db76025f3fd3b9/lib/pure/concurrency/threadpool.nim#L253
20:34:42dom96So this must be executed in the main thread
20:35:07dom96ergo the async event is triggered in the main thread too
20:35:21dom96so there is no need to worry about communicating across threads with pipes
20:36:57rayman22201https://github.com/nim-lang/Nim/blob/9db369063c4d14d775015df8f7490d23603827f3/compiler/spawn.nim#L155
20:37:08rayman22201That is just a convenience method to hide the underlying thread communication
20:37:14rayman22201which is done with a barrier
20:37:25dom96yes
20:37:31dom96so the communication is handled for us
20:38:21Zevvsorry ppl, it has been quite a day and I need to get up pretty early tomorrow - I'll leave you guys to it. I guess I'll hear from either of you if my assumptions were wrong here
20:38:28Araqj$ well I don't know. what we ship has been tested extensively on different machines
20:38:29Zevvlater
20:38:35rayman22201ok. sleep well!
20:39:12*narimiran quit (Ping timeout: 245 seconds)
20:39:17AraqI guess you also have some different mingw installation?
20:40:38rayman22201@Dom96, wait. I might finally understand what you are saying. Instead of keeping the unique ID with the asyncEvent, keep the unique ID with the FlowVar?
20:41:00*shomodj joined #nim
20:41:45rayman22201am I hot or cold here lol?
20:42:01dom96warm I guess :)
20:42:09rayman22201lol
20:42:14dom96You keep the async event with the flowvar already
20:42:23rayman22201That will fix FlowVars, but won't fix asyncEvents in general.
20:42:25dom96so it doesn't matter whether you keep it in async event or in the flowvar
20:42:52dom96I just don't think you need the pipes
20:42:55Araqas I said, please use the alternative threadpool impl, it's simpler
20:43:04Araqand simple is what you need.
20:43:19dom96Araq, I think that should be a separate PR
20:43:24rayman22201ignore FlowVar and threads for a minute. Right now, every newAsyncEvent creates a new fd.
20:43:26dom96I doubt it'll simplify this case much
20:43:30rayman22201it's not a thread problem
20:43:34dom96Yes, I know
20:43:34Araqdom96: I'm not talking about PRs
20:43:45Araqyou're doing a valuable experiment
20:43:56dom96I'm proposing you introduce a single AsyncEvent, store it in the async dispatcher
20:43:56Araqthe PRs should come later.
20:44:12dom96store a set of eventIDs that have been triggered in this one true AsyncEvent
20:44:20dom96and only create one FD for that one true AsyncEvent
20:44:23dom96Does that make sense?
20:44:33rayman22201ah. finally! I see now. ok
20:44:57*sniffdtek quit (Remote host closed the connection)
20:44:58rayman22201so you have an "internalAsyncEvent" and an externally exposed asyncEvent.
20:45:02dom96yes
20:45:08dom96exactly :)
20:45:10*sniffdtek joined #nim
20:45:32rayman22201when that one "fd" is triggered on select, how do you know which id was actually triggered?
20:45:41Araqdon't think about PRs. Make it rocksolid first
20:45:55rayman22201when the one "internalAsyncEvent" is triggered I mean.
20:46:17rayman22201since, as you said before, asyncEvents should only ever fire once, and then never change state?
20:46:59rayman22201If there are many external events for that one internal asyncEvent, then only first event will get through, and the rest will never fire.
20:49:11shashlickAraq - https://github.com/nim-lang/Nim/blob/devel/lib/pure/includes/osseps.nim#L21 is the problem
20:49:22shashlickDirSep and AltSep are both `/` in Nimdoc mode
20:49:33shashlickso `\` is never treated as a path separator in nim doc
20:49:35Araqbah
20:49:37*brakmic quit (Ping timeout: 245 seconds)
20:49:48Araqso nimscript doesn't work with nimdoc
20:50:54shashlickI am trying to generate docs for nimterop wrappers but since i use currentSourcePath.parentDir(), it doesn't work properly
20:51:11shashlickin fact, even ExeExt = "" so nothing works as expected on Windows for nim doc
20:51:38dom96rayman22201, I'm sure there is a way to track this :)
20:51:47rayman22201I'm sure there isn't :-P
20:51:54rayman22201that is why we went the way we did
20:51:56shashlickwhy is Nimdoc a separate OS category?
20:52:38FromGitter<GULPF> @shashlick so the doc comments don't need to be duplicated I think
20:53:15Araqyes.
20:53:18FromGitter<GULPF> I think there was a PR to fix it, but it was rejected
20:53:39AraqI doubt it.
20:53:57Araqthe PR likely had some issues :P
20:54:35shashlicknot sure i get it, but how do you propose fixing this? osseps shouldn't be impacted by nimdoc mode
20:55:02FromGitter<GULPF> https://github.com/nim-lang/Nim/pull/10629
20:55:12rayman22201the problem is that currently, all the underlying select impls, and asyncdispatch accordingly, assume every event is a unique fd. this can be seen by the fact that the fd is used as the index to access the callbacks. And by the fact that for `event.user` the pipe data is completely ignored.
20:55:21dom96rayman22201, what makes you so sure?
20:56:14dom96A naive implementation could be a `lastTriggeredEventIDs` set[int] that is set when an AsyncEvent is triggered
20:56:25dom96and then you know which events were just triggered
20:57:04rayman22201wat?
20:57:12AraqGULPF: ok :-)
20:57:38rayman22201how is `lastTriggeredEventIDs` populated?
20:57:46Araqfair enough. I still like 'const dirSep = selectSep('/', '\\') ## doc comment here' better
20:58:42*solitudesf quit (Ping timeout: 248 seconds)
20:58:47dom96rayman22201, when the AsyncEvent is triggered
20:59:38rayman22201actually.... yeah, ok. The trigger event can add it's id to the set. but this seems racy.
21:00:08dom96okay, so think about how to make it not racy :)
21:01:45rayman22201hrmmm.
21:02:13*fjellfras quit (Quit: Leaving)
21:03:47shashlickwhat is selectSep()
21:04:33*brakmic joined #nim
21:05:12*altarrel joined #nim
21:08:00*Jesin quit (Quit: Leaving)
21:10:19rayman22201ok. so my back of the envelope linearizability calculations (lol) tell me that if we can guarantee the event is always added to the set before the fd write is triggered (single threaded context), no events can be lost. The worst that can happen is a noop select event. And that can be mitigated by batch signaling.
21:11:10*Jesin joined #nim
21:11:42*altarrel quit (Quit: Leaving)
21:11:57*altarrel joined #nim
21:12:03rayman22201since the main thread always owns the asyncEvent (and can thus be the only thread that ever triggers the event). It should work out ok.
21:12:14rayman22201You convinced me @Dom96 :-P
21:12:18shashlickokay I see the intention, but this means `nim doc` is basically broken for all OS except posix - all procs that refer to any of these consts will be using the wrong value
21:12:24rayman22201but now I need to eat lunch. bbl
21:12:42dom96rayman22201, :D
21:13:24Araqshashlick: fix it?
21:14:56shashlicki'll look into it - looks like no one understood the issue in the thread
21:16:23*altarrel quit (Client Quit)
21:16:38*altarrel joined #nim
21:16:47*altarrel quit (Client Quit)
21:17:10*altarrel joined #nim
21:17:10*altarrel quit (Client Quit)
21:17:40*altarrel joined #nim
21:17:57*altarrel left #nim (#nim)
21:18:08*altarrel_ joined #nim
21:18:14disruptekit works, champ.
21:21:52*jjido joined #nim
21:31:09shashlickhttps://github.com/nim-lang/Nim/issues/10630
21:34:40*abm quit (Quit: Leaving)
21:36:11*actuallybatman quit (Quit: leaving)
21:37:47*actuallybatman joined #nim
21:50:46*altarrel joined #nim
21:51:34*altarrel quit (Client Quit)
21:51:51*altarrel joined #nim
22:02:11FromGitter<awr1> https://forum.nim-lang.org/t/5014
22:02:32FromGitter<awr1> i saw this forum post and don't get what is meant by "reflection support = part" for nim
22:02:55FromGitter<awr1> i don't really see what's missing from reflection in nim
22:05:31Araqwell in Java you can construct an object from the type name as a string and then call a method on it etc
22:05:45Araqin Nim you need to build the datastructures to support that
22:05:59Araqso you're on your own, but it's possible
22:06:21Araqthanks to macros.
22:06:59*brakmic quit (Read error: Connection reset by peer)
22:07:29*brakmic joined #nim
22:09:32FromGitter<awr1> i guess but to do that at runtime requires a VM, at which point you have to ask yourself "why"
22:10:00disruptekno.
22:10:00FromGitter<awr1> or some kind of more verbose RTTI
22:10:46*brakmic quit (Read error: Connection reset by peer)
22:10:50*brakmic_ joined #nim
22:11:29Araqyeah, well. most usecases for reflection are workarounds for a missing macro system
22:14:07FromGitter<mratsim> how is dereferencing a typedesc supposed to work, it has no address: https://github.com/nim-lang/Nim/issues/11747 ?
22:14:42FromGitter<awr1> there's no impl for [] on types, but theoretically it would just resolve to the underlying referrent type
22:15:37Araqmratsim: fixed here: https://github.com/nim-lang/Nim/pull/11751
22:16:09FromGitter<awr1> does `echo sizeof(MyRefType()[])` actually perform an allocation
22:16:16Araq TypeHere[] is still a type
22:16:31Araqso you can use it in sizeof() but not in 'addr', simple.
22:16:44Araqawr1: I think so, yes.
22:16:52FromGitter<awr1> :|
22:17:02Araqbut maybe not, lol
22:17:06FromGitter<mratsim> @awr1 you may be able to write that in static
22:17:14FromGitter<mratsim> but I think the VM will complain
22:17:32Araqthe VM has sizeof support nowadays
22:17:41FromGitter<mratsim> but not dereferencing
22:17:47FromGitter<mratsim> does it?
22:18:13Araqthe VM supports derefs in so far they can be supported
22:18:27FromGitter<awr1> shouldn't this be reflected in the docs too?
22:18:32Araqthe VM uses a symbolic representation so bithacks don't work
22:19:18*Vladar quit (Remote host closed the connection)
22:20:17FromGitter<awr1> also @Araq i wanted you to take a look at this
22:20:18FromGitter<awr1> https://github.com/nim-lang/Nim/pull/11742/files
22:20:24FromGitter<awr1> is this too janky or is it okay
22:20:51FromGitter<awr1> it allows us to get away with not having to add another compiler flag (or something like that)
22:24:14AraqI reviewed it
22:25:05FromGitter<awr1> ok thanks
22:26:08FromGitter<kaushalmodi> Any thoughts on this: https://github.com/nim-lang/Nim/issues/11755 ?
22:27:10FromGitter<kaushalmodi> Currently how the if and else, case and of's get nimorettified at different columns makes the code less readable IMO
22:28:01Araqwell I agree
22:28:22Araqrequires yet another concept to learn for nimpretty
22:28:34Araq*to be learned
22:28:48Araqso don't expect any quick fix
22:29:17Araqworkaround, write
22:29:20Araqlet x =
22:29:24Araq case cond
22:29:28Araq of ...
22:29:43*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:29:49FromGitter<kaushalmodi> Hmm, nimpretty pulls up the case to the above line
22:30:17FromGitter<kaushalmodi> At least it did that when I had similar with if condition starting from the next line
22:30:31FromGitter<kaushalmodi> But of course, I am not expecting a quick fix.
22:30:35Araqcan't try it right now
22:31:09FromGitter<kaushalmodi> Just a collective affirmation if my suggested nimpretty output does make sense
22:31:50Araqactually ... nimpretty could at least say "er, case/if expression, not gonna touch these until I understand them"
22:33:33Araqyay, new version of IUP, http://webserver2.tecgraf.puc-rio.br/iup/
22:34:33Araqwith new words like EXTRAPRESSCOLOR for the dyslexic among us.
22:34:56FromGitter<awr1> does nimpretty do hanging idents on call arguments, e.g.
22:35:49FromGitter<awr1> ```foo(bar, ⏎ baz)``` [https://gitter.im/nim-lang/Nim?at=5d2e51455fa7895c4313a0fe]
22:37:13FromGitter<kaushalmodi> > actually ... nimpretty could at least say "er, case/if expression, not gonna touch these until I understand them"
22:37:18FromGitter<kaushalmodi> That would be great too
22:38:16FromGitter<kaushalmodi> Actually, nim-mode in Emacs does the "right thing" when I hit enter after if condition or in a case expression.. it brings the cursor on the newline at my expected column
22:39:35FromGitter<awr1> yeah i noticed that too
22:40:57FromGitter<awr1> does the nim major mode use something from the python mode?
22:41:13*absolutejam quit (Ping timeout: 258 seconds)
22:41:36FromGitter<kaushalmodi> It's heavily based off python-mode
22:41:55FromGitter<kaushalmodi> If you do a diff between the two, you'll clearly see it.
22:42:49FromGitter<awr1> my only gripe with the emacs mode is the problems it has with nimsuggest
22:43:53FromGitter<kaushalmodi> Yeah, I don't use it
22:44:03FromGitter<kaushalmodi> Hippie-expand FTW
22:44:04FromGitter<awr1> i would use it if it worked
22:44:11FromGitter<awr1> it just crashes emacs
22:49:40*brakmic_ quit ()
22:53:11FromGitter<kaushalmodi> When I last tried, it did not crash Emacs, it just hung up
22:53:23FromGitter<kaushalmodi> So you'd need to Ctrl-G out of it
22:53:56FromGitter<kaushalmodi> If Emacs crashes for whatever reason, you should file an Emacs bug report: M-x report-emacs-bug
22:54:14disruptekshashlick: do i have to do anything special to make nimterop cImport() in cpp mode versus c mode? is it enough to `nim cpp something.nim`?
23:03:51*xace joined #nim
23:26:51*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:43:48*altarrel quit (Remote host closed the connection)
23:47:05*sniffdtek quit (Remote host closed the connection)
23:49:58*krux02_ joined #nim
23:52:55*krux02 quit (Ping timeout: 250 seconds)