00:00:19 | * | HakanD joined #nim |
00:00:23 | perturbation | hey all |
00:00:32 | * | elbow_jason quit (Ping timeout: 272 seconds) |
00:01:20 | perturbation | is 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:24 | flaviu | perturbation: Nope, but there's already a feature request in the issue tracker. |
00:02:39 | perturbation | <3 |
00:02:43 | perturbation | this is why I love Nim |
00:02:45 | perturbation | thanks 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:47 | cmk_zzz | I 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:54 | ldlework | cmk_zzz: nim --advanced |
00:52:44 | cmk_zzz | ldlework: Ah, ok. Thanks:) |
01:00:08 | def- | cmk_zzz: --passL:-lssl --passL:-lcrypto might do the trick |
01:01:12 | def- | or just -d:ssl ? |
01:05:42 | cmk_zzz | def-: 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:44 | def- | cmk_zzz: the best way would be to convert C headers into nim wrappers using c2nim |
01:09:16 | def- | if you have an RSA struct/object, the pointer of it is addr myRSA |
01:10:15 | def- | i haven't looked into the openssl wrapper, maybe it would make sense to just extend it with what you need |
01:11:16 | cmk_zzz | def-: 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:27 | cmk_zzz | Anyway 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:09 | def- | sounds good, what kind of testing? |
01:14:44 | cmk_zzz | def-: 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:29 | cmk_zzz | I figure I can easily translate the python code to nim and get things fast + easy to send to people who needs it |
01:16:30 | cmk_zzz | I could use go but I don't like it :P |
01:21:50 | transfuturist | c2nim is a pain ;_; |
01:22:05 | transfuturist | i finally got the generated wrapper to compile, though |
01:22:10 | transfuturist | now to translate the demos |
01:23:44 | def- | 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:29 | transfuturist | freetype definitely does not have nice headers |
01:26:42 | transfuturist | by 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:49 | repax | Araq: I think =finalize seems more consistent than =finalizer, compared to =destroy, =deepcopy - which are all verbs |
07:40:14 | Araq | repax: 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:26 | Arrrrrr | Is this an error? http://pastebin.com/YLdC01F3 |
08:26:49 | * | bjz joined #nim |
08:28:13 | Araq | Arrrrrr: looks like it |
08:28:43 | Araq | actually ... hrm |
08:29:09 | Araq | well yeah, interesting bug |
08:32:21 | * | vendethiel quit (Ping timeout: 248 seconds) |
08:34:03 | * | endragor joined #nim |
08:34:21 | Arrrrrr | Thanks. 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:22 | def- | Araq: I don't see how to improve https://github.com/Araq/Nim/pull/1960 |
10:23:13 | * | Sharcho joined #nim |
10:23:58 | Sharcho | How do I allocate a fixed size array with an unknown size? |
10:24:47 | def- | Sharcho: You can use a seq and not resize it |
10:25:51 | Sharcho | def-: will that have a similar memory efficiency to an array, i.e. no pointers for each item in it? |
10:26:28 | def- | a seq is a single block of memory on the heap, which you have a pointer to |
10:27:10 | Sharcho | def-: 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:11 | federico2 | here's a stub of the use cases wiki page https://github.com/Araq/Nim/wiki/Nim-use-cases |
11:40:30 | yglukhov | Nim is great for scripts. I have used it to automate my clash of clans bot. |
11:40:34 | yglukhov | =) |
11:42:17 | * | vendethiel joined #nim |
11:42:42 | * | emilsp quit (Read error: Connection reset by peer) |
11:42:49 | federico2 | yglukhov: 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:21 | yglukhov | python - definitely. bash - maybe not yet. |
11:43:26 | yglukhov | make - definitely |
11:43:30 | yglukhov | we have nake, btw |
11:43:31 | yglukhov | =) |
11:44:00 | yglukhov | https://github.com/fowlmouth/nake |
11:44:57 | federico2 | yglukhov: 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:26 | federico2 | urgh DATWPL |
11:47:11 | BlaXpirit | horrible |
11:47:34 | BlaXpirit | some would say it makes the product completely unusable |
11:47:54 | * | untitaker_ left #nim (#nim) |
11:48:25 | yglukhov | why? |
11:49:10 | yglukhov | BlaXpirit do you mean nake or datwpl? =) |
11:49:29 | BlaXpirit | datwpl makes nake unusable, in some people's opinion, whom i'd agree with |
11:49:46 | yglukhov | whats so bad about it? |
11:50:55 | BlaXpirit | maybe that it's a goddamn joke? |
11:51:36 | BlaXpirit | even if its contents were considered seriously, |
11:52:18 | BlaXpirit | it only allows to "DO AS THOU WILST" with the license file itself, and only if you "stumble upon it" |
11:52:24 | yglukhov | If 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:42 | BlaXpirit | CC0 seems to be the best option for releasing to public domain. |
11:54:04 | * | cmk_zzz_ quit (Ping timeout: 265 seconds) |
11:54:30 | federico2 | generally 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:05 | BlaXpirit | just carelessness or ignorance |
11:55:13 | yglukhov | are you serious guys? =))) |
11:55:37 | BlaXpirit | idiots who create joke licenses are the only ones to blame |
11:56:07 | yglukhov | what about the tool itself? if you find it useful, why not file a bug report on the license? |
11:56:23 | BlaXpirit | woops, sorry |
11:56:33 | BlaXpirit | looks like it's one-of-a-kind license |
11:56:35 | BlaXpirit | :p |
11:57:03 | * | TEttinger quit (Ping timeout: 245 seconds) |
11:57:35 | federico2 | yglukhov: 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:33 | federico2 | ...and this hurts FOSS in general |
11:59:48 | federico2 | bbl |
12:00:02 | yglukhov | well, 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:58 | Sharcho | Is 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:49 | Sharcho | Sharcho: nevermind |
13:12:19 | * | HakanD__ joined #nim |
13:14:17 | * | vendethiel joined #nim |
13:17:14 | fowlmouth | i think it clearly says that you can do what you want with it? |
13:17:25 | fowlmouth | fork relicense idgaf |
13:18:09 | * | Demon_Fox quit (Ping timeout: 256 seconds) |
13:18:25 | fowlmouth | oh 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:25 | HakanD__ | 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:30 | gokr_ | pd doesnt fly that well in all countries. |
13:48:02 | * | banister joined #nim |
13:49:37 | fowlmouth | licenses are annoying |
13:55:57 | * | endragor_ quit (Remote host closed the connection) |
13:56:26 | * | endragor joined #nim |
13:56:50 | HakanD__ | 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:14 | xcombelle | hi 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:56 | Araq | def-: how come? |
14:19:33 | def- | 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:07 | Araq | well if you don't understand the PR, it's hardly good enough, is it ;-) |
14:20:25 | Araq | I 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:42 | fowlmouth | HakanD__, 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:03 | BlaXpirit | Sharcho, are u still there? |
16:28:09 | Sharcho | BlaXpirit: yes |
16:28:18 | BlaXpirit | what random module are u talking about |
16:28:27 | BlaXpirit | and did u find your answer |
16:28:50 | Sharcho | BlaXpirit: I didn't, but I think I'll be alright with unsigned numbers for now |
16:29:00 | Sharcho | BlaXpirit: you modulee |
16:29:10 | Sharcho | BlaXpirit: your module |
16:29:10 | BlaXpirit | Sharcho, there is a way |
16:29:46 | BlaXpirit | randomInt(int64) |
16:30:06 | * | gsingh93 quit (Ping timeout: 256 seconds) |
16:30:52 | Sharcho | Doesn't work for me, but maybe that's because I'm using @#old-compiler |
16:41:49 | BlaXpirit | Sharcho, oh I just realized "61 commits behind master" |
16:42:02 | BlaXpirit | yeah, that wasn't there :| |
16:42:19 | BlaXpirit | i 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:42 | Sharcho | BlaXpirit: 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:05 | BlaXpirit | Sharcho, 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:09 | BlaXpirit | what a mouthful |
16:46:38 | Sharcho | BlaXpirit: 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:28 | BlaXpirit_ | 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:48 | Strikecarl | Guys |
20:07:58 | Strikecarl | I was messing around with "Streams" |
20:08:30 | Strikecarl | and when i do except: |
20:08:34 | Strikecarl | i get this error: |
20:08:35 | Strikecarl | e:\nim\nim.nim(8, 7) Error: 'except' expected |
20:08:49 | saml | except: label? |
20:09:12 | Strikecarl | source: http://pastebin.com/95EtxxGC |
20:10:02 | BlaXpirit_ | are u kidding -_- |
20:11:02 | Strikecarl | I honestly have no idea wtf i did wrong xD |
20:11:35 | Strikecarl | I sticked to the math part for to long. |
20:11:53 | saml | Strikecarl, check indentation |
20:12:05 | saml | things don't line up. after fixing indentation, it comiples |
20:12:27 | saml | try and except must line up |
20:15:34 | saml | I 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:03 | Araq | saml: interesting idea |
20:19:00 | * | Matthias247 joined #nim |
20:19:45 | saml | i wonder how easy it is for compiler to detect leak and warns programmer |
20:20:54 | * | OnwardEuler joined #nim |
20:22:50 | BlaXpirit_ | saml, isn't this similar to destructors? |
20:24:33 | saml | destructors can't leak into more than two scopes up? |
20:25:05 | saml | i mean, with exceptions, you can just do try { main() } except LeakError: gc() |
20:25:11 | saml | or something like that |
20:25:31 | saml | wait.. but probably i'm just confused |
20:25:56 | saml | cause LeakError.. isn't really raised runtime.. it's compile time flag to warn programmers |
20:26:33 | saml | i think resource leak stuff is not really exception |
20:28:22 | Sharcho | Is there a way I can get the compilation mode (release/debug)? |
20:30:10 | saml | nim c -d:release |
20:30:17 | saml | Sharcho, you mean from binary? |
20:30:50 | Sharcho | saml: yes, from nim the code |
20:32:15 | Sharcho | Is there a constant set or something? |
20:32:16 | HakanD__ | Sharcho: why do you want it? |
20:32:40 | fowlmouth | Sharcho, defined(release) or defined(debug) |
20:33:04 | saml | when defined(release): .... |
20:33:49 | Sharcho | HakanD__: I'm keeping benchmarking data, and I need to discard results from debug compilations |
20:34:01 | Sharcho | fowlmouth, saml: thanks! |
20:35:11 | * | xcombelle quit (Quit: Leaving) |
20:35:22 | saml | https://gist.github.com/saml/9aae803abb8e2d2a5f84 Sharcho |
20:35:49 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
20:38:14 | Sharcho | saml: thanks |
20:38:59 | * | banister joined #nim |
20:39:06 | * | banister quit (Max SendQ exceeded) |
20:44:41 | saml | i guess LeakedError could be thrown as proc returns to caller. but it's not really an exception.. because code should flow through |
20:45:18 | fowlmouth | what the fuck -_- |
20:45:19 | * | HakanD__ quit (Quit: Be back later ...) |
20:45:20 | saml | it's like finally that can cascade |
20:45:27 | BlaXpirit_ | [:25:30] <saml> probably i'm just confused |
20:45:31 | fowlmouth | inst2.alive: true |
20:45:31 | fowlmouth | inst2.alive == true: false |
20:45:31 | fowlmouth | inst2.alive == false: false |
20:45:57 | fowlmouth | what the fluck is happening here |
20:46:11 | saml | what's inst2.alive? |
20:46:15 | fowlmouth | bool |
20:46:24 | saml | do you ahve full code? |
20:47:15 | fowlmouth | saml, if you can debug this you deserve a medal https://gist.github.com/fowlmouth/73fcf0a36bfd1d224e1e#file-gistfile1-nim-L457 |
20:48:52 | saml | maybe c boolean vs. nim's boolean equality? |
20:49:47 | saml | try ord(inst2.alive) == ord(true) |
20:51:09 | * | banister joined #nim |
20:52:02 | fowlmouth | i think this is a nim error |
20:54:44 | Araq | saml: obviously it's not an exception, but some other effect |
20:56:54 | * | mpthrapp quit (Remote host closed the connection) |
20:57:35 | saml | it 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:17 | saml | this kind of analysis could be hard |
20:58:41 | fowlmouth | is* |
20:59:47 | Araq | saml: 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:23 | Araq | *in other words |
21:12:48 | saml | i 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:36 | Sharcho | How do I convert an int64 to a string? I'm getting an error when I do intToStr(1234'i64) |
21:44:46 | Araq | use $ like the rest of us |
21:47:41 | Sharcho | Araq: 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:39 | fowlmouth | hm |
22:15:41 | * | vendethiel joined #nim |
22:15:49 | fowlmouth | its failing because the function is returning 108 instead of 1 |
22:17:08 | Araq | comparing via '== true' is retarded anyway |
22:17:21 | Araq | it's already a bool |
22:17:51 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:17:55 | Araq | if (b == true) == true: echo "now, it's REALLY true" |
22:18:36 | fowlmouth | isnt this indicative of stack smashing |
22:18:46 | fowlmouth | or something horrible |
22:19:29 | Araq | why? I don't know your code but I bet it's full of |
22:19:43 | Araq | converter toBool(x: cint): bool = bool(x) |
22:19:47 | Araq | :P |
22:20:42 | fowlmouth | no this is what im working on atm https://gist.github.com/fowlmouth/73fcf0a36bfd1d224e1e#file-gistfile1-nim-L457 |
22:23:26 | Araq | yeah well |
22:23:35 | Araq | no idea if what you're doing is safe |
22:23:47 | Araq | all that casting and GCref'ing |
22:33:07 | * | Kingsquee quit (Quit: Konversation terminated!) |
22:34:01 | fowlmouth | fixed it^_^ |
22:34:56 | Araq | cool. how? |
22:35:10 | fowlmouth | the inner cast expression was wrong |
22:35:43 | Araq | told ya! ;- |
22:36:27 | * | Kingsquee joined #nim |
22:37:14 | fowlmouth | well, the cast was either wrong or passing the wrong param, either way i fixed both things and it works |
22:38:50 | renesac | Araq: how I can make what I was doing the other day work more universally? |
22:38:52 | renesac | https://gist.github.com/ReneSac/912219fbf0cfc87f4440 |
22:39:34 | renesac | would taking a pointer to the first element of the set/array/string and then access it via an unchecked array work always? |
22:39:45 | thotypous | just 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:46 | renesac | except the gc safety issue |
22:40:11 | fowlmouth | renesac, figure out what operations you need to call on the seq then write a concept for it |
22:40:50 | renesac | fowlmouth: I want to access an slice of an string or seq as an normal seq |
22:40:58 | renesac | w/o copying |
22:41:15 | fowlmouth | i understand |
22:41:32 | renesac | how a concept would help? |
22:41:48 | Araq | I wrote .shallow for that, dunno why you cannot use that and call it day |
22:41:49 | renesac | it needs state (the base and top in my case) |
22:42:38 | fowlmouth | well 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:18 | renesac | I don't know how to use shallow in this case |
22:45:38 | renesac | type ShallowSeq {.shallow.} = seq ? |
22:45:47 | renesac | with [T] there maybe? |
22:47:03 | Araq | never mind, I misread your code, you don' t use the 'ref' at all |
22:47:10 | Araq | so what's the question again? |
22:47:27 | Araq | overload by var/non-var. non-var creates a copy. so what |
22:47:38 | renesac | it won't work for the string |
22:47:49 | Araq | why not? |
22:47:56 | renesac | the error is there |
22:47:59 | renesac | at the end |
22:48:19 | renesac | it seems to be sitting on const space |
22:48:36 | def- | thotypous: cool, you can also strip the binary afterwards if size matters |
22:49:08 | thotypous | def-: that's with it already stripped ;) |
22:49:28 | def- | thotypous: --opt:size? |
22:49:33 | * | Sembei quit (Excess Flood) |
22:49:46 | thotypous | yes |
22:50:03 | renesac | it 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:24 | Araq | renesac: you can, but you need to use a ptr for that then |
22:52:40 | renesac | hum |
22:52:51 | Araq | and 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:34 | renesac | well, 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:41 | Araq | shallowCopy(result.data, cast[var seq[char]](data)) # I don't think this is correct |
22:55:03 | * | Manabu joined #nim |
22:55:08 | Manabu | back |
22:55:29 | * | Manabu left #nim (#nim) |
22:55:36 | Araq | you're not renesac |
22:55:38 | * | renesac joined #nim |
22:55:53 | Araq | shallowCopy(result.data, cast[var seq[char]](data)) # I don't think this is correct |
22:56:14 | renesac | hum |
22:57:01 | renesac | yeah, I don't know what the difference of string and seq[char] is, besides the \0 |
22:57:46 | Araq | there is none |
22:58:02 | Araq | but I think your 'var' is wrong in this cast |
22:58:29 | * | vendethiel quit (Ping timeout: 248 seconds) |
22:58:34 | renesac | I'm receiving a "var string" |
22:58:51 | renesac | can't 'var" be used this way in casts? |
22:58:51 | renesac | or should I use "ref"? |
22:58:57 | renesac | or what? |
22:59:12 | Araq | shallowCopy(result.data, cast[seq[char]](data)) |
23:03:13 | * | Jesin quit (Quit: Leaving) |
23:04:41 | Araq | fowlmouth: why don't we have marshal.nim at compile-time? |
23:05:02 | Araq | that's a seriously missing feature, staticExec doesn't cut it without that |
23:05:17 | * | Jesin joined #nim |
23:05:25 | federico2 | anyone familiar with arduinos around? |
23:05:30 | fowlmouth | it just became possible |
23:05:49 | * | a5i joined #nim |
23:07:12 | Araq | fowlmouth: what do you mean? |
23:08:28 | renesac | yeah, it seems to be working now |
23:08:29 | renesac | thanks |
23:08:52 | renesac | maybe I will do something with ptr for const data too, but I think I'm set for now |
23:09:36 | renesac | ah, one more thing, how can I know from insde the code if bounds check is on or off? |
23:09:45 | renesac | I can only access the "release" or "debug" variables |
23:10:07 | renesac | but not a "boundChecks" variable, not even when I use --boundChecks:on |
23:10:30 | Araq | when compileOption("boundChecks") or something like that |
23:10:39 | renesac | hum |
23:11:21 | renesac | yeah, that is it |
23:11:43 | thotypous | on x86_64, nim compiler reduces from 1535576 to 1092472 with -flto |
23:11:47 | thotypous | both with -Os |
23:12:05 | thotypous | ah, sorry, forgot to strip :P |
23:12:13 | thotypous | its from 1211312 to 1092472 |
23:12:16 | thotypous | not so huge difference |
23:13:27 | * | Trustable_2 joined #nim |
23:13:54 | renesac | --opt:size? |
23:14:56 | thotypous | yes, --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:44 | renesac | there are some threads onf the forum about this |
23:17:36 | renesac | and you can do some more extreme shrinking with --os:standalone, depending what your target use is |
23:18:38 | thotypous | nice, 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:04 | thotypous | just 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:34 | Araq | I hope you use deadcodeelim:on too |
23:21:46 | Araq | or d:release |
23:22:12 | * | Trustable_2 quit (Client Quit) |
23:22:48 | thotypous | Araq: i'm using d:release, does it already activate deadcodeelim? |
23:22:55 | Araq | yup |
23:23:00 | thotypous | nice, thanks |
23:23:26 | thotypous | we shall see if i'm able to get a smaller executable than the original C++ one :P |
23:23:41 | Araq | def-: 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:52 | Sharcho | Let'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:19 | Araq | Sharcho: we dont know yet. I'd use the threadpool |
23:41:32 | * | vendethiel joined #nim |
23:43:59 | Araq | is it too late to break multi-methods and require the dispatcher method to be explicit? |
23:45:06 | Sharcho | I'm not sure I understand |
23:45:18 | fowlmouth | Araq, why would you want to do that |
23:45:43 | Araq | cause it is a pita |
23:47:15 | fowlmouth | the order of method declaration thing? |
23:47:23 | Araq | yes |
23:47:37 | Araq | you know this bug? |
23:47:48 | fowlmouth | where you have to define the highest type first |
23:48:00 | Araq | yes |
23:48:57 | Araq | actually I can detect this and make it a compile-time error at least for now |
23:49:10 | Araq | that's a good hack |
23:49:20 | fowlmouth | why is that a problem though? |
23:49:30 | Araq | well it's a bug |
23:49:38 | fowlmouth | is the first method declared decided to be the dispatcher? |
23:49:46 | Araq | kind of |
23:50:03 | fowlmouth | seems like the dispatcher should be created last? |
23:50:15 | Araq | it is |
23:50:27 | Araq | but it is *attached* to the first encountered method |
23:50:46 | Araq | which ... causes all sorts of problems |
23:51:40 | fowlmouth | they can't be separated? |
23:52:35 | Araq | never mind I'm an idiot |
23:52:48 | fowlmouth | lol ._o |
23:55:26 | fowlmouth | i looked at the generated c and they are in separate functions |
23:55:48 | Araq | that's not the problem, never mind |
23:55:50 | * | alex98 joined #nim |
23:55:57 | Araq | the fix just looks totally different |
23:56:04 | Araq | I need to sleep, good night |
23:56:09 | fowlmouth | gn |