<< 16-12-2014 >>

00:02:46Araqtest
00:06:13*t4nk583 quit (Ping timeout: 246 seconds)
00:07:09*wan_ joined #nim
00:11:01ldleworkI wish there was a step debugger
00:13:58*NimBot joined #nim
00:15:18Mat4Idlework: I guess you mean a Nim source-level debugger ?
00:16:11EXetoCgdb can show nim code, right? but I don't know about stepping and such
00:16:25ldleworkI fixeded it
00:16:30gokrSeveral gdb frontends works just fine.
00:16:37Mat4ciao
00:16:39gokrKDevelop for example, steps perfectly fine, over into etc
00:16:54*Mat4 left #nim (#nim)
00:17:02ldleworkAs long as you leave and return to the same line, my polygon slicing works :D
00:17:04gokrCompile with debuginfo and linenumbering and then it works great.
00:17:14ldleworkgokr: sounds like a topic for an article
00:18:09gokrYeah, I know
00:18:54dom96Araq: And also redirects from build.nim-lang.org/irclogs to irclogs.nim-lang.org :)
00:19:20dom96flaviu: http://irclogs.nim-lang.org/16-12-2014.logs
00:19:38dts|pokeballfilename.writeln(stuff) is the proper way to write to the file right?
00:19:42Araqdom96: what that list of Nimble packages?
00:19:52Araq*what about
00:19:54dom96Araq: Done
00:20:07Araqoh so that only requires a redirect?
00:20:17AraqI thought it requires a running nimbuild
00:20:28dom96no
00:20:31flaviudom96: What does the leading 1416096269.481826 mean?
00:20:33dom96I implemented it in NimBot
00:20:53dom96flaviu: The time the logs start I assume.
00:21:01dom96The rest is marshalled data.
00:21:11dom96Take a look at NimBot's irclog module.
00:21:24dom96May as well use it to read the data.
00:21:28flaviuAh, ok. Thanks.
00:21:34*Matthias247 quit (Read error: Connection reset by peer)
00:21:52flaviuWell, I'll want to load it into sql. json isn't a particularly good data format.
00:24:15Araqflaviu: what?! how can you say that? ;-)
00:24:22Araqit's everywhere
00:24:26Araqit has to be good
00:24:44flaviuAnd it is good for it's major use case: http api results.
00:25:03dts|pokeballwell anyways, if anyone can help... http://paste.ubuntu.com/9534659/ at line 153, for some reason nothing is getting written to eval.nim and i cant figure out why?
00:26:01EXetoCflaviu: that was the original use casE?
00:26:39Araqdts|pokeball: close the file to flush its buffer
00:26:55dts|pokeballah
00:26:56dts|pokeballduh
00:27:04*Trustable quit (Quit: Leaving)
00:27:08dts|pokeballthanks Araq. i feel quite stupid now
00:27:11flaviuEXetoC: I think so. It was the same syntax as javascript object initializers, so people could simply eval($.get("/myendpoint")) and get their data.
00:27:32EXetoCit does indeed have javascript in the name
00:27:38dom96seems my babelpkglist script is broken now
00:27:50dom96Doesn't list any official packages.
00:27:59dom96oh, likely because of the org name change.
00:28:13flaviuWhich is great - javascript is slow, so if you can abuse the JS parser written in C to get your data quickly, great.
00:28:19*StefanSalewski quit ()
00:29:50dts|pokeballwoot! working prototype of the evalbot
00:30:00Araqflaviu: er... it was a security disaster
00:32:10flaviuAraq: It could be more easily abused than more data formats. But then, JSON comes along and severely limited what it can do, which puts it on par with most other data serialization formats in terms of security.
00:32:28flaviuIf you're referring to CSRF, then that's hardly because of JSON.
00:42:58*Varriount|Mobile joined #nim
00:50:25*brson quit (Quit: leaving)
00:58:53*repax quit (Quit: repax)
01:24:36*ARCADIVS joined #nim
01:45:34*rpag quit (Ping timeout: 250 seconds)
01:50:20*dts|pokeball quit (Ping timeout: 250 seconds)
01:51:27*boydgreenfield quit (Quit: boydgreenfield)
02:59:57*Puffin quit (Ping timeout: 240 seconds)
03:06:56*BlaXpirit joined #nim
03:13:52*flaviu quit (Ping timeout: 265 seconds)
03:16:34*willwillson quit (Read error: Connection reset by peer)
03:23:03*BlaXpirit quit (Quit: Quit Konversation)
03:26:40*darkf joined #nim
03:56:38*kapil__ joined #nim
04:21:03*saml_ joined #nim
04:35:02*Trixar_za quit (Ping timeout: 244 seconds)
04:35:19*vendethiel quit (Ping timeout: 272 seconds)
04:37:33*vendethiel joined #nim
04:37:55*biscarch joined #nim
04:38:48*j3rky joined #nim
04:39:26*Trixar_za joined #nim
04:42:47*Var|Mobile joined #nim
04:43:06ldleworkforward. type. declarations.
04:43:40*ldlework trips on his whine and cracks his head open on the corner table and dies.
04:46:48ldleworkhope you're happy, the afterlife sucks
04:47:21*Varriount|Mobile quit (Ping timeout: 272 seconds)
05:04:37*j3rky is now known as j3rky|zzZzz
05:25:21*Var|Mobile quit (Ping timeout: 272 seconds)
05:28:32ldleworkwe should invert the privacy in nim
05:53:58*j3rky|zzZzz quit (Ping timeout: 256 seconds)
05:56:52*Puffin joined #nim
05:57:15*saml_ quit (Quit: Leaving)
06:01:36*Puffin quit (Ping timeout: 264 seconds)
06:24:19ldleworkwho wrote the graphics module?
06:38:14*boydgreenfield joined #nim
06:56:16*boydgreenfield quit (Quit: boydgreenfield)
06:59:03ldleworkthis place is dead hello
07:05:29*boydgreenfield joined #nim
07:08:22cyraxjoeldlework: hi!
07:10:30cyraxjoeI'm just a lurker and an admirer of the work on nim.
07:12:23ldleworkcyraxjoe: have you used it yet?
07:13:44cyraxjoejust follow some of the documentation
07:13:54*boydgreenfield quit (Quit: boydgreenfield)
07:14:32cyraxjoeldlework: how about you?
07:17:59ldleworkcyraxjoe: yeah I've played with it
07:18:02ldleworkcurrently writing a game
07:18:08*gour joined #nim
07:18:47cyraxjoeoh! nice, what kind of game?
07:21:11ldleworkcyraxjoe: have you ever played Qix?
07:21:16ldleworkits an old arcade game
07:21:59cyraxjoeno, have not.
07:22:43*cyraxjoe checking the wikipedia page
07:26:53ldleworkyou can just play it: http://www.freewebarcade.com/game/qix/
07:30:16cyraxjoenice
07:32:06ldleworkcyraxjoe: I'm breeding that game with Tron
07:32:35fowlldlework, dont use graphics just use sdl2
07:32:50ldleworkfowl: why? Then I'd have to write my own line drawing routine, etc
07:33:04ldleworkgraphics provides a hash interface to pixels, etc
07:33:05fowluse the gfx addon
07:33:08ldleworkits not worthless
07:33:15fowlor allegro5, sfml
07:33:51ldleworkfowl: my thing already works
07:34:49fowlsdl is old, if you use sdl2 you can target android and ios
07:35:18ldleworkfowl: where's the wrapper?
07:36:11ldleworkI see that sdl_gfx is pretty nice
07:37:04fowlwhich wrapper
07:38:14ldleworkto use sdl2
07:40:25fowlits called sdl2
07:40:31fowlnimble search sdl2
07:45:25gokrHey guys
07:45:46gokrJust FYI, we are targetting Urho3D and it uses SDL2, and thus also works on iOS, Android and the big 3.
07:46:13gokrNow... we haven't yet started on the Nim wrapper (some other guy has though, see forum), but will.
07:48:39fowlhttps://github.com/yglukhov/nim-sdl-template
07:48:51*vegai left #nim (#nim)
08:08:43*fowl quit (Remote host closed the connection)
08:11:36*ARCADIVS quit (Quit: ARCADIVS)
08:38:21*Trustable joined #nim
08:54:06*bjz quit (Read error: Connection reset by peer)
08:54:18*bjz joined #nim
09:03:51*NimBot joined #nim
09:10:02*gokr quit (Ping timeout: 256 seconds)
09:14:45*gokr joined #nim
09:18:25*vendethiel quit (Ping timeout: 272 seconds)
09:18:42ldleworkWhat does gc.nim(254) asgnRefNoCycle
09:18:45ldleworkmean?
09:19:47*vendethiel joined #nim
09:24:07milosnhmmm nim is cool
09:24:11milosni wanna buy it
09:24:13milosn:D
09:24:15milosnhar har
09:24:41milosni can ensure your future success
09:24:43milosnhar har
09:25:04milosn:)
09:25:50*khmm joined #nim
09:55:15Araqldlework: i means you have some nice corruption
09:55:28Araqof you have some 'nil' access
09:55:38Araq*or
10:01:28*kapil__ quit (Quit: Connection closed for inactivity)
10:05:47*jasondotstar joined #nim
10:07:48*ekarlso- quit (Changing host)
10:07:48*ekarlso- joined #nim
10:44:18*kapil__ joined #nim
11:20:01*kniteli quit (Ping timeout: 272 seconds)
11:33:34*flaviu joined #nim
11:39:19*StefanSalewski joined #nim
11:42:10*BlaXpirit joined #nim
11:42:41StefanSalewskiOne question related to templates (generated by c2nim): Templates may contain undefined symbols in their body, but compile fine. Like
11:42:46StefanSalewskitemplate do_something(t: expr): bool = (this_does_not_exist(t) > (0))
11:43:35StefanSalewskiI guess there is no way to detect undefined symbols here. as long as the template is not really called?
11:46:53StefanSalewskiAnd, in the above template example you see many not really necessary brackets (). Does we have a nice tool to strip them? I used sed for a few trivial cases, but it works not always.
11:53:30*BlaXpirit quit (Quit: Quit Konversation)
11:54:24*flaviu quit (Ping timeout: 264 seconds)
11:54:42EXetoCit should exist either in the header or one of its dependencies
11:55:08EXetoCif not then perhaps it should be commented out
11:57:29StefanSalewskiOne remark to my gtk3 wrapper stuff -- I have added deprecated pragmas like
11:57:33StefanSalewski{.deprecated: [g_param_spec_get_name: get_name].}
11:58:15StefanSalewskito allow using the old original function name also. Is that a bad idea?
12:00:05EXetoCyes. the purpose is to give users some time to migrate, but you don't even have any existing users
12:00:22EXetoCthough I suppose it could be abused as a simple way to generate an alias, but that's just going be confusing
12:01:19StefanSalewskiI though of people porting from C -- they may use the long C function names
12:01:35*jasondotstar is now known as jasondotstar|afk
12:04:24EXetoCoh
12:04:26StefanSalewskiAnd indeed for wrappers like glib it is not always absolutely clear if we should use the long original function name or the abbreviated name. I think my idea is helpful :-)
12:09:41EXetoCtype prefixes can be omitted
12:09:50EXetoCI wouldn't bother. an example or two should clear things up
12:10:32*Varriount_ joined #nim
12:11:52StefanSalewskiIs it possible to see c compiler warning for an average Nim user, i.e to see warnings about used deprecated functions?
12:12:58StefanSalewskiReason: for GTK there are deprecated function -- I would like to care not too much about generating messages but leave that to gcc
12:13:45*Varriount quit (Ping timeout: 258 seconds)
12:16:43EXetoCI don't know. maybe with the header pragma
12:17:05EXetoCgtksharp seems to come with an api for generating libraries
12:20:46StefanSalewskiInteresting, I have never looked at gtksharp -- will do. Have considered GObject Introspection as used by Python first, but my feeling is that c2nim is easier to use...
12:24:30*clone1018 joined #nim
12:28:37*Roin joined #nim
12:28:43Roinhm why is that? ._.
12:32:56EXetoC?
12:34:10Roinname chnage? LD
12:34:12Roin:D
12:34:23RoinUh dont mind my spelling I'm at work atm lol
12:35:06Roinnim reminds me about AIX :/
12:43:47EXetoCbecause people either got offended or didn't know what it stood for
12:57:14Roinhm ok
13:07:57Araqdom96: can we deprecate sockets.nim now? do the people know what to use instead?
13:08:28dom96Araq: Sure, just do it.
13:08:45Araqwell the compiler itself uses it iirc
13:09:06dom96s/sockets/net/
13:09:49Araqoh?
13:09:54Araqit's that simple?
13:12:40dom96kind of
13:12:50dom96You should be able to figure out the rest.
13:12:56dom96socket vs. newSocket etc
13:14:57Araqwhat do we have wrt low level sockets?
13:15:10Araqcan we send a socket handle to another thread easily?
13:16:20dom96rawsockets
13:17:41*StefanSalewski quit ()
13:17:50Araqyes I know, but how does this work in practice?
13:18:09Araqsay some asynchttpserver gives me an async socket
13:18:34Araqand I want to pass that socket to 'spawn'
13:19:01AraqI can ask for the socket's underlying handle and pass that instead
13:19:48Araqbut then I'm stuck with this low level handle
13:25:12AraqI think net.createSocket should be exported
13:28:25dom96Why not just pass the whole thing?
13:28:52dom96You will probably want the buffer and other info stored in that object too.
13:29:00Araqthat performs a deepCopy then
13:29:36dom96You can always just use the Socket() constructor.
13:29:37Araqwhich is workable, but not too efficient
13:30:15Araqthe Socket constructor can access hidden fields? o.O
13:30:31dom96All of them are exported.
13:30:43Araq:O
13:31:03Araqthat's not good
13:32:33dom96probably yeah.
13:32:35dom96Anyway. Deep copy shouldn't be so bad.
13:32:46dom96You will want the buffer if it exists
13:32:50dom96if it doesn't then it'll be faster
13:33:00dom96so doing it manually won't help
13:33:03dom96it'll just be tedious
13:34:17Araqyeah but nevertheless we can override deepCopy and make it much faster
13:34:26*gokr_ joined #nim
13:38:31dom96You may as well get access to all the fields then.
13:42:43Araqnot really
13:45:55dom96Why?
13:48:55Araqbecause it's fundamentally different
13:49:19Araqjust because you can perform a deepCopy safely, it doesn't mean you can access the fields directly safely
13:49:22Araqbbl
14:08:04*repax joined #nim
14:08:41*gokr_ quit (Ping timeout: 256 seconds)
14:30:46*NimBot joined #nim
14:44:46*Var|Mobile joined #nim
14:47:24*BitPuffin joined #nim
14:51:51*repax quit (Remote host closed the connection)
14:53:20*repax joined #nim
14:57:29*j3rky|zzZzz joined #nim
15:04:16*zebra111 joined #nim
15:05:56*Var|Mobile quit (Ping timeout: 250 seconds)
15:08:20*j3rky|zzZzz quit (Quit: Konversation terminated!)
15:08:41*j3rky joined #nim
15:15:40*jasondotstar|afk is now known as jasondotstar
15:30:23*j3rky quit (Ping timeout: 258 seconds)
15:41:28*kapil__ quit (Quit: Connection closed for inactivity)
15:44:35*dts joined #nim
15:45:21*darkf quit (Quit: Leaving)
16:13:45*dts quit (Quit: dts)
16:26:03*brson joined #nim
16:32:37*yeye123 joined #nim
17:15:12*StefanSalewski joined #nim
17:31:29*repax quit (Ping timeout: 245 seconds)
17:34:10*khmm quit (Ping timeout: 244 seconds)
17:34:36*willwillson joined #nim
17:39:40*starless joined #nim
17:40:00ldleworkHow can I get a reference to a non-reference?
17:40:01*irrequietus joined #nim
17:40:13*irrequietus quit (Changing host)
17:40:13*irrequietus joined #nim
17:41:11ldleworkif I have type Foo = object foo = seq[int] and Bar = object bar = ref seq[int]
17:41:17ldleworkAnd I have a normal var foo object
17:41:17EXetoCI think you'll have to get a pointer to it instead
17:42:16ldleworkso
17:42:23ldleworkvar blah = "asdfasdf"
17:42:32ldleworkptr refer = addr(blah)
17:42:34ldleworkshould work?
17:42:47willwillsonor make an alias to Foo, eg: type FooRef = ref Foo
17:43:06ldleworkwillwillson: that doesn't help when I start with a Foo
17:43:12EXetoCalmost. ptr can't be there
17:43:26EXetoCyou simply want to avoid copying?
17:43:28willwillsonldlework: true, but maybe you start with a ref ;-)
17:43:53ldleworkEXetoC: I have this polygon structure that contains edges which keep references to the next and previous edges
17:44:02ldleworkand I'm splicing and cutting up polygons and creating new ones and so on
17:44:12ldleworkand I want to have as little references as possible
17:44:33ldleworkso that I don't get odd situations where one edge refers to the line of an old polygon
17:44:45ldleworkcould be mitigated by squashing the bugs in my code, but I figure the compiler could help me out
17:46:20EXetoCyou don't want to use only references?
17:48:32ldleworkeh I'll just use references and debug my code a bit better
17:50:10ldleworkEXetoC: do you know where the built in unit test stuff is described?
17:50:22willwillsonif these objects live a long time, you probbaly don't want a ptr to stack allocated variable
17:51:38EXetoCldlework: just in some tests in the unit test directory
17:52:21EXetoCI stopped using it after a check failed and it wouldn't give me a helpful stack trace
17:52:25ldlework:(
17:52:38EXetoCa standalone check macro would be great
17:55:40EXetoCI don't care as much about other features, such as not stopping on the first failure
17:56:15ldleworkEXetoC: basically I don't want to have to manually run individual nim files to run tests against my program
17:56:32ldleworkI'd like to say nim, start with foo.nim and run tests for any module imported as a result
17:57:17willwillsondid you see that solution posted on the forums?
17:57:23ldleworkno
17:57:32EXetoCjust do "when defined(unittest) or isMainModule: ..."
17:57:37willwillsonyou have to define your tests in the same module though
17:57:48EXetoCwhat was your solution?
17:57:52EXetoCoh
17:58:19EXetoCmy approach seems simpler
17:59:20willwillsonhttp://forum.nimrod-lang.org/t/653#3538 and the discussion started in http://forum.nimrod-lang.org/t/650#3526
17:59:24*kniteli joined #nim
18:01:26*StefanSalewski quit ()
18:03:32EXetoCok. something similar to 'check' would be good. I'd rather have assert act that way, conditionally perhaps
18:04:24EXetoCthe value of each expression is shown in case of a failure, which avoids having to fiddle with the message parameter
18:05:32willwillsonyeah, it would be nice if assert showed the values
18:15:34*Varriount|Busy joined #nim
18:20:56Varriount|BusyGah. Everytime I read a wikipedia article like this - https://en.wikipedia.org/wiki/Linux_Unified_Key_Setup -, I feel like I've been slapped in the face
18:25:45*irrequietus quit ()
18:46:13*Varriount|Busy quit (Ping timeout: 246 seconds)
18:55:01*starless quit (Quit: WeeChat 0.4.2)
18:55:39*AMorpork is now known as AFKMorpork
19:05:38*drewsrem joined #nim
19:15:28*repax joined #nim
19:20:13drewsremCan I explicitly specify the type of the values of tables when I use Table constructors?
19:21:51drewsremCurrently I do: var table = initTable[int, sometype](); table = { 1: 0, 2: 0 }
19:22:05drewsremI wonder if I can use let and still specify the type of my tables values
19:28:42*rpag joined #nim
19:34:09EXetoCvar table = {1:0,2:}.toTable?
19:34:48EXetoCI don't know it uses that name. I don't really see it as a conversion
19:35:14EXetoCbut that seems to be what you want
19:43:24*AFKMorpork is now known as AMorpork
19:48:30*Mat4 joined #nim
19:48:42Mat4hello
19:56:17drewsremEXetoC I wanted to specify the type explicitly, my example was badly chosen, e.g. if I define two different types, that both consist of an int and a string but with different field-names, I'd like to explicitly declare the correct type in the table constructor.
19:57:57drewsrem*...that are both _tuples_ consisting...
19:58:00drewsremAm I making senes?
19:59:35EXetoCwhy won't inferrence work?
20:00:21drewsremIf I have two types, both tuples, both consisting of an int and a string, how'd the table constructor know what type I want?
20:01:13drewsremhttp://ix.io/3Sq example
20:03:18drewsremI guess the correct term is "type signature"?
20:03:49drewsremanyway
20:04:48*comesandgos joined #nim
20:05:05drewsremIndeed, if I echo that first element from the table I get: (Field0: 2, Field1: guest room)
20:06:11comesandgosdo it like you would normally: let x: Table[int, sometype] = {1: instance1}.toTable ?
20:06:41drewsremcomesandgos, oh wonderful, that's what I was looking for, thanks
20:07:02drewsremSomehow didn't occur to me
20:07:23comesandgoshappy to help ;D
20:10:33drewsremThe toTable in that example seems a bit verbose tho? - But I guess there is no implicit conversion for this
20:11:55*dyu quit (Quit: Leaving)
20:19:02EXetoCthere isn't - the input is a tuple, constructed with a different syntax
20:19:29EXetoCyet another elegant solution
20:27:06*comesandgos quit (Quit: Page closed)
20:33:57*nande joined #nim
20:34:01*Jesin quit (Ping timeout: 264 seconds)
20:38:15*flaviu joined #nim
21:15:58ldleworkHow do i pass a pointer to a sequence to a c import?
21:18:11ldleworkdo I have to malloc it myself?
21:21:44*comesandgos joined #nim
21:23:04comesandgosidlework: you can take the addr of the 0th element
21:25:29ldleworkthat worked.
21:30:39*yeye123 quit (Quit: Leaving)
21:34:14*gour_ joined #nim
21:38:02*gour quit (Ping timeout: 256 seconds)
21:39:16*comesandgos quit (Quit: Page closed)
21:49:52*Jesin joined #nim
21:52:28*Jesin quit (Max SendQ exceeded)
21:53:00*Jesin joined #nim
22:08:49*kniteli quit (Ping timeout: 264 seconds)
22:08:56*Matthias247 joined #nim
22:15:47*repax quit (Quit: repax)
22:20:10*kniteli joined #nim
22:26:15*dts|pokeball joined #nim
22:52:46*Var|Mobile joined #nim
22:52:53Mat4ciao
22:53:31*Mat4 left #nim (#nim)
22:56:40*BitPuffin quit (Ping timeout: 255 seconds)
22:59:18*BillsPC joined #nim
23:07:29*BillsPC quit (Remote host closed the connection)
23:30:32*BillsPC joined #nim
23:30:44dts|pokeballok guys... if i can get your opinion on something
23:30:48dts|pokeballhow does this look?
23:31:06dts|pokeball,eval var foo: string = "Hello, world!"
23:31:07BillsPCdts|pokeball: <no output>
23:31:17dts|pokeball,eval echo("Hello, world!"
23:31:18BillsPCdts|pokeball: eval.nim(2, 0) Error: ')' expected
23:31:20dts|pokeball,eval echo("Hello, world!")
23:31:21BillsPCdts|pokeball: Hello, world!
23:33:13EXetoC,eval var x = 0
23:33:14*Var|Mobile quit (Read error: Connection reset by peer)
23:33:47EXetoC,eval var x = cast[ptr int](0)[]
23:33:52dts|pokeballit only works for me right now since i dont have it sandboxed
23:34:21EXetoCbut I wanted to test exploits :/
23:34:47dts|pokeballthats why i have it locked ;)
23:34:50dts|pokeballhold on
23:36:24*BillsPC quit (Remote host closed the connection)
23:36:56*BillsPC joined #nim
23:37:21dts|pokeballthere. i have temporarily taken off restrictions on eval EXetoC
23:37:28EXetoC,eval var x = cast[ptr int](0)[]
23:37:35BillsPCEXetoC: SIGSEGV: Illegal storage access. (Attempt to read from nil?)
23:37:38EXetoC,eval echo ohai
23:37:39BillsPCEXetoC: eval.nim(1, 5) Error: undeclared identifier: 'ohai'
23:37:44EXetoC,eval echo "ohai"
23:37:45BillsPCEXetoC: ohai
23:37:50dts|pokeballits slow right now but ill fix that
23:41:06EXetoC,eval echo open("/dev/random").readLine()
23:41:07BillsPCEXetoC: rš«‡krš䋃–i~?%։軺s֯9ͱª`ǩ
23:41:13EXetoC,eval echo open("/dev/random").readAll()
23:41:14BillsPCEXetoC:
23:42:03EXetoCgonna do it in the offtopic channel instead
23:42:08dts|pokeballgood idea
23:55:40*BillsPC quit (Remote host closed the connection)
23:58:41*dts|pokeball quit (Read error: Connection reset by peer)
23:59:44*dts|pokeball joined #nim