Page 1 of 1

Assessing language definition/syntax

Posted: Fri Oct 07, 2005 12:43 am
by Dare2
If you were assessing a computer language syntax, what would you consider to be good, and what would you consider to be bad?

What would you be looking for in a language definition?

What is important for you?

Is brevity more important than readability? Should the syntax allow the code be self-documenting as far as possible? Is intuitive at the cost of being verbose important?


Note: This is the source code syntax, the language definition, and not the final output (optimisation for speed, size, etc) that we're discussing.

Posted: Fri Oct 07, 2005 10:19 am
by KameHameHaaa
I wish the smallest number of commands to make the largest number of tasks... :)

Javascript, ActionScript (Flash) and others are based on ECMA ( http://www.ecma-international.org/publi ... ma-262.htm ) which I and many other people consider the best "language syntax"

p.s. What do you mean with "assessing" ??

Posted: Fri Oct 07, 2005 10:50 am
by GeoTrail
I think he means by assessing to review or comment on :)
I must admit that I really liked this of Vidual DialogScript when I first started with that. And when I first saw some samples from PB I thought at first that it looked pretty hard to learn, and not very Basic'ish. More like C++. But after time it grew on me, big time, now I wouldn't turn to another language for anything in the world ;)

Posted: Fri Oct 07, 2005 11:30 am
by blueznl
assessing the SYNTAX:

- make it consistent, without affecting usability too much

assessing the LOOKS:

- keep it readable, that's what i hate about c(++), you can't just glance at the code and grasp it

Posted: Fri Oct 07, 2005 3:16 pm
by Dare2
Hi guys,

Thanks for the feedback.

lol, KameHameHaaa. "I wish the smallest number of commands to make the largest number of tasks..." Me too. A "read my mind" language!

Sorry, by assessing I meant what would you want/look for in a language. If you could design the syntax ...


What I am going to do, very low key and background stuff, is develop a high level language but with the ability to do inline "target language". This HLL will translate into the target language, that is, emit target language code. Perhaps FreeBasic, perhaps PureBasic, code.

Later I want to to actually skip the target language and translate to asm, perhaps fasm or gas. And finally compile down to machine code (libs, objects and executables) - but that is later.

I have written "compilers" before, to get the hang of things (and it can get quite complex even for simple stuff). But I learned a lot about validation, tokenising, scope, symantics, etc,etc,etc. Little language compilers and even a music language (midi) (from source to "p-code" and a player for the "binary")

All just fun, and all a waste of time, really. But it interests me.

Just playing around with designing the syntax of the HLL at the mo. Clarity, no ambiguity, and no unneeded keywords (like THEN, Select CASE, etc) is my goal.

Edit:

@KameHameHaaa

Yeah, agree on ECMA languages and love ActionScript. But not used it for a while now. I have borrowed some concepts from there, but no {} curlys.

Posted: Fri Oct 07, 2005 3:23 pm
by thefool
there isnt really any difference between writing direct machinecode or going through an assembler [exept that the going through assembler might produce better and more optimized code :) ]

Really nearly every compiler uses assembler. Or else, build your own assembler! In the end, it will help you. You can write an assembler in nearly any language. Even in vbscript!

Posted: Fri Oct 07, 2005 3:28 pm
by Dare2
Heya thefool,

Yep. Did that last week (really!). Crappy syntax. Crappy result. But got an exe out that popped up a message box with, wait for it, "Hello World"

Edit: Syntax:
Eg: EAX = EBX
/Edit

And re-learning all the bits for the zillions of MOV variations was tiresome. Man, opcodes have come a long way since Z80/8080 days.

hehe.

Posted: Fri Oct 07, 2005 11:47 pm
by dell_jockey
Dare2 wrote:Clarity, no ambiguity
if you succeed, "Clarity" would be a nice name for your new programming language...

Posted: Sat Oct 08, 2005 12:17 am
by Dare2
hehe. Yes.

It's just a toy project though, for fun. No plans to release it. Because then I would have to support it.