Today, I will be rambling on incoherently about C) nonsensical languages, and in particular, my quasi-java/actionscript XML based programming language.
When last I left this topic, on another site far far away, the language was incredibly complicated and difficult. Since then, I have applied the "ball of mud" theory to it, and got rid of most of the mud. I set the mud aside, and may decide to use it later.
So, anyway, this language is based on XML because I like the hierarchical nature of XML and the lack of order dependence in XML and I also just like saying or typing XML.
I figured hey, an XML element could represent a variable, a class, a function, a module. There is some real potential here. I don't care if somebody else already tried something like this, I wanna try it, too.
So, I pared down my toy language down to a measly seven elements: module, class, method, field, parameter, script, and import.
The structure, as of this moment, looks like the following:
Briefly(yeah, right), a module is the top level entity of a file, and may contain imports, classes, fields, and methods. Similar in concept to a java class file.
An import specifies external modules that from which we may wish to use classes, fields, and methods. Much like the java import functionality.
A class is a collection of fields and methods that operate as a concrete type. Just like the concept of classes from many languages.
A field is a variable. It might be a module level field, and class level field, or a local field.
A method is a function. It can contain parameters, fields, script, and a result. It might be class level, or it might be module level.
A parameter is a passed to a method from its caller. Otherwise, this behaves just like a field.
Now here comes the issue I'm having at the moment. Let us say you have the following method:
If I should happen to call:
what takes care of the mapping between 'a' and 'first' and 'b' and second? XML is order independent. The program should do equally well to have the second parameter declared as a parameter on the line before first is. In truth, either parameter should be able to be defined after the 'script' block.
In the case of the div method, this order is important. So far, I've though to add an 'order' attribute to the parameter element, or a 'parameters' attribute to the method. I even thought to do the Ada thing, and require that the parameter name be specified in the call to the function.
I'm still not entirely sure how I want to approach this, but I figured I'd bore you to death with it first.
Have a lovely day!