unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* re-writing algorithms in Guile
@ 2021-06-28 21:38 Tim Meehan
  2021-06-28 21:50 ` Zelphir Kaltstahl
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Tim Meehan @ 2021-06-28 21:38 UTC (permalink / raw)
  To: guile-user

Say for instance, I have found an algorithm for scalar function
minimization on a website, written in C. It is posted with a license for
use. If I write something based on this hypothetical code, is it then
clearly also licensed in the same manner?

Granted, I know that this is guile-user and not guile-lawyer, but in many
cases the transformation from procedural to functional is kind of a radical
re-imagining. I usually try to contact the people and ask them directly,
but was wondering what was the general consensus in cases where the
original author did not answer?


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: re-writing algorithms in Guile
  2021-06-28 21:38 re-writing algorithms in Guile Tim Meehan
@ 2021-06-28 21:50 ` Zelphir Kaltstahl
  2021-06-29  4:09   ` Nate Rosenbloom
  2021-06-29  5:26 ` Jay Sulzberger
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Zelphir Kaltstahl @ 2021-06-28 21:50 UTC (permalink / raw)
  To: Tim Meehan; +Cc: guile-user

Don't take my words for words of a lawyer:

/opinion

I personally think, that something like a general algorithm cannot be limited
off and away from usage in society. I don't know about the law specifics, but if
there was a law against rewriting an algorithm, then it would be a quite stupid
law, as it would only serve to hinder progress of society.

However, as we all know the law is rarely written by experts. A lot of stupid
things are in there. It does not always take the good of society into account
and sometimes is even biased towards protecting the ones in power and with
financial resources. So it could very well be, that this is one of the cases,
where the law is stupid, or one, where it depends on what kind of day the judge
has or how well the judge knows software and code.

Furthermore I think, that rewriting the algorithm into a purely functional one
is often a significant work on its own and definitely adding enough of ones own
work to make it a separate thing in total.

/opinion end

On 6/28/21 11:38 PM, Tim Meehan wrote:
> Say for instance, I have found an algorithm for scalar function
> minimization on a website, written in C. It is posted with a license for
> use. If I write something based on this hypothetical code, is it then
> clearly also licensed in the same manner?
>
> Granted, I know that this is guile-user and not guile-lawyer, but in many
> cases the transformation from procedural to functional is kind of a radical
> re-imagining. I usually try to contact the people and ask them directly,
> but was wondering what was the general consensus in cases where the
> original author did not answer?

-- 
repositories: https://notabug.org/ZelphirKaltstahl




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: re-writing algorithms in Guile
  2021-06-28 21:50 ` Zelphir Kaltstahl
@ 2021-06-29  4:09   ` Nate Rosenbloom
  2021-06-29  4:38     ` Vivien Kraus via General Guile related discussions
  0 siblings, 1 reply; 13+ messages in thread
From: Nate Rosenbloom @ 2021-06-29  4:09 UTC (permalink / raw)
  To: Zelphir Kaltstahl; +Cc: guile-user

Note: Not a Lawyer. But according to this stack exchange thread
https://opensource.stackexchange.com/questions/1798/what-license-options-do-i-have-for-licensing-ported-source-code
(and according to my intuitive understanding of the term) porting code to a
new language would constitute a derivative work since the algorithm itself
stays the same. So you'd need to license the code using whatever provisions
the existing code has for derivative works.
-
Nate

On Mon, Jun 28, 2021 at 9:50 PM Zelphir Kaltstahl <
zelphirkaltstahl@posteo.de> wrote:

> Don't take my words for words of a lawyer:
>
> /opinion
>
> I personally think, that something like a general algorithm cannot be
> limited
> off and away from usage in society. I don't know about the law specifics,
> but if
> there was a law against rewriting an algorithm, then it would be a quite
> stupid
> law, as it would only serve to hinder progress of society.
>
> However, as we all know the law is rarely written by experts. A lot of
> stupid
> things are in there. It does not always take the good of society into
> account
> and sometimes is even biased towards protecting the ones in power and with
> financial resources. So it could very well be, that this is one of the
> cases,
> where the law is stupid, or one, where it depends on what kind of day the
> judge
> has or how well the judge knows software and code.
>
> Furthermore I think, that rewriting the algorithm into a purely functional
> one
> is often a significant work on its own and definitely adding enough of
> ones own
> work to make it a separate thing in total.
>
> /opinion end
>
> On 6/28/21 11:38 PM, Tim Meehan wrote:
> > Say for instance, I have found an algorithm for scalar function
> > minimization on a website, written in C. It is posted with a license for
> > use. If I write something based on this hypothetical code, is it then
> > clearly also licensed in the same manner?
> >
> > Granted, I know that this is guile-user and not guile-lawyer, but in many
> > cases the transformation from procedural to functional is kind of a
> radical
> > re-imagining. I usually try to contact the people and ask them directly,
> > but was wondering what was the general consensus in cases where the
> > original author did not answer?
>
> --
> repositories: https://notabug.org/ZelphirKaltstahl
>
>
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: re-writing algorithms in Guile
  2021-06-29  4:09   ` Nate Rosenbloom
@ 2021-06-29  4:38     ` Vivien Kraus via General Guile related discussions
  2021-06-29 13:52       ` Nate Rosenbloom
  0 siblings, 1 reply; 13+ messages in thread
From: Vivien Kraus via General Guile related discussions @ 2021-06-29  4:38 UTC (permalink / raw)
  To: Nate Rosenbloom, Zelphir Kaltstahl; +Cc: guile-user

Hello,

Le mardi 29 juin 2021 à 04:09 +0000, Nate Rosenbloom a écrit :
> since the algorithm itself
> stays the same.

This reason is not stated in the Stack Exchange post, and I believe
it’s inaccurate (although, I am not a lawyer either). I think the
reason is that you are reading the original implementation to write
your own, so you are some kind of a compiler, or translator (as for
human spoken languages). As such, what you write is mostly the other
person’s work, so you should not claim copyright about it.

However, if you are writing a computer program based on the description
of the algorithm that you would find in a peer-reviewed scientific
paper (that’s what you should be doing, because the paper will prove to
you that the algorithm is correct and efficient at solving the
problem), then it’s a different story, because copying mathematical
expressions is OK (it is proven that it’s the only correct outcome, so
there’s no copyright to claim here).




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: re-writing algorithms in Guile
  2021-06-28 21:38 re-writing algorithms in Guile Tim Meehan
  2021-06-28 21:50 ` Zelphir Kaltstahl
@ 2021-06-29  5:26 ` Jay Sulzberger
  2021-06-29  6:08   ` Dr. Arne Babenhauserheide
  2021-06-29  6:08 ` Dr. Arne Babenhauserheide
  2021-06-29  7:56 ` tomas
  3 siblings, 1 reply; 13+ messages in thread
From: Jay Sulzberger @ 2021-06-29  5:26 UTC (permalink / raw)
  To: guile-user

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed, Size: 2281 bytes --]


On Mon, 28 Jun 2021, Tim Meehan <btmeehan@gmail.com> wrote:

> Say for instance, I have found an algorithm for scalar function
> minimization on a website, written in C. It is posted with a license for
> use. If I write something based on this hypothetical code, is it then
> clearly also licensed in the same manner?
>
> Granted, I know that this is guile-user and not guile-lawyer, but in many
> cases the transformation from procedural to functional is kind of a radical
> re-imagining. I usually try to contact the people and ask them directly,
> but was wondering what was the general consensus in cases where the
> original author did not answer?

Algorithms cannot be copyrighted.

See

https://www.copyright.gov/circs/circ31.pdf

Here is a quote from the article:

   United States Copyright Office

   Ideas, Methods, or Systems

   What Is Not Protected by Copyright

   Copyright law does not protect ideas, methods, or systems.
   Copyright protection is therefore not available for ideas or
   procedures for doing, making, or building things scientific or
   technical methods or discoveries; business operations or
   procedures; mathematical principles; formulas or algorithms; or
   any other concept, process, or method of operation

   Section 102 of the Copyright Act (title 17 of the U.S. Code)
   clearly expresses this principle: “In no case does copyright
   protection for an original work of authorship extend to any idea,
   procedure, process, system, method of operation, concept,
   principle, or discovery, regardless of the form in which it is
   described, explained, illustrated, or embodied in such
   work.”

   Inventions are subject matter for patents, not copyrights.
   For information about patent laws, contact

   Commissioner for Patents
   U. S. Patent and Trademark Office
   P.  O . Box 1450
   Alexandria, VA 22313-1450
   (800) 786-9199
   www.uspto.gov

Your program in Guile Scheme which realizes an algorithm is not a
derivative work of the program you read, which program is written in
C.  Even in the case that your program realizes the same algorithm as
the C program does.  The above official article of the US Copyright
Office clearly states this.

oo--JS.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: re-writing algorithms in Guile
  2021-06-29  5:26 ` Jay Sulzberger
@ 2021-06-29  6:08   ` Dr. Arne Babenhauserheide
  0 siblings, 0 replies; 13+ messages in thread
From: Dr. Arne Babenhauserheide @ 2021-06-29  6:08 UTC (permalink / raw)
  To: Jay Sulzberger; +Cc: guile-user

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]


> Your program in Guile Scheme which realizes an algorithm is not a
> derivative work of the program you read, which program is written in
> C.  Even in the case that your program realizes the same algorithm as
> the C program does.  The above official article of the US Copyright
> Office clearly states this.

That is only true, if you do not re-use any structure of the original
program that is not part of the algorithm.

If you want to be sure, you need a cleanroom re-implementation: Have
someone else read the code and write down the pure algorithm. Then
implement that without ever having seen the original code.
https://en.wikipedia.org/wiki/Clean_room_design

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: re-writing algorithms in Guile
  2021-06-28 21:38 re-writing algorithms in Guile Tim Meehan
  2021-06-28 21:50 ` Zelphir Kaltstahl
  2021-06-29  5:26 ` Jay Sulzberger
@ 2021-06-29  6:08 ` Dr. Arne Babenhauserheide
  2021-06-29  7:56 ` tomas
  3 siblings, 0 replies; 13+ messages in thread
From: Dr. Arne Babenhauserheide @ 2021-06-29  6:08 UTC (permalink / raw)
  To: Tim Meehan; +Cc: guile-user

[-- Attachment #1: Type: text/plain, Size: 368 bytes --]


Tim Meehan <btmeehan@gmail.com> writes:

> Say for instance, I have found an algorithm for scalar function
> minimization on a website, written in C. It is posted with a license for
> use.

What do you mean by „license for use“? Does it restrict what you want to
do?

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: re-writing algorithms in Guile
  2021-06-28 21:38 re-writing algorithms in Guile Tim Meehan
                   ` (2 preceding siblings ...)
  2021-06-29  6:08 ` Dr. Arne Babenhauserheide
@ 2021-06-29  7:56 ` tomas
  2021-06-29  8:56   ` Vivien Kraus via General Guile related discussions
  3 siblings, 1 reply; 13+ messages in thread
From: tomas @ 2021-06-29  7:56 UTC (permalink / raw)
  To: Tim Meehan; +Cc: guile-user

[-- Attachment #1: Type: text/plain, Size: 1444 bytes --]

On Mon, Jun 28, 2021 at 04:38:50PM -0500, Tim Meehan wrote:
> Say for instance, I have found an algorithm for scalar function
> minimization on a website, written in C. It is posted with a license for
> use. If I write something based on this hypothetical code, is it then
> clearly also licensed in the same manner?

Definitely not: a license is about copyright, and copyright protects the
expression of an idea, not the idea itself (the Lord of the Rings is under
copyright, but if you write a novel involving very old talking trees, you
dont infringe on that).

For ideas there are patents. The situation on software patents is complicated,
to say the least.

You might want to not use exactly the same variable names, just to make sure :)

For an example where the line lies, more or less, in U.S. jurisdiction, see
the Oracle vs. Google case on the Java API (the question was whether the
"header files", which define the interface, are under copyright or not.

Note that this actually involves copying some files verbatim, so your example
lies far on the "safe side" of it.

NOTE: I'm not a lawyer, nor I play one on TV.

Cheers

[1] https://www.aei.org/technology-and-innovation/supreme-court-ingests-java-as-google-oracle-copyright-spat-boils-over/
[2] https://siliconangle.com/2021/04/05/supreme-court-rules-googles-favor-oracle-copyright-case-android-java-code-use/
[3] https://www.supremecourt.gov/opinions/20pdf/18-956_d18f.pdf
 - t

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: re-writing algorithms in Guile
  2021-06-29  7:56 ` tomas
@ 2021-06-29  8:56   ` Vivien Kraus via General Guile related discussions
  0 siblings, 0 replies; 13+ messages in thread
From: Vivien Kraus via General Guile related discussions @ 2021-06-29  8:56 UTC (permalink / raw)
  To: tomas, Tim Meehan; +Cc: guile-user

Le mardi 29 juin 2021 à 09:56 +0200, tomas@tuxteam.de a écrit :
> On Mon, Jun 28, 2021 at 04:38:50PM -0500, Tim Meehan wrote:
> > Say for instance, I have found an algorithm for scalar function
> > minimization on a website, written in C. It is posted with a
> license for
> > use. If I write something based on this hypothetical code, is it
> then
> > clearly also licensed in the same manner?
> 
> Definitely not: a license is about copyright, and copyright protects
> the
> expression of an idea, not the idea itself (the Lord of the Rings is
> under
> copyright, but if you write a novel involving very old talking trees,
> you
> dont infringe on that).

The idea is the algorithm, but the expression of the idea is the C
program. If you copy the C program, you are indeed bound by the license
of the C program.

> You might want to not use exactly the same variable names, just to
> make sure :)

I would not do that. It will just make the program harder to read.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: re-writing algorithms in Guile
  2021-06-29  4:38     ` Vivien Kraus via General Guile related discussions
@ 2021-06-29 13:52       ` Nate Rosenbloom
  2021-06-29 14:20         ` tomas
  0 siblings, 1 reply; 13+ messages in thread
From: Nate Rosenbloom @ 2021-06-29 13:52 UTC (permalink / raw)
  To: Vivien Kraus, Zelphir Kaltstahl; +Cc: guile-user


> This reason is not stated in the Stack Exchange post, and I believe
> it’s inaccurate (although, I am not a lawyer either). I think the
> reason is that you are reading the original implementation to write
> your own, so you are some kind of a compiler, or translator (as for
> human spoken languages). As such, what you write is mostly the other
> person’s work, so you should not claim copyright about it.

Sorry, I should have been more specific, the rewritten algorithm would not be the same, but it would be a derivative work and still covered by copyright of the original work.

It’s possible that the current license allows derivative works to be licensed under a compatible license that would allow you do to what you need to do? I guess to for any suggestions we would need to know what the original use license is.

Nate


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: re-writing algorithms in Guile
  2021-06-29 13:52       ` Nate Rosenbloom
@ 2021-06-29 14:20         ` tomas
  2021-06-29 23:48           ` Tim Meehan
  0 siblings, 1 reply; 13+ messages in thread
From: tomas @ 2021-06-29 14:20 UTC (permalink / raw)
  To: Nate Rosenbloom; +Cc: guile-user

[-- Attachment #1: Type: text/plain, Size: 1619 bytes --]

On Tue, Jun 29, 2021 at 01:52:56PM +0000, Nate Rosenbloom wrote:
> 
> > This reason is not stated in the Stack Exchange post, and I believe
> > it’s inaccurate (although, I am not a lawyer either). I think the
> > reason is that you are reading the original implementation to write
> > your own, so you are some kind of a compiler, or translator (as for
> > human spoken languages). As such, what you write is mostly the other
> > person’s work, so you should not claim copyright about it.
> 
> Sorry, I should have been more specific, the rewritten algorithm would not be the same, but it would be a derivative work and still covered by copyright of the original work.

I think the legal concept of "derivative work" is far more complex than
we'd all like. See [1] to get an idea.

With the caveat that I'm not a lawyer (heh), I think the "red line" lies
between those two extremes: (a) you read the original, understand the
algorithm and write your program based on this understanding. Best if
you forget details like variable naming, program structure, etc. Only
the "pure" algorithm survives, and (b) you translate the program line
by line (although that would be pretty hard between C and, say, idiomatic
Scheme). (a) is almost certainly not a derivative work, while (b) would
be, most probably.

To make sure you can cleanly /prove/ you did (a), some do what is called
a "clean room implementation". Fred looks at the original program and
tells Gina "how it works", and Gina implements the new one.

Cheers

[1] https://copyleft.org/guide/comprehensive-gpl-guidech5.html

 - t

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: re-writing algorithms in Guile
  2021-06-29 14:20         ` tomas
@ 2021-06-29 23:48           ` Tim Meehan
  2021-06-30  7:29             ` tomas
  0 siblings, 1 reply; 13+ messages in thread
From: Tim Meehan @ 2021-06-29 23:48 UTC (permalink / raw)
  Cc: guile-user

Thanks all for the input - I think I have a better understanding of
derivative work. I think that I'll look for a paper on the algorithm and
work from there.

For the curious, the "hypothetical" code in question was from here
<https://codetobuy.com/downloads/brent-dekker-method-as-a-root-finding-method-of-any-equation/>
:
Since he posted it in "algorithmic" form, and I had no interest in
purchasing his code to run in Matlab (since Matlab likely has something
faster anyhow), I was puzzled about what I might be able to do with my pure
Scheme version.

On Tue, Jun 29, 2021 at 9:22 AM <tomas@tuxteam.de> wrote:

> On Tue, Jun 29, 2021 at 01:52:56PM +0000, Nate Rosenbloom wrote:
> >
> > > This reason is not stated in the Stack Exchange post, and I believe
> > > it’s inaccurate (although, I am not a lawyer either). I think the
> > > reason is that you are reading the original implementation to write
> > > your own, so you are some kind of a compiler, or translator (as for
> > > human spoken languages). As such, what you write is mostly the other
> > > person’s work, so you should not claim copyright about it.
> >
> > Sorry, I should have been more specific, the rewritten algorithm would
> not be the same, but it would be a derivative work and still covered by
> copyright of the original work.
>
> I think the legal concept of "derivative work" is far more complex than
> we'd all like. See [1] to get an idea.
>
> With the caveat that I'm not a lawyer (heh), I think the "red line" lies
> between those two extremes: (a) you read the original, understand the
> algorithm and write your program based on this understanding. Best if
> you forget details like variable naming, program structure, etc. Only
> the "pure" algorithm survives, and (b) you translate the program line
> by line (although that would be pretty hard between C and, say, idiomatic
> Scheme). (a) is almost certainly not a derivative work, while (b) would
> be, most probably.
>
> To make sure you can cleanly /prove/ you did (a), some do what is called
> a "clean room implementation". Fred looks at the original program and
> tells Gina "how it works", and Gina implements the new one.
>
> Cheers
>
> [1] https://copyleft.org/guide/comprehensive-gpl-guidech5.html
>
>  - t
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: re-writing algorithms in Guile
  2021-06-29 23:48           ` Tim Meehan
@ 2021-06-30  7:29             ` tomas
  0 siblings, 0 replies; 13+ messages in thread
From: tomas @ 2021-06-30  7:29 UTC (permalink / raw)
  To: Tim Meehan; +Cc: guile-user

[-- Attachment #1: Type: text/plain, Size: 914 bytes --]

On Tue, Jun 29, 2021 at 06:48:56PM -0500, Tim Meehan wrote:
> Thanks all for the input - I think I have a better understanding of
> derivative work. I think that I'll look for a paper on the algorithm and
> work from there.
> 
> For the curious, the "hypothetical" code in question was from here
> <https://codetobuy.com/downloads/brent-dekker-method-as-a-root-finding-method-of-any-equation/>

Yes, Brent-Dekker is well known. There are good descriptions all
around. Actually, Wikipedia's [0] is pretty well written and
accessible. It has also hints on the improvements usual nowadays.

Actually, AFAICS, GSL (the GNU scientific library) [1] implements
its one-dimensional root finding [2] based on Brent-Dekker.

Cheers

[0] https://en.wikipedia.org/wiki/Brent's_method
[1] https://www.gnu.org/software/gsl/doc/html/intro.html
[2] https://www.gnu.org/software/gsl/doc/html/roots.html

 - t

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-06-30  7:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28 21:38 re-writing algorithms in Guile Tim Meehan
2021-06-28 21:50 ` Zelphir Kaltstahl
2021-06-29  4:09   ` Nate Rosenbloom
2021-06-29  4:38     ` Vivien Kraus via General Guile related discussions
2021-06-29 13:52       ` Nate Rosenbloom
2021-06-29 14:20         ` tomas
2021-06-29 23:48           ` Tim Meehan
2021-06-30  7:29             ` tomas
2021-06-29  5:26 ` Jay Sulzberger
2021-06-29  6:08   ` Dr. Arne Babenhauserheide
2021-06-29  6:08 ` Dr. Arne Babenhauserheide
2021-06-29  7:56 ` tomas
2021-06-29  8:56   ` Vivien Kraus via General Guile related discussions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).