<< 08-09-2015 >>

00:30:13*SirCremator joined #nim
00:45:46tymatis there a way to do restricted pointers in nim?
00:51:13*vikaton joined #nim
00:51:28Araqtymat: what is a restricted pointer?
00:52:12tymathttps://en.wikipedia.org/wiki/Restrict
00:54:35Amrykidok. sent the PR. man, that's been bothering me for years.
00:56:18Araqtymat: 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:05SirCrematori have a question.
05:24:19SirCrematorwhat 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:02Araqer ... we handle shebangs correctly since forever? what am I missing?
07:48:35Araq#! / is a shebang #! without the / is a parser directive?
07:52:47*kilon quit (Ping timeout: 256 seconds)
07:56:36Araqah 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:34NimBotnim-lang/Nim devel bd12b7d Rostyslav Dzinko [+0 ±1 -0]: Added == operator for comparing two Object IDs
08:20:34NimBotnim-lang/Nim devel ac79861 Dominik Picheta [+0 ±1 -0]: Merge pull request #3306 from SSPkrolik/oids-add-comparator... 2 more lines
08:21:17Araqer ... what is this?
08:21:43*tankfeeder quit (Quit: Leaving)
08:23:30NimBotnim-lang/Nim devel 6d654f8 Araq [+0 ±2 -0]: even better docs
08:23:30NimBotnim-lang/Nim devel 833a934 Araq [+0 ±1 -0]: NimScript: make the compiler shut up about effects it doesn't know about
08:23:30NimBotnim-lang/Nim devel 494431e Araq [+0 ±1 -0]: gangbang support for NimScript
08:23:30NimBotnim-lang/Nim devel f1a1799 Araq [+0 ±3 -0]: minor documentation cleanups
08:28:46dom96er... umm... hmmm?
08:33:01Araqnever mind I thought it would be a dangerous ==
08:39:13NimBotnim-lang/Nim devel 5eaf688 Araq [+0 ±1 -0]: fixes #3300
08:40:35r-kulove 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:25AraqAmrykid: did you marry?
09:05:59dom96Araq: what?
09:06:06NimBotnim-lang/Nim devel 564c9f4 Alexander Mitchell-Robinson [+0 ±3 -0]: Fixed my name.
09:06:06NimBotnim-lang/Nim devel 55e4796 Andreas Rumpf [+0 ±3 -0]: Merge pull request #3303 from Amrykid/amrykid-name-change... 2 more lines
09:06:16dom96oh, interesting.
09:06:24Araqhe got a longer name
09:06:43dom96added 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:31yglukhovAraq: what does shallowCopy do exactly? is it kinda memcpy in C?
09:29:39yglukhovif 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:04Araqmemcpy is the right image
09:33:38*boopsiesisaway is now known as boopsies
09:33:44yglukhovok, but in js we're screwed.
09:35:29Araqwhy?
09:39:10yglukhovbecause 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:48AraqnimCopy already has a "deepCopy" bool argument, right?
09:40:20Araq(btw it's more complex for the C codegen too...)
09:40:37yglukhovit doesn't
09:41:04Araqit should grow one then
09:41:33yglukhovdoes shallowCopy optimize only for strings and seqs?
09:41:42Araqyes
09:42:01Araqcannot optimize anything else
09:42:15Araqobject is embedded and the other stuff is fast to begin with
09:42:30yglukhovnot in js =)
09:43:23yglukhovi still think that splice would be waaay faster.
09:43:39yglukhovat the cost of broken pointers.
09:44:10yglukhovpointers are such a pita in js.
09:45:02Araqdunno, the chosen representations work well afaict
09:45:45Araqa pointer is an (array,idx) pair
09:46:03Araqderef is array[idx]
09:46:29yglukhovi'd say they work as good as they can get for js.
09:46:39yglukhovbut not better =)
09:46:55Araqthe only thing complex here is that we map "ref object" to pain JS objects for performance and interop
09:47:05Araq*plain
09:47:07Araqlol
09:50:23Araqalso ... 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:44yglukhovmy 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:27yglukhovbesides, pointers arithmetics and casts don't work there at all.
09:54:08reactormonkaren't pointers only there for C interop?
09:55:04yglukhovand if that is true, why doing rather complex shallow copies in js just to keep pointers working.
09:55:04reactormonkapparently nope. 125 in lib/pure/
09:55:46*boopsies is now known as boopsiesisaway
09:56:14yglukhov125 in lib/pure/what?
09:56:26Araqyglukhov: well I don't mind that shallowCopy does something slightly different for the JS target
09:56:39Araqbut generic seq ops need to work, one way or the other
09:57:04Araqspecialized impls for performance are fine too, but not if it patches over a JS codegen bug
10:00:19*NimBot joined #nim
10:00:59yglukhovi 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:22yglukhovI assume that builtin splice operation would work more efficienlty than a hand-written algorithm in JS that does exaclty that.
10:02:34yglukhovand this is what my pr about.
10:03:18AraqI still don't understand why 'insert' doesn't work
10:03:45Araqwhat needs to be set to null? and why?
10:04:39yglukhovx[i] = null, before x[i] = item
10:05:08yglukhovbecause x[i] = item is rewritten as: x[i] = nimCopy(x[i], item)
10:05:47yglukhovif x[i] is not null it will point to x[i+1]
10:06:05yglukhovand nimCopy will overwrite "both" of them
10:07:17*yglukhov quit (Remote host closed the connection)
10:12:38gokrAraq: In Smalltalk there is this pattern that Object>>copy is implemented as "return self.shallowCopy().postCopy()" where postCopy does nothing by default.
10:13:34gokrSo 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:44Araqnot sure if it would violate encapsulation otherwise, but interesting
10:15:50gokrIts 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:28gokrBut since the shallow new guy has everything, its better to just send him #postCopy.
10:17:01gokrAnd there you will then find "funny looking" code like "myVar = myVar copy" etc.
10:17:16gokrSelectively deepening the copy.
10:17:33gokrBut 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:12Araq'if x[i] is not null it will point to x[i+1]' ... what? o.O
10:20:42yglukhovthat's because previously the elements were moved by shallowCopy
10:20:53yglukhovx[i+1] = x[i]
10:24:15*jszymanski quit (Ping timeout: 255 seconds)
10:24:36*Demon_Fox quit (Quit: Leaving)
10:26:02yglukhovgokr, 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:37yglukhovAraq, so does that insert bug make sense?
10:29:38Araqno, not at all
10:33:01yglukhovhrm... 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:31yglukhovthe shift is done in a loop: i = countdown(len, Index):
10:33:42yglukhovx[i + 1] = x[i]
10:34:48yglukhovafter this loop the x[Index] points to the old value. and x[Index + 1] points to the same value as well.
10:34:54yglukhovdoes that make sense?
10:35:12yglukhov* not points, but "contains"
10:35:59yglukhovand since this is JS, the values are references to JS objects.
10:37:45Araqbut x[Index] will then get the inserted element
10:38:00Araqso what's the problem?
10:38:28yglukhovyes! and insertion is done in the following way: x[Index] = nimCopy(x[Index], newValue)
10:38:48yglukhovnimCopy deep copies newValue into x[Index]
10:39:34yglukhovi.e. nimCopy reuses it's dest argument if it's available.
10:40:12Araqaha!
10:40:21yglukhov=)
10:41:11*tja joined #nim
10:45:36*elrood joined #nim
10:45:58*tja quit (Client Quit)
10:46:02Araqwell since shallowCopy is about a moves, I think it's fine to set stuff to null in the JS implemenation
10:46:21AraqshallowCopy(a, b) # 'b' invalid afterwards? dunno
10:48:25*Trustable joined #nim
10:50:14yglukhovdunno either. imho, shallowCopy is just one of those beasts you have to know how to use.
10:51:14yglukhovbut 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:43wuehlmausjust a little overview question: is nim 1.0 available in a few months or in a few weeks? anybody knows?
11:54:08dom96likely in a few months
11:54:43*Jehan_ joined #nim
11:55:24wuehlmausso we are probably seeing a 0.11.3 or 0.12 before a 1.0, right?
11:56:37*bendiken joined #nim
11:57:44dom96yep
12:04:29*BitPuffin joined #nim
12:17:27Araqyglukhov: the interaction between nimCopy and shallowCopy is error prone and we need to do somehting about it
12:17:39Araqhowever, 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:00r-kuAraq 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:48Araqr-ku: gangbangs are more important
13:16:37*bendiken joined #nim
13:22:54*yglukhov joined #nim
13:23:00r-kuAraq could not agree more!
13:27:24*yglukhov quit (Ping timeout: 264 seconds)
13:28:29Jehan_Araq: For C function pointers, use {.cdecl.} or {.noconv.}?
13:29:41Jehan_The stdlib seems to use both.
13:30:17Araqdepends. Ansi C pretty much requires .noconv, the rest should use cdecl
13:32:24Jehan_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:39Araq.nimcall
13:36:36Jehan_Hmm, may want to adjust the importcs then, too, because they should be noconv.
13:36:52Jehan_For the Boehm GC, that is.
13:36:58Araqok
13:41:29wuehlmaus /query guitarman
13:45:25*yglukhov joined #nim
13:49:51*yglukhov quit (Ping timeout: 260 seconds)
13:55:00Jehan_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:34Jehan_lib/system/mmdisp.nim(207, 46) Error: pragmas are only allowed in the header of a proc
13:55:35Jehan_ proc `div`[T: SomeUnsignedInt](x, y: T): T {.magic: "DivU", noSideEffect.}
13:55:41Jehan_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:45Jehan_Oh, is this because `div` is being redefined?
13:58:57Araqyes
13:59:13Jehan_Yup, if I remove the definitions, then everything works.
13:59:59AraqI thought it would break --gc:go but def- said it's fine ;-)
14:00:44Jehan_Hmm, I'm getting the above error if I turn --gc:go on.
14:02:03Araqyeah same here
14:02:57Jehan_Ah, it happened when unsigned operations were moved to the systems module.
14:03:44Jehan_I'm going to remove them as part of the PR I'm working on.
14:04:13Araqthank you
14:05:25Jehan_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:38Jehan_That's because the code that I'm changing is littered with when clauses.
14:06:21Araqtests\testament\tester c gc
14:06:30Araqhas pretty good coverage
14:07:08Araqso 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:04Jehan_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:15Jehan_Ah, found how I could change that to include the Boehm GC in the source.
14:27:32Jehan_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:45yglukhovAraq: is there a script to generate urhonimo?
17:49:04yglukhovif there is, would be nice to have it in the urhonimo repo
17:49:47Araqit'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:20yglukhovthat'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:05AraqJehan_: I was under the impression that the gc tests already run under --gc:boehm
19:16:15Araqit's specialized in the tester
19:16:32Jehan_Araq: Huh. When I looked at it, they didn't appear to.
19:17:48Jehan_No, --gc:boehm is done for the DLL tests.
19:18:17Araqhrm ok
19:18:47Jehan_I did an egrep -i boehm tests/**/*.nim
19:18:53Jehan_Didn't find anything else.
19:22:50*unclechoochoo joined #nim
19:23:03*unclechoochoo quit (Max SendQ exceeded)
19:24:46Araqyou're right it only tests markAndSweep, refc, refc with realtime support in debug and release versions ...
19:24:57Araqcombinatorial 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:15OnOis {.base.} annotation is necessary for compiler? or it is just for developer sanity?
19:34:23OnOI mean for methods base
19:40:14*renesac quit (Ping timeout: 244 seconds)
19:42:42AraqOnO: for developer sanity
19:43:12Araqand if I get too many complaints, I may remove it again. But I like it.
19:44:50*redwyn left #nim (#nim)
19:45:19OnObut 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:37OnOat least this is how it works for most cases for C/C++ compilers
19:46:26*Jehan_ quit (Ping timeout: 240 seconds)
19:50:40Araqyes, I do think it is the right place. Nim's pragmas are essential.
19:51:21Araqand arguing that 'importc' really has no impact on program meaning is philosophical nonsense
19:52:27OnOokay, I understand, thanks
19:53:29OnOI am trying to see if we can fix simply "not nil" deduction for array elements
19:54:12OnOit seems that it is related to the symbol
19:54:30OnObut a[i] isn't a symbol but just expr
19:55:05OnOhaving that `[]` can be an user defined operator makes it even trickier
19:56:06OnObut 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:57Jehan_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:31Jehan_Ono: There are already pragmas that change semantics.
20:04:00Jehan_For example, {.global.}.
20:06:20AraqOnO: 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:26Araqif a[i] != nil:
20:06:28Araq inc i
20:06:33Araq notNil(a[i])
20:07:05*Jehan_ quit (Read error: Connection reset by peer)
20:07:17Araqand 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:16Araqand is dealt with the fact that it will become: proc `[]`(x: T): S not nil
20:08:43OnOAraq: 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:55AraqI noticed
20:10:19OnOI 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:34Jehan_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:16Jehan_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:50Jehan_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:45AraqOnO: well I know that 'not nil' is a pita to work with, that's why the stdlib doesn't use it.
20:19:34Araqthe prover needs to be smarter and even then it will be annoying for prototyping
20:19:42Araqproc foo(): string = discard
20:19:46*yglukhov quit (Remote host closed the connection)
20:19:54Araq# error: bla bla bla
20:20:25*yglukhov joined #nim
20:21:18Araqand fyi I played with abstract interpretation techniques to make 'not nil' feasible to work with arrays
20:24:39Araqone 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:17OnOyeah I was thinking about that
20:34:31OnOreally, even I was rolling a patch with that
20:35:11OnObut somehow it got ugly because once we show diagnostics, this would be not symmetric too
20:35:38OnOor we magically get "not nil" out of nowhere for aguments and return types
20:38:10AraqJehan_: yeah but what alternative solutions exist for the "uninit fields" problem?
20:38:34*ekarlso quit (Quit: WeeChat 1.1.1)
20:39:03Jehan_Araq: Umm, in the context of Nim, or in general?
20:39:23Araqin general
20:39:48Jehan_In general: require that fields are initialized. This means that if a nil is there, it was put there on purpose.
20:40:04Jehan_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:58OnOand 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:14OnOJehan_: 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:36Jehan_OnO: I'm not following?
20:47:57Jehan_The semantic meaning of a value is always a matter of convention.
20:48:10OnOthat's right
20:48:25Jehan_Whether None as a value of Option[T] represents a correct value or an error is no different.
20:48:51OnObut you need to state that convention, otherwise noone will understand whether you made a mistake or something is done on purpose
20:48:58Jehan_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:30Jehan_OnO: Correct. But relabeling nil/not nil as an option type doesn't solve that problem.
20:51:22Jehan_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:49Jehan_You can get (1) simply by requiring variables to be initialized.
20:52:26OnOor stating that leaving your variable uninitialized was actually your intention not mistake
20:52:53OnOcurrently Nim does not have (1)
20:53:10Jehan_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:45Jehan_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:07Jehan_I also think that Option[T] specifically is overused when you really want a custom type.
20:55:42Miruyanot 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:31Jehan_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:44MiruyaAh, fair enough.
20:57:46*Varriount quit (Ping timeout: 252 seconds)
20:59:04OnOC++ has "special" unintialized value, it is random garbage (can be anything), one some platforms it is zero or null
20:59:26Jehan_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:37OnOMiruya: another solution (used in dynamically typed langs) is pointer tagging
21:01:29OnOeg. you can consider pointers <4k (first page) to be invalid
21:01:36OnOand use them to encode some special values
21:01:38MiruyaJehan_: 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:08Miruyadevelopers, even*
21:02:25*pigmej joined #nim
21:04:14*Jehan_ quit (Ping timeout: 265 seconds)
21:04:47*Jehan_ joined #nim
21:04:56Jehan_Sigh, these disconnects are getting annoying.
21:05:06*vikaton quit (Quit: Connection closed for inactivity)
21:05:13Jehan_Anyway, Miruya: This is not really how this works.
21:06:24Jehan_Example: You have a class that has isGreen, isRed, and isBlue methods.
21:06:58*Demon_Fox joined #nim
21:07:23Jehan_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:06Jehan_It's really no different than overlaying an enum type on a reference.
21:10:23Jehan_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:00MiruyaOh, that makes it make more sense.
21:13:40OnObtw. are there any upcoming conferences in Europe where Nim will be presented?
21:15:44OnOI'd love to see some speech of Araq live :)
21:15:45*Jehan_ quit (Read error: Connection reset by peer)
21:17:29OnOokay, 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:31OnOcya
21:18:41AraqOnO: oscon amsterdam
21:18:47Araqoctober
21:19:32*jefus_ is now known as jefus
21:19:35federico3Araq: the video from the previous oscon was never released
21:19:38dom9626th to be precise
21:19:57dom96I'll be there too
21:20:08dom96Likely giving out Nim t-shirts ;)
21:20:19federico3Maybe it was too technical for oscon
21:20:43dom96federico3: It was released, but you have to pay to see it I think.
21:20:55dom96All the workshops are like that
21:21:49*yglukhov joined #nim
21:22:39federico3Many other videos from oscon are free
21:22:51federico3Apparently 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:57dom96This 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:04federico3dom96: also, where can people get a t-shirt? :D
21:34:17dom96In Amsterdam ;)
21:34:50dom96Maybe i'll give you some in Dublin :)
21:34:59*jefus_ is now known as jefus
21:35:02dom96Still need to actually order them
21:35:13dom96but before I do that I will ask on the forum if anyone has any clever ideas for the design
21:35:18dom96or what we should write on them
21:36:49federico3easy
21:37:10*beatmox joined #nim
21:37:30federico3http://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:10Xedom96: is there a way to have middleware in Jester?
22:13:41dom96Xe: define 'middleware'
22:14:56Xedom96: something that runs before and after a request
22:15:07Xelike for example a timing function
22:15:46*Kingsquee joined #nim
22:15:54dom96Xe: not right now
22:15:58Xeokay
22:16:12XeI think I am going to wrap stuff in a template for the meantime
22:21:14dom96go for it
22:21:30dom96A PR to add middleware support would also be well received :)
22:28:08Xehow would I include an immutable table into another table?
22:28:37Xesay 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:21dom96Xe: A Table[X, Table[T, Y]]?
22:37:43Xedom96: i want to cat two tables
22:38:00XemyHeaders & {"X-API-Options": "bare"}
22:40:23dom96Xe: for loop + add I guess
22:40:42Xeyikes
22:40:52Xehmm
22:41:21*Matthias247 quit (Read error: Connection reset by peer)
22:41:57Xeif i set the headers and then resp with headers
22:42:00dom96You can contribute a nice procedure which does this to the stdlib :)
22:42:05Xeyeah
22:43:53Xehttps://github.com/dom96/jester/blob/master/jester.nim#L699-L796
22:43:58Xethis 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)