Author: Manuel Lemos
Posted on: 2011-03-28
Download Size: 34MB Listeners: 2210
Introduction music: Riviera by Ernani Joppert, São Paulo, Brazil
RSS 2.0 feed compliant with iTunes:
Interview with Brett Zamir on PHP.js (0:44)
Latest browser releases: IE 9, Firefox 4, Chrome 10, Opera 11
Upcoming articles in JSMag magazine (59:45)
Participate in Open Source technology groups in China (1:05:17)
Interview with Brett Zamir on PHP.js (0:44)
I had also had the idea for this at a similar time, but he ended up I think building the momentum up first and on his blog initially, and then eventually it became a separate site, and when I saw what he was doing and the license of the code was very open and just decided I'd start contributing and that's how I got involved.
And we were looking to sort of replicate that core functionality but also leveraging the functions, the API's and so forth that we were already pretty familiar with.
And again, I didn't hear this as a motivation but you're kind of going the other way, you're saying hey we got people maybe a decade of PHP experience, maybe you can even remember haystack needle or needle haystack, but you've got a lot of that experience, take that to the browser so you don't have to rewrite and not even just rewrite but rethink how you work. Is that maybe a safe benefit, have you found that to be a benefit yourself?
But, sorry, you already mentioned the founder Kevin Van Zonneveld, right? I'm not sure if I'm pronouncing his name correctly. I also did not mention your surname, Brett Zamir, right? And there is a long list of authors here in the site. I did not count all of them. I'm not sure if this is a sort of ranking of who has contributed more because as a number in the front is this the number of functions or what is it?
And I think one interesting thing about this project from a management point of view is Kevin was very generous I think in just encouraging people to contribute no matter the initial level he would give credit to somebody even if they just reported a bug, and I think that really invited participation and made a really nice environment.
So for people who want to know contributions there's a... I mean we have it in source control now, we've moved it form subversion, we've got it in GitHub now, but I mean you can look at the repository but he's also still, we're also still keeping track of it inside the functions.
And yeah, so we've got a lot of people on the periphery who are making reports and we're including them, and then we've got a few core people some of whom come and go or are still around, but for example recently a person has come, Ratheous, if I'm pronouncing his name right, I'm not even sure myself, but he's made some really sharp contributions, and we've had other people over time like Onno Marsman and some others who have helped shape its development.
I know that works well because both in the JSClasses site and PHPClasses site I also have somewhat similar rankings based on number of users. It's a different count, but the goal of using rankings is somewhat similar.And it's quite amazing, a lot of contributors.
And what exactly is the main goal of the project, is it to cover all functions and extensions of PHP or a more modest goal?
I'm looking at the implementations of the functions, and at least some of the ones I looked at it doesn't look like there's a lot of necessarily a lot of reuse between the functions. And I'm wondering if I'm interpreting that correctly, if there is and maybe I'm just not looking at it, or if there's not, because it seems like most of the functions that are implemented are implemented more or less stand alone.
But the flipside of that might be that the actual PHP.JS environment when it's running might be larger than it needs to be. Could you talk about some of those internals for a little bit Brett?
And also the compiler which Kevin built allows you to select just the functions you want, and I think it also handles the dependencies for you because in some cases there are some dependencies when there was really a good need, when there was a very significant amount of code that could have benefitted from that.
So, yeah, we've tried to make it independent and, in fact, using a little trick appending the this object, we just this object to refer to our functions internally so that if you're using, if you're copying a function and pasting it into an object like our name-spaced object it will work there in a name-spaced way, but it will also work as a global since this is interpreted as a global when it's not in an object, when it's not called with new or whatnot.
So, yeah, we do reuse code when it's compelling, but we try to keep it more... that's maybe different as you say from other frameworks, there's not really a framework strictly speaking.
However, there is a way that some items work in sort of a framework way, for example, the INI settings, just like in PHP, PHP.JS you can use functions like ini_set which coordinates configurability using a pseudo-global, it's global if you're in the non-name space version, if you're in the name space version it's just the instance object.
And anyway, yeah, so that is something for example that you can coordinate behaviors between functions or it also allows us to track states in some cases like the string token, strtok function needs to know about the state, there are other cases like that where it does work in sort of a framework way, but usually it's just pick and choose whatever you want, whatever you want out of the library.
But sorry, I just thought I should mention that point because that's one of the more significant things that comes up for us. But as far as technical challenges, yeah, there are some major and minor differences, as you mentioned, synchronous or asynchronous.
For example, in let's say echo where that's a function that I still would like to do quite a bit more work on, but the question is for example if we implemented let's say output buffering code by we have the ability to store whatever strings the user's adding into echo, and if they've turned output buffering on we can kind of allow them to selectively store those strings, and then later on we can actually echo them whether it's to the document body or whatnot, so it does provide some interesting challenges.
And as you mentioned with asynchronous connections, for example, file_get_contents, which is synchronous in PHP, and if people are expecting a return object right away then of course it has to be synchronous.
So that's the default way we implemented it, but we do allow and thankfully PHP made it easy for us to allow configuration, sometimes we can do the configuration in a more PHP way, and sometimes we use INI settings.
So, for example, in PHP file_get_contents you can do a add a stream context to the arguments, so we added our own configuration item so that you can specify that you want file_get_contents to work asynchronously, and it's just kind of fun in some ways to find all the ways where we can leverage what PHP already does to make it work.
So I could not figure exactly how do you provide synchronous functionality, but now that you mention it may work asynchronously I wonder if you actually can make it work synchronously somehow with some trick that I'm not able to figure what it could be.
So if we didn't do it as the return object and added our own callbacks in a non-standard way it might not be able to leverage what the user already knew. So we do do it synchronously by default but we allow the user to pass in a stream context which I think is a callback that will be invoked when it returns.
We have a configuration setting so that when you use let's say the is array function whether it's going to actually treat them as associative arrays or not there are some issues with that I'm trying to work on because, I don't know if you want to get into that, but so basically we deal with differences by either putting functions in the experimental section or using INI functions or by taking advantage of arguments that PHP already has like stream context.
Are you looking for more contributors? If so, what should any interested listeners or other people that know about this project can do to approach and contribute somehow?
So yeah, contributors most welcome, like I said, it's on GitHub but also the web site has a simple comment system so if you just want to leave a comment for a particular function it's really easy to offer feedback, or if somebody has questions if they think something might not be right they're welcome to send those kinds of comments too.
Latest browser releases: IE 9, Firefox 4, Chrome 10, Opera 11 (32:09)
One of them is the ability to pin down your site pages, so the user can drag the current page tab to the desktop bar and it leaves it there with an icon so you can start with that page very quickly the next time you want to use it.
Actually there is an API defined by the standards body for desktop notifications. And it seems that IE 9 provides that API, so you can somehow notify your desktop in case you have your browser window minimized so the user knows that there are some notifications on that web page. I think is particularly useful, for instance, for chat applications like gTalk, Web based chat applications.
And if you minimize the window, the desktop bar shows over the icon of that application that is pinned down, shows a count of new web notifications that have been added since you minimized I think. And that is interesting because it somehow provides a feature that until now it was only available to non-Web applications.
Well, this web notification thing seems interesting with good potential to enhance applications that provide updated states on the pages, and once the user minimizes the window these notifications can get his attention back to the browser window again.
Other than that, other features that I also found interesting in IE 9 were more or less things that they already had before like their built in debugger that is now a permanent part of the browser, I think it was already there since IE 8, but is now enhanced with benchmark tools for those that want to determine how they can improve the performance of their scripts, including networking traffic.
There are other features, I did not try to go much in depth on those features, but basically now they tried to follow more the standards for API's to do many things like they already provided in the past but now since there are standard API's to implement those things they are providing those API's, this is more or less common to other browsers. I don't know if you guys also tried IE 9 or have anything to comment on about it.
I don't know if anybody else has that experience, but maybe IE 9 will be good but that's still only going to help me in a small amount of cases.
Other than that, I don't know much about Safari because I'm not on the Mac and in spite there is a Windows version I'm not a Windows user, so I don't know much about its state.
And we can get rid of that dependency capturing audio and video, there is already a standard defining how that can be done using API's, but so far I did not see any good implementation on any browser. I noticed there are some patches but that's all that I could figure.
Lately there are quite a few interesting objects, and not as many as I would hope, also because this time we tried to record earlier in the month so it did not leave much time. But there are still a few objects that I think to be worth mentioning.
Would either of you guys like to comment on any objects that you have noticed, Brett or Michael?
Now, it's an interesting implementation from a code standpoint and it looks nice, it still strikes me that the majority of people that would need an on-screen keyboard are probably people on mobile devices, maybe using a Samsung Galaxy Tab or an iPhone or some other Android device which generally come with their own onscreen keyboards anyway, if it's an input field the device will know to put one on there.
So, from a practical standpoint I don't see many day-to-day uses for this personally, but I thought the code itself was pretty slick.
So if you want to use a key map, for instance if you want to type Chinese letters, you have a key map you can switch to it and obviously I'm not acquainted with Chinese.
I don't think it was anything built into Windows, it looked like it was sort of a custom control, but for stand alone, sort of stand alone kiosk mode apps where you don't necessarily have a physical touch screen, you don't want to buy the Elo touch, or whatever it's called to get the touch, this would be a good thing to put on there, so there you go, I thought of one.
I worked on an extension for Firefox called Unicode Input Tool Converter which lets you input, but it's not an on-screen keyboard and it's not in HTML, which would be I think really pretty handy, I think it could be useful for that kind of app where you can define your own key set too, it might be interesting.
So it's great we can use these API's but we still have to catch up all the older browsers. OK, any other objects?
He's also a regular contributor on the PHPClasses site. Kudos to him for continuing to contribute to JSClasses site, as you mentioned he contributed this class for emulating keyboards, but there are others also interesting.
The one that I would like to mention is this Content Slider object. What it does is not exactly new but the effect that it provides is the ability to slide content like you can see using many libraries like jQuery and others that provide animation effects.
And what I notice that is interesting is not only can slide the content but you can sort of drag the pages as if it was handling touch events of dragging some content on the page, and it can do it in any direction, right, left or vertically, whatever you want.
Well, basically these are the objects that I would like to comment more this time.
Upcoming articles in JSMag magazine (59:45)Manuel Lemos: Now moving toward the end of our podcast, Michael, I don't know if you already have ready your comments on the upcoming articles of your JSMag magazine.
So we've got a lot of server side stuff coming up in the next month, and potentially if Brett has time he may be doing another piece for us on PHP.JS for JsMag as well too. So that's kind of the JsMag plug, reach out to me, Michael at jsmag.com if you're interested in learning more about it, and thank you.
I would also like to extend that invitation, if any of you would like to write an article for the JSClasses site blog you are also welcome, and hopefully it will also help you to get more contributors.
If you're writing software already and you're good at what you do the English will come, or we have editors that help you work through phrasing and wording and they'll say here's a better way of saying that, you forgot this and so on, but just get your content out there and however don't worry if you make a spelling mistake or whatever, people can help you with that.
So don't let that hold you back from contributing to anything, don't let it hold you back in life, let's be broader about that. There's always someone out there like Brett who can help you learn English, right Brett?
Basically my feeling is that it's great to bridge cultural divides and try to improve relations between people. One of the issues that I found over here in China specifically was that people don't tend to know a lot about open standards, open source tools that might be able to help them.
On the other side because of that and kind of interrelated with this is people tend to disrespect intellectual property sometimes, although I know some guys for example, one guy here that refuses to watch anything that's been copied or do anything, you know, very principled, but in general I think if there's more awareness, then hey, there's stuff out there you can use legitimately and have self respect in developing code ourselves which is open, you can feel good about that, and also by learning these technologies we get a chance to open ourselves to new markets too because there are a lot of users who are not using free software.
So hopefully we're hoping that out of this comes more familiarity with these kinds of technologies. And I think it's kind of fun also to meet with local people, and we're going to be contributing with wiki for them to learn about, try to improve the awareness of these things so we can see for example China contributing a lot more to open source and we all benefit from it as they get into these things and of course it helps their own plans locally to be aware of more tools you can use.
So that's something I've been getting into and enjoying, but we want to kind of expand it and maybe branch off once we get more than a good number of people, so hopefully we can kind of get a self-sustained movement here and keep it going.
My limited experience was in Shanghai a few years ago, I went over and my role was that of a software auditor and I was reviewing code that was going into a cell phone, and they had done the initial draft they had used the initial engineers had just copied code right and left and their initial audit had caught a lot of stuff that legally they can't use.
And we found a couple of potential minor violations in terms of code linking and stuff like that which they shouldn't have been doing, or if they do they need to release code, but it was kind of surprising to me to learn, this was four years ago, how I guess cavalier the attitude was, and hopefully with efforts like yours you'll be doing more to let people know that you really shouldn't be copying that, but you can use this, and it would be great also if you contribute back, but some things BSD even if you don't, that's fine.
So good luck on that, it's good to hear that you're able to bring that sort of perspective and it sounds like a guiding hand in the right direction.
And the guys really bring a lot of energy to this, you know, when you just filter everything through the media you might get this impression that they're just trying to steal everything, but it's just kind of habits and when people, like you said, they see what's available they contribute back too.
The guys are enthusiastic, I think really pleased to get involved, they've made bug reports and got a lot of skills that we don't learn even in the U.S maybe in computer school, whether it's using Subversion version control, that kind of stuff that takes a little bit of time to learn in order to contribute or try to help each other with that kind of stuff.
What I saw though in China was that, at least the project that we were involved in, one code violation was going to mean that half a million devices or more were going to be infected or have that problem with them, whereas that sort of scale of violation doesn't often happen if somebody's just sitting building a bug tracker for their own office the violation is more theoretical than practical.
And when you've got a large company, which I will not name, that's going to be redistributing these things in the U.S. and Canada, anybody that wants to sue them for a violation there's very deep pockets involved.
So the potential for one small violation over there given the manufacturing-ness of China and where they reach from a global scale has a much bigger potential for harm. And that's something that I think a lot of in my experience a lot of Western developers in the U.S. anyway, most of what they're working on doesn't have that potential in the first place, maybe that's another reason why they don't care either.
Conclusion (1:15:22)Manuel Lemos: So basically we are all done with this episode, I would like to thank Brett for coming and taking the time to talk to us about PHP.JS project and also his insight and his opinions about other aspects, and I think that's all for now.
You need to be a registered user or login to post a comment
Login Immediately with your account on: