• entries
292
557
• views
155248

You should skip this one, if you know what's good

152 views

My journal contains my ruminations on a number of topics. First, although not always foremost, is my game development. Second, there is my Truck. In a three way tie for fifth, there is A) general nonsense from my life that you don't care about B) incoherent religions that I make up and you similarly don't care about and C) nonsensical languages (both human and programming) that you could really stand to hear less about.

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:

                <br>        result = first / second;<br>        return( result );<br>

If I should happen to call:

div(a,b);

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!

1 Comment

Looks a bit like lisp, only with straight braces rather than curvy ones. Of course, Java/Action/EcmaScript is basically Lisp with a C++ish look to it, so that stands to reason.

I always wondered how much of Java/Action/EcmaScript is based on Dave Betz' language called Bob. It was basically an experiment to make a Lisp-like language with a C-like look in as little space as possible. It is pretty goldurned small.

http://www.mv.com/ipusers/xlisper/

Create an account

Register a new account