Archived

This topic is now archived and is closed to further replies.

RedBitsOfYarn

My "Simple" effective programming language

Recommended Posts

RedBitsOfYarn    100
No compiler yet or interpretor for that matter... anyways, here goes the "surface" design of it: -------------------------- EPIAE Every Program is an Expression Programs are ALL enclosed in "()", and can be refered to by outside programs if the program being refered to is running... *whew* The program is refered to by the file name. So, (my_program.ep) would call up my_program.ep. (Of course, once compiled you refer to it as it''s compiled name) Expressions are enclosed in parenthesises. The command that goes with an expression is located inside the parens. So if there was a magical foo command: (foo) Foo would be activated. Sometimes, a command shall need some data inputed into it. This is handled by doing: (foo (bar_data)) The nested () means that data is nested inside. There is one set of () for each command unless others should be nested. To create new commands, invoke the "built-in" command, func: (func ("Function_Name")("code in a string here")) Here, the string, function name shall create a new function, and the "code in a string here" is used to input the needed code. So: (print ("hello world")) would print hello world. Loops are handled with commands. So you would do: (while ("code that must be true for loop to execute")("code")) Variables: (int ("my integer")) (char ("my char")) Math: (add (5)(6)) If you put a + between two sets of parameters, it is the same as multiplying the parameters. Confused? Here''s an example:
  
(
(blah(a))
(blah(b))
)

is the same as 
(
(blah(a)+(b))
)
  
--- Sample:
  
( 
  (int (a)+(b))
  (input (a)+(b))
  (add (a)+(b))
)
   
The strings with "code" in them, depending on what the function or command asks for, might have to be converted into code. (Think the exec() function in python or some other language) (While you''re reading, please make an interpretor... you know... so I don''t have to :-P) Comments? Suggestions? Flames?

Share this post


Link to post
Share on other sites
RedBitsOfYarn    100
Yes, it looks like lisp, and mabye a little C sprinkled in, but you gotta admit, it would be a nice non stormy adventure to use

Some things I should add:

OOP (Easy enough... if you make commands data)
Arrays (My glaring thorn in the ass. My philosiphy is to try and weed out ambigiouties)

Share this post


Link to post
Share on other sites
RedBitsOfYarn    100
Basically, it''s design is to try and stop the usage of too many special symbols (Shifted number keys, the keys next to the letters). The usage of everything is a blah blah blah is to just make it easier.

Share this post


Link to post
Share on other sites
Extrarius    1412
If you are serious, just use ACTUAL Lisp, and save yourself the work of making a language. It would be a lot easier to spend $50 on "ANSI Common Lisp"(not that you need it, but I find it better than the freely available online books I looked at), learn lisp, and then find a free compiler w/ source to integrate as your scripting language. You can make macros to make (foo (a) + (b)) multiply A and B and then pass that to foo if you really want.

[edited by - Extrarius on March 5, 2003 10:45:30 PM]

Share this post


Link to post
Share on other sites
RedBitsOfYarn    100
Extrarius: But this is supposedly supposed be compiable ready. Either way, i could easily change the parens to [] or {} just as easily. (Not to you extrarius) Anyways, ive never worked in lisp. Are there many sematical differences?

Share this post


Link to post
Share on other sites