00:02:49 | * | zaquest joined #nim |
00:04:34 | * | flaviu quit (Ping timeout: 244 seconds) |
00:07:06 | * | zaquest quit (Ping timeout: 246 seconds) |
00:09:00 | * | xet7 joined #nim |
00:09:11 | * | flaviu joined #nim |
00:10:03 | * | zaquest joined #nim |
00:14:57 | * | zaquest quit (Ping timeout: 264 seconds) |
00:19:22 | * | zaquest joined #nim |
00:23:57 | * | zaquest quit (Ping timeout: 264 seconds) |
00:24:03 | * | brson joined #nim |
00:25:07 | * | X67r quit (Quit: leaving) |
00:26:43 | * | zaquest joined #nim |
00:31:05 | * | zaquest quit (Ping timeout: 252 seconds) |
00:33:30 | * | flaviu quit (Ping timeout: 250 seconds) |
00:34:26 | * | yglukhov___ joined #nim |
00:36:17 | * | flaviu joined #nim |
00:36:19 | * | zaquest joined #nim |
00:39:03 | * | yglukhov___ quit (Ping timeout: 256 seconds) |
00:40:45 | * | flaviu quit (Ping timeout: 256 seconds) |
00:40:46 | * | zaquest quit (Ping timeout: 265 seconds) |
00:44:59 | * | zaquest joined #nim |
00:52:20 | * | flaviu joined #nim |
00:53:01 | * | unclechu quit (Quit: Leaving.) |
01:08:50 | * | vasher_ quit (Quit: Connection closed for inactivity) |
01:16:44 | * | apense joined #nim |
01:22:42 | * | EXetoC quit (Ping timeout: 246 seconds) |
01:24:23 | * | jaco60 quit (Ping timeout: 256 seconds) |
01:25:13 | * | brson quit (Ping timeout: 246 seconds) |
01:26:12 | * | vendethiel quit (Ping timeout: 264 seconds) |
01:26:58 | * | brson joined #nim |
01:27:26 | * | kfm2 left #nim (#nim) |
01:44:18 | * | brson quit (Quit: leaving) |
01:46:22 | * | gyeates quit (Ping timeout: 248 seconds) |
02:40:36 | * | darkf joined #nim |
02:42:19 | * | Jesin quit (Quit: Leaving) |
02:44:35 | * | Jesin joined #nim |
02:48:41 | * | vendethiel joined #nim |
03:06:25 | * | vasher_ joined #nim |
03:16:52 | * | stubbZ joined #nim |
03:17:05 | stubbZ | is there console input in nim? |
03:20:31 | Varriount_ | stubbz: There's a rdstdin module |
03:44:14 | * | pipeep quit (Ping timeout: 248 seconds) |
04:02:15 | * | rgv151 joined #nim |
04:02:17 | * | xcombelle joined #nim |
04:03:37 | * | vendethiel quit (Ping timeout: 256 seconds) |
04:18:54 | * | wan quit (Ping timeout: 248 seconds) |
04:32:21 | * | wan joined #nim |
04:45:47 | * | apense quit (Ping timeout: 240 seconds) |
05:01:25 | * | polde quit (Ping timeout: 258 seconds) |
05:18:50 | * | vasher_ quit (Quit: Connection closed for inactivity) |
05:22:53 | * | vendethiel joined #nim |
05:28:41 | * | polde joined #nim |
05:29:35 | * | stubbZ quit (Quit: Page closed) |
05:45:15 | * | vendethiel quit (Ping timeout: 255 seconds) |
06:21:19 | * | BitPuffin|osx quit (Ping timeout: 256 seconds) |
06:24:44 | * | strcmp1 joined #nim |
06:27:09 | * | vendethiel joined #nim |
06:36:39 | * | Miko_____ joined #nim |
06:49:36 | * | vendethiel quit (Ping timeout: 255 seconds) |
06:51:15 | * | vendethiel joined #nim |
07:08:31 | * | yglukhov___ joined #nim |
07:14:01 | * | vendethiel quit (Ping timeout: 256 seconds) |
07:16:22 | * | vendethiel joined #nim |
07:17:17 | * | jszymanski joined #nim |
07:29:20 | * | xificurC joined #nim |
07:38:19 | * | xcombelle quit (Remote host closed the connection) |
07:39:13 | * | vendethiel quit (Ping timeout: 256 seconds) |
07:40:22 | * | vendethiel joined #nim |
07:42:08 | * | renesac quit (Ping timeout: 252 seconds) |
07:46:57 | * | strcmp1 quit (Quit: Leaving) |
07:48:24 | * | someplace quit (Ping timeout: 246 seconds) |
07:55:13 | * | renesac joined #nim |
07:56:34 | * | Demon_Fox_ joined #nim |
07:56:51 | * | Trustable joined #nim |
07:57:22 | * | [CBR]Unspoken1 joined #nim |
07:58:45 | * | Demon_Fox quit (Ping timeout: 264 seconds) |
08:02:27 | * | vendethiel quit (Ping timeout: 252 seconds) |
08:05:47 | * | coffeepot joined #nim |
08:06:10 | * | wuehlmaus joined #nim |
08:06:40 | * | wan quit (Ping timeout: 246 seconds) |
08:24:28 | * | vendethiel joined #nim |
08:36:22 | * | jaco60 joined #nim |
08:46:59 | * | huonw quit (K-Lined) |
08:55:09 | * | xet7_ joined #nim |
08:58:55 | * | xet7 quit (Ping timeout: 252 seconds) |
09:05:48 | * | xet7_ quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )) |
09:06:11 | * | xet7 joined #nim |
09:08:33 | * | someplace joined #nim |
09:10:55 | * | yglukhov____ joined #nim |
09:13:51 | * | yglukhov___ quit (Ping timeout: 256 seconds) |
09:34:17 | * | yglukhov____ quit (Quit: Be back later ...) |
09:37:36 | * | vendethiel quit (Read error: Connection reset by peer) |
09:42:23 | * | yglukhov____ joined #nim |
09:46:09 | * | Ven joined #nim |
09:46:45 | * | zaquest quit (Quit: Leaving) |
09:47:13 | * | zaquest joined #nim |
09:55:53 | * | dgellow left #nim (#nim) |
10:13:51 | Varriount_ | fowl: Remind me again what the advantage of using option[T] is against returning nil? |
10:13:59 | * | Varriount_ is now known as Varriount |
10:14:44 | Varriount | Araq: I don't suppose I would be able to convince you to simplify the rules for parsing string literals, could I? |
10:15:11 | Araq | no, but go on and tell me how they can be simplified |
10:15:34 | * | vendethiel joined #nim |
10:16:11 | Varriount | Araq: Having triple quoted strings not eat additional quotes, removing the wierd eat-newline-and-following-whitespace rule. |
10:16:16 | fowl | Varriount, a pointer can be nil, the state of 0, a struct type doesnt have a 0 state unless you decide that it does. maybe (string,string,string) is nil if one of its members is nil |
10:17:33 | Varriount | Araq: Both of those mechanisms can be done (at compile time!) with procedures and the generalized string literal notation. |
10:18:03 | fowl | you can program in such a way that nil is an ok value, for ex in a perfect world nil.string & nil.string returns nil.string and every operation with strings checks for nil |
10:20:44 | fowl | in reality thats expensive to add to every operation, but it would also be expensive to allocate strings that contain no data |
10:21:57 | Araq | Varriount: general"foo |
10:22:02 | Araq | newline here |
10:22:05 | Araq | the end" |
10:22:42 | Araq | doesn't parse, it was decided that single quotes are too error prone to be allow for spanning multiple lines |
10:23:25 | Varriount | Araq: Sorry, I should have been more specific. I meant triple-quoted string literals. |
10:32:35 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:34:47 | * | wb joined #nim |
10:41:18 | * | Miko_____ quit (Ping timeout: 248 seconds) |
10:43:36 | * | Kingsquee joined #nim |
10:44:16 | * | yglukhov_____ joined #nim |
10:47:57 | * | yglukhov____ quit (Ping timeout: 264 seconds) |
10:48:25 | Varriount | Araq: ? |
10:48:55 | Araq | so ... what's your point again? sorry |
10:49:16 | Araq | that the rule "ignore the first newline" could have been done without? ok I guess |
10:50:03 | Araq | but this rule is irrelevant for syntax highlighters anyway |
10:56:22 | Varriount | Araq: The manual states that a string literal `""""Hello"""" == "Hello"`, Not `"\"Hello\"". Such behavior is unexpected and rarely wanted. |
10:57:33 | Varriount | In addition, the manual also states "when the opening """ is followed by a newline [...], the newline (and the preceding whitespace) is not included in the string" |
10:57:52 | Varriount | This is also really unexpected behavior. |
10:58:01 | Araq | I think the manual is wrong or you misread it |
10:58:22 | Araq | """"hello"""" is the same as "\"hello\"" |
10:58:47 | Varriount | "The ending of the string literal is defined by the pattern """[^"], so this:" |
10:59:05 | Varriount | """"long string within quotes"""" |
10:59:05 | Varriount | Produces: |
10:59:05 | Varriount | "long string within quotes" |
10:59:20 | * | Jehan_ joined #nim |
10:59:34 | Araq | well yes, the quotes are part of the string literal |
10:59:51 | Varriount | Ah. That could be made... more clear. |
11:00:08 | Araq | that behaviour is not my invention btw, it came from user feedback |
11:00:35 | Araq | but I think it's expected behaviour |
11:00:55 | federico3 | yep |
11:01:28 | Araq | what 4 quotes in a row? simple, use """""""""" |
11:02:01 | Varriount | Araq: And the newline-whitespace eating behavior? |
11:02:31 | Varriount | There's no nice way to circumvent that. |
11:03:50 | Araq | that's true but it's rarely required |
11:04:03 | federico3 | what is it? |
11:04:10 | Araq | const foobar = " \n" & """ |
11:04:14 | Araq | workaround""" |
11:05:13 | Araq | Varriount: you cannot have """ in the middle of a triple quoted string either. |
11:06:05 | federico3 | The first whitespaces-newline is always removed? That's nice actually! |
11:06:10 | Varriount | Araq: Yes, but at least that makes sense. |
11:06:20 | Varriount | federico3: Hush you. |
11:06:39 | federico3 | why not? |
11:06:40 | Araq | triple quoted strings are for convenience and they are convenient. |
11:07:02 | Araq | so ... I think we got them exactly right. |
11:07:10 | Araq | however |
11:07:24 | federico3 | +1 |
11:07:33 | Araq | I like to see indentation based strings one day |
11:07:38 | federico3 | +2 |
11:07:39 | Varriount | ? |
11:07:41 | Araq | const foo = ``` |
11:07:52 | Araq | string ends. Guess when it does. |
11:07:55 | Araq | not here. |
11:08:02 | Araq | var buthere = 0 |
11:08:16 | federico3 | without closing it? :( |
11:08:33 | Jehan_ | This is not going to be fun for syntax highlighters. :) |
11:08:35 | federico3 | are the two whitespaces on the left of "string ends" stripped? |
11:09:00 | Varriount | Araq: I wouldn't actually be too opossed to that. |
11:09:11 | Varriount | *opposed |
11:09:19 | Araq | federico3: I dunno. I guess they are. |
11:09:51 | Araq | indentation based strings doesn't exist |
11:09:56 | Jehan_ | I like Scala's approach better: http://downgra.de/2010/09/14/multi-line_strings_with_scala/ |
11:09:57 | Araq | *don't |
11:10:14 | Jehan_ | Except, of course, they also don't allow triple quotes inside strings. |
11:10:43 | Varriount | Araq: You know the rest of the programming community would come for you with pitchforks if you did that. :P |
11:10:44 | Jehan_ | But explicitly marking the left margin makes sense. |
11:11:22 | federico3 | Jehan_: why marking it on *every* line? |
11:12:00 | Jehan_ | federico3: So that you can tell on every line where the left margin is. |
11:12:35 | federico3 | Jehan_: obviously. But why would you want to do that? |
11:12:37 | federico3 | https://docs.python.org/2/library/textwrap.html#textwrap.dedent |
11:12:42 | Jehan_ | Not always easy when stuff is indented by > 10 spaces and the string itself has some indentation, too. |
11:13:07 | federico3 | I would detect the indentation on the first line after """ and go with that one :) |
11:13:13 | Jehan_ | Also, I think the Python approach may not work if the first line is indented. |
11:13:32 | Araq | federico3: the point is to have no closing marker so everything can be written in the string literal without escaping stuff |
11:18:18 | Varriount | reactormonk: You might be happy to know that I'm writing an entirely new nim-by-example article on strings, using information from the manual and standard library. |
11:18:30 | * | yglukhov_____ quit (Remote host closed the connection) |
11:19:02 | * | yglukhov_____ joined #nim |
11:21:02 | Araq | Jehan_: "it looks like nodecl also suppresses code generation" well what else should it do? o.O |
11:21:30 | Jehan_ | Araq: I thought it only suppressed the prototype. |
11:21:43 | Araq | how would that help? |
11:22:09 | Araq | you have the prototype that disagrees with the header and skip that and then end up with the body that disagrees? |
11:22:15 | Jehan_ | Probably not, now that I think about it. The implementation would still ... yeah. |
11:22:37 | Jehan_ | I blame lack of sleep over the weekend. :) |
11:25:02 | * | thotypous joined #nim |
11:30:25 | Varriount | Araq: With the current string implementation, how are a strings references updated when it's add()'ed to? |
11:31:37 | * | bjz joined #nim |
11:36:44 | Jehan_ | Varriount: add() takes a var parameter. |
11:39:26 | * | EXetoC joined #nim |
11:50:42 | fowl | Will the async macros use the new continuations |
11:51:18 | Varriount | Jehan_: Ah, so in the end you get a pointer to the point in memory the reference to the string is. |
11:51:29 | Araq | fowl: when we figured out how, yess |
11:51:34 | Jehan_ | Varriount: yes. |
11:52:29 | * | xet7 quit (Read error: Connection reset by peer) |
11:52:45 | * | xet7 joined #nim |
11:55:01 | Varriount | Araq: Nim is getting continuations? |
11:56:01 | * | Kingsquee quit (Quit: Konversation terminated!) |
11:59:55 | fowl | Varriount r-ku is working on them |
12:03:08 | * | Miko_____ joined #nim |
12:04:08 | * | raza joined #nim |
12:33:24 | * | Jehan_ quit (Quit: Leaving) |
12:35:12 | * | MatrixBridge quit (Ping timeout: 264 seconds) |
12:36:32 | * | MatrixBridge joined #nim |
12:36:48 | * | huonw joined #nim |
12:50:58 | * | arnetheduck joined #nim |
12:55:34 | * | xificurC quit (Write error: Broken pipe) |
12:56:07 | * | xificurC joined #nim |
13:00:00 | * | raza quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
13:01:20 | * | raza joined #nim |
13:10:53 | * | BitPuffin|osx joined #nim |
13:15:00 | * | BitPuffin|osx quit (Remote host closed the connection) |
13:15:13 | * | BitPuffin|osx joined #nim |
13:19:19 | * | bjz quit (Excess Flood) |
13:19:58 | * | bjz joined #nim |
13:28:19 | * | jszymanski quit (Quit: computer sleeps...) |
14:03:01 | * | xcombelle joined #nim |
14:04:38 | * | gyeates joined #nim |
14:10:15 | * | saml joined #nim |
14:20:02 | * | baabelfish joined #nim |
14:37:14 | * | key_ quit (Quit: Konversation terminated!) |
14:57:36 | federico3 | that thread about captchas - would anyone support accepting OAuth/OpenID? |
14:58:07 | * | jszymanski joined #nim |
15:00:18 | * | dewdrop joined #nim |
15:05:17 | fowl | Yes |
15:05:48 | federico3 | I'd rather have a mailing list, or at least mirror the forum on a mailing list |
15:06:58 | fowl | Theres rss feed i think |
15:09:10 | * | gmpreussner|work joined #nim |
15:19:45 | * | BitPuffin|osx quit (Ping timeout: 264 seconds) |
15:23:20 | def- | federico3: well, there is a mailing list, but it's not widely used |
15:29:12 | federico3 | def-: maybe it could be merged with the forum? |
15:31:31 | def- | federico3: i guess that would be good, but someone would have to implement that and make sure the mail server runns well |
15:32:16 | * | key_ joined #nim |
15:33:10 | federico3 | def-: there's a PR https://github.com/nim-lang/nimforum/issues/57 |
15:36:50 | * | beatmox quit (*.net *.split) |
15:36:50 | * | rinukkusu quit (*.net *.split) |
15:36:50 | * | lyro quit (*.net *.split) |
15:36:50 | * | tymat quit (*.net *.split) |
15:36:50 | * | Amun_Ra quit (*.net *.split) |
15:36:51 | * | eventualbuddha quit (*.net *.split) |
15:36:51 | * | taotetek quit (*.net *.split) |
15:36:51 | * | so quit (*.net *.split) |
15:36:56 | * | reactormonk quit (*.net *.split) |
15:36:58 | * | pigmej quit (*.net *.split) |
15:36:58 | * | beatmox joined #nim |
15:37:07 | * | lyro joined #nim |
15:37:10 | * | taotetek joined #nim |
15:37:13 | * | rinukkusu joined #nim |
15:37:13 | * | reactormonk joined #nim |
15:37:31 | * | taotetek is now known as Guest62515 |
15:37:44 | * | Amun_Ra joined #nim |
15:38:39 | * | tymat joined #nim |
15:39:04 | * | pigmej joined #nim |
15:39:36 | * | arnetheduck quit (Ping timeout: 250 seconds) |
15:47:24 | * | eventualbuddha joined #nim |
15:49:07 | * | raza quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
15:51:58 | * | Miko___ joined #nim |
15:52:14 | * | Miko_____ quit (Ping timeout: 248 seconds) |
16:02:16 | * | raza joined #nim |
16:12:23 | r-ku | federico3: i have surprising news - not everyone uses that crap. |
16:13:47 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:19:46 | * | yglukhov_____ quit (Ping timeout: 264 seconds) |
16:30:23 | * | so joined #nim |
16:32:33 | * | raza quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:42:07 | reactormonk | Varriount, strings? I don't use strings ;> |
16:42:13 | reactormonk | Varriount, gimme link when you're done |
16:42:40 | * | raza joined #nim |
16:48:55 | * | FedeOmoto joined #nim |
17:04:39 | federico3 | r-ku: huh? |
17:06:01 | r-ku | openid |
17:12:56 | * | raza quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
17:14:55 | federico3 | not that surprising, I don't like it either |
17:18:35 | * | MatrixBridge quit (Remote host closed the connection) |
17:18:46 | * | MatrixBridge joined #nim |
17:20:16 | * | MatrixBridge quit (Remote host closed the connection) |
17:20:28 | * | MatrixBridge joined #nim |
17:20:43 | * | raza joined #nim |
17:29:50 | * | key_ quit (Read error: Connection reset by peer) |
17:42:54 | * | yglukhov_____ joined #nim |
17:43:33 | * | kokozedman joined #nim |
17:44:53 | kokozedman | hey guys, I'm compiling in C++ mode (using a C++ library), and it generates codes like: ((NI) (AF_INET)).UDT::socket(((NI) (SOCK_STREAM)), ((NI) 0)) ... that is, it tries to access member where as I need just a plain UDT::socket() call and the AF_INET as normal argument |
17:44:58 | kokozedman | how do I do that? |
17:45:25 | * | brson joined #nim |
17:46:17 | * | Matthias247 joined #nim |
17:46:51 | Araq | kokozedman: watched my OSCON talk about how to wrap C++? oh wait ... that's upcoming :-) |
17:47:10 | kokozedman | Araq, nope, where at? |
17:47:22 | Araq | wrap it like so: importcpp: "UDT::socket(@)" |
17:47:48 | Araq | Portland |
17:48:03 | * | yglukhov_____ quit (Quit: Be back later ...) |
17:48:11 | * | filcuc joined #nim |
17:50:04 | kokozedman | Araq, ohh... ok, thanks man |
17:50:08 | * | Arrrr joined #nim |
17:50:23 | kokozedman | would love that talk if you can share the link |
17:50:40 | Araq | btw c2nim can wrap that and produces the right importcpp pattern ;-) |
17:51:29 | kokozedman | Araq, it gets stuck in the middle, before even producing a wrapper... so I gave up and wrote things manually instead |
17:51:57 | Araq | bah, it never gets stuck for me |
17:52:01 | Araq | did you report this? |
17:53:55 | kokozedman | Araq, nope, I'm guessing that might be simply a not-yet implement, not yet a priority... it gets stuck in things like: class UDT_API CUDTException (removing those UDT_API lines solves the problem, but it's kinda psy killer) |
17:54:04 | * | BitPuffin|osx joined #nim |
17:54:25 | Araq | what does "get stuck" mean? |
17:54:51 | Araq | #def UDT_API |
17:55:03 | Araq | seriously ... why does nobody use #def ? :-( |
17:55:45 | * | yglukhov_____ joined #nim |
17:56:07 | kokozedman | Araq, because we don't know we needed to #def to hack our way around |
17:56:20 | kokozedman | this is the first time I heard about this |
17:57:34 | Araq | oh ffs I hate it that i can wrap full wxWidgets with c2nim in my spare time and everybody else doesn't |
17:58:11 | kokozedman | it's the know how that makes all the difference |
17:58:21 | kokozedman | the manual is massively great |
17:58:34 | Araq | c2nim has a manual |
17:58:40 | kokozedman | but for tasks such as these, it's quite a massive undertaking to figure-out you needed a #def |
18:00:20 | * | filcuc quit (Quit: Konversation terminated!) |
18:01:51 | kokozedman | Araq, in my humble opinion, I think people don't have the ability to actually remember things, for me, that's quite relevant... I read a manual, but then I easily forget and don't even know when a particular piece of the doc would be relevant ; and in that case, I'm pretty much like an ignorant person even though I have read the manual and whatever else I think might have been relevant |
18:02:05 | * | apense joined #nim |
18:02:27 | kokozedman | I think, that's in part because of the length of the documentations, it's pretty hard to digest |
18:03:11 | Araq | do you talk about c2nim's documentation? |
18:03:12 | kokozedman | I'm not trying to blame anyone here, it's just a fact; I sincerely think that the manual is quite great |
18:03:21 | kokozedman | documentations in general |
18:03:35 | kokozedman | seems quite a lot of them |
18:03:45 | * | darkf quit (Quit: Leaving) |
18:04:46 | kokozedman | Araq, I have this: "typedef unsigned __int32 uint32_t;" and c2nim complains: udt.h(76, 40) Error: ';' expected |
18:05:03 | kokozedman | not sure what #def is required here |
18:05:31 | kokozedman | that's the official udt header |
18:11:41 | kokozedman | so, I removed those lines, set the #def ... and amazingly, all was well! |
18:11:45 | kokozedman | thanks Araq |
18:13:10 | Araq | also use --nep1 for c2nim |
18:13:17 | Araq | I guess that should be the default |
18:16:25 | kokozedman | Araq, Ok... another thing, why is double underscores (__) causing Error: invalid token? |
18:17:31 | Araq | you need to tell c2nim how to mangle __ |
18:17:46 | Araq | in Nim underscores are separators only |
18:18:00 | * | fowl quit (Quit: zz) |
18:18:13 | kokozedman | Araq, I'm aware of that, but usually when I mangle these, they hit other things and cause a mess |
18:18:52 | kokozedman | like __MSG__ and then, there is like _MSG_ ... and it's a confusing result after |
18:19:27 | kokozedman | I know it's a strange naming from the original library, but realistically, I've been hit by this situation 2/4 |
18:20:12 | Araq | well one thing that Nim strives for is to make *talking* about code easier. So you can say to your collegue "oh you need to use the foobar here" |
18:20:30 | Araq | rather than "use underscore underscore foobar underscore underscore here" |
18:20:54 | Araq | "and not underscore foobar which is something completely different because the world ran out of identifiers" |
18:21:23 | * | BitPuffin|osx quit (Ping timeout: 252 seconds) |
18:24:05 | kokozedman | heheh... I see |
18:27:18 | * | gyeates quit (Ping timeout: 250 seconds) |
18:28:37 | * | filcuc joined #nim |
18:29:24 | * | fowl joined #nim |
18:29:24 | * | fowl quit (Excess Flood) |
18:33:27 | * | fowl joined #nim |
18:33:42 | * | fowl quit (Changing host) |
18:33:42 | * | fowl joined #nim |
18:33:42 | * | fowl quit (Changing host) |
18:33:42 | * | fowl joined #nim |
18:36:49 | reactormonk | Araq, apparently no one cares about wxwidgets ;-) |
18:37:09 | * | cyraxjoe quit (Ping timeout: 265 seconds) |
18:39:13 | * | cyraxjoe joined #nim |
18:39:32 | * | cyraxjoe quit (Client Quit) |
18:39:53 | Araq | reactormonk: wxwidgets' headers are quite messy though so they make a good realworld example |
18:40:38 | * | gyeates joined #nim |
18:41:10 | * | filcuc quit (Remote host closed the connection) |
18:47:23 | reactormonk | Araq, neat. Could you check in the pure c2nim too? So we have a list you had to change to get it to work. |
18:48:44 | * | key_ joined #nim |
18:48:51 | Araq | well you can just diff the headers |
18:49:30 | Araq | but unfortunately I got how wxWidgets does it too late |
18:49:41 | Araq | so the diffs are much larger than they have to be ... |
18:49:58 | reactormonk | :-( |
18:50:22 | Araq | one thing that c2nim really sucks at is that #if is not yet supported within 'class' |
18:52:56 | * | filcuc joined #nim |
18:53:46 | * | cyraxjoe joined #nim |
18:56:12 | * | ekarlso quit (Ping timeout: 264 seconds) |
18:59:43 | * | ekarlso joined #nim |
19:01:24 | * | unclechu joined #nim |
19:05:35 | * | X67r joined #nim |
19:08:07 | * | filcuc quit (Quit: Konversation terminated!) |
19:08:48 | * | filcuc joined #nim |
19:10:31 | * | Cryptotoad joined #nim |
19:10:56 | Cryptotoad | Are there any usage examples of the sqlite3 class? |
19:12:42 | * | def- quit (Ping timeout: 256 seconds) |
19:12:43 | * | filcuc quit (Client Quit) |
19:12:46 | Araq | Cryptotoad: nimforum uses sqlite3 |
19:13:32 | * | filcuc joined #nim |
19:13:33 | Cryptotoad | Oh, so it would be similar enough to use say, python tutorials on sqlite3? |
19:16:48 | Araq | well nimforum is still small enough to see how sqlite3 can be used |
19:17:26 | Araq | it uses db_sqlite btw which is much more convenient to use |
19:22:45 | * | wb quit (Ping timeout: 256 seconds) |
19:25:17 | * | def- joined #nim |
19:27:32 | * | wirbi joined #nim |
19:29:04 | wirbi | Hello! How to declarate binary operators for js? If I use proc `>>`(x, y: int32): int32 {.importc.} then in code I have wrong tmpx_16072 = >>(tmpx_16072, 8); |
19:29:39 | * | wb joined #nim |
19:30:13 | Arrrr | shr |
19:30:51 | Arrrr | http://nim-lang.org/docs/system.html#shr,int,int |
19:32:19 | * | filcuc quit (Quit: Konversation terminated!) |
19:32:53 | wirbi | Hm... It's realy work, but before you say I receive error. |
19:33:39 | Arrrr | Because i enabled a magical switch that makes it working on every nim compiler in the world |
19:35:15 | * | filcuc joined #nim |
19:37:50 | Araq | wirbi: as a workaround you can also use the 'asm' statement |
19:38:10 | Araq | proc `>>`(x, y: int32): int32 = |
19:38:28 | Araq | asm """ `result` = `x` >> `y` """ |
19:38:55 | wirbi | Arrrr: ) |
19:39:41 | wirbi | Araq: Thank you! It's power tool. |
19:42:56 | * | tinAndi joined #nim |
19:43:16 | * | aziz joined #nim |
19:43:29 | * | filcuc quit (Quit: Konversation terminated!) |
19:45:35 | * | filcuc joined #nim |
19:46:04 | * | def- quit (Quit: -) |
19:46:56 | * | def- joined #nim |
19:49:40 | * | pregressive joined #nim |
19:50:21 | * | wirbi quit (Ping timeout: 246 seconds) |
20:00:39 | * | Arrrr quit (Quit: WeeChat 1.2) |
20:02:49 | kokozedman | How do I access the elements of a C pointer? like a "v: ptr UdtSocket", and in C, one could do something like "v[2]" for the third element... how is this done in Nim? |
20:04:36 | Araq | v: ptr array[Arbitrary, UdtSocket] |
20:04:39 | Araq | v[2] |
20:04:42 | kokozedman | or better yet, how to create an array that doesn't do any copy and instead directly maps a memory location, like the ptr UdtSocket above? |
20:05:06 | kokozedman | oh, ok... another new less |
20:05:07 | kokozedman | thanks Araq |
20:05:10 | Araq | you need to define const Arbitrary = 10_000 |
20:05:11 | kokozedman | lesson* |
20:05:20 | * | filcuc quit (Quit: Konversation terminated!) |
20:05:33 | kokozedman | Araq, really? is there going to be a overhead with that? |
20:05:44 | Araq | nope |
20:07:12 | * | miglo joined #nim |
20:09:13 | miglo | Hi! I've installed via nimble the nre module and got additionally the module options_t, but the compiler complains about 'import options' that is located within 'nre.nim'. Do I have to install any additional package maybe? |
20:09:41 | * | tinAndi quit (Quit: ChatZilla 0.9.91.1 [Firefox 39.0/20150630154324]) |
20:10:15 | miglo | does the 'options' correspond to 'options_t' maybe? |
20:12:38 | * | matkuki joined #nim |
20:13:09 | * | matkuki quit (Client Quit) |
20:14:49 | Araq | miglo: I don't know but nre is part of the stdlib now in devel, so maybe switch to the github devel version |
20:19:38 | * | yglukhov_____ quit (Quit: Be back later ...) |
20:21:08 | * | yglukhov_____ joined #nim |
20:25:18 | * | gyeates quit (Ping timeout: 248 seconds) |
20:25:27 | * | yglukhov_____ quit (Ping timeout: 246 seconds) |
20:25:52 | miglo | the tutorial mentions that sequences are resizable during runtime. it mentions also how an certain element can be accessed but there is no explanation how a sequence can be modifed during runtime, how more elements can be added :-/ |
20:26:47 | Araq | yeah, somebody should update tut1. (Varriount? def-?) |
20:26:47 | fowl | miglo have you seen the nim by example website |
20:27:30 | Araq | miglo: use 'add' to append, newSeq[string](length) to create a seq[string] of the given length |
20:28:20 | miglo | yeah, its the add proc that I have seen already somewhere |
20:29:00 | * | xet7_ joined #nim |
20:29:00 | * | xet7 quit (Read error: Connection reset by peer) |
20:29:02 | miglo | I forgot about the examples that I've also ready a little bit |
20:31:50 | * | raza quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
20:32:56 | * | bogen-work joined #nim |
20:33:38 | bogen-work | hi. How do run a program at compile time? (To swallow it's output and return a string) |
20:34:25 | Araq | bogen-work: staticExec |
20:34:39 | * | raza joined #nim |
20:35:17 | bogen-work | thanks |
20:35:57 | kokozedman | another lesson for me, thanks for that staticExec thing Araq |
20:36:39 | * | raza quit (Client Quit) |
20:36:45 | * | kokozedman quit (Quit: Leaving) |
20:40:11 | Araq | bogen-work: with a bit of luck you can run marshal.to and marshal.`$$` at compile-time too for easy serialization of staticExec'ed data |
20:40:59 | bogen-work | Araq: thanks |
20:41:27 | Araq | check out my "lexim" project where I use this to offload DFA minimization for lexer generation |
20:42:55 | Araq | it works at compile-time in pure Nim VM based code, but compile-times are > 20 seconds. After offloading to an external Nim process, it's < 1s |
20:56:19 | * | txt_ joined #nim |
20:58:09 | * | txt_ left #nim (#nim) |
21:00:12 | * | clone1018_ quit () |
21:00:34 | * | clone1018 joined #nim |
21:03:10 | * | xcombelle quit (Quit: Leaving) |
21:03:50 | * | Demos joined #nim |
21:05:17 | * | jszymanski quit (Quit: computer sleeps...) |
21:07:54 | Demos | ohmygosh binary search drama |
21:07:57 | Demos | drrrraaaama |
21:08:09 | * | aziz quit (Remote host closed the connection) |
21:08:11 | Demos | I should check if that overflow is in the C++ library version too |
21:08:26 | Xe | Demos: wat |
21:09:28 | Demos | someone bitched about binarySearch |
21:09:39 | Demos | its designed so that you can insert elements using it I think |
21:10:40 | Araq | yeah it overflows when you have more element than fit in RAM anyway or something like that |
21:10:51 | * | gyeates joined #nim |
21:12:51 | * | Demos quit (Read error: Connection reset by peer) |
21:12:57 | * | Demos_ joined #nim |
21:14:27 | * | Demos_ quit (Remote host closed the connection) |
21:15:05 | * | Demos joined #nim |
21:15:13 | Demos | that does not sound like an overflow to me |
21:15:28 | Demos | like you can't even prevent that |
21:20:37 | Araq | well Nim's int is already word-sized to mitigate such problems |
21:20:48 | Araq | and in debug builds we detect overflows too, so *shrug* |
21:21:51 | Araq | i often wonder if people who really care about these things also throw away their cell phones when they get a busy signal. |
21:24:00 | miglo | if I create a new sequence in the following way "var x: seq[]", then can I say the x is a reference to a integer sequence that is initialized with nil? |
21:24:26 | Araq | yes |
21:24:45 | miglo | ups, should be: seq[int] |
21:29:46 | * | unclechu quit (Quit: Leaving.) |
21:31:26 | * | Miko___ quit (Ping timeout: 248 seconds) |
21:33:14 | * | heinrich5991 quit (Ping timeout: 256 seconds) |
21:33:35 | renesac | but that fix to the possible overflow has no negative side to it |
21:33:50 | renesac | pun not intended |
21:35:01 | renesac | it is not inconceivable one work with a 1GB char array on a 32bit program |
21:36:47 | * | heinrich5991 joined #nim |
21:37:37 | Araq | renesac: it's surely is and I'd rather add an "exceeds 1 GB" check into 'newSeq' and 'add' and 'setLen' than having binarySearch work with it but then not much else |
21:38:12 | renesac | what? |
21:38:15 | renesac | not much else? |
21:39:19 | renesac | the fix is painless, why would you add superflous checks in multiple places instead? |
21:40:07 | Araq | the checks are not superfluous, if your program needs to work with 1 GB sized arrays on a 32bit machine it's broken already. |
21:40:48 | Araq | fragmentation could happen, for instance |
21:40:49 | renesac | and nim binary search still only works with openarray, but in the future when concepts are more developed it could work in a dynamically generated random access thingy |
21:41:09 | renesac | much bigger than the physical memory |
21:41:18 | Araq | IMO this should fail with OOM reliably |
21:41:37 | * | dgellow joined #nim |
21:42:25 | Araq | renesac: yeah but the concept version then should use int64 or bignums |
21:42:33 | renesac | could happen, but there are ways around |
21:42:50 | renesac | I don't agree putting a limit on the language level for this |
21:43:27 | Araq | the limit already exists, it's just about making it more deterministic |
21:43:28 | renesac | it could happen with 700mb arrays too |
21:43:35 | renesac | where you call the line? |
21:44:21 | Araq | could it? how so? |
21:44:22 | renesac | hell, it could happen with 2mb arrays |
21:45:17 | renesac | if you have things allocated every 1mb of memory |
21:45:21 | renesac | that can't be moved |
21:45:49 | Araq | yeah but 1 GB more likely than not will fail, and 2 MB more likely than not will succeed. |
21:46:04 | renesac | yes |
21:46:22 | renesac | the programmer should catch the exception in case of failure, ideally |
21:46:41 | renesac | but if it can be done, do it |
21:47:00 | Araq | there is not even an exception, the program dies. There is a hook you can set though. |
21:47:09 | Araq | For OOM I mean. |
21:47:40 | Demos | you probably don't want to catch the exception around every alloc |
21:47:42 | renesac | in c I simply check the output of malloc |
21:48:00 | Araq | yeah and on Linux, it doesn't return NULL. |
21:48:24 | Araq | not that it matters anyway. you could also run out of stack space. how do you check for that in C? |
21:50:11 | renesac | Araq: are you sure it don't returns null when it don't have contiguous space |
21:50:21 | renesac | I konw it can allocate more memory than physical memory |
21:50:27 | Demos | by the way nim's bsearch happens to be almost identical to c++'s bsearch (libc++) |
21:50:28 | renesac | but not more memory than address space |
21:50:50 | Araq | Linux overcommits memory and when you *access* the memory you get a segfault |
21:50:58 | renesac | Araq: exactly |
21:51:05 | Demos | it might return null when your out of virtual address space |
21:51:07 | renesac | it can still fail because of fragmentation |
21:51:32 | renesac | especially in 32bit |
21:51:57 | renesac | or less |
21:52:07 | Demos | you may be right, it'll assign virtual pages when you call malloc. But it wont commit them |
21:52:28 | Demos | and the overcommit only applies to new pages afaik |
21:52:36 | EXetoC | well if all or nothing is the only way |
21:52:40 | Demos | not to malloc giving you memory on an old page |
21:53:58 | Araq | so what do you do with a malloc that sometimes returns NULL and sometimes your program will crash instead? |
21:54:42 | Araq | and even if it always returns NULL how do you handle "out of stack space"? |
21:55:54 | * | wb quit (Ping timeout: 256 seconds) |
21:56:06 | renesac | unless you do recursion, you are unlikelly to hit the stack limit |
21:56:14 | renesac | or alloca, or something funky |
21:56:25 | renesac | if you do recursion, you can limit the recursion depth |
21:56:57 | Araq | fixed size arrays on the stack are very common in C since it's the only automatic form of memory management that you can get |
21:57:56 | Araq | *of automatic memory management |
21:58:12 | renesac | well, tests should ideally trigger excessive use of the stack in that way |
21:58:44 | * | FedeOmoto quit (Quit: Leaving) |
21:58:50 | renesac | if they go to the end of a non-recursive algorithm |
21:59:19 | Araq | but didn't you argue for the rare case where you suddenly have a 1 GB char array at runtime? :P |
21:59:32 | renesac | it might not be rare |
21:59:44 | Araq | (which escaped your testing?) |
21:59:48 | renesac | the program may be designed to work with chunks of 1GB |
22:00:16 | Araq | sure, you can have almost 4 of these after all |
22:00:33 | Araq | sounds like a common and reasonable "design" |
22:00:49 | renesac | it can work with only one such chunk at a time to process a bigger file |
22:00:55 | renesac | for example |
22:01:20 | EXetoC | on 32-bit systems with <4GB? is that not rare? and what about opt-out? |
22:01:39 | EXetoC | well, any system with a relatively low amount of RAM |
22:01:43 | renesac | EXetoC: I don't know why to introduce that complexity in the first place |
22:02:26 | renesac | and C is normally used when you are close to the limits of the machine, and want that extra memory efficiency/performance |
22:02:41 | renesac | I hope to use nim in those cases too |
22:03:04 | Demos | Just try allocateing a 1GB array. even on a 64bit machine there is a great chance you won't get 1G from one call you malloc |
22:03:26 | Araq | Demos: did you try it? |
22:03:43 | Demos | I have yeah, I depends on the system |
22:03:52 | Demos | I remember windows bailing out pretty quick |
22:04:46 | Araq | commonly overlooked is also that with a shared memory for the graphics card a good chunk of the address space is taken from you |
22:08:19 | Araq | renesac: but let me put it this way: bug detected because <can fail under these rare circumstances> --> low priority |
22:08:41 | Araq | bug detected under these rare circumstances that *actually* happened --> high priority |
22:09:49 | Araq | and no "I constructed test cases so it *actually* happened" doesn't count. |
22:10:12 | renesac | ok, what I don't agree is putting arbitrary limits on newSeq, etc |
22:10:39 | renesac | I know you like those "arbitrary but deterministic" limits though |
22:12:09 | Araq | maybe it's because I wrote web crawlers for quite some time. The least thing you want is that the "crawler works with 1 GB HTML files but it kills your throughput" |
22:13:21 | Araq | instead you want "reject this piece of garbage, we have 1 million pages left to crawl" |
22:16:36 | * | xet7_ quit (Read error: Connection reset by peer) |
22:16:51 | dgellow | Is there an option to specify to the compiler a build directory ? Something like `nim c -outputDir:./build/ test.nim` that generates a 'test' binary into ./build dir |
22:17:02 | Araq | dgellow: --nimcache:foo |
22:17:44 | Araq | and --out:testbinary but --out picks the wrong directory iirc |
22:19:59 | * | pregressive quit (Remote host closed the connection) |
22:19:59 | * | EXetoC quit (Read error: Connection reset by peer) |
22:20:23 | * | Trustable quit (Remote host closed the connection) |
22:21:18 | dgellow | --nimcache only changes the output dir of C files. Not the one for the generated binary. |
22:21:39 | Araq | yes, for that we have --out |
22:22:13 | dgellow | yeah, I already knew about --out, but I don't want to specify the name of the binary. |
22:25:02 | * | miglo left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.") |
22:31:27 | * | EXetoC joined #nim |
22:36:18 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:50:50 | * | fowl quit (Quit: zz) |
22:55:10 | * | gyeates quit (Ping timeout: 248 seconds) |
23:01:49 | * | X67r quit (Quit: leaving) |
23:06:10 | * | fowl joined #nim |
23:06:10 | * | fowl quit (Changing host) |
23:06:10 | * | fowl joined #nim |
23:06:10 | * | fowl quit (Changing host) |
23:06:10 | * | fowl joined #nim |
23:06:13 | * | fowl quit (Excess Flood) |
23:06:19 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:07:41 | * | gyeates joined #nim |
23:12:08 | * | fowl joined #nim |
23:20:09 | * | saml_ joined #nim |
23:22:12 | * | vasher_ joined #nim |