<< 28-01-2014 >>

00:00:05Araqvbtt: well dom96 is implementing the runtime aspects. all I do is to provide language features for it
00:00:32Araqso of course these overlap
00:00:37vbttah i sse.
00:00:39vbttsee.
00:01:18vbttAraq:you are familiar with how async services work, i assume?
00:01:51Araqnot really, I hate this sockets stuff with a passion
00:02:18Araqbut I guess I'm "familiar"
00:02:25vbtttypically 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:32vbttso that's an OR.
00:03:16vbttit processes the next one that is ready - could be a new filesystem block read or a new data on an existing connection.
00:03:32Araqyeah sure
00:03:56vbtthaving 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:01vbttand then inject it in my list.
00:04:12vbttso the entire list has a timeout because it will be ready at that time.
00:04:26vbttbasically i can compose 'pending requests' of different types.
00:04:39Araqyeah I know
00:04:42filwitAraq: PULL IT NOW!!
00:04:49filwitAraq: :-P
00:05:13vbttbasically i'm suggesting these operations:
00:05:19vbttr = async f()
00:05:35vbttfirst = wait_for_next([r1, r2, r3..])
00:05:47vbttall = wait_for_all([r1, r2, r3..])
00:05:54vbttthat's all i think.
00:06:55Araqyes but 'wait_for' essentially delegates its work to an OS builtin
00:07:03Araqand here things get hairy
00:07:20Araqas the OS doesn't know about our 'closure iterators'
00:09:05Araqthis means 'yield' needs to be compatible to the callback style, I think
00:09:52*darkf joined #nimrod
00:11:04Araqvbtt: 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:10Araqseems much better to reduce network traffic
00:12:11vbttAraq: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:27vbttoften it's fire 3 wait for 2. i.e. difference isn't that huge.
00:12:48Araqbut that increases network traffic and so the likelyhood of some server failing
00:12:52vbtt* you don't know which are the fastest 2 (and available) at any given moment)
00:13:22Araqso what, just randomize. you don't have only 1 request to serve, do you?
00:14:34vbttAraq: you need N replicas anyway. so you need that traffic.
00:14:51Araqok, fair enough then
00:15:01vbttanyway, there's a lot of ways of implementing fault tolerant, distributed storage. i'm just saying OR is a common pattern.
00:15:50vbttand 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:35vbttsend N requests; while response = next(): process(response) # ie generate html for this bit. once all are done - concatenate and return page.
00:17:12vbttIf I do them in any predefined order, I sacrifice latency.
00:17:28Araqyeah
00:21:44vbttAraq: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:55Araqdom96
00:21:59Araq's business
00:22:38vbttI'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:37filwitwoah, who added all the cool color syntax highlighting to Aporia? nice job
00:28:05Araqfilwit: that came for free with gtksourceview
00:28:38filwitoh no wait, i was running my own build witch modified color syntax, lol
00:28:48vbttanyway, OR should be implementable as a function, i think.
00:28:54Araqvbtt: I don't know how closure iterators interact with 'select' etc. either
00:29:37vbttAraq: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:05Araqvbtt: the stack is scanned conversatively by the GC
00:30:55Araqthe plan is to have an .async pragma that transforms the 'proc' to an iterator and 'await' to 'yield'
00:31:19nuevahow can I disable from command line automatic adding of babel packages paths to search paths?
00:31:35Araqyield newPromise(...)
00:31:49Araqbut the details are not fleshed out, vbtt
00:32:03vbttAraq:will that allow a stack of suspended functions?
00:32:28Araqnueva: there is a --noBabel switch iirc
00:32:48Araqyou can also not set babelpath in your config
00:33:22Araqvbtt: it allows a list of suspended functions, yes
00:33:38Araqbut the suspended function has a rather shallow stack
00:33:44renesacAraq: 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:03Araqrenesac: yes
00:34:18Araqit's precise except for the stack scanning
00:34:18renesacgood to know
00:34:49Araqyou won't find a GC'ed language more hostile to a GC than D btw
00:35:12Araqbut they still think it's some quality of implemenation issue
00:35:13vbttAraq: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:47nuevaAraq: 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:50renesacAraq: well, with sufficient engineering it may be solvable... it left that impression
00:36:27Araqrenesac: sure, perhaps. it's however an open research problem
00:36:36renesacright
00:36:47vbtt"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:18Araqvbtt: can be precise. but it's expensive to do so.
00:47:06Araqvbtt: "stack of 2" should be possible, but I need to try that :P
00:48:41vbttAraq:going back to previous discussion. now that paren-less single arg function call is possible, isn't r"string" obsolete?
00:48:54vbttwhy not: regex "a+b+c?"
00:49:27OrionPKew regex
00:49:28OrionPKdont use
00:49:35Araqgood question, but extended string literals also prohibit \ as an escape char
00:50:14Araqre"\bABC\b"
00:50:29Araqvs re "\\bABC\\b"
00:50:45vbttif that means different things, it will be tricky.
00:51:16vbttif re is a macro it gets the unescaped string?
00:51:39Araqagain, macro vs proc plays no role here
00:51:48Araqsyntax is decoupled :P
00:52:10Araqfoo"\n" # Nimrod never interprets the \
00:53:10vbtti see
00:54:16Araqit's pure beauty ;-)
00:55:15vbttwill re "xx" fail to compile?
00:55:26vbttor just happen to do the wrong thing?
00:55:39Araqwrong thing
00:56:10Araqthinking about it
00:56:26Araqyou can disallow that with overloading based on ASTs ...
00:56:45Araqbut that's a story for another time, need to sleep now
00:57:53vbttgood 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:28Demoswow 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:52Demosand they did not even close campus
02:14:40Demosoh they formed a committe to examine policies related to extreme weather. Jesus Christ
02:15:06VarriountDemos: :<
02:15:24VarriountAny particular reason I can't have a set of int's or int32's?
02:15:27Discolodahurray committies
02:15:45DemosI 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:37DemosVarriount, 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:52Demosrather the same on most modern platforms
02:16:59renesacif nimrod used hash tables for sets it would work
02:17:07Demosbut nimrod does not
02:17:10renesacat least for larger sets
02:17:13Demosif you want a hash table use a TTable
02:17:21VarriountDemos: Er, no
02:17:32Demosto which part
02:17:34VarriountTTable's are for when you need a table of growable keys
02:18:04renesacsets can also be growable
02:18:08renesacin nimrod
02:18:08VarriountThis would be better, I guess - http://nimrod-lang.org/intsets.html
02:18:26Varriountrenesac: Yes, but Araq has said they shouldn't be used that way.
02:20:04renesacDemos: I'm not sure if we have the same set of operations on hash tables as there is in sets
02:20:16renesac*in TTable
02:20:20Demosyeah tables are the wrong notion
02:20:28Demosbut you can construct a hashset data structure
02:20:37Demosor indeed a set structure based on a binary tree
02:20:43*ehaliewicz joined #nimrod
02:20:57Demos(like c++'s std::set and std::unordered_set, both of which are pretty slow
02:20:58Demos)
02:21:23renesacyeah, that is what I was thinking
02:21:32DemosTSet is probably the hash set and TOrderedSet is probably the tree set
02:21:36renesacwell, there is no reason for nimrod not supporting it in the future
02:21:39Demosin the sets module
02:21:55Demosexcept for the good reason that nimrod supports it today!
02:22:02renesacoh
02:22:05VarriountAlways keep in mind, Araq designed parts of nimrod to be fast.
02:22:17VarriountNot necessarily flexible.
02:23:03Demoswell 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:52Demosimplementing the set operators for TSet and TOrderedSet is something that can be done.
02:26:17renesacyeah
02:28:22DemosI bet nimrod's hashes are faster than C++'s
02:28:50Demoss/hashes/hashmaps and hashsets
02:28:51renesacI think the std library ones are based on chained hash tables
02:29:04renesacthat are fast only to see if something isn't on them
02:29:20Demosthe standard does not specify a particular implementation but the iterator invalidation rules essentially require seperate chaining
02:29:35renesacyep, and pointer chasing is slow
02:29:43Demoseven worse than that there are exception safety garentees that make it even worse
02:30:01renesachum
02:30:23Demosthere is an article that talks about how dinkumware implemented them, it is not quite just seperate chaining with linked lists
02:30:24renesacD also dig it's own grave in that
02:30:40Demosyeah, having a garbage collector is nice hm
02:30:45renesacgiving you acess to a pointer inside their hash table
02:30:53Demosoh damn
02:31:06Demosthat is wierd for pretty much anything besides an array
02:31:11renesaclocked them to a chained implementation too
02:31:36Demoswhat is the pointer expected to be? To the array of buckets or to an individual bucket
02:31:47renesacan individual bucket
02:31:51renesacitem
02:32:07renesacIIRC
02:32:18DemosI mean seperate chaining is not even that bad if you can do it with arrays instead of linked lists
02:33:28renesacThe InExpression yields a pointer to the value if the key is in the associative array, or null if not:
02:33:32renesachttp://dlang.org/hash-map.html
02:34:32renesacDemos: yeah, but you may have to realloc your array, and then the pointer will be invalidated
02:34:37DemosI 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:45Demosofc
02:35:16renesacwell, D also don't gives strong guarantees in this page
02:35:28renesacbut people code to the implementation, not the specification
02:35:53Demosbesides 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:59renesacand now there is a lot of code implicitly depending on durable pointers...
02:36:59Demosit 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:26Varriountrenesac: "Durable Pointers"?
02:37:54DemosVarriount, I suspect he means pointers to values that are unlikely to get invalidated unless the element is actually deleted
02:38:05renesacexactly
02:38:14renesacto inside their hashtable
02:38:24renesac(or associative array, as they call)
02:46:05ehaliewiczoh, nimrod compiles to C, no wonder it doesn't have any kind of real runtime code gen
02:46:08ehaliewiczthat's too bad
02:46:37renesacwhy you need runtime code gen?
02:47:06filwitcompile to C has a lot of benefits
02:47:14ehaliewiczof course
02:47:23filwitNimrod runs great on Android/iOS right now.. try that with D
02:47:34renesaceval is generally considered bad style and unsafe
02:47:42filwit(ps, i came from D)
02:47:57filwiteval is being depreciated
02:48:01filwitto my knowledge
02:48:29VarriountThe 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:47ehaliewiczrenesac: i don't need it, but it's nice in certain circumstances,
02:48:49renesacfilwit: we have eval?
02:48:51Varriountehaliewicz: Nimrod has runtime macro evaluation though.
02:48:58filwitrunesac: yep
02:49:03filwitthink it's in macros
02:49:28renesacVarriount: macros are evaluated at compile time, not?
02:49:36ehaliewiczi use it sparingly, but similar to how i use macros, just at runtime
02:49:42filwitrenesac: not macros, it's in system
02:50:08filwitanyways folks, i'm taking off, later
02:50:11*filwit quit (Quit: Leaving)
02:50:24renesac...
02:50:27renesacI can't find it
02:50:51*brson quit (Quit: leaving)
02:54:03Varriountrenesac: Yeah, sorry, messed up with word
02:54:40Varriountrenesac: Try looking in the repo documentation files, not the documentation on the site (that's not up to date)
02:55:05renesacI'm lookin on the buil.nimrod-lang.org/docs
02:55:39Demosin any case having any kind of eval functionality will totally destroy binary sizes
02:55:54Varriountrenesac: Those are a bit old too
02:55:59DemosI remember I had a runtime eval type deal in haskell and I got binaries of 80+MB!
02:56:30renesacwell, a lua interpreter can be very small
02:56:43renesacI wonder how much nimrod is more complex than lua
02:56:52renesacwell, the standard library is certainly bigger....
02:57:23renesacbut yeah, nimrod is all about compile time manipulation and runtime efficiency
02:57:31renesacand I like that
02:58:04Demoswell sure, but with the standard lib large parts of it get hit with dead code elim
02:58:05ehaliewiczrenesac: runtime evaluation can help runtime efficiency though, at the cost of size
02:58:35renesacDemos: not if you are going to eval a arbitrary piece of nimrod code
02:58:44ehaliewiczfor 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:51Demosrenesac, yeah, that was my point
02:59:15renesacso in an eval binary, we could not do any dead code elimination
02:59:25ehaliewiczrenesac: true
02:59:48Demosehaliewicz, 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:55ehaliewiczeval complicates things, but it's useful at times
03:00:07renesacehaliewicz: this sounds like writing a JIT
03:00:13ehaliewiczyes, basically a jit
03:00:14Demoswell we have nimrod i
03:00:21Demosperhaps that will someday be exposed as a library
03:00:35renesacI don't think eval is the right way to do a JIT
03:00:38Demosbut like I said, expect binary explosions
03:01:06ehaliewiczDemos: i was thinking like at a repl
03:01:07DemosI think he wants a interpreter (maybe with JIT) so you could do stuff like scripts
03:01:11ehaliewiczcompile the lisp form as it comes in
03:01:14Demosehaliewicz, we have a rpel
03:01:16Demosnimrod i
03:01:17ehaliewiczand then just run the nimrod code
03:01:20ehaliewiczok
03:01:21Demosit segfaults a lot
03:01:24Demoswe are working on that
03:01:30Demosor rather Araq is
03:01:34ehaliewiczi'll check it out
03:08:16*noam quit (Read error: Connection reset by peer)
03:10:44*Icefoz left #nimrod (#nimrod)
03:21:00VarriountDemos: the repl doesn't segfault that much anymore
03:21:10Demoswell if you enter wrong code...
03:21:25VarriountDemos, want some fun?
03:21:37VarriountTry understanding this page -> http://msdn.microsoft.com/en-us/library/ms741621(VS.85).aspx
03:21:39Demosa lot of macro stuff also crashes the compiler or causes strange errors.... we are a pre 1.0 language.
03:21:52Demosyou linked me that yesterday
03:22:33Demosthat is actually a pretty good MSDN page, lots of info on each param. Not much on their interaction though
03:23:00Demosalso I found a "binding of isaac" serial key on my EFI partition...
03:23:04VarriountOr where to get the opcodes
03:23:05Demoscould be an omen
03:24:39Demosthere is probably a good in depth book on windows sockets
03:25:56Demosand 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:35reactormonkbtw, 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:36nuevacompiler 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:32Araqnueva: pong
13:04:11Araqwhen you allocate on the stack, c++ calls the destructor of course
13:06:24Araqotherwise 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:32renesacAraq: 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:53BitPuffinAraq: what's wrong with parsing with regexes btw
13:19:13renesacso, 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:39AraqBitPuffin: parsing with regexes simply doesnt work unless you use a tool built for it like flex
14:00:46BitPuffinAraq: I see
14:00:54BitPuffinAraq: so if you have flex, is it still misguided?
14:07:09bbodiAraq: Hi!
14:07:42bbodiAraq: I have a question. Can we use multi methods with generic types?
14:07:54bbodilike that: method handleEvent*[T](self: PComboBox[T], event: PEvent) =
14:08:08bbodi* types with generic parameter
14:09:07Araqbbodi: kind of ...
14:09:36AraqBitPuffin: yes but for different reasons ;-)
14:09:42BitPuffinAraq: haha :)
14:09:45BitPuffinperformance?
14:10:54AraqBitPuffin: no it generates horrible code and the produced lexers are only re-entrant when you use c++ generation
14:11:14Araqat least thats how it used to be
14:11:27Araqre2c is much better anyway
14:11:41Araqso dont bother with flex
14:12:47bbodiAraq: I tried it but unfortunately always the ancestor's method was called instead of the one I defined above
14:13:42Araqbbodi: there is a big semantical issue with them that I dont remember ...
14:14:21Araqwhat you encountered could also simply be a bug or a misuse :P
14:15:26Araqbbodi: try it with 0.9.2 please
14:15:38Araqand see if it makes a difference
14:15:41bbodiI will try it, thanks!
14:15:57*DAddYE joined #nimrod
14:20:42nuevaAraq: 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:58Araqnueva: wrap it as importc: "delete" then
14:26:20renesacAraq, did you see my question?
14:26:44renesac*saw
14:27:32Araqrenesac: the first func hopefully gets its args via the command *statement* rule
14:27:39Araqut I could be wrong
14:27:42Araq*but
14:28:18renesac" primarySuffix = '(' (exprColonEqExpr comma?)* ')' doBlocks? " <-- this seems from where the arguments come
14:28:35renesacbut I also don't understand
14:28:50renesac*I didn't fully understand the grammar
14:34:49Araqthat's foo(bar, baz)
14:34:54renesac"exprStmt" from "parseExprStmt()" you mean?
14:35:03Araqnot foo bar, baz
14:35:35Araqhi iNode000 welcome
14:35:40renesacright, so foo bar, baz already worked before the command syntax
14:38:35Araqright
14:39:25renesacI still don't know what I should do with the comma and possible doBlock or macroColon
14:39:37renesacignore them and let other part of the parser deal with it?
14:40:01renesacso the new rule becomes only | ( '`'|IDENT|literal|'cast') expr
14:40:02renesac?
14:40:25renesacthat seems wrong...
14:40:46Araqjust leave doblock and macrocolon as they are
14:41:45renesacok, so just delete lines 675 and 678
14:42:23renesacleaving the rest as is (changing the 'let a' to 'let b' to avoid name clash)?
14:43:38Araqyeah
14:44:11renesacand then the rule becomes.. "| ( '`'|IDENT|literal|'cast') expr (","|doBlock | macroColon)?
14:44:13EXetoCwill pretty.nim be backed by a re-usable API one day? so as to provide common functionality for other source code rewriters
14:44:23renesacthough we don't deal with the "," possibility
14:44:43Araqthe rule looks wrong
14:44:53renesacyeah
14:44:55Araqbut you need to test anyway
14:45:39AraqEXetoC: the whole compiler will get a better api
14:45:58renesacthe "getTok(p)" after the now deleted comma test will get one of those three tokens..
14:46:02EXetoCok
14:48:49nuevaAraq: 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:55EXetoCI'll just use pretty.nim as a reference. I want to modify all calls to xmlCheckedTag.
14:51:31renesachum, compiler compilation failed in the second iteration
14:52:11renesaclib/system/cgprocs.nim(24, 47) Error: invalid pragma: compilerRtl
14:52:33renesacpossibly because the modification in parser.nim I did
14:53:02renesacyep
14:55:58renesacI 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:59nuevaAraq: importc: "delete" works, thanks.
15:28:39EXetoCwhat 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:55nuevacan 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:16Varriount|Mobilenueva : I think there are finalizers, as well as destructors
16:02:32Varriount|MobileI can't remember the specifics though
16:04:15EXetoCcan 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:18nuevai 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:23EXetoCnevermind. split, obviously
16:11:46EXetoCnueva: All I know is that the manual claims that support will be improved in the future
16:12:34nuevaok, 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:07EXetoCyeah, 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:28Mat3hi all
16:38:14Discolodahowdy
16:38:29Mat3hi Dicoloda
16:42:12dom96hello
16:42:44Mat3ho dom96
16:43:22renesactrying 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:39Mat3hi renesac
16:43:48*renesac messing around with parser.nim
16:43:51renesachi
16:44:57*BitPuffin joined #nimrod
16:48:15Mat3I'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:21renesachow that compares with how nimrod does it?
16:49:42*renesac is now known as renesac|away
16:54:30Mat3the described method is more complex
16:54:43Mat3(I mean the one in the Nimrod docs)
16:59:47AraqMat3: what is the difference?
17:00:00Araqsounds exactly like nim does it
17:09:41Mat3The nimrod parser uses no stack
17:15:34Mat3(I think)
17:17:32Araqwell it used to ... ;-)
17:17:53Araqit is better to use the implicit call stack though
17:18:25Araqsince the parser needs to implement the indentation rules anyway
17:18:34nuevaAraq: 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:44nueva*to rewrite
17:21:02AraqI don't think so
17:21:09nuevabasically I want to use object reference created with new(v, finalizerProc) and automatically delegate all proc calls to object field.
17:21:12Araqsounds like you want a converter
17:22:05nuevaso that I can pass management of C++ object pointer to Nimrod GC
17:22:31Araqtry a constuctor for delegation
17:22:38Araq*converter
17:22:46nuevaok, I'll try, thanks
17:23:52*DAddYE joined #nimrod
17:25:30Araqdom96: please fix doc2 for the logging module
17:29:05dom96Araq: How?
17:29:25*DAddYE quit (Ping timeout: 272 seconds)
17:30:05Araqannotate raises and tags explicitly
17:31:21dom96Araq: oh. The compiler can't figure it out on methods I guess?
17:31:26*athaudia quit (Ping timeout: 264 seconds)
17:31:28Araqyes
17:35:37renesac|awayAraq, I think that
17:35:42*renesac|away is now known as renesac
17:35:56renesacprimarySuffix needs to stop parsing before parsing the end of line
17:36:09renesacthat is why I'm getting invalid identation error
17:36:38renesacbut I don't know how to enforce that, only parse the next token if it can be a parameter for the command
17:38:22Mat3Araq: So the Nimrod parser uses an internal stack ?
17:40:07renesacit gives invalid identation to 'echo "[SYSASSERT] ", msg'
17:42:03AraqMat3: yeah and I think it is also documented how it works in detail
17:43:01Araqrenesac: I don't think thats necessary
17:43:39Mat3Araq: Ok, my fault, sorry
17:43:47renesacwell, I don't know why it is failing then...
17:55:02Araqrenesac: I might take a loo later
17:55:05Araq*look
17:55:13renesacok
17:55:45AraqMat3: the indentation based parsing went through 3 iterations ;-)
17:56:07Araqthere is still a chance you find a better way, ofc
17:56:38*zahary joined #nimrod
17:58:47Mat3hi zahary
17:59:35zaharyhi Mat3
18:05:18*brson joined #nimrod
18:05:56renesaccpuClock() can lose the micro-second precision in less than 9 seconds in a system where float defaults to float32...
18:06:39renesacbut on the other hand, if the default isn't float64, float64 division will probably be very slow
18:07:22renesacit's a tricky choice
18:08:51Mat3solution: Glided fixed-point arithmetic
18:09:51Mat3alias fixed-point with dynamic scaling
18:10:47renesaclib/system/timers.nim seems to have higher precision functions to get time
18:11:06renesacI wonder why it isn't in lib/pure/times.nim
18:15:44Discolodais there a way to at compile time read and embed a directory into the application?
18:16:18AraqDiscoloda: yes
18:16:54Araqproduce a .nim file and staticExec compile and run it
18:17:08Araqbest solution for now
18:18:47Araqrenesac: I cant expose everything and it all costs in terms of maintaince
18:19:02Discolodaill take a look, thanks
18:19:15Araqalso people will complain about the interface ...
18:19:29renesachum
18:19:34renesactrue...
18:21:04*DAddYE joined #nimrod
18:31:17*BitPuffin quit (Quit: WeeChat 0.4.2)
18:45:25Mat3hi DAddYE
18:50:56Mat3ciao
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:06Araqhi brihat wb
19:39:46brihathi guys, m back from vacation..
19:41:11Araqzahary: you need to review filwit's PR (about typedesc)
19:45:56zaharyI know, but I'm also on a ski vacation and I have limited time
19:50:08Araqpfff vacation
19:50:18*Araq never has vacation
19:52:09nueva'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:27Araqnueva: please fix it
20:01:47nuevaAraq: 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:47Araqpastebin is fine with me
20:05:57nuevaAraq: 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:37Araqnueva: 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:13reactormonkVarriount, still in for it? Haven't managed yet :-/
20:48:42Araqrenesac: in parseExprStmt
20:48:51Discolodahttp://goo.gl/0I70ig
20:48:55Araq inc p.inPragma
20:48:57Araq var a = simpleExpr(p)
20:48:58Araq dec p.inPragma
20:49:06Araqmakes it work ;-)
20:49:09renesacoh
20:49:31renesacso the version that gives the pragma error is likely the correct?
20:49:32renesac:P
20:50:15renesacyou can explain why you need that?
20:50:35renesacI haven't seen that in other similar places
20:52:42renesacand do it makes sense to process macroColon on this stage?
20:53:34Araqhmm I guess it doesn't
20:53:40renesacbecause the parseExprStmt() can also do this
20:54:10Araqthat's why I added it but you're correct
20:54:36renesacso the final grammar would be: | ( '`'|IDENT|literal|'cast') expr doBlocs? # command syntax
20:54:37*Varriount-Mobile joined #nimrod
20:54:37renesac?
20:54:47renesacor (expr)?
20:54:52renesac?
20:54:59Araqwithout doblocks too then
20:55:42renesaccant some function be called echo a.map do ... ?
20:56:17Araqthe do should refer to the echo then for consistency i think
20:56:23renesachum
20:56:27renesacok
20:56:51renesacand should I add this check: if p.tok.tokType != tkComma and p.tok.tokType != tkEof:
20:56:54renesacin the place of the while?
20:56:55*Varriount-Mobile quit (Client Quit)
20:57:08renesacor parsing a comma isn't a problem?
20:57:17Araqno, why?
20:57:35Araqa, b is no expression
20:57:50Araqso parseexpr doesnt consume ','
20:57:59renesacoh, ok
20:58:03renesacI had doubts in this
20:58:17*Varriount|Mobile quit (Ping timeout: 252 seconds)
20:58:24renesacbrb
21:09:49*shodan45 joined #nimrod
21:10:16*vbtt joined #nimrod
21:14:09*[1]Endy quit (Ping timeout: 272 seconds)
21:17:33vbttello
21:19:41*tdc quit (Quit: Leaving)
21:19:50Discolodaim 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:52VarriountDiscoloda: I think It's a regression with generic types and 'void'
21:32:51renesacAraq, 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:05renesacError: expression expected, but found 'keyword if'
21:34:14renesacnevermind, I put simpleExpr() in the wrong place and forgot to take it out
21:34:58renesacI think I finally had SUCESS! (well, mostly guided by Araq's hand)
21:35:07renesac*SUCCESS
21:36:32renesacyep, it works
21:47:15*nueva joined #nimrod
21:56:48*ics quit (Quit: Textual IRC Client: www.textualapp.com)
22:06:09nuevacan 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:22Araqnueva: that might be possible for the c++ target
22:23:42Araqwe use c++ exception mechanism for that
22:24:06Araqyou need to look at the generated code
22:24:31renesacAraq, I want to put this somehow as a test for the new command syntax: https://gist.github.com/ReneSac/a638e1f9d3da866e1f55
22:25:20Araqrenesac: add it to tests/parser and see how to spec the output properly
22:28:54renesacshould I merge with tcommand_as_expr.nim ?
22:29:10Araqyeah
22:29:18renesacok
22:29:30Araqwe are optimizing the test suite too :-)
22:29:46Araqso that it doesnt run forever
22:30:00renesachum
22:30:10renesachow do I run the tests?
22:30:34renesacand will it take less than 1 hour?
22:30:38renesac:P
22:31:04Araqkoch tests cat parser
22:31:21Araqkoch tests --print html
22:31:46Araqit takes half an hour at most
22:33:03*ddl_smurf quit (Quit: ddl_smurf)
22:37:35nuevaAraq: 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:12renesac:/, 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:16renesacit accepts a new line, but not a comment
22:42:40renesacoops, not even that
22:44:21renesacsometimes...
22:45:44Araqnueva: yeah fix the codegen please
22:47:13renesacoh, that is not the problem
22:49:38Discolodawhat is "() must have an object or tuple type"
22:50:55AraqDiscoloda: not sure what you mean
22:54:23Discolodahttps://gist.github.com/8678353
22:55:25Discolodaif i get rid of the militia line, it compiles
22:58:17renesacyeah, I've broken all command calls with more than one argument, except for echo
22:58:19renesac:P
22:59:17renesacand probably assert and other things like that too, as the compiler compiles
23:00:02*nueva quit (Quit: Bye)
23:01:03AraqDiscoloda: stHero returns a ref
23:01:19Araqthat is not a valid 'const'
23:01:31Araqso you have to use 'let' here
23:02:05Discolodaah, okay. thanks
23:03:07renesacAraq, I'm stuck again...
23:03:27Araqwhy?
23:03:39renesac I've broken all command calls with more than one argument, except for echo
23:04:02renesac'let x = foo 7, 8 ' don't works
23:04:24renesac"echo optarg 1, optarg 2, # prints 1240
23:04:24renesac singlearg 2 "
23:04:26renesacworks
23:04:33Araqyeah but same for me
23:05:00renesacany idea?
23:07:15Araqyes but i need to sleep now
23:08:05renesacwell, I will not be around for the rest of this week
23:08:28Araqok but please come back
23:08:39renesacnp, I will
23:08:48Araqok, good night
23:08:52renesacgood 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)