00:08:05 | reactormonk | nope. |
00:19:15 | * | reactormonk quit (Ping timeout: 260 seconds) |
00:43:10 | * | q66 quit (Quit: Leaving) |
00:50:35 | * | Yeri quit (Quit: Yeri) |
01:04:13 | * | ltbarcly joined #nimrod |
01:14:18 | * | shodan45 quit (Ping timeout: 245 seconds) |
01:19:00 | * | io2 quit () |
01:21:50 | * | brson quit (Ping timeout: 264 seconds) |
01:23:15 | * | DAddYE quit (Remote host closed the connection) |
01:23:51 | * | DAddYE joined #nimrod |
01:27:03 | * | ltbarcly quit (Ping timeout: 276 seconds) |
01:29:00 | * | DAddYE quit (Ping timeout: 276 seconds) |
01:29:15 | * | ltbarcly joined #nimrod |
01:33:46 | * | ltbarcly quit (Ping timeout: 245 seconds) |
01:35:42 | * | ltbarcly joined #nimrod |
01:36:36 | * | jpoirier joined #nimrod |
01:40:14 | * | ltbarcly quit (Ping timeout: 240 seconds) |
01:42:14 | * | ltbarcly joined #nimrod |
01:46:41 | * | ltbarcly quit (Ping timeout: 245 seconds) |
01:47:46 | * | ltbarcly joined #nimrod |
01:48:16 | * | Yeri joined #nimrod |
01:54:36 | * | ltbarcly quit (Ping timeout: 256 seconds) |
01:56:44 | * | ltbarcly joined #nimrod |
02:01:03 | * | ltbarcly quit (Ping timeout: 240 seconds) |
02:03:17 | * | ltbarcly joined #nimrod |
02:08:08 | * | ltbarcly quit (Ping timeout: 260 seconds) |
02:10:16 | * | ltbarcly joined #nimrod |
02:14:03 | * | ltbarcly quit (Client Quit) |
02:29:27 | * | ltbarcly joined #nimrod |
02:34:15 | * | ltbarcly quit (Ping timeout: 256 seconds) |
02:34:38 | * | DAddYE joined #nimrod |
02:36:26 | * | ltbarcly joined #nimrod |
02:37:25 | * | DAddYE_ joined #nimrod |
02:39:02 | * | DAddYE quit (Ping timeout: 240 seconds) |
02:41:29 | * | ltbarcly quit (Ping timeout: 268 seconds) |
02:43:25 | * | ltbarcly joined #nimrod |
02:47:50 | * | ltbarcly quit (Ping timeout: 240 seconds) |
02:49:57 | * | ltbarcly joined #nimrod |
02:54:39 | * | ltbarcly quit (Ping timeout: 256 seconds) |
02:55:54 | * | ltbarcly joined #nimrod |
03:01:13 | * | ltbarcly quit (Ping timeout: 268 seconds) |
03:02:25 | * | ltbarcly joined #nimrod |
03:07:07 | * | ltbarcly quit (Ping timeout: 256 seconds) |
03:08:55 | * | ltbarcly joined #nimrod |
03:14:10 | * | ltbarcly quit (Ping timeout: 268 seconds) |
03:15:56 | * | ltbarcly joined #nimrod |
03:20:14 | * | ltbarcly quit (Ping timeout: 240 seconds) |
03:23:01 | * | ltbarcly joined #nimrod |
03:30:21 | * | ltbarcly quit (Ping timeout: 256 seconds) |
03:32:31 | * | ltbarcly joined #nimrod |
03:36:32 | * | Yeri quit (Quit: Yeri) |
03:37:38 | * | ltbarcly quit (Quit: Computer has gone to sleep.) |
03:48:42 | * | ltbarcly joined #nimrod |
03:53:19 | * | ltbarcly quit (Ping timeout: 246 seconds) |
03:54:42 | * | ltbarcly joined #nimrod |
03:59:02 | * | ltbarcly quit (Ping timeout: 240 seconds) |
04:00:11 | * | ltbarcly joined #nimrod |
04:04:36 | * | ltbarcly quit (Ping timeout: 245 seconds) |
04:06:40 | * | ltbarcly joined #nimrod |
04:11:11 | * | ltbarcly quit (Ping timeout: 246 seconds) |
04:12:38 | * | ltbarcly joined #nimrod |
04:17:02 | * | ltbarcly quit (Ping timeout: 240 seconds) |
04:19:06 | * | ltbarcly joined #nimrod |
04:21:34 | * | ltbarcly quit (Client Quit) |
04:34:07 | * | OrionPK quit (Read error: Connection reset by peer) |
05:05:17 | * | ltbarcly joined #nimrod |
05:07:23 | * | ltbarcly quit (Client Quit) |
05:36:58 | * | ltbarcly joined #nimrod |
05:41:49 | * | ltbarcly quit (Ping timeout: 256 seconds) |
05:42:26 | * | ltbarcly joined #nimrod |
05:47:43 | * | ltbarcly quit (Ping timeout: 268 seconds) |
05:48:57 | * | ltbarcly joined #nimrod |
05:58:15 | * | ltbarcly quit (Ping timeout: 256 seconds) |
06:00:27 | * | ltbarcly joined #nimrod |
06:05:36 | * | ltbarcly quit (Ping timeout: 268 seconds) |
06:06:28 | * | ltbarcly joined #nimrod |
06:11:52 | * | nebiros quit (Quit: ZNC - http://znc.in) |
06:11:58 | * | d34th quit (Quit: Deleted System32) |
06:12:16 | * | d34th joined #nimrod |
06:13:33 | * | ltbarcly quit (Ping timeout: 256 seconds) |
06:14:22 | * | nebiros joined #nimrod |
06:14:26 | * | nebiros is now known as Guest44283 |
06:14:57 | * | ltbarcly joined #nimrod |
06:44:27 | * | ltbarcly quit (Ping timeout: 268 seconds) |
06:45:28 | * | ltbarcly joined #nimrod |
06:54:55 | * | ltbarcly quit (Ping timeout: 256 seconds) |
06:56:23 | * | zahary quit (Ping timeout: 246 seconds) |
06:56:27 | * | ltbarcly joined #nimrod |
07:04:11 | * | ltbarcly quit (Ping timeout: 268 seconds) |
07:05:28 | * | ltbarcly joined #nimrod |
07:14:45 | * | ltbarcly quit (Ping timeout: 256 seconds) |
07:15:57 | * | ltbarcly joined #nimrod |
07:15:58 | * | silven joined #nimrod |
07:20:50 | * | ltbarcly quit (Ping timeout: 268 seconds) |
07:21:27 | * | ltbarcly joined #nimrod |
07:26:05 | * | ltbarcly quit (Ping timeout: 256 seconds) |
07:27:57 | * | ltbarcly joined #nimrod |
07:28:23 | * | DAddYE_ quit (Remote host closed the connection) |
07:29:01 | * | DAddYE joined #nimrod |
07:30:39 | * | io2 joined #nimrod |
07:33:13 | * | DAddYE quit (Ping timeout: 240 seconds) |
07:35:38 | * | ltbarcly quit (Ping timeout: 268 seconds) |
07:36:56 | * | ltbarcly joined #nimrod |
07:41:57 | * | ltbarcly quit (Ping timeout: 256 seconds) |
07:42:57 | * | ltbarcly joined #nimrod |
07:50:26 | * | ltbarcly quit (Ping timeout: 268 seconds) |
07:51:25 | * | ltbarcly joined #nimrod |
07:59:04 | * | Araq_ joined #nimrod |
08:01:26 | * | ltbarcly quit (Ping timeout: 264 seconds) |
08:02:28 | * | silven quit (Remote host closed the connection) |
08:03:27 | * | ltbarcly joined #nimrod |
08:04:45 | * | q66 joined #nimrod |
08:07:50 | * | ltbarcly quit (Ping timeout: 240 seconds) |
08:10:00 | * | ltbarcly joined #nimrod |
08:16:27 | * | faassen joined #nimrod |
08:18:46 | * | ltbarcly quit (Ping timeout: 245 seconds) |
08:19:47 | * | Araq_ quit (Quit: ChatZilla 0.9.90.1 [Firefox 23.0.1/20130814063812]) |
08:20:01 | * | ltbarcly joined #nimrod |
08:24:50 | * | ltbarcly quit (Ping timeout: 264 seconds) |
08:27:02 | * | ltbarcly joined #nimrod |
08:31:26 | * | ltbarcly quit (Ping timeout: 240 seconds) |
08:33:06 | * | ltbarcly joined #nimrod |
08:37:05 | * | ltbarcly quit (Client Quit) |
08:50:12 | * | jpoirier quit (Quit: Leaving...) |
08:54:02 | zahary_ | Araq, it was mentioned in my original commit here: |
08:54:03 | zahary_ | https://github.com/Araq/Nimrod/commit/cb6507759e7c8496b16a4250946d089491e3e7eb |
08:54:42 | zahary_ | it basically produces faster compiler, it's recommended for the caas mode anyway and fixes the Aporia build on a mac - so right now, it seems like a better choice |
08:54:50 | zahary_ | ... for the compiler itself |
09:07:22 | * | faassen quit (Ping timeout: 245 seconds) |
09:07:23 | * | faassen joined #nimrod |
09:11:48 | * | Guest44283 quit (*.net *.split) |
09:11:48 | * | d34th quit (*.net *.split) |
09:11:48 | * | BitPuffin quit (*.net *.split) |
09:18:28 | * | io2 quit (*.net *.split) |
09:18:28 | * | Associat0r quit (*.net *.split) |
09:18:28 | * | XAMPP quit (*.net *.split) |
09:18:29 | * | zahary_ quit (*.net *.split) |
09:18:29 | * | companion_cube quit (*.net *.split) |
09:18:29 | * | profmakx quit (*.net *.split) |
09:18:29 | * | mal`` quit (*.net *.split) |
09:18:30 | * | ponce quit (*.net *.split) |
09:18:32 | * | photex quit (*.net *.split) |
09:18:32 | * | Roin quit (*.net *.split) |
09:18:32 | * | q66 quit (*.net *.split) |
09:18:32 | * | Zor quit (*.net *.split) |
09:18:33 | * | JStoker quit (*.net *.split) |
09:18:33 | * | Amrykid quit (*.net *.split) |
09:18:35 | * | tumak quit (*.net *.split) |
09:18:35 | * | rndbit quit (*.net *.split) |
09:18:35 | * | comex quit (*.net *.split) |
09:18:36 | * | vegai quit (*.net *.split) |
09:18:36 | * | Trixar_za quit (*.net *.split) |
09:18:36 | * | Araq quit (*.net *.split) |
09:18:36 | * | eco quit (*.net *.split) |
09:18:36 | * | dom96 quit (*.net *.split) |
09:18:36 | * | Reisen quit (*.net *.split) |
09:21:08 | * | BitPuffin joined #nimrod |
09:21:08 | * | d34th joined #nimrod |
09:21:08 | * | Guest44283 joined #nimrod |
09:21:08 | * | q66 joined #nimrod |
09:21:08 | * | io2 joined #nimrod |
09:21:08 | * | Associat0r joined #nimrod |
09:21:08 | * | profmakx joined #nimrod |
09:21:08 | * | zahary_ joined #nimrod |
09:21:08 | * | XAMPP joined #nimrod |
09:21:08 | * | Zor joined #nimrod |
09:21:08 | * | JStoker joined #nimrod |
09:21:08 | * | mal`` joined #nimrod |
09:21:08 | * | companion_cube joined #nimrod |
09:21:08 | * | rndbit joined #nimrod |
09:21:08 | * | ponce joined #nimrod |
09:21:08 | * | eco joined #nimrod |
09:21:08 | * | comex joined #nimrod |
09:21:08 | * | Amrykid joined #nimrod |
09:21:08 | * | Trixar_za joined #nimrod |
09:21:08 | * | Reisen joined #nimrod |
09:21:08 | * | dom96 joined #nimrod |
09:21:08 | * | Araq joined #nimrod |
09:21:08 | * | tumak joined #nimrod |
09:21:08 | * | Roin joined #nimrod |
09:21:08 | * | photex joined #nimrod |
09:21:08 | * | vegai joined #nimrod |
09:23:07 | * | silven joined #nimrod |
09:25:49 | rndbit | is anyone using latest aporia (master, last commit on Aug 30, 2013)? not sure if its broken in repo or its my problem |
09:28:21 | rndbit | actually nvm, recompiling with optimizations made it work |
09:36:31 | * | Associat0r quit (Read error: Operation timed out) |
09:37:13 | * | Associat0r joined #nimrod |
09:37:13 | * | Associat0r quit (Changing host) |
09:37:13 | * | Associat0r joined #nimrod |
10:11:37 | * | BitPuffin_ joined #nimrod |
10:15:02 | * | BitPuffin quit (Ping timeout: 240 seconds) |
10:55:55 | * | Associ8or joined #nimrod |
10:55:55 | * | Associ8or quit (Changing host) |
10:55:55 | * | Associ8or joined #nimrod |
10:58:40 | * | Associat0r quit (Ping timeout: 264 seconds) |
11:53:36 | * | Araq_ joined #nimrod |
11:55:51 | * | Araq_ quit (Client Quit) |
12:07:03 | * | Associ8or quit (Quit: Associ8or) |
12:47:33 | * | io2 quit () |
12:59:55 | * | Guest44283 is now known as nebiros |
12:59:56 | * | nebiros quit (Changing host) |
12:59:56 | * | nebiros joined #nimrod |
13:07:50 | * | faassen left #nimrod (#nimrod) |
13:54:55 | * | JStoker quit (Quit: JStoker is gone :() |
13:59:31 | * | JStoker joined #nimrod |
14:37:02 | * | silven quit (Quit: No Ping reply in 180 seconds.) |
14:37:21 | * | BitPuffin_ quit (Remote host closed the connection) |
14:37:24 | * | silven joined #nimrod |
15:10:47 | dom96 | rndbit: What's the problem? |
15:29:49 | * | Mat2 joined #nimrod |
15:29:54 | Mat2 | hi @ all |
16:02:19 | * | ltbarcly joined #nimrod |
16:02:35 | * | ltbarcly quit (Client Quit) |
16:03:09 | * | ltbarcly joined #nimrod |
16:04:26 | * | ltbarcly_ joined #nimrod |
16:06:14 | rndbit | i noticed strange thing, following example plrints 1. why would it print 1 for uninitialized variable? i suppose one would expect it to be 0. http://paste2box.com/s/#/file/ThfdGwQ-FjBqpXiumaTC6QNEcjA/sVMev9Lz1o.txt/?p=E4otjy2VBf1ILkQEFBnGy4M8ye4X |
16:07:30 | * | ltbarcly quit (Ping timeout: 245 seconds) |
16:08:44 | Mat2 | hi rndbit |
16:09:16 | rndbit | hey |
16:11:24 | Mat2 | why is your variable not public declared ? |
16:13:50 | rndbit | probably because im just experimenting and i dont quite know how things work |
16:16:30 | Mat2 | first change: |
16:16:49 | Mat2 | var a = TSomeObj() |
16:16:56 | Mat2 | var a: TSomeObj |
16:17:09 | Mat2 | <- you defined an object as type |
16:17:35 | Mat2 | then |
16:17:51 | Mat2 | echo ("Variable: ",a.Variable) |
16:18:22 | Mat2 | this compiles here and executing the executable return: 0, as expected |
16:19:32 | rndbit | i thought () implied construction of an object where lack of () wiykd gave defined object as type |
16:19:59 | Mat2 | look here: https://gist.github.com/anonymous/6511834 |
16:20:46 | * | shodan45 joined #nimrod |
16:20:47 | rndbit | ah i see.. var a: TSomeObj is like declaring object on stack without manually calling ctor |
16:21:44 | Mat2 | I do not know what you mean with ctor but yes, type declarations are reserved on the heap as I know |
16:23:08 | rndbit | ctor = constructor |
16:23:35 | rndbit | i thought it would be equivalent of c++ TSomeObj a; |
16:24:55 | Mat2 | please note I do not have any experience with object allocation in C++, but typical in C objects would be defined as structures and also allocated on the heap |
16:25:29 | rndbit | heap or stack, programmer's choice. anyways.. |
16:26:09 | rndbit | scanning through docs i could not find what would look like familiar class. so object methods are always defined outside of object (type) body with first param as reference to that object? |
16:27:51 | Mat2 | (only in languages as Forth it would be usable to allocate objects on a stack, despite that even in this case objects are more licle declared as dictionary entrys extending the compiler) |
16:28:20 | Mat2 | ^entries |
16:29:20 | Mat2 | Nimrod uses another appoach to objects as C++, you will not find an equivalence of its class concept |
16:31:08 | rndbit | gotcha. as i see types are more like c structs |
16:31:37 | Mat2 | yes, you would define objects in C in a similar way |
16:32:13 | zahary_ | Mat2, I think you are spreading misconceptions here |
16:32:30 | Mat2 | feel free to correct my view |
16:32:42 | zahary_ | regular values (objects, tuples, etc) will be allocated on the stack just like in C++ |
16:33:11 | * | silven quit (Remote host closed the connection) |
16:33:12 | zahary_ | about the original question, I actually think that the compiler missed to produce a compile-time error here |
16:33:37 | zahary_ | the object initialization syntax var x = TFoo(...) requires that you specify all fields |
16:34:19 | zahary_ | this is clearly not the case with your code and I would submit it as bug - why the value of 1 is printed is even more peculiar, I would look at the generated C code to see what's happening |
16:34:34 | Mat2 | ok, I think to have another viewpoint of what a stack is (that's because of my Forth background) |
16:35:17 | zahary_ | http://en.wikipedia.org/wiki/Call_stack usually as defined by the CPU architecture |
16:35:41 | rndbit | err call stack and stack are two different things |
16:35:42 | Mat2 | well, that explains the misconception |
16:35:58 | Mat2 | a call stack is quite different from a data-stack |
16:36:10 | zahary_ | sure |
16:36:59 | Mat2 | just replace heap in my answers with call-stack |
16:37:24 | rndbit | and then it sounds absolutely weird :D |
16:37:31 | rndbit | data is not allocated on callstack xD |
16:37:44 | Mat2 | that's right *lol* |
16:37:53 | rndbit | http://en.wikibooks.org/wiki/X86_Disassembly/The_Stack \o/ |
16:38:48 | Mat2 | I know what a stack is. Its only Forth distinguish a data-stack, a return-stack and a list (called vocabulary) |
16:39:14 | rndbit | ah.. hard to tell when people are fooling around without seeing their faces :) |
16:40:29 | Mat2 | the return stack and vocabulary are allocated on the heap in most C implementations (that refuses things for me) |
16:41:38 | Mat2 | by the way, I wounder why objects are allocated on the call-stack ? |
16:41:48 | Mat2 | ^wonder |
16:42:03 | Mat2 | anyhow |
16:42:14 | * | DAddYE joined #nimrod |
16:42:23 | Mat2 | hi DAddYE |
16:42:30 | DAddYE | hi Mat2! |
16:44:09 | * | silven joined #nimrod |
16:45:25 | zahary_ | Mat2, allocating on the call-stack is extremely efficient - when a function is entered, only the stack top register must be modified once to allocate memory for all the local variables in the function |
16:49:47 | Mat2 | well the seperation of data and addresses have one advantage: Because most cpu's feature a large register set, a compiler is able to transform accesses to stack entries into direct register assignements and in addition the hardware-stack is free for holding addresses only - resulting in both lesser BTB mispredictions and avoidance of memory accesses |
16:51:42 | Mat2 | (this optimization is not possible in languages as C however) |
16:52:14 | Mat2 | so I think the Nimrod compiler has no choice here |
16:52:49 | Mat2 | and in this case, yes - allocating data on the call-stack is more efficient |
16:54:15 | zahary_ | where is data allocated in the other scheme? in a shadow stack that roughly follows the expansion and contraction of the call-stack or directly on the heap using some allocation algorithm for long-lived objects? |
16:57:56 | Mat2 | an adaptive compiler is able to map a set of registers to a stack (may it be a data or call-stack does not matter). Because the object itself is static, all references can be transformed into direkt register assignements, simple |
16:58:00 | * | brson joined #nimrod |
16:59:55 | zahary_ | well, the C compilers do this all the time (elect local variables to be stored in register locations), but they surely run out of registers frequently |
17:00:08 | Mat2 | but as written, that's not possible in static compiled languages as C, because the whole runtime state is not known at compile time, whereby in case of a dynamic compiler (JIT compiler for example) |
17:00:40 | Mat2 | such environment is able do support register dynamic sheduling |
17:01:02 | zahary_ | what is this required "runtime state" that must be known? |
17:02:09 | Mat2 | all dependencies and values for all referenced variables in your example |
17:02:48 | Mat2 | the compiler get this information though an interpreter and compilation can use it of course |
17:03:25 | zahary_ | dependencies? like other call-stack locations? that reside at fixed offsets form the current stack base pointer? |
17:04:49 | Mat2 | yes and in addition the dynamic state of used variables |
17:05:11 | Mat2 | I give you an example: |
17:05:20 | Mat2 | You define an object in Nimrod |
17:05:44 | Mat2 | this object has an variable |
17:06:10 | Mat2 | somewhere in the source code the variable content is changed, overwritten whatever |
17:07:00 | Mat2 | because execution is performed though interpretation, all these changes to the variable (the dynamic state at a given execution time) can be tracked |
17:07:36 | Mat2 | a JIT compiler is then able to use this tracked information for optimisations as earlier described |
17:07:59 | Mat2 | as long as the object itself is static and do not change |
17:09:02 | Mat2 | this lead to compiled code which only references internal registers (in most cases) |
17:09:19 | Mat2 | you can't aplly this kind of optimization with a static compiler |
17:09:51 | zahary_ | can you describe one particular optimization? are we talking about using guards like "if objects.wasnt_modified? : enter known fast path else: reinterpret and store knowledge of current object state |
17:10:14 | Mat2 | ok, I try it: |
17:10:27 | zahary_ | basically, stuff like PIC, etc |
17:11:32 | zahary_ | feel free to send me a paper about it if don't feel like describing it |
17:12:47 | Mat2 | http://www.cl.cam.ac.uk/research/srg/netos/vee_2012/papers/p63.pdf |
17:13:33 | zahary_ | thanks |
17:14:22 | Mat2 | (please note, the approach decribed in this paper uses a register based VM where I would prefer a stack based one. Additionally there register allocation scheme is staic, I tried to explain a dynamic approach to you) |
17:15:23 | Mat2 | ^static |
17:15:56 | Mat2 | for a quick look, read 3.3 Register Mapping Translator |
17:16:07 | Mat2 | following |
17:19:02 | Mat2 | I think you do not speak German ? |
17:19:10 | zahary_ | nope |
17:20:38 | Mat2 | this topic is somewhat complex and I fear my English is not good enough for describing dynamic register-transformation optimizations in detail, sorry |
17:21:28 | Mat2 | anyway, we are way off topic |
17:27:54 | Mat2 | and I think its correct to say, an object in Nimrod resembles more of a structure in C (if this object is allocated on a stack (sigh!) or the heap does not matter in tis case) |
17:29:22 | Mat2 | as an object structure in C++ which hold a vtable of method references bound to it (hope this is the right terminology) |
17:31:27 | zahary_ | you mean "than an object structure in C++" (i.e. stressing that nimrod doesn't use vtables?) |
17:31:46 | zahary_ | otherwise, I've read only part of the paper, but the C compilers certainly map stack locations to registers with similar register allocation algorithms - you can see this in the generated code |
17:36:04 | Mat2 | you oversee the point here: The SWIFT compiler *ensures* this optimization though some code-transformations in most situations |
17:41:03 | Mat2 | my design *grant* it (by using a compact immediate-code representation in CPS form) |
17:41:50 | Mat2 | also typical such optimizations will be applied at runtime by a JIT compiler |
17:42:16 | Araq | what the fuck is wrong with our "object of" code generation? it's like the 4th bug about it triggered by a trivial program ... |
17:42:38 | Mat2 | hi Araq |
17:43:36 | Araq | hi Mat2 |
17:44:23 | Araq | Mat2: nobody here understands your "dynamic register allocation" algorithms ... ;-) |
17:44:32 | Mat2 | I see |
17:44:43 | Araq | we need to see the code once it's ready |
17:45:19 | Araq | this Forth stuff is completely alien technology :D |
17:45:48 | Mat2 | most of this is known since the 70's |
17:46:11 | Mat2 | anyhow, its not common, right |
17:47:58 | * | BitPuffin joined #nimrod |
17:48:42 | Mat2 | at least Dalvik's author understand me *sniff* ;) |
17:50:37 | Araq | well first you need to explain why dynamic register allocation is even desirable ;-) |
17:52:41 | Mat2 | as written, most memory references can be transformed into direct register assignements for the whole runtime lifetime. It is also the preferable for efficient JIT compilation in ressource-restricted environments |
17:52:58 | Mat2 | ^a preferable way |
17:53:44 | Araq | so you mean there is potential aliasing that keeps a static compiler to keep the variable in a register but a JIT can do it? |
17:53:57 | Araq | *keeps from keeping |
17:53:59 | Mat2 | yes |
17:55:13 | Mat2 | it is even possible to completly get rid of stack and heap allocations alltogether |
17:55:22 | rndbit | is it possible to have one statement for variable declaration and allocation instead of two like in following example? http://paste2box.com/s/#/file/V9ud8wGJL3QeYkBZ0TG-FiBAnU0/OxG4Wx3Vzz.txt/?p=uI8N3YOK38j2OjLkRn6abuLpfg8X |
17:55:52 | Araq | rndbit: var n = PNode(data: 9) |
17:56:22 | rndbit | and its same thing right? |
17:56:47 | Araq | yes |
17:56:57 | rndbit | gotcha, thanks \o/ |
17:58:17 | rndbit | oh Araq i was thinking about discardable and what you told me yesterday. well if proc declaration changes and it no longer returns value - no matter if we have discardable or not compiler would raise error where proc is used improperly. so im again back at not getting the point. please enlighten me if its not too annoying ^_^ |
18:01:46 | Araq | what if it changes and it now returns an important value? |
18:02:40 | rndbit | is not programmer smart enough to use it where it should be used? |
18:03:15 | rndbit | usually if there is a case where same action has to be done with return value then its only logical to include that action in proc that returns object in the first place |
18:04:24 | Araq | yeah the programmer is not "smart enough"; hence the need for static typing |
18:05:46 | rndbit | so there is no good answer then, gotcha |
18:06:50 | * | reactormonk joined #nimrod |
18:07:18 | Araq | well you either see the value in static typing or you don't |
18:07:32 | Araq | if you see the value, 'discard' is a consequent feature |
18:07:55 | Araq | and as I said, in practice it does find bugs just like the rest of static typing |
18:08:02 | reactormonk | is seq[TClient] supposed to be initialized by @[] or nil? |
18:08:07 | Araq | nil |
18:08:15 | reactormonk | no not nill + lazy alloc? |
18:08:29 | rndbit | i just want to understand how could it FIND bugs since it would raise error at compile time just the same way as improper use would |
18:08:50 | Araq | but it doesn't, think about it: |
18:08:54 | Araq | proc p() = ... |
18:09:04 | Araq | # lots of code calls 'p' in a void context |
18:09:17 | Araq | now you change it to 'proc p(): int' |
18:09:36 | Araq | and the compiler tells you you might have got it wrong |
18:09:56 | Araq | after all, if you return additional information, that surely is useful? |
18:10:37 | rndbit | could be useful or could be not, its not like return values are ALWAYS used |
18:10:53 | rndbit | besides such compiler behavior implies programmer has no idea wtf he is doing ^_^ |
18:10:54 | Araq | that's why we have .discardable. |
18:12:26 | rndbit | reminds me microsoft's decision to not implement default parameters in c# because its easy to get things wrong using them |
18:13:26 | Araq | C# has default parameters |
18:13:57 | Araq | your argument amounts to "I don't need compiler checking, I know what I'm doing" |
18:16:55 | rndbit | c# does not have default parameters in constructors and methods unless they were added in 4.0 or 4.5. and yeah, well more like "i dont need to tell compiler that i do nothing when im not doing anything". anyway not that its hard to modify compiler to implicitly discard everything \o/ |
18:18:24 | Araq | I think 3.5 added default params but maybe it was 4.0 |
18:18:42 | Araq | in any case, they work whenever I use them :P |
18:19:22 | rndbit | oh yeah they added them in 4.0. bitches finally listened to the voice of reason. |
18:20:29 | Araq | they had to, it's important for COM and VB had it too |
18:21:09 | Araq | btw ever programmed against an API that uses return values for error reporting? |
18:21:41 | Araq | is there a slight chance you can see the value in a compiler that makes you handle errors? |
18:22:56 | * | Associat0r joined #nimrod |
18:23:03 | * | Associat0r quit (Changing host) |
18:23:03 | * | Associat0r joined #nimrod |
18:23:35 | rndbit | yes, and in that case whenever i add an error code i list all references to modified call and modify code appropriately. but i suppose in this case discard can really be useful |
18:23:58 | rndbit | error codes are evil though.. |
18:29:25 | Araq | it doesn't matter, posix and the winapi use error codes and for technical reasons they won't go anywhere |
18:30:29 | Araq | # XXX object initialization? but not necessary for temps, is it? |
18:30:44 | Araq | now that explains the bug ... |
18:52:28 | * | reactormonk quit (Ping timeout: 246 seconds) |
19:08:31 | * | reactormonk joined #nimrod |
19:14:33 | Mat2 | hi reactormonk |
19:23:52 | reactormonk | just phasing in & out |
19:24:21 | Araq | reactormonk: the JS bug is not due to a missing "import" (what's that in JS anyway?) |
19:24:34 | Araq | but it surely is a bug |
19:24:50 | reactormonk | Araq, there is no import, but the code isn't imported into the resulting .js file |
19:25:17 | Araq | ah |
20:04:35 | NimBot | Araq/Nimrod master b618706 Araq [+1 ±4 -0]: fixes #575 |
20:25:26 | * | shevy left #nimrod ("I'll be back ... maybe") |
20:26:16 | * | reactormonk quit (Ping timeout: 245 seconds) |
20:37:16 | Mat2 | get some sleep, ciao |
20:37:30 | * | Mat2 quit (Quit: Verlassend) |
21:21:07 | NimBot | Araq/Nimrod master 8f925e0 ventor3000 [+1 ±0 -0]: Added basic2d module... 2 more lines |
21:21:07 | NimBot | Araq/Nimrod master e0e4458 ventor3000 [+0 ±1 -0]: Added file header |
21:21:07 | NimBot | Araq/Nimrod master 6548cc5 ventor3000 [+0 ±1 -0]: Some minor changes |
21:21:07 | NimBot | Araq/Nimrod master e476a1f ventor3000 [+0 ±1 -0]: Fixed stupid mistake when clamping acos |
21:21:07 | NimBot | 5 more commits. |
21:36:43 | Araq | ping zahary_ |
22:09:43 | * | OrionPK joined #nimrod |
22:22:23 | NimBot | Araq/Nimrod master 73333eb Araq [+0 ±2 -0]: fixes #588 |
22:22:23 | NimBot | Araq/Nimrod master 39acf3f Araq [+0 ±1 -0]: fixes #566 |
22:22:23 | NimBot | Araq/Nimrod master 3f2d954 Araq [+0 ±3 -0]: c2nim: added some scope operator parsing |
22:22:23 | NimBot | Araq/Nimrod master 2176a57 Araq [+2 ±0 -0]: Merge branch 'master' of github.com:Araq/Nimrod |
22:24:55 | BitPuffin | Araq: Have you started binding Qt on your own? |
22:25:09 | Araq | hell no |
22:25:18 | BitPuffin | hehe := |
22:25:19 | BitPuffin | :)* |
22:26:15 | BitPuffin | Maybe fowl would be an appropriate person to do it? |
22:26:18 | Araq | I hope what we have now is useful enough; I need to hunt bugs and finish my VM instead |
22:26:30 | Araq | fowl is pretty busy these days ... |
22:26:42 | BitPuffin | unfortunately me too :/ |
22:27:17 | BitPuffin | Maybe you've noticed that I am considerably less active here the last few days |
22:27:45 | Araq | yeah but it's always like this |
22:27:51 | BitPuffin | Today was actually the first time I did some gaming in months or so because a game I have been looking forward to a long time came out today |
22:28:02 | BitPuffin | Yeah |
22:28:11 | BitPuffin | We need some nimrodders who don't have anything to do |
22:28:12 | BitPuffin | haha |
22:28:17 | Araq | gta ? |
22:28:22 | BitPuffin | Nah |
22:28:31 | BitPuffin | Amnesia: A Machine for Pigs |
22:29:07 | Araq | meh, I might watch a "let's play" about it during a debugging session :P |
22:29:25 | BitPuffin | Maybe you should watch mine then :P |
22:38:38 | BitPuffin | Don't remember the last time I played a game with such great audio |
22:39:53 | BitPuffin | Araq: I dunno, at the same time it is something that needs to be experienced. And maybe THEN look at a let's play and laugh at their misery |
22:47:04 | Araq | BitPuffin: make something like this in nimrod: http://www.voxelquest.com/1/post/2013/09/first-real-preview.html |
22:47:57 | BitPuffin | Hey! |
22:47:59 | BitPuffin | Here's an idea |
22:48:01 | BitPuffin | you do it ;) |
22:48:06 | BitPuffin | no but seriosly |
22:48:12 | BitPuffin | What I am currently making with nimrod |
22:48:39 | BitPuffin | Is to me more exciting than voxel stuff |
22:49:14 | Araq | good |
22:50:02 | BitPuffin | Araq: Basically I am hoping to put some stuff akin to this in a multiplayer environment http://graphics.berkeley.edu/papers/Parker-RTD-2009-08/index.html |
22:50:24 | BitPuffin | Which is basically why I have been inactive.. Been reading math stuff :P |
22:51:08 | * | shodan45 quit (Quit: Konversation terminated!) |
22:51:41 | Araq | that's a good way to spend one's time |
22:51:44 | Araq | good night |
22:51:48 | BitPuffin | yep |
22:51:49 | BitPuffin | night! |
23:18:18 | * | MFlamer joined #nimrod |
23:19:38 | MFlamer | Hi there. Is the difference between ptr and pointer just that ptr is a "typed" pointer and pointer is a raw "void" pointer? |
23:20:07 | BitPuffin | MFlamer: There is "pointer" ? |
23:22:12 | BitPuffin | MFlamer: Where are you seeing this? Because afaik there is only ptr |
23:22:16 | BitPuffin | (and ref) |
23:23:07 | MFlamer | yes, it's a C pointer. It's what calls to alloc and allocshared return |
23:23:26 | BitPuffin | MFlamer: link? |
23:23:49 | MFlamer | http://nimrod-code.org/system.html#612 |
23:23:57 | MFlamer | search on alloc |
23:24:21 | BitPuffin | hmm |
23:24:24 | BitPuffin | you seem to be right |
23:24:34 | BitPuffin | But it looks like "pointer" is a type |
23:24:49 | BitPuffin | whereas ptr is an erm |
23:24:52 | BitPuffin | what's it called |
23:25:13 | MFlamer | you can cast it to a ptr of some type. I guess I answered my own question. It;'s just a raw address |
23:25:29 | BitPuffin | MFlamer: Yeah probably, wrapped in a type |
23:26:12 | MFlamer | ok, thanks |
23:27:30 | BitPuffin | MFlamer: https://github.com/Araq/Nimrod/blob/master/lib/system.nim#L43 |
23:28:02 | MFlamer | Hey, do you know how to use a type class to restrict generics to a range of types like int8 through int64 and float32 and float64 and ptr? Basically like any scalars or pointers? |
23:28:52 | BitPuffin | MFlamer: I suppose the answer is that you know it if it is what seems right |
23:28:59 | BitPuffin | guess it kind of depends on the situation |
23:29:42 | MFlamer | ok, so maybe it's not necessary |
23:30:02 | BitPuffin | I think maybe it's when you know something wouldn't work with say an int8 but the compiler wouldn't fail the compilation because the code is still valid |
23:30:04 | BitPuffin | But yeah |
23:30:13 | BitPuffin | I'd say don't think about that too much |
23:30:18 | BitPuffin | You'll notice when you need it |
23:32:40 | BitPuffin | if ever :P |
23:43:35 | BitPuffin | MFlamer: I am pretty sure the feature is mostly for saying that "this proc only takes number" or "this proc only takes integer types" etc. Not so much for saying that it doesn't work with int8 or whatever, but I suppose it could happen |
23:45:31 | * | Associ8or joined #nimrod |
23:45:31 | * | Associ8or quit (Changing host) |
23:45:31 | * | Associ8or joined #nimrod |
23:47:05 | * | Associat0r quit (Ping timeout: 245 seconds) |
23:47:27 | MFlamer | What I'm trying to imply is that this proc can take any T as long as T is a scalar of size 8-64bits or T is a pointer. So would the type class restriction be "char|int|float|ptr|pointer" |
23:48:09 | BitPuffin | MFlamer: Hmmm nooo |
23:48:37 | MFlamer | or, like you said, its so general just let the compiler complain if there is a problem |
23:49:21 | BitPuffin | MFlamer: I think at least that you need to replace the number stuff listed with TNumber |
23:49:30 | BitPuffin | MFlamer: Not so sure about the ptr|pointer part |
23:49:45 | BitPuffin | no ptr should be there probably |
23:49:49 | BitPuffin | because it is not a type |
23:50:07 | BitPuffin | then you probably makes a proc that takes foo: ptr T |
23:50:20 | BitPuffin | Not 100% on this one though |
23:50:31 | BitPuffin | taking the pointer type should be possible though |
23:50:50 | MFlamer | good point on ptr |
23:51:01 | MFlamer | no pun intended |
23:51:12 | BitPuffin | hehe |
23:51:33 | BitPuffin | MFlamer: Some useful type classes https://github.com/Araq/Nimrod/blob/master/lib/system.nim#L52 |
23:56:54 | MFlamer | perfect, thanks |