00:07:01 | zachcarter | hmm… this define is now holding me up - |
00:07:02 | zachcarter | #define NK_ALIGNOF(t) ((char*)(&((struct {char c; t _h;}*)0)->_h) - (char*)0) |
00:08:26 | * | Vladar quit (Quit: Leaving) |
00:30:44 | * | bjz joined #nim |
00:36:20 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:50:03 | * | adeohluwa joined #nim |
00:50:11 | * | chemist69 quit (Ping timeout: 255 seconds) |
00:50:34 | * | chemist69 joined #nim |
00:51:16 | subsetpark | if I want to initialize a ref type (eg a deque), is this idiomatic? |
00:51:47 | subsetpark | https://www.irccloud.com/pastebin/1uy9165y/ |
01:12:56 | * | sz0 joined #nim |
01:18:33 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
01:22:59 | zachcarter | I’m pretty sure I’m close to having nuklear wrapped but I’m getting one final error I can’t figure out - https://gist.github.com/zacharycarter/29ed3e97e371ca5d70708c8a2c3e989f#file-nuklear-nim-L466 |
01:23:08 | zachcarter | nuklearpp.nim(466, 31) Error: cannot evaluate 'sizeof(nk_window)' |
01:23:12 | zachcarter | only error left :/ |
01:25:43 | zachcarter | oh maybe because it has a member named seq in it |
01:25:54 | * | couven92 quit (Quit: Client disconnecting) |
01:26:04 | zachcarter | nope that’s not why... |
01:31:00 | * | brson quit (Quit: leaving) |
01:33:29 | * | rauss joined #nim |
01:34:55 | zachcarter | can anyone help? this is driving me nuts… |
01:40:08 | * | vlad1777d quit (Quit: Leaving) |
01:54:36 | zachcarter | well minus that one error I’m pretty sure the library is wrapped, was just able to call init without any errors, going to try to set up a demo with glfw now |
02:14:53 | * | adeohluwa quit (Ping timeout: 260 seconds) |
02:21:59 | * | chemist69 quit (Ping timeout: 255 seconds) |
02:22:21 | FromGitter | <Varriount> zachcarter: I'm not sure sizeof is implemented to work like that in type sections. |
02:22:36 | zachcarter | ah okay |
02:22:46 | zachcarter | I’ll have to figure something else out… |
02:23:26 | FromGitter | <Varriount> Remember that Nim has to calculate sizeof on its own. |
02:24:09 | FromGitter | <Varriount> zachcarter: Try breaking out that type definition into its own section. |
02:24:20 | zachcarter | okay |
02:35:43 | * | chemist69 joined #nim |
02:51:39 | * | adeohluwa joined #nim |
02:57:21 | * | adeohluwa quit (Ping timeout: 260 seconds) |
03:26:26 | * | roygbiv joined #nim |
03:28:55 | * | adeohluwa joined #nim |
03:33:00 | * | rauss quit (Quit: WeeChat 1.7) |
03:48:41 | zachcarter | so close to getting nuklear to work but this one now has me stumped |
03:54:32 | zachcarter | I’m trying to find the stupid line on github... |
03:55:23 | zachcarter | apparently the file is too long for github to display fully… great |
03:55:28 | zachcarter | gd single header files |
03:55:39 | zachcarter | single header libs* |
04:14:08 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
04:16:07 | zachcarter | Varriount - I’m seeing something strange with my bindings to nuklear |
04:16:25 | zachcarter | if (!ctx || ctx->current || !title || !name) - this check in nuklear.h always fails because ctx->current is not null |
04:16:40 | zachcarter | but if I echo repr ctx.current in nim before calling that C function |
04:16:45 | zachcarter | it evaluates to nil |
04:19:15 | FromGitter | <Varriount> Hm |
04:20:48 | FromGitter | <Varriount> Are you actually converting references to pointers, and passing them in? The GC might be collecting the data then. |
04:20:58 | FromGitter | <Varriount> Also, look at the generated C code. |
04:21:26 | zachcarter | okay |
04:27:37 | FromGitter | <Varriount> zachcarter: it also might help if I had the Nim code snippet. |
04:27:51 | zachcarter | I can upload everything to a gist real quick |
04:27:55 | zachcarter | or create a git repo |
04:27:59 | zachcarter | if that would help |
04:28:15 | zachcarter | I’ll start with a gist |
04:30:13 | * | adeohluwa quit (Ping timeout: 260 seconds) |
04:30:15 | zachcarter | https://gist.github.com/zacharycarter/2eb816963e0526f86cb257a26c11463e#file-nuklear-h-L23 |
04:30:59 | zachcarter | that assert will fail when - https://gist.github.com/zacharycarter/2eb816963e0526f86cb257a26c11463e#file-nukleartest-nim-L164 |
04:31:00 | zachcarter | is called |
04:32:37 | * | rauss joined #nim |
04:32:58 | FromGitter | <Varriount> Yeah, I'd look at the generated C code for this one. |
04:33:19 | zachcarter | I’m trying to make heads / tails of that now |
04:33:51 | zachcarter | do you mean the generated c code of the test? or of the bindings? |
04:34:53 | FromGitter | <Varriount> Well, I'd look at the test first. |
04:34:57 | zachcarter | okay |
04:35:13 | zachcarter | going to remove a lot of code from it and just have the nuklear related stuff in there and see if that doesn’t help |
04:35:40 | FromGitter | <Varriount> Basically, I'd following the call, from the moment it is invoked through to the actual implementation. |
04:36:45 | zachcarter | okay |
04:37:05 | * | adeohluwa joined #nim |
04:46:34 | * | synshroud quit (Quit: ZNC 1.6.4 - http://znc.in) |
04:48:21 | * | synshroud joined #nim |
04:52:34 | zachcarter | Okay I think I figured out part of my problem |
04:52:56 | zachcarter | https://gist.github.com/zacharycarter/2be728697be59af160796ed6e53667b4 is more along the lines of what I should be doing |
04:53:08 | zachcarter | based on - https://github.com/vurtun/nuklear/blob/master/demo/glfw_opengl3/main.c |
04:53:16 | zachcarter | and -https://github.com/vurtun/nuklear/blob/master/demo/glfw_opengl3/nuklear_glfw_gl3.h |
04:53:20 | zachcarter | whoops - https://github.com/vurtun/nuklear/blob/master/demo/glfw_opengl3/nuklear_glfw_gl3.h |
04:54:01 | * | adeohluwa quit (Ping timeout: 260 seconds) |
04:55:00 | zachcarter | still not working though |
04:56:25 | FromGitter | <Varriount> zachcarter: Sorry, I might be able to help more tomorrow. |
04:56:30 | zachcarter | np |
04:56:54 | FromGitter | <Varriount> Currently im studying for a test |
04:57:04 | zachcarter | ah okay, good luck with your exam |
04:57:11 | zachcarter | best wishes on it |
05:18:18 | zachcarter | Varriount : I got passed the problem, thanks for the help |
05:24:30 | * | roygbiv quit (Quit: ™) |
05:25:11 | * | roygbiv joined #nim |
05:36:38 | * | chemist69 quit (Ping timeout: 240 seconds) |
05:49:14 | * | roygbiv quit (Quit: ™) |
05:55:16 | * | chemist69 joined #nim |
06:20:52 | * | libman quit (Quit: Connection closed for inactivity) |
06:56:14 | * | nsf joined #nim |
06:56:47 | * | yglukhov joined #nim |
07:00:12 | * | xet7 joined #nim |
07:25:21 | * | djellemah_ joined #nim |
07:41:29 | * | chemist69 quit (Ping timeout: 255 seconds) |
07:46:05 | * | chemist69 joined #nim |
07:47:52 | * | djellemah_ quit (Quit: Leaving) |
07:48:28 | * | djellemah_ joined #nim |
07:49:40 | * | rokups joined #nim |
07:50:06 | rokups | any idea if iterator with single yield statement would be optimized out? |
07:52:50 | rokups | hmm looks like answer is "yes" |
07:53:40 | rokups | i think i can make nim coroutines and normal gc stuff use same code while allowing to have coroutines and all that with no extra overhead when coroutines are not used \o/ |
07:53:56 | * | yglukhov quit (Remote host closed the connection) |
07:54:44 | * | rauss quit (Quit: WeeChat 1.7) |
08:03:03 | * | Kingsquee joined #nim |
08:06:03 | Araq | rokups: when can I merge your stuff? |
08:09:23 | rokups | as it is now its working, but i think i can do bit better by making normal gc code without coroutines use "stack: GcStack" instead of "stackBottom: pointer" and use that stack iterator which will be optimized out anyway. this would produce less code duplication. maybe within a week i hope. |
08:10:13 | * | yglukhov joined #nim |
08:23:21 | Araq | well I want to merge it to get tests green on OSX |
08:28:59 | rokups | if you want to merge and do not mind that bit of a mess it is there now then go for it. as far as i can tell things are working. ill just make new PR with cleanups later on. after that cleanup ill test arm as well, supporting it should not take much of an effort i think. |
08:38:51 | * | bjz quit (Ping timeout: 240 seconds) |
08:39:01 | * | bjz_ joined #nim |
08:44:08 | Araq | ok |
08:45:28 | * | Vladar joined #nim |
08:54:21 | * | Trustable joined #nim |
08:54:21 | * | zachcarter quit (Ping timeout: 260 seconds) |
09:09:55 | yglukhov | Araq: hi, could you pls fix or help me fix https://github.com/nim-lang/Nim/issues/5241 ? |
09:10:33 | yglukhov | I suppose the bug is somewhere in isObjectSubtype/sameObjectTypes |
09:13:20 | * | user_ joined #nim |
09:13:28 | * | user_ quit (Client Quit) |
09:13:29 | * | Trustable quit (Quit: Leaving) |
09:13:30 | * | user__ joined #nim |
09:14:21 | * | nsf quit (Quit: WeeChat 1.7) |
09:14:36 | * | nsf joined #nim |
09:31:41 | * | djellemah_ quit (Ping timeout: 260 seconds) |
09:34:16 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
09:39:26 | * | Matthias247 joined #nim |
09:40:16 | * | yglukhov quit (Remote host closed the connection) |
09:42:11 | federico3 | is the mailing list losing traffic again? |
09:44:08 | * | Jipok joined #nim |
09:45:35 | * | Jipok quit (Client Quit) |
09:48:51 | * | zevlg quit (Ping timeout: 240 seconds) |
09:52:41 | * | djellemah_ joined #nim |
09:57:20 | * | djellemah_ quit (Remote host closed the connection) |
09:57:47 | * | djellemah_ joined #nim |
10:22:37 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
10:40:47 | * | yglukhov joined #nim |
10:41:22 | * | Guest71185 joined #nim |
10:45:43 | * | yglukhov quit (Ping timeout: 268 seconds) |
10:48:28 | * | vlad1777d joined #nim |
10:53:30 | * | Guest71185 quit (Remote host closed the connection) |
10:59:53 | * | byte512 quit (Ping timeout: 260 seconds) |
11:21:19 | * | Etheco quit (Quit: Leaving) |
11:21:38 | * | yglukhov joined #nim |
11:22:24 | * | yglukhov quit (Remote host closed the connection) |
11:24:58 | * | yglukhov joined #nim |
11:38:34 | * | Snircle joined #nim |
11:53:21 | * | user__ quit (Remote host closed the connection) |
12:01:55 | * | bjz joined #nim |
12:07:05 | * | bjz quit (Ping timeout: 260 seconds) |
12:08:06 | * | bjz joined #nim |
12:19:28 | * | yglukhov quit (Remote host closed the connection) |
12:32:44 | * | yglukhov joined #nim |
12:38:39 | * | shashlick quit (Ping timeout: 240 seconds) |
12:40:58 | * | shashlick joined #nim |
12:41:41 | * | PMunch joined #nim |
12:46:53 | dom96 | federico3: what do you mean by losing traffic? What traffic would a mailing list get? |
12:47:32 | demi- | haha |
13:10:36 | * | yglukhov quit (Remote host closed the connection) |
13:22:54 | * | bjz_ joined #nim |
13:24:49 | * | bjz quit (Ping timeout: 268 seconds) |
13:27:48 | * | nsf quit (Quit: WeeChat 1.7) |
13:28:29 | federico3 | dom96: forum posts not being sent to the mlist? |
13:29:01 | dom96 | Probably. I still haven't looked into it. |
13:32:10 | * | rokups quit (Quit: Connection closed for inactivity) |
13:46:04 | * | yglukhov joined #nim |
13:49:50 | * | yglukhov quit (Remote host closed the connection) |
13:57:53 | * | yglukhov joined #nim |
14:02:14 | * | zachcarter joined #nim |
14:02:43 | * | yglukhov quit (Ping timeout: 260 seconds) |
14:05:03 | zachcarter | morning |
14:18:01 | demi- | what is the way you get the last element in the sequence? is it myseq[-1], or am i getting confused with another language? |
14:20:27 | Vladar | demi-: [^1] |
14:20:48 | demi- | ah, thanks! |
14:21:00 | demi- | is -1 invalid then? |
14:22:57 | Vladar | I'd assume so |
14:23:23 | Vladar | seq[^n] is evaluated to seq[seq.len-1], IIRC |
14:23:33 | Vladar | * seq[seq.len-n] |
14:23:35 | * | zachcarter quit (Quit: zachcarter) |
14:32:51 | * | zachcarter joined #nim |
14:33:41 | zachcarter | I got nuklear wrapped last night, but the wrapper isn’t quite working :/ can’t figure out why. The C code is getting called but I think either the way I’m calling my bindings or the bindings themselves are screwed up |
14:34:02 | * | rokups joined #nim |
14:34:34 | * | Matthias247 quit (Read error: Connection reset by peer) |
14:39:04 | demi- | hmmm, is there any way i can debug why some code is telling me it isn't GCsafe? |
14:40:12 | zachcarter | would anyone be willing to help me figure out why these bindings aren’t working if I created a github repo for them? |
14:40:47 | zachcarter | btw these bindings are for the immediate mode gui library - https://github.com/vurtun/nuklear |
14:42:17 | Vladar | Hey, guys, is it a known bug or should I post an issue? https://gist.github.com/Vladar4/132f029a9ad5b191d66ab63d7473283f |
14:44:13 | Vladar | Actually, I think I can minimize it even further |
14:44:58 | * | yglukhov joined #nim |
14:45:35 | Vladar | yep, updated the gist |
14:53:40 | rokups | Vladar: your gist doesnt do anything |
14:53:49 | Vladar | exactly |
14:54:07 | Vladar | it doesn't compile without any error message |
14:55:01 | rokups | you should have pointed it out ;) |
14:55:05 | rokups | definitely a bug |
14:55:14 | Vladar | if proc `$` is changed for other name, i.e. proc str, the expected error of undeclared proc appears |
14:55:29 | Vladar | see commented output below ) |
14:56:27 | rokups | nim still needs forward declarations, but there should be an error displayed, not silent exit |
14:57:18 | Vladar | it's pretty specific, like only with Obj member of type seq[Obj] and only with `$` proc |
14:59:44 | rokups | only thee who knows it all can provide more insight into this. im compiler nub.. |
15:01:53 | dom96 | demi-: add the gcsafe pragma to the proc that it's complaining about, it might tell you which call isn't gc safe then. |
15:03:24 | dom96 | Vladar: That's a cyclic object definition |
15:03:27 | dom96 | But yes, report it |
15:03:37 | dom96 | `Obj` should be a `ref` |
15:05:09 | * | byte512 joined #nim |
15:05:59 | Vladar | dom96, well yeah, but there should be an error message |
15:06:10 | dom96 | yes |
15:06:11 | Vladar | submitted https://github.com/nim-lang/Nim/issues/5412 |
15:06:55 | demi- | thank you dom96, that was helpful |
15:15:15 | rokups | got whiff of inspiration and did that gc code cleanup. master will be happy. got another intriguing idea - making coroutines opt-out. maybe CI will reveal more bugs. |
15:20:13 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
15:22:07 | * | adeohluwa joined #nim |
15:23:20 | * | yglukhov quit (Remote host closed the connection) |
15:27:53 | zachcarter | https://github.com/zacharycarter/nuklear-nim |
15:27:58 | zachcarter | here are my non-working nuklear bindings and a test |
15:28:31 | zachcarter | if you run gcc -c bind.c && g++ -dynamiclib -undefined suppress -flat_namespace bind.o -o libnuklear.dylib (on osx) |
15:28:38 | zachcarter | you can produce a nuklear dylib that you can link the bindings to |
15:29:06 | zachcarter | if anyone is willing to check this project out and help me I’d greatly appreciate it, and I can walk you through exactly where my problem currently lies |
15:33:41 | rokups | probably best idea would be posting in the forum about it |
15:35:56 | zachcarter | hrm okay |
15:35:58 | * | jjido joined #nim |
15:39:17 | demi- | is there a way to automatically turn an interator into a sequence? |
15:44:17 | demi- | *iterator |
15:45:05 | FromGitter | <Varriount> demi-: toSeq in sequtils |
15:45:09 | stisa | A converter using toSeq maybe |
15:45:42 | * | jjido quit (Read error: Connection reset by peer) |
15:46:40 | rokups | wouldnt adding const to system.nim make it available in all modules? |
15:51:18 | FromGitter | <Varriount> Rokups: You mean, adding a constant value? Yes |
15:51:38 | rokups | for some reason it does not work |
15:51:57 | FromGitter | <Varriount> rokups: Did you mark it as public? |
15:52:11 | rokups | thank you! |
15:52:22 | rokups | and i thought im going crazy |
15:53:19 | demi- | thank you varriount |
15:54:01 | FromGitter | <konqoro> @demi better use accumulateResult from system |
15:55:13 | zachcarter | anyone use lldb with nim? I can’t figure out how to succesfully set breakpoints... |
15:55:19 | FromGitter | <konqoro> but then you need to make a proc so its not automatic |
16:00:01 | * | yglukhov joined #nim |
16:08:14 | demi- | konqoro, why is that better? |
16:12:51 | * | yglukhov quit (Remote host closed the connection) |
16:14:19 | * | yglukhov joined #nim |
16:14:38 | zachcarter | nevermind I figured out the lldb issue |
16:21:55 | * | PMunch quit (Quit: leaving) |
16:37:06 | * | libman joined #nim |
16:42:52 | zachcarter | what is the answer to the captcha - either I’ve lost all ability to count or something is screwy on forum registration |
16:44:41 | * | yglukhov quit (Remote host closed the connection) |
16:56:30 | FromGitter | <Varriount> zachcarter: What is the question? |
16:58:17 | zachcarter | I’m still dealing with that same issue from last night Varriount |
16:58:19 | zachcarter | how’d your test go btw? |
17:04:12 | zachcarter | oh Varriount - did you mean the question on the captcha? |
17:05:02 | dom96 | zachcarter: can you try again? |
17:05:08 | zachcarter | dom96: sure |
17:05:40 | demi- | hmmmm, i'm looking at typeinfo and it seems like i should be able to get a seq of all the field names of an object type using `fields()` and `toSeq()` but i am having trouble getting just the name out of that, the compiler doesn't seem to like me doing this. |
17:05:42 | zachcarter | dom96: that worked |
17:06:04 | dom96 | zachcarter: great. Seems like the forum starts misbehaving after months of uptime. |
17:06:10 | zachcarter | ah okay |
17:06:14 | dom96 | Restarting it helped. |
17:06:23 | zachcarter | :D thank you |
17:06:31 | dom96 | np :) |
17:14:48 | zachcarter | okay I posted my question on the forums - https://forum.nim-lang.org/t/2807 |
17:20:16 | * | _alexr_ joined #nim |
17:20:37 | * | _alexr_ quit (Remote host closed the connection) |
17:25:49 | * | adeohluwa quit (Ping timeout: 260 seconds) |
17:28:05 | * | Matthias247 joined #nim |
17:31:14 | * | nsf joined #nim |
17:45:10 | * | yglukhov joined #nim |
17:45:24 | * | nsf quit (Quit: WeeChat 1.7) |
17:49:19 | * | yglukhov quit (Ping timeout: 240 seconds) |
17:50:45 | * | yglukhov joined #nim |
17:52:15 | * | yglukhov quit (Remote host closed the connection) |
17:52:30 | * | yglukhov joined #nim |
17:58:17 | dom96 | What do you guys think should be in a Nim cheatsheet/reference? |
18:00:57 | Araq | zachcarter: callback that are passed to C and then invoked on a different thread needs the .gcsafe annotation and also call setupForeignThreadGc |
18:03:04 | zachcarter | Araq: okay thank you I’ll see if I can track down the places I’m doing that |
18:08:52 | * | rauss joined #nim |
18:09:51 | zachcarter | Araq: I’m not sure that’s applicable to my situation, I’m not passing any callbacks, simply a pointer to a struct |
18:09:57 | zachcarter | or object |
18:16:21 | dom96 | I will be putting a Nim cheatsheet on the inside cover of my book, so suggestions very much welcome :) |
18:28:02 | zachcarter | I added gcsafe pragmas to all the functions that are taking callbacks in the nim bindings, and called setupForeignThreadGc Araq, but no luck |
18:28:15 | zachcarter | probably not understanding your suggestion correclty |
18:28:18 | zachcarter | correctly* |
18:36:43 | * | rauss quit (Quit: WeeChat 1.7) |
18:36:53 | * | rauss joined #nim |
18:36:53 | * | rauss quit (Client Quit) |
18:37:07 | * | rauss joined #nim |
19:00:32 | Araq | zachcarter: call it in error_callback |
19:00:45 | zachcarter | okay |
19:04:58 | * | yglukhov quit (Remote host closed the connection) |
19:35:12 | * | Redfoxmoon joined #nim |
19:35:48 | Redfoxmoon | \o/ |
19:36:37 | dom96 | hi Redfoxmoon! |
19:36:51 | Redfoxmoon | dom96, hiya o/ |
19:37:24 | * | yglukhov joined #nim |
19:38:50 | Redfoxmoon | how's cross-compilation for nim? |
19:40:47 | dom96 | Easy as long as you have a C compiler that supports cross-compilation. |
19:42:17 | * | dddddd joined #nim |
19:42:22 | Redfoxmoon | alright? |
19:43:03 | Redfoxmoon | wondering since you need to run koch to generate the final compiler, no? |
19:45:18 | Redfoxmoon | dom96, is it that not needed? |
19:45:21 | Redfoxmoon | or is that |
19:45:57 | dom96 | Not sure what you mean. |
19:46:16 | dom96 | You run 'koch' to bootstrap the compiler. |
19:46:48 | dom96 | The Nim compiler can cross-compile to anything as long as it has the appropriate C compiler. |
19:46:54 | dom96 | (In your PATH) |
19:49:13 | * | yglukhov quit (Remote host closed the connection) |
19:49:35 | * | chemist69 quit (Ping timeout: 255 seconds) |
19:49:46 | dom96 | https://nim-lang.org/docs/nimc.html#cross-compilation |
19:49:49 | Redfoxmoon | oh. |
19:50:19 | Redfoxmoon | hehehe, that will help:-) |
19:54:03 | * | chemist69 joined #nim |
19:57:00 | zachcarter | updated the thread with a much simpler example, same problem - https://forum.nim-lang.org/t/2807/1#17478 |
19:57:06 | zachcarter | took out all the glfw stuff |
19:58:46 | shashlick | if I run an installer directly from explorer, the run as admin prompt pops up, however if I run it from Nim using execCmdEx(), it pops an error |
19:59:19 | shashlick | Error: unhandled exception: The requested operation requires elevation. |
19:59:26 | shashlick | OSError |
20:04:41 | Redfoxmoon | dom96, what about cross-compiling nim? |
20:05:32 | dom96 | Redfoxmoon: nim c compiler/nim |
20:05:44 | dom96 | The compiler is itself a Nim program, so it works the same way |
20:05:50 | Redfoxmoon | ah, cool!:-) |
20:06:58 | * | yay joined #nim |
20:12:39 | yay | @Arag OK, I got my answer here: https://github.com/pragmagic/vscode-nim/issues/38, would be good to also include this line in the snippet on the Download page under "Bleeding edge installation from GitHub". I see it's mentioned under "Installation based on generated C code" in the section above, but I never looked there, as this wasn't my chosen way of installation. |
20:14:13 | * | yglukhov joined #nim |
20:18:20 | * | yglukhov quit (Ping timeout: 240 seconds) |
20:21:59 | * | adeohluwa joined #nim |
20:22:10 | * | rokups quit (Quit: Connection closed for inactivity) |
20:22:12 | * | Vladar quit (Read error: Connection reset by peer) |
20:28:41 | * | djellemah_ quit (Ping timeout: 240 seconds) |
20:29:01 | * | djellemah_ joined #nim |
20:29:13 | * | djellemah quit (Ping timeout: 260 seconds) |
20:29:22 | * | djellemah joined #nim |
20:32:54 | * | Jesin quit (Quit: Leaving) |
20:44:17 | * | sz0 quit (Quit: Connection closed for inactivity) |
20:46:58 | * | smt joined #nim |
21:14:21 | * | def-pri-pub joined #nim |
21:18:19 | * | adeohluwa quit (Ping timeout: 240 seconds) |
21:20:44 | * | jjido joined #nim |
21:29:05 | * | yay quit (Quit: yay) |
21:30:31 | * | nsf joined #nim |
21:33:03 | * | MonkeyJam joined #nim |
21:34:23 | * | MonkeyJam quit (Client Quit) |
21:34:53 | * | MonkeyJam joined #nim |
21:35:15 | * | MonkeyJam left #nim (#nim) |
21:38:48 | * | vlad1777d_ joined #nim |
21:40:41 | * | vlad1777d quit (Ping timeout: 240 seconds) |
21:59:43 | * | Vladar joined #nim |
22:00:52 | * | libman quit (Quit: Connection closed for inactivity) |
22:01:26 | * | djellemah_ quit (Ping timeout: 255 seconds) |
22:01:40 | zachcarter | okay the nuklear wrapper is working for the most part, having a bit of difficulty still getting things to draw but i’ve gotten muchf urther along |
22:01:59 | * | krux02 joined #nim |
22:04:00 | * | smt_ joined #nim |
22:05:06 | * | Jesin joined #nim |
22:05:20 | Araq | zachcarter: what was the rproblem? |
22:05:59 | zachcarter | Araq: I believe it had something to do with the example I was following and how he was using static structs to hold his context |
22:06:07 | zachcarter | I’m not 100% sure though |
22:06:44 | zachcarter | I’m going to post up this new example shortly in the repo once I actually get something to draw - but at this point I have the glfw window displaying and the nuklear begin / end calls working I just need to figure out how to get things to render, but I’m almost there :D |
22:07:03 | zachcarter | we should have a sweet new imgui library at our disposal soon |
22:07:17 | * | smt quit (Ping timeout: 255 seconds) |
22:07:35 | krux02 | yes imgui is c++ afaik, but it is mostly just method calls |
22:08:15 | zachcarter | oh no krux02 I wrote nuklear bindings |
22:08:19 | zachcarter | last night / today |
22:08:26 | krux02 | yea I just saw tho forum post |
22:08:29 | krux02 | and that you solved it |
22:08:32 | zachcarter | yeah |
22:08:41 | zachcarter | well I haven’t gotten things working 100% of the way yet but I”m almost there |
22:08:48 | zachcarter | just opengl stuff now I think |
22:08:52 | krux02 | cool |
22:09:09 | krux02 | will it be a 100% wrapper, or a just what you need wrapper? |
22:09:16 | zachcarter | 100% wrapper |
22:09:45 | zachcarter | patching / diffing is still goign to be an issue I’m going to have to write a mangler |
22:09:53 | zachcarter | as types need to be moved all over the place |
22:10:03 | zachcarter | nuklear uses tons of forward declarations for structs |
22:11:01 | krux02 | yea I think I have some dark memories with forward declared structs might be an issue |
22:11:38 | krux02 | I looked at that library, it is header only, isn't it? |
22:16:28 | * | yglukhov joined #nim |
22:19:50 | zachcarter | yup |
22:21:21 | * | smt_ is now known as smt |
22:25:27 | * | smt_ joined #nim |
22:28:53 | * | smt quit (Ping timeout: 255 seconds) |
22:37:45 | zachcarter | oh yeah |
22:38:00 | zachcarter | I need to try to figure out how to convert this horrific define, to a nim template - #define NK_ALIGNOF(t) ((char*)(&((struct {char c; t _h;}*)0)->_h) - (char*)0) |
22:38:50 | zachcarter | or I need another way to figure out the orientation of a type |
22:40:40 | * | Vladar quit (Quit: Leaving) |
22:41:42 | rauss | What's the difference between `type Foo = ref object` and having `Foo = ref FooObj`? I can tell the latter is a convention, but don't know why. Both have worked the same for everything I've done so far |
22:42:21 | rauss | (where `FOoObj = object`) |
22:44:37 | dom96 | There isn't much of a difference |
22:44:45 | dom96 | The latter means that you can also use 'FooObj' |
22:44:54 | dom96 | if you want a non-ref version, but that's rare. |
22:45:10 | rauss | dom96: Thanks |
22:45:18 | dom96 | and the fact that both are available is a historical artifact |
22:45:26 | dom96 | 'ref object' is relatively new |
22:46:36 | zachcarter | template alignof(typ) = |
22:46:36 | zachcarter | if sizeof(typ) > 1: |
22:46:38 | zachcarter | return offsetof(tuple[c: char, x: typ]) |
22:46:39 | zachcarter | else: |
22:46:39 | zachcarter | return 1 |
22:46:40 | zachcarter | crap sorry |
22:50:02 | * | yglukhov quit (Ping timeout: 255 seconds) |
22:53:34 | krux02 | yay my version breaks the c backend: |
22:53:34 | krux02 | template alignof(T: typedesc): int = cast[int](cast[ptr tuple[c: byte; t: T]](nil).t.addr) |
22:53:34 | krux02 | echo alignof(int) |
22:53:34 | krux02 | echo alignof(float32) |
22:53:34 | krux02 | echo alignof(float64) |
22:53:34 | krux02 | echo alignof(byte) |
22:53:36 | krux02 | |
22:53:41 | krux02 | sorry |
22:54:02 | krux02 | I wanted a nice pastie: http://ix.io/nss |
22:55:18 | zachcarter | nice :D |
22:56:05 | zachcarter | here’s what I came up with - https://gist.github.com/zacharycarter/7b7233ca49c33f6865303b1b3d4d8d22 |
22:56:31 | krux02 | http://ix.io/nsu |
22:57:26 | krux02 | you should make your dummy a ptr typ |
22:57:55 | krux02 | a ptr type value is initialized with nil, therefore the members have exactly the offset address |
22:58:13 | zachcarter | ah okay good call thank you |
22:58:24 | krux02 | and offsetof should be standard library, because it's pretty hacky to write it |
23:30:57 | * | vlad1777d_ quit (Quit: Leaving) |
23:37:28 | zachcarter | stumped again |
23:37:39 | zachcarter | so close too :/ |
23:39:44 | zachcarter | for some reason my enum value is being translated to - 1536 - in C |
23:46:12 | * | jjido quit (Remote host closed the connection) |
23:47:20 | * | yglukhov joined #nim |
23:47:39 | * | PMunch joined #nim |
23:48:44 | * | nsf quit (Quit: WeeChat 1.7) |
23:50:51 | zachcarter | https://gist.github.com/zacharycarter/6cbd957e30c33ca0d25e619cc5a4323f |
23:50:56 | zachcarter | so weird... |
23:51:50 | * | yglukhov quit (Ping timeout: 240 seconds) |
23:53:09 | krux02 | well, I can't do much with those code pastes |
23:53:23 | krux02 | the line number in the output don't match with the line numbers in the sourcecode |
23:53:42 | zachcarter | yeah I just tried to copy / paste relevant snippets |
23:53:47 | krux02 | also I don.t know how that code is related to each other |
23:54:01 | zachcarter | I just updated the gist a bit I can try to explain |
23:54:06 | krux02 | well yea, you took out the context, I don't understand it like this |
23:54:10 | zachcarter | yeah |
23:54:32 | zachcarter | only thing I can think to do is check in everything, but you’re not on osx are you? you’d have to change the linking stuff and re-build the library |
23:54:43 | zachcarter | I can post up all the code but it’s a lot of code |
23:54:55 | krux02 | Nope, no OSX |
23:56:01 | krux02 | well, I think it's useful to me, too |
23:56:04 | krux02 | so I might do that |
23:56:10 | krux02 | just let me clone the project |
23:56:15 | zachcarter | okay one moment please |
23:56:17 | zachcarter | let me check in some stuff |
23:56:34 | krux02 | but that project is header only, isn't it? |
23:57:00 | krux02 | so what linking stuff are you talking about? |
23:57:32 | zachcarter | oh I meant my bindings |
23:57:41 | zachcarter | it is header only |
23:58:04 | zachcarter | https://github.com/zacharycarter/nuklear-nim/blob/master/bind.c |
23:58:11 | krux02 | I am not sure what I think about bindings to header only libraries |
23:58:29 | krux02 | writing a binding is basically porting the header to Nim |
23:58:41 | zachcarter | no |
23:58:45 | krux02 | for header only it means porting everythig |
23:58:53 | zachcarter | yeah I get what you mean |
23:58:56 | zachcarter | but that’s not what I did |
23:59:09 | zachcarter | I just ran c2nim on the header without the implementation included |
23:59:37 | krux02 | so it's not header only? |
23:59:56 | krux02 | I look at it myself |
23:59:57 | zachcarter | it is but he does this thing where the implementation is surrounded by #ifdef |