00:00:05 | Araq | vbtt: well dom96 is implementing the runtime aspects. all I do is to provide language features for it |
00:00:32 | Araq | so of course these overlap |
00:00:37 | vbtt | ah i sse. |
00:00:39 | vbtt | see. |
00:01:18 | vbtt | Araq:you are familiar with how async services work, i assume? |
00:01:51 | Araq | not really, I hate this sockets stuff with a passion |
00:02:18 | Araq | but I guess I'm "familiar" |
00:02:25 | vbtt | typically a single thread has a queue of 'pending requests'. it wants to process the next one that is ready. it has one place in code where it does wait_on(list of pending requests) |
00:02:32 | vbtt | so that's an OR. |
00:03:16 | vbtt | it processes the next one that is ready - could be a new filesystem block read or a new data on an existing connection. |
00:03:32 | Araq | yeah sure |
00:03:56 | vbtt | having a generic OR will be very useful. I can create a timeout by just proc timer(): sleep(...); and then call it in async timer() |
00:04:01 | vbtt | and then inject it in my list. |
00:04:12 | vbtt | so the entire list has a timeout because it will be ready at that time. |
00:04:26 | vbtt | basically i can compose 'pending requests' of different types. |
00:04:39 | Araq | yeah I know |
00:04:42 | filwit | Araq: PULL IT NOW!! |
00:04:49 | filwit | Araq: :-P |
00:05:13 | vbtt | basically i'm suggesting these operations: |
00:05:19 | vbtt | r = async f() |
00:05:35 | vbtt | first = wait_for_next([r1, r2, r3..]) |
00:05:47 | vbtt | all = wait_for_all([r1, r2, r3..]) |
00:05:54 | vbtt | that's all i think. |
00:06:55 | Araq | yes but 'wait_for' essentially delegates its work to an OS builtin |
00:07:03 | Araq | and here things get hairy |
00:07:20 | Araq | as the OS doesn't know about our 'closure iterators' |
00:09:05 | Araq | this means 'yield' needs to be compatible to the callback style, I think |
00:09:52 | * | darkf joined #nimrod |
00:11:04 | Araq | vbtt: why does one want replication to 10 servers but it suffices when 2 are done with it? that's just wasteful. let 2 then doe the work and the other 8 update in batches later |
00:12:10 | Araq | seems much better to reduce network traffic |
00:12:11 | vbtt | Araq:you want the fastest 2, but you don't know (load changes over time and network changes). also some servers might just be dead. so you fire to all and wait for the fastest 2 to respond. |
00:12:27 | vbtt | often it's fire 3 wait for 2. i.e. difference isn't that huge. |
00:12:48 | Araq | but that increases network traffic and so the likelyhood of some server failing |
00:12:52 | vbtt | * you don't know which are the fastest 2 (and available) at any given moment) |
00:13:22 | Araq | so what, just randomize. you don't have only 1 request to serve, do you? |
00:14:34 | vbtt | Araq: you need N replicas anyway. so you need that traffic. |
00:14:51 | Araq | ok, fair enough then |
00:15:01 | vbtt | anyway, there's a lot of ways of implementing fault tolerant, distributed storage. i'm just saying OR is a common pattern. |
00:15:50 | vbtt | and not just for the storage example. lets say to generate a web page, i need to query N backend systems. I don't want to do them in any specific order . |
00:16:35 | vbtt | send N requests; while response = next(): process(response) # ie generate html for this bit. once all are done - concatenate and return page. |
00:17:12 | vbtt | If I do them in any predefined order, I sacrifice latency. |
00:17:28 | Araq | yeah |
00:21:44 | vbtt | Araq:you said you make an OS call (select?) is that part of the language feature you're providing or something dom96 is writing? |
00:21:55 | Araq | dom96 |
00:21:59 | Araq | 's business |
00:22:38 | vbtt | I'm not sure what async does, btw, in addition to what's already possible with closure iterators? |
00:23:00 | * | Icefoz joined #nimrod |
00:27:37 | filwit | woah, who added all the cool color syntax highlighting to Aporia? nice job |
00:28:05 | Araq | filwit: that came for free with gtksourceview |
00:28:38 | filwit | oh no wait, i was running my own build witch modified color syntax, lol |
00:28:48 | vbtt | anyway, OR should be implementable as a function, i think. |
00:28:54 | Araq | vbtt: I don't know how closure iterators interact with 'select' etc. either |
00:29:37 | vbtt | Araq:somewhat related, I looked at the generated C code and it looked like it's capturing the stack start address - if so, why? |
00:30:05 | Araq | vbtt: the stack is scanned conversatively by the GC |
00:30:55 | Araq | the plan is to have an .async pragma that transforms the 'proc' to an iterator and 'await' to 'yield' |
00:31:19 | nueva | how can I disable from command line automatic adding of babel packages paths to search paths? |
00:31:35 | Araq | yield newPromise(...) |
00:31:49 | Araq | but the details are not fleshed out, vbtt |
00:32:03 | vbtt | Araq:will that allow a stack of suspended functions? |
00:32:28 | Araq | nueva: there is a --noBabel switch iirc |
00:32:48 | Araq | you can also not set babelpath in your config |
00:33:22 | Araq | vbtt: it allows a list of suspended functions, yes |
00:33:38 | Araq | but the suspended function has a rather shallow stack |
00:33:44 | renesac | Araq: nimrod GC is precise? I'm asking that because in D I tried to implement a hashtable that stored the hashes in the table itself, and I had to give up the GC because it would leak memory like crazy |
00:34:03 | Araq | renesac: yes |
00:34:18 | Araq | it's precise except for the stack scanning |
00:34:18 | renesac | good to know |
00:34:49 | Araq | you won't find a GC'ed language more hostile to a GC than D btw |
00:35:12 | Araq | but they still think it's some quality of implemenation issue |
00:35:13 | vbtt | Araq:what I meant is - shallow > 1, right? i.e. one iterator can call other and then both can yield, creating a 'stack' of 2. |
00:35:47 | nueva | Araq: there is --noBabelPath, but I still get "config/nimrod.cfg(37, 2) Hint: added path: '/home/user/.babel/pkgs/opengl-1.0' [Path]". is it ok? |
00:35:50 | renesac | Araq: well, with sufficient engineering it may be solvable... it left that impression |
00:36:27 | Araq | renesac: sure, perhaps. it's however an open research problem |
00:36:36 | renesac | right |
00:36:47 | vbtt | "it's precise except for the stack scanning". why can't stack scanning be precise? we know the functions that have been invoked and where on the stack, no? |
00:37:18 | Araq | vbtt: can be precise. but it's expensive to do so. |
00:47:06 | Araq | vbtt: "stack of 2" should be possible, but I need to try that :P |
00:48:41 | vbtt | Araq:going back to previous discussion. now that paren-less single arg function call is possible, isn't r"string" obsolete? |
00:48:54 | vbtt | why not: regex "a+b+c?" |
00:49:27 | OrionPK | ew regex |
00:49:28 | OrionPK | dont use |
00:49:35 | Araq | good question, but extended string literals also prohibit \ as an escape char |
00:50:14 | Araq | re"\bABC\b" |
00:50:29 | Araq | vs re "\\bABC\\b" |
00:50:45 | vbtt | if that means different things, it will be tricky. |
00:51:16 | vbtt | if re is a macro it gets the unescaped string? |
00:51:39 | Araq | again, macro vs proc plays no role here |
00:51:48 | Araq | syntax is decoupled :P |
00:52:10 | Araq | foo"\n" # Nimrod never interprets the \ |
00:53:10 | vbtt | i see |
00:54:16 | Araq | it's pure beauty ;-) |
00:55:15 | vbtt | will re "xx" fail to compile? |
00:55:26 | vbtt | or just happen to do the wrong thing? |
00:55:39 | Araq | wrong thing |
00:56:10 | Araq | thinking about it |
00:56:26 | Araq | you can disallow that with overloading based on ASTs ... |
00:56:45 | Araq | but that's a story for another time, need to sleep now |
00:57:53 | vbtt | good night |
01:00:41 | * | vbtt quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
01:28:49 | * | DAddYE quit (Remote host closed the connection) |
01:29:18 | * | xenagi joined #nimrod |
01:29:23 | * | DAddYE joined #nimrod |
01:33:45 | * | DAddYE quit (Ping timeout: 252 seconds) |
01:45:20 | * | nueva quit (Quit: Bye) |
02:10:57 | * | Demos joined #nimrod |
02:13:28 | Demos | wow way to go umich. Have class today and cancel (for the first time in like 30 years) tomorrow when today is fucking colder. |
02:13:52 | Demos | and they did not even close campus |
02:14:40 | Demos | oh they formed a committe to examine policies related to extreme weather. Jesus Christ |
02:15:06 | Varriount | Demos: :< |
02:15:24 | Varriount | Any particular reason I can't have a set of int's or int32's? |
02:15:27 | Discoloda | hurray committies |
02:15:45 | Demos | I am just pissed because the did not cancel class when it was really fucking cold the week winter break ended and my flight got canceled |
02:16:37 | Demos | Varriount, I think sets are essentially the equivalent of bitwise ORing together constant flags in C, thus a set of int32s does not really make sense, also I bet int32 and int are the same |
02:16:52 | Demos | rather the same on most modern platforms |
02:16:59 | renesac | if nimrod used hash tables for sets it would work |
02:17:07 | Demos | but nimrod does not |
02:17:10 | renesac | at least for larger sets |
02:17:13 | Demos | if you want a hash table use a TTable |
02:17:21 | Varriount | Demos: Er, no |
02:17:32 | Demos | to which part |
02:17:34 | Varriount | TTable's are for when you need a table of growable keys |
02:18:04 | renesac | sets can also be growable |
02:18:08 | renesac | in nimrod |
02:18:08 | Varriount | This would be better, I guess - http://nimrod-lang.org/intsets.html |
02:18:26 | Varriount | renesac: Yes, but Araq has said they shouldn't be used that way. |
02:20:04 | renesac | Demos: I'm not sure if we have the same set of operations on hash tables as there is in sets |
02:20:16 | renesac | *in TTable |
02:20:20 | Demos | yeah tables are the wrong notion |
02:20:28 | Demos | but you can construct a hashset data structure |
02:20:37 | Demos | or indeed a set structure based on a binary tree |
02:20:43 | * | ehaliewicz joined #nimrod |
02:20:57 | Demos | (like c++'s std::set and std::unordered_set, both of which are pretty slow |
02:20:58 | Demos | ) |
02:21:23 | renesac | yeah, that is what I was thinking |
02:21:32 | Demos | TSet is probably the hash set and TOrderedSet is probably the tree set |
02:21:36 | renesac | well, there is no reason for nimrod not supporting it in the future |
02:21:39 | Demos | in the sets module |
02:21:55 | Demos | except for the good reason that nimrod supports it today! |
02:22:02 | renesac | oh |
02:22:05 | Varriount | Always keep in mind, Araq designed parts of nimrod to be fast. |
02:22:17 | Varriount | Not necessarily flexible. |
02:23:03 | Demos | well he designed parts of nimrod to do specific things, and the builtin notion of a set is not the tool that does what you wanted |
02:23:52 | Demos | implementing the set operators for TSet and TOrderedSet is something that can be done. |
02:26:17 | renesac | yeah |
02:28:22 | Demos | I bet nimrod's hashes are faster than C++'s |
02:28:50 | Demos | s/hashes/hashmaps and hashsets |
02:28:51 | renesac | I think the std library ones are based on chained hash tables |
02:29:04 | renesac | that are fast only to see if something isn't on them |
02:29:20 | Demos | the standard does not specify a particular implementation but the iterator invalidation rules essentially require seperate chaining |
02:29:35 | renesac | yep, and pointer chasing is slow |
02:29:43 | Demos | even worse than that there are exception safety garentees that make it even worse |
02:30:01 | renesac | hum |
02:30:23 | Demos | there is an article that talks about how dinkumware implemented them, it is not quite just seperate chaining with linked lists |
02:30:24 | renesac | D also dig it's own grave in that |
02:30:40 | Demos | yeah, having a garbage collector is nice hm |
02:30:45 | renesac | giving you acess to a pointer inside their hash table |
02:30:53 | Demos | oh damn |
02:31:06 | Demos | that is wierd for pretty much anything besides an array |
02:31:11 | renesac | locked them to a chained implementation too |
02:31:36 | Demos | what is the pointer expected to be? To the array of buckets or to an individual bucket |
02:31:47 | renesac | an individual bucket |
02:31:51 | renesac | item |
02:32:07 | renesac | IIRC |
02:32:18 | Demos | I mean seperate chaining is not even that bad if you can do it with arrays instead of linked lists |
02:33:28 | renesac | The InExpression yields a pointer to the value if the key is in the associative array, or null if not: |
02:33:32 | renesac | http://dlang.org/hash-map.html |
02:34:32 | renesac | Demos: yeah, but you may have to realloc your array, and then the pointer will be invalidated |
02:34:37 | Demos | I guess nimrod allows you to keep a pointer around as well (addr of `[]`) but I doubt there are strong invalidation garentees for that. Nimrod's general rule seems to be "if you have an array keep indicies, if you have a table keep keys" |
02:34:45 | Demos | ofc |
02:35:16 | renesac | well, D also don't gives strong guarantees in this page |
02:35:28 | renesac | but people code to the implementation, not the specification |
02:35:53 | Demos | besides nimrod returning a var B means you can keep the reference around long enough to not have to sift throught the table whole lot |
02:35:59 | renesac | and now there is a lot of code implicitly depending on durable pointers... |
02:36:59 | Demos | it is almost as if we should make it hard to keep pointers around, and use methods of addressing relitive other things instead :D |
02:37:26 | Varriount | renesac: "Durable Pointers"? |
02:37:54 | Demos | Varriount, I suspect he means pointers to values that are unlikely to get invalidated unless the element is actually deleted |
02:38:05 | renesac | exactly |
02:38:14 | renesac | to inside their hashtable |
02:38:24 | renesac | (or associative array, as they call) |
02:46:05 | ehaliewicz | oh, nimrod compiles to C, no wonder it doesn't have any kind of real runtime code gen |
02:46:08 | ehaliewicz | that's too bad |
02:46:37 | renesac | why you need runtime code gen? |
02:47:06 | filwit | compile to C has a lot of benefits |
02:47:14 | ehaliewicz | of course |
02:47:23 | filwit | Nimrod runs great on Android/iOS right now.. try that with D |
02:47:34 | renesac | eval is generally considered bad style and unsafe |
02:47:42 | filwit | (ps, i came from D) |
02:47:57 | filwit | eval is being depreciated |
02:48:01 | filwit | to my knowledge |
02:48:29 | Varriount | The only time I've seens eval used wisely in python is when it's being used to do macro-like things (named tuples, etc) |
02:48:47 | ehaliewicz | renesac: i don't need it, but it's nice in certain circumstances, |
02:48:49 | renesac | filwit: we have eval? |
02:48:51 | Varriount | ehaliewicz: Nimrod has runtime macro evaluation though. |
02:48:58 | filwit | runesac: yep |
02:49:03 | filwit | think it's in macros |
02:49:28 | renesac | Varriount: macros are evaluated at compile time, not? |
02:49:36 | ehaliewicz | i use it sparingly, but similar to how i use macros, just at runtime |
02:49:42 | filwit | renesac: not macros, it's in system |
02:50:08 | filwit | anyways folks, i'm taking off, later |
02:50:11 | * | filwit quit (Quit: Leaving) |
02:50:24 | renesac | ... |
02:50:27 | renesac | I can't find it |
02:50:51 | * | brson quit (Quit: leaving) |
02:54:03 | Varriount | renesac: Yeah, sorry, messed up with word |
02:54:40 | Varriount | renesac: Try looking in the repo documentation files, not the documentation on the site (that's not up to date) |
02:55:05 | renesac | I'm lookin on the buil.nimrod-lang.org/docs |
02:55:39 | Demos | in any case having any kind of eval functionality will totally destroy binary sizes |
02:55:54 | Varriount | renesac: Those are a bit old too |
02:55:59 | Demos | I remember I had a runtime eval type deal in haskell and I got binaries of 80+MB! |
02:56:30 | renesac | well, a lua interpreter can be very small |
02:56:43 | renesac | I wonder how much nimrod is more complex than lua |
02:56:52 | renesac | well, the standard library is certainly bigger.... |
02:57:23 | renesac | but yeah, nimrod is all about compile time manipulation and runtime efficiency |
02:57:31 | renesac | and I like that |
02:58:04 | Demos | well sure, but with the standard lib large parts of it get hit with dead code elim |
02:58:05 | ehaliewicz | renesac: runtime evaluation can help runtime efficiency though, at the cost of size |
02:58:35 | renesac | Demos: not if you are going to eval a arbitrary piece of nimrod code |
02:58:44 | ehaliewicz | for example, if you have a lisp implementation in nimrod, you can compile lisp forms to nimrod at compile-time. but if you want to run lisp at runtime, you have to interpret it. with runtime codegen you can get the same optimization benefits at runtime |
02:58:51 | Demos | renesac, yeah, that was my point |
02:59:15 | renesac | so in an eval binary, we could not do any dead code elimination |
02:59:25 | ehaliewicz | renesac: true |
02:59:48 | Demos | ehaliewicz, you really do NOT want the same optimizations at runtime as at compile time. You have way less information, it is way harder to prove optimizations valid, and you have less time in which to do the optimizations |
02:59:55 | ehaliewicz | eval complicates things, but it's useful at times |
03:00:07 | renesac | ehaliewicz: this sounds like writing a JIT |
03:00:13 | ehaliewicz | yes, basically a jit |
03:00:14 | Demos | well we have nimrod i |
03:00:21 | Demos | perhaps that will someday be exposed as a library |
03:00:35 | renesac | I don't think eval is the right way to do a JIT |
03:00:38 | Demos | but like I said, expect binary explosions |
03:01:06 | ehaliewicz | Demos: i was thinking like at a repl |
03:01:07 | Demos | I think he wants a interpreter (maybe with JIT) so you could do stuff like scripts |
03:01:11 | ehaliewicz | compile the lisp form as it comes in |
03:01:14 | Demos | ehaliewicz, we have a rpel |
03:01:16 | Demos | nimrod i |
03:01:17 | ehaliewicz | and then just run the nimrod code |
03:01:20 | ehaliewicz | ok |
03:01:21 | Demos | it segfaults a lot |
03:01:24 | Demos | we are working on that |
03:01:30 | Demos | or rather Araq is |
03:01:34 | ehaliewicz | i'll check it out |
03:08:16 | * | noam quit (Read error: Connection reset by peer) |
03:10:44 | * | Icefoz left #nimrod (#nimrod) |
03:21:00 | Varriount | Demos: the repl doesn't segfault that much anymore |
03:21:10 | Demos | well if you enter wrong code... |
03:21:25 | Varriount | Demos, want some fun? |
03:21:37 | Varriount | Try understanding this page -> http://msdn.microsoft.com/en-us/library/ms741621(VS.85).aspx |
03:21:39 | Demos | a lot of macro stuff also crashes the compiler or causes strange errors.... we are a pre 1.0 language. |
03:21:52 | Demos | you linked me that yesterday |
03:22:33 | Demos | that is actually a pretty good MSDN page, lots of info on each param. Not much on their interaction though |
03:23:00 | Demos | also I found a "binding of isaac" serial key on my EFI partition... |
03:23:04 | Varriount | Or where to get the opcodes |
03:23:05 | Demos | could be an omen |
03:24:39 | Demos | there is probably a good in depth book on windows sockets |
03:25:56 | Demos | and yeah, I know... not helpful |
03:30:29 | * | noam joined #nimrod |
03:30:59 | * | nueva joined #nimrod |
03:37:32 | * | aftershave joined #nimrod |
03:42:16 | * | nueva quit (Quit: Bye) |
03:46:44 | * | DAddYE joined #nimrod |
04:15:27 | * | aftershave quit (Quit: Computer has gone to sleep.) |
05:18:11 | * | Mordecai joined #nimrod |
05:20:02 | * | psquid quit (Ping timeout: 264 seconds) |
05:26:17 | * | bbodi joined #nimrod |
05:26:39 | * | aftershave joined #nimrod |
05:26:57 | * | aftershave quit (Client Quit) |
05:29:38 | * | xenagi quit (Quit: Leaving) |
05:30:09 | * | xtagon quit (Ping timeout: 252 seconds) |
06:05:57 | * | ddl_smurf joined #nimrod |
06:20:44 | * | DAddYE quit (Remote host closed the connection) |
06:21:12 | * | DAddYE joined #nimrod |
06:25:57 | * | DAddYE quit (Ping timeout: 272 seconds) |
06:35:59 | * | DAddYE joined #nimrod |
06:42:59 | * | bbodi quit (Ping timeout: 240 seconds) |
06:43:33 | * | Demos quit (Read error: Connection reset by peer) |
07:29:00 | * | XAMPP quit (Quit: Drink all the Booze; Hack all the Things; Kill all the Humans;) |
07:29:35 | reactormonk | btw, this is leaking memory http://sprunge.us/KDOZ - very slowly. @ 300M after a week |
07:42:47 | * | zahary joined #nimrod |
07:43:33 | * | DAddYE quit (Remote host closed the connection) |
07:44:00 | * | DAddYE joined #nimrod |
07:48:29 | * | DAddYE quit (Ping timeout: 240 seconds) |
07:48:43 | * | bbodi joined #nimrod |
08:01:04 | * | DAddYE joined #nimrod |
08:18:40 | * | fowl quit (Read error: Operation timed out) |
08:24:10 | * | fowl joined #nimrod |
08:50:38 | * | zahary quit (Quit: Leaving.) |
08:58:13 | * | Varriount|Mobile quit (Remote host closed the connection) |
08:58:26 | * | Varriount|Mobile joined #nimrod |
09:05:08 | * | frankbutt joined #nimrod |
09:05:11 | * | frankbutt left #nimrod (#nimrod) |
09:38:39 | * | Boscop joined #nimrod |
09:45:17 | * | DAddYE quit (Remote host closed the connection) |
09:45:44 | * | DAddYE joined #nimrod |
09:50:53 | * | DAddYE quit (Ping timeout: 272 seconds) |
09:56:48 | * | ehaliewicz quit (Remote host closed the connection) |
10:03:36 | * | DAddYE joined #nimrod |
10:07:59 | * | DAddYE quit (Ping timeout: 240 seconds) |
11:01:27 | * | io2 joined #nimrod |
11:04:07 | * | DAddYE joined #nimrod |
11:07:30 | * | DAddYE quit (Remote host closed the connection) |
11:07:56 | * | DAddYE joined #nimrod |
11:12:35 | * | DAddYE quit (Ping timeout: 272 seconds) |
11:18:49 | * | athaudia quit (Read error: Connection reset by peer) |
11:23:41 | * | athaudia joined #nimrod |
11:38:45 | * | io2 quit (Ping timeout: 252 seconds) |
12:03:02 | * | Mordecai is now known as psquid |
12:08:37 | * | DAddYE joined #nimrod |
12:12:21 | * | aruniiird joined #nimrod |
12:15:17 | * | DAddYE quit (Ping timeout: 272 seconds) |
12:17:26 | * | Varriount|Mobile quit (Remote host closed the connection) |
12:29:48 | * | aruniiird quit (Ping timeout: 252 seconds) |
12:31:01 | * | nueva joined #nimrod |
12:33:36 | nueva | compiler user guide shows how to wrap c++ object allocated on heap and how to call its methods, but doesn't show how to destroy it (how to call delete)? is there such example anywhere? |
12:48:12 | * | BitPuffin joined #nimrod |
12:48:19 | * | io2 joined #nimrod |
13:03:32 | Araq | nueva: pong |
13:04:11 | Araq | when you allocate on the stack, c++ calls the destructor of course |
13:06:24 | Araq | otherwise try something like proc destructFoo(foo: ptr Foo) {,importc: "Foo::~Foo", nodecl.} |
13:12:04 | * | DAddYE joined #nimrod |
13:12:37 | * | io2 quit (Ping timeout: 248 seconds) |
13:18:17 | * | Mordecai joined #nimrod |
13:18:32 | renesac | Araq: I was looking at the parser again, and the only change to the grammar would be that ( '`'|IDENT|literal|'cast') would be consumed immediately, right? |
13:18:37 | * | DAddYE quit (Ping timeout: 272 seconds) |
13:18:53 | BitPuffin | Araq: what's wrong with parsing with regexes btw |
13:19:13 | renesac | so, if we get rid of the while loop, how the first calling function gets it's other arguments? |
13:19:43 | * | psquid quit (Ping timeout: 260 seconds) |
13:19:51 | * | renesac still doesn't understand how nimrod parsetree is constructed. |
13:20:29 | * | Mordecai is now known as psquid |
13:31:26 | * | [1]Endy joined #nimrod |
13:37:59 | * | athaudia quit (Read error: Connection reset by peer) |
13:42:27 | * | athaudia joined #nimrod |
13:42:31 | * | iNode000 joined #nimrod |
13:47:11 | * | io2 joined #nimrod |
13:51:28 | * | PortableEXetoC joined #nimrod |
13:53:00 | * | darkf quit (Quit: Leaving) |
13:58:47 | * | PortableEXetoC quit (Quit: cake) |
13:59:39 | Araq | BitPuffin: parsing with regexes simply doesnt work unless you use a tool built for it like flex |
14:00:46 | BitPuffin | Araq: I see |
14:00:54 | BitPuffin | Araq: so if you have flex, is it still misguided? |
14:07:09 | bbodi | Araq: Hi! |
14:07:42 | bbodi | Araq: I have a question. Can we use multi methods with generic types? |
14:07:54 | bbodi | like that: method handleEvent*[T](self: PComboBox[T], event: PEvent) = |
14:08:08 | bbodi | * types with generic parameter |
14:09:07 | Araq | bbodi: kind of ... |
14:09:36 | Araq | BitPuffin: yes but for different reasons ;-) |
14:09:42 | BitPuffin | Araq: haha :) |
14:09:45 | BitPuffin | performance? |
14:10:54 | Araq | BitPuffin: no it generates horrible code and the produced lexers are only re-entrant when you use c++ generation |
14:11:14 | Araq | at least thats how it used to be |
14:11:27 | Araq | re2c is much better anyway |
14:11:41 | Araq | so dont bother with flex |
14:12:47 | bbodi | Araq: I tried it but unfortunately always the ancestor's method was called instead of the one I defined above |
14:13:42 | Araq | bbodi: there is a big semantical issue with them that I dont remember ... |
14:14:21 | Araq | what you encountered could also simply be a bug or a misuse :P |
14:15:26 | Araq | bbodi: try it with 0.9.2 please |
14:15:38 | Araq | and see if it makes a difference |
14:15:41 | bbodi | I will try it, thanks! |
14:15:57 | * | DAddYE joined #nimrod |
14:20:42 | nueva | Araq: thanks. destructFoo will destroy object, but I think it will not mark allocated memory as free (contrary to 'delete' usage). I'm not sure, though, I'm not proficient in C++. do you think I'm possibly right? |
14:22:26 | * | DAddYE quit (Ping timeout: 264 seconds) |
14:23:58 | Araq | nueva: wrap it as importc: "delete" then |
14:26:20 | renesac | Araq, did you see my question? |
14:26:44 | renesac | *saw |
14:27:32 | Araq | renesac: the first func hopefully gets its args via the command *statement* rule |
14:27:39 | Araq | ut I could be wrong |
14:27:42 | Araq | *but |
14:28:18 | renesac | " primarySuffix = '(' (exprColonEqExpr comma?)* ')' doBlocks? " <-- this seems from where the arguments come |
14:28:35 | renesac | but I also don't understand |
14:28:50 | renesac | *I didn't fully understand the grammar |
14:34:49 | Araq | that's foo(bar, baz) |
14:34:54 | renesac | "exprStmt" from "parseExprStmt()" you mean? |
14:35:03 | Araq | not foo bar, baz |
14:35:35 | Araq | hi iNode000 welcome |
14:35:40 | renesac | right, so foo bar, baz already worked before the command syntax |
14:38:35 | Araq | right |
14:39:25 | renesac | I still don't know what I should do with the comma and possible doBlock or macroColon |
14:39:37 | renesac | ignore them and let other part of the parser deal with it? |
14:40:01 | renesac | so the new rule becomes only | ( '`'|IDENT|literal|'cast') expr |
14:40:02 | renesac | ? |
14:40:25 | renesac | that seems wrong... |
14:40:46 | Araq | just leave doblock and macrocolon as they are |
14:41:45 | renesac | ok, so just delete lines 675 and 678 |
14:42:23 | renesac | leaving the rest as is (changing the 'let a' to 'let b' to avoid name clash)? |
14:43:38 | Araq | yeah |
14:44:11 | renesac | and then the rule becomes.. "| ( '`'|IDENT|literal|'cast') expr (","|doBlock | macroColon)? |
14:44:13 | EXetoC | will pretty.nim be backed by a re-usable API one day? so as to provide common functionality for other source code rewriters |
14:44:23 | renesac | though we don't deal with the "," possibility |
14:44:43 | Araq | the rule looks wrong |
14:44:53 | renesac | yeah |
14:44:55 | Araq | but you need to test anyway |
14:45:39 | Araq | EXetoC: the whole compiler will get a better api |
14:45:58 | renesac | the "getTok(p)" after the now deleted comma test will get one of those three tokens.. |
14:46:02 | EXetoC | ok |
14:48:49 | nueva | Araq: btw, for constructing of wrapped C++ object on stack should I explicitly define constructor proc or it works with object construction syntax somehow? if constructor proc is unavoidable (I'm not saying it's bad), then what naming convention is recommended? is it using of 'init' prefix (proc initWrappedType)? |
14:48:55 | EXetoC | I'll just use pretty.nim as a reference. I want to modify all calls to xmlCheckedTag. |
14:51:31 | renesac | hum, compiler compilation failed in the second iteration |
14:52:11 | renesac | lib/system/cgprocs.nim(24, 47) Error: invalid pragma: compilerRtl |
14:52:33 | renesac | possibly because the modification in parser.nim I did |
14:53:02 | renesac | yep |
14:55:58 | renesac | I don't know how to make this machine continue working after chopping some pieces :P |
15:19:40 | * | DAddYE joined #nimrod |
15:24:39 | * | DAddYE quit (Ping timeout: 272 seconds) |
15:27:59 | nueva | Araq: importc: "delete" works, thanks. |
15:28:39 | EXetoC | what are you interfacing with? |
15:35:23 | * | Varriount|Mobile joined #nimrod |
15:40:15 | * | aftershave joined #nimrod |
15:54:39 | * | BitPuffin quit (Ping timeout: 260 seconds) |
15:57:55 | nueva | can I tell GC to manage my allocated-on-heap C++ object (maybe by encapulating it in another Nimrod object)? {.destructor.} is working for scope-bounded value, but is there kind of {.destructor.} that is working by counting number of references? |
16:02:16 | Varriount|Mobile | nueva : I think there are finalizers, as well as destructors |
16:02:32 | Varriount|Mobile | I can't remember the specifics though |
16:04:15 | EXetoC | can pegs.findAll alone turn "a b c" into ["a", "b", "c"], or is ["a", " b", " c"] the closest you can get with \skip? |
16:06:18 | nueva | i read about finalizers in some forum message, where AFAIR dom96 said they are deprecated in favor of destructor. 'finalizer' couldn't be found in manual. but I'll look in sources then, thanks. |
16:08:23 | EXetoC | nevermind. split, obviously |
16:11:46 | EXetoC | nueva: All I know is that the manual claims that support will be improved in the future |
16:12:34 | nueva | ok, looks like it's 'proc new*[T](a: var ref T, finalizer: proc (x: ref T)' and I've should been searched in system library docs. I guess it's well suited for my needs. |
16:14:07 | EXetoC | yeah, just switch to something else later if necessary |
16:21:39 | * | DAddYE joined #nimrod |
16:25:58 | * | DAddYE quit (Ping timeout: 245 seconds) |
16:32:24 | * | Mat3 joined #nimrod |
16:32:28 | Mat3 | hi all |
16:38:14 | Discoloda | howdy |
16:38:29 | Mat3 | hi Dicoloda |
16:42:12 | dom96 | hello |
16:42:44 | Mat3 | ho dom96 |
16:43:22 | renesac | trying to fix the command syntax, I either get "lib/system/cgprocs.nim(24, 47) Error: invalid pragma: compilerRtl" or "lib/system.nim(946, 26) Error: invalid indentation" |
16:43:39 | Mat3 | hi renesac |
16:43:48 | * | renesac messing around with parser.nim |
16:43:51 | renesac | hi |
16:44:57 | * | BitPuffin joined #nimrod |
16:48:15 | Mat3 | I've found a simple way for parsing intentation: series of white-spaces are counted and handled as tokens (of different size). Each token-size is pushed on an internal stack so the intention level equals the stack content. |
16:49:21 | renesac | how that compares with how nimrod does it? |
16:49:42 | * | renesac is now known as renesac|away |
16:54:30 | Mat3 | the described method is more complex |
16:54:43 | Mat3 | (I mean the one in the Nimrod docs) |
16:59:47 | Araq | Mat3: what is the difference? |
17:00:00 | Araq | sounds exactly like nim does it |
17:09:41 | Mat3 | The nimrod parser uses no stack |
17:15:34 | Mat3 | (I think) |
17:17:32 | Araq | well it used to ... ;-) |
17:17:53 | Araq | it is better to use the implicit call stack though |
17:18:25 | Araq | since the parser needs to implement the indentation rules anyway |
17:18:34 | nueva | Araq: is there a way to reqrite someProc(v, p1, p2) into someProc(v.someField, p1, p2) automatically, where 'p1, p2' could be zero or more parameters. can term rewritng handle this? |
17:18:44 | nueva | *to rewrite |
17:21:02 | Araq | I don't think so |
17:21:09 | nueva | basically I want to use object reference created with new(v, finalizerProc) and automatically delegate all proc calls to object field. |
17:21:12 | Araq | sounds like you want a converter |
17:22:05 | nueva | so that I can pass management of C++ object pointer to Nimrod GC |
17:22:31 | Araq | try a constuctor for delegation |
17:22:38 | Araq | *converter |
17:22:46 | nueva | ok, I'll try, thanks |
17:23:52 | * | DAddYE joined #nimrod |
17:25:30 | Araq | dom96: please fix doc2 for the logging module |
17:29:05 | dom96 | Araq: How? |
17:29:25 | * | DAddYE quit (Ping timeout: 272 seconds) |
17:30:05 | Araq | annotate raises and tags explicitly |
17:31:21 | dom96 | Araq: oh. The compiler can't figure it out on methods I guess? |
17:31:26 | * | athaudia quit (Ping timeout: 264 seconds) |
17:31:28 | Araq | yes |
17:35:37 | renesac|away | Araq, I think that |
17:35:42 | * | renesac|away is now known as renesac |
17:35:56 | renesac | primarySuffix needs to stop parsing before parsing the end of line |
17:36:09 | renesac | that is why I'm getting invalid identation error |
17:36:38 | renesac | but I don't know how to enforce that, only parse the next token if it can be a parameter for the command |
17:38:22 | Mat3 | Araq: So the Nimrod parser uses an internal stack ? |
17:40:07 | renesac | it gives invalid identation to 'echo "[SYSASSERT] ", msg' |
17:42:03 | Araq | Mat3: yeah and I think it is also documented how it works in detail |
17:43:01 | Araq | renesac: I don't think thats necessary |
17:43:39 | Mat3 | Araq: Ok, my fault, sorry |
17:43:47 | renesac | well, I don't know why it is failing then... |
17:55:02 | Araq | renesac: I might take a loo later |
17:55:05 | Araq | *look |
17:55:13 | renesac | ok |
17:55:45 | Araq | Mat3: the indentation based parsing went through 3 iterations ;-) |
17:56:07 | Araq | there is still a chance you find a better way, ofc |
17:56:38 | * | zahary joined #nimrod |
17:58:47 | Mat3 | hi zahary |
17:59:35 | zahary | hi Mat3 |
18:05:18 | * | brson joined #nimrod |
18:05:56 | renesac | cpuClock() can lose the micro-second precision in less than 9 seconds in a system where float defaults to float32... |
18:06:39 | renesac | but on the other hand, if the default isn't float64, float64 division will probably be very slow |
18:07:22 | renesac | it's a tricky choice |
18:08:51 | Mat3 | solution: Glided fixed-point arithmetic |
18:09:51 | Mat3 | alias fixed-point with dynamic scaling |
18:10:47 | renesac | lib/system/timers.nim seems to have higher precision functions to get time |
18:11:06 | renesac | I wonder why it isn't in lib/pure/times.nim |
18:15:44 | Discoloda | is there a way to at compile time read and embed a directory into the application? |
18:16:18 | Araq | Discoloda: yes |
18:16:54 | Araq | produce a .nim file and staticExec compile and run it |
18:17:08 | Araq | best solution for now |
18:18:47 | Araq | renesac: I cant expose everything and it all costs in terms of maintaince |
18:19:02 | Discoloda | ill take a look, thanks |
18:19:15 | Araq | also people will complain about the interface ... |
18:19:29 | renesac | hum |
18:19:34 | renesac | true... |
18:21:04 | * | DAddYE joined #nimrod |
18:31:17 | * | BitPuffin quit (Quit: WeeChat 0.4.2) |
18:45:25 | Mat3 | hi DAddYE |
18:50:56 | Mat3 | ciao |
18:51:13 | * | Mat3 quit (Quit: Verlassend) |
18:54:04 | * | zahary quit (Quit: Leaving.) |
18:57:36 | * | athaudia joined #nimrod |
19:04:57 | * | brson quit (Ping timeout: 272 seconds) |
19:12:42 | * | aftersha_ joined #nimrod |
19:24:24 | * | aftershave quit (Quit: Computer has gone to sleep.) |
19:37:18 | * | zahary joined #nimrod |
19:38:26 | * | brihat joined #nimrod |
19:39:06 | Araq | hi brihat wb |
19:39:46 | brihat | hi guys, m back from vacation.. |
19:41:11 | Araq | zahary: you need to review filwit's PR (about typedesc) |
19:45:56 | zahary | I know, but I'm also on a ski vacation and I have limited time |
19:50:08 | Araq | pfff vacation |
19:50:18 | * | Araq never has vacation |
19:52:09 | nueva | 'nimrod --cc:gcc --passL:<some option> compileToCpp ex.nim' loses linker options because of one of setCC calls. I have a workaround, so it's a minor issue for me. |
19:54:27 | Araq | nueva: please fix it |
20:01:47 | nueva | Araq: if you'll accept patch from pastebin or will pull my commit from non-GitHub git hosting, I'll try to do it. it's a minor issue, so I can live with it while trying to stay away from GH as much as possible (for personal reasons) |
20:03:47 | Araq | pastebin is fine with me |
20:05:57 | nueva | Araq: well, then here is a patch for current devel HEAD to fix case errors when booting compiler with -d:useFFI and some other rare -d's http://pastebin.com/zCfcNJxe |
20:07:37 | Araq | nueva: alright thanks |
20:10:32 | * | xtagon joined #nimrod |
20:15:58 | * | tdc joined #nimrod |
20:29:39 | * | Varriount|Mobile quit (Remote host closed the connection) |
20:29:53 | * | Varriount|Mobile joined #nimrod |
20:39:13 | reactormonk | Varriount, still in for it? Haven't managed yet :-/ |
20:48:42 | Araq | renesac: in parseExprStmt |
20:48:51 | Discoloda | http://goo.gl/0I70ig |
20:48:55 | Araq | inc p.inPragma |
20:48:57 | Araq | var a = simpleExpr(p) |
20:48:58 | Araq | dec p.inPragma |
20:49:06 | Araq | makes it work ;-) |
20:49:09 | renesac | oh |
20:49:31 | renesac | so the version that gives the pragma error is likely the correct? |
20:49:32 | renesac | :P |
20:50:15 | renesac | you can explain why you need that? |
20:50:35 | renesac | I haven't seen that in other similar places |
20:52:42 | renesac | and do it makes sense to process macroColon on this stage? |
20:53:34 | Araq | hmm I guess it doesn't |
20:53:40 | renesac | because the parseExprStmt() can also do this |
20:54:10 | Araq | that's why I added it but you're correct |
20:54:36 | renesac | so the final grammar would be: | ( '`'|IDENT|literal|'cast') expr doBlocs? # command syntax |
20:54:37 | * | Varriount-Mobile joined #nimrod |
20:54:37 | renesac | ? |
20:54:47 | renesac | or (expr)? |
20:54:52 | renesac | ? |
20:54:59 | Araq | without doblocks too then |
20:55:42 | renesac | cant some function be called echo a.map do ... ? |
20:56:17 | Araq | the do should refer to the echo then for consistency i think |
20:56:23 | renesac | hum |
20:56:27 | renesac | ok |
20:56:51 | renesac | and should I add this check: if p.tok.tokType != tkComma and p.tok.tokType != tkEof: |
20:56:54 | renesac | in the place of the while? |
20:56:55 | * | Varriount-Mobile quit (Client Quit) |
20:57:08 | renesac | or parsing a comma isn't a problem? |
20:57:17 | Araq | no, why? |
20:57:35 | Araq | a, b is no expression |
20:57:50 | Araq | so parseexpr doesnt consume ',' |
20:57:59 | renesac | oh, ok |
20:58:03 | renesac | I had doubts in this |
20:58:17 | * | Varriount|Mobile quit (Ping timeout: 252 seconds) |
20:58:24 | renesac | brb |
21:09:49 | * | shodan45 joined #nimrod |
21:10:16 | * | vbtt joined #nimrod |
21:14:09 | * | [1]Endy quit (Ping timeout: 272 seconds) |
21:17:33 | vbtt | ello |
21:19:41 | * | tdc quit (Quit: Leaving) |
21:19:50 | Discoloda | im getting this on 'devel' "lib/pure/collections/critbits.nim(23, 8) Error: internal error: genTraverseProc()" , im not sure what is causing it on that line " when T isnot void:" |
21:25:52 | Varriount | Discoloda: I think It's a regression with generic types and 'void' |
21:32:51 | renesac | Araq, this line breaks my version: ' putWithSpace g, tkSymbol, if n.kind == nkState: "state" else: "goto" ' |
21:33:03 | * | nueva quit (Ping timeout: 245 seconds) |
21:33:05 | renesac | Error: expression expected, but found 'keyword if' |
21:34:14 | renesac | nevermind, I put simpleExpr() in the wrong place and forgot to take it out |
21:34:58 | renesac | I think I finally had SUCESS! (well, mostly guided by Araq's hand) |
21:35:07 | renesac | *SUCCESS |
21:36:32 | renesac | yep, it works |
21:47:15 | * | nueva joined #nimrod |
21:56:48 | * | ics quit (Quit: Textual IRC Client: www.textualapp.com) |
22:06:09 | nueva | can I catch exception of imported C++ type with Nimrod's try:except: block? |
22:14:07 | * | Demos joined #nimrod |
22:18:22 | * | aftersha_ quit (Quit: Computer has gone to sleep.) |
22:23:22 | Araq | nueva: that might be possible for the c++ target |
22:23:42 | Araq | we use c++ exception mechanism for that |
22:24:06 | Araq | you need to look at the generated code |
22:24:31 | renesac | Araq, I want to put this somehow as a test for the new command syntax: https://gist.github.com/ReneSac/a638e1f9d3da866e1f55 |
22:25:20 | Araq | renesac: add it to tests/parser and see how to spec the output properly |
22:28:54 | renesac | should I merge with tcommand_as_expr.nim ? |
22:29:10 | Araq | yeah |
22:29:18 | renesac | ok |
22:29:30 | Araq | we are optimizing the test suite too :-) |
22:29:46 | Araq | so that it doesnt run forever |
22:30:00 | renesac | hum |
22:30:10 | renesac | how do I run the tests? |
22:30:34 | renesac | and will it take less than 1 hour? |
22:30:38 | renesac | :P |
22:31:04 | Araq | koch tests cat parser |
22:31:21 | Araq | koch tests --print html |
22:31:46 | Araq | it takes half an hour at most |
22:33:03 | * | ddl_smurf quit (Quit: ddl_smurf) |
22:37:35 | nueva | Araq: I looked at generated code, also tried to use 'except ImportedCppType:' but it still generates 'try {/**/} catch (NimException& TMP5) {/**/}'. I'll try to look into code generator source to find definite answer. |
22:40:12 | renesac | :/, I'm having problem with the tcommand_as_expr.nim test, my version don't accept the comment between two arguments of the main function.. |
22:41:25 | * | brson joined #nimrod |
22:42:16 | renesac | it accepts a new line, but not a comment |
22:42:40 | renesac | oops, not even that |
22:44:21 | renesac | sometimes... |
22:45:44 | Araq | nueva: yeah fix the codegen please |
22:47:13 | renesac | oh, that is not the problem |
22:49:38 | Discoloda | what is "() must have an object or tuple type" |
22:50:55 | Araq | Discoloda: not sure what you mean |
22:54:23 | Discoloda | https://gist.github.com/8678353 |
22:55:25 | Discoloda | if i get rid of the militia line, it compiles |
22:58:17 | renesac | yeah, I've broken all command calls with more than one argument, except for echo |
22:58:19 | renesac | :P |
22:59:17 | renesac | and probably assert and other things like that too, as the compiler compiles |
23:00:02 | * | nueva quit (Quit: Bye) |
23:01:03 | Araq | Discoloda: stHero returns a ref |
23:01:19 | Araq | that is not a valid 'const' |
23:01:31 | Araq | so you have to use 'let' here |
23:02:05 | Discoloda | ah, okay. thanks |
23:03:07 | renesac | Araq, I'm stuck again... |
23:03:27 | Araq | why? |
23:03:39 | renesac | I've broken all command calls with more than one argument, except for echo |
23:04:02 | renesac | 'let x = foo 7, 8 ' don't works |
23:04:24 | renesac | "echo optarg 1, optarg 2, # prints 1240 |
23:04:24 | renesac | singlearg 2 " |
23:04:26 | renesac | works |
23:04:33 | Araq | yeah but same for me |
23:05:00 | renesac | any idea? |
23:07:15 | Araq | yes but i need to sleep now |
23:08:05 | renesac | well, I will not be around for the rest of this week |
23:08:28 | Araq | ok but please come back |
23:08:39 | renesac | np, I will |
23:08:48 | Araq | ok, good night |
23:08:52 | renesac | good night |
23:17:57 | * | io2 quit (Ping timeout: 248 seconds) |
23:43:38 | * | darkf joined #nimrod |
23:48:03 | * | zahary quit (Quit: Leaving.) |
23:55:57 | * | vbtt quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |