<< 26-07-2013 >>

00:00:17BitPuffinEXetoC: huh?
00:00:29*mario-goulart left #nimrod ("ERC Version 5.3 (IRC client for Emacs)")
00:01:10EXetoCI think you did "type x = y", which is an alias
00:01:28BitPuffinhm
00:01:29BitPuffinwell
00:01:35BitPuffinthat's creating a type
00:01:43BitPuffinI'm trying to alias a proc
00:02:05BitPuffinalias '*.` = dot
00:02:06BitPuffinetc
00:06:31EXetoCI guess not
00:08:22BitPuffinhrm
00:10:17EXetoClike I said, you can use templates etc, but then you might as well just write a wrapper function
00:11:19BitPuffinEXetoC: pretty much what I'm doing
00:11:30BitPuffinreally strange that you can't just create a symbol alia
00:11:31BitPuffins
00:11:38BitPuffingotta talk to Araq about that :P
00:13:52BitPuffinEXetoC: is `*x` a valid operator name, or does it has to be special characters
00:16:08BitPuffinhas to be special oki
00:16:09EXetoCI think you need to include ` at the call site then
00:19:03EXetoCso it's not very useful in that case
00:19:07*EXetoC quit (Quit: WeeChat 0.4.1)
00:34:50BitPuffinI THINK, vectors are feature complete now
00:42:45*BitPuffin quit (Ping timeout: 264 seconds)
01:03:45*Trix[a]r_za joined #nimrod
01:19:30*DAddYE quit (Remote host closed the connection)
01:20:06*DAddYE joined #nimrod
01:24:21*DAddYE quit (Ping timeout: 248 seconds)
01:39:01*q66 quit (Quit: Leaving)
02:01:36*mario-goulart joined #nimrod
02:12:38*Associat0r joined #nimrod
02:21:15*DAddYE joined #nimrod
02:27:58*DAddYE quit (Ping timeout: 276 seconds)
03:24:18*DAddYE joined #nimrod
03:31:18*DAddYE quit (Ping timeout: 264 seconds)
04:13:21*OrionPK quit (Quit: Leaving)
04:27:36*DAddYE joined #nimrod
04:34:35*DAddYE quit (Ping timeout: 260 seconds)
05:26:25*DAddYE joined #nimrod
07:05:04*Endy joined #nimrod
08:16:11*DAddYE quit (Remote host closed the connection)
08:16:20*DAddYE joined #nimrod
08:16:26*DAddYE quit (Remote host closed the connection)
08:16:57*DAddYE joined #nimrod
08:21:23*DAddYE quit (Ping timeout: 260 seconds)
08:26:23*erlnoob joined #nimrod
09:17:38*DAddYE joined #nimrod
09:24:36*DAddYE quit (Ping timeout: 256 seconds)
09:46:57*BitPuffin joined #nimrod
09:48:06BitPuffinoihoi!
09:48:11BitPuffinsup errbody?
09:52:09BitPuffinAraq: is there a pretty way to create an alias?
09:59:50AraqBitPuffin: only via a template
10:00:13*Araq is no fan of aliases
10:00:47BitPuffinAraq: ah I see, well that's a shame
10:01:11BitPuffinAraq: it would be nice to just be able to do something like `alias bar = foo`
10:07:26BitPuffinAraq: when doing it with a template, do I still need to have type parameters?
10:08:02AraqI think so unless it's an immediate template
10:08:17BitPuffinokay
10:08:34BitPuffinwell, I think I basically only need to change the keywords from proc to template then
10:08:47BitPuffinunless the args has to be of type expr
10:13:18BitPuffinAraq: do you think it would be necessary to put parenthesis around stuff like: a + (-b) in a template?
10:13:33Araqlol no
10:13:43Araqtemplates are not C's shitty #defines
10:13:54BitPuffinAraq: thank jesus
10:17:01*EXetoC joined #nimrod
10:17:58NimBotAraq/Nimrod master ce71477 Araq [+0 ±2 -0]: new vm: can execute simple programs
10:18:06Araqbye
10:20:14BitPuffinsee you!
10:20:24BitPuffino/ EXetoC
10:21:00*DAddYE joined #nimrod
10:27:07*DAddYE quit (Ping timeout: 246 seconds)
10:29:56EXetoClo
10:30:30BitPuffinEXetoC: can you think of any operation that I haven't added to the vectors yet?
10:30:56BitPuffinhttps://github.com/BitPuffin/linagl/blob/master/src/linagl/vector.nim
10:33:31BitPuffinhmm
10:33:40BitPuffinI guess - could be made more efficient
10:34:00BitPuffinit currently goes through the vector twice :/
10:34:17*q66 joined #nimrod
10:35:24BitPuffinalthough I'm just assuming
10:35:45EXetoCtwice?
10:35:55EXetoCthose are the essentials I guess, but I'm no expert
10:36:19EXetoCI usually look at OGRE's implementation, which has some other stuff as well
10:36:43*[1]Endy joined #nimrod
10:36:45BitPuffinEXetoC: well I made it so that - is a + (-b)
10:37:02BitPuffinEXetoC: + goes through the vector once, and -b goes through the vector once too, to negate it
10:37:54EXetoCright
10:38:35BitPuffinso I changed that now
10:38:40BitPuffinhrm
10:38:56BitPuffindoes one really need all the squaredMagnitude and all that jazz
10:40:37*Endy quit (Ping timeout: 248 seconds)
10:40:38*[1]Endy is now known as Endy
10:43:49EXetoCrarely
10:46:02BitPuffinI'll skip that for now
10:46:19BitPuffinnow I wonder how I should do with matrices
10:46:24BitPuffinopengl stores them column major
10:47:11BitPuffinmaybe I should just make it so that it's stored that way
10:53:16BitPuffinhttp://pastebin.com/GQ0hTzcs
10:53:36BitPuffinHowever it would be nice if one could write literals the way they actually are
10:53:56BitPuffinmaybe I can override the = operator for literals somehow?
10:54:12BitPuffinand transpose the matrix they enter
10:57:23*erlnoob left #nimrod (#nimrod)
11:07:14EXetoCI don't think you can
11:09:16BitPuffinnope
11:09:17BitPuffinhmm
11:09:23BitPuffinI wonder how I'm gonna do then
11:09:29BitPuffinmaybe implement a constructor for it
11:10:15EXetoCyeah
11:19:12BitPuffinwhat's the most efficient way to build a string?
11:31:51BitPuffinlike if you are going to do a lot of concatenation
11:43:34BitPuffinchar sequence?
11:46:29*gradha joined #nimrod
11:47:08gradhaBitPuffin: strings are mutable in nimrod, use 'var s = "foo"; s &= "bar"'
11:48:56EXetoCand they are basically just seq[char] internally, right?
11:49:49BitPuffinokay gradha :), was just worrying if there was potential overhead doing that
11:50:10gradhaEXetoC: no idea, maybe seqs don't guarantee memory continuity
11:52:48gradhaBitPuffin: I guess if you already know all your strings sizes it may be more efficient to preallocate the target's destination size to avoid reallocs, newString can be used for that
11:53:17EXetoCdealing with C libs would be very complicated then
11:54:00gradhaEXetoC: in system there are setLen procs for seqs, so I guess the memory is guaranteed to be continuous, otherwise those wouldn't exist
11:56:01BitPuffingradha: newString(numberOfChars)?
11:56:19gradhayes
11:56:25BitPuffinwill &= still work?
11:56:30EXetoCthe documentation is pretty clear in this case
11:56:39EXetoCyep, string as string
11:57:26EXetoCno wait
11:57:56gradhaBitPuffin: I think you would have garbage then, since &= will likely use the length to append more
11:58:17EXetoC"proc newStringOfCap*(cap: int): string"
11:58:29gradhathat's more like it if you want to use add/&=
11:59:07BitPuffinwell then it's too inconvenient :D
11:59:41BitPuffineasier to just use &=
11:59:42gradhaEXetoC: yeah, you would use the lists module for non linear space
11:59:53BitPuffinthen I don't have to worry about indices
12:00:06gradhaBitPuffin: I would first profile before doing anything at all
12:00:30BitPuffingradha: is there a good profiling tool for nimrod? or do you just mean time ./program
12:01:19gradhaBitPuffin: I think you would use nimprof for profiling, though I haven't needed it so far
12:03:04BitPuffingradha: where can I grab nimprof?
12:03:38BitPuffinoh it's in the stdlib
12:03:55gradhait needs a compiler switch to work
12:06:04BitPuffinI can't seem to find the docs for it
12:09:10AraqBitPuffin: http://nimrod-code.org/estp.html
12:09:33BitPuffinthe exact second I click on that link on the website lol Araq :)
12:10:53BitPuffinisn't it just better to time the execution of something?
12:10:54BitPuffinor well
12:10:55BitPuffinnot better
12:11:13Araqdepends on what you're doing
12:11:15BitPuffinoh we're profiling memory
12:11:24BitPuffinyeah then we can't time it lol :)
12:11:38Araqusually profiling is not "try approach A" vs "try approach B"
12:12:04Araqyou're quite lucky if you're able to do that
12:12:32Araqusually profiling means "what the heck? where is the time spent?"
12:13:16Araqalso ESTP is no memory profiler but it can be used for that too
12:16:58BitPuffinYeah I saw that
12:17:03BitPuffin--profiler:off lol :)
12:17:08BitPuffinwhy is it off?
12:18:45BitPuffinapparently creating a string out of a vector 50 000 times didn't do much
12:20:21BitPuffinAraq: Great that you're here btw, I'm trying to implement swizzling, It is supposed to return a vector that is the same length as the string it takes in, how do I write that in to the signature, because I can't seem to come up with anything that works
12:21:28BitPuffinproc swizzle*[T, I](a: TVector[T, I]; s: string): TVector[T, I] =
12:21:40BitPuffindoesn't really make sense to return a TVector[T, ___I___]
12:23:04EXetoCyou'd need a template
12:23:27EXetoCunless you want it to be dynamic too, in which case you'd have to return a seq or something, obviously
12:24:07BitPuffinEXetoC: a template? and no I shouldn't need to return a seq, the string length should be known at compile time shouldn't it?
12:24:13EXetoCthat would be kinda useless though
12:24:33EXetoCnot if it's a function parameter
12:24:44BitPuffinWell
12:25:12BitPuffinyou kind of call it like swizzle("xyzrgbargbstq")
12:25:26BitPuffinnever really by generating a string and then calling it
12:25:34BitPuffinand I can't return a seq
12:25:38BitPuffinthat would destroy errthing
12:25:40EXetoCyes, but you need a template then
12:26:02BitPuffinhow would I do it with a template?
12:27:39BitPuffinhmm
12:27:46BitPuffinis there a way to make an array from a sequence?
12:28:46EXetoCI don't know. "template x(a: string{lit})..."?
12:31:00*BitPuffin goes to read the template documentation and hopes that Araq will come and enlighten me
12:37:55BitPuffinHow do I check if a string only contains a certain kind of characters?
12:38:13BitPuffinlike string.onlyContains("rgba") or whatever
12:38:31BitPuffindoesn't mean that it contains all of those, just that no other character is in there
12:40:18BitPuffinsounds like a regular expression to me
12:41:18*Associat0r quit (Quit: Associat0r)
12:43:58EXetoCor "not contains", where the second arg is a char set
12:44:36gradhamaybe you could try using some variant of parseutils.skipUntil to see if you find a non matching character
12:44:43gradhafor regular expressions there is the re module
12:45:19gradhaor strutils.allCharsInSet
12:46:23BitPuffinEXetoC: considered that too
12:46:44BitPuffingradha: hmm, I think re sounds like the winner
12:47:01EXetoClet's see if it works at compile-time
12:48:24BitPuffinEXetoC: well, templates pretty much inline them selves don't they?
12:48:47BitPuffinwhatever was in the template body is substituded
12:51:00EXetoCyes but you probably want the 're' stuff to be executed at compile-time. anyway, it seems a little overkill
12:51:40EXetoC"xyzwxywzyxywz".contains({char(0)..char(255} - {'x', 'y', 'z', 'w'})
12:53:34EXetoCHave I missed anything?
12:56:12BitPuffinEXetoC: well strings aren't always known at compile time are they
12:56:30BitPuffinbut hmm
12:56:33BitPuffinmaybe that works
12:57:35BitPuffinEXetoC: but it won't happen at compile time will it?
12:58:42EXetoCso have it take a literal
12:58:46EXetoCit might
12:58:58EXetoCmany operations are supported at compile-time
12:59:15BitPuffininteresting
12:59:23BitPuffinhow do I specify it's a string literal?
13:02:07EXetoCsee the second block of code here http://nimrod-code.org/manual.html#typedesc_toc
13:02:15EXetoCactually, those anchors don't even work for me
13:02:43EXetoCsearch for string{lit}. do a search for enumfield if you want a list of available constraints
13:04:18BitPuffinyeah the anchors suck
13:05:45BitPuffinEXetoC: can you use that with templates too? the example uses macro
13:10:17EXetoCyeah
13:11:26BitPuffinEXetoC: so you think `when not s.contains({char(0)..char(255} - {'x', 'y', 'z', 'w'}): {.fatal.}` will work
13:12:46EXetoCI don't know if these operations don't have any side effects, or at least if the compiler can accurately decide that
13:14:30EXetoCI'll try to figure that out
13:14:57BitPuffindidn't even know you could do that {blabla} - {blabla} stuff, that's very expressive
13:15:51EXetoCyup. set[T], and .. is usually just proc `..` in the system module
13:16:11EXetoC`@` as well (@[1, 2, 3])
13:18:33EXetoCBitPuffin: https://gist.github.com/EXetoC/6088773
13:19:31BitPuffinEXetoC: it actually compiles in when so it seems to work
13:19:46EXetoCalright
13:19:56BitPuffinEXetoC: although I didn't import strutils :s
13:24:33BitPuffinEXetoC: weird, got an invalid characters for swizzling
13:25:04BitPuffinoh
13:25:06BitPuffinit shouldn't be not
13:25:56BitPuffinhmm
13:25:57BitPuffinvector.nim(86, 23) Error: undeclared identifier: 'T'
13:26:38BitPuffinBut T is inferred from the vector passed to swizzle :s
13:29:06EXetoCBitPuffin: I guess the template doesn't have any type parameters then
13:30:05BitPuffinEXetoC: well others had
13:30:08BitPuffinand they worked
13:31:17EXetoCI don't know what you mean, but the template needs type parameters, just as your functions do
13:31:55BitPuffinWell it did have type parameters
13:32:44BitPuffinhttps://gist.github.com/BitPuffin/cbaa99837fa494e07cbc
13:32:48BitPuffinEXetoC: ^
13:33:06BitPuffinand yeah I haven't updated so it also captures uppercase
13:36:06EXetoCoh well. [T](x: T) worked
13:37:06EXetoCdon't you mean 0..s.len - 1?
13:37:12EXetoC(0.. <s.len)
13:37:17BitPuffinyeah
13:37:39BitPuffinEXetoC: so I should remove the I param?
13:43:34EXetoCit wasn't related to that specifically, but that might work, just that it's not constrained
13:43:52BitPuffinah
13:43:56BitPuffinvar a = [1, 3, 37].TVec3i
13:43:56BitPuffinecho($(a.swizzle("")))
13:44:04BitPuffindon't see why it doesn't work
13:44:27BitPuffinEXetoC: well then I get undeclared I
13:44:49EXetoCyou'd have to change the parameter type as well then, to just T
13:45:06EXetoCwhich would be a start, assuming that it works
13:45:29EXetoCwhat part of it doesn't? arrays cannot be converted to string yet. I think it was possible before, but the function was commented out for some silly reason IIRC
13:45:33BitPuffindon't think that would work
13:46:06BitPuffinEXetoC: the part - var result: TVector[T, 0..len(s)-1]
13:46:06EXetoCalso, $ isn't strictly necessary with echo, or any function that does something like args: varargs[T, `$`]
13:46:23BitPuffinI've implemented $ so it works
13:46:35EXetoCoh right. if only you could do something like T.ElemType
13:47:00BitPuffinI also tried removing it and doing type(a) but that obviously didn't work
13:47:13BitPuffinbecause that doesn't return what I want
13:47:36BitPuffincould this be because of a compiler bug? >_>
13:47:44EXetoCvec[0].type?
13:48:30BitPuffinwell
13:48:40BitPuffinthat assumes that the vector isn't 0 dimensional
13:51:19EXetoCsomeone in an alternate universe might need it before that (bug?) is fixed :p
13:51:26EXetoCanyway, it should still work
13:54:30BitPuffinI'll try
13:55:44EXetoCok, arrays can't be zero-sized
13:55:57EXetoCso there you go
13:56:56EXetoClet a=[range[0.. -1] #Error: range is empty
13:58:12BitPuffinEXetoC: yeah I noticed
13:58:30BitPuffinEXetoC: weird though, non of the cases are cought
13:59:26EXetoCand if you print the value?
13:59:47*mario-goulart left #nimrod ("ERC Version 5.3 (IRC client for Emacs)")
14:00:15BitPuffinEXetoC: the value?
14:00:20BitPuffinooh
14:02:04BitPuffinEXetoC: apparently I can't return result that way either
14:02:08BitPuffinit has to be discarded :s
14:03:30BitPuffinI have to go for a while, I'll push in the mean time, if you find a solution, feel free to do a pull request :P
14:04:40BitPuffinhttps://github.com/BitPuffin/linagl
14:04:42BitPuffincheerio
14:05:42AraqBitPuffin: does that template work? :O
14:06:00Araqtemplate swizzle*(a: TVector; s: string{lit}) ?
14:07:55EXetoCI don't think he has actually been able to have it generate a value yet. why, is it experimental?
14:08:20Araqnot really
14:08:52EXetoCmaybe he needs to return expr or something. what's the default, stmt?
14:09:01Araqyeah
14:09:09*BitPuffin quit (Ping timeout: 264 seconds)
14:09:12Araqmake it return 'expr'
14:09:45EXetoCNimBot: hello
14:10:13gradhaNimBot: don't be shy
14:11:45EXetoCAraq: wasn't the whole "proc `$`*[T](a: openArray[T]): string" issue silly? :p
14:12:38EXetoCdo you want separate functions for array and seq?
14:13:29EXetoCnvm, a compile-time branch will do (for adding @)
14:13:41AraqI don't but fowl wants the @ iirc
14:13:49Araqalso again
14:14:05Araqearlier versions conflated "openArray" and "varargs"
14:14:22Araqvarargs means anything gets a buggy $ operator
14:14:29Araqso it was disabled
14:14:40EXetoCoh yeah
14:25:54*DAddYE joined #nimrod
14:32:37*DAddYE quit (Ping timeout: 248 seconds)
14:41:35*zahary_ joined #nimrod
15:21:20*Sergio965 joined #nimrod
15:29:06*DAddYE joined #nimrod
15:35:33*DAddYE quit (Ping timeout: 248 seconds)
16:13:39*Mat2 joined #nimrod
16:13:43Mat2hi @ all
16:17:22Araqhi Mat2
16:17:33Mat2hi Araq
16:18:32Araqinterleaving the instruction stream with proc bodies is evil ...
16:19:00AraqI generate 'jmp XXX; <proc body>; XXX: ... '
16:19:14Araqbut debugging this is pita
16:19:23Araqany good ideas, Mat2?
16:19:27Mat2I have check-up a VM model build from your sources and implemented some optimizations
16:19:59Araqwell since it doesn't work yet how do some optimizations help? :-)
16:20:08Araqbut sure, I'm interested
16:21:32Mat2ehm, the mdoelled vm used your encoding and instruction-set but for speed I've recoded it in forth
16:21:36Mat2^modelled
16:22:17Mat2the results told me that dispatching can be reduced to 10-15 clock cycles per instruction
16:22:44Mat2(dependent of the cpu of course)
16:22:56Mat2that's not bad for a register-based vm
16:23:33Mat2the greatest gain in performance comes with static trace-compilation
16:24:50Mat2this eases also debugging because you only have a list of address pointers which can be traced beside execution (just modifies the next routine)
16:25:40Mat2I hold a precached buffer in memory for 32 decoded instructions
16:26:29Mat2and another for 64 immediate parameters
16:26:46Araqhow can you accurately model software pipelining when you don't know the typical instruction stream?
16:29:16Mat2the buffer is fixed in size and because each instruction compiles into an address and each buffer-element maps directly to an element of the immediate-data cache you can implement software-pipelining just by preloading in the primitive-code
16:30:36Mat2it's only wise to reserve some register (or statc variables) for that
16:30:44Mat2^static
16:31:36Mat2in forth jargon this is called static-replication
16:35:44Mat2http://www.complang.tuwien.ac.at/projects/interpreters.html
16:35:54Mat2^here you find some papers about this stuff
16:39:16Mat2^^ the idea is that if its not possible to meassure instruction streams directly, that's possible for indirect branches and memory references
16:42:12*DAddYE joined #nimrod
16:49:59Mat2Araq: We bring up Nimrod as language with help of my current vm to the duinomite (the original planning was to choose Pascal but Nimrod seem to be easier for beginners)
16:54:53*Associat0r joined #nimrod
16:54:53*Associat0r quit (Changing host)
16:54:53*Associat0r joined #nimrod
16:57:05AraqMat2: awesome
16:57:06*zahary_ left #nimrod (#nimrod)
17:06:22Araqwell Mat2 feel free to optimize the heck out of it once it's stable
17:06:47Mat2I will do :)
17:08:35Araqhow is Nimrod easier than Pascal btw? :-)
17:10:01Mat2I think Pascal features some excentrical syntax shortcomings inherited from Algol
17:11:03Araqit surely confuses verbosity with readability
17:11:19Mat2I know beginners learning it are confused from using semicolons as sequence terminator for example
17:11:58Mat2there arr many details most of us don't think of
17:12:01Mat2^are
17:19:34Mat2on the other side, the language is somewhat restricted compared with Nimrod
17:20:23Mat2no prototype support etc.
17:20:34Mat2it is showing Age
17:55:55*Raynes quit (Excess Flood)
17:56:15*Raynes joined #nimrod
18:00:31dom96hello
18:00:44Mat2hi dom96
18:05:50EXetoCdom96: YOOOOOOOOOOOO
18:06:05dom96HELLOOOOOO Mat2 and EXetoC !!!!!!
18:07:02Mat2hi EXetoC *g*
18:07:58dom96So I am now free until the end of August!
18:18:59EXetoCMat2: ohai
18:19:17EXetoCdom96: good stuff. watcha gonna do? write at least *some* Nimrod code I hope :>
18:21:01dom96oh dude, I will be writing nimrod ALL the time.
18:23:08Mat2a suggestion: write a demo and post it at pouet.net, this should attract more programmers to Nimrod
18:24:08EXetoCdom96: oic :p
18:26:07EXetoCwasn't I supposed to exercise?
18:26:16EXetoCI blame BitPuffin and his stupid code
18:41:40*EXetoC is now known as EXetoC_
18:41:59EXetoC_swizzling is implemented now. compile-time evaluation is pretty solid
18:42:43Araq"pretty solid" -- perhaps
18:42:53Araqbut not good enough
18:43:56dom96Mat2: I actually am a bit interested in the demoscene. Maybe someday... I have too many things planned already.
18:44:38Araqdom96: we need bitbucket support :P
18:44:50dom96I know.
18:45:12dom96(You mean for babel right?)
18:46:53Araqright
18:48:14EXetoC_maybe not, but I haven't been blocked by anything so far. I'll re-evaluate it if I ever use it for rocket science :>
18:48:50AraqI ran a simple SDL demo with -d:useFFI
18:48:54Araqat compile time
18:48:58Araq:D
18:56:35Sergio965Woo!
18:58:00Mat2nice
18:58:49Araqkey presses don't work though as the compiler still computes field offsets wrongly
18:59:21dom96wow, i'm getting a big deja vu
18:59:49dom96I guess this is with your new VM?
19:00:02Araqno ... *cough*
19:00:11Araqbut I said "I ran" :P
19:00:14dom96lol
19:00:29Araqand EXetoC wasn't around back then
19:19:50*BitPuffin joined #nimrod
19:23:52*rubino123 joined #nimrod
19:24:12Araqhi rubino123, how is progress with websockets?
19:26:20rubino123I have not started the nimrod version yet
19:26:37rubino123Got another project that took over my freetime
19:26:52rubino123Its related to my need for the websocket though
19:26:52Araqaww
19:27:05rubino123how tight is the postgres wrapper?
19:27:38AraqI used it in production, kind of
19:27:50rubino123You are the lead dev?
19:27:51Araqswitched to sqlite quite soon afterwards though
19:28:22rubino123Was it a postgres problem with untrusted langauges or something else?
19:28:32Araqyes, I'm the creator
19:28:44rubino123I have high hopes for nimrod
19:29:12Araqno problem with postgres really but too tedious to setup on a server
19:29:12rubino123Its impressive at delivering the performance at a reasonably productive syntax
19:29:22Araqthank you
19:29:32rubino123OK, I have a DBA so i just need to write the integrations
19:29:40gradhanow that ~30 is usual on IRC, what's the next milestone?
19:30:49Araqgradha: ~50 of course and I'll be here more rarely so that my presence is a cool event to celebrate
19:30:57EXetoC_BitPuffin: The string stuff would probably be executed at run-time, unless optimized away, and I've dealt with that
19:31:37*EXetoC_ is now known as EXetoC
19:31:38AraqEXetoC_: use a macro to optimize it away
19:32:17EXetoCI used compileTime
19:34:18rubino123Araq: where can I find the milestones for releases if any?
19:35:47Araqrubino123: $nimrod/todo.txt
19:36:40Araqthese are however my personal notes
19:37:01Araqso most of it is overly terse and not understandable :P
19:40:44rubino123good enough
19:40:45rubino123thanks
19:41:21rubino123Is numerical computing going to be emphasized in the ecosystem? I ask because I saw the libsvm bindings
19:42:43Araqwhy do you think we have this: http://nimrod-code.org/trmacros.html ? ;-)
19:44:46rubino123holy macros batman!
19:47:15*OrionPK joined #nimrod
19:54:52*EXetoC quit (Quit: WeeChat 0.4.1)
19:55:06*EXetoC joined #nimrod
19:56:42gradhaAraq: see http://forum.nimrod-code.org/t/184/1#904 and please tell me I won't have to build manually the question mark list for the sql statement
19:59:20dom96That last example looks like a bug to me.
20:01:16Araqdom96: hu? & for sequences is a feature
20:01:29Araqit works exactly as its signature suggests
20:01:51dom96Shouldn't it output: 1374868327, one, two?
20:02:20EXetoChigh and low seems to work at compile-time, but not len in some cases
20:08:26Araqdom96: good point
20:08:34Araqlooks indeed like a bug
20:09:11Araqlol yeah
20:09:21Araqcopy paste not enough modified
20:10:10reactormonkcopypasta!
20:10:58EXetoCmmh, pasta
20:12:40gradhais it really a bug? I mean, for a & b I would expect b to be concatenated to a, so b would need to transform into a string first
20:13:15gradhaunless the rule is "things get upgraded to the highest level object"
20:13:23gradhawhatever that means
20:13:51*gradha sighs and starts writing his own quote concatenation query formatter
20:14:21Araqproc `&` *[T](x: T, y: seq[T]): seq[T] {.noSideEffect.} =
20:14:23Araq newSeq(result, y.len + 1)
20:14:24Araq result[0] = x
20:14:25Araq for i in 0..y.len-1:
20:14:27Araq result[i+1] = y[i]
20:14:35Araqthat's how it looks like after the fix
20:14:58Araqno idea why you think the old buggy behaviour is valid
20:15:45Araq"Huh, this is something that sort of works automatically for other language/bindings I've tried, help this spoiled brat!"
20:15:49gradhaI expect b to be transformed to the type of a, not the other way round
20:16:10Araq<-- no idea where it works this way
20:16:14gradhapython
20:16:24Araqok fair enough
20:16:32Araqit surely doesn't work this way in C#
20:16:45Araqwell ... you're right it's a problem
20:17:10Araqwe could introduce ?! as a way to insert stuff without quoting
20:17:23Araqor maybe just !
20:17:44reactormonkAraq, that gets hairy
20:18:02dom96Sounds dangerous.
20:18:20dom96I accidentally misplace my params and i'm fucked.
20:18:22Araqwell I'm not happy with the ? syntax, I think it should use $# like format
20:18:45Araqdom96: you accidentally wrote ! instead of ?
20:19:05dom96You never know :P
20:19:12gradhathis "feature" can also work in objc, most sqlite bindings require you anway to wrap simple values into objects so the wrapper can do these magical things
20:19:13EXetoCyou don't like the printf syntax?
20:19:36dom96If I mix ! and ? then it gets messy doesn't it?
20:19:53dom96I have to be sure that I give it the params in the correct order is what I meant.
20:20:37AraqEXetoC: printf makes sense when you have no type safety, otherwise the 1 letter types after the % are stupid
20:20:57gradhait's surprising C# doesn't expand collections for the question mark
20:22:00dom96why is there no printf macro?
20:23:36EXetoCAraq: no need to use all of it, or at least not force that. $# is kinda ugly, but maybe I can get used to it
20:24:30Araq$# is excellent once you understand it IMHO
20:24:44EXetoCwell, the annoying part is having to press two different modifier keys
20:25:01Araqget a german keyboard then
20:25:35Araqdom96: so ... what's your alternative? use !!! instead?
20:26:07dom96Araq: I don't really have an alternative. Just raising my concerns.
20:31:20EXetoCBitPuffin: linaGL? I see what you did there
20:32:33Araqgradha: what do you think of my '!' solution? it's 2 lines of code in db_sqlite.nim ;-)
20:32:53Araqok, ok, 3 lines
20:33:15gradhawouldn't you also need to export dbQuote so I can prepare the params?
20:33:34Araqtrue
20:33:52gradhaI like more the idea of creating n question marks
20:34:01EXetoCanyway, just a single character for the basic case would be nice. plenty of characters are not that commonly used
20:34:23Araqgradha: that requires no changes to db_sqlite then, right?
20:35:16gradhano changes required
20:35:29dom96oooh mercurial has a built-in web server
20:36:25Araqgradha: fine with me but dbQuote should be exported and in fact
20:36:32Araqnow that we have 'export'
20:36:44Araqwe can pull common code into a db_common
20:37:06Araqcurrently there is some duplication in all of these db_* wrappers
20:37:06gradhaI think my memory is wrong, according to http://stackoverflow.com/questions/283645/python-list-in-sql-query-as-parameter this behaviour of list expansion doesn't work in python either
20:37:22gradhaso either I'm confusing the language or I smoke good stuff
20:39:47gradhamaybe python is like 8bit games: you remember it fondly, but your memories don't match reality
20:41:14AraqI surely don't remember matplotlib fondly :P
20:41:38EXetoCdoesn't it? I thought you could expand in all sorts of places
20:42:03gradhaI remember PIL and pyglet with special hate
20:49:38AraqI ended up drawling every single pixel on my own to generate the graphs exactly how I wanted them
20:50:31gradhaso just to make sure: string & seq[string] produces seq[string] instead of string?
20:50:51Araqsure
20:50:57gradhaaha
20:51:04Araqauto join is no concept in the stdlib
20:58:24dom96BitPuffin: Do you know if hg has a git-like --depth param for 'clone'?
21:00:13Mat2gradha: do you know the ABC80 ?
21:02:19gradhanope
21:04:10Mat2gradha: https://sv.wikipedia.org/wiki/ABC_800; It featured a half-compiling basic interpreter named ABC. Then take a look at the predecessor influence for pyhthon: The ABC language!
21:05:39gradhaI remember typing hexadecimal programs into a spectrum without tape, FWIW
21:06:06Mat2nice hobby !
21:06:16gradhaoh, the joy of magazine erratas
21:08:19*gradha goes thirsty into the kitchen to return with salty pistachoes
21:08:23Mat2some years ago, I learned most z80 instructions by coding a game for the zx81 in machine-code
21:25:56*Sergio965 quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:36:34Mat2ciao
21:36:42*Mat2 quit (Quit: Verlassend)
21:39:20gradhashame that the `?` operator requires backticks
21:39:37gradhahave to write varname.`?` instead of varname.?
21:40:15Araqit's hard to support varname.? as .? would be a postfix operator
21:40:30EXetoCgradha: I've never needed them
21:40:59gradhais it possible to have ?varname or varname? without the dot?
21:41:51EXetoCthe former should work
21:41:54Araq?varname is easy
21:42:22Araqtemplate `?`(x: expr): expr = x
21:43:40gradhawonderful
21:44:12Araqin my example code I make ? a nop. I'm sure that's what you want.
21:49:02Araqso dom96 is right: http://memedad.com/meme/19953
21:49:09dom96ahaha
21:49:35Araqbut I'm sure I soon get 'strutils.replace' to work in my VM
21:52:33rubino123Araq: I do not have lua on my system but the lua example runs?!?
21:52:46*Endy quit (Ping timeout: 276 seconds)
21:53:33Araqrubino123: it's magic ;-)
21:54:16Araqif you're on linux chances are high that you have it on your system though
21:54:29Araqnimrod doesn't require devel-packages
21:57:31dom96I am such a noob at mercurial...
21:59:04dom96I have to merge before I push huhhh
21:59:22gradhaso like git?
21:59:28dom96or maybe only when I create a new tag.
21:59:53dom96gradha: huh? In git you just commit and push.
22:00:19gradhayou can't push if the remote is out of sync
22:00:43Araqdom96: what about scriptability for the download?
22:00:44gradhamaybe mercurial push is different from git push?
22:00:57dom96hrm, ok. Perhaps mercurial pull doesn't automatically merge origin with local
22:01:06dom96Araq: hrm?
22:01:18dom96Araq: Have you tested babel yet?
22:02:49Araqno ...
22:02:59Araqsorry
22:03:55Araqdom96: I mean instead of hardcoding git, mercurial and then svn, make it scriptable
22:04:48dom96uhh how would that work?
22:04:55dom96an embedded script in the packages.json?
22:05:08Araqyeah
22:05:14Araqperhaps
22:05:19dom96no. I'm not adding that.
22:05:22Araqor in the .babel file
22:05:48dom96What's wrong with it being hardcoded?
22:05:59AraqdownloadCmd: "mercurial pullit merc://my.mercuiral"
22:06:23dom96What about tag switching?
22:06:27dom96what about tag lists?
22:06:40Araqwhat about an FTP download?
22:06:49dom96That will be added.
22:07:02dom96along with http
22:07:24dom96Why should every package specify the same downloadCmd?
22:07:41gradhaI want a megaupload download too
22:07:56dom96but megaupload is dead :\
22:07:58*Associat0r quit (Quit: Associat0r)
22:08:08gradhaok, then napster is the way to go
22:08:29Araqwhat if I use codeBeamer?
22:08:37Araqare you going to add support for that too? :P
22:08:48gradhais a codeBeamer like a star treak tricoder for code?
22:09:17AraqcodeBeamer is a web based Collaborative Application Lifecycle Management and Requirements management tool for distributed software development, written in Java.
22:09:28dom96maybe I should add support for mail, you know, in case someone wants to send you a CD with a babel package.
22:09:33gradharight, so it's jave, now I know you are joking
22:09:43dom96babel can then go to the post office and pick it up for you
22:09:54Araqdom96: now you got the spirit
22:10:07gradhadom96: floppies FTW https://www.youtube.com/watch?v=up863eQKGUI
22:12:05Araqbut there is at least Bazaar, Darcs and Fossil to support too
22:12:27dom96screw that shit
22:12:49AraqdownloadCmd is starting to look nice, hu? :P
22:12:59dom96no
22:21:52dom96What should be installed by default if the git repo has tags, git HEAD or the latest tag?
22:23:31dom96(And by git I mean any VCS)
22:24:48dom96i'm going to go for the latter
22:26:04Araqreally?
22:26:08Araqnot git HEAD?
22:26:15Araqwhat about living on the edge?
22:26:24dom96it's possible that HEAD will be unstable.
22:26:42Araqyeah but that's the point
22:26:59Araqotherwise the tag should have been included
22:27:07dom96I suppose it's easier to specify the specific version that 'latest'
22:27:17dom96*than
22:27:49dom96i'm not sure what you mean by what you just said
22:28:21Araqwell I dunno, it seems we need 2 different "latest"
22:28:43Araqlatest tag and HEAD
22:29:56dom96no, this makes sense.
22:30:02dom96you're confusing me
22:30:13Araqok
22:30:14dom96You don't want your dependencies to be HEAD by default
22:30:22AraqI do
22:30:32*Araq doesn't care about tags
22:30:34dom96Safer to have them be the latest version
22:31:03Araqsafer to include every last bugfix :P
22:31:21dom96many use the master branch as the dev branch...
22:31:29dom96like, well, you.
22:31:41dom96until recently perhaps
22:31:42dom96:P
22:33:00dom96it's a pretty bad idea to depend on HEAD.
22:33:56dom96haven't you read the Go story? :P
22:34:19gradhathe Go story or the Go! story?
22:34:40dom96The Go!!! story!
22:34:55gradhadon't know about it, sorry
22:35:32Araqdunno I think Go's packager manager is awesome
22:35:47Araqit's clearly broken but simple
22:36:03Araqand since every package manager is broken anyway, simplicity wins
22:36:11Araqof course except Babel
22:36:20dom96babel always wins
22:36:31AraqBabel will be the first non broken pakcage manager
22:36:53dom96Well thinking about this more. It's a bit odd.
22:37:01dom96If there are tags present in the repo
22:37:07gradhasearching for "The Go!!! story!" I arrived to http://gointothestory.blcklst.com. Nice police clip.
22:37:13dom96babel will find the latest version and use it
22:37:17dom96if there are not it will use HEAD
22:37:53dom96This behaviour could be confusing.
22:38:53dom96But it makes sense I think.
22:41:32EXetoCyour head is confusing
22:41:37BitPuffinEXetoC: yeah! too bad it won't be called linagl for much longer :)
22:41:57BitPuffindom96: not entirely sure, ask in their irc perhaps?
22:42:13dom96it's not that important.
22:42:48dom96EXetoC: I'm way too tired to be thinking about deep package manager issues :\
22:43:02BitPuffindom96: it's for submodules right?
22:43:06EXetoCI just said something random, really
22:43:44EXetoCand I meant the shape of your head. think Karl Pilkington
22:44:09BitPuffinKarl Pilkington is amazing
22:44:13dom96BitPuffin: It's to do with history. --depth 1 will only download the latest commit, it will not download the rest of the history.
22:44:26EXetoCyes, with a head like a fucking orange
22:44:27BitPuffindom96: oooh, yeah that should be useful
22:45:21EXetoCBitPuffin: ok. I guess there's no need to mention OpenGL all that much
22:45:41BitPuffindom96: maybe hg clone -r tip or head or whatever it is again
22:46:39Araqyay strutils.replace works
22:46:54EXetoCc(:)
22:47:08BitPuffinEXetoC: yeah, I hope to kind of somehow make it portable for other platforms too, the game api is ment to be able to run on pretty much everything, so say the native ps4 api ain't opengl and uses row major arrangement or whatever
22:47:28BitPuffinhey Araq, care to help a guy out?
22:47:44AraqBitPuffin: always
22:48:33BitPuffinAraq: I'm trying to implement swizzling right? But I'm getting a bunch of weird errors, it needs to be a template since I can't figure out the return type at compile time
22:48:53EXetoCand my pull request?
22:49:06BitPuffinEXetoC: oh, I didn't check
22:50:03BitPuffinEXetoC: why can't it take a TVector?
22:50:49BitPuffinEXetoC: I find it funny that you made a bunch of semantic changes after your preferences >_<
22:51:23EXetoCoops
22:51:42EXetoCI'll remove that
22:52:10BitPuffinEXetoC: and I'm fairly sure len(a) worked, why make it high - low + 1?
22:52:43EXetoCwill only take a minute
22:52:53EXetoCBitPuffin: it didn't when I tried
22:53:07BitPuffinEXetoC: Do you have the latest nimrod?
22:53:08EXetoCit simply didn't work at compile-time at that point
22:53:30AraqEXetoC: I fixed the 'len' bug
22:53:31EXetoCno, but I'll install it
22:53:34EXetoCalright
22:53:50EXetoCso I'll commit some stuff after that
22:54:05BitPuffinBtw
22:54:15BitPuffinwhat's the type for these literals?
22:54:20BitPuffin{'x', 'X', 'r', 'R', 's', 'S'},
22:54:27EXetoCset[char]
22:54:31BitPuffinah
22:54:34BitPuffinso it's sets
22:54:48EXetoCyou can echo it. it'll give you an error, but with the type in it :p
22:55:02EXetoCusually easier than importing that module
22:57:56BitPuffinI'm fairly sure I tested it :s
22:59:01EXetoCit should tell you what type you tried to pass to it. typedesc[something]
23:00:56NimBotnimrod-code/babel master 07b7f46 Dominik Picheta [+1 ±5 -0]: Implemented download of packages residing in mercurial repos.... 5 more lines
23:01:08dom96BitPuffin: there you go.
23:01:24dom96oh yeah, the --depth stuff
23:03:32*gradha quit (Quit: bbl, need to watch https://www.youtube.com/watch?v=1ZZC82dgJr8 again)
23:03:47NimBotnimrod-code/babel master 4bfbc1a Dominik Picheta [+0 ±1 -0]: Improved efficiency of hg cloning.... 2 more lines
23:05:09BitPuffindom96: awesome!
23:09:23NimBotnimrod-code/packages master d401396 Dominik Picheta [+0 ±1 -0]: Added info about new hg support.
23:11:01BitPuffinEXetoC: a.high instead of high(a) works fine though :)
23:11:02dom96BitPuffin: Let me know if you find any bugs :)
23:11:08BitPuffindom96: sure!
23:11:40BitPuffindom96: how do you suggest I package this api for babel, some people might only want to grab the math part of it for example
23:13:08EXetoCBitPuffin: I reverted all that, but ok
23:13:21BitPuffinEXetoC: ah, I'll change it later then
23:13:38dom96You could put it into separate repos, or use directory structure like 'mylib/math.nim'
23:13:41dom96*use a
23:14:13BitPuffindom96: yeah I plan to do the second one, do you think people will mind downloading everything?
23:14:33AraqBitPuffin: I don't think so
23:14:47AraqI surely don't mind if it's 10K or 50K
23:15:07EXetoCBitPuffin: the issue was that it wouldn't recognize TVector as an array even though it's just an alias, and so overloading `==` this way seemed like the easiest solution
23:15:11dom96I guess it depends how big it is.
23:15:20EXetoCbut it doesn't really matter since it's an alias
23:15:56dom96Some people may dislike depending on a library from which they only use one module.
23:16:56BitPuffinEXetoC: weird, but it worked when i tested it
23:17:08EXetoCI'll try again
23:18:05EXetoCthat appears to have been fixed too
23:20:12BitPuffinEXetoC: the len thing?
23:21:31AraqNimrod: 0.0790179
23:21:38AraqPython: 0.022048
23:21:54Araqfor my shitty strutils.replace benchmark ;-)
23:23:29BitPuffinAraq: higher is worse right?
23:23:34Araqyeah
23:23:42BitPuffinWell, that can be optimized
23:23:47dom96not bad for a VM you wrote in a couple of weeks.
23:23:50Araqbut python's string.replace is compiled code
23:24:00Araqnimrod's is interpreted
23:24:28BitPuffinhuh?
23:24:29BitPuffinoh
23:24:30BitPuffinit's the VM
23:24:34Araqyeah
23:24:39BitPuffinI thought it was statically compiled nimrod
23:24:42BitPuffinhow does that compare?
23:25:06AraqI don't care
23:25:20BitPuffinfair enough
23:25:27BitPuffinit's probably about the same one would assume
23:26:25Araqnot really, python has some overhead
23:26:26EXetoCBitPuffin: that and the TVector stuff. fixing both
23:27:32BitPuffinAraq: so you think it's slower?
23:27:46AraqBitPuffin: yeah
23:28:52NimBotAraq/Nimrod master ce6df5f Araq [+0 ±1 -0]: bugfix: system.& for sequences
23:28:52NimBotAraq/Nimrod master 3f63f76 Araq [+0 ±3 -0]: new vm: lots of fixes
23:29:03BitPuffinAraq: hmm, yeah it might be, I was just thinking that they have more resources to optimize such things, but obviously python can't compare to a compiled language
23:29:52AraqBitPuffin: perhaps you're right
23:30:14Araqwell my benchmark is silly anyway as it includes startup overhead in both
23:30:24BitPuffinhehe :)
23:30:26BitPuffinoh well
23:30:36BitPuffinIt will get better I'm sure
23:30:49BitPuffinand the VM will help me work around apple shitty bullshit shit
23:31:01Araqwell nimrod needs to process system.nim and strutils.nim at startup
23:31:06BitPuffineven though iOS gets a far slower version of the game
23:31:27Araqso it's suprising these numbers are comparable
23:31:48Araqand we're only a factor of 4 slower
23:35:37BitPuffinyeah truly
23:35:46BitPuffinand it's a very new VM
23:35:52BitPuffinthat was written in a short time
23:36:08BitPuffinsays a lot about nimrods productivity / performance ratio, hats off
23:36:17Araqindeed
23:36:33AraqI can't imagine debugging it somewhere else
23:37:49Araqnow only ~20 missing features have to be implemented :P
23:38:57Araqgood night
23:43:16BitPuffinnight!
23:51:25BitPuffinEXetoC: why did you remove +? I know it's silly but I don't want compilation to fail just because someone wrote +a
23:52:03EXetoChuh
23:52:42BitPuffinoh wait
23:52:46BitPuffingithub showed it as removed
23:52:49BitPuffinit was just moved
23:53:09EXetoCyeah
23:53:25BitPuffinEXetoC: also why `U`?
23:54:00EXetoCmissed something. wait
23:54:21BitPuffinalso ~= still takes an array
23:54:29BitPuffinand T is not a range, I is (interval)
23:58:18EXetoCI can't remember why I did that, but I can fix that in another branch
23:59:08BitPuffinwell I haven't merged yet
23:59:15BitPuffinso go ahead and add :)