Assessing language definition/syntax

For everything that's not in any way related to PureBasic. General chat etc...
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Assessing language definition/syntax

Post 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.
@}--`--,-- A rose by any other name ..
KameHameHaaa
User
User
Posts: 19
Joined: Wed Oct 05, 2005 2:44 pm

Post 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" ??
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post 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 ;)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post 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
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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.
Last edited by Dare2 on Fri Oct 07, 2005 3:24 pm, edited 1 time in total.
@}--`--,-- A rose by any other name ..
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post 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!
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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.
@}--`--,-- A rose by any other name ..
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post by dell_jockey »

Dare2 wrote:Clarity, no ambiguity
if you succeed, "Clarity" would be a nice name for your new programming language...
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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.
@}--`--,-- A rose by any other name ..
Post Reply