Re: [Bug-apl] A really simple component-file implementation

2014-04-21 Thread David Lamkins
I intend to. I'll probably use Github. This project kind of took on a life of its own. It started with the realization that I might be able to layer a component file system on top of apl-sqlite. I really didn't expect to end up with something that'd actually be useful. (This is my first real APL p

Re: [Bug-apl] A really simple component-file implementation

2014-04-21 Thread Elias Mårtenson
Can't you put this thing on Github or similar service to make access to the latest version easy? What source control software do you use for development? Regards, Elias On 22 April 2014 00:53, David B. Lamkins wrote: > Latest drop attached. > > - Updated for latest apl-sqlite (library name cha

Re: [Bug-apl] A really simple component-file implementation

2014-04-21 Thread David B. Lamkins
Latest drop attached. - Updated for latest apl-sqlite (library name changed). - Batched inserts added to performance test. cf.tar.gz Description: application/compressed-tar

Re: [Bug-apl] A really simple component-file implementation

2014-04-21 Thread Elias Mårtenson
What does the {tn} do in the call to cf∆with_transaction? On 21 April 2014 15:20, David B. Lamkins wrote: > On Sun, 2014-04-20 at 21:18 -0700, David B. Lamkins wrote: > > > One thing that's interesting is that cf∆append runs about twice as fast > > inside the transaction wrapper than it does wi

Re: [Bug-apl] A really simple component-file implementation

2014-04-21 Thread David B. Lamkins
On Sun, 2014-04-20 at 21:18 -0700, David B. Lamkins wrote: > One thing that's interesting is that cf∆append runs about twice as fast > inside the transaction wrapper than it does without. I imagine that > SQLite must be running several implicit transactions; these get deferred > by running the seq

Re: [Bug-apl] A really simple component-file implementation

2014-04-20 Thread Elias Mårtenson
Probably in the APL code with some support code in the library. The reason for this is that a native library can only have a single entry point, and that entry point has to be *either* an operator *or* a normal function. It's a normal function now, and I have no intention of changing that. Regards

Re: [Bug-apl] A really simple component-file implementation

2014-04-20 Thread David B. Lamkins
On Mon, 2014-04-21 at 12:21 +0800, Elias Mårtenson wrote: > I think that I should probably implement SQL∆with_transaction. It > belongs in the SQL layer. It's also the only way to ensure that > transaction rollback on error is handled correctly. I agree that that's probably the right place to do i

Re: [Bug-apl] A really simple component-file implementation

2014-04-20 Thread Elias Mårtenson
I think that I should probably implement SQL∆with_transaction. It belongs in the SQL layer. It's also the only way to ensure that transaction rollback on error is handled correctly. Regards, Elias On 21 April 2014 12:18, David B. Lamkins wrote: > One more code drop... > > I've factored out the

Re: [Bug-apl] A really simple component-file implementation

2014-04-20 Thread David B. Lamkins
One more code drop... I've factored out the encode and decode routines to make it easier to experiment with the storage format. I've added a cf∆with_transaction operator to simplify transaction support for applications that actually need it. This, I believe, is useful since it lets the applicatio

Re: [Bug-apl] A really simple component-file implementation

2014-04-20 Thread David B. Lamkins
On Sun, 2014-04-20 at 14:18 +0800, Elias Mårtenson wrote: > > Oh, and I'll be committing a fix within the next half hour that > actually implements transaction support for SQLite. Please use these > commands instead of directly calling begin/commit as SQL calls, since > the library will keep trac

Re: [Bug-apl] A really simple component-file implementation

2014-04-20 Thread David B. Lamkins
Here's one more update (see attached). Unless someone discovers an egregious bug or I find an order-of-magnitude breakthrough on the performance front (see below), this should be the last code drop for a while. + I've made most functions return some value so they can be used in a lambda. + I've

Re: [Bug-apl] A really simple component-file implementation

2014-04-19 Thread Elias Mårtenson
Unfortunately, the only standard way to do it in a non-database-specific way is to use a separate table like you do. I suppose that my SQL library could provide some kind of generalised API to it, but the problem is that different databases handle this in such a wildly different manner that it'd b

Re: [Bug-apl] A really simple component-file implementation

2014-04-19 Thread David B. Lamkins
Here's what I have so far (see attached). The tarball contains an APL dump file and a test-case file. I've stumbled upon a couple of GNU APL bugs; these have already been reported to bug-apl and are documented in the test-case file. I haven't yet done any performance testing. I'm intentionally le

Re: [Bug-apl] A really simple component-file implementation

2014-04-19 Thread David B. Lamkins
On Sat, 2014-04-19 at 17:20 -0500, Blake McBride wrote: > Very cool! I was going to implement a keyed file system according to > the idea present in my April 1 message. Sounds like you are 80% > there. I'll leave it up to you (since you are so close), or pick it > up when you need a break. Let

Re: [Bug-apl] A really simple component-file implementation

2014-04-19 Thread Blake McBride
Very cool! I was going to implement a keyed file system according to the idea present in my April 1 message. Sounds like you are 80% there. I'll leave it up to you (since you are so close), or pick it up when you need a break. Let me know if I can help. Thanks!! Blake On Sat, Apr 19, 2014

Re: [Bug-apl] A really simple component-file implementation

2014-04-19 Thread David B. Lamkins
Minor correction to make cf∆max_cn return a scalar: ∇z←cf∆max_cn tn ⍝ Return the component file's largest component number. z←↑'select max(oid) from component' SQL[4,tn] ⍬ ∇

[Bug-apl] A really simple component-file implementation

2014-04-19 Thread David B. Lamkins
Here's a really simple component-file implementation I cobbled together last night and this morning. This has been tested only lightly; I wouldn't advise pushing this code into production. ;) The implementation consists of nine functions and one variable. Call cf∆init to load the apl-sqlite libr