<< 23-11-2014 >>

00:08:20*brson quit (Quit: leaving)
00:08:29*brson joined #nimrod
00:13:17*vendethiel quit (Ping timeout: 240 seconds)
00:17:47*vendethiel joined #nimrod
00:35:12*Boscop joined #nimrod
00:35:12*Boscop quit (Changing host)
00:35:12*Boscop joined #nimrod
00:44:20*AMorpork is now known as AFKMorpork
00:46:08NimBotAraq/Nimrod devel e1630dc Araq [+1 ±1 -1]: fixes #1337
00:47:08*BitPuffin quit (Remote host closed the connection)
00:59:54*vendethiel quit (Ping timeout: 256 seconds)
01:01:59*nande joined #nimrod
01:15:12*vendethiel joined #nimrod
01:17:20*Matthias247 quit (Read error: Connection reset by peer)
01:31:28*darkf joined #nimrod
01:38:30*AFKMorpork is now known as AMorpork
02:29:43*Trustable quit (Remote host closed the connection)
02:39:17*nande quit (Ping timeout: 240 seconds)
02:52:33*kniteli quit (Ping timeout: 258 seconds)
02:55:47*dapz joined #nimrod
03:03:00*dapz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
03:03:19*vendethiel quit (Ping timeout: 272 seconds)
03:04:03*dapz joined #nimrod
03:05:03*fowl joined #nimrod
03:05:26*vendethiel joined #nimrod
03:05:29*kniteli joined #nimrod
03:06:23*dapz quit (Client Quit)
03:07:33*brson quit (Remote host closed the connection)
03:09:54*bjz quit (Read error: Connection reset by peer)
03:10:07*bjz joined #nimrod
03:13:45*ARCADIVS joined #nimrod
03:47:38*vendethiel quit (Ping timeout: 256 seconds)
03:49:56*vendethiel joined #nimrod
04:11:17*vendethiel quit (Ping timeout: 264 seconds)
04:13:24*vendethiel joined #nimrod
04:20:18*perturbation quit (Quit: Leaving)
04:28:05*flaviu quit (Remote host closed the connection)
04:36:26*vendethiel quit (Ping timeout: 258 seconds)
04:39:01*q66 quit (Quit: Leaving)
04:42:44*q66[lap] quit (Read error: Connection reset by peer)
04:43:28*q66[lap] joined #nimrod
04:47:58*vendethiel joined #nimrod
04:57:34*q66[lap] quit (Read error: Connection reset by peer)
05:00:16*q66[lap] joined #nimrod
05:08:40*vendethiel quit (Ping timeout: 256 seconds)
05:50:52*untitaker quit (Ping timeout: 240 seconds)
05:56:14*untitaker joined #nimrod
06:00:52*q66[lap] quit (Read error: Connection reset by peer)
06:03:16*q66[lap] joined #nimrod
06:07:35*vendethiel joined #nimrod
06:28:08*q66[lap] quit (Read error: Connection reset by peer)
06:29:18*vendethiel quit (Ping timeout: 250 seconds)
06:30:32*q66[lap] joined #nimrod
06:40:38*vendethiel joined #nimrod
06:48:32*bjz quit (Read error: Connection reset by peer)
06:48:39*bjz_ joined #nimrod
06:59:08*q66[lap] quit (Read error: Connection reset by peer)
07:01:51*q66[lap] joined #nimrod
07:03:37*vendethiel quit (Ping timeout: 245 seconds)
07:07:29*vendethiel joined #nimrod
07:37:11*gour joined #nimrod
07:58:24*q66[lap] quit (Read error: Connection reset by peer)
07:59:06*q66[lap] joined #nimrod
08:35:12*fowl quit (Read error: Connection reset by peer)
08:37:46*vendethiel quit (Ping timeout: 256 seconds)
08:40:47*vendethiel joined #nimrod
08:53:14*gokr_ joined #nimrod
10:05:23*shodan45 quit (Quit: Konversation terminated!)
10:08:22*Matthias247 joined #nimrod
10:13:38*BlaXpirit joined #nimrod
10:15:02*AMorpork is now known as AFKMorpork
10:35:47*Demos quit (Read error: Connection reset by peer)
10:46:34*bouliiii quit (Ping timeout: 246 seconds)
10:52:06*gokr_ quit (Read error: Connection reset by peer)
10:52:23*gokr_ joined #nimrod
10:58:11*gokr quit (Quit: Leaving.)
11:04:05*gokr joined #nimrod
11:05:57*gokr_ quit (Ping timeout: 240 seconds)
11:28:56*Trustable joined #nimrod
12:00:43*gokr quit (Ping timeout: 258 seconds)
12:31:46*septictank joined #nimrod
12:41:49*gokr joined #nimrod
12:42:03*gokr quit (Remote host closed the connection)
12:47:08*gokr joined #nimrod
13:08:22*septictank left #nimrod ("Leaving")
13:10:11*q66[lap] quit (Read error: Connection reset by peer)
13:13:18*q66[lap] joined #nimrod
13:13:37*q66 joined #nimrod
13:22:45*Matthias247 quit (Read error: Connection reset by peer)
13:23:35EXetoCwhy does c2nim separate parameters with ';'? it's not really used elsewhere, is it? it can make it more readable though because of how ',' can be used
13:23:44*flaviu joined #nimrod
13:26:07*q66[lap] quit (Read error: Connection reset by peer)
13:28:44*q66[lap] joined #nimrod
13:29:09*gokr quit (Quit: Leaving.)
13:29:56*q66[lap] quit (Read error: Connection reset by peer)
13:32:26*q66[lap] joined #nimrod
13:42:18*flaviu quit (Remote host closed the connection)
13:50:05*flaviu joined #nimrod
13:50:06*kniteli quit (Remote host closed the connection)
13:55:26*q66[lap] quit (Read error: Connection reset by peer)
13:58:02*q66[lap] joined #nimrod
14:00:15*bjz joined #nimrod
14:00:15*bjz_ quit (Read error: Connection reset by peer)
14:00:42*q66[lap] quit (Read error: Connection reset by peer)
14:02:44*q66[lap] joined #nimrod
14:03:07*gokr joined #nimrod
14:05:25*q66[lap] quit (Read error: Connection reset by peer)
14:06:05AraqEXetoC: because ; is now encouraged over ,
14:07:27*q66[lap] joined #nimrod
14:10:17EXetoCok
14:57:45*bjz quit (Read error: Connection reset by peer)
14:58:02*bjz joined #nimrod
15:07:41NimBotAraq/Nimrod devel 81f013d Araq [+0 ±1 -0]: fixes #642
15:09:03*q66[lap] quit (Read error: Connection reset by peer)
15:10:43*kemet joined #nimrod
15:15:38*q66[lap] joined #nimrod
15:19:50*darkf quit (Quit: Leaving)
15:32:08*gokr_ joined #nimrod
15:33:37*gokr quit (Ping timeout: 240 seconds)
15:36:15*gokr joined #nimrod
15:36:15*gokr_ quit (Read error: Connection reset by peer)
15:50:40*gokr1 joined #nimrod
16:01:50*BitPuffin joined #nimrod
16:02:05*gokr_ joined #nimrod
16:03:13EXetoCis it possible to define a converter that takes 'nil'?
16:03:37*gokr quit (Ping timeout: 240 seconds)
16:09:44*gokr joined #nimrod
16:13:20*gokr_ quit (Ping timeout: 258 seconds)
16:14:55*gokr_ joined #nimrod
16:16:17*gokr quit (Ping timeout: 240 seconds)
16:18:59*gokr_ quit (Client Quit)
16:28:01*ARCADIVS quit (Quit: ARCADIVS)
16:42:28*bouliiii joined #nimrod
16:45:52bouliiiibyref does not seem to work. I am not sure of the syntax. I am not able to find an example in nim source code. What is the syntax? I just wrote type ssef {.byref.} = m128
16:47:16bouliiiiAlso, what I meant is that it compiles but C codegen does not use pointers
16:49:53bouliiiiHmm. nimrod seems to ask for getSizeType() > sizeof(float) * 2
16:49:57bouliiiiin ccgtypes
16:50:06bouliiiiI am wondering because this is a m128
16:50:18bouliiiiso a imported type, it may just fail to know what this is
16:51:22bouliiiiAh yes
16:51:34bouliiiiI seems that it is not going to work for an imported C type as m128
17:04:00EXetoCwhat about the fact that it's an alias?
17:05:15EXetoCI missed a detail as always
17:05:30bouliiiiMaybe I am not sure. I am littering the compiler with printf :-)
17:08:35EXetoCno it's not that
17:09:47*AFKMorpork is now known as AMorpork
17:12:59bouliiiiok for sure the problem is in ccgIntroducedPtr or before because it does not seem to want to put the ref qualifier here
17:23:21*Matthias247 joined #nimrod
17:26:05bouliiiityByRef seems to get lost between parsing and codegen :-(
17:27:55j3rkyhello, i'm just getting started with nim, and i'm reading through the various documentation and tutorials online. i haven't been able to find any examples yet on what is the idiomatic way to do de-/serialization of objects. is there are runtime reflection, are there any syntactic conventions like in Rust, or is it completely manual/user defined? can anyone push me in the right direction and/or show me some examples?
17:29:39flaviuj3rky: There is runtime type information, http://nim-lang.org/typeinfo.html, there exists the marshal module for serialization: http://nim-lang.org/marshal.html
17:30:03j3rkyah, thank you very much, flaviu. i will take a look!
17:43:01*BitPuffin quit (Ping timeout: 272 seconds)
17:43:06*vendethiel- joined #nimrod
17:45:16*vendethiel quit (Ping timeout: 255 seconds)
18:05:06*BitPuffin joined #nimrod
18:17:39Araqbouliiii: you need to attach .byRef to a unique nominal type
18:17:45Araqotherwise it cannot work
18:18:43bouliiiiAh :-)
18:19:07bouliiiiI was tracing in the debugger to see what was going on and why the param type did not include anymore the flag :-(
18:19:40*Sembei quit (Excess Flood)
18:20:34bouliiiiAraq: I need to use distinct?
18:20:38Araqyes
18:20:53Araqthough this might not work either *cough*
18:20:56*Sembei joined #nimrod
18:21:06bouliiii:-)
18:21:14Araqwell it should be easy to fix
18:21:34bouliiiiI am forcing nim code base in my brain. I can look at it at least
18:22:40Araqbbl
18:23:12bouliiiidoes not work :-(
18:24:53EXetoCAraq: what does that mean? because it works with aliases
18:25:48EXetoCit's because of 'header'? I assume m128 is defined that way
18:26:06bouliiiiAh
18:26:18bouliiiiWe are getting closer. Param types have the flags now :-)
18:43:06bouliiiiAraq: I think there is something weird with ccgIntroducedPtr. You are getting to the last son recursively. So, with a distinct type, we get m128. But m128 has a no flag. The flag is on the parent type (ssef).
18:44:52bouliiiiObviously, I have a "fix" but I am not sure it makes really sense
18:47:33bouliiiiI can open a bug with my current findings if you want.
18:49:03*pafmaf joined #nimrod
18:50:50*gour quit (Disconnected by services)
18:50:51*gour_ joined #nimrod
19:09:25EXetoC"type T=object\nconst X:T=T()" -> "Error: invalid type: 'T'". unreported, right?
19:09:41EXetoCare const object instantiations really not used anywhere?
19:20:17*gour_ is now known as gour
19:30:16Araqbouliiii: just make a PR
19:30:40AraqEXetoC: no bug, you can't have a const object for now
19:30:47Araqerror message could be better of course
19:32:27bouliiiiOK. I'll try to see what I can do
19:32:48*Jesin quit (Quit: Leaving)
19:32:58*kemet quit (Quit: Instantbird 1.5 -- http://www.instantbird.com)
19:34:01bouliiiiAraq: Well, actually, I think my fix should be fix. There is exactly zero byref and bycopy in Nimrod source code :P
19:34:11bouliiiis/should be fix/should be ok
19:34:18Araqbouliiii: no, I bet it's wrong
19:34:34Araqthese things are much harder than it looks like
19:35:05bouliiiifind -name "*nim" | xargs grep byref says nothing
19:35:41bouliiiiI am not looking at external code bases though. Just Araq/Nimrod
19:36:00Araqwell some wrappers use it
19:36:43bouliiiiIf you know one, tell me, I'll look at it to see what will be the other use cases
19:37:01Araqbtw how is m128 defined?
19:37:35bouliiiitype m128* {.importc: "__m128", header: "xmmintrin.h".} = object
19:38:00bouliiiiIt cannot be byref I guess because intrinsics are not byref
19:38:18bouliiiibut msvc will require ptrs for user defined functions
19:39:00Araqwell that's an object
19:39:06Araqbyref should work for that
19:39:09Araqbbl
19:40:02*kemet joined #nimrod
19:40:27EXetoCbouliiii: the pattern is in the wrong case isn't it?
19:40:34bouliiiiI am building a distinct type called ssef on top of it using byref. This one has the flag but not m128
19:40:53*kemet quit (Client Quit)
19:40:58EXetoCeither use the correct case or pass -i to grep
19:41:16bouliiiiBut ccgIntroducedPtr recurses to m128 and therefore skips the flags
19:41:43bouliiiiExectoC: this is the correct case
19:43:11*gour quit (Quit: WeeChat 1.0.1)
19:43:45EXetoCboth can be used
19:43:58*kemet joined #nimrod
19:44:15EXetoCpossibly depending on the compiler version
19:44:55bouliiiiAraq: and using byref on m128 seems to deadlock the compiler :-( It cannot make sense anyway. Intrinsics are byvalue
19:45:37bouliiiiExectoC {.byref.} is not used in the compiler. But I want to check other code bases using it
19:46:32EXetoCbyRef might be morec common
20:01:18*pafmaf quit (Quit: Verlassend)
20:02:02bouliiiiExetoC: Again, there is no byref whatever the case. I checked while debugging it. Again, if you have a use case, just tell me.
20:03:13EXetoCthe simplest test case for 'byRef' does work
20:03:20EXetoCthat's all I know
20:05:18*will joined #nimrod
20:05:35EXetoCno wait, so the 'ref' property is omitted? nevermind then
20:07:52willI used byref in in the GMP wrapper so that a let variable would be passed by ref when the function took a const pointer
20:08:35willa pointer to a const
20:08:43bouliiiiwill: great! would you have a link to this use case?
20:08:49*MightyJoe quit (Quit: No Ping reply in 180 seconds.)
20:08:54EXetoCdid you validate it?
20:08:58willhttps://github.com/cowboy-coders/nim-gmp/blob/master/src/gmp/pure.nim
20:09:09bouliiiiproblem is byref here on a type declaration not on a variable
20:09:18*MightyJoe joined #nimrod
20:09:36bouliiiiwill: thanks!
20:10:07bouliiiiAh
20:10:37EXetoCwill: as in, validate the effect of byRef
20:10:40bouliiiiI think the problem is just with distinct types. Because the compiler is just going to recurse to the leaf type which does *not* have any flag in my case
20:11:10bouliiiiEXetoc: What are you talking about? This https://gist.github.com/bsegovia/ddb1224936db794d0893 does not work
20:11:11EXetoCit was just an alias at first though
20:12:02willEXetoC: what do you mean? Teh generated code seemd to be correct.
20:13:52bouliiiiwill: the code in my simple example use by value arguments for the add function . Anyway, I'll submit a patch.
20:14:40bouliiiiwill: thanks for your example! I can at least check it will not break this example at least
20:14:56willbouliiii: nice, sounds good :D
20:14:57EXetoCbouliiii: nevermind I said. it doesn't work indeed
20:15:26EXetoCwill: the parameters in the C code are pointers for you?
20:16:25EXetoCfor parameters whose nimrod types are annotated with byRef
20:18:51*kemet quit (Quit: Instantbird 1.5 -- http://www.instantbird.com)
20:19:45*bjz quit (Read error: Connection reset by peer)
20:20:12*bjz joined #nimrod
20:22:35willEXetoC: in the gmp code, yes, in boliiii's example, no.
20:24:07*johnsoft quit (Ping timeout: 255 seconds)
20:24:37EXetoCok
20:25:22*johnsoft joined #nimrod
20:28:29*Jesin joined #nimrod
20:28:30willI wanted to do somethng similar in the GMP wrapper for mp_limb_t (which is an alias for a clong)
20:30:43*bjz quit (Read error: Connection reset by peer)
20:30:54*bjz joined #nimrod
20:31:34*bjz quit (Read error: Connection reset by peer)
20:43:22Araqbouliiii: the C code generator does a unification step for types
20:43:34Araqdistinct types are simply mapped to their base types
20:43:49Araqso that type conversions in Nim become nops in C
20:44:03Araqthis means that distinct .byref loses the .byref
20:44:18Araqyou have to annotate the object type with it and then it should work
20:44:39Araqhowever, you can also try to tell the compiler it's "big"
20:44:44Araq = object
20:44:57Araq dummy: array[128, char]
20:45:29Araqsince it's imported, the dummy will not affect anything except to tell the compiler its size is big
20:45:37Araqand then the compiler uses byRef too
20:46:31EXetoCwhy can't the dummy just be of type m128?
20:47:05Araqm128 = object
20:47:19Araq dummy: m128 # invalid recursion
20:47:29*Hakaslak quit (Quit: TODO: Generate 'Part & Quit Message')
20:48:57EXetoCbut didn't he want an m128 alias? in which case that object would be called something else, so no recursion
20:49:06*bjz joined #nimrod
20:49:35Araqthe alias is a bad idea
20:51:59EXetoCit would be a new type though
20:52:39EXetoCso not a direct alias at least. still bad?
20:56:25*Hakaslak joined #nimrod
21:03:38*q66[lap] quit (Read error: Connection reset by peer)
21:03:53*Boscop quit (Read error: Connection reset by peer)
21:04:14*Boscop joined #nimrod
21:04:21*q66[lap] joined #nimrod
21:04:40bouliiiiAraq: Nah. The big size trick would be a monstrosity :P If c types are unified, let's keep it like this and I just use an object to really wrap m128 into a new struct (as I did in C++ actually)
21:13:12*kemet joined #nimrod
21:14:22*Joe_knock joined #nimrod
22:04:11*fowl joined #nimrod
22:08:17*bjz quit (Ping timeout: 264 seconds)
22:31:45*brson joined #nimrod
22:33:29*johnsoft quit (Ping timeout: 264 seconds)
22:53:49*kemet quit (Remote host closed the connection)
22:55:24bouliiiiDamn. this macro interface is addictive
22:57:15EXetoC:-)
22:57:23EXetoCgo nuts
22:58:52j3rkyyeah, i'm starting to dive into it as well. seems pretty powerful.
22:59:04j3rkyhas anyone build a DSL with it yet?
22:59:09j3rky*built
22:59:22Araqunittest counts as a DSL already
22:59:39bouliiiiFinally something that goes beyond s-expressions only. This is really cool. If nim exposes at some point the full typed ast after sema, we would just have a full compiler available from the source code. this is really cool
22:59:46EXetoCand Jester (web framework) too I guess
22:59:53*BlaXpirit quit (Quit: Quit Konversation)
22:59:55Araqthere is also "nake", jester etc
23:00:03j3rkycool, i'll take a look at jester
23:01:16dom96_j3rky: look at the new-async branch, it uses macros instead of hundreds of hacky templates.
23:02:00EXetoCis it easier to read the code now?
23:02:42j3rkyok, i'll check that out as well. jester looks interesting. hmm... makes me want to build a DSL based GUI library :)
23:03:33Joe_knockDSL?
23:03:37bouliiiiI am experimenting to write a vectorizer a la ISPC now. It just seems doable which is just crazy.
23:03:45EXetoCJoe_knock: domain-specific language
23:04:16Joe_knockj3rky: We could use a binding to QT for cross-platform desktop apps
23:05:00EXetoCwell if it makes sense. someone was working on a windows toolkit, and many people would like a QT binding. that should be more doable now with the recent C++ generator fixes
23:05:42dom96_j3rky: That would be cool!
23:06:38Joe_knockWe have a couple of Jinja2-like templating languages + Jester, looks like we're moving in the Flask direction?
23:07:22*johnsoft joined #nimrod
23:07:41j3rkyi don't use Qt much, unfortunately. i'm heavily involved with UI framework in Unreal Engine 4 though. we've always wanted to create a DSL for it, but C++ is not very helpful in that regard :o)
23:08:06Joe_knockThat could work as well.
23:08:12Joe_knockNim in games
23:10:08bouliiiiI am a bit confused.
23:10:10EXetoCA C binding would be nice, but it's probably more work. the PySide tools can be used for other languages too though
23:10:23bouliiiistmt macros are expanded after type checks???
23:10:55*q66[lap] quit (Read error: Connection reset by peer)
23:11:38*q66[lap] joined #nimrod
23:12:02bouliiiiI have this code: https://gist.github.com/bsegovia/6d3645ed8068b8b87392
23:12:14bouliiiiBasically, the if at the end cannot type check
23:12:28bouliiiiBut a statement macro called "simd" will legalize it
23:13:12bouliiiiBut I got a type error. I can see in some way that the macro works (if I type properly the condition) but the compilation will abort here before the macro rewriting
23:15:44Araqbouliiii: declare your macro as immediate
23:16:06Araqwe're in the process of getting rid of it, but it will take a while
23:16:34bouliiiiAraq: pfeewww. Thanks!
23:17:03bouliiiiSO what is happening here? (if you have time to quickly explain, otherwise, I am fine with it :-))
23:17:51bouliiii(or if you have a relevant link)
23:18:16EXetoCthe manual?
23:18:55EXetoChttp://nim-lang.org/manual.html#ordinary-vs-immediate-templates_toc
23:21:12bouliiiiEXetoC: ah yes. I was a bit confused. I thought it was just for templates. Thanks!
23:21:45bouliiiioh yeahh!! It just works. It is completely awesomely cool
23:26:10Joe_knockIt must be great for all you core-contribs when you get a visitor to the Nim IRC and they're absolutely bowled over by Nims power :D
23:28:54bouliiiiA "bit" of effort, and a OpenCL DSL in nim should just work :-)
23:29:24bouliiiiwell, more like ISPC
23:32:43EXetoChow do I pass in -fPIC?
23:33:21bouliiii{.passC = "-fpic".} ?
23:34:58EXetoCyeah, had to do it in the source file. thanks
23:45:35Araq--app:lib?
23:49:21EXetoCI'm making an app, but now I'm trying to link with the Qt libs
23:50:21*Jesin quit (Quit: Leaving)
23:52:39EXetoCthere we go