<< 27-11-2019 >>

00:01:17FromDiscord_<Kaynato> Oh,, that is... a lot better than what I am dealing with right now, thank you clybber
00:01:42clyybbernp, ping me if you have questions
00:01:54clyybberor if you want it to be updated to the latest vulkan headers
00:08:52*Kaynato joined #nim
00:21:09*ng0 quit (Quit: Alexa, when is the end of world?)
00:29:02*rockcavera joined #nim
00:30:59*krux02_ quit (Remote host closed the connection)
00:32:37*Hideki_ joined #nim
00:37:53*Hideki_ quit (Ping timeout: 276 seconds)
00:43:12*clyybber quit (Quit: WeeChat 2.6)
00:46:41*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:56:16FromDiscord_<sealmove> Zevv: Thanks for the info! I will try to fix my grammar.
01:17:02sealmoveZevv: sorry :( I didn't think it could be a grammar issue. I will debug my grammar before anything, next time.
01:40:54*uu91 quit (Read error: Connection reset by peer)
01:41:12*uu91 joined #nim
01:42:27*disruptek quit (Ping timeout: 250 seconds)
01:42:56*disbot quit (Ping timeout: 252 seconds)
01:58:17*disruptek joined #nim
01:58:27*disbot joined #nim
02:09:32*lvmbdv quit (Ping timeout: 276 seconds)
02:17:01*lvmbdv joined #nim
02:21:44*seni quit (Quit: Leaving)
02:26:56*lvmbdv quit (Ping timeout: 240 seconds)
02:30:16*abm quit (Quit: Leaving)
02:31:48*njoseph quit (Ping timeout: 246 seconds)
02:35:02*lvmbdv joined #nim
02:35:32*njoseph joined #nim
02:44:14*uu91 quit (Read error: Connection reset by peer)
02:44:43*uu91 joined #nim
02:49:47*sagax joined #nim
02:52:48*crem quit (Ping timeout: 245 seconds)
02:54:36*crem joined #nim
03:04:56disruptek!repo npeg
03:04:56disbothttps://github.com/zevv/npeg -- 11PEGs for Nim, another take 8 66⭐15 2🍴
03:05:24*endragor joined #nim
03:07:09leorizedisruptek: oooh your bot got better
03:07:18leorizeany command list yet? :P
03:07:24disruptektry !help
03:07:29leorize!help
03:07:55KaynatoHello, if there's an opportunity for a quick question - due to the interface with a c library, I receive a ptr pointer to what ought to be some sequence of floats. I have a tuple type, FloatVec4 which consists of 4 floats. Is it completely wrong to do something like `var vecdata = cast[ptr FloatVec4](memmap)`?
03:08:48leorizemaybe
03:08:55disruptekkinda; the float type might vary.
03:08:58leorizei don't know if the compiler aligns members in tuple
03:09:19disrupteki would use what you're passed or copy it to your own structure.
03:09:49leorizeconverting to UncheckedArray might be better
03:10:09Kaynatoi was thinking about UncheckedArray but wasn't sure how I would really approach it there
03:10:10disruptekthat would solve half the problem.
03:12:05leorizeso what kind of C voodoo are you interfacing with?
03:12:14Kaynatovulkan
03:12:57KaynatoThis is what I have in that section - Pixel is my 4-float tuple, WIDTH and HEIGHT were passed in as args https://hastebin.com/raw/ejehoyulis
03:14:37leorizeunchecked array please
03:14:48leorizedo you know what kind of float are they using?
03:15:00leorizeif not just assume float32
03:15:21Kaynatomhm, that's what I'm assuming
03:49:03*ponyrider quit (Quit: WeeChat 2.6)
03:53:21Kaynatoalmost working - is there a definite way to convert array[255, char] to string, or to directly do strcmp on the badly typed string?
03:56:30disruptekhit backspace and type it again.
04:00:25*sealmove quit (Quit: WeeChat 2.6)
04:12:01FromDiscord_<Kaynato> Good joke - only if I could do that... The interfacing library defines its own arbitrary maxlength of pseudo-cstring char arrays, and I don't think I can safely replace those with regular cstring in the cimports. I just want to ask if there's any established convention or if I can just do an ad hoc method to convert.
04:15:51*chemist69 quit (Ping timeout: 250 seconds)
04:16:59disruptekthere's no routine to convert from the arbitrary form to a standard cstring? i guess you get to write that yourself.
04:17:24FromDiscord_<Kaynato> Huh, alright then. Thanks for the heads-up
04:17:44disrupteki'd still rather write that stuff in nim than c. 😉
04:17:55*chemist69 joined #nim
04:17:58disruptekhad to do something similar for git.
04:25:01*sagax quit (Remote host closed the connection)
04:27:11*rockcavera quit (Remote host closed the connection)
04:34:24*Hideki_ joined #nim
04:38:51*Hideki_ quit (Ping timeout: 246 seconds)
04:46:03*nsf joined #nim
04:47:46*uu91 quit (Read error: Connection reset by peer)
04:48:04*uu91 joined #nim
04:54:57*Jesin quit (Ping timeout: 265 seconds)
05:20:38*uu91 quit (Read error: Connection reset by peer)
05:20:51*uu91 joined #nim
05:25:06disruptek!repo disruptek/atoz
05:25:07disbothttps://github.com/disruptek/atoz -- 11Amazon Web Services (AWS) APIs in Nim 8 10⭐15 0🍴
05:25:18disruptekadded 5 more apis 🎉
05:35:31FromGitter<Willyboar> !help
05:49:49*sagax joined #nim
06:02:09*kevinchau joined #nim
06:08:12*uu91 quit (Read error: Connection reset by peer)
06:08:28*uu91 joined #nim
06:22:11Zevvdisruptek: why the cutlery?
06:24:03*uu91 quit (Read error: Connection reset by peer)
06:24:21*uu91 joined #nim
06:24:22Zevvhttps://zevv.nl/div/cutlery.png
06:25:51FromDiscord_<WilliamDraco> forks
06:26:25FromDiscord_<WilliamDraco> I.E. 10 stars, 0 forks
06:27:30Zevv0 forks and knives
06:28:08FromDiscord_<WilliamDraco> Still technically correct I'd wager 😉
06:32:26*narimiran joined #nim
06:48:27*solitudesf joined #nim
06:55:49FromDiscord_<Rika> is there a better datatype than seq for "an array with size determined at runtime which never changes size"
06:56:00FromDiscord_<Rika> or is seq best?
06:59:42Zevvlet me turn that around: what is *wrong* with a seq? Because basically it is "an array with size determined at runtime", and not resizing does not cost anything.
07:00:07ZevvThe only downside I can think of is that you would have *many* of these and the 16 byte administration overhead of a seq is too much for you.
07:00:27ZevvIf that is the case, you could just allocate one huge seq and do your own bookkeeping inside it.
07:02:12*LargeEpsilon joined #nim
07:16:14*kevinchau quit (Remote host closed the connection)
07:22:22*uu91 quit (Read error: Connection reset by peer)
07:22:36*uu91 joined #nim
07:27:54*uu91 quit (Read error: Connection reset by peer)
07:28:09*uu91 joined #nim
07:44:36*njoseph quit (Ping timeout: 265 seconds)
07:44:46*uu91 quit (Read error: Connection reset by peer)
07:44:49FromDiscord_<Rika> Zevv, I was asking more of "I do not know if this is the best data type to use"
07:45:08*uu91 joined #nim
07:45:21Zevvwell, I guess it Is, sorry for the rambling :)
07:46:30*PMunch joined #nim
07:53:57*dddddd quit (Remote host closed the connection)
07:55:47FromDiscord_<mratsim> @Kaynato, you can do ptr FloatVec4 if you importc FLoatVec4 to ensure compat
07:56:49FromDiscord_<mratsim> this is a good example of fully importing a C type into Nim: https://github.com/status-im/nim-decimal/blob/master/decimal/decimal_lowlevel.nim#L204-L214
07:57:05FromDiscord_<mratsim> and to import and opaque type just don't list the fields
07:57:11FromDiscord_<mratsim> an*
07:57:19*uu91 quit (Read error: Connection reset by peer)
07:57:36*uu91 joined #nim
07:58:27FromGitter<alehander92> i am surprised you didnt write
07:58:28FromGitter<alehander92> a macro
07:59:14FromGitter<alehander92> which is a good thing, a bit of repetition is fine
08:00:00*gmpreussner quit (Quit: kthxbye)
08:04:52*gmpreussner joined #nim
08:09:55FromDiscord_<mratsim> for FFI when you are exploring, I feel it's easier to just write stuff. Plus it was mostly generated by c2nim
08:10:21FromGitter<alehander92> yep
08:21:31*njoseph joined #nim
08:21:43PMunchHaha, I've been trying to push the binary size of my Nim -> Arduino program down. The .text section of it was originally 23490 bytes compared to the C++ version at 14792 bytes (ouch)
08:22:19PMunchAfter much back and forth with different compilation options and GCC flags I was looking at "nim --fullhelp" for anything that might help
08:22:52PMunchTurns out that --excessiveStackTrace:off was enough to bump it down to 15264 bytes
08:27:03ZevvPMunch: sweet
08:27:14PMunchOh no, wait
08:27:26PMunchIt was apparently the --opt:size flag I had added as well :P
08:27:30PMunchThat makes more sense
08:27:32Zevv:)
08:27:36*solitudesf quit (Ping timeout: 240 seconds)
08:28:16ZevvNot sure if you caught my question yesterday: how does nim handle constants these days? Pretty importand on low ram devices - there were some discussion some time ago that consts always end up in a C variable anyway
08:29:23FromGitter<alehander92> dont they get inlined
08:29:32PMunchYeah they seem to be inlined
08:29:40FromGitter<alehander92> but yeah this means they still have to be somewhere
08:29:50FromGitter<alehander92> e.g. in the data segment? not sure how this all works still
08:31:10ZevvOn atmel it's tricky anyway, the .text section is usually not mapped in the normal address space
08:31:19Zevvyou need special instructions for accessing those
08:32:03ZevvI'm sick and done with all these atmel avrs. For $.20 you get a nice and fat ARM at your local dealer, there is really no use for these things anymore IMHO
08:32:16Zevvthe only reason would be that you want somethign DIL
08:34:34FromGitter<alehander92> hm wat is this
08:34:35FromGitter<alehander92> atmel
08:34:48Zevvatmel AVR MCU architecture.
08:35:11PMunchHmm, this is so weird..
08:36:00PMunchWith -d:release -d:danger I get larger binaries than if I don't include them. But adding --opt:size makes builds with these two flags smaller than those without..
08:36:01*Hideki_ joined #nim
08:36:23PMunchBut only if I have some other --passC flags defined
08:37:12PMunchSeems like it is the -flto flag that causes it to drop dramatically with this combination of flags
08:38:04PMunchBuilding with "-d:release -d:danger --opt:size" in both cases. With "-flto": 15264 bytes, without: 28588 bytes
08:38:25*krux02 joined #nim
08:40:34*Hideki_ quit (Ping timeout: 252 seconds)
08:50:36*PMunch quit (Ping timeout: 240 seconds)
08:51:16*PMunch joined #nim
08:55:05*krux02 quit (Remote host closed the connection)
08:55:52*lritter joined #nim
09:27:10*shashlick[m] quit (Remote host closed the connection)
09:27:20*Connor[m] quit (Remote host closed the connection)
09:27:20*xomachine[m] quit (Remote host closed the connection)
09:27:25*isaac[m]1 quit (Remote host closed the connection)
09:27:26*yglukhov[m] quit (Write error: Connection reset by peer)
09:27:26*Manny8888 quit (Remote host closed the connection)
09:27:27*planetis[m] quit (Remote host closed the connection)
09:27:29*d-nice2[m] quit (Write error: Connection reset by peer)
09:27:30*leorize[m] quit (Remote host closed the connection)
09:27:31*k0mpjut0r quit (Write error: Connection reset by peer)
09:27:32*macsek1911[m] quit (Remote host closed the connection)
09:27:32*meff[m] quit (Remote host closed the connection)
09:27:33*spymasterd[m] quit (Read error: Connection reset by peer)
09:27:34*M948e5[m] quit (Read error: Connection reset by peer)
09:27:35*lqdev[m] quit (Read error: Connection reset by peer)
09:27:36*skrylar[m] quit (Read error: Connection reset by peer)
09:27:37*GitterIntegratio quit (Write error: Connection reset by peer)
09:27:39*TheManiac[m] quit (Write error: Connection reset by peer)
09:27:41*LEdoian[m] quit (Write error: Connection reset by peer)
09:27:42*lasso[m] quit (Remote host closed the connection)
09:27:43*Demos[m] quit (Read error: Connection reset by peer)
09:27:44*zielmicha[m]1 quit (Read error: Connection reset by peer)
09:27:44*joachimschmidt55 quit (Remote host closed the connection)
09:27:45*Miguelngel[m] quit (Remote host closed the connection)
09:27:45*Asbrn[m] quit (Remote host closed the connection)
09:27:46*zacharycarter[m] quit (Read error: Connection reset by peer)
09:27:46*Balu[m] quit (Remote host closed the connection)
09:27:47*Mike[m]7 quit (Remote host closed the connection)
09:27:47*nergal[m] quit (Write error: Broken pipe)
09:27:47*BitPuffin quit (Read error: Connection reset by peer)
09:35:52*floppydh joined #nim
09:35:56*floppydh quit (Client Quit)
09:36:06*floppydh joined #nim
10:05:49PMunchHmm, is there a way to expand varargs in a template?
10:05:54PMunchI think I've asked this before
10:10:28*lqdev[m] joined #nim
10:10:28*isaac[m]1 joined #nim
10:10:28*k0mpjut0r joined #nim
10:10:28*TheManiac[m] joined #nim
10:10:29*BitPuffin joined #nim
10:10:29*Demos[m] joined #nim
10:10:29*M948e5[m] joined #nim
10:10:29*leorize[m] joined #nim
10:10:29*LEdoian[m] joined #nim
10:10:30*GitterIntegratio joined #nim
10:10:30*nergal[m]1 joined #nim
10:10:34*d-nice2[m] joined #nim
10:10:34*pigmej joined #nim
10:10:34*skrylar[m] joined #nim
10:10:34*Manny8888 joined #nim
10:10:35*zielmicha[m]1 joined #nim
10:10:35*Miguelngel[m] joined #nim
10:10:35*Connor[m] joined #nim
10:10:35*shashlick[m] joined #nim
10:10:35*xomachine[m] joined #nim
10:10:35*meff[m] joined #nim
10:10:35*Asbrn[m] joined #nim
10:10:35*zacharycarter[m] joined #nim
10:10:35*planetis[m] joined #nim
10:10:35*nc-x[m] joined #nim
10:10:35*joachimschmidt55 joined #nim
10:10:36*spymasterd[m] joined #nim
10:10:36*salotz[m] joined #nim
10:10:36*Balu[m] joined #nim
10:10:36*Mike[m]2 joined #nim
10:10:37*lasso[m] joined #nim
10:10:37*macsek1911[m] joined #nim
10:10:37*yglukhov[m] joined #nim
10:21:34*uu91 quit (Read error: Connection reset by peer)
10:21:54*uu91 joined #nim
10:30:52*LargeEpsilon quit (Ping timeout: 265 seconds)
10:44:17madpropshmm wondering how adapt this js function to nim https://play.nim-lang.org/#ix=22XN
10:44:34madpropsthe js seems to fill an array at different orders through index
10:44:50madpropsi can't just do it with a simple seq, unless i fill it maybe
10:47:39*Hideki_ joined #nim
10:47:40PMunchThat seems to calculate the edit distance between two strings
10:47:44PMunchYou might want: https://nim-lang.org/docs/editdistance.html
10:50:42madpropsweird, can't seem to be able to import it
10:53:35*Hideki_ quit (Remote host closed the connection)
10:53:45madprops"cannot open file: editdistance"
10:55:23PMunchNim version?
10:55:32PMunchIt used to be part of strutils
11:00:27madprops1,0,2
11:00:35madpropss/,/\.
11:01:00madpropshmm weird
11:01:03madpropsit works with strutils
11:01:12madpropsam i running an older nim?
11:01:18FromGitter<alehander92> std/editdistance
11:01:19FromGitter<alehander92> ?
11:01:36madpropsah that works
11:01:40madpropswhy do i need the std/ ?
11:02:02FromGitter<alehander92> well it's in `std/`
11:02:16madpropsisn't strutils etc in std too?
11:02:18FromGitter<alehander92> i think the idea was to namespace std modules to not clash with custom user ones
11:02:24madpropsoh
11:02:33FromGitter<alehander92> not really, but i think `std/strutils` .. should work?
11:02:40FromGitter<alehander92> i am not sure how the whole things works now
11:03:11madpropsmaybe docs should reflect stuff like this
11:03:23FromGitter<alehander92> yes
11:03:27FromGitter<alehander92> narimiran do we have docs
11:03:29FromGitter<alehander92> for std/ ?
11:03:46FromGitter<alehander92> couldnt google them
11:04:25narimiranplenty of `std/...` stuff here: https://nim-lang.github.io/Nim/lib.html
11:06:18FromGitter<alehander92> but no explanation of std/ vs just imports
11:06:55FromGitter<alehander92> did this happen at all the std/strutils thing
11:16:23*ng0 joined #nim
11:22:17*thomasross_ joined #nim
11:22:17*thomasross is now known as Guest16810
11:22:17*Guest16810 quit (Killed (adams.freenode.net (Nickname regained by services)))
11:22:17*thomasross_ is now known as thomasross
11:23:11Araq'import strutils' works because of backwards compat with every existing Nim project out there
11:23:29Araqnew stdlib modules must be accessed via 'std/'
11:24:24*rockcavera joined #nim
11:26:36*Vladar joined #nim
11:26:44FromDiscord_<onelivesleft> `nim doc` questions: can you change the order things appear in? can you have it insert another file? (would be a lot easier than copy-pasting my readme.md eery time I change it)
11:35:09*letto quit (Ping timeout: 265 seconds)
11:37:44FromDiscord_<onelivesleft> I've found `.. include`, but I can't get `start-line` to work
11:38:03Araqthere is menu for "group by type" on the left
11:38:22Araqbut I don't know if that a stdlib specific feature
11:40:01FromGitter<qqtop> incidentally it should be mentioned that export std/... will not work
11:42:08Araqthat's not std/ specific, you don't export paths
11:42:12Araqyou export module names
11:42:57Araqmaybe it's overly picky but for now that's the current design
11:43:32FromDiscord_<python273> is there any workaround for https://forum.nim-lang.org/t/3133?
11:43:59*tklohna joined #nim
11:45:26Araqyou could do maybe const POSIX_CONST = parseInt(staticExec(cprogramThatOutputsPOSIX_CONST))
11:45:32Araqbut please don't
11:45:50Araqjust look up the constant's value and write 'const x = value'
11:46:48Araqit helps when you stop pretending Posix is a real thing, in reality it's some fake standard closely tied to C, hostile to every other compiled language
11:49:14FromGitter<alehander92> but if he uses like 20 of those
11:49:42FromGitter<alehander92> it wouldn't be very nice to do that, i guess someone should publish such a detect-like lib on nimble
11:49:44*uu91 quit (Read error: Connection reset by peer)
11:49:58*uu91 joined #nim
11:49:59*thomasross quit (Ping timeout: 276 seconds)
11:50:27Araqthese days you can look up the values in Rust's source code. Or Go's. Previously it was FPC's.
11:50:54Araqthey all have the same problem, Posix is a non-standard.
11:51:06FromGitter<alehander92> of course, i am just saying someone can package that so not everyone needs to do it
11:51:15FromGitter<alehander92> e.g. something that loads them on build time as you said
11:51:37Araqwell ok, but detect.nim is buried inside Nim somewhere
11:52:11Araqit exists, you can adapt it, maybe make it interactive.
11:52:29FromGitter<alehander92> ah i found it interesting
11:54:34FromDiscord_<python273> thanks, I'm hacking around stuff, so hardcoding seems fine for now
11:55:06Araqpython273: just give it a nice error message on "not linux"
11:55:09narimiranbtw, @python273 you should switch your nick to python 3!
11:57:46*thomasross joined #nim
12:00:53*tiorock joined #nim
12:00:54*rockcavera is now known as Guest36717
12:00:54*Guest36717 quit (Killed (tolkien.freenode.net (Nickname regained by services)))
12:00:54*tiorock is now known as rockcavera
12:04:25FromGitter<kayabaNerve> Psh. 1.6 or bust.
12:05:36*njoseph quit (Ping timeout: 240 seconds)
12:05:43FromGitter<kayabaNerve> Anyone who uses a Python not in the 1 series isn't using Python, but rather New Python. Like New Coke, because it has New in the name, it is objectively worse.
12:07:05*uu91 quit (Read error: Connection reset by peer)
12:07:18*uu91 joined #nim
12:07:34*uu91 quit (Read error: Connection reset by peer)
12:07:50*uu91 joined #nim
12:08:00Araqnow look at this, https://github.com/nim-lang/Nim/pull/12667/checks?check_run_id=322767602
12:08:02disbotVM: improvements for var T/addr; WIP @11Araq
12:10:54AraqI broke no Nimble package :-)
12:11:10*LargeEpsilon joined #nim
12:24:49*clyybber joined #nim
12:33:40clyybberAraq: Hi, does it fix #12282?
12:33:49clyybber#12282
12:33:51disbothttps://github.com/nim-lang/Nim/issues/12282 -- 3var param with type conversion doesn't work in VM @11Clyybber; snippet at 12https://play.nim-lang.org/#ix=22XY 😏
12:34:59clyybberdisruptek: disbot should probably have detected it even with the `?`
12:36:56*endragor quit (Remote host closed the connection)
12:37:01Araqclyybber, maybe
12:38:46*sealmove joined #nim
12:40:45*sleepyqt joined #nim
12:44:51*abm joined #nim
12:47:19*njoseph joined #nim
12:59:14sealmoveZevv: https://github.com/zevv/npeg/issues/17#issuecomment-559015363
13:00:50*njoseph quit (Ping timeout: 276 seconds)
13:02:22Zevvinteresting, will look into that
13:11:12*njoseph joined #nim
13:11:43*solitudesf joined #nim
13:21:26sealmovejust producing more issues because you were complaining there are not enough ;D
13:21:52sealmovepersonally I don't care about such minor inconveniences
13:22:15sealmovejust reporting as I stumble across them
13:24:14*uu91 quit (Ping timeout: 276 seconds)
13:25:10*uu91 joined #nim
13:26:19*couven92 joined #nim
13:34:16rockcaveraSomewhere that exposes Nim code optimizations for speeding execution?
13:37:46*nsf quit (Quit: WeeChat 2.6)
13:51:16FromGitter<alehander92> <3
13:51:24FromGitter<alehander92> what is your program
13:51:25FromGitter<alehander92> doing
13:59:30Araqwow syntax highlighting for format strings is nice
14:06:12Yardanicoyes :P
14:06:58Yardanicobtw just fyi - `sh build_all.sh` worked flawlessly on x86_64 void (musl)
14:07:36FromDiscord_<funcmike> 😉 spawn starts a task in threadpool yes? so starting 1000x spawn tasks is using only fixed number of threads in threadpool?
14:07:48Yardanicoyes
14:08:15Yardanicohttps://nim-lang.org/docs/threadpool.html#MaxThreadPoolSize and setMax/MinPoolSize
14:08:32FromDiscord_<funcmike> async starts a task in asyncdispatcher ? single threaded
14:10:30PMunchHmm, why aren't top level variables in Nim translated to just top level variable declarations in C?
14:10:39PMunchI have to call NimMain in order to initialise them
14:11:01Yardanico@funcmike well, by default yes, but no one stops you from using async and threads at the same time :P
14:11:08FromDiscord_<onelivesleft> I'm getting `VM problem: too many registers required` - should I use dev version or something? Is this something that will be fixed in release soon?
14:11:28Yardanico@onelivesleft it means that youre completime function is too big to execute for the VM
14:11:36Yardanicoor a macro
14:11:44Yardanicotry to split it into smaller macros/compiletime procs
14:12:22FromDiscord_<onelivesleft> it is a pretty big macro 😛
14:12:24Yardanicoor maybe you have a very big variable at compile-time, I'm not sure
14:13:18FromDiscord_<funcmike> so why is this distinction between asyncdispatcher and threadpool ? i know concurrency vs parallelism but i want to understand why nim choose this way (different then others)- task switching implemention (scheduler) is different?
14:13:55Yardanicowhat do you mean it's different?
14:14:03Yardanicoasync is just like your normal async in any modern programming language
14:14:07Yardanicoand the same goes for threads
14:14:51FromDiscord_<funcmike> ok so why async/spawn?
14:15:09Yardanicoto differentiate between the two
14:15:23leorizePMunch: some of them uses the heap (ie. strings) so they have to be initialized
14:16:02FromDiscord_<funcmike> ok but why i cant run async task in multithreaded threadpool ?
14:16:25leorizethen I guess someone decided that it doesn't worth adding extra code for stack-based variables
14:16:37Yardanico@funcmike you can do it, nobody stops you from doing that
14:16:46Yardanicobut watch out for GC safety (nim's default GC is thread-local)
14:16:54leorizeyou can't atm actually
14:17:19FromGitter<alehander92> funcmike can you show another language
14:17:26FromGitter<alehander92> where you can await from another thread
14:17:38FromGitter<alehander92> probably there are, i am just trying to learn more about this as well
14:17:50FromDiscord_<funcmike> rust with tokio runtime for ex.
14:18:14leorize@funcmike: it's separated into two because they are fundamentally different
14:18:28leorizelater on we can add abstractions to make them seamless
14:20:09leorizework is being done for that: https://github.com/nim-lang/Nim/pull/11724
14:20:11disbotMake Flowvar compatible with Async @11rayman22201
14:20:29Araqalso, this part of Nim is still in heavy development, we're getting --gc:arc mitigating the .gcsafe restrictions
14:21:11FromGitter<alehander92> i see so rust has mutlithread executors
14:21:24FromGitter<alehander92> i didnt know how this works thanks
14:22:04FromGitter<alehander92> would gc:arc permit easier await thread() ?
14:22:37FromDiscord_<funcmike> alehander92: https://tokio.rs/blog/2019-10-scheduler/ (Work-stealing scheduler based on Go)
14:22:38FromGitter<alehander92> PMunch you cant run code
14:22:42FromGitter<alehander92> in c on top level
14:23:03Araqwell check out http://seastar.io/ attaching the event loop to a single thread is not outdated afact
14:23:05FromGitter<alehander92> so i guess some more complicated initializations
14:23:18FromGitter<alehander92> might need to be called in a function?
14:23:19PMunchalehander92, ah so it's just because Nim isn't tracking if it is = 1 or = someproc()
14:23:28FromGitter<alehander92> and i guess
14:23:30FromGitter<alehander92> also to follow the
14:23:39FromGitter<alehander92> stuff happens when your import a module thing
14:23:42FromGitter<alehander92> but not sure about that
14:23:59Araqand they even have http://docs.seastar.io/master/classseastar_1_1foreign__ptr.html
14:28:33*NimBot joined #nim
14:32:29FromDiscord_<funcmike> 🙂 Any ETA on --gc:arc, from what i see it will be next big thing for Nim ?
14:32:53leorizenot confirmed :P
14:33:02leorize--newruntime is the next big thing
14:34:13leorizebut turns out it wasn't compatible with most of nim code
14:34:21*couven92 quit (Quit: Client Disconnecting)
14:35:03leorizeso we can't be sure with these experiments until things start to be ported to it
14:35:13*Romanson joined #nim
14:35:35Araqfuncmike: I still think we'll have it in beta-quality this Christmas
14:35:47Araqmore and more programs compile with it
14:35:51FromGitter<nixfreakz_twitter> has anyone came across this error https://github.com/alaviss/nim.nvim/issues/17 ?
14:36:37FromDiscord_<funcmike> Araq: nice Christmas present 🙂
14:36:53leorizenixfreakz_twitter: \o/ a bug
14:37:11leorizelooks like your nimsuggest couldn't be executed sometimes
14:37:59FromGitter<nixfreakz_twitter> yeah not sure why though
14:38:01Yardanicodo you have nimsuggest in path @nixfreakz_twitter ?
14:38:44sealmoveyesterday I downloaded Nim on a friend's PC (Linux binary) and readFile was not working!
14:39:05FromGitter<nixfreakz_twitter> its under .nimble/bin/
14:39:07FromGitter<nixfreakz_twitter> so yes
14:39:18leorizenixfreakz_twitter: just pushed a fix
14:39:26leorizenow the error should display properly
14:39:48sealmovedidn't have time to investigate, but it's weird; I wonder...
14:40:03FromGitter<nixfreakz_twitter> getting git error installing nimsuggest again
14:40:18Yardanico?
14:40:20sealmovewhat can cause readFile() to fail?
14:40:26Yardanicopermissions?
14:40:32sealmoveyes, checked that
14:40:38leorizeout of file descriptors?
14:40:49sealmoveunlike, the code was 2 lines
14:40:56sealmoveunlikely*
14:41:09leorizewithout an error message it's hard
14:41:20sealmoveit was like "could not open file"
14:41:31FromGitter<nixfreakz_twitter> using choosenim stable
14:42:08sealmoveanyway, I will investigate more today and report, but it was disturbing
14:42:45leorizenixfreakz_twitter: any error messages?
14:44:09*nsf joined #nim
14:44:17FromGitter<nixfreakz_twitter> do you see it above ? gitter is screwing up my color scheme by highlighting it
14:45:13leorizeno, i don't see any?
14:45:24FromGitter<nixfreakz_twitter> ok one momenet
14:45:56FromGitter<nixfreakz_twitter> I'm going to post on IRC
14:47:01*nixfreak joined #nim
14:47:04leorizeuse a pastebin then post the link here
14:47:43nixfreakhttp://pastebin.ws/f656w
14:48:51leorizedon't install nimsuggest with nimble
14:48:53leorizeuse choosenim
14:49:20nixfreakI have stable for choosenim
14:49:38nixfreakchoosenim v0.4.0 (2019-04-18 22:21:21) [linux/amd64]
14:50:12Yardanicoupdate it pls :P
14:50:15Yardanicoand nim 1.0.2 is also out
14:50:27nixfreaksorry updating now
14:50:33Yardanicowell I'm not sure if that will help
14:50:50Yardanicobut generally it'll rule out the possibility of a fixed bug in choosenim/nimble/nim
14:52:08narimiranwait with updating nim for a few minutes ;)
14:52:30nixfreakumm ok canceled
14:53:30nixfreakthanks for looking into this , its appreciated
14:54:19*ng0_ joined #nim
14:56:28*ng0 quit (Ping timeout: 260 seconds)
14:59:02Araqcan anybody confirm that choosenim has 1.0.4 already?
14:59:28FromDiscord_<Rika> is
14:59:30FromDiscord_<Rika> i just updated
14:59:47FromDiscord_<Rika> Araq, ^
14:59:56Araqthanks!
15:00:00narimirannixfreak: there, you can update now and have the freshest nim :)
15:00:07nixfreakI'm updating now , thanks
15:00:48FromDiscord_<Rika> article when
15:00:53nixfreakpretty sweet i can update two devices at the same time and use syncthing to sync them
15:01:18YardanicoI'm still using nim devel :P
15:01:29nixfreakdoesn't matter what device i have nim libs are always on my devices
15:02:48FromDiscord_<Rika> ooh TIL about syncthing
15:03:09narimiran@Rika never :P
15:04:45nixfreakI use it on all my devices
15:06:17nixfreaksweet nvim works great again
15:06:28*PMunch quit (Quit: Leaving)
15:06:59narimiranNim 1.0.4 changelog is here: https://github.com/nim-lang/Nim/blob/version-1-0/changelogs/changelog_1_0_4.md
15:11:36leorizenarimiran: Manjaro support for detectOS is a language change? :P
15:11:52narimiranleorize: nitpick :P
15:15:32nixfreakError detected while processing User Autocommands for "asyncomplete_setup":
15:15:34nixfreakE15: Invalid expression:
15:15:36nixfreakE116: Invalid arguments for function asyncomplete#register_source
15:15:38nixfreakPress ENTER or type command to continue
15:15:54nixfreakit works just that error now
15:16:16leorizeis your asyncomplete the latest version?
15:17:40nixfreakI'll check when I get back thanks again for all the help
15:24:49*clyybber quit (Quit: WeeChat 2.6)
15:32:14*shadowbane quit (Quit: Konversation terminated!)
15:32:53*bacterio quit (Read error: Connection reset by peer)
15:36:01*Kaivo joined #nim
15:38:36*ng0_ is now known as ng0
15:41:27shashlickdom96: you there?
15:46:46*Vladar quit (Quit: Leaving)
15:48:41*sleepyqtx joined #nim
15:52:26*sleepyqt quit (Ping timeout: 276 seconds)
16:11:25*a_b_m joined #nim
16:14:28*abm quit (Ping timeout: 245 seconds)
16:18:02*a_b_m quit (Quit: Leaving)
16:25:31*leorize quit (Quit: WeeChat 2.6)
16:40:16FromDiscord_<Rika> why do `set`s not have augmented assignment? is there a reason or is it just an oversight?
16:40:35*bacterio joined #nim
16:40:55disruptekwhat is `augmented assignment`?
16:41:11FromDiscord_<Rika> uh shit, its whatever `+=` is actual'y called
16:41:14FromDiscord_<Rika> actually*
16:42:35FromDiscord_<Rika> disruptek, ^
16:42:49disruptekit seems like some attention was paid to the purity of sets as a concept, hence `card` versus `len` and some of the other design decisions.
16:43:27disruptekthat's my best guess. i don't think there's a technical reason for the omission; it seems like it should be feasible.
16:43:35*Jesin joined #nim
16:43:49FromDiscord_<Rika> purity?
16:44:16disruptekyeah, like despite the fact that we're iterator, we're not a sequence, damnit.
16:47:14*dddddd joined #nim
16:47:25*floppydh quit (Quit: WeeChat 2.6)
16:57:13Zevvhey disruptek how many cutleries do you have on your repo then?
16:58:45disruptekno one likes my code. 😭
17:02:53disruptek👭cloning https://github.com/zevv/npeg...
17:03:18disruptekjust for you, buddy.
17:05:36FromDiscord_<Rika> two forks but no knives, thats sad
17:05:52disruptekyou cut deep, son.
17:07:13disruptekor maybe no one needs to fork code that's perfect.
17:07:17disruptekyeah, that's it.
17:18:38*LargeEpsilon quit (Ping timeout: 268 seconds)
17:22:24*uu91 quit (Read error: Connection reset by peer)
17:22:44*uu91 joined #nim
17:29:17*njoseph quit (Ping timeout: 276 seconds)
17:31:48*Romanson quit (Quit: Connection closed for inactivity)
17:31:49*LargeEpsilon joined #nim
17:32:07*bacterio quit (Read error: Connection reset by peer)
17:34:27Zevvnah, we need to unite and go to the unicode consortium
17:35:30*njoseph joined #nim
17:35:40Zevvwow dude really, you made just for me? That's you and me holding hands, right!
17:36:11disruptekyeah; i just can't get over the photo of you in a skirt and i wanted to immortalize it and share it with others.
17:39:02*LargeEpsilon quit (Ping timeout: 276 seconds)
17:40:14Zevvfeel free, I have no shame
17:40:34Zevvhm funny, there really does not seem to be any version-fork-like symbol in unicode
17:40:59disruptek🔱
17:41:12Zevv:)
17:41:23disruptekyou prefer that one?
17:41:37*njoseph quit (Ping timeout: 240 seconds)
17:42:31ZevvჄ ?
17:42:36Zevv
17:42:42Zevvψ
17:49:03Zevv⎇!
17:49:11Zevvor is that more like a branch
17:49:52disruptek🌲
17:51:49*solitudesf- joined #nim
17:52:06Zevvgoing through the unicode table is like reading an encyclopedia, so many things to see and discover you never knew existed
17:53:30disruptekyou outta check out these new things called "color charts."
17:53:47*solitudesf quit (Ping timeout: 268 seconds)
17:55:12ZevvI find colors very... disruptive
17:55:15*Trustable joined #nim
17:56:11disruptekfigures.
17:58:35*Trustable quit (Client Quit)
18:01:25*nsf quit (Quit: WeeChat 2.6)
18:02:26Zevvjesting aside, your bot is growing up nicely. It's not on github, is it?
18:02:45disrupteknah.
18:03:03disruptekwell, the guts it's based on is.
18:03:08disruptek!repo disruptek/xs
18:03:09disbothttps://github.com/disruptek/xs -- 11xstreamstartup.com 8 1⭐15 0🍴
18:08:12*njoseph joined #nim
18:10:06FromGitter<zacharycarter> Hmm - so I have an issue. BGFX doesn't support 32 bit integer buffer attributes, so I was storing 4 32 bit integer values in 4 32 bit floats and passing them to my shader code which had inputs of ivec4 or integer vec4 and this worked
18:10:28FromGitter<zacharycarter> at least it worked on d3d11 - on Metal it throws up with - hrm - when targeting metal I'm getting: Vertex attribute a_texcoord4(5) of type int4 cannot be read using MTLAttributeFormatFloat4
18:11:26FromGitter<zacharycarter> bgfx does support 16 bit integer attributes though... I'm not great at bitwise ops but it should be possible to store a 32 bit int in two 16 bit ints correct?
18:11:40FromGitter<zacharycarter> and then on the shader side of things I could create a 32 bit int from two 16 bit ints?
18:12:27*nif quit (Quit: ...)
18:12:37*nif joined #nim
18:13:10FromGitter<zacharycarter> I guess it's as easy as - https://stackoverflow.com/questions/44098765/split-unsigned-32-integer-into-two-16-bit-numbers-that-can-be-rebuilt ?
18:13:44*solitudesf-- joined #nim
18:13:54*njoseph quit (Ping timeout: 265 seconds)
18:14:24Zevvzacharycarter: sure
18:14:38Zevvnot sure if it has performance inpact in your shader tho
18:15:01FromGitter<zacharycarter> yeah :/
18:15:12Zevvand watch your step when your numbers are signed
18:15:24*solitudesf- quit (Ping timeout: 246 seconds)
18:15:26*njoseph joined #nim
18:16:54FromGitter<zacharycarter> thanks Zevv :)
18:22:50*solitudesf-- quit (Ping timeout: 252 seconds)
18:23:19*shashlick_ joined #nim
18:23:27*narimiran quit (Ping timeout: 250 seconds)
18:23:51*narimiran joined #nim
18:23:53*shashlick quit (Ping timeout: 250 seconds)
18:36:58*narimiran quit (Ping timeout: 245 seconds)
18:42:20*bacterio joined #nim
18:42:25*uu91 quit (Ping timeout: 265 seconds)
18:44:04Zevvoh you're talking float16/float32, right?
18:44:58*uu91 joined #nim
18:45:58FromGitter<zacharycarter> yeah
18:45:59*njoseph quit (Ping timeout: 276 seconds)
18:46:18FromGitter<zacharycarter> well the values were int32s in memory on the Nim side of things
18:46:58FromGitter<zacharycarter> like an array of 4 int 32s, but the attribute for the vertex buffer was 4 float 32s and on the shader side of things, the input varying was 4 int32s
18:47:07FromGitter<zacharycarter> and on d3d11 everything worked fine - but of course on Metal things don't
18:49:23*letto joined #nim
18:50:54*narimiran joined #nim
18:57:40*njoseph joined #nim
19:01:12*clyybber joined #nim
19:05:03*solitudesf joined #nim
19:05:43FromGitter<slomp> Q: is there a way to preppend/append something to an existing environment variable in a `nim.cfg` file? ⏎ (I'm aware of `@putenv`, but that simply *replaces* the value of the environment variable)
19:07:06*nif quit (Quit: ...)
19:07:15*nif joined #nim
19:08:14FromGitter<slomp> (btw, I know I can append to an environment variable with a nim script like `config.nims`, but I'm curious about a way of achieving that with just `nim.cfg`)
19:10:28*nif quit (Client Quit)
19:10:37*nif joined #nim
19:11:13Araqslomp: I think there is no way but disruptek is adding features to nim.cfg
19:11:24Araqso maybe ask him politely about it ;-)
19:12:10disrupteki dunno how to do that; i guess maybe you can set a value with the concatenation of a previous value, right?
19:12:32disruptekstring expansion?
19:14:12clyybberOr just use nims :p
19:14:19FromGitter<slomp> I tried that, but it doesn't work: ⏎ ⏎ ```@putenv "PATH" "T:/MSYS2/mingw64/bin:$PATH"``` [https://gitter.im/nim-lang/Nim?at=5ddecb0b6a85195b9eb8192f]
19:14:33*uvegbot joined #nim
19:14:39disruptekwhat does that produce?
19:15:18FromGitter<slomp> the above will *literally* set the `PATH` to `T:/MSYS2/mingw64/bin;%PATH%`
19:15:36*zyklon quit (Ping timeout: 246 seconds)
19:16:08disruptekwow, so it's converting the $PATH syntax but not actually evaluating it.
19:16:38FromGitter<slomp> I found out about it with the following snippet on my main nim file that got built-and-run out of that config: ⏎ ⏎ ```import os ⏎ echo getEnv("PATH")``` [https://gitter.im/nim-lang/Nim?at=5ddecb9655066245982841aa]
19:16:47disruptekwill you file an issue, please? i will look into fixing it.
19:17:35FromGitter<slomp> Sure :) ⏎ Thanks for looking into it!
19:20:35disruptekit seems that the new recommendation will be to put stuff in nim.cfg if it's site-specific or variant with regard to dependency status; use config.nims if it's invariant, as package managers won't mess with that file.
19:26:17Araqer, did you try
19:26:55Araqx %= "T:/stuff;$PATH"
19:27:03Araq@putenv "PATH" x
19:36:09FromGitter<slomp> @Araq: I just tried, and got this: ⏎ ⏎ ```nim.cfg(17, 9) Error: 'on' or 'off' expected, but 'T:/MSYS2/mingw64/bin;%PATH%' found``` [https://gitter.im/nim-lang/Nim?at=5dded0288e906a1c8d2aafa7]
19:36:28FromGitter<slomp> I think `x` is some boolean variable used elsewhere by the cfg system?
19:37:52Araqinstead of 'x' use foo.bar
19:40:17*njoseph quit (Ping timeout: 240 seconds)
19:40:24Araqwait a sec
19:40:36Araqthere is @prependenv and @appendenv
19:40:42FromGitter<slomp> 1) foo.bar %= "T:/MSYS2/mingw64/bin;%PATH%" ⏎ 2) @putenv "PATH" foo.bar ⏎ nim.cfg(18, 28) Error: expected identifier, but got: .
19:41:07clyybberuse foobar :p
19:41:07Araq@prependenv "PATH" "Z:\..."
19:41:13Araqit already exists
19:41:19Araqsince forever
19:41:25FromGitter<slomp> Oh!! I swear I searched all over the place for this and couldn't find them!
19:41:25Araqundocumented of course .P
19:41:43Araqread compiler/nimconf.nim to be enlightened
19:42:05FromGitter<slomp> Yeah, the cfg system does not have much documentation, but I remember browsing the source code looking for things like that
19:42:12FromGitter<slomp> My bad, let me give it a try
19:42:17shashlick_Araq: https://github.com/nim-lang/Nim/pull/12750 failed for an unrelated connection issue
19:42:18disbotSubstitute $nimbleDir in --path flags @11genotrance
19:42:30shashlick_can you please restart that test
19:42:37Araqshashlick_, friday is PR merge friday
19:42:42disruptekshashlick: i'm trying to figure out these tests.
19:42:57shashlick_heeh 🙂
19:43:11disruptekalso the change to nim.cfg.
19:44:37FromGitter<slomp> @Araq, @disruptek : It worked, many thanks! ⏎ I'll file the issue and close it immediately to have it as documentation in case someone googles the same issue in the future
19:46:33disruptekgood idea.
19:46:50disruptekshashlick: i think the idea of the PR is a good one.
19:47:01disrupteki just think the impl could be better.
19:47:45disruptekthis will help me throw away some possibly-inaccurate and relatively complex code that nimph uses to guess nimbleDir values.
19:50:30shashlick_thanks for the review, i'll look into it
19:51:16FromGitter<slomp> @Araq , @disruptek : done: https://github.com/nim-lang/Nim/issues/12751
19:51:18disbot[nim.cfg] @putenv does not expand inline variables @11slomp; snippet at https://play.nim-lang.org/#ix=22ZB 😏
19:55:30shashlick_@disruptek - replied, ptal
19:56:56shashlick_what's a good example of a file that has some portion of it automatically managed by a tool
19:57:11shashlick_but the user can still hand edit outside that portion
19:59:37*nsf joined #nim
19:59:52disrupteknim.cfg.
20:02:51*uvegbot quit (Quit: Konversation terminated!)
20:03:12*uvegbot joined #nim
20:04:02shashlick_i'll let Araq decide on searchPaths vs lazyPaths but this goes back to the original point that in this mode, there should be nothing lazy
20:04:32disruptekyes, but you're breaking the semantics for package management outside of nimble.
20:04:42shashlick_cause there's ways to clear lazyPaths but searchPaths aren't
20:05:11disruptekthen you may as well just remove lazyPaths altogether. they won't exist as a result of this change, anyway.
20:05:16disruptekthey can never get populated.
20:05:32disrupteki dunno why you're trying to cripple the compiler this way.
20:05:46shashlick_it's opt in for who needs it, nothing existing is impacted
20:06:16disruptekhow do you figure? if i specify --nimblePath, it adds whatever it finds to --path, right? isn't that what you want to happen?
20:06:53shashlick_only if that path has a $nimbleDir in it
20:07:37disruptekso you're making it even more complex.
20:07:50disruptekbig 👎 from me.
20:07:56shashlick_if it is just `--path:"$projectpath/localdeps"` , the behavior is the same as today
20:08:28disruptekwell, that won't do anything, will it.
20:08:41shashlick_it will get added to searchPaths
20:09:09shashlick_and if you have --nimbleDir then Nim will search that path and add it to lazyPaths unless you use --noNimblePath or --clearNimblePath
20:09:10disruptekso what? i don't have anything in "localdeps" and even if i did, it could only add one path. not the contents.
20:09:34*deepend quit (*.net *.split)
20:10:06disruptekwhy don't you do this in nimble instead? quit breaking my compiler.
20:10:21shashlick_debate that with Araq then - this is what he wants
20:10:27disruptekonce you record --nimblePath values in the compiler, you can use that to stuff your nim.cfg with whatever you want.
20:10:40disruptekdon't break my env.
20:10:51shashlick_that's exactly what i'm doing here
20:11:09disruptekgood. record them in their lil array. leave --path alone.
20:11:26disruptekit's breaking to paint --paths with your --lazy semantics.
20:11:53disruptekespecially when the user has not asked you to do so.
20:12:08*njoseph joined #nim
20:12:24shashlick_ok let Araq decide whether this is searchPaths or lazyPaths
20:12:42shashlick_just cause you say the word nimble doesn't immediately mean lazy - this is a different mode
20:12:49disrupteki don't care who i have to argue with.
20:13:04disruptekstop trying to impose this "mode" on me.
20:13:06shashlick_and the user is explicitly asking for this mode so
20:13:16disruptekmake it something separate, then.
20:13:19shashlick_no one is asking you to use it
20:13:22disruptek--stupidModePaths.
20:13:41disrupteki can't escape it and i cannot elide it, as now i can't determine how it has changed my configuration.
20:14:17shashlick_why do you expect a user to use nimph and suddenly run `nimble modecfg` in the middle of it
20:14:37*krux02 joined #nim
20:14:39disruptekwhy should you limit what they're able to do with their toolchain?
20:14:59disruptekthey can use nimph whenever they want without any configuration or state. it helps.
20:15:18disruptekthe fact is, nimble isn't as good at finding and fixing configuration problems.
20:15:45*deepend joined #nim
20:22:52*solitudesf- joined #nim
20:24:12*solitudesf quit (Ping timeout: 252 seconds)
20:26:15*nsf quit (Quit: WeeChat 2.6)
20:32:21*tane joined #nim
20:32:40*bacterio quit (Read error: Connection reset by peer)
20:34:26*sleepyqtx quit (Quit: Leaving)
20:34:50*LargeEpsilon joined #nim
20:39:23*LargeEpsilon quit (Ping timeout: 265 seconds)
20:41:04*jwm224 quit (Ping timeout: 252 seconds)
20:42:56*jwm224 joined #nim
20:49:28Zevvhow does one find relevant info in azure CI output
20:50:29narimiranZevv: https://dev.azure.com/nim-lang/Nim/_build/results?buildId=877&view=ms.vss-test-web.build-test-results-tab ?
20:52:49Zevvhow do i get there from github test results?
20:53:19ZevvI always end up in 3klines verbatim output
20:53:34clyybberWe don't have when expressions..?
20:53:37narimiranstarting from https://github.com/nim-lang/Nim/pull/12742, you click on "Details", which takes you to https://dev.azure.com/nim-lang/Nim/_build/results?buildId=877, there you click "Tests"
20:53:39disbotRefactoring of VM register sizes to allow for bigger programs running in the VM @11zevv
20:54:39Zevvnarimiran: with you
20:55:08clyybberAraq: Any reason we don't have when expressions and any obligations to adding them?
20:55:40Zevvnarimiran: thanks, I missed the little tiny 'tests' tab that does not look like a tab
20:56:09narimiranyeah, UI/UX is not the friendliest....
20:56:29Zevvhmm funny fail, not sure if I even caused hat.
20:56:55FromGitter<slomp> Out of curiosity: shouldn't the following work in a `nim.cfg` file? ⏎ `foo.bar %= gcc.path` ⏎ I get the following: ⏎ `Error: expected identifier, but got: .` ⏎ This is coming from `checkSymbol` in `nimconf.nim`. ... [https://gitter.im/nim-lang/Nim?at=5ddee3166a85195b9eb8d14e]
21:00:52clyybberoh wait, we actually do have when expressions..
21:04:08*ltriant joined #nim
21:07:23*tane quit (Quit: Leaving)
21:11:08*nif quit (Quit: ...)
21:11:18*nif joined #nim
21:14:12*narimiran quit (Ping timeout: 268 seconds)
21:15:08clyybberthis week really was harsh wrt issues. Now at 30 newly opened issues..
21:15:26disruptekhow many closed?
21:15:45clyybber6
21:27:15clyybber31 now..
21:28:34rockcaverahow to make Nim code similar to this C code: int *a = malloc(sizeof(int) * 100)?
21:29:46clyybbera: ptr int = c_malloc(sizeof(int) * 100)
21:32:14Araqvar a = cast[ptr UncheckedArray[cint]](c_malloc(sizeof(cint) * 100)
21:32:26Araqor you use a 'seq' and learn Nim
21:32:56clyybberah right, lol totally missed that it should be an array
21:33:23rockcaverathanks
21:34:40rockcaveraI actually used seq in my Nim code from a C code transcript
21:38:06Araqclyybber, trial deletion requires =trace as well as =rawDestroy or something like that
21:38:16Araqso it's 2 more procs, not just one
21:38:59clyybberWhy? Do you want the =destroy to invoke trace or what?
21:42:17jxycan somebody confirm issue #12753 for me? am I using template wrong?
21:42:19disbothttps://github.com/nim-lang/Nim/issues/12753 -- 3template generates wrong code @11jxy; snippet at 12https://play.nim-lang.org/#ix=230j 😏
21:42:34clyybberjxy: Nope looks like a bug to me
21:45:24clyybberAraq: ping
21:46:49jxythe playground is nice, it looks like it started to give wrong results since 0.18.0
21:47:28jxyand 0.17.2 is correct
21:47:53clyybberhmm
21:48:10clyybberjxy: Can you git bisect?
21:48:36Araqclyybber, after tracing we need to dealloc individual objects
21:49:05nixfreak
21:49:24clyybberAraq: You mean without recursively destroying the refs they point to?
21:56:05jxyclyybber: maybe next week
22:01:09Araqclyybber, exactly
22:02:55*uu91 quit (Ping timeout: 268 seconds)
22:05:10clyybberAraq: Hmm, yeah I see no way around it.
22:08:57*nixfreak quit (Ping timeout: 240 seconds)
22:10:30*nif quit (Quit: ...)
22:10:44*nif joined #nim
22:14:01Araqme neither but since 'ref' is builtin, maybe we don't have to expose its machinery for the time being
22:14:17clyybberAraq: Does a template that is an expression have to have a return type?
22:14:37Araqyeah but 'untyped' works
22:14:55clyybberAraq: Ah, right. I was confused because I flipped it with typed
22:17:52clyybberThat naming really doesn't make any sense does it?
22:18:43*ng0 quit (Quit: Alexa, when is the end of world?)
22:24:29Araqoh I know!
22:24:37*solitudesf- quit (Ping timeout: 240 seconds)
22:24:42Araqwe need annotated sections in the =hooks
22:25:34Araqthen we have 'trace: for ...' and 'destroy:' sections within =destroy and we can also optimize =sink further by explicitly marking the "destroy previous value" snippet inside it
22:26:00Araqno new hooks required, but some template magic...
22:29:15sealmovehow to construct a Type node in macros?
22:30:02clyybberAraq: Hmm, interesting idea
22:30:07*Calinou left #nim ("https://quassel-irc.org - Chat comfortably. Anywhere.")
22:30:26sealmovethere is no `newTypeNode` proc or something
22:31:12*uu91 joined #nim
22:31:26sealmovei mean, when constructing a var declaration (without assignment), can you only give the type as a string? or is there a way to construct the type node directly?
22:31:34sealmove nnkIdentDefs.newTree(
22:31:37sealmove ident(a.id),
22:31:40sealmove ident(datatype),
22:31:41sealmove newEmptyNode()
22:31:43sealmove )
22:31:46sealmoveinstead of `ident(datatype)`
22:32:06AraqbindSym"int"
22:32:29Araqbut don't go too far, the compiler must still semcheck your constructed type properly
22:32:56Araqin other words, treating types as any other AST for construction is fine
22:33:03Araq*like any
22:33:41sealmoveok, that's what I was wondering, thanks!
22:43:33*Ven`` joined #nim
22:44:55sealmovenimitai already works for some simple .ksy files :))))
22:50:18*nif quit (Quit: ...)
22:50:28*nif joined #nim
22:51:57sealmoveI will add a hello_world.ksy example which should work!
22:54:17FromDiscord_<trey.merkley> Is there a way to change the styles in nimx?
22:55:10shashlick_@disruptek you are suggesting a separate iterator and proc
22:55:28shashlick_What would get called where
22:55:56disruptekwhat we can change to an iterator, we will.
22:56:16disruptekthe proc doesn't need to change.
22:56:24disruptek(though it should)
22:59:10sealmovethere you go: https://github.com/sealmove/nimitai
23:01:33shashlick_@disruptek - doesn't nimble just have 1 nimbleDir
23:01:43shashlick_it's Nim that looks in instances
23:01:55shashlick_i somehow feel just replacing $nimbleDir with the last one makes most sense
23:02:29disrupteknope, --nimblePath explodes a bunch of directories to --lazyPaths any time you invoke it.
23:03:06disrupteki use multiple nimblePaths to have separate distributions; eg. so i can have different projects share the same closeted trees.
23:04:01disruptekas another example, it lets you always link to the compiler library that matches the compiler, by issuing a `nimble develop` in your Nim tree.
23:04:25disruptekbecause, as you recall, you can only follow .nimble-link files via --nimblePath statements.
23:04:31FromDiscord_<mratsim> @zacharycarter regarding your splitting of int32 into 2xint16, just use an union type, example on splitting uint16 into uint8: https://github.com/mratsim/chirp8/blob/master/src/cpu.nim#L9-L23
23:08:00shashlick_what do you mean by separate distributions
23:08:19shashlick_do you do --nimblePath=1 --nimblePath=2
23:08:23disruptekyeah.
23:09:14shashlick_the problem with pathSubs is that everything that calls it - and it goes deep into the compiler code - expects only 1 path
23:09:32disruptekyou don't have to break pathSubs. just add something better.
23:09:55shashlick_ya but it still would mean that other callers of pathSubs won't handle nimbleDir correctly, or at all
23:10:20disruptekyes, it's not ideal. but you can handle it inside of pathSubs if you want.
23:10:20shashlick_part of the problem is the limitations with the % operator itself
23:10:35disruptekhey man, no one said you had to modify the compiler.
23:10:56shashlick_how can you return 1 path when there can be n nimblePaths to substitute
23:11:12disrupteklike i said, i think it's a good change that's helpful.
23:11:18disruptekyou return the best one.
23:11:45disrupteki actually count the uses of the path and return the most populous one.
23:12:37disruptekthis would free me up from having to compute popularity in order to identify --nimblePaths, since i'd have a record of them. then i can count their use more accurately, if i want.
23:13:14shashlick_what is the best one - I proposed checking if the dirExists but Araq said weirdos like me can create it at compile time
23:13:30shashlick_it might not even be there
23:13:40*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:13:48disruptekdirectories that don't exist don't seem like ideal candidates, so i select them last.
23:13:54shashlick_so i'm thinking perhaps the last nimbleDir added to the list (first in storage order) will be most relevant
23:14:04*clyybber quit (Quit: WeeChat 2.6)
23:14:12disruptekhonestly, i think $nimbleDir/ just doesn't even make sense. why are you adding it?
23:14:44shashlick_so that instead of a full path in nim.cfg which is host specific, you can say $nimbleDir/pkg-1.0.0
23:14:54*Ven`` joined #nim
23:15:01disruptekthe last will work well with package managers, as they are more likely to append to the file versus prepending.
23:15:16disruptekbut as you've shown, the semantics of that are ambiguous at best.
23:15:23disruptekwhy do you want ambiguous semantics?
23:15:33*Ven`` quit (Client Quit)
23:16:04shashlick_what is ambiguous?
23:16:16disruptekit's pointless anyway. that path is already picked up by --nimblePath=/some/nimbleDir. i don't even add paths if they are already expressed.
23:16:55disrupteki only add --path for packages that need it because they have silly structures mandated by Nimble, like src/nimph/src/nimph/src.
23:17:11disruptekor whatever the hell it works out to. like i said, silly.
23:17:53disruptekit's ambiguous because you're trying to guess a single path from an array of paths. makes no sense.
23:18:03disruptekthat's why you're having so much trouble.
23:18:52shashlick_again, the point is to not search nimbleDir - it is to point to a specific version of a package
23:19:13disruptekthen why are you using --nimblePath? just specify the path with --path.
23:20:00disruptek--nimblePath is a shortcut to "add all the packages within"; it's like asking the compiler to just loop over the directories and follow them. it's also essential for following .nimble-link files.
23:20:28disruptekit's handy because it lets you quickly develop without having to stop to adjust requirements and nim.cfg files each time you twiddle a dependency.
23:21:29disruptekit's basically letting you refer to entire trees of dependencies symbolically. nice.
23:21:44shashlick_nimble already does all that and gives me a list of specific paths - all we are doing is putting it in nim.cfg and fixing it so that the compiler again doesn't search for anything
23:21:53disruptekwell, stop.
23:22:08disruptekjust put them in as --path if that's what you want, and keep using --noNimblePath.
23:22:21disruptekyou're breaking functionality that's very handy and powerful.
23:23:00disruptekthe compiler already does what we both want today. 🙄
23:23:28shashlick_Araq wouldn't ask for this if it was already there
23:23:44shashlick_and adding a different way doesn't break any existing code path
23:23:51disrupteklet Araq speak for himself.
23:24:12disruptekit's breaking my code path, and that of any user of my software.
23:24:48disrupteki can't believe i have to explain to you how to use Nimble, but here we are.
23:35:48*Ven`` joined #nim
23:36:34shashlick_ya and I cannot believe that you are going on about legacy behavior, which i am not even touching
23:37:04disruptekwell, it's not my fault that you guys never took advantage of it.
23:38:18disruptekwhy do you want to add a different way? can you explain that?
23:38:28disruptekbecause i cannot.
23:40:03shashlick_never mind then
23:45:54*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:49:12xacedoes the nim iterators for walkDir or w/e follow symbolic links to directories? my goal is to recursively find all files, subfolders and symbolic links included
23:49:35disruptekthey yield a component value which indicates the kind of link, be it real or symbolic.
23:50:15xacedisruptek: yes, but would it step into them?
23:50:26FromDiscord_<yewpad> i think you have to do that manually
23:50:42disruptekrecursion is up to you.
23:50:47*clyybber joined #nim
23:50:57xaceseems like there is a followfilter `pclinktodir`
23:51:43disruptekoh, oswalkdir.
23:52:13disruptekyou can specify the values to follow.
23:52:32disruptekfilter = {pcLinkToDir, pcDir}
23:52:46disruptekhttps://nim-lang.org/docs/oswalkdir.html
23:53:12*lritter quit (Ping timeout: 252 seconds)
23:53:43clyybberAm I crazy or is `set1 < set2 or set1 > set2` not equivalent to `set1 != set2`
23:53:47xacehttps://nim-lang.org/docs/os.html#walkDirRec.i,string # i was going to use this... i find it really difficult to browse nim documentaiton some times
23:54:14clyybberUgh, nevermind