darcs

Issue 1149 darcs API

Title darcs API
Priority wishlist Status given-up
Milestone 2.8.0 Resolved in
Superseder task: rethink DarcsFlag
View: 1157
Nosy List darcs-devel, dmitry.kurochkin, galbolle, kowey, mafo, thorkilnaur, tux_rocker
Assigned To
Topics Devel, Library

Created on 2008-10-17.09:07:27 by mafo, last changed 2017-07-31.00:00:21 by gh.

Messages
msg6338 (view) Author: mafo Date: 2008-10-17.09:07:25
I would like to build a small continous integration tool.
For this purpose,
it would be graet if there was an Haskell-API for darcs,
such that one can import darcs as a Module from within Haskell
and call darcs-functions from Haskell, bypassing the commandline interface
msg6339 (view) Author: droundy Date: 2008-10-17.15:14:54
This is the familiar libdarcs request.  We'd like to have a libdarcs,
but I want to have a safe API first.

Of  course, we could have a libdarcs that couldn't modify
repositories, and that would be inherently safe, it's just that most
requesters don't want that.

David

On Fri, Oct 17, 2008 at 5:07 AM, mafo <bugs@darcs.net> wrote:
> I would like to build a small continous integration tool.
> For this purpose,
> it would be graet if there was an Haskell-API for darcs,
> such that one can import darcs as a Module from within Haskell
> and call darcs-functions from Haskell, bypassing the commandline interface
msg6340 (view) Author: kowey Date: 2008-10-17.15:22:36
On Fri, Oct 17, 2008 at 15:14:56 -0000, David Roundy wrote:
> Of  course, we could have a libdarcs that couldn't modify
> repositories, and that would be inherently safe, it's just that most
> requesters don't want that.

Could this be a libdarcs 0.0?
msg6341 (view) Author: droundy Date: 2008-10-17.15:51:02
On Fri, Oct 17, 2008 at 11:20 AM, Eric Kow <kowey@darcs.net> wrote:
> On Fri, Oct 17, 2008 at 15:14:56 -0000, David Roundy wrote:
>> Of  course, we could have a libdarcs that couldn't modify
>> repositories, and that would be inherently safe, it's just that most
>> requesters don't want that.
>
> Could this be a libdarcs 0.0?

It could be.  One annoyance is that building of packages and
executables from the same object files broke between ghc 6.6 and ghc
6.8, which breaks what was originally a feature of franchise (before I
tried ghc 6.8.2).  And which means that building a libdarcs is going
to double darcs' compile time.

However, I still hold that there's little point in going to the effort
of creating a libdarcs before anyone exists to use it.  Developing a
good API is hard, and developing a good API that isn't used is close
to impossible.  The best answer to this, of course, is to use the API
ourselves, which is what I'd rather try to do first.  Once we have a
decent API used within darcs, then creating a libdarcs will make a lot
more sense.

David
msg6344 (view) Author: kowey Date: 2008-10-20.08:42:10
The familiar request is a good sign that we have users for an eventual libdarcs.
    Concrete use cases would be welcome though.
msg6373 (view) Author: galbolle Date: 2008-10-21.20:59:38
The first application i see for a libdarcs would be to have a more evolved patch
selection/review mechanism. For example, a graphical darcs pull/whatsnew… For
this we would probably not be manipulating the repository dirtily, but we would
need to expose patch sequences, dependencies and so on.
msg6374 (view) Author: dagit Date: 2008-10-21.21:14:10
On Tue, Oct 21, 2008 at 1:59 PM, Florent Becker <bugs@darcs.net> wrote:
>
> Florent Becker <florent.becker@ens-lyon.org> added the comment:
>
> The first application i see for a libdarcs would be to have a more evolved patch
> selection/review mechanism. For example, a graphical darcs pull/whatsnew… For
> this we would probably not be manipulating the repository dirtily, but we would
> need to expose patch sequences, dependencies and so on.

While I agree with you, I think what David was suggesting was that we
need to use our own API before we know it will work well.

I've been thinking for a while now that we're not that far from an API
at the moment.  We have the patch core, we have the repository layer
on top of that and then we have all the command logic.  The command
logic should be refactored to just depend on the repository layer.
The repository layer should just depend on the patch core.  Once we
have that then the abstractions posed by the repository layer are
meant to be the API.  Additionally, we should and could provide some
of the functionality in the commands through this API so that common
tasks for consumers of the API can be handled in ways that are
consistent with darcs itself.  I explain this as, darcs should just
become the canonical example of how to use libdarcs.  Where in reality
what I mean is that we have a libpatch and librepository to match the
layers I mentioned above.  Then libdarcs would really be a those two
libraries repackaged with some convenience functions.  All the cool
patch selection magic, revert, interactive stuff are implemented using
our UI logic that is outside of libdarcs.

One thing Eric pointed out to me on IRC is that as we converge on an
API we'll likely get it wrong.  I think this mostly comes down to
managing expectation.  We don't want to set the API in stone because
then it becomes something we don't want to use and we would have to
keep extending it to fix bugs, add features and so on.  I take this to
mean that we have to tell people it's experimental, we'll need to be
able to deprecate things and otherwise change things up without fear
of annoying projects that use the API.  I think a mature API will come
out of this process naturally.  That is to say, it will be more
painful if we try to force it to be a mature stable API.

I hope that clarifies some of my thinking.

Jason
msg6375 (view) Author: droundy Date: 2008-10-21.21:23:33
On Tue, Oct 21, 2008 at 02:14:00PM -0700, Jason Dagit wrote:
> I hope that clarifies some of my thinking.

Which pretty much agrees with mine on this front, and was pretty
well-expressed...  so I won't write my own opinion here.

David
msg8390 (view) Author: kowey Date: 2009-08-23.11:17:08
I'm setting this to a slightly far-off release and deferring.

We already have a libdarcs in the sense that darcs is exposed as library on
hackage.  Now we need to converge towards a proper API as Jason suggests in msg6374.

Here's a possible plan:
1. Finish type witness work
2. Split off patch library
3. Split off repository library

I suspect that we're only going to get there through constant whittling.
msg11495 (view) Author: tux_rocker Date: 2010-06-20.13:56:56
And a further important point: have no modules in the top level of the
name space, like Printer currently is.

Deferring for another release.
History
Date User Action Args
2008-10-17 09:07:27mafocreate
2008-10-17 15:14:56droundysetstatus: unread -> unknown
nosy: + droundy
messages: + msg6339
2008-10-17 15:22:38koweysetnosy: droundy, kowey, dagit, simon, thorkilnaur, dmitry.kurochkin, mafo
messages: + msg6340
2008-10-17 15:51:04droundysetnosy: droundy, kowey, dagit, simon, thorkilnaur, dmitry.kurochkin, mafo
messages: + msg6341
2008-10-20 08:42:12koweysetnosy: droundy, kowey, dagit, simon, thorkilnaur, dmitry.kurochkin, mafo
messages: + msg6344
title: Using darcs from within Haskell -> libdarcs
2008-10-21 20:59:40galbollesetnosy: + galbolle
messages: + msg6373
2008-10-21 21:14:13dagitsetnosy: droundy, kowey, dagit, simon, thorkilnaur, dmitry.kurochkin, galbolle, mafo
messages: + msg6374
2008-10-21 21:23:35droundysetnosy: droundy, kowey, dagit, simon, thorkilnaur, dmitry.kurochkin, galbolle, mafo
messages: + msg6375
2008-10-23 12:46:00koweysetnosy: droundy, kowey, dagit, simon, thorkilnaur, dmitry.kurochkin, galbolle, mafo
superseder: + task: rethink DarcsFlag
2008-11-25 16:20:09koweylinkissue1242 superseder
2009-08-06 18:01:19adminsetnosy: + markstos, jast, Serware, darcs-devel, zooko, mornfall, tommy, beschmi, - droundy, galbolle, mafo
2009-08-06 21:13:29adminsetnosy: - beschmi
2009-08-10 21:49:56adminsetnosy: + mafo, galbolle, - tommy, markstos, darcs-devel, zooko, jast, Serware, mornfall
2009-08-10 23:48:28adminsetnosy: - dagit
2009-08-23 11:17:13koweysetstatus: unknown -> deferred
nosy: kowey, simon, thorkilnaur, dmitry.kurochkin, galbolle, mafo
topic: + Devel, Target-2.5
messages: + msg8390
title: libdarcs -> darcs API
2009-08-25 17:31:22adminsetnosy: + darcs-devel, - simon
2009-08-27 01:37:17koweysetnosy: kowey, darcs-devel, thorkilnaur, dmitry.kurochkin, galbolle, mafo
2009-08-27 14:30:27adminsetnosy: kowey, darcs-devel, thorkilnaur, dmitry.kurochkin, galbolle, mafo
2010-03-20 16:36:10koweysettopic: + Library
2010-06-15 20:51:43adminsetmilestone: 2.5.0
2010-06-15 20:58:54adminsettopic: - Target-2.5
2010-06-20 13:56:57tux_rockersetnosy: + tux_rocker
messages: + msg11495
milestone: 2.5.0 -> 2.8.0
2017-07-31 00:00:21ghsetstatus: deferred -> given-up