Taking the GPL plunge
One thing I'd like to have in Fabric is decimal (base 10) arithmetic. Most languages have IEEE floating point support, but it causes all sorts of problems that are often subtle and bite you at odd moments.
So instead I'd like to use a decimal arithmetic floating point library. Unlike regular floating point, decimal arithmetic always comes out the same answer you'd get working it out with pencil and paper. The only problem is I can't find a public domain one, the only I can find is from IBM available under the GPL license. That means (I think) I am compelled to provide the source for Fabric under a GPL compatible license. And also CouchDb. Right?
I was probably going to do that anyway, but once I incorporate this library, I no longer have a choice. At least that's my understanding of it.
Quick update, the Fabric formula engine is quite far along. While its still quite rough around the edges, I've now got all this working:
+ addition/string concatenation
- subtraction/negation
* multiplication
/ division
: list concanation
== equality
~= case insensitive equality
!= not equal
< less than
> greater than
<= less than or equal
>= greater than or equal
:= variable/field assignment
[] array subscript/slice
|| logical OR
&& logical AND
! logical NOT
++ increment
-- decrement
id variable/field reference
.. field concatenation range
Literals:
Numbers 1 : 1.2 : 1.2e10
Strings "foo" : 'foo'
Keywords [SomeKeyword] : [AnotherKeyword]
Date-Times [10/24/1973 5:00 pm]
Flow Control:
if/else
forall
user defined functions (including recursion)
My next big tasks are getting the code well organized and commented and writing a formula test suite.
Posted January 2, 2006 9:35 PM

Comments
Yes, you've got the idea of the GPL correctly.
Effectively, the GPL means that you always have to acknowledge the copyright, and you get a license to re-use and modify with abandon. Whoever gave you the GPL software - be it a complete application or a library - must also make source code available, under the same license, for free. (I think a small amount to cover copying costs is allowed, although that really dates back to the days of floppies & BBSes!)
The GPL has little effect on you whilst your code remains yours. However, the moment you distribute your code - and therefore redistribute that library - you are obliged to obey the GPL and not charge for your efforts, and make source code available.
This is why I quite like the GPL. It's a hacker's license. I can go fetch GPL products, and tweak them to my heart's content to suit my own environment. However, if I modify it significantly and want to re-release it, I can't profit from it (remember, some of the work wasn't mine - I modified something!) and I have to extend the same courtesy to everyone that the orginal author(s) extended to me.
It's not something you can sell software with, IMO. But it is something you can sell services alongside (support, or even the service that your software provides), and something that you can enrich the world with.
I've pretty much made my mind up that my current developments will all be GPLd. Glad to hear that you're looking to do the same. :-)
Philip Storry, January 3, 2006 6:12 PM
Philip's account of the GPL is incorrect. There is NO restriction on profiting from GPL'ed software. The GPL is designed to protect the rights of the person receiving the code so that may do WHATEVER they like with it (but must also pass on the source code).
See: http://www.opensource.org/licenses/gpl-license.php
"For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights."
There is much confusion over opensource and the GPL. The two are not the same. The GPL is cannibalistic by nature in that you must make all of your code available under the GPL if you include GPL'ed source code in your derrived work. Some other licenses may be more suited (or roll your own).
"You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above..."
My advice on the opensource issue is to wait. The move to opening the code is a one-way street. Also chances are you will be the only developer or one of very few. I don't think you will have any more immediate advantage to gain from opening the code than simply giving Couch away for free. If in a year or two as couch approaches maturity you still feel the same way, then you can still do it.
Brendon Upson, January 4, 2006 10:35 PM
You could write it in such a way as to make the arithmatic library pluggable. Personally I think it is a fantastic idea to use a decimal library. There is some performance overhead, but who cares these days? The benefits of @round actually working would be huge. Incidentally having a lot of options on the round function would be cool, e.g. round up/down/towards zero/ alternate rounding of .5 etc. The number of significant figures or decimal places is also interesting to do properly.
Alan Bell, January 12, 2006 5:35 AM
oh, and arbitary precision would be cool too!
Alan Bell, January 12, 2006 6:05 AM
Post a comment