<< 07-01-2019 >>

00:00:46FromGitter<timotheecour> oh noo…. @araq no chance for a pass on https://github.com/nim-lang/Nim/pull/10183 ? i’ve quickly addressed ur comment
00:05:36rect0x51timotheecour: Sorry I haven't studied the code enough to understand what it's about. I see that the symbols are produced by templates at CT and thus ungrepable, but don't see why it's non-trivial to write them down and put them somewhere.
00:07:18FromGitter<timotheecour> didn’t say it wasn’t trivial, it’s trivial to add the symbols generated by `registerCallback` to `nim dump`
00:08:03FromGitter<timotheecour> and it’d help debugging since we can’t grep for these
00:08:03*zyklon quit (Read error: Connection reset by peer)
00:14:29rect0x51I see, seems like a discussion about it with Araq is needed.
00:16:39rect0x51Though personally I don't see why it's a bad idea to add them to nim dump...
00:26:15*zyklon joined #nim
00:31:36*stefanos82 quit (Remote host closed the connection)
00:37:09FromDiscord_<hcorion> hey @exelotl saw you were doing some gba stuff? Here's some of my basic stuff on that: <https://github.com/hcorion/nim-on-gba>
00:39:02FromDiscord_<hcorion> it's mainly just ports of khalladay's gba tutorial, but might be useful
00:39:02*zyklon quit (Read error: Connection reset by peer)
00:47:44*Snircle quit (Excess Flood)
00:48:52FromDiscord_<exelotl> @hcorion ohhh awesome! I didn't know anyone else was doing this with Nim
00:50:05FromDiscord_<hcorion> Yeah, haven't worked on it in a while, and probably won't work on it any more 😛
00:50:22*lritter quit (Ping timeout: 250 seconds)
00:50:53FromDiscord_<hcorion> not sure if it still compiles though
00:55:42*zyklon joined #nim
00:58:27FromGitter<zacharycarter> hcorion: long time no see - are you still using Nim?
01:01:00FromDiscord_<hcorion> haven't for a while unfortunately
01:01:07FromGitter<zacharycarter> :(
01:01:32FromDiscord_<hcorion> I got involved in RPCS3, which is in C++, so I spent all my time doing C++
01:02:32FromDiscord_<hcorion> And now taking game design at college, so doesn't look like I'll be playing with Nim any time soon 😦
01:03:45FromGitter<zacharycarter> :( well - if you ever want to flex those game design skills, I'm sure there are plenty of Nim devs who would love to collab :)
01:04:05FromGitter<zacharycarter> but regardless - congrats on the game dev schooling! awesome stuff!
01:04:49FromDiscord_<hcorion> thanks, would be cool to improve the rod engine, that's for sure
01:05:23FromGitter<zacharycarter> I'm working on an PBR rendering engine atm
01:05:39FromGitter<zacharycarter> rod is cool - but totally undocumented
01:05:52FromGitter<zacharycarter> and I don't think that situation is changing anytime soon
01:06:47FromDiscord_<hcorion> PBR rendering engine in Nim? That's awesome!
01:06:47FromDiscord_<hcorion> Yeah I wonder what kind of usage rod and nimx might get if the got some good docs
01:09:38FromGitter<zacharycarter> probably quite a bit - unfortunately the game using rod seems to have died
01:11:31FromDiscord_<hcorion> ah that sucks, is yglukhov going to work on future games or was that it?
01:11:44FromGitter<zacharycarter> not sure :/
01:11:46FromGitter<zacharycarter> hopefully!
01:12:07FromGitter<zacharycarter> I think he's working with status now - like a lot of the more talented / knowledgeable Nim devs
01:12:31FromGitter<zacharycarter> they seem to have all been gobbled up :P and then of course some went to work for Nim itself
01:12:47FromDiscord_<hcorion> ah, right
01:13:21FromDiscord_<hcorion> well I should get back to my homework 😛
01:13:53FromGitter<zacharycarter> gl!
01:18:23*theelous3_ quit (Ping timeout: 245 seconds)
01:34:32*rect0x51 quit (Quit: WeeChat 2.3)
01:37:00FromDiscord_<Protty> hey, im a beginner learning nim and trying to write some code without the standard library. Do iterators do any heap allocations?
01:41:40FromGitter<zacharycarter> there's one way to find out :)
01:42:50FromDiscord_<Protty> valgrind? lol
01:42:53FromGitter<zacharycarter> apparently so
01:42:54FromGitter<zacharycarter> no
01:43:06FromDiscord_<Protty> darn
01:43:09FromGitter<zacharycarter> well actually
01:43:13FromGitter<zacharycarter> valgrind might be the best bet
01:43:44FromGitter<zacharycarter> but - based on this little test, I'd have to assume SOMETHING is being allocated on the heap
01:43:52FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c32aed8357dd7655d2adc58]
01:44:02FromGitter<zacharycarter> the code is
01:44:12FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c32aeec1d1c2c3f9cd28547]
01:45:02FromGitter<zacharycarter> `gc:none` will check to make sure nothing is being referenced by the GC
01:45:16FromGitter<zacharycarter> so it's not a surefire bet at all
01:48:13FromGitter<zacharycarter> if I run the same program with `➜ zacharycarter.github.io git:(master) ✗ nim c --profiler:off --stackTrace:on -d:memProfiler -r foo.nim`
01:48:14FromGitter<zacharycarter> I get
01:48:23FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c32afe73cf6c35a84a108a4]
01:49:23FromDiscord_<Protty> oh, is it the `nimIntToStr` thats allocating a string?
01:50:03FromDiscord_<Protty> oh, is it the `nimIntToStr` thats allocating a string every echo?
01:51:25FromGitter<zacharycarter> probably
01:51:38FromGitter<zacharycarter> looks that way Protty - so you might be fine :)
01:53:06*rockcavera joined #nim
01:53:42FromDiscord_<Protty> phew. thanks for the help!
01:54:33FromGitter<zacharycarter> anytime!
02:00:55*d10n-work quit (Quit: Connection closed for inactivity)
02:14:38*wildlander quit (Ping timeout: 245 seconds)
02:17:52*endragor joined #nim
02:27:05*endragor quit (Remote host closed the connection)
02:29:44*Tyresc quit (Quit: WeeChat 2.4-dev)
02:52:06FromGitter<m4d3bug> have your guys seen this before?
02:52:09FromGitter<m4d3bug> https://github.com/moigagoo/nimage
02:52:37FromGitter<m4d3bug> I am using dive https://github.com/wagoodman/dive so I can see what's they did in the container
02:58:07FromGitter<zetashift> iirc the nim playground uses nimage
03:00:34*banc quit (Quit: Bye)
03:07:14*Snircle joined #nim
03:11:52*leorize quit (Quit: WeeChat 2.3)
03:12:53*leorize joined #nim
03:16:45*banc joined #nim
03:23:25FromGitter<m4d3bug> what is the iirc?
03:26:50xaceiirc == If I Recall Correctly
03:30:38FromGitter<m4d3bug> LOL,Is there any link that allows me to see how the nim playground uses nimage?
03:41:46xacehttps://github.com/zacharycarter/nim-playground im guessing this is what you are looking for, you can find a demo here: https://play.nim-lang.org/
03:53:59FromGitter<m4d3bug> great,worth to try!
04:00:51*shpx joined #nim
04:06:50*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:12:01*vendethiel- quit (Read error: Connection reset by peer)
04:12:01*zyklon quit (Read error: Connection reset by peer)
04:15:27*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:21:06*dddddd quit (Remote host closed the connection)
04:27:35*endragor joined #nim
04:29:55*zyklon joined #nim
04:31:44*endragor quit (Ping timeout: 246 seconds)
04:36:00*nsf joined #nim
04:41:20*dvn quit (Ping timeout: 250 seconds)
04:46:32*dvn joined #nim
04:56:44FromGitter<timotheecour> @krux02 are you here? https://github.com/nim-lang/Nim/issues/10185 is locked; why ?
04:58:51leorizewhat do you mean by locked?
04:59:32FromGitter<timotheecour> i can’t comment on it, can you? it shows: `you can’t perform this action at this time`
04:59:59FromGitter<timotheecour> I’ve seen this on a a few other PR’s and issues from @krux02
05:01:00FromGitter<timotheecour> I was gonna reply with a fix, but cannot because of that
05:01:55leorizeI can comment
05:02:18leorizeand I've just added one
05:02:25leorizecan you see it?
05:02:28FromGitter<timotheecour> (https://files.gitter.im/nim-lang/Nim/fyCF/image.png)
05:03:12leorizecan you still create issues?
05:03:46FromGitter<timotheecour> yes, and I can comment on any other issue except those from @krux02
05:03:51FromGitter<timotheecour> super weird
05:06:20leorizehe might have blocked you, see: https://help.github.com/articles/blocking-a-user-from-your-personal-account/
05:06:48leorizewell, it doesn't say anything about not being able to comment :/
05:06:53leorizeso maybe it's something else?
05:07:08FromGitter<timotheecour> Ok, not sure why he’d do that
05:33:07*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
05:33:48*xace quit (Ping timeout: 245 seconds)
05:35:19*xace joined #nim
06:09:07*shpx joined #nim
06:46:15*leorize quit (Quit: reboot)
06:58:29*sheerluck joined #nim
07:08:55*krux02 joined #nim
07:25:59*leorize joined #nim
07:54:15*Notkea quit (Ping timeout: 268 seconds)
07:58:17*Notkea joined #nim
08:19:22*Vladar joined #nim
08:24:39*shpx quit (Quit: Textual IRC Client: www.textualapp.com)
08:31:51*floppydh joined #nim
08:32:52*rokups joined #nim
09:20:38*narimiran joined #nim
09:27:58*abm joined #nim
09:30:58*stefanos82 joined #nim
09:55:45*kapil____ joined #nim
10:49:59*PMunch joined #nim
11:11:09*dddddd joined #nim
11:28:23*endragor joined #nim
11:32:47*endragor quit (Ping timeout: 246 seconds)
11:47:20*a_b_m joined #nim
11:48:39*tobbez quit (Ping timeout: 250 seconds)
11:51:03*abm quit (Ping timeout: 268 seconds)
11:57:32*tobbez joined #nim
11:59:03*a__b__m joined #nim
12:02:28*a__b__m quit (Client Quit)
12:03:04*a_b_m quit (Ping timeout: 272 seconds)
12:08:49*BigEpsilon joined #nim
12:09:32*Snircle joined #nim
12:23:39*abm joined #nim
12:24:13*dom96_w joined #nim
12:25:39*ripspin joined #nim
12:27:39ripspinis #head the same as the nightlies releases?
12:28:48PMunchWell it's nighly + whatever has been comitted during the day
12:28:56PMunchcommitted*
12:30:13ripspiniv got Nim Compiler Version 0.19.9 after a choosenim #head
12:30:45narimiranripspin: 0.19.9 can be a lot of things, depending on when it was last updated
12:31:25narimiransee the compiled date with `nim -v`
12:34:00PMunchYeah .9 just means that it is any commit that is not a release
12:34:44narimiranbtw PMunch are you are new guy for playground, or did i mis-read something?
12:34:55narimiran*are you our
12:35:10PMunchYes, but not yet
12:35:20PMunchWaiting to get the torch passed on
12:35:32narimiranhaha, ok. i just wanted to know
12:38:33PMunchHave some plans to make it better
12:38:53PMunchAmongst those switching to an editor that actually supports Nim syntax :P
12:39:31narimirangreat to hear
12:40:29narimiranhopefully one of those plans is to use 0.19.4 (currently is 0.18.0) (0.19.4 is not yet out, but it should be relatively soon, just until you settle in :))
12:41:06ripspinCompiled at 2019-01-07
12:41:20narimiranripspin: then you're set :)
12:41:53narimiranPMunch: one of my plans is to make playground more visible, so these changes would be very nice to have
12:53:41PMunchOh yeah, newest stable version (or possibly even choosing the version) is also on my list
12:54:02narimirannice!
12:54:11*abm quit (Quit: Leaving)
12:55:39PMunchI already started tinkering with something like "A tour of Go"
13:01:47FromGitter<kaushalmodi> > A tour of Go ⏎ ⏎ PMunch: +1
13:02:00FromGitter<kaushalmodi> i.e. +1 of "A tour of Nim" :D
13:06:01FromGitter<zetashift> I have a type `Foo` which has a `RenderOrder` enum component how would I write the sort() function to sort an seq of `Foo`'s to sort it by that enum's ordinal value?
13:09:37PMunchWhat are you using for the sorting?
13:11:15PMunchYou can compare enums like this: http://ix.io/1xIP/Nim
13:11:30dom96_wPMunch: Awesome! Keep reminding me to give you access to the VPS (can't now, at work)
13:11:49PMunchWill do :)
13:12:03dom96_wI'm also happy to set up the playground there (I set up something similar for my Uni project anyway so I should be able to do it fairly quickly)
13:12:41FromGitter<zetashift> nim's algorithm sorted(), but I'd need to write my own cmp function no even though enum are ordinals?
13:12:49PMunchOh nice, yeah if I had the existing playground to look at it would make it much easier to figure out how the deploy and everything works :)
13:14:26PMunchzetashift, nope you can just do this: http://ix.io/1xIS/Nim
13:14:26*zyklon quit (Read error: Connection reset by peer)
13:14:48PMunchEchoes out @[One, Two, Three]
13:17:12FromGitter<zetashift> I solved it with `world.entities.sorted((x,y) => x.renderOrder > y.renderOrder )` but yeah nice to know I can just use system.cmp
13:17:26FromGitter<zetashift> also bless that sugar module
13:18:30PMunchWhat are you working on by the way?
13:20:23FromGitter<zetashift> @PMunch goofing around with libtcod trying to get better: https://imgur.com/a/CBx1IKA
13:21:18PMunchOh nice, roguelikes :)
13:21:43PMunchSucks that I can't play nethack without a numpad on my Dvorak layout keyboard
13:21:55FromGitter<zetashift> Can't you rebind?
13:22:10*PMunch shudders
13:22:20PMunchRebinding all of Nethacks bindings?
13:22:26PMunchThat's like the entire keyboard :P
13:25:36PMunchI'll have to rebind something to get movement to work, but that would shift other keys etc.
13:28:30FromGitter<zetashift> yea true a quick googling shows me someone made keybindings for nethack on emacs
13:30:25*zyklon joined #nim
13:32:30*rokups quit (Quit: Connection closed for inactivity)
13:38:57ZevvIs there fast and a idiomatic way to convert array[uint8] to a string or cstring?
13:39:06PMunchOf course they did, but I already know the QWERTY bindings, and relearning all of them will be a pain..
13:39:11narimiranZevv: $ ?
13:39:36Zevvyeah, problem is that $ is defined for the type. I'm trying to do a lot of base64 of sha1 hashes
13:39:46Zevvbut $ securehash is defined and creates a hex string
13:39:55Zevvbasically, I'd like a raw 20 byte string
13:39:59Zevvfrom the 20 byte uint8 array
13:40:10Zevvand casting is icky
13:40:14*abm joined #nim
13:40:25Zevvas is copying
13:41:02PMunchWell, casting works..
13:41:25Zevvok, np, thanks!
13:42:02PMunchI think Araq has basically said that seq[byte] -> string casting isn't going to change. Even though it's a bit icky
13:45:41Zevvworks for me
13:47:25*vlad1777d joined #nim
13:53:04*zyklon quit (Read error: Connection reset by peer)
14:05:12FromDiscord_<Protty> hey, is there a way to list the symbols defined that are used in `defined(x)` in nim?
14:09:06*zyklon joined #nim
14:17:58*vlad1777d quit (Ping timeout: 245 seconds)
14:19:58PMunchNot entirely sure, are you looking for a particular symbol?
14:25:17FromDiscord_<Protty> looking for `windows`, `linux` and `posix`
14:25:47leorize`nim dump`
14:26:34FromDiscord_<Protty> oh, they dont exist ... any way to define them in nimble?
14:26:51FromDiscord_<Protty> oh, they dont exist ... any way to define them in nimble? detectOs and `--d` doesnt seem to be working for me
14:26:59*synthmeat quit (Quit: WeeChat 2.3)
14:27:03leorizethey should exists in nimble
14:28:45*synthmeat joined #nim
14:30:29FromDiscord_<Protty> is there a way to set them? im using `--os:standalone` and `--gc:none` if thats preventing anything?
14:32:13leorize--os:standalone kill those define of automatically
14:32:18leorizebut shouldn't affect nimble
14:34:06FromDiscord_<Protty> ah, no wonder. ill try putting them in the cfg instead
14:34:52FromDiscord_<Protty> nvm, just realized that doesnt execute nimscript
14:36:04FromDiscord_<Protty> currently trying to do
14:36:04FromDiscord_<Protty> ```nim
14:36:05FromDiscord_<Protty> when defined(nimdistros):
14:36:05FromDiscord_<Protty> import distros
14:36:05FromDiscord_<Protty> if detectOs(Windows):
14:36:05FromDiscord_<Protty> --d:windows
14:36:05FromDiscord_<Protty> elif detectOs(Linux):
14:36:07FromDiscord_<Protty> --d:linux
14:36:08FromDiscord_<Protty> ```
14:36:10FromDiscord_<Protty> but it doesnt seem to work (im on windows 10 using nim's mingw gcc)
14:36:19PMunchPlease use a paste service
14:36:43*synthmeat quit (Quit: WeeChat 2.3)
14:36:58leorize@Protty you should add that to a project config file instead of nimble
14:37:20FromDiscord_<Protty> by paste service, do you mean like hastebin or similar?
14:37:37*synthmeat joined #nim
14:37:40leorizeand you shouldn't define those symbols
14:37:49leorizecreate your own, like "onLinux"
14:37:57PMunchProtty, yes
14:38:24leorizebecause defining those symbols will cause stdlib to use OS-specific implementation, which you don't want when you're using --os:standalone
14:39:41*synthmeat quit (Client Quit)
14:39:55FromDiscord_<Protty> ive tried putting it in the config file but it errors out trying to use `when` as a command line option
14:41:40leorizewhat file did you put it in?
14:41:57FromDiscord_<Protty> <project_name>.nim.cfg
14:42:03*synthmeat joined #nim
14:42:09leorizeyou should put it into a config.nims file
14:42:20FromDiscord_<Protty> ooh, that config file. sorry
14:42:24*synthmeat quit (Client Quit)
14:46:56FromDiscord_<Protty> changed the define symbols to `onWindows` and `onLinux`, but there seems to be an error in nim's standard library `lib/system/ansi_c.nim(73, 12) Error: SIGABRT not ported to your platform`. Ive also tried changing the define symbols to random characters to see if even those were affecting it, but it doesnt seem to be the case
14:47:30leorizeyou're using --os:standalone
14:47:49leorizeremember that a lot of stdlib functionality just won't work
14:47:58leorizeespecially the os module
14:48:15leorizewhy are you using --os:standalone anyway?
14:49:06FromDiscord_<Protty> writing a vm and need complete control over memory so not able to use many of the stdlib functionality or anything that calls mmap/VirtualAlloc
14:49:34leorizethen don't use --os:standalone
14:49:34FromDiscord_<Protty> would an alternative be to check out how detectOs is implemented from the source?
14:50:03leorize--os:standalone should be used only when you're writing stuff that doesn't need an os
14:50:06leorizelike a kernel
14:50:53*kapil____ quit (Quit: Connection closed for inactivity)
14:51:41FromDiscord_<Protty> tried to avoid using nims stdlib because i believed it required allocation for internal things like closures and exceptions. Was that not the case?
14:52:13leorize--gc:none should raise warnings in compile time
14:52:46leorizeclosures are rarely used in the stdlib, but yes, exceptions requires heap allocation
14:52:58leorizeonly when they're raised
14:53:18*synthmeat joined #nim
14:55:31leorize@Protty: you might be interested in --gc:stack
14:55:48leorizedocumentations are scare, but there's a post on the forum on how to use it iirc
14:57:11FromDiscord_<Protty> is there a way to not link to the gc in general?
14:57:57leorize--gc:none
14:58:08leorizeevery gc usage will be warned, so you'd know what to avoid
14:58:14*d10n-work joined #nim
15:01:53FromDiscord_<Protty> is there any way to map a C define symbol (e.g. `_WIN32`) into nim to use `when defined(_WIN32)` ?
15:02:31leorizeno
15:02:52leorizefor your use case, --gc:none should suffice
15:03:07leorizeanytime you touch the GC, directly or indirectly, you get a warning
15:03:35FromDiscord_<Protty> i also cant use c malloc or similar
15:03:38leorizeavoid --os:standalone and you will get `when defined(windows)` back
15:03:55leorizemalloc is not indirectly used anywhere, don't worry
15:04:57leorizeonce allocators is a thing, you can replace the Nim's allocator directly and don't have to worry too much about these
15:08:45FromDiscord_<Protty> the thing is, not planning to use a global allocator like most c programs. Different structures in the vm all allocate and handle pages directly so a global allocator isnt an option
15:11:25*lritter joined #nim
15:16:39*snowolf quit (Ping timeout: 250 seconds)
15:19:22*nsf quit (Quit: WeeChat 2.3)
15:44:26*Xe quit (Ping timeout: 246 seconds)
15:47:38*baba_ joined #nim
15:49:05*baba_ quit (Client Quit)
15:59:46*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:02:20*Trustable joined #nim
16:15:20*abm quit (Read error: Connection reset by peer)
16:22:58*BigEpsilon quit (Ping timeout: 258 seconds)
16:26:03*Ven`` joined #nim
16:26:03*zyklon quit (Read error: Connection reset by peer)
16:26:19*dom96_w joined #nim
16:32:37*Xe joined #nim
16:41:57*zyklon joined #nim
16:51:32*Tyresc joined #nim
16:53:27*endragor joined #nim
16:53:30*floppydh quit (Quit: WeeChat 2.3)
16:54:42*BigEpsilon joined #nim
17:01:34*PMunch quit (Remote host closed the connection)
17:35:17*cspar_ joined #nim
17:37:11FromGitter<Clyybber> @arnetheduck Whoo, nlvm is able to successfully compile my project! Also nice fixes you pushed!
17:37:13*cspar quit (Ping timeout: 244 seconds)
17:37:36FromGitter<Clyybber> Will try to get asm statements to work asap
17:49:23*dorelix quit (Ping timeout: 246 seconds)
17:50:27*nsf joined #nim
17:57:35*kobi7 joined #nim
17:57:39kobi7Hi guys
17:59:07FromGitter<Clyybber> Hi kobi
17:59:47kobi7when working with tables, I had a need to get the key value pairs. iow, the data field. but it's private. is there a getter or something I'm missing?
17:59:58kobi7hi Clyybber
18:01:03kobi7btw, I ported from python the html entity definition table. it was so easy. a 10 min work.
18:01:22kobi7so nice, the syntax almost matches one to one
18:02:01kobi7I think the nim translate proc might be what I needed to use, but decided to go that route
18:02:04FromGitter<zetashift> what do you mean getter or setter of a table?
18:02:50kobi7the data field of the table is private. I want to get this keyvalue pairs. I wonder if there's a way to access it.
18:03:52kobi7you know, instead of iterating, I can get it with a single O(1) request
18:03:58kobi7at least that's my idea here
18:04:35Araqbut then you have a seq with holes in it and you need to iterate over it to avoid the holes, just like 'pairs' does it
18:05:22kobi7I saw pairs, but it returns an iterator.
18:05:32Araqthe O(1) request only gets you one tiny step further before the reality of hashing kicks in
18:05:55Araq'pairs' doesn't "return" an iterator, it IS an iterator
18:06:02kobi7hehe, that's a worthy quote, Araq :-)
18:06:22*dorelix joined #nim
18:07:02Araqin other words, this field is private because no use cases for its direct access are known
18:07:57kobi7I didn't mean to argue if it sounded like that. just looking for the direct way to do things
18:09:04kobi7so I have multireplace that wants a seq of pairs. shall I write a proc for Table ?
18:09:07*BigEpsilon quit (Ping timeout: 240 seconds)
18:09:11kobi7is toSeq what I want?
18:10:27FromDiscord_<treeform> my enemy #1 : https://github.com/nim-lang/Nim/issues/10202 JS gen can be very convoluted.
18:12:14FromGitter<arnetheduck> @Clyybber nice! just compile or also run? :)
18:12:23FromGitter<Clyybber> Both
18:12:28*zyklon quit (Read error: Connection reset by peer)
18:12:30FromGitter<Clyybber> And I just pulled in you latest changes
18:12:51FromGitter<Clyybber> But those fail.
18:12:57FromGitter<alehander42> @treeform there was a similar bug which got fixed maybe month ago
18:13:29FromGitter<Clyybber> @arnetheduck Is it supposed to work with the latest devel Nim?
18:13:45FromGitter<arnetheduck> no.. just the submoduled version
18:13:56FromGitter<Clyybber> I updated the submodule, guess thats what I did wrong :D
18:15:15*kobi7 quit (Read error: Connection reset by peer)
18:15:55*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:15:57FromGitter<Clyybber> @arnetheduck Just in case you arent aware, rsync failed in CI : https://travis-ci.org/arnetheduck/nlvm/builds/476178886#L2053
18:17:33FromGitter<arnetheduck> yeah, saw.. different shell I'm guessing.. a bit of a bother that rsync, would be much easier to have a blacklist feature in testament (after all.. @Araq) - rsyncing like that doesn't work with the custom categories (like gc)
18:18:07FromGitter<Clyybber> Yeah, looks like the shell doesn't support `{}` syntax
18:19:27FromGitter<Clyybber> Looks like brace expansion is not part of POSIX
18:22:50*seni joined #nim
18:23:28*kapil____ joined #nim
18:24:40Araqinstead of a blacklist.txt you can have a blacklist.sh that moves stuff around
18:25:14AraqI would give you disabled: "nlvm" but the last time you refused
18:29:02*zyklon joined #nim
18:29:18FromDiscord_<moerm> Hello
18:32:12FromDiscord_<treeform> Is there a way to mutate/replace `lib/wrappers/openssl.nim` with my own version, other then constantly updating/replacing the file, and messing with git?
18:34:02Araqnimscript's patchFile mechanism can be used
18:34:08Araqhi moerm
18:34:28FromDiscord_<treeform> neat
18:35:24FromDiscord_<moerm> Kudos to Nim - I'm just looking into a good backup app (knoxite) written in Go. What a mess to get that compiled (need to install go first). With Nim something like that would be much easier/better/less lessy
18:35:35*wildlander joined #nim
18:35:46FromDiscord_<moerm> -lessy +messy
18:38:15FromDiscord_<treeform> Araq, would you be opposed to adding some thing like `-d:sslVersion=1.0.0` flag? And openssl.nim reads the flag if its set?
18:38:58FromDiscord_<treeform> I need a particular ssl version because of C dependencies, they include an older ssl version, which if I don't match, breaks.
18:42:26FromGitter<arnetheduck> @Araq can't move gc and some other tests around, they're hard-coded in testament, likewise for `lib` - if I make a separate copy of `lib` I get some nasty module conflicts instead because there's now two copies of lib - I also can't selectively remove stuff from lib because then things no longer compile.. `disabled:nlvm` means I must make changes the `Nim` repo - doesn't work on a stand-alone setup / has
18:42:26FromGitter... coordination issues (waiting for PR too slow, keeping separate Nim branch means fragmentation) ... also, the right thing to do sometimes is to disable some test variants that come from the same file - say, some gc ..
18:58:57*zachk joined #nim
18:59:47*Ven`` quit (Ping timeout: 240 seconds)
19:02:50FromDiscord_<Zachary Carter> I don't get the Go criticism - you'd have to install Nim to use a Nim project
19:03:32FromGitter<Clyybber> @zacharycarter switched to irc huh?
19:06:01FromGitter<zacharycarter> I'm on gitter too :P
19:06:09FromGitter<zacharycarter> I'm probably on irc, gitter and discord
19:06:11FromGitter<zacharycarter> all at once :P
19:06:31FromGitter<Clyybber> Same, though gitter is really pissing me off on mobile
19:06:42FromGitter<zacharycarter> gitter mobile does suck
19:06:49FromGitter<Clyybber> Clicking anywhere just instantly sends your message, finished or not
19:06:58*zachk quit (Changing host)
19:06:58*zachk joined #nim
19:07:05Araqarnetheduck: could run selective categories then :P
19:08:55FromGitter<arnetheduck> in most categories, there's one or two tests that fail .. often because someone used the `var XXX {.importc.}`constant/define hack instead of importing from `posix` and it got past review
19:09:04FromDiscord_<moerm> Zachary Carter Maybe I'm somewhat biased but I still remember the time I had a look at and played a bit with go. With Nim things are much easier. The only advantage of go is that most linuxes have it as package. But then, building Nim isn't a big thing.
19:09:24FromGitter<zetashift> Huh it wasn't that hard to get going with Go? I had more trouble with Nim on windows, not significantly more though
19:10:04*craigger quit (Quit: bye)
19:10:24*craigger joined #nim
19:11:38FromDiscord_<moerm> oh and not to mention the binary size ...
19:11:39Araqarnetheduck: ok you convinced me to the point I'll accept a "blacklist for testament" PR.
19:12:19FromGitter<arnetheduck> better yet, stop those `importc` things from trickling into the std lib.. such a bother :)
19:12:31FromGitter<zetashift> yea that I heard after they did a lot of rewrites in Go their binary size grew fair bit
19:12:51FromDiscord_<Clyybber> @arnetheduck I guess that will require lots of work
19:13:36FromDiscord_<Zachary Carter> moerm: okay - but that has nothing to do with having to install Go
19:13:47FromDiscord_<Zachary Carter> and you didn't address my point that you still have to install Nim to compile Nim code
19:14:32FromDiscord_<moerm> Zachary Carter Uhm I think I did. No big thing (and: go is usually in the package which is a plus)
19:14:36FromGitter<Clyybber> I guess nim is smaller than go
19:14:53FromGitter<Clyybber> go is ~400mb on my system
19:15:01Araqarnetheduck: I recently merged a PR that use WEXIT_STATUS or whatever it's called
19:15:02FromDiscord_<moerm> The executable produced by Nim are *much* smaller
19:15:26FromDiscord_<Zachary Carter> yes - but that doesn't make an app that is written in Go easier to build than one written in Nim, like you originally suggested - `What a mess to get that compiled (need to install go first).`
19:15:31FromDiscord_<Zachary Carter> was my point
19:15:57FromDiscord_<Zachary Carter> Go does do some funky stuff - like requiring you to place our source code under a certain path, and having certain env variables exported for your shell session
19:16:07FromDiscord_<Zachary Carter> but other than that - I don't find building Go apps any more difficult than building Nim
19:16:18Araqcan we stop the Go discussion please? it's kinda offtopic and moerm only brought it up to avoid my wrath
19:16:24FromDiscord_<moerm> Uhm I never said (or did I word it that clumsily?) that compiling in Nim is worse than in go.
19:16:48Araqarnetheduck: Posix is full of C macros, it's bad
19:17:07Araqany ideas? the PR made Nim work better on Haiku, it's a real problem
19:17:16FromDiscord_<moerm> Zachary I think we have a misunderstanding. My point was that compiling in Go is uglier than in Nim
19:18:08FromDiscord_<moerm> Araq probably not attractive but (in crypto there's lots of macros) I usually precompile the C source and then c2nim
19:18:38AraqI don't like that, c2nim has its own preprocessor
19:18:51Araqin order to produce platform indepedent wrappers
19:19:24FromDiscord_<moerm> I don't like it neither.
19:21:19FromDiscord_<moerm> (but for crypto you need tpo be sure to get it exactly the way gcc or clang "understand" macros)
19:21:36FromDiscord_<moerm> But I LOVE c2nim anyway.
19:23:28FromGitter<arnetheduck> @Araq well, `posix.nim` kind of has the right solution already, which I think is a good model for the future - for "known" platforms, use a `const`with the value defined in `nim` and then have a `generic` fallback that catches the stragglers by importing from c (like haiku could do) - the key idea is to collect all platform-dependent / importc code in `posix` and not spread it all over the place (like `times.nim`
19:23:28FromGitter... that now duplicates the import of some constants that already exist in posix), and then autogenerate it (like `detect.nim` does)
19:24:54Araqhmm ok
19:25:57FromGitter<arnetheduck> it's more a matter of pointing this out to patch authors, as a strategy for managing the issue in `std` so that what helps the left hand doesn't hinder the right
19:26:18*abm joined #nim
19:28:33FromGitter<arnetheduck> the real long-term strategy I believe is still the `libc` solution that simply wraps every local `c` library in full to provide pure-nim declarations of everything in it, removing the need for `.h` files completely - current `posix.nim` can then be kept as that "generic" fallback for semi-supported platforms..
19:29:41AraqI'm thinking about reviving pas2nim for this, FPC runs on a ton of platforms and is much easier to parse than platform specific obfuscated C header files
19:29:43FromGitter<arnetheduck> the nice thing about `libc` is that ABI-compatibility is practically guaranteed - producing the nim wrappers has to be done only once, there's no upgrade churn
19:30:20FromGitter<arnetheduck> well, whatever, but `c` is the lingua franca.. every intermediate step will lose some information
19:31:28FromDiscord_<moerm> Araq *Great idea*! (pas2nim) ... maybe could also open a path for a run-everywhere gui lib
19:32:08Araqwhat kind of information is lost in const x = 4; or function WAITFOR(x: integer): integer; begin result = x shr 8; end; ?
19:32:24Araq(excuse me my rusty Pascal syntax :P )
19:32:47Araqthe only problem is that the FPC stuff can have bugs too
19:34:13AraqI'd like to get rid of the libc dependency, Linux is a kernel, it exposes a binary interface.
19:34:15FromGitter<arnetheduck> mostly the special magic extra attributes.. ie glibc points out which fields are bigendian, notnull etc.. I haven't touched pascal since the 90's, but I'll assume it has unions,bitfields,etc / good coverage for more quirky c abi features?
19:34:43FromGitter<arnetheduck> c is a nice platform independence layer.. one of the most successful ones out there, arguably
19:34:47shashlickCan't read most of this due to dilated eyes but nimterop and nimgen use gcc to preprocess
19:35:08Araqwell yes and no, often it's enough to get the struct/object size and alignment right
19:35:38shashlickWill comment further once I can read again :)
19:36:15Araqthe unions and bitfields inside them don't matter much, they have accessor functions. Ok, well ... it's Posix. "struct X shall have at least the following fields in unspecified order"
19:36:46FromGitter<Clyybber> Any idea why this segfaults? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Don't see anything faulty in the gnu asm code. Taken from the manual [https://gitter.im/nim-lang/Nim?at=5c33aa4e57c6883f9b7a8197]
19:37:27FromGitter<arnetheduck> well, that's why posix is a dead end.. much easier to go straight to the source (your local friendly libc) and get the fields from there
19:38:01AraqClyybber: I don't know, I never got it to work either. :-)
19:38:55Araq"friendly libc"? it's full of #ifdefs to the point where you are better off asking the C binary about offsetof()
19:38:56*zyklon quit (Read error: Connection reset by peer)
19:39:19FromGitter<arnetheduck> still better than posix.. at least you get an answer ;)
19:40:32Araqwell an even better detect.nim can extract these. but #define MACRO(x) is impossible to "query"
19:41:33*theelous3_ joined #nim
19:42:06FromGitter<arnetheduck> yeah, but I'd argue that in the case of `libc`, it's feasible to do the exceptions by hand, as needed, because they never ever change, once done.. if you think about it, it's pretty amazing how good their backwards compatibility story is
19:55:45*zyklon joined #nim
20:04:09FromGitter<Clyybber> Oh god, GNU assemblers comment syntax depends on the target architecture :D
20:07:26FromDiscord_<moerm> *g
20:08:23Araqlibc differences are why binaries are not portable across Linux distros.
20:08:52AraqI have no idea about what kind of "backwards compat story" you're talking about
20:09:33*nsf quit (Quit: WeeChat 2.3)
20:09:33*zyklon quit (Read error: Connection reset by peer)
20:14:26FromGitter<arnetheduck> well not really.. it's very easy to make portable linux binaries, specially if your only dep is `libc` - everyone does them nowadays, you just need to know how.. most incompatibilities come from other libs and projects that have a more.. loose.. approach
20:20:46FromGitter<arnetheduck> what's crucial is that it's backwards compatible, not forwards compatible.. you just need to build on the oldest glibc version you want to support, and it tends to magically just work.. but what I was really talking about was `c` itself - imagine that the `open/read/write` from what.. 40 years ago.. is still around and working to the same spec.. when things in the c standard change, they do so in a way that doesn't
20:20:46FromGitter... break userland / applications - they don't add a parameter or change the behavior of existing stuff
20:26:32*zyklon joined #nim
20:28:55Araqgets() took them decades to remove
20:29:27*vlad1777d joined #nim
20:32:25*kapil____ quit (Quit: Connection closed for inactivity)
20:32:38Araqand the rest is not much better. On Linux fopen() on a directory doesn't produce an error because "everything is a file" but then you cannot read from the "file". "working to the same spec" -- maybe but then the spec is terrible
20:32:44FromGitter<zetashift> This is the recommended wordWrap proc? https://nim-lang.github.io/Nim/wordwrap.html
20:35:40Araqyes
20:39:03FromGitter<arnetheduck> it might be "terrible", but its staying power is remarkable, given all the fancy, clever and advanced solutions that have come since to try to address the issues and at the same time not bring other, worse issues
20:44:10FromDiscord_<moerm> My thought: Pascal is what you get when someone actually thinks before designing. Posix is what you get when someone is trying to think after a conglimerate of thoughless "let's hack" has happened.
20:45:22FromDiscord_<moerm> That's btw. one of the reasons Nim is not "somehow like a better C". Nope. It goes deeper. Nim is what you get when someone thinks a lot and then designs. C is like unix. A dirty hack with ever more stuff added on
20:47:40FromGitter<Clyybber> Well, C was designed at a different time. At least its not as feature bloated as cpp
20:47:50Araqthere is nothing remarkable about it, what we have here is a system that was good at its time and then turned into a tiresome cult
20:48:52Araqand C's innovations are widely regarded as wrong moves by today's standards. Weak typing, unchecked arrays / pointer conflations, a preprocessor
20:49:28FromDiscord_<moerm> btw. How do you address someone here (like e.g. "<Clybber>")?
20:49:48narimiran@moerm you put @ in front of their nick
20:50:15narimiran(without < and > )
20:50:32FromDiscord_<moerm> Thanks. But I still have to type it? (I can't somehow click it)
20:51:00AraqC has got the best marketing of all time though, whenever something is an obviously broken design, the programmer is blamed instead.
20:51:23FromGitter<Clyybber> @moerm For IRC people it shouldn't matter, just type their name ⏎ Yeah you have to type it in. Thats because it all goes through a discord-irc bridge
20:51:24FromGitter<arnetheduck> well, you could say that the "remarklable" part then is that it's still around, in spite of these design issues
20:51:41Araqthe Windows API is still around too.
20:51:49Araqas is most of Java 1's API.
20:52:19FromGitter<arnetheduck> I thought the good folks at microsoft were doing their best to forget that unpleasant fact ;)
20:52:36FromDiscord_<moerm> I don't blame the C devs. a) that was another time and b) C still is a nice cross platform meta-assembler
20:52:59FromDiscord_<moerm> @Clybber thank you.
20:53:18AraqI like real assemblers more. C abstracts over the runtime stack too much.
20:53:31Araqwhich causes lots of problems.
20:53:57FromDiscord_<moerm> @Araq well that's what a meta assembler is
20:53:58*narimiran quit (Quit: Leaving)
20:54:31FromDiscord_<moerm> But I get your point. For that one will have to (real) asm a hardware interface layer
21:00:47*endragor quit (Remote host closed the connection)
21:05:00FromGitter<mratsim> I would love to have access to the carry flags in C ...
21:05:04FromGitter<mratsim> so much for the meta assembler
21:07:02FromGitter<arnetheduck> first language I wrote something in was assembler actually - also tried basic without luck, but assembler is so refreshingly simple.
21:08:52Araqassembler is also powerful and mostly free of weird ambiguous syntax (f(i++, ++i)). Wanna switch the stack for co-routines? swap the stack pointer
21:09:10FromDiscord_<moerm> @mratsim meta-assembler !? asm. MA means that you can write reasonably low level code for diverse platforms. Which btw. is one of the reasons why I think Araqs decision to target C (use it as backend) was very smart and useful
21:09:38FromDiscord_<moerm> -!? + !=
21:10:32Araqno need to butter me up constantly, it's enough to avoid telling me I get easily distracted
21:10:36FromGitter<mratsim> I agree, targeting C means I can enjoy OpenMP
21:10:45FromGitter<mratsim> =)
21:12:44FromDiscord_<moerm> @Araq I'm not buttering you up. I'm saying what I think. Some of that angers you and some of that is very positive.
21:13:04Araqyeah stop that, stay objective
21:13:40*dddddd quit (Ping timeout: 250 seconds)
21:14:16FromDiscord_<moerm> @Araq Pardon me but I will stay the way I am. I thank you very much for Nim and I respect you but you liking me or not liking me is no factor for me. In either direction.
21:14:27*Trustable quit (Remote host closed the connection)
21:15:30FromDiscord_<moerm> "stay objective" as in guessing ones motivation? * friendly grin
21:19:42FromDiscord_<moerm> -> Can anyone tell me a place where I find something like a list of what is ref'd in Nim and what is value copied?
21:20:22FromGitter<mratsim> seq, string, ref object and closure are ref
21:20:31FromGitter<mratsim> everything else is a value type
21:20:46Araqseqs and strings are values too, mostly
21:20:49FromGitter<mratsim> seq and string are ref objects but have value semantics
21:21:13FromDiscord_<moerm> mratsim Thank you. But I'm afraid I'm getting senile a bit early, so a list would be great. I could always look it up
21:22:21FromDiscord_<moerm> I have a lot of procs taking uint8 arrays and I'm wondering whether I need to GC_ref/unref them
21:22:47FromDiscord_<moerm> (the procs are external C)
21:23:05FromGitter<mratsim> you most likely don’t need to
21:24:12FromGitter<mratsim> as long as you only pass ptr uint8 in Nim there is no need to GCref/unref them
21:24:39FromDiscord_<moerm> typically the caller has a var (myarray). It would be cool if I could be *sure* that I don't need to GC_ref/unref those before/after calling the external C func
21:25:05FromGitter<mratsim> ah, so you pass a Nim allocated buffer to C?
21:25:42FromDiscord_<moerm> @mratsim Hmmm ... but them pointers are referring to a local var (which might be GC collected?)
21:25:45FromGitter<mratsim> if it’s a stack array you just need to ensure that it lives long enough for the duration of the C code
21:26:07FromGitter<mratsim> no, ptr uint8 are similar to value types
21:26:23FromGitter<mratsim> they are destroyed only at the end of the scope
21:26:43FromDiscord_<moerm> yep. Often the caller has e.g. var: array[16, int8] and then passes the addr() to a C func expecting a pointer as parm.
21:27:23FromDiscord_<moerm> "destroyed only at the end of the scope" is very good news and makes me happy. But are your really really sure?
21:27:24FromGitter<mratsim> just make sure that the array doesn’t disappear. Especially if the C proc is async
21:27:41FromGitter<mratsim> (I had this issue with Cuda async proc)
21:28:17FromGitter<mratsim> yes, I am really really sure, I use that a lot for Cuda, OpenCL, and various numerical routines I call from C/Fortran
21:28:25FromGitter<mratsim> on arrays I allocated in Nim
21:28:46FromDiscord_<moerm> Nope, won't happen. The C funcs are low level and the parameters I pass are either const or they are a buffer for a return value
21:29:09FromDiscord_<moerm> @mratsim Great! Thanks a lot!
21:30:35FromDiscord_<moerm> Is that generally true for arrays (but if I got Araq right) not necessarily for seq? And: How about an openarray -> my (Nim) caller gets an openarray from its caller and passes the addr of that to the C func. Is that safe without GC_ref/unref?
21:31:50FromGitter<mratsim> Yes, the only issue I had was with async C proc where the proc returned control to Nim code before having finished and the variable was destroyed/finalized too early
21:32:00FromGitter<mratsim> this is probably my most complex C/Fortran wrapper: https://github.com/mratsim/Arraymancer/blob/master/src/linear_algebra/decomposition.nim#L105-L106
21:32:04FromDiscord_<moerm> P.S. to be correct: my (Nim) caller gets a *var* openarray ...
21:32:33FromGitter<mratsim> I pass int32 addresses and seq addresses without issues
21:32:42FromGitter<mratsim> and it’s even used in a parallel context
21:32:47FromGitter<mratsim> and no GC ref/unref
21:33:02FromDiscord_<moerm> Thanks a lot!
21:37:25FromGitter<mratsim> even for GPU I don’t have a single GCref/unref: https://github.com/mratsim/Arraymancer/blob/master/src/nn_primitives/backend/cudnn_conv_interface.nim#L134-L174
21:41:25FromDiscord_<moerm> Cool. I'll have a close look at your code
21:44:14FromGitter<mratsim> The data structure and allocation code for Cuda OpenCL is there: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/cuda.nim#L23-L40 https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/opencl_backend.nim#L35-L44 https://github.com/mratsim/Arraymancer/blob/master/src/tensor/data_structure.nim#L50-L96
21:44:41FromGitter<mratsim> basically I have a ref object that wraps a "ptr T”.
21:45:17FromGitter<mratsim> ptr T is allocated on GPU, and when the ref object is finalized it automatically calls the deallocating proc from Cuda or OpenCL
21:45:20*zyklon quit (Read error: Connection reset by peer)
21:45:36FromGitter<mratsim> so I basically have GC-ed GPU memory =)
21:45:57FromGitter<mratsim> but I don’t have any GCref/unref in my code
21:50:22FromDiscord_<moerm> Well, my needs are a lot simpler. Thanks again!
21:53:34*sheerluck quit (Quit: Leaving)
22:03:27*zyklon joined #nim
22:12:51FromDiscord_<treeform> hmm so you can use `defined(path)` during compile time to check if path was defined, but how to get its value some thing like `getStrDefined(path)` during compile time?
22:15:51FromGitter<kaushalmodi> treeform: see https://scripter.co/notes/nim/#define-switch-value
22:17:50*dddddd joined #nim
22:18:49FromDiscord_<treeform> kaushalmodi, thanks this is exactly what I needed!
22:19:35*theelous3_ quit (Ping timeout: 246 seconds)
22:20:02FromDiscord_<treeform> I don't think have have seen this dock before. I really like this kind of example documentation. Thank you for putting this together.
22:20:10FromDiscord_<treeform> I don't think have have seen this doc before. I really like this kind of example documentation. Thank you for putting this together.
22:20:33*ripspin quit (Quit: Leaving)
22:22:09*krux02 quit (Remote host closed the connection)
22:24:13FromGitter<kaushalmodi> treeform: You are welcome :). The doc started pretty small about a year back. Since then I'm just adding code snippets that I think I'll need for reference at some
22:24:22FromGitter<kaushalmodi> *some point
22:38:29FromDiscord_<moerm> see you soon, and thanks again @mratsim
22:39:22FromGitter<mratsim> you’re welcome
23:22:10FromDiscord_<treeform> many I pass it as parameter it works, i pass it in .nims file it breaks! how!
23:24:35FromDiscord_<treeform> man, I pass it as parameter it works, i pass it in .nims file it breaks! how!
23:26:20*asie joined #nim
23:48:10FromDiscord_<treeform> omg, I might have solved all of this complex code with one line: https://github.com/nim-lang/Nim/pull/10230/files
23:48:23FromDiscord_<treeform> This has been one stubborn line