util/link.lsp (and modules)

Started by kanen, April 15, 2010, 01:41:44 PM

Previous topic - Next topic

kanen

I love the ability to create a binary using link.lsp


(load "util/link.lsp")
(link "/usr/bin/newlisp" "my-app" "my-app.lsp")


However, I want to be able to link all my sources (i.e. the modules I have written) into the same binary, so   the binary doesn't have to load them from source files.



Inside my-app.lsp


(load "modules/foo.lsp")
(load "modules/bar.lsp")

Aside from appending all my source code together, so the modules (and contexts) get crammed into the same link'd binary, is there a way to do this that I am overlooking?
. Kanen Flowers http://kanen.me[/url] .

kanen

#1
bump
. Kanen Flowers http://kanen.me[/url] .

Lutz

#2
Yes, the only way is, too merge the modules into one program file, like this:


(context 'Foo)
...
...
(context MAIN)

(context 'Bar)
...
...
(context MAIN)

(Foo:this x y z)
(Bar:that p q r)
...

(exit)


When you have multiple contexts in one file it is important to finish them them with a switch to MAIN (not necessary to quote, because MAIN exists already).



link.lsp just appends the encrypted source file to the newlisp executable. The encryption is trivial, and only serves to deter amateurs from casual fiddling with your source code. But anybody who understands newLISP will be able to extract your source code after reading/understanding the link.lsp file.

kanen

#3
So... this adds another module for me to write. :)



I understand the security issue of people being able to reverse it, I just want to be able to create a pre-compiled version for different operating systems to make life easier for everyone.



Thanks.


Quote from: "Lutz"Yes, the only way is, too merge the modules into one program file, like this:


(context 'Foo)
...
...
(context MAIN)

(context 'Bar)
...
...
(context MAIN)

(Foo:this x y z)
(Bar:that p q r)
...

(exit)


When you have multiple contexts in one file it is important to finish them them with a switch to MAIN (not necessary to quote, because MAIN exists already).



link.lsp just appends the encrypted source file to the newlisp executable. The encryption is trivial, and only serves to deter amateurs from casual fiddling with your source code. But anybody who understands newLISP will be able to extract your source code after reading/understanding the link.lsp file.
. Kanen Flowers http://kanen.me[/url] .

cormullion

#4
If you distribute any software, you might have to distribute the source anyway...

kanen

#5
I actually do not have to release my source code.



This has been a long-standing debate among users of the gcc compiler, which is licensed under GPL, but allows you to write (and then compile) your non-GPL source code and distribute it as a binary.



If everyone who used gcc had to release their code, there would be almost no private and proprietary applications.



The same is true for newLISP. Yes, I am using a GPL interpreter (which, in turn, was compiled against a GPL compiler), but this doesn't mean I have to automatically have a GPL program and release the code under the GPL.



In fact, kane|box will likely be BSD-Licensed. Which, ironically, is a MORE FREE license than GPL, because it is less restrictive as to how it can be used by anyone in the future and (the BSD License) doesn't require anyone to automatically submit their changes back to the public.



Now... if you are only talking about modifications I might make to any newLISP modules -- I do have to release those changes back to the public because I am modifying GPL code.



The only time I wouldn't have to release my changes back to the public is if I were not releasing the product of those changes as a publicly available binary.



Meaning: If I modify link.lsp and use it for my own, internal network or technology, which is not part of a publicly available distribution, I do not have to release my changes.



All that having been said, my intention is to make kane|box freely available. This would include everything I have written for the tool and technology. :)



GPL Reference: http://www.gnu.org/licenses/old-licenses/gpl-2.0-faq.html#CanIUseGPLToolsForNF">http://www.gnu.org/licenses/old-license ... ToolsForNF">http://www.gnu.org/licenses/old-licenses/gpl-2.0-faq.html#CanIUseGPLToolsForNF


Quote from: "cormullion"If you distribute any software, you might have to distribute the source anyway...
. Kanen Flowers http://kanen.me[/url] .