<< 23-04-2015 >>

00:00:19*HakanD joined #nim
00:00:23perturbationhey all
00:00:32*elbow_jason quit (Ping timeout: 272 seconds)
00:01:20perturbationis there any support for range types with floats? (i.e., I want to have a float but restrict it to be between 0 and 1.0 for a 'probability' type?)
00:01:21*elbow_jason joined #nim
00:02:24flaviuperturbation: Nope, but there's already a feature request in the issue tracker.
00:02:39perturbation<3
00:02:43perturbationthis is why I love Nim
00:02:45perturbationthanks flaviu
00:04:49*HakanD quit (Ping timeout: 245 seconds)
00:05:26*cmk_zzz joined #nim
00:09:46*gokr quit (Remote host closed the connection)
00:14:53*gokr_ quit (Quit: IRC for Sailfish 0.9)
00:19:28*brson_ joined #nim
00:20:14*brson quit (Ping timeout: 264 seconds)
00:25:22*perturbation quit (Quit: Leaving)
00:31:27*vendethiel quit (Ping timeout: 256 seconds)
00:37:29*flyx joined #nim
00:45:25*flyx quit (Ping timeout: 264 seconds)
00:45:25*flaviu quit (Remote host closed the connection)
00:48:20*elbow_jason quit (Quit: Leaving)
00:49:01*flyx joined #nim
00:49:47cmk_zzzI need to pass -lssl -lcrypto to the nim compiler. I.e I dynamically need to link to ssl, but I don't know how to. any pointers?
00:50:54ldleworkcmk_zzz: nim --advanced
00:52:44cmk_zzzldlework: Ah, ok. Thanks:)
01:00:08def-cmk_zzz: --passL:-lssl --passL:-lcrypto might do the trick
01:01:12def-or just -d:ssl ?
01:05:42cmk_zzzdef-: Yes your first suggestion did the trick. I found it thanks to the --advanced options:). Now I just need to find out how to import types from C libraries. Perhaps I am doing it wrong but I need a few RSA functions from openssl which are not included in the wrappers, so I was just trying to call them using the header and importc pragma. But I need to pass a pointer to an RSA structure, but don't know how to get to it. (Sorry I am very new
01:08:44def-cmk_zzz: the best way would be to convert C headers into nim wrappers using c2nim
01:09:16def-if you have an RSA struct/object, the pointer of it is addr myRSA
01:10:15def-i haven't looked into the openssl wrapper, maybe it would make sense to just extend it with what you need
01:11:16cmk_zzzdef-: Yes, I'll look into the openssl wrapper. It may be easier to do that then do something on your own. An openssl_evp wrapper exists to in nimble and it almost does what I want so perhaps extend one of these.
01:12:27cmk_zzzAnyway I'm pretty exited about nim having just found it, so if I just can get my crypto functions to work I'll definately start using it for lots of our testing at work
01:13:09def-sounds good, what kind of testing?
01:14:44cmk_zzzdef-: It will act as a mock client for our server components (currently in python which is slow and hard to distribute) so will be used for functional testing and also as a load generation tool
01:15:29cmk_zzzI figure I can easily translate the python code to nim and get things fast + easy to send to people who needs it
01:16:30cmk_zzzI could use go but I don't like it :P
01:21:50transfuturistc2nim is a pain ;_;
01:22:05transfuturisti finally got the generated wrapper to compile, though
01:22:10transfuturistnow to translate the demos
01:23:44def-transfuturist: nice headers work quite well with c2nim in my experience: http://hookrace.net/blog/what-makes-nim-practical/#wrapping-libraries-with-c2nim
01:25:29transfuturistfreetype definitely does not have nice headers
01:26:42transfuturistby the way, your blog was how i found nim
01:31:09*vendethiel joined #nim
01:31:14*noobie_ quit (Quit: Page closed)
01:37:37*wan quit (Ping timeout: 264 seconds)
01:38:01*wan joined #nim
01:51:16*saml_ joined #nim
01:51:57*brson_ quit (Quit: leaving)
01:58:53*transfuturist quit (Quit: Lost terminal)
02:13:05*darkf joined #nim
02:18:09*vendethiel quit (Ping timeout: 276 seconds)
03:02:41*vendethiel joined #nim
03:49:17*ChrisMAN quit (Ping timeout: 265 seconds)
03:53:20*a5i quit (Quit: Connection closed for inactivity)
04:03:49*milosn quit (Read error: Connection reset by peer)
04:05:05*milosn joined #nim
04:08:05*filwit quit (Quit: Leaving)
04:17:44*vendethiel quit (Ping timeout: 245 seconds)
04:23:10*yglukhov joined #nim
04:27:33*yglukhov quit (Ping timeout: 248 seconds)
04:32:42*vendethiel joined #nim
04:41:53*zahary joined #nim
04:51:54*saml_ quit (Quit: Leaving)
04:56:49*vendethiel quit (Ping timeout: 264 seconds)
05:01:15*vendethiel joined #nim
05:02:03*gsingh93 quit (Ping timeout: 245 seconds)
05:08:54*endragor joined #nim
05:22:01*johnsoft quit (Ping timeout: 264 seconds)
05:22:02*bogen quit (Ping timeout: 250 seconds)
05:22:38*johnsoft joined #nim
05:23:56*vendethiel quit (Ping timeout: 240 seconds)
05:26:46*vendethiel joined #nim
05:36:57*bogen joined #nim
05:51:59*vendethiel quit (Ping timeout: 246 seconds)
06:02:08*BlaXpirit joined #nim
06:25:44*vendethiel joined #nim
06:48:42*vendethiel quit (Ping timeout: 256 seconds)
07:11:01*endragor_ joined #nim
07:14:21*endragor quit (Ping timeout: 256 seconds)
07:18:02*bjz joined #nim
07:19:01*cmk_zzz_ joined #nim
07:23:05*endragor_ quit (Remote host closed the connection)
07:28:18*vendethiel joined #nim
07:34:59*yglukhov joined #nim
07:35:49repaxAraq: I think =finalize seems more consistent than =finalizer, compared to =destroy, =deepcopy - which are all verbs
07:40:14Araqrepax: yeah that was just a typo
07:45:23*Trustable joined #nim
07:47:44*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:07:33*coffeepot joined #nim
08:09:51*bjz joined #nim
08:12:51*ingsoc joined #nim
08:15:23*BlaXpirit quit (Quit: Quit Konversation)
08:24:28*Arrrrrr joined #nim
08:24:56*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:25:26ArrrrrrIs this an error? http://pastebin.com/YLdC01F3
08:26:49*bjz joined #nim
08:28:13AraqArrrrrr: looks like it
08:28:43Araqactually ... hrm
08:29:09Araqwell yeah, interesting bug
08:32:21*vendethiel quit (Ping timeout: 248 seconds)
08:34:03*endragor joined #nim
08:34:21ArrrrrrThanks. Good morning.
08:34:24*Arrrrrr quit (Quit: Page closed)
08:34:56*vendethiel joined #nim
08:35:23*bjz quit (Ping timeout: 256 seconds)
08:40:28*Pisuke joined #nim
08:41:41*milosn quit (Ping timeout: 244 seconds)
08:48:55*Ven joined #nim
08:54:21*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:56:20*endragor_ joined #nim
08:59:33*endragor quit (Ping timeout: 248 seconds)
09:00:57*synthmeat joined #nim
09:01:44*synthmeat left #nim ("WeeChat 1.2-dev")
09:04:55*Ven joined #nim
09:17:25*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:29:28*gokr_ joined #nim
09:41:47*vendethiel quit (Ping timeout: 250 seconds)
09:58:44*vendethiel joined #nim
10:07:30*milosn_ joined #nim
10:13:05*milosn_ quit (Ping timeout: 246 seconds)
10:20:21*vendethiel quit (Ping timeout: 250 seconds)
10:21:22def-Araq: I don't see how to improve https://github.com/Araq/Nim/pull/1960
10:23:13*Sharcho joined #nim
10:23:58SharchoHow do I allocate a fixed size array with an unknown size?
10:24:47def-Sharcho: You can use a seq and not resize it
10:25:51Sharchodef-: will that have a similar memory efficiency to an array, i.e. no pointers for each item in it?
10:26:28def-a seq is a single block of memory on the heap, which you have a pointer to
10:27:10Sharchodef-: thanks
10:28:17*HakanD joined #nim
10:44:03*endragor_ quit (Remote host closed the connection)
10:44:32*endragor joined #nim
11:05:06*johnsoft quit (Read error: Connection reset by peer)
11:05:33*johnsoft joined #nim
11:08:37*BlaXpirit joined #nim
11:10:07*vendethiel joined #nim
11:11:22*HakanD_ joined #nim
11:12:33*HakanD__ joined #nim
11:13:23*Kingsquee quit (Quit: Konversation terminated!)
11:13:29*cmk_zzz_ quit (Ping timeout: 256 seconds)
11:14:28*HakanD quit (Ping timeout: 256 seconds)
11:15:33*HakanD_ quit (Ping timeout: 248 seconds)
11:19:59*untitaker_ joined #nim
11:20:14*zahary quit (Read error: Connection reset by peer)
11:23:07*untitaker quit (Ping timeout: 256 seconds)
11:24:05*milosn_ joined #nim
11:25:38*milosn_ quit (Read error: Connection reset by peer)
11:27:14*cmk_zzz_ joined #nim
11:33:41*vendethiel quit (Ping timeout: 248 seconds)
11:37:11federico2here's a stub of the use cases wiki page https://github.com/Araq/Nim/wiki/Nim-use-cases
11:40:30yglukhovNim is great for scripts. I have used it to automate my clash of clans bot.
11:40:34yglukhov=)
11:42:17*vendethiel joined #nim
11:42:42*emilsp quit (Read error: Connection reset by peer)
11:42:49federico2yglukhov: while it's certainly more scriptable than other languages, would you really recommend it to replace Python/bash/makefiles to do system administration "chores"? Honestly we are not there yet
11:43:21yglukhovpython - definitely. bash - maybe not yet.
11:43:26yglukhovmake - definitely
11:43:30yglukhovwe have nake, btw
11:43:31yglukhov=)
11:44:00yglukhovhttps://github.com/fowlmouth/nake
11:44:57federico2yglukhov: keep in mind that the average script user/developer might be busy doing system eng. work and does not want to spend monts on learning a new language. Also, python/perl/bash are avaliable everywhere while a Nim compiler is not (yet)
11:46:26federico2urgh DATWPL
11:47:11BlaXpirithorrible
11:47:34BlaXpiritsome would say it makes the product completely unusable
11:47:54*untitaker_ left #nim (#nim)
11:48:25yglukhovwhy?
11:49:10yglukhovBlaXpirit do you mean nake or datwpl? =)
11:49:29BlaXpiritdatwpl makes nake unusable, in some people's opinion, whom i'd agree with
11:49:46yglukhovwhats so bad about it?
11:50:55BlaXpiritmaybe that it's a goddamn joke?
11:51:36BlaXpiriteven if its contents were considered seriously,
11:52:18BlaXpiritit only allows to "DO AS THOU WILST" with the license file itself, and only if you "stumble upon it"
11:52:24yglukhovIf it's really an issue, i don't think fowlmouth will mind changing the licence to whetever is cosidered seriously. MIT, BSD? fowlmouth, will you?
11:53:42BlaXpiritCC0 seems to be the best option for releasing to public domain.
11:54:04*cmk_zzz_ quit (Ping timeout: 265 seconds)
11:54:30federico2generally speaking, why would you want to use a license that is written by someone who is *not a lawyer* in the first place
11:55:05BlaXpiritjust carelessness or ignorance
11:55:13yglukhovare you serious guys? =)))
11:55:37BlaXpiritidiots who create joke licenses are the only ones to blame
11:56:07yglukhovwhat about the tool itself? if you find it useful, why not file a bug report on the license?
11:56:23BlaXpiritwoops, sorry
11:56:33BlaXpiritlooks like it's one-of-a-kind license
11:56:35BlaXpirit:p
11:57:03*TEttinger quit (Ping timeout: 245 seconds)
11:57:35federico2yglukhov: ignoring BlaXpirit ranting for a second, I am. Silly licenses create a lot of complexity for companies that need to make sure that they are not in violation.
11:59:33federico2...and this hurts FOSS in general
11:59:48federico2bbl
12:00:02yglukhovwell, I'm almost sure fowlmouth doesn't care much about the license (just like I would not care), so we just need to ask him to change it =)
12:04:01*vendethiel quit (Ping timeout: 264 seconds)
12:43:29*bjz joined #nim
12:48:19*vendethiel joined #nim
12:49:54*Ven joined #nim
12:50:06*mpthrapp joined #nim
13:05:58SharchoIs there an easy way to get a random int64 (signed) from the random module?
13:06:07*HakanD__ quit (Quit: Be back later ...)
13:09:57*vendethiel quit (Ping timeout: 265 seconds)
13:11:49SharchoSharcho: nevermind
13:12:19*HakanD__ joined #nim
13:14:17*vendethiel joined #nim
13:17:14fowlmouthi think it clearly says that you can do what you want with it?
13:17:25fowlmouthfork relicense idgaf
13:18:09*Demon_Fox quit (Ping timeout: 256 seconds)
13:18:25fowlmouthoh you say it only applies to the license itself
13:18:47*Demon_Fox joined #nim
13:24:16*Demon_Fox quit (Ping timeout: 240 seconds)
13:26:16*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:27:08*Demon_Fox joined #nim
13:32:49*endragor_ joined #nim
13:36:08*endragor quit (Ping timeout: 256 seconds)
13:36:42*vendethiel quit (Ping timeout: 256 seconds)
13:41:25HakanD__fowlmouth: why not change to mit/bsd/something, or just public domain?
13:42:54*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:43:52*vendethiel joined #nim
13:46:30gokr_pd doesnt fly that well in all countries.
13:48:02*banister joined #nim
13:49:37fowlmouthlicenses are annoying
13:55:57*endragor_ quit (Remote host closed the connection)
13:56:26*endragor joined #nim
13:56:50HakanD__annoying, but necessary -_-
13:57:38*a5i joined #nim
14:06:13*xcombelle joined #nim
14:06:40*vendethiel quit (Ping timeout: 272 seconds)
14:07:19*xcombelle quit (Client Quit)
14:07:26*xcombelle joined #nim
14:07:26*xcombelle quit (Remote host closed the connection)
14:07:38*xcombelle joined #nim
14:09:13*vendethiel joined #nim
14:09:25*gokr_ quit (Ping timeout: 264 seconds)
14:09:50*OnO joined #nim
14:11:34*OnO quit (Client Quit)
14:15:14xcombellehi everybody
14:16:25*OnO joined #nim
14:17:08*endragor quit (Read error: Connection reset by peer)
14:17:20*endragor joined #nim
14:18:18*Ven joined #nim
14:18:56Araqdef-: how come?
14:19:33def-Araq: i don't understand what's going on there and what's wrong with it. Too much conversion magic
14:19:38*OnO quit (Client Quit)
14:20:07Araqwell if you don't understand the PR, it's hardly good enough, is it ;-)
14:20:25AraqI too think it's convoluted
14:26:34*milosn joined #nim
14:26:46*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:30:45*vendethiel quit (Ping timeout: 248 seconds)
14:31:34*darkf quit (Quit: Leaving)
14:37:08*johnsoft quit (Ping timeout: 250 seconds)
14:37:32*johnsoft joined #nim
14:41:20*MightyJoe is now known as cyraxjoe
14:49:55*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:50:33*bjz joined #nim
14:56:24*endragor_ joined #nim
14:58:08*banister joined #nim
14:59:29*vendethiel joined #nim
14:59:46*endragor quit (Ping timeout: 252 seconds)
15:00:36*endragor_ quit (Ping timeout: 240 seconds)
15:01:39*justicefries_ joined #nim
15:01:52*justicefries_ is now known as justicefries
15:10:42fowlmouthHakanD__, i'll change it to cc0 if gradha agrees
15:22:02*vendethiel quit (Ping timeout: 272 seconds)
15:32:37*OnO joined #nim
15:33:32*vendethiel joined #nim
15:37:07*gsingh93 joined #nim
15:37:10*yglukhov quit (Ping timeout: 252 seconds)
15:39:35*OnO quit (Read error: Connection reset by peer)
15:39:41*OnO_ joined #nim
15:41:51*ChrisMAN joined #nim
15:42:27*savorywatt joined #nim
15:42:57*Strikecarl joined #nim
15:47:49*OnO_ quit (Read error: Connection reset by peer)
15:48:18*OnO joined #nim
15:48:25*OnO quit (Client Quit)
15:50:17*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:55:08*vendethiel quit (Ping timeout: 250 seconds)
15:57:51*vendethiel joined #nim
16:10:26*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:13:28*HakanD__ quit (Ping timeout: 252 seconds)
16:14:04*HakanD__ joined #nim
16:18:50*vendethiel quit (Ping timeout: 246 seconds)
16:23:28*HakanD__ quit (Quit: Be back later ...)
16:27:39*vendethiel joined #nim
16:28:03BlaXpiritSharcho, are u still there?
16:28:09SharchoBlaXpirit: yes
16:28:18BlaXpiritwhat random module are u talking about
16:28:27BlaXpiritand did u find your answer
16:28:50SharchoBlaXpirit: I didn't, but I think I'll be alright with unsigned numbers for now
16:29:00SharchoBlaXpirit: you modulee
16:29:10SharchoBlaXpirit: your module
16:29:10BlaXpiritSharcho, there is a way
16:29:46BlaXpiritrandomInt(int64)
16:30:06*gsingh93 quit (Ping timeout: 256 seconds)
16:30:52SharchoDoesn't work for me, but maybe that's because I'm using @#old-compiler
16:41:49BlaXpiritSharcho, oh I just realized "61 commits behind master"
16:42:02BlaXpirityeah, that wasn't there :|
16:42:19BlaXpiriti wonder how difficult it would be to update it
16:43:51*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:44:42SharchoBlaXpirit: also it might be worth mentioning the old-compiler branch in the README, as it took me a while to figure it out
16:46:05BlaXpiritSharcho, the main thing driving me against such changes is that the next release has been meant to be imminent for the last couple of months
16:46:09BlaXpiritwhat a mouthful
16:46:38SharchoBlaXpirit: understood, anyway, it's no biggie
16:49:01*vendethiel quit (Ping timeout: 264 seconds)
16:50:45*HakanD__ joined #nim
16:53:47*brson joined #nim
16:55:37*yglukhov joined #nim
16:59:56*vendethiel joined #nim
17:02:32*BlaXpirit_ joined #nim
17:05:23*BlaXpirit quit (Ping timeout: 256 seconds)
17:05:28BlaXpirit_nope, now i remember that there is no way to bring recent changes in nim-random to 0.10.2
17:06:44*gsingh93 joined #nim
17:20:36*vendethiel quit (Ping timeout: 240 seconds)
17:26:43*yglukhov quit (Quit: Be back later ...)
17:43:25*ChrisMAN quit (Remote host closed the connection)
17:54:27*gsingh93 quit (Ping timeout: 264 seconds)
17:57:08*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:02:25*filwit joined #nim
18:06:17*HakanD__ quit (Quit: Be back later ...)
18:07:33*gsingh93 joined #nim
18:08:41*vendethiel joined #nim
18:14:50*Pisuke quit (Ping timeout: 252 seconds)
18:20:57*elbow_jason joined #nim
18:24:13*Jesin joined #nim
18:28:26*ChrisMAN joined #nim
18:33:47*yglukhov joined #nim
18:44:01*elbow_json joined #nim
18:44:36*elbow_jason quit (Ping timeout: 240 seconds)
18:46:28*Jesin quit (Quit: Leaving)
18:47:33*HakanD__ joined #nim
18:48:15*Jesin joined #nim
18:51:24*ChrisMAN quit (Quit: Leaving)
18:51:45*ChrisMAN joined #nim
18:53:30*touch joined #nim
18:54:30*fichtl joined #nim
19:02:35*EXetoC joined #nim
19:37:03*elbow_json quit (Ping timeout: 245 seconds)
19:43:21*a5i quit (Quit: Connection closed for inactivity)
19:51:31*elbow_json joined #nim
19:56:25*justicefries left #nim (#nim)
20:01:24*banister joined #nim
20:01:28*banister quit (Max SendQ exceeded)
20:07:29*Strikecarl joined #nim
20:07:48StrikecarlGuys
20:07:58StrikecarlI was messing around with "Streams"
20:08:30Strikecarland when i do except:
20:08:34Strikecarli get this error:
20:08:35Strikecarle:\nim\nim.nim(8, 7) Error: 'except' expected
20:08:49samlexcept: label?
20:09:12Strikecarlsource: http://pastebin.com/95EtxxGC
20:10:02BlaXpirit_are u kidding -_-
20:11:02StrikecarlI honestly have no idea wtf i did wrong xD
20:11:35StrikecarlI sticked to the math part for to long.
20:11:53samlStrikecarl, check indentation
20:12:05samlthings don't line up. after fixing indentation, it comiples
20:12:27samltry and except must line up
20:15:34samlI was thinking about manual memory management via checked exception. For example, compiler sees body of proc and sees new resource allocated but not freed. and there's no {.raises: [LeakError].} . and forces programmer to add that pragma to proc. caller of the leaking proc must catch and free.
20:17:03Araqsaml: interesting idea
20:19:00*Matthias247 joined #nim
20:19:45samli wonder how easy it is for compiler to detect leak and warns programmer
20:20:54*OnwardEuler joined #nim
20:22:50BlaXpirit_saml, isn't this similar to destructors?
20:24:33samldestructors can't leak into more than two scopes up?
20:25:05samli mean, with exceptions, you can just do try { main() } except LeakError: gc()
20:25:11samlor something like that
20:25:31samlwait.. but probably i'm just confused
20:25:56samlcause LeakError.. isn't really raised runtime.. it's compile time flag to warn programmers
20:26:33samli think resource leak stuff is not really exception
20:28:22SharchoIs there a way I can get the compilation mode (release/debug)?
20:30:10samlnim c -d:release
20:30:17samlSharcho, you mean from binary?
20:30:50Sharchosaml: yes, from nim the code
20:32:15SharchoIs there a constant set or something?
20:32:16HakanD__Sharcho: why do you want it?
20:32:40fowlmouthSharcho, defined(release) or defined(debug)
20:33:04samlwhen defined(release): ....
20:33:49SharchoHakanD__: I'm keeping benchmarking data, and I need to discard results from debug compilations
20:34:01Sharchofowlmouth, saml: thanks!
20:35:11*xcombelle quit (Quit: Leaving)
20:35:22samlhttps://gist.github.com/saml/9aae803abb8e2d2a5f84 Sharcho
20:35:49*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
20:38:14Sharchosaml: thanks
20:38:59*banister joined #nim
20:39:06*banister quit (Max SendQ exceeded)
20:44:41samli guess LeakedError could be thrown as proc returns to caller. but it's not really an exception.. because code should flow through
20:45:18fowlmouthwhat the fuck -_-
20:45:19*HakanD__ quit (Quit: Be back later ...)
20:45:20samlit's like finally that can cascade
20:45:27BlaXpirit_[:25:30] <saml> probably i'm just confused
20:45:31fowlmouthinst2.alive: true
20:45:31fowlmouthinst2.alive == true: false
20:45:31fowlmouthinst2.alive == false: false
20:45:57fowlmouthwhat the fluck is happening here
20:46:11samlwhat's inst2.alive?
20:46:15fowlmouthbool
20:46:24samldo you ahve full code?
20:47:15fowlmouthsaml, if you can debug this you deserve a medal https://gist.github.com/fowlmouth/73fcf0a36bfd1d224e1e#file-gistfile1-nim-L457
20:48:52samlmaybe c boolean vs. nim's boolean equality?
20:49:47samltry ord(inst2.alive) == ord(true)
20:51:09*banister joined #nim
20:52:02fowlmouthi think this is a nim error
20:54:44Araqsaml: obviously it's not an exception, but some other effect
20:56:54*mpthrapp quit (Remote host closed the connection)
20:57:35samlit gets tricky though. a = newA(); b = newB(a); c = newC(a); free(c); return b; free(c) must not free(a), otherwise b.a is dangling pointer.
20:58:17samlthis kind of analysis could be hard
20:58:41fowlmouthis*
20:59:47Araqsaml: depending on what you're after it's turing complete, in others unsolvable
21:00:06*BlaXpirit_ quit (Quit: Quit Konversation)
21:05:53*shodan45 quit (Quit: Konversation terminated!)
21:10:23Araq*in other words
21:12:48samli see
21:15:44*yglukhov quit (Quit: Be back later ...)
21:24:18*OnwardEuler quit (Ping timeout: 272 seconds)
21:28:38*tinAndi joined #nim
21:29:42*fichtl quit (Remote host closed the connection)
21:31:14*Kingsquee joined #nim
21:31:58*cmk_zzz_ joined #nim
21:42:36SharchoHow do I convert an int64 to a string? I'm getting an error when I do intToStr(1234'i64)
21:44:46Araquse $ like the rest of us
21:47:41SharchoAraq: thanks
21:50:45*saml quit (Quit: Leaving)
21:56:35*Matthias247 quit (Read error: Connection reset by peer)
22:01:02*ingsoc quit (Quit: Leaving.)
22:12:44*vendethiel quit (Ping timeout: 265 seconds)
22:15:39fowlmouthhm
22:15:41*vendethiel joined #nim
22:15:49fowlmouthits failing because the function is returning 108 instead of 1
22:17:08Araqcomparing via '== true' is retarded anyway
22:17:21Araqit's already a bool
22:17:51*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:17:55Araqif (b == true) == true: echo "now, it's REALLY true"
22:18:36fowlmouthisnt this indicative of stack smashing
22:18:46fowlmouthor something horrible
22:19:29Araqwhy? I don't know your code but I bet it's full of
22:19:43Araqconverter toBool(x: cint): bool = bool(x)
22:19:47Araq:P
22:20:42fowlmouthno this is what im working on atm https://gist.github.com/fowlmouth/73fcf0a36bfd1d224e1e#file-gistfile1-nim-L457
22:23:26Araqyeah well
22:23:35Araqno idea if what you're doing is safe
22:23:47Araqall that casting and GCref'ing
22:33:07*Kingsquee quit (Quit: Konversation terminated!)
22:34:01fowlmouthfixed it^_^
22:34:56Araqcool. how?
22:35:10fowlmouththe inner cast expression was wrong
22:35:43Araqtold ya! ;-
22:36:27*Kingsquee joined #nim
22:37:14fowlmouthwell, the cast was either wrong or passing the wrong param, either way i fixed both things and it works
22:38:50renesacAraq: how I can make what I was doing the other day work more universally?
22:38:52renesachttps://gist.github.com/ReneSac/912219fbf0cfc87f4440
22:39:34renesacwould taking a pointer to the first element of the set/array/string and then access it via an unchecked array work always?
22:39:45thotypousjust did an experiment here: added -flto to gcc flags, and it reduced the size of the sample jester webserver from 256kb to 136kb on mips/openwrt target
22:39:46renesacexcept the gc safety issue
22:40:11fowlmouthrenesac, figure out what operations you need to call on the seq then write a concept for it
22:40:50renesacfowlmouth: I want to access an slice of an string or seq as an normal seq
22:40:58renesacw/o copying
22:41:15fowlmouthi understand
22:41:32renesachow a concept would help?
22:41:48AraqI wrote .shallow for that, dunno why you cannot use that and call it day
22:41:49renesacit needs state (the base and top in my case)
22:42:38fowlmouthwell if all you need to call on the seq is operations X Y and Z then any type that implements these operations can be used
22:45:18renesacI don't know how to use shallow in this case
22:45:38renesactype ShallowSeq {.shallow.} = seq ?
22:45:47renesacwith [T] there maybe?
22:47:03Araqnever mind, I misread your code, you don' t use the 'ref' at all
22:47:10Araqso what's the question again?
22:47:27Araqoverload by var/non-var. non-var creates a copy. so what
22:47:38renesacit won't work for the string
22:47:49Araqwhy not?
22:47:56renesacthe error is there
22:47:59renesacat the end
22:48:19renesacit seems to be sitting on const space
22:48:36def-thotypous: cool, you can also strip the binary afterwards if size matters
22:49:08thotypousdef-: that's with it already stripped ;)
22:49:28def-thotypous: --opt:size?
22:49:33*Sembei quit (Excess Flood)
22:49:46thotypousyes
22:50:03renesacit would be cool if I could create an view out of those even if I can't modify their values
22:50:38*Sembei joined #nim
22:52:24Araqrenesac: you can, but you need to use a ptr for that then
22:52:40renesachum
22:52:51Araqand now the string is not on const space, there is something different going on here
22:53:16*gsingh93 quit (Ping timeout: 240 seconds)
22:53:34renesacwell, the error is the same as the one for the seq on const space, but unlike the seq case, it won't fail at compile time anymore
22:53:57*renesac quit (Quit: Changing server...)
22:54:41AraqshallowCopy(result.data, cast[var seq[char]](data)) # I don't think this is correct
22:55:03*Manabu joined #nim
22:55:08Manabuback
22:55:29*Manabu left #nim (#nim)
22:55:36Araqyou're not renesac
22:55:38*renesac joined #nim
22:55:53AraqshallowCopy(result.data, cast[var seq[char]](data)) # I don't think this is correct
22:56:14renesachum
22:57:01renesacyeah, I don't know what the difference of string and seq[char] is, besides the \0
22:57:46Araqthere is none
22:58:02Araqbut I think your 'var' is wrong in this cast
22:58:29*vendethiel quit (Ping timeout: 248 seconds)
22:58:34renesacI'm receiving a "var string"
22:58:51renesaccan't 'var" be used this way in casts?
22:58:51renesacor should I use "ref"?
22:58:57renesacor what?
22:59:12AraqshallowCopy(result.data, cast[seq[char]](data))
23:03:13*Jesin quit (Quit: Leaving)
23:04:41Araqfowlmouth: why don't we have marshal.nim at compile-time?
23:05:02Araqthat's a seriously missing feature, staticExec doesn't cut it without that
23:05:17*Jesin joined #nim
23:05:25federico2anyone familiar with arduinos around?
23:05:30fowlmouthit just became possible
23:05:49*a5i joined #nim
23:07:12Araqfowlmouth: what do you mean?
23:08:28renesacyeah, it seems to be working now
23:08:29renesacthanks
23:08:52renesacmaybe I will do something with ptr for const data too, but I think I'm set for now
23:09:36renesacah, one more thing, how can I know from insde the code if bounds check is on or off?
23:09:45renesacI can only access the "release" or "debug" variables
23:10:07renesacbut not a "boundChecks" variable, not even when I use --boundChecks:on
23:10:30Araqwhen compileOption("boundChecks") or something like that
23:10:39renesachum
23:11:21renesacyeah, that is it
23:11:43thotypouson x86_64, nim compiler reduces from 1535576 to 1092472 with -flto
23:11:47thotypousboth with -Os
23:12:05thotypousah, sorry, forgot to strip :P
23:12:13thotypousits from 1211312 to 1092472
23:12:16thotypousnot so huge difference
23:13:27*Trustable_2 joined #nim
23:13:54renesac--opt:size?
23:14:56thotypousyes, --opt:size corresponds to -Os in gcc
23:15:23*Trustable quit (Ping timeout: 245 seconds)
23:15:32*vendethiel joined #nim
23:15:50*Trustable_2 quit (Read error: Connection reset by peer)
23:16:44renesacthere are some threads onf the forum about this
23:17:36renesacand you can do some more extreme shrinking with --os:standalone, depending what your target use is
23:18:38thotypousnice, thank you :)
23:19:29*tinAndi quit (Quit: ChatZilla 0.9.91.1 [Firefox 37.0.1/20150402191859])
23:20:01*Trustable_2 joined #nim
23:21:04thotypousjust for the record: you also need to pass -Os to the linker (besides -flto) with MIPS gcc, otherwise it does lto for speed (aggressive inlining)
23:21:34AraqI hope you use deadcodeelim:on too
23:21:46Araqor d:release
23:22:12*Trustable_2 quit (Client Quit)
23:22:48thotypousAraq: i'm using d:release, does it already activate deadcodeelim?
23:22:55Araqyup
23:23:00thotypousnice, thanks
23:23:26thotypouswe shall see if i'm able to get a smaller executable than the original C++ one :P
23:23:41Araqdef-: the bug has nothing to do with modules, just with the order in which the methods are declared
23:28:25*gsingh93 joined #nim
23:30:52SharchoLet's say I want to write a parallel file word count from a single large file. What would be the best way to do it? I suppose would need async io, and several workers. What would be the best approach? threadpool, channels or something else. Any similar examples?
23:37:18*vendethiel quit (Ping timeout: 272 seconds)
23:37:19AraqSharcho: we dont know yet. I'd use the threadpool
23:41:32*vendethiel joined #nim
23:43:59Araqis it too late to break multi-methods and require the dispatcher method to be explicit?
23:45:06SharchoI'm not sure I understand
23:45:18fowlmouthAraq, why would you want to do that
23:45:43Araqcause it is a pita
23:47:15fowlmouththe order of method declaration thing?
23:47:23Araqyes
23:47:37Araqyou know this bug?
23:47:48fowlmouthwhere you have to define the highest type first
23:48:00Araqyes
23:48:57Araqactually I can detect this and make it a compile-time error at least for now
23:49:10Araqthat's a good hack
23:49:20fowlmouthwhy is that a problem though?
23:49:30Araqwell it's a bug
23:49:38fowlmouthis the first method declared decided to be the dispatcher?
23:49:46Araqkind of
23:50:03fowlmouthseems like the dispatcher should be created last?
23:50:15Araqit is
23:50:27Araqbut it is *attached* to the first encountered method
23:50:46Araqwhich ... causes all sorts of problems
23:51:40fowlmouththey can't be separated?
23:52:35Araqnever mind I'm an idiot
23:52:48fowlmouthlol ._o
23:55:26fowlmouthi looked at the generated c and they are in separate functions
23:55:48Araqthat's not the problem, never mind
23:55:50*alex98 joined #nim
23:55:57Araqthe fix just looks totally different
23:56:04AraqI need to sleep, good night
23:56:09fowlmouthgn