00:00:46 | FromGitter | <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:36 | rect0x51 | timotheecour: 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:18 | FromGitter | <timotheecour> didn’t say it wasn’t trivial, it’s trivial to add the symbols generated by `registerCallback` to `nim dump` |
00:08:03 | FromGitter | <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:29 | rect0x51 | I see, seems like a discussion about it with Araq is needed. |
00:16:39 | rect0x51 | Though 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:09 | FromDiscord_ | <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:02 | FromDiscord_ | <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:52 | FromDiscord_ | <exelotl> @hcorion ohhh awesome! I didn't know anyone else was doing this with Nim |
00:50:05 | FromDiscord_ | <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:53 | FromDiscord_ | <hcorion> not sure if it still compiles though |
00:55:42 | * | zyklon joined #nim |
00:58:27 | FromGitter | <zacharycarter> hcorion: long time no see - are you still using Nim? |
01:01:00 | FromDiscord_ | <hcorion> haven't for a while unfortunately |
01:01:07 | FromGitter | <zacharycarter> :( |
01:01:32 | FromDiscord_ | <hcorion> I got involved in RPCS3, which is in C++, so I spent all my time doing C++ |
01:02:32 | FromDiscord_ | <hcorion> And now taking game design at college, so doesn't look like I'll be playing with Nim any time soon 😦 |
01:03:45 | FromGitter | <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:05 | FromGitter | <zacharycarter> but regardless - congrats on the game dev schooling! awesome stuff! |
01:04:49 | FromDiscord_ | <hcorion> thanks, would be cool to improve the rod engine, that's for sure |
01:05:23 | FromGitter | <zacharycarter> I'm working on an PBR rendering engine atm |
01:05:39 | FromGitter | <zacharycarter> rod is cool - but totally undocumented |
01:05:52 | FromGitter | <zacharycarter> and I don't think that situation is changing anytime soon |
01:06:47 | FromDiscord_ | <hcorion> PBR rendering engine in Nim? That's awesome! |
01:06:47 | FromDiscord_ | <hcorion> Yeah I wonder what kind of usage rod and nimx might get if the got some good docs |
01:09:38 | FromGitter | <zacharycarter> probably quite a bit - unfortunately the game using rod seems to have died |
01:11:31 | FromDiscord_ | <hcorion> ah that sucks, is yglukhov going to work on future games or was that it? |
01:11:44 | FromGitter | <zacharycarter> not sure :/ |
01:11:46 | FromGitter | <zacharycarter> hopefully! |
01:12:07 | FromGitter | <zacharycarter> I think he's working with status now - like a lot of the more talented / knowledgeable Nim devs |
01:12:31 | FromGitter | <zacharycarter> they seem to have all been gobbled up :P and then of course some went to work for Nim itself |
01:12:47 | FromDiscord_ | <hcorion> ah, right |
01:13:21 | FromDiscord_ | <hcorion> well I should get back to my homework 😛 |
01:13:53 | FromGitter | <zacharycarter> gl! |
01:18:23 | * | theelous3_ quit (Ping timeout: 245 seconds) |
01:34:32 | * | rect0x51 quit (Quit: WeeChat 2.3) |
01:37:00 | FromDiscord_ | <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:40 | FromGitter | <zacharycarter> there's one way to find out :) |
01:42:50 | FromDiscord_ | <Protty> valgrind? lol |
01:42:53 | FromGitter | <zacharycarter> apparently so |
01:42:54 | FromGitter | <zacharycarter> no |
01:43:06 | FromDiscord_ | <Protty> darn |
01:43:09 | FromGitter | <zacharycarter> well actually |
01:43:13 | FromGitter | <zacharycarter> valgrind might be the best bet |
01:43:44 | FromGitter | <zacharycarter> but - based on this little test, I'd have to assume SOMETHING is being allocated on the heap |
01:43:52 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c32aed8357dd7655d2adc58] |
01:44:02 | FromGitter | <zacharycarter> the code is |
01:44:12 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c32aeec1d1c2c3f9cd28547] |
01:45:02 | FromGitter | <zacharycarter> `gc:none` will check to make sure nothing is being referenced by the GC |
01:45:16 | FromGitter | <zacharycarter> so it's not a surefire bet at all |
01:48:13 | FromGitter | <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:14 | FromGitter | <zacharycarter> I get |
01:48:23 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c32afe73cf6c35a84a108a4] |
01:49:23 | FromDiscord_ | <Protty> oh, is it the `nimIntToStr` thats allocating a string? |
01:50:03 | FromDiscord_ | <Protty> oh, is it the `nimIntToStr` thats allocating a string every echo? |
01:51:25 | FromGitter | <zacharycarter> probably |
01:51:38 | FromGitter | <zacharycarter> looks that way Protty - so you might be fine :) |
01:53:06 | * | rockcavera joined #nim |
01:53:42 | FromDiscord_ | <Protty> phew. thanks for the help! |
01:54:33 | FromGitter | <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:06 | FromGitter | <m4d3bug> have your guys seen this before? |
02:52:09 | FromGitter | <m4d3bug> https://github.com/moigagoo/nimage |
02:52:37 | FromGitter | <m4d3bug> I am using dive https://github.com/wagoodman/dive so I can see what's they did in the container |
02:58:07 | FromGitter | <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:25 | FromGitter | <m4d3bug> what is the iirc? |
03:26:50 | xace | iirc == If I Recall Correctly |
03:30:38 | FromGitter | <m4d3bug> LOL,Is there any link that allows me to see how the nim playground uses nimage? |
03:41:46 | xace | https://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:59 | FromGitter | <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:44 | FromGitter | <timotheecour> @krux02 are you here? https://github.com/nim-lang/Nim/issues/10185 is locked; why ? |
04:58:51 | leorize | what do you mean by locked? |
04:59:32 | FromGitter | <timotheecour> i can’t comment on it, can you? it shows: `you can’t perform this action at this time` |
04:59:59 | FromGitter | <timotheecour> I’ve seen this on a a few other PR’s and issues from @krux02 |
05:01:00 | FromGitter | <timotheecour> I was gonna reply with a fix, but cannot because of that |
05:01:55 | leorize | I can comment |
05:02:18 | leorize | and I've just added one |
05:02:25 | leorize | can you see it? |
05:02:28 | FromGitter | <timotheecour> (https://files.gitter.im/nim-lang/Nim/fyCF/image.png) |
05:03:12 | leorize | can you still create issues? |
05:03:46 | FromGitter | <timotheecour> yes, and I can comment on any other issue except those from @krux02 |
05:03:51 | FromGitter | <timotheecour> super weird |
05:06:20 | leorize | he might have blocked you, see: https://help.github.com/articles/blocking-a-user-from-your-personal-account/ |
05:06:48 | leorize | well, it doesn't say anything about not being able to comment :/ |
05:06:53 | leorize | so maybe it's something else? |
05:07:08 | FromGitter | <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:39 | ripspin | is #head the same as the nightlies releases? |
12:28:48 | PMunch | Well it's nighly + whatever has been comitted during the day |
12:28:56 | PMunch | committed* |
12:30:13 | ripspin | iv got Nim Compiler Version 0.19.9 after a choosenim #head |
12:30:45 | narimiran | ripspin: 0.19.9 can be a lot of things, depending on when it was last updated |
12:31:25 | narimiran | see the compiled date with `nim -v` |
12:34:00 | PMunch | Yeah .9 just means that it is any commit that is not a release |
12:34:44 | narimiran | btw PMunch are you are new guy for playground, or did i mis-read something? |
12:34:55 | narimiran | *are you our |
12:35:10 | PMunch | Yes, but not yet |
12:35:20 | PMunch | Waiting to get the torch passed on |
12:35:32 | narimiran | haha, ok. i just wanted to know |
12:38:33 | PMunch | Have some plans to make it better |
12:38:53 | PMunch | Amongst those switching to an editor that actually supports Nim syntax :P |
12:39:31 | narimiran | great to hear |
12:40:29 | narimiran | hopefully 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:06 | ripspin | Compiled at 2019-01-07 |
12:41:20 | narimiran | ripspin: then you're set :) |
12:41:53 | narimiran | PMunch: one of my plans is to make playground more visible, so these changes would be very nice to have |
12:53:41 | PMunch | Oh yeah, newest stable version (or possibly even choosing the version) is also on my list |
12:54:02 | narimiran | nice! |
12:54:11 | * | abm quit (Quit: Leaving) |
12:55:39 | PMunch | I already started tinkering with something like "A tour of Go" |
13:01:47 | FromGitter | <kaushalmodi> > A tour of Go ⏎ ⏎ PMunch: +1 |
13:02:00 | FromGitter | <kaushalmodi> i.e. +1 of "A tour of Nim" :D |
13:06:01 | FromGitter | <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:37 | PMunch | What are you using for the sorting? |
13:11:15 | PMunch | You can compare enums like this: http://ix.io/1xIP/Nim |
13:11:30 | dom96_w | PMunch: Awesome! Keep reminding me to give you access to the VPS (can't now, at work) |
13:11:49 | PMunch | Will do :) |
13:12:03 | dom96_w | I'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:41 | FromGitter | <zetashift> nim's algorithm sorted(), but I'd need to write my own cmp function no even though enum are ordinals? |
13:12:49 | PMunch | Oh 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:26 | PMunch | zetashift, nope you can just do this: http://ix.io/1xIS/Nim |
13:14:26 | * | zyklon quit (Read error: Connection reset by peer) |
13:14:48 | PMunch | Echoes out @[One, Two, Three] |
13:17:12 | FromGitter | <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:26 | FromGitter | <zetashift> also bless that sugar module |
13:18:30 | PMunch | What are you working on by the way? |
13:20:23 | FromGitter | <zetashift> @PMunch goofing around with libtcod trying to get better: https://imgur.com/a/CBx1IKA |
13:21:18 | PMunch | Oh nice, roguelikes :) |
13:21:43 | PMunch | Sucks that I can't play nethack without a numpad on my Dvorak layout keyboard |
13:21:55 | FromGitter | <zetashift> Can't you rebind? |
13:22:10 | * | PMunch shudders |
13:22:20 | PMunch | Rebinding all of Nethacks bindings? |
13:22:26 | PMunch | That's like the entire keyboard :P |
13:25:36 | PMunch | I'll have to rebind something to get movement to work, but that would shift other keys etc. |
13:28:30 | FromGitter | <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:57 | Zevv | Is there fast and a idiomatic way to convert array[uint8] to a string or cstring? |
13:39:06 | PMunch | Of course they did, but I already know the QWERTY bindings, and relearning all of them will be a pain.. |
13:39:11 | narimiran | Zevv: $ ? |
13:39:36 | Zevv | yeah, problem is that $ is defined for the type. I'm trying to do a lot of base64 of sha1 hashes |
13:39:46 | Zevv | but $ securehash is defined and creates a hex string |
13:39:55 | Zevv | basically, I'd like a raw 20 byte string |
13:39:59 | Zevv | from the 20 byte uint8 array |
13:40:10 | Zevv | and casting is icky |
13:40:14 | * | abm joined #nim |
13:40:25 | Zevv | as is copying |
13:41:02 | PMunch | Well, casting works.. |
13:41:25 | Zevv | ok, np, thanks! |
13:42:02 | PMunch | I think Araq has basically said that seq[byte] -> string casting isn't going to change. Even though it's a bit icky |
13:45:41 | Zevv | works for me |
13:47:25 | * | vlad1777d joined #nim |
13:53:04 | * | zyklon quit (Read error: Connection reset by peer) |
14:05:12 | FromDiscord_ | <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:58 | PMunch | Not entirely sure, are you looking for a particular symbol? |
14:25:17 | FromDiscord_ | <Protty> looking for `windows`, `linux` and `posix` |
14:25:47 | leorize | `nim dump` |
14:26:34 | FromDiscord_ | <Protty> oh, they dont exist ... any way to define them in nimble? |
14:26:51 | FromDiscord_ | <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:03 | leorize | they should exists in nimble |
14:28:45 | * | synthmeat joined #nim |
14:30:29 | FromDiscord_ | <Protty> is there a way to set them? im using `--os:standalone` and `--gc:none` if thats preventing anything? |
14:32:13 | leorize | --os:standalone kill those define of automatically |
14:32:18 | leorize | but shouldn't affect nimble |
14:34:06 | FromDiscord_ | <Protty> ah, no wonder. ill try putting them in the cfg instead |
14:34:52 | FromDiscord_ | <Protty> nvm, just realized that doesnt execute nimscript |
14:36:04 | FromDiscord_ | <Protty> currently trying to do |
14:36:04 | FromDiscord_ | <Protty> ```nim |
14:36:05 | FromDiscord_ | <Protty> when defined(nimdistros): |
14:36:05 | FromDiscord_ | <Protty> import distros |
14:36:05 | FromDiscord_ | <Protty> if detectOs(Windows): |
14:36:05 | FromDiscord_ | <Protty> --d:windows |
14:36:05 | FromDiscord_ | <Protty> elif detectOs(Linux): |
14:36:07 | FromDiscord_ | <Protty> --d:linux |
14:36:08 | FromDiscord_ | <Protty> ``` |
14:36:10 | FromDiscord_ | <Protty> but it doesnt seem to work (im on windows 10 using nim's mingw gcc) |
14:36:19 | PMunch | Please use a paste service |
14:36:43 | * | synthmeat quit (Quit: WeeChat 2.3) |
14:36:58 | leorize | @Protty you should add that to a project config file instead of nimble |
14:37:20 | FromDiscord_ | <Protty> by paste service, do you mean like hastebin or similar? |
14:37:37 | * | synthmeat joined #nim |
14:37:40 | leorize | and you shouldn't define those symbols |
14:37:49 | leorize | create your own, like "onLinux" |
14:37:57 | PMunch | Protty, yes |
14:38:24 | leorize | because 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:55 | FromDiscord_ | <Protty> ive tried putting it in the config file but it errors out trying to use `when` as a command line option |
14:41:40 | leorize | what file did you put it in? |
14:41:57 | FromDiscord_ | <Protty> <project_name>.nim.cfg |
14:42:03 | * | synthmeat joined #nim |
14:42:09 | leorize | you should put it into a config.nims file |
14:42:20 | FromDiscord_ | <Protty> ooh, that config file. sorry |
14:42:24 | * | synthmeat quit (Client Quit) |
14:46:56 | FromDiscord_ | <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:30 | leorize | you're using --os:standalone |
14:47:49 | leorize | remember that a lot of stdlib functionality just won't work |
14:47:58 | leorize | especially the os module |
14:48:15 | leorize | why are you using --os:standalone anyway? |
14:49:06 | FromDiscord_ | <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:34 | leorize | then don't use --os:standalone |
14:49:34 | FromDiscord_ | <Protty> would an alternative be to check out how detectOs is implemented from the source? |
14:50:03 | leorize | --os:standalone should be used only when you're writing stuff that doesn't need an os |
14:50:06 | leorize | like a kernel |
14:50:53 | * | kapil____ quit (Quit: Connection closed for inactivity) |
14:51:41 | FromDiscord_ | <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:13 | leorize | --gc:none should raise warnings in compile time |
14:52:46 | leorize | closures are rarely used in the stdlib, but yes, exceptions requires heap allocation |
14:52:58 | leorize | only when they're raised |
14:53:18 | * | synthmeat joined #nim |
14:55:31 | leorize | @Protty: you might be interested in --gc:stack |
14:55:48 | leorize | documentations are scare, but there's a post on the forum on how to use it iirc |
14:57:11 | FromDiscord_ | <Protty> is there a way to not link to the gc in general? |
14:57:57 | leorize | --gc:none |
14:58:08 | leorize | every gc usage will be warned, so you'd know what to avoid |
14:58:14 | * | d10n-work joined #nim |
15:01:53 | FromDiscord_ | <Protty> is there any way to map a C define symbol (e.g. `_WIN32`) into nim to use `when defined(_WIN32)` ? |
15:02:31 | leorize | no |
15:02:52 | leorize | for your use case, --gc:none should suffice |
15:03:07 | leorize | anytime you touch the GC, directly or indirectly, you get a warning |
15:03:35 | FromDiscord_ | <Protty> i also cant use c malloc or similar |
15:03:38 | leorize | avoid --os:standalone and you will get `when defined(windows)` back |
15:03:55 | leorize | malloc is not indirectly used anywhere, don't worry |
15:04:57 | leorize | once allocators is a thing, you can replace the Nim's allocator directly and don't have to worry too much about these |
15:08:45 | FromDiscord_ | <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:11 | FromGitter | <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:36 | FromGitter | <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:39 | kobi7 | Hi guys |
17:59:07 | FromGitter | <Clyybber> Hi kobi |
17:59:47 | kobi7 | when 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:58 | kobi7 | hi Clyybber |
18:01:03 | kobi7 | btw, I ported from python the html entity definition table. it was so easy. a 10 min work. |
18:01:22 | kobi7 | so nice, the syntax almost matches one to one |
18:02:01 | kobi7 | I think the nim translate proc might be what I needed to use, but decided to go that route |
18:02:04 | FromGitter | <zetashift> what do you mean getter or setter of a table? |
18:02:50 | kobi7 | the 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:52 | kobi7 | you know, instead of iterating, I can get it with a single O(1) request |
18:03:58 | kobi7 | at least that's my idea here |
18:04:35 | Araq | but 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:22 | kobi7 | I saw pairs, but it returns an iterator. |
18:05:32 | Araq | the O(1) request only gets you one tiny step further before the reality of hashing kicks in |
18:05:55 | Araq | 'pairs' doesn't "return" an iterator, it IS an iterator |
18:06:02 | kobi7 | hehe, that's a worthy quote, Araq :-) |
18:06:22 | * | dorelix joined #nim |
18:07:02 | Araq | in other words, this field is private because no use cases for its direct access are known |
18:07:57 | kobi7 | I didn't mean to argue if it sounded like that. just looking for the direct way to do things |
18:09:04 | kobi7 | so 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:11 | kobi7 | is toSeq what I want? |
18:10:27 | FromDiscord_ | <treeform> my enemy #1 : https://github.com/nim-lang/Nim/issues/10202 JS gen can be very convoluted. |
18:12:14 | FromGitter | <arnetheduck> @Clyybber nice! just compile or also run? :) |
18:12:23 | FromGitter | <Clyybber> Both |
18:12:28 | * | zyklon quit (Read error: Connection reset by peer) |
18:12:30 | FromGitter | <Clyybber> And I just pulled in you latest changes |
18:12:51 | FromGitter | <Clyybber> But those fail. |
18:12:57 | FromGitter | <alehander42> @treeform there was a similar bug which got fixed maybe month ago |
18:13:29 | FromGitter | <Clyybber> @arnetheduck Is it supposed to work with the latest devel Nim? |
18:13:45 | FromGitter | <arnetheduck> no.. just the submoduled version |
18:13:56 | FromGitter | <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:57 | FromGitter | <Clyybber> @arnetheduck Just in case you arent aware, rsync failed in CI : https://travis-ci.org/arnetheduck/nlvm/builds/476178886#L2053 |
18:17:33 | FromGitter | <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:07 | FromGitter | <Clyybber> Yeah, looks like the shell doesn't support `{}` syntax |
18:19:27 | FromGitter | <Clyybber> Looks like brace expansion is not part of POSIX |
18:22:50 | * | seni joined #nim |
18:23:28 | * | kapil____ joined #nim |
18:24:40 | Araq | instead of a blacklist.txt you can have a blacklist.sh that moves stuff around |
18:25:14 | Araq | I would give you disabled: "nlvm" but the last time you refused |
18:29:02 | * | zyklon joined #nim |
18:29:18 | FromDiscord_ | <moerm> Hello |
18:32:12 | FromDiscord_ | <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:02 | Araq | nimscript's patchFile mechanism can be used |
18:34:08 | Araq | hi moerm |
18:34:28 | FromDiscord_ | <treeform> neat |
18:35:24 | FromDiscord_ | <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:46 | FromDiscord_ | <moerm> -lessy +messy |
18:38:15 | FromDiscord_ | <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:58 | FromDiscord_ | <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:26 | FromGitter | <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:26 | FromGitter | ... 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:50 | FromDiscord_ | <Zachary Carter> I don't get the Go criticism - you'd have to install Nim to use a Nim project |
19:03:32 | FromGitter | <Clyybber> @zacharycarter switched to irc huh? |
19:06:01 | FromGitter | <zacharycarter> I'm on gitter too :P |
19:06:09 | FromGitter | <zacharycarter> I'm probably on irc, gitter and discord |
19:06:11 | FromGitter | <zacharycarter> all at once :P |
19:06:31 | FromGitter | <Clyybber> Same, though gitter is really pissing me off on mobile |
19:06:42 | FromGitter | <zacharycarter> gitter mobile does suck |
19:06:49 | FromGitter | <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:05 | Araq | arnetheduck: could run selective categories then :P |
19:08:55 | FromGitter | <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:04 | FromDiscord_ | <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:24 | FromGitter | <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:38 | FromDiscord_ | <moerm> oh and not to mention the binary size ... |
19:11:39 | Araq | arnetheduck: ok you convinced me to the point I'll accept a "blacklist for testament" PR. |
19:12:19 | FromGitter | <arnetheduck> better yet, stop those `importc` things from trickling into the std lib.. such a bother :) |
19:12:31 | FromGitter | <zetashift> yea that I heard after they did a lot of rewrites in Go their binary size grew fair bit |
19:12:51 | FromDiscord_ | <Clyybber> @arnetheduck I guess that will require lots of work |
19:13:36 | FromDiscord_ | <Zachary Carter> moerm: okay - but that has nothing to do with having to install Go |
19:13:47 | FromDiscord_ | <Zachary Carter> and you didn't address my point that you still have to install Nim to compile Nim code |
19:14:32 | FromDiscord_ | <moerm> Zachary Carter Uhm I think I did. No big thing (and: go is usually in the package which is a plus) |
19:14:36 | FromGitter | <Clyybber> I guess nim is smaller than go |
19:14:53 | FromGitter | <Clyybber> go is ~400mb on my system |
19:15:01 | Araq | arnetheduck: I recently merged a PR that use WEXIT_STATUS or whatever it's called |
19:15:02 | FromDiscord_ | <moerm> The executable produced by Nim are *much* smaller |
19:15:26 | FromDiscord_ | <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:31 | FromDiscord_ | <Zachary Carter> was my point |
19:15:57 | FromDiscord_ | <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:07 | FromDiscord_ | <Zachary Carter> but other than that - I don't find building Go apps any more difficult than building Nim |
19:16:18 | Araq | can we stop the Go discussion please? it's kinda offtopic and moerm only brought it up to avoid my wrath |
19:16:24 | FromDiscord_ | <moerm> Uhm I never said (or did I word it that clumsily?) that compiling in Nim is worse than in go. |
19:16:48 | Araq | arnetheduck: Posix is full of C macros, it's bad |
19:17:07 | Araq | any ideas? the PR made Nim work better on Haiku, it's a real problem |
19:17:16 | FromDiscord_ | <moerm> Zachary I think we have a misunderstanding. My point was that compiling in Go is uglier than in Nim |
19:18:08 | FromDiscord_ | <moerm> Araq probably not attractive but (in crypto there's lots of macros) I usually precompile the C source and then c2nim |
19:18:38 | Araq | I don't like that, c2nim has its own preprocessor |
19:18:51 | Araq | in order to produce platform indepedent wrappers |
19:19:24 | FromDiscord_ | <moerm> I don't like it neither. |
19:21:19 | FromDiscord_ | <moerm> (but for crypto you need tpo be sure to get it exactly the way gcc or clang "understand" macros) |
19:21:36 | FromDiscord_ | <moerm> But I LOVE c2nim anyway. |
19:23:28 | FromGitter | <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:28 | FromGitter | ... that now duplicates the import of some constants that already exist in posix), and then autogenerate it (like `detect.nim` does) |
19:24:54 | Araq | hmm ok |
19:25:57 | FromGitter | <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:33 | FromGitter | <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:41 | Araq | I'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:43 | FromGitter | <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:20 | FromGitter | <arnetheduck> well, whatever, but `c` is the lingua franca.. every intermediate step will lose some information |
19:31:28 | FromDiscord_ | <moerm> Araq *Great idea*! (pas2nim) ... maybe could also open a path for a run-everywhere gui lib |
19:32:08 | Araq | what kind of information is lost in const x = 4; or function WAITFOR(x: integer): integer; begin result = x shr 8; end; ? |
19:32:24 | Araq | (excuse me my rusty Pascal syntax :P ) |
19:32:47 | Araq | the only problem is that the FPC stuff can have bugs too |
19:34:13 | Araq | I'd like to get rid of the libc dependency, Linux is a kernel, it exposes a binary interface. |
19:34:15 | FromGitter | <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:43 | FromGitter | <arnetheduck> c is a nice platform independence layer.. one of the most successful ones out there, arguably |
19:34:47 | shashlick | Can't read most of this due to dilated eyes but nimterop and nimgen use gcc to preprocess |
19:35:08 | Araq | well yes and no, often it's enough to get the struct/object size and alignment right |
19:35:38 | shashlick | Will comment further once I can read again :) |
19:36:15 | Araq | the 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:46 | FromGitter | <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:27 | FromGitter | <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:01 | Araq | Clyybber: I don't know, I never got it to work either. :-) |
19:38:55 | Araq | "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:19 | FromGitter | <arnetheduck> still better than posix.. at least you get an answer ;) |
19:40:32 | Araq | well an even better detect.nim can extract these. but #define MACRO(x) is impossible to "query" |
19:41:33 | * | theelous3_ joined #nim |
19:42:06 | FromGitter | <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:09 | FromGitter | <Clyybber> Oh god, GNU assemblers comment syntax depends on the target architecture :D |
20:07:26 | FromDiscord_ | <moerm> *g |
20:08:23 | Araq | libc differences are why binaries are not portable across Linux distros. |
20:08:52 | Araq | I 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:26 | FromGitter | <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:46 | FromGitter | <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:46 | FromGitter | ... break userland / applications - they don't add a parameter or change the behavior of existing stuff |
20:26:32 | * | zyklon joined #nim |
20:28:55 | Araq | gets() took them decades to remove |
20:29:27 | * | vlad1777d joined #nim |
20:32:25 | * | kapil____ quit (Quit: Connection closed for inactivity) |
20:32:38 | Araq | and 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:44 | FromGitter | <zetashift> This is the recommended wordWrap proc? https://nim-lang.github.io/Nim/wordwrap.html |
20:35:40 | Araq | yes |
20:39:03 | FromGitter | <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:10 | FromDiscord_ | <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:22 | FromDiscord_ | <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:40 | FromGitter | <Clyybber> Well, C was designed at a different time. At least its not as feature bloated as cpp |
20:47:50 | Araq | there 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:52 | Araq | and C's innovations are widely regarded as wrong moves by today's standards. Weak typing, unchecked arrays / pointer conflations, a preprocessor |
20:49:28 | FromDiscord_ | <moerm> btw. How do you address someone here (like e.g. "<Clybber>")? |
20:49:48 | narimiran | @moerm you put @ in front of their nick |
20:50:15 | narimiran | (without < and > ) |
20:50:32 | FromDiscord_ | <moerm> Thanks. But I still have to type it? (I can't somehow click it) |
20:51:00 | Araq | C has got the best marketing of all time though, whenever something is an obviously broken design, the programmer is blamed instead. |
20:51:23 | FromGitter | <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:24 | FromGitter | <arnetheduck> well, you could say that the "remarklable" part then is that it's still around, in spite of these design issues |
20:51:41 | Araq | the Windows API is still around too. |
20:51:49 | Araq | as is most of Java 1's API. |
20:52:19 | FromGitter | <arnetheduck> I thought the good folks at microsoft were doing their best to forget that unpleasant fact ;) |
20:52:36 | FromDiscord_ | <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:59 | FromDiscord_ | <moerm> @Clybber thank you. |
20:53:18 | Araq | I like real assemblers more. C abstracts over the runtime stack too much. |
20:53:31 | Araq | which causes lots of problems. |
20:53:57 | FromDiscord_ | <moerm> @Araq well that's what a meta assembler is |
20:53:58 | * | narimiran quit (Quit: Leaving) |
20:54:31 | FromDiscord_ | <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:00 | FromGitter | <mratsim> I would love to have access to the carry flags in C ... |
21:05:04 | FromGitter | <mratsim> so much for the meta assembler |
21:07:02 | FromGitter | <arnetheduck> first language I wrote something in was assembler actually - also tried basic without luck, but assembler is so refreshingly simple. |
21:08:52 | Araq | assembler 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:10 | FromDiscord_ | <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:38 | FromDiscord_ | <moerm> -!? + != |
21:10:32 | Araq | no need to butter me up constantly, it's enough to avoid telling me I get easily distracted |
21:10:36 | FromGitter | <mratsim> I agree, targeting C means I can enjoy OpenMP |
21:10:45 | FromGitter | <mratsim> =) |
21:12:44 | FromDiscord_ | <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:04 | Araq | yeah stop that, stay objective |
21:13:40 | * | dddddd quit (Ping timeout: 250 seconds) |
21:14:16 | FromDiscord_ | <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:30 | FromDiscord_ | <moerm> "stay objective" as in guessing ones motivation? * friendly grin |
21:19:42 | FromDiscord_ | <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:22 | FromGitter | <mratsim> seq, string, ref object and closure are ref |
21:20:31 | FromGitter | <mratsim> everything else is a value type |
21:20:46 | Araq | seqs and strings are values too, mostly |
21:20:49 | FromGitter | <mratsim> seq and string are ref objects but have value semantics |
21:21:13 | FromDiscord_ | <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:21 | FromDiscord_ | <moerm> I have a lot of procs taking uint8 arrays and I'm wondering whether I need to GC_ref/unref them |
21:22:47 | FromDiscord_ | <moerm> (the procs are external C) |
21:23:05 | FromGitter | <mratsim> you most likely don’t need to |
21:24:12 | FromGitter | <mratsim> as long as you only pass ptr uint8 in Nim there is no need to GCref/unref them |
21:24:39 | FromDiscord_ | <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:05 | FromGitter | <mratsim> ah, so you pass a Nim allocated buffer to C? |
21:25:42 | FromDiscord_ | <moerm> @mratsim Hmmm ... but them pointers are referring to a local var (which might be GC collected?) |
21:25:45 | FromGitter | <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:07 | FromGitter | <mratsim> no, ptr uint8 are similar to value types |
21:26:23 | FromGitter | <mratsim> they are destroyed only at the end of the scope |
21:26:43 | FromDiscord_ | <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:23 | FromDiscord_ | <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:24 | FromGitter | <mratsim> just make sure that the array doesn’t disappear. Especially if the C proc is async |
21:27:41 | FromGitter | <mratsim> (I had this issue with Cuda async proc) |
21:28:17 | FromGitter | <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:25 | FromGitter | <mratsim> on arrays I allocated in Nim |
21:28:46 | FromDiscord_ | <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:09 | FromDiscord_ | <moerm> @mratsim Great! Thanks a lot! |
21:30:35 | FromDiscord_ | <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:50 | FromGitter | <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:00 | FromGitter | <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:04 | FromDiscord_ | <moerm> P.S. to be correct: my (Nim) caller gets a *var* openarray ... |
21:32:33 | FromGitter | <mratsim> I pass int32 addresses and seq addresses without issues |
21:32:42 | FromGitter | <mratsim> and it’s even used in a parallel context |
21:32:47 | FromGitter | <mratsim> and no GC ref/unref |
21:33:02 | FromDiscord_ | <moerm> Thanks a lot! |
21:37:25 | FromGitter | <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:25 | FromDiscord_ | <moerm> Cool. I'll have a close look at your code |
21:44:14 | FromGitter | <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:41 | FromGitter | <mratsim> basically I have a ref object that wraps a "ptr T”. |
21:45:17 | FromGitter | <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:36 | FromGitter | <mratsim> so I basically have GC-ed GPU memory =) |
21:45:57 | FromGitter | <mratsim> but I don’t have any GCref/unref in my code |
21:50:22 | FromDiscord_ | <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:51 | FromDiscord_ | <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:51 | FromGitter | <kaushalmodi> treeform: see https://scripter.co/notes/nim/#define-switch-value |
22:17:50 | * | dddddd joined #nim |
22:18:49 | FromDiscord_ | <treeform> kaushalmodi, thanks this is exactly what I needed! |
22:19:35 | * | theelous3_ quit (Ping timeout: 246 seconds) |
22:20:02 | FromDiscord_ | <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:10 | FromDiscord_ | <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:13 | FromGitter | <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:22 | FromGitter | <kaushalmodi> *some point |
22:38:29 | FromDiscord_ | <moerm> see you soon, and thanks again @mratsim |
22:39:22 | FromGitter | <mratsim> you’re welcome |
23:22:10 | FromDiscord_ | <treeform> many I pass it as parameter it works, i pass it in .nims file it breaks! how! |
23:24:35 | FromDiscord_ | <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:10 | FromDiscord_ | <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:23 | FromDiscord_ | <treeform> This has been one stubborn line |