<< 18-02-2017 >>

00:07:01zachcarterhmm… this define is now holding me up -
00:07:02zachcarter#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:16subsetparkif I want to initialize a ref type (eg a deque), is this idiomatic?
00:51:47subsetparkhttps://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:59zachcarterI’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:08zachcarternuklearpp.nim(466, 31) Error: cannot evaluate 'sizeof(nk_window)'
01:23:12zachcarteronly error left :/
01:25:43zachcarteroh maybe because it has a member named seq in it
01:25:54*couven92 quit (Quit: Client disconnecting)
01:26:04zachcarternope that’s not why...
01:31:00*brson quit (Quit: leaving)
01:33:29*rauss joined #nim
01:34:55zachcartercan anyone help? this is driving me nuts…
01:40:08*vlad1777d quit (Quit: Leaving)
01:54:36zachcarterwell 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:21FromGitter<Varriount> zachcarter: I'm not sure sizeof is implemented to work like that in type sections.
02:22:36zachcarterah okay
02:22:46zachcarterI’ll have to figure something else out…
02:23:26FromGitter<Varriount> Remember that Nim has to calculate sizeof on its own.
02:24:09FromGitter<Varriount> zachcarter: Try breaking out that type definition into its own section.
02:24:20zachcarterokay
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:41zachcarterso close to getting nuklear to work but this one now has me stumped
03:54:32zachcarterI’m trying to find the stupid line on github...
03:55:23zachcarterapparently the file is too long for github to display fully… great
03:55:28zachcartergd single header files
03:55:39zachcartersingle header libs*
04:14:08*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
04:16:07zachcarterVarriount - I’m seeing something strange with my bindings to nuklear
04:16:25zachcarterif (!ctx || ctx->current || !title || !name) - this check in nuklear.h always fails because ctx->current is not null
04:16:40zachcarterbut if I echo repr ctx.current in nim before calling that C function
04:16:45zachcarterit evaluates to nil
04:19:15FromGitter<Varriount> Hm
04:20:48FromGitter<Varriount> Are you actually converting references to pointers, and passing them in? The GC might be collecting the data then.
04:20:58FromGitter<Varriount> Also, look at the generated C code.
04:21:26zachcarterokay
04:27:37FromGitter<Varriount> zachcarter: it also might help if I had the Nim code snippet.
04:27:51zachcarterI can upload everything to a gist real quick
04:27:55zachcarteror create a git repo
04:27:59zachcarterif that would help
04:28:15zachcarterI’ll start with a gist
04:30:13*adeohluwa quit (Ping timeout: 260 seconds)
04:30:15zachcarterhttps://gist.github.com/zacharycarter/2eb816963e0526f86cb257a26c11463e#file-nuklear-h-L23
04:30:59zachcarterthat assert will fail when - https://gist.github.com/zacharycarter/2eb816963e0526f86cb257a26c11463e#file-nukleartest-nim-L164
04:31:00zachcarteris called
04:32:37*rauss joined #nim
04:32:58FromGitter<Varriount> Yeah, I'd look at the generated C code for this one.
04:33:19zachcarterI’m trying to make heads / tails of that now
04:33:51zachcarterdo you mean the generated c code of the test? or of the bindings?
04:34:53FromGitter<Varriount> Well, I'd look at the test first.
04:34:57zachcarterokay
04:35:13zachcartergoing 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:40FromGitter<Varriount> Basically, I'd following the call, from the moment it is invoked through to the actual implementation.
04:36:45zachcarterokay
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:34zachcarterOkay I think I figured out part of my problem
04:52:56zachcarterhttps://gist.github.com/zacharycarter/2be728697be59af160796ed6e53667b4 is more along the lines of what I should be doing
04:53:08zachcarterbased on - https://github.com/vurtun/nuklear/blob/master/demo/glfw_opengl3/main.c
04:53:16zachcarterand -https://github.com/vurtun/nuklear/blob/master/demo/glfw_opengl3/nuklear_glfw_gl3.h
04:53:20zachcarterwhoops - 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:00zachcarterstill not working though
04:56:25FromGitter<Varriount> zachcarter: Sorry, I might be able to help more tomorrow.
04:56:30zachcarternp
04:56:54FromGitter<Varriount> Currently im studying for a test
04:57:04zachcarterah okay, good luck with your exam
04:57:11zachcarterbest wishes on it
05:18:18zachcarterVarriount : 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:06rokupsany idea if iterator with single yield statement would be optimized out?
07:52:50rokupshmm looks like answer is "yes"
07:53:40rokupsi 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:03Araqrokups: when can I merge your stuff?
08:09:23rokupsas 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:21Araqwell I want to merge it to get tests green on OSX
08:28:59rokupsif 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:08Araqok
08:45:28*Vladar joined #nim
08:54:21*Trustable joined #nim
08:54:21*zachcarter quit (Ping timeout: 260 seconds)
09:09:55yglukhovAraq: hi, could you pls fix or help me fix https://github.com/nim-lang/Nim/issues/5241 ?
09:10:33yglukhovI 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:11federico3is 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:53dom96federico3: what do you mean by losing traffic? What traffic would a mailing list get?
12:47:32demi-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:29federico3dom96: forum posts not being sent to the mlist?
13:29:01dom96Probably. 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:03zachcartermorning
14:18:01demi-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:27Vladardemi-: [^1]
14:20:48demi-ah, thanks!
14:21:00demi-is -1 invalid then?
14:22:57VladarI'd assume so
14:23:23Vladarseq[^n] is evaluated to seq[seq.len-1], IIRC
14:23:33Vladar* seq[seq.len-n]
14:23:35*zachcarter quit (Quit: zachcarter)
14:32:51*zachcarter joined #nim
14:33:41zachcarterI 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:04demi-hmmm, is there any way i can debug why some code is telling me it isn't GCsafe?
14:40:12zachcarterwould anyone be willing to help me figure out why these bindings aren’t working if I created a github repo for them?
14:40:47zachcarterbtw these bindings are for the immediate mode gui library - https://github.com/vurtun/nuklear
14:42:17VladarHey, guys, is it a known bug or should I post an issue? https://gist.github.com/Vladar4/132f029a9ad5b191d66ab63d7473283f
14:44:13VladarActually, I think I can minimize it even further
14:44:58*yglukhov joined #nim
14:45:35Vladaryep, updated the gist
14:53:40rokupsVladar: your gist doesnt do anything
14:53:49Vladarexactly
14:54:07Vladarit doesn't compile without any error message
14:55:01rokupsyou should have pointed it out ;)
14:55:05rokupsdefinitely a bug
14:55:14Vladarif proc `$` is changed for other name, i.e. proc str, the expected error of undeclared proc appears
14:55:29Vladarsee commented output below )
14:56:27rokupsnim still needs forward declarations, but there should be an error displayed, not silent exit
14:57:18Vladarit's pretty specific, like only with Obj member of type seq[Obj] and only with `$` proc
14:59:44rokupsonly thee who knows it all can provide more insight into this. im compiler nub..
15:01:53dom96demi-: 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:24dom96Vladar: That's a cyclic object definition
15:03:27dom96But yes, report it
15:03:37dom96`Obj` should be a `ref`
15:05:09*byte512 joined #nim
15:05:59Vladardom96, well yeah, but there should be an error message
15:06:10dom96yes
15:06:11Vladarsubmitted https://github.com/nim-lang/Nim/issues/5412
15:06:55demi-thank you dom96, that was helpful
15:15:15rokupsgot 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:53zachcarterhttps://github.com/zacharycarter/nuklear-nim
15:27:58zachcarterhere are my non-working nuklear bindings and a test
15:28:31zachcarterif you run gcc -c bind.c && g++ -dynamiclib -undefined suppress -flat_namespace bind.o -o libnuklear.dylib (on osx)
15:28:38zachcarteryou can produce a nuklear dylib that you can link the bindings to
15:29:06zachcarterif 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:41rokupsprobably best idea would be posting in the forum about it
15:35:56zachcarterhrm okay
15:35:58*jjido joined #nim
15:39:17demi-is there a way to automatically turn an interator into a sequence?
15:44:17demi-*iterator
15:45:05FromGitter<Varriount> demi-: toSeq in sequtils
15:45:09stisaA converter using toSeq maybe
15:45:42*jjido quit (Read error: Connection reset by peer)
15:46:40rokupswouldnt adding const to system.nim make it available in all modules?
15:51:18FromGitter<Varriount> Rokups: You mean, adding a constant value? Yes
15:51:38rokupsfor some reason it does not work
15:51:57FromGitter<Varriount> rokups: Did you mark it as public?
15:52:11rokupsthank you!
15:52:22rokupsand i thought im going crazy
15:53:19demi-thank you varriount
15:54:01FromGitter<konqoro> @demi better use accumulateResult from system
15:55:13zachcarteranyone use lldb with nim? I can’t figure out how to succesfully set breakpoints...
15:55:19FromGitter<konqoro> but then you need to make a proc so its not automatic
16:00:01*yglukhov joined #nim
16:08:14demi-konqoro, why is that better?
16:12:51*yglukhov quit (Remote host closed the connection)
16:14:19*yglukhov joined #nim
16:14:38zachcarternevermind I figured out the lldb issue
16:21:55*PMunch quit (Quit: leaving)
16:37:06*libman joined #nim
16:42:52zachcarterwhat 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:30FromGitter<Varriount> zachcarter: What is the question?
16:58:17zachcarterI’m still dealing with that same issue from last night Varriount
16:58:19zachcarterhow’d your test go btw?
17:04:12zachcarteroh Varriount - did you mean the question on the captcha?
17:05:02dom96zachcarter: can you try again?
17:05:08zachcarterdom96: sure
17:05:40demi-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:42zachcarterdom96: that worked
17:06:04dom96zachcarter: great. Seems like the forum starts misbehaving after months of uptime.
17:06:10zachcarterah okay
17:06:14dom96Restarting it helped.
17:06:23zachcarter:D thank you
17:06:31dom96np :)
17:14:48zachcarterokay 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:17dom96What do you guys think should be in a Nim cheatsheet/reference?
18:00:57Araqzachcarter: callback that are passed to C and then invoked on a different thread needs the .gcsafe annotation and also call setupForeignThreadGc
18:03:04zachcarterAraq: 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:51zachcarterAraq: I’m not sure that’s applicable to my situation, I’m not passing any callbacks, simply a pointer to a struct
18:09:57zachcarteror object
18:16:21dom96I will be putting a Nim cheatsheet on the inside cover of my book, so suggestions very much welcome :)
18:28:02zachcarterI added gcsafe pragmas to all the functions that are taking callbacks in the nim bindings, and called setupForeignThreadGc Araq, but no luck
18:28:15zachcarterprobably not understanding your suggestion correclty
18:28:18zachcartercorrectly*
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:32Araqzachcarter: call it in error_callback
19:00:45zachcarterokay
19:04:58*yglukhov quit (Remote host closed the connection)
19:35:12*Redfoxmoon joined #nim
19:35:48Redfoxmoon\o/
19:36:37dom96hi Redfoxmoon!
19:36:51Redfoxmoondom96, hiya o/
19:37:24*yglukhov joined #nim
19:38:50Redfoxmoonhow's cross-compilation for nim?
19:40:47dom96Easy as long as you have a C compiler that supports cross-compilation.
19:42:17*dddddd joined #nim
19:42:22Redfoxmoonalright?
19:43:03Redfoxmoonwondering since you need to run koch to generate the final compiler, no?
19:45:18Redfoxmoondom96, is it that not needed?
19:45:21Redfoxmoonor is that
19:45:57dom96Not sure what you mean.
19:46:16dom96You run 'koch' to bootstrap the compiler.
19:46:48dom96The Nim compiler can cross-compile to anything as long as it has the appropriate C compiler.
19:46:54dom96(In your PATH)
19:49:13*yglukhov quit (Remote host closed the connection)
19:49:35*chemist69 quit (Ping timeout: 255 seconds)
19:49:46dom96https://nim-lang.org/docs/nimc.html#cross-compilation
19:49:49Redfoxmoonoh.
19:50:19Redfoxmoonhehehe, that will help:-)
19:54:03*chemist69 joined #nim
19:57:00zachcarterupdated the thread with a much simpler example, same problem - https://forum.nim-lang.org/t/2807/1#17478
19:57:06zachcartertook out all the glfw stuff
19:58:46shashlickif 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:19shashlickError: unhandled exception: The requested operation requires elevation.
19:59:26shashlickOSError
20:04:41Redfoxmoondom96, what about cross-compiling nim?
20:05:32dom96Redfoxmoon: nim c compiler/nim
20:05:44dom96The compiler is itself a Nim program, so it works the same way
20:05:50Redfoxmoonah, cool!:-)
20:06:58*yay joined #nim
20:12:39yay@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:40zachcarterokay 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:20Araqzachcarter: what was the rproblem?
22:05:59zachcarterAraq: 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:07zachcarterI’m not 100% sure though
22:06:44zachcarterI’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:03zachcarterwe should have a sweet new imgui library at our disposal soon
22:07:17*smt quit (Ping timeout: 255 seconds)
22:07:35krux02yes imgui is c++ afaik, but it is mostly just method calls
22:08:15zachcarteroh no krux02 I wrote nuklear bindings
22:08:19zachcarterlast night / today
22:08:26krux02yea I just saw tho forum post
22:08:29krux02and that you solved it
22:08:32zachcarteryeah
22:08:41zachcarterwell I haven’t gotten things working 100% of the way yet but I”m almost there
22:08:48zachcarterjust opengl stuff now I think
22:08:52krux02cool
22:09:09krux02will it be a 100% wrapper, or a just what you need wrapper?
22:09:16zachcarter100% wrapper
22:09:45zachcarterpatching / diffing is still goign to be an issue I’m going to have to write a mangler
22:09:53zachcarteras types need to be moved all over the place
22:10:03zachcarternuklear uses tons of forward declarations for structs
22:11:01krux02yea I think I have some dark memories with forward declared structs might be an issue
22:11:38krux02I looked at that library, it is header only, isn't it?
22:16:28*yglukhov joined #nim
22:19:50zachcarteryup
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:45zachcarteroh yeah
22:38:00zachcarterI 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:50zachcarteror I need another way to figure out the orientation of a type
22:40:40*Vladar quit (Quit: Leaving)
22:41:42raussWhat'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:21rauss(where `FOoObj = object`)
22:44:37dom96There isn't much of a difference
22:44:45dom96The latter means that you can also use 'FooObj'
22:44:54dom96if you want a non-ref version, but that's rare.
22:45:10raussdom96: Thanks
22:45:18dom96and the fact that both are available is a historical artifact
22:45:26dom96'ref object' is relatively new
22:46:36zachcartertemplate alignof(typ) =
22:46:36zachcarter if sizeof(typ) > 1:
22:46:38zachcarter return offsetof(tuple[c: char, x: typ])
22:46:39zachcarter else:
22:46:39zachcarter return 1
22:46:40zachcartercrap sorry
22:50:02*yglukhov quit (Ping timeout: 255 seconds)
22:53:34krux02yay my version breaks the c backend:
22:53:34krux02template alignof(T: typedesc): int = cast[int](cast[ptr tuple[c: byte; t: T]](nil).t.addr)
22:53:34krux02echo alignof(int)
22:53:34krux02echo alignof(float32)
22:53:34krux02echo alignof(float64)
22:53:34krux02echo alignof(byte)
22:53:36krux02
22:53:41krux02sorry
22:54:02krux02I wanted a nice pastie: http://ix.io/nss
22:55:18zachcarternice :D
22:56:05zachcarterhere’s what I came up with - https://gist.github.com/zacharycarter/7b7233ca49c33f6865303b1b3d4d8d22
22:56:31krux02http://ix.io/nsu
22:57:26krux02you should make your dummy a ptr typ
22:57:55krux02a ptr type value is initialized with nil, therefore the members have exactly the offset address
22:58:13zachcarterah okay good call thank you
22:58:24krux02and offsetof should be standard library, because it's pretty hacky to write it
23:30:57*vlad1777d_ quit (Quit: Leaving)
23:37:28zachcarterstumped again
23:37:39zachcarterso close too :/
23:39:44zachcarterfor 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:51zachcarterhttps://gist.github.com/zacharycarter/6cbd957e30c33ca0d25e619cc5a4323f
23:50:56zachcarterso weird...
23:51:50*yglukhov quit (Ping timeout: 240 seconds)
23:53:09krux02well, I can't do much with those code pastes
23:53:23krux02the line number in the output don't match with the line numbers in the sourcecode
23:53:42zachcarteryeah I just tried to copy / paste relevant snippets
23:53:47krux02also I don.t know how that code is related to each other
23:54:01zachcarterI just updated the gist a bit I can try to explain
23:54:06krux02well yea, you took out the context, I don't understand it like this
23:54:10zachcarteryeah
23:54:32zachcarteronly 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:43zachcarterI can post up all the code but it’s a lot of code
23:54:55krux02Nope, no OSX
23:56:01krux02well, I think it's useful to me, too
23:56:04krux02so I might do that
23:56:10krux02just let me clone the project
23:56:15zachcarterokay one moment please
23:56:17zachcarterlet me check in some stuff
23:56:34krux02but that project is header only, isn't it?
23:57:00krux02so what linking stuff are you talking about?
23:57:32zachcarteroh I meant my bindings
23:57:41zachcarterit is header only
23:58:04zachcarterhttps://github.com/zacharycarter/nuklear-nim/blob/master/bind.c
23:58:11krux02I am not sure what I think about bindings to header only libraries
23:58:29krux02writing a binding is basically porting the header to Nim
23:58:41zachcarterno
23:58:45krux02for header only it means porting everythig
23:58:53zachcarteryeah I get what you mean
23:58:56zachcarterbut that’s not what I did
23:59:09zachcarterI just ran c2nim on the header without the implementation included
23:59:37krux02so it's not header only?
23:59:56krux02I look at it myself
23:59:57zachcarterit is but he does this thing where the implementation is surrounded by #ifdef