<< 27-02-2015 >>

00:15:12*infinity0 quit (Ping timeout: 246 seconds)
00:17:05*infinity0 joined #nim
00:17:26fowlAraq, this is pretty cool https://gist.github.com/fowlmouth/9c40de9a3700868a7419
00:19:04*qwr quit (Ping timeout: 265 seconds)
00:21:06Araqfowl: :D told ya
00:22:33def-got asynchttp 33% faster with some crude speedups: https://github.com/def-/nim-http-speedup#optimizing-standard-library
00:22:47*xkpe quit ()
00:24:32*qwr joined #nim
00:24:50*banister joined #nim
00:27:25Araqdef-: request.hostname.shallowCopy(address) # unsafe!
00:27:40def-i don't think that made any change anyway
00:27:43def-i was just trying everything
00:27:57Araqit's not just unsafe, it's wrong here
00:28:10Araqwhat if I pass a constant string to this?
00:28:58fowlAraq, did you tell me not to try variant types
00:29:42*iivvoo quit (Ping timeout: 276 seconds)
00:29:48Araqfowl: no I told you to try them
00:29:55*bretthart joined #nim
00:30:21fowli get an error lib\core\macros.nim(459, 26) Error: index out of bounds
00:30:55brettharthow do i return a cstring to my C function? right now when my C function calls my nim function and gets the cstring, it crashes with: "No stack traceback available
00:30:55bretthartSIGSEGV: Illegal storage access. (Try to compile with -d:useSysAssert -d:useGcAssert for details.)"
00:30:57fowloh thats from lisprepr, weird
00:30:58*iivvoo joined #nim
00:31:15dom96def-: awesome!
00:31:25brettharti am supposed to use GC_ref(mystring) before returning it?
00:33:47Araqbretthart: depends on what the C functions does with the cstring
00:33:57bretthartjust prints it
00:34:26Araqsounds more like a threading issue then
00:34:35brettharti'm not using threads
00:34:41Araqdoes the C stuff create threads behind your back?
00:34:48bretthartno
00:35:00bretthartits a very minimal hello world
00:35:18Araqdid you initialize Nim from C properly?
00:35:30brettharti call PreMain, and NimMain()
00:36:12dom96bretthart: How are you returning the cstring?
00:36:17dom96can we see your code?
00:36:20bretthartresult = mystring
00:36:32bretthartyes one sec
00:36:53dom96def-: Are the shallow calls significantly improving the performance or is it your other changes?
00:38:06def-dom96: the other ones
00:38:12def-the shallow things didn't do anything actually
00:38:31def-and i wouldn't call 30% significant. should be 100 or 200% faster
00:39:23flaviudef-: What code are you testing
00:39:39flaviuI've found that perf (linux) works great as a non-intrusive profiler.
00:39:44bretthartmy code is here
00:39:45brettharthttps://github.com/rusthon/Rusthon/blob/master/examples/hello_nim.md
00:40:03def-flaviu: this one: https://github.com/def-/nim-http-speedup/blob/master/asynchttpserver_hello.nim
00:41:14flaviudef-: How do you generate the requests?
00:41:29def-wrk -c 400 -d 10 -t 12 http://localhost:8080
00:42:43flaviuthanks!
00:43:06def-numbers are in the readme: https://github.com/def-/nim-http-speedup#nim-http-speedup
00:43:51Araqbretthart: try the GC_ref please but it should really work without
00:46:59def-bretthart: hm, i thought i did that once, but i resorted to array[1024, char]. now i'm wondering if i ran into the same problem as you do: https://github.com/def-/nim-unsorted/blob/master/anotherlang/query.nim
00:48:32flaviuhm, profiling is pretty much useless here as allocation is separate from collection.
00:49:59def-using the boehm gc helps quite a lot here. another 43% faster
00:50:38def-with boehm gc it's just as fast as go and cppsp with 1 thread
00:51:28Araqdef-: yeah but watch out
00:51:39Araqboehm uses parallelism
00:51:39*Demon_Fox joined #nim
00:51:54AraqI don't think that counts as "1 thread" then
00:52:20Araqbut maybe I'm wrong an Boehm doesn't use threads in your configuration?
00:52:37def-Araq: does it? i only see the program using exactly 100% cpu, so 1 core only
00:52:49def-and i don't see a boehm process anywhere
00:53:45*kniteli quit (Quit: Leaving)
00:54:06flaviuI see 4 threads, 3/4 have 1 second of cpu time, the other has 10 sec.
00:54:18flaviuI assume the thread with 10 sec is the GC thread.
00:54:31bretthartAraq, so in my nim code i simply do "GC_ref(mystring)" and then assign it to "result"?
00:54:54Araqno you GC_ref(result)
00:55:21bretthartok, thanks
00:57:09def-flaviu: how do you see them?
00:57:23flaviudef-: I set htop in tree mode.
00:58:50def-flaviu: still only 1 thread for me, strange
00:59:03def-oh, i compiled boehm without threads :P
00:59:31flaviuhttp://i.imgur.com/LBfBh7j.png
00:59:41bretthartAraq, is there a command line option to tell the compiler not to copy all the internal nim stuff in the generated output?
00:59:52def-but it's good to know that performance is so much better even without threads
01:00:32def-with threads it's actually worse for me
01:00:43Araqbretthart: -d:release helps when you wanna read the generated C code
01:00:57bretthartright now i merge stdlib_system.c and mynim.c into the same c file and compile it
01:01:30bretthartbecause i need to hack it and remove references to `dlopen`, `dlclose`, and `dlsym`
01:01:56brettharti have to do that because for some reason those symbols are undefined when i link to my final exe
01:02:10brettharteven if my final exe links do libdl
01:02:31Araqwhat OS?
01:02:37bretthartlinux
01:02:53flaviudef-: I haven't enabled threads either, this is my invocation command: nim c -r -d:release --debuginfo --linedir:on --gc:boehm test.nim
01:03:13def-flaviu: nono, i mean when I compiled boehm itself
01:03:32flaviuah, right. I guess my distro compiled it with threads.
01:03:43brettharti would rather use nim to compile my nim project, maybe nim could just have an option not to use libdl stuff because it seems like its not required.
01:03:56Araqbretthart: well usually dlopen etc are generated when they are required and not for the sake of it
01:03:59def-dom96: my bad, the shallow is significant after all, about 10% improvement
01:05:13bretthartthen maybe something in my build options is wrong and forcing libdl? --header --noMain --noLinking --compileOnly --genScript --app:staticlib
01:05:33bretthartmy nim program itself is just printing hello world
01:05:46*TEttinger joined #nim
01:06:31Araq--app:staticLib doesn't work with --noMain iirc
01:06:31bretthartor is it possible that having my function pragma as: {.cdecl, exportc.} forcing libdl?
01:07:01Araqno, but you need -d:release or --deadCodeElim:on to get rid of the crap
01:07:02*BlaXpirit quit (Quit: Quit Konversation)
01:09:07brettharthow do i build a staticlib without noMain? i thought that the staticlib is supposed to then be linked to a final program that defines a C main?
01:10:14*infinity0_ joined #nim
01:10:14*infinity0_ quit (Changing host)
01:10:14*infinity0_ joined #nim
01:10:14*infinity0 is now known as Guest99657
01:10:14*Guest99657 quit (Killed (cameron.freenode.net (Nickname regained by services)))
01:10:14*infinity0_ is now known as infinity0
01:19:43Araqyeah I dunno
01:20:11Araqreport it properly and I'll look at it properly ;-)
01:21:51fowlAraq, variant types work, but lispRepr fails on it
01:22:13Araqbtw your problems with Haxe might stem from the fact that it is a compiler, and not a transpiler ;-)
01:25:44TEttingeris someone using haxe with Nim?
01:25:48fowlAraq, i believe its the empty recList in the else branch (in ast it would have NilLit in it)
01:26:09Araqfowl: lispRepr is clearly bogus
01:26:23Araq add(result, lispRepr(n[0])) # without any check?
01:26:45Araqwhat if it's a statement list with 0 statements in it?
01:26:56fowlAraq, it would have an nnkEmpty in it
01:27:13Araqnot necessarily
01:27:22fowlor discard or something
01:27:27AraqI think that's just an artifact of lambda lifting
01:27:47fowlhow do you make a statement list with no statements?
01:28:02fowlfrom code i mean
01:28:10AraqnewStmtList() ?
01:28:12fowlfrom code i mean
01:28:19fowllike `foo: #`
01:28:46Araqoh you can't
01:28:58Araqbut lispRepr is for outputting any AST
01:30:48fowlnil lit would be more useful than an empty reclist ^^
01:39:09*reem quit (Remote host closed the connection)
01:40:31*reem joined #nim
01:57:11bretthartif i call GC_ref(onsomething) i always have to be sure to call GC_unref on it later?
02:00:38*brson quit (Ping timeout: 272 seconds)
02:04:51*chemist69_ joined #nim
02:06:34fowlbretthart, if you dont want leakage
02:07:05*infinity0 quit (Remote host closed the connection)
02:07:53*chemist69 quit (Ping timeout: 240 seconds)
02:08:20*darkf joined #nim
02:09:15fowlbretthart, my recommendation would be create a function that copies a string to a new cstring, return that and free it when you're done with it
02:18:20*whitenoise quit (Quit: Connection closed for inactivity)
03:00:54*reem quit (Remote host closed the connection)
03:06:25*reem joined #nim
03:07:01*gsingh93 quit (Ping timeout: 264 seconds)
03:17:46*saml_ joined #nim
03:21:45*gsingh93 joined #nim
03:24:50*reem quit (Remote host closed the connection)
03:42:04*qwr quit (Ping timeout: 265 seconds)
03:42:12*reem joined #nim
03:42:54def-I guess the results are good, have to clean this all up for a real PR: https://github.com/def-/nim-http-speedup#optimizing-standard-library
03:43:40*qwr joined #nim
03:43:56def-with these changes asynchttpserver is twice as fast as before
03:50:52*gsingh93 quit (Quit: WeeChat 1.1.1)
03:51:47*gsingh93 joined #nim
03:54:06flaviuI wonder if boehm is constantly faster than Nim's GC.
03:57:14fowlflaviu, i dont know about faster but it was noticeable a lot sooner than nims gc in my experience
04:07:08*aidanh quit (Ping timeout: 264 seconds)
04:11:13brettharthas anybody tried hooking into the JVM from nim using JNI?
04:11:47*aidanh joined #nim
04:14:22brettharthttp://rusthon-lang.blogspot.com/2015/02/nim-and-rusthon.html
04:14:47*reem quit (Remote host closed the connection)
04:15:45fowlcool
04:16:14fowlbretthart, no but jnis c api should be easy to wrap
04:16:24def-bretthart: https://github.com/zielmicha/nimrod-java and https://github.com/gradha/nimrod-on-android
04:18:17shevyhow do writing bindings (in C) in nim compare to python and ruby? e. g. ease of doing so (when we have comparable developers there, let's say 3 years of C and 3 years of said language)
04:19:41bretthartdef-, nimrod-java hasn't been updated in a year, any idea if it still works?
04:19:54def-no idea, i just googled for nim and jni
04:20:32def-shevy: bindings to C libraries are pretty easy in Nim I'd say
04:21:07*reem joined #nim
04:23:25fowlshevy, did you see hisham just uploaded gobolinux tools to github?
04:23:39fowlhttps://github.com/gobolinux
04:23:44shevyoh
04:23:47shevydid not see that
04:24:33shevywonder why he is doing that
04:27:12def-shevy: here's how to wrap a nice library for example: http://hookrace.net/blog/what-makes-nim-practical/#wrapping-libraries-with-c2nim
04:27:18fowlmore visibility than their svn i would guess
04:33:52*reem quit (Remote host closed the connection)
04:37:04*reem joined #nim
04:38:44*saml_ quit (Quit: Leaving)
04:39:23*shevy quit (Ping timeout: 252 seconds)
04:39:32*reem quit (Remote host closed the connection)
04:46:26*Jehan_ joined #nim
04:48:26*reem joined #nim
04:51:01*reem quit (Remote host closed the connection)
04:53:34*reem joined #nim
04:58:17*reem quit (Ping timeout: 252 seconds)
05:07:19*reem joined #nim
05:15:39*Jehan_ quit (Quit: Leaving)
05:24:40bretthartnew post on mixing nim, java and c++. http://rusthon-lang.blogspot.com/2015/02/nim-and-java-and-c.html
05:37:43*darkf_ joined #nim
05:39:48*darkf quit (Ping timeout: 244 seconds)
05:41:29fowllol
05:42:04fowlsomeone removed "as well as Android" from wikipedia "(Maybe iOS but not Android so far.)"
05:42:50*reem quit (Remote host closed the connection)
05:43:25*reem joined #nim
05:47:15Varriountbretthart: Is it something I should read? Or does it cast negative light on Nim?
05:47:30Varriountonionhammer: Sent out another big update to the refactoring branch.
05:49:30Triplefoxi looked at the post, it's short and hard to make sense of
05:50:08bretthartVarriount, there is nothing negative in the post, and in my first post first thing i say is "Nim is a new language with some very powerful features."
05:50:23Triplefoxi guess it's easier to grok from the sense of "using nim(and other languages)" from rusthon
05:54:52VarriountHm. The quote on the Nim manual's page is really resonating with me right now. (The one about complexity being transferable, but the amount remaining the same)
05:55:23VarriountI'm refactoring this code, and although I can make it easier to follow, I can't seem to make it any less complex.
05:57:48Varriountbretthart: Hm. I'm not sure that, just because the nim-java repo hasn't been updated, means that it's worthless.
05:58:38VarriountPossibly outdated and in need of a maintainer, but still salvageable.
05:59:25*reem quit (Remote host closed the connection)
06:00:47*reem joined #nim
06:05:08*bretthart quit (Ping timeout: 265 seconds)
06:08:39*darkf_ is now known as darkf
06:10:28*sillesta joined #nim
06:14:42*Menche quit (Quit: Leaving)
06:15:59reactormonkFavourite way to call subprocesses?
06:32:34*Jehan_ joined #nim
06:35:30*Jehan_ quit (Client Quit)
06:41:07*shevy joined #nim
06:46:42*bretthart joined #nim
06:48:38*gsingh93 quit (Ping timeout: 265 seconds)
06:59:30*reem quit (Remote host closed the connection)
07:07:48*kniteli joined #nim
07:09:27*reem joined #nim
07:10:51*Guest6923 quit (Read error: Connection reset by peer)
07:12:38*bjz joined #nim
07:15:40*Menche joined #nim
07:30:50*Jehan_ joined #nim
07:31:48*Jehan_ quit (Client Quit)
07:41:52*chemist69_ quit (Quit: WeeChat 1.1.1)
07:42:02*chemist69 joined #nim
07:56:08*Demon_Fox quit (Quit: Leaving)
07:57:15*johnsoft joined #nim
08:07:07*gokr joined #nim
08:08:04*pafmaf joined #nim
08:11:46*beier joined #nim
08:12:16*beier quit (Client Quit)
08:12:52*beier joined #nim
08:16:01*jazz_ joined #nim
08:16:25jazz_:beier hi
08:18:26*gmpreussner|work quit (Read error: Connection reset by peer)
08:18:42*gmpreussner|work joined #nim
08:20:30*reem quit (Remote host closed the connection)
08:26:57*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:30:09beierwhat does nim target ? system develop ? distributed develop ?
08:31:25*banister quit (Read error: Connection reset by peer)
08:31:48Araqbeier: my website says it's a "systems programming language"
08:34:15beierlike go language ? why reinvent the wheel ?
08:34:48*dyu joined #nim
08:35:14gokrbeier: Not the same language by far.
08:35:47aidanhbeier: Nim is much closer to Python or Ruby (except compiled)
08:36:20gokrFurther, in my personal opinion I do think Nim is more general purpose than typical "systems programming languages" - but it may be due to different views on what that entails.
08:36:39gokrAnd good morning btw ;)
08:39:30beiermorning, but it's afternoon at asia :(
08:39:54gokrThere is always morning somewhere! :)
08:42:09beierare there some project develop using nim ?
08:42:55*jazz_ quit (Quit: Page closed)
08:43:54aidanhbeier: I'm using Nim to do the matasano crypto challenges, although I don't know if that qualifies as a project
08:44:23*BlaXpirit joined #nim
08:47:03gokrbeier: What's your domain of interest?
08:48:36beierdistributed development
08:49:29beierI'm intersting in big data processing
08:49:49gokrOk, on what level? Hacking your own or using some dbs/frameworks for that?
08:50:18beierbefore I use akka
08:50:50gokrNim has quite nice networking modules, using the newer more modern APIs on the various OSes, it has async networking stuff. Also, it can very easily wrap C/C++ libraries.
08:52:39gokrAFAIK we don't have higher level networking frameworks like Akka (although I am unsure), except for wrappers of ZeroMQ etc
08:53:01*sepisoad joined #nim
08:56:40*reem joined #nim
08:56:45beierIt's say nim is a member of c platfrom and is another compile frontend.
08:57:55beierlike scala to java platfrom ?
08:57:56gokrWell, Nim can compile via C or C++ (and js but.. I think that's more experimental) but the language is very far from those languages. It does however mean Nim gets many benefits from the C ecosystem.
08:58:32gokrSo yes, interoperating with C and C++ is very easy. And the performance of Nim is similar to C/C++.
09:03:18*reem quit (Remote host closed the connection)
09:06:43*pafmaf quit (Quit: This computer has gone to sleep)
09:06:48*reem joined #nim
09:08:26*tumult joined #nim
09:09:53*BlaXpirit quit (Quit: Quit Konversation)
09:11:42*BlaXpirit joined #nim
09:31:37*tumult_ joined #nim
09:31:52*tumult quit (Ping timeout: 246 seconds)
09:35:20*reem quit (Remote host closed the connection)
09:36:47*reem joined #nim
09:38:15*bretthart quit (Ping timeout: 250 seconds)
09:41:07*bretthart joined #nim
09:46:41*reem quit (Remote host closed the connection)
09:46:57*Trustable joined #nim
09:47:28dyuI just built nim on freebsd (thanks to http://forum.nim-lang.org/t/936, PR: https://github.com/Araq/Nim/pull/2225)
09:48:33*reem joined #nim
09:49:44*reem quit (Remote host closed the connection)
09:52:32TEttingerwoo dyu
09:52:47*bretthart quit (Ping timeout: 265 seconds)
09:53:11TEttingernow you have to maintain it, since no one else uses BSD with Nim yet!
09:53:25def-TEttinger: not true, there is wtw as well
09:53:32*Jehan_ joined #nim
10:06:20*pafmaf joined #nim
10:08:46*bjz joined #nim
10:12:42dyuTettinger: I use nim on linux (which depends on c libs with no freebsd ports) ... just wanted to play with nim on my freenas box
10:20:28*beier quit (Ping timeout: 256 seconds)
10:31:37*TEttinger quit (Ping timeout: 264 seconds)
10:41:02*dyu quit (Quit: Leaving)
10:46:46*bretthart joined #nim
11:14:56*bretthart quit (Remote host closed the connection)
11:16:25*beier joined #nim
11:21:46*beier quit (Ping timeout: 272 seconds)
12:13:55*pafmaf quit (Quit: This computer has gone to sleep)
12:47:30*beier joined #nim
12:52:15*beier quit (Ping timeout: 244 seconds)
13:22:10*Jehan_ quit (Quit: Leaving)
13:33:48*pafmaf joined #nim
13:49:28onionhammerVarriount great when are u going to merge? :)
14:20:01*mpthrapp joined #nim
14:21:22*darkf quit (Quit: Leaving)
14:36:16*beier joined #nim
14:41:13*beier quit (Ping timeout: 255 seconds)
14:47:57*BlaXpirit_ joined #nim
14:51:24*BlaXpirit quit (Ping timeout: 272 seconds)
14:56:29AraqOderWat: " If he could do this impressive demonstrations while being that nervous, he can do this compiler anyway!"
14:56:34Araqhey
14:56:51Araqthey told me after 10 minutes there are only 5 minutes left
14:57:09OderWatHehe. I think you where great!
14:57:13AraqI was at slide 10 or something
14:57:41Araqand I was like "wtf? I will do all of this, I was promised 35 minutes of time"
14:59:34OderWatThey should have given you 90. There is so much "less interesting" stuff where people can talk all day.
15:01:43OderWatBut really. I think that standing there after developing for years and showing off highly opinionated and specialized stuff (it is isn't it?) needs a lot of self esteem. I don't know you but that was just my impression.
15:04:05BlaXpirit_umm what am i missing here
15:05:10Araqwell I expected the audience to know everything already so I focussed on stuff which is not as known
15:05:22BlaXpirit_any video?
15:09:30OderWatTalk by Araq here: http://www.infoq.com/presentations/nimrod (nothing new probably)
15:11:15tumult_^ cheers :)
15:24:10*dyu joined #nim
15:25:40*saml quit (Quit: Leaving)
15:32:09*saml joined #nim
15:33:55*saml quit (Client Quit)
15:34:21*saml joined #nim
15:35:21*saml quit (Remote host closed the connection)
15:40:22*saml joined #nim
15:55:31*pregressive joined #nim
15:57:28*pafmaf quit (Quit: This computer has gone to sleep)
16:15:30*beier joined #nim
16:18:15*sillesta quit (Ping timeout: 252 seconds)
16:20:26*beier quit (Ping timeout: 246 seconds)
16:29:38*sillesta joined #nim
16:37:09*gsingh93 joined #nim
17:03:20gmpreussner|workAraq: great presentation
17:03:43Araqthanks :-)
17:04:23mpthrappHow do I serve static pages with Jester? Eg. I want to do resp "path/to/file.html" and have that render.
17:04:35onionhammerput it in the public/ folder
17:04:48mpthrappI have it in public/root/
17:05:18onionhammeryou have what in public/root/
17:05:57mpthrappMy static HTML file that I want jester to serve as the response to get "/"
17:06:45onionhammerso... you're trying to map "/" to a static file?
17:07:06onionhammerif you're rewriting the path to the static file then it's not static anymore
17:07:22onionhammeryou'll have to handle it in code or in config if you're using a web server like nginx
17:07:33mpthrapponionhammer: I may be misunderstanding stuff then, I don't have a ton of experience with web stuff.
17:07:39onionhammernp
17:07:45*Etheco- quit (Read error: Connection reset by peer)
17:08:05onionhammerso if you put "something.html" in public/, you would hit localhost:{PORT}/something.html
17:08:08onionhammerand it should serve that file
17:08:10*pafmaf joined #nim
17:08:25mpthrappAhhhh, okay.
17:08:38onionhammerif you want localhost:{PORT}/ to map to something.html you need to redirect to it or you need to serve it from code by reading the file and writing it to the http response
17:08:52mpthrappAlright, that makes sense.
17:09:14mpthrappCan I do a redirect right in jester? Or do I need to do it through nginx?
17:09:23onionhammerpersonally i would recommend just using a web server like apache or nginx to serve your static content
17:09:50onionhammerthen you just do a rule for whatever your path is to the actual file
17:09:56mpthrappOkay. I'm really just doing this as a way to learn nim/the web.
17:10:04onionhammerok
17:10:32onionhammeryeah if its just learning then dont bother with nginx probably:)
17:10:38mpthrappI've pretty much just done enterprisey utility apps so far.
17:11:05mpthrappAnd while I do actually enjoy it, I figure I should probably have at least a basic understanding of how the web works. :P
17:19:39mpthrappAlright, one more question. What module should I be looking at to do file io?
17:19:59mpthrappI'm looking at the streams module, I'm just not sure if that's the right way to do things?
17:20:58Araqstreams work, so does the stuff in system.nim
17:21:34Araqas a rule of thumb: if you care about stdin and stdout, use system.nim, else use streams
17:21:49mpthrappAlright, cool, thanks!
17:31:43*tumult_ quit (Ping timeout: 246 seconds)
17:36:32*pafmaf quit (Quit: This computer has gone to sleep)
17:44:28emilspmpthrapp, just load the file as a string and return it as a response
17:44:43mpthrappemilsp: Yeah, that's what I'm doing now.
17:45:07emilspis that bad ? or do you want it to redirect '/' to '/home.html' ? if yes, then why ?
17:45:16*BlaXpirit_ quit (Quit: Quit Konversation)
17:45:56emilspof course, you could have a directory static/ and put all the 'static' stuff in there, then enumerate them before you start jester and add them as responses.
17:45:57mpthrappNo, that's exactly what I wanted. I wanted a way to change what's being returned to / without recompiling for testing purposes.
17:46:28mpthrappSo reading the html from a file and returning it is exactly what I needed.
17:47:29*zahary joined #nim
17:47:29emilspok then :)
17:48:42*BlaXpirit joined #nim
17:48:44mpthrappNow I just have to figure out the JSON module. :/
17:49:34emilspit's a bit of a pain, but to get values out of it, you have to load the json data and then access it by json_obj[key].num or .str or .fnum
17:49:56mpthrappActually I'm trying to do it the other way around. I want to build a JSON response.
17:50:01emilspI was dealing with the same things last weekend
17:50:26mpthrappI get how to create nodes, I'm just not sure what the overall object should be.
17:50:47*dumdum joined #nim
17:51:24emilspisn't it just a toplevel node holding lower nodes ?
17:51:44mpthrappMaybe? I've never really built JSON in any language before.
17:52:05emilspwell, do experiment then. I can't say I'm a json expert by any means either.
17:53:23*brson joined #nim
17:53:57mpthrappYeah, I'm basically just throwing things at the wall and seeing what sticks. :P
17:54:39emilspbasically newJObject() will create an empty object and you can add key value pairs to that.
17:55:06mpthrappThat's what I'm doing now.
17:55:14emilspis it working ?
17:55:16mpthrappYeah.
17:55:20emilsphurray
17:55:34mpthrappNow to figure out how to get jester to return JSON without flattening it.
17:57:04*Matthias247 joined #nim
17:57:56*pafmaf joined #nim
17:57:57mpthrappHurray for .pretty!
18:01:09shevyHurray for .cookies!
18:01:52emilspIf I want to write a secure web service, I'll be bound to using nginx to deal with ssl, right ?
18:03:16onionhammeryou can use https with nim, but you have to enable it w/ a compiler flag
18:03:28onionhammer-d:ssl
18:03:48onionhammeryou're better off using nginx reverse proxy though
18:04:05emilspok, is jester multithreaded ? And why am I better off using nginx's reverse proxy ?
18:04:16*beier joined #nim
18:04:43onionhammerno i dont think jester is multithreaded
18:04:57emilspso it is bound to a single request at a time, right ?
18:05:20onionhammerno it uses non-blocking socket IO operations
18:05:59emilspso if I'm serving a massive file on one request, it would still be able to take other requests ?
18:06:29onionhammeryeah, depending on how you served the massive file
18:07:05emilspwell, I'd intend not to divide it up into little chunks
18:08:13onionhammerjust avoid blocking the thread
18:08:53emilspso I'd have to use nonblocking io on my end as well, right ?
18:09:02*beier quit (Ping timeout: 245 seconds)
18:09:27onionhammerif you're using jester? it might be abstracted away for u
18:09:39emilspok, thank you very much.
18:09:45onionhammeris there a 'sendfile' method or something?
18:11:55onionhammeranyway, nginx is probably going to be a lot smarter/better optimized at serving static files
18:12:42onionhammerit'll also spawn multiple processes
18:12:43mpthrappSpeaking of jester, is there a way to return JSON without doing .pretty? Or does it even matter? Will the receiving client still interpret it as JSON?
18:13:05onionhammerthe whitespace doesnt matter to the interpreter, only to humans reading the json
18:13:56mpthrappOkay, that makes sense. So, as long as I set content-type, the bits themselves don't matter?
18:14:27onionhammeri mean, they do matter, it still has to be valid json :)
18:14:50mpthrappWell, yeah. :P But it doesn't matter if Nim converts it to a string before it responds with it.
18:15:52onionhammeroh
18:15:56onionhammeri see what you're asking
18:16:30onionhammeryou still have to convert it to a string because I doubt jester or whatever http server you're using supports JsonNode objects
18:16:49onionhammerunless there's a converter
18:17:09onionhammeryou should juse use '$'
18:17:12onionhammernot .pretty()
18:17:32mpthrappI tried using $, but it says I don't have enough arguments.
18:17:33onionhammer.pretty() = human readable, $ is the 'tostring' operator
18:17:41onionhammerhow are you invoking it
18:17:49mpthrappresp $json
18:17:56onionhammertry resp($json)
18:18:05mpthrappOkay, thanks.
18:18:16onionhammerand dont name ur variable 'json', name it something else in case it's conflicting w/ the module name
18:18:27mpthrappThat is a really good point.
18:19:11mpthrappYup, that did it.
18:19:52onionhammeryeah, sometimes nim has problems w/ that ambiguity
18:19:54*matkuki joined #nim
18:20:32mpthrappI mean, it's a hard problem. I'm not sure any language has really solved it.
18:21:08onionhammeri think araqs idea is to make whitespace significant to operator precedence
18:21:17mpthrappInteresting.
18:21:27onionhammerhe's gotten a lot of pushback on that though
18:21:44onionhammerpeople dont like the idea of 4+4 / 2 being different from 4 + 4/2
18:21:45OderWatjust to mention it: jester currently has no support for any caching of static files
18:22:43mpthrapponionhammer: Yeah, that seems like it could be a little frusterating.
18:23:03OderWatat least not with its supplemented static route so nginx (or apache2 which i prefer) will help with that too
18:23:19onionhammernginx > apache :P
18:24:32OderWatmay be but I have apache running everywhere and only occasionally need a reverse proxy for some stuff like ghost
18:27:18mpthrappYay, finished my hello world as a service. :P AKA, learning Nim.
18:28:46*BlaXpirit quit (Quit: Quit Konversation)
18:30:30*BlaXpirit joined #nim
18:33:46emilsponionhammer, how does nim handle namespaces ?
18:34:17emilspoh, I remember, if I get a clash, I have to use the 'full path' with the import
18:38:27*Matthias247 quit (Read error: Connection reset by peer)
18:41:40onionhammeryou mean import from cpp?
18:42:26emilspnono, I was thinking out loud, sorry about that.
19:01:05Araqonionhammer: we can make resp $foo work without full blown "strong spaces".
19:01:43Araqbut I still think resp (1, 2) should then mean "pass tuple to resp" and this will break code
19:01:57Araqlots of code.
19:04:18emilspAraq, please, don't introduce 'significant' significant whitespace.
19:04:56Araqemilsp: and yet we have more problems *without* it
19:13:03*superfunc joined #nim
19:13:10*filwit joined #nim
19:13:48filwitflaviu: just got your memo about the website background image. Nice job on fixing it, has that been uploaded to the web?
19:14:15Trixar_zaHey Araq, is there a clever way around the floating point base 2 conversion issue?
19:14:49AraqTrixar_za: use bignums? use the new rationals module?
19:15:33Trixar_zaRationals module?
19:17:11def-Trixar_za: fresh in devel: https://github.com/Araq/Nim/blob/devel/lib/pure/rationals.nim
19:17:42Araqdef-: btw I would rename these to Rat[T], but that's just me
19:18:16def-Araq: just for brevity or any deeper reason?
19:18:39Araqfor brevity
19:18:39def-When I read "Rat" I wouldn't think of rational number immediately
19:18:50AraqI think it's common in math
19:18:59emilsprats are rational, mmkay ?
19:21:07onionhammerew definitely dont rename it to Rat[T] :P
19:21:40def-i just don't like that you have to write "initRational" now instead of just having a tuple
19:22:02onionhammeri hate init procs :)
19:22:39onionhammerit would be great if nim had a way of restricting construction of a type to the module (e.g. internal constructor) araq
19:23:32*mpthrapp quit (Remote host closed the connection)
19:23:34Araqyeah initRational sucks
19:24:11Araqit's like a punishment for using rational numbers
19:24:30Araqdef-: the tuple was weird too though
19:24:32Araqwhat about
19:24:46Araqproc `//` (a, b: T): Rational[T]
19:24:53Araq1//7 + 4//6
19:25:24Araqnow that's a rational number
19:26:05def-Yes, something like this would be nice
19:26:28def-not sure if // is that obvious
19:26:53Araqmaybe 1 /. 3
19:27:06Araqunfortunately / already means divison
19:27:21*mpthrapp joined #nim
19:28:27*superfunc quit (Ping timeout: 250 seconds)
19:28:53*JodaZ joined #nim
19:29:06JodaZhow does nims garbage collector work?
19:29:25onionhammerhttp://nim-lang.org/gc.html
19:31:15JodaZ:/
19:31:32JodaZok, so its not actually optional if you really want to use nim
19:33:51*reem joined #nim
19:34:14BlaXpiritkinda
19:34:23AraqJodaZ: *shrug* I have stopped thinking about that question. *I* can use Nim without GC and its GC has obviously been written in the GC-less subset. But then I can also write C without using strlen() everywhere.
19:35:59*pafmaf quit (Quit: This computer has gone to sleep)
19:37:01Araqbut I can also use its GC in a realtime setting and call it a day
19:41:54mpthrappThis might be a crazy person thing to do, but is there a library to interface with MSSQL?
19:42:10*JodaZ left #nim (#nim)
19:47:18Demosmpthrapp, you /can/ use COM API fairly easily
19:47:39Demosyou can wrap the CINTERFACE version or use the string based way of calling things
19:47:44mpthrappThat is a really good point.
19:47:54*Menche quit (Quit: Leaving)
19:48:08Demos(I don't know the string based way, but I have wrapped Direct3D and it was way easier than I thought it would be)
19:48:59DemosI have wrappers for some of the required COM stuff
19:49:41Demosdirectnimrod is in nimble
19:50:27DemosOK yeah I did not even bother to wrap IUnknown.h or any of that stuff
19:50:36DemosI think some of that is actually in windows.nim
19:51:08Demoshttps://bitbucket.org/barcharcraz/directnimrod/src/05adb989d8f961ddcfc43c5f05aa9ea4b27ce14c/src/d3d11.nim?at=master
19:51:14Demosthat is the main d3d11.h wrapper
19:51:23Demosand there may be a premade library to do it
19:51:31Demosalready in nimble
19:53:02*beier joined #nim
19:57:55*beier quit (Ping timeout: 250 seconds)
19:59:52*gokr_ joined #nim
20:02:38*reem quit (Remote host closed the connection)
20:03:20*reem joined #nim
20:06:33*reem quit (Remote host closed the connection)
20:18:59filwitgokr_: btw, I added your blog's code colors to my recent Aporia PR, but I didn't know if they came from a common color-scheme, so I just named it "EggShell" with a description "Colors from Gokr's blog"... if you have a more official name for them I would like to know.
20:20:16*mrkishi joined #nim
20:20:27gokr_oh... its actually what I get when I use "nimrod" in code blocks in octopress
20:21:04gokr_i can look it up, on phone now
20:21:08*sepisoad quit (Quit: Leaving)
20:21:46filwitgokr_: okay, thanks. No rush or anything, just wanted to give credit to the original theme
20:24:13matkukiCan someone tell me why a call to a proc/method of a type has less overhead when calling "myproc(mytype, myparameter)" than "mytype.myproc(myparameter)"?
20:26:06Araqmatkuki: because an indirect call is slower than a direct call?
20:26:23matkukiAraq: Can't the compiler make these equal? I don't know much about compilers, so please be gentle.
20:27:11filwitmatkuki: those should be identical (unless you're talking about proc vs method). Can you expand a little on how you've reached that conclusion?
20:27:30Araqfilwit: he stores the proc in the object as a field
20:27:53filwitAraq: ah, okay i see
20:28:16Araqmatkuki: you can do:
20:28:29Araqobj.myproc = someOtherProc
20:28:38Araqyou can redefine it at runtime
20:28:50Araqand so the compiler's optimizer has a hard time
20:29:24Araqsometimes gcc can optimize the overhead away, but often it can't
20:31:02*onionhammer quit (Quit: WeeChat 1.0.1)
20:31:02matkukiThanks. But I'm a little confused about the object field thing. Let me give you some code, just a minute...
20:31:20*onionhammer joined #nim
20:36:15TriplefoxShould I be worried if I've taken to making the . syntax my default?
20:36:48AraqTriplefox: no, not at all. that's a different dot with no overhead .. ;-)
20:37:10TriplefoxWhew
20:37:11matkukiAraq, filwit: https://bpaste.net/show/996e6afbf727
20:39:17filwitmatkuki: both calls should be identical in performance (the compiler sees them as pretty much the same thing). How are you reaching the conclusion that one "has less overhead"?
20:41:24matkukifilwit: what if I use "TypeA = ref object" ?
20:43:35filwitmatkuki: what if you do? I'm not sure what you're asking, and you didn't answer my previous question about how you reached the conclusion one call incurred more overhead. I am having trouble understanding what problem you're trying to solve.
20:50:12filwitmatkuki: I need to get something to eat, so I'll help you later if you still have questions.
20:50:29matkukifilwit, Araq: Sorry, totally my mistake. I once asked Araq if I could simulate namespaces by assigning procs to a type, as Araq showed above "obj.myproc = someOtherProc".
20:50:31matkukiAraq has better memory than me, because I forgot about the that the overhead only happens in the above example. Sorry for the mixup!
20:50:45matkukifilwit: Thanks!
20:53:18filwitmatkuki: okay i see.. fyi, you can assign procs to a type like this: `proc foo(t:type T, ...)`
20:53:48filwitmatkuki: that will allow you to call like this: `T.foo(...)` without any runtime overhead
20:54:10filwitokay, need food. bbl
20:54:26matkukifilwit: Thanks.
20:54:31matkukiAraq: Sorry for the confusion:)
20:55:27*reem joined #nim
20:58:04Demosyou don't need namespaces for the same reasons you do in c++, the module system takes care of it
21:00:31*dapz joined #nim
21:02:31*reem quit (Remote host closed the connection)
21:03:03*reem joined #nim
21:06:21*reem quit (Remote host closed the connection)
21:08:30matkukiWhat is the guidline for using "include"? Always at the top of a module, like import?
21:10:11*dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:11:27*dapz joined #nim
21:11:58*fizzbooze joined #nim
21:17:05BlaXpiritmatkuki, i'd suspect the guideline is not to use include
21:17:32matkukiIs it going to be deprecated?
21:17:44BlaXpirituh no
21:17:51BlaXpiriti just feel like it's inelegant
21:20:17*mikolalysenko joined #nim
21:22:20Varriount'include' is meant for splitting up a single module into multiple modules.
21:23:05Araq'include' is also required when you need to reuse a userdefined pragma
21:23:12Araqdue to a hole in the language
21:23:14VarriountGenerally, 'import' is better, but the choice is up to you.
21:24:34matkukiThanks.
21:24:54Varriountonionhammer: I'll merge when things are ready.
21:25:56*reem joined #nim
21:26:55onionhammerwell yeah :P
21:27:00onionhammerI meant ballpark ETA
21:30:25*dumdum quit (Ping timeout: 256 seconds)
21:30:32Varriountonionhammer: Well, spring break is coming up for me. I'd guess sometime then.
21:30:50onionhammerah ok
21:30:52Varriountonionhammer: Right now a large portion of my time is being taken up with Calculus studies.
21:31:03VarriountAnd I really can't afford to get a bad grade.
21:31:09onionhammershould be a piece of cake for a genius like u though :P
21:31:52VarriountI wish.
21:32:20*dhasenan_ quit (Remote host closed the connection)
21:33:25*banister joined #nim
21:33:54*gever-gever joined #nim
21:41:46*beier joined #nim
21:46:51*beier quit (Ping timeout: 256 seconds)
21:57:23*dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:59:19*dapz joined #nim
21:59:44*pafmaf joined #nim
22:00:12*mpthrapp quit (Remote host closed the connection)
22:01:20*reem_ joined #nim
22:02:35*dapz quit (Client Quit)
22:04:12*reem quit (Ping timeout: 246 seconds)
22:09:06shevyyou can do it!
22:09:24shevyVarriount why can't you have bad grades btw?
22:11:10fowlAraq, how is urhonimo going to work without forward declarations
22:19:46matkukidef~: Just found your HookRace articles on Nim. I didn't know you make games, cool. You made the artwork?
22:33:10def-matkuki: nope
22:33:29matkukiPhysics?
22:33:51matkukiDid you make the physics engine?
22:35:06*banister is now known as banisterfiend
22:36:00*fizzbooze quit (Ping timeout: 256 seconds)
22:36:37*reem_ quit (Remote host closed the connection)
22:36:41def-matkuki: The physics is based on Teeworlds as well. This isn't really Nim-related, so we can talk by PM I guess
22:48:32matkukidef~: Was just curious.
22:51:20flaviufilwit: Yep, it's been merged to the forum and website. I'm not sure if it's been deployed yet though.
22:54:06*reem joined #nim
22:54:07*reem quit (Remote host closed the connection)
22:54:13filwitflaviu: nice job. I think it has been (website dots look a little cleaner than before)
22:54:31*fizzbooze joined #nim
22:55:50*TEttinger joined #nim
22:56:28*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 36.0/20150222232811])
22:56:28flaviuThanks! Yes, you're right, it has been deployed. I also have it pushed to the assets repo, see https://raw.githubusercontent.com/nim-lang/assets/master/Art/background.svg. I didn't bother updating the concept art though, there's little use in that.
22:57:22flaviudef- helped optimize the file size, I'm not sure if I ultimately went with his version or https://kraken.io/
22:59:18*elbow joined #nim
22:59:21*elbow_ joined #nim
22:59:40*elbow_ left #nim (#nim)
23:00:37*reem joined #nim
23:06:02BlaXpirithttp://htmlpreview.github.io/?https://raw.githubusercontent.com/nim-lang/assets/master/Art/background.svg to actually view the file
23:07:28flaviuBlaXpirit: Doesn't render correctly.
23:07:49BlaXpirit:o that's true
23:07:55flaviuhttps://raw.githubusercontent.com/nim-lang/assets/master/Art/background.png
23:08:43*Matthias247 joined #nim
23:11:30*OderWat quit (Quit: Textual IRC Client: www.textualapp.com)
23:14:39*fizzbooze quit (Ping timeout: 250 seconds)
23:15:59*filwit quit (Quit: Leaving)
23:17:14*OderWat joined #nim
23:17:52*saml quit (Quit: Leaving)
23:22:53*filwit joined #nim
23:23:19*pafmaf quit (Quit: This computer has gone to sleep)
23:24:17*reem quit (Remote host closed the connection)
23:25:16*sillesta quit (Ping timeout: 265 seconds)
23:26:47*Menche joined #nim
23:29:53filwitflaviu: ps. we should probably update the github nim-lang group's logo to the new one
23:32:41*fizzbooze joined #nim
23:32:43*whitenoise joined #nim
23:32:51ldleworknew logo?
23:33:04ldleworkglowing instead of black?
23:33:22ldleworkoh I see
23:36:30filwitldlework: yeah there was an older logo for the first site redesign
23:42:03*elbow quit (Remote host closed the connection)
23:42:36flaviufilwit: I'm not sure that you included the source art for https://raw.githubusercontent.com/nim-lang/assets/master/Art/new-design.png in the bundle.
23:43:24flaviuOr did I make that file? I don't remember.
23:44:01filwitflaviu: probably not.. that's just the logo on top of the raw background.. I think i just rendered that real fast to show off the new logo to everyone as a stand-alone image
23:44:28filwitflaviu: i gave def the raw-logo svg/png pack the other day, let me give you a link.. one sec
23:46:16filwitflaviu: http://www.reign-studios.net/philipwitte/nim/artwork/NimLogo.zip
23:46:18gmpreussner|workanyone here going to be at the Game Developer Conference in San Francisco next week?
23:46:40Triplefoxgmpreussner|work: yep...
23:46:43*reem joined #nim
23:46:54gmpreussner|workyay
23:47:03gmpreussner|workcome see me at the Epic Games booth. ask for Max!
23:47:23filwitflaviu: that's basically the Logo SVG as a separate entity (there's a background color to the SVG file, but it will export as transparent) + 3 different resolution PNGs for people to use on blogs and stuff
23:47:53Triplefoxwill do...if i get a pass, ha (i live here, usually end up with an expo every year by chance)
23:48:16filwitflaviu: I should (or you can) make a monochrome color version of the logo for other branding purposes in the future
23:48:34gmpreussner|workTriplefox: if you don't get a pass, email me at [email protected] - maybe i can get you in, or we can meet outside :)
23:48:53flaviufilwit: Already have a two-color version at https://github.com/nim-lang/assets/blob/master/Art/logo-simple.svg
23:48:55*brson quit (Quit: leaving)
23:49:11Triplefoxokay, will probably let you know in another day or two
23:49:24onionhammergmpreussner|work you work for epic?
23:49:52onionhammerI just subscribed to the new unreal engine :)
23:49:59gmpreussner|workyep
23:50:20onionhammerwhat do u do there?
23:50:29gmpreussner|worksr. engine programmer
23:51:19onionhammerso when can we expect nim support in unreal? :P
23:51:29*Hakaslak joined #nim
23:54:17flaviufilwit: Looks like I already have that. Should the repo's logo be the rectangular logo? I'd like to keep it square so it's recognizable.
23:54:44filwitflaviu: you can adjust it if you want
23:54:50*Matthias247 quit (Read error: Connection reset by peer)
23:55:20filwitflaviu: a two-tone logo isn't the same as a monotone one.. monotone is the onlything that works for watermarks, etc
23:55:31*reem quit (Remote host closed the connection)
23:55:43filwitflaviu: i actually already made one (for the website favicon)
23:56:32filwitflaviu: it uses outlines instead of colors to differentiate between the front and back side of the crown
23:56:37*dapz joined #nim
23:57:36filwitflaviu: it may already be in the zip i gave you and just needs to be adjusted in size.. i'll take a look later if you can't find it
23:58:25*reem joined #nim