RE: Lang. (was Re: Alternative hierarchy proposal)

Malcolm Wallace writes:
One abbreviation I have always disliked intensely though is Lang. [snip]
The other thing that bothers me about Lang is that I don't see the connection between many of the things proposed to go into it, and the Haskell language itself. The FFI is the best candidate, because it clearly extends the source language. Likewise, Generics and Dynamic. But why should libraries like Array, Memo, and Monad be in Lang? They don't extend the language. And of course some things /not/ currently in Lang seem to have everything to do with the language - like the Haskell source parser, abstract syntax, source pretty-printer etc.
I disagree. Lang (or Language if you like, or HaskellLanguageFeatures) is a *semantic* category. It contains libraries which provide access to language features. It's not a perfect categorisation (eg. you could argue that Monads aren't really a language feature, or that Chars are), but in most cases it's obvious what belongs in Lang, and that's the main thing. On the other hand, Haskell in your proposal isn't a semantic category. The similarity between the contents seems to be in name only: it's like saying that "Biography" and "Biology" books belong on the same shelf because they both begin with "Bio".
These were the reasons I proposed a hierarchy like
Haskell Plus Foreign Generics Dynamic Language AbstractSyntax Parse PrettyPrint
Here in my scheme, Haskell.Plus contains extensions to the language, and Haskell.Language contains utilities to manipulate the source language itself. Simon proposed Haskell.Source for the latter, which would also be a fine name, provided there were no Haskell.Lang category to confuse you.
By all means change the name "Lang" to something more mnemonic and unambiguous, but I like the current meaning (and I have to admit it was chosen for its similarity to Java and the existing hslibs layout).
My final difficulty with the Lang category is that, if it contains extensions to the language, people will be misled into thinking that the extensions are truly a part of the language standard. After all, they are categorised in Lang! In my opinion, a clearer name is needed, to emphasise the extensional nature of some of the libraries.
I don't agree with separating extensions (as you probably noticed from my proposal :-). If we separate language extensions into a separate hierarchy, code will be broken when/if these extensions become part of the base language. Ok so that's probably a long way off, but I don't feel comfortable with a design which we're accepting will inevitably change later. I *do* however believe that extensions should be standardised, so that if a compiler implements a particular extension, it should match other implementations of that extension. You're probably concerned that code which purports to be Haskell 98 will accidentally make use of non-standard libraries - well for a start, the extended module namespace is itself an extension, and secondly it will be easy to restrict the libraries that are available according to compiler flags: at the moment with GHC, if you don't say -fglasgow-exts or -package <anything>, then you get Haskell 98. Full stop. The trouble is, Haskell 98 isn't very useful on its own... Cheers, Simon

Simon Marlow wrote:
I disagree. Lang (or Language if you like, or HaskellLanguageFeatures) is a *semantic* category. It contains libraries which provide access to language features.
Are you saying that there are language features which cannot be accessed without these libraries?
but in most cases it's obvious what belongs in Lang, and that's the main thing.
That's just the trouble: I don't find the contents of Lang to be obvious at all. I simply don't see the semantic relationship between the various modules. If I, as a Haskell language implementor, have difficulty understanding it, I'm sure other people will too.
On the other hand, Haskell in your proposal isn't a semantic category. The similarity between the contents seems to be in name only: it's like saying that "Biography" and "Biology" books belong on the same shelf because they both begin with "Bio".
Well, I disagree completely. I proposed "Haskell." precisely because it /is/ a semantic category, in contrast to "Lang." But that's just my view. Both you and Marcin don't see the connection, so I'll happily retract that part of my layout proposal, and search for an even better categorisation.
By all means change the name "Lang" to something more mnemonic and unambiguous, but I like the current meaning (and I have to admit it was chosen for its similarity to Java and the existing hslibs layout).
I'm afraid I don't know enough about Java even to know what java.lang.* contains! And my confusion about Haskell.Lang. applies equally to hslibs/lang. I can't think of a less ambiguous name for the category, because I simply don't know what the category is.
I don't agree with separating extensions (as you probably noticed from my proposal :-). If we separate language extensions into a separate hierarchy, code will be broken when/if these extensions become part of the base language.
I understand. I'm even beginning to shift my point of view towards yours. But there remains a difficulty. What if two people develop similar extensions, but with different syntax/semantics, each in a different compiler?
I *do* however believe that extensions should be standardised, so that if a compiler implements a particular extension, it should match other implementations of that extension.
That depends on whether the original author of the extension got the design right, doesn't it? :-) Regards, Malcolm

Mon, 12 Mar 2001 20:22:03 +0000, Malcolm Wallace
Are you saying that there are language features which cannot be accessed without these libraries?
(I can't speak for Simon, but probably) yes. Features whose implementations rely on details of a particular runtime system. Those libraries provide the primary lowest level interface to them. They include all the magic types like Ptr, ForeignPtr, StablePtr, Weak, ByteArray, ST, Dynamic, Exception, MVar. And of course standard types like Integer, IO, Handle, but they are already in Haskell 98's libraries or even in Prelude. After some thought I am not convinced at all that we should make this distinction in the module namespace. This is implementors' job, not users'. A user doesn't care if FiniteMap is a builtin type or a container defined in Haskell 98, and whether an unboxed array is a builtin or a wrapper around ForeignPtr + Storable. We should probably put the corresponding modules under appropriate categories like data structures, FFI, I/O, concurrency, interaction with the system etc. Categories which reflect situations where these modules are used, not how they are defined. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTÊPCZA QRCZAK
participants (3)
-
Malcolm Wallace
-
qrczak@knm.org.pl
-
Simon Marlow