<<28-11-2012>>

00:12:35*q66 quit (Quit: Quit)
01:54:52*mal`` quit (Read error: Operation timed out)
01:57:58*mal`` joined #nimrod
02:20:22*silven_ joined #nimrod
02:20:32*silven quit (Read error: Connection reset by peer)
08:15:28*XAMPP quit (Read error: Connection reset by peer)
08:21:53*Araq_ joined #nimrod
08:23:23*Araq_ quit (Client Quit)
11:39:53*FreeArtMan joined #nimrod
12:40:57*Trix[a]r_za is now known as Trixar_za
14:07:55*Trixar_za is now known as Trix[a]r_za
15:05:53*q66 joined #nimrod
16:23:27*Vladar joined #nimrod
16:56:48*FreeArtMan quit (Ping timeout: 245 seconds)
17:44:38*XAMPP joined #nimrod
17:58:37VladarAraq, I did some research about that only-on-windows-bug. Not sure what exactly caused it and why only on windows. Here is minimal code to reproduce it: http://pastebin.com/NK31y7BC
18:02:04AraqVladar: looks like the known const seq bug to me ;-)
18:04:43Araqit's mostly bad luck it's only triggered on windows then I think
18:05:00Araqhowever this shouldn't have anything to do with bug #263
18:08:29VladarI tried to build latest ver. again and everything went fine.
18:10:36VladarAlso, gcc v4.7.2 too.
18:11:14AraqI may try it on windows myself tonight
19:24:44*FreeArtMan joined #nimrod
19:41:48Araqping zahary
19:47:15*fowl quit (Ping timeout: 240 seconds)
19:49:20zaharypong
19:49:39AraqI'm implementing the 'export' feature
19:50:10Araqand wonder how to do it; simply adding the identifiers to the current module doesn't work as that would introduce ambiguities
19:50:25Araq# module A
19:50:32Araqimport B
19:50:36Araqexport B.p
19:50:51Araqp() # amb if we add 'p' to A's symbol table
19:51:23Araqand I don't want to introduce yet another symbol flag
19:51:49Araqso I think 'import A' should look into A's ast for 'export' statements?
19:51:56zaharywhy is it ambigious? is there another definition of p within A or are the multiple definitions of p within B?
19:52:17Araqwell there is a 'p' in A and in B
19:52:27zaharyaha, I see
19:53:47zaharywhy don't you add `exports` list that's stored for the module. it doesn't affect local lookups, but when you import … (just like you proposed actually, reading it now)
19:57:04Araqyeah seems to be the way to go
19:59:42zaharywill you also implement expressions like A.B.c (B is an another module exported from A)?
20:00:28Araqnot planned :P
20:00:46Araqin fact, 'export B' doesn't export B but all of its public symbols
20:01:14zaharydo you dislike it or do you consider it too much work for now?
20:01:18*fowl joined #nimrod
20:01:24Araqnever thought about it
20:01:42Araqhave no opinion about it, so convince me
20:02:22zaharywe discussed it once actually - the first time the issue was brought up
20:02:41Araqchannel wasn't logged then :P
20:04:59zaharyI made an argument that it could be used as alternative for namespaces. for example, there are number of C++ libraries where you import something like tcp or time and then have nested types such as ip4.address / ip6.address or gregorian.date, etc
20:06:26Araqmeh ... I still dislike these arbitrary hierarchies
20:06:49Araqbut since I'm apparently the only one, I'll reconsider this
20:07:49Araqeverybody seems to like universe.earth.programming.language.nimrod.token.kind.EOF
20:09:18zaharyfor hypolang I was going to use namespaces to achieve something similar to some of the pragmas (these that serve as directives)
20:09:19zaharyinstead of {.error: "blah" .}, the system module exports a submodule with these directives as normal magic functions
20:09:19zaharynimrod.error "blah"
20:09:46zaharyI can't argue this is better, but I should mention it (I didn't have such pragmas in the design)
20:10:39Araqone reason I dislike this is that '.' is already quite ambiguous; it's easy to implement if you add a skNamespace symbol kind
20:10:55zaharywell, we already have skModule
20:11:04zaharythat's enough
20:11:11Araqhrm
20:11:17Araqmaybe, yeah
20:12:42*FreeArtMan quit (Ping timeout: 264 seconds)
21:10:20Araqoh btw zahary we'll also get warnings about potential race conditions :-)
21:10:54Araqthe idea is that any load/store to a 'shared' location that doesn't occur within some lock is racy
21:11:27Araqatomic ops are special cased of course
21:15:39zaharyhow deep does the analysis go? can I fool the system by using 2 different locks for the same shared location (thus not preventing the race)?
21:17:41Araqyes :-)
21:17:53Araqwell I thought about adding an expression to 'shared'
21:18:12Araqand use some alias analysis to determine lock identity
21:18:47zaharynevertheless, sounds good. make sure it also works with scoped locks
21:19:29Araqwell my idea is that even a very simplistic approach results in a huge win in practice
21:20:24Araqhowever you're right, it'd be nice if a lack of a warning would guarantee race freedom
21:20:43zaharyyeah, sure. the case I cited is almost diabolic, although with nested locks some "parent" lock may trigger a false-possitive
21:21:00Araqit's possible if you only have global locks and no aliasing
21:21:12Araqthen the deadlock analysis can be accurate too
21:26:36AraqI think in practice the big problem is arrays
21:27:01Araqthere are lots of index partitions that ensure no sharing occurs at runtime
21:27:39Araqand yet all these a[i] expressions are evil for compile-time analysis ;-)
21:28:36Araqso I thought about a partition() built-in
21:29:08Araqbut I think all this requires dependent typing to work
21:29:32zaharywhat is this partition built-in exactly?
21:29:45Araqdunno ;-)
21:30:10Araqpartition(a, i, j, k) --> (b, c, d) where b,c,d are uniquely typed slices
21:31:08zaharythese are the "border indices"?
21:31:16zaharya, i, j, k
21:31:27Araqa is the original array
21:31:33Araqi,j,k are some borders
21:31:49Araqyou can check the borders at runtime doesn't matter much
21:32:54zaharyI've read the region types writings for rust, they cover similar problems
21:33:29zaharyalso, microsoft have a new C++ compiler features for massive data parallelism that define similar types
21:33:55zaharyhttp://msdn.microsoft.com/en-us/library/hh265137.aspx
21:35:25Araqyeah I think chapel does something similar
21:38:01Araqone problem is that these uniquely typed arrays are need a new form of polymorphism
21:38:38Araqit's essentially the "taint" problem
21:38:52Araqif the input is tainted the output should be too
21:39:03Araqit comes up again and again
21:39:10Araqunits of measure is another example
21:45:07zaharyI understand the taint problem, and I see how it applies for everything (array views included), but why do you consider units of measure a special instance of it? also, array views (partitions) seem to be mostly about aliasing. the tainting aspect comes orthogonal to the aliasing aspect
21:46:19zaharyaliasing and lifetime
21:47:04AraqF# has some nice feature for units of measure and they have some type inference for it
21:47:14Araqthat looks like it solves the taint problem too
21:47:29Araqbut I could be wrong
21:48:17Araqf: string?tainted -> string?tainted
21:48:36Araq`+`: int?measure * int?measure -> int?measure
21:48:57Araqwhere ? means "optionally with this attribute"
21:49:05zaharyI have studied some C++ libraries for units of measure as it's an interesting problem for me. basically, C++ features (static types that don't change over time) are enough to solve the problems
21:50:14zaharyhmm, but what is measure here? just a flag? measure is about conversions of units and catching errors of incompatible units
21:50:34Araqyeah I know, but for a start s+s yields s
21:50:42Araq(s = second)
21:51:21Araqand s + no measure is a type error
21:53:22*Vladar quit (Quit: Leaving)
21:58:01*gradha joined #nimrod
22:05:45Araqbtw have you look at the 'not nil' stuff yet?
22:10:25zaharynot yet
22:10:35zaharyI read the docs about it
22:10:46Araqyay XD
22:11:07Araq1) 'nil' is the wrong default
22:11:22Araq2) the implementation is wrong
22:11:44Araqit sets some type flag, but if you do 'string not nil' than it modifies the string type
22:11:48Araqeverywhere
22:12:06zaharyoops :)
22:12:32Araqa tyNotNil(tyString) construct would have prevented that
22:12:49Araqbut then we'd need to skip over tyNotNil almost everywhere
22:13:10Araqthese type graphs are really hard to design
22:14:33Araq'shared' has the same problem
22:15:11Araqone solution is to only allow them in a 'type' section so it's always an annotation for a named type
22:15:28Araqi.e. we know we deal with a fresh type object
22:16:21Araqbut it's annoying for the programmer
22:16:53zaharywhat's root of the problem with not nil infecting the original string type? the caching done in systypes?
22:17:10Araqfor any structural type we can create a copy before setting the flag
22:17:25Araqbut for a nominal type this doesn't work
22:17:44Araqso 'not nil' can be fixed but it illustrates the general problem
22:18:26Araq(and yeah we can copyType tyString too and set the flag in the copy only)
22:20:15zaharylet's imagine that a "not nil" is compileTime property of the type. we plan to allow overloading based on compile time properties so it's the same problem. clarify a bit more why it doesn't work for nominal types
22:22:38Araqwell if you have A{.prop.} and A where A is an object type
22:22:55Araqyou want these to map to the same C struct for instance
22:23:20Araqso the plan was to have 2 A type objects in the compiler with same ID
22:24:02Araqhowever large parts of the compiler can't work this way
22:24:40Araqit's often more handy to store stuff in the A itself instead of in lots of mappings type-ID -> stuff
22:25:12zaharyok, I have worked on a design for compileTime properties a bit btw. indeed tyNotNil is analogous to what I have in mind. I would introduce a single tyTypeView (if we use ATS terminology or tyTypeState if we use rusts) and that's what have to be skipped in some places as you said
22:25:39Araqyeah that should work
22:25:51Araqand a single tyTypeView is fine with me
22:26:06Araqbut the proliferation of these abominations needs to stop ;-)
22:26:21Araqmaybe we can generalize some existing type property
22:26:48zaharynot nil is a good example of built-in compileTime property for the ref types
22:30:01Araqperhaps but 'not nil' deserves special treatment in the type system
22:38:24gradhahow are import naming conflicts resolved? say I want to name strutils a module in my program and want to import that, or the one provided by nimrod libraries in different files
22:39:43Araqfrom x import `%`
22:39:51Araqimport y except `%`
22:39:59Araqor simply:
22:40:08Araqx.`%`(2, 3)
22:40:33Araqimports are optimistic :P
22:40:51Araqboth symbols are imported and overloading resolution figures it out
22:41:19Araqor if it's a type or variable, an error is raised if you actually use the symbol in your code
22:41:19gradhathat's not what I was meaning
22:41:32gradhaI have a strutils.nim file in my project
22:41:48gradhawhen I type "import strutils", does my file get imported or the one in nimrod's library?
22:41:48Araqwell too bad for you then
22:41:57Araqyour file
22:42:10Araqas it's closer to your main.nim file
22:45:34*silven_ quit (Ping timeout: 265 seconds)
22:47:35Araqwow I just noticed, I stopped reading your question after the question mark
22:48:41gradhathat's all right, question marks terminate sentences after all
22:49:14Araqwell I take it as a sign I should go to sleep
22:50:11gradhaouch, nimrod just crashed compiling
22:51:18Araqif only there would be a way to declare a crash to be a feature ...
22:51:39gradhabah, remember I'm on mac, it's surely a mac problem
22:51:47gradhamaybe not enough white pixels or something
22:52:04Araqancient GCC version :P
22:52:36gradhathat's new, especially since I have to compile with clang or it doesn't work at all
22:52:57Araqwell there is a known bug that could be the cause for it
22:53:24gradharight now I was playing with importobjc
22:53:32gradhawhen used on a proc in the same module, it works
22:53:40Araqthe fix would be easy if I could get over adding a 8/16 byte header to constant sequence/string
22:53:45gradhawhen I move the proc along the type to a different module, the module referencing it doesn't like it
22:54:02Araqbut instead I'm thinking about some way to avoid that :P
23:02:22gradhahmmm... this is bad, I compiled in debug, but get no stack trace or anything
23:03:50gradhaI only get "Error: execution of an external program failed"
23:09:10zaharythis means that the C compiler produces an error
23:09:30zaharyyou can see the error by giving —parallelBuild:1 on the command line
23:10:23zaharythe printing of errors should really be fixed at some point, but that's a work-around for now
23:10:56gradhaok, so that's what it was
23:11:23gradhayes, the compiler was failing because I was using bad parameters
23:11:44Araqwhat "bad parameters"?
23:11:54gradhatrying to compile objc as c
23:12:40gradhagot used so much to "nimrod c whatever" that it seems I have it hardcoded
23:15:36Araqhe he alright
23:15:51gradhaah, and just found out the other problem I was having is due to naming conflicts
23:16:00gradhaI had defined a NSString type with a cstring proc
23:16:15gradhaso when that is in another module the "incorrect" cstring gets used
23:16:23gradhasolved by renaming
23:17:31gradhalovely, now recompile nimrod in release...
23:24:19gradhawow, amazing xcode quality software, I added two nim files to the project, one works, the other is shown in red and doesn't even open
23:28:06*gradha quit (Quit: gradha)
23:37:34Araqgood night guys