Okay how about this:
[i]RML is a language that kinda looks like XML and it doesn’t have any immediate purpose for the general programmer but I don’t care because this project was really just for fun. [i]
PERFECT!
Cheers,
Kev
Thinking about making a syntax change:
rml(class:Main){
func(name:$main){
double(name:hello, value:10);
@var(name:hello, set:30);
print(){
Hello World
}
}
}
Any suggestions?
I like a syntax more like:
class Main {
$hello = 10;
function main() {
$hello = 30;
print "Hello World";
}
}
For example, I personally like PHP syntax
CopyableCougar4
The parts I can decipher I cannot understand why the syntax would be like it is, and the rest I simply cannot comprehend how the types, semantics, etc. interact.
E.g.
double(name:v, action:v)
@var(name:v, action:v)
What is the difference between these? Obviously “double” seems to construct a floating point value, but then “@var” seems to construct/declare a variable. So then does “double” not declare a variable?!
double would be defining the variable while @var would be used to manipulate it. This is one of the parts I would like to change along with the syntax but I figured I would focus on changing the syntax before working on functionality.
The syntax I mentioned above is much more readable in my opinion.
It has the things I like in a scripting language.
- Types determined by program
- No unneeded characters
- Easy to read
CopyableCougar4
This seems almost intentionally confusing haha
I would go with a traditional approach :
SomeClass {
name = "Saucy"
value = 10
main {
print "Hello World"
}
}
If you’re still working on this, I found a nice blog post about a particular part of programming language design that you (and others!) might enjoy reading: http://www.defmacro.org/ramblings/lisp.html
It’s about the power of homoiconicity in LISP, but the first half is an introduction via XML that you might find particularly relevant.
This project also reminds me of Greenspun’s Tenth Rule. :point: