Recommendations for module hierarchy names for Python parser

Hi all, I've written a parser for Python 3.0 using Happy and Alex and I want to make it available as a library. I'd like some feedback on choosing the right module hierarchy names. I guess it is fairly clear that it should go in: Language The following document already has space for Language.Python: http://www.haskell.org/~simonmar/lib-hierarchy.html The nub of my question is really what to do about version numbers of Python? Currently my parser only supports Python 3.0. In the near future I will also support an earlier version from the 2 series. In case you don't know Python, version 3.0 is the latest version, which was released late 2008. It is not backwards compatible with earlier versions. I think it would be difficult, and probably a bad idea to try to merge a parser for Python 3.0 with a parser for an earlier version. I don't think I should use: Language.Python, since it is not clear which version of Python it is. Would it be better to have: Language.Python30 -- for version 3.0 and say: Language.Python26 -- for version 2.6 Or would it be better to have something like: Language.Python.Version30 Language.Python.Version26 In general my strategy has been to follow the structure of Language.C, but they appear to only have one version. Cheers, Bernie.

Bernie Pope schrieb:
Or would it be better to have something like:
Language.Python.Version30 Language.Python.Version26
In general my strategy has been to follow the structure of Language.C, but they appear to only have one version.
I think the version number should be part of the module name for the reasons you mention. Is Language.Python.30 Language.Python.26 also possible?

Henning Thielemann wrote:
I think the version number should be part of the module name for the reasons you mention. Is
Language.Python.30 Language.Python.26
also possible?
Good question. Where is this documented? http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#hi... "GHC supports a small extension to the syntax of module names: a module name is allowed to contain a dot ‘.’." This would also allow lowercase letters following a dot. Given: http://www.haskell.org/onlinelibrary/lexemes.html modid -> conid (modules) conid -> large {small | large | digit | ' } I would add: modid -> modid . modid (or make it a qualified conid: qconid) So Python.30 should beillegal. Why not use V30 or Ver30. Cheers Christian

On Fri, 2009-01-16 at 21:53 +1100, Bernie Pope wrote:
Or would it be better to have something like:
Language.Python.Version30 Language.Python.Version26
In general my strategy has been to follow the structure of Language.C, but they appear to only have one version.
There had been some discussion about variants in Language.C. Currently it does GNU C + C99 but if they were split then the suggestion was: Language.C.GNU Language.C.C99 Language.C.C89 Of course those are the common names of the versions. For Python where they are labelled with numbers rather than names then your suggestion of Language.Python.Version30 or Language.Python.V30 or whatever seems fine. Do you think it needs both digits? Would V2 and V3 not be enough? Surely V26 could read code intended for Python-2.4? And similarly a future Language.Python.V3 module that was compatible with Python-3.1 should still be able to read code for Python-3.0 right? Duncan

On 17/01/2009, at 12:18 AM, Duncan Coutts wrote:
On Fri, 2009-01-16 at 21:53 +1100, Bernie Pope wrote:
Or would it be better to have something like:
Language.Python.Version30 Language.Python.Version26
In general my strategy has been to follow the structure of Language.C, but they appear to only have one version.
There had been some discussion about variants in Language.C. Currently it does GNU C + C99 but if they were split then the suggestion was:
Language.C.GNU Language.C.C99 Language.C.C89
Of course those are the common names of the versions. For Python where they are labelled with numbers rather than names then your suggestion of Language.Python.Version30 or Language.Python.V30 or whatever seems fine. Do you think it needs both digits? Would V2 and V3 not be enough? Surely V26 could read code intended for Python-2.4? And similarly a future Language.Python.V3 module that was compatible with Python-3.1 should still be able to read code for Python-3.0 right?
Good point Duncan. Yes, I think the single digit is enough. I'm a bit torn between: Language.Python.Version3 and Language.Python.V3 The former is a bit long, but the latter is a bit obscure. I don't like the compromise of "Ver3"; it is hard to pronounce. Does anyone have a strong preference for or against the long or short version? If not, I will go with the long one. It's a pity module name components can't be just sequences of digits. Thanks everyone for your advice. Cheers, Bernie.

On Fri, Jan 16, 2009 at 11:53 AM, Bernie Pope
Would it be better to have:
Language.Python30 -- for version 3.0
and say:
Language.Python26 -- for version 2.6
Or would it be better to have something like:
Language.Python.Version30 Language.Python.Version26
Couldn't this lead to ambiguities (quite far) down the road? For example between Python 26.1 and Python 2.61? Cheers, Johan

On Fri, Jan 16, 2009 at 3:04 PM, Johan Tibell
On Fri, Jan 16, 2009 at 11:53 AM, Bernie Pope
wrote: Or would it be better to have something like:
Language.Python.Version30 Language.Python.Version26
Couldn't this lead to ambiguities (quite far) down the road? For example between Python 26.1 and Python 2.61?
Maybe use underscores to separate the digits: Language.Python.Version3 Language.Python.Version2_6 Bas
participants (6)
-
Bas van Dijk
-
Bernie Pope
-
Christian Maeder
-
Duncan Coutts
-
Henning Thielemann
-
Johan Tibell