Re: Are PHP libraries linked dynamically or statically?



Henk verhoeven wrote:
NC wrote:
On Jul 20, 5:30 am, Martin Larsen <martin+spamfree+lar...@xxxxxxxxxxx>
wrote:
(..)

With PHP, the PHP interpreter is the functional analog of the word
processor (it is a program that processes user-submitted data); PHP
scripts, functionally, are documents (user-submitted data); an include/
require is akin to an instruction to include a subdocument into the
main document.

Anyway, in your opinion, does the mechanism rememble dynamic
or static linking most?

Neither. Static linking and dynamic linking are terms applicable only
to compiled languages; in case of an interpreted language, they are
only meaningful when applied to the interpreter, not to scripts it
parses.
>
Hi,

This may be true from a strict technical definition, but juridical reasoning may not be that strict. It is unlikely that the php interpreter will parse each line of code every time it interprets it. Most interpreters use some kind of intermediate code. As not everything is included at once, there will be a program in intermediate code being executed when a require_once occurs. Then the required code is parsed (maybe partially, but that is irrelevant) and the resulting intermediate code may be executed. If the included file holds functions the functions must be added to some sort of function lookup table so that the interpreter can find them and jump into them quickly whan a call is made. From a juridical point of view this adding to the lookup table can easily be seen as linking.


Actually, it does. Unless you have implemented a PHP optimizer, every PHP file is interpreted every time you load the file. There is no intermediate code.


Furtermore i believe te Free Software Foundation does not define 'linking' in strict compiler-linker terms. There is no problem if the interpreter is GPL: for the interpreter the interpreted program is then seen as data. But if your program is making calls to functions in a GPL-ed library...


Perhaps the FSF doesn't define "linking". But it has had a standard definition which has remained unchanged since I started programming - around 40 years ago. The FSF is not the last word in definitions!


"A consequence is that if you choose to use GPL'd Perl modules or Java classes in your program, you must release the program in a GPL-compatible way, regardless of the license used in the Perl or Java interpreter that the combined Perl or Java program will run on." See http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL

(The terms "use" and "release" may also not be what you think. Here it becomes really tricky, i rather avoid making comments on that)


Which has absolutely nothing to do with whether something is statically or dynamically linked.


BTW, running a program that is using a GPL-ed library on your own public website might have consequences with the new version of GPL (gpl3), see http://www.gnu.org/licenses/gpl-faq.html#UnreleasedMods


Again, nothing to do with the current discussion.

Does anybody know if that 'wording' made it to the final release?

Greetings,

Henk Verhoeven,
www.phpPeanuts.org.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: Are PHP libraries linked dynamically or statically?
    ... The PHP interpreter itself is executable. ... PHP scripts are just interpreted by the executable. ... The interpreter may statically or dynamically link to other libraries; like other executables, statically linked libraries are handled at compile time and become part of the executable. ...
    (comp.lang.php)
  • Re: PHP in html
    ... additional calls to the server, ... to invoke a script handler for every single image. ... configuration of the webserver and the PHP interpreter. ... If you think interpreting all pages as PHP ...
    (comp.lang.php)
  • Re: Which Is The Better Approach To Working With Javascript?
    ... interface with a script interpreter. ... A server, or a server-associated process, can start a script host, passing ... However this is achieved, PHP has no script interface, based ...
    (comp.lang.php)
  • Re: Are PHP libraries linked dynamically or statically?
    ... processor (it is a program that processes user-submitted data); ... scripts, functionally, are documents; ... It is unlikely that the php interpreter will parse each line of code every time it interprets it. ...
    (comp.lang.php)
  • Re: PHP on XP Setup HELP
    ... I am not running any kind of server from my house and just ... But when I rung the simplest of php ... you downloaded) must include an interpreter. ... the web server must pass on requests for your scripts to a PHP ...
    (comp.lang.php)