4 ms·
A totally different comment: any one know if arbitrary word order so important feature of Latin as a language, why no such thing in computer language. Lisp is
by ngcc_hk 7y ago
A totally different comment: any one know if arbitrary word order so important feature of Latin as a language, why no such thing in computer language.
Lisp is Most flexible I suppose but basically it is fixed form (verb x). Whatever verb is it governs how x is interpret. Also you cannot eliminate (). Hence the basic and simple structure is fixed.
Not sure any use of arbitrary word order.
- jhanschoo 7y agoYou still have the same thing in computer language, at a different level. Your imperative programs are free up to dataflow. ---- Absent contextual clues, natural languages syntax is also only usually flexible up to recursion. That is, your case markings can only distinguish only so many roles, and relative clauses in relative clauses need to be distinguished by position.
- triska 7y agoFor example, in logic programming languages like Prolog and Mercury, you can write the goals of a rule, and also the clauses of a predicate, in any order you like while preserving the logical meaning of the code.
- hackyhacky 7y agoThis is not correct. Clauses of a predicate are evaluated in order, which can be significant if, for example, you want to do in-order vs pre-order vs post-order traversal of a binary tree. inorderTraversal(t(V, L, R), Z) :- inorderTraversal(L, Z). inorderTraversal(t(V, L, R), V). inorderTraversal(t(V, L, R), Z) :- inorderTraversal(R, Z). Also, the meaning of ordering of goals with a rule may be significant: ?- not(member(X,[a,b,c])), X=f. false. ?- X=f, not(member(X,[a,b,c])). X = f. Although Prolog aspires to represent logic, it is still really just a logic-flavored programming language.
- triska 7y agoWhen you say "evaluated", then this is a procedural aspect that depends on the concrete evaluation strategy that is being used. For example, we can evaluate logic programs top down, bottom up, using various forms of resolution etc. Mercury will reorder goals automatically to satisfy certain mode constraints etc. Importantly, the actual meaning of a logic program in the sense of solutions it describes are not influenced by different evaluation strategies, although some may be more effective or efficient than others. As to the examples using not/1: This is an extra-logical predicate where this flexibility indeed does not apply, since its meaning depends on the evaluation strategy. However, for this concrete case, we can use the purely logical predicate memberd_t/3 to retain desirable logical properties such as commutativity of conjunction: ?- memberd_t(X, [a,b,c], true), X = f. false. ?- X = f, memberd_t(X, [a,b,c], true). false. memberd_t/3 is available in library(reif) for various Prolog systems.
- kragen 7y ago> then this is a procedural aspect that depends on the concrete evaluation strategy that is being used. Yes, but Prolog specifies a particular concrete evaluation strategy, and you have to rely on it to write practical programs.
- triska 7y agoThe way I see it, a key attraction of Prolog and logic programming languages in general is that different evaluation strategies are possible, and in fact also starting to be implemented in several systems to various degrees. For example, an increasing number of Prolog systems provide, in addition to SLDNF resolution (which is the the default evaluation strategy), also SLG resolution (tabling) as an evaluation strategy with different termination and performance characteristics. These different strategies are very useful in practical programs, and it would be limiting if one were to prevent them by using extra-logical predicates.
- kragen 7y agoI agree.
- kragen 7y agoSurprisingly nobody has mentioned Perligata yet. Latin's (or Ancient Greek's, or Hungarian's) ability to reorder words because of inflectional endings is not absolute; you still have things like subordinate clauses and prepositional phrases, even though they're not as ubiquitous as in Romance languages or English. You can reorder things locally, but not over long distances, and some things have to move together. Interestingly, lots of programming languages have the freedom to reorder big chunks over long distances without altering the meaning, while I've never used a natural language that had that feature. I think the reason for the large-scale freedom is mostly that in programming languages you are usually defining named entities (subroutines, methods, classes, variables, constants, inference rules, predicates, rewrite rules, and whatnot) that the rest of the program interacts with by mentioning their names. Languages with named arguments allow you to reorder named argument lists freely. My own Bicicleta takes that to somewhat of an extreme and also allows it within "subroutines", depending on dataflow dependencies to drive sequencing.
- ergfdsdag 7y ago"Interestingly, lots of programming languages have the freedom to reorder big chunks over long distances without altering the meaning, while I've never used a natural language that had that feature" wouldn't that be a cognitive burden that would hit our brains quicker than a computer, namely short term memory? Far off re-ordering would be like trying to do mental math in your head that requires memorizing very many results.
- kragen 7y agoMaybe, but this applies equally well to programming languages!