CJS Framework – Abandoned

author
5 minutes, 57 seconds Read

The project is marked as abandoned because:

  • The name CJS Framework was already used in the context of other frameworks, I don't like it anymore and it doesn't mirror the current purpose of the framework
  • I don't have time and resources to achieve the ambitious requirements that I decided in the past (supporting interchangable classes between four languages and make it a standard is too expensive. I cannot open an open source project because it is not convenient for my current job, too much implications)
  • The framework evolved into different directions. I changed the name to TM Framework (TextureMind Framework) that is a useful collection of classes to develop my own programs in C++ or C# when the projects will be so complicated to require it. Being a framework slave in never a good thing for the developers, I saw developers becoming incapable of doing the simplest things in C starting from scratch, when they were anchored on Qt, Boost, Unity, Unreal Engine 4 or their own frameworks. I saw also good programmers becoming incapable of doing good plain programming (not even a pacman game) without projecting frameworks that would require years to be finished, so I don't want to feed this trend.

After a long research for the perfect crossplatfrom multitarget language i didn't find anything that satified my expectations. I wanted to create c++, c#, java and javascript projects around a set of basic classes, functionalities and serialization to import/export files in a custom format.

In a first evaluation, Haxe language with json seemed to be the perfect choise, but after using it i realized that the code produced for the languages of my interest is too heavy, bad indented and hard to reuse in the context of a specific project. That's because Haxe and the other multitarget languages are studied to produce a final result (i.e. a game) and not a source code that is easy to understand for the human reader or to include in other part of a wide project. For instance, if i create an Hello world example with haxe and convert it to c#, it will generates alot of useless .cs files in a well structured (and unreadable) project that you can build and run at first attempt, but that is barely readable and hard to reuse into other clean c# projects. If you are thinking of creating a library in haxe to include the source code into your projects, it's better if you change idea: the final result of your cpp, c#, java or javascript projects may end to a gigantic mess.

For this reason, I decided to create from scratch a new framework that is called CJS Framework, which stands for CppJavaScriptSharp Framework. It's mainly a full bridge between these four languages (but it's not improbable that it will support other languages in the future). The basic idea is very simple: make a set of classes that are useful in a project and a serialization system that easly load objects regardless of the used language. For instance, we can decide to take advantage of the .NET framework and produce an editor in C# to manipulate the maps of a game that will be programmed in javascript and it will run on facebook or the web browser. Or a server application in c++ that communicates in a binary format with a client application for html5 coded in javascript. The framework is projected to satify easly all these tasks and much more.

1 Basic Principles of the implementation

1.1 Introduction

The basic principle is to support features on languages avoiding the reinvention of the wheel if it's not necessary. For example, on c++ there will be a basic framework that will handle strings and objects, meanwhile on c# that part is skipped because it is already implemented on the native language. The most important thing is to have a set of classes that will facilitate the exchange of data. This data could be formatted into xml/json to be readable or modifiable by human beings, or binary like google protofub to be interchangable or raw to be light and optimized in terms of bandwidth at the expense of interchangeability. For example, immagine to serialize million of opengl calls from a client to a server, you cannot do it in xml, json and neither in protobuf also if it's a binary format, the best way for doing it is in raw format. But also if you have to handle a simple raw format, a framework is still necessary to handle 'obscure' stuff like the endiannes, multithreading, synchronization issues or the queue. If you decide to reprogram everything everytime you need it, you risk to injure your mental wellness with never ending session of debugging.

For these and other reasons, I decided to program a crossplatform multitarget language framework from scratch. It's not an easy task to do, but it's useful for my personal interest and maybe a great starting point for the birth of a new language. Anyway you must not think about it like the umpteenth framework on the market but much more like a programming phylosophy: make it easy, make it portable, make it readable anywhere. After 20 years of programming experience, i didn't find anything satisfactory from this point of view. I'm not trying to make the difference, to make viewers or to take attention, i'm finding the best way to code a project without GB of already existing frameworks with tons of redundant code. I really hope to succeed this time.

1.2 The minimal framework for c++

At first glance I was convinced that Poco Foundation libraries were the right choise to guarantee a minimal framework for the c++ base of the cjs framework. Studying the poco foundation project and taking a look at its internal architecture, i found it too broad (the full compilation of the library may take a gigabyte!). Moreover, the idea to have an heavy dependency to include into the framework does not thrill me a lot. The other alternatives were boost, qt, apache, but they were too heavy to be a part of a minimal and lightweight part of the framework. The final decision was the hardest one: code everything from scratch, without external dependencies. Also if this decision could be painful at a first time, in my opinion it is the best to avoid gigabytes of external dependencies and huge executable files, if the project is programmed in c++. Thanks to this important decision, the c++ part of the cjs framework will be lightweight, easy to build and transport. Anyway, if you are looking for advanced features, you can include poco foundation, qt or boost though.

The c++ framework is based on standard template library, so part of the classes (like strings, vectors, lists, maps) will be implemented starting from it. I decided to not use C++0x, C++11 or C++13 because it could restrict the range of portability of the framework, the readability of the code, the uselessness of the context and finally because I really don't like it. So old classic C++ and that's it, you don't need anything else.


 

Gianpaolo Ingegneri
Copyright @ 2015 - All right reserved

Similar Posts

Leave a Reply

X