<< 05-07-2016 >>

00:02:35*GangstaCat joined #nim
00:07:38*der-landgraf joined #nim
00:09:45*kingofoz quit (Ping timeout: 276 seconds)
00:10:19*kingofoz joined #nim
00:17:39*Demon_Fox joined #nim
00:50:08*GangstaCat quit (Quit: Leaving)
01:00:25*ephja quit (Read error: Connection reset by peer)
01:01:03*ftsf_ joined #nim
01:17:03*der-landgraf quit (Ping timeout: 240 seconds)
01:23:13*der-landgraf joined #nim
01:29:10ftsf_good morning
01:29:50*chemist69_ joined #nim
01:30:47*der-landgraf quit (Ping timeout: 258 seconds)
01:32:52*yglukhov joined #nim
01:33:36*chemist69 quit (Ping timeout: 276 seconds)
01:37:03*yglukhov quit (Ping timeout: 240 seconds)
01:43:08theweirdn8#VickieRunsSmackdownLive
01:43:30theweirdn8ftsf_: i live in the civilized world where its still monday
01:44:22ftsf_theweirdn8, oh, which one is that?
01:54:01ftsf_i thought civilisation had crumbled over there
02:01:12theweirdn8ftsf_: its our birthday today
02:01:31*Jesin quit (Read error: Connection reset by peer)
02:02:18ftsf_happy birthday!
02:03:53*Jesin joined #nim
02:04:09theweirdn8USA! USA! USA!
02:04:13theweirdn8What country are you in?
02:04:38ftsf_AUS
02:05:01ftsf_we're currently trying to decide if we have a government or not
02:05:25theweirdn8Just join the EU from long distance
02:06:17*Jesin quit (Max SendQ exceeded)
02:07:21ftsf_yeah I hear they have a vacancy coming up
02:12:08*Jesin joined #nim
02:13:11*Jesin quit (Max SendQ exceeded)
02:14:46*Jesin joined #nim
02:17:51theweirdn8:-)
02:20:43*Jessin joined #nim
02:20:59*Jesin quit (Disconnected by services)
02:21:23*Jessin is now known as Jesin
02:54:52*yglukhov joined #nim
03:01:21*yglukhov quit (Ping timeout: 276 seconds)
03:03:09*theweirdn8 quit (Quit: Leaving.)
03:07:40*afrigginelf joined #nim
03:25:34*afrigginelf quit (Ping timeout: 250 seconds)
03:51:27*GangstaCat joined #nim
04:00:49*vendethiel joined #nim
04:03:55*akamaus joined #nim
04:09:40*vendethiel quit (Ping timeout: 252 seconds)
04:17:46*yglukhov joined #nim
04:21:55*yglukhov quit (Ping timeout: 244 seconds)
04:56:20*endragor joined #nim
05:19:37*s4 joined #nim
05:24:00*kssreeram joined #nim
05:34:49*kssreeram quit (Quit: My Mac has gone to sleep. ZZZzzz…)
05:53:43veganskHey guys, vote for Nim here http://www.slant.co/topics/101/~languages-that-compile-to-javascript.
06:07:39ftsf_=\ a popularity based "best"?
06:15:06*rlr joined #nim
06:17:06*endragor_ joined #nim
06:19:33*yglukhov joined #nim
06:20:58*endragor quit (Ping timeout: 258 seconds)
06:23:51*yglukhov quit (Ping timeout: 244 seconds)
06:30:23*der-landgraf joined #nim
06:32:28*der-landgraf quit (Excess Flood)
06:34:54*hendi__ joined #nim
06:34:55*der-landgraf joined #nim
06:36:23*endragor_ quit (Remote host closed the connection)
06:36:52*endragor joined #nim
06:56:02*Matthias247 joined #nim
06:58:31*akamaus quit (Ping timeout: 252 seconds)
07:06:43*bjz joined #nim
07:09:40*bjz_ joined #nim
07:11:48*bjz quit (Ping timeout: 246 seconds)
07:11:53*bjz__ joined #nim
07:14:35*Varriount quit (Read error: Connection reset by peer)
07:14:49*Varriount joined #nim
07:14:51*bjz_ quit (Ping timeout: 276 seconds)
07:17:33*huonw quit (Ping timeout: 240 seconds)
07:17:56*bjz__ quit (Ping timeout: 272 seconds)
07:19:47*huonw joined #nim
07:27:48*Satyajit quit (Quit: https://fnordserver.eu)
07:34:10*Matthias247 quit (Read error: Connection reset by peer)
07:38:49*Trustable joined #nim
07:40:38*yglukhov joined #nim
07:43:37*kssreeram joined #nim
07:45:24*yglukhov quit (Ping timeout: 276 seconds)
07:53:01*Demon_Fox quit (Quit: Leaving)
07:57:44*ftsf_ quit (Remote host closed the connection)
07:59:26*RGeisel joined #nim
08:00:08*RGeisel is now known as BratwurstMitSenf
08:09:00*pafmaf joined #nim
08:14:39*hendi__ quit (Ping timeout: 276 seconds)
08:17:20*euantor joined #nim
08:20:54*Satyajit joined #nim
08:24:49*der-landgraf quit (Quit: WeeChat 1.5)
08:26:15*der-landgraf joined #nim
08:35:15cheatfateAraq, is it easy to add option to compiler to replace stdlib files?
08:35:23cheatfateor it already present?
08:35:40Araqas I said, --lib
08:35:50Araqsets the library path
08:39:30*vendethiel joined #nim
08:39:34cheatfateyeah but i want to replace only one file, like asyncdispatch.nim (which used by asyncnet.nim, asynchttpserver.nim)
08:39:41cheatfatei dont want to replace whole library
08:40:29cheatfatei'm tired of my PRs to stdlib, so i think to create nimble package
08:42:27*yglukhov joined #nim
08:50:43*hendi__ joined #nim
08:56:34*bjz joined #nim
08:57:29cheatfateI have tested `--lib` and got `Error: cannot open system.nim' so its not very suitable to replace just only one file
09:02:28*vendethiel quit (Ping timeout: 244 seconds)
09:02:40*Matthias247 joined #nim
09:02:53euantorcheatfateL why not just fork the standard lib, clone it and replace your file in your fork
09:02:59euantorThen point --lib to the cloned fork?
09:03:30*gokr joined #nim
09:05:32*yglukhov_ joined #nim
09:05:48cheatfateeuantor, this is long story
09:06:17cheatfatemy files is working, but my pr will not be accepted
09:06:35cheatfateso i want to create nimble package
09:06:36euantorWhy not? If it works and fixes an issue, what's blocking the merge?
09:07:03*yglukhov quit (Ping timeout: 264 seconds)
09:08:25Araqcheatfate: yeah indeed, just continue to make PRs please
09:08:55Araqhave you tried the proc() iterator(): FutureBase unification?
09:09:28*GangstaCat quit (Quit: Leaving)
09:10:35cheatfateAraq, nope, because i'm not fully understand what is it
09:12:50cheatfateAraq, i have new version of ioselectors which is not in one file, how i must organize them?
09:12:57cheatfatefor PR?
09:14:17Araqjust have the files in an ioselectors subdir
09:32:50*euantor quit (Read error: Connection reset by peer)
09:35:55*Arrrr joined #nim
09:38:18*yglukhov_ quit (Remote host closed the connection)
09:50:22*yglukhov joined #nim
09:54:23*euantor joined #nim
09:54:42*yglukhov quit (Ping timeout: 250 seconds)
10:01:30*fastrom joined #nim
10:07:42*arnetheduck quit (Ping timeout: 250 seconds)
10:22:27*Flox42 quit (Remote host closed the connection)
10:22:28*M-max quit (Remote host closed the connection)
10:22:28*M-Quora quit (Read error: Connection reset by peer)
10:22:34*endragor quit (Remote host closed the connection)
10:25:08*endragor joined #nim
10:26:47*desophos quit (Read error: Connection reset by peer)
10:27:21*Flox42 joined #nim
10:27:26*vendethiel joined #nim
10:32:09*yglukhov joined #nim
10:41:51*theweirdn8 joined #nim
10:41:56*theweirdn8 quit (Client Quit)
10:42:36*theweirdn8 joined #nim
10:55:51*vendethiel quit (Ping timeout: 276 seconds)
11:15:32ftsfis there a way to do `when ProfilerEnabled:` ?
11:17:28Araqwhen defined(nimProfile) or something
11:17:32Araqgrep for it
11:18:26ftsfcheers =) `when defined(profiler):` seems to work
11:21:55kier_did anything happen with regard to https://github.com/nim-lang/Nim/pull/4367 ?
11:33:44Araqkier_: I think it's a compiler bug and I don't want more workarounds
11:33:53Araqbut if it's blocking you I can reconsider
11:39:03kier_Araq: ah okay. i'm not blocking on it. I'll separate the compiler bug into a separate issue
11:59:20derlafffhi guys. want to ask it again: echo 'import nre' > test.nim && nim c test.nim: lib/impure/nre.nim(246, 45) Error: undeclared identifier: 'Option'
11:59:27derlafffis it a bug or I do smth wrong?
12:01:49Arrrrdoes import options fix the issue?
12:02:00derlafffnope
12:02:23derlafffArrrr: 'import options, nre' fails too
12:05:16kier_derlafff: have you tried on the latest Nim version (the devel branch)?
12:05:43derlafffkier_: only 0.14.2
12:10:30*Arrrr quit (Read error: Connection reset by peer)
12:17:06derlafffkier_: the same with devel branch
12:17:08derlafffgit hash: 5f9da6b2ae137feb762c149ed5a7e0eb0f23a17d
12:17:34derlafffnow line is different: lib/impure/nre.nim(245, 45) Error: undeclared identifier: 'Option'
12:18:54ftsfhmm trying to figure out how cyclic imports work =\
12:19:04euantorI take it unix sockets aren't currently supported in the stdlib (with Named pipes on Windows being the counterpart)?
12:19:05ftsfI get "Error: type expected"
12:20:21*kssreeram quit (Ping timeout: 276 seconds)
12:24:39*M-Quora joined #nim
12:24:46*M-max joined #nim
12:25:09*EastByte quit (Read error: Connection reset by peer)
12:25:17*EastByte joined #nim
12:26:34ftsfcan I forward declare a type?
12:40:02Araqftsf: no, the workaround is to use subtyping
12:40:20Araqthere is a branch where cyclic imports are allowed, but it's still a long way from working
12:40:28ftsfsubtyping?
12:43:57Araqtype Foo = ref object of RootObj
12:44:02Araq# use Foo here.
12:44:08Araq# Later:
12:44:19Araqtype RealImpl = ref object of Foo
12:44:28jeffcSorry to ask a stupid question, but how does one go about building the manual?
12:44:34ftsfAraq, oh I see, I think
12:44:35ftsfI'll try it
12:44:45jeffcWant to check my changes before pushing documentation updates
12:44:54Araqkoch web
12:44:58jeffcawesome, thanks
12:46:03*Trustable quit (Ping timeout: 246 seconds)
12:47:10*michael_campbell joined #nim
12:47:12*Trustable joined #nim
12:53:41ftsfAraq, I saw your post about using a types.nim with all the types, is that still a recommended way to do things?
12:54:11AraqI still like it. it's honest.
12:54:31Araqif you have an interdependent mess, don't pretend you don't.
12:55:09ftsfok, cool. I'm now getting Car.nim(14, 60) Error: Error: ambiguous identifier: 'Car' --use .Car or types.Car however Car.nim no longer defines Car
12:55:27Araqthe module should be named cars.nim
12:55:44Araqand yeah, this error message is confusing :P
12:55:51ftsfoh ok
12:56:16*vendethiel joined #nim
13:01:33*endragor quit (Ping timeout: 258 seconds)
13:02:26ftsfohh that's weird.. car.nim(16, 6) Error: attempting to call undeclared routine: 'map=' proc newCar*(map: Map): Car = var car = new(Car); car.map = map
13:04:44ftsfwhich didn't occur before moving stuff to types.nim
13:07:37*endragor joined #nim
13:08:44*nsf quit (Quit: WeeChat 1.5)
13:11:09*saml joined #nim
13:20:15*vendethiel quit (Ping timeout: 264 seconds)
13:23:26Araqftsf: export fields via *
13:23:45ftsfoh of course, they're in a different module now
13:27:10*s4 quit (Quit: Konversation terminated!)
13:35:23ftsfhmm so you can't have a variable with the same name as a module you've imported
13:41:15*kssreeram joined #nim
13:49:34*PMunch joined #nim
13:53:57*ephja joined #nim
13:56:27Araqsurely you can, but you might need to disambiguate it
13:59:40ephjawhat symbols need sys/sysctl.h in cpuinfo?
14:01:05ephjaIt's archaic indeed. Is it really necessary to reference C files? What a nightmare it must be for everyone who is implementing similar things in other ecosystems
14:07:15ephjais this in case "constants" are changed at some point? which rarely happens in practice, right?
14:12:26*BratwurstMitSenf left #nim (#nim)
14:14:38ephjathough I can't see what it is that depends on it in this case. can't the sysctl function be used without referencing the header?
14:14:40*vendethiel joined #nim
14:21:00*akamaus joined #nim
14:21:17*pafmaf quit (Ping timeout: 258 seconds)
14:21:20Araqephja: I don't remember.
14:21:44*pafmaf joined #nim
14:24:03*maus joined #nim
14:26:56*akamaus quit (Ping timeout: 244 seconds)
14:37:28*vendethiel quit (Ping timeout: 272 seconds)
14:39:43michael_campbellre: var vs. module name - This seems like something a lot of people run into.
14:40:06michael_campbellI know I did, at least.
14:40:16michael_campbellAnd have seen it mentioned here a few times.
14:40:44ftsfI guess that's the problem with using global variables
14:43:33dom96I think the compiler needs to detect it and at least give a better error message.
14:43:53dom96because it is indeed a common problem
14:55:03*endragor quit (Ping timeout: 264 seconds)
14:56:56*vendethiel joined #nim
14:57:55jeffc(Different but related) Same goes for C source file and nim module. Gives a very strange message
15:08:24*PMunch quit (Quit: leaving)
15:09:51*nsf joined #nim
15:20:03*vendethiel quit (Ping timeout: 246 seconds)
15:29:49*euantor quit (Quit: Leaving)
15:32:11*theweirdn8 quit (Quit: Leaving.)
15:49:04*Matthias247 quit (Read error: Connection reset by peer)
15:51:43*kulelu88 joined #nim
15:54:30*PMunch joined #nim
16:01:57PMunchI'm having some trouble using the SDL compiled binaries with the SDL bindings
16:02:38PMunchI might be doing it wrong but it's complaining that the file SDL2/SDL_image.h doesn't exist
16:02:56PMunchWhich makes sense since it's a separate source
16:03:13AraqI usually use the wrappers which don't depend on fucking header files
16:03:25PMunchBut I can't figure out how to make them compile together in a way that the binding likes it..
16:03:37PMunchAraq, and which is that then?
16:03:52PMunchThis is the sdl2 binding from Nimble..
16:04:01Araqthe official SDL2 repo doesn't depend on the headers
16:04:18Araqor maybe I am an idiot and didn't notice.
16:04:41PMunchhttps://github.com/nim-lang/sdl2/blob/master/src/sdl2/image.nim
16:04:47PMunchI beg to differ, line 18
16:05:36Araqdon't define SDL_Static
16:05:41PMunchUsing the static since I'm compiling with the NDK for Android
16:05:45*J3RN left #nim ("WeeChat 1.5")
16:06:02Araqaha!
16:06:31Araqyou need to .passc: "-Ifoo" then
16:06:57*hendi__ quit (Ping timeout: 246 seconds)
16:08:21*theweirdn8 joined #nim
16:09:32*vendethiel joined #nim
16:09:35PMunchHmm
16:09:55PMunchIt doesn't seem to do that for the SDL stuff
16:13:43PMunchI might be going about this all wrong..
16:16:18*pafmaf quit (Ping timeout: 276 seconds)
16:25:33*yglukhov quit (Ping timeout: 250 seconds)
16:29:35*hendi__ joined #nim
16:30:06*_stowa joined #nim
16:32:33*vendethiel quit (Ping timeout: 276 seconds)
16:34:23*_stowa quit (K-Lined)
16:36:11*brson joined #nim
16:38:58PMunchOkay, I think I figured out something that works
16:39:53PMunchI looked in the C source generated for my file and noticed that SDL2 wasn't mentioned as an import, but SDL2/SDL_images was
16:41:15PMunchSo I modified the SDL2 wrapper to not output that and made sure that the Java code for the Android project was set to load the images library
16:41:33PMunchNow it compiles and installs fine
16:42:43dom96Araq: Maybe we should set this up for the Nim repo? https://lgtm.co/
16:43:21PMunchNot 100% sure if it works though since the loadTexture function returns null pointers but that is probably because I need to figure out how to do the paths on Android..
17:02:35Araqdom96: what's it about?
17:02:53dom96Araq: Doesn't the site provide enough of an explanation?
17:03:01*euantor joined #nim
17:06:32Araqno.
17:09:13dom96Take a look at the HN thread then https://news.ycombinator.com/item?id=12035346
17:13:54*euantor quit (Remote host closed the connection)
17:15:53*yglukhov joined #nim
17:17:54*vendethiel joined #nim
17:18:55*hendi__ quit (Ping timeout: 252 seconds)
17:25:06PMunchhttps://wiki.libsdl.org/SDL_GetBasePath
17:25:15PMunchWhere did that go in the SDL wrapper?
17:28:18*yglukhov quit (Remote host closed the connection)
17:32:06AraqPMunch: not required, use os.nim instead
17:32:56PMunchWell I tried to use currentDirectory and that gave me / on Android..
17:33:17PMunchThe SDL function might've done the same though..
17:33:23Araqos.getAppDir()
17:33:24cheatfatedom96, maybe useful for bitcoin developers
17:33:43cheatfatethey always have discussion about any pr :)
17:34:36*yglukhov joined #nim
17:39:00*vendethiel quit (Ping timeout: 246 seconds)
17:42:20PMunchAraq, that returns /system/bin
17:42:41Araqso your app is in /system/bin
17:42:48Araqmakes sense, doesn't it?
17:43:34PMunchI highly doubt that my Android app is installed in /system/bin
17:49:21*vendethiel joined #nim
17:57:49*euantor joined #nim
17:59:54*euantor quit (Client Quit)
18:02:01ephjadom96: maybe Aporia doesn't attempt to read the remaining output *after* the process has exited
18:06:41PMunchI'm having some weird issues with cpuTime
18:07:58PMunchI'm running it in a loop and accumulate the time until it goes over a certain threshold (based on FPS) and then let an animation go to it's next frame. But it's not working particularly well..
18:08:50PMunchI'm guessing it's because the time delta is so small the precision of the float is the issue?
18:09:06PMunchOr is cpuTime not doing what I think it's doing
18:12:57PMunchepochTime seems to do what I wanted
18:13:06ephjadom96: it seems like more like an issue with the thread communication
18:20:11*pafmaf joined #nim
18:22:11*vendethiel quit (Ping timeout: 240 seconds)
18:32:19*devn_ is now known as devn
18:34:56*vendethiel joined #nim
18:39:33federico3def-: nimfmt is pretty interesting
18:41:18*kssreeram quit (Quit: My Mac has gone to sleep. ZZZzzz…)
18:41:25ephjaneat
18:42:06federico3if only it wasn't stripping away newlines and comments :)
18:49:51ephjaD:
18:52:42*kulelu88 quit (Ping timeout: 272 seconds)
18:55:20*yglukhov quit (Remote host closed the connection)
19:02:51*kunev quit (Ping timeout: 250 seconds)
19:03:48*kunev joined #nim
19:04:32*arnetheduck joined #nim
19:06:53def-federico3: well, it just calls the compiler. next step would be to improve the compiler's renderTree output
19:07:46federico3def-: I'm thinking of writing my own unless you plan to working on it in the short term
19:12:22*maus_ joined #nim
19:12:23*kunev quit (Ping timeout: 250 seconds)
19:14:17*kunev joined #nim
19:15:31*maus quit (Ping timeout: 240 seconds)
19:16:06ephjaHave the Windows directory management and console APIs not been accounted for?
19:21:21def-federico3: go ahead
19:21:49ephjafederico3: all that effort wasted
19:21:58ephjaj/k
19:22:45federico3uh?
19:23:22AraqI still don't know why people want auto-formatting in an indentation based language...
19:23:38Araqcan anyone enlighten me?
19:24:28ephjax-space indentation to y-space indentation? :-P
19:25:12federico3well, it depends how in-depth you go with the formatting
19:25:13dom96Araq: Because people aren't using type sections
19:25:24Araqwhat?
19:25:40dom96or they put spaces before a ':' and after it
19:26:10ephjais it not a section if it only contains one type? but I know what you mean
19:27:01federico3having used gofmt in-line in an editor, the thing also save you some typing
19:27:19ephjait's not like you save that much typing, but it is indeed necessary with cyclical type dependencies
19:32:15ephjabut it might make code a little more readable
19:36:45ephjabut muh screen real estate :p
19:42:06*yglukhov joined #nim
19:59:13*freezerburnv joined #nim
20:00:11*fastrom quit (Quit: Leaving.)
20:01:12*kunev quit (Ping timeout: 276 seconds)
20:03:50*kunev joined #nim
20:03:58*yglukhov quit (Remote host closed the connection)
20:04:48*kulelu88 joined #nim
20:04:48*kulelu88 quit (Changing host)
20:04:48*kulelu88 joined #nim
20:09:57*yglukhov joined #nim
20:13:20*Matthias247 joined #nim
20:21:56*theweirdn8 quit (Quit: Leaving.)
20:39:22*yglukhov quit (Remote host closed the connection)
20:42:03*kunev quit (Ping timeout: 246 seconds)
20:42:54*kunev joined #nim
20:50:53*yglukhov joined #nim
21:03:44*freezerburnv quit (Ping timeout: 244 seconds)
21:04:24*theweirdn8 joined #nim
21:04:39*maus_ quit (Ping timeout: 264 seconds)
21:07:20*michael_campbell quit (Quit: Textual IRC Client: www.textualapp.com)
21:26:54*fastrom joined #nim
21:27:30PMunchyglukhov, you there?
21:27:55yglukhovPMunch: hey whats up!
21:28:25PMunchHi! I'm still fiddling with this SDL cross platform stuff
21:28:48PMunchGot everything running smoothly now with SDL2 and SDL image
21:29:18PMunchAnd started writing a small library of game related things
21:29:30yglukhovcool!
21:29:37PMunchBut I've run into an issue with opening files on Android
21:30:33PMunchI've written a small Texture atlas parser (only basic support so far) which works great on desktop
21:31:04PMunchBut when trying to run it on Android I only get a file not found exception when using the built in file operations.
21:31:39yglukhovdo you put your file in the assets?
21:31:42PMunchNot surprisingly as the files lives inside the APK, but I can't find a way to reference them..
21:31:50PMunchYes, the images loads fine
21:32:19yglukhovwell, images should not differ from other files in any way =)
21:32:29PMunchUsing the loadTexture function from SDL image
21:32:44PMunchI'm guessing it does some sort of wrapping..
21:32:50yglukhovyup
21:32:58yglukhovyou have to use rwops api
21:33:28yglukhovtake a look at resource.nim in nimx. pay attention to `when defined(android)` parts.
21:33:50ephjayglukhov: does nimx have support for running code inbetween main loop iterations?
21:33:54PMunchAh, thanks :)
21:35:41yglukhovephja: not really, but a pr to nimx allowing that would probably take no more than 10 mins of your time ;)
21:35:48yglukhovbut why would you need it?
21:37:34ldleworkyglukhov: 404 http://yglukhov.github.io/nimx/livedemo/main.html
21:38:01ldleworkalso, no DSL!?
21:38:15yglukhovldlework: yeah, just noticed as well... it breaks occationally =)
21:38:32yglukhovdsl? for what?
21:40:20ldleworkyglukhov: yes, because DSL's have never before been associated with GUI toolkits
21:40:27ldlework"the obvious thing"
21:40:56yglukhovyou mean the layout dsl?
21:41:15ldleworkis there one? I don't see it mentioned in the readme
21:41:32yglukhovno, there's no such thing yet.
21:41:45yglukhovim currently working on an editor though
21:41:53ephjayglukhov: well it's not the only way to run code periodically. timers might be what I need to use for communicating with threads
21:42:11yglukhovephja: nimx has got timers
21:42:16ldleworkyglukhov: hopefully your editor generates layout DSL :)
21:42:29yglukhovldlework: sorry, thats json =)
21:42:32ephjaI noticed that, and that's why I mentioned timers :p
21:42:39ldleworkyglukhov: ah that's sufficient
21:43:03ldleworkWe need an Urwid for Nim
21:44:27yglukhovyup, that would be really great. but i think, i've seen something of a kind in nim...
21:44:51ephjathere's termbox, but unfortunately only the 'go' library has windows support
21:46:20ephjathe termbox author said something like "I dunno why you would want to write such applications in C anyway". I guess he wasn't thinking about library writers
21:49:24PMunchAw man, this RWOps thing means I'll have to rewrite my line based loop..
21:49:46PMunchOr write the lines iterator for a RWops stream..
21:50:33ldleworkif a termbox/urwid ever shows up for nim I have some tools I will probably port from python
21:51:16yglukhovPMunch: in nimx, there's an rwops stream which wraps sdl rwops to nim stream.
21:51:23yglukhovjust use it already
21:51:25yglukhov=)
21:51:41ephjathere are termbox bindings
21:51:57ldleworkis termbox anywhere as nice as urwid?
21:52:03ephjanope
21:52:04ldleworkjust wondering, never used it
21:52:06ldleworkdoh
21:52:09PMunchBut that still won't work with the lines iterator
21:52:23ephjaI dunno if windows support could be bolted onto the termbox bindings
21:52:29yglukhovif lines works with nim streams, that it will
21:52:58yglukhov* then
21:54:55ephjayglukhov: why did you decide to roll your own widget toolkit?
21:55:40PMunchBut it doesn't
21:55:57PMunchOnly works with files and strings (which are then opened as a file)
21:56:14ephjastreams are nice
21:57:50PMunchFor many things
21:57:51yglukhovPMunch: anyway, it's almost a one-liner: iterator lines(s: Stream): string = var s: string; while s.readLine(s): yield s
21:57:57yglukhovthere you go =)
21:58:19PMunchOh, streams have a readLine. That changes everything :P
21:58:50yglukhovephja: coz its fun? =)
21:58:54*vendethiel quit (Ping timeout: 272 seconds)
22:00:03yglukhovok gotta go. see you guys.
22:00:13ephjaI just wanted to know if there were any practical reasons, but it's nice to have a high level library in any case
22:00:21ephjabb
22:00:31*yglukhov quit (Remote host closed the connection)
22:00:38ephjanimqml seems to be coming along nicely though
22:03:55*Demon_Fox joined #nim
22:12:39ephjaldlework: is tcod also too low level? I guess it doesn't really have widgets
22:17:17ephjaI don't know which approach to take. maybe I should try to port termbox-go
22:18:50dyce_hmm is there anyway to dump a table to json format?
22:19:08dyce_i have a seq of table[string,string]
22:19:17ldleworkephja: yeah tcod is just a render library
22:19:26ldleworkit just gives you a character based canvas
22:19:34ldleworkwith some roguelike features for line of sight and such
22:22:21*Trustable quit (Remote host closed the connection)
22:26:04Araqdyce_: hmmm json.nim should be able to json tables
22:29:16dyce_Araq: so i guess im looking for something like proc escapeJson , but works on any object. or do i need to build a json object from my sequence of tables?
22:29:18*vendethiel joined #nim
22:33:11Araqwhat does escapeJson have to do with anything?
22:36:06dyce_Araq: i am looking for something like python's json.dump https://docs.python.org/2.7/library/json.html (escapeJson seems close, but only works for a string)
22:37:03Araq*% macro?
22:39:00*fredrik92 joined #nim
22:40:22*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:45:09*bjz joined #nim
22:45:42dom96I think that `%` should handle this.
22:47:37dyce_hmm
22:47:54dyce_well on a sequence of strings, marshal's $$ does what i want
22:51:20*theweirdn8 quit (Quit: Leaving.)
22:52:06*vendethiel quit (Ping timeout: 272 seconds)
22:52:21dyce_https://glot.io/snippets/eg9z87axm3 but this doesnt work with a table
22:52:42dom96dyce_: just write a quick proc that does it for you :)
22:54:51dyce_dom96: hmm so with jester should i just be using JObject instead of table?
22:55:24dom96sure
22:57:41ephjadyce_: doesn't it? just that it generates a lot of data for tables for example
22:57:46ephjaIIRC
22:58:21dyce_ephja: it does, is there a way to suppress what is empty?
22:58:49ephjaso it gives you the whole structure, even thought it's not necessary in order to recreate it
22:58:59ephjahm don't think so, but I haven't used it much
22:59:07ephjabut I know it has a couple of limitations
23:09:12*pafmaf quit (Read error: Connection reset by peer)
23:11:21*PMunch quit (Quit: leaving)
23:12:19ephjaI don't know how close you can get to the same level of convenience while keeping only the essential data.
23:19:25dyce_ephja: i guess this will do https://glot.io/snippets/eg9zzbs7hl
23:20:31ephjaI guess, just that there's no need to generate json strings manually
23:22:04dyce_ephja: hmm what about for a json api?
23:22:13dyce_using jester
23:22:28*kulelu88 quit (Quit: Leaving)
23:23:00dyce_or would the better practice be to use jobject and other data structures that represent json
23:32:16ephjadyce_: you could use this if you want http://nim-lang.org/docs/json.html#add,JsonNode,string,JsonNode
23:32:22ephjahttp://nim-lang.org/docs/json.html#newJObject,
23:32:49*Jesin quit (Quit: Leaving)
23:32:59*pregressive joined #nim
23:36:37*Jesin joined #nim
23:40:20ephjaI think you just need to check if "toJson(foo.field1), toJson(foo.field2), ..." compiles
23:41:17ephjadoes the marshal mechanism always succeed? if so then it could even be used as a fallback. more data would be generated in some cases, but it would be convenient
23:42:58ephjaAraq: will getType work? can it replace the 'any' interface?
23:43:56*Matthias247 quit (Read error: Connection reset by peer)
23:47:59*GangstaCat joined #nim
23:51:04*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:53:14*bjz joined #nim