473,487 Members | 2,667 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Enhancements to PHP -- Polar

I like PHP a lot. It's my favorite programming language. That's not to
say that I'd like to see it grow more or for derivatives to come from
it. For me, the ideal programming language would be:

* Would take the name of Polar instead of PHP.

* Syntacticaly exactly like PHP, but would be much faster on string
handling and would swap "." for "->".

* Has all the same modules of PHP but would have extremely easy-to-use
Qt and GTK modules (a way to build cross-platform GUIs), have fast ways
to build ssh/telnet data entry or cash register apps for VT100 or VT220
terminals, have faster ways to build HTML tables, have cookie routines
that are encrypted (fast/slow, better modes), and has modules to allow
admins to rapidly build admin interfaces to various database reference
tables. The admin interface module, alone, would be a major time-saver.

* Mostly a scripting language, but a fake compiler could be provided
that would convert the script into a Linux ELF binary or EXE. However,
when you run the binary, it extracts the script to $TEMP (or %TEMP%)
(if not already extracted with same CRC stamp) and runs it in
interpreted mode from there. You still need the interpreter to be
installed before the binaries would work, which is forgivable. If you
try to run the binary without the interpreter, it would display a
friendly command-line message back suggesting that you "Google for the
interpreter".

* Various IDEs could be available for it, but it would have a slick,
VB6-like IDE where you can build Qt or GTK "forms" with various widgets
on them, doubleclick them to access their code, and then save as one
big script, optimized as much as possible.

* When run at command-line, it would NEVER spit out HTML on errors.
When you run "php -q program.php", if your program has an error, you're
going to get HTML back.

* No need for "-q" for command-line programs like you need with PHP.

* Would run indefinitely by DEFAULT, and not require "-d
max_execution_time=10000" to be added. Instead, if you wanted a timeout
restriction on the script, you'd have to add that into the script's
source code at the top.

* You can add new modules far easier without recompiling PHP and
Apache.

* Can be installed side-by-side other, earlier versions of Polar.

* Can be installed even if you don't have Apache, providing a way to
make GTK, Qt, or console-based apps.

* Can be installed easily on Linux, or retrieved easily with "apt".

Jul 17 '05 #1
14 1631
.oO(Google Mike)
I like PHP a lot. It's my favorite programming language. That's not to
say that I'd like to see it grow more or for derivatives to come from
it. For me, the ideal programming language would be:

* Would take the name of Polar instead of PHP.
Why Polar? Sounds somewhat ... cold. I don't like it.
* Syntacticaly exactly like PHP, but would be much faster on string
handling and would swap "." for "->".
And what would you use for string concatenation if '.' is taken for
property access/method calls? There's not much left.
* [...] have faster ways to build HTML tables, have cookie routines
that are encrypted (fast/slow, better modes), and has modules to allow
admins to rapidly build admin interfaces to various database reference
tables. The admin interface module, alone, would be a major time-saver.
You're free to extend the PHP standard library.
* Mostly a scripting language, but a fake compiler could be provided
that would convert the script into a Linux ELF binary or EXE.
Roadsend compiler exists.
However,
when you run the binary, it extracts the script to $TEMP (or %TEMP%)
(if not already extracted with same CRC stamp) and runs it in
interpreted mode from there. You still need the interpreter to be
installed before the binaries would work, which is forgivable.
Zend Optimizer/Accelerator?
* Various IDEs could be available for it, but it would have a slick,
VB6-like IDE where you can build Qt or GTK "forms" with various widgets
on them,
I prefer the Delphi IDE ... ;)
doubleclick them to access their code,
.... and the Delphi Object Inspector ...
and then save as one
big script, optimized as much as possible.
All code in one big file is really ugly.
* When run at command-line, it would NEVER spit out HTML on errors.
When you run "php -q program.php", if your program has an error, you're
going to get HTML back.
http://www.php.net/manual/en/ref.err...ni.html-errors
* No need for "-q" for command-line programs like you need with PHP.
alias php='php -q'
* Would run indefinitely by DEFAULT, and not require "-d
max_execution_time=10000" to be added. Instead, if you wanted a timeout
restriction on the script, you'd have to add that into the script's
source code at the top.
The timeout makes sense on a shared host. If you run your own server you
can disable it in the php.ini.
* You can add new modules far easier without recompiling PHP and
Apache.
Can be done, but depends on the module. Recompiling is not always
necessary.
* Can be installed side-by-side other, earlier versions of Polar.
Possible with PHP (at least with the CGI version).
* Can be installed even if you don't have Apache, providing a way to
make GTK, Qt, or console-based apps.

* Can be installed easily on Linux, or retrieved easily with "apt".


Getting PHP with apt works, and even compiling a new version is easy:

../configure ...
make
make install

That's it (it might require some additional library headers, which can
be easily fetched with apt).

Micha
Jul 17 '05 #2
Forgot something ...

.oO(Google Mike)
* Can be installed even if you don't have Apache, providing a way to
make GTK, Qt, or console-based apps.


Possible with PHP (CLI).

Micha
Jul 17 '05 #3
">>I like PHP a lot. It's my favorite programming language. That's not
to
say that I'd like to see it grow more or for derivatives to come from
it. For me, the ideal programming language would be: * Would take the name of Polar instead of PHP.
Michael Fesser Why Polar? Sounds somewhat ... cold. I don't like it." etc....


Michael F., I liked all of your constructive criticism. It also taught
me a few things I didn't know.

The name Polar was one of those things I spent time on during a few
long boring flights across the USA before I discovered PHP. I was
working for Avanade, and regretting that I did this, doing C#, and
wondering what it would be like to work in a world without Microsoft,
where things were free, where people shared some cool code snippets
without charging, where the atmosphere among programmers was friendlier
than the Microsoft environment I had to deal with. So I came up with a
language specification and didn't know what to name it because all the
other names are taken. I thought that Polar kind of had a math-ring to
it so it stuck. Then, I discovered that PHP had grown up since I had
last looked at it, and so my idea of the ideal business programming
language for me moved from C# and Java into PHP.

On the "." versus "->" issue, I think that string concatenation could
be done with other characters. Of course, I've seen a thread like that
before in the newsgroups. One says that "." should be "->" and then
others chime in and say what about string concat., and then a reply
comes back that string concat. could be done with "&", and then others
complain about the fact that this is already used for something else,
and on and on it goes. I don't want to go there. I just think that I'd
rather use "." instead of "->" and still use string concat with ".".
But then no one would be able to use my code but me, so that would be a
drag. It's great to dream, though.

Well, the dream bubble burst. I think I'll just stick with PHP. Didn't
know about the alias command or the Roadsend thing. I'll have to try
that.

As for Delphi, I have to maintain some apps for that at my day job
occasionally. It's frustrating for me with all the nested BEGIN/END
statements that are easily mismatched. The IDE is confusing to me.
Also, the fact that you can do nested functions inside functions is
also an oddity.

Jul 17 '05 #4
"Google Mike" <go********@hotpop.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I like PHP a lot. It's my favorite programming language. That's not to
say that I'd like to see it grow more or for derivatives to come from
it. For me, the ideal programming language would be:

* Would take the name of Polar instead of PHP.
I don't like "PHP" either. Sounds like some sort of drug. Polar...hmmm. I
kinda like it.
* Has all the same modules of PHP but would have extremely easy-to-use
Qt and GTK modules (a way to build cross-platform GUIs), have fast ways
to build ssh/telnet data entry or cash register apps for VT100 or VT220
terminals, have faster ways to build HTML tables, have cookie routines
that are encrypted (fast/slow, better modes), and has modules to allow
admins to rapidly build admin interfaces to various database reference
tables. The admin interface module, alone, would be a major time-saver.
I disagree with that. The strength of PHP has always been its focus on
server-side web development. Adding all these other components only creates
distraction.
* You can add new modules far easier without recompiling PHP and
Apache.
I can certainly agree with that. Writing a PHP module actually isn't that
hard. Getting PHP to compile, on Windows especially, is a pain in the ass.

Maybe adopting some sort of a component module like XPCOM would make things
easier.
* Can be installed side-by-side other, earlier versions of Polar.


Really trivial to implement. Exactly why it wasn't I have no idea.
Jul 17 '05 #5
.oO(Google Mike)
Didn't
know about the alias command
It's quite convenient from time to time to setup "shortcut" commands.
or the Roadsend thing.
It's a commercial PHP compiler, has nothing to do with Zend etc. It just
uses the grammar of PHP and compiles to native executables or libraries.

http://www.roadsend.com/
As for Delphi, I have to maintain some apps for that at my day job
occasionally. It's frustrating for me with all the nested BEGIN/END
statements that are easily mismatched.
The same may happen with {}, it's the same. The developer is responsible
for writing clean code.
The IDE is confusing to me.
Also, the fact that you can do nested functions inside functions is
also an oddity.


There's nothing special about them, it's just a scope issue. In other
languages (Java IIRC) you can nest classes inside classes etc. And there
are even people asking if PHP supports nested functions. ;)

Micha
Jul 17 '05 #6
"Google Mike" <go********@hotpop.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
As for Delphi, I have to maintain some apps for that at my day job
occasionally. It's frustrating for me with all the nested BEGIN/END
statements that are easily mismatched. The IDE is confusing to me.
Also, the fact that you can do nested functions inside functions is
also an oddity.


The use of begin/end is actually one thing I like about Delphi. By and
large, the community only uses one convention (begin and end on separate
lines). The curly brackets, on the other hand, are done in number of
different ways. I always get confused reading code where "else" follows the
preceding } without a linebreak. One of the reasons I hate PEAR...
Jul 17 '05 #7
.oO(Chung Leong)
The curly brackets, on the other hand, are done in number of
different ways.
There are only two, which are commonly used.
I always get confused reading code where "else" follows the
preceding } without a linebreak.


I prefer that. ;)

Micha
Jul 17 '05 #8
Google Mike wrote:
On the "." versus "->" issue, I think that string concatenation could
be done with other characters. Of course, I've seen a thread like that
before in the newsgroups. One says that "." should be "->" and then
others chime in and say what about string concat., and then a reply
comes back that string concat. could be done with "&", and then others
complain about the fact that this is already used for something else,
and on and on it goes. I don't want to go there. I just think that I'd
rather use "." instead of "->" and still use string concat with ".".
But then no one would be able to use my code but me, so that would be
a drag. It's great to dream, though.


I was thinking that no concatenation operator is really necessary. Imagine
that an ebsence of any operator meant concatenation, e.g.

$concatenatedString = $myVar ' here goes some text'
$then_some_other_variable "and then some $embeddedVar."

Berislav
Jul 17 '05 #9
Google Mike wrote:
I like PHP a lot. It's my favorite programming language. That's not to
say that I'd like to see it grow more or for derivatives to come from
it. For me, the ideal programming language would be:


<snip>

Have you tried Python?

Berislav
Jul 17 '05 #10
Chung Leong wrote:
"Google Mike" <go********@hotpop.com> wrote in message
* Would take the name of Polar instead of PHP.

I don't like "PHP" either. Sounds like some sort of drug.


That's a very old jokel

http://www.google.com/search?q=%22St...UTF-8&oe=UTF-8
http://bbspot.com/News/2000/6/php_suspend.html

That being said, there is the CLI (not CGI) version of PHP. Any number of
these can be installed.

kris@h3118:~> php -v
PHP 4.3.10 (cli) (built: Feb 28 2005 13:10:32)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
kris@h3118:~> php5 -v
PHP 5.1.0-dev (cli) (built: Feb 23 2005 10:59:22)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.1.0-dev, Copyright (c) 1998-2004 Zend Technologies

While CLI still does require <?php ?>-Syntax, it does not echo a CGI header
when being called

cookiekris@h3118:~> php5
<?php echo "cookie\n"; ?>
cookie

Also, error messages are no longer HTMLized in CLI:

kris@h3118:~> php5
<?php cookie

Parse error: syntax error, unexpected $end in - on line 2

Kristian

Jul 17 '05 #11
Berislav Lopac <be************@lopsica.com> wrote:
Have you tried Python?


Ya - tastes like chicken.
Jul 17 '05 #12
Thanks, Kristian.

Ah, so PHP5 doesn't emit HTML at CLI when an error occurs, but PHP 4
does. I'll keep that in mind when I'm ready to upgrade.

Jul 17 '05 #13
Google Mike wrote:
Ah, so PHP5 doesn't emit HTML at CLI when an error occurs, but PHP 4
does. I'll keep that in mind when I'm ready to upgrade.


$ php --version
PHP 4.3.10 (cli) (built: Jan 23 2005 21:23:17)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
$ php
<?php fatal_error_time(); ?>
^D
Fatal error: Call to undefined function: fatal_error_time() in
/Users/brion/- on line 1
Doesn't look like HTML to me.

-- brion vibber (brion @ pobox.com)
Jul 17 '05 #14
Berislav,

Yeah, I couldn't get PHP GTK to install, so I looked at how Red Hat
does their control panels. I found out that they do them in GTK and
Python. So I then made the 'pgst' tool with that. I'm not a fan of
Python, nor a good programmer in it, but at least I got it to work.

You can download this tool via apt or get it from here:

http://www.sourceforge.net/projects/pgst/

It permits one to have a GUI for interfacing with PostgreSQL. We use it
all the time in my day job because we prefer to do PHP/PostgreSQL apps
over PHP/MySQL. We're a fan of LAPP here, not LAMP.

Jul 17 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1453
by: aj | last post by:
DB2 WSE 8.1 FP5 Red Hat AS 2.1 I'm currently on 8.1 FP5 ("If it ain't broke, don't fix it.."). However, I'm looking at a change to the 2.6 kernel and an accompanying FP upgrade. It looks...
1
1555
by: imani_technology_spam | last post by:
We are running SQL Server 2000 in a 32-bit environment. Are there any performance enhancements included in the new Service Pack 4? If so, how do those enhancements compare to SQL Server 2005?
7
4812
by: Chung Leong | last post by:
For the past few months I've been working on a fork of PHP from the version 4 source code. I call the new dialect "Polar." It's different from PHP 5 in that it's a procedural-centric language. One...
4
6449
by: Joseph Geretz | last post by:
I'm trying to convert my DIME Web Service (WSE 2.0) to use MTOM (WSE 3.0). All the literature I'm reading specifies that I'll need to check both: Enable this project for Web Services Enhancements...
0
801
by: MASI | last post by:
Hi, in a polar graph if I define the position of the first label TOP or BOTTOM,the grid doesn't show. Is this a bug? e.g. dislin.polmod('top', 'clockwise') dislin.polar (1.,0., 0.2, 0.,...
3
2431
by: yadin | last post by:
hi! how can i do polar plot in python with negative axes that is the value of the magnitude is negative
0
1148
by: yadin | last post by:
hi every one can you please can you help me to fix these polar plot in db's so that the center is at the minimun negative number in voltagedb about and the maximun is at zero how can i see...
7
2359
by: schaefer.mp | last post by:
To compute the absolute value of a negative base raised to a fractional exponent such as: z = (-3)^4.5 you can compute the real and imaginary parts and then convert to the polar form to get...
3
5230
by: afrogazer | last post by:
I am creating a wind rose using a polar bar plot bu the points do not seem to align to the correct angles. Here is the sample code I am using. I can't seem to see anything in the API on how to set...
0
7106
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5442
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.