<< 15-05-2015 >>

00:15:22*vendethiel quit (Ping timeout: 264 seconds)
00:15:54gmpreussner|workdom96: im writing bindings for OpenGL ES and ran into some name collisions. when I nimify the constants, some of them end up with the same name as imported functions. what's the best way to resolve that?
00:16:22gmpreussner|workone thing i tried was to convert the constants to enums, but that gets really messy thanks to the crappy API
00:16:54gmpreussner|workanother option would be to rename either the constants or the functions, but that may confuse users
00:17:19notfowlgmpreussner|work: I believe yglukhov has a wrapper for opengl es in nimx
00:17:48gmpreussner|worknotfowl: oh, i searched github and couldn't find any. lemme check
00:18:51gmpreussner|workhe forked OpenGL, but not ES
00:19:37notfowlThere has to be some opengl es stuff in here for it to run on mobile right
00:19:53gmpreussner|workhe is using a subset of GL in portable_gl.nim
00:20:10gmpreussner|worki guess it's the common denominator of all GL's
00:20:17gmpreussner|workvery limited functionality
00:20:50notfowlAh
00:20:52gmpreussner|worknotfowl: do you have any recommendation on how to best resolve the name collisions? i'm not sure what to do...
00:21:29gmpreussner|workif all else fails, i could get back to the fugly GL constant naming conventions (UPPER_SNAIL_CASE)
00:21:29notfowlgmpreussner|work: prefix the constants with c, it had to be done in opengl.nim because of the conflicts
00:22:54gmpreussner|worki looked at the bindings in nim-lang, and they went with the fugly names
00:23:09gmpreussner|worki.e. GL_CULL_FACE_MODE
00:23:15gmpreussner|workinstead of glCullFaceMode
00:23:27gmpreussner|worki guess i could do cglCullFaceMode... is that what you're suggesting?
00:25:03notfowlThe problem was back then some constants clashed with function names, that was before we had cs:partial though
00:25:25gmpreussner|workyep, that's the problem i'm having
00:25:33gmpreussner|workwhat is cs:partial?
00:26:19notfowlPartial case sentitivity, means capitalization matters for the first letter
00:26:38gmpreussner|workoh i see
00:26:44*Jehan_ quit (Quit: Leaving)
00:27:01*jbomo joined #nim
00:27:02*jbomo quit (Client Quit)
00:27:11gmpreussner|workthe Wiki recommends using camelCase for constants, if possible
00:27:20gmpreussner|workthat will make it clash again
00:28:01gmpreussner|workmaybe i just go with FUGLY_CASE then?
00:28:10notfowlMight as well
00:28:13gmpreussner|workthen at least it is consistent with opengl.nim
00:28:24notfowlIts nice to not the api very far removed from its c equivalent
00:29:01notfowlThat way you can tell people to RTFM without having one written :D
00:30:11gmpreussner|worktrue. i prefer to use idiomatic nim though
00:30:24gmpreussner|workso the code isn't littered with C style stuff
00:30:46gmpreussner|workimho a user shouldn't have to know that an import comes from C etc.
00:31:33transfuturistso i worked out how to print a nim enum in gdb
00:31:34transfuturistprint (reprEnum((*formal).kind, (&NTI190260)))->data
00:31:57transfuturistwhere NTI*** is something you have to find manually, since the info regex doesn't work outside of the actual name
00:33:00*Jesin joined #nim
00:33:08transfuturistand, uh. fun news.
00:33:23transfuturistthe breakpoints set in nim files don't follow the nim control structure
00:35:24transfuturisti have a breakpoint set on an echo statement and it's catching the cases where the statement doesn't fire
00:43:43reactormonktransfuturist, urgh
00:43:48*yglukhov____ joined #nim
00:48:06*yglukhov____ quit (Ping timeout: 246 seconds)
00:48:35*vikaton joined #nim
00:53:36*Demos joined #nim
00:58:48*filwit joined #nim
01:04:17*Kingsquee joined #nim
01:06:05*epichero quit ()
01:11:57transfuturistback to trying to get endb to compile
01:16:46*dddddd quit (Ping timeout: 244 seconds)
01:18:52*vendethiel joined #nim
01:27:21*gsingh93 quit (Ping timeout: 240 seconds)
01:27:45*Trustable_2 joined #nim
01:30:31*Trustable quit (Ping timeout: 250 seconds)
01:37:11def-transfuturist: that sounds weird, did you try without optimizations or can you post instructions for how to reproduce?
01:37:21def-I only tried really simple things with gdb but they seemed to work just fine
01:39:10Quorahow would I use metaprogramming to simplify redundant blocks of code like this? https://github.com/Heartmender/sobot/blob/master/web/web.nim#L32-L34
01:39:42def-Quora: a template
01:39:49Quoradef-: how would I do that?
01:39:56QuoraI've not used languages with templates before
01:40:19def-http://nim-lang.org/docs/tut2.html#templates
01:41:47*vendethiel quit (Ping timeout: 256 seconds)
01:44:37Quorahttps://gist.github.com/Heartmender/8978e3b0876036390139
01:45:25def-an {.immediate.} pragma might help
01:46:00Quoranope
01:46:04*pipeep quit (Changing host)
01:46:04*pipeep joined #nim
01:46:14def-I can't test it, strangely the re module is not compiling for me
01:46:36transfuturistdef-: i'm pretty sure it's all a consequence of the c generation. control structures get melted down into gotos (with many line directives), that might mess with the breakpoint
01:47:40def-oh, i see why, my bad
01:47:54*boydgreenfield quit (Quit: boydgreenfield)
01:48:27transfuturistendb seems to put a bunch of references to an object called 'F' that isn't defined anymore, either locally or globally, and that's freezing the compilation
01:48:40transfuturistexample statement: F.s[0].address = (void*)&n; F.s[0].typ = (&NTI193805); F.s[0].name = "n";
01:48:58def-transfuturist: yeah, i noticed that as well, no idea what that was and why it stopped working. maybe bisecting will help
01:49:37*vendethiel joined #nim
01:50:16transfuturistbisecting is always the answer :P
01:51:04transfuturistin ccgstmts:
01:51:06transfuturistif frameLen > 0: blockEnd.addf("F.len-=$1;$n", [frameLen.rope])
01:52:10Quoradef-: would a macro be more appropriate?
01:52:50def-Quora: this works: https://gist.github.com/def-/7d5fdfac9dc7ca9729cf
01:53:39transfuturistit seems to be indentation sensitive
01:53:57transfuturistgcc isn't complaining about the lines where F is referenced on non-indented lines
01:55:04Quoradef-: doesn't work for me
01:55:10Quora0.11.2
01:55:18*Trustable_2 quit (Remote host closed the connection)
01:55:27Quoraor
01:55:34QuoraI copied the wrong block
01:55:36Quoraugh
01:55:38QuoraI hate chrome
01:57:01Quorahttp://puu.sh/hNHnS/f3a312d6dc.png web.nim(33, 5) Error: undeclared identifier: 'get'
01:57:20def-Quora: don't put the template inside the routes
01:57:56Quoradoesn't work in or out of them
01:58:52def-oh, it works when you remove the brackets at foo() call
01:58:57def-I'm wondering why
01:59:15*vikaton quit ()
01:59:54def-that's probably the routes macro interfering, I think it might be a better idea to go with the manual routing: https://github.com/dom96/jester/blob/master/tests/example2.nim
02:00:12Quoraahh
02:00:14Quoraokay I see
02:00:15Quorathanks
02:02:28Quorawait what
02:02:41Quorait's now eliminating the stuff from the binary
02:03:14def-ok, let's not call templates inside the routes macro
02:03:30def-I just checked, and the routes macro just discards our templates
02:03:41Quorahttps://gist.github.com/Heartmender/59250eddb8e20252541c
02:03:42notfowlO.o
02:03:43Quoraoh
02:03:51def-two choices: go with manual routing, or build your custom routes with a macro
02:04:43transfuturisthm, it might be in csources too
02:04:54Quorahow would I do it with a macro?
02:05:13def-Quora: it's a bit complicated I think, you can try reading about them in the tutorial. I'll give it a try too
02:05:58def-(but this looks hacky to me and I would go with the manual routing instead)
02:07:34Quorahmm
02:08:27Quoradef-: I filed an issue (https://github.com/dom96/jester/issues/34)
02:08:43def-Quora: not necessary, that's totally intentional
02:09:12def-the routes macro is not supposed to have templates inside
02:09:28Quoradef-: I find it better to make the issue and be rejected than not make it and have the authors never know there is a problem to begin with
02:09:49def-it parses the AST of the stmt inside and transforms that into a manual routing
02:10:05Quoraah
02:15:17*darkf joined #nim
02:18:13def-Quora: ha, got it I think!
02:18:19Quorahmm?
02:20:20notfowlIs the template pulled out in outsideStmts
02:20:42def-Quora: Updated: https://gist.github.com/def-/7d5fdfac9dc7ca9729cf
02:22:58def-Quora: maybe you're also interested in the mimetypes module: http://nim-lang.org/docs/mimetypes.html
02:23:21def-then you could get rid of specifying your own mimetypes by hand
02:24:42Quoradef-: that is kinda beautiful. Thanks!
02:25:48def-Quora: still one thing missing, my bad
02:26:37notfowlDo you use the s parameter def-
02:26:42def-notfowl: just fixed
02:26:48def-That's what was missing
02:27:03def-I can't actually test the program, don't have a sobot.toml
02:27:16notfowldef-: do you know how to use quote
02:27:24def-notfowl: yes, but it complains here
02:27:29notfowlIts a lot nicer looking than parserxpr
02:27:33notfowlAh
02:28:22def-is there a dirty kind of quote?
02:28:28Quorahttps://github.com/Heartmender/sobot
02:28:54notfowlNo but it is needed. Quote itself is not magic just a macro
02:29:35Quoraweb.nim(22, 3) Hint: 'robotoregwoff2' is declared but not used [XDeclaredButNotUsed]
02:30:08def-Quora: i removed those
02:30:13Quoraoh
02:30:25QuoraOH
02:30:27QuoraI see
02:30:29Quoraokay
02:30:41def-Quora: also, did you know that jester has setStaticDir?
02:31:05QuoraI do now
02:33:09def-notfowl: are you sure quote is not magic and a macro instead?
02:33:42def-notfowl: from what I can see it's semQuoteAst im compiler/semexprs.nim
02:36:15notfowlHrm
02:38:01notfowlThought I just looked at it recently
02:56:12*vendethiel quit (Ping timeout: 258 seconds)
03:00:12transfuturist if not m.preventStackTrace:
03:00:13transfuturist var procname = makeCString(m.module.name.s)
03:00:13transfuturist add(prc, initFrame(m.initProc, procname, m.module.info.quotedFilename))
03:00:13transfuturist else:
03:00:14transfuturist add(prc, ~"\tTFrame F; F.len = 0;$N")
03:01:39*zahary quit (Ping timeout: 244 seconds)
03:03:23*vendethiel joined #nim
03:03:40reactormonkAraq, hm?
03:26:29*vendethiel quit (Ping timeout: 245 seconds)
03:35:46*vendethiel joined #nim
03:37:57*BitPuffin|osx quit (Ping timeout: 256 seconds)
03:58:31*notfowl is now known as fowl
03:59:46*vendethiel quit (Ping timeout: 264 seconds)
04:27:05*Kingsquee quit (Quit: Konversation terminated!)
04:36:52transfuturistgot endb to work, F needed to be renamed to FR in strings
04:49:53transfuturistit seems that enable and disable are no longer endb commands
04:50:30transfuturistah, it's toggle now
04:52:29transfuturiststill isn't working...
04:53:05transfuturistthe pain that is debugging a debugger
05:15:13*vendethiel joined #nim
05:22:23*mal``` quit (Ping timeout: 248 seconds)
05:22:50*mal`` joined #nim
05:23:46renesacYo dawg, I herd you like debuggers
05:29:28*Demon_Fox joined #nim
05:38:05*vendethiel quit (Ping timeout: 256 seconds)
05:38:24*vendethiel joined #nim
06:12:15transfuturistfor the last five hours i've been switching between trying to get gdb to work, and trying to get endb to work, and alternately remembering why i switched to trying the other immediately
06:13:24transfuturistaaaaaaaaaaaaaaaaaaaaagh
06:17:39transfuturistright, fuck debuggers.
06:17:57*BlaXpirit joined #nim
06:23:31*vendethiel quit (Ping timeout: 255 seconds)
06:26:11*vendethiel joined #nim
06:36:05*iamd3vil joined #nim
06:37:41*d3m1gd joined #nim
06:46:04*Demos quit (Read error: Connection reset by peer)
06:47:18*bjz joined #nim
07:00:33*Kingsquee joined #nim
07:25:31*Matthias247 joined #nim
07:36:59*dtscode quit (Remote host closed the connection)
07:38:51*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
07:39:16*transfuturist quit (Quit: Lost terminal)
07:40:02*Matthias247_ joined #nim
07:42:43*Matthias247 quit (Ping timeout: 255 seconds)
07:44:30ggVGcwhy does nim use colons after conditionals ?
07:44:42ggVGcnot sure why python does it either, but I guess that's where the inspiration comes from
07:44:51ggVGcI don't see a syntactic benefit of it
07:47:33*ingsoc joined #nim
07:47:55*iamd3vil quit (Ping timeout: 246 seconds)
07:54:09*wan quit (Ping timeout: 240 seconds)
07:55:13*wan joined #nim
07:58:16*coffeepot joined #nim
08:05:48*bjz joined #nim
08:19:43*yglukhov____ joined #nim
08:22:20*Jesin quit (Quit: Leaving)
08:24:15*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:28:22*ddl_smurf quit (Quit: ddl_smurf)
08:34:58*mrkishi quit ()
08:37:49*MyMind joined #nim
08:42:55*ingsoc quit (Quit: Leaving.)
08:44:00*BlaXpirit quit (Quit: Quit Konversation)
08:57:58*mal`` quit (Ping timeout: 256 seconds)
09:05:42*xcombelle joined #nim
09:11:55*mal`` joined #nim
09:18:21def-ggVGc: reads nicely and same syntax works with single line conditionals, see also: http://forum.nim-lang.org/t/1127#7031
09:23:24*endragor joined #nim
09:41:11*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:48:56*Demon_Fox quit (Quit: Leaving)
09:56:02*bluenote_ joined #nim
09:59:48*ddl_smurf joined #nim
10:13:20*filwit quit (Quit: Leaving)
10:18:59*Trustable joined #nim
10:28:00*phira joined #nim
10:37:23*OnO joined #nim
10:49:06*milosn quit (Quit: leaving)
11:00:32coffeepotcouldn't see it in the manual, how do I create my own exceptions for raising?
11:00:35*johnsoft quit (Ping timeout: 272 seconds)
11:01:24coffeepotah ok I see, just create object decending from Exception
11:01:53*johnsoft joined #nim
11:07:57*bjz joined #nim
11:15:24dom96Quora: thanks
11:18:16*bjz quit (Ping timeout: 255 seconds)
11:32:04*banister joined #nim
11:32:40*banister quit (Client Quit)
11:33:02*banister joined #nim
11:44:38*vikaton joined #nim
11:50:40*bjz joined #nim
11:51:28*ELFrederich quit (Quit: Leaving)
11:52:50*Kingsquee quit (Quit: Konversation terminated!)
11:54:57*dddddd joined #nim
11:57:20*emilsp joined #nim
11:57:33emilsperm, is there python equivalent for nims json library ?
11:59:02dom96emilsp: https://docs.python.org/2/library/json.html I guess
12:00:03emilspdom96, yeah, but it returns a dictionary, whereas nim's library returns super awesome node objects/structs/things, which are much more fun to deal with
12:00:57dom96emilsp: that is the way to represent it in Python because it is dynamically typed
12:01:43emilspI see no reason why it couldn't return an object that would just throw exceptions if the type it held wasn't accessed with the right 'method' or whatever
12:02:09emilspmaybe I'm just stupid, but dealing with 'bare' dicts feels too hard for what I want to do
12:03:45dom96emilsp: The obvious solution is to use Nim instead of Python :P
12:04:22emilspdom96, to serialize python objects ? Of course :)
12:05:21emilspdom96, I would've used nim if it hadn't been for the libraries that were already there in python for this project :(
12:05:29dom96Why not just use the pickle module for serialisign?
12:05:32dom96*serialising
12:05:52emilspI don't want to serialize everything
12:06:50emilspand serialization is 'clunky' when you deal with enums and there might be a thread object somewhere there, and a subprocess for good measure
12:13:18*JinShil joined #nim
12:14:47*gmpreussner|work quit (Read error: Connection reset by peer)
12:33:15*OnO is now known as ono
12:39:33*ingsoc joined #nim
12:43:44*vikaton quit ()
12:50:29*Freedum joined #nim
12:55:27FreedumCould someone explain me that ? This code : http://pastebin.com/atpXGYvL prints only one IP. But this one : http://pastebin.com/p5TGdt7W prints a ton of IPs. And I just changed "google.com" to "www.google.com". Why ?
12:57:53emilspmultiple hosts bound to the full hostname ?
12:58:21emilspbut just a resolver host for the 'nonfull' hostname ?
12:58:48FreedumMaybe.
12:59:17*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:01:41FreedumIt depends. It works for google.com, but it doesn't work for, say, 4chan.org. The output is : 141.101.114.6.52.99.104.97.141.101.115.6.52.99.104.97.190.93.244.6.52.99.104.97.190.93.245.6.52.99.104.97.190.93.247.5.103 141.101.115.6.52.99.104.97.190.93.244.6.52.99.104.97.190.93.245.6.52.99.104.97.190.93.247.5.103 190.93.244.6.52.99.104.97.190.93.245.6.52.99.104.97.190.93.247.5.103 190.93.245.6.52.99.104.97.190.93.247.5.103 190.93.247.5.1
13:04:24FreedumIs there no way to get properly the IP adress associated to a hostname ?
13:06:53*banister joined #nim
13:07:44def-Freedum: I guess it's just missing in the standard library so far
13:09:40emilspFreedum, wouldn't there be multiple IPs associated with a hostname anyway ?
13:13:24FreedumYes, that's true. I found that https://raw.githubusercontent.com/def-/nim-unsorted/master/dns.nim gives only one IP, that works, even if it changes from www.google.com (173.194.113.113) to google.com (216.58.210.46)
13:15:20*Freedum quit ()
13:15:29*giuliano108 joined #nim
13:23:07*ono is now known as OnO
13:24:09reactormonkdom96, any idea whom to bug for the whole suggest stuff?
13:25:41*ingsoc quit (Quit: Leaving.)
13:26:36*OnO quit (Quit: Textual IRC Client: www.textualapp.com)
13:30:21dom96reactormonk: Araq I suppose
13:32:41giuliano108May I ask a question? Is there an equivalent of "select" for channels (TChannel)? Such a call would block until any of the channels is available for reading or writing.
13:33:32dom96giuliano108: Don't think so. But if that is something you would like to see then create an issue on Github for it, or a thread on the forum.
13:33:47dom96It might be easy enough to implement using a macro.
13:33:51*OnO joined #nim
13:34:11*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:49:04giuliano108dom96: thanks, I can maybe try to implement that myself
13:51:22*BitPuffin|osx joined #nim
14:06:04*banister joined #nim
14:07:05*pregressive joined #nim
14:10:12*yglukhov____ quit (Ping timeout: 256 seconds)
14:10:50*yglukhov____ joined #nim
14:15:16*Freedum joined #nim
14:17:32FreedumHello.. Could someone explain me that error : "test.nim(15, 2) Error: value of type 'int' has to be discarded" ? The line is s.recv(data, 1024) and I don't understand what discarded mean...
14:18:53def-Freedum: the recv proc returns an int value, namely how much data has been received
14:19:27def-Freedum: you should compare the return value to see if it's according to what you expect, or if you don't care, just write "discard s.recv(...)"
14:19:30emilspFreedum, and if you don't discard return values, you get errors
14:19:40emilspbecause you should never discard return values, really
14:19:44*JinShil quit (Quit: Konversation terminated!)
14:20:27*BlaXpirit joined #nim
14:20:38def-if you write a proc, and the result should be discardable, there's the {.discardable.} pragma
14:21:13bluenote_any ideas how to determine the size of a certain C type from within Nim? I expected this to work: {.emit: """ printf("Size of: %zu", sizeof(int)); """}
14:28:29*pregressive quit (Remote host closed the connection)
14:29:54bluenote_okay got it: emit is not wrapped in a function, so I had to define a function first...
14:33:14dom96you could just also do: echo(sizeof(cint))
14:34:54FreedumAlright, it works. Thanks
14:38:30*pregressive joined #nim
14:38:44*milosn joined #nim
14:43:02onionhammerVarriount nice! how far from a release are we?
14:44:27*darkf quit (Quit: Leaving)
14:46:11onionhammerVarriount doccontinue not working for me on mac actually
14:52:35*xcombelle quit (Quit: Leaving)
14:54:57bluenote_dom96: I was actually interested in the size of ptrdiff_t, which is probably not exported (no cptrdiff_t at least)
14:55:34dom96bluenote_: I see. In that case you probably would have had to wrap it.
15:03:15*pregressive quit (Remote host closed the connection)
15:15:52*jholland joined #nim
15:21:07*venuc joined #nim
15:24:24*Jesin joined #nim
15:24:53venuchi all, I am trying to build Nim on Mac OS X 10.5. Since I do not have clang installed, I modified the build.sh file to use GCC (i686-apple-darwin9-gcc-4.0.1). I am getting this error while running "sh build.sh"
15:24:56venucgcc -w -O3 -fno-strict-aliasing -Ic_code -c c_code/3_1/stdlib_net.c -o c_code/3_1/stdlib_net.o c_code/3_1/stdlib_net.c: In function 'bindaddr_514620': c_code/3_1/stdlib_net.c:355: error: 'u_int32_t' undeclared (first use in this function) c_code/3_1/stdlib_net.c:355: error: (Each undeclared identifier is reported only once c_code/3_1/stdlib_net.c:355: error: for each function it appears in.) c_code/3_1/stdlib_net.c:355: error: syntax error b
15:25:08venuccould someone please help?
15:29:38def-venuc: hm, that's strange. I don't know if we support such an old gcc version. just replacing clang with gcc may not work because nim may create compiler specific c code. and I remember the u_int problems from here: https://github.com/Araq/Nim/issues/1406
15:31:58def-venuc: I think some include might help for u_int32_t, but you may run into other problems
15:32:01def-https://stackoverflow.com/questions/5163835/what-is-u-int32-t
15:34:07*venuc quit (Ping timeout: 246 seconds)
15:39:43*vendethiel quit (Ping timeout: 255 seconds)
15:41:22Freedumhttps://github.com/nim-lang/c2nim Do I just need to run c2nim.nim to use it, or do I have to compile something ?
15:48:33onionhammervenucvenuc you should just install the os X command line tools
15:49:11onionhammeror homebrew
15:49:14*vendethiel joined #nim
15:51:41*gmpreussner|work joined #nim
15:59:46*banister quit (Read error: Connection reset by peer)
16:06:42*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:07:26*pregressive joined #nim
16:08:49*OnO quit (Ping timeout: 264 seconds)
16:12:11*vendethiel quit (Ping timeout: 256 seconds)
16:14:41*vendethiel joined #nim
16:17:15*TEttinger quit (Ping timeout: 272 seconds)
16:23:23def-Freedum: nimble install c2nim
16:30:06*yglukhov_____ joined #nim
16:30:52*drguildo joined #nim
16:31:19*pregressive quit (Remote host closed the connection)
16:31:30Freedumty def-
16:31:41drguildodoes anybody have any idea why the rot13 brainfuck example on http://howistart.org/posts/nim/1 would cause an OverflowError?
16:33:09*yglukhov____ quit (Ping timeout: 256 seconds)
16:34:42*yglukhov_____ quit (Ping timeout: 256 seconds)
16:35:08drguildohttp://pastie.org/10190682 is the output i get
16:36:16def-drguildo: Hi, I'm the author of that guide
16:36:25def-drguildo: https://github.com/howistart/howistart/pull/36/files
16:36:48drguildooh cool, hi
16:38:48def-drguildo: Now you have the chance to proof-read my pull request. Does it make sense?
16:39:17*ticktick left #nim ("gaylords")
16:39:55*bluenote_ quit (Ping timeout: 246 seconds)
16:40:32gmpreussner|workdef-: is DDrace written in Nim?
16:41:57drguildodef-: yeah, that makes sense. thanks.
16:42:01*Freedum quit (Ping timeout: 246 seconds)
16:42:02def-gmpreussner|work: unfortunately not, but I actually started using Nim to rewrite it in Nim, but got sidetracked by other things: http://hookrace.net/blog/what-is-hookrace/
16:43:19gmpreussner|worknice
16:45:49ldleworkgmpreussner|work: use your skills to lead the effort build standard metaverse technologies to lead us from web to verse with the anticipation of consumer vr techonlogy
16:46:14emilspldlework, wat
16:46:25*ldlework folds his arms.
16:46:52*giuliano208 joined #nim
16:47:01gmpreussner|workworking on it ^_^
16:47:09*ldlework falls over.
16:47:30*brson joined #nim
16:49:49*giuliano108 quit (Ping timeout: 245 seconds)
16:49:59gmpreussner|workwho maintains Nim syntax highlighting on GitHub?
16:50:09*def- quit (Ping timeout: 252 seconds)
16:50:30gmpreussner|workit's not working correctly... integer constant suffixes seem to be handled badly
16:51:11gmpreussner|worksee https://github.com/nimious/io-gles/blob/master/src/gles3/gl3.nim#L288
16:51:13BlaXpirityup, i had fun with that
16:51:21*giuliano208 quit (Ping timeout: 250 seconds)
16:52:37*brson quit (Quit: leaving)
16:53:26*pregressive joined #nim
16:59:13*brson joined #nim
17:03:29*Freedum joined #nim
17:11:04*dtscode joined #nim
17:12:47*Jehan_ joined #nim
17:13:52*gamesbrainiac joined #nim
17:16:37FreedumI know I can use httpclient to make GET and POST requests...but what about CONNECT, HEAD, HEAD, PUT, DELETE, TRACE... ?
17:21:34*def- joined #nim
17:23:01*vendethiel quit (Ping timeout: 256 seconds)
17:25:06Freedumdef-, I know I can use httpclient to make GET and POST requests...but what about CONNECT, HEAD, HEAD, PUT, DELETE, TRACE... ?
17:25:15*boopisaway is now known as boop
17:29:09dom96Freedum: yep http://nim-lang.org/docs/httpclient.html#HttpMethod
17:29:51def-gmpreussner|work: same problem in Vim iirc
17:30:58*gsingh93 joined #nim
17:35:10*Jesin quit (Quit: Leaving)
17:40:38*yglukhov_____ joined #nim
17:45:03*epichero joined #nim
17:50:40gmpreussner|workdef-: your 150 byte executable article is fantastic
17:52:07def-gmpreussner|work: thanks!
17:53:13def-I also had some more fun in that direction: https://github.com/def-/nim-small-coreutils
17:54:50FreedumThanks a lot def- !
17:55:06FreedumSorry, it was dom96 :-)
17:55:25*Freedum quit ()
18:03:25gamesbrainiacguys, is anyone considering working on an IntelliJ idea extension for nim?
18:03:55*Jesin joined #nim
18:05:52def-gamesbrainiac: haven't seen anything
18:06:07gamesbrainiacdef- I was considering it myself.
18:09:13dom96gamesbrainiac: I was considering working on one actually.
18:09:41gamesbrainiacdom96 I think it would be useful, I love the code completion it provides.
18:10:15gamesbrainiacdom96 I'll be at PyCon APAC 2015 soon, so I can ask some of the core devs if they're interested in supporting it.
18:10:32gamesbrainiacSince the golang plugin's success was in large part due to jetbrains help
18:10:48gamesbrainiac(api isn't all that well documented)
18:10:56dom96gamesbrainiac: That would be brilliant. Spread the word of Nim at PyCon :)
18:11:08gamesbrainiacdom96 Will do man!
18:13:15*elbow_ quit (Remote host closed the connection)
18:16:43*epichero quit ()
18:17:22*Perelandric joined #nim
18:21:26gmpreussner|workdef-: i just stumbled upon your NES emulator
18:21:30gmpreussner|workyou are full of awesome
18:22:32gmpreussner|worki've been wanting to write an Atari Lynx emulator in Nim. just don't have any time. might revisit now :)
18:23:45gmpreussner|worklove the 'op' template and how clean everything is
18:23:56Jehan_gamesbrainiac: I think it'd be a great idea, but, yeah, I've found the documentation to be largely impenetrable.
18:24:27gamesbrainiacJehan_ Join the club. I actually know some of the guys, and the often have to ask the person who wrote the damn api to know whats what
18:25:19gamesbrainiac...some of the guys (at jetbrains) ...
18:25:25*vendethiel joined #nim
18:31:35*MyMind quit (Quit: WeeChat 1.1.1)
18:34:30Jehan_gamesbrainiac: I had been thinking about adapting the Scala plugin, because it's pretty mature and writing Scala code would be a lot easier than Java, but the thing is huge.
18:34:43*boydgreenfield joined #nim
18:34:56Jehan_In the end, vim + tags still works best for me. :)
18:35:10Jehan_Especially since I often have to work on a server via ssh.
18:35:12gamesbrainiacJehan_ I probably want to do it in Kotlin. Problem with Scala is that you have to add a huge .jar file with every distro
18:35:27Jehan_gamesbrainiac: Eh, it's not so bad.
18:35:27boopis there something in nim that's like python's struct.pack?
18:35:40Jehan_And proguard can trim it down to a fairly reasonable size.
18:36:45*xcombelle joined #nim
18:37:06Jehan_boop: Umm … the concept doesn't really make as much sense in Nim.
18:37:25boophmm.
18:37:26Jehan_Since you can already declare a tuple or object with the appropriate byte layout.
18:37:27*deavmi joined #nim
18:37:29deavmiI love nim!
18:37:34deavmiLearning it as of today
18:37:38dtscodeMaybe I'm crazy, but I'm not finding a substr method in strutils. Am I right?
18:37:42deavmiAnd it is frikken awesome
18:37:45Jehan_And then just do copyMem etc. to access the byte representation.
18:37:48boopit's mostly for the endianness stuff
18:38:03boophow would i do pad null bytes in a packed object?
18:38:18deavmiAnybody know about any other small or different languages
18:38:44Jehan_dtscode: substr is in system.nim
18:39:08dtscodeJehan_: Thanks. Its been far too long since I've used nim :D
18:39:11Jehan_boop: Hmm, endianness makes sense. I hadn't thought of that.
18:39:34boopthe endian package is quite low level
18:39:42boopideally i could do something like this: 'struct.pack('!xcH5x{}sx'.format(len(msg) + 1), b'\x83', len(msg) + 7, six.b('?' + msg))'
18:40:46*boop unrolls the xyproblems
18:40:47dom96deavmi: That's nice to hear! Other programming languages off the top of my head: Crystal, Rust, Go, ooc.
18:40:49Jehan_boop: You could probably handle endianness using fieldPairs().
18:40:51booptrying to implement this
18:40:54boophttp://www.byond.com/forum/?post=276414#comment1156465
18:41:03boopi might be going at it the wrong way
18:42:12dom96boop: perhaps this is what you need https://github.com/akiradeveloper/msgpack-nim
18:42:55boopmessagepack is its own protocol
18:43:02boopi'm trying to interface with an existing protocol
18:44:31*deavmi quit (Ping timeout: 246 seconds)
18:45:29*fizzbooze joined #nim
18:45:31*gamesbrainiac quit (Quit: Bye folks!)
18:48:51Jehan_boop: Looking at the forum post, struct.pack seems to be overkill. just string.add() should suffice for this particular protocol.
18:49:10boopJehan_: and endianness?
18:49:42Jehan_boop: There's only a case of a two-byte integer being encoded.
18:50:07boopand a four byte float being decoded
18:50:17boopthat's another thing, unpacking. hm.
18:50:30Jehan_Oh, I didn't see that in the post.
18:50:41Jehan_Well, floats are easy, since they have a standard layout.
18:51:15Jehan_Just use a float32, get its addr(), cast to ptr array[0..3,char].
18:52:19def-gmpreussner|work: great to hear, thanks!
18:54:55*yglukhov_____ quit (Quit: Be back later ...)
19:02:04*deavmi joined #nim
19:03:30booplet msglen: uint16 = cast[uint16](htons(cast[int16](len(msg).uint16)))
19:03:34boop^ oh well, should work!
19:03:56*banister joined #nim
19:05:15fowlUsed endians module for reading/writing data, it was probably an abuse though
19:05:55*yglukhov_____ joined #nim
19:06:13*deavmi quit (Ping timeout: 246 seconds)
19:07:05*brson quit (Quit: leaving)
19:10:39*vendethiel quit (Ping timeout: 245 seconds)
19:15:55*yglukhov_____ quit (Quit: Be back later ...)
19:16:45boophmm
19:16:53boopcan i concat a string and a ptr array?
19:16:57boop[char]
19:21:39Jehan_boop: Here's a a simple module to do string encoding of int and float32 values: https://gist.github.com/rbehrends/02cfb062ec344a5002d5
19:22:55Jehan_Could probably use some tidying up, but it should be enough for your purposes.
19:23:13boopoohhh. that's great! thanks so much!
19:27:55*rinukkusu quit (Quit: ZNC - http://znc.in)
19:28:26*rinukkusu joined #nim
19:38:11*askatasuna joined #nim
19:39:41*boydgreenfield quit (Quit: boydgreenfield)
19:42:41boopJehan_: before you get too far away, do i have permission to use this in a MIT licensed thing?
19:43:31Jehan_Actually, let me just put CC0 on this.
19:43:42Jehan_This should make it even easier.
19:43:45boopthat works :)
19:46:31*vendethiel joined #nim
19:48:06Jehan_boop: Updated.
19:48:28*xcombelle quit (Remote host closed the connection)
19:48:53boopcheers!
19:49:15Jehan_I've also added float64 support while at it.
19:53:50*fizzbooze quit (Ping timeout: 252 seconds)
20:02:33*dom96_ joined #nim
20:05:10*drguildo left #nim (#nim)
20:05:12*Varriount quit (Ping timeout: 252 seconds)
20:07:54*Wicked joined #nim
20:08:06*filwit joined #nim
20:08:57*endragor quit (Ping timeout: 240 seconds)
20:10:34*pregressive quit (Remote host closed the connection)
20:13:12dtscodedoes writeFile append to the file or overwrite it?
20:13:23WickedMy errors must be blasphemous for an experimented Nimrider, but what's the problem with my code ? http://pastebin.com/1qZJ0MCn
20:13:40Araqdtscode: overwrite
20:14:13dtscodeAraq: Is there a method like writeFile that appends?
20:14:43*gsingh93 quit (Ping timeout: 256 seconds)
20:15:35dom96_dtscode: I think you need to open() the file with the correct flags.
20:15:54dtscodeDamn. Oh well.
20:17:22AraqWicked: google doesn't like bots?
20:17:42Araqyou need to set the user-agent at least
20:18:17filwitdtscode: not sure if you didn't get what dom96 meant, he meant do this: yourfile.open("...", fmAppend)
20:18:42dtscodefilwit: Yeah thats what I figured.
20:18:54filwitokay, just making sure :)
20:19:01WickedI don't think the problem comes from the user-agent or Google itself. Here's the error : http://pastebin.com/HGqYgCAS
20:19:23def-Wicked: nope, compilation failures don't come from Google
20:19:48WickedHa ha :D
20:19:57def-it means you're tryint to print a StringTableRef, but there is no stringification proc ($) defined
20:20:11def-print or otherwise make a string
20:21:33WickedOh ! The problem comes from echo(a).
20:23:42*Varriount joined #nim
20:24:25*pregressive joined #nim
20:25:10WickedAlso, is there a function to know the type of a variable ?
20:29:19def-Wicked: type()
20:30:25WickedThanks a lot.
20:31:15def-if you want to print them, import typetraits and use 3.type.name
20:32:32WickedAlright
20:37:18WickedHum, there's no such thing in documentation. How do I convert my Response body to a string ?
20:39:36Jehan_The simplest way to dump something to a string is using repr(x).
20:39:49Jehan_Which should work on pretty much anything, but isn't as pretty as $x.
20:41:17*boydgreenfield joined #nim
20:41:35WickedOkay, thanks!
20:48:51*giuliano108 joined #nim
20:50:09WickedI see that myResponse.status gives me "200 OK". I understand that this is the same thing that "200 Connection Etablished", but can I send it directly to my client ? Will his browser read "200 OK" like "200 Connection Etablished" ?
20:53:15dom96_Wicked: What are you trying to do?
20:55:44WickedSomething like a proxy. I already know how to make a web server, but I want to make a proxy server which is more difficult than just respond to a GET request by the same response.
20:56:49dom96_Wicked: Take a look at the docs for the Response object (what request() returns) http://nim-lang.org/docs/httpclient.html#Response
20:57:28VarriountWicked: Neat. How does a proxy actually work?
21:01:00WickedThe point is to read the HTTP request coming from a client, parse it to have the request type, the url to get and the HTTP version, then send the request on the specified host, get the response, and send the response to the client.
21:01:15Wicked[Varriount]
21:01:33*boydgreenfield quit (Quit: boydgreenfield)
21:01:38VarriountWicked: Ah, thanks.
21:03:47VarriountWicked: I expect that the '200 Ok' is the same as http status code 200
21:04:05VarriountActually, I'm puzzled as to why that's a string, and not an integer.
21:04:15*pregressive quit (Remote host closed the connection)
21:05:44WickedI know, but my question was to know if a web browser is able to understand that "200 OK" == "200 Connection Etablished".
21:08:18VarriountWicked: I believe the '200 Connection established' is separate? I'm looking at this: https://github.com/google/google-api-php-client/issues/117
21:08:50VarriountWicked: Also this: http://curl.haxx.se/mail/lib-2005-10/0023.html
21:09:25VarriountIt looks like the answer is 'it depends on the client'
21:10:22WickedSo, looks like that when there's at least "200" in the response it's good.
21:11:37*dvlwrk joined #nim
21:12:14dom96_Varriount: There is an enum for this.
21:12:31dom96_but httpclient doesn't use it I suppose
21:13:52Varriountdom96: In an ideal world, Nim would have a module with an api similar to that of the Python 'requests' module.
21:16:28*boydgreenfield joined #nim
21:21:46*brson joined #nim
21:24:55dom96_Varriount: Indeed. In an ideal world we would get paid to make the httpclient module awesome.
21:27:16*Wicked quit (Ping timeout: 246 seconds)
21:29:01boopasynchttpclient is a lot nicer on the API than httpclient
21:29:47*vendethiel quit (Ping timeout: 264 seconds)
21:31:50*saml quit (Quit: Leaving)
21:37:56*xender joined #nim
21:38:50*gsingh93 joined #nim
21:39:21xenderHi. Could you advise me some 2d graphics library for gamedev, with a nice API, that will work when compiled to C and JS (not necessarily by built-in JS backend, Emscriptening generated C is allowable too, if it's going to be better (I've seen that opinion on one blog))?
21:39:33xenderWill SFML or SDL2 work in those modes?
21:39:53*giuliano108 quit (Quit: leaving)
21:40:03*doomster joined #nim
21:40:13doomsterHi!
21:40:14xenderTargetting Linux + maybe Windows, MacOS + browsers via JS
21:40:30BlaXpiritxender, check out https://github.com/def-/nimes
21:41:21xenderBlaXpirit: Oh, yeah, the blog post I've seen was about this, thank you for reminding me. Will check out :)
21:42:18doomsterI'm looking for a way to determine the number of elements in a set[char]. len() doesn't seem to have an according overload, is there a special reason for this?
21:42:53BlaXpiritmaybe some semantic nonsense
21:43:15BlaXpiritdoomster, you're looking for `card`
21:43:43BlaXpirithow i found it: http://nim-lang.org/docs/system.html search for ": set"
21:43:47doomsterah, thanks BlaXpirit!
21:45:06*mrkishi joined #nim
21:47:41dom96_doomster: These docs are also useful: http://nim-lang.org/docs/manual.html#types-set-type
21:47:53dtscodeCan someone tell me why https://bpaste.net/show/bed5d38b92be doesn't append code to file?
21:47:59*gmpreussner|work quit (Ping timeout: 244 seconds)
21:48:54dom96_dtscode: you mean it just overwrites it?
21:49:18dtscodedom96_: No. The file is the same before running the program
21:49:42dom96_dtscode: So you never get to line 26 perhaps?
21:49:51Varriountdtscode: Buffering perhaps?
21:50:10dtscodedom96: No, because it prints True.
21:50:20dtscodeVarriount: Perhaps. Would I need to call flushFile?
21:50:25dom96_Ok. Then buffering is likely.
21:50:29dom96_You should close the file handle.
21:50:51dtscode/facepalm
21:51:13*gmpreussner|work joined #nim
21:51:19VarriountAlthough, shouldn't the OS normally close any open file handles when the program quits?
21:53:00dom96_yeah. I'm guessing dtscode's process didn't exit yet.
21:53:40dtscodeYeah it doesn't exit after writing to the file
21:55:19dtscodeOdd... It still doesn't write to the file.
21:56:16Varriountwhat happens when you write, instead of appending?
21:57:18dtscodeLet me see real quick
21:57:48*gmpreussner|work quit (Ping timeout: 244 seconds)
22:00:25dtscodeVarriount: Writing overwrites it, as expected
22:00:48VarriountWeird, so appending doesn't work..
22:01:06VarriountAFAIK, the stdlib uses the constants found in the C library.
22:01:33*BlaXpirit quit (Quit: Quit Konversation)
22:03:58Varriountdtscode: What OS are you using, and what C lib?
22:04:22dtscodeLinux Mint, gcc which I think is glibc
22:08:57*vendethiel joined #nim
22:09:16Varriountdtscode: Sorry if this exasperates you, but what happens when you test out a simple usage of append?
22:09:42dtscodeLet me see...
22:09:53VarriountUsing a simple 3 line script, appending works for me, although I'm on Windows...
22:12:19dtscodeA simple test does not work for me.
22:12:35*boydgreenfield quit (Quit: boydgreenfield)
22:13:24VarriountO_o
22:13:40Varriountdtscode: Stop scaring me.
22:13:58dtscodeNo joke
22:15:58Varriountdtscode: What does the C source look like? Can you see what (eventual) constant is being passed to open()?
22:16:38dtscodeLet me see
22:18:07Varriountdtscode: Here are the constants in the system source code: https://github.com/Araq/Nim/blob/8ddb58aecc6ddc4c7945258d55debd188c3b5692/lib/system/sysio.nim#L251
22:18:15*dvlwrk quit (Ping timeout: 272 seconds)
22:18:47dtscodeWait... I spoke too soon
22:18:50dtscodeIt did work
22:19:19Varriount?
22:19:29filwithmm.. can someone explain to me why the pointers in this simple gist are so far off? gist: https://gist.github.com/PhilipWitte/2d167c888f95e67f0292
22:19:57filwitnamely, why is the pointer addr to 'me' from the proc 'blah' so different than that of it's properties?
22:20:18dtscodeVarriount: The simple test worked.
22:21:02filwitI would have expected that and addr to a 'ptr object's member would basically be an offset from it's own, but that doesn't appear to be the case at all
22:21:32boopfilwit: i'm guessing the pointer is on the stack, stuff it points to is on the heap
22:21:34Varriountfilwit: Doesn't `addr me` give the address on the stack where the pointer resides?
22:22:10Varriount'give the address of the pointer pointing to GameObj data'
22:22:14filwitboop: that's gotta be it, of course.. i was thinking in reverse (the members where stack refs) but that makes sense
22:22:28filwitdamn..
22:22:35Varriountfilwit: Long day?
22:22:47filwitnah, just wasn't thinking this through enough
22:22:52*askatasuna quit (Quit: WeeChat 1.1.1)
22:22:53filwitmiddle of day for me
22:24:09*gsingh93 quit (Ping timeout: 244 seconds)
22:24:25filwitnevermind, it works actually if I put the 'w' var inside a seq (which is my actual use-case anyways
22:24:48filwitbut good to be aware of..
22:25:39Varriountfilwit: In case you don't already know, 'var' parameters are essentially pointers to the argument type on the stack.
22:26:39*boydgreenfield joined #nim
22:26:48filwitVarriount: thanks for the heads up.. I'm just exploring some ideas right now, but thanks for the heads up
22:30:36*gamesbrainiac joined #nim
22:31:27filwitcool it works!: https://gist.github.com/PhilipWitte/2d167c888f95e67f0292
22:31:47filwitcan adjust 'index' value of GameObj through reference to it's 'data' field
22:31:51*vendethiel quit (Ping timeout: 256 seconds)
22:32:17filwitdunno how safe all this is..
22:32:59Varriountfilwit: I'm sure Araq would be horrified at all the casting and pointer arithmatic
22:33:07filwiter.. the `.` macro is kinda pointless now..
22:34:13filwitVarriount: yeah.. and possibly for good reason.. I'm not sure exactly the implications of using 'ptr object' as a container for GCed data.. could just be unsafe all around (of course I could most likely manually register 'data' with the GC)
22:34:35Varriountfilwit: Why are you using a pointer?
22:35:20filwitwell initially I was just using 'ref object', but wasn't sure if ref-counting variables was going to get in the way of my pointer arithmetic
22:36:17filwitplus, if possible it would be nice to have the GC not scan my top-level list of data I tightly control anyways
22:36:27Varriountfilwit: I don't believe so, not unless you are doing arithmatic with references to the references, and those references are stored in sequences.
22:36:57Varriount(I'm not sure that made sense...)
22:37:06filwitam a bit confused, lol
22:37:35Varriountfilwit: Also, isn't that something of a premature optimization?
22:38:23filwitwell that part isn't a big concern, it's just I want to know how to do something like it if I want to.
22:38:36filwitthe GC scanning part I mean
22:40:25Varriountfilwit: Araq would be the one to ask about using pointer arithmatic with references.
22:40:30filwitmostly I'm looking for a way to pass around a user-defined type (aka, Ship) to user-defined functions (aka, blah) and still be able to manipulate GameObj properties tied to that instance (aka, 'index' which is used to enable/disable the object on multiple event lists)
22:40:46Varriountfilwit: Inheritance?
22:40:59filwitoh, i meant to right 'without inheritance'
22:41:14VarriountOr possibly, wrap the user defined type inside another type?
22:42:06*vendethiel joined #nim
22:42:09Varriountfilwit: You know that what your script does is the same as inheritance, right?
22:42:22filwityes
22:42:54filwitthere's a reason I'm trying to do this generically, but like I said, it's just an idea at this point
22:43:15filwitat the end of the day, Inheritance might just be the better option
22:43:43filwitanyways, do gotta work on other things now
22:43:54*pregressive joined #nim
22:45:15Jehan_filwit: The result of putting GCed references in an object allocated with alloc() and friends will result in those references not being scanned and (unless other references are there to keep them alive) the associated objects possibly being freed prematurely.
22:45:52Jehan_You can work around this by using GC_ref() and GC_unref() manually.
22:46:44Jehan_The Boehm GC also eliminates the issue, but … well, it's not really suited for video games.
22:48:34*pregressive quit (Ping timeout: 255 seconds)
22:52:26filwitJehan_: okay, thats what I was guessing. Thanks for confirming that.
22:54:13*boop is now known as boopisaway
22:58:50*boopisaway is now known as boop
23:00:49*brson quit (Read error: Connection reset by peer)
23:02:03*brson joined #nim
23:04:11VarriountGah, as much as I dislike PyCharm and IntelliJ for their memory usage, their refactoring capabilities are unmatched.
23:05:12*vendethiel quit (Ping timeout: 276 seconds)
23:05:40*brson quit (Client Quit)
23:07:10Jehan_Varriount: Heh. :)
23:07:15onionhammerVarriount release yet? :)
23:07:34Jehan_I have to say that I don't need refactoring capabilities very much.
23:07:57Jehan_Or rather, when I need them, they don't really do enough for what I need.
23:08:32Jehan_I have wondered whether a refactoring language might be a good solution.
23:09:08Jehan_I.e. a programming language that has basic refactoring commands and can apply them to a set of files.
23:09:51*milosn quit (Ping timeout: 265 seconds)
23:10:06*brson joined #nim
23:11:17*milosn joined #nim
23:12:38Varriountonionhammer: Since you primarily use ST3, I would appreciate it if you could test all the new commands and features.
23:12:47VarriountThen we can release.
23:14:35Varriountonionhammer: I just made a commit, so don't forget to check out the new revision
23:15:38onionhammerVarriount ok, i'm on a trip in tennessee right now, so I dont have a whole lot of time on my computer
23:15:47onionhammerare you on ST2 only?
23:16:48*vendethiel joined #nim
23:17:02onionhammerVarriount doccomments still dont work for me at least
23:19:22Varriountonionhammer: They aren't empty, are they?
23:19:49onionhammerno
23:26:49*gamesbrainiac quit (Quit: Bye folks!)
23:31:44*brson quit (Quit: leaving)
23:34:58*gmpreussner|work joined #nim