Great work Andrea!
Factor needs a package management system eventually. Programmers have
this strange infatuation with packages and unless the language offers
it, it's just not taken seriously. Maybe because people are customed
to the language core being almost closed and the bar uber high for
contributions so people feel they need to release their own packages
to contribute.
I think Factor's community is more open than that and John and Doug
are amazingly responsive on the bug tracker. So if you have any
worthwhile code to contribute, just make a pull request and it will be
merged quickly. Then you'll get code maintenance for free in case the
language changes and your test suite is setup to run nightly which
catches bugs.
So I tried to get your package manager to work, but something goes wrong:
USE: packages.example
"example-project" activate
Added "packages.projects" vocabulary to search path
More than one file found for vocabulary: example-project
Type :help for debugging help.
Maybe the code is in flux? Anyway, here are some random thoughts about
your implementation:
* You can't have one voacb root per package. If you run "threads." in
the listener, you'll see that there is one thread for each of the
three roots. They monitor that directory tree and reloads vocabs
that change automatically. See
http://docs.factorcode.org/content/article-vocabs.refresh.html So
yes, there are performance problems.
* So for example, to install your monoid package, I run:
$ git clone https://github.com/andreaferretti/factor-monoid
$ cp -r factor-monoid/monoid /opt/factor64/lib/factor/extra
(Thats where my resources:extra is) And in the listener:
IN: scratchpad USE: monoid
IN: scratchpad 3 3 |+| .
6
No need to restart Factor or any other setup to get it
going. Suppose then you released a new version of monoid, I would
copy it to /opt/factor64/lib/factor/extra and then simply run:
IN: scratchpad refresh-all
Loading resource:extra/monoid/monoid.factor
Factor would then recompile your monoid vocab and not only that, all
vocabs I have loaded that uses monoid would automatically be
recompiled too.
Uninstallation is a sore point though and that's where I think a
package managerwould really shine.
* Maybe we can repurpouse resource:extra as the package installation
url? In a way it already is. Or we could add a specific
resource:packages root.
* I like that the configuration is Factor code, but I think you went
to syntax happy. :) A simple assoc would suffice:
{
{ project "example-project" }
{ url "https://github.com/andreaferretti/factor-example.git" }
{ version "0.1.0" }
{ dependencies {
"https://github.com/andreaferretti/factor-packages.git"
"https://github.com/andreaferretti/factor-options.git"
} }
}
Also the standard convention is to have metadata inside the
vocabulary's own directory. So why not have it in say
monoid/monoid-pkg.factor? It would be symmetrical with the
-docs.factor and -tests.factor suffixes.
* You might also want to look into Factor's application deployment
system: http://docs.factorcode.org/content/article-tools.deploy.html
because deployment has many similarities with making packages. Also
see the summary.txt, authors.txt, deploy.factor and tags.txt
files. Possibly they could all be merged into one
vocabname-meta.factor file?
* I realised you've spent a lot of thought thinking about how
dependencies and especially transitive dependencies should
work. Personally, I think it's way, way, to soon to think about that
and a package manager that just handled the packaging and not any
deps would still be really useful.
* Feel free to ignore all my points above. :) It's ofcourse better if
a package manager is created than that bikeshedding prevents it from
ever happening.
--
mvh/best regards Björn Lindqvist
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk