<< 03-05-2015 >>

00:05:35*vendethiel joined #nim
00:08:43*zama quit (Quit: leaving)
00:09:35*zama joined #nim
00:11:02*loz1 quit (Ping timeout: 256 seconds)
00:28:11*vendethiel quit (Ping timeout: 256 seconds)
00:36:45*lakurei quit (Quit: lakurei)
00:40:28*darkf joined #nim
00:46:22*brson joined #nim
01:22:12*Ven joined #nim
01:32:13*BitPuffin|osx quit (Ping timeout: 250 seconds)
01:35:44*Ven quit (Read error: Connection reset by peer)
01:42:23*Jesin quit (Quit: Leaving)
01:46:01*wb quit (Ping timeout: 264 seconds)
01:56:32*saml_ joined #nim
01:57:03*bjz joined #nim
02:02:28*Ven joined #nim
02:06:12*vendethiel joined #nim
02:07:20*Jesin joined #nim
02:09:21*Jesin quit (Read error: Connection reset by peer)
02:10:28*Ven quit (Read error: Connection reset by peer)
02:11:23*Jesin joined #nim
02:11:28*anthony joined #nim
02:11:52*anthony is now known as Guest84116
02:12:59*Jesin quit (Remote host closed the connection)
02:27:18*vendethiel quit (Ping timeout: 246 seconds)
02:40:57*TEttinger quit (Ping timeout: 246 seconds)
02:42:15*brson quit (Quit: leaving)
02:42:57def-This works better than expected: https://github.com/def-/nimfmt/blob/master/nimfmt.nim
02:46:18*TEttinger joined #nim
02:59:45*johnsoft quit (Ping timeout: 240 seconds)
02:59:59*gcr joined #nim
03:00:14*johnsoft joined #nim
03:00:48*gcr left #nim (#nim)
03:08:25*vendethiel joined #nim
03:31:37*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:14:08*vendethiel quit (Ping timeout: 256 seconds)
04:18:15*Demon_Fox quit (Ping timeout: 256 seconds)
04:18:46*Demon_Fox joined #nim
04:19:09*JinShil joined #nim
04:27:04*ddl_smurf quit (Quit: ddl_smurf)
04:55:11*JinShil quit (Quit: Konversation terminated!)
04:59:44*saml_ quit (Quit: Leaving)
05:25:36*Guest84116 quit (Quit: My Mac has gone to sleep. ZZZzzz…)
05:37:50*solidsnack joined #nim
05:41:40*solidsna_ joined #nim
05:42:15*solidsnack quit (Ping timeout: 250 seconds)
05:54:25*solidsna_ quit (Ping timeout: 264 seconds)
06:19:34*zzach joined #nim
06:24:05*solidsnack joined #nim
06:40:44*perturbation joined #nim
06:47:32perturbationanyone use the openssl_evp nimble package? Crashes at runtime with 'could not import: ASN1_SEQUENCE_ANY_it', but I have /usr/lib/libcrypto.dylib and /usr/lib/libssl.dylib
06:47:57perturbationmaybe it's because I screwed things up with Homebrew... Mac OS X is not my favorite OS
06:54:37perturbationI'm going to try and reproduce on Linux... if I can't reproduce (with openssl libs installed), I'll know it's a problem with my Mac OS X setup
06:55:02perturbationif I can, I'll know it's a problem with openssl_evp (or how I'm using it)
06:55:08*perturbation quit ()
06:56:12*yglukhov_ joined #nim
07:04:09*transfuturist quit (Ping timeout: 246 seconds)
07:04:12*Jesin joined #nim
07:08:00*perturbation joined #nim
07:08:10*johnsoft quit (Read error: Connection reset by peer)
07:08:19*Jesin quit (Read error: Connection reset by peer)
07:08:25*Jessin joined #nim
07:08:34*Jessin is now known as Jesin
07:08:59*johnsoft joined #nim
07:09:26perturbationdefinitely a problem with library path in OS X (or my setup) - openssl_evp works in Linux
07:09:32*perturbation quit (Client Quit)
07:18:46*filcuc joined #nim
07:26:48*solidsnack quit (Ping timeout: 256 seconds)
07:29:06*Jessin joined #nim
07:29:47*Jesin quit (Ping timeout: 256 seconds)
07:30:22*Jessin is now known as Jesin
07:56:13*filcuc quit (Ping timeout: 255 seconds)
08:00:15*filcuc joined #nim
08:00:21*Kingsquee quit (Quit: Konversation terminated!)
08:02:08*gmpreussner|work quit (Read error: Connection reset by peer)
08:05:08*X-Scale quit (Ping timeout: 272 seconds)
08:10:26*JinShil joined #nim
08:19:21*OnO joined #nim
08:20:44*anthony joined #nim
08:21:06*anthony is now known as Guest13258
08:21:20*Ven joined #nim
08:22:41*Ven quit (Read error: Connection reset by peer)
08:26:30*BlaXpirit joined #nim
08:38:06*filcuc quit (Quit: Konversation terminated!)
08:38:36r-kui could use additional set of eyes. my patch is misbehaving somehow. i listed everything including url to my patch in following gist: https://gist.github.com/r-ku/26ca187e0ad61d09a64b
08:39:05r-kui have no idea how my changes could interfere with --import switch, any kind of help would be really appreciated
08:42:02*Demon_Fox quit (Quit: Leaving)
08:43:41*nimnoob123 quit (Quit: Page closed)
08:44:17*johnsoft quit (Ping timeout: 244 seconds)
08:44:36*Jesin quit (Quit: Leaving)
08:44:36*johnsoft joined #nim
09:09:54*grncdr joined #nim
09:10:00*Guest13258 quit (Quit: My Mac has gone to sleep. ZZZzzz…)
09:33:13*Matthias247 joined #nim
09:34:58*Ven joined #nim
09:36:29*Ven quit (Read error: Connection reset by peer)
09:47:29*wb joined #nim
09:53:30*grncdr quit (Quit: Leaving.)
09:59:53*grncdr joined #nim
10:17:36*bjz quit (Ping timeout: 240 seconds)
10:18:20*bjz joined #nim
10:37:39*bluenote joined #nim
10:41:11*banister joined #nim
10:57:41*Trustable joined #nim
11:07:43*ddl_smurf joined #nim
11:21:14*grncdr quit (Quit: Leaving.)
11:21:40*grncdr joined #nim
11:28:53*grncdr quit (Quit: Leaving.)
11:45:36*milosn quit (Quit: leaving)
11:51:00*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:27:32def-Someone asked about zipfiles yesterday, should work again: https://github.com/Araq/Nim/pull/2648
12:28:48*vendethiel joined #nim
12:31:32*jsseb left #nim (#nim)
12:42:08*yglukhov_ quit (Quit: Be back later ...)
12:43:31*yglukhov_ joined #nim
12:45:08*banister joined #nim
12:47:47*yglukhov_ quit (Ping timeout: 250 seconds)
12:58:49*BitPuffin|osx joined #nim
13:00:38*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
13:21:31*ingsoc joined #nim
13:31:51*xcombelle joined #nim
13:55:41*vendethiel quit (Ping timeout: 256 seconds)
13:56:13*TEttinger quit (Ping timeout: 264 seconds)
13:57:13*wb_ joined #nim
13:57:34*wb quit (Ping timeout: 255 seconds)
13:57:38*vendethiel joined #nim
14:00:24*transfuturist joined #nim
14:04:09*Matthias247 quit (Read error: Connection reset by peer)
14:17:02*filcuc joined #nim
14:20:21*yglukhov_ joined #nim
14:20:25*milosn joined #nim
14:24:14*ir2ivps10 joined #nim
14:26:36*darkf quit (Quit: Leaving)
14:30:14*wb_ quit (Read error: Connection reset by peer)
14:58:18*JinShil quit (Quit: Konversation terminated!)
15:23:04*bluenote quit (Ping timeout: 246 seconds)
15:30:28onionhammerdef- you should pull that into a nimble package
15:30:33onionhammerand remove it from std lib ;)
15:31:17def-onionhammer: and niminst needs that nimble package for installation then?
15:31:58onionhammerhm hadnt considered that
15:32:36onionhammeri figured it was just another oddball in the std lib :)
15:33:00def-I'd like to do major changes in the stdlib by using more concepts. Could get rid of a lot of duplicate code
15:33:13onionhammeri dont think many use niminst though
15:33:30onionhammeryeah the std lib could use a makeover
15:33:34def-Not many, but I think the compiler tools should not depend on nimble packages
15:33:48onionhammerI agree
15:34:00def-I'm just waiting for concepts to work well enough
15:34:03onionhammerbut I also dont think that should be a compiler tool ;)
15:34:09def-I hope that can happen before 1.0
15:35:07onionhammerthe nim repo needs to be stripped down to what the compiler relies on, and what the compile relies on shouldnt include zip (for example;))
15:35:18onionhammerbut nimble needs to be improved a lot too..
15:35:55dom96niminst should be a nimble package
15:36:03Araqniminst should be a separate tool
15:36:12onionhammerfor sure
15:36:31Araqit's totally wrong that "koch install" uses niminst IMO
15:37:27Araqr-ku: does --import work for you in other cases? cause it surely is yet another feature hacked into the compiler before we had code reviews or test coverage
15:37:50r-kuwell --import/--include work without my changes just fine
15:38:03Araqwhat are your changes?
15:38:24r-kuhttps://github.com/r-ku/Nim/commit/401e39bdc5ebcf41c80194e765461c05e9be8d4c
15:39:44Araqyou remove 'mRepr' from semfold?
15:40:11Araqoh never mind, syntax highlighting is fucked up
15:42:51Araqwell sysstr cannot import unsigned, system.nim cannot import anything.
15:43:17AraqI got away with it when I tested it, but it's not supported officially
15:44:25r-kuone more reason to put unsigned operations in system module
15:44:49r-kuafter removing I64 variants we should be able to define signed and unsigned operators with single line actually
15:45:21Araqvia a template?
15:45:46*ingsoc quit (Quit: Leaving.)
15:45:52r-kuoperators i saw use same magic for signed and unsigned
15:45:59r-kufor all versions of ints, from 8 to 64
15:46:02*ingsoc joined #nim
15:46:08r-kuwith redundant I64 magic, which would be gone
15:46:18r-kuso all would use same magic
15:46:23r-kuoh damn, indeed template!
15:46:27Araqaye
15:47:08r-kuso.. i get an OK to move unsigned stuff to system after I64 magics are removed?
15:47:28def-r-ku: I have a PR for that with nice deprecation warnings
15:47:49r-kuoh thats awesome
15:48:01r-kuill just do I64 stuff then
15:48:04def-and thanks for improving unsigned numbers, I used them a lot recently and ran into some problems
15:48:28r-kuafter it and your PR are merged this string stuff can actually work
15:48:45r-kuyeah man me too. makes one's head spin how bad they are now ^_^
15:48:54onionhammer:)
15:48:59onionhammeraraq doesnt like them
15:49:02onionhammerso they work bad
15:49:37r-kui guess then we need enough people to like them to compensate for that ;)
15:49:56Araqno.
15:50:06AraqI hate them, so they were added late
15:50:26Araqbut I didn't deliberate make them work badly
15:52:04Araqand the compiler itself uses them in its VM subsystem
15:53:40*skyfex__ joined #nim
15:56:10*skyfex_ quit (Ping timeout: 265 seconds)
15:58:25*OnO joined #nim
15:58:29onionhammerim just giving you a hard time
15:59:21onionhammerhijack! http://forum.nim-lang.org/t/1179/1#7290
16:00:17*banister is now known as banisterfiend
16:01:09Araqonionhammer: well but it's not "yet another good example", it's "yet another newbie"
16:01:50Araq;-)
16:01:52onionhammeraraq how hard would it be though
16:02:17Araqnot very. 10 lines of code?
16:02:26onionhammerso why not?
16:02:31Araqbut somebody must decide about a syntax
16:02:39onionhammermaybe a {.local.} pragma on the type for now idk
16:03:00Araqwell but then, isn't that the wrong default?
16:03:08onionhammeryea
16:03:14onionhammerbut its backwards compatible
16:03:20Araqhmm
16:03:43onionhammerotherwise type MyType = local object
16:03:45onionhammerwould be cool
16:04:17onionhammernot necessarily "local", but some way to avoid typeing {. .} :)
16:04:22Araqthanks to function application without () this might be possible without making 'local' a keyword
16:04:58Araqbut {. .} is more consistent
16:05:12Araq.inheritable, .final, .nonconstructible
16:05:25onionhammerwell, you know how I feel about {..}
16:05:34onionhammerthat it's a lot of typing :)
16:05:40Araqso backward compat and consistency decide that thing for us
16:05:48AraqI think
16:05:49onionhammermaybe I'll make a sublime snippet for it.. hmm
16:06:02Araqwell you can type {. } instead
16:06:25onionhammerit's mainly a tool for library authors to avoid users mis-using their stuff..
16:06:38onionhammerso whatever works.
16:06:39flaviuWell, just because something is a keyword doesn't mean it can't be used elsewhere.
16:08:54*OnO quit (Quit: Textual IRC Client: www.textualapp.com)
16:09:03flaviuHmm, how about Voldemort types?
16:09:20Araqflaviu: doesn't work
16:09:29*OnO joined #nim
16:09:31Araqproc (f: Foo)
16:09:34Araqneeds to be possible
16:09:48Araqit's just Foo() construction we want to forbid
16:10:23Araqplus you can get the type back via type(...) anyway
16:10:26flaviuWell, Foo() could be a concept.
16:10:33flaviuerr, Foo.
16:11:20*ChrisMAN quit (Remote host closed the connection)
16:11:40onionhammertype Foo^ = object :P
16:13:01Araqonionhammer: come up with a pragma name please
16:13:11flaviuI think I've found a bug: https://gist.github.com/ca97970a41a224870145
16:13:16Araqnonconstructible is too long and wrong
16:13:19onionhammerinitlocal or local
16:13:21onionhammerhmm
16:13:24flaviu"type mismatch: got (int) but expected 'Foo'"
16:14:06flaviuThat's on line 6
16:15:29Araqdef-, dom96 ready for 0.11.2 tonight?
16:15:49dom96what, already?
16:16:22*grncdr joined #nim
16:16:57Araqdom96: 0.11.0 was an exceptionally bad release
16:17:18dom96how so?
16:17:43Araqthe last minute'ish patch that changes how types are computed broke everything
16:18:02AraqI was overconfident with our test suite
16:18:12Araqturned out it still sucks :P
16:19:32dom96lol ok
16:21:12OnOhi, can I have a small suggestion for making csources a submodule, I had a problem compiling stuff from scratch on 0.11 until I realized that my "csources" were outdated
16:21:32OnOor at least build.sh should check if csources are recent enough somehow
16:22:24Araqdon't make suggestions, make PRs :-)
16:22:42OnOsure
16:23:02Araqso ... not even install.sh works for 0.11
16:23:29Araqat least we don't write on the site to use that
16:23:32*lakurei joined #nim
16:24:18lakureiHi. To learn a bit more about Nim, I wrote this small program:
16:24:20lakureihttp://pastebin.com/raw.php?i=KT3Wmq9q
16:24:35lakureiIt does work but half of the time it crashes with the following error:
16:24:43lakureiSIGSEGV: Illegal storage access. (Attempt to read from nil?)
16:24:56lakureiAny pointer on what I did wrong?
16:26:07dom96what's the stack trace?
16:26:08*grncdr1 joined #nim
16:26:42*grncdr quit (Ping timeout: 244 seconds)
16:26:47lakureiOne second, I'll pastebin it too.
16:27:44lakureihttp://pastebin.com/raw.php?i=RGTkAbSS
16:28:46lakureiAnother one, this time it failed earlier:
16:28:47lakureihttp://pastebin.com/raw.php?i=PND0grPF
16:30:01dom96huh, shouldn't `client` be out of scope in the 'finally' body?
16:31:31lakureiIt also crashes with the same stack trace when outside.
16:34:26grncdr1I have a question about the change to parameter names in macros/templates
16:34:30*grncdr1 is now known as grncdr
16:35:32grncdraccording the release announcement, I should use immediate, dirty, to get non-gensym paramaters, but then the news also says that immediate templates & macros will be deprecated because typed/untyped will cover it
16:35:53grncdrI'm just wondering if there's a better way to selectively break hygiene?
16:37:11Araqgrncdr: dirty is not the same as immediate
16:37:16Araqdirty will stay
16:37:20grncdrok
16:37:40grncdrI was using `quote do:` to initialize an AST node for a proc, then replacing the proc body. Is it possible to use the dirty pragma with that?
16:37:43Araqand there are better ways, dirty is just for convenience
16:37:55grncdrah, then better ways are what I'm interested in
16:38:35dom96lakurei: Hrm. I think there is a bug in async's handling of try except blocks :\
16:38:45*yglukhov_ quit (Quit: Be back later ...)
16:39:48lakureiOuch. By the way, the same thing happens with your gist in: https://gist.github.com/dom96/2d63e2a31a30feae54ea
16:40:15*yglukhov_ joined #nim
16:40:52lakureiI also remember getting a warning from the compiler that cb in asyncdispatch isn't GC-safe, (may be related?) but I can't reproduce it now.
16:44:14*nimnoob123 joined #nim
16:44:22dom96lakurei: yeah, the transformation is wrong. Can you report this on github please?
16:44:27*yglukhov_ quit (Ping timeout: 246 seconds)
16:44:41grncdrAraq: any small example of how to access proc parameters in a template/macro?
16:45:05lakureidom96: sure, I'll do, thanks.
16:45:22grncdr(with the proc itself being created in a macro)
16:45:53grncdrI guess I could create the syms myself, then quote them in the `proc(…)` part
16:46:01*grncdr tries that
16:46:12def-Araq: yes, ready
16:46:42*X-Scale joined #nim
16:48:51Araqgrncdr: read about .gensym and .inject please
16:51:17r-kuhey so uh... that constructor deal pretty much stalled?
16:53:19nimnoob123wait is it really coming? r-ku, I thought Araq was against it, if it is though I doubt it'll make 1.0
16:53:50r-kusomeone said he would make PR or something like that, idk
16:54:39r-kubut raising exceptions illustrates need for it.. raise newException(IOError, "...")...
16:55:09dom96raise IOError(msg: "...")
16:55:22dom96Will work when IOError is a ref.
16:55:43Araqbbl
16:55:48r-kuthats another problem yeah.. what if i want my type to be both ref counted and local on stack?
16:56:00r-kutwo different types, complexity, dead kittens
16:56:25dom96Then you have a TypeRef and a TypeObj
16:56:49*bogen left #nim (#nim)
16:57:22flaviuOr you just have a Type and a ref Type.
16:57:51r-kuraise (ref IOError)(...) <-- awkward
16:58:02*yglukhov_ joined #nim
16:58:15dom96r-ku: What do you propose
16:58:16dom96?
16:58:18r-kuworse yet - cant initialize object right there. its more of a problem for other objects, not exceptions
16:58:23flaviuThat's a flaw in the stdlib.
16:58:33flaviuIoError should be a ref object
16:58:41flaviuit is useless as a non-ref object.
16:58:44r-kudom96: i talked a lot in that constructor thread. (me novist, changed nick)
16:58:58OnOAraq: here you go: https://github.com/Araq/Nim/pull/2649
16:59:01r-kuflaviu: in that case yes. but its not true for every other case
16:59:13dom96link?
16:59:19flaviur-ku: How about https://gist.github.com/flaviut/1ae1d7deac4c57d0a84c ?
16:59:33flaviuthen it's `box Foo(...)`
16:59:39r-kuhttp://forum.nim-lang.org/t/703
17:00:21dom96Could you summarise? I don't have time to read 10 pages of posts.
17:00:54r-kufor my own needs i made some macro stuff with folowing syntax: var a = local TypeName(p1, p2, p3); var a = gcnew TypeName(p1, p2, p3); they call proc init automatically with var TypeName as first param and rest of args passed to that proc
17:01:18r-kuofc its a hack and bit awkward too, if it could be simplified it would be much better
17:01:45r-kufor example i think var a = TypeName(p1, p2); for local stack object makes a lot of sense
17:01:56r-kuand var a = ref TypeName(p1, p2); for gc'ed version
17:02:20OnOAraq: can we add .gitignore to csources repo or it will be wiped on next bootstrap niminst?
17:02:42OnOcoz .o or .obj files makes repo dirty
17:03:02r-kuvar a = (ref TypeName)(f1: p1, f2: p2); works now right? not much difference from how it works now if so.
17:03:57dom96perhaps we could just remove the need for the parenthesis in that case
17:04:14dom96but yeah, ok. PRs welcome :)
17:05:25r-kudom96: but its not just parenthesis problem. there is automatic init() proc calling too
17:23:44xcombellehi I have a question is it possible to limit the size of one thread heap ?
17:31:10*pidg quit (Ping timeout: 246 seconds)
17:31:56*Xaseron joined #nim
17:40:13Araqdom96: the inconsistent parenthesis is what I dislike most about 'new'-like constructors in the first place!
17:45:03Araqxcombelle: no.
17:49:58*OnO_ joined #nim
17:51:07*OnO quit (Quit: Textual IRC Client: www.textualapp.com)
17:51:13*OnO_ quit (Client Quit)
17:52:27*OnO joined #nim
17:54:39xcombellethanks for the answer Araq
17:56:17*OnO quit (Client Quit)
17:56:58*OnO joined #nim
18:02:57*vendethiel quit (Ping timeout: 240 seconds)
18:04:19*vendethiel joined #nim
18:23:32*filcuc_ joined #nim
18:23:54*filcuc quit (Ping timeout: 272 seconds)
18:24:36*elbow_json joined #nim
18:32:34*ingsoc quit (Quit: Leaving.)
18:35:36OnOguys, simple Q, how to check if we are in debug build or release build
18:35:39OnOwhen XXXX: ?
18:36:19Araqwhen defined(release) ?
18:42:38OnOokay cool, thnx
18:43:21OnOdom96: is master the right branch to send PR for jester?
18:43:22*banisterfiend quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:44:41dom96OnO: yes
18:46:08*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
18:46:30*Trustable_2 joined #nim
18:47:20*OnO joined #nim
18:48:33*Trustable quit (Ping timeout: 240 seconds)
18:53:30*elbow_json quit (Remote host closed the connection)
19:00:19*vendethiel- joined #nim
19:01:18*vendethiel quit (Ping timeout: 246 seconds)
19:03:41*OnO is now known as ono
19:04:00Xaseronis there no abs() function in the std?
19:05:22*ono is now known as OnO
19:05:28*OnO quit (Quit: Textual IRC Client: www.textualapp.com)
19:06:09*OnO joined #nim
19:06:37AraqXaseron: system.abs?
19:07:01Xaseronah ok
19:07:10Xaseroni looked in the math library
19:10:46*Jesin joined #nim
19:13:23OnOdom96: do you reckon what's the reason jester simple routes: get "/": resp "Hello World!" is 21k req/s, while same done directly in AsyncHTTPServer is 47k req/s?
19:13:35OnOdom96: what makes such a slowdown?
19:14:03dom96excessive allocations of the Request object
19:14:12dom96I will be improving it
19:15:17OnOdom96: btw. how do I change jester default 5000 port when using routes: and runForever(), no explicit Jester instance?
19:15:38dom96https://github.com/dom96/jester/blob/master/tests/alltest.nim#L4
19:15:43def-let settings = newSettings(port=Port(8080), staticDir=".")
19:16:08OnOoh thanks
19:17:13*anthony joined #nim
19:17:37*anthony is now known as Guest5420
19:18:45*filcuc_ quit (Quit: Konversation terminated!)
19:22:34*Kingsquee joined #nim
19:22:41fowldef-: you have GCC 5?
19:22:44*Guest5420 quit (Ping timeout: 245 seconds)
19:24:17fowlNm I'm tripping
19:24:23def-fowl: nope, but my clang version has those builtins already
19:24:41def-I guess I should build GCC 5.1 for testing though
19:25:11fowlWell I asked because on arch I have 4.9 I think. 5 must be very bleeding edgr
19:28:22*elbow_json joined #nim
19:32:32OnOdom96: okie, updated my little benchmark at https://github.com/nanoant/WebFrameworkBenchmark I hope Jester will be soon closer to native AsyncHTTPServer performance
19:32:45OnOI'd expect just few % drop from route processing
19:33:10def-But if you think about it, 20k req/s is still enough for nearly everything
19:33:43Araqfwiw when I looked at jester's code I added to my todo to rewrite utils.nim or something
19:33:55fowlWhat kind of traffic does your site get when its "slashdotted"
19:34:01OnOdef-: yes & no, if using AsyncHTTPServer gives you more than 2x then Jester overhead is simply way too much
19:34:10onionhammerdef- it's about overhead
19:34:30onionhammerrealistically 'hello world' should be pretty quick, it'll slow down quick w/ app logic, the framework shouldnt be causing that though
19:34:36def-fowl: When my blog was #1 on Hacker News and r/programming it got 1-2 requests per second. Slashdot was about the same
19:34:51OnOIMHO overhead should be minimal, 2-3% is justifiable for route processing
19:35:20Araqroute processing should use lexim :-)
19:36:46OnOAraq: okie, I guess I overlooked that one
19:37:03OnOhttps://github.com/Araq/lexim ?
19:38:21Araqyep
19:38:21OnOI am thinking about using Nim to make GitHub/GitLab clone with minimals deps
19:38:58OnOthis isn't rocket science, and I think GitLab sucks too much with billions deps I can't stand it
19:39:24OnObut I miss also ORM for db_postgress/mysql/sqlite
19:39:35onionhammerAraq cool.... how do you use it? :)
19:40:27OnOjust trying to learn how to do macros which turn sthing like: User.where(User.name == "joe" and User.pwsha == "1234") to SQL
19:40:36ddl_smurfhas anyone done some kind of DHT with nim ? (distributed hash table - basically bittorrent)
19:40:54OnOI guess I need where to be a macro that will turn stmt into SQL
19:41:08OnOany good place for example for such a macro?
19:41:14fowlI thought an orm could store and retrivr objects from the db
19:42:01Araqonionhammer: match s, i:
19:42:17Araqof r"[a-z]+": echo "identifier"
19:42:26Araqof r".": echo "something else"
19:42:30OnOfowl: this piece is rather straightforward, I think Nim could excel in higher level retrieval statements turned at compile time into SQL
19:42:53OnOwhich will obviously greatly improve performance
19:43:12ddl_smurfOnO: you'll never handle all stmt, so just define your own subset that makes SQL sense and force users to whatever syntax it understands
19:44:17*Matthias247 joined #nim
19:44:48ddl_smurf(the alternative approach is to use "representational" objects like col"thiscolumn" == sqlliteralint"4" and have thos objects self-generate, basically your own SQL DOM)
19:45:16OnOpretty ugly :>
19:45:21ekarlsooh god, +100 to a object mapper thing in nim...
19:45:25ddl_smurf(in this case you'd override == on col to generate says a EqualitySQLContraintExpression or something)
19:46:03OnOI'd opt for User.where(@id == 4) where @something is a operator that created some SQLORMId
19:46:19dom96OnO: A GitLab clone in Nim would be really cool to see.
19:46:24OnOand then we can define other operators eg. `==`(ORMId, int)
19:46:26ddl_smurfreally isn't so ugly, i'd wager you could rather quickly like 99% of useful sql expressions)
19:47:15ddl_smurfsure, you'll need a special object of identifiers in any case, they need escaping and aren't strings
19:48:09fowlNah you just use prepared stmts and you're fine
19:48:32OnOhmmm.... thinking loud, I could create dot accessor template that that 1st argument is Model type
19:48:51OnOso User.name -> ORMId, where user.name is actual value
19:49:18OnOthen (User.name == 1) -> ORMStmt
19:49:33ddl_smurf(obviously, depending on your dialect, you want `user`.`name` or the like)
19:49:50Araqekarlso: how would that help you? you cannot even use the cgi.nim module that we already have!
19:50:07fowlOno write out some example statements first
19:51:07Araqekarlso: or do you? ;-)
19:51:14OnOeg. for user in User.where(User.name == "joe" and User.pwsha == "1234"): echo user.email
19:52:36AraqOnO: that's cool but without compile-time model checking not good enough IME
19:52:58ekarlsoAraq: sorry how's that related ?
19:53:21ddl_smurfUser.id in (User.select(id).where(like(name, "Paul%") and User.current_job.name == "Annoyer" and User.managers.include(User.where(country == "gb"))) ))))) <- or another number of rparen
19:53:38Araqekarlso: we want your "run Nim code here" website to work with more than 1 user at a time
19:54:00ekarlsoAraq: i dont have time atm to remake it to use cgi...
19:54:21ddl_smurf(not sure i agree with the model checking - you don't always have your whole model in the current language you're using, and rarely need to)
19:54:23Araqekarlso: fair enough but then make somebody else in #nim do it
19:54:31ekarlsoAraq: really ?
19:54:42Araqddl_smurf: it should ask the DB for the model
19:54:43ekarlsothe code is up for forking if someone has wanted to do it ..
19:54:57ddl_smurfat compile time it should be talking sql ??????
19:55:06Araqekarlso: yes but you need to announce it in the mailing list, forum and here
19:55:14Araqddl_smurf: yup
19:55:17*xcombelle quit (Quit: Leaving)
19:55:59ddl_smurfi disagree, hell i don't see the checking as helping at all, and waiting for the db to dump it's schema at each compile is nearly totally useless
19:56:24ddl_smurfmore often than not your DB target schema is variable, and its actually mostly OK
19:59:10ddl_smurf(OnO if you do work on it, please consider naming conventions (nim field name to field name, fk name etc), relations, dates and collations, and most importantly transactions - from the start, too many ORM are shit hobby projects that ruin enterprises)
19:59:56Araqddl_smurf: without the checking you might as well pass strings to the db
19:59:59gokrPersonally I would instead start making something similar to ROE in the Smalltalk world.
20:00:13onionhammerAraq so will this replace the re module in the std lib?
20:00:16ddl_smurfactually had invested quite a bit of dev into sequelize, it said it did transactions but it didn't, when i went on IRC to ask the author, he basically replied he didn't see the point, this forced me to rewrite a lot)
20:00:19gokrWhich models relations as first class constructs.
20:00:20Araqonionhammer: it can't
20:00:43OnOyeah, sure this is why I am thinking loud, so maybe:
20:00:43OnOUser.where(User.name == "joe" and User.pwsha == "1234")
20:00:43OnOor maybe:
20:00:43OnOUser.where(@name == "joe" and @pwsha == "1234")
20:00:45OnOor even:
20:00:45OnOUser.where(.name == "joe" and .pwsha == "1234")
20:01:01ddl_smurfthats a reducio ad absurdum, there is plenty of value in using the correct code identifiers and auto-escaping and type checking to a degree
20:01:04Araqddl_smurf: plus you can cache the DB model querying
20:01:19Araqddl_smurf: how do you get the type checking though?
20:01:29OnOlast one would be cool, but no idea how to make a custom prefix operator that will take any identifier and turn it into something else
20:01:33ddl_smurfthe way i see it is you define the fields you're going to use
20:01:59ddl_smurf(last one doesnt nest well)
20:02:42Araqplus strings have the advantage that you can try and tweak the query and then paste it into your program
20:02:45fowlOno more interesting i think is generating the db layout from object types. We can do that with macros looking the types fields and stuff
20:03:08OnOfowl: yess... that would be also awesome
20:03:17ddl_smurffowl: yeah but it needn't be exhaustive
20:03:18Araqfowl: that works but I like to have the model in the DB
20:03:40Araqnot generate it from Nim's type system
20:03:56Araqbut I guess given enough annotations that can work as well
20:03:56ddl_smurfaraq: i'm not against strings - in fact if doesn't have a fallback to sql chunk system i'm not touching with a stick
20:04:09OnOAraq: I'd opt for annotations
20:04:22onionhammeraraq where did we land on that pragma?
20:04:35OnOif you don't like default type from given field name you add some annotation like {. sqlType: XXX .}
20:04:48Araqyeah
20:05:11OnOsome thing for defining indexes
20:05:26OnOonly think that would need to be worked out are migrations
20:05:34OnObut this is far future ;)
20:05:49gokrSomething like ROE should fit Nim fairly well - since its a lazy library that generates SQL only when you start iterating over something.
20:05:52ddl_smurfin a perfect world, that syntax need not be SQL-specific, ie.: i wouldn't mind a .where and a .join etc on my normal nim objects
20:06:05ddl_smurfor using the query generator in other contexts, say xpath etc
20:06:18gokrBut obviously noone listens ;)
20:06:31ddl_smurfactually i'm describing linq and nhibernate, maybe i'm just biased
20:06:46Araqgokr: sorry, you need to at least give us lazy folks a link
20:07:08gokrMmmm, let me see...
20:07:42Araqddl_smurf: LINQ2SQL is great but it generates strongly typed stuff from the DB model. ;-)
20:07:56Araqwhich is what I'm proposing
20:08:16ddl_smurfyeah but your model needn't be complete, you can just define whichever couple of tables and fields you want to use, which is what i'm proposing
20:08:44*HakanD joined #nim
20:08:48ddl_smurfwait, you're saying it pulls the schema from the DB ? in the case of nhibernate that's wrong
20:09:00OnOgokr: Why would you need lazy SQL generation if you can have compile time SQL generation ?
20:09:24gokrOnO: What I mean is that the laziness fits perfectly with "compile time"
20:09:27ddl_smurfOnO: sometimes your parameters are variable in themselves too
20:09:42ekarlso+1 ddl_smurf ...
20:09:48gokrIts a bit hard to find stuff around ROE, but you can see a summary if you search for "ROE" here: http://blog.redtexture.net/2010/10/30/avi-bryants-presentations/
20:09:50ekarlsoapi filter for example :p
20:10:03OnOddl_smurf: sure, but then at compile time you get sql"... where id = ?" % [ id ]
20:10:24OnOso I don't see the point
20:10:27ddl_smurfsometimes its not id, sometimes i want to add an "AND this" or "SORT" clause
20:10:40gokrSo ROE was made by Avi Bryant (who has done lots of really slick stuff) and the idea was to model Relations in Smalltalk - instead of "objects in an RDB". Turning it around. Kinda like LINQ.
20:11:05ddl_smurfin more advanced cases you want more control at runtime within the query, things like full text search or bson
20:11:20OnOddl_smurf: the elements in where clause are either constants or variables.. this is known at compile time
20:11:22ddl_smurfso being able to manipulate the query dom would be very interesting
20:12:00OnOso the idea is always generate query at compile time
20:12:02gokrSo you have a library that models relational algebra. You can combined them etc, and only when you start accessing a "table" by iterating - only then will it actually produce SQL. Thus, it would fit perfectly with compile time.
20:12:03fowlgokr: but smalltalk is just a giant database so a better accomplishment there is doing something outside of the database :p
20:12:29gokrfowl: Not sure what that comment has to do with ROE.
20:12:40OnObtw. I need some help why this code does not work:
20:12:40OnOtype
20:12:41OnO Model = object
20:12:41OnO ORMId = object
20:12:43OnO name : string
20:12:43OnO User = Model
20:12:45OnOtemplate `.`(t : typedesc[Model], f : string): string =
20:12:45OnO result = f
20:12:47OnOecho Model.test
20:12:53OnOI get: orm.nim:10:11: Error: undeclared identifier: 'result'
20:13:21fowlJust make the last line f
20:13:38gokrfowl: ROE basically is an internal DSL for SQL - that makes relations look like Collections.
20:13:58fowlgokr: dunno what ROE is either you're the only one talking about it?
20:14:10OnOfowl: wow, thanks, think I still don't understand templates :)
20:14:13fowlOk
20:14:45fowlOnO: the template is simple substitution mechanism, the code inside gets replaced as an expression
20:14:54gokrfowl: Could be because I am the only Smalltalker here, right? Its still a very nice approach to the eternal "SQL in code" problem.
20:16:08ddl_smurf(the SQL in code problem is eternal for a good reason)
20:16:16gokrfowl: See from slide 10 here: http://www.slideshare.net/esug/squeak-at-net-style
20:16:27ddl_smurfto exclusively use an ORM is idiotic, ORM's are complimentary tools to SQL
20:16:34Araqgokr: I cannot see how Linq2sql differs from ROE in this aspect
20:17:11gokrI may be wrong, but LINQ basically "just" makes SQL fit better with the language, it doesn't really "model" relations, does it?
20:17:34fowlgokr: looks easy
20:17:47gokrfowl: You checked the slides?
20:18:23gokrI am not sure, but I think latest Rails is doing something kinda similar.
20:19:17AraqOnO: a template does not have 'result' as a template has no stack frame etc. it's not a function.
20:19:56Araqwe could give it a gensym'ed result for consistency but I think that's a bit too much muddling of stuff
20:20:02gokrEither way, I am not that much into RDBs, but from everything I have seen over the years in the various shapes of ORMs etc, ROE seemed like a very clean "Let's go to the mountain"-instead solution.
20:22:21fowlgokr: looks doable
20:22:39gokrfowl: I kinda felt it should fit nicely with Nim.
20:22:50gokrAFAIK GNU Smalltalk has ROE included.
20:23:41fowlI don't really have a need for it though
20:23:45OnOso far, my little experiment:
20:23:47OnOtype
20:23:47OnO Model = object
20:23:49OnO ORMStmt = object
20:23:49OnO query : string
20:23:51OnO User = Model
20:23:51OnOtemplate `.`(t : typedesc[Model], f : string): ORMStmt =
20:23:53OnO ORMStmt(query : f)
20:23:53OnOtemplate `and`(a : ORMStmt, b : ORMStmt): ORMStmt =
20:23:55OnO ORMStmt(query : "(" & a.query & " AND " & b.query & ")")
20:23:55OnOtemplate `or`(a : ORMStmt, b : ORMStmt): ORMStmt =
20:23:57OnO ORMStmt(query : "(" & a.query & " OR " & b.query & ")")
20:23:57OnOproc `$`(s : ORMStmt): string =
20:23:58*vikaton quit ()
20:23:59OnO s.query
20:23:59OnOecho User.id and User.name or User.pw
20:24:11gokrfowl: It wouldn't solve the "objects in RDB" problem - but for many it would be enough to get a nice Nim abstraction layer over RDBs, and could form a base for ORMs on top.
20:24:20gokrOnO: Please use some paste thingymabob
20:24:45OnOyeah, sorry about that
20:25:24gokrJust amazed you haven't been disconnected automatically yet - I always do when I paste ;)
20:26:12gokrfowl: What I really want though is a clean nice binding to HyperDex.
20:26:58fowlgokr: would you pay for it
20:27:05gokrPossibly
20:27:51gokrAlthough... we do have Araq on our team ;)
20:28:09gokrHe probably does it in 10 min
20:28:20fowlSure
20:28:50fowlI actually have done a wrapper in 10 mins before ;)
20:29:19gokrThe actual wrapper itself is trivial. But then you would want a higher Nim level above.
20:29:44gokrThe lib is all async, so you need a bit of book keeping to keep track of req/responses etc
20:30:39fowlC interface means it shouldn't be too painful
20:30:59Araqfowl: gokr wrapped it and blogged about it months ago
20:31:03fowlDoes it have events that you hook to
20:31:16fowlOh lol
20:31:18Araqdon't tell him what c2nim can do ;-)
20:31:23Araqhe knows.
20:31:33fowlC2nim isn't as good as a human
20:31:44Araqnot yet :P
20:31:56gokrfowl: http://goran.krampe.se/2014/10/16/nim-wrapping-c/
20:32:34gokrBut I only did a spike of it so to speak.
20:33:23fowlCan key value stores replace a database
20:33:24gokrBut its a way cool db. Fast as a bat out of hell, and very fault tolerant.
20:33:51gokrfowl: Is that a serious question or?
20:34:17fowlI've never used one. Haven't needed a database in a long time
20:34:35gokrAh, well, there are so many different kinds of dbs these days, its all about what you need.
20:34:58gokrThe NoSQL dbs cover a wide spectrum of different aspects.
20:35:11Araqyeah and Postgre is all you need *cough*
20:35:29gokrFor a lot of projects a solid RDB is more than enough.
20:35:48gokrBut for say Amazon scale web stores - nah.
20:35:59gokrOr Spotify play lists.
20:36:03gokrEtc etc.
20:36:06*jh32 joined #nim
20:36:28ekarlsoriak & cassandra are REALLY nice
20:36:39gokrYes, those two are quite nice.
20:36:57gokrSpotify use Cassandra btw.
20:37:00ekarlsowe're deploying it for a PoC atm and the numbers we're doing atm is pretty cool
20:37:07*yglukhov_ quit (Quit: Be back later ...)
20:37:13ekarlsogokr: tons of companies use both technologies...
20:37:19ekarlsoriak & cas
20:37:22gokrYes, of course.
20:37:31ekarlsonot so many on mongo though on big scale
20:37:41gokrNah, Mongo got quite a few burnt.
20:38:10gokrHyperDex fits an interesting niche though.
20:38:21ekarlsoanother kewl one is influxdb
20:38:26ekarlsofor timeseries
20:38:36gokrIt has similar fault tolerant characterstics as Riak - but is actually consistent.
20:38:46gokrAnd very fast even on a small number of nodes.
20:38:47*vendethiel- is now known as vendethiel
20:39:07AraqI liked mongo until I had to use it for complex queries
20:39:14jh32not sure if this is the right place, but the example in the Reference and pointer types section in http://nim-lang.org/tut1.html seems to have a typo (le, ri: PNode
20:39:15ekarlsogokr: hmmm, checked out cockroachdb ?
20:39:17gokrWe use Influx a bit actually, but moved onto ...
20:39:30ekarlsogokr: moved onto what ? :p
20:39:45gokrMy memory... arrgh...
20:39:56jh32.. should probabely read le, ri: Node , no?
20:40:17Araqjh32: yup good catch. consider it reported
20:40:29jh32thanks
20:40:36ekarlsogokr: ? :p
20:41:24gokrAh, hostedgraphite
20:41:29gokrThey actually use Riak
20:41:48ekarlso:o
20:42:03gokrIts very nice IMHO.
20:42:06ekarlsowe're doing influxdb for our monitoring as a service ^
20:42:07*HakanD quit (Quit: Be back later ...)
20:42:19gokrAh
20:42:42gokrWell, we used influxdb.com for a short while, but then went with hostedgraphite instead.
20:42:47ekarlsoi wonder if it will be able to compete with Vertica though...
20:42:59ekarlsoi heard vertica handles in some cases some insane nr's
20:43:15ekarlsolike 2 trillion entries + without sweating
20:44:07*dalarmmst joined #nim
20:44:18*yglukhov_ joined #nim
20:45:54gokrekarlso: One slightly oddball of NoSQL dbs is Tarantool which I stumbled over when looking at Lua
20:47:23dalarmmstDoes anyone know where I can find info on pointer arithmetic? If I have a var of type pointer to some memory (for example with MemFile.mem in memfiles.MemFile in module memfiles) I'd like to retrieve data from that pointer, by stepping through one byte at a time.
20:48:17Xaseroni have wrote a basic avl tree in nim this evening. it's a pretty sleek and clutter free language.
20:48:35BlaXpiritdalarmmst, https://github.com/fowlmouth/nimlibs/blob/master/fowltek/pointer_arithm.nim
20:49:20Araqdalarmmst: template `+!`(x): expr = cast[type(x)](cast[int](x) + sizeof(x[]))
20:51:07BlaXpirita couple examples of dealing with pointer returned from C https://github.com/BlaXpirit/nim-csfml/search?q=cast
20:56:08*vikaton joined #nim
20:57:54dalarmmstThanks guys
20:58:39Araqdalarmmst: of course, the proper way is to map it to a pointer of an array ;-)
20:58:55Araqand then use array indexing
20:59:03*egrep quit (Quit: Error -38: Black hole has swalled this client.)
20:59:36dalarmmstAraq: I'm very new to nim, do you have an example somewhere of this?
20:59:38*egrep joined #nim
21:01:38OnOcan we concat sequences at compile time?
21:02:46BlaXpiritOnO, wouldn't expect such a question from you. can't you just check?
21:03:01OnOI checked, and seems not
21:03:55dalarmmstAraq: Also, will that work if you use an mmap'ed file?
21:03:56OnOlet me say I got type ORMStmt = query : string, args : seq[string]
21:04:14BlaXpiritOnO, can concat
21:04:17OnOif I try to concat args in my template for operators such as `==`
21:04:34BlaXpiritdoing something wrong
21:04:45Araqdalarmmst: let x = cast[ptr array [1000_000, ptr int](result_of_mmap); use x[i]
21:05:03Araqand yes, the upper limit of 1 million is arbitrary
21:05:11*Araq likes arbitrary limits.
21:05:27BlaXpiritthat's scary
21:05:53Araqthat's the nature of computation.
21:06:06fowlThat would be for int**
21:06:18Araq2^31 - 1 is just as arbitrary
21:06:37dalarmmstAraq: let x = cast[ptr array [m.size, ptr int](m.mem); Wouldn't this be nicer?
21:06:46OnOBlaXpirit: https://gist.github.com/nanoant/ce1428eee5d009fdf3eb
21:07:03Araqdalarmmst: but m.size is a runtime value and arrays don't support that
21:07:16OnO^-- aparrently I don't get string concatenation opt at compile time
21:07:45OnObut if I remove anything related to concatenating: args seq, just concatenating query strings works OK
21:08:06AraqOnO: I'm working on this right now ...
21:08:17dalarmmstAraq: So I'm just casting it to something that looks like an array of 1000_000 elements, I'm not allocating anything there right?
21:08:24Araqright
21:08:36dalarmmstThe arbitrary size still looks a bit ugly to me :p
21:10:01Araqwell actually you get some runtime checking out of this
21:10:22Araqas indexes greater than that will produce an out of bounds exception
21:10:22ddl_smurfas well it should - i think araq is trolling - even though he'll go on with "oh but that limit or MAXINT, what's the difference?"
21:10:50Araqddl_smurf: how is that trolling?
21:10:56renesacAraq: can't the {.unchecked.} pragma be used here?
21:11:10renesacto not have that arbitrary limit?
21:11:11Araqrenesac: it can but then you get no checking whatsoever
21:11:16ddl_smurfyou're truly advocating abritrary limits ?
21:11:33Araqyou think there are other limits?
21:11:54renesacI don't see much gain from that limited checking
21:12:01ddl_smurfwell if you don't think there are others, what are you talking about =D
21:12:04renesacplus failing when it could otherwise work
21:12:24renesacif you are using a arbitrary limit, then at least don't use a magic number
21:12:27Araqddl_smurf: making other programmers aware is not a bad thing
21:12:41renesacso the rest of the code can properly use it too
21:12:47ddl_smurfok i'll bite: the other limits are not arbitrary
21:12:53ddl_smurfthey have explanations
21:13:41Araqno the other limits are far more error prone, try computations when close to MAX_INT you get overflows etc
21:13:59*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
21:14:19Araqan arbitrary limit of 1 million means you don't get into this trouble and its related security risks
21:14:27ddl_smurfgoes both ways: there are plenty of scenarios that run into your arbitrary limit that wouldn't have in MAX_INT, precisely MAX_INT-10^6 scenarios
21:14:55ddl_smurfbut then it's not arbitrary if you opt-in for some reason
21:15:10Araqyeah ok, whatever
21:15:42Araqbut MAX_INT is stupid limit most of the time
21:15:45ddl_smurfjust saying if you're putting a limit, i'm hoping for a reason, plenty are good
21:15:48Araqa particularly stupid limit
21:16:00ddl_smurfoh definitely, stay well << max_int/2
21:17:08Araqplus end users think in powers of ten, not in powers of two.
21:17:36renesacdepends on the problem
21:17:37renesac:P
21:17:38Araqso a limit of 100 characters per message only sounds stupid to programmers
21:17:41ddl_smurfif i was a server receiving a packet size i'd have to allocate, i'd put a well named constant MAX_PACKET_SIZE or something that has a reason to be there for security, but also thus documents it
21:18:23ddl_smurfyeah but only programmers wonder whether the limit is necessary too
21:18:40ddl_smurfcan cater to every goat outside and its numerical preconceptions
21:20:16ddl_smurfanyway i apologise for the interruption, its jsut, too often ive hit a stupid limit by some coder for no reason (or more accurately for lazyness), i want less arbirtrary limits out there, not more =/
21:20:42ddl_smurfurl's have a max safe length for example
21:20:52ddl_smurfpath names too
21:20:58ddl_smurf(in old windows)
21:21:27AraqI never experienced this, most of the time it's programmers believing in their process should be able to use all RAM causing all sorts of problems for the server
21:21:50ddl_smurfof course they should
21:22:09ddl_smurfit's up to the OS to limit that shit, not each individual programmer picking some fixed constant for all
21:22:16*vendethiel quit (Ping timeout: 240 seconds)
21:22:16vikatonoh my jesus
21:22:21reactormonkAraq, where should I start digging for https://github.com/Araq/Nim/issues/2634 ?
21:23:00Araqddl_smurf: aye right that smart OS that picks a process at random and kills it
21:23:41ddl_smurfyeah you set the limit with rlimit/ulimit, and you program with if (!malloc()) bite_smaller();
21:24:51ddl_smurf(this is assuming you have no other way to control ram usage, which often you can by simply throttling stdin or the like)
21:26:17Araqreactormonk: dunno, sounds bad
21:26:44Araqreactormonk: but msgs.nim uses the very same mechanism and it works
21:27:53ddl_smurfi've never understood why people want free ram - free ram is a sign of poorly using your resources
21:28:06renesacddl_smurf: cache
21:28:19*vendethiel joined #nim
21:28:27ddl_smurfrenesac: as in geo ?
21:28:44renesacno, as file system cache, and other things the kernel can do with the free ram
21:28:55ddl_smurfif the kernel is using its not free
21:29:08renesacok, then I don't remember seeing free ram
21:29:13Araqddl_smurf: you don't get provable bounded memory usage out of this approach :P
21:30:05ddl_smurfmost OSs these days do very well on that account, i'm just saying optimising for ram is not a simple min()
21:31:03ddl_smurfAraq: agreed - this practice is invalid in the pursuit of phd's or in aeronotics/medical
21:32:19*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:33:28ddl_smurf(actually no - this approach is not incompatible, you can still fit in the smallest workable space, and in any case, anything that needs reliability should have "replayability-ish-ov-ness", i mean the OS killing your process is definitely a feature and should be considered part of your flow)
21:34:09Araqthere might not even be an OS
21:34:10*yglukhov_ quit (Quit: Be back later ...)
21:34:38ddl_smurfin that case you've just moved the problem into malloc's impl.
21:40:12renesacif you get a provable bounded memory of 10TB for a desktop application that don't helps
21:40:42renesacarbitrary limits in arbitrary places using magic numbers don't really solve this problem
21:41:13renesacif you need a provable memory bound, then you know what it is and have to be able to engineer your whole application around it
21:41:18ddl_smurfthey do make the proving *much* easier
21:42:06ddl_smurfthey also make the code much simpler - which i think is why there are so many of em
21:42:08renesacddl_smurf: yeah, but what you want isn't to prove a 10TB bound, but to make your program provably fit in a X bytes bound
21:42:28*elbow_json quit (Ping timeout: 256 seconds)
21:42:41ddl_smurfbut with the fixed limit you can just pick x - overhead
21:42:58renesacyeah, but you shouldn't use magic numbers in the middle of the code at least
21:43:16renesacyou probably want something you can tweak
21:43:26ddl_smurfat the least a define
21:43:31renesacexcept for fixed things, like some lenght that needs to be expressed in a uint8
21:43:33ddl_smurfbut there are use cases
21:43:47ddl_smurfeven then you can document those things
21:44:34ddl_smurf#define MAX_PACKET_SIZE (min(EXPECTED_MEMORY, sizeof(uint8), 10000))
21:44:57renesacyeah, that is sane
21:45:00Araqoh so now it's about "magic numbers". well *shrug*
21:45:52ddl_smurfwell i think the naming of it also kind of removes the arbitrary of it, like the example of, you can inject a lot of explanation into the limit
21:46:17Araqthat's just DRY for integer literals
21:46:30Araqnothing to debate here
21:47:00ddl_smurfthere's the dry + the explaining
21:48:03renesacand you probably want 1 << sizeof(uint8) * 8 <-- I want a nice name for that
21:48:09renesacin the code above
21:48:20*elbow_json joined #nim
21:48:55ddl_smurfi don't think the code above makes any sense, it's really metaphore-c
21:49:13renesacI know, but it is a common error, and a common thing to want
21:49:18*vendethiel quit (Ping timeout: 246 seconds)
21:49:32ddl_smurfwhat's the priority between << and * ? or alternatively what's the value of your expr ?
21:49:43Araq'bitsizeof' ?
21:49:53renesacops, yeah, the priority is wront
21:49:54*Trustable_2 quit (Remote host closed the connection)
21:49:56renesac*wrong
21:49:59ddl_smurfno its weirder
21:50:10renesacbitsizeof would return 8
21:50:20renesacthe thing above would return 256
21:50:24ddl_smurfi don't think that makes sense
21:50:39ddl_smurfyou want max_uint8 ?
21:50:41renesacif I wrote it correctly
21:50:53renesachum, yeah
21:50:56renesacright
21:51:33ddl_smurfin nimrod theres a succ and prec no, if theres a last that would be it
21:51:47renesacok, that can be done with T.high() + 1
21:51:56ddl_smurfi think you want (1<<(sizeof(T) + 1)) -1
21:52:04ddl_smurffor 255
21:52:15renesacsizeof gives the size in bytes
21:52:24ddl_smurfor right gotcha
21:52:45Araqtemplate bitsizeof(x) = sizeof(x)*8
21:54:24ddl_smurfso many off-by-ones - time for me to stop coding
21:55:07renesacthere are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.
21:55:24ddl_smurfstealing it =)
21:55:48renesacthis specific quote don't quite have attribution AFAIK
21:56:20ddl_smurfi usually disclaim when not mine, but i'll be damned if in the age of google i'll waste space with author names
21:56:24renesacthe original one was from Phil Karlton, but didn't include off-by-one errors
21:56:55ddl_smurf(optimising my wetware ram is very different)
21:58:50*grncdr quit (Quit: Leaving.)
21:59:08ddl_smurfhttp://en.wikipedia.org/wiki/Octet_(computing) "The term is often used when the term byte might be ambiguous, as historically there was no standard definition for the size of the byte."
21:59:20ddl_smurfi dont want to code in a world where thats a variable =(
21:59:56renesacthat is the reason for C original integer types don't specifying width
22:00:07ddl_smurfyeah ok but
22:00:08ddl_smurfnope
22:00:14renesacI know
22:00:49renesacluckly we aren't in that world anymore
22:01:00Araqreally? isn't that what you're arguing for though? no arbitrary sizes, make the code generic to deal with anything? ;-)
22:01:02ddl_smurfi just found out about it
22:01:13ddl_smurfits like finding out "milli-" may be a variable
22:01:22ddl_smurflike million/billion fiasco
22:01:54renesackilo can mean 1024 or 1000 depending on the context
22:01:55renesac:P
22:02:13ddl_smurfAraq: it absolutely is - my trouble is with the mountains of code in my past that rely on that and my expectations for the byte to change again - its human
22:02:30renesac(nobody says kibibyte or whatever)
22:03:05ddl_smurfyeah, the guy who made the k=1024 thing up was really helpful to the world - thanks dude, come see me please i have a gift
22:04:31Araqthat's a typical programmer though. 1000?! what's this? a magic number?! that's not even a power of two ...
22:04:44Araq.. let's fix it ...
22:04:50ddl_smurfno its not
22:04:54ddl_smurfits lazy
22:05:17ddl_smurfits fuck this dividing by any number generalisation, i'll bit shift and that's what ill print
22:05:34ddl_smurfyou know it is
22:07:03ddl_smurfor someone drawing his square of flip-flops thinking itd be cool if width and height were the same size for his drawing to be symmetric, and it was annoying to do the .024 everywhere so "I dub thee 1024, 1k"
22:07:20vikatonI was benchmarking some frameworks of various langs
22:07:25vikatonand h00ly c0w
22:08:49ddl_smurfthat's Hindu right ?
22:16:10def-vikaton: so, what's so special?
22:35:00vikatonwel for starters
22:35:13*elbow_json quit (Remote host closed the connection)
22:35:19vikatonI was benchmarking hello world with Rust and Crystal
22:35:27vikatonand results were surprising
22:35:47nimnoob123ah that reminds me, need to dual boot linux on my win8 laptop
22:36:01nimnoob123wanted to test crystal
22:36:24vikatonhere it is vs Rust https://gist.github.com/Vikaton/3102c16ee14ef3d76244
22:36:37nimnoob123vikaton: how are you liking crystal?
22:36:39fowlas long as you beat rust i'm happy :p
22:36:57vikatonnimnoob123: I like it alot!
22:37:11nimnoob123yeah it looks pretty good
22:37:23vikatonresults were very impressive
22:38:00nimnoob123I wanted to like rust, i hate the syntax :/
22:38:34dom96vikaton: what about Nim? :)
22:38:37ddl_smurfimpressive, does rust do anything "more" ?
22:38:57vikatondom96: not there yet :P
22:39:07vikatonddl_smurf: what do u mean?
22:39:39ddl_smurfi am familiar with neither, is it like parsing a potential body, spliting headers, unescaping stuff ?
22:40:07vikatonI just created a new project with cargo, got Iron as a dependency, then put the iron hello world example and ran it with optimizations
22:40:17dom96vikaton: do please keep in mind that Jester hasn't been optimised at all yet.
22:40:23dom96(once you do get around to it)
22:40:40vikatono
22:40:44vikatonwill do
22:50:45Matthias247I would say these results are nearly neglible. Especially if you take into account that Crystal seems to use nonblocking IO and lightweight processes and Rust doesnt
22:51:48*solidsnack joined #nim
22:53:38cmk_zzzIs there any built in way to extend a sequenece in nim? something like this: @[1, 2, 3] + @[4, 5, 6] or perhaps @[1,2,3].extend(@[4,5,6])
22:56:18FDGFGFGDFDhttp://nim-lang.org/sequtils.html#concat,varargs[seq[T]]
22:56:38*gyeates joined #nim
22:56:42FDGFGFGDFDmisread sorry lol
22:57:29gyeateshow do you add a custom index accessing procedure on a type (e.g. customType[3])
22:58:18cmk_zzzFDGFGFGDFD: anyway, sequtils is something I can work with:)
23:01:11Araqgyeates: overload `[]`
23:01:13FDGFGFGDFDproc `[]`(x :customType, i: int)
23:01:15FDGFGFGDFDprobably
23:02:01*rektide_ is now known as rektide
23:02:32*Matthias247 quit (Read error: Connection reset by peer)
23:04:37*solidsnack quit (Ping timeout: 264 seconds)
23:05:15*BlaXpirit quit (Quit: Quit Konversation)
23:08:53Araqyup
23:12:03*vendethiel joined #nim
23:13:38*gsingh93 joined #nim
23:23:02*solidsnack joined #nim
23:25:58*wan quit (Quit: WeeChat 1.1.1)
23:28:31*banister joined #nim
23:30:04gyeatesthanks - also is there a way to create an array of `n` size & type `T` and fill it with `nil` at init
23:30:30Araqit's filled for you with 'nil' already
23:30:50Araqvar s = newSeq[string](60) # 60 nil strings
23:34:52*vendethiel quit (Ping timeout: 272 seconds)
23:35:23reactormonkAraq, not exactly what I wanted to hear :-/ No idea what I'm doing differently. Would you mess around until it works or try to fix the compiler? Sounds like a nasty bug that might bite someone sometime
23:38:48Araqreactormonk: move the callback var to msgs.nim for a start. and of course you're right, we need to fix it.
23:47:30*solidsnack quit (Ping timeout: 252 seconds)
23:47:32*nimnoob123 quit (Quit: Page closed)
23:57:58*transfuturist quit (Quit: leaving)