<< 13-12-2013 >>

00:22:38Varriount!seen filwit
00:22:38NimBotfilwit was last seen on Sun Dec 1 06:40:41 2013 quitting with message: Quit: Leaving
00:22:59BitPuffin13 days ago
00:23:02BitPuffinanyway
00:23:04BitPuffinnight!
00:23:07VarriountNight
00:23:11Varriount!help
00:27:25*BitPuffin quit (Ping timeout: 250 seconds)
00:30:09*boydgreenfield_ joined #nimrod
01:02:52*boydgreenfield_ quit (Quit: boydgreenfield_)
01:03:13*OrionPKM quit (Remote host closed the connection)
01:06:29*boydgreenfield_ joined #nimrod
01:18:44*brson quit (Quit: Lost terminal)
01:20:21*brson joined #nimrod
01:25:34*boydgreenfield_ quit (Quit: boydgreenfield_)
01:29:57*boydgreenfield_ joined #nimrod
01:30:44boydgreenfield_Can anyone point me to a good idiomatic/canonical example for how to set up tests for a module?
01:32:52Varriountboydgreenfield, looks at the nimrod ./tests directory
01:33:09VarriountOr, the strutils module
01:35:15boydgreenfield_Varriount: Thanks. And what's the typical way one calls them/runs the tests (like is there a Python nosetests equivalent practice)?
01:35:54boydgreenfield_Varriount: For context, I'm just trying to move some crummy "when isMainModule" tests into a separate file and re-organize things a bit.
01:36:24boydgreenfield_(if appropriate)
01:48:25*DAddYE_ joined #nimrod
01:51:55*DAddYE quit (Ping timeout: 250 seconds)
01:52:39*DAddYE_ quit (Ping timeout: 252 seconds)
01:58:22*brson_ joined #nimrod
01:58:32*boydgreenfield_ quit (Quit: boydgreenfield_)
02:02:28*brson quit (Ping timeout: 260 seconds)
02:06:06*OrionPKM joined #nimrod
02:08:46*darkf joined #nimrod
02:10:52*shodan45 joined #nimrod
02:13:59fowlboydgreenfield, hey try the unittest module
02:18:13fowlboydgreenfield, heres an example https://gist.github.com/fowlmouth/7938914
02:18:24fowland a more lengthy example https://github.com/fowlmouth/nimlibs/blob/master/tests/test_bbtree.nim
02:33:52*brson joined #nimrod
02:37:25*brson_ quit (Ping timeout: 250 seconds)
02:43:38darkfis there a way to allocate and initialize a ptr type? like i want to alloc/initialize an sdl.PRect, can i do that without let x = alloc(sizeof(PRect)); x.x = ...; ?
02:48:52*DAddYE joined #nimrod
02:53:20*DAddYE quit (Ping timeout: 245 seconds)
02:54:22shodan45"home of the honey badgers"?
02:58:28*boydgreenfield_ joined #nimrod
02:59:00*DAddYE joined #nimrod
03:03:36*DAddYE quit (Ping timeout: 272 seconds)
03:06:45*xenagi joined #nimrod
03:17:56Varriountdarkf, why are you using a ptr? why not a ref?
03:19:36Varriountdarkf, PRect is a ref, to TRect
03:20:05Varriounthttp://nimrod-lang.org/sdl.html#573
03:21:14darkfVarriount: "PRect = ptr TRect"
03:21:38VarriountSorry, I meant ptr
03:22:09VarriountAnyway, you don't need to do that sizeof() stuff, you should just be able to create it with new
03:22:50darkfdoesn't new work on ref and alloc on ptr?
03:23:59VarriountHuh, so it does.
03:24:17darkfindeed
03:24:25darkfI just made a wrapper newRect() *sigh*
03:24:38VarriountStill, you don't need to use the sizeof, I'm pretty sure
03:31:07*boydgreenfield_ quit (Read error: Connection reset by peer)
03:32:59VarriountOr not. Man, I feel stupid.
03:34:05fowlproc alloc[T]: ptr T = cast[ptr T](alloc0(sizeof(T)))
03:34:27fowlthen you can just do alloc[TRect]() to get a ptr trect
03:34:52Varriountdarkf, listen to him, he actually knows things.
03:35:10VarriountAlthough, why that isn't in system, I have no idea.
03:36:40*boydgreenfield_ joined #nimrod
03:37:36darkffowl: awesome
03:41:24*boydgreenfield_ quit (Ping timeout: 260 seconds)
03:41:36fowldarkf, i wouldnt allocate PRect though
03:41:53fowlif you're using it for srcrect/destrect, just do it on the stack
03:42:12fowlvar src = TRect(x: 0, y: 0, w: 32, h: 32)
03:42:13darkffowl: can I take a reference ptr to something on the stack?
03:42:30fowlblit(surf, dest, addr src, addr src)
03:42:55darkfnice
03:42:57fowldarkf, yes with addr keyword
03:43:03darkfthanks fowl
03:49:44fowlgood night all
03:50:58*DAddYE joined #nimrod
03:55:25*DAddYE quit (Ping timeout: 245 seconds)
03:57:20darkfgn fowl
04:53:58*xenagi quit (Quit: Leaving)
05:15:18VarriountAraq, any particular reason that types are spread out all over os.nim, and not at the top?
05:23:12*boydgreenfield_ joined #nimrod
05:23:17*boydgreenfield_ quit (Client Quit)
05:34:56shodan45anyone ever try to nimrod-ify Qt?
05:35:44*brson quit (Quit: leaving)
05:54:41*DAddYE joined #nimrod
05:59:31*DAddYE quit (Ping timeout: 265 seconds)
06:56:12*DAddYE joined #nimrod
07:00:39*DAddYE quit (Ping timeout: 260 seconds)
07:22:52*DAddYE joined #nimrod
07:23:09*DAddYE quit (Remote host closed the connection)
07:23:15*DAddYE joined #nimrod
07:42:14*ics quit (Ping timeout: 240 seconds)
07:45:40*ics joined #nimrod
08:51:33*DAddYE quit (Remote host closed the connection)
08:52:01*DAddYE joined #nimrod
08:56:53*DAddYE quit (Ping timeout: 265 seconds)
09:09:20AraqVarriount: I think they are grouped into some logical sections
09:13:43*ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:39:25*CarpNet joined #nimrod
09:52:34*DAddYE joined #nimrod
09:56:48*DAddYE quit (Ping timeout: 246 seconds)
10:54:34*DAddYE joined #nimrod
10:57:09*HipsterPuffin joined #nimrod
10:58:45*DAddYE quit (Ping timeout: 245 seconds)
11:46:26*fundamental quit (Ping timeout: 264 seconds)
11:55:52*DAddYE joined #nimrod
11:55:54HipsterPuffindom96: I did some research on the cookie thing before I slept
11:56:09HipsterPuffindom96: we can discuss it in the VNUG later :P
11:59:41*fundamental joined #nimrod
12:00:00*DAddYE quit (Ping timeout: 245 seconds)
12:52:39Araqshodan45: c2nim got c++ support, so you can try to wrap Qt ...
12:57:16*DAddYE joined #nimrod
12:58:43HipsterPuffinHe can try
13:01:40*DAddYE quit (Ping timeout: 245 seconds)
13:13:40*gradha joined #nimrod
13:14:32*zahary_ joined #nimrod
13:14:34*isenmann quit (Quit: Leaving.)
13:58:32*DAddYE joined #nimrod
14:00:06*darkf quit (Quit: Leaving)
14:02:57*DAddYE quit (Ping timeout: 250 seconds)
14:29:41dom96HipsterPuffin: y u so hipster?
14:34:31HipsterPuffindom96: cuz I am sitting at a mac lol
14:34:50HipsterPuffindoing iOS dev
14:35:24dom96so hipster
14:35:31HipsterPuffinultrahipster
14:35:38dom96uberhipster
14:35:47HipsterPuffinI will now lose my password if I start using the forum
14:35:58HipsterPuffincuz starbax errday
14:38:28dom96lol
14:38:40dom96yeah, i'm sure starbucks is filled with hackers
14:38:51gradhahipster hackers
14:42:35HipsterPuffinyup only hipster hackers
14:46:26*faassen joined #nimrod
14:47:38dom96HipsterPuffin: When can we VNUG?
14:47:53HipsterPuffindom96: when I get home :P
14:48:02dom96HipsterPuffin: When will that be?
14:48:06HipsterPuffinhmm
14:48:11HipsterPuffindepends on how fast I read
14:48:44faassennoob question about assignment
14:48:58HipsterPuffinbut I would say I'll leave in ~3 hours or so?
14:49:13HipsterPuffindom96: isn't there someone else you can VNUG with until then? :D
14:49:35faassenif I have a nested array with a tuple inside, and I write a proc with an argument that takes this as a parameter.. how can I modify the fields in the tuple in that proc?
14:49:40dom96HipsterPuffin: It's ok, I can wait.
14:49:40faassenit tells me it cannot assign.
14:49:49faassenwhen I'm not doing nesting I can use 'var' in the proc definition
14:49:53faassenbut how would I do 'var' for a nested structure?
14:50:05HipsterPuffindom96: but it is important that more people become VNUGgets!
14:50:16HipsterPuffinfaassen: jump into the VNUG and dom96 will help you!
14:50:33faassenit would be good if I knew what a VNUG is.
14:50:34EXetoCfaassen: var is recursive
14:50:43EXetoCso passing by var should be enough
14:50:45HipsterPuffinfaassen: it's in the irc topic
14:51:04HipsterPuffinEXetoC: you should VNUG
14:51:13faassenah, well, what does VNUG stand for?
14:51:24dom96Virtual Nimrod User's Group
14:51:32faassenokay, well, can I get help on IRC too? :)
14:51:43HipsterPuffindom96: you were quicker than me. Damn this hipster keyboard
14:51:45Araqfaassen: yes of course
14:51:49faassenokay, very good. :)
14:51:55faassenI figure they were having VNUG in their head.
14:51:58Araqand it's still the preferred method
14:52:07dom96Yeah. I think HipsterPuffin is trying to recruit people a bit too much :P
14:52:13HipsterPuffin:(
14:52:23faassenyeah, I figure that's what was going on, and it's okay, I understand HipsterPuffin
14:52:27faassenokay var is recursive..
14:52:33faassenbut I tried that. let me try again.
14:52:39HipsterPuffinWouldn't really forum be the preferred method because it's (hopefully) searchable
14:52:44faassenoh wait, I even got rid of the argument altogether.
14:52:51faassenI tried creating my nested structure on the stack and then on the heap with new
14:52:53dom96HipsterPuffin: Yeah, but IRC is real time.
14:52:55faassenbut still no luck.
14:53:01HipsterPuffindom96: unlike VNUG?
14:53:09dom96no, unlike the forum
14:53:25faassenI want to be able to ask follow up questions real quick. :)
14:53:34HipsterPuffinin the VNUG there is less misunderstandings, and you go forward much faster than irc even
14:53:40OrionPKMhey dom96 how is the json module able to use {}'s, i.e. %{ "something: %"else" }
14:54:03faassenI can access the field, my loop is correct, I can echo things.
14:54:30AraqOrionPKM: by taking an openarray
14:54:47Araq{key: val} is just sugar for [(key, val)]
14:54:49faassenwhat is your preferred pastebin?
14:54:50dom96OrionPKM: The compiler transforms %{ "something: %"else" } into a openarray[tuple[key: string, val: PJsonNode]]
14:55:05dom96faassen: gist
14:55:10Araqand yes, that's documented :P
14:55:13OrionPKMinteresting.. im trying that and it's not working so well
14:55:16dom96It's got Nimrod syntax highlighting
14:55:22HipsterPuffinI think the only reason IRC wins over VNUG at the moment is because there is more people in irc. Which is what I'm trying to fix :P
14:55:37AraqHipsterPuffin: you have no idea
14:55:55Araqit's really loud in here all the time
14:56:02OrionPKMI get 'undeclared identifier {}'
14:56:27HipsterPuffinAlso VNUG is a great tool to help people in irc even. Because the people trying to help could discuss the issue in the VNUG and help the irc noob in irc
14:57:15Araqyeah because different channels for IRC don't exist
14:58:04HipsterPuffinAraq: did I say that? No. Just that when you are actually talking to each other it's faster and there is less misunderstandings
14:58:07faassenhttps://gist.github.com/faassen/7945477
14:58:19faassennot sure how to do syntax highlighting.
14:58:31dom96HipsterPuffin: I think for most people it's easier to communicate via text
14:58:37dom96especially about programming
14:58:49faassenyeah, there's a benefit to text when talking about programming. also it's less noisy.
14:58:53dom96VNUG should be just a fun hang out place for hardcore nimrod users
14:58:58HipsterPuffindom96: well it's easier to write something out
14:59:04HipsterPuffinbut I don't see how you couldn't do both
14:59:05faassenanyway, here's my gist. why does 'field.height' not work?
14:59:50HipsterPuffinlike in vnug "I have this problem on this line and it looks like this" *pastes text* "at the place where it says bla I'm getting this error blabla"
14:59:59*DAddYE joined #nimrod
15:00:09faassenmaybe I should just join vnug just to keep HipsterPuffin focused here. :)
15:00:25Araqfaassen: your problem is that the items iterator returns a read-only view
15:00:30faassenahah.
15:00:34HipsterPuffinI'm not in the VNUG atm, I'll be there when I get home hehe :D
15:00:53Araqthere is an mitems iterator for a mutable view but not yet in system
15:01:10faassenAraq: so what's the normal pattern to do this? am I doing something unusual?
15:01:13Araqit only exists for tables and more advanced collections
15:01:27Araqthe normal pattern for now is to use an old-school index
15:01:34faassenahah.
15:01:42faassenI usually use Python, so I expected this to work.
15:01:52faassenand it almost does as I can *view* the values.
15:02:23Araqwell python works very differently
15:02:27faassenI know.
15:02:39Araqit would work the same if you use 'ref TField'
15:02:51faassenin the TRow definition, right?
15:02:58Araqright
15:03:07Araqbut that's a stupid idea for performance
15:03:07faassenand then I wouldn't get a read-only view as only the reference would be read-only?
15:03:14Araqexactly
15:03:32faassenyeah, I figured I'd want everything non-reference for performance.
15:03:58faassenwhat's the reason behind it being a read-only view?
15:04:29*DAddYE quit (Ping timeout: 250 seconds)
15:04:36faassenI mentioned Python because the Nimrod syntax leads one to believe such a pattern works, and once I noticed the for-loop worked for reading I thought, okay, why not writing?
15:04:52Araqpeople love immutability these days
15:05:19Araqmaybe the default should be the 'mitems' iterator, I'm not sure
15:05:21faassendoes it let the compiler optimze some more?
15:05:37gradhafaassen: IIRC depending on python version and what you are iterating, python's for will allow modification but it won't "happen", because it's being done on a copy, which is more confusing
15:06:08faassenheh, well, Nimrod has mutable strings and tuples (which is odd coming from Python as those are the main immutable things).. so this whole immutability love is a bit mixed.
15:06:45faassengradha: hm, well, perhaps you're talking about modifying the array itself, otherwise I don't know what you're talking about.
15:06:55faassengradha: I was talking about modifying items in the array.
15:07:51OrionPKMso dom96, proc `%`*(elements: openArray[PJSonNode]): PJsonNode overload doesnt ever get called?
15:08:06OrionPKMunless you explicitly use `%`(args)
15:09:15dom96Yes, unless you write %{...}
15:09:34OrionPKMbut %{} is expecting key:value
15:10:10Araqtry %{:}
15:10:12dom96oh no. That must be the overload for JsonArray
15:10:23OrionPKMit is
15:11:11Araqfaassen: in general eliminating copies is easier than eliminating aliasing, so immutability tends to be good for an optimizer
15:11:36Araqbut it's much more complex than that
15:11:47OrionPKMaraq pass no items?
15:12:19OrionPKMso dom96 the JArray constructor has to be `%`(args) ?
15:12:56dom96Dunno. Maybe %[...] works?
15:13:01faassenso the best way to loop through indexes in an array is 'for i in low(array) .. high(array)'? or is there a helper that gives me the indexes? I only find items and pairs.
15:13:16faassenand this seems to be a bit verbose, repeating what I loop through in low() and high()
15:13:40faassenI could use pairs but then it gets a bit confusing, indexes for writing and item for reading?
15:14:21OrionPKMhmm actually that does work dom
15:15:57gradhafaassen: low(array) will most likely be zero, but it's either that or 0..len(x)-1
15:16:12faassengradha: true, that gets rid of some repetition.
15:16:52faassenI guess I can define my own indexes iterator. :)
15:18:29HipsterPuffinAraq: maybe we should switch to NSString and NSMutableString
15:23:24faassenfunny, I have to ask for help when I want to modify values in a for loop, but writing a generic iterator proc that yields array indexes was easy. :)
15:27:20gradhaI don't understand how the subexes module has a format for $named when no procs accept table like params
15:28:07faassenAraq: this immutable view thing in items. is this documented somewhere?
15:29:42faassengoing to wake up toddler from nap, so I will be intermittently or not-here soon. :)
15:30:21Araqit's not documented but it's also quite obvious from the type signature
15:30:32Araqit return a 'T' and not a 'var T'
15:30:58Araqbut surely it's a gotcha, especially when coming from python
15:31:10Araqwe need a "Nimrod for Python programmers" tutorial
15:31:32faassenah, okay, right, I am not used to the 'var' thing yet.
15:31:35faassenin return values.
15:31:38faassengot to think about that.
15:32:19faassenanyway, got to go now.
15:32:21faassenthanks!
15:32:26*faassen waves.
15:32:28Araqyou're welcome
15:32:35*faassen quit (Quit: faassen)
15:33:23Araqgradha: well subexes is a weird rarely used module
15:33:39gradhano worries, looked at the source
15:34:13gradhadoes parsecfg lack a loadConfig() to avoid depending on the tables module or similar?
15:34:43Araqin general I don't like tables
15:34:52Araqand use them only when really necessary
15:35:11gradhawhat do you use to store config files?
15:35:25AraqI don't store config files
15:35:34AraqI read them and process them
15:35:51Araqand set some globals that contain what I can't use immediately
15:36:12Araqso I have someGlobal instead of config["someGlobal"]
15:36:51Araqthat works much better anyway since then I can use the type system
15:36:59OrionPKMwhat are the rules for proc names that can be used with that {} syntax?
15:37:01Araqinstead of dealing with strings everywhere
15:37:10OrionPKMseems like !@#$% etc can be used
15:37:27OrionPKMbut not letters
15:37:33AraqOrionPKM: there is nothing special going on here
15:37:44Araqit's <operator> <curlies>
15:38:11Araqand an operator can't consist of letters unless it's some keyword operator
15:38:50OrionPKMwhy
15:38:57Araqbecause
15:39:24OrionPKMah, that makes sense :p
15:39:55Araqwell read the grammar and then you'll know
15:42:49Araq+4, +(1, 2) vs foo(4), foo(1, 2)
15:43:11Araqnote how +(1, 2) passes a tuple to the +
15:43:23Araqbut foo(1, 2) doesn't pass a tuple to foo
15:43:36OrionPKMI would have thought it would depend on how foo was declared
15:43:41OrionPKMproc foo vs. proc `foo`
15:43:51Araqthe grammar doesn't rely on symbol lookup
15:44:06Araqso how things are declared is irrelevant
15:44:33OrionPKMgot it
15:44:51OrionPKMwhat about symbol prefixes to "foo"
15:44:56OrionPKMe.g. `%foo`
15:45:07OrionPKMcant that be treated as an operator
15:47:28Araqno that's operator and then an identifier
15:47:44Araqoh you mean with the backticks?
15:47:59Araqwell backticks mean to parse it like an ordinary identifier
15:48:17Araqso `+`(1, 2) # doesn't pass a tuple to +
15:48:27OrionPKMhm
15:49:12OrionPKMI didnt mean calling with backticks
15:49:43Araqwell I answered every possible interpretation of your question :P
15:49:47OrionPKMlol
15:50:12OrionPKMIm not asking what's possible now, I'm asking about minimal modifications to parsing
15:50:16OrionPKMwhat I want is something like %tagname {..children.. }
15:50:40OrionPKMtreat `%tagname` as one identifier if tagname isn't otherwise recognized
15:51:14*brihat joined #nimrod
15:54:13Araqyou can hack it with a template/macro `%` that checks it got "tagname" as an identifier
15:54:34Araqbut I wonder why you want that
15:54:47OrionPKMI want to write a better html gen library
15:54:58Araqha
15:55:02Araqimpossible
15:55:04OrionPKMsince the one we have is a joke
15:55:15Araq-.-
15:55:20OrionPKMit's way overly restrictive :P
15:55:38Araqwell what we have is used already
15:55:44Araqand people tend to like it
15:56:06OrionPKMthere are a lot of problems with it
15:56:37Araqwell in my slides I should how to do it completely different
15:56:43Araq*I show
15:57:04OrionPKMthe reqAttr stuff shouldn't even exist imo
15:57:11OrionPKM<script> doesnt require a type
15:57:27OrionPKMleave it to the client to tell you if it's a bad tag
15:59:10Araqwell that's what the html spec used to say
15:59:23Araqnot sure if that changed
15:59:31Araqhtml keeps changing
15:59:34OrionPKMlol
15:59:50Araqso sure, lets have no validation
16:00:10Araqthat doesn't mean we need to change the fucking language definition to get a better htmlgen module
16:01:00OrionPKMguess not
16:01:14*DAddYE joined #nimrod
16:02:04OrionPKMI think it'd be nice if the HTML generator was more like the json generator, where it actually builds up a tree of nodes
16:02:24Araqyeah it would be nice
16:02:41gradhaOrionPKM: thanks for volunteering
16:02:54OrionPKMthat way you can do 'pretty' output vs minified etc more easily
16:02:54Araqbut since the compiler performs no deforestation it would also be much more inefficient
16:03:06EXetoCmore syntax!!!
16:03:36Araqwe have that already btw
16:03:47Araqit's some macro in the xmltree module
16:04:02Araqand works for every kind of xml including html
16:04:06OrionPKMcool
16:05:07Araqgradha: btw does -d:useFFI work for you?
16:05:23gradhahaven't tried it yet
16:05:25*DAddYE quit (Ping timeout: 245 seconds)
16:05:44Araqmy bet: libFFI doesn't work on mac
16:05:55gradhadoesn't zahary_ know?
16:06:13Araqor requires some stupid libfffi.fu.version.so.dylib instead
16:06:21zahary_I haven't tried it
16:06:27gradhaI'm sure it require downloading something from the appstore
16:06:52Araqlol
16:08:26zahary_it's called libffi.dylib and apparently ships with mac os
16:08:47gradhaawww... fu.version sounded so much more interesting
16:09:52*boydgreenfield quit (Quit: boydgreenfield)
16:10:09HipsterPuffinI actually kind of like that obj-c makes you type more when you want a mutable version of a collection or value
16:10:31HipsterPuffinnot because mutability should be avoided at any cause but just so that you think about i
16:10:33HipsterPuffintt
16:10:47HipsterPuffinhey zahary_!
16:11:13gradhaHipsterPuffin: how do you like mandaatory named parameters for each call
16:11:40AraqNSMutableString is a subclass of NSString iirc, which means the subclass breaks the basic invariants of the superclass
16:11:57Araqso yeah. great design.
16:12:01HipsterPuffingradha: honestly considering I noticed yesterday that I had accidentally passed parameters in the wrong order to my own procs I wouldn't mind
16:12:17HipsterPuffinAraq: yeah it's a subclass
16:12:20gradhaHipsterPuffin: well, that happens a lot in a language with disregard for types
16:12:21EXetoCstring hierarchies. awesome
16:12:31HipsterPuffingradha: it was in nimrod
16:12:45gradhaHipsterPuffin: stop using strings all over the place then
16:12:54HipsterPuffingradha: well it was sqlite code
16:13:01AraqHipsterPuffin: use foo(param1=a, param2=b) then :P
16:13:04HipsterPuffinno point in coverting to int and back for ids etc
16:13:08HipsterPuffinAraq: yeah
16:13:33Araqnimrod supports named parameters and hey, sometimes even I use them
16:13:37HipsterPuffinAraq: for the record I didn't say that objc has amazing design or anything
16:14:24gradhaif you were in the VNUG you would have heard the laughter
16:14:54HipsterPuffingradha: but you are never in the VNUG :P
16:15:08gradhacome on HipsterPuffin, join the VNUG! You'll never know if I'm there unless you come!
16:15:23HipsterPuffingradha: I will when I get home damn it!
16:16:54AraqHipsterPuffin: my jump optimizer doesn't NEED mutable state, but it's kind of nice to my users if it uses less RAM and doesn't copy the bytecode around pointlessly
16:17:27EXetoCThank god for the ability to specify parameter names at the call site. I went crazy with default arguments in nim-glfw for this reason :>
16:17:49HipsterPuffinAraq: well sure but a decent optimizer can remove those pointless copies pretty easily right?
16:17:51gradhaAraq: talking about types, shouldn't rstgen export the PDoc alias? I think I've seen other semi-public types, used in signatures but not immediately available from the generated docs
16:17:52*zielmicha joined #nimrod
16:18:09AraqHipsterPuffin: not any "decent" optimizers I'm aware of
16:18:23gradhaAraq: I guess it could be a bother since the compiler also defines it's own PDoc
16:19:07HipsterPuffinAraq: didn't you like make the argument a few minutes ago that immutability sometimes makes optimizing easier even
16:19:25AraqHipsterPuffin: yes. but I also said it's more complex than that
16:19:51Araqyou hit the "more complex than that" scenario
16:20:06HipsterPuffinyeah
16:21:39HipsterPuffinwell like I immediately added to my comment in order to prevent this impression that you got anyways. I don't think mutability should be avoided like the plague
16:21:58HipsterPuffinjust that if you don't get any real benefits from it it's cleaner to stay away
16:22:37Araqyou immediately get efficiency though :P
16:23:04HipsterPuffinnot always
16:23:06Araqunless you start to use multi-threading
16:23:13Araqthen the fun begins
16:23:20HipsterPuffinexactly
16:23:41Araqgradha: PDoc is a simple alias for my typing pleasure
16:23:48HipsterPuffinso yeah, if it give efficiency without ridiculous amounts of sweat, blood, and tears I am all for it
16:24:09HipsterPuffinso I don't know what you are on about trying to convince me when I already agree lol
16:24:41gradhaAraq: it's also an undocumented nightmare for people new to the module who are forced to look at the source
16:25:00Araqreplace it with it's "body" then instead
16:25:05Araq*its
16:26:12HipsterPuffinlol NSNull
16:26:13Araqusing P for a 'var' type is uncommon anyway
16:26:19HipsterPuffingreat job on that one
16:26:22*ddl_smurf joined #nimrod
16:26:33Araqddl_smurf is back!
16:26:38ddl_smurfheya
16:26:40Araqafter all those years ...
16:26:50ddl_smurflol don't get misty eyed =D
16:26:55Araqfed up with JS?
16:27:04ddl_smurfha, NEVER
16:27:19ddl_smurffed up with GC requirement ?
16:27:38ddl_smurfcheez 50 people, congrats on nimrod's growth dude
16:27:40HipsterPuffinfed up with food?
16:27:44*brson joined #nimrod
16:28:04Araqfed up with GC-related corruptions for sure
16:29:05Araqthanks for the congrats
16:29:08ddl_smurfhow the **€! did you know I was working on JS most of this time ?
16:29:17ddl_smurfwas I drunk again ?
16:29:56Araqwell you said JS is your favourite language :P
16:30:13HipsterPuffingtg!
16:30:15ddl_smurfyeah… hell I even like gorillascript
16:30:21*HipsterPuffin quit (Quit: Page closed)
16:30:22Araqand thanks to Google you can now use it for everything
16:30:26*Demos joined #nimrod
16:30:49ddl_smurfthat's true, also node's fault, but still, good JS is hard to come by
16:31:13ddl_smurfthese kids these days, they have 1 function-sized libraries for everything
16:31:39dom96it's been a long time ddl_smurf, welcome back
16:31:49ddl_smurfhey dom
16:32:06ddl_smurfcan't find a language to really invest in, want optional GC and zero cost iterators and macros
16:32:18Demoswait I thought that in js is was common to package your whole lib as one function to sever as a module and namespace
16:32:26VarriountAny reason removeDir uses walkDir, instead of walkDirRec?
16:32:43Araqusually the reason is efficiency, Varriount
16:32:54Araqof course we never even measure it
16:33:32VarriountAraq, the removeDir uses recursion along with walkDir, which is probably less efficient than a loop of walkDirRec
16:33:53ddl_smurf(my 2cents: there's a very good reason for a rmdir that doesn't work if the folder isn't empty - to use FS "global" lock)
16:34:13Araqnah, recursion kicks ass
16:34:33VarriountAraq, stack overflow...
16:34:52DemosI was thinking maybe wierd situations where you have simlinks and you end up trying to follow a dangleing symlink
16:34:53Demosor not
16:35:18VarriountAnd I've looked at the generated C, and the recursion isn't optimized away.
16:35:33Araqnor does it need to be
16:35:44Araqthe cpu is quite good at it
16:35:58DemosI think every C compiler worth its salt will to TCO (and GCC can do even more)
16:36:11Demosrecursion can be a bad thing when you have to like traverse a 4GB tree
16:36:43VarriountAraq, imagine trying to delete a bunch of minecraft maps.
16:37:02*linkmauve1 quit (*.net *.split)
16:37:11*q66 quit (Remote host closed the connection)
16:37:13Varriount(I'm assuming minecraft still uses that wierd folder based chunk storage system)
16:37:15EXetoCI'm thinking of making a freetype2 wrapper in C, and then bind that, simply because it seems like a less painful approach.
16:37:32*q66 joined #nimrod
16:38:03ddl_smurf(my question was semi serious though, does the runtime still leak without a GC ?)
16:38:45ddl_smurfEXetoC: why not add nimrod support to SWIG ? =D
16:38:56DemosI know you can set the GC to use ref-counting, which is "not GC" if you listen to the average C++ dev, and I think the entire GC gets eliminated if you do not use it
16:39:24Araqddl_smurf: sure it leaks, it's got realtime capabilities so why bother?
16:39:26EXetoCddl_smurf: isn't it similar to c2nim? which is a great tool, but some libs are just huge and/or messy
16:39:35ddl_smurfafaik only worse c++ dev listen to the average c++ dev
16:39:39Demosactually I hear the entire GC is implemented as a library, but I am unsure of that
16:40:07Araqit's not like you want to use nimrod's xml module in a kernel anyway
16:40:28ddl_smurfEXetoC: yeah it is, but it automates writing wrappers for quite a few languages
16:40:42Demosthere are things that are faster with gc (probably graph stuff, in particular cyclic graphs)
16:41:01Araqddl_smurf: we have c2nim instead of swig
16:41:02*q66 quit (Client Quit)
16:41:12DemosI think SWIG is a HUGE undertaking, nimrod is fast enought that it is not so worth it
16:41:22ddl_smurfDemos: sure, actually most things are faster with GC iirc, but still, i have a psychological problem with GCs =D
16:41:44Araqsaid the JS developer
16:41:58Araq;-)
16:42:07ddl_smurfyou can work around it if you really want to =)
16:42:21Araqoh really? well so can you in nim
16:42:37DemosI think if you are using "unique_ptrs" than manual management may be faster, unless you really need wierd ownership
16:42:39AraqDemos: the GC is implemented in Nimrod but that doesn't make it a library
16:42:44ddl_smurfpass a native array around, make sure you don't create a closure, use the array as the whole system memory, a la asm.js
16:43:00ddl_smurfbut anyway, i don't do server JS, that's where i'm more concerned about ram
16:43:16*capisce quit (Write error: Broken pipe)
16:43:32Demosnimrod's GC is really, really, really fast.
16:43:43Demosnot thread safe though
16:43:56VarriountErm, mostly thread safe, I thought
16:44:09Demoswell not thread safe in the sense that you can not use it for stuff shared between threads
16:44:25*dymk quit (Ping timeout: 338 seconds)
16:44:33ddl_smurfaraq: what's your take on rust type ownership model ?
16:44:43*q66 joined #nimrod
16:45:44Araqddl_smurf: I think it's somewhat misguided
16:46:10Araqfor reasons I will explain later, perhaps
16:46:19DemosI can give you /my/ take
16:46:21ddl_smurfyour purity system ?
16:46:33ddl_smurfsure
16:46:40Demosbut I know little about lang design, still here goes
16:46:42*dymk joined #nimrod
16:47:10Araqddl_smurf: in reality I'm waiting and if they have a really nice and sweet solution, I'll copy it :P
16:47:14VarriountI'm just happy to have a compiled language that doesn't require semicolons on every line, or excessive use of braces.
16:48:00ddl_smurfi don't think its sweet, its horrible to use, but i kinda don't see a better way to accomplish it, very much looking for alternatives
16:48:02DemosI think rusts ownership "stuff" expends a ton of effort on solving a problem that is not relevant for many people because of the garentees of functions in a data race free program and for situations where there are no races could increase the number of programs that fail to typecheck and are correct
16:48:17Demostl;dr feature has a low thrust/weight
16:49:05*capisce joined #nimrod
16:49:06ddl_smurfthe way i see it it's more about the interaction between refcounted/gc and threading than only race conditions though, spiky problem that
16:49:37Demosyeah, I kinda like nimrod's solution that says "don't share memory" and "if you really need to share memory you are on your own"
16:49:51Demosas a bonus I think that this speeds up the gc in the common case
16:50:13Demosand in the case where you need to share memory you already care about perf and you may want to manually manage memory anyways
16:50:54ddl_smurfnot much point in threading if you don't share something....
16:51:11Demoswell you share immutable data and send messages
16:51:21ddl_smurfthat's kinda what process isolation is for no ?
16:51:41Demosif you are sharing writeable data and having two threads cooperate to build a structure it is hard no matter what
16:51:48Demosand memory management is small peas
16:51:52Demosat that point
16:53:05ddl_smurfi dunno, there are some nice models (like disruptor) that do most of the heavy lifting in that regard
16:55:35gradhaAraq: I have Objc code which calls nimrod, and expects a cstring returned, how does that work with the GC, do I need to keep a global on the nimrod side so the return value doesn't get released?
16:55:36Demosthat seems like /almost/ just message passing, but the homepage does not really say wtf disruptor /is/
16:56:54ddl_smurfit is, each thread takes then surrender ownership, the disruptor thing is just a collection of threads that synchronises all the workers without locks
16:57:16Demosgradha, if the string that the cstring comes from is a ref you can call gc_ref (I think) on it to pin it, and gc_unref to unpin it, then use objective-cs memory management tools to call those setup and delete functions, there may be something better to do with cstrings though
16:57:17ddl_smurf(so there is no actual ownership of messages)
16:57:26Araqgah, I have to leave, interesting discussion
16:57:29Araqbbl
16:58:02Varriountgradha, if the Objc code releases what it is given, I think you need to allocate an untraced reference of the cstring
16:58:04gradhaDemos: yes, that's an alternative to a global
16:58:19Demosyeah that is a good idea ddl_smurf and one could do that in nimrod, my point was that you either want something like that, or you are writing extremely difficult code that you will be doing manual memory management anyways
16:58:23ddl_smurfgradha: you can also just copy the cstring to a nsstring, which will spare you a lot of pain (and the perf impact is probably tolerable)
16:58:37Varriountnsstring?
16:58:47gradhaddl_smurf: sure, but, by the time the nimrod code *returns*, aren't their variables already volatilized?
16:58:57ddl_smurfsorry, i assumed mac
16:59:14*boydgreenfield joined #nimrod
16:59:51VarriountIs there any way to use an expression var in a regular proc?
16:59:54ddl_smurfyour objc is calling nimrod that is returning a string ?
17:00:13VarriountSomething like "let x = v, z"
17:00:31gradhaddl_smurf: yes, exposed as a C function call, which would return a char*
17:01:10ddl_smurfyou should probably reverse that and have nimrod call you with the string as parameter, that way nimrod knows about the scope
17:01:46ddl_smurf(this kind of stuff is the whole point of SWIG)
17:01:59ddl_smurfVarriount: i don't understand what let x = v, z should do
17:02:11gradhaddl_smurf: I'm implementing the SWIG, so to speak
17:02:48Demosthe GC may treat strings and cstrings specially to make just returning the cstring more or less OK
17:04:29ddl_smurfeven if you were writing c that called a c library, returning char* should come with a method to release it, otherwise malloc is assumed
17:05:05gradhaddl_smurf: ho ho, like no libc method uses globals and is therefore non reentrant
17:05:09Demosunless you document that the string comes from a literal or something
17:05:11ddl_smurfif you have a special allocator (as nimrod does), you should provide a matching deallocator
17:05:52ddl_smurfalternatively, have two functions (a la windows api), one that returns the size, you allocate and pass that buffer to nimrod for filling
17:05:56gradhameh, I'll end up creating an objc object from nimrod, at least I know how to do that
17:07:01ddl_smurflast option is to provide nimrod with a pointer to your allocator and let it allocate with that then fill
17:08:24ddl_smurfafaik the very very very few globals used are well documented and are mostly special cases so that you don't need to use a global, do you have an example otherwise of libc that is non reentrant when re-entry could be an issue ?
17:10:04gradhastrtok vs strtok_r
17:11:07Demosyou could have in nimrod a function proc getString() : cstring that pins the string, and a release string that unpins it, return the cstring and then in objc copy it to a objectivec managed string then release it
17:12:47ddl_smurfinteresting thanks
17:13:45ddl_smurf(and indeed, strtok looks horrible enough they don't even provide an example in my man)
17:21:22*Hannibal_Smith joined #nimrod
17:22:36Hannibal_SmithAraq, do you frequent the D forum?
17:23:06Hannibal_SmithI did view some your message in the thread about D vs C performance
17:25:33*zielmicha quit (Ping timeout: 272 seconds)
17:28:28Demosinteresting thread, seems to me that bjarne stroustrup's reasoning for doing c++ holds, that good abstractions are not really that great if you can not get dirty and actually write fast code /when you need it/
17:31:00Hannibal_SmithC++ is a complex language, but have so many good concepts inside it
17:31:47ddl_smurfC++ is horrible in a company where you must collaborate with a variety of profiles
17:32:18Hannibal_SmithSo Sun made Java, a constrained C++
17:32:29Hannibal_SmithAnd people are "happy" with it
17:34:47Demosc++ does few things wrong, and what it does do wrong people seem to ignore, but yeah it is not 100% good
17:35:11Demosit /is/ good enough that until nimrod gets mature it is not worth going and dealing with immature libraries in another language
17:35:17ddl_smurfI don't trust people who say they fully know c++, and that scares me
17:35:56DemosBjarne Stroustup says on a scale of 1 to 10 for c++ knowlege he rates himself a 7!
17:36:59ddl_smurfsounds about right =)
17:37:28Demosbut this is true of most languages, there is A LOT to know
17:38:03ddl_smurfvery few are as dangerous as c++ to ignore, i've seen experts forget one of (5 now ?) constructors and just assume it wasn't defined
17:38:10Hannibal_SmithProbably depend also on how a complex the problem that you are going to solve is
17:38:25Demosddl_smurf, =delete fo life!
17:38:29Hannibal_SmithIMHO, a complex problem is helped from a "complex" language
17:38:31*DAddYE joined #nimrod
17:38:36*DAddYE quit (Remote host closed the connection)
17:38:45Hannibal_SmithBut using a "complex language" at is "full" is hard
17:38:50*DAddYE joined #nimrod
17:39:03Demosthere is little pointless in c++, I mean there is vector<bool> and dynamic exceptions specs and export and such but still
17:39:27*BitPuffin joined #nimrod
17:39:39ddl_smurfi don't know, few people actually understand C for me stay away from c++
17:40:12ddl_smurfstuff like undefined behaviour and sequence points
17:40:44ddl_smurfor the oh so subtle interaction between threading and signals
17:41:07Hannibal_SmithUndefined behavior is functional to compiler optimization
17:41:43ddl_smurfsure, i'm just saying, its hardly ever correctly applied in practice
17:42:08Hannibal_SmithAh yes, I think that everybody agree with you on this
17:42:12ddl_smurfyou'll find people going func(i++, i++) and yelling at compilers
17:42:43fundamentalIt does seem odd that that ',' was never defined to be a sequence point
17:43:17ddl_smurfcomma doesn't have semantic value, it's just help for the parser
17:43:22Demosnot really, since the primary use of ',' is not really sequencing and I bet actually benifits from it not being sequenced
17:43:29Demosddl_smurf, erm what
17:44:03Hannibal_SmithDo people actually use ,?
17:44:06Demosfor(int i = 0, int j = 0; i < foo.size(), j < bar.size(); ++i, j+=2) P{
17:44:07ddl_smurfit's not an operator or expression or anything, its just separator, it disappears after parsing
17:44:19Demoserm you can overload ,
17:44:36ddl_smurfoh i forgot that, you're right
17:44:41Hannibal_SmithDemos, some Boost library like Spirit do this
17:44:46ddl_smurf(overload , in C ??)
17:44:46Demosalso that for loop was wrong
17:44:50Demosno in c++
17:44:58Demosyeah Eigen uses it as well
17:45:19Demoslike Vector3f vec << 1,3,2
17:45:29Hannibal_SmithI like the possibility to overload operators
17:45:43Hannibal_SmithIn Haskell people can overload "anything"
17:45:51Demosno
17:45:57Demoshaskell does not allow arbitrary overloading
17:46:02Demosyou need to use typeclasses
17:46:13Demosyou can /create/ any operator
17:46:28Demoswell any binary operator, I dun think you can make trianry ones
17:47:03Hannibal_SmithI like this, because you can write little edsl in a more easy way
17:47:58Demoswell nimrod supports more or less arbitrary operators and some neat macros to make infix operators performant
17:48:29Hannibal_SmithNimrod is superior to C++ in this aspect
17:49:00Hannibal_Smith(and not only C++)
17:51:42Hannibal_SmithDemos, you seems for sure an experienced developer, you don't regret that Nimrod don't support (also) the OOP paradigm?
17:52:11gradhaHannibal_Smith: how come nimrod doesn't support OOP?
17:52:22Hannibal_Smith---it does?
17:52:48gradhait's a good part of the second tutorial
17:52:54Demosthe fact that nimrod lacks interfaces is kinda annoying, but I hear from people smarter than I that any kind of multiple inheratance (even interfaces) makes multimethods really hard
17:53:19Demosand I LOVE the way methods in nimrod are just functions
17:53:55Hannibal_Smithgradha, I have a really bad memory
17:54:06Hannibal_SmithI must reread the Nimrod documentation
17:54:08BitPuffindom96: VNUG!
17:54:23dom96I think soon enough somebody will create a nice macro for interfaces.
17:55:11dom96BitPuffin: yes sir
17:55:15Hannibal_SmithI also did read about adding something like typeclass to Nimrod
17:55:37BitPuffindom96: I am ze VNUG generrral
17:55:47dom96BitPuffin: give me a sec
17:57:40DemosI thought nimrod already had typeclasses
17:58:16Demosand dom96 wont that macro use nimrod's generic programming support, not dynamic dispatch?
17:58:54Hannibal_SmithDemos, is there a documentation page about it?
17:59:12DemosI dont think so
17:59:26Demosthere is one on typeclasses though, just not how to make your own
17:59:42Hannibal_SmithOk
17:59:43Demosagain not 100% sure it is in yet
18:00:39*brson quit (Ping timeout: 252 seconds)
18:04:34EXetoCmake sure to check the documentation for HEAD
18:12:01EXetoCthat example doesn't yet work IIRC
18:12:03BitPuffindom96: slow poke
18:14:07*CarpNet quit (Quit: Leaving)
18:14:25EXetoCit'd obviously be hard to miss had it been implemented already :>
18:15:16*hoverbear joined #nimrod
18:15:28*ics joined #nimrod
18:27:17AraqHannibal_Smith: occasionally I'm on the D forum
18:38:31*brson joined #nimrod
18:42:01Araqddl_smurf: in theory I'd agree with you but in practice inter process communication is so bad that I prefer threads and share nothing over processes
18:45:00ddl_smurfthat's kind of my point, if you're just going to with message passing, might as well IPC, threads for me are a) light fork for when the runtime has a fat ass, b) when the communication needs warrant more than serialisation
18:45:21*boydgreenfield quit (Quit: boydgreenfield)
18:45:54*boydgreenfield joined #nimrod
18:47:58Araqyes but you get instead:
18:48:14Araqa shitty means even when all you need is serialisation
18:49:21Hannibal_Smithddl_smurf, are not process more heavy?
18:50:05ddl_smurfdepends on your point of view, if you want strong isolation guarantees they are pretty much the only way to go
18:50:39ddl_smurfaraq: you really hate pipes/sockets that much ? =D
18:50:51Araqoh yes I do :P
18:51:03Araqthe API never makes any sense
18:51:13Hannibal_SmithMPI!
18:51:15ddl_smurfhow so ?
18:51:26Araq"what do you mean 'there is no way to tell how much data is in the buffer?' "
18:51:52ddl_smurfundefined behaviour for optimisation by the kernel =)
18:52:06Araqline based protocols when there is no 'readline' for sockets
18:52:11ddl_smurfforces you into scalable stream logic
18:52:17Araqbs
18:52:25Araqthere is no logic involved here
18:52:54ddl_smurfof course there is, do you really need to know how big the file is before you parse it ?
18:53:06Hannibal_SmithProbably, writing a production quality MPI library that scale is very hard
18:53:14ddl_smurfif you do its probably that you're loading the whole thing, i.e. you now have a hard limit
18:53:39Araqwell it helps to read what I wrote
18:53:49Araqline based protocols when there is no 'readline' for sockets
18:54:11Araqso? how am I supposed to handle this? implementing my own buffering on top?
18:54:13ddl_smurfi'm not one for line based (or any separator based) protocols, but that's really another debate
18:54:23Araqbecause otherwise I call recv for a single character
18:54:44Araqwhich seems rather desastrous for performance
18:54:47ddl_smurfyou could, but the cost is only in the sys call then
18:54:54Araqyeah
18:54:57Hannibal_SmithAlso, latency is probably bad for socket
18:54:57ddl_smurfso you buffer sys calls, which you should anyway
18:55:30ddl_smurfbut yeah, processes need some form of buffering, and which really depends on the application
18:55:40*vendethiel quit (Read error: No route to host)
18:56:24ddl_smurfthe good news is that there are only so many kinds of buffers, and they're imminently easy to put in runtime lib once and for all
18:56:59ddl_smurfthe stupidest buffering (i.e. fixed size, read again on depletion) would be enough for very good performance
18:57:19ddl_smurfwe're not talking audio processing here
18:57:29Araqwell we do that in sockets.nim
18:57:45Araqand now the Socket object has an attached buffer
18:58:14Araqso it's not compatible with C's socket type anymore
18:58:23ddl_smurfyou don't need to, a generic buffered stream type thing should be enough for any use case
18:58:23Araqetc etc. it never stops
18:59:18Araqperhaps that would have been the better design, but we had ddl_smurf around back then
18:59:23Araq*had no
18:59:36ddl_smurfyou flatter me sir !
18:59:38Hannibal_Smith"Buffered channels allow asynchronous writes, but only up to the buffer size, so that doesn't actually make things easier. Fully asynchronous channels, like you get in Erlang and Haskell don't have this problem, but they are unbounded so you have to be careful about filling them up (Erlang uses a clever scheduling trick to mitigate that problem, though)." <-From Simon Marlow
18:59:46ddl_smurfironically i suspect, but nevertheless =)
19:00:58ddl_smurfmore seriously, any of .net/java/ruby and so on are like that, if you want to buffer sockets that's a design choice, might very well be a valid (specially if you deal with threading/select()ing from within)
19:02:05ddl_smurfHannibal_Smith: you can get notification on when a write would be accepted, it's not really any trouble
19:03:04ddl_smurf(you should too, but you are correct in that a good practice forces proc-side buffering, I just don't mind it simply because of the large choices of approaches available, which i wouldn't want my kernel to consider)
19:03:22ddl_smurfif you don't care so much about performance, just stay in blocking and let the kernel do all the buffering you could want
19:08:38*brson quit (Ping timeout: 264 seconds)
19:14:03ddl_smurfI have two problems with posix streams though: closing FDs isn't threadsafe, and dup2() must have come from the same hell as printers just to torment humans
19:15:47AraqHannibal_Smith: latency of sockets is a valid point too
19:17:07Araqwe've had situations where we had to cache everything in the process just to get the performance we needed
19:17:09ddl_smurf(only really for "dumb" sockets, i mean, those without any flow control)
19:18:28Hannibal_SmithIn the end, any production system that have a cluster of machine uses some proprietary hardware for node interconnect (like InfiniBand)
19:18:43Hannibal_SmithTCP/IP is really the last option
19:19:57ddl_smurfmy guess is that most production systems using clusters don't actually need that
19:20:11ddl_smurfthat's already in the rather specialised zone
19:21:31Hannibal_SmithThese interfaces do things like kernel bypass
19:22:43EXetoCcan pattern be used for importc? can't remember. I'd like to specify a prefix
19:22:56Araqyes
19:24:21*brson joined #nimrod
19:24:54EXetoCok, grep to the rescue once again
19:25:55EXetoCI suspect that I can't turn initFreeType into FT_Init_FreeType though
19:26:51EXetoCso were the rules for proc names going to remain the same, other than the fact that the first character was going to be case sensitive?
19:27:52ddl_smurfhttp://nimrod-lang.org/c2nim.html#mangle-directive ?
19:27:54AraqI think so
19:28:32EXetoCok
19:31:35gradhaso looks like I've succesfully made a quicklook plugin to render rst files, any volunteers?
19:32:35Araqwhat's quicklook?
19:32:38ddl_smurfsure
19:32:51gradhait's the thingy that previews files on macosx
19:33:07gradhayou browse files, hit space, and get the preview of its content
19:33:19ddl_smurfdo i need nimrod ? not on the right computer now
19:33:23gradhawith this plugin files with rst|rest extension are rendered into html
19:33:42gradhaddl_smurf: you only need to trust running stranger binary code http://dl.dropbox.com/u/145894/t/QuickLook.zip
19:33:56ddl_smurfno worries =)
19:34:13ddl_smurfwhat was it ? qlmanage -refresh ?
19:34:41gradhapresumably, though for me removing and adding the file works too
19:34:50gradhaqlmanage -r
19:34:59gradhaI was getting annoyed that there's no rest ql plugin, but then realized github "misses" searches for qlrest and doesn't show repos
19:35:13gradhaso maybe there's a github conspiracy against finding rest projects
19:35:39gradhatry using github's search for "qlrest"
19:35:48gradhait will never point you to https://github.com/cluther/qlrest or any of the multiple mirrors
19:36:00gradhanot that you want to, they run python
19:36:10gradhaand therefore have dependencies, and slow runtime
19:37:43gradhaddl_smurf: presumably xcode targets 10.5, but I don't trust xcode
19:37:58ddl_smurfits using another plugin (QLColorCode)
19:38:33gradhayou can try qlmanage -d 1 -p file.rst to see why it's not being resolved, or if it's not being found
19:43:17*boydgreenfield quit (Quit: boydgreenfield)
19:45:35EXetoCAraq: So I guess I should use --header with c2nim in order to reduce repetition (defines used in several headers)
19:46:24Araqmeh, don't use --header if you can avoid it
19:46:44gradhaI can't avoid using --header
19:47:04EXetoCI'm sure a search/replace will do in many cases
19:48:30EXetoCbut not modifying the input files is kinda neat, because then it's very easy to sync with the upstream headers, right?
19:50:03*Demos quit (Ping timeout: 250 seconds)
19:50:50Araqright
19:54:21ddl_smurf(I hadn't noticed github had a search functionality but you're right, oddly absent - just google with site: =) )
19:54:21*boydgreenfield joined #nimrod
19:55:21gradhaon the other hand qlmark finds stuff, it's a conspiracy
19:55:35EXetoCbut no one does it I think
19:55:40Hannibal_SmithOT: If it walks like a duck, and quacks like a duck, it’s probably gonna throw exceptions at runtime.
19:55:45ddl_smurfmaybe the tokenizer just likes vowels in the name
19:56:14EXetoCHannibal_Smith: +1
19:57:27EXetoC(... and quacks like a duck, but ain't one)
19:57:32EXetoCtype errors at runtime sux
20:00:50*boydgreenfield quit (Quit: boydgreenfield)
20:04:07EXetoCAraq: can "typedef struct" be dealt with using c2nim directives? unless it's supposed to work, in which case I'll have to look at the preceding lines
20:04:14OrionPKMaraq im getting a sigsegv in the GC
20:04:17OrionPKMon newObj
20:05:37AraqEXetoC: typedef struct should work
20:05:51AraqOrionPKM: that could mean you're out of memory
20:06:02OrionPKMit was at ~13mb
20:06:26OrionPKMI am trying to track down a memory leak though
20:07:03AraqOrionPKM: -d:useSysAssert -d:useGCAssert
20:07:08ddl_smurfdoes the gc work with electricfence etc ?
20:07:11*boydgreenfield joined #nimrod
20:07:13Araqand see what that changes
20:07:31Araqddl_smurf: don't think so, it surely doesn't work with valgrind
20:07:52Araqunless you know how to config valgrind, but I don't
20:08:11ddl_smurfgod no
20:09:18ddl_smurfdoes the gc work with some malloc or directly with sbrk ?
20:09:51Araqwith mmap
20:10:26ddl_smurfinteresting, so you stick to page sizes ?
20:10:49Araqyeah
20:11:02Araqand larger pages would be sweet
20:11:43Araqbut posix doesn't guarantee proper alignment for anything larger
20:12:24ddl_smurfprobably loose performance gain anyway
20:12:34ddl_smurfcompared to a tmalloc or other
20:15:44EXetoCgradha: --header works for you? I tried to pass an non-existent file, but that doesn't cause an error
20:19:00gradhayes, --header generates a neat file with all my exportc pragmas
20:21:48EXetoCgradha: ok, I don't know what's missing here then https://gist.github.com/EXetoC/7950650
20:22:59gradhawhat does that have to do with --header? Oh, wait, you are talking about c2nim, I was talking about the compiler's --header
20:24:31EXetoCok
20:25:14gradhafor me compilation of a dummy .c file including those fails because of the checks on line 24
20:25:16*Hannibal_Smith quit (Quit: Sto andando via)
20:25:19*boydgreenfield quit (Quit: boydgreenfield)
20:26:42EXetoCyou'd need all those headers too
20:27:28gradhacan't help you there
20:29:49NimBotAraq/Nimrod vm2 da687af Hitesh Jasani [+0 ±1 -0]: Add docs for connecting to postgres with keyword/value connection... 1 more lines
20:29:49NimBotAraq/Nimrod vm2 f340eb3 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Merge pull request #706 from hiteshjasani/master... 2 more lines
20:29:49NimBotAraq/Nimrod vm2 1abb83e Zahary Karadjov [+1 ±4 -0]: adding some provisions for writing lower-level unit tests targeting specific sub-systems of the compiler... 4 more lines
20:29:49NimBotAraq/Nimrod vm2 826b817 Zahary Karadjov [+0 ±1 -0]: fixes #708... 5 more lines
20:29:49NimBot34 more commits.
20:30:19EXetoCAraq: is --header for c2nim supposed to work? how have you been dealing with repetition in multiple headers?
20:31:04OrionPKMaraq what will those two flags tell me
20:31:24EXetoCor whoever I should ask. I don't know who generated all the wrappers
20:31:34AraqOrionPKM: they might tell you what's really wrong with your code
20:32:04AraqEXetoC: I think it works, yes
20:32:14AraqI simply edit the header instead so that c2nim likes it
20:32:24OrionPKMfingers crossed then
20:32:24OrionPKMafk
20:33:24*boydgreenfield joined #nimrod
20:34:19ddl_smurf(in my experience araq's recommendations, when you try against them, it bites you in very strange ways down the road, so maybe a little git rebase - type stuff for following upstream would be called for)
20:34:54gradhaAraq: the rst parser chokes on unknown .. directives, so I want to add a soSkipUnknownDirectives flag
20:35:14Araqare you sure that's a good idea?
20:35:34Araqthe directive could affect pretty much everything
20:35:34gradhathe alternative being knowing all possible human invented directives?
20:35:34Araqyou can't just pretend to not know it and go on
20:36:04EXetoCAraq: That must've been a pain in the ass in some cases. freetype2 apparently consists of 89 headers
20:36:04gradhaso they are listed somewhere? I thought you could make them up
20:37:04Araqyou can but only with a python plugin
20:37:39gradhawat
20:37:49AraqEXetoC: c2nim is not yet up for the "I don't want to modify the header" workflow
20:38:19gradhameh, I guess I have to implement http://docutils.sourceforge.net/docs/ref/rst/directives.html
20:39:24Araqwell RST is incredible spec, no wonder the world ended up with markdown
20:39:39OrionPKM[GCASSERT] waMarkGray
20:39:59gradhaAraq: I guess I'll wrap one of the markdown C parsers
20:40:24OrionPKMthis time it's a newObj call in jester
20:40:54AraqOrionPKM: cool, how large is your program?
20:41:14OrionPKMat runtime? it got up to ~12-13 mb again
20:41:14Araqno, its source code
20:41:24Araqlooks like the nimbuild bug we're hunting :P
20:41:39OrionPKMthe exe itself is 1057kb
20:42:04*boydgreenfield quit (Quit: boydgreenfield)
20:42:14*fundamental quit (Read error: Connection reset by peer)
20:42:44OrionPKMthe good news is if I disable the http request my program is doing and just go to disconnecting/reconnecting from my websocket the memory usage appears fairly stable
20:43:14OrionPKMbut I throw a jester http request, and grows much more quickly
20:43:24OrionPKMthrow in*
20:43:44OrionPKMafk 15
20:45:14EXetoCAraq: I assume that you've resorted to search/replace then. hopefully nimgrep will get the job done
20:45:34*Demos joined #nimrod
20:45:34Araqno I *edit* the header file
20:46:14shodan45I don't know why, but I always confuse Dart and Rust. But not Nimrod! Nimrod is such a... unique... name. :)
20:46:24EXetoC-.-
20:46:24VarriountLets throw rusty darts.
20:47:39AraqOrionPKM: yes I know there seems to be a leak on windows
20:48:24shodan45it's because "Nimrod" has 6 letters. which is more than 4. hence, better!
20:48:44*shodan45 goes off to take his pills
20:49:04Araqshodan45: wrapped Qt already?
20:49:44shodan45Araq: I wish :/
20:49:59shodan45I was mostly asking out of curiosity
20:50:19shodan45I need a lot more experience with nimrod before trying something like that :)
20:50:44gradhashodan45: nah, you only need the correct amount of alcohol
20:53:04shodan45if I were to wrap Qt, I'd want it to be nimrod-ized, like how PyQt added some niceties on top of Qt to make it more "pythonic"
20:53:39shodan45and I just don't know enough nimrod yet to know what "nimrod-ized" means
20:53:39gradhaI understand that feeling, but it's the kind of feeling which prevents you from starting any big project at all
20:53:39OrionPKMaraq have you been able to reproduce it yourself yet
20:54:39gradhashodan45: do you know python?
20:54:39shodan45gradha: yeah, pretty well
20:55:04gradhashodan45: well, then nimrod-ized means to look like python but to perform about 20 times faster
20:55:19shodan45heh.
20:55:29gradhaI think it's a builtin feature of the language, so don't worry
20:57:24AraqOrionPKM: couldn't reproduce it under linux if you remember, might try again tonight
20:57:24*Demos quit (Ping timeout: 245 seconds)
20:57:39Araqunder windows
21:01:39*fundamental joined #nimrod
21:01:59AraqOrionPKM: does jester trigger the crash?
21:03:34OrionPKMi just went to the coffee shop and back, without that call to jester its at 4mb
21:04:04OrionPKMthats connecting/disconnecting from websocket every 100ms
21:05:19OrionPKMi mean to say I went to the coffee shop while the program was running..
21:06:04Araqwell please file a new bug report for the crash
21:06:19Araqmight really help me debugging things
21:06:44OrionPKMI can perhaps build another sample app that reproduces it w/ just asyncio/jester
21:07:04Araqplease do so
21:08:34Varriountdom96, ping
21:09:44*boydgreenfield joined #nimrod
21:10:44Zuchtowhat is this thing with the {.effects.}?
21:11:04VarriountZuchto, side effect tracking system
21:11:14*Hannibal_Smith joined #nimrod
21:11:14Zuchtoah, so "effects" == "side effects"?
21:11:39gradhanot necessarily
21:11:49Varriounthttp://nimrod-lang.org/manual.html#effect-system
21:12:59gradhaoh, so effects is for that, I was thinking of tags
21:19:34*DAddYE_ joined #nimrod
21:21:44*DAddYE quit (Read error: Operation timed out)
21:25:39*DAddYE_ quit (Remote host closed the connection)
21:26:14*DAddYE joined #nimrod
21:26:44*vendethiel joined #nimrod
21:32:19VarriountAnyone know why the build server is down?
21:32:39gradhathe VNUG takes up all the bandwidth
21:32:59VarriountIs that true?
21:33:09gradhaonly if you believe me
21:33:09VarriountActually, how much is the VNUG costing?
21:33:19OrionPKMgradha said it, so it must be false
21:33:29OrionPKMreturn not gradhaSaidIt
21:33:59ddl_smurfwhats a vnug ?
21:33:59VarriountOrionPKM, I don't know if I've mentioned this, but whenever I read your name, I think of Ness and Lucas from the Earthbound/Mother series.
21:34:09gradhavnug = Varriount's Nimrod User Group
21:34:09Varriountddl_smurf, teamspeak server for nimrod.
21:34:24OrionPKMi have no idea what that is :p
21:34:24VarriountNo, It's the virtual nimrod user group
21:34:34EXetoCgradha: really low bandwidth huh?
21:34:59VarriountIt might be more cost effective to just use something like google hangouts, and have one person on all the time.
21:34:59gradhaEXetoC: dunno about you, I'm streaming kpop
21:34:59ddl_smurfX)
21:35:44EXetoCgradha: the best codecs available are often overkill, so maybe it could be lowered then
21:36:04EXetoCif it can even be configured
21:36:34gradhaEXetoC: kidding, I have nothing to do with the farm's problems
21:36:44EXetoCc(:)-<
21:36:54gradhaneither do I stream kpop, I prefer to upload whole files at a tiime
21:37:04*Varriount puts away the pitchforks and flaming torches.
21:37:24ddl_smurfanyone sc2 here ?
21:37:34Varriountsc2?
21:37:34ddl_smurfstarcraft 2
21:37:34gradhacome on Varriount
21:37:44gradhaall the cool kids do sc2
21:37:44VarriountNo.
21:38:04ddl_smurfyou teamspeak about compilers, but don't sc2…. very neckbeard =)
21:38:24VarriountI don't have a neckbeard. I'm clean shaven.
21:38:44OrionPKMtalk is cheap
21:38:59ddl_smurfnot on voip its not
21:39:09OrionPKMactually it's only like $10/mo that's pretty cheap :p
21:39:09gradhaonly if you have bandwidth caps or something
21:39:24Varriountgradha, which most of the world has.
21:40:04gradhaluckily I live in a 3rd world countrly, so I have a plain monthly fee
21:40:24VarriountWhich country?
21:40:54gradhaSpain, the most promising country from the north of Africa
21:41:04Varriount:O
21:41:44gradhaSouth corea is much better, instead of skype they use sc2 to chat
21:42:04gradha"mom, pleas don't zerg rush me while I'm talking with friends!"
21:42:59OrionPKMaraq looks like it's not happening from w/in jester
21:43:14OrionPKMaraq might be happening in my sourcecode filter
21:43:59gradhaVarriount: I just bought some cloud thingy, indeed there are bandwidth caps
21:43:59ddl_smurfjester is true dom96 style, 3 tiny files and one 20 page file
21:44:24ddl_smurfwould you mind describing what you mean bu source code filter in relation to jester ?
21:45:14Zuchtohang on... system.== isn't defined for uint16?
21:45:24Zuchtoit isn't defined for any unsigned integer at all?
21:45:34gradhaZuchto: maybe it is in the unsigned module
21:46:44Zuchto... so there is a separate module for unsigned arithmetic?
21:47:14gradharumors say people using unsigned types live less
21:48:25ddl_smurfhttps://github.com/Araq/Nimrod/blob/master/lib/core/unsigned.nim#L11
21:49:00Zuchtostill... it's fairly common and as far as logic goes it's often better to use unsigned values if there is no meaning of the value being negative
21:49:25Zuchtowell well... i was expecting to find something odd with nimrod... i guess this is where it starts :)
21:50:00gradhaZuchto: didn't you read the forum rant?
21:50:10Zuchtogradha: nope
21:50:10gradhalet me find it for you
21:50:45gradhasearch for rant http://forum.nimrod-lang.org/t/313
21:52:35Zuchtothanks :)
21:53:25OrionPKMaraq is it possible getLocalTime and/or getGMTTime are leaking?
21:53:45*fundamental quit (Read error: Connection reset by peer)
21:54:25*fundamental joined #nimrod
21:57:25gradhadom96: just got access to a Linux debian7 3.2.0-4-amd64, want a nimbuild tester there?
21:58:40OrionPKManyone who has a chance, please test this: https://gist.github.com/onionhammer/7952099
21:58:55OrionPKMaraq, that leaks on my machine
22:00:05gradhaOrionPKM: interesting "lib/posix/posix.nim(30, 18) Error: undeclared identifier: 'TTime'"
22:00:15OrionPKMwell thats no good lol
22:00:40gradhayeah, also I've noticed too idetools segsevs recently as you mentioned
22:03:15OrionPKMgradha try that version
22:03:25OrionPKMerm, oh wait nm
22:03:25OrionPKMit wont build for u still
22:03:55OrionPKMif I comment out the getLocalTime/getGMTime, the memory stays stable
22:03:55OrionPKMotherwise it grows rapidly
22:05:05gradhaIIRC there are some problems with the default gc and changing the gc to bohem or something may help
22:05:15ddl_smurfdoes it need to be both getLocalTime and getGMTime ?
22:05:25OrionPKMddl_smurf dont think so
22:05:35ddl_smurf(you may also have more success introducing some scope)
22:05:45OrionPKMit can be either or
22:05:55OrionPKMthere is scope
22:06:40ddl_smurfyou never leave a scope in that code, while you overwrite, taking stabs in the dark at the gc, i could guess leaving a scope would help
22:07:05OrionPKMloop body is a scope, no?
22:07:25ddl_smurfok a proc, something that would be on the stack
22:07:40ddl_smurf(i'm very rusty with nimrod - ha)
22:08:00OrionPKMI dont think that would make any difference
22:11:00OrionPKMaraq
22:11:00OrionPKMit's the tzname parameter of tmToTimeInfo
22:11:35OrionPKMyou add in a string to tzname, it adds memory
22:12:55OrionPKMif I change tzname to initialize to nil, the leak isnt happening
22:13:40ddl_smurfwhy would'nt that be GC-ed ?
22:23:00OrionPKMddl_smurf did you try that gist?
22:30:40joelmoOrionPKM: I tried to run it, it doesn't leek memory for me, using 416KB
22:30:55OrionPKM# doesnt grow in the console?
22:32:55joelmoOrionPKM: there I get memory: 61000 to 77000
22:33:15ddl_smurfnah, no windows, did you try with a proc ?
22:34:05joelmoIm on 5b96890 if that matters
22:34:40joelmooh no sorry, i ran it with 9.2
22:34:50OrionPKMno windows?
22:35:05joelmoMac
22:36:35OrionPKMjoelmo sorry was responding to ddl_smurf
22:37:00OrionPKM61000 to 77000?
22:37:25OrionPKMin the output?
22:37:25ddl_smurfmac
22:37:55OrionPKMok, so you're both on OSX and it's not leaking?
22:39:05ddl_smurfholy shit, compiling nimrod got *a lot* faster in a year
22:39:45ddl_smurfoh, wait, no, that was koch X)
22:40:35OrionPKMit is faster on osx
22:40:35OrionPKMbecause it uses clang by default
22:41:05BitPuffinHmm
22:41:05BitPuffinin a source code filter
22:42:05BitPuffinif I wanna do <a href="/articles/show/$articles[i].id/$articles[i].slug"> is that the correct way to do it?
22:42:45joelmoOrionPKM: I was using the latest release though
22:46:20BitPuffinwhere articles is a tuple
22:51:35OrionPKMok thanks guys, I submitted a bug
22:52:42dom96Varriount: Sorry, nimbuild is back up now.
22:53:04dom96gradha: We already have a amd64 machine so it's ok.
22:53:11OrionPKMdom96 does nimbuild have leakage as well?
22:53:32dom96OrionPKM: don't think so, why?
22:53:45OrionPKMaraq was saying the build server crashed a lot I think
22:54:17dom96that's not because of leakage
22:54:24OrionPKMwhat is it because of?
22:55:07*darkf joined #nimrod
22:55:16OrionPKMI've been getting SIGSEGV which return stack traces to gc.nim, and it's because of a leak
22:56:15gradhadom96: tell the truth, nimbuilds depends on your lifeforce and you just took a nap
23:00:18BitPuffindom96: bladibla!
23:00:20BitPuffinnugv!
23:04:32dom96OrionPKM: async bugs
23:09:01BitPuffindom96: vnugg!!
23:10:00gradhajust received some Apple email telling me next iOS version will suck as badly
23:10:24*gradha hopes to not have broken the NDA by saying something so obvious
23:10:51OrionPKMwhy do you have iOS
23:11:06gradhait's the thing that comes with iDevices
23:13:46BitPuffinOrionPKM: join the VNUG! :D
23:13:53OrionPKMnevar
23:14:02BitPuffinme and Varriount are in there
23:14:07gradhaOrionPKM: join the VNUG!
23:14:56OrionPKMi dont use teamspeak
23:16:03*vendethiel quit (Ping timeout: 240 seconds)
23:17:35*vendethiel joined #nimrod
23:18:34BitPuffinOrionPKM: because you hate non-freedom?
23:23:13gradhagood night, honey badgers
23:23:21*gradha quit (Quit: bbl, need to watch http://www.youtube.com/watch?v=hcDEWiH-ciw again)
23:34:41ZuchtoI have a function declared as: proc newPanel*(w, h: int): TPanel = TPanel(w, h, array[TCell, w*h]) and when I try and compile it I get "invalid type: 'proc (int, int): TPanel'" Anyone who could tell me why?
23:37:08Araqthe error msg is weird, but your array[TCell, w*h] can't work
23:37:25Araqfirstly the order is wrong and secondly array constructors don't work like that
23:38:51ZuchtoAraq: ah, thanks
23:38:55OrionPKMaraq https://github.com/Araq/Nimrod/issues/746
23:39:52AraqOrionPKM: alright well I'm way more interested in the GC crash
23:40:21Araqddl_smurf: ok, lets play sc2
23:40:31OrionPKMaraq this is the cause IMO
23:40:55OrionPKMaraq once this grows out of hand, the gc would eventually crash i think
23:41:54Araqhmm alright
23:42:09OrionPKMi traced that request through jester we were talking about
23:42:14OrionPKMall the way to that times call
23:43:27ddl_smurfi'm so bad it keeps giving me 5 more placement matches, bronze is too high for me =)
23:44:17ddl_smurf(i did reproduce the bug OrionPKM is talking about, but i'm really rusty, not sure i got the gc into the build)
23:44:58Araqwell I never play, so now you know how good I'm at it
23:45:25OrionPKMbest i got was silver :P
23:45:31OrionPKMbut I hate 1v1s
23:45:42ddl_smurfme too, can't 1v1 drunk
23:46:07OrionPKMi was probably the equivalent of platinum at my best
23:46:19ZuchtoAraq: even without the none-working array constructor it gives the same error. I replaced the body of the proc with "result.w = w; result.h = h" (but with a newline instead of ;)
23:46:29ddl_smurf(silver is top 50% i think)
23:49:29ddl_smurfwait, you sc2 without ts ?
23:51:57ddl_smurfk well, ready on the gaming channel of the VULVA
23:52:01ddl_smurf*VNUG
23:52:21fowllol
23:52:23fowlvulva
23:54:15AraqOrionPKM: well I can reproduce it
23:54:23OrionPKMwhich platform?
23:54:27Araqwindows
23:54:40Araqddl_smurf: well I'm kidding, no time for playing, sorry
23:54:52EXetoCZuchto: names for all the fields must be specified when constructing an object
23:54:59ddl_smurfpff pussy
23:55:14AraqEXetoC: really? I don't think so
23:55:23EXetoChuh
23:56:13AraqZuchto: looks suspicious to me, please make a bug report
23:57:06ZuchtoAraq: I found that it "works" if I just remove the openarray field in the tuple (TPanel)
23:57:23AraqZuchto: well then the compiler is correct
23:57:32Araqopenarrays are only valid as parameters
23:57:37EXetoCAraq: I mean when actually invoking the ctor T(x: 1...)
23:58:12AraqEXetoC: I know but you're wrong, it depends on the structure of T
23:58:13Zuchtook, how would I then go about if I want a field of a tuple or object to be of a variable length (decided at runtime?)
23:58:24fowlEXetoC, nope, ur drunk
23:58:30AraqZuchto: use a 'seq'
23:58:30fowlZuchto, use a seq[T]