Andrey Somov
2009-09-26 11:45:51 UTC
Hi all,
I like Mercurial. And I am sure a pure Java implementation would help
Mercurial to be spread even wider.
The idea is to be able to work on the same repository with both hg and a
pure Java implementation.
Since Jython (most probably) will never be able to run Mercurial, there
is only one option left: to re-write Mercurial in pure Java.
Unfortunately Java does not support/have out of the box some Python
features which are heavily used in Mercurial:
- generators
- decorators
- tuples
- symbolic links
- struct
- heapq
- file-like objects
- slices and negative indices for lists
- functions are not first-class objects and cannot be passed or used as
arguments
- classes cannot be "callable"
- functions may only return one type
- regular expressions look and work slightly different
It means that these (and many other Python features/modules) have to be
somehow reimplemented.
It would be also profitable for Python Mercurial. Since I have to read
and understand each and every line of code I will try to report any
place where the code may be improved (I have already submitted a few
patches to increase code readability)
The main goal of the Java library is not to serve as CLI (here hg is the
best) but to be included in another Java application (IDE for instance).
The big obstacle here is the GPL license. If the Java version is
released under the GPL2 or 3 licenses it will make it impossible to
include the library into many other applications (even Open Source like
Eclipse).
Even though it is possible to write Java code without consulting the
source code (Mercurial is quite well documented) it is very beneficial
to see the source. But then as far as I understand it would be
considered as "Derivative work" it terms of the GPL license.
Here is my question:
May I base the Java library on the Mercurial code but release it with
another Open Source license?
I am specifically interested in Apache License v2.0. (in the same way
how it has happened with JGit)
-
Andrey Somov
I like Mercurial. And I am sure a pure Java implementation would help
Mercurial to be spread even wider.
The idea is to be able to work on the same repository with both hg and a
pure Java implementation.
Since Jython (most probably) will never be able to run Mercurial, there
is only one option left: to re-write Mercurial in pure Java.
Unfortunately Java does not support/have out of the box some Python
features which are heavily used in Mercurial:
- generators
- decorators
- tuples
- symbolic links
- struct
- heapq
- file-like objects
- slices and negative indices for lists
- functions are not first-class objects and cannot be passed or used as
arguments
- classes cannot be "callable"
- functions may only return one type
- regular expressions look and work slightly different
It means that these (and many other Python features/modules) have to be
somehow reimplemented.
It would be also profitable for Python Mercurial. Since I have to read
and understand each and every line of code I will try to report any
place where the code may be improved (I have already submitted a few
patches to increase code readability)
The main goal of the Java library is not to serve as CLI (here hg is the
best) but to be included in another Java application (IDE for instance).
The big obstacle here is the GPL license. If the Java version is
released under the GPL2 or 3 licenses it will make it impossible to
include the library into many other applications (even Open Source like
Eclipse).
Even though it is possible to write Java code without consulting the
source code (Mercurial is quite well documented) it is very beneficial
to see the source. But then as far as I understand it would be
considered as "Derivative work" it terms of the GPL license.
Here is my question:
May I base the Java library on the Mercurial code but release it with
another Open Source license?
I am specifically interested in Apache License v2.0. (in the same way
how it has happened with JGit)
-
Andrey Somov