If you'd design a Haskell-like language, what would you do different?

99 messages
12345
Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

 On Tue, Dec 20, 2011 at 1:46 AM, Ben Lippmeier wrote: On 20/12/2011, at 6:06 PM, Roman Cheplyaka wrote: > * Alexander Solla <[hidden email]> [2011-12-19 19:10:32-0800] >> * Documentation that discourages thinking about bottom as a 'value'.  It's >> not a value, and that is what defines it. > > In denotational semantics, every well-formed term in the language must > have a value. So, what is a value of "fix id"? There isn't one! Indeed, that is my point.  "Bottom" is the representation of a computation which cannot be computed.  It does not have a semantic in anything less than the first infinite ordinal.  It should be treated as essentially unique.  It exists as a syntactic construct, but it cannot be given an interpretation in Haskell. In particular, we cannot compare "distinct" (or even indistinct) bottoms, because of the halting problem.  There is no consistent logic in which (forall x, x = x) does not hold.  Treating bottom the same way we treat 1, "abc", (Just 10), and the other (in principle) comparable values introduces contradiction to Haskell, as a logic.  (That is why bottom has the syntactic symbol _|_, the syntax for /the/ unique contradiction) Denotational semantics is nice, but it goes way out of the realm of realistic computation to deal with infinite ordinals just to have a complete semantic.  (We can't run computations even up to the first infinite ordinal in real life) I would rather have an incomplete semantic, and have all the incomplete parts collapsed into something we call "bottom".  We can then be smart and stay within a total fragment of the language (where bottom is guaranteed to not occur).  Or we may have to move into the non-total fragment of the language for performance reasons.  That's fine, but we shouldn't treat things like 'seq' as if they produce values.  'seq', 'unsafeCoerce', and many others are literally compiler magic, and as such, should be used with extreme care not warranted when dealing with "regular" values. I have used the phrase "proto-value" for describing these magical objects.  I just wish the documentation made the distinction between a "proto-value" and a real value more clear. _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe
Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

 On 21 Dec 2011, at 08:24, Alexander Solla wrote: > I would rather have an incomplete semantic, and have all the incomplete parts collapsed into something we call "bottom". I don't see the reason to limit ourselves to that. Of course, in total languages like Agda there is no need for (_|_). But in a turing-complete lazy language like Haskell we really need it. Of course, it makes not much sense to write "fix id" anywhere in your program; but, for example, lists like "1:2:3:4:5:_|_" can be really useful. And denotational semantics is not just nice. It is useful. It's the best way to understand why the program we just wrote doesn't terminate. _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe
Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

 In reply to this post by Alexander Solla On Dec 21, 2011, at 2:24 PM, Alexander Solla wrote:I would rather have an incomplete semantic, and have all the incomplete parts collapsed into something we call "bottom".  We can then be smart and stay within a total fragment of the language (where bottom is guaranteed to not occur).But part of the whole point of including bottom in our semantics in the first place is *exactly* to *enable* us to be smart enough to know when we are staying within a total fragment of the language.  For example, including bottom in our semantics allows us to make and prove statements like fst (42,_|_) = 42and fst _|_ = _|_That is, as long a you know that the pair is total and that the first element is total, calling fst on it is also total regardless of whether the second value is total.Refusing to use bottom in our semantics doesn't make life better by forcing us to stay within a total fragment of the language, it actually makes life harder by removing from us a useful tool for knowing *how* to stay within a total fragment of the language.Cheers,Greg_______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe
Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

 In reply to this post by Robert Clausecker Support for long binary data sections would be nice. -- Jason Dusek ()  ascii ribbon campaign - against html e-mail /\  www.asciiribbon.org   - against proprietary attachments _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe
Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

 In reply to this post by Brandon Allbery On 21 Dec 2011, at 04:15, Brandon Allbery wrote: > On Tue, Dec 20, 2011 at 21:05, Andrew Cowie <[hidden email]> wrote: >> Now we just need λ to replace \, → to replace ->, and ≠ to replace /= >> (which still looks like division assignment no matter how hard I squint >> my eyes. 25 years of C and C derived languages is hard to forget). > Some of it is already supported. > http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#unicode-syntax> > (≠ isn't in that list, but it doesn't need to be; just stick it in the Prelude if it's not there already, since it's not special syntax, it's just another operator.  The * *is* a special case, I suspect, though:  I bet it's only supported in kinds, not as the multiplication operator.) The one on the list is not a mathematical symbol. It should be ⋆ STAR OPERATOR U+22C6 or ∗ ASTERISK OPERATOR U+2217. > The problem with λ is that it's a perfectly valid Unicode lowercase letter.  There is 𝛌 > MATHEMATICAL BOLD SMALL LAMDA U+1D6CC but font support is often lacking, and it looks like Unicode categorizes *that* also as a lowercase letter.  If you can convince the Unicode Consortium to add a lambda that is of class symbol, Haskell can then make use of it — once there are fonts that support it.   There is   http://www.stixfonts.org/For typesetting with Xe[La]TeX or Lua[La]TeX, use XITS (in the TeXLive package). > (And then we'll have to deal with folks trying to use the letter, because everyone knows the Roman alphabet is the only one that matters and of *course* Greek letters are symbol characters....  Pfeh.) This is the big problem right now: how to enter these symbols efficiently. Hans _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe
Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

 In reply to this post by Ashok Gautham-4 On 21 Dec 2011, at 04:27, Ashok Gautham wrote: > On Tue, Dec 20, 2011 at 11:17:32PM +0100, Hans Aberg wrote: >> The monospace characters U+1D670-1D6A3 might be used for keywords. Font: >>  http://www.stixfonts.org/> > I feel that monospace fonts should be used for all of programming. A > language could use Unicode symbols, but if it enforces typography, it > is destined to win an award for being really unusable I have some books from the 1980s which does not use monospace; it seems to be a later movement. Using it for all symbols would be awkward. Hans _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe
Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

 In reply to this post by Hans Aberg-2 On Wed, Dec 21, 2011 at 04:51, Hans Aberg wrote: The one on the list is not a mathematical symbol. It should be ⋆ STAR OPERATOR U+22C6 or ∗ ASTERISK OPERATOR U+2217....except, at least in my current font, the former is microscopic and the latter not a whole lot better. The advantage of the one they chose is it's big and readable.  (That's part of why I assume it's intended for kinds, actually.) -- brandon s allbery                                      [hidden email]wandering unix systems administrator (available)     (412) 475-9364 vm/sms _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe
Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

 In reply to this post by Hans Aberg-2 IIRC, Scite's default configuration is with non-monospace font. I actually found it quite appealing, and in fact forgot about it entirely after some usage. It is much easier on the eyes to read. The difference is really whether you care about aligning things mid-line or not, not to mention editor support (i.e. not Vim or other terminal-based editor). On Wed, Dec 21, 2011 at 8:58 PM, Hans Aberg wrote: On 21 Dec 2011, at 04:27, Ashok Gautham wrote: > On Tue, Dec 20, 2011 at 11:17:32PM +0100, Hans Aberg wrote: >> The monospace characters U+1D670-1D6A3 might be used for keywords. Font: >>  http://www.stixfonts.org/ > > I feel that monospace fonts should be used for all of programming. A > language could use Unicode symbols, but if it enforces typography, it > is destined to win an award for being really unusable I have some books from the 1980s which does not use monospace; it seems to be a later movement. Using it for all symbols would be awkward. Hans _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe
Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

 In reply to this post by Brandon Allbery On 21 Dec 2011, at 11:03, Brandon Allbery wrote: > On Wed, Dec 21, 2011 at 04:51, Hans Aberg <[hidden email]> wrote: >> The one on the list is not a mathematical symbol. It should be ⋆ STAR OPERATOR U+22C6 or ∗ ASTERISK OPERATOR U+2217. >> > ...except, at least in my current font, the former is microscopic and the latter not a whole lot better. The advantage of the one they chose is it's big and readable.  (That's part of why I assume it's intended for kinds, actually.) This problem is in my editor for unstyled text due to that if it a symbol is not available in the font selected, it just chooses a glyph from the next font available in alphabetical order. Hopefully such problem will be resolved in the future. Hans _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe
Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

 In reply to this post by Jesse Schalken On 21/12/2011 10:09 AM, Jesse Schalken wrote: > IIRC, Scite's default configuration is with non-monospace font. I > actually found it quite appealing, and in fact forgot about it entirely > after some usage. It is much easier on the eyes to read. The difference > is really whether you care about aligning things mid-line or not, not to > mention editor support (i.e. not Vim or other terminal-based editor). SciTE's default binding /is/ proportional, not mono-space. I find it ever so irritating. Then again, I'm sure this one comes squarely down to personal preference, so it seems pointless to debate it. LaTeX offers the possibility of mid-line alignment even if you don't use monospace - a feature which I haven't seen in any other text processing system. It's a pitty this isn't more widespread... _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe
Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

 In reply to this post by Jesse Schalken On 21 Dec 2011, at 11:09, Jesse Schalken wrote: > IIRC, Scite's default configuration is with non-monospace font. I actually found it quite appealing, and in fact forgot about it entirely after some usage. It is much easier on the eyes to read. The difference is really whether you care about aligning things mid-line or not, not to mention editor support (i.e. not Vim or other terminal-based editor). Right, ASCII code that relies on monospace for such midline alignments can be quite unreadable, but otherwise it has nothing really to contribute. Non-monospace might in fact be more readable, taking away the fact that it may take some time to get used to it, since monospace has been used so much. For such alignments, one would either to write to code so it does not depend on it, or find some other means to do it. Hans > On Wed, Dec 21, 2011 at 8:58 PM, Hans Aberg <[hidden email]> wrote: > On 21 Dec 2011, at 04:27, Ashok Gautham wrote: > > > On Tue, Dec 20, 2011 at 11:17:32PM +0100, Hans Aberg wrote: > >> The monospace characters U+1D670-1D6A3 might be used for keywords. Font: > >>  http://www.stixfonts.org/> > > > I feel that monospace fonts should be used for all of programming. A > > language could use Unicode symbols, but if it enforces typography, it > > is destined to win an award for being really unusable > > I have some books from the 1980s which does not use monospace; it seems to be a later movement. Using it for all symbols would be awkward. > > Hans _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe
Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

 In reply to this post by Andrew Coppin On 21 Dec 2011, at 11:22, Andrew Coppin wrote: > On 21/12/2011 10:09 AM, Jesse Schalken wrote: >> IIRC, Scite's default configuration is with non-monospace font. I >> actually found it quite appealing, and in fact forgot about it entirely >> after some usage. It is much easier on the eyes to read. The difference >> is really whether you care about aligning things mid-line or not, not to >> mention editor support (i.e. not Vim or other terminal-based editor). > > SciTE's default binding /is/ proportional, not mono-space. I find it ever so irritating. Then again, I'm sure this one comes squarely down to personal preference, so it seems pointless to debate it. > > LaTeX offers the possibility of mid-line alignment even if you don't use monospace - a feature which I haven't seen in any other text processing system. It's a pitty this isn't more widespread... Monospace isn't used in math (except in the days when one used typewriters), but alignments are of course used in matrices and multiline formulas, for example, which may correspond to uses in computer code. A problem is that LaTeX is used for rendering typeset pages, and not really suitable for writing direct computer code, though Unicode characters can improve the readability of LaTeX source code. The link below shows an example. Hans http://www.charlietanksley.net/philtex/the-unicode-math-package-for-xelatex-and-the-stix-fonts/_______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe
Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

Open this post in threaded view
|

Re: If you'd design a Haskell-like language, what would you do different?

 >> - Function overloading without classes. If it's not done, there must >> be a good reason for it >> (many good reasons, probably), but I really miss it. > > That does not play well with type inference. I understand that. But it may be ok in many simple situations, which is actually where I tend to "need" it. For instance, the following wouldn't pose a problem, would it? f  :: Int -> Int -> Int f = (+) f :: String -> String -> String f = (++) (Not that I would use it for exactly that code, but anyway). I know that one can write that with classes and instances, but I just want to save myself the extra-coding when possible. In complex situations (where it doesn't play well with type inference), that's when I'd rather create classes and instances. Not for the type-checker, but for myself. > Also, see type-directed name resolution (TDNR) Thanks for that pointer. I found that proposal a few months ago, but had completely forgotten about it. I don't really like the proposed syntax; it's very OO-like. I agree with gabrielrf, who said "[...] I wonder if adding an obj.method style will be a hinderance to beginners, as it obscures what type inference can do." _______________________________________________ Haskell-Cafe mailing list [hidden email] http://www.haskell.org/mailman/listinfo/haskell-cafe