Since I’ve blogged a few times about its performance, several people have asked: What is SXE?
What is SXE? In a nutshell, SXE is an easy way to build robust & scalable network programs without comprising run-time performance or memory usage.
How does SXE achieve this?
1. By providing a software development environment for the fastest language, C, where rapid development (not traditionally associated with the C language) can occur.
How does the environment enable rapid development?
a. Traditionally tedious to create and maintain header files and makefiles are generated automatically meaning that the developer need only concentrate on creating .c files. Creating a new library is as easy as creating a new folder with a new .c file.
b. Release, debug, and code coverage builds happen automatically. SXE itself is developed using the same mechanism and is protected by 99.9% code coverage. This means SXE is rock solid code and programs developed using the environment will also be rock solid. This means bugs are always minimal and the latest github version is always a release candidate.
c. The necessity of using a traditional debugger to slowly single step through code has been eliminated by the use of extensive code instrumentation techniques which also double as an efficient code comprehension mechanism.
d. Although not forbidden the traditional use of pointers in C is strongly discouraged — for reasons of reducing complexity — and alternative mechanisms are provided to achieve similar results using simple, human-friendly, and easy to debug integers.
2. By providing a generic layer of network handling code on top of the cross-platform and asynchronous libev. Want to create an HTTP- / SMTP- / DNS- / whatever- server? The common network handling code has already been created for you. All you have to do is write some simple handlers for network connect, read, and close events.
3. By providing powerful and generic data structures to maintain state and chronological information even in a multi-threaded environment. It’s a bit like having an ultra powerful NoSQL solution right inside your program. For example, you have one million peers connected and want to know who has been in the read state the longest? The generic data structure will tell you. Want to know which is the second longest? The data structure will tell you. Want to multiplex between the one million peers and another limited resource? Just use two data structures and request the oldest member in state ‘waiting for resource’ when any member of the other data structure becomes state ‘resource free’. Memory leaks (a traditional problem with C programs) are completely eliminated by using fixed memory structures which effectively mirror the maximum capacity of the server hardware they are running on. The effects of DDOS attacks become a thing of the past because programs are engineered to use a fixed amount of memory and therefore even in an attack the server will never ‘go into SWAP’ or become unstable; as soon as the attack ends then regular functionality resume immediately.
In this way it’s possible to rapidly create robust & scalable network programs with surprisingly few lines of code and without compromising run-time performance or memory usage.