ObjectiveC for the internet


Functional and objected oriented programming both have their place in applications. Applications such as those found in Unix are typically best implemented in a functional style while almost anything which can be conceived as a complex relation of objects is usually constructed in terms of objects. What about internet applications: in what terms should they be conceived as?

As I dive deeper into ObjectiveC I can’t help to find it a remarkable language for internet applications. It offers both the functional capabilities for simple runtiness, object hierarchy which is part of almost all designs, and smalltalk like messaging. With the recent popularization of Javascript many extensions have been developed. Today Javascript supports both objects and functions, but what happened to messaging?

With the current usage of Ajax, messaging is a pivotal aspect of internet applications, yet none of the languages offer a simple and intuitive method for communicating in terms of messages. Both in the server and the client side have no language enabled for of communication leaving it up to the developers to find a suitable technique. This however not only leads to unneeded complexities but also numerous security and bug problems. A language which natively allowed for the sending and receiving of messages would be extremely beneficial.

Ruby thus far seems the closest to reaching this ideal. It does offer an RPC like framework which allows for easy implementation of server and client side scripts. Its solid backbone allows for the communication to be fairly secure and with enough checking to avoid trivial errors. However it has two primary faults. It requires a service to be running in ther server side which few servers have currently (ie. Ruby) and secondly it forces the usage of a language which has fewer support and extensions than other languages such as PHP and Perl.

Thus we are left with no solutions. A possible solution would be to implement a PHP/Javascript solution. PHP would be used for both the server side scripting and for the generation of the client side scripting. An internet application would be divided into three parts: presentation, server, and client. The presentation may be implemented in any language as long as the output is HTML in the end. The presentation is responsible for “connecting” the client and server parts together. Both the server and the client side would be implemented using a language similar to ObjectiveC. For example extending PHP much the same way ObjectiveC extends C. When a page from the internet application is called (from the presentation part) it would connect the server and client sides together. The connection process consists of building or loading from cache a PHP and Javascript program for the server and client parts (respectively). The connection would be, in the end, a converter that would convert a ObjectiveC/PHP script into either standard PHP or Javascript. The conversion would be responsible for picking up all inconsistencies between the server and client. It would also be in the advantageous position to add extra features such as compression, encryption, validation and etc.&…