If you could create your own language...

Pages: 12345
chrisname +... dammit! There's no number large enough for the number of ups I'm planning to give to chrisname's post.

Do you think we should head to twicker and ask if he's implemented IP banning?

-Albatross
g64 is large enough.
closed account (EzwRko23)
That argument is completely ridiculous. One thing looks like another, therefore it should be exactly the same? Really?


You haven't understood it. XML is known for having extremely over-verbose and ugly (for humans) syntax. I was designed to be easy for machines and easy to manipulate. So, if your language is not going to be XML-compatible, I don't understand a use of such XML-like syntax - that is why I asked. I'm sure it will confuse people - they will try to open your source codes using an XML editor and will be surprised it doesn't work as expected.

Anyway, how do you plan to support < and > operators?
They are a part of your synax already and they are used for a different purpose (as delimiters). This might complicate your parser a lot.

1
2
3
4
<operation>	; operation is a tag that 
					; allows arithmatic parsing to occur
			boolean_result = arg1 < arg2  ; how do you know, < arg2 is not a start of the tag? You will have a very serious problem constructing a parser here.
		</operation> 




 
The syntax is a little verbose and inconsistent, it's true, but it's no "stranger" than many other languages


Oh, so you agree with me. How nice. :)


Last edited on
Please don't make me insult your intelligence, xorebxebx.

variable < variable
vs.
expression < keyword

Small difference, no?

EDIT: Now, if Seraphimsan were to implement custom tags, it would look a little different.

variable < variable
vs.
expression < tag_name

However, as long as you can't have a tag name and a variable name that are the same, there should be no problems as long as the tag name is explicitly stated to be the name of a tag.

-Albatross
Last edited on
@xorebxebx

>_> No one will open it in an xml editor because as of right now no one is going to code in it but me.

edit: thank you Albatross for your support :)

also you are correct My language by definition is not a mark up language. though it is close to one.
Last edited on
You're probably right, but that is where I got the inspiration for the syntax.
Oops. I deleted the post just above Seraphimsan's last post with perfect timing.

For others' reference, Seraphim's language describes computation, and so I did not think it to be a markup language simply because it does.

EDIT: Also, would the troll answer the question I posed at the start of this thread?

-Albatross
Last edited on
If could make a programming language I would stop crappy syntax like this:
1
2
variable-type variable;
variable.do_this_to_variable();

instead it would be:
1
2
variable-type variable;
do_this_to_variable(variable);

and like this:
print out "this";
instead it would be:
print out("this");
Last edited on
So let me get this straight. If you were to create a programming language, it would be C. Am I right?

-Albatross
No but every thing would be in functions and dot syntax even declaring variables eg:

var.string(a_string,"value of string",amount of memory allocated to variable)
and
math.add(#num1,#num2)

and int variable start with "#" just like text is in quotes
Last edited on
clover, you have much to learn :P But at least you're being creative.
Clover, you just implied you'd not use dot syntax. Or were you implying that you would prevent members of classes from manipulating class variables, or were you perhaps implying that there would be no class variables?

He or she wrote:
If could make a programming language I would stop crappy syntax like this:
variable-type variable;
variable.do_this_to_variable();

instead it would be:
variable-type variable;
do_this_to_variable(variable);


-Albatross
No I meant dot syntax is bad for applying a function to variables. The variable should be a parameter of the function.
Last edited on
then go learn a language that isnt object oriented.
closed account (EzwRko23)

EDIT: Now, if Seraphimsan were to implement custom tags, it would look a little different.

variable < variable
vs.
expression < tag_name

However, as long as you can't have a tag name and a variable name that are the same, there should be no problems as long as the tag name is explicitly stated to be the name of a tag.


Nice try, but this works only for a hardcoded set of tags.
If you want the user to define its own tags, then you have a problem, because the parser has no way to know whether the given name is a tag or a variable name.
Last edited on
An empty ebx register wrote:
If you want the user to define its own tags, then you have a problem, because the parser has no way to know whether the given name is a tag or a variable name.


Tsk tsk. *drinks CommonTrollBGone*

If the compiler on its first pass over a source file makes a record of all the custom tags' names and then checks if any "variable names" match any of the tag names on the third pass and changes the recorded tokens appropriately, then there's no problem, is there?

-Albatross
Last edited on
Maybe I'm missing something, but why would you need to make several passes (unless an identifier can be used before its declaration)? The lexer can have access to the symbol table and decide the type of any given identifier.
That was just the simplest solution I could think of in... actually, not five, closer to three seconds, that's all. :)

-Albatross
Last edited on
for christ's sake stop this arguing. now.
Agreed. xorebxebx... I don't wanna say this, but...

YOUR LANGUAGE, OR GTFO. ;)

-Albatross
Last edited on
Pages: 12345