Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Some programming languages are modeled on machine code, like assembly languages. Other languages are modeled on a natural language, the English language. Others are not modeled on either machine code or natural language. Languages such as PROLOG, for example, don't follow either model.

I came across this Perl module Lingua::Romana::Perligata, that allows to write programs using a syntax that is very similar to Latin.

Are there programming languages that have less positional syntax?

Are there other languages or modules that allow you to write in syntaxes inspired by other natural languages, like French, Hebrew or Farsi? There is a very long list on Wikipedia, but most of those projects are dead.

There is a related question on StackOverflow. The answer that was accepted is "Use Google".

share|improve this question
1  
Not entirely related, but many of the answers involve languages that support syntax modification, and thus may be what you're looking for: http://programmers.stackexchange.com/questions/145751/has-whitespace-in-identif‌​iers-ever-been-idiomatic –  Telastyn Apr 29 '12 at 13:24
2  
Some programming languages are not modeled on either machine code or natural language. Languages such as PROLOG, for example, don't follow either model... –  Andres F. Apr 29 '12 at 15:09
    
@AndresF. thank you! I corrected that. –  Vitalij Zadneprovskij Apr 29 '12 at 15:14
    
You should also note programming languages that are primarily inspired by math. At least in PL research, these are fairly common. –  Tikhon Jelvis Jun 3 '12 at 21:12
    
@TikhonJelvis you mean that for a programming language being able to express mathematical structures and concepts is considered more important than being similar to natural languages? –  Vitalij Zadneprovskij Jun 3 '12 at 21:25
show 1 more comment

2 Answers

up vote 3 down vote accepted

The only currently used written programming language I can think up off the top of my head is HTML. Now depending on your definition of programming language, this may or may not count.

To help you understand why there is not a lot of high usage programming languages that have less positional syntax you have to understand how most programming languages are designed. Most programming languages are based on unambiguous grammars, mostly by the use of LL and LR grammars. In order to keep the grammars unambiguous most of the technology relies on using the ordering of the symbols and words, e.g. terminals, to make the input unambiguous. What you are looking for are languages that give up position to make the grammar unambiguous. If the compilers cannot use position to decide if the grammar is unambiguous, then the compiler needs some other hints to make the grammar unambiguous, thus prefixes such as #, %, ' and ". Another technique is to associate keywords with each value, i.e. width=10, which is what HTML does. If you create a grammar that does not use LL and LR grammars, then you have to use a different technology to resolve ambiguities which typically use backtracking which requires a large amount of computer processing to resolve the ambiguities.

Declarative languages are closest in general that I know of such as PROLOG and SQL, but again require the use of some positional values.

The only other languages that come to mind are spoken language into AI systems that process the input such as Watson, but again, do you consider this a programming language; if you consider SQL a programming language, then why not a verbal query for Watson.

share|improve this answer
    
Thank you for the great explanation! I guess that this way the HTML language must have a big number of keywords. I guess that regular expessions on tokens could be used to decide the type of a token. Of course that would make the compiler much slower. –  Vitalij Zadneprovskij Apr 29 '12 at 13:55
    
also, by extension XML could be considered. –  alfa64 Apr 29 '12 at 18:35
3  
Might consider Forth, which doesn't have much of a grammar. –  Steven Burnap May 22 '12 at 19:46
1  
AFAIK HTML isn't a programming language. –  akled May 22 '12 at 20:19
2  
HTML is a markup language; that is what the M stands for, it isn't a programming language because it isn't Turing complete! XML definitely isn't a programming language either. They are data encoding formats! This like saying that a JPEG is a programming language! –  Jarrod Roberson May 22 '12 at 21:56
show 3 more comments

Oracle Policy Automation has business rules coded in natural language. It is worth a look.

An example is:

Human Resources Policy 100 – Maternity Leave 

100.1. The employee is eligible for maternity leave if

a. The employee is female and
b. Either
 i. The employee has given birth to a natural child or
 ii. The employee has taken legal custody of an adopted child
 and
c. The employee is a full time employee and
d. The employee has been employed for at least 12 months continuously

The original source of the example.

The official Oracle documentation is here.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.