Hacker News new | ask | show | jobs
by mpweiher 2951 days ago
"The experiment in designing a language that resembled natural languages (English and Japanese) was not successful." -- William Cook

Any programming language that tries to do "natural language" should at least reference the AppleScript HOPL Paper[1] and say how they are doing things differently to address the (now) obvious problems.

(Oh, and there is a LOT of good stuff in the paper, definitely worth a read).

[1] http://www.cs.utexas.edu/~wcook/Drafts/2006/ashopl.pdf

1 comments

I think all experiments of languages that resembled natural languages will never work until one will try to ascend to a more high-level paradigm.

Actuals programming language are based on a "forklift paradigm" : you describe the path of a forklift in a virtual warehouse where data's are in some places and your forklift move them from places to places. So a natural language isn't design to express this kind of semantic.

In PPIG ( Psychology of Programming Interest Group ) 2006 was published a very interesting paper where is studied the metaphors which was shared by the core java library authors, the mental model said in another way. It reaveals very interesting facts : Programmers tend to think the world in term of Belief-Intention agents. Agent are members of a society who trade and own datas and are subject to legal constraints. A method calls is a speech act. The execution is mentalized as a journey in a a spatial world. Etc. There's a lot of metaphors like that, and it reveals tracks to conceive a more high level language.

So there's a lot of work in this field (Behavior-Tree based language, time dimension include inside the semantics, etc.).

Note that it is also possible to express non ambiguigous semantics in natural language : Attempto Controlled English is an exemple [2].

Here an toy example of what you could do with this language :

"MyWebPage is a webpage. MyWebPage contains a textfield which a logical name is-named NameTextField. His label is "Name". MyWebPage contains a button which a logical name is-named SubmitButton. His label is "Submit". If User clicks on Submit and NameTextField is empty then NameTextField ' s css class becomes AlertEmptyInput. "

[1] http://www.ppig.org/sites/default/files/2006-PPIG-18th-black... [2] http://attempto.ifi.uzh.ch/site/