 

 

Hol X - an XML-based extensible programming language

Status of this document

This document describes an idea of XML-based imperative object-oriented programming language. This is not a documentation. This is description of an idea. Sumartization of my ideas what the language should does and how. Currently I'm likely to start some works on Hol X, but there is no guarantee that the language will be created. Feel free to let me know if you like such language to be created, or even if you like to be one oc authors.

Last update 17 November 2007 00:51+01:00

The purpose

Hol X will be XML-based extensible object-oriented procedural programming language for .NET. The language will basically support all the constructs defined by CIL/CLI. There will be a module for low-level programming like in CIL as well as high level programming comparable to other .NET languages. There will be direct support for CodeDOM. Pure-tree programming will require to create all expressions as XML trees like this for x = 7 + 8 * 2:

        <variable name="x"/>

This is very efficient for parsing to CodeDOM, for generated code etc. But this is not very useful for typing code by humans. So, there will be another module for short expressions:

<statement>x = 7 + 8 * 2</statement>

There will be also options to combine both syntaxes:

<assign><to><variable name="x"/></to><expression>7 + 8 * 2</expression>

Then, in the future, there will be also modules for direct support of XPath, XSLT and other XML-based technologies. Finally - the language will be extensible. So, anyone will be allowed to create own module - set of rules how to transform some XML code to another XML code understand by some of Hol ghunwI' X core modules.

Feature list

Compiler as XSLT style sheet

Yes - the Hol X compiler will be XSLT style sheet defining how to translate XML document to CLI instructions. Or how to translate it into another XML document that will be then translated using another stylesheet.

Hol ghunwI' X compilation process

What Hol X is not?

Hol X is not primary intended to be a declarative programming language (or more descriptive than programming language) like eg. XAML or SQL. It is intended to be object-oriented procedural programming language such as C# or Visual Basic are. However because it is extensible there can be easily added support for some declarative constructs - like Data Sets, Resources, or even XAML. There will be support for LINQ that is somewhat declarative.

Intended core modules

Hol ghunwI' X ("Programming Language X")
Whole programming language
SoSbor'a' ("Main core")
1:1 support for CLI/CIL. One XML element per CLI instruction/directive/metadata block
ghojmoHwI' ("Instruction")
1:1 support for CLI/CIL instructions and some method-level metadata.
Hommey ("Bones")
1:1 support for CLI/CIL metadata such as assemblies, classes, methods, properties, ...
lojmIt ("Gate")
Support for Microsoft specific extensions of CLI/CIL. Metadata- as well as instruction-level.
ngeD ("Easy")
Simplifications for writing CLI instructions - complex instructions that translates to elementary ones.
tIgh ("Custom")
Specific low level thing. It will allow to decorate method with CustomCompilerAttribute. The will cause the attribute to provide CIL code for place where method is called instead of calling method.
Sor ("Tree")
1:1 support for .NET CodeDOM. Many other parts of language will be based on Sor.
nap ("Simple")
Simplification of tree-styled programming. Support for in-line expressions and statements.
chelwI' ("Addition")
Useful extension to CodeDOM like modules, static variables, simple events etc.
Gre'thor ("Hell")
"Strange" extensions to CodeDOM like custom delegates, custom accessors for properties and events etc.
qach ("Building")
Build-in support for MS Build
chIjwI' ("Navigator")
Build-in support for XPath
mughwI' ("Translator")
Built-in support for XSLT
ynqH (stands for yu' ngaSlu'pu' HolDaq; "Question Integrated into Language")
LINQ support

3-levels of language

Level Description Sub-level Description Modules covering this level
Level 1
Qut ("vulgar")
  • Pure CLI instructions and metadata with some helpers.
  • Metadata and instruction (objects and code) are strictly split.
  • Has direct or near-direct translatin to CIL metadata and instructions.
  • XSLT used for compiling is "strange" and uses Reflection.Emit.
  • Normal users usually don't use this.
0.9 Strange low-level things. Not written in XML (XSLT). tIgh
1.0 Direct translation to CIL, 1:1 representation. ghojmoHwI', Hommey, lojmIt
1.1 Still works with CIL 'objects' (at instruction-level), but performs some very basic level of abstraction. Something like macro-instruction. ngeD
Level 2
joj ("between")
  • Standard language elements in human-undertandable form.
  • Widely used by users.
  • The most of work of compiler is done when translating from Level 2 to Level 1.
  • Metadata and instructions (objects and code) are split, but instruction-level (in methods) items are allowed to create objects invisible for the programmer as normal objects (eg. static variables, inline functions) and object-level items can create some code (eg. default CTor, automatic events).
2.0 Direct translation to level 1.x. Sor chelwI', chIjwI'
2.1 Indirect translation to level 1.x (translates to another 2.x). Used for complex statements that can be represented by another (e.g. translate for-each to while). nap, Gre'thor, yngH
Level 3
jen ("high")
  • Performs high level of abstraction.
  • Allows to mix instructions and metadata (objects and code).
  • Used for declarative programming.
  • Level 3 item cannot translate to another Level 3 items. It translates to level 2 xor 1. It cannot combine translation to level 1 and 2.
3.0 Direct translation to level 2.x xor 1.x. qach, mughwI'

Đonny dzonny@dzonny.cz