<< 27-04-2014 >>

00:44:12NimBotAraq/Nimrod devel 6550f96 Bódi Balázs [+1 ±0 -2]: fix #1065
00:44:12NimBotAraq/Nimrod devel 2da7ad8 Varriount [+1 ±0 -2]: Merge pull request #1139 from bbodi/devel... 2 more lines
01:17:06*Demos_ joined #nimrod
01:18:33Varriountdom96: How would you like the different concatenation behavior expressed?
01:19:17*xenagi quit (Quit: Leaving)
01:20:08*superfunc joined #nimrod
01:25:15Varriountdom96: Er, disregard that.
01:28:54*Demos_ quit (Read error: Connection reset by peer)
01:32:05NimBotAraq/Nimrod devel 61dfe9f Clay Sweetser [+2 ±0 -1]: Revert "Merge pull request #1139 from bbodi/devel"... 3 more lines
01:32:05NimBotAraq/Nimrod devel 936eaa6 Varriount [+2 ±0 -1]: Merge pull request #1155 from Varriount/revert-bbodi/devel... 2 more lines
01:36:03Varriountdom96: Feel free to yell at me. I deserve it. :|
01:39:10*Skrylar joined #nimrod
01:46:31reactormonkVarriount, that's why I never merge my own pullrequests ;-)
01:47:04reactormonkit's the multiple-eyes principle.
01:57:30BitPuffinyeah that's a really good way to dev
01:58:51reactormonkBitPuffin, I tend not to write too much code, but I accept one or another PR
02:02:16*q66 quit (Quit: Leaving)
02:05:09BitPuffinreactormonk: well it's important to have someone review PRs
02:06:48*superfunc quit (Ping timeout: 240 seconds)
02:06:55reactormonkBitPuffin, I just run over them regularly and accept what I deem good and within my domain
02:08:35BitPuffinreactormonk: yeah :D
02:17:27reactormonkhmm, the tester fails with Error: unhandled exception: No such file or directory [EOS]
03:31:56*brson joined #nimrod
03:42:20*brson quit (Ping timeout: 252 seconds)
03:43:15*brson joined #nimrod
03:56:10*brson quit (Ping timeout: 276 seconds)
03:59:20*bbodi joined #nimrod
04:08:04*brson joined #nimrod
04:24:31bbodidom96: https://github.com/Araq/Nimrod/issues/1065 I checked the python implementation, and there is not any feature there you mentioned. Moreover, I find it a semantically wrong idea.
04:24:58bbodiIf "/foo?test=4&test2=5" url is used, that means you want to visit "foo" with the given param
04:25:26bbodi"/bar?q=123", here the case is sam,e you want to visit bar with q=123
04:26:18bbodiIt does not make any sense to concatenate these two totally different things (visiting two different place with their own param), and generating an url with the concatenation of the pathes and using the union of the parameters
04:26:40bbodican you give me an example from the real life, when it could be a useful feature?
04:28:16*bjz joined #nimrod
04:37:16fowlbbodi, hi, i made WhiteStag compile on linux but the FPS is dreadful, it looks like you are redrawing after handling events
04:39:00fowlis that right?
04:39:49bbodiI think it is caused by a View who are mark himself as modified when some event occurs, like eventTick, which occurs automatically in a second. The statusline View do that.
04:40:28bbodimoreover, StatusLine is modified by every mouse moving event
04:40:44bbodiPHelpLine, sorry, not statusline
04:41:58bbodiBut i think the FPS should not be so low, the count of redrawing is much lower than it would be in a game
04:42:21bbodiand thanks a lot for your work
04:42:29fowlwhy is the call to swapBackBuffer inside view.executeView
04:43:32bbodiits the "main loop", i have to swap buffers somewhere
04:46:57fowlbbodi, but executeView is called for events, not used like a main loop (selectbox.handleItemSelection, window.windowHandleEvent)
04:47:34fowloh i see, you use it to block the process for things like opening a file dialog
04:47:49bbodiyou are right, yes
04:48:05bbodiit becomes the new "main loop" while it is executing
04:49:58bbodiAs I see, you make the project compile on linux by removing clipboard functionality
04:50:17fowlim looking for a solution
04:50:34bbodiOk
04:50:54fowltoo bad this isnt available for 1.2 http://wiki.libsdl.org/SDL_GetClipboardText
04:51:09bbodiyes, I couldnt use it on windows too
04:51:29fowlwhat, sdl2?
04:52:33bbodiwith SDL 2 I had some strange bug and behavior and the early stage of the development, so I stay with SDL 1. But I think the rendering engine is well separated, so it is very easy to replace
04:52:48bbodimoreover, I will to an engine that use simple console functionality without SDL
04:53:12bbodibut I have some feature Idea, which for I need SDL, like resizable and transparent View-s
05:08:08*brson quit (Ping timeout: 252 seconds)
05:08:16*brson joined #nimrod
05:29:52fowlbbodi, im going to try to think of how to fix it within your design
05:31:20bbodifix what? :)
05:31:24fowlbbodi, traditionally you would clear all the pending events, draw, then sleep for a time to make the framerate stable
05:31:34fowlbbodi, the main loop
05:32:05fowlit might not seem like a problem but my cpu goes up to 100% when im moving the mouse around or hitting keys
05:32:27bbodicheck sdlengine.nim
05:32:32bbodireadSdlEvent
05:32:45bbodithat function contains this: sdl.Delay(10)
05:34:40fowlthat runs when there are no events
05:35:38*brson quit (Ping timeout: 240 seconds)
05:36:12bbodimeasure twice, cut once. I will introduce a new Window that will be available for any application. That window will contains some measurement numbers like the number of different events, and logging
05:36:44fowlheh
05:38:20fowlbbodi, you dont see it? when you move the mouse around and the cursor pos starts to lag? i run a task monitor in the background and it goes up to 100% when im moving around the mouse, then when i stop giving it events it slows down (thats when the sdl.delay() is in effect)
05:40:22bbodimy CPU runs on 12% always. But maybe I have a strong machine. Thanks for your observation!
05:41:24bbodiI put the SDL.delay to the pollEvent method, right after whule true statement. Try it out please
05:46:15*brson joined #nimrod
05:46:34fowlbbodi, that will put the delay after each event still
05:48:36*Demos quit (Read error: Connection reset by peer)
05:52:12fowlbbodi, i'll play with it tomorrow, ill probably add a user event to act as the draw timer
06:09:47fowlgood night
06:12:17*bbodi quit (Ping timeout: 264 seconds)
07:16:35AraqVarriount: correct (about the new_comment_handling). somebody needs to check it doesn't break the documentation generator in a subtle way.
07:16:59Araqand then it still needs a deprecation path to allow for:
07:17:02Araqelse:
07:17:12Araq # comment as a statement suffices
07:20:20*brson quit (Ping timeout: 252 seconds)
07:35:13*seertaak joined #nimrod
07:35:36seertaakgood morning everyone
07:36:37seertaakquestion: how can I make a nimrod proc visible from C code?
07:37:14seertaake.g. C code should expect a function with signature: void(void *, void *)
07:37:41seertaakhmmm looks like I may be here a bit early ;)
07:37:51*brson joined #nimrod
07:51:26*brson quit (Ping timeout: 255 seconds)
07:53:15*brson joined #nimrod
08:19:48*seertaak quit (Ping timeout: 240 seconds)
08:53:52*brihat1 joined #nimrod
08:53:52*brihat joined #nimrod
08:53:57*brihat quit (Client Quit)
08:54:00*brihat1 quit (Client Quit)
09:03:32*daharon joined #nimrod
09:07:45*brihat joined #nimrod
09:07:45*brihat1 joined #nimrod
09:07:45*brihat1 quit (Client Quit)
09:07:47*brihat quit (Client Quit)
09:13:16*[1]Endy joined #nimrod
09:15:33*io2 joined #nimrod
09:19:04*Ycros left #nimrod (#nimrod)
10:09:15*brson quit (Ping timeout: 276 seconds)
10:13:50Araqhi daharon welcome
10:16:53*nande quit (Remote host closed the connection)
10:19:53*Matthias247 joined #nimrod
10:22:03milosnmorning
10:22:05milosnhi Araq
10:22:19Araqhi
10:23:37milosntell me how does it work for module which are impure and require external libs to work ... for example 're' module
10:24:26milosni assume when i compile the binary which i want to deploy ... the development environment and target environment need to match
10:24:37*daharon left #nimrod ("Leaving")
10:24:38milosnin this case PCRE needs to match on both?
10:25:07milosnis that how it works?
10:28:18Araqhm?
10:29:34milosnin the module index it says that some modules, like 're' depend on external libraries in this case PCRE
10:29:51milosni just wonder how it works when i want to deploy binary which needs those
10:30:26Araqwell you better ship pcre.dll with your .exe
10:30:38Araqon linux libpcre.so is around anyway
10:30:55milosnits linux env
10:30:59Araqre simply imports pcre which wraps the DLL
10:31:11milosnno dll-s and exe-s :)
10:31:13Araqand the DLL is loaded via dlsym
10:31:23Araqnote: I use DLL for lib*.so too
10:31:41Araqbecause it's easier to type and the term lib*.so makes no sense
10:31:55Araqbbl
10:31:59milosnso its safe to say, if my binary is using 're' module ... target env should have libpcre someplace
10:32:03milosnand it should work?
10:32:11milosnoke thanks
10:37:36dom96'morning
10:45:15dom96Nice of BurntSushi to mention Nimrod in his Rust compile-time regex blog post.
10:45:39dom96I wonder why he decided to make the implementation in Rust instead of Nimrod.
11:12:46*[2]Endy joined #nimrod
11:15:12*[1]Endy quit (Ping timeout: 240 seconds)
11:34:03*io2 quit ()
11:36:45Araqmilosn: yes, exactly
12:02:06*bbodi joined #nimrod
12:06:56*q66 joined #nimrod
12:06:56*q66 quit (Changing host)
12:06:56*q66 joined #nimrod
12:08:18*brson joined #nimrod
12:42:47*seertaak joined #nimrod
12:43:41milosnAraq: cool
12:44:08milosnhmm i must tell you, nimrod is easely cool-est thing ive discovered this year :)
12:44:15milosnwell done :)
12:55:11Araqthank you
12:57:26seertaakhi quick question: coming from C++ background, I'm used to seeing constructors/destructors (not least for RAII). Does nimrod support them?
12:59:41seertaakAh, I just saw in the manual there are destructors via {.destructor.} pragma.
13:03:05seertaakHowever, I'm still not clear on how constructors work -- the nimrod tutorial (II) doesn't seem to mention anything, and the manual also isn't clear
13:05:33*Varriount|Mobile joined #nimrod
13:05:51*darkf quit (Quit: Leaving)
13:06:12Varriount|Mobileseertaak: Nimrod doesn't have constructors, as such
13:06:23*Jesin quit (Quit: Leaving)
13:07:25Varriount|MobileIt has procedures that create and setup new instances of objects, like newSeq, initTable, etc
13:08:39Varriount|Mobilebut these are regular procedures
13:10:14Varriount|MobileDestructors and finalizers are special because they are called implicitly, sometimes by the garbage collector
13:11:18*io2 joined #nimrod
13:12:14seertaakVarriount: ok, thanks for the explanation
13:19:59*brson quit (Quit: leaving)
13:23:48*seertaak quit (Ping timeout: 240 seconds)
13:29:09bastian_hi
13:29:22dom96hi bastian_
13:29:46bastian_i'm currently implementing a parser in C with a push-style API
13:30:17*BitPuffin quit (Ping timeout: 264 seconds)
13:30:47bastian_is it possible to allocate memory for a string on the C side, pass it to nimrod, and have it handle memory (deallocate it at some point) for me?
13:31:18bastian_or is it necessary to create a copy?
13:32:20*BitPuffin joined #nimrod
13:33:07Araqyou need to create a copy or you call 'newObj' from C
13:34:16AraqI would simply write the parser in nimrod though :P
13:36:04Araqyou can also wrap the string in some 'ref' and attach a finalizer to that
13:36:14bastian_already have it working using ragel
13:36:31Araqah good point
13:36:41Araqa ragel backend for nim would be sweet
13:37:22bastian_looked at it, but the existing backends seem rather intimidating
13:41:49bastian_Araq: could you elaborate on the two non-copy approaches? how would I call newObj from C, and how would wrapping work?
13:43:08Araqtype Foo = ref object
13:43:14Araq cs: cstring
13:43:39Araqproc createFoo(x: cstring): Foo =
13:43:47Araq new(result, finalizer)
13:43:52Araq result.cs = x
13:44:18Araqproc finalizer(f: Foo) = free(f.cs)
13:44:44Araqthat's the wrapping approach
13:46:15Araqproc nimCreateString(size: int): pointer {.exportc.} =
13:46:30Araq result = cast[pointer](newString(size))
13:46:42bastian_ah, interesting. this looks quite like what i'm looking for
13:46:57bastian_thanks!
13:47:00Araqand then use 'nimCreateString' in C, but you need to know Nimrod's string layout
13:47:06Araqfor this to work
13:48:08bastian_cool. think i'll go with wrapping, as with the other approach the parser would be nimrod-specific
13:48:15Araqit's typedef struct { long Len; long Cap; char data[]; } *NimString; iirc
13:48:35*Varriount|Mobile quit (Remote host closed the connection)
13:48:56Araqthe parser should be nimrod specific though
13:49:06Araqhow else will we conquer the world?
13:49:36Araqmake people program in nimrod as all the libraries you want to use are in nimrod too.
13:50:32AraqLook at Objective C's success. It doesn't play well with anybody so people have no choice.
13:51:37bastian_heh :)
13:53:46bastian_btw: here are my first steps in nimrod: github.com/turbolent/ketu
13:54:26bastian_any suggestions for approach / performance / code-style are very welcome
13:54:33bastian_esp. k2tree.nim
14:07:04*Varriount|Mobile joined #nimrod
14:07:05*Varriount|Mobile quit (Client Quit)
14:07:45*uvelichitel joined #nimrod
14:14:10milosnhmm i am trying to do: for k, v in pairs(my_table)
14:14:14milosnbut it dont work :)
14:14:32milosnwhats the correct way to do it, before i google :D
14:14:43milosni expected it to work as in python
14:19:57dom96are you trying to iterate over keys and values?
14:20:06dom96if so then that should work
14:20:12milosnunpacking works only in let and var
14:20:16milosni found it :)
14:20:37milosnso its: for p in pairs(my_table):
14:20:44milosnthan i unpack in let
14:22:55milosndom96: it should? i cant get it to work ... let me try again
14:23:04milosnmaybe i had an error someplace else
14:23:07*milosn not sure
14:24:20milosndom96: indeed it does, i had error someplace else, was not reading what it actually was ... thought my 'for' doesnt work
14:24:23milosncool
14:24:23*io2_ joined #nimrod
14:25:07*Jesin joined #nimrod
14:26:25*io2 quit (Ping timeout: 252 seconds)
14:27:37*menscrem joined #nimrod
14:28:27menscremhi all
14:28:49dom96hello menscrem
14:36:13*io2_ is now known as io2
14:36:26milosndom96: you made nimrod?
14:36:35dom96milosn: Nope. Araq did.
14:36:36milosnas in, you started the project
14:36:39milosnah
14:36:49milosnits like python just faster and better
14:36:50milosn:D
14:37:15*milosn loves it
14:38:04menscrem whether there is a ternary operation Nimrod?
14:38:07milosndom96: is it possible to make "active record" style ORM (having in mind what nimrod is) ... or even better did someone made it already?
14:38:08dom96milosn: That's exactly why I use it. A long time ago I used python.
14:38:38milosni havent looked at macros yet, not good at that stuff ... but maybe in nimrod they are easy
14:38:48dom96menscrem: You mean the ?: operator?
14:39:23menscremYes
14:39:36*darithorn joined #nimrod
14:40:41dom96milosn: Never used 'active record' so i'm not sure, but I bet it's possible.
14:41:06dom96milosn: Play around with templates first, they are simpler than macros and may be enough for your needs.
14:41:12milosnthats where i had problem with scala, it was just to rigid ... that kinda stuff cant be done easely
14:41:26dom96menscrem: No, but you can do this instead: let x = if y: 5 else: 8
14:41:53milosntemplates? ill have a look ... i am just at basic level at the moment ... getting to know data structures and stuff
14:42:18milosnso far i wrote ... err 188 lines of nimrod, including empty lines and comments :P
14:42:28milosn:)
14:42:59dom96milosn: I would really love to see an ORM using Nimrod's macros.
14:43:17dom96milosn: If you get stuck we can always help :)
14:43:32milosnwe shall see :)
14:43:48milosnif i get time to play around with, i might give it a go
14:45:25menscremdom96: thank you
14:55:10*Skrylar quit (Ping timeout: 252 seconds)
15:22:14Varriountbbodi: Concerning your PR. When I use parseurl on many of dom96's examples, the fields of the URL objects are empty, when it seems they shouldn't be.
15:22:32Araqoh hi Varriount
15:22:40Araqdid you revert whatever you did wrong?
15:23:06VarriountYeah.
15:23:51VarriountRight Click -> Revert Commit -> Push and Open PR -> Accept PR -> Reopen Issue.
15:28:34bbodiVarriount: Where can I find these examples?
15:32:35*Skrylar joined #nimrod
15:56:11*seertaak joined #nimrod
15:56:58*seertaak quit (Client Quit)
16:00:00*untitaker quit (Ping timeout: 240 seconds)
16:04:18bbodiIn D, you can do the following "array[pos..$]", where '$' denotes the array size. Is there anything similar construct in Nimrod? If not, dont you find it useful?
16:05:16*untitaker joined #nimrod
16:07:11Varriountbbodi: Use echo(repr()) on the url objects in the example dom96 gives in the old PR
16:08:10VarriountAlso, I really feel that we should stick to whatever standard there is on handling URL's. We can implement non-standard behvior as other procedures.
16:13:53EXetoCmilosn: what error message do you get for "for k, v in pairs(my_table)"? unpacking iterator yields should work too
16:15:22dom96EXetoC: he got it working
16:15:34VarriountI think iterator unpacking should follow the same syntax as tuple unpacking in var statements. Otherwise you get ambiguity when iterating over objects like sequences of two-item tuples.
16:15:54dom96bbodi: I don't think so, would be nice to have though.
16:16:22renesacbbodi, you can do arr[pos..arr.high]
16:17:04EXetoCdom96: Didn't he say that he was unpacking in a variable? I don't know why he has to do that
16:17:24EXetoClet me re-rerad
16:17:35EXetoC*re-read
16:17:36renesacnot as compact as D, but '$' is a general operator in nimrod... we don't have many characters left
16:17:44bbodiit should be then arr[pos..arr.high-1] or arr[pos.. <arr.high], dont?
16:18:00renesacarr.high = arr.len - 1
16:18:07EXetoCok nevermind
16:18:12bbodioh thanks
16:18:49EXetoCmilosn: disregard that
16:21:14EXetoCrenesac: hm, macro to the rescue?
16:22:30EXetoCbut it matters mostly for long names really
16:22:48renesacand when you do lots of slicing, like in D
16:22:58*io2 quit ()
16:23:10renesacwhat macro you were thinking about?
16:25:58Varriountrenesac, bbodi: I've tried to think how one would implement an operator like that, but I think the only way that such a thing could be done is with term rewriting macros, or possibly a regular macro.
16:26:27renesacon D it is backed into the language
16:26:34EXetoCthe former of which you cannot rely on for semantics
16:26:37renesacand I don't think '$' is used for something else
16:30:19Araqwith a slight parser/grammar patch we could easily support s[0..$]
16:30:42Araqbut I prefer s[0..] as a syntax
16:30:53VarriountAraq: That would be fine too.
16:31:15renesacinteresting option
16:31:18Araqwe only need the rule "infix operator before ], }, ) becomes a postfix operator"
16:31:22bbodiusing '$' is not a good idea, I just picked one example from D, we shouldnt follow them, because we use '$' for another thing. The point here is to using some simple, short expression
16:31:45bbodiI thing too that s[0..] is much better
16:32:07renesacit remembers me of python, where it is 's[0:]'
16:32:11Araqbut then the language already has a prefix '..' for s[..x]
16:32:16renesacindeed it is much better
16:32:22EXetoCx.. is nice
16:32:32Araqso this would require yet another pragma to disambiguate
16:32:37VarriountAraq: Tell me again why negative string slicing "s[0.. -1]" is inefficient?
16:32:58Araqbecause the hardware doesn't support it natively?
16:33:06VarriountHuh?
16:33:59VarriountBut it's just the same as s[0..(s.len()-1)-1], isn't it?
16:34:18Araqno, it is not
16:34:20renesacVarriount, I think you have a '-1' too much there
16:34:28Araqcheck out what the implementation in system.nim does
16:35:12Varriountrenesac: len() returns the number of items in an collection. Indices start at 0
16:35:45renesacbut 's[-1]' isn't the last item?
16:36:17Varriountrenesac: No, second to last.
16:36:48renesacin python it means the last one
16:37:00renesac'-2' is second to last
16:37:06Araqs[-1] IS the last item, if it would be valid, that is
16:37:27dom96IMO it should be valid
16:38:30dom96after all, "expressive" is above "efficient" on the website :P
16:38:47renesacdom96, I think they are together
16:38:48renesac:P
16:39:27Araqargh
16:39:45dom96The website is wrong it seems "Nimrod's design focuses on efficiency, expressiveness, elegance (in the order of priority)."
16:39:45Araqit used to be "efficient expressive elegant" in the order of priority
16:39:56Araqyeah, didn't notice it
16:40:15VarriountIt seems that we are giving Araq a headache. :P
16:40:32renesacfor integer literals, it would be equivalent performance as the compiler could translate between the two forms
16:40:45Araq-1 is really only meaningful as literal, IMHO
16:40:51Varriount proc `[]`*(s: string, x: TSlice[int]): string {.inline.} =
16:40:52Varriount ## slice operation for strings. Negative indexes are supported.
16:40:52Varriount result = s.substr(x.a-|s, x.b-|s)
16:40:57Araqlet x = parseInt(stdin.readLine)
16:40:58renesacbut when the value isn't known at compile time it would generate more code
16:41:04Araqecho foo[x]
16:41:21Araq# do you really want to allow x == -1 here?
16:41:38renesacAraq, if it had no runtime overhead, yes
16:41:42renesac:P
16:41:59renesacof course, you would do some input validation before using untrusted input
16:42:06VarriountWhat does the '|s' mean?
16:42:09Araqthat's true
16:42:21AraqVarriount: -| is an operator
16:42:36Araqit does "minus plus some bounds check"
16:42:42Araqit's also defined in system
16:43:26VarriountSo.. I don't see how the hardware limits it.
16:43:59Araqwell as renesac said, it requires an 'if' for every subscript operation
16:44:35Araqpeople will shout "this is no systems programming language" on reddit if we do that
16:45:00renesacwell, it can be optimized to a cmov I think, but yeah
16:45:07Varriountcmov?
16:45:35renesacan if that does not do branching, it executes the two options in parallel
16:45:40VarriountAraq: We're already doing a comparison for bounds checking.
16:45:48AraqVarriount: not in release mode
16:45:49renesacand picks the correct one latter
16:47:04*Jesin quit (Quit: Leaving)
16:47:04renesacor something like that, I'm not that into assembly
16:47:16VarriountHm. Ah well. people can do "s[-1..-1] if they really way.
16:47:19Varriount*want
16:47:30Araqwe can also do something like this:
16:48:11Araqtype Foo = tuple[x: int]
16:48:54Araqproc `~ `(x: int): Foo = result.x = x
16:49:28renesacresult.1?
16:49:55Araqproc `[]` [T](a: openArray[T], f: Foo): T = a[a.len - f.x]
16:50:03Araqecho a[~1]
16:50:37Araqthe type Foo only serves as a disambiguator for overloading resolution
16:50:49renesacright
16:50:52VarriountWhy not distinct int?
16:51:44VarriountOr is that a stupid question.
16:52:08VarriountAraq: Anyway, I give in, you're right.
16:53:10VarriountI see why it would be inefficient. And I'm hesitant to add an operator procedure to the stdlib for such a common type, since there's only a limited number of operator combination people can remember and use.
16:53:10renesacanother thing I would like is the third field that python and some other languages have
16:53:17Varriountrenesac: Stride?
16:53:19renesacthat describes the step
16:53:45renesacbut in nimrod we only have binary operators
16:53:51VarriountPersonally, I've rarely, if ever, seen the step/stride feature used.
16:54:12Araqx[::-1] is an idiom for "reverse" in python
16:54:16renesacwell, I used it more just to revert the ...
16:54:17renesacyeah
16:54:42VarriountAn inefficient idiom. reverse() is much better both memory and performance wise.
16:55:00VarriountPerhaps stride/step could be implemented as a third argument?
16:55:29Araqthat's just an implementation detail though, Varriount. I bet a JIT for Python optimizes both to the same.
16:55:46renesacVarriount, why inneficient?
16:55:51VarriountAraq: For Pypy, yeah. Not CPython :/
16:56:04renesacif you know it at compile time, you can replace by a "reverse()"
16:56:12renesacif you don't, you would need an 'if' anyway
16:56:54renesacof course, it is a bit inefficient if you just need an positive integer step
16:57:06renesacthat is not known at compile time
16:57:19Araqrenesac: we'll get more efficient slicing soon as they part of my new master plan :P
16:57:27Araqstrides however are not part of it
16:57:36Varriountrenesac: Master plan? Tell all, please.
16:57:52renesacthat was for Araq, right?
16:57:54VarriountAlso, I thought you were working on threading stuff.
16:58:01VarriountEr, yes.
16:58:16VarriountAraq: Master plan? Tell all, please.
16:58:19Araqit's all secret
16:58:30renesacwell, strides need copying, except when in generators
16:58:39renesaclike a counter in a 'for' loop
16:59:16renesacactually, you could even add an additional field in a slice to say the stride..
16:59:57renesacit would be more efficient for applications that need it... but that is rare...
17:00:01VarriountHmf. It's ideas like this that need a well though out enhancement proposal document.
17:01:15AraqVarriount: feel free to introduce the first "Nimrod enhancement proposal" (NEP)
17:02:43VarriountAraq: Now that you mention it..
17:03:19renesacactually, just a nice generator functionality would obliviate the need of such special stride field
17:03:36renesacif I could pass an generator as if it was a seq
17:03:44renesacthat is what is cool in D ranges
17:04:59renesacyou implement an algorithm for a 'random acess range', or something like that
17:05:11*bbodi quit ()
17:06:16renesachttp://ddili.org/ders/d.en/ranges.html
17:06:56EXetoCI wanted to do that with UDTCs, but I'm waiting for bug fixes
17:08:50EXetoCso that it's part of the actual type interface, which allows for overloading and so on
17:14:47EXetoCbut I haven't tested something like "c.isRandomAccess == true" yet
17:15:44EXetoCor maybe the last part can be chopped off, if it does indeed work at all
17:16:15EXetoCbut then you have a to associate a constant with a type somehow
17:17:06AraqisRandomAccess = has [] and len, right?
17:18:01EXetoCthat might be good enough
17:18:14Araqthough I always though "isRandomAccess" is a bad joke
17:18:18Araq*thought
17:18:45Araq"oh yeah, lets see, what's random access in practice? oh yeah, arrays. anything else? no..."
17:19:27Araqdepending on how you look at it, hardware doesn't know such a thing as "random access" anymore
17:19:52Araqor finger trees are random access'y enough
17:21:22VarriountI always though that random access, at it's most basic, meant that arbitrary parts of a piece of information could be accessed and/or read to.
17:21:58EXetoCI guess if you count abstractions, but the underlying type should still be an array I guess
17:22:21Araqwhat the heck means "random access"? why is that a useful generic constraint? is O(lg N) access too slow? maybe but does the algorithm stop working for that then?
17:22:58AraqI'd call it "arrayLike" instead
17:26:35EXetoC"RandomAccessFinite RandomAccessInfinite RandomFiniteAssignable..." :-)
17:29:18*Demos joined #nimrod
17:31:48renesacAraq, it does not need to be an array, it can be a function
17:39:07Araqrenesac: and yet I'd expect an overloaded [] if it resemembles an array
17:40:37DemosI think I agree with araq, although something like KeyValueContainer[K,V] may be OK
18:06:32*Jesin joined #nimrod
18:21:59*BitPuffin quit (Ping timeout: 252 seconds)
18:25:31Skrylardoes it seem like every rule of math is arbitrarily bolted on to anyone else?
18:32:46Demosnot really, there do seem to be quite a few paths that get you all the rules though
18:32:53Demoswhich I guess is good
18:37:42*bbodi joined #nimrod
18:38:59bbodiI have the following module hierarchy: a/a.nim, and a/b/b.nim. From b.nim, I want to import a.nim in the following way: import ../a.nim. But I get Error: invalid module name: '../ a'
18:45:46Araqimport "../a" should work
18:47:20bbodiBut it doesnt. You can try it by cloning https://github.com/bbodi/WhiteStag and nimrod c -r WhiteStagEditor\renderer\sdlengine.nim
18:49:20*BitPuffin joined #nimrod
19:03:48Araqimported with the "" ?
19:04:08bbodioh sorry
19:04:29bbodiwith "" its ok
19:07:03OrionPKhola
19:10:17*menscrem quit (Quit: Page closed)
19:34:22*springbok joined #nimrod
19:34:24Demosif you are compileing from the parent directory you import a/a.nim
19:34:29Demosoh or that
19:41:44*bbodi quit (Ping timeout: 252 seconds)
20:00:27*Demos quit (Read error: Connection reset by peer)
20:08:00EXetoCfowl: does verlet.nim compile for you?
20:08:09EXetoC"sdl2/engine2.nim(4, 16) Error: cannot open 'fowltek(/|/|/)sdl2"
20:09:53EXetoCmodule/directory collision?
20:11:51fowlsdl2/engine2 still refers to fowltek/sdl2 >_>
20:11:57*njoejoe joined #nimrod
20:14:01Araqhi springbok welcome
20:14:30njoejoeis there something like: str = ['data',123,variable].join(",") in nimrod?
20:14:46Araqyes. it's called "join"
20:14:51Araqand should be in the index
20:15:22njoejoethank you. i need to remember the index...
20:15:43springbokThanks Araq. Curious about Nimrod. Looking around.
20:21:12EXetoCfowl: is it suitable for player movements?
20:21:52EXetoCbox2d isn't for example. I couldn't be bothered with the hacks that need to be applied
20:27:56*nande joined #nimrod
20:31:24EXetoCI guess not
20:43:14fowlEXetoC, are you doing a platformer
20:43:35EXetoCI'm not doing anything
20:44:02*[2]Endy quit (Read error: Operation timed out)
20:44:06fowloh
20:44:18EXetoCbut I usually have top-down mechanics in mind
20:45:02fowlchipmunk or box2d should work for that
20:45:12*shevy joined #nimrod
20:45:24fowlassuming you mean top-down as in asteroids
20:45:54EXetoCyep
20:49:29*Skrylar quit (Ping timeout: 264 seconds)
20:53:31njoejoehow to do something like this in a loop?: var1,var2,var3 = line.split(",")
20:55:07uvelichitelHi there. Can't quite understand what for 'method' are. Please point me some code base using them to read
20:56:56EXetoCuvelichitel: polymorphism (virtual in C++ [vtable])
20:57:23*Skrylar joined #nimrod
21:01:00Araqnjoejoe: there is a macro for that somewhere
21:01:42EXetoCdoes it involve a temporary?
21:01:56*Matthias247 quit (Read error: Connection reset by peer)
21:02:20Araqwho cares
21:02:45Araqwho uses "split" when efficiency is important anyway :P
21:03:18uvelichitelEXetoC: C++ have inheritance, Haskell type-classes and Go interfaces to exploit methods polymorphism. Can't clear understand Nimrod approach. Please show the code
21:06:12uvelichitelEXetoC: I mean real code base, not example in manual. Thanks
21:08:32fowluvelichitel, this project makes extensive use of methods: https://github.com/bbodi/WhiteStag
21:09:08uvelichitelfowl: Thanks. Let me see
21:09:30EXetoCpolymorphism implies inheritance I think
21:09:35EXetoCruntime polymorphism at least
21:10:37renesacnimrod also has many compile time mechanisms, like our type-classes
21:11:13renesacand very good generic programming in general
21:13:13uvelichitelrenesac: Don't take me wrong. Nimrod is nice. Question was exactly about multy-methods
21:14:11renesacright, I was just pointing out the other alternatives
21:14:24*renesac never used multi-methods in nimrod
21:14:25njoejoeAraq: I wonder if this is it: https://gist.github.com/gradha/8140318 i just tried it, and it seems it works with "let (var1,var2)..." but haven't gotten it to work without the "let" keyword.
21:14:53renesacnjoejoe, there is a feature request for this in the issue tracker
21:14:54renesac:P
21:15:30renesacyou need to use a temporary tuple and then unpack it one field at time
21:15:58renesacif you want to reuse previous variables
21:25:41*brihat joined #nimrod
21:26:06Araqnjoejoe: yeah that's what I had in mind
21:43:36*uvelichitel quit (Quit: Textual IRC Client: www.textualapp.com)
21:51:00njoejoei think this would be awesome: (var1:int,var2:string,var3:float) = line.split(",") but i don't think it can be done with a macro. can it be done with whatever mechanism that #!strongSpaces uses? where could I read up on that?
21:51:49Araq#!strongSpaces is totally different
21:52:06Araqbut what you want could be done with a macro
21:54:48njoejoethat's good news. i will read up on them now.
21:56:54njoejoenimrod is a yak shavers delight :-)
21:57:22*uvelichitel joined #nimrod
22:00:01dom96and here I thought you people were actually shaving yaks
22:09:47*Jesin quit (Quit: Leaving)
22:11:00*Varriount|Mobile joined #nimrod
22:12:50Varriount|MobileAraq: How hard would it be to change the compiler's parsing code to support parenthesized groups of identifiers for variable unpacking in for loops?
22:13:28Varriount|MobileThe current unparenthesized situation is ambiguous.
22:14:11EXetoCwhy is it?
22:15:07dom96for k, i in blah: # could mean unpacking or k is value and i is index.
22:15:31Varriount|MobileEXetoC: Try unpacking when iterating over a sequence of two-item tuples.
22:16:28Varriount|MobilePlus, having/forcing parenthesis makes things consistant with tuple unpacking in var statements.
22:16:47Araqyeah well, iirc we fixed the ambiguity
22:16:54*Demos joined #nimrod
22:16:58Varriount|MobileHow?
22:20:07Varriount|MobileAraq: How
22:20:52Araqcan't remember
22:21:04Araqfor k, v in x # always calls 'pairs'
22:21:10Araqcan't be used for unpacking
22:21:14Araqiirc
22:21:51Varriount|MobileYeah, which is unknown, and still ambiguous when read.
22:22:03Varriount|Mobile*relatively unknown
22:23:36Demosoh damn, I have been calling pairs explicitly
22:24:08renesacit is the most common usage
22:24:36renesacand consistent with the tuple unpacking syntax, it seems
22:24:54renesacdo 'for (k,v) in x' do tuple unpacking?
22:25:01AraqVarriount|Mobile: implicit tuple unpacking in 'for' is awful for generic code
22:25:25Araqbut yeah, we could support 'for (a, b, c) ' for tuple unpacking
22:25:28Varriount|Mobilerenesac: I'm not disagreeing with using pairs, I'm just suggestion that parenthesizing tuple unpacking in iterators be made allowable/mandatory
22:25:49Varriount|MobileAraq: Why is it terrible?
22:39:30dom96I agree with Varriount|Mobile, we should support it.
22:41:59*Skrylar quit (Ping timeout: 255 seconds)
23:08:59*darkf joined #nimrod
23:18:24*Jesin joined #nimrod
23:38:16njoejoeis there a way to have string interpolation of variables in scope? "hello #{p.name}, you are #{p.age} years old" is so handy
23:39:28*brson joined #nimrod
23:40:21*uvelichitel quit (Quit: Textual IRC Client: www.textualapp.com)
23:47:27Varriountnjoejoe: I think that there may be a macro somewhere in the tests that does that. If nothing else, it's doable with a macro.
23:49:32*brson quit (Quit: leaving)
23:50:02njoejoeit's all coming up macros! hopefully macros can use other macros because i want to use this in a macro :-)
23:55:36Varriountnjoejoe: To put it bluntly, although I see the merit of that kind of macro, it's not high up on the priorities of any of the developers, and noone has submitted a PR for it.
23:56:02*Varriount is currently porting python stuff to nimrod