The short answer to "Why Vely?" is performance and simplicity. What follows is a more qualified answer.
Vely was created to rapidly build server-side applications with maximum possible performance.
While different people have entirely different notions of what that means, here it means simple statements that generate efficient and safe C code.
Such statements are written directly in C code and they perform a function that traditional API does, except they are simpler, more powerful and safer. In short, a Vely program is C program with statement_APIs
that generate C.
So the goal is to skew on the side of statement APIs, because it is safer, functionally richer and quicker to build applications; and to write C only as needed.
And that can help with C's issues such as memory safety, being #1 such issue. Why? Because you'll get the best of C and skip the problematic part. What follows elaborates more on that.
Say you're using C mostly for variables and functions declarations, conditional and program flow statements, and for access to libraries. So pretty light stuff.
And you're using statement APIs for heavy lifting, say building strings, querying databases, outputting data, file manipulation, memory structures, program execution, encryption, encoding, JSON parsing, web stuff like cookies, input parameters, uploading and downloading files, request handling, daemonizing etc. - you get the picture, lots of stuff you need every day. Add to that the automatic memory allocation and garbage collector for statement APIs.
All of this is done with safety in mind, while pure C is more like "programming glue" that binds it together and provides a base for it.
This setup clearly isn't safe; because C can still be used in any way you like. But it is safer
, and if you do things the easy
way, meaning you use the statement APIs wherever possible, then it is much safer
. And the resource utilization is likely to be better than anything else.
So in a nutshell, Vely offers APIs in a form of easy to use statements. It generates C code for its statement_APIs
which are themselves written within C code.
Vely statements look nothing like C though, or for that matter like Java, PHP or many other popular languages. On one hand, they are simple. On the other, they are written inside C code so there is no need to learn anything new about the layer underneath; C is quite simple and well-known.
Most of Vely statements generate a number of C statements. Still, their scope is typically narrow and the generated code is shallow and direct, similar to what an experienced C programmer would write, incurring virtually no loss of performance. Vely's design omits the classic API look and feel on purpose and focuses on simplicity. The arguments are specified in any order by naming their purpose.
Perhaps Vely is not elegant, and that certainly wasn't the #1 goal, though it is arguably quite simple. It is more about practical, actual needs people have; it's about productivity, safety and performance. The idea is to not sacrifice performance at all, and to improve productivity and safety significantly.
Writing programs in C, if done properly, generally results in fastests and smallest programs, which is the reason why it's used in system and low-level programming. C is also the greenest programming language
When not done properly, C programs can cause memory issues with writing and reading out-of-bounds, which can be related to almost anything, such as memory allocation and usage, type conversion etc. and can manifest as safety issues and incorrect functioning.
Vely generates C underneath for several reasons. It is the shortest route to maximum performance and the smallest memory footprint. C is simple. It also allows usage of virtually any library in existence. And Vely statements are carefully crafted with the goal of generating fast and safe C code on their own and to provide memory garbage collection. Vely itself is written in C.
Vely's goal is not to write more C code, quite the opposite. By using Vely anywhere possible, C code can be used as a supporting mechanism for Vely statements, such as declaring variables, conditional statements, program flow and usage of external libraries. This drastically reduces the risk associated with C programming.
What it is, and what it isn't
Vely is not a language. It is a better way to API. Some may not like the idea of using C to begin with. But C is a great compromise: rapid and easy development on top of a simple programming base with improved safety and arguably the best performance.
This is especially true in the Cloud, where smaller and faster means less CPU seconds, less RAM, less money spent, less energy used and less emissions. And Moore's law
may or may not be failing, but it will take significantly more funding, time and expenditure of all kinds to keep it going, and at some point it may no longer.
In short, the goal of Vely is to lend the superior performance of C to general-purpose application development, and especially web applications. Regardless of what kind of hardware you run, or whatever kind of software you're designing, ultimately, performance matters.