views:

534

answers:

11

Which programming language has the least amount of syntax? How can I calculate how many syntax a programming language has?

Thanks.

A: 

I find Applescript to be close to english and I feel there are less things you need to remember on a longer run.

Pradeep
But English has horrible syntax! :)
Marcus Downing
+8  A: 

LISP-derived, Forth-derived and Smalltalk-derived (IO?) languages probably have the least syntax, in that order.

And you can't measure it, because it's not technical, it's social.

alamar
Forth has very little syntax, though variants build on it. Postscript (and by extension PDF) is a similar model to Forth, but with a lot more syntax.
Marcus Downing
Well, syntax is what you accumulate over time.
alamar
+8  A: 

Does Brainfuck count.

Oh wait...you meant a useful language.

Aditya Sehgal
hahah, i was just about to post that.
Sam Saffron
I think Ook! has less syntax. =) http://www.dangermouse.net/esoteric/ook.html
wai
Both Ook! and Brainfuck have 8 productions, so have the same amount of syntax. Ook! uses multi-token productions, so arguably has more complicated syntax.
Pete Kirkham
Brainfuck is useful. How many rep point did we get just using it in an anwser ?
e-satis
e-satis: ha ha hah ha
Aditya Sehgal
**Important** I upvoted this not because of the snark brainfuck answer, that answers the question explicitly. It was because this links to Ruby, a wonderful example of a programming language that makes your fingers and eyes hurt less.
Sam Saffron
@sam: Ruby is indeed a wonderful language.
Aditya Sehgal
+2  A: 

A Hello World in Brainfuck

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
m3rLinEz
Sometimes I tell myself I'll learn brainfuck. Just for laughs, you know? Then I double take at how you do something simple like hello world, or multiplication. Then I go to a therapist for weeks 'cause you know. Brain fuck'd.
Carson Myers
@Carson I learnt brainfuck this weekend. It's really easy. I mean, yeah, it takes for ever to write anything at all useful, but I worked out how to add two integers together and print the result (as long as the result is less than 10).
Skilldrick
+3  A: 

Programming languages that are implemented very close to some simple computational model are likely to have very little syntax.

Nick D
Last time I checked, my Intel computer didn't have a tape inside. x86 is register based.
Pete Kirkham
IP register is the HEAD and memory is the TAPE.
Nick D
The Turing machine has very few instructions with operate on the tape, which is a single stream of data and instructions with O(N) access. x86 is CISC device, and most read/writes operate on random access memory, not on the instruction stream. If anything it's based on Von-Neumann with separation of instruction and data - later variants have support to prevent you executing read/write memory.
Pete Kirkham
+1  A: 

It rather depends on your definition of syntax. For example, Subtext no textual syntax, but quite a lot of visual syntax.

Pete Kirkham
A: 

Not sure about "least" amount of syntax, but if you mean succinct/lightweight, then undoubtedly the K language has to be a strong competitor.

Noldorin
+2  A: 

If I guess your purpose correctly, Python has no more or less "syntax" than any other language, but it has less "strange funny symbols" than any other language I know. And it uses simplified, mostly plain English syntax.

If you're looking for a serious language in which it'd be easy to read and write, but still be prouctive, go for Python.

Or visual basic, which is becoming more and more bloated over the years, and it has syntax incompatibility issues with earlier versions - so I can't recommend VB.

Berry Tsakala
A: 

Most modern languages have relatively few keywords and operators. They usually have some way of indicating a logic block. The problem is that fewer keywords and operators don't usually mean easier to read and understand code - just look at BrainFuck - 4 operators, no keywords and pretty useless.

More 'natural' languages are more verbose and have a lot of syntax, but can be easier for a beginner.

Java, C#, Javascript and loads more languages share the same basic syntax. They all have their own extra keywords and operators, but if you're going to learn one basic syntax their's is where to start - if you can code in one you can read the others.

Keith
A: 

As far as I can tell, I tried :

  • Assembly;
  • C/C++;
  • Java;
  • C#;
  • PHP;
  • Java;
  • Python;
  • Ruby;
  • Bash;
  • Perl.

Excepting bash, wich I do not even thing about when it comes to programming more that scripting, Perl has the shortest syntax, but it's one of the slowest to read.

Assembly, C/C++, and Java are really Verbose. C# and PHP less, but still. And you are stuck with .Net or with a language with no naming convention.

The best balance between being concise, powerful and readable are Ruby and Python.

I am a Python lover myself, and I'm use to the syntax so I'll go for it. I don't like the way Ruby ends blocks using keywords.

e-satis
A: 

The parsing of Jot can be done using only 5 characters: the [01]* regex is a full description of all and only legal programs.

Mykelyk