though, not really happy with the VM architecture since it is really quite inefficient (since each block is a separate execution frame, loops become stupidly expensive).
@driusan well, that "flattening" happens at the CFG step since there's no hierarchy after that conversion happens..
would probably also be useful to go into a little more depth about how frames are stored (especially if it's inefficient and something that someone could improve)
@JoeWatkins what would you need to see me provide support for to support Parallels in PHP-Compiler. Thread local storage for globals I assume. Anything else big?
plus, I am code-generating native code, so wouldn't it be more efficient to just generate threaded code directly?
user9727963
Can someone tell me why my <?php echo $file; $i++; ?> is outputting the full directory? jsfiddle.net/bsq3eg0x - I want it only to output the last .dns extension.
not even a rewrite, since I would imagine having access directly to low level LLVM apis for code generation could result in a very different implementation
@ircmaxell probably its better to choose a different approach like real threads with all the normal c++ magic? Then there could be written a polyfill/mapper to run the php-src parallel things.
@JoeWatkins it's a bit of a chicken and egg. The alternative would be less "redundant" work, but it would be more work getting a bridge to be performant. And honestly, building support for those macros that php-src uses scares the crap out of me. Plus, it would make it a pain in the neck to support generating native types instead of zvals for variables, since I have no control over the call convetions (where if the functions are implemented in PHP, I absolutely can)
@CSSUM you almost certainly want to get better at googling things. Like "php filename instead of full path".
or probably searching just php.net for relevant functions "file name without directory site:php.net" gives as the top result: php.net/manual/en/function.pathinfo.php
I dunno if it would have to necessarily be slow, you can get the address of any internal function, pass it a thing the sizeof(zend_execute_data) with arguments at the right offset (and object on This), and for everything but things like xdebug, that will work most probably ...
@PeeHaa Signed back up for classes to finish my degree. Only have a year left. But- the most important reason for finishing- I can get Avid Pro Tools for half off! W00t!
@JoeWatkins the parts that depend on a library wouldn't be in PHP. Those can call via FFI to an underlying lib. I just don't really want that calling into php-src, at least long term.
or re-implementing a bunch of core stuff like ctype, json, all stuff that things like composer needs ... it doesn't make sense to reimplement them in any language ...
ctype is a libc thing, and can be implemented using FFI or directly
if there's a native C library for it, I can link to that library using FFI, and code generate a link to it using LLVM so turn them all into native calls
what would be re-implemented would be the wrapper logic
it just seems so very far away from the compiler, you know ? I just imagine all the time you're going to have to sink into that so that people can run basic things like composer ...
true, but if I don't do that, then I'm stuck linking php-src, with all the initialization overhead that brings, and re-using its error handling system, and a bunch of other things in any binary I compile
which then massively kills any performance benefit to AOT compiling in the first place
Plus, a lot of this was implemented in HHVM. So perhaps just port from there?
@JoeWatkins true, but I still would need to initialize PHP, no? It would expect at least some amount of globals to be setup, for MINIT and RINiT to be called appropriately, and for enough of the runtime to be present to run the extensions
well I can't think of a way around that ... but that's not to say that you have to call any of PHP, you have to present an environment to the extensions that looks like PHP ...
so much, and not the sort of work people really want to do ... if I had to write down a list of ten things I least wanted to do, writing a dom/datetime/libxml API would probably be on there, near the top ...
But it's split into two types of work "delicate and deep architectural work" and "mostly straight forward build and test" work. The stdlib and core extensions are mostly on the second half of that spectrum
whereas if I did integrate into Zend deeply, it would be slightly less work overall, but far more on the delicate and deep side
@JoeWatkins quite true, but those are things that also don't require a ton of deep compiler knowledge to write. Hence they can be good places for contributors who want to help but aren't ready to jump into the engine to write.
Plus, that comes with a HUGE benefit: PHP-code documentation for the standard library. When people have a dispute about how something behaves today, they must go to C to resolve it. But having a PHP version of standard lib can solve that easily by not requriing people know C. Especially when there's already talk of extracting parts of the stdlib into PHP once JIT ships in 8
@JoeWatkins There are a ton of people who sometimes just want to implement some very simple function just for fun. Take x of these.
then 1 function a day keeps the hhvm away?!
This could be even linked to some kind of gamification online frontend? Like a platform for learning to re implement function x and learn from it. If all tests passed against the php-src this should work
i need to read more.... if only i had things to read... i tried to read medium for a while and i wasn't happy with the programming content. there are roughly 3 kind of contents on medium: 1- this is why we are winning at life 2- this is why you are not winning at life 3- "hello world" tutorials
There are now also a ton of youtubers to listen to while working. This helps me a lot if im constantly hearing english
1 month ago i spoke english for the first time since 3 years lol. I realized that i really are not working globally. The last international team was a gamejam 3 years ago :/
@ircmaxell hahaha nesse caso, é bom ficar fluente (risos). Meu pai é de Minas Gerais (ao lado de Espírito Santo) e essas regiões tem expressões idiomáticas bem estranhas /o\
Then its probably better to use something else well documented and maintained. A self managed package like this will increase the development cost of everything
I dont want do say its not right do write your own stuff (20 devs as well). I got a ton of components you should replace with sympfony... but the history of that doesnt allow a major change now.
if sebastian approved your component then go with it
Talking specifically about the issue I'm having: Prophecy doesn't seem to support partial mocks, so when I create a mock of a class, I can't invoke its original methods. From my understanding, every public function will just return null unless I state otherwise
if you write some code and test it with prophecy, what will happen if you change that code? will the test continue working or will it be checking the wrong things?
if you need to update the tests when you change the code, you have a problem
and that's a common problem for everybody using mocks
instead if you use actual object you get to test a real scenario
some might say that's not unit testing, but you are still testing a single code path of a single function/method, unlike what you do with integration testing
@LucasBustamante If you have a database layer as an architectural boundary, it could provide a test layer so that you can run unit-tests w/o any database interaction (and the database layer could be tested to actually to the database work on the other end), I think this is best. Otherwise you start to integration test your code w/ a specific database state (that works as well, but is often much more expensive).
I'm not certain that integrations should completely replace unit tests. At least I think there are certain things which ought to be unit tested, and any usage in "integration" is testing the other piece, not this unit.
Well with unit tests, it's just testing, developing, refactoring in quick circles. You can't have that with integration tests, which require debugging but with unit tests it's no debugging normally, it's just developing.
@user3655829 well put "truly" in quotes, hehe :)
But when you start with testing, the real framework is maybe the testing framework, regardless of which other framework there is in the project.
should be depending on the application youre developing. I said i run elearning platform with 100+ of models. There is no complicated stuff inside. Its basicly crud on a big big thing.
I can't understand these people who can't take the time to review a patch on <? to <?php. I don't think I ever will understand them, but I can't believe that they even need manager approval to do such a thing. It's going to take very little time at all, particularly if run on small subdirectories at first to make sure it can be done in a small sessions.
> Unless someone decides to actually discuss the issues I've raised in previous emails, instead of just telling me how easy it's going to be for me to update my codebase that they know nothing about, this will be the last message I'm sending in this thread.
@LeviMorrison this is why I'm strongly against having to justify either yes or no votes. It's always going to result in people getting precious and saying that the other side haven't 'justified' their position.
Also, has everyone else's mail client decided to start their reply with a '>' ?
@Jimbo This job will be my foot into the programming world, whether I agree with their technologies or not it would be stupid not to take it and learn Laravel :)