WinBinder.org The native windows binding for php

Why WinBinder?

As an experienced C programmer for Windows, I enjoy the power and flexibility of the C language. However, C is just not right for the quick development of tools or database applications. Building user interfaces in C and making them interact under Windows is a very time-consuming process. So I started looking for alternatives.

My "ideal" environment should meet the following requirements:

  • Interpreted. A scripting language requires no compilation: Just code and run.
  • Native. Applications must use the native Windows classes and controls. The average Windows user will not be comfortable with anything else. Since I am only interested in Windows applications, portability between platforms in not a concern.
  • Simple. It must be easy to learn and use, with no variable and function declarations, simple string operations, a flexible data structure and other similar requirements.
  • C-like. The language must be familiar to a C programmer like myself.
  • Simple. The language must be simple to use and popular enough so that it is easy to find programmers to work with.
  • Procedural. A language that is not necessarily object-oriented allows the programmer to choose between both programming models.
  • Lightweight. Relatively small runtime library, easy installation and fast program execution.
  • Database-friendly. Must work seamlessly with the most popular SQL databases.
  • Inexpensive. Less than US$50, preferably open source with a BSD- or MIT-like license.

I found out quite a few excellent scripting languages and environments. The most interesting ones are on the following table. I actually examined more than 20 others, including some very curious language/library combinations, but I have selected here only the most promising ones. This is by no means an extensive evaluation. Feel free to comment or criticize it.

Language / env.

Euphoria + Win32lib

wxLua

wxPython

PHP-GTK

Tcl/Tk

Windows-likeness

Native (with omissions)

Native

Native

Look maybe, but no feel

Look, but no feel

Easy to work with

Yes, but must declare all variables

Yes

Maybe, once you master the language

Probably not

Maybe

C-like

No; BASIC-like

No; BASIC-like

Not at all

Yes

A little bit

Popular

No, but easy to learn

More and more

Yes

Yes, very

Yes

Procedural/OO

Procedural only

Procedural only

OO only

OO only

OO only

Weight, speed

Lightweight, fast

Acceptable, fast

Acceptable

Acceptable

A bit bulky

Database support

Uses its own non-standard database system

Yes

Yes

Extensive

Extensive

License

Various¹

Open source (MIT)

Open source (GPL/LGPL)

Open source (LGPL)

Open source (BSD-style)

Comments

Euphoria deserved some serious consideration because it is very well-implemented, but it is too BASIC-like; all variables must be declared. Also for Linux.

Lua + wxWidgets. Lua is an amazing extensible language from fellow Brazilian Roberto Ierusalimschy and others.

Python + wxWidgets. A true standard, but language is too odd for a C programmer.

PHP-GTK for Windows is a remarkable achievement and inherently multi-platform. However its interface does not feel like Windows at all, even with a XP-like theme.

This is another port of a popular Linux language/environment. The language is a bit odd for a C programmer.

¹ The Euphoria interpreter is free, but extra packages range from US$ 39 to US$ 79.

As you can see, although there are a lot of high-quality platforms on this table, none of them actually met all the requirements. So I decided to investigate the possibility of creating a new binding for PHP. Why PHP? This language is a natural choice because it is so easy to learn and use, it is C-like, has a wealth of useful functions and extensions, and works great with almost all databases known to mankind. The idea of binding wxWidgets to PHP was tempting, but this was not an easy task and wxWidgets is a bit on the heavy side. Some other people have thought about this before, but they have not completed their work as far as I know (this might mean something).

So I started to design and develop a system that would meet these requirements. I called it WinBinder.

 

See also

Overview | Examples