Guest User

php.net irc log namespaces

a guest
Sep 6th, 2013
1,271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 58.67 KB | None | 0 0
  1. [16:00:19] <@dmitry> hi, have we started?
  2. [16:00:35] <@CelloG> hi dmitry
  3. [16:00:38] <@otherbird> not really - just greg's been correcting errors on his wiki page
  4. [16:00:54] <@otherbird> have you had a chance to look through it yet?
  5. [16:01:01] <@dmitry> yeah it has some mistakes
  6. [16:01:10] <@otherbird> please share :)
  7. [16:01:14] <@dmitry> of course
  8. [16:02:38] <@CelloG> if it didn't, I would be ashamed of myself - I wrote it in a single blast after 1 AM, and proofreading doesn't help much for me in that state :)
  9. [16:02:41] <@dmitry> The name resolution bug in "\" proposal in second paragraph after two examples is not really a bug
  10. [16:02:47] Derick__ joined the channel.
  11. [16:03:00] Derick is now known as Derick___.
  12. [16:03:02] Derick__ is now known as Derick.
  13. [16:03:11] lsmith sets mode +o Derick
  14. [16:03:18] <@dmitry> if we have a name in namespace we always assume that it's a local namespaced name
  15. [16:03:19] <@CelloG> here? http://wiki.php.net/rfc/backslashnamespaces#resolution_of_t_string_t_paamayim_nekudotayim_t_string_and_why_this_kills_as_namespace_separator
  16. [16:03:38] <@CelloG> dmitry: that's not how it is implemented
  17. [16:04:04] <@CelloG> if we have foo::bar::foo() inside a namespace, it resolves to "foo::bar::foo()" without namespace prefix
  18. [16:04:17] <@CelloG> as if it were ::foo::bar::foo()
  19. [16:04:35] <@dmitry> so in namespace foo::bar always assumes method bar in namespace foo
  20. [16:04:36] <@CelloG> and the same is true of foo::bar()
  21. [16:04:46] <@CelloG> no - it resolves to class foo, method bar
  22. [16:04:49] <@CelloG> which is the bug
  23. [16:04:59] Derick___ left IRC. (leaving)
  24. [16:05:16] <@dmitry> right
  25. [16:05:27] <@CelloG> it should resolve to namespace function
  26. [16:05:30] <@dmitry> we have different resloutions orders for short and long names
  27. [16:05:41] <@dmitry> long names are used right as is
  28. [16:06:17] <@CelloG> the same problem exists for classes in sub-namespaces
  29. [16:06:19] <@dmitry> short names in namespaces assumes entities from namespace
  30. [16:06:33] <@otherbird> when you say 'long names' you mean the fully resolved path, right?
  31. [16:06:38] <@CelloG> any name containing ::
  32. [16:06:43] <@dmitry> we don't handle sub namespaces
  33. [16:07:05] <@dmitry> the name of subnamespace must be written completely
  34. [16:07:05] <@otherbird> ...
  35. [16:07:05] <@CelloG> well, the bug is that it makes the same code work very differently in and outside of a namespace
  36. [16:07:15] <@dmitry> or it must be imported
  37. [16:08:20] <@CelloG> is there something I need to correct on the RFC or was this a misunderstanding? I am saying that the way we do things now leads to non-intuitive behavior from the engine, which = bug
  38. [16:09:18] <@CelloG> i.e. foo::bar might be a short name - class foo, method bar, but it could also be a long name, function foo::bar
  39. [16:09:25] <@CelloG> and the engine just assumes it is a short name
  40. [16:09:36] <@CelloG> and that is why :: is fatally flawed as a separator
  41. [16:09:36] <@Derick> and it's confusing for me read
  42. [16:09:44] <@otherbird> Dmitry: what's the problem with the classes-only approach? I can't see why functions would be anything other than global in that scenario?
  43. [16:09:51] <@dmitry> Anyway "\" is not an option
  44. [16:09:54] <@CelloG> because there is no way to check for both unless we retool the way we check names completely
  45. [16:09:57] <@Derick> dmitry: why not?
  46. [16:10:05] <@otherbird> what derick said
  47. [16:10:06] auroraeos joined the channel.
  48. [16:10:07] <@CelloG> ... I wrote a working patch, how is it not an option?
  49. [16:10:11] <@CelloG> hi elizabeth
  50. [16:10:13] <@dmitry> try to writre namespace name in a duble quoted string
  51. [16:10:15] * auroraeos waves
  52. [16:10:17] <@Derick> hi
  53. [16:10:23] <@CelloG> "like\\this\\works\\fine"
  54. [16:10:27] <@Derick> dmitry: why would I want to do that?
  55. [16:10:32] <@dmitry> echo "my\namespace"
  56. [16:10:34] <@otherbird> dmitry: greg already covered that
  57. [16:10:34] <@CelloG> several tests do it
  58. [16:10:43] <@CelloG> so it is possible, but is a drawback
  59. [16:11:07] <@johannes_> some factory implementations do that, too, for doing new $string; then
  60. [16:11:54] <@CelloG> what happens is a fatal error, class not found "namewithweirdcharacters"
  61. [16:12:19] <@CelloG> one of the tests was failing because \f is some kind of control sequence, so it could be an issue and is one to take seriously
  62. [16:12:21] <@otherbird> and don't whatever you do name anything beginning with n or t :)
  63. [16:12:27] <@otherbird> or f...
  64. [16:12:44] <@CelloG> no, whatever you do, use \\ inside a double quoted string if you want \
  65. [16:13:00] <@Derick> or use single quoted strings
  66. [16:13:01] <@CelloG> which is a rule that all PHPers know, and yet it is easy to screw up
  67. [16:13:07] <@CelloG> which is what I do these days
  68. [16:13:14] <@CelloG> (single quoted)
  69. [16:13:23] <@otherbird> the longer we look at this the more I'm thinking a full ns implementation would need to wait to 6.0
  70. [16:13:35] <@bjori> +1 on classes only :)
  71. [16:13:48] <@otherbird> bjori: that's where I am right now too
  72. [16:13:54] <@otherbird> keep it simple
  73. [16:14:00] <@Derick> otherbird: waiting doesn't help though
  74. [16:14:08] <@bjori> rome wasnt build in a day
  75. [16:14:09] <@Derick> it still needs to be sorted out properly
  76. [16:14:14] <@dmitry> with classes only we have to emit a fatal error on each function declaration in namespace
  77. [16:14:19] <@CelloG> let's talk about that
  78. [16:14:26] <@otherbird> Derick: no, but a patch the size of Greg's shouldn't go into the engine so late in the release cycle
  79. [16:14:27] <@bjori> dmitry: thats fine
  80. [16:14:44] <@CelloG> otherbird: it's deceptive, most of that patch is generated source and modified test files
  81. [16:14:51] <@Derick> otherbird: meta-discussion, irrelevant now
  82. [16:14:53] <@CelloG> there's about 200ish actual line changes
  83. [16:15:01] <@dmitry> and we probably have to remove "const = X;" syntax as it became useless
  84. [16:15:14] <@bjori> I never understand that point anyway dmitry
  85. [16:15:19] <@dmitry> then namespaces with classes only can work
  86. [16:15:31] <@bjori> and the drawbacks with that are?
  87. [16:15:43] <@otherbird> why do we have to emit a fatal error?
  88. [16:15:54] <@bjori> no, but why wouldnt you?
  89. [16:16:06] <@CelloG> http://wiki.php.net/rfc/backslashnamespaces#remove_functionsconstants_from_namespaces
  90. [16:16:10] <@bjori> it doesn't do what you think it would do, so a fatal error rather then obscure behaviour is better
  91. [16:16:15] <@otherbird> I'd assume that classes were ns'd and functions weren't, simple as
  92. [16:16:23] <@CelloG> nobody else would think that way
  93. [16:16:32] <@otherbird> warning?
  94. [16:16:35] <@CelloG> it would be like being able to define methods inside class {} that don't go in the class
  95. [16:16:36] <@otherbird> :)
  96. [16:16:37] <@johannes_> I like the const foo = "bar"; syntax, even in global scope ...
  97. [16:17:04] <@dmitry> but it'll prohibited in namespaces
  98. [16:17:08] <@otherbird> CelloG: point taken, I was thinking more of when you're using third-party ns'd stuff in your own non-00 codebase
  99. [16:17:30] <@CelloG> otherbird: think of taking existing code and putting a namespace declaration at the top
  100. [16:17:43] <@CelloG> it would require splitting files in many cases
  101. [16:17:55] <@CelloG> even in OO projects, we use functions for sort callbacks all the time in PEAR
  102. [16:18:09] <@CelloG> which could be replaced with closures, but there are other examples as well
  103. [16:18:14] <@otherbird> so why not make it global? it would seem the sanest thing
  104. [16:18:17] <@bjori> KISS. Only classes in namespaces. See how it pans out. If it works out cool, and people want to evolve to do otherstuff in namespaces then we can go over the options again
  105. [16:18:21] <@otherbird> s/make/keep
  106. [16:18:32] <@bjori> otherbird: but it could break BC if functions will ever be allowed
  107. [16:18:34] <@otherbird> bjori: that's not an option, we already know that
  108. [16:18:46] <@otherbird> we either allow for them now, or we don't
  109. [16:18:48] <@CelloG> the only way I would support removing functions/constants would be if it is actually possible to add them back in
  110. [16:18:50] <@otherbird> (ever)
  111. [16:19:03] <@Derick> CelloG: and that can only be done by solving the issues with them right now
  112. [16:19:31] <@CelloG> and there are 2 ways we can do that. (1) change :: to \ as separator (2) have different syntax for accessing functions/consts as in nsname::here::is->constantname
  113. [16:19:54] <@CelloG> we both know #2 has been regarded as alien syntax by many
  114. [16:19:55] <@Derick> CelloG: and I am quite against (2)
  115. [16:20:01] <@CelloG> s/both/all/
  116. [16:20:13] <@otherbird> so let's investigate (2), because we don't know much about it
  117. [16:20:37] <@CelloG> #2 would mean that $a = nsname::classname and $a = nsname->classname();
  118. [16:20:45] <@dmitry> what about the idea of changing resolution order from (function->class) to (class->function)?
  119. [16:20:47] <@CelloG> it's the reverse idea of Stas's Classname->method() syntax
  120. [16:21:03] <@CelloG> dmitry: introduces autoload bomb on all namespaced function calls
  121. [16:21:09] <@otherbird> the *reverse* idea? where'd this one come from?
  122. [16:21:10] <@dmitry> I know
  123. [16:21:11] <@CelloG> I already suggested it, and Stas vetoed on those grounds
  124. [16:21:26] <@CelloG> it can introduce a hidden order-of-magnitude performance problem
  125. [16:21:27] * Derick would agree
  126. [16:21:39] <@dmitry> but we can think about caching negative autholod results
  127. [16:21:49] <@CelloG> it still means at least 1 call per file
  128. [16:21:57] <@CelloG> since namespaces are per-file
  129. [16:21:58] <@dmitry> it's an implementation question
  130. [16:22:12] <@CelloG> and I've spent the better part of the last month trying to solve those questions - it isn't possible
  131. [16:22:17] <@dmitry> 1 call for namespace/class
  132. [16:22:35] <@Derick> if "using \ in double quoted" string is the only real issue with \ as separator -> why are we still discussing it?
  133. [16:22:42] <@dmitry> and this may allow autoload namespaces without classes
  134. [16:22:54] <@CelloG> as much as I would prefer it, it is a deceptive solution, it makes functions dangerous to use in namespaces if you mix them with an OO framework that has autoload
  135. [16:23:11] <@CelloG> derick: the other issue is the size and scope of the changes
  136. [16:23:20] CelloG sets mode +o auroraeos
  137. [16:23:21] <@Derick> CelloG: that's an implementation issue
  138. [16:23:34] <@CelloG> it's a delay-of-release issue, as I understand it
  139. [16:23:35] <@Derick> also "all existing namespaced code must be nearly rewritten, a simple search/replace of :: would not be possible." is not an issue
  140. [16:23:37] <@dmitry> the main issue with \ is readability
  141. [16:23:39] <@Derick> namespaces don't exist
  142. [16:23:43] <@otherbird> Derick: it's whether it's safe at this stage in 5.3 cycle
  143. [16:23:47] <@Derick> dmitry: ::: has also readability issues
  144. [16:24:00] <@bjori> \is hard to type
  145. [16:24:11] <@dmitry> I never liked :::
  146. [16:24:15] <@Derick> bjori: and ::: is not?
  147. [16:24:16] <@otherbird> Derick: ::: was voted out because a sizeable minority have problems even reading it
  148. [16:24:20] <@Derick> i keep typing :: and ::::
  149. [16:24:20] <@CelloG> http://php.net/~helly/triplecolon-colored.html
  150. [16:24:25] <@bjori> Derick: shift+dot*3, not thats easy
  151. [16:24:28] <@CelloG> http://php.net/~helly/backslash-colored.html
  152. [16:24:40] <@CelloG> gives a good sense of how they would look for readability
  153. [16:24:51] <@otherbird> bjori: switch to US layout ;)
  154. [16:24:53] <@bjori> typing \ is impossible with correct fingerposition
  155. [16:24:57] <@johannes_> I like ::: more than \ if it's only about bikeshed color ...
  156. [16:25:01] <@Derick> bjori: that's just your keyboard - other keyboards have it readibly accessible (UK, US, NO, NL at least)
  157. [16:25:04] <@bjori> :)
  158. [16:25:11] <@CelloG> on my keyboard \ is right above "enter" and is easy to get used to typing
  159. [16:25:20] <@otherbird> johannes_: if ~20% of users can't use it, we can't have it
  160. [16:25:26] <@otherbird> simple as
  161. [16:25:48] <@otherbird> Derick: we heard from 3 nationalities on-list that had problems with it
  162. [16:25:55] <@CelloG> johannes_: it's more about code review than bikeshed color
  163. [16:26:02] <@otherbird> Derick: I checked off-list with a friend in Japan, they're OK with it
  164. [16:26:09] <@Derick> otherbird: those have likely issues with other programming characters as well
  165. [16:26:19] <@bjori> no
  166. [16:26:33] <@CelloG> as was pointed out [] and {} also require double keystrokes one of those keyboards
  167. [16:26:39] <@CelloG> or triple
  168. [16:26:47] <@CelloG> and let's be frank here
  169. [16:26:50] <@johannes_> CelloG: well I doubt that either \ or ::: is better readable, from an objective perspective ...
  170. [16:27:01] <@CelloG> shift-colon colon colon is 3 keystrokes and \ is 1 or 2 keystrokes
  171. [16:27:03] <@CelloG> this is a non-issue
  172. [16:27:05] <@dmitry> as a side step from Stas idea of optional A->foo() syntax we can use <A>::foo() as an alternative syntax
  173. [16:27:10] <@bjori> this is fun :)
  174. [16:27:11] <@otherbird> johannes_: did you look at the stuff Greg put online to demonstrate?
  175. [16:27:18] <@johannes_> (and \ on German keyboard is right Alt key + the one right of the 0)
  176. [16:27:41] <@Derick> dmitry: yes, something like that *could* work perhaps — but I'd need to see an example first
  177. [16:27:51] <@otherbird> dmitry: what Derick said (again)
  178. [16:27:53] <@CelloG> dmitry: yes we could do this too, I thought you had given up on it :)
  179. [16:27:59] <@CelloG> that's the only reason I didn't suggest it
  180. [16:28:06] <@Derick> afk
  181. [16:28:09] <@CelloG> stas was violently opposed to it
  182. [16:28:16] <@otherbird> ?
  183. [16:28:29] <@Derick> CelloG: is violently opposed to everything he doesn't like ;-)
  184. [16:28:48] <@dmitry> I tried the idea of using <A> syntax of namespaces everywhere
  185. [16:28:48] <@johannes_> otherbird: yes, i also wrote some pseudo-code with both of them ... and to *me+ \ was more distrubing, but I guess one could get used to it ...
  186. [16:28:49] <@otherbird> oh that's not fair now, just bc you know he's only logging :)
  187. [16:29:20] <@otherbird> dmitry: do you have some sample code you can put online?
  188. [16:29:24] <@dmitry> but now I'm talking about using it only as an alternative syntax to explicitly call method in ambiguity case
  189. [16:29:39] <@dmitry> (the same as Stas idea with ->)
  190. [16:29:57] <@CelloG> dmitry: the syntax was only part of the problem for me, and the least significant part
  191. [16:29:58] <@otherbird> dmitry: understood - my question about that would be how is ambiguity defined?
  192. [16:30:20] <@CelloG> http://wiki.php.net/rfc/backslashnamespaces#problems2 <-- see the first problem listed
  193. [16:30:23] <@otherbird> by the Engine? (eg a warning is thrown?)
  194. [16:30:51] <@CelloG> warning can't be thrown - that introduces autoload bomb
  195. [16:31:05] <@CelloG> i.e. the engine can't detect the ambiguity without calling autoload
  196. [16:31:08] <@dmitry> A::B::foo(), is it a method of A in ns B, or function foo in ns A::B
  197. [16:31:29] <@dmitry> right
  198. [16:31:58] <@dmitry> so we have to call autoload, but we can do it once for it namespace
  199. [16:32:07] <@dmitry> it=each
  200. [16:32:48] <@otherbird> so... really that's impracticable because it relies on the programmer to know when ambiguity arises
  201. [16:32:48] <@lsmith> <@dmitry> but now I'm talking about using it only as an alternative syntax to explicitly call method in ambiguity case
  202. [16:33:01] <@lsmith> dont you think plain parenthesis are more obvious for this?
  203. [16:33:05] <@otherbird> lsmith: that's how I understood it too
  204. [16:33:16] <@lsmith> also are you talking about having the brackets part of the ns name or not?
  205. [16:33:29] <@dmitry> I like <> more
  206. [16:33:31] <@otherbird> and no to parenthesis, they're used all over the shop as it is :)
  207. [16:33:51] <@dmitry> then [], and only then ()
  208. [16:34:11] <@lsmith> otherbird: thats the point .. this is about resolution order control .. then parenthesis are obvious .. this is what we use in math too
  209. [16:34:13] <@dmitry> however I would accept even ()
  210. [16:34:30] <@lsmith> so its reusing an existing concept for the same purpose
  211. [16:34:41] <@lsmith> instead of introducing a new syntax for an existing concept
  212. [16:34:45] <@otherbird> lsmith: point taken
  213. [16:34:46] <@CelloG> folks, did we all look at the fact that anything that changes classname::method requires rewriting all existing OO code to actually solve the problem?
  214. [16:34:56] <@CelloG> do we seriously think this is a real, practical option?
  215. [16:35:11] <@otherbird> point taken (again)
  216. [16:35:20] <@lsmith> imho its fine to force rewriting if people use ns
  217. [16:35:23] <@dmitry> It requires rewritting only in case ambiguities are really exists
  218. [16:35:28] <@Derick> lsmith: i disagree
  219. [16:35:33] <@lsmith> if it gets a considerably better long term syntax
  220. [16:35:36] <@Derick> lsmith: it'd be a major pain for pear, and also for us
  221. [16:35:36] <@CelloG> it requires rewriting code that uses third-party libraries that use namespaces
  222. [16:35:38] <@dmitry> most cases won;t have any ambiguities
  223. [16:35:41] <@lsmith> (which my E_STRICT proposal was about)
  224. [16:35:50] <@dmitry> ZendFramework don't use functions at all
  225. [16:35:51] * lsmith nods to dmitry
  226. [16:36:20] <@CelloG> look, either we decide this is a problem, or not
  227. [16:36:28] <@CelloG> if we decide it is not a problem, then we don't change syntax
  228. [16:36:33] <@CelloG> no bandaids, please
  229. [16:36:58] <@lsmith> CelloG: i actually think bandaids are legit
  230. [16:37:00] <@otherbird> it's only not a problem if we don't have ns func/const support (ever)
  231. [16:37:07] <@otherbird> lsmith: fail!
  232. [16:37:44] <@lsmith> especially if we make it possible to migrate the code to be nice and clean (with E_STRICT) eventually
  233. [16:37:56] <@CelloG> in this case we are talking about introducing alternate syntax that would bring PHP closer to Perl (many ways to do the same thing for no apparent reason)
  234. [16:38:07] <@lsmith> but i think we all agree now that not having a way to resolve ambiguity is an issue
  235. [16:38:28] <@otherbird> lsmith: only if we take that proposal
  236. [16:38:50] <@otherbird> the \ alternative and the classes-only alternative don't present those problems
  237. [16:39:20] <@lsmith> so for the \ proposal .. what is the real concern we think is the stumbling block?
  238. [16:39:25] <@otherbird> time
  239. [16:39:28] <@dmitry> classes only is good for pure-OO frameworks
  240. [16:39:29] <@CelloG> don't forget the code review issue, both Ilia and Marcus have noted that allowing functions to look like static method calls would prevent major problems in that area
  241. [16:39:34] <@lsmith> i mean what tips this proposal to not be a sure winner?
  242. [16:39:47] <@CelloG> er
  243. [16:39:50] <@CelloG> cause major problems :)
  244. [16:40:18] <@lsmith> if it has major issues .. they do not seem to be listed on the wiki
  245. [16:40:22] <@CelloG> for \ proposal, the major problems to think about are time and readability.
  246. [16:40:23] <@otherbird> lsmith: nothing, it's literally down to class-only vs \
  247. [16:40:24] <@CelloG> uh, check again
  248. [16:40:32] <@CelloG> http://wiki.php.net/rfc/backslashnamespaces#problems3
  249. [16:40:55] <@Derick> CelloG: the only "valid" one is the escaping issue
  250. [16:41:16] <@lsmith> "the patch touches a lot of the engine, and will need rigorous battle-testing." ?
  251. [16:41:16] <@CelloG> Derick: I wrote down every possible problem I could think of, I'm sure others will think of them as well :)
  252. [16:41:20] <@otherbird> that isn't really an issue for doze users, we're used to having to do that anyway
  253. [16:41:30] <@otherbird> lsmith: that's the one for me
  254. [16:41:34] <@CelloG> lsmith: it touches constant, function and class name resolution
  255. [16:41:40] <@otherbird> lsmith: but that's the _only_ one
  256. [16:42:00] <@CelloG> for the obvious reason that we were looking for :: and now look for \
  257. [16:42:04] <@Derick> lsmith: it'd also mean fixing Xdebu (again)
  258. [16:42:08] <@lsmith> so you are worried .. that if we do spend the time .. we will run into a situation where we realize it doesnt work?
  259. [16:42:11] <@Derick> but alas
  260. [16:42:16] <@otherbird> Derick: that's low priority ;)
  261. [16:42:44] <@lsmith> otherwise i do not see time has a stumbling block
  262. [16:42:49] <@otherbird> lsmith: no, it's more a case of it's likely to be buggy
  263. [16:43:04] <@lsmith> buggy just means more time
  264. [16:43:08] <@otherbird> lsmith: it depends how panicked you are about getting 5.3 out
  265. [16:43:21] <@lsmith> finding out in 4 weeks it doesnt work .. that would concern me
  266. [16:43:41] <@lsmith> so are we worried about buggy .. or possibly discovering it doesnt work
  267. [16:43:54] <@otherbird> greg, dmitry: tell him
  268. [16:44:06] <@CelloG> lsmith: no, I'm not worried about that
  269. [16:44:15] <@CelloG> lsmith: more about missed bugs - it definitely works
  270. [16:44:15] <@lsmith> ok .. so its time only
  271. [16:44:38] <@CelloG> time only, yes
  272. [16:44:38] <@otherbird> so you're prepared to wait for 5.3 a while longer so long as this is resolved?
  273. [16:44:40] <@Derick> which means: 5.3 or 6.0
  274. [16:44:44] <@lsmith> so we make an estimate .. and then we decide if we delay 5.3 (do PHP 5.4 or move this ti PHP 6.0)
  275. [16:44:53] <@Derick> i really don't want a 5.4
  276. [16:45:01] <@otherbird> Derick: nobody does
  277. [16:45:03] <@CelloG> I am certain, for instance, that Dmitry would be able to make this a far better patch than I could
  278. [16:45:09] <@lsmith> lets not worry about PHP 5.4 .. lets get an estimate first
  279. [16:45:19] <@CelloG> dmitry: still there?
  280. [16:45:31] <@dmitry> CelloG: which solution?
  281. [16:45:48] <@CelloG> http://wiki.php.net/rfc/backslashnamespaces#patch <-- the patch linked in there
  282. [16:45:50] <@lsmith> i mean all the other issues with \ seem petty to me .. this seems quite obvious as the way to go, since the only major issue with it is time to create the patch
  283. [16:46:11] <@lsmith> all the other proposals have much more noteworthy concerns
  284. [16:46:14] <@otherbird> lsmith: it's the obvious way to go if we want full ns support
  285. [16:46:34] <@CelloG> it took me a week of a couple hours a day to get that patch working - the biggest stumbling block was constants, which is the most ridiculously complicated thing in the world
  286. [16:46:39] <@otherbird> lsmith: class-only is the only serious option, but it'd have to come with a big stamp on it saying 'forever'
  287. [16:46:48] <@dmitry> no, I won't support '\' solution
  288. [16:46:50] <@CelloG> the majority of code changes were constant-related, as we needed different handling code in 5 different files
  289. [16:47:06] <@lsmith> ah dmitry .. what is the issue you see?
  290. [16:47:49] <@dmitry> it's the issue with myself, I can't accept it
  291. [16:47:57] <@Derick> but why not?
  292. [16:47:57] <@otherbird> you think it's fugly?
  293. [16:48:25] <@dmitry> this syntax goes PHP to Perl or something worse
  294. [16:48:43] <@Derick> dmitry: and none of the other ideas <...> or changing :: to -> does?
  295. [16:49:04] <@otherbird> at least there's no ambivalence about this one..
  296. [16:49:12] <@dmitry> any alternative syntax will work
  297. [16:49:18] <@dmitry> -> <> or ()
  298. [16:49:18] <@CelloG> I think dmitry is showing ambivalence :)
  299. [16:50:07] <@auroraeos> heh, I think simply changing the separator is the best way really... i think anything used will feel "weird" at first... people will adapt
  300. [16:50:08] <@CelloG> so you don't think the ambiguity issue is a problem (as I read it)
  301. [16:50:36] <@dmitry> It's not a big problem
  302. [16:50:51] <@Derick> i think it is
  303. [16:50:54] <@CelloG> it seems there are 2 camps, those who don't think it's a problem (and thus any solution that allows dis-ambiguation without call_user_func or reflection is good) and those who do think it is a problem, and the only solutions require syntax changes
  304. [16:51:00] <@dmitry> PHP has very wired references behavior , but it's not a problem
  305. [16:51:15] <@auroraeos> ...the solution I give for most reference problems is "don't use it"
  306. [16:51:24] <@auroraeos> I really don't want namespaces being told the same thing
  307. [16:51:26] <@auroraeos> do you ?
  308. [16:51:43] <@dmitry> don't use functions in namespaces if you don;t like them
  309. [16:52:34] <@dmitry> it doesn't prohibit to use namespace theirselvs
  310. [16:52:36] <@CelloG> um...
  311. [16:52:52] <@otherbird> well if you're going to make functions in ns ambivalent you might as well just say 'classes only', it goes back to that
  312. [16:52:53] <@CelloG> "here's a brand new feature. Oh, and don't use it if you don't like it"
  313. [16:53:10] <@CelloG> s/ambivalent/ambiguous/
  314. [16:53:20] <@otherbird> yeah, that too
  315. [16:54:38] <@lsmith> dmitry: you dont like using a backslash for anything but escaping? i assume the issue is not with a new separator .. right?
  316. [16:54:41] <@otherbird> dmitry: I don't understand what you have against \ - is it just the choice of separator you don't like, or something else?
  317. [16:54:49] <@otherbird> lsmith: snap
  318. [16:54:54] <@lsmith> so if there would be this magical separator alternative to \ it would all be good for you?
  319. [16:55:11] <@dmitry> \ is a terrible separator
  320. [16:55:17] <@lsmith> k
  321. [16:55:27] <@otherbird> but is that your only complaint about that resolution?
  322. [16:56:01] <@CelloG> http://pear.php.net/~greg/doubledot.php.txt
  323. [16:56:18] <@CelloG> http://pear.php.net/~greg/doublecarat.php.txt
  324. [16:56:30] <@Derick> CelloG: $err = new ..PEAR2..MultiErrors;
  325. [16:56:33] <@Derick> is wrong ...
  326. [16:56:44] <@Derick> not?
  327. [16:56:48] <@Derick> nm
  328. [16:56:49] <@Derick> :)
  329. [16:57:07] <@CelloG> no it just looks wrong :)
  330. [16:57:16] <@Derick> yeah
  331. [16:57:19] <@CelloG> these are the two major alternatives not considered
  332. [16:57:30] <@otherbird> double carat looks so surprised :)
  333. [16:57:37] <@Derick> ^^ looks like a WoW smile
  334. [16:57:41] <@otherbird> 'wtf am I doing here?'
  335. [16:57:43] <@CelloG> I also tried ** as separator, but it looks like doubly-dereferenced pointer as in **pointer
  336. [16:58:20] <@lsmith> lets use the real arrow char: →
  337. [16:58:21] <@lsmith> ;)
  338. [16:58:23] <@CelloG> I'm happy to consider alternatives, but the truth is, I think that when actually trying them, \ is much simpler for both typing and reading
  339. [16:58:43] <@CelloG> actually trying = taking existing code, and converting it to namespaces
  340. [16:58:49] <@otherbird> dmitry: you still didn't confirm that the choice of separator was your only objection
  341. [16:58:57] <@auroraeos> actually, after playing with \ it's not as bad as I thought too, CelloG
  342. [16:59:19] <@CelloG> I also believe strongly that every separator is terrible. \ is like democracy. The worst separator ever conceived except for all the other ones :)
  343. [16:59:22] <@dmitry> I don't think it's possible to find somrthing better then ::
  344. [16:59:29] <@otherbird> auroraeos: yes, I thought it'd be horrible too til I saw greg's code
  345. [16:59:34] <@Derick> but we've already concluded that :: alone causes issues
  346. [16:59:46] <@otherbird> dmitry: what Derick said (again)
  347. [17:00:05] <@CelloG> I am the strongest advocate for :: - every patch I have made up to this one was designed to preserve it, and I am convinced it just isn't technically possible to use it
  348. [17:00:28] <@dmitry> It's better to have some issues them kill the language with unreadable syntax
  349. [17:00:33] <@otherbird> ... except for classes only
  350. [17:00:53] <@CelloG> I agree with you dmitry, I disagree that \ is unreadable. Unfamiliar, yes
  351. [17:01:41] <@dmitry> yes
  352. [17:02:03] <@lsmith> ok .. i assume we will get the same opinion from Stas ..
  353. [17:02:10] <@dmitry> once agin eval() and code with namespaces
  354. [17:02:16] <@otherbird> lsmith: that's a dangerous assumption
  355. [17:02:41] <@Derick> dmitry: if you use eval, you need to think of escaping anyway
  356. [17:02:45] <@dmitry> eval("$y = a\new_foo($x);");
  357. [17:02:52] <@CelloG> lsmith: I wouldn't assume anything of Stas, he's a surprising fellow
  358. [17:03:25] <@Derick> dmitry: that code is wrong, you need to escape $ too
  359. [17:03:27] <@CelloG> in all cases where \ creates an escape sequence, we get immediate parse error
  360. [17:03:41] <@CelloG> which makes it easy to debug
  361. [17:03:52] <@otherbird> .. which resolves disambiguation issues
  362. [17:04:14] <@CelloG> actually there is 1 case where we would not get a parse erorr
  363. [17:04:25] <@CelloG> when using reflection, or when using constant()
  364. [17:04:30] <@otherbird> where it makes sense to the engine too (f, t, n)
  365. [17:04:34] <@CelloG> but we get a notice with constant, and an exception with reflection
  366. [17:04:38] <@CelloG> so I guess that's the same idea
  367. [17:05:54] <@CelloG> I have a quote from Stas: "I asked a lot of people - including ones that write major OO frameworks and real-life major applications - and they are OK with current solution and I think will be OK with either of the solutions we have under consideration. I think they will be much less OK with ::: and they will be royally pissed off at PHP group if there would be no namespace implementation in 5.3. "
  368. [17:06:03] <@CelloG> so I think it may be fair to assume he won't like \
  369. [17:06:22] <@CelloG> and "If we could find better separator, I think we would have found it by now... I didn't see yet a proposal that didn't look alien to PHP and unobvious to the user."
  370. [17:06:39] <@otherbird> so we should talk to the ones that write major OO frameworks
  371. [17:06:46] <@otherbird> ?
  372. [17:07:25] <@lsmith> i think most of the people that care today are reading internals now
  373. [17:07:31] <@dmitry> We spoke with ZendFramework team and even tryed to use current implementation
  374. [17:07:34] <@lsmith> what was the reaction to \ (or ..)
  375. [17:07:40] <@otherbird> lsmith: yes, but we're hiding from it ;)
  376. [17:07:45] <@lsmith> ?
  377. [17:08:29] <@CelloG> I think we could do that and talk in circles - in my opinion the best course is to decide whether there is a problem with ambiguity or not, and then choose the implementation. Developers adapt once they decide there is 1 choice if and only if it actually ends up working
  378. [17:08:30] <@otherbird> lsmith: \ or .. hasn't been offered up on-list as a solution, were you asking dmitry?
  379. [17:08:44] <@dmitry> We had problems with naming convesions then some parts of the name were "abstract" or "interface"
  380. [17:08:50] <@otherbird> CelloG: I agree with you
  381. [17:08:51] <@lsmith> otherbird: both separators have been mentioned on the list
  382. [17:09:12] <@lsmith> and atleast \ has been mentioned quite a lot lately
  383. [17:09:16] <@otherbird> lsmith: 'mentioned' yes, not polled - not in the last several years anyway
  384. [17:09:25] <@lsmith> otherbird: err ..
  385. [17:09:49] <@otherbird> no really
  386. [17:09:50] <@CelloG> a poll can't work here. It's not possible to vote without really understanding the depth of the problem - do you really expect all internals devs to read that long wiki entry I just wrote? :)
  387. [17:09:59] <@lsmith> i think it a lot of people have voiced opinions .. and i remember a lot in favor
  388. [17:10:09] * lsmith nods to CelloG
  389. [17:10:10] <@CelloG> the only separator a lot have voiced favor for is :::
  390. [17:10:23] <@otherbird> CelloG: I would expect them to read up prior to voting, yes
  391. [17:10:23] <@auroraeos> well CelloG, that's not entirely true
  392. [17:10:32] <@CelloG> auroraeos: which part?
  393. [17:10:33] <@otherbird> CelloG: that came second, : came tops
  394. [17:10:38] <@auroraeos> many who voted were saying "change the separator" not necessarily to ':::' but something
  395. [17:10:40] ScottMac joined the channel.
  396. [17:10:46] <@CelloG> right : ain't possible, especially with goto labels
  397. [17:10:56] <@CelloG> auroraeos: right, that is a good point
  398. [17:10:56] * ScottMac is hung over
  399. [17:11:01] <@CelloG> heh hi scott
  400. [17:11:03] CelloG sets mode +o ScottMac
  401. [17:11:09] <@otherbird> CelloG: many in the last poll wanted a different separator, didn't say which, just not :::
  402. [17:11:13] <@lsmith> err .. you guys do know the entire thread that lead to the keyboard discussion?
  403. [17:11:24] <@ScottMac> i saw that
  404. [17:11:36] <@lsmith> anyways .. yeah .. i think the fundamental question to answer first is if we feel that ambuigity is a severe issue or not
  405. [17:11:45] <@CelloG> lsmith: also a good point, many casually mentioned being ok with \
  406. [17:11:48] <@otherbird> lsmith: the kb discussion was short-lived, it's at the end of all ns stuff - Derick and someone else offered workarounds
  407. [17:12:06] <@otherbird> lsmith: I think it self-evidently is
  408. [17:12:15] <@lsmith> i also do not think that ns is a internals poll decision
  409. [17:12:18] <@CelloG> the truth is, ambiguity between namespaced function and static class method will be somewhat rare, just as all edge cases are somewhat rare
  410. [17:12:37] <@CelloG> but the ambiguity goes beyond just actual code in run-time
  411. [17:12:45] <@Derick> CelloG: it'll be harder to explain than that you need to escape \
  412. [17:12:53] <@CelloG> there is a real, and serious problem with debuggability and code review
  413. [17:13:02] <@otherbird> CelloG: that would make it a nightmare to debug those clashes
  414. [17:13:08] <@CelloG> the simple fact that the engine has trouble telling the difference is because they look the same
  415. [17:13:09] <@otherbird> rarity would make it harder
  416. [17:13:09] <@lsmith> static code analysis ..
  417. [17:13:20] <@CelloG> external code review, security audits, static code analysis all suffer
  418. [17:13:25] <@lsmith> right
  419. [17:13:28] andrei_ joined the channel.
  420. [17:13:35] lsmith sets mode -o andrei_
  421. [17:13:38] lsmith sets mode +o andrei_
  422. [17:13:38] <@otherbird> so really we are down to \ or classes-only
  423. [17:13:49] <@lsmith> otherbird: no .. we are down to another separator or class only
  424. [17:13:57] <@andrei_> I was the one who originally proposed \ :)
  425. [17:14:01] <@CelloG> I would contend that it could even open up a new security vulnerability when combined with other problems (user uploads script that is loaded first in include_path and redefined class foo method bar as namespace function foo::bar)
  426. [17:14:03] <@otherbird> lsmith: I stand corrected
  427. [17:14:05] <@otherbird> hi andrei
  428. [17:14:07] <@lsmith> and for the anither separator .. \ is a good candiate
  429. [17:14:12] <@CelloG> hi andrei_ I figured you might like that one for that reason
  430. [17:14:21] <@andrei_> I'm so transparent.
  431. [17:14:32] <@andrei_> did I miss much?
  432. [17:14:33] <@otherbird> you should've written that in black ;)
  433. [17:15:00] <@otherbird> andrei_: sort of, we think we're down to \ vs classes-only but dmitry hates \ enough to refuse to work on it
  434. [17:15:10] <@CelloG> so I have made my opinion clear on the ambiguity, I am happy - no ecstatic - to be proven wrong here by those who feel the ambiguity is not as big of an issue
  435. [17:15:25] <@lsmith> so a quick straw poll .. how is for allowing some syntax for disambigutation, but sticking with ::?
  436. [17:15:28] <@CelloG> because I actually do like ::, just not the baggage associated with it. :: feels good to use
  437. [17:15:30] <@andrei_> i think :> or -> stuff is worse personally
  438. [17:15:46] <@CelloG> -1
  439. [17:15:51] <@lsmith> dmitry i presume you are?
  440. [17:15:52] <@otherbird> lsmith: -1
  441. [17:15:52] <@dmitry> the same
  442. [17:15:54] <@auroraeos> -1
  443. [17:15:55] <@Derick> -1
  444. [17:16:09] <@andrei_> -1
  445. [17:16:26] <@ScottMac> -1
  446. [17:16:56] <@lsmith> and who is for a new separator? (prefix vote with "new" to make it clear which poll you are voting on)
  447. [17:17:04] <@CelloG> new: +1
  448. [17:17:08] <@Derick> new: +1
  449. [17:17:09] <@dmitry> +1
  450. [17:17:14] <@dmitry> -1
  451. [17:17:17] <@johannes_> new: +1
  452. [17:17:23] <@andrei_> new: +1
  453. [17:17:37] <@otherbird> new: +1 if not class-only
  454. [17:17:49] <@otherbird> dmitry: what on earth are you doing? :)
  455. [17:18:06] <@lsmith> ok .. who is ok with class only? (prefix with class only)
  456. [17:18:17] <@CelloG> class: -1
  457. [17:18:18] <@auroraeos> new +1
  458. [17:18:27] <@Derick> class: -1
  459. [17:18:29] <@auroraeos> class 0
  460. [17:18:29] <@ScottMac> new: +1
  461. [17:18:33] <@ScottMac> class -1
  462. [17:18:36] <@dmitry> 0
  463. [17:18:52] <@andrei_> -1
  464. [17:18:57] <@andrei_> class: -1
  465. [17:18:57] <@lsmith> ok .. counting dmitry as +1, new -1 and class 0
  466. [17:19:02] <@dmitry> (I was too late for first pool +1 is for first and -1 for the second)
  467. [17:19:07] <@otherbird> +1
  468. [17:19:14] <@otherbird> (sorry that was class)
  469. [17:19:44] <@andrei_> I would be majorly disappointed if i coulnd't namespace all the constants in PHP-GTK for example.
  470. [17:19:46] <@lsmith> i am 0, +1 new, -1 class
  471. [17:20:12] <@otherbird> lsmith: ever the diplomat :)
  472. [17:20:15] <@lsmith> ok .. this is quite unanimous .. even if we count Stas to be of the same opinion as dmitry
  473. [17:20:16] <@otherbird> brb
  474. [17:20:17] <@dmitry> in case of classes-only you won't
  475. [17:20:37] <@otherbird> so really the only thing left to discuss is which separator
  476. [17:20:41] <@auroraeos> andrei_: +1 for that...I'd love to get it all namespaced ;)
  477. [17:21:22] <@lsmith> dmitry: i think given the number of core people we have in here .. it seems that we are as close as we will ever be with an agreement
  478. [17:22:00] <@lsmith> i think none of the options on the table will spell the end of php, even though i do think it will certainly have a considerable affect on PHP
  479. [17:22:08] <@dmitry> I see, but selecting separator can take while
  480. [17:22:16] <@andrei_> have we ever discussed disallowing classes inside a namespace to be named the same? that is, namespace Foo cannot contain class Foo?
  481. [17:22:34] <@otherbird> dmitry: it's been discussed sooooooooooo many times surely we already know the problems?
  482. [17:22:55] <@otherbird> dmitry: that's why \ is getting some support now
  483. [17:23:12] <@CelloG> it means doing "sub-namespaces" naming style (like PEAR) with class name + extension cause fatal error
  484. [17:23:36] <@CelloG> it also doesn't remove the visual ambiguity between blah::is::this::method::or::function()
  485. [17:23:40] <@CelloG> it does solve the ambiguity issue in the engine
  486. [17:23:54] <@CelloG> removing that potential security issue I talked about (that would become fatal error)
  487. [17:23:58] <@lsmith> ok .. we are in search of a separator
  488. [17:24:10] <@andrei_> CelloG, I understand that. I bring it up as a possible fallback solution.
  489. [17:24:14] <@lsmith> we have \ on the table as well as the double dot
  490. [17:24:14] * otherbird silently votes for greg's backspace
  491. [17:24:26] <@lsmith> what else?
  492. [17:24:33] <@Derick> ^^
  493. [17:24:35] <@otherbird> lsmith: so you didn't like the eyebrows either? ^^
  494. [17:24:48] <@andrei_> To me personally, \ is a lot easier on the eyes and makes chained namespaces look like a directory search.
  495. [17:24:58] <@CelloG> might as well consider ** since it is technically feasible
  496. [17:24:58] <@lsmith> Derick: why does it need to be double ^?
  497. [17:25:04] <@Derick> ^ is xor
  498. [17:25:06] <@CelloG> single ^ is already used for xor
  499. [17:25:07] <@lsmith> ah right
  500. [17:25:22] <@lsmith> what are some criterias""
  501. [17:25:23] <@otherbird> I wouldn't be opposed to double dot, but I think \ is ok - and it could reflect actual paths to some extent under doze
  502. [17:25:24] <@lsmith> ?
  503. [17:25:25] <@CelloG> % is also possible but holy god almighty it is fugly
  504. [17:25:27] <@lsmith> readability
  505. [17:25:30] <@CelloG> er %
  506. [17:25:34] <@andrei_> eek
  507. [17:25:35] <@CelloG> hrm, double %
  508. [17:25:40] <@lsmith> severity for typos
  509. [17:25:42] <@otherbird> %%namespace
  510. [17:25:45] <@ScottMac> i really dont mind ::: :)
  511. [17:25:48] <@andrei_> we have to consider typography here too. Any "busy" symbol will be tough to read.
  512. [17:26:08] <@lsmith> (as in what would happen if one would do a typo .. this is mainly relevant for the proposals that require double chars)
  513. [17:26:10] <@otherbird> ScottMac: 80% wouldn't, the other 20% have difficulties differentiating it from ::
  514. [17:26:19] <@CelloG> lsmith: ambiguity with other operators (::: looks like ::, \ looks like /)
  515. [17:26:25] <@lsmith> ok
  516. [17:26:26] <@otherbird> actually %% is quite nice
  517. [17:26:41] <@ScottMac> otherbird: an IDE would highlight the difference between ::: and :: quite wel
  518. [17:26:51] <@andrei_> ScottMac, not everyone uses those :)
  519. [17:26:57] <@Derick> ScottMac: it's the typing though... ::: easily turns into :: or ::::
  520. [17:27:01] <@otherbird> ScottMac: what andrei_ said
  521. [17:27:29] <@andrei_> CelloG, different contexts for \ vs /. People are used to seeing / with variables/numbers and in file paths.
  522. [17:27:31] <@ScottMac> how about £ :P
  523. [17:27:40] <@ScottMac> other than the fact most keyboards dont have it
  524. [17:27:42] <@CelloG> http://pear.php.net/~greg/doublepercent.php.txt
  525. [17:27:55] <@CelloG> ScottMac: how do you do that on a US keyboard?
  526. [17:27:56] <@andrei_> ‡
  527. [17:28:11] <@otherbird> you just search and replaced ^^ yeah? now I know why you had ^^ in the first place :)
  528. [17:28:21] <@andrei_> OMG, %% is just not readable to me..
  529. [17:28:37] <@andrei_> it's a "busy" symbol.
  530. [17:28:43] <@lsmith> http://pastebin.com/m4322784a
  531. [17:28:43] <@CelloG> $errs = new %PEAR2%MultiErrors; <-- heheh :)
  532. [17:28:56] <@otherbird> does it even need to be double?
  533. [17:29:00] <@andrei_> i would disagree with this "#
  534. [17:29:01] <@andrei_> \ looks a lot like / and is easy to accidentally flip, especially for unix users
  535. [17:29:01] <@andrei_> "
  536. [17:29:07] <@CelloG> % is modulo
  537. [17:29:08] <@lsmith> is that a summary of the criterias and separators?
  538. [17:29:10] <@andrei_> they are not even close.
  539. [17:29:24] <@otherbird> CelloG: sorry, blonde moment
  540. [17:29:37] <@CelloG> andrei: I made that exact mistake in one of the examples on the RFC and had to correct it this morning
  541. [17:29:45] <@CelloG> foo/name instead of foo\name
  542. [17:29:51] <@andrei_> CelloG, that's cause you've been thinking about it for too long. :)
  543. [17:29:57] <@otherbird> CelloG: but you didn't make it when coding, just when writing about it
  544. [17:30:06] <@andrei_> What about > ?
  545. [17:30:08] <@CelloG> actually, I did make that mistake in one of the unit tests :)
  546. [17:30:14] <@otherbird> CelloG: noted
  547. [17:30:15] <@CelloG> >? greater than?
  548. [17:30:37] <@lsmith> ah right .. we had :> as well
  549. [17:30:37] <@CelloG> lsmith: yes that is a good summary
  550. [17:30:40] <@andrei_> new FileTransactions>Installedas
  551. [17:30:51] <@CelloG> if (CONST > OTHERCONST)
  552. [17:30:51] <@andrei_> I'm looking for a single symbol.
  553. [17:30:55] <@Derick> andrei_: without highlight, hard to see a separator
  554. [17:31:03] <@Derick> as*
  555. [17:31:05] <@CelloG> parser conflict not possible to resolve
  556. [17:31:12] <@andrei_> Derick, fair enough. Which is why I still think \ works the best and has fewest disadvantages.
  557. [17:31:16] <@CelloG> CONST>OTHERCONST could be a namespace constant or an expr
  558. [17:31:21] <@Derick> andrei_: and I agree with that
  559. [17:31:25] <@otherbird> I'd say the advantage of \ is that you only need a single symbol
  560. [17:31:36] <@otherbird> given that we can't have :
  561. [17:31:44] <@otherbird> that goes highly in its favour
  562. [17:31:49] <@andrei_> otherbird, and it's visual correspondence to directory search
  563. [17:32:03] <@otherbird> andrei_: I already said that :)
  564. [17:32:04] <@andrei_> it's = its
  565. [17:32:11] <@andrei_> still drinking coffee here..
  566. [17:32:21] <@otherbird> good thinking, brb
  567. [17:32:25] <@Derick> i've switched to wine already
  568. [17:32:37] <@lsmith> Derick: its before 6pm!
  569. [17:32:43] <@lsmith> tsk tsk
  570. [17:32:50] <@Derick> lsmith: so? :)
  571. [17:33:06] <@andrei_> That's funny, I interpreted it as "I switched to running windows stuff under Wine."
  572. [17:33:07] <@andrei_> doh
  573. [17:33:12] <@lsmith> ok .. i have added :> .. http://pastebin.com/m3a7df988
  574. [17:33:15] <@CelloG> http://pear.php.net/~greg/asshat.php.txt
  575. [17:33:16] <@dmitry> I'm going to take a whiskey :(
  576. [17:33:20] <@Derick> andrei_: wtf would I do that? :)
  577. [17:33:23] <@CelloG> dmitry: :)
  578. [17:33:38] <@andrei_> like i said.. coffee
  579. [17:33:59] <@CelloG> my eyes convert :> to -> or to :: alternately
  580. [17:34:01] <@andrei_> i don't know.. :> just looks weird
  581. [17:34:04] <@andrei_> like a smiley :)
  582. [17:34:09] <@andrei_> CelloG, that too
  583. [17:34:14] <@Derick> »
  584. [17:34:16] <@CelloG> look at static function begin()
  585. [17:34:18] <@andrei_> hey, what about :) separator
  586. [17:34:26] <@Derick> ±
  587. [17:34:26] <@CelloG> in class Installer
  588. [17:34:42] <@Derick> asshat?! :)
  589. [17:34:46] <@lsmith> we could make a ton if we sell PHP NS keyboards :)
  590. [17:35:02] <@CelloG> http://pear.php.net/~greg/smiley.php.txt
  591. [17:35:04] <@andrei_> well, personally I'd still prefer ☭ as a separator
  592. [17:35:09] <@CelloG> Derick: :) I'm glad someone noticed :)
  593. [17:35:12] <@lsmith> andrei_: :)
  594. [17:35:27] <@Derick> andrei_: haha
  595. [17:35:30] <@CelloG> self::$transact->registerTransaction('rmdir', new FileTransaction:)Rmdir);
  596. [17:35:36] <@CelloG> looks like the ( matches the ) in :)
  597. [17:35:37] <@andrei_> and let's not go into <3
  598. [17:35:37] <@Derick> CelloG: fail
  599. [17:35:50] <@lsmith> CelloG: worse yet .. lots of IDE's will go berserk
  600. [17:36:14] <@lsmith> ok .. i guess we should make a table an rate all the proposals based on the criterias
  601. [17:36:19] <@andrei_> Practically, \ works.
  602. [17:36:22] <@Derick> lsmith: so that excludes <, >, (, ), { and } from any separator
  603. [17:36:37] <@CelloG> for completeness: http://pear.php.net/~greg/doubledereference.php.txt
  604. [17:36:46] <@lsmith> i guess one of us can do this .. then the others can have a look .. and we can talk about any rating someone disputes
  605. [17:36:54] <@lsmith> ok?
  606. [17:37:06] <@Derick> lsmith: criteria: busy symbol, hard to type, IDE berserkyness
  607. [17:37:06] <@dmitry> @
  608. [17:37:07] <@andrei_> CelloG, eek, that smacks of C :)
  609. [17:37:11] <@CelloG> $err = new **PEAR2**MultiErrors; <-- just looks bizarre, especially coming from C background
  610. [17:37:23] <@andrei_> yes, I'd go nuts personally.
  611. [17:37:28] <@Derick> lsmith: number of chars
  612. [17:37:46] <@lsmith> criterias:
  613. [17:37:46] <@lsmith> (1) type-ability (how easy is it to type the separator)
  614. [17:37:46] <@lsmith> (2) typo-vulnerability (how easy is it to make a typo and get an unwanted behavior without a error/warning)
  615. [17:37:46] <@lsmith> (3) parse-ability (how easy is it to read the code and figure out whats going on without getting confused with similar syntax that means another thing)
  616. [17:37:46] <@lsmith> (4) IDE compatibility
  617. [17:37:46] <@lsmith> (5) number of chars
  618. [17:37:52] <@andrei_> those criteria are weighed differently i think
  619. [17:37:59] * CelloG volunteers not to make the table if that's all right
  620. [17:38:24] <@lsmith> andrei_: sure .. but lets worry about that if we have narrowed things doen
  621. [17:38:29] <@lsmith> ok .. i will make the table
  622. [17:38:35] <@lsmith> give me a few mins
  623. [17:38:36] <@CelloG> thanks lukas
  624. [17:38:44] <@Derick> lsmith: (6) busy symbol - how easy it is to spot in unhighlthed text
  625. [17:38:53] * andrei_ is secretly (well, not so much) rooting for \
  626. [17:38:56] <@lsmith> Derick: that is "parse-ability"
  627. [17:39:01] <@Derick> k
  628. [17:39:19] <@CelloG> on a side note, did you all have any idea how uber-complex handling of constants is in the engine?
  629. [17:39:32] <@Derick> CelloG: I know they're slow :)
  630. [17:39:41] <@andrei_> CelloG, Yes.
  631. [17:39:51] <@CelloG> compile-time constants (in method parameter default values, constant values, etc.) are completely different from run-time
  632. [17:40:01] <@andrei_> i know
  633. [17:40:15] <@CelloG> and arrays with constant indices - yikes :)
  634. [17:40:40] <@CelloG> we store metadata in 3 bytes after the constant name and then convert it to its value at runtime
  635. [17:41:02] <@CelloG> that part of the \ patch took me 5 days because of all the complexities I had to learn
  636. [17:42:07] * otherbird hands CelloG a cookie
  637. [17:42:52] <@CelloG> I'd love to talk about http://pastebin.com/m4516ca05
  638. [17:43:24] <@CelloG> if we move to \ as separator, I'd rather require \ prefix for absolute names like an absolute path \foo\bar()
  639. [17:43:26] <@Derick> bar\other\thing
  640. [17:43:31] <@andrei_> agree
  641. [17:43:34] <@otherbird> interesting
  642. [17:43:47] <@CelloG> so that namespace is always prefixed to "relative" namespace names
  643. [17:43:49] <@Derick> because "namespace foo;" is IMO similar to "import foo;"
  644. [17:43:54] <@Derick> which is import foo as foo
  645. [17:43:58] <@andrei_> that would make sense to Web people
  646. [17:44:03] <@dmitry> now it's bar\other\thing
  647. [17:44:16] <@CelloG> no it is bar\other\thing, correct
  648. [17:44:19] <@otherbird> I'd have read that as foo\bar\other\thing because there's no \ in front of it
  649. [17:44:20] <@CelloG> s/no/now/
  650. [17:44:54] <@dmitry> in case you are going to look for \foo\bar\other\thing you have one another ambiguity
  651. [17:45:22] <@CelloG> the confusion I can see is that bar() resolves to foo\bar(), and \bar() resolves to bar()
  652. [17:45:23] <@dmitry> and even for if you have class foo in namespace foo
  653. [17:45:43] <@CelloG> but foo\bar() resolves to foo\bar(), \foo\bar() resolves to foo\bar()
  654. [17:45:46] <@CelloG> it's inconsistent
  655. [17:46:12] <@dmitry> only short names can be resolved now
  656. [17:46:19] <@dmitry> long names are used as is
  657. [17:46:30] <@andrei_> that could work too
  658. [17:46:55] <@CelloG> of course it can work. There are 2 drawbacks
  659. [17:47:11] <@CelloG> I didn't even understand this until 3 days ago, so newbies will have similar issues
  660. [17:47:28] <@CelloG> and it makes the engine a lot more complex because we have two different ways of resolving things
  661. [17:47:39] <@CelloG> the engine part is just details
  662. [17:47:41] <@Derick> two ways is not "KISS"
  663. [17:48:16] <@CelloG> I could understand it if we document it well, but it's really hard to explain clearly why a short name is different from a long name
  664. [17:48:22] <@lsmith> ok .. here it is:
  665. [17:48:23] <@lsmith> http://pastebin.com/m5a8d7ff1
  666. [17:48:53] <@otherbird> CelloG: well if it's just documentation, I can help - so long as I understand it first :)
  667. [17:49:07] <@lsmith> for type ability is focused on how quick i assume it is to type the chars .. also how common the sign is today already (assuming that people have it in their fingers to quickly type these)
  668. [17:49:23] <@dmitry> again, in case you tey to resolve long names you get another ambiguity which can't be solved with namespace separator
  669. [17:49:34] <@dmitry> yey=try
  670. [17:49:35] <@lsmith> for typo vulnerability i marked down anything that contains an single char operator
  671. [17:49:57] <@lsmith> parse ability anything that looks similar to an existing operator
  672. [17:50:01] <@CelloG> what I did in my patch was to make "relative" always resolve to namespace\...
  673. [17:50:23] <@CelloG> it removes 1 hash lookup from this situation
  674. [17:50:28] <@lsmith> IDE compatibility .. obviously all of the separators show a parse error today .. so i marked down anything that could confuse auto complete or parenthesis matching
  675. [17:50:37] <@lsmith> for number if chars .. i guess its obvious :)
  676. [17:50:54] <@CelloG> #3 should be -1 for \
  677. [17:50:55] <@lsmith> so please raise your hand if you take issue with any of my ratings .. so that we can discuss them
  678. [17:50:55] <@auroraeos> smart IDE 's let you pick a PHP to lint from so won't show a parse error - will just be a highlighting thing ;)
  679. [17:50:58] <@CelloG> it is similar to /
  680. [17:51:20] <@dmitry> then you can't access other namespaces without prefixing them (however in case of \... it looks natural)
  681. [17:51:28] <@lsmith> CelloG: i guess this is for the case when its used inside a string definition only?
  682. [17:51:50] <@CelloG> dmitry: right - that's the drawback. If we don't use \ as separator, I would prefer existing resolution
  683. [17:52:06] <@lsmith> which would make it +-0 i guess .. but not really -1 .. since its unlikely to be confusing when used outside of a string definition
  684. [17:52:17] <@CelloG> lsmith: I was just talking about $a = CONST / ANOTHER; versus $a = CONST\ANOTHER;
  685. [17:52:32] <@lsmith> ah ok
  686. [17:52:38] <@andrei_> CelloG, true, but i think that's a minor consideration..
  687. [17:52:39] <@CelloG> it's relatively rare to divide two constants, but is possible
  688. [17:52:45] <@lsmith> so lets give it a -1 ..?
  689. [17:52:46] <@CelloG> +-0 is fine, I guess
  690. [17:52:54] <@CelloG> if you all think it's minor
  691. [17:53:01] <@lsmith> opinions?
  692. [17:53:07] <@Derick> 0
  693. [17:53:45] <@CelloG> #2 for :) should be -1 because if we miss the : it becomes a closing paren
  694. [17:54:20] <@lsmith> err yes .. that was a "typo"
  695. [17:54:21] <@lsmith> :)
  696. [17:54:27] <@otherbird> lol
  697. [17:54:29] <@Derick> fail :)
  698. [17:54:37] <@lsmith> http://pastebin.com/m6d4e40f4
  699. [17:54:40] <@Derick> lsmith: should we include ::: too?
  700. [17:54:46] <@otherbird> Derick: no
  701. [17:55:03] <@otherbird> Derick: that was already polled, there are good reasons to drop it
  702. [17:55:25] <@Derick> counting nr,s \ is the only one with a "positive" vote
  703. [17:55:38] <@lsmith> i have added :::
  704. [17:55:46] <@lsmith> http://pastebin.com/m7a69c046
  705. [17:55:58] <@andrei_> ::: is FAIL
  706. [17:56:01] <@andrei_> apparently :)
  707. [17:56:15] <@CelloG> #4 on ::: is probably +1 an IDE would have no trouble with it
  708. [17:56:16] <@lsmith> dmitry: can you check out http://pastebin.com/m7a69c046 ?
  709. [17:56:29] <@Derick> CelloG: but i'd give it a -1 for (1)
  710. [17:56:33] <@CelloG> but -2 on # of characters :)
  711. [17:56:43] <@CelloG> Derick: agreed
  712. [17:56:46] <@lsmith> Derick: number of chars is already in (5)
  713. [17:56:55] <@lsmith> so i did not want to factor the number of chars into (1)
  714. [17:57:00] <@Derick> lsmith: no, I meant ::: vs :: or ::::
  715. [17:57:04] <@andrei_> ::::::
  716. [17:57:11] <@CelloG> ah! make it stop!
  717. [17:57:14] <@CelloG> :)
  718. [17:57:14] <@otherbird> andrei_: ouch
  719. [17:57:15] <@Derick> :)
  720. [17:57:15] <@andrei_> Ok, I think it's clear which way the cookie is crumbling.
  721. [17:57:24] <@dmitry> forget about IDE, we are making language for human
  722. [17:57:35] <@CelloG> dmitry, voice of reason
  723. [17:57:39] <@Derick> humans use IDEs
  724. [17:57:44] <@otherbird> some of them
  725. [17:57:46] <@lsmith> dmitry: like ScottMac said .. not all criterias are weighted evenly
  726. [17:57:47] <@Derick> nobody uses notepad or edlin
  727. [17:57:57] <@andrei_> lsmith, that was me :)
  728. [17:58:09] <@otherbird> Derick: 'nobody'? would you like me to start another poll? :)
  729. [17:58:14] <@johannes_> people using notepad won't use namespace, or it's their problem ...
  730. [17:58:19] <@Derick> otherbird: nobody sane at least
  731. [17:58:19] <@andrei_> ok ok
  732. [17:58:23] <@lsmith> Scotty, Scottdrei, andrei
  733. [17:58:24] <@lsmith> all the same :)
  734. [17:58:25] <@otherbird> shh
  735. [17:58:26] <@andrei_> let's not get into emacs vs. vim
  736. [17:58:27] <@CelloG> johannes_: what do you mean?
  737. [17:58:28] <@Derick> scottdor
  738. [17:58:41] <@andrei_> because we all know who would win :)
  739. [17:58:49] <@Derick> yes, vim
  740. [17:58:50] <@Derick> :)
  741. [17:59:01] * CelloG thinks this is deteriorating fast, let's wrap it up efficiently so I can go eat breakfast
  742. [17:59:06] <@andrei_> me too
  743. [17:59:09] <@andrei_> i'm due for a french toast
  744. [17:59:11] <@Derick> dinner soon
  745. [17:59:15] <@otherbird> who's actually against \?
  746. [17:59:18] <@otherbird> (without the ?)
  747. [17:59:22] <@CelloG> dmitry was
  748. [17:59:24] <@CelloG> I thought?
  749. [17:59:28] <@Derick> yeah
  750. [17:59:32] <@otherbird> and nobody else?
  751. [17:59:52] <@CelloG> johannes_: is there some problem with \ and notepad?
  752. [17:59:59] <@auroraeos> no
  753. [18:00:01] <@otherbird> CelloG: no there isn't
  754. [18:00:05] <@lsmith> lets always count Stas -1 for any proposal .. when we are trying to determine if a proposal has a clear majority
  755. [18:00:14] <@andrei_> hahahaha
  756. [18:00:16] <@auroraeos> LOL
  757. [18:00:19] <@Derick> :)
  758. [18:00:23] <@otherbird> poor Stas :)
  759. [18:00:26] <@lsmith> i am not saying this as a hit on Stas
  760. [18:00:33] <@lsmith> i am just saying that Stas's opinion is important
  761. [18:00:35] <@CelloG> I think that is fair, just because Stas has expressed clear opinions against a new separator
  762. [18:00:36] <@lsmith> and since he is not here
  763. [18:00:46] <@otherbird> ok
  764. [18:01:06] <@dmitry> Stat was for ->
  765. [18:01:14] <@CelloG> right
  766. [18:01:15] <@dmitry> or classes only
  767. [18:01:20] <@Derick> yeah, but also for modifying :: to ->
  768. [18:01:24] <@CelloG> also true
  769. [18:01:24] <@otherbird> 2 against how many? 9?
  770. [18:01:38] <@dmitry> only as an alternative syntax
  771. [18:01:40] <@lsmith> dmitry: but we have accepted that even if Stas was opposed to a new separator, we were unanimous enough to proceed
  772. [18:01:46] <@CelloG> could I suggest we make this whole log publicly accessible?
  773. [18:01:47] * otherbird would still go to classes only at the drop of a hat but if that's not an option..
  774. [18:01:58] <@CelloG> perhaps editing out the jokes/entering/leaving the channel
  775. [18:02:02] <@andrei_> it is an option.
  776. [18:02:11] <@otherbird> CelloG: that was intended, actually I think we should keep the jokes in
  777. [18:02:25] <@lsmith> yeah no need to edit ..
  778. [18:02:39] <@andrei_> let them slog through what we had to go through.
  779. [18:02:41] <@CelloG> ok, no problem here with that, just thought it might make the read a bit shorter
  780. [18:02:55] <@auroraeos> eh, the jokes are cute ;)
  781. [18:03:03] <@lsmith> i will put the pastebin on the wiki somewhere i guess
  782. [18:03:11] <@andrei_> So \ it is.
  783. [18:03:15] <@andrei_> Thank Science.
  784. [18:03:17] <@otherbird> ok
  785. [18:03:42] <@otherbird> and Greg, when it's to a state it can be documented - come and talk to me
  786. [18:03:52] <@CelloG> if that is true, then I would want to make clear how the patch I wrote works. I leave tomorrow for a week-long residency at Harvard, and am not sure how inet is at the hotel
  787. [18:04:08] <@lsmith> i feel, that even while this was comparitively quick to get to \ (compared to the entire namespace history), that we did it based on the experience we have gained
  788. [18:04:15] <@lsmith> so it does not feel rash or anything
  789. [18:04:21] <@otherbird> lsmith: agreed
  790. [18:04:33] <@otherbird> CelloG: on here, in public space - where?
  791. [18:04:36] <@otherbird> rfc it?
  792. [18:04:39] <@CelloG> first off, there is a clear bug in the patch that I realized when I work up this morning. CG(current_import) is mistakenly applied to short function names like "bar()"
  793. [18:04:55] <@CelloG> just here, so any questions can be asked (especially from Dmitry)
  794. [18:05:09] <@CelloG> because I'd like it to be helpful, as a base to work from
  795. [18:05:16] <@CelloG> but I don't think it is a final product yet
  796. [18:05:21] <@dmitry> yes you are welcome
  797. [18:05:28] <@otherbird> I don't think anybody assumed it was, Greg
  798. [18:06:03] <@CelloG> zend_resolve_class_name() is used to apply namespace to current function name, but we need a new function, perhaps zend_resolve_non_class_name() to be used for constant/function resolution
  799. [18:06:18] <@CelloG> the idea here is that for constants/functions, we don't want to apply "use" imports directly, only to the namespace part of their name
  800. [18:06:32] <@CelloG> so foo/bar() checks "foo" for import name, but bar() does not check "bar" for import name
  801. [18:06:36] <@CelloG> am I making sense so far?
  802. [18:07:07] <@otherbird> you're asking dmitry or all of us?
  803. [18:07:24] <@CelloG> anyone, but particularly dmitry since he has ZendEngine2 karma
  804. [18:07:30] <@dmitry> I don't hold it in my head I need to look
  805. [18:07:45] <@dmitry> Please ask questions by email
  806. [18:08:01] <@dmitry> I'll answer them on Monday
  807. [18:08:05] <@CelloG> the only other thing to be aware of is that the patch implements relative\ns\name
  808. [18:08:23] <@CelloG> so in the example bar\other\thing() becomes foo\bar\other\thing()
  809. [18:08:46] <@CelloG> this would be relatively simple to change, but touches a lot of unit tests
  810. [18:09:18] <@dmitry> in case you change behavior you can just remove tests
  811. [18:09:24] <@CelloG> otherwise it should be good to go. I also touched ext/reflection, ext/standard/unserializer.re, and ext/tokenizer
  812. [18:09:28] <@dmitry> I mean old tests
  813. [18:09:37] <@CelloG> in the tests, I just prefix things with \ that need it
  814. [18:09:51] <@CelloG> the patch does *not* change the name resolution of classes, as that is a separate issue
  815. [18:09:52] <@dmitry> it seems ok
  816. [18:10:05] <@andrei_> ok, i'm off to get breakfast
  817. [18:10:24] <@CelloG> to all: http://pear.php.net/~greg/backslash.sep.patch.txt can be applied to PHP 5.3 if you want to play around with \ as separator
  818. [18:10:39] <@CelloG> thanks everyone, this was unbelievably productive
  819. [18:10:50] <@andrei_> it's even better in real-life :)
  820. [18:10:51] <@CelloG> I still can't quite believe a decision was made
  821. [18:11:17] <@CelloG> dmitry: I'll fix that bug I mentioned and update the patch, and send you an email with the details
  822. [18:11:28] <@CelloG> and include Stas as well
  823. [18:11:30] <@dmitry> ok
  824. [18:11:35] <@dmitry> I'll take a look
Advertisement
Add Comment
Please, Sign In to add comment