Talk:Icon (programming language)

message: Just for historical purposes..
One of the frequent requests in the old Icon mailing list for Icon was adding regular expression support to the language.  Unfortunately, I'm not sure who responded, but the best comeback to one of these requests was:
Asking for regular expressions in Icon is like asking for training wheels for a Harley
CheyenneWills 16:40, 29 September 2006 (UTC)
thread_title:  regular expressions 

message: ----
Do anybody know what is the license on Icon implementation and IPL? I have found no trace of license on their website. 83.246.135.39 (talk) 10:49, 31 October 2009 (UTC)
thread_title:  license 

message: Since the switch from Geshi to Pygments for syntax highlighting (phab:T85794), support for 'icon' and 'unicon' was unfortunately dropped, as can be seen with the plain text formatting on this page and many others like Unicon (programming language) and Generator_(computer programming). If you want specialised syntax highlight support again, it will need to be added to Pygments.  However we could also add a compatibility fallback, e.g. to 'pascal' which works quite well for highlighting these languages. John Vandenberg (chat) 12:57, 14 July 2015 (UTC)
thread_title:  icon syntax highlighting lost 

message: Some of the "Criticism" section feels opinion.
The linked paper that is the basis for the criticism section is a reference to the experiences in developing a new language (Converge) that was derived as a cross between Icon and python.  
Some of the design considerations of Icon were derived from Snobol, where the concept of success/failure instead of boolean is one of primary features of that language. Icon, like Snobol, does require a different way of "thinking" because of the use of success/failure instead of using booleans. To a Snobol programmer, this behavior of Icon does feel "natural".  
As with many programming languages there can be nuances that can trip up a programmer, especially if the language has concepts that are radically different from other programming languages. Because there are some radical differences, there are typically idiomatic ways of performing certain operations. The similarity of syntax with other languages can further lead to confusion since there might be an expectation of common behavior.  To give an example, C's uses and idiom of 0 as "false" and everything else as "true", while Icon's idiom is to use a conditional expression to check the value that you want.  This is not saying that C is wrong and Icon is correct, it's just that they are different. In some languages (e.g. pascal) there is a boolean data type and using an non-boolean variable as a raw check for true/false produces a compile time syntax error.
The design choice of success/failure is documented in the introduction to Icon and as well as being covered in the 1st chapter of Icon Programming Language book.  The points brought up in the criticism are covered the topic 'Success and Failure' in the Icon Programming Language book has notes of caution when using Icon due to the differences with success/failure and boolean logic (e.g. the fact that failure is inherited by the assignment operator, and that use of conditional expressions).
To rework the specific examples given in a more "Iconic" fashion:
  x := 10
  ...
  x := f(-1) | &null     # if f fails, assign a default value
  write("f(-1) is ", \x | "undefined")
  if /c then {           # Use a conditional expression to check to see if c is &null
      write("taken")
  }
It should also be noted that the 2nd example given was misquoted from the original article.  In the article, the example firsts sets c to 10 (c := 10) then performs the test, this is followed by removing the assignment and repeating the test.  The default value of an initialized variable is &null not zero
CheyenneWills (talk) 22:51, 22 June 2021 (UTC)
thread_title:  Criticism section 

message: Above code block  in section: Goal-directed_execution
"if the operations to the right" ... Icon programming class from U of Arizona many years ago and rusty but bold part of quote confusing. Likely, based on textbook, better written "if the conditional evaluates to a true value". Likewise: "if the operations to the right succeed" maybe better written "if the conditional evaluation is successful and does not fail". Ronaldws (talk) 00:59, 12 August 2022 (UTC)
replies: text: Sounds right ... WP:bebold and go ahead and make such improvements. Jibal (talk) 23:11, 21 August 2022 (UTC)
replies: text: Tried putting in this update and #other_icon_programming_languages. Ronaldws (talk) 01:30, 26 August 2022 (UTC)
thread_title:  "if the operations to the right evaluate to true" confusing ... perhaps better "if the conditional evaluates to a true value"