> On 16 Apr 2016, at 11:19 , Lester Caine <les...@lsces.co.uk> wrote:
> 
> On 16/04/16 06:56, André Rømcke wrote:
>>>> This actually summarises many of the problems all of these 'extras' are
>>>> creating for very little gain.
>>>> 
>>>> 'Seconds' is a 'Traditional Property' so is untyped and if accessed as a
>>>> value from some OS's will be a floating point number[...]
>> It wasn't really the example I intended to point to, it does not represent 
>> the cases me and others refer to. I was linking to it for the possible 
>> solution to handle type and immutability.
>> 
>> Examples for the latter:
>> https://en.m.wikipedia.org/wiki/Value_object
> 
> Working from and SQL base ... the schema provides both validation beyond
> simply 'int' or 'float' and 'read only' all simply extensions to the
> basic variable returned.


readonly in this case is more about application logic and not db logic.
If you want to take a swing at it a more relevant example would be to just ask 
everyone to use get<Param>() and in case of writable properties 
set<Param>($value) and stop asking about expanding the language to cover the 
use cases and hence simplify use.

> 
>>>> I don't see how the idea of 'optimizing' the compiled code has any
>>>> bearing on handling a 'typed property' when one has to have an object to
>>>> contain even the simple of type information?
>> 
>> What is this regarding?
> 
> People have been claiming they need to be able to identify the type in
> order to optimize the compiled code. […..]

True, for me is more about the benefits in user land. There are lots of cases 
where those claims won’t be true, as in scalars changing types. So even with 
type hints it will still need some sort of tracing JIT compiler that uses type 
info from todays runtime to machine compile hot spots, the type hints will 
merely make sure the type is somewhat more predictable. And even then you’ll 
need to account for possible type misses and sometimes have to pop back to 
interpreter effectively loosing time. All of which Javascript has done for 
years and continue on to do, afaik latests on that is 
https://webkit.org/blog/5852/introducing-the-b3-jit-compiler/

 
But even if discussing that would be neat, and it’s relevance since there have 
been discussions on using LLVM with PHP over the years. This thread is not 
really about type, it’s about readonly properties or whatever you would like to 
call them :)


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to