Since the goal of Vulkan is to be closer to the metal compared to other graphics and compute APIs along with its proposed and upcoming features such as Machine Learning, A.I., Exposing Matrix Multiplication, Ray Tracing, etc., and due to how powerful and versatile it is utilizing multi-core processors and modern GPUs; I was thinking instead of having Vulkan just as an API for some choice named progamming language such as C/C++, C#, Java, Python, etc. that one would write their Vulkan application in; would it be feasible to create a Shell, Console, or Terminal type of application designed at the Kernel level that has its own built in real time Compiler, Linker, and Debugger where Vulkan is at the core of its programming language?
For example if you want to create a VK_KHR_Surface
all they would have to do within the shell is type something like: Surface mySurface;
and they would have an instance of a VkSurface
object, then they can access all of its fields via mySurface.someField = someValue, someFlag or somePointer
to some other data structure.
What I’m trying to get at here is that every structure, function call, enumeration and constant within the Vulkan API would be built into the shell’s core language and would be readily available for the user. It would also be considered an intuitive and interactive shell so that when one declares a Vulkan Info
or Create
type structure they would have a declared and ready variable of that Vulkan type.
Then once they access one of its members such as *.sType
and after they enter an =
sign after that type’s member the shell would be smart enough to fill in the appropriate enumerated typed for them! As for other fields that have to be populated with values, flags, data structures, etc., such as setting flags, it would give you a scrolled list of the most commonly used flags that are acceptable for that member type.
I believe this would decrease and improve on development time. I’m not suggesting to revert back to OpenGL’s style of hand holding with all the driver signing and checking; I’m only suggesting that the capabilities of the shell would be smart enough to recognize which enumerations belong to said structures and or their members.
The shell would be a customize-able dual window while having the capabilities of having multiple tabs. The idea of of this would be to provide say on the left hand side, your command prompt - text editor while on the right hand side, having on the fly compiler-debugging errors and warnings with suggestions to proper fixes.
The shell could also have interactive controls for independent compiling, linking and debug where one could almost literally modify their code as it is running within its context window. Another possible feature would be to have a built in Rendering Canvas that is separate from the programming interface. This would also render complete objects on the fly once one has the proper amount of code base to draw something tangible.
One should easily be able to write any arbitrary text file for shaders, csv, json, etc. to easily be able to create scripts, batch files and piped type sub programs while having the ability to load them in to their Vulkan program similar to that of Bash, Python, Windows Power Shell, etc.
Another useful built in feature for the shell or terminal would be to compile any acceptable shader language and convert it directly to Spir V either in the shell directly or within the source code. They could for example have something like: use glslangValidator convert shader.vert to shader.spv
and it will convert and validate that shader either from the shell directly or within the compiled code. Then they could load that Spir V file on their next available line of code.
Another feature that would be interesting to see is something similar to that of Visual Studio’s Solution Explorer in that it would contain a tree hierarchy of every available Vulkan API call from all of its Structures, Enumerated Types, Constants and Function Calls. It would also populate all possible extensions; however because this shell is intuitive it would grey out extensions that are not supported by the currently installed hardware. What I mean by this is when a user has this shell installed along with the most recent updated version of Vulkan, it will automatically query for the supported physical devices and extensions for that platform and architecture! The shell acquires this information when it is executed or invoked to run on that system. This is a built in feature so that one doesn’t have to worry about creating a Physical device, the shell itself has a privately hidden global physical device that is publicly accessible within the shell-compiler. All of the other extensions would still be in the list and available to use in order to write ported code for other machines but they would not be able to be executed on the current machine unless if some kind of integrated virtual environment is available to enabled one to do so. The tree hierarchy would also give you a brief description of the Vulkan object along with its common uses and a directly hyper link to the specifications and documents page!
If something like this is achievable then one who becomes extremely familiar with Vulkan wouldn’t have to program it in some other language to make an application, they can make a Pure Vulkan Application from a Vulkan Terminal or Shell where Vulkan itself is at the core of the shell’s language. Of course there would still be a general need for basic programming idioms and abstractions such as structs, classes, pointers, arithmetic and logical operations, function calling, namespaces, macros, and possibly even a template system with lambdas and other core concepts that are vital to languages such as C++ including strongly typed data types and to have the ability to have built in threads. I also think it would be beneficial to also fully support the STL, and GLM and to easily import GLFW, SDL
and other APIs without having to link them in manually. I think this would be an interesting thing to see.
Some other things that would be beneficial would consist of having the Vulkan Terminal to easily import or integrate different higher level languages’ compilers, so that one could quickly write C++ blocks, C blocks, Python blocks, C# blocks, and even ASM blocks directly into the shell or in their code. Here the Vulkan Terminal would just end up passing your specified language block to the native compiler or interpreter that is installed on your system and it would invoke them to do their job, then after they are done with their tasks, the Vulkan Shell would then be able to take that binary code and either convert it into equivalent Vulkan code or use the binaries directly depending on the user’s and code’s intended use.
Instead of just having Vulkan as programming library or API, how about turning it into its own close to the metal programming language! A language that would have the raw power of ASM, the capabilities and flexibility of C/C++ with the ease of Python while having the ability to integrate any other programming language by invoking their compiler’s or interpreters as long as they are installed on that system.
I believe that this would be a very powerful and versatile programming environment centered completely around Vulkan. Who knows; if something like this came about, then some could take advantage of this and even have the ability to nearly design an Operating System centered around and based directly on Vulkan and its capabilities.
Turning concepts like these into something tangible is how we progress into the future!