In a message dated 7/6/2009 12:12:15 AM Pacific Daylight Time, stevagewp@gmail.com writes:
Your point is made, understood, and soundly rebutted. An "english-like" language is not desirable, feasible, or going to happen.>>
----------------------
I propose that A) you are not the authority invested in deciding this issue; and B) your approach is overly antagonistic and confrontational.
Will
************** Looking for love this summer? Find it now on AOL Personals.
WJhonson@aol.com wrote:
In a message dated 7/6/2009 12:12:15 AM Pacific Daylight Time, stevagewp@gmail.com writes:
Your point is made, understood, and soundly rebutted. An "english-like" language is not desirable, feasible, or going to happen.>>
I propose that A) you are not the authority invested in deciding this issue; and B) your approach is overly antagonistic and confrontational.
Will
Will,
Although the point could have been put more tactfully, I think the salient point here is that "English-like" programming languages have been tried before many times, and have (with the possible exception of COBOL) consistently been rejected in favour of compact equation-like languages.
Consider the difference between the ease of writing, say, the Python-like
print "%02x" % find(":", param[1])
or even the Lisp-like
(print (fmt "%02x" (find ":" (param 1))))
compared to writing an "English-like" equivalent such as
PRINT THE NUMBER OF CHARACTERS BEFORE THE FIRST OCCURRENCE OF THE COLON CHARACTER IN THE FIRST POSITIONAL PARAMETER FORMATTED AS A TWO-DIGIT ZERO-PADDED HEXADECIMAL NUMBER USING LOWERCASE LETTERS FOR THE HEX DIGITS A TO F
If you think this an unfair example, please could you show how your proposed English-like language would handle this example better than the above?
-- Neil
On Mon, Jul 6, 2009 at 3:54 AM, Neil Harrisusenet@tonal.clara.co.uk wrote:
Consider the difference between the ease of writing, say, the Python-like print "%02x" % find(":", param[1]) or even the Lisp-like (print (fmt "%02x" (find ":" (param 1)))) compared to writing an "English-like" equivalent such as PRINT THE NUMBER OF CHARACTERS BEFORE THE FIRST OCCURRENCE OF THE COLON CHARACTER IN THE FIRST POSITIONAL PARAMETER FORMATTED AS A TWO-DIGIT ZERO-PADDED HEXADECIMAL NUMBER USING LOWERCASE LETTERS FOR THE HEX DIGITS A TO F
Your example is a bit unfair though, Neil. For one, how would it be parsed? Two, it only implies and does not explicitly state the "find/search" functionality you use in the examples.
Interestingly, this seems to follow the useful form for a teaching tool. Compromising between efficiently terse syntax and efficiently expressive natural language gets... ?
-Steve
stevertigo wrote:
On Mon, Jul 6, 2009 at 3:54 AM, Neil Harrisusenet@tonal.clara.co.uk wrote:
Consider the difference between the ease of writing, say, the Python-like print "%02x" % find(":", param[1]) or even the Lisp-like (print (fmt "%02x" (find ":" (param 1)))) compared to writing an "English-like" equivalent such as PRINT THE NUMBER OF CHARACTERS BEFORE THE FIRST OCCURRENCE OF THE COLON CHARACTER IN THE FIRST POSITIONAL PARAMETER FORMATTED AS A TWO-DIGIT ZERO-PADDED HEXADECIMAL NUMBER USING LOWERCASE LETTERS FOR THE HEX DIGITS A TO F
Your example is a bit unfair though, Neil. For one, how would it be parsed? Two, it only implies and does not explicitly state the "find/search" functionality you use in the examples.
Oh, don't tempt me to write an implementation... a grammar for it might look something like this:
command ::= print-expr | ...
expr ::= find-expr | param-expr | arithmetic-expr | strong-expr
no-default-param-expr ::= "THE" ordinal-number-name "POSITIONAL PARAMETER" | "THE PARAMETER CALLED" name-expr
param-expr ::= no-default-param-expr ["UNLESS THE PARAMETER IS UNDEFINED, IN WHICH CASE USE" expr "INSTEAD"]
find-expr ::= "THE NUMBER OF CHARACTERS BEFORE THE FIRST OCCURRENCE OF" expr "IN" expr
arithmetic-expr ::= expr "MULTIPLIED BY" expr | expr "ADDED TO" expr | ... | "OPEN BRACKETS" expr "CLOSE BRACKETS"
substitution-expr ::= "THE STRING" expr ", SUBSTITUTING THE STRING" expr "FOR THE STRING" expr "THROUGHOUT"
string-expr ::= "THE" char-name "CHARACTER"
print-statement ::= "PRINT" expr "FORMATTED AS" print-format
print-format-atom ::= "A LITERAL STRING" | "A" ordinal-number-name "-DIGIT" [ "ZERO-PADDED" ] ["HEXADECIMAL" | "OCTAL" | "DECIMAL" ] "NUMBER" ["USING" ["UPPERCASE" | "LOWERCASE" "LETTERS FOR THE HEX DIGITS A TO F"]
print-format ::= print-format-atom | print-format-atom "FOLLOWED BY" print-format
ordinal-number-name ::= "FIRST" | "SECOND" | "THIRD" | "FOURTH" ...
cardinal-number-name ::= "ONE" | "TWO" | "THREE" | "FOUR" ...
and then throw it at a packrat parser or similar shortest-length parser for nondeterministic languages... I leave code generation and the runtime environment as an exercise for the student. To keep fully within the spirit of the exercise, don't forget to add automatic type coercion of all data types to strings wherever necessary.
-- Neil
On Mon, Jul 6, 2009 at 12:49 PM, Neil Harrisusenet@tonal.clara.co.uk wrote:
Oh, don't tempt me to write an implementation... a grammar for it might look something like this:
I thought we were keeping this conversation high level.
-Steven
Yeah, that could work... if we lived in bizarro world where all the developers actually liked COBOL!
If I know software engineers, over their dead bodies!
On 06/07/2009, Neil Harris usenet@tonal.clara.co.uk wrote:
stevertigo wrote:
On Mon, Jul 6, 2009 at 3:54 AM, Neil Harrisusenet@tonal.clara.co.uk wrote:
Consider the difference between the ease of writing, say, the Python-like print "%02x" % find(":", param[1]) or even the Lisp-like (print (fmt "%02x" (find ":" (param 1)))) compared to writing an "English-like" equivalent such as PRINT THE NUMBER OF CHARACTERS BEFORE THE FIRST OCCURRENCE OF THE COLON CHARACTER IN THE FIRST POSITIONAL PARAMETER FORMATTED AS A TWO-DIGIT ZERO-PADDED HEXADECIMAL NUMBER USING LOWERCASE LETTERS FOR THE HEX DIGITS A TO F
Your example is a bit unfair though, Neil. For one, how would it be parsed? Two, it only implies and does not explicitly state the "find/search" functionality you use in the examples.
Oh, don't tempt me to write an implementation... a grammar for it might look something like this:
command ::= print-expr | ...
expr ::= find-expr | param-expr | arithmetic-expr | strong-expr
no-default-param-expr ::= "THE" ordinal-number-name "POSITIONAL PARAMETER" | "THE PARAMETER CALLED" name-expr
param-expr ::= no-default-param-expr ["UNLESS THE PARAMETER IS UNDEFINED, IN WHICH CASE USE" expr "INSTEAD"]
find-expr ::= "THE NUMBER OF CHARACTERS BEFORE THE FIRST OCCURRENCE OF" expr "IN" expr
arithmetic-expr ::= expr "MULTIPLIED BY" expr | expr "ADDED TO" expr | ... | "OPEN BRACKETS" expr "CLOSE BRACKETS"
substitution-expr ::= "THE STRING" expr ", SUBSTITUTING THE STRING" expr "FOR THE STRING" expr "THROUGHOUT"
string-expr ::= "THE" char-name "CHARACTER"
print-statement ::= "PRINT" expr "FORMATTED AS" print-format
print-format-atom ::= "A LITERAL STRING" | "A" ordinal-number-name "-DIGIT" [ "ZERO-PADDED" ] ["HEXADECIMAL" | "OCTAL" | "DECIMAL" ] "NUMBER" ["USING" ["UPPERCASE" | "LOWERCASE" "LETTERS FOR THE HEX DIGITS A TO F"]
print-format ::= print-format-atom | print-format-atom "FOLLOWED BY" print-format
ordinal-number-name ::= "FIRST" | "SECOND" | "THIRD" | "FOURTH" ...
cardinal-number-name ::= "ONE" | "TWO" | "THREE" | "FOUR" ...
and then throw it at a packrat parser or similar shortest-length parser for nondeterministic languages... I leave code generation and the runtime environment as an exercise for the student. To keep fully within the spirit of the exercise, don't forget to add automatic type coercion of all data types to strings wherever necessary.
-- Neil
WikiEN-l mailing list WikiEN-l@lists.wikimedia.org To unsubscribe from this mailing list, visit: https://lists.wikimedia.org/mailman/listinfo/wikien-l
Forgive my pseudocode (based on Neil's example):
function A: search ":" = [0], scope (before [0]), count [a-z] = [1], format [1] [TWO-DIGIT ZERO-PADDED HEXADECIMAL NUMBER] /* :-P */, format [1] [lowercase], move [1] [0].
Breakdown: function A: search ":" = [0], // search for ":" and set it to the 0 parameter scope (before [0]), // set the scope for the next operation as before 0 (":") count [a-z] = [1], // count anything a-z within the scope and set it to another parameter 1 format [1] [TWO-DIGIT ZERO-PADDED HEXADECIMAL NUMBER], format [1] [lowercase], // shouldn't affect numbers, and hex = A-F anyway, so "A-F distinction = unnecessary move [1] [0]. // put the results of 1 in the 0 position, period (.) ambiguously = stop symbol
I'm not sure this gets all of it. IANAP
Me: "Compromising between efficiently terse syntax and efficiently expressive natural language gets... " .. a functional language? Haskell?
-Steven
Yes I mean PRINT is far more obvious what it's doing.? Most programmers can understand what ADD, COUNT or FORMAT is supposed to do, in general.? Sure you could just use "/" or "~" or "^" but it's not obvious what they do without a manual.
Me: "Compromising between efficiently terse syntax and efficiently expressive natural language gets... " .. a functional language? Haskell?
-----Original Message----- From: stevertigo stvrtg@gmail.com To: English Wikipedia wikien-l@lists.wikimedia.org Sent: Mon, Jul 6, 2009 3:56 pm Subject: Re: [WikiEN-l] MediaWiki is getting a new programming language
Forgive my pseudocode (based on Neil's example):
function A: search ":" = [0], scope (before [0]), count [a-z] = [1], format [1] [TWO-DIGIT ZERO-PADDED HEXADECIMAL NUMBER] /* :-P */, format [1] [lowercase], move [1] [0].
Breakdown: function A: search ":" = [0], // search for ":" and set it to the 0 parameter scope (before [0]), // set the scope for the next operation as before 0 (":") count [a-z] = [1], // count anything a-z within the scope and set it to another parameter 1 format [1] [TWO-DIGIT ZERO-PADDED HEXADECIMAL NUMBER], format [1] [lowercase], // shouldn't affect numbers, and hex = A-F anyway, so "A-F distinction = unnecessary move [1] [0]. // put the results of 1 in the 0 position, period (.) ambiguously = stop symbol
I'm not sure this gets all of it. IANAP
Me: "Compromising between efficiently terse syntax and efficiently expressive natural language gets... " .. a functional language? Haskell?
-Steven
_______________________________________________ WikiEN-l mailing list WikiEN-l@lists.wikimedia.org To unsubscribe from this mailing list, visit: https://lists.wikimedia.org/mailman/listinfo/wikien-l