00:00:28 | * | Johz quit (Quit: Leaving) |
00:00:47 | Araq | good night |
00:00:54 | Skrylar | Araq: gnight |
00:19:43 | * | Demos joined #nimrod |
00:38:56 | * | q66 quit (Quit: Leaving) |
00:44:53 | * | olahol quit (Ping timeout: 240 seconds) |
00:44:55 | * | olahol_ joined #nimrod |
00:45:40 | * | oxful__ quit (Ping timeout: 240 seconds) |
00:46:11 | * | oxful__ joined #nimrod |
01:05:29 | * | brson quit (Ping timeout: 252 seconds) |
01:07:35 | * | brson joined #nimrod |
01:11:43 | * | JStoker quit (Killed (hobana.freenode.net (Nickname regained by services))) |
01:12:01 | * | JStoker joined #nimrod |
01:15:54 | EXetoC | we don't have sort for strings? |
01:20:57 | Demos | is that a hard problem? lexographical comparison should be avalible someplace :D |
01:48:23 | * | brson quit (Ping timeout: 252 seconds) |
01:48:25 | * | zahary joined #nimrod |
01:50:17 | * | brson joined #nimrod |
01:51:14 | * | CARAM_ joined #nimrod |
01:51:16 | * | zahary1 quit (Read error: Connection reset by peer) |
01:51:17 | * | CARAM quit (Ping timeout: 240 seconds) |
01:51:20 | * | zielmicha_beta quit (Ping timeout: 240 seconds) |
01:51:21 | * | fowl quit (Ping timeout: 240 seconds) |
01:51:32 | * | CARAM_ is now known as CARAM |
01:52:03 | * | olahol joined #nimrod |
01:52:30 | * | olahol_ quit (Ping timeout: 276 seconds) |
01:52:34 | * | Xuerian quit (Ping timeout: 276 seconds) |
01:52:38 | * | Xuerian joined #nimrod |
02:04:35 | * | fowl joined #nimrod |
02:27:16 | * | flaviu quit (Remote host closed the connection) |
02:56:48 | * | xenagi quit (Read error: Connection reset by peer) |
03:14:54 | * | brson quit (Ping timeout: 240 seconds) |
04:19:31 | * | superfunc joined #nimrod |
04:44:45 | Skrylar | oh piss |
04:44:56 | Skrylar | i've been putting the 'importc' call in the wrong side for it to work on structs |
05:02:02 | fowl | there are 2 places it can go |
05:11:37 | * | isenmann joined #nimrod |
05:13:04 | * | isenmann left #nimrod (#nimrod) |
05:32:21 | Skrylar | fowl: it doesn't work if you do foo = object {.importc} |
05:32:26 | Skrylar | foo {.importc} = object does |
06:01:05 | * | Demos quit (Read error: Connection reset by peer) |
06:49:25 | * | boydgreenfield quit (Quit: boydgreenfield) |
07:01:47 | * | Jesin quit (Ping timeout: 250 seconds) |
07:02:10 | * | superfunc quit (Quit: Page closed) |
07:27:42 | * | q66 joined #nimrod |
07:27:42 | * | q66 quit (Changing host) |
07:27:42 | * | q66 joined #nimrod |
07:57:44 | Skrylar | discovery: when a module is boring as bricks to write, you designed it poorly |
08:12:53 | * | BitPuffin quit (Ping timeout: 264 seconds) |
08:25:15 | * | io2 joined #nimrod |
08:46:29 | Skrylar | Araq: nimrod needs a call/cc equivalent :o |
08:48:18 | * | chemist69 joined #nimrod |
08:49:55 | Araq | Skrylar: iirc "one-shot continuations" are as expressive but cheaper to implement |
08:53:14 | * | BitPuffin joined #nimrod |
09:02:15 | * | noam quit (Quit: Leaving) |
09:15:49 | NimBot | Araq/Nimrod new_spawn 6195dbe Araq [+4 ±12 -0]: initial non-compiling version of 'parallel' |
09:23:49 | Skrylar | Araq: i was just trying to lazy out of having to make one extra pointer |
09:25:06 | Skrylar | I learned how badly my image API sucked when trying to add jpeg support to it; now I redesigned it to suck less. |
09:34:10 | Araq | now put it on babel please |
09:34:44 | Skrylar | it doesn't work |
09:34:57 | Skrylar | you want APIs that don't have implementations on babel :P |
09:44:08 | Araq | bbl |
10:26:19 | * | Mat3 joined #nimrod |
10:26:27 | Mat3 | good evening |
10:37:14 | * | BitPuffin quit (Ping timeout: 240 seconds) |
10:38:04 | * | kunev joined #nimrod |
10:46:14 | * | BitPuffin joined #nimrod |
11:44:01 | Araq | hi Mat3 |
11:44:12 | Mat3 | hi Araq |
11:49:57 | Mat3 | what's new ? |
11:53:03 | Araq | I've written a thraad pool that adapts to the current CPU usage, no manual static tweaking of the thread pool size |
11:53:13 | Araq | necessary |
11:53:30 | Araq | I need to test it much better though ;-) |
11:54:25 | Araq | but maybe Varriount likes to do that? ;-) |
12:02:12 | Mat3 | I think you mean a dynamic thread pool |
12:04:34 | * | Skrylar quit (Read error: Connection reset by peer) |
12:05:36 | * | Skrylar joined #nimrod |
12:07:07 | Araq | who knows if these things have standardized names |
12:21:17 | Mat3 | anyhow; It's an useful feature |
13:11:22 | * | darkf quit (Quit: Leaving) |
13:30:34 | * | Johz joined #nimrod |
13:38:34 | Skrylar | arghs |
13:38:51 | Skrylar | so apparently if you don't want to load a PNG in one pass, pain ensues |
13:39:46 | Mat3 | ciao |
13:39:49 | * | Mat3 quit (Quit: Verlassend) |
13:40:43 | * | Johz quit (Quit: Leaving) |
14:59:18 | * | Jesin joined #nimrod |
15:12:13 | * | kunev quit (Quit: leaving) |
15:21:25 | * | bjz quit (Ping timeout: 250 seconds) |
15:51:19 | * | CarpNet joined #nimrod |
15:51:37 | * | CarpNet left #nimrod (#nimrod) |
16:03:49 | * | untitaker quit (Ping timeout: 252 seconds) |
16:05:18 | * | seertaak joined #nimrod |
16:05:59 | seertaak | hi all, I asked this question a yesterday, but a bit early :) |
16:06:59 | seertaak | I saw a discussion in the nimrod forum in which Araq proposed to remove case-insensitivity of identifiers, and to use camelCase for vars and PascalCase for types. What's the status of this proposal? |
16:07:57 | seertaak | I must profess to finding the whole TSomeType business a bit ugly, but I recognize that some people seem to like ultimate flexibility in naming convention :) |
16:09:18 | * | untitaker joined #nimrod |
16:32:47 | * | Jehan_ joined #nimrod |
16:33:46 | seertaak | hi are there any nimrod experts around? |
16:33:57 | Jehan_ | Depends on what you mean by expert. :) |
16:34:27 | Jehan_ | Hmm, just looking at your question regarding case sensitivity. |
16:34:34 | seertaak | yeah, that's the question :) |
16:34:38 | Jehan_ | There are actually two different issues involved. |
16:35:04 | Jehan_ | The T/P prefixes are supposed to go (while, at least temporarily, keeping the old type names around as aliases). |
16:35:15 | seertaak | for practical purposes: I'm just starting with nimrod, and I'm just wondering if I should use the T prefixes |
16:35:21 | Jehan_ | However, that does not affect case sensitivity. |
16:35:28 | Jehan_ | seertaak: That's up to you. |
16:35:37 | Jehan_ | Personally, I don't use them in my code. |
16:36:12 | seertaak | ok, so then it's up to the programmer to make sure type names don't collide with variable names |
16:36:42 | seertaak | i.e. so e.g. creating a type with name Id is probably a bad idea |
16:36:57 | Jehan_ | My convention is generally (let's say for a stack type): call the module "stacks" (i.e., the plural), the type "Stack", and if I need to distinguish a value/ref type, call that type "StackObj" or "StackRef". |
16:36:59 | seertaak | since it's likely to be used as a variable also |
16:37:23 | Jehan_ | Well, names (aside from temporary variables) should have understandable names. |
16:37:33 | Jehan_ | Ruby went from id to object_id eventually, for example. |
16:38:17 | seertaak | ok, thanks for the suggestions |
16:38:32 | * | brson joined #nimrod |
16:39:02 | seertaak | although personally I think "id" is about as clear an identifier as you can get :) |
16:39:23 | Jehan_ | Well, even if it's clear, it's just too likely to be reused. |
16:39:24 | seertaak | and anyway, regarding ruby, wouldn't it always be accessed as object.id |
16:39:46 | Jehan_ | No, you do 1.object_id or "foo".object_id. |
16:40:14 | seertaak | ok, Jehan_ thanks! |
16:40:29 | Jehan_ | The problem is, id was essentially a keyword in all but name and it was difficult to reuse it. |
16:41:28 | seertaak | well, all I can say is that I write c++ for a living and regularly use id as an identifier -- have yet to encounter any problems with collision :) |
16:41:57 | seertaak | but I don't want to start a holy war on variable naming... when in rome and all that |
16:42:11 | Jehan_ | That's why C++ has foo_ variables all over the place. :) |
16:42:45 | Jehan_ | Oh, I do understand your preferences. The thing is, there are always tradeoffs. |
16:43:56 | Jehan_ | Personally, I just go with whatever convention a language uses, unless it's totally broken. :) |
16:44:31 | seertaak | exactly :) and in C++ I'm lead to a kind of literate style of naming where the namespace adds meaning and disambiguation, allowing the class/method name to be quite short |
16:45:20 | seertaak | anyway, back to tinkering with nimrod... on today's menu: templates to generate objective-c classes :) |
16:45:41 | Jehan_ | Have fun with that. :) |
16:55:03 | * | flaviu joined #nimrod |
16:55:10 | * | Jehan_ quit (Quit: Leaving) |
17:00:18 | * | BitPuffin quit (Ping timeout: 240 seconds) |
17:06:12 | * | Demos joined #nimrod |
17:16:46 | * | Matthias247 joined #nimrod |
17:16:49 | reactormonk | seertaak, the next step is cs:partial, which means first character only. |
17:18:43 | EXetoC | is that set in stone then? |
17:19:55 | reactormonk | not sure |
17:27:40 | flaviu | reactormonk: I'm user60561, I can't think of a better name though. Also, 15 people on stack overflow upvoted, which is awesome. |
17:31:01 | * | DAddYE joined #nimrod |
17:34:48 | * | seertaak quit (Ping timeout: 240 seconds) |
17:41:35 | * | chemist69 quit (Quit: leaving) |
17:47:07 | * | BitPuffin joined #nimrod |
17:53:06 | * | seertaak joined #nimrod |
17:58:19 | seertaak | reactormonk: thanks for info |
17:58:30 | seertaak | I'd personally prefer case-sensitive |
17:58:54 | seertaak | but first character allows type/instance disambiguation so that's already useful |
18:01:08 | Varriount | Meep |
18:03:28 | * | askatasuna joined #nimrod |
18:08:23 | Araq | ping Varriount |
18:08:33 | Varriount | Hi Araq |
18:08:50 | Araq | wanna write tests for threadpool.nim? |
18:08:59 | Araq | (already found a bug ;-) ) |
18:09:28 | Varriount | Eh, I'd like to finish what I'm working on currently. |
18:14:42 | Araq | what is that again? |
18:15:43 | Varriount | cross platform file change monitoring |
18:15:52 | seertaak | hi, I have two .nim files. one is called objcapi.nim, and defines (but does not export) proc myImpl(...) . the other, objc.nim, also defines (but does not export) proc myImpl. attempting to compile causes duplicate symbol error message. is that expected? |
18:16:35 | seertaak | oh yeah should mention that objc.nim imports objcapi.nim, but that's prob obvious |
18:16:49 | Varriount | seertaak: Are you using an include directive, or an import directive |
18:17:19 | seertaak | I'm doing: import objcapi as objc |
18:17:30 | seertaak | from objc.nim |
18:18:27 | Varriount | seertaak: I don't suppose you could gist your two files? |
18:18:49 | seertaak | err... yes, but may take a second -- have never gisted before |
18:18:55 | Varriount | seertaak: gist.github.com |
18:19:16 | flaviu | just paste and come up with a name. really nice and easy |
18:19:26 | Varriount | seertaak: If both procs have the same signature - the same name and parameter types - then the compiler won |
18:19:35 | seertaak | https://gist.github.com/zenAudio/67006968d584fe9ca8a7 |
18:19:42 | Varriount | *won't know which one to use when you call the procedure |
18:20:34 | seertaak | that's a prob imo, because if I've declared the proc not to be exported, it should be in an anonymous namespace (to use C++ parlance!) |
18:21:29 | seertaak | if this is true, then I need to be careful about (unexported) proc names in library modules -- not ideal, or? |
18:23:10 | Varriount | seertaak: Hm. That is very odd |
18:23:39 | Varriount | seertaak: I was assuming that the error you got was from the nimrod compiler, not the C compiler |
18:24:13 | Varriount | Oh, here's why. You've exportc'd both of your procs |
18:24:13 | seertaak | sorry should have mentioned it was after compilation and during linking of object files |
18:24:55 | seertaak | oh i see |
18:24:57 | Varriount | exportc uses the procedure name as the exported symbol if no other string is given. |
18:25:03 | seertaak | that totally makes sense |
18:25:34 | seertaak | my bad. I guess the way to do it is to have one carefully named {.exportc.} method which can call an arbitrary proc. |
18:25:39 | seertaak | thanks for help! |
18:25:58 | Varriount | seertaak: You can also have formatting symbols in the exportc pragma |
18:26:06 | EXetoC | github has nimrod highlighting, in case you didn't know that |
18:26:48 | seertaak | EXetoC: yes was aware, not sure how to use and wanted to do it quick :) but will check it out |
18:27:03 | seertaak | Varriount: what do you mean? |
18:28:03 | Varriount | seertaak: ' {exportc: "nimrtl_$1"} ' will, when used to export a procedure named "findString", generate an exported symbol "nimrtl_findString" |
18:28:22 | seertaak | oh, nice! |
18:28:49 | Varriount | That pattern is used throughout the standard library to export the runtime and os procedures. |
18:29:03 | flaviu | seertaak: I think it should be reported as a bug anyway |
18:30:15 | milosn | hmmm if i want to wrote a 'setter' method ... should i do it on a type or on a pointer to that type? |
18:30:27 | milosn | on TMyType or PMyType |
18:30:48 | milosn | ive just noticed it dont work when i did it on PMyType |
18:32:08 | milosn | hmmm lets try on TMyType :P |
18:32:15 | EXetoC | it does work for value types, but you have to dereference first |
18:32:26 | milosn | pointer should only point to real type |
18:32:48 | EXetoC | and pointers can often be dereferenced implicitly |
18:33:42 | seertaak | flavius: added issue #1194 |
18:36:17 | EXetoC | but not in this case apparently |
18:36:58 | milosn | ? |
18:37:36 | milosn | EXetoC: can you give me an example of simple setter proc on a pointer type? |
18:38:16 | milosn | ive just tried making it proc on an underlying real type, it gives me an error |
18:38:25 | milosn | c3/domains.nim(58, 5) Error: for a 'var' type a variable needs to be passed |
18:39:27 | * | CARAM quit (Read error: Connection reset by peer) |
18:39:32 | milosn | hmmm |
18:39:33 | EXetoC | var implies possible modifications, and a parameter declared without 'var' or a variable declared with 'let' won't work in this case |
18:40:40 | milosn | hmmm i think its because i just define my type and pointer type, and than i have init proc for pointer |
18:40:40 | * | CARAM_ joined #nimrod |
18:40:52 | milosn | without init proc for the type itself |
18:40:54 | EXetoC | and you don't need 'var' in other cases. the compiler will decide whether or not passing in a hidden reference will be faster |
18:41:10 | milosn | hmmm |
18:41:23 | milosn | and making a setter proc on pointer type dont work |
18:41:30 | flaviu | Is there something like {.emit.} but for type names? |
18:41:32 | EXetoC | I'll try that |
18:42:25 | milosn | please do, if i can make it work ... i can have "limmited" update()-s for my ORM :) |
18:42:41 | milosn | where only fields which have been updated are included in resulting SQL |
18:42:42 | milosn | :D |
18:43:17 | milosn | now update() gathers all values from all fields and updates whole record in DB |
18:43:44 | milosn | better to spend some time on CPU and distinguish what actually got changed than hitting the hard disk :) |
18:43:49 | EXetoC | it does work for 'ref' though. you need to dereference ptr's yourself |
18:44:05 | milosn | can i have simple example on pastie? |
18:44:39 | milosn | like pretty please :D |
18:44:40 | EXetoC | I might've been bitten by type inference |
18:44:42 | EXetoC | sure |
18:52:29 | seertaak | does nimrod have any facilities for reflection? |
18:53:07 | milosn | seertaak: there is typeinfo |
18:53:16 | milosn | but its a bit cryptic for me :) |
18:53:24 | * | milosn did things the "hard way" |
18:53:56 | seertaak | milosn: cool, thanks! |
18:53:57 | milosn | seertaak: module index, typeinfo |
18:54:10 | EXetoC | see marshal.nim for typeinfo in action |
18:55:12 | milosn | EXetoC: knowing what typeinfo can do and marshal.nim ... you think one could make ZODB style object store for nimrod? |
18:55:25 | milosn | or lighwight version, like durus |
18:55:36 | milosn | (both are python) |
18:55:55 | seertaak | EXetoC: thx |
18:56:45 | flaviu | milosn: There's only compile-time reflection |
18:57:14 | flaviu | but you can save the shape of the types at compile time and do whatever you'd like with them. |
18:59:05 | EXetoC | milosn, https://gist.github.com/EXetoC/7956c00a787da7e074a0 |
18:59:47 | EXetoC | usually you don't need to mix values and pointers of the same type, which simplifies things |
19:00:51 | flaviu | milosn: Sorry, I'm wrong, you can do it without macros. I'd probably still do it with macros since they're neat |
19:02:11 | milosn | EXetoC: not sure what you made there ... this is what i try to do: http://pastie.org/9169433 |
19:02:12 | EXetoC | x.y can be used for actual field accesses, but not for getters. might be by design |
19:02:45 | milosn | and o.do_id = 1223 ... dont update the dirty_updated seq |
19:02:57 | milosn | where o is pointer |
19:03:38 | EXetoC | it should |
19:04:06 | milosn | it compiles, but dont seem to work |
19:04:16 | milosn | let me dig a bit, maybe i have a fail someplace else |
19:04:27 | EXetoC | maybe the actual field is accessed instead. add an echo |
19:06:01 | milosn | hmmm |
19:06:05 | milosn | not sure |
19:06:28 | EXetoC | I'd rename the field if that's the case. It won't matter in other modules though if the do_id field isn't exported (do_id*: type rather than do_id: type) |
19:06:33 | * | noam joined #nimrod |
19:07:39 | milosn | EXetoC: what you mean its not important if its exported? |
19:07:45 | milosn | i need access to it :) |
19:07:54 | milosn | this is how it works: http://pastie.org/9164177 |
19:08:04 | milosn | update() is not there, still working on it |
19:08:05 | milosn | :D |
19:09:02 | milosn | its the port of my ORM for python, just done in nimrod |
19:09:38 | milosn | originally inspired by worst ORM of all ORMS ... DB_DataObject for PHP :) |
19:11:03 | EXetoC | milosn, export means public. is do_id invoked from the module that defines PDomain? |
19:11:13 | * | brson quit (Ping timeout: 245 seconds) |
19:11:27 | milosn | it should be invoked from anyplace |
19:12:15 | milosn | for example you set it value INT_SKIP and do an insert() ... viola, you duplicated the record :P |
19:12:16 | EXetoC | well, figure out if it's the field that's being accessed. perhaps you want to remove the * attached to it, if there is one |
19:12:31 | milosn | no, all fields need to be accessible |
19:13:12 | milosn | from every where ... you think thats why it dont work? |
19:14:31 | milosn | well in worst case, if i dont figure it out ... we shall have full blown hard-disk-destrying update() :P |
19:14:40 | EXetoC | possibly. find out by printing in the setter |
19:15:05 | milosn | maybe i need to de-ref o in the setter? |
19:15:07 | milosn | hmmm |
19:15:16 | milosn | ill try echo-ing stuff |
19:17:54 | EXetoC | it is already being dereferenced (implicitly). you'd get an error otherwise |
19:18:27 | milosn | yeah it dont work |
19:18:29 | milosn | hmmm |
19:18:31 | milosn | strange |
19:18:36 | EXetoC | nothing is printed? |
19:19:18 | milosn | trying that now, i tried de-refing |
19:19:52 | EXetoC | well, the proc takes a pointer already, assuming that the type name doesn't lie |
19:21:13 | EXetoC | I'd rename either of those. |
19:21:45 | milosn | hmmm echo() in setter ... dont get echoed |
19:21:51 | milosn | its not going in there at all |
19:22:49 | milosn | do i need {.inline.} pragma like in example in tutorial? |
19:22:50 | milosn | ? |
19:23:01 | EXetoC | no |
19:23:20 | EXetoC | so rename the setter and try again |
19:24:19 | milosn | rename it to be something other than the field name? |
19:24:21 | EXetoC | and then modify the lines that invoke it of course. something should indeed be printed, assuming that it does compile |
19:24:23 | EXetoC | yes |
19:25:14 | milosn | ummm thats not gonna work, the code is auto-generated, and basically you should be able to access the fields as you are working with the DB rows |
19:25:20 | milosn | ill try so we can nail it down |
19:26:33 | Araq | er flaviu how can we fix this bug? the user explicitly requested both procs should gain the same C identifier ... |
19:27:09 | flaviu | Araq: Do you have a link? |
19:27:14 | Araq | we can reject it at the expense of a huge global dictionary that re-implements what the linker checks... yay |
19:27:44 | milosn | EXetoC: renaming the setter works ... but thats not the fix i need :) |
19:28:00 | milosn | so setters with same name as a field dont work |
19:28:02 | milosn | hmmm |
19:28:06 | EXetoC | usually you don't want to export both, and for good reasons |
19:28:35 | milosn | EXetoC: if i dont export the field, it cant be read not written? |
19:28:56 | EXetoC | `do_id=` implies a write |
19:29:01 | Araq | seertaak [19:33:42] flaviu: added issue #1194 |
19:29:43 | EXetoC | "proc do_id(o: Type): typeToReturn" would be the getter. |
19:29:45 | flaviu | Araq: No, the user who wanted the two procs to have the same id |
19:30:08 | seertaak | Araq: is there a problem with the issue submission? |
19:30:47 | milosn | EXetoC: ahhhh |
19:30:50 | seertaak | Sorry, didn't read context. |
19:31:17 | milosn | EXetoC: thats the solution, fields will be private, and i have getter/setter combo same as field names |
19:31:29 | milosn | EXetoC: genious :) |
19:31:31 | flaviu | The guy who wanted the procs to be the same should use exportc since his case is more special than seertaak's. |
19:31:41 | EXetoC | yeah, and you can of course choose what combination to support |
19:32:04 | Araq | flaviu: the gist has 2 proc myImpl(...) {.exportc.} |
19:32:14 | Araq | the compiler does what it is told |
19:32:21 | EXetoC | milosn, I don't know about that. everyone does it :p it's very simple in nimrod though |
19:32:36 | milosn | EXetoC: hmmm this is cool, i could make "access profiling" like in one ORM i seen in java, it profiles the fields you are actually using in your objects and generates "smarter" select queries |
19:32:40 | milosn | hmm cool |
19:32:55 | fowl | wow they are putting damian conways quantum::superpositions in perl6 http://en.wikipedia.org/wiki/Perl_6#Junctions |
19:33:11 | seertaak | Araq: what is not expected is that that in both cases the method was not exported |
19:33:14 | EXetoC | milosn, sounds good |
19:33:23 | EXetoC | btw, is PDomain a ref or a ptr? |
19:33:33 | seertaak | From a "user" point of view, it is suboptimal that a non-exported proc leaks out |
19:33:40 | milosn | EXetoC: dont have time to do that ATM, thats not hight on pri list |
19:33:45 | milosn | EXetoC: umm let me see |
19:33:46 | seertaak | but I understand the caveat that this is because I'm doing low-level stuff with exportc |
19:33:54 | EXetoC | usually you want a reference |
19:33:58 | Araq | seertaak: so? *exportc* does exactly what the docs say it does |
19:33:59 | milosn | EXetoC: its a ref |
19:34:03 | EXetoC | right |
19:34:04 | milosn | traced one? |
19:34:10 | seertaak | yes, hence my caveat :) |
19:34:22 | milosn | i want one that can be garbage collected |
19:34:27 | milosn | hope i picked the right one |
19:34:31 | EXetoC | yes |
19:34:34 | seertaak | feel free to delete the issue if you like! :) |
19:34:48 | seertaak | didn't want to cause problems |
19:34:53 | flaviu | Araq: Oh, I see, I thought it wasn't exported at all. If he's using exportc, I don't think its the compiler's job to figure it out. |
19:34:57 | EXetoC | ptr requires manual freeing |
19:35:09 | Araq | flaviu: alright, closing it then |
19:35:51 | EXetoC | milosn, this overload takes a finalizer (destructor) proc: "proc new*[T](a: var ref T, finalizer: proc (x: ref T) {.nimcall.})" |
19:36:53 | * | dymk quit (Quit: ZNC - http://znc.in) |
19:37:55 | * | dymk joined #nimrod |
19:37:56 | EXetoC | Araq, do full collects make any guarantees regarding finalizing? |
19:38:42 | Araq | no, they don't guarantee anything, they can't |
19:38:56 | Araq | the stack is scanned conservatively |
19:39:33 | Araq | hence they don't even guarantee everything that is unreachable is GC'ed |
19:42:00 | milosn | EXetoC: thats works like magic (with set/get and private field) |
19:42:03 | milosn | cool thanks |
19:43:11 | EXetoC | ok. I can't remember if destructors were unreliable. maybe only for vars declared in the module scope |
19:44:09 | EXetoC | in addition to never being invoked in some cases of course |
19:44:14 | EXetoC | milosn, np |
19:48:13 | * | Mat3 joined #nimrod |
19:48:17 | Mat3 | hello |
19:49:16 | Araq | servus, Mat3 |
19:50:16 | EXetoC | yeah, probably just the module scope. should destructors work there? |
19:51:19 | EXetoC | tdestructor.nim has destructible contexts only inside procs |
19:55:50 | Araq | IMO no, they shouldn't |
19:56:12 | Araq | it's hard to support, produces code bloat and is most often unnecessary |
19:56:34 | Araq | oohh, lets close the sockets before the OS does that too |
20:06:38 | * | brson joined #nimrod |
20:24:55 | Varriount | Hm. Does Unix/Linux/Posix support "locking" a file, to prevent read/write/deletion of the file? |
20:29:19 | EXetoC | permissions? |
20:29:27 | * | flaviu1 joined #nimrod |
20:29:44 | Varriount | EXetoC: I mean, on a temporary basis. |
20:30:19 | * | flaviu quit (Ping timeout: 240 seconds) |
20:30:50 | Varriount | As in, if a program opens a file on those platforms, can it prevent other programs from modifying the file, so that it can write to the file without fear of race conditions. |
20:31:36 | flaviu1 | Varriount: http://man7.org/linux/man-pages/man2/open.2.html |
20:31:37 | skroll | Varriount: it's filesystem dependent |
20:36:46 | flaviu1 | Varriount: Sorry, while that explains everything about files, http://man7.org/linux/man-pages/man2/flock.2.html is what you actually call |
20:37:39 | Varriount | flaviu1: Is that just for linux, or posix in general? |
20:38:42 | fowl | what am i doing wrong here :/ https://gist.github.com/fowlmouth/6fce784b3ea3e7a967d3 |
20:39:15 | skroll | Varriount: keep in mind that locks are generally advisory unless you mount your filesystem to have mandatory locks. in other words, by default, unless other processes are explicitly checking for locks, they won't care if it's locked or not. |
20:39:33 | flaviu1 | Varriount: http://anselmo.homeunix.net/ebooks/linuxkernel2/083.htm Seems that mostly everything will implement flock(), but the official posix call is fcntl() |
20:39:57 | Araq | fowl: only zahary can help you with this |
20:48:41 | EXetoC | the feature is still pretty unusable |
20:48:50 | Varriount | "Only zahary can save you now" |
20:49:45 | EXetoC | I might be able to get my container type class to work though, but then I have to omit var in the signatures, and instead introduce temporaries |
20:50:24 | EXetoC | eh no. it's likely that the compiler will copy. maybe with a dummy object that contains a reference |
20:51:00 | EXetoC | I have about 2 open UDTC issues |
20:51:27 | * | BitPuffi1 joined #nimrod |
20:51:56 | * | BitPuffi1 quit (Client Quit) |
20:52:14 | * | BitPuffi1 joined #nimrod |
20:53:18 | * | BitPuffin quit (Ping timeout: 245 seconds) |
20:54:44 | Varriount | Speaking of which, when was zahary last on? |
20:54:51 | Varriount | I mean, like, active. |
20:55:12 | dom96 | !seen zahary |
20:55:13 | NimBot | zahary was last seen on Mon May 12 02:48:25 2014 joining #nimbuild |
20:55:32 | dom96 | That's not really useful heh |
20:55:46 | dom96 | he was active on github 3 days ago |
20:56:43 | EXetoC | he's very busy apparently |
20:57:06 | EXetoC | with running a company or something |
21:12:17 | dom96 | I wish I was busy with running a company |
21:12:25 | dom96 | instead of having to deal with exams |
21:16:00 | * | snuffeluffegus joined #nimrod |
21:16:17 | dom96 | hi snuffeluffegus |
21:17:42 | Matthias247 | dom96: I guess exams are easier ;) But unfortunatly don't bring you any money |
21:19:48 | dom96 | True. Running your own company may also not bring in any money though. Perhaps I should be careful what I wish for heh. |
21:21:24 | * | snuffeluffegus quit (Quit: Leaving) |
21:22:40 | * | hoverbear joined #nimrod |
21:22:47 | Matthias247 | that's true. I'm still struggling with what-to-do if I would have an own company ;) |
21:22:49 | hoverbear | Araq: It's you! |
21:25:35 | * | OrionPK quit (Remote host closed the connection) |
21:25:40 | Araq | hi hoverbear wb |
21:26:01 | dom96 | hoverbear: welcome back! It's been a long time! |
21:26:19 | hoverbear | I came looking for a mongodb driver and a web framework. *looks ashamed* |
21:26:39 | * | Varriount wonders who hoverbear is, and wonders if he will continue to hover. |
21:26:53 | hoverbear | Varriount: I'm an adept hoverer. Want to learn? |
21:27:42 | EXetoC | hoverbear, https://github.com/dom96/jester (web framework) |
21:28:27 | reactormonk | hoverbear, following the nonsql hype? ^^ |
21:28:39 | EXetoC | we do have an incomplete mongodb interface, which relies on the old API. I've been working on a rewrite that doesn't use the legacy C driver. it should be in a usable state soon |
21:28:58 | hoverbear | reactormonk: No I need to query a database. :S |
21:29:04 | Mat3 | nonsql hype ? |
21:29:06 | hoverbear | EXetoC: Thanks! |
21:29:06 | reactormonk | huh? |
21:29:45 | hoverbear | reactormonk: I think Mongodb sucks, I need to interface with it, not like it. :_p |
21:29:52 | reactormonk | hoverbear, so be it |
21:30:04 | EXetoC | Mat3, yes, the recent increase in popularity for non-SQL database engines |
21:30:34 | Mat3 | well, dbase was a nice database |
21:31:48 | * | seertaak quit (Ping timeout: 240 seconds) |
21:33:01 | EXetoC | hoverbear, what do you need? there are things such as gridfs which I haven't touched yet |
21:33:22 | hoverbear | EXetoC: It's already in mongoDB, that's not an option :( |
21:33:46 | Mat3 | EXetoC: but I suspect, this trend has more to do with web based search libraries which somehow can be misused for database alike applications |
21:34:02 | EXetoC | what do you mean? I'll implement as much as possible, but I'll prioritize the basic operations |
21:34:10 | EXetoC | *core |
21:34:31 | EXetoC | Mat3, ok. maybe |
21:49:47 | hoverbear | dom96: How have you been? |
21:51:03 | dom96 | hoverbear: pretty good. You? Are you going to stick around this time? :P |
21:51:57 | hoverbear | dom96: Want to try Nimrod some more. :) |
21:52:24 | hoverbear | dom96: Been digging at Rust lately. |
21:52:44 | dom96 | hoverbear: Out of curiosity, what made you come back? |
21:53:58 | hoverbear | dom96: Google didn't have any results for a mongodb driver for Nimrod xD |
21:56:07 | flaviu1 | Is there any way to not use system.nim? |
21:56:21 | EXetoC | you want to be able to do nothing at all? :> |
21:56:31 | EXetoC | hoverbear, does too :p |
21:56:39 | hoverbear | It's true |
21:56:54 | flaviu1 | EXetoC: I want my own system.nim, with hookers and blackjack :P |
21:57:36 | EXetoC | hoverbear, "nimrod mongo"? |
21:57:47 | dom96 | flaviu1: Closest thing is --os:standalone I think. |
21:57:57 | hoverbear | EXetoC: https://www.google.ca/search?q=nimrod+mongodb&oq=nimrod+mongodb&aqs=chrome.0.69i59.2070j0j7&sourceid=chrome&es_sm=91&ie=UTF-8 |
21:58:06 | flaviu1 | Doesn't work, fails to compile |
21:58:24 | flaviu1 | I'll just lobotomize the regular system.nim then |
21:58:33 | hoverbear | Icepicks work nice |
21:58:40 | EXetoC | hoverbear, right. I need a readme |
21:58:56 | EXetoC | so as to add some relevant keywords |
21:59:03 | hoverbear | Yup! |
21:59:12 | hoverbear | EXetoC: Would love to take a look |
21:59:35 | dom96 | flaviu1: Really? with what error? |
21:59:51 | flaviu1 | Error: cannot open 'panicoverride' |
21:59:52 | EXetoC | I'll try to release something tomorrow |
22:00:08 | Araq | flaviu1: yes. that's a feature. |
22:00:23 | dom96 | flaviu1: Yeah, you need to create that file. |
22:00:28 | EXetoC | hoverbear, so do you need anything other than the core features? I wouldn't consider gridfs one for example |
22:00:36 | dom96 | flaviu1: Example here: https://github.com/dom96/nimkernel/blob/master/panicoverride.nim |
22:00:38 | EXetoC | update, insert, find etc should be prioritized of course |
22:01:18 | flaviu1 | I'll worry about that later, I've already cut everything out of system.nim except string, char, and int |
22:01:20 | hoverbear | EXetoC: At the moment I just want to see what the syntax is like and play around with `find` |
22:01:24 | flaviu1 | Thanks though |
22:02:10 | dom96 | flaviu1: Why do you want a custom system.nim? |
22:02:10 | EXetoC | ok |
22:02:36 | flaviu1 | dom96: To prove you can get by without magic |
22:03:06 | hoverbear | flaviu1: #rust would love to speak with you |
22:03:43 | flaviu1 | hoverbear: Why? Do they want that too? |
22:04:00 | hoverbear | flaviu1: The Rust folks are the most no-magic people I've ever met |
22:04:50 | hoverbear | http://jvns.ca/blog/2014/03/12/the-rust-os-story/ |
22:12:38 | flaviu1 | That's awesome, but rust still does magic to make integers work |
22:13:18 | flaviu1 | hoverbear: Nimrod can do better |
22:13:33 | hoverbear | flaviu1: What do you mean? |
22:13:59 | EXetoC | it must do something to make them work |
22:14:32 | EXetoC | and when is that not magic? |
22:15:16 | flaviu1 | Integers aren't magic, the only magic parts are keywords like `type` or `proc`. I'd like to get to a point where I can do `type int = {emit: "int8_t"}` |
22:15:57 | EXetoC | ok |
22:19:09 | * | OrionPK joined #nimrod |
22:19:17 | dom96 | good night |
22:19:58 | milosn | hmmm can i fork nimrod app proccess? |
22:20:12 | * | milosn cant find fork() anywhere |
22:20:36 | EXetoC | flaviu1, and when we get an ASM target? will it work then too= |
22:21:54 | flaviu1 | EXetoC: I don't know assembler, but just define `when(asm): type int = {.emit: "asm stuff".}` |
22:25:34 | flaviu1 | I don't see how assembler is a viable target for nimrod though |
22:25:53 | skroll | might as well let the C compiler take care of it |
22:28:50 | EXetoC | you either need a language like C++ or asm to minimize the overhead of setting up exception handlers |
22:29:03 | EXetoC | but it's of minor significance of course |
22:29:05 | flaviu1 | EXetoC: or llvm |
22:33:42 | EXetoC | yeah |
22:33:52 | Mat3 | LLVM is basical just an IL representation which is compiled to native code. I do not see any advantage of using it against writing in assembler especially system-programming tasks like exception handling often is cpu dependent |
22:34:31 | EXetoC | doesn't it do optimizations? perhaps it's nothing special |
22:34:55 | EXetoC | oh well if it cant generate optimized exception handling |
22:35:19 | flaviu1 | Mat3: Have you seen LLVM IR? Its amazing! It lets you pass off the hard parts to the backend |
22:35:56 | hoverbear | flaviu1 \i/ |
22:36:31 | Mat3 | (with CPU dependance I mean special system registers not common avariable) |
22:36:43 | flaviu1 | EXetoC: IR does absolutely nothing by itself, but LLVM has many optimization passes to make it better. It even will take care of zero-cost exception handling on Itanium. It isn't your problem anymore. |
22:37:34 | EXetoC | yeah well llvm takes care of all steps |
22:37:56 | EXetoC | all good then |
22:38:07 | flaviu1 | You still have to do lambda manually |
22:38:50 | flaviu1 | and if statements are uglier than C. It does optimize the if's loads and stores into phi nodes automatically though |
22:39:41 | flaviu1 | And it figures out the best way to do accurate garbage collection too |
22:40:19 | Mat3 | flaviul: It depend on the task |
22:40:33 | Araq | it also doesn't support efficient integer overflow checking, lacks OpenMP support, exception handling and GC stuff is barely documented |
22:41:14 | Araq | and doesn't provide a decent C wrapper |
22:41:39 | Araq | so everybody has to compile his own massive llvm DLLs and hope for the best |
22:41:39 | Mat3 | in addition: LLVM compiles stack based code with really horrible result for x86 |
22:41:39 | EXetoC | is the wrapper incomplete? |
22:41:57 | Araq | EXetoC: last time I checked it, yes |
22:42:00 | flaviu1 | Araq: `llvm.s(add|sub|mul).with.overflow` |
22:42:05 | hoverbear | Isn't Nimrod a llvm language? |
22:42:16 | EXetoC | the llvm target is unfinished |
22:42:18 | flaviu1 | hoverbear: Nope, compiles to c |
22:42:23 | Araq | flaviu1: that's a recent addition then ... |
22:42:26 | flaviu1 | EXetoC: Its started? |
22:43:37 | EXetoC | a long time ago. didnt get far I think |
22:44:32 | Mat3 | flaviul: My point is LLVM can't support CPU dependent features like architecture dependent watchdog timers for example because it is a *general* kind of CPU abstraction. That make this compiler of limited use for some system-programming tasks |
22:44:53 | flaviu1 | Mat3: LLVM allows direct assembler output |
22:45:22 | Mat3 | yes, but for such usages you must patch these output so its easier to write directly in assembler |
22:46:14 | flaviu1 | Mat3: I don't understand, can you phrase that differently? |
22:47:13 | * | askatasuna quit (Ping timeout: 276 seconds) |
22:47:52 | Mat3 | try accessing a AMD specific debug register with LLVM (you can't) |
22:48:09 | flaviu1 | Araq: LLVM has changed a lot, GC has decent docs: http://llvm.org/docs/GarbageCollection.html , as do exceptions http://llvm.org/docs/ExceptionHandling.html |
22:49:04 | Mat3 | I see. We are talking about different types of exception handlers |
22:49:38 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:52:23 | * | xenagi joined #nimrod |
22:53:23 | Mat3 | ciao |
22:53:30 | * | Mat3 quit (Quit: Verlassend) |
23:02:23 | EXetoC | dunno what he meant |
23:02:25 | EXetoC | cpu flags maybe |
23:04:47 | Araq | I think he meant interrupts |
23:09:58 | * | darkf joined #nimrod |
23:12:19 | flaviu1 | It lives: https://gist.github.com/flaviut/7e5332df1ea9929b9438 |
23:12:40 | flaviu1 | Araq: I can do arithmetic without any magic |
23:13:29 | Araq | at compile time? ;-) |
23:13:55 | EXetoC | metaprogramming is overrated :> |
23:14:02 | flaviu1 | The c code contains some `return a; return result;`, but who cares. |
23:14:50 | flaviu1 | Araq: I don't understand what you're saying |
23:15:16 | EXetoC | as in using it at compile time |
23:15:32 | EXetoC | (vm) |
23:15:54 | flaviu1 | With some work, (ok, a lot) the emit pragma can support outputting ASTs |
23:16:39 | flaviu1 | Then just hide everything behind a `when vm: include vmints` |
23:22:33 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
23:22:34 | Araq | flaviu1: yeah but it is lots of work and I fail to see the advantage of your appraoch |
23:23:12 | * | Varriount_ joined #nimrod |
23:25:02 | * | boydgreenfield joined #nimrod |
23:25:29 | * | Varriount quit (Ping timeout: 264 seconds) |
23:27:11 | Araq | good night |
23:27:25 | flaviu1 | I like the idea of everything being done in the library. It leads to fewer corner cases in the compiler. |
23:27:25 | flaviu1 | Night |
23:33:16 | * | hoverbear quit () |
23:46:10 | Varriount_ | flaviu1: What do you mean? |
23:46:15 | * | Varriount_ is now known as Varriount |
23:47:52 | flaviu1 | Varriount: What I said was different from what I thought, the standard library declares the things with magic, but the compiler provides the implementation. |
23:48:23 | flaviu1 | s/ht, th/ht; what I mean is that the/ |
23:51:25 | flaviu1 | It also puts limits on the extensibilty of the language. If everything is done without magic, that demonstrates that the language does not restrict you in any way, even if what you want to do is boneheaded |
23:57:33 | * | q66 quit (Quit: Leaving) |