An alternative way to build desktop applications
Beesnest is an open source experiment, creating a simple but smart framework,
that will let us use web-application technology in order to build desktop
All the required technology is already here, we just need to put it all
- The concept of web applications is great. What if we can take the
"web" out, but leave the concept intact. That is, using this programming
paradigm to create desktop applications?
- The web browser that all of us have on our computer is
an excellent user interface, we are using it all the time. What if we can use it
for all of our programs, or at least most of them?
- High level scripting languages are becoming stronger and stronger. How can we do
more with these technologies on our desktop?
- At the same time we definitely don't want to give up the power of compiled
So why do we need a new framework, when we have Java EE or .NET web technology?
I'm not sure why, but the fact is that the concept of desktop web
applications didn't catch using these frameworks, and in my view, not
because it is a bad concept.
Java EE and Microsoft .NET (and all the new Python frameworks) are excellent to
build enterprise level web applications. With a slight modification it could be
all we need.
Here are the main features of Beesnest
- Beesnest has a built-in login system
The entire concept of a session in Beesnest depends on the login of a user.
It is not so much for security as for identification. After the user is logged in,
she/he has all the benefits of Beesnest saved modules and interpreters.
There is no idle-login time out. A user can stay logged in for a week, and everything
he loaded will wait for the user in memory.
- Beesnest can work with any compiled language (C++, Java, C#)
Modules are like Enterprise Java Beans. They have a Read/Write
interface and can execute any kind of logic. Like Java Beans these modules can
stay loaded for an unlimited period of time, and an unlimited number of requests.
Unlike Java Beans, these modules can be written in any language*.
I call these modules Adapters. It might not be the perfect term, but it
is for historic reason.
A module is always per-user. A user doesn't have to be logged in in order to
load a module, but has to be logged in in order to store one. Some modules can
be loaded for only one user at a time, others can have multiple instances
* I'm still not sure how to execute these modules. As for now they are DLLs that
Beesnest loads, and can only be C++ modules.
I'm pretty sure these modules have to run in a separate process. That is to
prevent one broken module from crashing the entire framework. Running these
modules in a separate process will really let me use any kind of language
(even scripting languages). On the other hand, it might create an unnecessary
load on the computer, and create problems loading more than one instance from
the same module.
The answer is probably to create a separate process container, that will load
these modules as dynamic libraries. However this feature is not completed.
- Beesnest can work with any scripting language (Python, Perl, Ruby, PHP)
Beesnest can load an interpreter for any scripting language, given the proper
Script Engine. Then the script is executed inside Beesnest.
Beesnest can work with more then one scripting language at the same time, even
on the same page. Moreover, different scripts can pass data to each other.
Unlike with ASP, JSP and PHP pages, the <% switch back %> between HTML
and script is restricted (and I might eliminate it all together). A script page is
where the logic is executed, an HTML page is where the view is generated.
The concept of CGI was dropped entirely. Scripts are executed inside the
Beesnest server process.
- Beesnest can keep a script interpreter loaded in memory
Since Beesnest is designed to serve one or very few clients, it can keep the
entire script interpreter in the memory for a logged in user. That takes the
concept of session to a new level. All the data and code
definitions that exists in one request will exist in any other request (until
you drop the interpreter).
That means the same script can be executed over several pages. When the
request for the next page arrives, the script will continue to execute from the
place it was when the previous page was done. The only change will be a different
So now we can design our software as an event driven application, every
request for a page is an event, but the software itself is running for the
entire life of the application.
- Beesnest has a dedicated scripting language for HTML rendering
In order to create the separation between logic and view, Beesnest will work
with a new simple scripting language called BZB, while the already processed
data will arrive from stronger scripting languages and/or adapters.
The only place where HTML code will be "allowed" is inside a BZB script, whose
sole purpose is to generate the user view. BZB is specially designed
for an easy text rendering, but is pretty useless for any other serious
ASP.NET serves the same purpose, but it uses XML format, and has a strong
binding between XML tags and their data. BZB has a sequential structure, like a
regular script, and all the data comes as strings (or buffers).
Of course, this entire concept is optional. One can generate the HTML using
any scripting language. But what I'm trying to prevent is the spaghetti
code syndrome that is so common in web applications.
- Beesnest is small and simple
As I said, all the components we need in order to create a "web like" desktop
application already exists, and all of them are excellent. The only missing
part is to put all of it together. Like with enterprise web applications, we
need some kind of a framework for a personal computer.
Beesnest is a small but smart Personal Application Server, it should
allow all these technologies to work together.
At the moment Beesnest is less than 1M software, it is very simple to configure,
and no installation is needed. It is specially designed so different software
manufactures can install their web applications over the Beesnest
One small server for all the "web" applications that will run on your
computer. Did I mention that, in my opinion, in the near future, most of the
applications that will run on a home computer will be "web" applications?
* More work is needed on the automatic installation of these applications over
Read my basic F.A.Q., what is
there left To-Do, and some
other thoughts about
Beesnest and web applications.
Not everything that was mentioned here has been implemented. There is
still a lot of work to be done, but the basic features are working – a server
that works with Python as well as C++ modules, with a built-in login system,
stores the Python interpreter and the modules in memory (for a logged in user),
and serves web applications.
Beesnest is an Open Source Code project, it is written in C++, for now it is
working just under Windows (but I will port it to Linux). I am working on this
project in my spare time.
If you have any comments please contact me.