<< 18-06-2016 >>

00:01:11Araq_yeah but i dunno if i patched repr to show this :P
00:01:17*pregressive joined #nim
00:01:22Araq_I planned to do this
00:06:09cheatfateAraq_, so right now when i'm debugging my macro with `echo(toStrLit(a))` all names i have generated looks like `param` and `param`
00:06:25cheatfatenot so unique
00:06:30cheatfateas promised :)
00:06:33Araq_told ya.
00:06:46Araq_you can patch the compiler though
00:07:34cheatfateok nm its not very important, one thing which very needed for me - convertation of arguments to NimNode
00:08:21fowlThey are unique
00:09:07fowlThey just have the same name
00:10:26*yglukhov quit (Remote host closed the connection)
00:13:56cheatfatefowl, lol they are unique but have same name :)
00:14:23cheatfatebut i understand that strLit() could not handle this and shows not unique names
00:17:36philohow can I compare a char to the first letter of a string?
00:22:18fowlthe name is the least important aspect of a symbol so
00:25:12*akaisora joined #nim
00:27:42philoI can't convert a char to a string, nor vice versa, so how can a compare a char to a letter in a string?
00:34:30*gokr quit (Ping timeout: 246 seconds)
00:40:01*Demos joined #nim
00:49:02*abruanese joined #nim
00:50:38*Demos_ joined #nim
00:58:19*Demos_ quit (Ping timeout: 260 seconds)
01:10:54*yglukhov joined #nim
01:17:06*francisl quit (Quit: francisl)
01:17:18*yglukhov quit (Ping timeout: 244 seconds)
01:39:04*pregressive quit (Remote host closed the connection)
01:39:36*pregressive joined #nim
01:43:58*pregressive quit (Ping timeout: 252 seconds)
01:48:35lazypenguinphilo: echo(yourString[0] == 'a')
01:52:48*chemist69_ quit (Ping timeout: 272 seconds)
01:54:52*vendethiel joined #nim
01:59:23*edub4rt quit (Quit: Page closed)
02:05:52*chemist69_ joined #nim
02:20:45*freezerburnV quit (Ping timeout: 276 seconds)
02:27:38*Demos_ joined #nim
02:38:47*akaisora quit (Read error: Connection reset by peer)
03:14:34*yglukhov joined #nim
03:19:03*yglukhov quit (Ping timeout: 240 seconds)
03:27:48*mahasamoot quit (Ping timeout: 272 seconds)
03:29:04*philo quit (Ping timeout: 272 seconds)
03:47:08*lazypenguin quit (Quit: Leaving)
03:53:20*chemist69_ quit (Ping timeout: 258 seconds)
03:55:42*chemist69_ joined #nim
05:16:34*yglukhov joined #nim
05:21:24*yglukhov quit (Ping timeout: 260 seconds)
05:23:15*endragor joined #nim
05:35:55*Demon_Fox joined #nim
05:38:39*chrisheller quit (Remote host closed the connection)
05:43:26*chrishel_ joined #nim
05:51:09*Demos_ quit (Ping timeout: 260 seconds)
06:25:54*nsf quit (Quit: WeeChat 1.4)
07:01:01*chemist69_ quit (Ping timeout: 250 seconds)
07:05:20*chemist69_ joined #nim
07:09:23*pregressive joined #nim
07:11:37*pregressive quit (Remote host closed the connection)
07:18:19*yglukhov joined #nim
07:23:00*yglukhov quit (Ping timeout: 276 seconds)
08:20:42deavmiWhat does ordinal type mean?
08:31:19*yglukhov joined #nim
08:31:55*Polynomial joined #nim
08:36:11*branduardi_ joined #nim
08:36:26*xet7 quit (Quit: Leaving)
08:36:34*Polynomial quit (Ping timeout: 250 seconds)
08:43:59*bjz joined #nim
08:45:06*bjz_ quit (Ping timeout: 272 seconds)
08:49:33*euantor joined #nim
08:49:57*edub4rt joined #nim
08:51:39*edub4rt quit (Client Quit)
08:52:49*Matthias247 joined #nim
08:53:21*euantor quit (Remote host closed the connection)
08:54:14*edub4rt joined #nim
08:55:37*edub4rt quit (Client Quit)
08:57:27*edub4rt joined #nim
09:00:25*elrood joined #nim
09:15:48*nsf joined #nim
09:33:53*euantor joined #nim
09:33:57*deavmi_mobile quit (Quit: Cheers all. Be good and don't do drugs.)
09:36:32*euantor quit (Client Quit)
09:38:13*MyMind joined #nim
09:39:30*Sembei quit (Ping timeout: 276 seconds)
09:45:32*gokr joined #nim
09:51:46*GangstaCat joined #nim
10:00:57*endragor quit (Ping timeout: 276 seconds)
10:07:07*miqlas-H joined #nim
10:07:11miqlas-HHi Guys!
10:07:37miqlas-HHere is my patch to extending the Haiku support: http://termbin.com/g7w1
10:08:55dom96miqlas-H: Can you submit it as a PR on http://github.com/nim-lang/Nim?
10:13:29cheatfatei want to use macro in such way `await mymacro(..)`, and my macro generates some preparation code before it call to proc
10:13:48cheatfatehow i can finish my macro?
10:14:07cheatfateor i need to make await someproc(..) in macro?
10:15:33miqlas-Hdom96: i think, but not right now
10:15:58dom96cheatfate: what are you up to?
10:17:03cheatfatedom96, i'm making macro which accepting `varargs[typed]` it generates some preparation code and make call to someProc()
10:17:30cheatfateit must be someProc() returns Future
10:17:43dom96cheatfate: hrm, what's the use case for this macro?
10:17:52cheatfatedom96, performing sql query
10:18:06dom96cool
10:18:11cheatfatepostgres sql query
10:18:41cheatfatewhich can accept parameters of this query in arrays, but this parameters must be converted so i need some preparation code
10:19:07cheatfateand after that i need to call my proc execAsync() which returns Future
10:19:43cheatfateso i'm looking a proper way to do it, so for application it will be call like await mymacroName(sqlstatement, varargs[typed])
10:19:46dom96for 'await myMacro(...)' I think you will need to generate: 'await (command; command2; myFuture)'. You can check what the AST for that looks like by using 'dumpTree'.
10:21:47miqlas-HBye!
10:21:58cheatfatedom96, so if there like 100 commands in preparation i need to return `await (command0; ...; command99; myFuture)?
10:22:16*miqlas-H quit (Quit: Vision[0.9.7-H-20140108]: i've been blurred!)
10:22:46dom96cheatfate: I think so yeah
10:23:09cheatfateAraq_, ping?
10:23:14cheatfatei know you are alive :)
10:29:58cheatfatedom96, but it looks like tuple, is it ok?
10:30:29dom96cheatfate: what looks like a tuple?
10:30:39cheatfate'await (command; command2; myFuture)'
10:30:58cheatfateis `;` magic symbol which allows to put command in one line?
10:31:01dom96It's not a tuple. It's a expression list.
10:31:03dom96Yes.
10:38:30cheatfatedom96, for some reason i can't generate this expression list
10:39:24cheatfatedom96, https://gist.github.com/cheatfate/f21c0e24927500ebc5a0502d2246a75d this returns error
10:41:25dom96This works https://gist.github.com/dom96/167c0fb152f595542ad6bff32512c80c
10:41:31dom96But adding 'await' in front of it fails :\
10:44:45*bjz quit (Max SendQ exceeded)
10:45:51*bjz joined #nim
10:47:20*gokr quit (Ping timeout: 272 seconds)
10:48:26cheatfatedom96, looks like StmtListExpr a little bit undocumented ... :P
10:48:35cheatfatei can't find nnk for it
10:55:02cheatfateouch, nm i have found it
10:57:04*mostworst joined #nim
11:16:45*branduardi_ quit (Quit: Leaving)
11:17:14*hendi joined #nim
11:17:51*GangstaCat quit (Ping timeout: 264 seconds)
11:27:07*brson joined #nim
11:27:36*Matthias247 quit (Read error: Connection reset by peer)
11:32:11*yglukhov quit (Remote host closed the connection)
11:47:21*Eddy_ joined #nim
11:51:45*mostworst quit (Ping timeout: 244 seconds)
11:55:15*sdw quit (Ping timeout: 260 seconds)
11:57:42*desophos quit (Read error: Connection reset by peer)
12:01:13*Eddy_ left #nim (#nim)
12:19:20*mostworst joined #nim
12:37:41*nsf quit (Quit: WeeChat 1.4)
12:49:18*hendi quit (Ping timeout: 276 seconds)
12:58:58*brson quit (Quit: leaving)
13:11:48*elrood quit (Quit: Leaving)
13:13:19*chemist69_ quit (Ping timeout: 260 seconds)
13:15:38*chemist69_ joined #nim
13:34:45kierhow should I be organising source files in my nimble package?
13:35:47kierbefore v0.14.0 (or whatever the coincident Nimble version was) I had source files in a directory 'pkg/' under my repository root, and files imported each other as 'pkg.file'
13:36:02kierbut that setup doesn't seem to work anymore since the update
13:37:35def-you can probably work around that with a nim.cfg containing path = "$projectPath" (or something like that)
13:38:10*mostworst quit (Ping timeout: 244 seconds)
13:39:25kierhow should I ideally be doing it?
13:39:57def-internally you could just import with 'file' instead of 'pkg.file'. from other modules it should be available as 'pkg.file'
13:41:36kierah i see. imports within the same package are relative now?
13:43:11def-I'd guess it's one of the mentions of "relative" in 0.14: http://nim-lang.org/news/2016_06_07_version_0_14_0_released.html
13:46:59kieryep, it's in there (but doesn't mention the word "relative", try "path handling" instead).
13:47:07kierprobably should have read that at some point before now
13:54:41kierhuh, tables.clear() is broken. can't believe I didn't spot that earlier
14:00:22kieror am I just incompetent...
14:00:55*akaisora_ joined #nim
14:08:07*PMunch joined #nim
14:09:39*Trustable joined #nim
14:15:41*gokr joined #nim
14:20:22*Matthias247 joined #nim
14:25:39vktecHow do I delete an entry (or reset it to 0) in a CountTable?
14:31:30kiertable[key] = 0 ?
14:32:37kierfunctionally works, but it looks like the key still stays in the table
14:32:54*sdw joined #nim
14:33:13kierdoesn't look like there's a del proc for counttables
14:33:30vktecNope, it doesn't work
14:33:39vktecI tried that already
14:34:09kierit doesn't compile, or doesn't change the value?
14:34:17kiereither way that's probably an issue
14:34:21vktec 0 < val [AssertionError]
14:34:25vktec(runtime error)
14:34:54vktecIt's checking to see if it's negative, but doing it wrong
14:35:08vktecIt should be `not val < 0`
14:35:18vktecNo, wait
14:35:23vktec`val > 0`
14:35:29vktec`val >= 0`
14:35:30kierval >= 0 would work
14:35:31vktecSorry
14:35:54vkteckier: Yes, it's a bug in the code, AFAIK
14:35:57vktec*AFAICT
14:36:10vktecI wanted to make sure I wasn't missing something
14:36:14kierpossibly the combination of that and the fact that there's no 'del' method implies that there's some reason that removing entries from the table isn't implemented
14:36:32kierbut its more likely that its just a typo and that use case just hasn't been encountered yet
14:37:01kiermake an issue on github about it
14:37:15renesacor make a pull request directly
14:37:20kieror that
14:37:40vktecOkay, will do
14:38:01renesacexamples of usage for countTable in the documentation are also appreciated
14:38:16vktecOkay
14:38:20kierinterestingly, there's no assertion like that on CountTable.inc, so table.inc(key, -table[key]) is potentially a valid solution
14:38:47vktecOoh, thanks, I'll use that as a workaround for now
14:51:52vktecOkay, I've created an issue (it's a very minor change, so probably easier for a contributor):https://github.com/nim-lang/Nim/issues/4366
14:53:40*Trustable quit (Remote host closed the connection)
15:18:47vktecDoes `nim c -d:release` imply `nim c --opt:speed`?
15:18:59vktecCan I combine the two?
15:21:20vktecAlso, is running binaries compiled on one Linux distro on another distro a sensible idea?
15:21:53vktecIf not, can I get the C sources for my program and compile on the target machine?
15:22:06vktecSorry for the barrage of questions
15:23:18cheatfatevktec, it depends on cpu architecture and bitness
15:23:30cheatfatealso it depends on libraries you using
15:23:32vktecSame architecture
15:23:54vktecProbably not a good idea then, Arch vs Debian stable :D
15:24:17cheatfateif architecture is same and executable linked statically it will works, but if it linked dinamically problems can be
15:24:32vktecCan I tell Nim to statically link it?
15:24:47vktecOr check whether it's statically or dynamically linked?
15:32:34gokrvktec: You can check my article on ardunimo - I produce C files and compile them manually using a Makefile there.
15:32:57gokrhttp://goran.krampe.se/2016/02/25/nim-meets-arduino/
15:33:18*hendi joined #nim
15:33:22vktecThanks, I'll take a look
15:34:11*xet7_ joined #nim
15:36:00cheatfatedom96, its not a good idea to `if a.tzname == "UTC"` its better to check `if a.timezone == 0`
15:48:57*Matthias247 quit (Read error: Connection reset by peer)
16:01:05*JackIsJack joined #nim
16:08:28*NimianAsAlways joined #nim
16:12:26*JackIsJack quit (Ping timeout: 250 seconds)
16:13:57*xet7_ quit (Ping timeout: 250 seconds)
16:15:43sdwis the nim website on github? nim-atom is missing from the editor list on the faq page
16:16:06sdwI don't know what would be the best way to submit a PR
16:16:10*filcuc joined #nim
16:16:48dom96sdw: https://github.com/nim-lang/Nim/blob/devel/web/question.rst
16:17:25sdwthanks
16:19:48*NimianAsAlways quit (Ping timeout: 250 seconds)
16:21:15dom96cheatfate: 'a.timezone' seems to always be 0.
16:21:25dom96perhaps that's a different bug
16:22:24*deavmi quit (Ping timeout: 250 seconds)
16:27:24*ephja joined #nim
16:35:52*kingofoz quit (Ping timeout: 264 seconds)
16:36:10onionhammerare bounds checks still disabled in -d:release?
16:37:03*kingofoz joined #nim
16:38:38dom96onionhammer: looks like it: https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L54
16:40:06onionhammerhmm
16:40:19onionhammerseems like a lot of those shouldnt be disabled
16:46:45*kingofoz quit (Ping timeout: 244 seconds)
16:47:08*kingofoz joined #nim
16:49:10def-onionhammer: well, they cost you performance
16:50:15def-onionhammer: I benchmarked all of them once and the thing is in micro-benchmarks gcc compiles them away, but in realistic programs they have an impact
17:21:54*chemist69_ quit (Ping timeout: 272 seconds)
17:25:56*chemist69_ joined #nim
17:40:11*elrood joined #nim
17:43:17*xet7_ joined #nim
17:52:10*nsf joined #nim
18:02:20*Fribby joined #nim
18:06:18*philo joined #nim
18:06:25*mahasamoot joined #nim
18:07:17*mostworst joined #nim
18:11:20vktecAnyone here develop websites/webapps with Nim?
18:11:55vktecI'm trying to figure out the best way to deploy them...
18:14:42*deavmi_mobile joined #nim
18:25:07*mcc joined #nim
18:28:56Araq_vktec: behind a proxy that's been battle tested for security
18:29:11vktec:)
18:29:31vktecI was more wondering about how to handle compiling
18:29:52vktecie. compile fully on server, compile to c locally then to binary on server or compile fully locally
18:35:00*yglukhov joined #nim
18:37:41*yglukhov quit (Remote host closed the connection)
18:39:44Araq_compile on server.
18:40:02edub4rtI was trying to use tcmalloc/jemalloc with nim (by statically linking it) but found out that it didn't work, is it possible to use them instead of Nim's default allocator without disable the GC?
18:41:04vktecAraq_: Yeah, that's what I've decided
18:43:16edub4rtI saw that nim does have a lot of options for GC, but found no options for other memory allocators, nor disabling it without disabling the GC, that mades me think how performant is the nim's memory allocators compared to others one like tcmalloc?
18:44:18Araq_edub4rt: no it's not possible nor do jemalloc anything that would be beneficial for Nim, IMO.
18:45:07Araq_these malloc replacements try to serve allocation requests as fast as possible to different threads (shared heap), but Nim doesn't even require a shared heap
18:45:30Araq_so you trade lockfree cas instructions against no cas instructions nor locks at all.
18:47:36edub4rtbenchmarking the asynchttpdispatcher, the most used function is rawAlloc, which is a nim's allocator routine, I wanted to just throw away nim's memory allocator and use malloc/free instead then link the tcmalloc to see if would have performance gains, but I see that this is not possible, the GC is completely dependent on current allocator implementation
18:48:22edub4rtI do not know much about allocators internals, but I see no reason to allocator wasting much time allocating many small objects (that's whats is happening)
18:49:36Araq_before I wrote Nim's allocator I used dlmalloc
18:49:57Araq_mine allocator was faster :P
18:50:00Araq_*my
18:52:17edub4rtthat depends on the application, and IMO tcmalloc/jemalloc is much better than dmalloc
18:52:31edub4rtdlmalloc*
18:53:15Araq_yeah but iirc jemalloc uses Nim's algorithms anyway, they all pretty much converged to what Nim does
18:55:08Araq_that doesn't mean Nim's alloctor cannot be further optimized, but it's really not bad.
18:56:07edub4rtthen I will assume that it is fast as jemalloc for now, I just don't feel confident because I can't really test, but would be nice if the allocator had more abstraction, so we could switch and test other allocators, like we do with the GC
19:00:08Araq_which allocator supports isInteriorPointer in O(1) ?
19:00:42Araq_none of these. you cannot abstract away this critical feature requirement.
19:01:45edub4rtyep, I was trying to hack somehow to use malloc/free instead, but that function was the barrier, the GC would have to somehow be changed to function without it
19:02:23edub4rtdoes some kind of objectpool allocator class exists in nim? so I could use it instead of reallying in the GC and its memory allocator?
19:05:09edub4rtrelying*
19:05:25edub4rtfor what I'm doing an object pool would perform much better, and might be useful for others who doesn't want to use the GC too for a critical part
19:07:36Araq_well Nim advocates newObj instead of new(obj) so that you can make newObj use a pool
19:07:53*deavmi joined #nim
19:08:10Araq_I argued yesterday that it's a pretty bad idea, but *shrug* test it.
19:09:03PMunchHmm, is there/what is the correct way to do something like a malloc to copy part of an array into another in Nim?
19:15:37*lazypenguin joined #nim
19:16:25*PMunch quit (Quit: leaving)
19:19:09*filcuc quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/)
19:27:31*deavmi_mobile quit (Quit: Cheers all. Be good and don't do drugs.)
19:29:05*deavmi_mobile joined #nim
19:44:11*yglukhov joined #nim
19:50:57cheatfateAraq_, i have a small problem with macro :)
19:52:33cheatfateis it possible to make `await myMacro(..., varargs[typed])` and in macros i want to make some preparation and call {.async.} function
19:59:50Araq_no idea what you mean
20:02:04dom96he wants `await myMacro(...)` to expand like so: `await (command1; command2; newFuture())`
20:05:38philodoes anyone here do gui? If so which tk do you use?
20:06:15Araq_philo: libui
20:06:31dom96gtk
20:06:38dom96Araq_: Don't lie, you use SDL2.
20:06:59philonever heard of libui.
20:07:09Araq_dom96: ok ok, I lied. but libui is what I currently like best.
20:07:28philoAraq_, why is that?
20:07:33cheatfatedom96, problem that code is not working...
20:13:02*desophos joined #nim
20:19:41*Demon_Fox quit (Quit: Leaving)
20:22:28cheatfateAraq, i have function which makes query to postgres in async way using arrays which describes parameters to sql
20:22:43cheatfatei have macro which takes varargs[typed] and convert it to arrays
20:23:21cheatfatei want to call this function from macro
20:23:50cheatfateand my macro usage must be like 'await myMacro(..., varargs[typed])
20:24:53edub4rtsmall question, I have an object "b" inside another object "a", I normally I use a.b.method() to call a method from b, but I would like to create a shortcut like "let b = a.b" then use "b.method" (so I don't have to type "a."), but let/var will clearly not work here, as var would copy, and let would not allow to modify, so what I need is to capture b by reference, what is the proper way to do that?
20:26:31*mostworst quit (Ping timeout: 252 seconds)
20:31:04*mostworst joined #nim
20:32:33mccis b an object or a ref object?
20:34:32edub4rtan object
20:35:13edub4rtB = object ...
20:38:44mcchm, i am not sure this is a thing nim allows. i know you can get a ptr with addr a.b but that might have effects you don't want...
20:42:04Araq_edub4rt: var b = addr(a.b)
20:42:14Araq_there is no other way
20:46:33gokrIs it moving along? It looked darn neat
20:46:45gokr(oops, I am behind - libui I mean)
20:46:53ephjawhat up
20:48:31gokredub4rt: Generally of course that's "bad OO" - doing a.b.xxx
20:49:46*deavmi quit (Ping timeout: 250 seconds)
20:51:01edub4rtthat's why I would like a shortcut, and I do not want to store as a ref object because would cause more allocations
20:52:14gokrBut you wold be doing the same thing - just with less characters.
20:52:43gokrThe problem is that the code outside of a will be hardcoded to depend on a having a b.
20:52:58gokrBut I may be misunderstanding of course.
20:54:18edub4rtit is dependent in my code
20:55:10edub4rttried "var b = addr(a.b)[]" but that failed
20:55:59edub4rtin C is common to do this doing B& b = a.b
20:56:21edub4rtanyway I can live with that
20:58:54edub4rt"var b = addr(a.b)[]" must is copying to, capturing by reference without using pointers is clearly not possible in nim, maybe because can be considered dangerous, could have a keyword for that, but nvm
21:04:06*deavmi_mobile quit (Quit: Cheers all. Be good and don't do drugs.)
21:05:12*deavmi_mobile joined #nim
21:06:25fowlIn c++ you mean? anyway a reference there is just a hidden pointer
21:08:11edub4rtyep C++*, I know
21:09:59edub4rtother question, is it possible possible to create a C library using nim? to use in my C/C++ code?
21:10:13vktecedub4rt: Yes, it has been done
21:10:27vktecI can't remember the link, but there was a blog post
21:11:02*Heartmen- quit (Remote host closed the connection)
21:13:12*Heartmender joined #nim
21:13:35*Heartmender is now known as Guest2750
21:14:10gokrAraq_: Cool (ui)
21:15:22edub4rtnim would have to generate a C header, export functions, I guess that is not available by default and would need some hacking?
21:20:56Araq_edub4rt: Nim can generate a header for you
21:21:18edub4rthow?
21:21:32Araq_--header or --genHeader, can't remember
21:22:44mccedub4t: the way i think about the "can't get ref to a.b" thing is that non-ref objects in nim aren't really very object-like.. they're values... some of the object-oriented behaviors you're used to want refs to work
21:23:27*mostworst quit (Ping timeout: 276 seconds)
21:25:10edub4rtAraq_: it does generate a header, but with just 3 functions, none of mine, is there a pragma to mark which functions should be defined in the header?
21:25:29Araq_yes, .exportc them
21:26:47edub4rtAraq_: okay now it appears, but the name is unreadable (has types and numbers), how to give a proper name?
21:27:29Araq_.exportc: "namehere"
21:27:29edub4rtmy bad, aw the struct name is unreadable, the function name is ok, but still would need a prefix
21:27:43Araq_.exportc: "prefix$1"
21:32:16*chemist69_ quit (Ping timeout: 264 seconds)
21:32:27*gokr quit (Ping timeout: 250 seconds)
21:32:35*Guest2750 quit (Remote host closed the connection)
21:33:34*Heartmen- joined #nim
21:36:08*chemist69_ joined #nim
21:36:39edub4rtcool, so I can code a library in nim, compile to C, and use in my other C/C++ projects
21:37:54*Heartmen- quit (Client Quit)
21:38:55*Heartmen- joined #nim
21:39:18*nimnoob123 joined #nim
21:43:08*nimnoob123 quit (Client Quit)
21:46:34*Heartmen- quit (Quit: EliteBNC free bnc service - http://elitebnc.org - be a part of the Elite!)
21:46:35edub4rtdoes anyone know or have experience in using nim in production for any kind of server? if so, does your server app leak/crashes often or is it really solid stable?
21:46:46*Heartmen- joined #nim
21:51:47*Heartmen- quit (Quit: EliteBNC free bnc service - http://elitebnc.org - be a part of the Elite!)
21:53:06*elrood quit (Quit: Leaving)
21:55:54*Heartmen- joined #nim
21:56:33edub4rtI have tested nim's performance, portability, capability, APIs, now my only concern is stability for a server and debugging, but I guess debugging is easy considering there is tracing and debugging with gdb is possible, so my last concern is stability
21:56:45dom96edub4rt: The forum is written in Nim and seems to be running pretty solidly.
21:57:03dom96Although we do automatically restart it if it crashes.
21:57:57edub4rtdom96: does it leak? if you run for example, without restart, for 7 days, the mem will grow?
21:58:42edub4rtwhen it crashes, why it does? your app's fault? or nim's core fault?
21:58:51Araq_edub4rt: it used to do exactly that but with 0.14 these issues are gone, afaik
21:59:31dom96Indeed. It used to leak but now doesn't anymore.
21:59:47dom96Although I really need to add some uptime information into it
21:59:53dom96I'm not really sure what it's current uptime is
22:00:10dom96*its
22:00:13*Heartmen- quit (Remote host closed the connection)
22:01:08dom96But NimBot is also written in Nim and it's running very solidly.
22:01:11dom96!lag
22:01:11NimBot88ms between me and the server.
22:01:19dom96I really need to add more commands
22:01:40Araq_!ping
22:01:40NimBotpong
22:01:42edub4rtin a crash scenario for the nim's forum, do you find the root cause of the problem with ease?
22:02:11*euantor joined #nim
22:02:14edub4rtif so how? looking into the core dump with gdb? traceback?
22:02:33Araq_edub4rt: come on, never seen one of Nim's NICE tracebacks?
22:02:49edub4rtnope, I didn't test that yet
22:02:59dom96Indeed, the forum is running in debug mode so we get nice tracebacks in the logs.
22:03:02Araq_and you can combine -d:release with --strackTrace:on even though not many know about it
22:03:03edub4rtI didn't coded a crash yet
22:03:22*Heartmender joined #nim
22:03:30Araq_but yeah, better GDB support is being worked on too
22:03:44*Heartmender is now known as Guest52203
22:04:59*euantor quit (Remote host closed the connection)
22:05:09*ephja quit (Quit: WeeChat 1.5)
22:06:01dom96I just checked the logs and I don't actually see any crashes.
22:06:22edub4rtfor how long?
22:07:05edub4rthow can I can fool the nim compiler to crash so I can see a backtrace?
22:07:43dom96raise newException(Exception, "FOObar") in a proc
22:07:53*Guest52203 quit (Remote host closed the connection)
22:08:29edub4rtnot just an exception an actual C crash
22:10:34edub4rta SIGSEGV
22:11:23*Heartmen- joined #nim
22:11:24*freezerburnV joined #nim
22:12:36renesacedub4rt: search in the bugtrackers for the tag crash
22:12:44renesac*bugtracker
22:13:06edub4rthaha, good idea
22:13:21mcctype whatever = ref object\nx:int; var y:whatever; y.x = 0
22:15:09*ddl_smurf joined #nim
22:15:20Araq_ddl_smurf is back! wooohooo.
22:15:54ddl_smurfHiya =) Congrats on the continued dev
22:16:10*Heartmen- quit (Remote host closed the connection)
22:16:17*kulelu88 joined #nim
22:16:23Araq_thanks
22:16:24*akaisora_ quit (Ping timeout: 260 seconds)
22:16:32edub4rtmcc: thanks worked
22:16:49edub4rtsigsegv does print a nice traceback too, using gdb the traceback is also readable
22:16:58*Jesin quit (Quit: Leaving)
22:18:39dom96hello ddl_smurf!
22:20:13ddl_smurfhi dom96 =)
22:27:48dom96ddl_smurf: what brings you back to #nim? :)
22:28:51*freezerburnV quit (Ping timeout: 240 seconds)
22:29:09*yglukhov quit (Remote host closed the connection)
22:30:20Araq_boredom :P
22:30:44ddl_smurfirc =) it means i'm in trouble =) have a misbehaving esp8266
22:31:01ddl_smurfirc is had to follow man
22:41:47*hendi quit (Ping timeout: 250 seconds)
22:44:55*freezerburnV joined #nim
22:48:13cheatfatedom96, why i need newFuture() at the end?
22:48:28dom96cheatfate: you don't, it was just an example
22:49:05cheatfatebut last statement in list must be call to async functions?
22:51:41*Heartmen- joined #nim
22:54:14cheatfatei made it but got an error...
22:54:29cheatfateError: value of type 'Future[system.void]' has to be discarded
22:54:45cheatfatebut there no Future[system.void] at all
22:59:34*Heartmen- quit (Remote host closed the connection)
23:10:26*deavmi_mobile quit (Read error: Connection reset by peer)
23:12:28*Heartmender joined #nim
23:12:49*Heartmender is now known as Guest22271
23:16:04edub4rta is a string, "let b = a.substr(1,10)" does b points to a slice of "a" data or nim allocates a completely new string?
23:16:49*Guest22271 quit (Remote host closed the connection)
23:18:06edub4rtfrom what I understood in the code, nim does allocate a new one
23:19:05Araq_yes, that's also what Python does fwiw.
23:19:06edub4rtbut that's unoptimized, b uses a "let" statement, so there would be no need to allocate a new string
23:19:41Araq_sure there would unless you swap out completely Nim's internal representation of strings
23:20:13def-edub4rt: and what if you modify a later?
23:20:15edub4rtI just found out that slices of arrays does this too, woah, the slice allocates a new seq
23:21:04edub4rtthis changes completely how I was working and thinking, I will have to work with pointers to avoid extra allocations in those cases?
23:21:41Araq_no, you only need a decent Slice datatype
23:21:49Araq_which the stdlib lacks
23:21:51*arnetheduck joined #nim
23:22:33*Heartmen- joined #nim
23:23:04edub4rtAraq_: what python does has nothing to do with nim right? nim is completely other thing and I don't like python, so slow
23:24:44edub4rtnow I'm imagining extra allocations everywhere inside nim's internals
23:26:34edub4rtI don't get why there are let/var keywords if those optimizations are not made, I thought it was for performance reasons, but now I am thinking it's just for safety?
23:26:51*Heartmen- quit (Remote host closed the connection)
23:29:30Araq_it's easier to reply and explain things when people don't already know everything
23:30:28*heretobang joined #nim
23:30:29Araq_in Nim a string is struct { length, cap, data }
23:30:57Araq_how can you create a substring from 1 without a copy in this setup? you cannot.
23:31:58Araq_aha! you say, "see? this is all wrong, it should have been {length; char* data; } from the beginning!"
23:32:36Araq_so now every string you pass around is 2 machine words, not 1 and the ownership is unclear (can you append to a slice? if so, what is affected?)
23:33:00Araq_and the GC needs to deal with interior pointers which are harder to support
23:33:26Araq_fine, you say, keep a pointer to the beginning so that the GC can continue to be a RC'ing GC ...
23:33:53Araq_so the representation is { length; char* data; char* orig; }
23:34:11*fvs joined #nim
23:34:47Araq_now it's 3 words you pass around all the time and it's not that clear it's really so wise to pretend slicing is super cheap when it isn't
23:35:54edub4rtI see your point
23:36:50renesacopen array is a lenght and pointer duo?
23:36:53renesacor only a pointer?
23:37:13renesacI know it is for parameters only
23:37:23Araq_renesac: a duo
23:37:37renesacfor pointing at things on the satck?
23:37:41renesac*stack
23:38:39*arnetheduck quit (Ping timeout: 276 seconds)
23:40:31*chemist69_ quit (Ping timeout: 258 seconds)
23:41:46*arnetheduck joined #nim
23:42:57*chemist69_ joined #nim
23:43:40Araq_renesac: yes but it can point to anything
23:44:41*GangstaCat joined #nim
23:45:22*renesac_ joined #nim
23:45:53*Heartmen- joined #nim
23:47:06renesac_right
23:47:29Araq_edub4rt: I see more value in stealing C++'s "small string optimization" where the payload is directly embedded in the struct and x[1..3] copies, but doesn't allocate
23:48:05*renesac quit (Ping timeout: 260 seconds)
23:48:06edub4rtI still miss something to pass a slice of a buffer to another proc without duplicating, I don't want to use pointers/length but that now I see that as my only option, because the buffer is huge, and I want just to pass a slice of it for doing checksum
23:48:22*Demos_ joined #nim
23:49:03*arnetheduck quit (Ping timeout: 240 seconds)
23:49:26Araq_edub4rt: I usually pass array, start to the proc then
23:49:56edub4rtAraq_: okay for smalls strings I agree, either SSO or COW I'm fine, but in my case are huge buffers, and I am not even using string class, I just noticed that for strings, I can live with that
23:51:07*Heartmen- quit (Remote host closed the connection)
23:52:09*Heartmen- joined #nim
23:52:10edub4rtsimple enough, I was using slices because thought it was cleaner and the right way in Nim, but found this, okay will do this other way
23:55:07*Sentreen joined #nim
23:55:25*arnetheduck joined #nim
23:56:45*Heartmen- quit (Remote host closed the connection)