00:30:13 | * | SirCremator joined #nim |
00:45:46 | tymat | is there a way to do restricted pointers in nim? |
00:51:13 | * | vikaton joined #nim |
00:51:28 | Araq | tymat: what is a restricted pointer? |
00:52:12 | tymat | https://en.wikipedia.org/wiki/Restrict |
00:54:35 | Amrykid | ok. sent the PR. man, that's been bothering me for years. |
00:56:18 | Araq | tymat: not yet, it's on my todo. usually you can get the same effect with a c compiler switch too |
01:11:24 | * | rollo quit (Quit: Leaving) |
01:12:20 | * | Demos quit (Read error: Connection reset by peer) |
01:21:35 | * | n99999i_ joined #nim |
01:23:17 | * | n99999i quit (Ping timeout: 250 seconds) |
01:34:38 | * | Trustable_2 joined #nim |
01:37:08 | * | SirCremator left #nim (#nim) |
01:37:33 | * | Trustable quit (Ping timeout: 246 seconds) |
02:09:01 | * | yglukhov joined #nim |
02:13:29 | * | yglukhov quit (Ping timeout: 244 seconds) |
02:25:37 | * | Demon_Fox_ joined #nim |
02:28:05 | * | Demon_Fox quit (Ping timeout: 256 seconds) |
02:28:40 | * | Demon_Fox_ is now known as Demon_Fox |
02:52:50 | * | Trustable_2 quit (Quit: Leaving) |
03:19:29 | * | strcmp1 joined #nim |
03:31:47 | * | darkf joined #nim |
03:39:20 | * | vegansk joined #nim |
04:22:16 | * | Cryptotoad quit (Read error: Connection reset by peer) |
04:22:40 | * | Cryptotoad joined #nim |
04:51:35 | * | yglukhov joined #nim |
04:55:59 | * | yglukhov quit (Ping timeout: 264 seconds) |
05:13:58 | * | jszymanski joined #nim |
05:23:55 | * | SirCremator joined #nim |
05:24:05 | SirCremator | i have a question. |
05:24:19 | SirCremator | what does rm -rf / in powershell do? |
05:39:48 | * | jszymanski quit (Quit: computer sleeps...) |
05:51:13 | * | SirCremator left #nim (#nim) |
06:18:34 | * | gsingh93 quit (Ping timeout: 260 seconds) |
06:20:21 | * | gsingh93 joined #nim |
06:38:23 | * | tankfeeder joined #nim |
06:42:28 | * | johnsoft joined #nim |
06:43:06 | * | chemist69 joined #nim |
06:49:35 | * | Ven joined #nim |
07:05:08 | * | strcmp1 quit (Read error: Connection reset by peer) |
07:32:16 | * | yglukhov joined #nim |
07:36:42 | * | kilon quit (Ping timeout: 250 seconds) |
07:39:07 | * | yglukhov quit (Remote host closed the connection) |
07:41:15 | * | kilon joined #nim |
07:48:02 | Araq | er ... we handle shebangs correctly since forever? what am I missing? |
07:48:35 | Araq | #! / is a shebang #! without the / is a parser directive? |
07:52:47 | * | kilon quit (Ping timeout: 256 seconds) |
07:56:36 | Araq | ah got it |
07:57:17 | * | kilon joined #nim |
07:59:42 | * | yglukhov joined #nim |
08:03:57 | * | infinity0_ joined #nim |
08:03:58 | * | infinity0_ quit (Changing host) |
08:03:58 | * | infinity0_ joined #nim |
08:03:58 | * | infinity0 is now known as Guest87195 |
08:03:58 | * | Guest87195 quit (Killed (barjavel.freenode.net (Nickname regained by services))) |
08:03:58 | * | infinity0_ is now known as infinity0 |
08:04:07 | * | yglukhov quit (Remote host closed the connection) |
08:04:23 | * | yglukhov joined #nim |
08:07:07 | * | coffeepot joined #nim |
08:17:57 | * | infinity0_ joined #nim |
08:17:59 | * | infinity0_ quit (Changing host) |
08:17:59 | * | infinity0_ joined #nim |
08:17:59 | * | infinity0 is now known as Guest97658 |
08:17:59 | * | Guest97658 quit (Killed (hitchcock.freenode.net (Nickname regained by services))) |
08:17:59 | * | infinity0_ is now known as infinity0 |
08:20:34 | NimBot | nim-lang/Nim devel bd12b7d Rostyslav Dzinko [+0 ±1 -0]: Added == operator for comparing two Object IDs |
08:20:34 | NimBot | nim-lang/Nim devel ac79861 Dominik Picheta [+0 ±1 -0]: Merge pull request #3306 from SSPkrolik/oids-add-comparator... 2 more lines |
08:21:17 | Araq | er ... what is this? |
08:21:43 | * | tankfeeder quit (Quit: Leaving) |
08:23:30 | NimBot | nim-lang/Nim devel 6d654f8 Araq [+0 ±2 -0]: even better docs |
08:23:30 | NimBot | nim-lang/Nim devel 833a934 Araq [+0 ±1 -0]: NimScript: make the compiler shut up about effects it doesn't know about |
08:23:30 | NimBot | nim-lang/Nim devel 494431e Araq [+0 ±1 -0]: gangbang support for NimScript |
08:23:30 | NimBot | nim-lang/Nim devel f1a1799 Araq [+0 ±3 -0]: minor documentation cleanups |
08:28:46 | dom96 | er... umm... hmmm? |
08:33:01 | Araq | never mind I thought it would be a dangerous == |
08:39:13 | NimBot | nim-lang/Nim devel 5eaf688 Araq [+0 ±1 -0]: fixes #3300 |
08:40:35 | r-ku | love those pearls lurking in commit messages lol |
08:47:27 | * | jszymanski joined #nim |
08:51:45 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:52:05 | * | Ven joined #nim |
08:56:38 | * | Ven quit (Client Quit) |
08:57:51 | * | BitPuffin|osx quit (Ping timeout: 250 seconds) |
08:58:37 | * | Cryptotoad quit (Quit: Leaving) |
09:05:25 | Araq | Amrykid: did you marry? |
09:05:59 | dom96 | Araq: what? |
09:06:06 | NimBot | nim-lang/Nim devel 564c9f4 Alexander Mitchell-Robinson [+0 ±3 -0]: Fixed my name. |
09:06:06 | NimBot | nim-lang/Nim devel 55e4796 Andreas Rumpf [+0 ±3 -0]: Merge pull request #3303 from Amrykid/amrykid-name-change... 2 more lines |
09:06:16 | dom96 | oh, interesting. |
09:06:24 | Araq | he got a longer name |
09:06:43 | dom96 | added his middle name maybe? |
09:07:16 | * | yglukhov quit (Remote host closed the connection) |
09:17:02 | * | Kingsqueee joined #nim |
09:17:55 | * | yglukhov joined #nim |
09:18:10 | * | Kingsquee quit (Read error: Connection reset by peer) |
09:20:34 | * | NimBot joined #nim |
09:28:31 | yglukhov | Araq: what does shallowCopy do exactly? is it kinda memcpy in C? |
09:29:39 | yglukhov | if we have a complex object with complex object members, then in JS we'll have to traverse this object completely, doing almost deep copy, right? |
09:32:09 | * | yglukhov quit (Remote host closed the connection) |
09:32:47 | * | yglukhov joined #nim |
09:33:04 | Araq | memcpy is the right image |
09:33:38 | * | boopsiesisaway is now known as boopsies |
09:33:44 | yglukhov | ok, but in js we're screwed. |
09:35:29 | Araq | why? |
09:39:10 | yglukhov | because for complex-but-still-value types, we'll have to do almsost what nimCopy does. type A = tuple[tuple[tuple[tuple[a, b: int], b: int], b: int], b: int]. With memcpy this is easy. With js-shallow-copy it's at least 4 recursive calls. |
09:39:48 | Araq | nimCopy already has a "deepCopy" bool argument, right? |
09:40:20 | Araq | (btw it's more complex for the C codegen too...) |
09:40:37 | yglukhov | it doesn't |
09:41:04 | Araq | it should grow one then |
09:41:33 | yglukhov | does shallowCopy optimize only for strings and seqs? |
09:41:42 | Araq | yes |
09:42:01 | Araq | cannot optimize anything else |
09:42:15 | Araq | object is embedded and the other stuff is fast to begin with |
09:42:30 | yglukhov | not in js =) |
09:43:23 | yglukhov | i still think that splice would be waaay faster. |
09:43:39 | yglukhov | at the cost of broken pointers. |
09:44:10 | yglukhov | pointers are such a pita in js. |
09:45:02 | Araq | dunno, the chosen representations work well afaict |
09:45:45 | Araq | a pointer is an (array,idx) pair |
09:46:03 | Araq | deref is array[idx] |
09:46:29 | yglukhov | i'd say they work as good as they can get for js. |
09:46:39 | yglukhov | but not better =) |
09:46:55 | Araq | the only thing complex here is that we map "ref object" to pain JS objects for performance and interop |
09:47:05 | Araq | *plain |
09:47:07 | Araq | lol |
09:50:23 | Araq | also ... performance of the generated JS was not my point when I wrote the JS codegen... for that you need to do it differently |
09:52:44 | yglukhov | my point is that pointers are pretty rudimentary in Nim. there's almost no need to use them. And if one uses them, he has to understand how pointers work. And pointers might work differently even on different native targets. E.g. unaligned rw, etc. So tell me, why does JS have to closely "emulate" pointers behavior as if they are C pointers. |
09:53:27 | yglukhov | besides, pointers arithmetics and casts don't work there at all. |
09:54:08 | reactormonk | aren't pointers only there for C interop? |
09:55:04 | yglukhov | and if that is true, why doing rather complex shallow copies in js just to keep pointers working. |
09:55:04 | reactormonk | apparently nope. 125 in lib/pure/ |
09:55:46 | * | boopsies is now known as boopsiesisaway |
09:56:14 | yglukhov | 125 in lib/pure/what? |
09:56:26 | Araq | yglukhov: well I don't mind that shallowCopy does something slightly different for the JS target |
09:56:39 | Araq | but generic seq ops need to work, one way or the other |
09:57:04 | Araq | specialized impls for performance are fine too, but not if it patches over a JS codegen bug |
10:00:19 | * | NimBot joined #nim |
10:00:59 | yglukhov | i don't think it's a js codegen bug. shallowCopy is a magic that may be treated by the backend as wishes. and JS backend treats shallowCopy as semantically correct as it can: just to the ref copy and that's it. Users of shallowCopy, imho also need to know it. And seq.insert is wrong ONLY because it doesn't nullify the last remaining ref, that's it. otherwise it would work. but my PR goes a little further than that. |
10:02:22 | yglukhov | I assume that builtin splice operation would work more efficienlty than a hand-written algorithm in JS that does exaclty that. |
10:02:34 | yglukhov | and this is what my pr about. |
10:03:18 | Araq | I still don't understand why 'insert' doesn't work |
10:03:45 | Araq | what needs to be set to null? and why? |
10:04:39 | yglukhov | x[i] = null, before x[i] = item |
10:05:08 | yglukhov | because x[i] = item is rewritten as: x[i] = nimCopy(x[i], item) |
10:05:47 | yglukhov | if x[i] is not null it will point to x[i+1] |
10:06:05 | yglukhov | and nimCopy will overwrite "both" of them |
10:07:17 | * | yglukhov quit (Remote host closed the connection) |
10:12:38 | gokr | Araq: In Smalltalk there is this pattern that Object>>copy is implemented as "return self.shallowCopy().postCopy()" where postCopy does nothing by default. |
10:13:34 | gokr | So if you want to implement "deeper" copying in a class you basically implement postCopy, because that runs in the new guy - so no encapsulation broken. |
10:14:44 | Araq | not sure if it would violate encapsulation otherwise, but interesting |
10:15:50 | gokr | Its a fairly deep pattern in Smalltalk code. If you let the old guy try to "stuff things into" the new guy - then that needs methods to do it, and you don't want to open up such methods typically. |
10:16:28 | gokr | But since the shallow new guy has everything, its better to just send him #postCopy. |
10:17:01 | gokr | And there you will then find "funny looking" code like "myVar = myVar copy" etc. |
10:17:16 | gokr | Selectively deepening the copy. |
10:17:33 | gokr | But what do old farts like Smalltalkers know eh? :) |
10:17:43 | * | Kingsqueee quit (Quit: http://i.imgur.com/EsXzoum.png) |
10:19:20 | * | yglukhov joined #nim |
10:20:12 | Araq | 'if x[i] is not null it will point to x[i+1]' ... what? o.O |
10:20:42 | yglukhov | that's because previously the elements were moved by shallowCopy |
10:20:53 | yglukhov | x[i+1] = x[i] |
10:24:15 | * | jszymanski quit (Ping timeout: 255 seconds) |
10:24:36 | * | Demon_Fox quit (Quit: Leaving) |
10:26:02 | yglukhov | gokr, Araq: D has also got a so-called postblit constructor. this(this) { ... }. It is called after memcpy. And not called for move semantics. |
10:26:04 | * | jszymanski joined #nim |
10:27:37 | yglukhov | Araq, so does that insert bug make sense? |
10:29:38 | Araq | no, not at all |
10:33:01 | yglukhov | hrm... ok. to insert an element at Index, we need to realloc the array by 1. Then we need to shift all elements from Index to Len by 1. |
10:33:31 | yglukhov | the shift is done in a loop: i = countdown(len, Index): |
10:33:42 | yglukhov | x[i + 1] = x[i] |
10:34:48 | yglukhov | after this loop the x[Index] points to the old value. and x[Index + 1] points to the same value as well. |
10:34:54 | yglukhov | does that make sense? |
10:35:12 | yglukhov | * not points, but "contains" |
10:35:59 | yglukhov | and since this is JS, the values are references to JS objects. |
10:37:45 | Araq | but x[Index] will then get the inserted element |
10:38:00 | Araq | so what's the problem? |
10:38:28 | yglukhov | yes! and insertion is done in the following way: x[Index] = nimCopy(x[Index], newValue) |
10:38:48 | yglukhov | nimCopy deep copies newValue into x[Index] |
10:39:34 | yglukhov | i.e. nimCopy reuses it's dest argument if it's available. |
10:40:12 | Araq | aha! |
10:40:21 | yglukhov | =) |
10:41:11 | * | tja joined #nim |
10:45:36 | * | elrood joined #nim |
10:45:58 | * | tja quit (Client Quit) |
10:46:02 | Araq | well since shallowCopy is about a moves, I think it's fine to set stuff to null in the JS implemenation |
10:46:21 | Araq | shallowCopy(a, b) # 'b' invalid afterwards? dunno |
10:48:25 | * | Trustable joined #nim |
10:50:14 | yglukhov | dunno either. imho, shallowCopy is just one of those beasts you have to know how to use. |
10:51:14 | yglukhov | but what about splice? Don't you think it's better to use standard js algorithms when possible? |
10:53:08 | * | yglukhov quit (Remote host closed the connection) |
11:00:24 | * | yglukhov joined #nim |
11:02:40 | * | raza joined #nim |
11:12:06 | * | yglukhov quit (Remote host closed the connection) |
11:15:53 | * | funny_falcon joined #nim |
11:17:00 | * | funny_falcon quit (Client Quit) |
11:17:12 | * | thotypous quit (Ping timeout: 264 seconds) |
11:24:34 | * | yglukhov joined #nim |
11:33:11 | * | thotypous joined #nim |
11:38:37 | * | mal`` quit (Ping timeout: 240 seconds) |
11:42:10 | * | irrequietus joined #nim |
11:47:35 | * | X67r joined #nim |
11:52:31 | * | mal`` joined #nim |
11:52:43 | wuehlmaus | just a little overview question: is nim 1.0 available in a few months or in a few weeks? anybody knows? |
11:54:08 | dom96 | likely in a few months |
11:54:43 | * | Jehan_ joined #nim |
11:55:24 | wuehlmaus | so we are probably seeing a 0.11.3 or 0.12 before a 1.0, right? |
11:56:37 | * | bendiken joined #nim |
11:57:44 | dom96 | yep |
12:04:29 | * | BitPuffin joined #nim |
12:17:27 | Araq | yglukhov: the interaction between nimCopy and shallowCopy is error prone and we need to do somehting about it |
12:17:39 | Araq | however, I'm willing to accept your PR as it is |
12:28:17 | * | FedeOmoto joined #nim |
12:40:32 | * | yglukhov quit (Remote host closed the connection) |
12:59:00 | r-ku | Araq you still forgot what you promised :p (urhonimo) |
13:00:09 | * | yglukhov joined #nim |
13:02:18 | * | yglukhov quit (Remote host closed the connection) |
13:15:30 | * | bendiken quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
13:15:48 | Araq | r-ku: gangbangs are more important |
13:16:37 | * | bendiken joined #nim |
13:22:54 | * | yglukhov joined #nim |
13:23:00 | r-ku | Araq could not agree more! |
13:27:24 | * | yglukhov quit (Ping timeout: 264 seconds) |
13:28:29 | Jehan_ | Araq: For C function pointers, use {.cdecl.} or {.noconv.}? |
13:29:41 | Jehan_ | The stdlib seems to use both. |
13:30:17 | Araq | depends. Ansi C pretty much requires .noconv, the rest should use cdecl |
13:32:24 | Jehan_ | Yeah, it looks like I have to use what the Boehm GC does. Hmm, what does importc default to? .nimcall, .cdecl, or .noconv? |
13:32:39 | Araq | .nimcall |
13:36:36 | Jehan_ | Hmm, may want to adjust the importcs then, too, because they should be noconv. |
13:36:52 | Jehan_ | For the Boehm GC, that is. |
13:36:58 | Araq | ok |
13:41:29 | wuehlmaus | /query guitarman |
13:45:25 | * | yglukhov joined #nim |
13:49:51 | * | yglukhov quit (Ping timeout: 260 seconds) |
13:55:00 | Jehan_ | Huh, while testing, --gc:go barfs on something where I don't even know why it does that (and it does that for the devel branch also, not just my patch). |
13:55:15 | * | jaco60 joined #nim |
13:55:34 | Jehan_ | lib/system/mmdisp.nim(207, 46) Error: pragmas are only allowed in the header of a proc |
13:55:35 | Jehan_ | proc `div`[T: SomeUnsignedInt](x, y: T): T {.magic: "DivU", noSideEffect.} |
13:55:41 | Jehan_ | Position is the opening brace. |
13:56:11 | * | yglukhov joined #nim |
13:57:01 | * | n99999i_ quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
13:57:45 | Jehan_ | Oh, is this because `div` is being redefined? |
13:58:57 | Araq | yes |
13:59:13 | Jehan_ | Yup, if I remove the definitions, then everything works. |
13:59:59 | Araq | I thought it would break --gc:go but def- said it's fine ;-) |
14:00:44 | Jehan_ | Hmm, I'm getting the above error if I turn --gc:go on. |
14:02:03 | Araq | yeah same here |
14:02:57 | Jehan_ | Ah, it happened when unsigned operations were moved to the systems module. |
14:03:44 | Jehan_ | I'm going to remove them as part of the PR I'm working on. |
14:04:13 | Araq | thank you |
14:05:25 | Jehan_ | For what it's worth, I've now got everything properly working with --gc:boehm --threads:on, but I'm still doing some more testing to verify that there's not some configuration that doesn't break. |
14:05:38 | Jehan_ | That's because the code that I'm changing is littered with when clauses. |
14:06:21 | Araq | tests\testament\tester c gc |
14:06:30 | Araq | has pretty good coverage |
14:07:08 | Araq | so what do I do when cmake ignores my -D CMAKE_C_COMPILER settings? |
14:11:53 | * | saml joined #nim |
14:12:17 | * | Ven joined #nim |
14:22:04 | Jehan_ | Araq: Hmm, but they don't seem to deal with --gc:boehm. Will have a look at them, anyway. |
14:26:18 | * | NimBot joined #nim |
14:27:15 | Jehan_ | Ah, found how I could change that to include the Boehm GC in the source. |
14:27:32 | Jehan_ | Do you want me to add Boehm GC support for those tests? |
14:28:01 | * | NimBot joined #nim |
14:30:38 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:33:09 | * | n99999i joined #nim |
14:33:45 | * | Jehan_ quit (Quit: Leaving) |
14:42:25 | * | UberLambda joined #nim |
14:43:13 | * | NimBot joined #nim |
14:46:31 | * | Ven joined #nim |
14:50:31 | * | yglukhov quit (Remote host closed the connection) |
14:50:35 | * | raza quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
14:57:32 | * | n99999i quit (Read error: Connection reset by peer) |
14:57:35 | * | n99999i_ joined #nim |
15:01:25 | * | yglukhov joined #nim |
15:02:12 | * | n99999i_ quit (Read error: Connection reset by peer) |
15:02:17 | * | n99999i joined #nim |
15:02:34 | * | yglukhov quit (Remote host closed the connection) |
15:08:10 | * | Ven quit (Read error: No route to host) |
15:08:35 | * | bendiken quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
15:09:36 | * | bendiken joined #nim |
15:11:15 | * | Ven joined #nim |
15:11:20 | * | Jesin quit (Quit: Leaving) |
15:12:59 | * | Jesin joined #nim |
15:14:49 | * | yglukhov joined #nim |
15:20:07 | * | bendiken quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
15:21:07 | * | bendiken joined #nim |
15:39:25 | * | mal`` quit (Ping timeout: 240 seconds) |
15:42:31 | * | mal`` joined #nim |
15:44:38 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:55:10 | * | jszymanski quit (Quit: computer sleeps...) |
16:02:05 | * | Ven joined #nim |
16:04:00 | * | golak joined #nim |
16:08:08 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:12:25 | * | darkf quit (Quit: Leaving) |
16:18:01 | * | yglukhov_ joined #nim |
16:20:55 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:21:19 | * | yglukhov quit (Ping timeout: 244 seconds) |
16:22:26 | * | yglukhov_ quit (Ping timeout: 260 seconds) |
16:25:31 | * | kilon quit () |
16:27:47 | * | enamex joined #nim |
16:27:53 | * | saml quit (Remote host closed the connection) |
16:33:15 | * | saml joined #nim |
16:33:15 | * | jszymanski joined #nim |
16:39:58 | * | boopsiesisaway is now known as boopsies |
16:49:01 | * | Ven joined #nim |
17:02:36 | * | enamex quit (Ping timeout: 246 seconds) |
17:04:42 | * | Miruya quit (Ping timeout: 246 seconds) |
17:07:21 | * | yglukhov joined #nim |
17:11:54 | * | yglukhov quit (Ping timeout: 260 seconds) |
17:19:25 | * | NimBot joined #nim |
17:21:40 | * | yglukhov joined #nim |
17:26:00 | * | stratact joined #nim |
17:26:14 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:28:31 | * | unclechu joined #nim |
17:28:37 | * | unclechu quit (Max SendQ exceeded) |
17:29:05 | * | key_ quit (Ping timeout: 256 seconds) |
17:33:36 | * | unclechu joined #nim |
17:34:02 | * | unclechu quit (Client Quit) |
17:34:25 | * | unclechoo joined #nim |
17:34:39 | * | unclechoo quit (Max SendQ exceeded) |
17:35:13 | * | unclechoo joined #nim |
17:35:27 | * | unclechoo quit (Max SendQ exceeded) |
17:36:13 | * | unclechoochoo joined #nim |
17:36:27 | * | unclechoochoo quit (Max SendQ exceeded) |
17:38:07 | * | Miruya joined #nim |
17:38:36 | * | Ven joined #nim |
17:48:45 | yglukhov | Araq: is there a script to generate urhonimo? |
17:49:04 | yglukhov | if there is, would be nice to have it in the urhonimo repo |
17:49:47 | Araq | it's full of manual tweaks. only for wxWidgets we got c2nim to the point where no tweaks of the generated Nim code were necessary |
18:01:40 | * | raza joined #nim |
18:04:17 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:04:20 | yglukhov | that's pity |
18:06:12 | * | BitPuffin quit (Ping timeout: 244 seconds) |
18:16:30 | * | UberLambda quit (Quit: GTG) |
18:17:46 | * | Jehan_ joined #nim |
18:22:52 | * | stratact quit (Quit: WeeChat 1.3) |
18:28:36 | * | yglukhov quit (Remote host closed the connection) |
18:42:43 | * | Jehan_ quit (Read error: Connection reset by peer) |
18:43:45 | * | elrood quit (Quit: Leaving) |
18:44:38 | * | redwyn joined #nim |
18:46:50 | * | key_ joined #nim |
18:48:01 | * | vendethiel joined #nim |
18:52:26 | * | yglukhov joined #nim |
18:53:22 | * | shodan45 joined #nim |
18:55:32 | * | Jehan_ joined #nim |
18:58:56 | * | Jehan_ quit (Read error: Connection reset by peer) |
18:59:09 | * | redwyn quit (Ping timeout: 246 seconds) |
19:02:11 | * | Jehan_ joined #nim |
19:11:38 | * | redwyn joined #nim |
19:13:15 | * | thotypous quit (Ping timeout: 260 seconds) |
19:16:05 | Araq | Jehan_: I was under the impression that the gc tests already run under --gc:boehm |
19:16:15 | Araq | it's specialized in the tester |
19:16:32 | Jehan_ | Araq: Huh. When I looked at it, they didn't appear to. |
19:17:48 | Jehan_ | No, --gc:boehm is done for the DLL tests. |
19:18:17 | Araq | hrm ok |
19:18:47 | Jehan_ | I did an egrep -i boehm tests/**/*.nim |
19:18:53 | Jehan_ | Didn't find anything else. |
19:22:50 | * | unclechoochoo joined #nim |
19:23:03 | * | unclechoochoo quit (Max SendQ exceeded) |
19:24:46 | Araq | you're right it only tests markAndSweep, refc, refc with realtime support in debug and release versions ... |
19:24:57 | Araq | combinatorial explosion ftw |
19:25:30 | * | Matthias247 joined #nim |
19:29:57 | * | UncleChoo joined #nim |
19:33:08 | * | UncleChoo quit (Client Quit) |
19:34:03 | * | unclechu joined #nim |
19:34:15 | OnO | is {.base.} annotation is necessary for compiler? or it is just for developer sanity? |
19:34:23 | OnO | I mean for methods base |
19:40:14 | * | renesac quit (Ping timeout: 244 seconds) |
19:42:42 | Araq | OnO: for developer sanity |
19:43:12 | Araq | and if I get too many complaints, I may remove it again. But I like it. |
19:44:50 | * | redwyn left #nim (#nim) |
19:45:19 | OnO | but do you think that pragma is the right place, shouldn't it be a keyword instead? I mean pragmas IMHO shouldn't be obligatory and shouldn't have impact on program meaning |
19:45:37 | OnO | at least this is how it works for most cases for C/C++ compilers |
19:46:26 | * | Jehan_ quit (Ping timeout: 240 seconds) |
19:50:40 | Araq | yes, I do think it is the right place. Nim's pragmas are essential. |
19:51:21 | Araq | and arguing that 'importc' really has no impact on program meaning is philosophical nonsense |
19:52:27 | OnO | okay, I understand, thanks |
19:53:29 | OnO | I am trying to see if we can fix simply "not nil" deduction for array elements |
19:54:12 | OnO | it seems that it is related to the symbol |
19:54:30 | OnO | but a[i] isn't a symbol but just expr |
19:55:05 | OnO | having that `[]` can be an user defined operator makes it even trickier |
19:56:06 | OnO | but obviously not being able to deduct that `if a[i] != nil: onlyNonNil(a[i])` is okay would make all this feature kind of useless |
19:59:40 | * | strcmp1 joined #nim |
20:01:05 | * | Jehan_ joined #nim |
20:01:57 | Jehan_ | Araq: I'm fine with not including the Boehm GC in the tests; I mostly did it just to do it myself and figured that it would make sense to keep them there if people start using it more extensively. |
20:02:41 | * | pregressive joined #nim |
20:03:13 | * | golak quit (Ping timeout: 256 seconds) |
20:03:31 | Jehan_ | Ono: There are already pragmas that change semantics. |
20:04:00 | Jehan_ | For example, {.global.}. |
20:06:20 | Araq | OnO: it's a *feature* that a[i] is not the same as a[i] for now, because our algorithm needs to prevent this: |
20:06:26 | Araq | if a[i] != nil: |
20:06:28 | Araq | inc i |
20:06:33 | Araq | notNil(a[i]) |
20:07:05 | * | Jehan_ quit (Read error: Connection reset by peer) |
20:07:17 | Araq | and overloading of [] is not a problem by the time we do the analyis it has already been lowered to a function call |
20:07:22 | * | Jehan_ joined #nim |
20:08:16 | Araq | and is dealt with the fact that it will become: proc `[]`(x: T): S not nil |
20:08:43 | OnO | Araq: yeah I know, but this feature makes this non-nil proving annoying, just taking example of cstringArray methods in my PR commit, I had to introduce extra variable |
20:08:55 | Araq | I noticed |
20:10:19 | OnO | I am worried that this could be showstopper for many ppl, forcing them to do such tricks, while on other hand, taking that a array may be accessed by other thread etc. etc. this is acutally correct to use temporary local variable |
20:10:48 | * | BitPuffin|osx joined #nim |
20:11:50 | * | kilon joined #nim |
20:13:34 | Jehan_ | This may be a bit of an unpopular opinion in the current programming language design climate, but I'm not sure that `not nil`, Option[T], and similar approaches are actually the right solutions (in particular for imperative languages). |
20:14:55 | * | n99999i quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
20:15:16 | Jehan_ | I'd start with this stackexchange post by Eric Lippert: http://programmers.stackexchange.com/questions/237697/if-null-is-bad-why-do-modern-languages-implement-it/237746#237746 |
20:15:50 | Jehan_ | And add that the actual problem that we're trying to deal with may often be something different (e.g., uninitialized fields). |
20:17:35 | * | elrood joined #nim |
20:17:45 | Araq | OnO: well I know that 'not nil' is a pita to work with, that's why the stdlib doesn't use it. |
20:19:34 | Araq | the prover needs to be smarter and even then it will be annoying for prototyping |
20:19:42 | Araq | proc foo(): string = discard |
20:19:46 | * | yglukhov quit (Remote host closed the connection) |
20:19:54 | Araq | # error: bla bla bla |
20:20:25 | * | yglukhov joined #nim |
20:21:18 | Araq | and fyi I played with abstract interpretation techniques to make 'not nil' feasible to work with arrays |
20:24:39 | Araq | one direction we could look at is to break symmetry, so that parameters and return types are implicitly 'not nil', elsewhere it's still nilable |
20:25:00 | * | yglukhov quit (Ping timeout: 255 seconds) |
20:31:01 | * | Trustable quit (Remote host closed the connection) |
20:34:17 | OnO | yeah I was thinking about that |
20:34:31 | OnO | really, even I was rolling a patch with that |
20:35:11 | OnO | but somehow it got ugly because once we show diagnostics, this would be not symmetric too |
20:35:38 | OnO | or we magically get "not nil" out of nowhere for aguments and return types |
20:38:10 | Araq | Jehan_: yeah but what alternative solutions exist for the "uninit fields" problem? |
20:38:34 | * | ekarlso quit (Quit: WeeChat 1.1.1) |
20:39:03 | Jehan_ | Araq: Umm, in the context of Nim, or in general? |
20:39:23 | Araq | in general |
20:39:48 | Jehan_ | In general: require that fields are initialized. This means that if a nil is there, it was put there on purpose. |
20:40:04 | Jehan_ | Nil may still be an invalid state, but so may be other values. |
20:42:20 | * | strcmp1 quit (Ping timeout: 250 seconds) |
20:43:09 | * | strcmp1 joined #nim |
20:43:14 | * | ChrisMAN quit (Remote host closed the connection) |
20:43:58 | OnO | and btw. here's Clang introducing nonnull attribute to be in par with ObjC & Swift http://clang.llvm.org/docs/AttributeReference.html#id75 |
20:44:31 | * | ChrisMAN joined #nim |
20:45:14 | OnO | Jehan_: as pointed on SE discussion, the problem is that unless you have nullability in language there is no way to express whether nil is correct value or an error |
20:47:36 | Jehan_ | OnO: I'm not following? |
20:47:57 | Jehan_ | The semantic meaning of a value is always a matter of convention. |
20:48:10 | OnO | that's right |
20:48:25 | Jehan_ | Whether None as a value of Option[T] represents a correct value or an error is no different. |
20:48:51 | OnO | but you need to state that convention, otherwise noone will understand whether you made a mistake or something is done on purpose |
20:48:58 | Jehan_ | I've seen None returned in regular expression libraries both for "this regexp isn't wellformed" and "no match found". |
20:49:06 | * | raza quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
20:49:30 | Jehan_ | OnO: Correct. But relabeling nil/not nil as an option type doesn't solve that problem. |
20:51:22 | Jehan_ | option types do two things: (1) They force you to initialize variables (assuming your language has such a semantic, an x: Option[T] can be nil in some); (2) they force you to write code to deconstruct them. |
20:51:49 | Jehan_ | You can get (1) simply by requiring variables to be initialized. |
20:52:26 | OnO | or stating that leaving your variable uninitialized was actually your intention not mistake |
20:52:53 | OnO | currently Nim does not have (1) |
20:53:10 | Jehan_ | The problem with (2) is different: You often know for certain that None is not a possible value, so you write a shorthand to get at the value you know that is there, and suddenly you've got the original problem again. |
20:54:03 | * | NimBot joined #nim |
20:54:44 | * | Ven joined #nim |
20:54:45 | Jehan_ | OnO: Correct. I think that requiring initialization is the better solution (with the caveat that I haven't entirely convinced myself; I mean "think" when I say "think" here). |
20:55:07 | * | Varriount_ joined #nim |
20:55:07 | Jehan_ | I also think that Option[T] specifically is overused when you really want a custom type. |
20:55:42 | Miruya | not to ask a stupid question, but what are the downsides between differentiating between two values? A special none/nil and uninitialized? |
20:55:56 | * | pigmej quit (Ping timeout: 252 seconds) |
20:57:31 | Jehan_ | Miruya: There are languages that do that, but you can't really have an upper bound on the number of special values that you may want. |
20:57:44 | Miruya | Ah, fair enough. |
20:57:46 | * | Varriount quit (Ping timeout: 252 seconds) |
20:59:04 | OnO | C++ has "special" unintialized value, it is random garbage (can be anything), one some platforms it is zero or null |
20:59:26 | Jehan_ | Miruya: The simple solution is to create a new type, which encodes the sum of the possible types it may hold. |
20:59:53 | * | jszymanski quit (Quit: computer sleeps...) |
21:00:37 | OnO | Miruya: another solution (used in dynamically typed langs) is pointer tagging |
21:01:29 | OnO | eg. you can consider pointers <4k (first page) to be invalid |
21:01:36 | OnO | and use them to encode some special values |
21:01:38 | Miruya | Jehan_: Oh, I see now. After awhile, it would become cumbersome for developer's to account for every possible special value.. and they'd be left just wondering why they weren't dealing with nil again |
21:02:08 | Miruya | developers, even* |
21:02:25 | * | pigmej joined #nim |
21:04:14 | * | Jehan_ quit (Ping timeout: 265 seconds) |
21:04:47 | * | Jehan_ joined #nim |
21:04:56 | Jehan_ | Sigh, these disconnects are getting annoying. |
21:05:06 | * | vikaton quit (Quit: Connection closed for inactivity) |
21:05:13 | Jehan_ | Anyway, Miruya: This is not really how this works. |
21:06:24 | Jehan_ | Example: You have a class that has isGreen, isRed, and isBlue methods. |
21:06:58 | * | Demon_Fox joined #nim |
21:07:23 | Jehan_ | You don't really "account" for all of them. It's just a reflection of the object's state. If it's natural for the object to have multiple states, then dealing with them should also have an inherent logic. |
21:08:06 | Jehan_ | It's really no different than overlaying an enum type on a reference. |
21:10:23 | Jehan_ | A practical example would be a readline method that returns a Line object that has properties for: error, eof, hasEol, endsinCrLf, endsinLf, endsinCr, etc. |
21:11:00 | Miruya | Oh, that makes it make more sense. |
21:13:40 | OnO | btw. are there any upcoming conferences in Europe where Nim will be presented? |
21:15:44 | OnO | I'd love to see some speech of Araq live :) |
21:15:45 | * | Jehan_ quit (Read error: Connection reset by peer) |
21:17:29 | OnO | okay, going to bed, need to wake up for 3rd day of this one http://ppam.pl/program |
21:17:29 | * | jefus is now known as jefus_ |
21:17:31 | OnO | cya |
21:18:41 | Araq | OnO: oscon amsterdam |
21:18:47 | Araq | october |
21:19:32 | * | jefus_ is now known as jefus |
21:19:35 | federico3 | Araq: the video from the previous oscon was never released |
21:19:38 | dom96 | 26th to be precise |
21:19:57 | dom96 | I'll be there too |
21:20:08 | dom96 | Likely giving out Nim t-shirts ;) |
21:20:19 | federico3 | Maybe it was too technical for oscon |
21:20:43 | dom96 | federico3: It was released, but you have to pay to see it I think. |
21:20:55 | dom96 | All the workshops are like that |
21:21:49 | * | yglukhov joined #nim |
21:22:39 | federico3 | Many other videos from oscon are free |
21:22:51 | federico3 | Apparently the boring ones. |
21:26:48 | * | yglukhov quit (Ping timeout: 264 seconds) |
21:28:30 | * | n99999i joined #nim |
21:32:18 | * | jefus is now known as jefus_ |
21:32:48 | * | beatmox quit (Ping timeout: 264 seconds) |
21:32:57 | dom96 | This time Araq's presentation won't be a workshop so hopefully they will put it on youtube for free. |
21:33:17 | * | Jehan_ joined #nim |
21:33:23 | * | Jehan_ quit (Client Quit) |
21:33:38 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:33:45 | * | Jehan_ joined #nim |
21:33:48 | * | bendiken quit () |
21:34:04 | federico3 | dom96: also, where can people get a t-shirt? :D |
21:34:17 | dom96 | In Amsterdam ;) |
21:34:50 | dom96 | Maybe i'll give you some in Dublin :) |
21:34:59 | * | jefus_ is now known as jefus |
21:35:02 | dom96 | Still need to actually order them |
21:35:13 | dom96 | but before I do that I will ask on the forum if anyone has any clever ideas for the design |
21:35:18 | dom96 | or what we should write on them |
21:36:49 | federico3 | easy |
21:37:10 | * | beatmox joined #nim |
21:37:30 | federico3 | http://nim-lang.org/assets/images/logo.png |
21:42:50 | * | pregressive quit (Remote host closed the connection) |
21:43:08 | * | pregressive joined #nim |
21:44:42 | * | NimBot joined #nim |
21:45:50 | * | shodan45_ joined #nim |
21:46:27 | * | shodan45 quit (Ping timeout: 255 seconds) |
21:47:16 | * | boopsies is now known as boopsiesisaway |
21:47:28 | * | unclechu quit (Remote host closed the connection) |
21:50:23 | * | NimBot joined #nim |
21:53:22 | * | shodan45_ quit (Quit: Konversation terminated!) |
21:54:41 | * | wach0 joined #nim |
21:54:47 | * | wach0 left #nim (#nim) |
21:56:52 | * | xet7_ quit (Ping timeout: 250 seconds) |
22:00:03 | * | elrood quit (Quit: Leaving) |
22:11:10 | Xe | dom96: is there a way to have middleware in Jester? |
22:13:41 | dom96 | Xe: define 'middleware' |
22:14:56 | Xe | dom96: something that runs before and after a request |
22:15:07 | Xe | like for example a timing function |
22:15:46 | * | Kingsquee joined #nim |
22:15:54 | dom96 | Xe: not right now |
22:15:58 | Xe | okay |
22:16:12 | Xe | I think I am going to wrap stuff in a template for the meantime |
22:21:14 | dom96 | go for it |
22:21:30 | dom96 | A PR to add middleware support would also be well received :) |
22:28:08 | Xe | how would I include an immutable table into another table? |
22:28:37 | Xe | say I have a table of HTTP headers to use as a reply and want to include another optional header if some condition is true |
22:30:11 | * | Kingsquee quit (Ping timeout: 260 seconds) |
22:31:07 | * | Kingsquee joined #nim |
22:37:21 | dom96 | Xe: A Table[X, Table[T, Y]]? |
22:37:43 | Xe | dom96: i want to cat two tables |
22:38:00 | Xe | myHeaders & {"X-API-Options": "bare"} |
22:40:23 | dom96 | Xe: for loop + add I guess |
22:40:42 | Xe | yikes |
22:40:52 | Xe | hmm |
22:41:21 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:41:57 | Xe | if i set the headers and then resp with headers |
22:42:00 | dom96 | You can contribute a nice procedure which does this to the stdlib :) |
22:42:05 | Xe | yeah |
22:43:53 | Xe | https://github.com/dom96/jester/blob/master/jester.nim#L699-L796 |
22:43:58 | Xe | this is clever |
22:50:27 | * | NimBot joined #nim |
22:57:00 | * | pregressive quit (Remote host closed the connection) |
23:00:44 | * | pregressive joined #nim |
23:01:09 | * | vendethiel quit (Ping timeout: 256 seconds) |
23:05:12 | * | pregressive quit (Ping timeout: 264 seconds) |
23:11:12 | * | X67r_ joined #nim |
23:14:07 | * | X67r quit (Ping timeout: 250 seconds) |
23:18:09 | * | irrequietus quit () |
23:18:19 | * | X67r joined #nim |
23:21:26 | * | X67r_ quit (Ping timeout: 240 seconds) |
23:22:12 | * | jefus is now known as jefus_ |
23:22:36 | * | jefus_ is now known as jefus |
23:23:49 | * | zemm quit (Ping timeout: 256 seconds) |
23:24:23 | * | zemm joined #nim |
23:27:16 | * | thotypous joined #nim |
23:34:36 | * | jaco60 quit (Ping timeout: 246 seconds) |