AnonymousNamefag

A brief description of the CABS interface

Jun 30th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. CABS is short for "C ABStraction". It is an abstraction layer between PHP scripts and executables written in C/C++. CABS provides a set of PHP functions that allow PHP programmers to easily run C programs from PHP scripts. It also provides a C back-end that allows C programmers to write their programs in such a way that they can be used by PHP programmers through the CABS interface. CABS takes advantage of the proc_open() facility in PHP to spawn an instance of a C/C++ program and then sends data structures in a serialized form between the PHP script and the C program through pipes. Basically, the user creates an instance of one of four predefined classes to encapsulate the data they want the C program to operate on, then serializes the data structure and sends it to the C program, which performs the computations on the data and then sends the result back to the PHP script in a serialized form. CABS provides functions for serializing and deserializing the data structures, as well as a simple serialization format that delimits structure using ASCII control characters.
  2.  
  3. The purpose of CABS is to allow web back-end programmers using PHP to offload more computationally intensive algorithms to a C program so that they can be computed more efficiently. It is built with highly complex machine learning and big data applications in mind. The idea is to make this AI and data science functionality, which is currently only available to Python programmers, available to other languages as well. My reasoning was that since libraries like TensorFlow are written in C/C++, there is really no good reason why Python should be the de facto language for data science and machine learning, given that those algorithms aren't even implemented in Python in the first place. There is no reason those functionalities shouldn't also be available to other languages such as PHP, Ruby, etc. Part of the idea of CABS is to make it easy to retrofit C/C++ programs so that they can be run from PHP scripts using CABS. Once I have gotten the CABS interface to a working state, I plan to retrofit the entire TensorFlow library for CABS so that it can be used in PHP. A possible future project would be to write a version of CABS for Ruby and possibly other languages as well.
  4.  
  5. So far I have implemented a large chunk of the PHP portion of CABS, enough to serialize, deserialize, and process array structures. My next step will be to write the C portion. I will be using my Pastebin as sort of a log of my progress, until I get CABS to a working state, at which point I will make a Github account (I don't have one yet) and move the project there.
Add Comment
Please, Sign In to add comment