Re: [Factor-talk] A stub of a package manager

2014-12-18 Thread Andrea Ferretti
I added basic support for publishing. You can find the updated version
[here](https://github.com/andreaferretti/factor-package-manager) (I am
not calling it factor-package-manager to mean that it is official in
any way, I am just running out of repository names)

In fact, it published itself! :-)

This version is slightly changed from the old one, but the basics are the same.

I think now I will let it rest until some more experienced factorers
(is this the right word?) decide if it can have any use.

2014-12-17 20:15 GMT+01:00 Andrea Ferretti :
> I thought to use factor itself, as most package managers I have seen use an
> internal dsl for configuration (sbt, lein, bundler, metacello). Npm uses
> json, which is both a separate language and valid js. The only exception I
> know is maven.
>
> Of course, using yaml would be fine for me as well. Another possibility
> would be to avoid the syntax words and write configs with normal words. In
> fact this works right now, but the required words are currently private.
>
> Il giorno 17/dic/2014 19:41, "Jon Harper"  ha
> scritto:
>
>> Is a DSL better than a standard configuration data format ?
>>
>> For example, I worked on yaml serialization/deserialization
>> (http://docs.factorcode.org/content/article-yaml.html) because jckarter was
>> using it in https://gist.github.com/jckarter/3440892 so now this is
>> available.
>> Jon
>>
>> Jon
>>
>> On Wed, Dec 17, 2014 at 7:13 PM, mr wzrd  wrote:
>>>
>>> On 12/17/2014 09:20 AM, Andrea Ferretti wrote:
>>>
>>> Hi, following this [small
>>> discussion](https://news.ycombinator.com/item?id=8750720) I thought I
>>> might give a try at designing a simple package manager.
>>>
>>> Neat idea.
>>>
>>> One of the benefits to the "one big tree" that we have right now is that
>>> we guarantee to update your code as the standard library changes or
>>> improves.
>>>
>>>
>>> Regardless of whether a package manager is necessary or proper at the
>>> moment, it demonstrates that the complex trappings of modern software can be
>>> implemented in our "simple" stack-based-language.
>>>
>>>   - mrw
>>>
>>>
>>>
>>> --
>>> 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
>>> Factor-talk@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>>
>>
>>
>> --
>> 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
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>
>

--
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
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Multiple quotation reduce?

2014-12-18 Thread Mark Green
Hi,

Is there any version of reduce which accepts an array of values and an
array of quotations, and performs reduce but rather than calling the same
quotation every time, calls the quotation corresponding to the list
position of the value?

So that as
{ 1 2 3 } { } [ f ] reduce
is equivalent to
{ } 1 f 2 f 3 f

Thus
{ 1 2 3 } { } { [ f ] [ g ] [ h ] } multi-reduce
is equivalent to
{ } 1 f 2 g 3 h

Mark
--
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
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Multiple quotation reduce?

2014-12-18 Thread John Benediktsson
Hi Mark,

You could try this:

{ 1 2 3 } { [ f ] [ g ] [ h ] } { } [ call ] 2reduce

On Thu, Dec 18, 2014 at 4:38 PM, Mark Green 
wrote:
>
> Hi,
>
> Is there any version of reduce which accepts an array of values and an
> array of quotations, and performs reduce but rather than calling the same
> quotation every time, calls the quotation corresponding to the list
> position of the value?
>
> So that as
> { 1 2 3 } { } [ f ] reduce
> is equivalent to
> { } 1 f 2 f 3 f
>
> Thus
> { 1 2 3 } { } { [ f ] [ g ] [ h ] } multi-reduce
> is equivalent to
> { } 1 f 2 g 3 h
>
> Mark
>
>
> --
> 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
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
--
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
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] A stub of a package manager

2014-12-18 Thread Björn Lindqvist
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
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk