Codename for the idea right now is Dao.
The main idea I have right now is that every statement is a call to a method of the global object. So, like how window. is prefixed to every variable in javascript, god. is prefixed to every statement in Dao (god doesn't necessarily have to be what the global object is called, I haven't yet decided). define is a method of the global object that takes one argument, the name of the property to define.
Code: Select all
define "foo";Code: Select all
method arg1, arg2, arg3, ...;Code: Select all
define "foo"; //Creates the property foo
foo.equals 23; //foo now equals 23
foo.plus 9; //foo remains 23, rather this statement returns (foo + 9) which is 32
foo.equals foo.minus 12;; //foo = foo - 12 = 11
The statement terminator operator not only ends the statement but is used as a delimiter too. It can act like a , (comma). For example:
Code: Select all
method 1, method 1, 2, 3; 2, 3;Code: Select all
method(1, method(1, 2, 3), 2, 3);Code: Select all
method arg1:1, arg2: 2, arg3: 3;
method arg2:2, arg3:3, arg1:1;
method arg3:3;This is all I have so far. I have yet to define the syntax involved for defining methods (eek, that's sounds a bit confuzling :S). Let me know what you think, and if you have any questions.
Philosophy: (now for some blab; you don't need to understand this)
left-to-right-ism: Basically the philosophy is that we write from left to right so we should program from left to right. So the code shouldn't force you to use the arrow keys much. I'm not sure how I'm going to accomplish this, but it seems like I'm doing okay at it.
self-programmable: I want the language to be very flexible, so flexible that perhaps able to program itself thus altering the language a bit. Kinda like how JavaScript is so flexible that we can actually create our own patterns. Kinda how jQuery has altered the pattern in which we access the DOM, I want Dao to be able to be extended in that way but not limited to that way.
I'm thinking of containing the entire language within the god object, or something. An example of this is would be that every literal would be an property of the god object, and it would be an object itself:
Code: Select all
11.plus 12; //Would return 23
//We could go crazy with methods for the literal classes
23.each method; //calls method 23 times
"foo".reverse null; //returns the string "foo" reversed "oof". We pass null as the first parameter just to call the function. It could of easily have been 0 or any value.