Wondering how does a language that indirectly compiles to languages of existing systems or software receive proper type hints, autocompletion, diagnostics, and syntax highlighting for customized file extensions (such as XML components). I am aware of Language Server Protocol which is supported by most editors, but I am not sure it is capable of handling languages where the compiler used and where certain additional file extensions are up to the implementation (the platform)?
Multi-compiler language: a language that targets multiple languages behind a platform, where the platform is a software that allows for scripting, such as Node.js, or Unreal Engine. You may think of it like a "Haxe" language that targets other languages, but instead of calling them languages I call them platforms, because the final languages have varying applications.
There is no single compiler to use, although I've a single programming language, whose semantics and implementation may vary a bit according to the developer's project.
Dependency manager
I have only planned (not finished) a scripting toolset that consists of an unique programming language, and a dependency manager (or package manager). These parts of the toolset overlap with each other.
In that dependency manager, package manifests would describe a package that belongs exclusively to one platform. The package registry available to that package varies according to that platform, meaning that platforms do not conflict.
Platforms describe which compiler subset of the same programming language to use, which will handle additional file extensions other than that of the programming language, such as user interface components described in XML files, and also determine how the package is run when using an execution command.
Example manifest:
{
"id": "com.n1.n2",
"version": "0.1.0",
"platform": "http://www.nodejs.org/2009",
"compilerOptions": {
"sources": ["src"]
}
}
Here, the platform property is an URI identifying the platform. In my design, platforms would be explicitly installed through a command. Platform URIs beginning with file: would locate a platform in the host file system without the need to install it.
For example, there could be the Node.js platform, or the Unreal Engine platform. The semantics and available APIs would vary according to the platform, including interpretation of certain, if not all, meta-data (meta-data are plain attributes attached to definitions).
Another thing complicating things a little more is that I had the idea of describing package scripts such as the build script as actual nested packages instead of using development dependencies. I am not sure if this is possible.
Compilers
Compilers would be implemented as subsets of the single compiler of the language. Here is a compilation cycle taken from my project:
I only suppose it is possible to do this. The major work for implementing a compiler subset is solely the bytecode ⇒ artifacts step (that is, usually transpilation from the unique bytecode to a code in another form) and handling customized file extensions such as user interface components in XML.
The Haxe language might have something in familiar with this, but one difference is that a library in Haxe may support more than one target (for example, a Haxe library may be designed to target either C++, SWF, or Lua). In my case, the packages available in the registry vary according to the manifest's assigned platform.
