views:

260

answers:

3

I'm sure I join many in being glad there's finally a powerful language tied tightly to a mainstream GUI/Database/Communication framework.

I haven't been sure where to post this, but here seems the best spot.

I need to use Unicode symbol characters either as operators or as function names. I'd like syntactic sugar, but I don't need it.

Guy Steele pointed out in Communications of the ACM that "*" was a forced choice when it was adopted from Ascii as multiply, but my software works in Unicode, so I'm not tethered to Ascii anymore.

!$%&*+-./<=>?,@^|~:

Part of localization includes local programmers. Why limit the set of operators that can be defined in F#? It isn’t orthogonal to C#'s and F#'s acceptance of many Unicode IsLetter in identifiers.

Also, F# is likely to be used for symbolic manipulation of problems from logic, math, physicists, etc. It makes work much easier if there’s a direct mapping into the language of the basic operators. (F# and C# accept many Unicode IsLetter? as well as IsDigit’? This is a request to allow Unicode IsSymbol? As operators with the precedence of, for example, *, or, since “+” is both a unary and binary operator, I could put up with the precedence of + and make up the difference with parenthesized groupings.

Consider the domain-specific needs of logicians, mathematicians, physicists, etc. I’d rather write a symbolic differentiator or integrator using math symbols than Ascii permutations of already-taken operators.

  • Logic: ∀ ∃ ⇒
  • Math: ∑ ∫ ∂
  • Group theory: ≤ ≥ ∈ ∉
  • Set Theory: ⊆ ⊇ ⊃ ∪ ∩
  • Tensors: ⊗

I’ve written many languages in other languages, but because F# is tightly .Net-integrated, this issue poses special challenges without language support:

It’s trivial to cobble up a translator that takes Unicode-operator F# source and maps it, line-by-line, to Ascii-operator F# source.

But when debugging, how do I make sure the programmer still sees their untranslated source? And that they can see variable values.

Operators and converts them is trivial. But how do I ensure the translation is what gets compiled, while the programmer sees their own source? If I map line-for-line correctly, how do I ensure they can still point at a variable and see its value?

+1  A: 

You probably wanted to tag this with F#

Other languages, such as Scala, do permit operators from outside the ASCII range -- mathematical symbols(Sm) and other symbols(So)

Steve Gilham
+1  A: 

You may be interested in Project Fortress which is a new functional programming language that embraces the Unicode character set (among many other features). In particular, see the Mathematical Syntax in Fortress page which contains some sample code.

Greg Hewgill
My interest is strong in F# because .Net can be used to create any application that doesn't need C++ performance. And Project Fortress sounds interesting. Thanks.
A: 

For an interesting discussion on this check: http://cs.hubfs.net/forums/thread/9690.aspx

Moonlight