<< 16-01-2015 >>

00:00:01BlaXpirit_not funny -_-
00:00:27Triplefoxah yeah, it does cover that case where many apis will return a -1 if missing
00:04:02Triplefoxah yeah, it does cover that case where many apis will return a -1 if missing
00:04:08Triplefoxoops, arrowkeys
00:04:55Triplefoxinteresting how negative index "works" for slice and not for regular indexing
00:05:19Triplefoxe.g. you can do @[1,2,3][-1.. -1] to get @[3]
00:06:07EXetoCAraq: you did provide some arguments in favor of inclusive intervals, but it was still debated at great length
00:06:19Triplefoxi guess the error for a single index would stop some bugs
00:06:35EXetoCit can indeed be confusing to either have to add or subtract 1 in certain cases, but I must admit to sucking at such logic
00:06:42*Trustable quit (Remote host closed the connection)
00:07:00BlaXpirit_EXetoC, Python fixes brain very quickly
00:07:17BlaXpirit_but again, it is way too late to change this convention
00:07:25BlaXpirit_negative indices should go though
00:07:51BlaXpirit_BUT maybe there should be a special syntax inside square brackets
00:08:04BlaXpirit_that would be alias for this.len
00:08:24Triplefoxi can tolerate the current as long as there is a desugared equivalent for the half-inclusive situation
00:08:33BlaXpirit_[2..^-2]
00:09:20BlaXpirit_no, that's not good
00:09:47BlaXpirit_.eval var s = "abcdef"; s[2 .. s.high-2]
00:09:50MimbusBlaXpirit_: eval.nim(4, 1) Error: value of type 'string' has to be discarded
00:10:02BlaXpirit_you're supposed to say "cd"
00:10:15Triplefoxthen again, looking at actual code i've written i've already fallen into the size zero bug without having it surface
00:10:20BlaXpirit_s[2 .. ^-2] etc
00:10:38BlaXpirit_Triplefox, yup, and it's in standard library everywhere, i bet
00:11:02BlaXpirit_heck, this may even be possible with term rewriting macro
00:11:11BlaXpirit_i tried term rewriting template but it didnt seem to work
00:12:02Triplefox.eval var z : seq[int] = @[]; echo(z[0..high(z)])
00:12:06MimbusTriplefox: @[]
00:12:16Triplefoxokay, well that works i guess .-.
00:12:28BlaXpirit_it works because z[0..1000] would give @[] too
00:12:37BlaXpirit_as does z[0..0]
00:12:46Triplefoxactually it out of bounds it when it's too small
00:12:55Triplefox.eval var z : seq[int] = @[]; echo(z[0..1000])
00:12:58MimbusTriplefox: Error: unhandled exception: index out of bounds [IndexError]
00:13:45BlaXpirit_:o
00:13:53Triplefoxso in the common case where you iterate over a sequence of unknown size and it happens to be size zero...no bug
00:14:28EXetoCthat is neat
00:14:41BlaXpirit_neat that bug hides from you?
00:14:49BlaXpirit_ah high == -1
00:14:51BlaXpirit_ok
00:14:53BlaXpirit_...
00:15:16EXetoCthat in isolation anyway
00:19:54Triplefoxwhat i get from this is that in nim [0.. 0] is basically "magical" and has at least three contextual meanings
00:20:16Triplefoxas an array declaration, it's the array of unknown length
00:20:39Triplefoxon a slicable thing that is length zero, it's empty
00:20:45flaviuTriplefox: No, it's an array of size 1.
00:21:12Triplefoxon a slicable thing that is length greater than zero, it's the whole thing
00:21:20flaviu{.unchecked.} is of unknown length.
00:21:52Triplefoxokay, then it has four meanings and who knows why you'd ever have an array of size 1
00:21:55BlaXpirit_.eval echo(newSeq[int]()[0..0])
00:21:59MimbusBlaXpirit_: Error: unhandled exception: index out of bounds [IndexError]
00:22:07BlaXpirit_Triplefox, it's not magical
00:22:20BlaXpirit_you wrote 0 .. -1 before thinking its 0 .. 0
00:22:38Triplefoxoh, you're right
00:22:57BlaXpirit_inclusive indices :>
00:23:13BlaXpirit_i did it!
00:23:18BlaXpirit_term rewriting template
00:23:46EXetoCare they not supposed to keep the semantics?
00:24:03BlaXpirit_term rewriting template in case negative indices are removed
00:24:06flaviuYeah, the solution is worse than the problem IMO
00:24:55BlaXpirit_imagine we removed negative indices. if you had s[1 .. -1], you make that s[1 .. ^ -1]
00:25:27Triplefoxso then it's... array of size 1, array of unknown length(unchecked), whole if not empty, error if empty
00:30:11Triplefoxgood when you want an entire slice, then ugly in the case where you control the slice variables and have to insert emptyslice checks
00:30:53Triplefox"entire" = (everything in the original)
00:31:35Triplefoxalthough it is still consistent...
00:31:59Triplefox.eval echo(@[1,2,3][1.. 0])
00:32:03MimbusTriplefox: @[]
00:32:45dtscodehey Araq... how do you get the compiler to compile .tmpl files/
00:33:53dom96dtscode: Just include them.
00:34:09dtscodethats it? huh
00:34:15dtscodethanks dom96
00:34:41BlaXpirit_https://gist.github.com/BlaXpirit/f063fe6706201504580d
00:34:48BlaXpirit_"Replacement for negative indices"
00:35:28dtscodedom96, is there a page documenting .tmpl files?
00:35:39dom96http://nim-lang.org/filters.html
00:35:44dtscodety
00:36:21BlaXpirit_so guys, what do you think?
00:36:52flaviuI don't like it, I think the better option is to use exclusive upper bounds.
00:37:31def-BlaXpirit_: looks like an abuse of Term rewriting. If you used this in a library, the user could disable TR.
00:37:36BlaXpirit_flaviu, and break all existing code?
00:37:51flaviuBlaXpirit_: ye.
00:37:57BlaXpirit_def-, whatever, then add it to compiler -___-
00:38:17flaviuI'm not actually proposing that the stdlib be changed
00:39:03def-BlaXpirit_: I'd just write a proc "sub" that behaves as you want
00:39:15BlaXpirit_explain
00:39:28BlaXpirit_ah x.sub
00:39:29BlaXpirit_whatever
00:39:44gunnwhat am I doing wrong here? or is it a bug? https://gist.github.com/gunn/27e8ae56e5ffebc05a26
00:39:48BlaXpirit_the point of that thing i sent is to easily fix code
00:40:02BlaXpirit_you can just add 1 symbol and everything is fixed
00:40:29flaviudid someone just get bitten by inclusive ranges?
00:40:37BlaXpirit_nah it's just empty array
00:41:08flaviugunn: 1 sec, let me check the source
00:41:23BlaXpirit_flaviu, -_-
00:41:54BlaXpirit_i'm telling you, just 0-row result
00:42:33dtscodeoh wow... so this is kind of like c's preprocessor system
00:44:25flaviuBlaXpirit_: ah, "row number 0 is out of range 0..-1" is coming directly from postgres
00:46:11Triplefoxi've now lost interest in thinking about slices
00:47:27BlaXpirit_Araq, please do consider removing negative indices and introducing something like this syntax https://gist.github.com/BlaXpirit/f063fe6706201504580d to easily fix code that needs it
00:47:52flaviuplease, not another symbol.
00:48:04Varriount^
00:48:18BlaXpirit_yes, yes, ^ :p
00:48:27BlaXpirit_can be anything else though
00:48:39def-gunn: the code looks ok to me. you don't need to pass user and pw?
00:49:03BlaXpirit_def-, looks like 0 rows result
00:49:15BlaXpirit_or maybe it's just because of previous error
00:49:32gunndef-, flaviu, BlaXpirit_: yes, the tweets table was empty, explaining most of the result
00:49:34VarriountAlternately, we could allow negative indices only for literals.
00:49:41gunnit works fine on a populated table
00:49:47BlaXpirit_Varriount, naaah, that won't do
00:50:00VarriountToo much magic, I guess.
00:50:02BlaXpirit_people sometimes need to just count from end -_-
00:50:22BlaXpirit_all i'm saying is, these negative indices should be explicit
00:50:30def-gunn: still a strange error for an empty table
00:50:49BlaXpirit_requiring a '^' is just one of the countless ways to achieve it
00:52:10flaviuranges could also be less stupid.
00:52:27BlaXpirit_no, they couldn't without breaking all the code
00:52:28flaviuie, say if it should be exclusive or inclusive and if bounds wrap
00:52:34BlaXpirit_for sure
00:52:43BlaXpirit_that's what's good
00:52:49*brson quit (Quit: Lost terminal)
00:52:50BlaXpirit_but it is impossible to introduce now
00:52:55BlaXpirit_(not literally)
00:52:57*brson joined #nim
00:53:08flaviurewrite rewrite :P
00:54:08gunndef: yes, it looks like it's returning an empty row as per https://github.com/Araq/Nim/blob/master/lib/impure/db_postgres.nim#L162-L163 I wonder why it would SIGSEV on trying to iterate over it?
00:54:33BlaXpirit_you have 0 rows
00:54:42BlaXpirit_you take the first of the 0 rows
00:54:45BlaXpirit_do i need to continue
00:55:03BlaXpirit_i probably do
00:55:07gunnBlaXpirit_: row.len == 11?
00:55:13BlaXpirit_the pointer to 0 rows is not initialized
00:55:23BlaXpirit_gunn, row.len is taken from database columns
00:55:36BlaXpirit_it is stored separately for efficiency probably
00:56:13BlaXpirit_so yeah, when you take uninitializedpointer[0] - that's where the error happens
00:56:22gunnSo is this wrong: "If the query doesn't return any rows, this proc will return a TRow with empty strings for each column." ?
00:56:36BlaXpirit_no, wait, i'm completely wrong here
00:56:43Varriountthat was changed, I think
00:56:49BlaXpirit_gunn, that may indeed be a bug
00:57:24VarriountIIRC, something was changed so that something regarding databases returned 'nil' instead of a string. I can't remember specifics
00:57:33BlaXpirit_forget the part i said about pointers
00:57:57flaviuVarriount: When the DB contains null, it returns nil.
00:58:01flaviuinstead of returning ""
00:58:08VarriountAh, that was it, yeah.
00:58:42*BlaXpirit_ quit (Quit: Quit Konversation)
01:27:26*Demon_Fox joined #nim
01:33:58*JinShil joined #nim
01:51:49dtscodewhat does the standard filter do?
01:56:03EXetoCisn't it documented?
01:57:36dtscodei couldnt find it
01:57:40dtscodeill look again though
01:58:39EXetoCyou mean stdtmpl here http://nim-lang.org/filters.html ?
01:58:51EXetoCoh, that
01:59:05EXetoCno idea. don't bother I guess
01:59:20dtscodeok. awesome
01:59:42dtscodeand yeah i know what stdtmpl does. i was wondering what stdtmpl | standard does
01:59:52dtscodestandardizes the html maybe. idk. oh well
02:01:22EXetoCthe only reference I've found seems to indicate that it simply uses the standard syntax (rather than begin/end for example)
02:01:34EXetoCdoes |standard work?
02:01:58dtscodewhat do you mean? like appended to stdtmpl? or just |standard
02:02:23EXetoCstdtmpl|standard
02:02:38EXetoCstrongspaces might work too
02:03:03dtscodeitmight. let me finish and ill try to compile it
02:04:07*flaviu quit (Read error: Connection reset by peer)
02:04:07*Mimbus quit (Read error: Connection reset by peer)
02:06:21*flaviu joined #nim
02:10:12*Hakaslak joined #nim
02:15:03*Hakaslak quit (Ping timeout: 264 seconds)
02:20:14*phi_freenode is now known as phira
02:25:17*jefus__ joined #nim
02:28:53*jefus_ quit (Ping timeout: 246 seconds)
02:38:00dtscodecan someone tell me why this repo https://github.com/DTSCode/dtscodeio is causing: https://bpaste.net/show/44b831bf7e8c
02:39:00EXetoCI dunno but it is known
02:40:03Araqdtscode: title or content that you pass to genHTMLPage is nil?
02:40:11dom96dtscode: You need to init result inside genHtmlPage
02:40:26*VinceAddons quit (Read error: Connection reset by peer)
02:40:28dom96result = "" on line 3
02:40:31dom96in the .tmpl
02:41:20Araqah dom96 is right
02:41:30Araqand I should sleep
02:41:32Araqgood night
02:41:40dtscodeah, forgot to do that. thanks :)
02:50:21*skyfex quit (Read error: Connection reset by peer)
02:50:22*JinShil quit (Read error: Connection reset by peer)
02:50:58*skyfex joined #nim
02:52:18*vendethiel quit (Ping timeout: 265 seconds)
02:53:35*JinShil joined #nim
02:54:54*vendethiel joined #nim
02:56:57*darkf joined #nim
03:01:47*keyle quit (Quit: leaving)
03:03:08gmooredom96: if you're still here i had a debugging question. i've been trying nim out this week and really like it so far. one of the things ill need to evaluate shortly is how well i can debug a runtime problem. we're a microsoft shop so everything needs to play nice in MSVC more or less.
03:03:55gmoorewhat's the workflow for "oh no my program is doing weird things" for nim code? is there a way to get a sane mapping of the generated C code to your lines of nim and walk through line by line?
03:03:55dom96i'm still here
03:04:37dom96The compiler can generate line numbers for debuggers like gdb via the --lineDir:on option.
03:06:02*kapil__ joined #nim
03:07:00dom96good night
03:07:40gmooreah ok so embedded #line is the primary way to debug the running C code then. i believe msvc does support that. i'll give it a shot tomorrow. thanks!
03:08:49flaviugmoore: I do --debuginfo --linedir:on
03:08:55flaviuand then it runs fine in GDB, excluding some mangling.
03:10:03gmooredo you find that you're able to get enough info back to debug easily? i'm exploring nim as an alternative to writing C code when we don't need to, so everyone is very familiar with C, but the generated code is pretty unfriendly looking
03:12:58flaviuEasily enough for me. You have to use C syntax in print and some of the local variables are named LOC1, LOC2, ...
03:13:29flaviuStructure members are normally named
03:13:36gmooreso i take it there is a bit of a learning curve in deciphering the generated code
03:13:45flaviuyep, definitely.
03:14:09flaviubut GDB shows you the nim code and nim line numbers
03:14:24gmooreimo i'd rather spend a day writing some crap and 2 more days debugging it than spend an entire week just to do the code writing in C. just a matter of convincing my team, hah
03:14:36gmooreright ill have to see if i can get the same functionality out of msvc
03:15:42*vendethiel quit (Ping timeout: 245 seconds)
03:17:05*vendethiel joined #nim
03:19:00*gunn_ joined #nim
03:20:17*gunn quit (Ping timeout: 245 seconds)
03:33:40*NimrodBot joined #nim
03:34:58*NimrodBot quit (Remote host closed the connection)
03:35:01*Demon_Fox quit (Ping timeout: 272 seconds)
03:38:56*brson quit (Ping timeout: 244 seconds)
03:39:39*vendethiel quit (Ping timeout: 256 seconds)
03:40:17*johnsoft quit (Ping timeout: 245 seconds)
03:40:53*johnsoft joined #nim
03:41:59*Mimbus joined #nim
03:51:24*yonson quit (Read error: Connection reset by peer)
03:54:18ldleworkflaviu: can you write up a short thing on how you do debugging?
04:01:09flaviuldlework: Sure, I'll do it tomorrow.
04:21:11dtscodejust dont write bugs
04:22:03fowlmouthIf debugging is the process of removing bugs, then programming must be the process of putting them in.
04:22:55dtscodehmmm... i dont like this default font my site uses. i might fix that
04:33:06*JinShil quit (Quit: Konversation terminated!)
04:53:17*ARCADIVS joined #nim
05:00:26dtscodeis aporia still being worked on?
05:04:39EXetoCdtscode: slowly
05:05:02dtscodedamn :/
05:09:36*gunn_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
05:11:14*lws joined #nim
05:12:08fowlmouth4 npc sidewinders calling me a dreg
05:21:51*vendethiel joined #nim
05:23:13dtscodehrmmmm jester doesnt want to see my favicon...
05:24:18ldleworkhi lws welcome :)
05:25:00lwshello
05:25:13lwsldlework: Don't get too excited, I'm not a convert yet :D
05:25:25dtscodethats what they all say
05:26:11dtscodethen they see the UFC and they are like ZOMG GET ME NIM NOW
05:26:18lwsUFC?
05:26:25dtscodeuniform function call
05:26:32lwsWhat is that?
05:26:40dtscodebasically x(y) is the same as y.x()
05:27:09dtscodeand, you can also do x y (ie if the function has 0 or 1 arguments, you dont need the ()'s)
05:27:14lwsUFCS is what that's called in other systems BTW
05:27:33fowlmouththe S is for syntax..
05:28:13dtscodemeh. ive seen it called ufs as well
05:28:23ldleworkwhat would that stand for
05:28:34fowlmouthuniversal function call syntax
05:28:45ldleworkthat would be ufcs
05:28:50dtscodeuniform function syntax
05:28:55ldleworkaha
05:29:10fowlmouthunifunctax
05:29:43fowlmouthlws, what programming language do you most often use
05:29:48dtscodei was going to say imo its like procs/routines/functions/etc, and then you said that and now really want to call functions funkytions
05:29:54lwsAt work, or for pleasure?
05:30:04dtscodeboth
05:30:18ldleworklws is a D contributor
05:30:22lwsI use to use C# for work, just started at a Go shop, and D is my hobby language
05:30:44dtscode>D
05:30:44lwscontributor is being generous. Haha :)
05:30:56fowlmouthgo shops exist? my soul just shrunk a little bit
05:31:02ldleworkfowlmouth: Docker :/
05:31:04lwsfowlmouth: Yes, unfortunately.
05:31:08dtscode>Go
05:32:03lwsGo makes me miss C#..
05:32:20lwsAnd that statement makes me really sad.
05:32:31dtscodei dont like go :}
05:32:35dtscodeor D for that matter
05:32:43ldleworkI found Nim because as a Python programmer I yearned for a nice language like C# in the FOSS space
05:32:44dtscodebut thats just because im a n00b
05:32:45ldleworktada, Nim
05:33:03lwsC# is nice because of the framework behind it
05:33:12ldleworkThat isn't the core reason no.
05:33:13fowlmouthlws, C# seems nice (i've only used it with visual studio though, intelliwhatever helps a lot)
05:33:14lwsAlthough it's a pretty decent language in it's own right.
05:33:25fowlmouthi was able to jump right into it
05:33:32ldleworkC# is nice because not only does each feature work well, all the features seem to work well together.
05:34:15ldleworkintellisense does help a lot
05:34:34ldleworkI tried to get into Mono .. but meh
05:34:35lwsThe reason all those features work well is that the standard library is tightly coupled to the language...
05:34:55dtscodecan someone tell me why my favicon isnt working? https://github.com/DTSCode/dtscodeio
05:35:05lwsThe language syntax is aware of specific interfaces in .NET and if you support those, you get lots of nice syntactic sugar.
05:35:49fowlmouthdtscode, put http in the href or use a relative url (/images/favicon.ico)
05:36:05fowlmouthis my guess
05:36:10dtscodehmmm ill try that
05:37:09lwsdtscode: FYI: http://www.drdobbs.com/cpp/uniform-function-call-syntax/232700394
05:37:21lwsI'm pretty sure that article coined the term. Note the author.
05:37:50dtscodelws, im not saying im write. im just saying ive seen it called all 3 before.
05:37:53dtscodeslang if you will
05:38:34lwsdtscode: I'm not arguing with you, I was pointing out the inventor of the concept.
05:38:53dtscodeag
05:39:00dtscodeah*
05:39:05dtscodethanks for the article btw
05:39:26dtscodefowlmouth, didnt work :/
05:39:51lwsdtscode: I don't blame you for not liking D. There's a lot of really cool stuff in the language and some of it was sort of "discovered by accident" such as UFCS. I like that Nim takes these ideas and designs with many of them in mind from the start.
05:40:42lwsI would actually encourage you guys to hang out in the D usenet forum for reference. Because some of the features actually are causing a lot of heated debates due to bugs they cause in code.
05:40:56lwsIt would be good to be aware of those types of things when making those features first class citizens.
05:41:52lwse.g. Optional () around functions that take no parameters actually causes ambiguity when you want to refer to the function itself.
05:41:59fowlmouthdtscode, this says you should use rel="icon" http://www.w3.org/2005/10/howto-favicon
05:42:33lwsCaused a lot of debate in the D forums. Optional () are going to be deprecated in D because of it, and they will only apply to @property methods and then they will not be allowed.
05:43:41ldlework.eval proc foo() = echo "hello"; foo
05:43:44Mimbusldlework: eval.nim(4, 0) Error: value of type 'proc ()' has to be discarded
05:44:07ldleworkwut
05:44:13*vendethiel quit (Ping timeout: 272 seconds)
05:44:25ldlework.eval proc foo() = echo "hello";foo
05:44:28Mimbusldlework: eval.nim(4, 0) Error: value of type 'proc ()' has to be discarded
05:44:33fowlmouthnim requires parens if there are no arguments
05:44:43ldleworkah I see, it wants me to discard foo itself
05:45:09dtscodefowlmouth, oops my mistake. i dont know why i thought it was 0 or 1 arguments
05:45:09lwsfowlmouth: ? Parents are option if there ARE arguments?
05:45:16lwsparens*
05:45:21dtscodelws, only if there is one
05:45:27dtscodeie:
05:45:54dtscode.eval proc foo(x: int) echo x; foo 1; foo(2);
05:45:57Mimbusdtscode: eval.nim(3, 21) Error: invalid indentation
05:46:05ldleworkno spaces
05:46:10dtscode.eval proc foo(x: int) echo x; foo 1;foo(2);
05:46:13Mimbusdtscode: eval.nim(3, 21) Error: invalid indentation
05:46:13dtscodeoops
05:46:16lws.eval proc foo(x: string) = echo "hello"; foo("hello")
05:46:17fowlmouthlws, yes but only for the outtermost expression
05:46:20Mimbuslws: hello
05:46:27fowlmouth.eval echo 1,2,3
05:46:28dtscode.eval proc foo(x: int) = echo x; foo 1;foo(2);
05:46:30lws.eval proc foo(x: string) = echo "hello"; "hello".foo
05:46:30Mimbusfowlmouth: 123
05:46:33Mimbusdtscode: 1
05:46:36Mimbuslws: hello
05:46:44lws.eval proc foo(x: string) = echo "hello"; echo &"hello".foo
05:46:46Mimbuslws: eval.nim(4, 13) Error: expression 'foo("hello")' has no type (or is ambiguous)
05:46:56dtscode& is string catting in nim
05:46:56lws.eval proc foo(x: string) auto = return "hello"; echo &"hello".foo
05:46:59Mimbuslws: eval.nim(3, 24) Error: invalid indentation
05:47:53lws.eval proc foo(x: string):string = return "hello"; echo "hello".foo
05:47:56Mimbuslws: hello
05:47:56lwshow do I take an address?
05:48:19fowlmouthlws, addr, but you couldn't do it that way
05:48:23lws.eval proc foo(x: string):string = return "hello"; echo addr "hello".foo
05:48:26Mimbuslws: eval.nim(4, 5) Error: expression has no address
05:48:36lwswah?
05:49:06lwsAh, I need to make foo a method on a struct to see the behavior
05:49:08fowlmouth.eval var x = "hello"; x.addr.echo
05:49:10Mimbusfowlmouth: eval.nim(4, 2) Error: type mismatch: got (ptr string)
05:49:17fowlmouth.eval var x = "hello"; x.addr.repr.echo
05:49:20Mimbusfowlmouth: ref 0x645b20 --> 0x7f6ae4543050"hello"
05:49:20lws.eval proc foo(x: string):string = return "hello"; echo addr "hello".foo.addr
05:49:23Mimbuslws: eval.nim(4, 22) Error: expression has no address
05:49:27lws.eval proc foo(x: string):string = return "hello"; echo "hello".foo.addr
05:49:30Mimbuslws: eval.nim(4, 17) Error: expression has no address
05:49:38lwsInteresting
05:49:47lwsHow does nimbus work? Is it compiling to javascript or something?
05:49:51lwsmimbus
05:50:23ldleworklws: why do you think it must be compiling to js?
05:50:41lwsThere's a direct nim interpreter?
05:51:14ldleworklws: Nim compiles very fast
05:51:32fowlmouthlws, you can only get address of an l-value, not an r-value, and inside the proc you can't get x's address
05:51:53lwsldlework: Seems like a bad idea to compile nim to C and C -> asm and then execute it and give me the result here?
05:52:13lwsWhat's it doing, firing up a container real quick to sandbox it too?
05:52:21ldleworkit is sandboxed, yes
05:53:33ldleworklws: try to write something
05:55:58lws.eval echo system.open("/dev/urandom").readLine
05:56:01Mimbuslws:
05:56:13lws:(
05:56:26lws.eval echo system.open("/etc/hosts").readLine
05:56:29Mimbuslws: #
05:56:36lws.eval echo system.open("/etc/shadow").readLine
05:56:39Mimbuslws: Error: unhandled exception: cannot open: /etc/shadow [IOError]
05:56:43lws:(
05:56:46lwslol
05:59:51lws.eval echo osproc.execCmd("mount")
05:59:54Mimbuslws: eval.nim(3, 5) Error: undeclared identifier: 'osproc'
05:59:56lws.eval osproc.execCmd("mount")
05:59:59Mimbuslws: eval.nim(3, 0) Error: undeclared identifier: 'osproc'
06:00:08lws.eval import osproc; osproc.execCmd("mount")
06:00:11Mimbuslws: eval.nim(4, 14) Error: value of type 'int' has to be discarded
06:00:18lws.eval import osproc; echo osproc.execCmd("mount")
06:00:22Mimbuslws: proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
06:00:22*Mimbus quit (Excess Flood)
06:00:29*Mimbus joined #nim
06:01:15*gunn joined #nim
06:02:03lws.eval import osproc; var x, y = osproc.execCmdEx("mount"); echo x
06:02:07Mimbuslws: (output: proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
06:02:07*Mimbus quit (Excess Flood)
06:02:13*Mimbus joined #nim
06:03:31lws.eval import osproc; import strutils; var x = osproc.execCmdEx("mount"); echo x.output.splitLines[2]
06:03:35Mimbuslws: dev on /dev type devtmpfs (rw,nosuid,relatime,size=4052072k,nr_inodes=1013018,mode=755)
06:03:39lwsmwahaha
06:03:43lws.eval import osproc; import strutils; var x = osproc.execCmdEx("mount"); echo x.output.splitLines[3]
06:03:46Mimbuslws: run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
06:03:49lws.eval import osproc; import strutils; var x = osproc.execCmdEx("mount"); echo x.output.splitLines[4]
06:03:52Mimbuslws: /dev/mapper/linux on / type btrfs (rw,nodev,relatime,compress=lzo,space_cache)
06:04:36lwsSeems like a neat language
06:05:03lwsVery easy to get some stuff working
06:05:57lwsldlework: Is mimbus your bot?
06:06:04ldleworklws: no dts
06:06:31ldleworkdtscode
06:07:01lwsIt seems like it'd be possible to overwrite mimbus with a .eval though
06:07:09lwsWhich would just be annoying I suppose
06:07:20dtscodehmmmm?
06:07:28lwsI assume the bot is running in the same container?
06:07:31dtscode.eval and Mimbus: do the same thing
06:07:34Mimbusdtscode: eval.nim(3, 3) Error: expression expected, but found 'keyword and'
06:07:39ldleworkhehe
06:07:44dtscodeoh you tricked me
06:07:49dtscodeim suing
06:07:56ldleworkdtscode: he's saying that you could get Mimbus to overwrite itself
06:08:01dtscodehow so?
06:08:17lwsIs mimbus in the same container as what it's evaling?
06:08:22ldleworkdtscode: is Mimbus running in a Docker container?
06:08:47fowlmouth.eval echo(hostOS, " ", hostCPU)
06:08:51Mimbusfowlmouth: linux amd64
06:08:58dtscodeldlework, not yet. its kind of on the backburner right now due to more important projects
06:09:07ldleworkjust wondering
06:09:09dtscodelws, no its not
06:09:39lws.eval echo system.open("/proc/cgroup").readLine
06:09:42Mimbuslws: Error: unhandled exception: cannot open: /proc/cgroup [IOError]
06:09:54lws.eval echo system.open("/proc/self/cgroup").readLine
06:09:57Mimbuslws: 8:memory:/
06:10:45lws.eval var f = system.open("/proc/self/cgroup"); f.readLine; echo f.readLine
06:10:48Mimbuslws: eval.nim(4, 1) Error: value of type 'TaintedString' has to be discarded
06:11:03lws.eval var f = system.open("/proc/self/cgroup"); var x = f.readLine; echo f.readLine
06:11:06Mimbuslws: 7:devices:/user.slice
06:11:31lwsmemory is not capped?
06:11:49fowlmouthcan we move the Mimbus spamming to #nim-offtopic
06:11:55dtscodeuhhh no. it looks like flaviu is running a very early release
06:11:55lwsSorry :)
06:45:04lwsdtscode: Early release of?
06:48:02vegai3 overlapping ways to make function calls?
06:48:18vegaioops, sorry. Commented on something in the backlog
06:55:13dtscodelws, Nimbus
07:08:55dtscodefowlmouth, that didnt work eitehr
07:09:04dtscodeAraq, dom96 do either of you have an idea?
07:11:53*nande quit (Remote host closed the connection)
07:36:57*vendethiel joined #nim
07:39:03*gour joined #nim
07:42:25*Demon_Fox joined #nim
07:52:00*SplinterOfChaos quit (Ping timeout: 264 seconds)
07:58:48*valberg quit (Changing host)
07:58:48*valberg joined #nim
07:59:51*vendethiel quit (Ping timeout: 244 seconds)
08:08:02*rkj-b joined #nim
08:08:30*BlaXpirit joined #nim
08:12:48*rkj-b quit (Quit: ChatZilla 0.9.91.1 [Firefox 34.0.5/20141126041045])
08:20:56*gsingh93 quit (Quit: Connection closed for inactivity)
08:34:46*Sphax joined #nim
08:41:44ekarlsoc2nim --header foo.h -o foo isn't that correct ?
08:44:08*Sphax quit (Quit: ZZZZZzzzzz)
08:44:43EXetoCno, you're missing the inputfile parameter as you can see in the help output
08:45:29dtscodeany day now linus will be finding out about c2nim and will be like "Fuck yeah. i can port the kernel to nim now."
08:48:00ekarlsoEXetoC: so you pass it .c files ? ^
08:49:15ekarlsoahh
08:49:16ekarlsonice
08:49:49EXetoCheaders too
08:50:59*Sphax joined #nim
09:07:46*vendethiel joined #nim
09:11:12*Trustable joined #nim
09:14:51*seemsindie joined #nim
09:30:25*vendethiel quit (Ping timeout: 256 seconds)
09:33:49*EXetoC quit (Ping timeout: 252 seconds)
09:45:38*vendethiel joined #nim
09:45:55BlaXpiritjust realized it's impossible to extend `re` library to have the functionality I need
09:45:57BlaXpiritsigh
09:46:02*Demon_Fox quit (Quit: Leaving)
09:50:09ekarlsohmm, is there a way to have a object that inherits from Table ?
09:50:19ekarlsolike Claims = Table[string, JsonNode] ?
09:50:52ekarlsoI tried that but then when I do var claims = Claims(); claims["foo"] = %"foo" it goes invalid storage
09:51:01BlaXpiritekarlso, heh, i wanted almost exactly the same thing yesterday
09:51:06BlaXpiritbut i wanted to inherit from seq
09:51:21BlaXpiritah ekarlso, wait
09:51:27BlaXpirityou actually can extend from it?
09:51:34BlaXpirityou probably need to call "new"
09:51:37BlaXpiritor newtable
09:51:39BlaXpiritor whatever it is
09:51:50BlaXpiritshow code tho
09:51:54BlaXpiritalways show code
09:53:07BlaXpiritok whatever
09:54:06ekarlsoBlaXpirit: was getting coffee :p
09:54:19ekarlsohttps://bpaste.net/show/03debcdf211a
09:54:43BlaXpiritekarlso, basically my rule of thumb is
09:54:48BlaXpiritnever create objects directly
09:54:55BlaXpiritalways use a constructor function
09:55:53BlaXpiritTableRef... sigh
09:55:57ekarlsoBlaXpirit: yeah, was wondering if I should just proc newclaims that returned a table..
09:56:24BlaXpiritbut it doesn't look like Table is a ref object, so "new" is probably not needed for it itself
09:56:44BlaXpirithowever, it contains a seq, which does need to be initialized
09:56:53BlaXpiritbasically call v
09:56:55BlaXpiritinittable
09:57:26ekarlso?
09:57:29BlaXpiritekarlso, oh to generalize a bit more
09:57:38BlaXpiritthis type you created is not the problem here
09:57:47BlaXpirityou wouldn't be able to use a normal table like this too
09:57:58BlaXpiritbecause you should not create it directly!
09:58:01BlaXpiritinitTable is the thing
09:58:41ekarlsoI guess I can just skip declaring the claims type vs just creating a new table
09:59:57ekarlsoyap, worked wonderfully
09:59:59ekarlso:D
10:00:16ekarlsoit's allmost stupid how easy nim is sometimes..
10:00:40BlaXpiriteasy?
10:00:50BlaXpiriti wouldn't say it's so easy
10:00:59ekarlsoBlaXpirit: I mean, for me coming from a dynamic languages background vs learning C
10:16:21*VinceAddons joined #nim
10:58:24*matkuki joined #nim
10:59:20*ARCADIVS quit (Quit: ARCADIVS)
10:59:57*JinShil joined #nim
11:15:32*akir joined #nim
11:16:50akirHi, a username "akiradeveloper" is kicked by ChanServ. Did I do anything wrong?
11:18:03akirplz let "akiradeveloper" join this chat. I am not sure why I am kicked out
11:18:39*gour_ joined #nim
11:18:48*gour quit (Read error: Connection reset by peer)
11:19:44*jm116_ quit (Quit: Leaving)
11:20:51akirI am going out for an hour but keep this connection. Please tell me if I did bad thing for kicking
11:22:25*gour_ is now known as gour
11:34:45*gokr quit (Ping timeout: 276 seconds)
11:41:01BlaXpiritok i think i have found a bug here
11:41:13BlaXpiritminimal example time!
11:43:29BlaXpiritdamn, cant reproduce
11:49:20flaviuakir: I checked the logs, and I see no reason why you would be banned. It's probably a mistake, glitch, or misunderstanding; hopefully dom96 can figure out how to fix it whenever he comes back.
11:51:21ekarlsoso flaviu yes a jwt needs to be decoded on the server side..
11:51:26ekarlsohs256 that is.
11:51:52ekarlsoflaviu: unless alg is none that is
11:51:59flaviuekarlso: sorry, I can't stay and chat. I've got to go.
11:52:08ekarlsoflaviu: ok :)
11:52:45ekarlsohow do I get the compiler to know of a library path ?
12:05:28dom96akir: I don't see you being kicked anywhere.
12:12:33*Sphax quit (Quit: ZZZZZzzzzz)
12:14:09akirI am back now
12:14:09*keyle_ joined #nim
12:15:12akirdom96: really? I am using web IRC chatting. When I try to log into this room, ChanServ kicks me out
12:15:18akirI will try again
12:15:21*akir left #nim (#nim)
12:16:38*akir joined #nim
12:16:50akir[21:15] == akiradeveloper was kicked from #nimlang by ChanServ [Invite only channel]
12:16:56akirthis is the log
12:17:25dom96Join #nim instead.
12:17:36*akir left #nim (#nim)
12:18:20*akiradeveloper joined #nim
12:18:26akiradeveloperYeah
12:18:49akiradeveloperThanks. Changed from nimlang to nim?
12:19:06*Sphax joined #nim
12:19:14*gokr joined #nim
12:19:18dom96yes
12:20:57akiradeveloperI see..
12:24:09akiradeveloperPlease tell me why is this code compiled? T isn't obviously a subclass of float https://gist.github.com/akiradeveloper/2a5a6fed3246fc30a565
12:24:30*keyle_ is now known as keyle
12:28:35BlaXpiritdoes anyone know how to make function "any"?
12:28:42BlaXpiritand why it is not in standard lib
12:29:11BlaXpiritakiradeveloper, seems to me that ldlework brought this up yesterday
12:30:16BlaXpirithttp://irclogs.nim-lang.org/15-01-2015.html 05:45:42
12:30:54BlaXpirit21:06:47 better
12:35:13akiradeveloperBlaXpirit: I use = instead of : but the same problem per se?
12:35:24BlaXpiritprobably
12:35:35BlaXpiriti dont know this stuff
12:38:22akiradeveloperit's not a big thing for me and ok
12:45:51*BitPuffin joined #nim
12:46:13BlaXpiritwhat is up with json module
12:46:41BlaXpiriti hoped it would be so clever
12:46:51BlaXpiritto learn from it
12:50:19BlaXpirithow to get argv?
12:51:33BlaXpiritcommandLineParams
12:52:00*gour quit (Remote host closed the connection)
12:59:32*gour joined #nim
12:59:45TriplefoxFeeling pretty good about this spritesheet library... I think I've got the internal data sorted now so I'm starting work on some algorithms
12:59:49*gour quit (Changing host)
12:59:49*gour joined #nim
13:00:17TriplefoxIt's designed so that you will be able to write little scripts to do whatever is needed
13:00:39*EXetoC joined #nim
13:06:02*keyle quit (Quit: Morbo: Chitchat achieved!)
13:11:14*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 34.0.5/20141126041045])
13:14:22*BitPuffin quit (Ping timeout: 240 seconds)
13:19:38gokrBtw, for optparsing - I did tweak and get Lapp going (similar to docopt, but probably less advanced).
13:20:24gokrI am using it in my blimp utility. Here is Lapp: https://gitlab.3dicc.com/gokr/lapp
13:23:16*Demon_Fox joined #nim
13:24:02*BitPuffin joined #nim
13:30:13gokrWho controls nim-lang.com? Is it you Araq?
13:30:22gokrEh, nim-lang.org I mean
13:31:45*jpoirier quit (Quit: Leaving)
13:33:38BlaXpirittype Argument = ref object of LeafPattern
13:33:47BlaXpiritwhy can't I convert Argument(leafpattern)
13:35:04ekarlsois it 2 spaces or 4 spaces that's wanted in .nim files ?
13:35:10ekarlsoI see some with 2 and some with 4..
13:35:26EXetoC2 is more common
13:36:15BlaXpiritplease explain to me: https://bpaste.net/show/cae091e63e53
13:38:35BlaXpiritwhat can I do to make this work?
13:40:34BlaXpiritpls
13:42:13BlaXpirit:(
13:42:19BlaXpiritthis halts all my work
13:43:10BlaXpiritT_T
13:44:57EXetoCby keeping another reference? but I assume it shouldn't be needed. do you really want to downcast though?
13:45:20BlaXpirityou call it "down"?
13:45:24BlaXpirityes, well, i do really want
13:46:52EXetoCworks with a nil base object apparently :p
13:47:30BlaXpiritEXetoC, inheritance only works with non-final objects -__-
13:47:56BlaXpiritor i don't know what you mean
13:50:03BlaXpiritthis works in c++
13:52:37EXetoCBlaXpirit: casting seems to work
13:52:50BlaXpiritbut it's bad, mkay
13:52:59BlaXpiritwhat if there is non-empty memory
13:53:08BlaXpiritim pretty sure it writes trash to other members or something
13:53:14BlaXpiritalthough that shouldnt be a problem
13:53:24BlaXpiritno wait
13:53:28BlaXpiritwriting to extra members
13:53:33BlaXpiritwill write to uncharted territory
13:57:04BlaXpirithttp://ideone.com/x17i0X vs https://bpaste.net/show/430a86cd7859
13:57:06EXetoCyou might be right
14:00:17EXetoCbut it's not a 'B' to begin with
14:01:15EXetoCcompare your statement with this: "discard B(A(B()))", which works
14:02:06BlaXpiritEXetoC, but c++ does something with it
14:02:06EXetoCyou don't want an object variant though? just asking because of the downcast. it's discouraged I think, but I don't know what your code is doing
14:02:25*BlaXpirit is trying to port a Python library to Nim without understanding it
14:02:25ekarlsohmm, can you go from varargs > seq ?
14:02:32BlaXpirit@
14:02:40EXetoCright, because it's a static cast, and not a dynamic cast
14:02:45BlaXpiritfacepalm
14:02:55EXetoCwell
14:03:01BlaXpiritso what if i want a static cast
14:03:17BlaXpiritc++ crashes, makes sense
14:03:36akiradeveloperI have two files a.nim b.nim. b is the main file and a has library function. What compile option do I need to import a from b?
14:03:41BlaXpiritcrashes on dynamic_cast, that is
14:03:47EXetoCthen you cast like I said, which I'm not encouraging now that I know a little more about this, and hope that it doesn't explode
14:03:56BlaXpiritakiradeveloper, why not import or include it??
14:04:13EXetoCyes, and B(A()) can be considered a failed dynamic cast
14:04:21EXetoCthere's also the "x of y" test
14:04:25*gokr_ joined #nim
14:04:32BlaXpiritok, EXetoC, then let me put this differently
14:04:33*askatasuna joined #nim
14:04:55akiradeveloperBlaXpirit: what do you mean? I want to import a.nim from b.nim
14:04:58BlaXpirithow to inherit constructor of ref object?
14:05:14BlaXpiritakiradeveloper, then write import a
14:05:55akiradeveloperWe don't need to create .o file like in C?
14:05:58EXetoCyou must explicitly upcast and then pass it to the base "constructor", which is one aspect that OOP macros simplify I think
14:06:07BlaXpiritEXetoC, https://bpaste.net/show/39b65bf105f6
14:06:30EXetoCthat's what I recall for my brief use of inheritance over a year ago
14:06:48BlaXpiritthis is one of the problematic places
14:06:57akiradeveloperyeah succeed, thanks
14:07:36EXetoCBlaXpirit: I think you must start by constructing the leaf class
14:07:55EXetoCsince it does indeed encompass the base type as well
14:08:10akiradevelopermaybe, I am ready to implement nim-fuse. since I am newbie, it will be a long fight.
14:08:59EXetoCthis can be tested by adding a field to each class and then stringifying a base class object (dereference first)
14:09:56BlaXpiritD:
14:10:00BlaXpiritI don't understand
14:10:49*akiradeveloper left #nim (#nim)
14:11:12BlaXpiritbut don't try too hard to explain, i just might not need this all stuff
14:11:25BlaXpiritjust gonna rewrite constructors, big deal
14:11:33EXetoChence why "B(A(B()))" works, but "B(A())" doesn't, because the runtime type of the object passed to B in the latter case is an A and not a B
14:11:39BlaXpiritand hope it is not anywhere else in the code
14:11:52BlaXpiritEXetoC, well, yes, that totally makes sense
14:12:05BlaXpiritthank you
14:13:06BlaXpiritnext up, attempt to read from nil
14:16:10*jefus__ is now known as jefus
14:23:23ekarlsohttps://bpaste.net/show/b627c94b1743 < does that API seem fair ?
14:25:57*jefus_ joined #nim
14:28:54*jefus quit (Ping timeout: 244 seconds)
14:32:52ekarlsohttps://bpaste.net/show/0fbb41758be5 < shouldn't #72 work there ? claims.nim(72, 24) Error: type expected
14:35:05*jefus_ is now known as jefus
14:35:23EXetoCEXP is not a type. perhaps you want T:static[ClaimKind]. it might or might not work, as static is experimental
14:35:37EXetoCbut why is it not a normal parameter?
14:36:46EXetoCthe variant type can be selected at run-time
14:37:02ekarlsogood call
14:37:11EXetoCit can be done statically by making the type generic as well
14:37:23*Sphax quit (Quit: ZZZZZzzzzz)
14:38:20ekarlsothat worked more nicely EXetoC :)
14:38:21*Sphax joined #nim
14:38:35EXetoCc(:)|<
14:38:51*sillesta joined #nim
14:40:48*gokr_ quit (Ping timeout: 245 seconds)
14:42:14*Demos joined #nim
14:46:51*Demos quit (Ping timeout: 264 seconds)
14:51:04Araqgokr: yes. why?
14:51:15*gokr_ joined #nim
14:57:19AraqBlaXpirit: I'm willing to do something about negative indexing (never liked it too much in the first place), but less noise from you can only help you as I'm about to /ignore you.
14:59:54gokrHey guys
15:00:06gokrAraq: I am itching to set up a planet for Nim
15:01:57Araqgokr: nice :D
15:07:53*Guest51690 is now known as adam12
15:33:14novista planet?
15:34:52*SplinterOfChaos joined #nim
15:44:53*faineance joined #nim
15:49:25gokrnovist: Yeah. A blog aggregator. At say planet.nim-lang.org
15:49:50gokrI think I will use the Pluto tool - it seems the most maintained variant these days.
15:50:06gokrWill set one up this weekend I think.
15:50:21novistnever heard of such things ^_^
15:50:42*nimnoob joined #nim
15:50:51gokrThere are TONS of them: http://www.planetplanet.org
15:51:16gokrHere is the one for the Mono people: http://www.go-mono.com/monologue
15:52:16gokrAnd here is one using the software I will use: http://planetruby.herokuapp.com
15:53:34novistlast one reminds me of hackernews
15:55:20EXetoCis there a planet-planet-planet too?
15:56:58*jpoirier joined #nim
15:59:18*faineance quit (Quit: leaving)
16:00:13*darkf quit (Quit: Leaving)
16:00:38*faineance joined #nim
16:01:35*kapil__ quit (Quit: Connection closed for inactivity)
16:04:45*nimnoob quit (Remote host closed the connection)
16:08:51*MajorWork joined #nim
16:20:39*nimnoob joined #nim
16:22:44*brson joined #nim
16:23:29*UberLambda joined #nim
16:33:17*nimnoob quit (Ping timeout: 252 seconds)
16:43:22*seemsindie quit (Ping timeout: 240 seconds)
16:54:36*BlaXpirit quit (Read error: Connection reset by peer)
16:54:59*BlaXpirit joined #nim
17:05:27*gokr_ quit (Ping timeout: 264 seconds)
17:29:35*JinShil quit (Quit: Konversation terminated!)
17:29:50*Sphax quit (Quit: CYA!!)
17:45:48*gmpreussner___ joined #nim
17:49:37*gmpreussner___ is now known as gmpreussner
17:53:17*faineance quit (Remote host closed the connection)
17:54:44*gsingh93 joined #nim
17:54:55*UberLambda quit (Quit: Leaving the Matrix)
17:55:54*MajorWork quit (Quit: Leaving)
18:23:46def-Is this the first time Nim(rod) appeared on this Programming Language Rankings?: http://redmonk.com/sogrady/2015/01/14/language-rankings-1-15/
18:25:38*yonson joined #nim
18:25:48gmpreussnerdef-: wohoo... gonna be number one soon
18:26:13gmpreussnerAraq: maybe i'm doing it wrong, but the endians module seems rather inconvenient to use since it requires pointers
18:26:41gmpreussneri often have proc parameters (int16 etc.) that need to be converted
18:27:01gmpreussnerbut the addr operator doesn't accept those, so i have to copy to local vars first?
18:27:12Araqyes
18:27:45Araqwell it just needs some more convenience procs
18:28:22gmpreussnerif you tell me what they should be, i can add them and submit a PR
18:28:31gmpreussnerbut i'd like it to not require an extra copy
18:29:02ekarlsohow would u go about doing something like >https://github.com/square/go-jose/blob/master/shared.go#L79 in nim +
18:29:15gmpreussnerespecially since the values will just be passed through a lot of times
18:30:00Araqgmpreussner: unsafeAddr is planned to allow taking the address of a parameter but for scalars at least the copy is optimized away anyway
18:30:08def-ekarlso: type SignatureAlgorithm = distinct string?
18:30:09gmpreussnerekarlso: type SignatureAlgorithm = string
18:30:14ldleworkdef-: I don't see Nim on that page
18:30:22gmpreussneror distinct, yes
18:30:31def-ldlework: it's on the picture, bottom left corner, as Nimrod
18:30:44gmpreussnerAraq: ok, i will copy then
18:50:49dom96def-: nope
18:51:17*yonson quit (Quit: Leaving)
18:59:23EXetoCAraq: as in a parameter that is not annotated with 'var'?
19:00:31AraqEXetoC: yes exactly
19:01:29EXetoCgreat
19:09:59EXetoCanyone using nim for DSP?
19:11:30gmpreussnerhow do i properly do pointer arithmetic? i have to convert some C crap... i need to add sizeof(SomeType)' to some 'ptr uchar' and return the new 'ptr uchar'
19:12:31BlaXpiritgmpreussner, i did something here https://github.com/BlaXpirit/nim-csfml/blob/55b09f6c3251cd963790bcd71c217b03b6534b77/src/csfml_graphics.nim#L217
19:13:00BlaXpiritgmpreussner, basically u cast to int, then add, then cast back
19:13:10gmpreussnerah ok, cool thx
19:13:15BlaXpiritthere are other, maybe better ways
19:13:23BlaXpiritif you plan to extensively use pointer arithmetic
19:13:30*Varriount|Busy joined #nim
19:13:31BlaXpiritthere was a library https://github.com/fowlmouth/nimlibs/blob/master/fowltek/pointer_arithm.nim
19:13:35gmpreussnernah, it's just a few one offs
19:13:48Varriount|BusyHi guys!
19:13:54gmpreussnero hai
19:17:30*rpag joined #nim
19:38:51*Guest70720 quit (Quit: WeeChat 1.0.1)
19:44:10*Demos joined #nim
19:46:36*sampwing joined #nim
19:48:12*joecodes joined #nim
19:56:25gmpreussnercan someone tell me what this C syntax is? http://pastebin.com/mJJrZKiM
19:56:30gmpreussneris 'bar' a dynamic array?
19:56:40gmpreussnerhow would i translate this to nim?
19:59:01*Fusion_Gaming is now known as FusionGaming
20:00:36Araqgmpreussner: .unchecked pragma, look it up, it's documented
20:01:06Araqit's an array of unspecified length, valid only as last element in a struct
20:01:29gmpreussnerinteresting, i have never seen that before
20:01:49gmpreussnerthanks Araq, the docs have what i need
20:05:46*nande joined #nim
20:09:07*NimBot joined #nim
20:11:59dtscodehey dom96... i did as you said, and moved the image to a public folder (so now its under $SiteRoot/public/images), but the favicon still isnt showing up
20:36:58BlaXpiritdtscode, i can look at it if it isn't something uncommon
20:45:33*sampwing quit (Ping timeout: 252 seconds)
20:49:17*Mat4 joined #nim
20:49:31Mat4hello
20:49:39Varriount|BusyHi Mat4
20:50:01Mat4Hi Varriount, what's new ?
20:51:02Varriount|BusyMat4: Well, I'm writing a string based linked-list of strings, using xor and tags to save memory
20:51:19Varriount|BusyIt's interesting work.
20:51:37dtscodeBlaXpirit, ok. give me a sec to update the repo
20:53:14Mat4Varriount|Busy: Reads nice
20:53:32Mat4I'm fighting with the bochs emulator and its debugger today
20:54:15Mat4(it's really a primitive monitor intended for OS development)
20:54:25dtscodehttps://github.com/DTSCode/dtscodeio BlaXpirit
20:55:35BlaXpiritok, gonna pm you
20:56:00ekarlsodo we have something like play.rust-lang.org ?
20:56:19Varriount|Busyekarlso: Not really.
20:56:25ekarlso-,,-
20:56:30ekarlsomaybe something to create :D
20:57:29flaviudtscode: Do you have a new version of Nimbus?
20:58:05dtscodeflaviu, no not yet :/ its kind of on the backburner right now.
20:59:30flaviudtscode: Ok. I saw "dtscode | uhhh no. it looks like flaviu is running a very early release" in the logs, is that something I should fix or.. ?
21:00:04*yonson joined #nim
21:00:16*wan joined #nim
21:01:20*gour left #nim ("Leaving")
21:01:52dtscodeit doesnt do gists
21:02:05dtscodewhich is why i thought that
21:02:11ekarlsoMimbus: is irc only atm no ?
21:02:27dtscodewhat else would it be?
21:02:39flaviugokr: lapp looks cool, can you add it to nimble? It might also be a good idea to paste the example in the README so it's readily accessible.
21:02:48flaviuekarlso: It's very tightly coupled to IRC.
21:02:59ekarlsoshouldn't be that hard to make it be both..
21:03:08ekarlsodtscode: do you do somekind of isolation atm with it ?
21:03:29flaviuekarlso: I would be the correct person to ask that, and I've set it up in it's own linux account, with ulimit.
21:03:31dtscodeekarlso, not yet. flaviu has managed it. when i get back to it nimbus will run with docker
21:03:53ekarlsohmm, does docker have cbindings ?
21:03:59*askatasuna quit (Ping timeout: 245 seconds)
21:04:00dtscodewhat other platform would nimbus run on?
21:04:05dtscodecbindings?
21:04:16flaviuI've set filesystem permissions so that it can't access anything sensitive, and ulimit manages memory usage and CPU time.
21:05:34*rpag quit (Quit: Leaving)
21:09:13ekarlsodtscode: yeah if docker has bindings for C
21:09:15ekarlso..
21:09:21ekarlsoso you could call docker from nim
21:09:58dtscodeno. thats not what docker really is
21:10:06dtscodeits a program not a library
21:11:53gokrflaviu: Yeah, I will add lapp to nimble. I also use it in blimp, which I also should add to nimble I guess.
21:12:40dtscodewhat is lapp?
21:12:59*dtscode is guessing it has something to do with smalltalk
21:13:25gokrhttps://gitlab.3dicc.com/gokr/lapp
21:13:49gokrAnd no, its a Nim library. I just revived it, was written by Steve Donovan (Lua fame) - he ported it from Lua.
21:14:10dtscodeooo this looks nice
21:14:17gokrThe idea is to let the help text for a command line utility double as the parser grammar.
21:14:31gokrI tweaked it a bit also.
21:14:37gokrI use it in blimp
21:14:43*sampwing joined #nim
21:14:51gokrhttps://gitlab.3dicc.com/gokr/blimp
21:14:51dtscodewhy is it called LAPP?
21:14:56gokrDunno :)
21:15:16gokrI checked with Steve and he was fine with me taking over that code.
21:15:41dom96gokr: add it to nimble :)
21:15:58gokrIt can be improved - but its already quite nice.
21:16:13gokrAnd blimp is a utility I wrote in Nim to handle big files in git.
21:16:32gokrIts very similar to git-fat.
21:17:13*irrequietus joined #nim
21:17:14gokrWe use blimp for some of our own git repos and it works great.
21:17:44gokrdom96: Yeah, I will.
21:18:30dom96gokr: I can do it for you if you'd like :)
21:18:41gokrdom96: Yeah, sure
21:18:43ekarlsowould be easier with pkgs :P
21:18:49Varriount|BusyHm.. What is that hack that you can use to change the discriminant of an object variant?
21:18:50ekarlsonimble register foo
21:19:01Araqdom96: can you also add the compiler's source code as a nimble package for me?
21:19:38AraqVarriount|Busy: assign it the new value
21:19:45dom96Araq: perhaps
21:19:54dom96Araq: I'm assuming this is for c2nim?
21:19:54Araqbut if debug mode complains then you really MUST not do it
21:20:01Araqyup
21:20:02gokrdom96: I actually made nimble files for both those utilities.
21:20:08Varriount|BusyAraq: Why not?
21:20:29dom96gokr: Want me to add blimp too?
21:20:38gokrYeah, go ahead
21:20:49AraqVarriount|Busy: because you change how the GC sees the data structure, you will get nice memory corruptions
21:21:28Varriount|BusyAraq: Oh... yay
21:22:34*shodan45 joined #nim
21:23:04Varriount|BusyAraq: What if the object variant is, at bottom, just a struct with an int8 and an int64 member?
21:23:09Varriount|BusyAraq: https://gist.github.com/Varriount/ea6fec5a0558e81b433f
21:25:05AraqVarriount|Busy: you can modify the discriminant with pointer hacking. that said you data structure is completely pointless as it's always 16 bytes.
21:25:16Araq*your
21:25:30Varriount|BusyAraq: Yes, I know that. But not in when encoded.
21:25:57Araqthen you can always decode it to int64
21:26:13Araqand save 8 bytes per entry
21:28:06sillestaStringStream from the 'streams' module is deprecated. is there any other way to get a empty string with defined size?
21:28:36Araqit's not deprecated
21:28:47sillestamaybe i misread..
21:29:06dom96Araq: I will make a package called "compiler", that means c2nim will need to import compiler/ast instead of just ast for the compiler modules.
21:29:07dom96Sound good?
21:29:26Araqyup
21:29:29ldleworkcool
21:30:52def-sillesta: newString(size)?
21:30:59Araqsillesta: however there is also system.newStringOfCap() and system.newString()
21:31:16sillestagotcha
21:31:39Araqdom96: beware that the compiler also depends on doc/*.txt though
21:32:03dom96Araq: why?
21:32:06Araqsince we read the command line argument descriptions at compile time
21:32:45dom96That complicates things.
21:33:21dom96What directory prefix does it to try to read those files from?
21:34:00Araqdoc/
21:34:41Araqdom96: well we can move the 2 files to compiler/doc
21:34:49Araqand adapt the docgen instead
21:35:11dom96Where will the compiler look for those files?
21:35:18dom96$moduleDir/../doc?
21:35:49dom96if that's the case then it will work
21:36:40Araqnah it's --path:"$projectPath/.."
21:37:13Araqand then I do slurp("doc/basicopt.txt") and slurp("doc/advopt.txt") iirc
21:37:24ekarlsowhy is there both map and mapIt ?
21:37:33def-ekarlso: mapIt is more convenient to use
21:37:44def-but map can be used with regular procs
21:37:45dom96Araq: That's unfortunate.
21:38:30flaviuekarlso: map(proc (val: T): R = ...) is a huge pita
21:38:47Araqdom96: actually it's not. this means we can move these 2 files to compiler/doc and 'koch boot' should continue to work
21:38:48ekarlso.mao(|s| {})
21:38:50ekarlsowould be awesome
21:39:42dom96Araq: alright
21:40:27def-ekarlso: you have seen the future module?
21:40:56def-.map((s) => ...) should work
21:41:22onionhammer(sometimes)
21:41:29def-yes
21:41:32flaviudef-: I honestly spend more time wrestling with bugs in that module than just writing out the proc...
21:42:08AraqI'm not aware of any unfixed (!) bugs for =>
21:42:16ekarlsoone thing that would be even more cool .map((s) => (var i = foo; foo...))
21:42:41onionhammer.map((s:type) => ...)
21:43:00onionhammervs .map((s) => ...)
21:43:03*jokra joined #nim
21:43:25Araqonionhammer: we have better type inference now. :type is not necessary
21:43:34onionhammersince today?
21:43:38onionhammerbecause its still happening for me
21:43:49Araqsince months
21:44:06onionhammerwelp, then i guess i should submit a but
21:44:08onionhammerbug*
21:44:17dtscodeplease dont submit a butt
21:44:29onionhammertest2.nim(14, 4) Error: type mismatch: got (seq[int], proc (GenericParam): auto)
21:44:32onionhammerbut expected one of:
21:44:34onionhammersystem.map(data: var openarray[T], op: proc (var T){.closure.})
21:44:36onionhammersystem.map(data: openarray[T], op: proc (T): S{.closure.}): seq[S]
21:44:47ekarlso+1 to onionhammer
21:45:05flaviuhttps://gist.github.com/029cc41dc59c6f0758ba
21:45:39onionhammeryeah, I get that error with flaviu's code snippet
21:45:49*sillesta quit (Read error: Connection reset by peer)
21:49:48*sillesta joined #nim
21:50:20*nimnoob joined #nim
21:51:09Araqhrm strange. maybe I misremember
21:51:30AraqI saw code in the compiler to infer these things
21:51:48onionhammerit works sometimes
21:51:50onionhammer.filter(x => x mod 2 == 1)
21:51:54onionhammerbut not map()
21:52:00*superfunc joined #nim
21:55:27Araqaha, it's because 'map' itself is generic
21:55:37Araqfor a concrete mymap it works ... yay
21:56:23*rpag joined #nim
21:56:31gmpreussneri have a C function that takes a pointer to an array of Foo: void Foobar(Foo*** foo); what would be the best way to map this to nim? pointer to an unchecked array?
21:56:56gmpreussneror do unchecked arrays have some special format, i.e. a count in front?
21:57:21Araqthey do not, but they are not pointers either
21:57:53gmpreussneris there a way to express this?
21:57:56Araqis that 3 or 2 stars?
21:58:00gmpreussnerthree
21:58:08gmpreussnerit's an array out parameter
21:58:29Araq2 dimensional array then?
21:58:37gmpreussnernope
21:58:48gmpreussneri know, it's gross
21:59:15gmpreussnerhttp://libusb.sourceforge.net/api-1.0/group__dev.html#gac0fe4b65914c5ed036e6cbec61cb0b97
22:00:14Araqah so it's a pointer to an array of pointers to Foo
22:00:31gmpreussneryep
22:00:43gmpreussnerarray of Foo*
22:00:59gmpreussneri forgot the star above
22:01:40gmpreussnerwell, let me ask you this first: how would i model an array of Foo*?
22:01:51gmpreussneri think the next step would then just be a ptr to that
22:02:45gmpreussnerit would be nice if it mapped to some array type in Nim. but if that's not possible, that's ok, too. then i just need to know how to access the values.
22:03:24dom96Araq: nimble install c2nim@#head, try it.
22:03:44Araqptr UncheckedArray[ptr Foo] perhaps
22:04:21BlaXpiritdom96, c2nim installed successfully
22:04:24BlaXpiritand works
22:04:31Araqwhere type UncheckedArray {.unchecked.} [T] = array [10_000, T]
22:04:43dom96BlaXpirit: :)
22:04:47BlaXpiritthx
22:05:08sillestaokay, maybe i'm missing something, but isn't this supposed to print something out? https://gist.github.com/sillesta/af314983eab9865af89d
22:05:19sillestajust getting a newline
22:05:34BlaXpiritsillesta, sey hello to unicode :(
22:05:44BlaXpiritå is 2 bytes
22:05:49BlaXpiritreversing them gives gibberish
22:05:51sillestaremoved them, same thing
22:06:31def-i have a pull request for reversing unicode strings
22:06:31gmpreussnerAraq: ok, i'll try that
22:06:31Araqsillesta: use countdown(size-1, 0)
22:06:35def-it's even performant!
22:06:49*superfunc quit (Ping timeout: 246 seconds)
22:07:15BlaXpiritutf-8 strings?
22:07:25sillestaAraq: nada
22:07:29BlaXpiritbah, I just wish Rune was more ubiquitous
22:07:30def-BlaXpirit: yes
22:08:01*nimnoob quit (Remote host closed the connection)
22:08:06ldleworkutf-8 != unicode
22:08:42gokrsillesta: In this article I also play with reversed, and also notice the unicode issue: http://goran.krampe.se/2014/10/29/nim-and-oo/
22:08:49def-https://github.com/Araq/Nim/pull/1842/files
22:09:02Araqgmpreussner: though it's possible that there is a codegen bug lurking here as 'ptr array' is mapped to a single star iirc
22:09:08*yonson quit (Ping timeout: 245 seconds)
22:09:33Araqgmpreussner: maybe you need to use 'ptr ptr ptr Foo' then ...
22:10:15BlaXpiritsillesta, there are mistakes in indices
22:10:25Araqor ptr ptr UncheckedArray[ptr Foo] ...
22:10:54BlaXpiritsillesta, this works :| https://bpaste.net/show/e273ff5ddffa
22:11:15gmpreussnerAraq: ok, so 'ptr UncheckedArray[ptr Foo]' maps to 'Foo**' ?
22:11:16ldleworkAraq: lol
22:11:26sillestaBlaXpirit: works for me too
22:11:41sillestasuspecting i may have copied the null terminator to the start maybe ;)?
22:11:43*Varriount|Busy quit (Ping timeout: 246 seconds)
22:11:53BlaXpiritsillesta, that is actually most likely the case
22:11:58BlaXpiritI haven't considered this
22:13:33*Demon_Fox quit (Quit: Leaving)
22:15:51sillestagokr: interesting article, is there a way to treat utf8 characters as a single entity?
22:16:09BlaXpiritunicode module; Rune
22:16:33gokrWell, def- just pointed out his pull request that handles it.
22:16:57gokrsillesta: I do have more articles btw: http://goran.krampe.se/category/nim
22:16:57AraqRune is just as wrong as char iirc
22:17:02BlaXpiritthat's not wise to implement all character-based algorithms on bytes
22:17:18sillestahehe, i'm not used to seeing "live" changes to languages
22:17:26BlaXpiritAraq, how is it wrong? what then?
22:19:13ekarlsosillesta: try Rust on for size :p
22:19:32Araqsomething like é can be 2 utf-32 characters
22:19:36sillestai did, wasn't my style
22:19:42ekarlsosillesta: +1
22:19:44Araqand when you reverse it you get ´e
22:19:49sillestacouldn't get past lifetimes
22:20:18def-Araq: that should be fixed in my reverse
22:20:31def-ah, if you reverse runes
22:20:39Araqyep.
22:20:45def-yeah, has to be "blocks of runes"
22:20:54def-because each character can have a number of combining characters
22:21:11def-not like any software handles this correctly
22:21:16BlaXpiritas if that wasn't difficult enough, you attempt it on utf-8 :p
22:21:30def-BlaXpirit: first i did it with runes, but it was terribly slow
22:21:47AraqBlaXpirit: with utf-8 it's at least obviously wrong when you test it with ü
22:22:15flaviuIt's easiest to never reverse any strings.
22:22:39def-flaviu: but you see that 2 people just tried it and ran into problems
22:22:43*nimnoob joined #nim
22:22:45BlaXpiritlet's just console outselves with the fact that in real world you never need to reverse strings (and that's when I remembered right-to-left script)
22:23:17ekarlsowhat does the "distinct" mean ?
22:23:36def-ekarlso: http://nim-lang.org/manual.html#distinct-type
22:23:56AraqBlaXpirit: how about you blame me instead for not copying Java/C# blindly? or maybe another ramble of how the stdlib is useless
22:24:35Araq*rant
22:25:06BlaXpiritAraq, Java/C# is irrelevant here because they use unicode strings
22:25:26renesacdef-: by the way, shouldn't you use 'distinct tuple' for your rational numbers library?
22:25:29Araqthey use utf16...
22:25:36gokrIn Pharo there is actually quite advanced support for multibyte strings - and it turns out, Unicode is not the whole answer.
22:25:40renesacnow that tuples are more compabile with each other
22:26:36def-renesac: i don't know
22:26:38BlaXpiritAraq, well congrats, the situation is already better than C# and Java. nothing to rant about in such case
22:28:02BlaXpiriti don't pick these languages as examples anyway o.o
22:28:20flaviuAraq: There's no reason to flame, it won't take the discussion anywhere useful.
22:28:22renesacI think yes, as your type isn't any 2 integer tuple
22:29:32renesacand I think the shuffle and other random things would be better in a dedicated random library
22:29:50renesacof course, right now it don't exists
22:29:54BlaXpiritrenesac, what shuffle are you talking about?
22:29:57BlaXpiritrenesac, it exists
22:30:04BlaXpiritjust that nobody knows about it and nobody cares
22:30:11renesachttps://github.com/Araq/Nim/pull/1840/files
22:30:19renesacBlaXpirit: that one you did based on python?
22:30:26BlaXpirityes
22:30:38BlaXpiritwhat is that shuffle doing there? :D
22:30:53BlaXpiritnim's random() is not even usable
22:31:12renesacok
22:31:18renesacfound my integer log function
22:31:22def-BlaXpirit: why not?
22:31:39Araqsillesta: btw you need to iterate up to 'len div 2'
22:31:45BlaXpirithttps://github.com/Araq/Nim/issues/1506 "Problems with random number generation"
22:31:49renesacBlaXpirit: what behaviour you want when the operand is zero?
22:32:01renesacfor the log base 2 function
22:32:30fowlmouthBlaXpirit, dont get discouraged if nobody uses your libraries, instead write things that you use
22:32:58BlaXpiritfowlmouth, yeah, just gonna finish up 3rd and final library nobody's gonna use :D
22:33:00fowlmouthif someone else finds it useful thats just a bonus
22:35:14BlaXpiritthe gist of "Problems with random number generation" is random() will give a random number between 0 and 32767 even if you ask it for a random number between 0 and a billion
22:35:14renesacBlaXpirit: can't you make a random function that accepts a typedesc as parameter?
22:35:30EXetoCwhat libs again?
22:35:33BlaXpiritrenesac, that's... not good
22:35:39renesacinstead of many different functions
22:35:40renesacwhy?
22:35:46EXetoCjust advertise, add readme's and so on
22:35:47BlaXpiritifyou mean what i think you mean
22:36:10EXetoC3. ?????? 4. PROFIT
22:36:21*flaviu quit (Remote host closed the connection)
22:39:08AraqBlaXpirit: we mostly just wrapped ansi C here, so you're complaining about libc's implementation as far as I'm concerned
22:39:21BlaXpiritno, Araq
22:39:34BlaXpiritlibc's implementation just gives you a random number between 0 and RAND_MAX
22:39:39BlaXpiritno strings attached, no hard feelings
22:40:07BlaXpiritNim's functions based on it, however, are inherently bugged
22:42:56*flaviu joined #nim
22:43:02def-BlaXpirit: they can be fixed though?
22:43:12def-BlaXpirit: worst case, by getting multiple random numbers?
22:43:13BlaXpirithttps://github.com/Araq/Nim/blob/3119fe087d28344a34f296f1548cd8d852aea2f8/lib/pure/math.nim#L221 for reference
22:43:18BlaXpiritworkarounds are possible, yes
22:43:27dom96BlaXpirit: please fix it
22:43:28ekarlsowould anyone wanna add base64url support for base64 ?
22:43:46renesacdef-: you are better off implementing a better random number generator yourself
22:43:47BlaXpiritdom96, cryptographers will cringe
22:43:56BlaXpiritbut sure, i can try
22:44:17dom96cryptographers should create specialised libraries
22:44:58dom96The current random's use case is basic things like card games.
22:45:04dom96It works ok for that I think.
22:45:10renesacdom96: right now, no
22:45:19def-shuffle is good for card games too :P
22:45:19BlaXpirityou can't have seeded games, for instance
22:45:21renesacor badly
22:45:53dom96Is there some other problem apart from it only generating random numbers between 0 and MAX_RAND?
22:45:55*Demos quit (Quit: Leaving)
22:46:07BlaXpirityes
22:46:11BlaXpirithorrible inconsistency
22:46:34dom96inconsistency with what?
22:46:44BlaXpiritacross systems and compilers
22:46:59BlaXpiritinconsistency with itself
22:47:00dom96ahh, MAX_RAND is always different.
22:47:11dom96Change it so that it doesn't use libc then.
22:47:16BlaXpiritnot only it, the algorithm itself can be different and whatnot
22:47:23BlaXpiritdom96, well, that requires a dedicated library!
22:47:36BlaXpiritwhich i have made a long time ago
22:47:41dom96Add it to the stdlib then.
22:47:44dom96Call it random.
22:47:48renesacdom96: not so fast
22:47:51BlaXpiriti suggested that in september
22:48:01BlaXpiritbut first people must review it and improve it
22:48:04Araqdom96: not so fast
22:48:20dom96That is what PRs are for.
22:48:26BlaXpiritit is not ready
22:48:32BlaXpiritit was the first thing i wrote in nim basically
22:48:36EXetoCnot so fast
22:48:38ekarlsoflaviu: u ot a clue on decoding hs256 ?
22:48:39dom96then what are we arguing about?
22:48:54dom96EXetoC: not so slow
22:49:12BlaXpiriti'm arguing about lack of action on the problems with math.random
22:49:26BlaXpiriti should indeed at least fix the glaring bug
22:49:30renesacI'm trying to write the integer log 2 function for BlaXpirit replace the float one in his library
22:49:51Araqtbh I don't really agree it's a bug. but that's just me. nobody should use this for anything serious anyway. and the fact that it says 'int' is rather meaningless
22:49:54*saml quit (Quit: Leaving)
22:49:57flaviuekarlso: I'm not sure what you're asking.
22:50:06BlaXpiritAraq, please don't be like this
22:50:14Araqit's obviously underspecified, or is -4 a valid value for it?
22:50:40BlaXpiritreturns a value in range "a .. b-1"
22:50:56BlaXpiritokay, maybe it does, but some values are impossible to obtain
22:51:09gokrFor random I think this is brilliant: http://xkcd.com/221/
22:51:21ekarlsoflaviu: so you're supposed to encrypt a string with hs256 but also supposed to decrypt / decode it ye ?
22:51:46*tinAndi joined #nim
22:51:56flaviuekarlso: let me bring this into PM, it's not directly about nim
22:52:08ekarlsook
22:52:09BlaXpiritbut can we at least agree that shuffle() shouldn't be added to math, and that it shouldn't be based on random()?
22:52:46renesachttps://github.com/Araq/Nim/issues/936 <-- Araq: have you read my last answer to this topic?
22:52:49Araqyes, we can agree on that
22:53:04renesacdo you think what I propose to do with int literal is possible?
22:53:35dom96BlaXpirit: You're upset that Araq is not making random his priority when he has lots of other things to do?
22:54:08gokrgnite folks
22:54:11EXetoC"one year ought to be enough for the design and implementation of a programming language" - Bill Gates
22:54:30dom96We don't have a big company backing us. In the open source world if you want to get something fixed then in most cases you need to do it yourself.
22:54:51ldleworkI think we should all take BlaXpirit not so seriously
22:54:57ldleworkerr that came out wrong
22:55:07ldleworkI mean his immediacy and hand-waving
22:55:22ldleworkhe just cares. I think he knows Araq is busy.
22:55:41BlaXpiritsomething like that...
22:55:46Araqrenesac: cannot see where this solution differs from what we do
22:56:04EXetoCjust need to express it more calmly
22:56:12BlaXpiriti always start calm
22:56:15Araq5 already has the type 'int literal(5)' and is compatible with uint8, 300 is not
22:56:16ldleworklol
22:56:22gokrBlaXpirit: You wrote a different PRNG in Nim or did I misunderstand?
22:56:30renesacAraq: humm
22:56:41renesacI will try to run skyfex fork then
22:56:44BlaXpiritit's just that people always try to argue with my obviously correct statements :p
22:56:49renesacand add those proc overloads
22:57:10renesacbut I will be away for a week first
22:57:14BlaXpiritgokr, i made a library that utilizes the same Mersenne Twister that Python uses
22:58:07gokrBlaXpirit: Neat. I also saw a huge number of other langs relying on the twister. Which apparently is good for simulation, albeit worthless for crypto I think I read.
22:58:07ldleworkBlaXpirit: nice
22:58:10BlaXpiritand it should support different implementations of PRNG but i can't be sure the API is good enough for that
22:58:23AraqBlaXpirit: I'd fix it by s/int/range[0..10_000]
22:58:27gokrJulia uses it for one newish language.
22:58:50flaviuI'd like to post www.pcg-random.org
22:58:56flaviuThat website is excellent.
22:58:56BlaXpiritAraq, if you want to make assumptions about RAND_MAX, yeah, that's not so bad
22:58:57gokrBlaXpirit: Guess this is it: http://forum.nim-lang.org/t/533
22:59:16renesacflaviu: I wanted to make a random library based on that xorshift*
22:59:18BlaXpirityes. i mention it in https://github.com/Araq/Nim/issues/1506 too
22:59:25dtscodefowlmouth, wheres your ircd again?
22:59:31renesacbut I had other priorities
22:59:35flaviurenesac: I'm excited about PCG these days!
22:59:35BlaXpiritrenesac, there is no problem with having both
22:59:52EXetoCuse several popular engines and pick a default
22:59:54flaviuMersenne Twister actually fails a few statistical tests.
23:00:18fowlmouthdtscode, https://github.com/fowlmouth/nimlibs/tree/master/fowltek/musings
23:00:27flaviuLCG 96/32 is higher quality, smaller, and faster, but I can't find the multiplier anywhere.
23:00:39renesacBlaXpirit: yeah, the ideal is a library where you can use a uniform interface for different types of random number generators
23:00:42renesacthat is what you tried to do
23:00:49BlaXpirityes
23:01:11Araq"Which apparently is good for simulation, albeit worthless for crypto" gokr +10
23:01:13renesacI'm just not sure if it is the best interface (only looked quickly)
23:01:14BlaXpiritthe library did kinda get abandoned (due to lack of attention and time)
23:01:14dtscodety
23:01:34renesacBlaXpirit: some things you copied too much from python
23:01:51renesacby default, the random function spits a float
23:01:56renesacnot an int that would be expected
23:02:03ldleworkwhy would an int be expected?
23:02:04BlaXpiritAraq, my library exposes operating system's random byte source
23:02:18EXetoChave an engine interface
23:02:18renesacthat kinda makes sense in python, because python don't have fixed lenght integers
23:02:20BlaXpiritwhich is "worthy" for crypto
23:02:24EXetoCbut you probably know more than me
23:02:41Araqso then the stdlib is good for simulation but perhaps bad for crypto ... and this is exactly why a stldib's random is a toy IMHO
23:02:42ldleworkrenesac: Python is by far the only language that defaults to floats for random functions...
23:02:43gokrflaviu: Squeak has (since the dawn of time) an LCG variant (http://en.wikipedia.org/wiki/Lehmer_random_number_generator)
23:03:01BlaXpiritAraq, it can be a toy but without bugs at least
23:03:39AraqBlaXpirit: ok, but more elaborate stuff HAS to be a nimble package
23:03:49BlaXpiritprobably
23:03:54Araqotherwise nobody trusts it anyway
23:04:01Araqwell shouldn't trust it.
23:04:05gokrflaviu: Nice site you found.
23:04:32flaviugokr: Thanks, that's interesting! re. the site, the paper is also excellent reading. I found it very accessible.
23:05:26flaviuThe idea that it's possible to just change c to some arbitrary number to obtain a new sequence sounds useful.
23:07:02def-t
23:07:11def-(oops)
23:07:17BlaXpiritI sure would like to keep up the topic of RNG, but it's sleepy time
23:09:23fowlmouthdef-, can you pull that big sdl2 PR
23:09:29renesacldlework: do you mean "not the only"?
23:09:54fowlmouthmerge*
23:11:46def-fowlmouth: huh?
23:11:48*brson quit (Quit: leaving)
23:12:38fowlmouthdef-, https://github.com/nim-lang/sdl2/pull/17
23:13:15def-fowlmouth: into my own fork or what?
23:13:45sillestaare TType and PType legacy code?
23:14:00sillesta(the naming)
23:14:02Araqsillesta: yes.
23:14:47fowlmouthdef-, i'll make you a contributor 1 sec
23:14:59AraqI don't think I'll ever update the compiler itself to get rid of T/P though
23:16:34dtscodeircd.nim(378, 8) Error: invalid indentation
23:16:42sillestano magical regex to save the day ;)?
23:16:43dtscodedo you know why it would be saying that?
23:16:50dtscodesince it looks proper to me
23:17:36dtscodeoh wait never mind
23:17:40BlaXpiritdtscode, it's often unmatched brackets on prev lines
23:18:00dtscodeBlaXpirit, in this case it was an empty of
23:18:10fowlmouthdtscode, that section needs a discard
23:18:22dtscodeyeah. just realized :/ silly me
23:20:18*BlaXpirit quit (Quit: Quit Konversation)
23:22:02*JinShil joined #nim
23:23:45dtscodeircd.nim(423, 34) Error: type mismatch: got (proc (AsyncSocket){.closure.}) but expected 'proc (AsyncSocket){.closure, gcsafe.}' # does this mean that i just need to find the function and add the gcsafe pragma to it?
23:24:24Mat4ciao
23:24:28*Mat4 left #nim (#nim)
23:24:33*sillesta quit (Ping timeout: 276 seconds)
23:24:48*nimnoob quit (Ping timeout: 265 seconds)
23:27:43*sillesta joined #nim
23:28:28dtscodefowlmouth,
23:29:36*zahary_ quit (Ping timeout: 246 seconds)
23:29:41fowlmouthyea that probably work
23:30:47def-fowlmouth: should be fine, i hope
23:30:58dtscodehmmm for whatever reason there isnt anything like that on that line
23:31:03dtscodeno functions or anything
23:31:26*akiradeveloper joined #nim
23:32:26def-fowlmouth: my examples still don't compile though, can I pull in my pull request as well?
23:33:11flaviu`"abc".match(re"abc", endpos = 0)`, "Error: invalid expression: 'endpos = 0'"
23:33:11fowlmouthsure
23:33:28flaviuI'm I don't understand why that's an error.
23:33:42flaviuendpos is the correct name.
23:34:52fowlmouthdef-, btw that importc wasnt missing, there was a {.push importc: "SDL_$1".} before it (those can go away now since the function names are lowercase)
23:40:52rpagfowlmouth, ive never seen you be so serious
23:41:08*tinAndi quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0/20150108202552])
23:42:14Araqflaviu: report it
23:44:15def-fowlmouth: hm, the big PR broke the gfx.nim
23:46:11fowlmouthdef-, did he not update that file?
23:47:01*brson joined #nim
23:47:20def-fowlmouth: or it was broken even before, huh
23:47:46fowlmouthrpag, stop spying on me >_>
23:48:45rpagfowlmouth, i'm not, i check this channel from time to time and you happened to be speaking.
23:51:14flaviulooks like a unittest bug.
23:51:24def-fowlmouth: he renamed aapolygonColor to aaPolygonColor for example, now the importc fails. I'm fixing the importc instead of renaming back, ok?
23:52:31dtscodecan someone tell me what is going on here?
23:52:50dtscodeoops
23:52:51dtscodehttps://bpaste.net/show/543a78511efc
23:53:19fowlmouthdef-, thats fine thank you, feel free to make any fixes you like
23:55:23fowlmouthdtscode, add gcsafe to that function? cant tellwhich it is