If you’re into programming, I’d suggest you read this.
As a developer I’d love if I can write code that anybody can run, on their desktop (as opposed to trying to move it on to a browser so it can be truly cross platform), but let’s just stay away from the operating system in the browser paradigm. Let’s say I want to build an application which would run on windows, mac osx, and linux (and perhaps even bsd, etc). There are three major options I have
1. Write the code in java, and have it execute in a virtual machine. While java is nice, I’m not too fond of having my code run in a virtualized wrapper like format. Moreover, performance concerns, the Java Native Interface, etc do not make this the best choice for me.
2. Write code in a more simplified language like python, or ruby which has language bindings to major system so which allows me to run my code on most systems. This is nice, but there’s the performance concern, the obsfucation and moreover requiring the right version of python or ruby to be installed in the target machine.
3. Write code on C++ with the right cross platform libraries and compile. This is a confusing option because finding good cross platform libraries and learning to use all of them can be very complicated. But this does, however mean that my code will run natively, thus, much faster than the aforementioned options.
My idea deals mostly with number 3. I won’t beat around the bush and get to the point:
1. An easy to use suite of cross platform c++ tools, with open source wrappers to all of them, and are configurable to larger extents.
Here’s what this means. Suppose I needed to build an alarm clock, and wanted it to run natively on all platforms, I first write a “libcollection†file. This will be a list of all the libraries that I’ll be using for the project, and these are sort of dependencies. These might be gtk, wxwidgets, or qt for gui, opengl or SDL for graphics, openal or some other audio library for audio, one particular library for networking, etc, etc. These might also include other details as extra libraries, dlls, per-platform specification, etc.
ALSO, we will have native access to files, operating system, etc, through a vast object oriented library, who’s code will work on all object oriented systems.
The first benifit of this is that there’s a program that downloads the latest versions of all the libraries, and their dependencies, and create a project for an ide of your choice, ready to compile with any supported compiler.
Now the hassle of getting the right libraries is removed, which is only the beginning, as the best part, and an excruciatingly hard part is to write object oriented wrappers for all of these. So for example if I have:
(note this is just a concept and not anyway related to the final code)
File music_file(“asastor.mp3â€); // FILE: is a wrapper class
Audio_Decoder decoder(music_file); // An audio decoder
Audio_Output output; // to output audio
decoder.play_with(output); // set the output module.
decoder.playfrom(“1:00â€) //play from 1 minute timestamp
Now, you say, sure, there are libraries that can do things like this, even if you present an oversimplified audio, graphics, networking and filesystem interface, there are ways to do this, but the best caveat will be this:
Suppose you are writing code for linux. You’ve set your gui engine to gtk. So instead of writing code for gtk, you write it like this:
Window new(“My windowâ€);
Button click_me(“Click Me!â€);
new.Attach(click_me);
Now suppose some code like this would attach a button to a window. While porting code from gtk to another gui engine like qt is painful, it’ll be as simple as setting a simple variable in your library collection file. Of course, the functionality will be lesser than all libraries, as certain features are there in qt that’s not there in gtk but while we cannot hack our way to replicate features, we’ll have to allow ability to add features directly from the libraries themselves.
This would enable to write code once, and have it run almost flawlessly anywhere. Taking what we already know about building good cross platform libraries, and the great many advancements in compiler and build tools, and the power to run an application natively using the blistering fast power of computers, rather than running it on top of some other layer. Moreover, with so many open source libraries with some really cool stuff from computer vision, to artificial intelligence, etc, allowing developers to easily install and use these libraries would be a great first step before encapsulating them classes.
If compelling enough reason exists to build this and enough support, I plan to build this over the next few years.
Recent Comments