<< 16-03-2014 >>

00:01:32*Guest31831 quit (Quit: Leaving)
00:06:00EXetoCSkrylar: see beep
00:06:13Skrylarskrylar is not robot
00:06:21*Skrylar awaits insertion of floppy diskette
00:06:54EXetoChttp://www.urbandictionary.com/define.php?term=beep&defid=582119
00:06:59EXetoCand meep is that muppet dude
00:09:26Skrylar-.-
00:09:36SkrylarI made the compiler segfault itself.
00:13:23flaviuIsn't the PEG `&(\n/^)` equivalent to the regex `^`? It refuses to match anything but the input start.
00:14:55*io2 quit ()
00:16:33runvncdom96: is there a way to process a request through a route, but have jester just not close the socket?
00:16:47runvncI am putting some requests in a redis queue that gets handled by another process
00:17:17runvncand I get like a callback from my little queue module
00:18:15dom96use sendHeaders
00:18:20dom96IIRC the socket won't get closed then
00:18:32runvncis that all? awesome
00:19:00runvncI have been trying to do this with httpserver but I really need all the stuff you put in jester so I had to revise that idea
00:19:23dom96hrm, well i'm looking at the source and it looks like I'm wrong
00:19:25runvncand I can get the socket from response.client maybe
00:20:48dom96I could have sworn I added this :\
00:20:57runvncI was thinking maybe if I could get the socket out of the response and then just hack on a new TCAction type to say don't close
00:21:22dom96yeah, well I think that TCActionRaw shouldn't close the socket.
00:21:26dom96So just use that.
00:21:40dom96Should be a fairly easy change.
00:21:55runvncyou think I need to change jester, or can I set response.data from my program
00:22:35dom96you need to change jester
00:23:05runvncok thanks
00:23:23*zielmicha quit (Quit: Connection closed for inactivity)
00:23:36dom96You should be able to do: if resp.data.action != TCActionRaw: on line 341
00:24:03dom96Argh, nah. The resp will be out of scope.
00:24:13dom96You can create a var similar to the 'matched'
00:24:18dom96and set it in routeReq
00:24:33*dom96 should really reevaluate this excessive use of templates in Jester
00:24:45runvncok thanks
00:25:23runvncI just have to grab breakfast and then I will try to figure it out don't tell me the whole thing please
00:25:24runvncheh
00:28:58renesachttps://github.com/Araq/Nimrod/blob/7778e79f24a1da4dccfeacc0e9936b171fd1eb74/tests/misc/tinout.nim
00:29:13renesac<-- why int literals can't be passed to procs expecting 'var' parameters?
00:30:04Skrylarrenesac: because 'var' implies the input is mutable, a literal is not mutable
00:30:32renesacwell... but it isn't an imutable variable either
00:30:49Skrylarliterals are immutable
00:30:52renesacit is not like a person reading that code will assume I wanted to change what '3' means in the code
00:31:30EXetoCI've wanted the ability to introduce vars at the actual call site
00:31:31renesacput a gap in the integer range
00:31:39Skrylarwell when you say '3' its going either in to .STATIC space or getting shoved in registers directly, so changing it is either not possible (static pages are read-only) or silly
00:31:46EXetoCbut I don't think I reported that
00:32:07Skrylari get to track down why this rectangle packer ICEs :/
00:32:11renesacbut literals could go in a different static space
00:32:18Skrylar"var rect: Rectangle[T]" # ICE
00:32:41renesacso this expression could be calculated at compile time
00:34:47renesacor at least the compiler declare a 'var x = 3' for you in those cases
00:41:16renesacI also wanted to reuse the parameter variables when doing calculations, w/o having to came up with a new name and declare a var with that new name
00:41:33EXetoCI don't think it matters what the rvalue is. it's just a syntactic shortcut
00:41:57renesacand probably go around the rest of the function replacing the parameter name by the new var name
00:42:52renesacat least give the option of marking 'var x' on the parameters line to make that parameter variable...
00:42:58renesacbut alas, this is already token
00:43:26renesacwhy the current 'var x' isn't 'ref x'?
00:43:26*clovis quit (Quit: clovis)
00:43:27EXetoCvariable?
00:44:21renesacyeah, like "proc foo(a,b: bool) = if a: b = true; (do the rest of the function)"
00:44:29renesacw/o changing b at call site
00:44:57renesaccurrently we need to define a new 'c' variable to do that
00:44:59EXetoCbecause ref means a traced GC-managed reference
00:45:42EXetoCI don't know what you mean
00:45:44renesachum, there are procs that actually expect a 'ref'?
00:45:54EXetoCyes
00:45:56renesacEXetoC, what wasn't clear?
00:46:30renesacthe snipped I gave don't compiles
00:46:43renesacbut would be the most convenient behaviour
00:46:46EXetoCrenesac: ok so you mean mutable without actually passing by reference
00:47:01renesacyeah, mutable but only inside the function
00:50:24ScriptDevilSmall suggestion. Given all the metaprogramming that Nimrod can do, suggesting when false: for comments seems a bit of a let-down. Is there something else that people use for block-comments?
00:50:53renesacScriptDevil, ctrl + shift + c
00:51:18renesacor the equivalent on your editor
00:51:22ScriptDevilrenesac: Or M-; I know the editor shortcuts (Assuming you are talking about it)
00:51:51ScriptDevilI felt suggesting a hack like "when false:" in the tutorial isn't too neat.
00:52:27renesacthat hack actually works better than C block comments
00:52:31renesacit is nestable
00:52:43flaviuIn python, multiline comments are strings. That seems like a hack...
00:52:58renesacoh
00:53:05renesacnimrod supports that too
00:53:14dom96You can also use: discard """ ... """ in Nimrod.
00:53:14renesacdiscard """ your comment """
00:53:45ScriptDevilYes, C-comments are not too good.
00:53:50ScriptDevildiscard seems nice.
00:56:35EXetoCdiscard is necessary because values cannot be implicitly ignored
00:56:57EXetoCso it's just a literal that you're throwing away
00:57:46dom96I think it would be nice to make """ """ an exception to that rule.
00:57:53ScriptDevilEXetoC: Yeah, it is fine. I don't want to complain too much, but it is just that I generally have non-docstring comments set to a color which has very low contrast to the BG-color.
00:58:05ScriptDevilBut that is just my workflow.
00:58:16dom96Although I would prefer a different multi-line comment syntax.
00:58:53ScriptDevilSeveral languages provide nestable block comments, Haskell {- -} and Ocaml (* *)
00:59:06ScriptDevilOr ruby =begin =end
01:00:14ScriptDevilAlso, I am assuming that when false: still syntax checks the dead-code. Which is in itself something I wouldn't want for some temporary code I stashed away.
01:00:36flaviuScriptDevil: IIRC it doesn't
01:00:54renesacor Lua --[==[ ]==]
01:01:01*Matthias247 quit (Read error: Connection reset by peer)
01:01:33renesac(with zero to infinity '=')
01:01:38ScriptDevilrenesac: That lua thing is a serious piece of work... I lol at the number of extra == it piles on :D
01:02:02EXetoCwhat about this? --[==[##[@@[$$[]$$]@@]##]==]--
01:02:31ScriptDevil:o Don't tell me that is a real thing. I haven't done much Lua, but that is an eyesore if I have ever seen one.
01:02:32renesaceverything inside the --[==[ ]==] is commented out
01:02:41renesacif it is lua
01:02:56EXetoCrenesac: what do you mean? any repetition is optional?
01:03:07EXetoCScriptDevil: nah
01:03:09renesacyes
01:03:14renesacthe basic form is
01:03:19renesac--[[ ]]
01:03:30renesacbut then you cant put a ]] inside it
01:04:26renesacbut if you use --[=[ this comment contains ]] ]=] it allows the ]] inside the comment
01:04:28*ScriptDevil mumbles It is turtles all the way down...
01:05:04renesacyou only need simetrical number of == for each comment level
01:08:40*CARAM quit (Remote host closed the connection)
01:08:41*ics joined #nimrod
01:10:48*XAMPP joined #nimrod
01:24:41*CARAM joined #nimrod
01:29:26*EXetoC quit (Quit: WeeChat 0.4.3)
01:31:31Skrylarhow do things keep getting stuck in my 3 key
01:40:13*xenagi joined #nimrod
01:51:06*CARAM quit (Remote host closed the connection)
02:08:57ScriptDevilSkrylar: You probably aren't looking for an answer. But it could be because it is right above "e" which is pressed most often.
02:10:34*ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
02:13:01SkrylarScriptDevil: probably.
02:13:36SkrylarSkrylar: though so far the problem happens most on flat membrane keyboards; my mechanicals don't do that
02:18:14*ScriptDevil quit (Quit: "Breakfast...")
02:23:42*q66 quit (Quit: Leaving)
02:23:54fowlfowl, you are pretty k00l
02:24:00fowlfowl, thanks man, i like you too
02:28:09*Demos joined #nimrod
02:30:33renesachttps://gist.github.com/ReneSac/681bc1485ed2ccde6ecb <-- what is happening here?
02:31:06fowlrenesac, you dont return anything from ++
02:31:38renesacright, but then 'Error: expression '++ x' has no type (or is ambiguous)'
02:32:03renesacI must return a value?
02:32:24fowlrenesac, since you dont return or use the result variable the result is 0
02:32:29renesacyeah, I guess yes
02:32:51renesacok, just put a discardable there
02:32:59renesacand it is all set
02:33:26fowlwhat exactly do you want here
02:34:11renesachttps://gist.github.com/ReneSac/681bc1485ed2ccde6ecb <-- now it's working
02:35:11Skrylarfowl are you feeling underappreciated
02:35:14fowlo
02:35:43renesacbut I can't turn it in a template: Error: expression 'inc(x, 1)' has no type (or is ambiguous)
02:35:56renesac(trying to hack around precedence rules XD)
02:36:49*Demos quit (Ping timeout: 240 seconds)
02:37:29renesachttps://gist.github.com/ReneSac/681bc1485ed2ccde6ecb <-- gist updated
02:38:52renesacok
02:39:01renesacjust taking the return type off it
02:39:26renesacbut then I can't use in expressions
02:40:03renesacand templates don't accept {.discardable.}...
02:40:43fowltemplates wont help you change precedence
02:40:58fowlSkrylar, making fun of you
02:41:11fowl<Skrylar> Skrylar: though so far ..
02:42:50Skrylar:P
02:43:13renesacfowl, they just did
02:43:14renesac:D
02:43:55renesachttps://gist.github.com/ReneSac/681bc1485ed2ccde6ecb
02:44:04renesacfunction call FTW!
02:45:39*renesac does a super villain laugh
02:46:13fowlrenesac, just call myinc `++` and it works the same ...
02:46:25fowlrenesac, that doesnt change precedence at all
02:48:17renesacstrange, I thought it would do the * first
02:48:36renesacas + has lower precedence than *
02:49:21fowlunary vs binary
02:49:22*ics joined #nimrod
02:49:52renesacwhere this is described at the manual?
02:50:50renesacthat unary operators have always the highest precedence?
02:51:30fowlnobody ever expects + 1 - 2 to mean +(-(1, 2))
02:52:22fowlhttp://build.nimrod-lang.org/docs/manual.html#precedence
02:58:35*flaviu quit (Remote host closed the connection)
03:01:42renesacI don't see anything about unary there
03:01:50renesaconly If the operator's relevant character is @ it is a sigil-like operator which binds stronger than a primarySuffix: @x.abc is parsed as (@x).abc whereas $x.abc is parsed as $(x.abc).
03:02:17renesacI guess it is a non-documented special case for + and -
03:03:12renesacand in the table "@" has the lowest, not the highest precedence, which is strange too
03:03:24fowlspecial case for + and - ? what
03:03:30renesacseems to contradict that phrase quoted
03:03:37fowlwhat makes you think this
03:03:43renesacfowl, please quote where the manual says that unary operator has higher precedence?
03:03:47renesac*.
03:04:14renesacand I just said in the last lines what makes me think this
03:04:37renesac(@, $ example, for example)
03:05:13Skrylarso i've isolated the ICE from earlier to a single line
03:05:19Skrylarall though i'm not sure why that causes an ice
03:05:28fowlrenesac, you're asking for confirmation that unary and binary operations do not have the same precedence -- ?
03:05:43fowlhow could they
03:08:34runvncis there a way to prevent this proc from showing in the docs? I am only exposing it because a macro needs it
03:08:41runvncer a template needs it
03:09:01fowlrunvnc, dont export it, use bind instead
03:09:21runvncok thanks let me try that
03:15:08runvncit keeps saying undeclared identifier
03:15:13*BitPuffin quit (Ping timeout: 240 seconds)
03:15:43runvncsee I am trying to use this macro in my program, its from another module, the macro uses this one proc from the module
03:15:48runvncI mean template
03:16:17runvncI will look at the manual about bind
03:17:44*CARAM joined #nimrod
03:19:14runvncif I call it statusContent(response.client instead of response.client.statusContent( then it works
03:19:14renesacfowl, no: [00:03:43] <renesac> fowl, please quote where the manual says that unary operator has higher precedence
03:19:19runvncso problem solved thanks
03:19:31renesacotherwise, I will assume: [00:02:17] <renesac> I guess it is a non-documented special case for + and -
03:23:59fowlrenesac, its no skin off my nose if you want to believe your assumptions
03:24:16renesacit is undocumented, right?
03:24:27fowlit is not true
03:24:42renesacso, where the manual says something about it
03:24:44fowlyou have a line of code that shows this behavior
03:25:06fowlhow can the manual say anything thats undocumented?
03:25:20renesac??
03:25:36renesacif the manual don't say anything about unary operators precedence, then it is undocumented
03:25:44fowloy
03:26:09renesacwhat 'oy' means?
03:26:34fowlan expression of dismay
03:27:05renesacFor operators that are not keywords the precedence is determined by the following rules:
03:27:07renesac[... ]
03:27:13renesacOtherwise precedence is determined by the relevant character.
03:27:57renesac`++` don't fit in any of those previous rules, therefore it's precedence should be the same as the relevant character, acording to the manual
03:28:21fowlthere is no special case for +/-, idk what you're talking about
03:28:26renesacand "An operator symbol's relevant character is its first character unless the first character is \ and its length is greater than 1 then it is the second character."
03:28:44renesacso `++` relevant character is +
03:28:59renesacwhich has a precedence level of 7
03:29:01renesaclower than *
03:29:11fowlwhat is the issue anyways
03:29:26renesacso, acording to the manual `++` should evaluate after *
03:29:43renesacbut that is not what happen
03:29:44renesacs
03:29:46fowljesus
03:30:14fowli cant help you with this renesac because i've already explained whats going on
03:30:27renesacyou explained how it works
03:30:39renesacbut the manual defines the precedence differently
03:30:52renesacwhat from I just quoted was wrong?
03:31:45fowlyour understanding is wrong
03:31:54renesacwhere exactly?
03:32:54renesacbbl
03:33:02*renesac is now known as renesac|away
03:37:29fowlrenesac|away, there is no operator that binds higher than binary expressions
03:52:16*nequitans_ joined #nimrod
03:56:39Skrylarinteresting
03:56:46Skrylareven though i declare it as proc foo* [T]
03:56:53Skrylarif i call a specific form foo[int](self)
03:57:06Skrylarit tells me that function doesn't exist, and to try a non-generic form that doesn't exist
03:57:27fowlfoo*[T] has no parameters
03:57:48Skrylarthe full call is "method TryGet* [T](self: var MaxRectPacker[T]; width, height: T; outRectangle: var Rectangle[T]): bool ="
03:58:00fowlgeneric methods dont work
03:58:11Skrylari changed it out for a proc and it still broke
03:58:42SkrylarSwap method with proc, remove the other method definition from another unit, same error
03:58:55Skrylarif I leave the [int] specifier off the proc call, it gives a read from nil ICE
03:59:15fowlid have to see the whole code
04:01:24*renesac|away is now known as renesac
04:01:37renesacI guess you mean unary expressions
04:01:58Skrylarfowl: one minute; i'll merge it back in to github
04:02:10renesacbut then, what is this paragraph: "If the operator's relevant character is @ it is a sigil-like operator which binds stronger than a primarySuffix: @x.abc is parsed as (@x).abc whereas $x.abc is parsed as $(x.abc)."
04:02:10renesac?
04:02:25renesac@ and $ aren't unary operators there?
04:02:25fowlrenesac, no, i meant binary expressions
04:02:32fowlrenesac, yes, they are.
04:03:23renesacso.. '.' is binary
04:03:34renesacand yet there are different behaviours
04:04:01Skrylarfowl: https://github.com/Skrylar/Skylight or more specifically skylight/maxrectpack.nim
04:04:24renesacand nowhere in the manual says that precedence rules only apply to binary operators
04:04:26renesac:/
04:04:52fowlrenesac, i cant help you, post on the forum or create an issue
04:05:26Skrylari isolated it down to the crash being caused in TryGet, when you remove any code that tries to refer to a Rectangle[T] type it goes away
04:05:50SkrylarJudging by the errors when specifying the types on proc calls, the compiler isn't understanding that there is a generic type at play
04:06:00Skrylarso its trying to initialize Rectangle[nil] and failing
04:06:42fowlyou still have it as a method
04:06:42renesacfowl, ok
04:09:26Skrylarthats the base code
04:09:49Skrylari didn't plan on making 90 commits of every single line adjustment that still resulted in segfaults
04:10:41Skrylar1) went in to binpack.nim, commented out tryget method, went back and renamed TryGet from method to proc, same issue
04:11:19Skrylar2) changing the test to while TryGet[int](packer, 32, 32, outRect) results in crash
04:11:41Skrylarpacker.TryGet[int](...) results in the compiler being confused but not ICE
04:12:37fowlyea thats not supported for explicit generic instantiation
04:12:50fowlyou have to use f[t](x,y) not x.f[t](y)
04:12:58Skrylarsee #2
04:14:12Skrylaralright, i found the specific issue
04:14:23Skrylargenerics can't have *any* methods against them (which sounds like a bug in itself)
04:14:54Skrylaris there already a bug report for that? it *really* shouldn't give ICEs for that if its intentional
04:16:30fowlidk
04:16:49Skrylari made a todo to report it
04:19:16Skrylarnevermind. that didn't actually fix it
04:19:28Skrylarits apparently genuinely just botching the generic field
04:37:46*Mordecai joined #nimrod
04:38:31*Mordecai is now known as Guest23044
04:39:42*psquid quit (Ping timeout: 252 seconds)
04:42:03*Skrylar sighs
04:43:39Skrylartime to rebuild the compiler in debug mode i guess
04:47:16SkrylarsemGeneric -> addSonSkipIntLit -> skipIntLit
04:50:12Skrylar... yep
04:50:16Skrylarfowl: well i think i found the problem
04:50:38Skrylarthere's a part of the compiler that does "x.n != nil" but not "x != nil", yet calls the function with no argument
04:56:14Skrylari'll have to bother Araq about it later
04:56:35renesacfill a bug report with what you said here
04:56:40SkrylarIt looks like what I thought was happening is exactly whats happening; it's not parsing the [int] part
05:07:04eximiushey, what was the url to the 9.4 docs? build.nimrod-lang.org/.....
05:09:33renesachttp://build.nimrod-lang.org/docs
05:10:01eximius403 forbidden
05:10:50renesachttp://build.nimrod-lang.org/docs/
05:11:15eximius*facepalm* .... right. thanks.
05:11:35renesacthat was my error too
05:12:07eximiusnp
05:13:41renesacbithacks.nim(44, 8) Error: type mismatch: got (uint32, int)
05:13:42renesacbut expected one of:
05:13:42renesacbithacks.or(x: TSignedInt or TUnsignedInt, y: TSignedInt or TUnsignedInt): int
05:14:07Skrylari think they both need to be the same
05:14:16Skrylarthough that error is being derpy
05:14:36renesacyeah, I'm trying to work around that with my own `or`
05:16:12renesacbut the compiler is being really stubborn..
05:16:30renesacbtw, the function declaration is: (x, y: distinct Tinteger)
05:16:46renesacfor some reason, when I use distinct the TInteger is expanded
05:18:32renesacbithacks.or(x: T, y: U): T <-- no joy also
05:18:41Skrylari'm not sure what thats supposed to be called now; we're not supposed to use TNames anymore
05:19:50renesacwell, it is still called that in system.nim, apparently
05:23:30Skrylarbleh. i saw we have a event handler module based on PyEE
05:23:38SkrylarI don't think I like x.on("somestring", handler) personally
05:24:53*rveach_ quit (Ping timeout: 246 seconds)
05:25:02SkrylarMaybe its just me, but I rather like hard-typed signals and slots over string lookup table dispatches
05:27:34*ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
05:35:33*ics joined #nimrod
05:35:39*xenagi quit (Remote host closed the connection)
05:57:31*brson quit (Ping timeout: 264 seconds)
06:02:05renesac Error: type mismatch: got (Array constructor[0..31, int]) but expected 'array[0..31, Byte]'
06:02:06renesac:/
06:02:53renesacthat is a combination of two bugs I already reported
06:04:26Skrylaryou have to put byte(x) around every element
06:04:32Skrylarthat works for arrays of uints
06:05:58Skrylarunfortunately the bug i reported earlier is a showstopper :( i'll have to find a different part of the project to work on in the interim :\
06:08:52renesacwell, I'm using int-sized array as a quicker work around (quicker in development time, not speed)
06:10:34Skrylarquicker than typing [byte(1), byte(2)..]?
06:10:45SkrylarI seem to remember Araq mentioning you can make a converter against the lit(int) type
06:12:22*brson joined #nimrod
06:12:39fowlnooo
06:12:48fowlSkrylar, you just need to annotate the first member
06:13:00fowl[1.byte, 2, 4, x, ..]
06:13:18fowlsince every member is the same type
06:17:13Skrylartell him that. :o
06:18:06fowlrenesac, that^
06:18:24Skrylarfowl: do you think signals and slots would work well in nimrod?
06:18:32Skrylarseems like a template should be able to do it
06:19:12Skrylari think there are some really fancy ones that deal with weak references (Qt's?) but most of them are just a sequence
06:19:15fowlsignals like sigint/hup/term ?
06:19:20Skrylarno, like Qt
06:19:22fowli dont know what slots are
06:19:40SkrylarQt signals and slots are basically an array of function pointers
06:19:56fowlah im reading about them now
06:19:58Skrylarall though Qt has some smartness so when a QObject gets finalized it removes itself from signals IIRC
06:20:35Skrylarso you can do things like mywindow.onClosed.connect(doathing)
06:20:57SkrylarI saw the nimee module in stdlib, not sure i like it.. that just binds a string and a thinly typed pointer
06:22:13fowlthe events module?
06:23:54Skrylaryeah
06:24:03Skrylari peeked at the docs for it, wasn't really thrilled
06:25:10SkrylarI'm not thrilled with string-based event hookups, because you have to go and invoke a hash table every event; and the docs for events didn't mention if it runs them through normalize() first
06:25:33SkrylarCompared to a direct generic, which is going to skip the normalize/hash step
06:26:48fowlno hash table, it does a linear search
06:27:13fowlcheck out the source - it could definitely be optimized
06:31:29renesac'for i in uint32.high - 100_000 .. uint32.high:' wraps around here
06:31:45renesacprobably in an infinite loop
06:31:50Skrylarfowl: thats probably worse o_O
06:31:58renesacfowl, thanks, I forgot that
06:32:47Skrylarusing compile-time funcs you could pre-hash the event strings, so as long as there was no collision you could have a really cheap linear search
06:33:08Skrylarthen again, you could also just use a directly wired callback and its as cheap as it gets
06:35:18renesacanyone can reproduce that infinite loop?
06:35:40renesac Error: type mismatch: got (int literal(1), Byte) <-- even with 'converter toByte*(x: int{lit}): byte = x.byte'
06:35:46renesac:/
06:37:23renesacthe target function, of course: unsigned.+(x: T, y: T): T
06:37:57renesacgoing back to int, quicker than fixing all that
06:40:31fowlrenesac, yes
06:40:47fowlrenesac, i ran it in aporia and it locked up my whole system
06:41:35renesacshould it give an infinite loop?
06:42:18fowlSkrylar, yea, going that route it is probably best to define eventID(name: static[string]): int and use a counter starting from 0 as your event-id
06:42:33fowlrenesac, no, you found a bug
06:43:08renesac\o/
06:43:11renesac:P
06:43:28renesacworkaround for the moment: uint32.high - 100_000 .. uint32.high-1
06:44:36Skrylarfowl: ultimately i don't want people dealing with events, but some system still has to be worked out
06:44:45fowli bet thats a codegen problem, incrementing the var (which just rolled to 0) before you check to stop the loop or something
06:44:59Skrylarfowl: i would prefer that people make a set of actions that can be performed, and then the GUI uses those for buttons/hotkeys/etc
06:45:12Skrylarsince it centralizes undo/redo actions, tooltips, names, recording logs
06:45:18fowlSkrylar, i found a page on qt's slots/signals, i wonder how much of this depends on their meta-info stuff
06:45:30Skrylarfowl: MOC is a workaround
06:45:59*brson quit (Ping timeout: 240 seconds)
06:46:07Skrylarfowl: basically, boost and clanlib have C++ signal/slots written in pure templates; but Qt has to cover compilers that aren't ideal and MOC lets them get away from relying on the compiler handling template magic
06:46:26Skrylarespecially since Qt has been doing it since the 90s when the compilers were really crap
06:47:20Skrylarall though in Nimrod, it might be less than ideal because a signal to an object could make the GC decide to keep the object around
06:48:05*brson joined #nimrod
06:55:23renesacSkrylar, here what I was working: https://gist.github.com/ReneSac/ff983a857dd56209d3bb
07:00:53*grumio2 joined #nimrod
07:06:09Skrylarrenesac: exporting unsigned might be a bit of a no-no
07:06:33renesac yeah, I wasn't sure about that either
07:06:41renesacbut I thought it would't hurt
07:06:55Skrylarleave out the export line; import is fine though
07:07:02fowlrenesac, have you tested your functions shl, shr, or, etc? i'm not sure they will work
07:07:13Skrylarpeople aren't meant to use unsigned unless they explicitly know what they are doing
07:08:03renesacfowl, I'm calling 'shl', etc, but I don't know are my functions the ones calledhow to test those functions
07:08:25SkrylarI think event hookup is going to be my next focus; I can't continue with the GL-based GUI directly until the bug i reported is fixed, but fiddling with event dispatch i can still do
07:08:25renesacSkrylar, if people are using a bithacks module, they probably want unsigned
07:08:45renesacmany functions require unsigned inputs
07:09:32renesac(though I can soften this requirement in quite a few of them)
07:10:00fowlrenesac, i think that by using distinct in that you have no way to call it
07:10:36renesacI thought that distinct in this case tells that U and T types can differ
07:11:06fowlno
07:11:14fowlt and u will be the same type actually
07:14:14renesac"Alternatively, the distinct type modifier can be applied to the type class to allow each param matching the type class to bind to a different type."
07:14:37renesachttp://build.nimrod-lang.org/docs/manual.html#type-classes
07:15:23renesacthough I'm not sure it works inside [], but it surely works as proc `**`(a, b: distinct Matrix): Matrix[a.type.T, a.type.M, b.type.N] =
07:15:33renesac(example given by zahary)
07:19:06*Endy joined #nimrod
07:19:09fowlah
07:19:20fowlthat makes sense
07:19:32fowli guess it wouldnt be usable the other way
07:23:08renesacgoing to sleep
07:23:38renesacthis module is already usable for me, but latter I will make a proper repository for it
07:48:24*brson quit (Ping timeout: 252 seconds)
07:55:53*rejuvyesh[away] quit (Ping timeout: 245 seconds)
08:07:33Skrylari wonder how big of a pain it is to overlay cef on sdl
08:13:38*nequitans_ quit (Ping timeout: 240 seconds)
08:24:49Araqrenesac: unary ops have higher precedence than binary ops and I think the manual mentions that
08:24:59Araqit's obvious from the grammar anyway :P
08:32:04SkrylarAraq: I broke your compiler again :(
08:32:53AraqI noticed
08:34:01Araqshow stopping bug?
08:34:38Skrylar"yes" in that i can't work on that module without a serious workaround; it might be possible to hardcode the binpacker to use ints and cover it up with a typedef until the bug gets fixed
08:34:49Skrylarso probably just severe
08:35:18SkrylarI have no idea why the compiler is getting a nil instead of the type though
08:36:42Araqbug number?
08:38:37Skrylar#1007
08:41:32Araqtried to rename your 'Set' procs?
08:46:21SkrylarI haven't tried that, no.
08:46:46SkrylarIt does still happen when I make no function calls within TryGet though, just using the T type is enough to break it
08:51:39Araqgosh this openCL API is so full of bullshit
08:51:47Skrylarlol
08:51:53Skrylari've never tried to use opencl
08:51:57Araqand it's in fact one of the better designed C APIs
08:52:22Araqpointers vs arrays, unsigneds, type unsafety everywhere
08:52:40SkrylarC doesn't really have typesafety though
08:53:18SkrylarIIRC if you put GCC in ansi mode it will still try to implicitly cast everything to ints
08:53:41Araqwho cares, I'm not using C directly
08:53:46AraqI'm using Nimrod
08:54:05SkrylarIn that case, suckass is a macro away from being hidden. </lisp>
08:54:11AraqC is for retarded masochists
08:54:31Araqand should have died decades ago
08:55:16*rejuvyesh[away] joined #nimrod
08:55:30fowlshould have died? maybe, but it won't, its going to be around at least until the next leap in computing
08:55:49Skrylarthen rust takes over because corporate backing
08:55:52Skrylara new age of masochism and pain
08:56:03Araqfowl: problem is: that leap has happened 3x already ...
08:56:10Araqand it's still there
08:56:36Araqwe really need a 'cOpenArray' which is more forgiving
08:56:39fowlc is the english of programming languages, sure it pisses you off that the past-tense of "run" is "ran" but there nothing you can do about it (because a global cabal of bankers runs the world)
08:57:54SkrylarC++ is the one i have beef with
08:58:02Skrylarstraight C is useful in its place
08:58:33Skrylarthere haven't been very many languages that fulfill the "readable assembly" goal that ANSI C is supposed to fulfil; most of them (even the 'systems' languages) have mandatory GC for instance
08:58:50SkrylarGCs aren't what you want in the middle of factory control code
08:59:04runvncPersonally I think the main thing holding back software engineering is source code
08:59:08*ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:59:17runvnclol
08:59:30runvncnot actually kidding
08:59:36Skrylarhowso? i find auxillery means of inputting logic slower
08:59:44Skrylari've used graph-based and event grid systems
09:00:09SkrylarInform tries to do it as english but in reality is pigeon english
09:00:25runvncBy that statement I don't mean that there is a popular and practical general alternative to general purpose text-based programming languages
09:00:53*CARAM quit (Remote host closed the connection)
09:01:02SkrylarSmalltalk tried to be a mix of a class browser and source code
09:01:17Skrylarthere's been people talk about Source Code In Database to auto-format source blobs for you
09:01:24Araqlets see, the common assembler has a more powerful macro system than C, supports checking for integer overflows, makes coroutines easy, ... hmm
09:01:25fowlAraq, if you could make openarray pass the array length as int it would cover c apis that pass around T*, int for arrays (once this is possible i would ask for another one that flips the order of arguments (like int argc, char**argv))
09:01:48fowlpass it as cint*
09:02:00AraqI'd say C is a poor "portable assembler"
09:02:15Skrylari don't think nasm output works on sparc
09:02:27Skrylar:P
09:02:42AraqSkrylar: yet I can easily invent a better portable assembler
09:02:55AraqI don't even need to try hard, it's obvious how to do that
09:03:00Skrylaran Araq version of li.no.lium?
09:03:36SkrylarI found using an assembler more painful just because its extremely unforgiving
09:03:49Skrylarand its easy to end up with a dozen different method call types
09:04:26Araqfowl: I'm thinking of pragma support to nail that
09:04:56runvncwell just one more comment about what I was trying to say, having a specific textual syntax as an underlying representation is limiting.
09:04:58SkrylarI'm not sure if the edge case of dealing with that kind of array merits compiler support personally
09:05:22*ics joined #nimrod
09:05:35runvncthere is only so much that an IDE can do within those constraints
09:06:02Skrylarrunvnc: well, how many IDEs are living up to that though?
09:06:12runvncwell, its not even an underlying representation, it is THE representation except for some coloring and code folding or whatever
09:06:15Skrylarthe only ones i've seen that really hit the edge of that is maybe SLIME
09:07:05Skrylarslime/emacs and lisp take you to the realm of hitting a key to eval the current statement, preview macro output / optimizer results, and shove code in to a running process
09:07:15Skrylarmost of the IDEs *stop* at syntax coloring
09:07:25runvncmy point is that since the paradigm is a particular textual representation that is parsed, it limits the types of interactions and availability of different representations for programs
09:07:31runvncand this is holding back software engineering
09:07:49Skrylarbut are we even hitting those limits with most software? :/
09:07:53runvncthe representation and interaction with the program is very critical
09:08:08runvncwe are not but it isnt because people aren't writing clever enough text editors skrylar
09:08:15runvncit is because the paradigm is outdated
09:08:17Skrylarits like arguing for a bigger pixel bit depth than 16-bit, when most paint programs only support basic 12-color
09:08:46runvncwhat I am saying is that we are using CGA and they have 3d HD now
09:09:29Skrylarwhat is the '3d HD' of programming?
09:10:24SkrylarWe had image-based systems and people decided they hated those, and those dealt with an interesting set of problems
09:10:38runvncprograms with interactive representations, multiple ways of viewing the underyling program, non-textual representations that are more appropriate for the domains
09:10:56Skrylarso basically a good IDE with flow charts + generators
09:11:03runvncabsolutely not
09:11:17Skrylar"non-textual representations"
09:11:40Skrylarthere are some state machine editors that do a very good job at visualizing that particular model and its transitions
09:12:27Araqunhandled exception: SUCCESS [EOpenCL]
09:12:29Araqlol
09:12:34Skrylarwelp
09:12:41SkrylarBugfix: Success is not failure.
09:12:56runvnchow many different types of interactive 2d and 3d representations do you know of skrylar
09:12:56runvncare there say a half dozen
09:12:56runvnca dozen
09:12:56runvncmaybe a thousand
09:12:57runvnccertainly there are more general purpose representations that would be useful for various types of programming interactions than you can think of off the top of your head
09:13:09runvnclol
09:13:53SkrylarI've used a few attempts to replace source code.
09:13:54runvncsure state machine editors, and all of the different ideas you had, and more general ones, as well as various different options for mapping to alternate syntaxes
09:13:58SkrylarI wouldn't say they are universally better.
09:14:21SkrylarStuff like the RM2K event editor is great for sketching out NPC events, sure, but they're a nightmare for maintaining/growing
09:14:27runvncof course I am not saying that any particular attempts to replace source code that you have used are universally better than text
09:14:48Skrylarwhat you want in some of those situations are closer to things like the Elder Scrolls Construction Kit which is essentially a database editor
09:15:00runvncif you listen to what I am saying, it is quite clear that I am not advocating for any particular visual representation
09:15:14SkrylarI'm listening, but I haven't seen anything specific recommended
09:15:40Skrylarinteractive, multiple ways and non-textual aren't really descriptive; all I can say is thats the kind of thing SCID was supposed to solve
09:15:59Skrylaryou store the AST in a database, and the SCID client parlays that in to something meaningful
09:16:02runvncI am specifically recommending that we create a new paradigm that redefines programming in a way that transcends single-syntax textual non-interactive representation
09:16:39SkrylarI wouldn't mind poking at a SCID system for nimrod, but that's not tool friendly (e.g. the database isn't git-able)
09:16:46runvncok skrylar something along the lines of this scid thing is the direction I think programming should go
09:17:25runvncthere is nothing about this general approach that precludes a textual or otherwise tool-friendly serialization
09:17:45Skrylarhttp://c2.com/cgi/wiki?SourceCodeInDatabase theres also a mention on wikipedia of an IBM attempt
09:18:05runvncintentional software has a domain workbench with a projection editor
09:18:09Skrylarproblem is that SCID is a move back in to image-based development which people for some reason don't want
09:18:13runvncI think those types of tools are a step in the right direction
09:18:39runvncI do not necessarily think those specific tools are practical for general purpose programming or that they have successfully created this new paradigm
09:18:46Skrylaryou also have to have a stable storage AST
09:18:54runvncwell just to clarify
09:19:09runvncwith this new tool, I would definitely want to be able to represent program fragments using text
09:19:25runvncand I envision that would be an integral aspect of program development still
09:19:57runvncthe problem is the definition of programming
09:20:06runvncprogrammers do not use graphical user-friendly programs
09:20:10runvncthose programs are for users
09:20:20runvncprogrammers write cryptic ascii text
09:20:22fowlseen this? http://peaker.github.io/lamdu/
09:20:29runvncthat is the beginning and end of the definition of programming
09:20:34fowlyou type into AST
09:21:13runvncwow very interesting thanks no I had not seen that
09:22:41runvncin fact, if the text you type into the computer overall isn't cryptic enough, you don't get credit for being a programmer
09:22:58runvncits a 12-year-old's mentality
09:23:01fowlif its not cryptic then you have no job security
09:23:17Skrylarthere is that
09:23:37Skrylar"good code = you're unimportant" and launch day = fired day probably doesn't convey a sense that we should be more productive
09:23:57Skrylarwhich is probably why tiny groups like Delphi and friends; they aren't writing against a boss and their time is more vaulable
09:24:28runvncoh actually I did see that lamdu thing, just totallly forgot I had seen that particular one
09:25:19SkrylarI like the idea of an outlining editor
09:25:23*ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:25:25Skrylarbut i like outliners :(
09:25:58Skrylarespecially with clones, since you can have the bug references and example code links grouped together
09:26:39*ics joined #nimrod
09:27:17Skrylaranyhow, i should probably try to minimize the segfault related to generics
09:27:19*grumio2 quit (Quit: Lost terminal)
09:27:23Skrylarzah was asking about it
09:28:50AraqSkrylar: yeah plase do so, I need to go
09:28:52Araqbbl
09:29:24*clovis joined #nimrod
09:35:06*grumio2 joined #nimrod
09:35:44Skrylarwut
09:35:50SkrylarI merged the files together and it works
09:36:00SkrylarSo its a module boundary issue. Yay.
09:37:17grumio2I have this window open in case I need to ask a question. But all your high-level discussion intimidates me to RTFM and solve my own problems.
09:37:47fowllol
09:37:49Skrylar:(
09:38:01fowlgrumio2, all joking aside the manual is pretty comprehensive, its a good resource
09:38:20grumio2It's a good thing haha. It's worked so far. Yeah the manual is great.
09:38:53*[1]Endy joined #nimrod
09:40:55clovisOk then, perhaps I should pose a question
09:41:24clovisWhat's the cost of exceptions that are not raised?
09:41:54clovisMost C++ compilers have zero-cost exceptions in the non-exceptional case.
09:42:18*Endy quit (Ping timeout: 240 seconds)
09:42:18*[1]Endy is now known as Endy
09:43:42*lanior quit (Quit: Page closed)
09:43:53*CARAM_ joined #nimrod
09:44:08*CARAM_ quit (Client Quit)
09:44:27fowlclovis, i guess it would be the cost of the allocation and subsequent garbage collection
09:45:21clovisfowl, hm. Is that a one-time cost or is it for each entered try-statement?
09:45:37clovisSuppose I call a try-statement in a loop..
09:47:12fowlwell
09:47:26fowli doubt you would allocate an exception if you arent raising it
09:47:33runvncclovis you know you can look at the generated c code in the nimcache folder right?
09:48:11clovisrunvnc, I should do that.
09:50:21runvncheh easier to just ask in here.. not for the faint of heart
09:52:09grumio2lol. runvnc, see my earlier message
09:52:38runvncheh
10:01:47*ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
10:02:21*ics joined #nimrod
10:02:28*reloc0 joined #nimrod
10:05:58clovisHm, unfortunatly there seems to be a cost for entering the try even though en exception isn't raised.
10:06:32clovisThe setjmp C-function and some other stuff has to be set up.
10:07:29clovisThis means that using exceptions in a loop will have a negative impact on performance
10:11:27Skrylarzahary: zahary_office: okay, minimized the code needed to cause the crash
10:11:43SkrylarIts definitely an issue with cross-module generics
10:13:22zaharySkrylar: put a link in the issue
10:17:47clovisGood news! If you compile to cpp instead of C then C++ exceptions are used instead of setjmp/longjmp. This means that the code will probably run faster
10:18:42runvncclovis did you test what the performance impact actually is with the try in the loop
10:18:49runvnclike use a high resolution timer
10:18:52runvncand do a simple test
10:19:06clovisNo, there was a linker error for me. Perhaps c++ isn't fully supported yet
10:19:14runvnctry it with c
10:19:14clovisI only have Clang installed
10:19:18runvncmeasure the performance impact
10:19:42Skrylarzahary: posted
10:20:10runvncI would not assume that issue is an important optimization
10:20:16fowlclovis, how do you know c++ doesnt use set/longjmp?
10:20:18runvncwhat are you optimizing clovis
10:20:36runvncalso clovis nimrod has flags for optimization
10:20:37clovisfowl. I know that LLVM has zero-cost exceptions
10:20:58clovisrunvnc, right. I shall recompile the C-version with optimizations on
10:21:10runvncbut you would need to profile it for a specific use case
10:21:19clovisOf course
10:21:21runvncto see whether that is actually an important issue for your optimization
10:21:33runvncseems silly to assume its a problem
10:21:33clovisBut setjmp/longjmp is always slower
10:21:53clovisWell, exceptions are used everywhere in nimrod
10:22:03zaharyclovis: C++ should be supported, but we test it more rarely
10:22:10zaharyif something doesn't work for you, post a bug
10:22:18*ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
10:22:58cloviszahary. I think I read somewhere on the website that osx was not fully supported
10:23:06zaharythe most typical linker error is that the C++ runtime is not linked - check if you are compiling with clang++
10:23:17clovisI only have clang installed
10:23:17zaharyI'm using osx most of the time
10:23:20clovisno gcc
10:23:46zaharysame here
10:23:51clovisHm.
10:25:06clovisI just installed nimrod from trunk source on github a couple of days ago, following the instructions
10:25:17zaharytry adding this to the command linke —cc:clang++
10:25:29zahary* line *
10:26:53fowlclovis, you are using the devel branch right?
10:27:06clovisfowl, yep
10:28:23runvncclovis what is the exact linker error you received
10:28:28*Matthias247 joined #nimrod
10:30:15clovisrunvnc, http://pastebin.com/pSpWJ0RU
10:31:48zaharyyes, this is the error I was referring to
10:32:27cloviszahary. I see
10:32:29zaharydidn't my suggestion fix it?
10:32:56cloviszahary, is that command line option for nimrod compiler?
10:33:20zaharyyes, it can also go into your project or user config file
10:33:31zaharycc: "clang++"
10:34:18zaharythere must be a problem with the default config and I'll take a look a bit later
10:34:36fowlso i tried doing ./koch boot -d:debug -o:nimrodd and that worked fine but the result binary was left in compiler/ not moved to bin
10:35:15fowlat least it worked though and now i have a debug build on hand
10:35:59cloviszahary. I'm probably a bit dense but I don't understand where to put the command line option. This didn't work: nimrod cpp -—cc:clang++ x008_exceptions.nim
10:38:51zaharyI've reproduced the issue here after I deleted my user config - I can just wait for me to push a fix today
10:39:21zahary*you can*
10:39:29cloviszahary, thanks
10:40:57clovisI can do some measurements of the possible performance impact then of using exceptions in C vs C++
10:43:44clovisI'm not aware of any implementation technique other than setjmp/longjmp in C. The C++ compiler does the corresponding at compile-time as well as a few allocations when the program is started. But not upon each time a try-block is entered.
10:46:53*ics joined #nimrod
10:48:58Skrylarthe way the C++ compiler does it depends on how it feels
10:49:08Matthias247clovis: afaik there are 2 common approaches. The one with setjmp/longjmp and another which generates alternate program flow pathes for each exception and stores them in unwind tables
10:49:16Skrylaron some platforms theres a side chain that gets appended to every time you enter a try block, so its not *that* different from setjmps
10:52:58*grumio2 quit (Read error: Connection reset by peer)
10:53:25*grumio2 joined #nimrod
10:54:08Matthias247I've heard about up to a 25% performance hit from using exceptions and many (embedded) projects don't allow them therefore. But don't know how much truth is in there
10:56:22clovisMatthias247, some extra code has to be generated for unwinding that may take up some precious memory/cache
10:58:16clovisCache should of course not be a problem. That (exceptional-) code would be placed somewhere off the hot code
10:59:23fowli wonder what the least efficient way to do it is
10:59:57clovisfowl. return values perhaps
11:00:26clovisThey have to be propagated up from all calls and checked at each level
11:00:51clovisExceptions are great because you optimise for the non-exceptional case
11:01:15Skrylaryou could always benchmark it
11:01:40clovisSkrylar. Yep. but first pick the low-haning fruit
11:01:40Skrylari pasted the OnTime benchmark here where they wrote their own setjmp and found that it was more efficient than try/catch in C++, but that was done in '01
11:02:48clovisOn windows, 32bit?
11:03:33clovisVC++ 32bit does exceptions the bad way
11:04:00Skrylarhttp://www.on-time.com/ddj0011.htm here's their old article
11:07:11Matthias247the mentioned projects use propagated error codes of course because they seem to be faster than exceptions for them and it's the only way you can do it without exceptions
11:07:41Matthias247as far as I can see: Zero-cost-exceptions > error codes > classical exceptions
11:09:36*runvnc quit (Quit: Leaving)
11:10:35clovisHere's another article/blog post: http://mortoray.com/2013/09/12/the-true-cost-of-zero-cost-exceptions/
11:10:53clovisHave to go. See you later
11:10:54*clovis quit (Quit: clovis)
11:25:45*EXetoC joined #nimrod
11:32:15*jbe joined #nimrod
11:38:33dom96good morning
11:41:12jbehello folks
11:41:19dom96hi jbe
11:42:11jbei’m trying to write a macro that takes an nkkCall expression as its parameter, and returns a statement list that uses the string representation of the name of the called proc/templ/whatever. I could not figure it out from the docs, am i missing something?
11:42:55jbei mean, how do i get the name that was called?
11:43:30dom96Use echo(treeRepr(node)) to see the AST node that was passed to the macro.
11:43:39dom96You should be able to figure out how to get the name from that.
11:43:51jbeok, thx
11:44:31jbei'm trying to implement a haml-esque template syntax
11:51:52fowlyou might use callsite()
12:03:31dom96EXetoC: yo, you there?
12:06:59EXetoCdom96: yes
12:07:37dom96EXetoC: Have you tested your Jester PR with the tests in jester's tests dir?
12:13:07EXetoCdom96: oh. no I haven't. that's an easy fix. so what were the considerations? did you think that maybe performance would be an issue in some cases?
12:13:45EXetoCor was it something else?
12:14:20dom96Just wondering whether there are any hidden issues.
12:14:31dom96Like code breaking.
12:14:47dom96Can you test it for me?
12:15:38EXetoCthe tests run at least, and I did use my patch for my own project, just that I didn't use that particular feature so I missed that
12:16:12dom96well as long as they run then it's fine
12:16:25EXetoCI'll run the programs again anyway
12:16:30dom96i'll revert it if bad things happen
12:16:35NimBotdom96/jester master aae03df EXetoC [+0 ±1 -0]: {.nimcall.} -> {.closure.}
12:16:35NimBotdom96/jester master dc6fbb5 Dominik Picheta [+0 ±1 -0]: Merge pull request #10 from EXetoC/proc-type-fix... 2 more lines
12:17:00EXetoCI was just about to update the branch
12:17:08dom96with what?
12:17:45EXetoCdom96: with the missing instance of 'closure'
12:18:14dom96huh. Where is this missing instance?
12:18:15Skrylardom96: i was working on the GL-GUI earlier and.. broke the compiler again :F
12:18:34EXetoCj.routes.add... asynctest.nim
12:19:36dom96You don't add routes manually.
12:19:44dom96Where do you see that in asynctest.nim?
12:21:04EXetoCdom96: "jester.nim(489, 12) Error: type mismatch: got (seq[tuple[meth: TReqMeth, m: PMatch, c: TCallback]], tuple[TReqMeth, PMatch, proc (var TRequest, PResponse)])"
12:21:56dom96You said the tests ran...
12:23:59dom96It's ok, i'll fix it.
12:24:15EXetoCI wasn't being very clear
12:24:19EXetoCok
12:24:22*BitPuffin joined #nimrod
12:25:34dom96BitPuffin: We should play Civ V
12:25:58NimBotdom96/jester master d71898d Dominik Picheta [+0 ±1 -0]: Adds {.closure.} to getRe.
12:31:48jbenow i am getting a "not unused" error when i try to add more than one call to the statement list.. ideas?
12:32:12*Vendethiel- quit (Quit: q+)
12:33:49jbewait, it must be a compiler bug.. adding a comment does the same
12:34:13jbeand that is not devel anyway
12:37:10EXetoCthis might be relevant https://github.com/Araq/Nimrod/issues/889
12:37:22EXetoCit's in devel. master was last updated about 2 months ago
12:40:42*q66 joined #nimrod
12:40:42*q66 quit (Changing host)
12:40:42*q66 joined #nimrod
12:42:36dom96jbe: gist your code and the error message
12:43:36jbedom96: it's probably the same bug. i'm trying devel first
12:43:42dom96alright
12:45:57*darkf quit (Quit: Leaving)
13:11:05*hetman joined #nimrod
13:14:23hetmanhi
13:15:18hetmanI was wondering if macros allowed a way to achieve something similar to the template "bind" statement
13:16:24dom96hello hetman
13:16:34dom96I think there is a bindSym proc in the macros module which is similar.
13:19:01jbehow can i raise a compile time error from a macro?
13:19:55hetmanawesome, I'll go take a look at that
13:20:03jbei got it to work btw
13:21:37*BitPuffin quit (Ping timeout: 240 seconds)
13:22:30dom96jbe: error("message") IIRC
13:22:50EXetoCdom96: is BitPuffin terrible at reading stuff before quitting or what? :p
13:23:03jbeok
13:31:16*foodoo joined #nimrod
13:36:52*io2 joined #nimrod
13:40:33Araqhmm if we change the pragma's syntax we could use [] instead, this might cause less problems when we support braces for control flow. Not sure we want to support braces though.
13:41:07*hetman quit (Quit: Page closed)
13:43:42dom96Araq: Nooo. Don't change the syntax. :(
13:45:14Araqchanging things is good for marketing though
13:45:38EXetoCjust let editors deal with alternative representations
13:46:13AraqEXetoC: nah this argument only holds when filwit makes it
13:46:16jbeoh god braces nooooo
13:46:39Araq"looks like shit but not if I add this particular piece of syntax highlighting..."
13:47:33fowli think a braces grammar is a good idea
13:47:50EXetoCas in brackets everywhere, for the few people who really want that above anything
13:47:50fowljust keep it separate from the normal syntax
13:49:10EXetoCmake it into an API or something
13:49:30AraqEXetoC: it already is an "API" in syntaxes.nim
13:49:40dom96Do you know of any people that would use Nimrod if it had a braces syntax?
13:49:48EXetoCthere you go :p
13:50:40fowldom96, i know of people that would have to come up with a better reason to not use nimrod if it had braces
13:50:54*guth_ joined #nimrod
13:51:32EXetoCdom96: but that doesn't matter if you delegate that responsibility to editors
13:51:40dom96I doubt we would convince those people.
13:51:49fowlyea
13:51:51dom96They would just say "well, it still sucks because now you have two syntaxes"
13:52:46EXetoCeven if it's up to the user to render the source code differently?
13:52:48fowlserious programmers dont place syntax on such a high pedestal anyways
13:52:52EXetoCmaybe some people will complain still, who knows
13:53:46dom96Well I am against this.
13:53:52dom96Just so we're clear.
13:54:36dom96There are more important things to do than worry about syntax.
13:56:19Araqhi guth_ welcome
14:21:00jbei dont know if something like this exists already, but i tried hacking together a basic dsl for creating html and xml templates
14:21:02jbehttps://github.com/jbe/niml
14:21:24Araqdude, watch my talk
14:21:36jbei did
14:22:00jbewell, parts at least
14:22:36Araqyeah, 25 minutes is way too long to watch
14:22:48Araqmore seriously "Under the hood, a NIML template is simply a proc that writes to a stream or socket, or anything else that has an implementation of write."
14:22:50dom96what do all these operators mean? % vs. ~ for example.
14:23:14jbe% is tag with body, ~ is self-closing
14:23:24Araqyou should call '&=' instead of 'write'
14:23:31jbei would have liked % for both
14:23:39jbeAraq: why?
14:23:57Araqbecause it's the upcoming 'sink' operator
14:24:27jbe*scratches head
14:25:05dom96Can you get a string out of it?
14:26:11jbedom96: simple enough to implement at least
14:26:24*foodoo quit (Remote host closed the connection)
14:26:50jbei used write as the base case for max efficiency
14:27:50Araqyeah and it's fine
14:27:56*Matthias247 quit (Read error: Connection reset by peer)
14:28:40jbei could write a "capture" template, that returns the wrapped niml as a string
14:29:14jbei'm not sure how unbreakable the syntax is though
14:30:59Araqproc write(a: var string, b: string) = a.add(b) # problem solved
14:38:09renesacAraq, I was unable to find a mention to that in the manual
14:39:17renesacthus the bug report
14:40:09Araqyeah well, guess what I'll add it to the manual and close the bug
14:42:29renesacand I also found strange this paragraph about unary operators: "If the operator's relevant character is @ it is a sigil-like operator which binds stronger than a primarySuffix: @x.abc is parsed as (@x).abc whereas $x.abc is parsed as $(x.abc)."
14:43:15renesacand in the table @ has precedence of 1 and $ of 9
14:43:48renesacI'm not sure if I'm misunderstanding things
14:45:15Araqthe precedences are about *binary* operators
14:45:28Araqthe sentence you quote is concerned with unary operators
14:46:37OrionPKmornin
14:46:55jbeAraq: did i understand correctly that something like stdout &= "str" will be valid in a future version?
14:47:12Araqjbe: yes
14:47:27renesacright, so this paragraph tells us that @ is a special case among unary operators?
14:47:30jbegreat
14:47:49Araqrenesac: correct
14:48:43*ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:48:45renesacok, now things make sense
14:48:47renesac:)
14:53:32*nequitans_ joined #nimrod
15:07:10*nequitans_ quit (Remote host closed the connection)
15:08:08*guth_ quit (Ping timeout: 245 seconds)
15:17:35fowlSkrylar, you around?
15:28:22*clovis joined #nimrod
15:37:34fowlsignals implementation: https://gist.github.com/fowlmouth/9584728
15:38:38fowlneeds more pizazz
15:39:09EXetoCmmh pizza
15:40:02jbedom96: i added string output to the niml example, using the &= operator and a shallow copy internally, so i guess it might work with jester now. i'd be happy to find a way to get rid of the ~operator though
15:44:46EXetoCfowl: gonna test it out in a Qt clone?
15:48:26fowlim going to try it with my entity system
15:50:28fowlhow to add arguments...
15:54:28EXetoCfowl: the boost way ofc
15:55:15EXetoCA macro perhaps, but type variadics would be nice
15:55:18fowli didnt look at boost
15:56:00fowlEXetoC, the problem is i dont want to create 9 generic types for up to 9 arguments
15:57:08EXetoCyeah that's what boost does
15:57:10fowlboost::signal<void ()> sig;
15:57:10fowl i dont think this is possible
15:57:15EXetoCor maybe they don't anymore because of C++11
15:59:03*grumio2 quit (Quit: Leaving)
15:59:22fowloh wow i can do var x: tx[proc: int]
16:00:31EXetoCright, proc type class
16:01:11EXetoCdo you need return type reflection?
16:01:55fowlno
16:02:05fowli dont think return variables should be allowed
16:03:10EXetoCI just realized that it's never done that way
16:04:32EXetoCexcept when it is
16:04:36EXetoC"boost::signal<float (float x, float y)> sig"
16:04:42fowlif you need to return something you should pass var seq[result-type] as an argument
16:06:14dom96Now that we have a proper asyncio do you guys think we still need async support in the new 'net' module (which will replace the sockets module)?
16:07:30EXetoCreturning an actual value does indeed seem pretty obscure
16:07:46renesacdo we have any function to read/write bits (not bytes)?
16:08:09renesacI searched in the stream module and haven't found any
16:08:51EXetoCdom96: people can just use those two together, so I guess not
16:10:28dom96Well, you will likely use one or the other.
16:11:22renesacfowl, I don't really know how this interface works, but return values are usually nicer, because type inference and not needing to declare a variable in a separate line
16:11:37EXetoCdom96: why doesn't that module just provide the core functionality that other modules can then use?
16:11:56renesacjust my 2 cents tossed in the dark
16:12:38EXetoCrenesac: I doubt it. just deal with int8 or bool
16:13:15*vendethiel joined #nimrod
16:13:54renesacfor bool, return values are also nicer because you can use it directly inside a if clause, for example
16:14:22EXetoCrenesac: but it seems really strange for something like a signal
16:14:24renesacbut as I said, I don't know this interface or the way it is usually used
16:14:43renesacright...
16:15:07dom96EXetoC: It will, but this functionality will be for sync sockets only.
16:15:17dom96The async stuff is too tightly bound to the dispatcher.
16:15:47fowlrenesac, how do you make sense of the value some connected slot returns?
16:15:52dom96Some functions will be common though
16:15:55dom96anyway brb
16:16:37*clovis quit (Quit: clovis)
16:17:02renesacI have no idea, but from what you are saying, it seems like return values are indeed a bad idea
16:17:20renesacsorry for butting in
16:17:29fowlits cool
16:17:59renesacI need to learn QT some day
16:18:30fowlthats the problem though, you have a bunch of connected components returning numbers and nothing to make sense of them, the only solution i can think of is to disallow return types, make the developer pass result: var seq[int] as a parameter, the connecting objects should fill up the result seq
16:18:47EXetoCdom96: so it's tightly coupled with sockets?
16:19:50renesachum, so a seq[] organizes the result?
16:20:45EXetoCis that common?
16:21:11fowlrenesac, its a container to catch the result from any connected component, what you want to do with the results is unknown to me
16:21:13*nolan_d left #nimrod (#nimrod)
16:22:03fowlrenesac, as an example, in my component systems i usually have a calculateBB message that different components (physics, sprite) will use to calculate the bounding box
16:25:57renesacI don't really understood, but ok
16:26:09renesacnow it seems I need to write a bit writing routine
16:27:20EXetoCso what's wrong with the types that I mentioned?
16:30:25fowl?
16:37:43*nolan_d joined #nimrod
16:40:46*foodoo joined #nimrod
16:42:32*Mat3 joined #nimrod
16:42:39Mat3hello
16:55:27dom96EXetoC: It's tightly coupled with the dispatcher because of the way that IOCP works
17:02:34dom96I then emulate that with epoll
17:13:40*rveach_ joined #nimrod
17:14:24dom96hi rveach_
17:15:05rveach_hey
17:27:03foodooproc recv(socket: TSocket; data: var string; size: int; timeout = - 1): int
17:27:13*vendethiel quit (Ping timeout: 240 seconds)
17:27:30*vendethiel joined #nimrod
17:27:57foodooFrom the sockets module. Has the string to be initialized to length =size?
17:28:30dom96No, it just has to be initialised.
17:28:33dom96var data = ""
17:29:14foodooworks. Thanks :) I had var mystring : string #before
17:39:02foodoothe keyword ̀pass ̀ in Python should be translated to ̀nil ̀ in Nimrod, correct?
17:41:08Araqfoodoo: not anymore, it's an empty discard now
17:42:53foodooSo what would you write now instead of nil? Or does Nimrod allow empty blocks?
17:47:19OrionPKdiscard
17:49:18foodoothanks
17:50:32Mat3I think there exist no wrapper for the Gee library, right ?
17:59:58*brson joined #nimrod
18:04:33AraqMat3: right
18:09:04Mat3hi Araq
18:21:09*clovis joined #nimrod
18:23:00*Matthias247 joined #nimrod
18:33:30foodooAraq: Out of curiosity: Did you consider Haskell-style function call syntax? Nimrod currently has a call syntax like this: fun param1, param2, param3. In Haskell you can call the function without the commas.
18:34:32Araqhaskell is brutal to read even with practice
18:34:41Araqymmv of course
18:35:38*Mat3 prefering Standard ML syntax
18:35:54foodooIs ML similar to Haskell in that regard?
18:36:25Mat3of course not in my opinion
18:47:34Mat3with one exception: functional concatenation
18:47:42Mat3you can write for example:
18:48:10Mat3fun fib (0 | 1) = 1
18:48:36Mat3 | fib n = fib (n-1) + fib (n-2)
18:49:16Mat3and concatenate without needed closures?:
18:50:15Mat3val res = par fib 42
18:50:24dom96I do like partial function application
18:50:35dom96Haskell's syntax makes that very natural.
18:55:10Mat3n < 2 | 1 :f n > 1 | n 1 - n 2 - + tail :g f g :fib <- like these style
18:56:21Matthias247absolutely natural ;)
18:56:49Matthias247(or absolutely unreadable?)
19:00:17foodooYou can write ugly code in any language
19:00:51Mat3f(n) := n < 2: 1; g(n) := n > 1: tail [(n - 1) + (n - 2)]; fib(n) := f(g (n)) <- the same, only in infix notation, only with more noise and unneeded parentess
19:01:31Mat3or in ML:
19:02:25Mat3fun fib (0 | 1) = 1 | spawn (fib (n-1) + fib (n-2)
19:02:49Mat3)
19:05:46foodoohttp://pastebin.com/8hNRnhWw would be naive Haskell
19:06:17Mat3it's all about habit and unease in front of the unfamiliar - that's my point
19:08:51NimBotAraq/Nimrod devel 1c065b3 Zahary Karadjov [+0 ±1 -0]: grammar fix: allow free-standing expressions such as type(foo) is bar
19:08:51NimBotAraq/Nimrod devel e8a7366 Zahary Karadjov [+0 ±2 -0]: allow multi-line expressions using the dot operator... 10 more lines
19:08:51NimBotAraq/Nimrod devel 40d9443 Zahary Karadjov [+1 ±5 -0]: fix #715 again... 2 more lines
19:08:51NimBotAraq/Nimrod devel ff1c6d1 Zahary Karadjov [+0 ±3 -0]: fix #1001
19:08:51NimBot8 more commits.
19:11:27Mat3n 2 < | 1; n 1 - n 2 - + tail :fib (that's a shorter defination which does the same)
19:15:32Mat3anyhow, are there plans for a SIMD library ?
19:20:57EXetoCI think someone was messing about with some GCC intrinsics before
19:25:48foodooThe nimrod compiler says that the module ̀ssl̀̀ ̀ is deprecated. Which other module should be used instead? (The documentation of the ssl module doesn't say it's deprecated)
19:26:18renesacMat3, https://gist.github.com/PhilipWitte/9316566
19:26:33*rveach_ quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/)
19:28:14dom96foodoo: The sockets module supports ssl
19:30:37foodoodom96: Thanks. Which function do I need to use to create an ssl socket? Is it also socket()?
19:30:46dom96wrapSocket()
19:31:48foodooThat's not in the documentation
19:32:48dom96Yeah, I guess the doc gen doesn't define 'ssl'
19:33:18dom96https://github.com/Araq/Nimrod/blob/devel/lib/pure/sockets.nim#L319
19:33:59foodooThanks. Should I consider the HTML documentation to be outdated?
19:34:25dom96No, this is a bug.
19:34:36dom96should only affect ssl stuff
19:34:48dom96but check the date on the docs to be sure
19:36:44Mat3renesac: thanks
19:37:48renesacit would be cool if someone made a full fledged nimrod wrapper, though
19:37:59renesacfor SIMD stuff
19:38:23Mat3I take it on my list
19:40:09Mat3however, I am skeptical about the approach. Will this GCC extension work with other compilers (clang) ?
19:40:41AraqI think so, clang is quite compatible with gcc
19:41:08Araqmvsc is different of course
19:44:39NimBotAraq/Nimrod devel 14aee49 Zahary Karadjov [+0 ±1 -0]: fix #1007
19:45:13AraqSkrylar: zahary is unstoppable :-)
19:46:06zahary:) such a short weekend
19:46:24Mat3ok, an alternative would be using 64-bit integers: $01AC3E100FFFFF30 + 0000001000000020 for example (32 bit SIMD addition)
19:46:46dom96Take tomorrow off work, it's St. Pats day in Ireland
19:46:54Mat3this approach is flexible and compiler independent
19:47:18Mat3or better library independent
19:49:40AraqMat3: I don't think think this works for all the suff that SIMD supports
19:54:06Mat3yes, it does not work well for floating point SIMD calculations, but for fixpoint and integer
19:54:09Mat3ones
19:57:03Mat3ciao
19:57:09Araqgood night
19:57:16foodoogn8
19:57:21*Mat3 quit (Quit: Verlassend)
20:00:34*jbe quit (Quit: Leaving)
20:05:19*rejuvyesh[away] quit (Ping timeout: 264 seconds)
20:11:36*hasgfbv joined #nimrod
20:12:26Araqhi hasgfbv welcome
20:12:40Araqdom96: is there some kind of standard for babel directory structures?
20:12:46hasgfbvHello there
20:12:50Araqsrc/ and examples/ ?
20:13:36dom96Araq: rtfm :P
20:14:05dom96The only standard is that private modules should be in a private dir
20:14:12AraqI haven't come so far in life by reading fucking manuals
20:14:16dom96Just create your repo and i'll tell you if it's wrong :P
20:14:45*xenagi joined #nimrod
20:14:52Araqok
20:15:33*Araq uses org.kronos.nimrod.opencl.source as a directory name
20:19:13Araqzahary: tests/generics/C/tforwardgeneric.nim (reSuccess -> reNimrodcCrash)
20:20:55zaharyyeah, I noticed. to my credit, I fixed about 30 other regressed tests and this one I left for tomorrow
20:22:55Araqwell I have no overview about the test results tbh
20:23:24AraqI'm waiting for varriount's patches to nimbuild
20:23:47renesaccan I make an array of sets?
20:24:03Araqsure why not
20:24:42renesacah, ok, found the alternative syntax for declaring sets
20:24:52renesacset[size], right?
20:25:13AraqI don't think so
20:25:27Araqif that works it's a bug
20:26:21Araq!addrepo nimrod-code opencl
20:26:21NimBotAccess denied.
20:26:25*Endy quit (Read error: Operation timed out)
20:26:26Araqwtf
20:26:39dom96hah
20:26:44dom96He don't like you.
20:26:46renesaclol
20:26:48dom96!users
20:26:53hasgfbvI'm sorry dave
20:26:58*dom96 can't even remember the commands
20:27:02dom96!addrepo nimrod-code opencl
20:27:02NimBotDone.
20:27:32renesacproc typeEqualsAux(a, b: PType, s: var set[PType * PType]) <-- the * operator there confused me
20:27:38renesacso, it is set[Type]?
20:27:40*rejuvyesh[away] joined #nimrod
20:27:53Araqrenesac: that's pseudo code
20:27:58foodoodoes "\0" create a zero-byte within a string?
20:28:09Araqfoodoo: yes
20:28:27renesacit is an example in the manual...
20:28:29Araqnimbot doesn't mention my push
20:28:43Araqrenesac: no it's an *algorithm* in the spec
20:28:54renesachum, right
20:29:00Araqbut yes
20:29:09Araqothers were confused before you
20:29:16Araqwe should change the syntax
20:29:47renesacand describe how to declare a set w/o using the {} syntax
20:31:47renesacthe 'set[Type]' syntax I got from the Case Statement part
20:31:48renesacis it right?
20:34:31renesacand what types of set I can put on an array?
20:34:39renesacor set[int] is a reference type?
20:34:53renesacall sets are reference types?
20:38:34*skyfex joined #nimrod
20:38:35*skyfex left #nimrod (#nimrod)
20:38:37*skyfex joined #nimrod
20:39:27skyfexSuggestion: Put a search-field in the upper right on the forum that just does a site: query on duckduckgo.com
20:39:46skyfexTo silence some of the complaints about the forum
20:40:28skyfexI'm suggesting duckduckgo rather than google so people don't complain about being redirected to someone that tracks you
20:40:37Araqskyfex: alternative: I delete the complaints :P
20:41:04Araqthat will show them why our forum is superior for us
20:41:20Araq(just kidding!)
20:41:24skyfex^_^
20:42:17Araqbut yeah, it's the way to go
20:42:29Araqyour suggestion, that is
20:42:49dom96in my experience duck duck go doesn't give the best results.
20:43:15skyfexdom96: On a single site.. does it matter much?
20:43:34renesacdoes it index all nimrod forum pages?
20:44:05skyfexrenesac: that's a good question.. I'd assume so, but I don't know
20:44:48*hasgfbv quit (Quit: Page closed)
20:44:54Araqwe had people here who wanted to reuse our forum software, can't be that bad
20:44:56skyfexWouldn't mind if it was Google either..
20:46:41renesacand anyone can help me with the set's syntax and semantics?
20:46:58renesacI can improve the documentation latter
20:48:08Araqrenesac: what's hard about them? the stdlib is full of them ...
20:48:16Araqthe compiler too
20:48:32Araqit's still one of my favourite features, in fact
20:49:54Araqset[int] is not possible, the base type has to be a smallish ordinal type
20:50:01Araqsets are value types
20:50:13Araqtype MyEnum = enum a, b, c
20:50:27Araqsizeof(set[MyEnum]) == 1
20:51:04Araqthe size is computed upfront to be able to hold {low(base)..high(base)}
20:52:21renesacin the stdlib they are mostly enum
20:52:34renesaccan I pass a range as type?
20:52:47renesacconstant, of course
20:52:50Araqrange[a..b] IS a type
20:53:09Araqand yes you can pass that to 'set'
20:53:23renesacok, so set[] is aways a bit array, unless I use the 'set' module
20:53:48Araqit's always a bit array, the set module exports TSet
20:54:02renesacoh, it will continue to be TSet?
20:54:45Araqgood question
20:56:20renesacI would suggest set[] -> bitset[], TSet-> set[]
20:56:35renesacbut then, most of set usage would be more verbose
20:56:49renesacand breaks backwards compatibility
20:57:03AraqTSet -> Hashset
20:57:20renesacyeah, that also works
20:57:37Araqthis is no implementation detail anyway as it doesn't work without a proper 'hash' operation
20:58:08renesacwell, one sure could use a log n tree...
20:58:53renesacbut the performance characteristics are different, of course
20:59:23Araqa log n tree doesn't require a 'hash' proc
20:59:44renesacthat was my point
21:00:02Araqah ok
21:00:18Araqwell the current TSet is a hash set and will continue to be so
21:00:34renesacthat is fine
21:00:54renesacI support the Hashset rename
21:00:59Araqdom96: can you please add opencl to babel's package list?
21:03:37foodoo(Googling didn't yield any helpful results) How can I access command line arguments?
21:04:16skyfexAraq: How complete should a package be before adding to Babel? I've done parts of libusb, and I don't know if I'll complete it anytime soon
21:05:40renesacAraq, thanks for the help, I already saved the log to edit the manual latter
21:06:13Araqfoodoo: os.paramStr(i), os.paramCount() or by the univerally hated parseopt module
21:07:21foodoothanks. I was looking in the system module
21:07:59Araqskyfex: just mention is in the package description. if it's useful enough for you, it might be useful enough for somebody else
21:08:06Araq*mention it
21:08:34NimBotnimrod-code/packages master c7f06cf Dominik Picheta [+0 ±1 -0]: Add opencl.
21:08:44NimBotAraq/Nimrod devel 3d59c70 flaviut [+0 ±1 -0]: Add token position to `nimrod scan`... 2 more lines
21:08:44NimBotAraq/Nimrod devel 98cc618 Andreas Rumpf [+0 ±1 -0]: Merge pull request #1003 from flaviut/devel... 2 more lines
21:08:45*noam_ joined #nimrod
21:09:13renesacare sets faster than functions with optional parameters?
21:09:28renesac*functions with optional parameters passed as sets of enums
21:09:29NimBotAraq/Nimrod devel c3f0fce Grzegorz Adam Hankiewicz [+0 ±1 -0]: Adds example to likely/unlikely docstring. Refs #983.
21:09:29NimBotAraq/Nimrod devel 3ecca6e Andreas Rumpf [+0 ±1 -0]: Merge pull request #1000 from gradha/pr_adds_likely_example_983... 2 more lines
21:09:52NimBotAraq/Nimrod devel ce9798e Michał Zieliński [+0 ±1 -0]: Provide zlib version explicit on Linux.... 4 more lines
21:09:52NimBotAraq/Nimrod devel b1acca1 Andreas Rumpf [+0 ±1 -0]: Merge pull request #999 from zielmicha/zlib_abi_version... 2 more lines
21:10:37renesac"Merge pull request #1000" <-- \o/
21:11:03renesac(the number is a bit misleading, but anyway)
21:11:03Araqtrue
21:11:10Araqlet's celebrate!
21:11:36Araqnext time I'll tell people we have over 1000 bug reports/feature requests/ pull requrests
21:11:44*noam__ quit (Ping timeout: 252 seconds)
21:11:48Araqso much for the "nobody uses nimrod"
21:12:04renesacand most of them closed!
21:12:14renesacan important detail
21:12:15renesacXD
21:13:01dom96Let's just lie and say we've got 1000 PRs
21:14:28Araqrenesac: I don't understand your question
21:14:40Araqwhich makes it kind of hard to answer
21:14:46Araqbut let me try anyway: yes.
21:15:09renesacI tried to fix the start of the question in the second line
21:15:57renesacI think the optional parameters are a nicer interface, both for the library coder and for the user
21:16:30renesacespecially when reading the docs, as enums are located at the top, and not all enums are aceptable for all functions
21:16:50Araqah you mean a list of optional 'bool' parameters instead of the set[enum] way?
21:16:56renesacyes
21:16:56EXetoC.
21:17:18Araqwell the set[enum] way is indeed faster
21:17:51Araqand I think it's somewhat cleaner than an ever growing list of optional parame
21:17:53Araq*params
21:18:27Araqthe param style basically makes you use named parameters so that you don't screw up
21:19:01renesacmaybe when you have many functions sharing the same optional parameters
21:19:10renesacotherwise, I don't see why it would be clearer
21:19:16*XAMPP quit (Excess Flood)
21:19:24renesactrue
21:19:44renesacbut with enums you also have to use the enum name, plus the prefix
21:19:56*XAMPP joined #nimrod
21:19:56*XAMPP quit (Changing host)
21:19:56*XAMPP joined #nimrod
21:20:23Araqrenesac: for the stdlib you're perhaps right, it surely makes a difference in the compiler
21:20:28Araqwhere everything is recursive
21:20:53Araqand foo(a, b, flags) # recursive call tends to continue to work when you add another flag
21:21:17renesachum
21:22:08renesaccan the compiler optimize the functions with optional parameters to sets?
21:22:12*Matthias247 quit (Excess Flood)
21:22:17renesacor it would break the ABI?
21:22:36*Matthias247 joined #nimrod
21:22:45Araqthere is no ABI when you don't specify a calling convention so yeah the compiler could do that
21:23:10Araqbut again:
21:23:35Araqproc foo(flagA = false)
21:23:41Araq--> add another param
21:24:00Araqproc foo(flagA = false, flagB = false)
21:24:37Araqfoo(flagA) # recursive call, d'oh! forgot to pass 'flagB'
21:25:34Araqvs. foo(flags) # recursive call, continues to work
21:26:45renesacwould be interesting if one could call this function foo with foo({flagA, flagB})
21:26:58renesacbut then, optional parameters let you make parameters that are true by default..
21:27:07renesacso this don't work so well...
21:28:37Araqbtw the other common use case is set[char]
21:28:57renesacthe idea would be a set could be expected at the first boolean parameter position, and this translated to the correct call by the compiler
21:29:28renesacbut then, this could introduce obscure bugs with overloading...
21:29:30EXetoCrenesac: no, only pure enumerators must be fully qualified
21:29:37Araqthe idea requires a problem. but what's the problem?
21:30:06renesacwanting to make those recursive calls with a function that wasn't made with set parameters
21:30:32renesacwell, you could write your own wrapper function, but too much effort probably
21:30:52renesacand that feature is also probably too much effort
21:31:53renesacand bring too many problems, it seems
21:32:53Araqargh, the mimetypes module is *OLD*
21:33:10EXetoChow come?
21:33:18Araqit should use a string case. this way no need for globals, no threading problems
21:33:32*runvnc joined #nimrod
21:33:34AraqI have to reject #1002 because of that
21:34:13runvncjust missed the problem with my 1002
21:34:21runvncprobably shows on this logs page though
21:34:34runvncyeah it does
21:35:17runvncaraq string case like case keyword, meaning a giant case with a different of for each mime type?
21:35:25Araqyeah
21:35:43Araqa 'case' instead of the current {:} ... oohhh big deal
21:35:43skyfexOh, Araq, while working on the libusb stuff, i needed a "packed" pragma.. I added it to the compiler, should I commit it?
21:36:03Araqskyfex: er ... sure
21:36:23Araqyou don't have write access, do you?
21:36:40skyfexAraq: No.. I meant pull request
21:36:48Araqok good
21:36:58runvnctheoretically I should be able to do some search/replaces on the mimetypes module
21:37:08Araqrunvnc: is #1002 from you?
21:37:11runvncyes
21:37:40runvncNo biggie though because I need the redirect and stuff that dom already put in jester
21:37:51runvncso I am not actually dependent upon that in httpserver now so
21:37:58runvncbut I will try to upgrade mimetypes
21:38:02skyfexAraq: But it assumes GCC/Clang (__attribute__((__packed__))).. Is that a problem? I think it might be different with other compilers
21:38:05runvncso you can use the setcontenttype
21:38:30Araqrunvnc: excellent thanks
21:38:48Araqthough the 'case' solution doesn't support 'register'
21:39:21Araqshould be solved with a user defined callback I think
21:39:31Araqthat's invoked in the 'else'
21:39:58Araqlets clients deal with the problem
21:40:14EXetoCskyfex: well, VS is very common
21:40:18runvncok
21:40:54Araqskyfex: sure it's a problem, edit extccomp and make it a format string or something
21:41:30Araqand yes implement it for VS
21:42:15skyfexAraq: Cool, I'll do that
21:43:07EXetoCsupport for more compilers would be nice, but that's a start
21:43:17EXetoCthough GCC and VS covers something like 99% of the users, right?
21:43:52skyfexI could take a quick look down the list, shouldn't take too long to google some or most of them
21:45:53Araqyou can do that but only VS, clang, gcc and intel exist
21:46:09Araqthe other C compilers are all effectively dead
21:46:34Matthias247on desktop ;)
21:46:45Araqtrue
21:47:03Matthias247I guess for embedded there are still things like KEIL around
21:47:21AraqGreen Hills comes to mind
21:50:17dom96Araq: If you change the mimetypes to a string case then we won't be able to read the mimetypes from /etc/mimetypes
21:50:24skyfexAraq: I also could use a bits pragma, which I remember you suggested I could do.. but I didn't need it bad enough, maybe later
21:50:39Araqdom96: do we do that?
21:51:03Araqskyfex: yeah well I already added 'union' and 'unchecked' :P
21:51:05dom96No but I think that my plan originally.
21:51:28Araqthat's not portable anyway
21:51:35dom96Also, you will need 2 different lists
21:51:51dom96One for getExt the other for getMimetype
21:51:56Araqno, but one direction will be slow
21:52:19dom96one direction already is
21:52:26Araqwe could also generate both from a macro
21:52:31dom96oh but see, you can register mime types.
21:52:48AraqI saw and found a solution
21:52:57Araqread the logs completely :P
21:53:39Araqthread safety is more important than compatibility in this case
21:54:29dom96I don't see the problem. The mimetypes db should be apart of the HttpServer object
21:54:33dom96*a part
21:54:58*BitPuffin joined #nimrod
21:57:10runvncdom96 re the finish ttyl thing I needed, this is what you mean right proc finish*(response: PResponse)
21:57:29dom96runvnc: yeah
21:59:22Araqdom96: ah good point
21:59:41Araqthis means it's not shared but then it is not as threadvar either
22:00:14AraqI still prefer the string case though
22:00:22Araqstring cases rule
22:00:24dom96I'll likely rewrite httpserver anyway
22:01:17dom96So that proc sendFile(http: HttpServer, filename: string, mime: MimeDb) exists
22:02:08dom96We could provide both a string case and the current implementation :P
22:02:45dom96Then by default sendFile could use the more efficient string case.
22:03:00*foodoo quit (Quit: it works!)
22:03:14dom96Maybe some macro magic would also allow it to be fast both ways.
22:03:28dom96i.e. we'll get the macro to create two lists.
22:05:49dom96Argh. Looks like I will need to rewrite the SSL code for IOCP
22:05:55runvncok so I would like everyone to be happy.. I can just close my pull request
22:06:05runvncbut still maybe ok to make a new version of mimetypes with a pull or what
22:06:11runvncI can just put it in a gist I guess
22:07:27*skyfex quit (Quit: Computer has gone to sleep.)
22:08:39Araqrunvnc: close it if you want to or fix it "properly" whatever that means
22:09:09runvnclol I thought properly meant mimetypes with case
22:09:29runvncbut dom said all that stuff then I was confused
22:09:41runvncI will do the mimetypes with case in case anyone wants to use it
22:09:48runvncsince I said I would
22:10:31*BitPuffin quit (Ping timeout: 252 seconds)
22:14:34Araqwelll dom96 made good points
22:14:43Araqso I dunno
22:15:45runvncok well you guys let me know if you want me to close the pull request or make a mimetypes with string case
22:15:57runvncotherwise its not a big priority for me and I will leave it to the big guns I guess
22:16:47runvncalso I don't even know where HttpServer is defined so heh
22:18:04Araqjust close it and let think about it
22:18:09Araq*let us
22:20:09runvnck
22:21:54dom96runvnc: one more fix please
22:21:59dom96take a look at my comment
22:22:01runvnclol ok
22:28:29*darkf joined #nimrod
22:29:09renesacwhy sets have 'incl' instead of 'add'?
22:29:27dom96I was wondering the same thing.
22:29:43renesacthe operations are fundamentally different?
22:30:33dom96Add implies being able to add the same value multiple times I guess
22:30:51runvncmath texts use language like include and exclude I think for sets
22:32:16*io2 quit ()
22:35:03Araqtables have both add and incl and they are not aliases
22:38:00renesachttp://build.nimrod-lang.org/docs/tables.html <-- this tables?
22:38:32renesacbecause I can't see any incl() there
22:43:45*EXetoC quit (*.net *.split)
22:43:46*cark quit (*.net *.split)
22:43:46*Matthias247 quit (*.net *.split)
22:43:47*xenagi quit (*.net *.split)
22:43:48*Guest23044 quit (*.net *.split)
22:43:49*nolan_d quit (*.net *.split)
22:44:46*Matthias247 joined #nimrod
22:44:46*xenagi joined #nimrod
22:44:46*nolan_d joined #nimrod
22:44:46*Guest23044 joined #nimrod
22:56:10Araqrenesac: maybe it's only for the compiler's tables
22:56:26Araqthe stdlib's tables uses []= vs add instead
22:56:56*cark joined #nimrod
22:56:56*EXetoC joined #nimrod
23:02:35renesac[]= would be the incl()?
23:05:00*_fel1x quit (Ping timeout: 265 seconds)
23:08:32Araqyeah
23:29:41*Demos joined #nimrod
23:48:15Skrylarzahary: you know, the irony is i would have named it TRectangle, but someone told me we weren't doing that anymore :P
23:58:42clovisI'm not sitting on a TChair
23:59:45runvncTChair probably wouldnt be very practical
23:59:48runvnctend to fall over