On Thu, 10 May 2012 11:51:00 -0700, H. S. Teoh <[email protected]> wrote:

On Thu, May 10, 2012 at 08:26:45PM +0200, Paulo Pinto wrote:
Am 10.05.2012 00:34, schrieb Joseph Rushton Wakeling:
>On 10/05/12 00:25, H. S. Teoh wrote:
>>Which is what fueled the market for hundreds (if not thousands) of
>>JS obfuscators.
>
>Well, that's kind of my point really. Is it so bad (from a
>proprietary point of view) to have to distribute .d rather than .di
>files, if you can obfuscate them?

Try to find an error on an obfuscated dump.

Not fun.
[...]

Yeah, like those Javascript errors from deep within the compressed core
of Yahoo UI or jQuery, which are impossible to figure out because
function names, variable names, etc., are all compressed. It's much
worse with deliberately obfuscated source.

But it still wouldn't stop a determined code thief. This is one of many
reasons I prefer OSS. Trying to prevent code "theft" is an exercise in
futility, reduces utility, and only results in debility.

But if the only way for some people to be happy is to obfuscate their
code, well, then they just have to live with the consequences.

Anyway, all of this just backs up my proposal that instead of
obfuscation, we just store the parsed source (or publically-exposed
parts of it) in the object file in some kind of intermediate form (like
ASTs). Don't bother with .di's at all, just generate the ddocs and let
users use that as reference, you just ship the binary shared lib. The
compiler can load the ASTs as necessary whenever it needs function
bodies, etc.. Problem solved.


T


I think this represents the best possible long-term strategy. However, getting D to do all that is going to take a *LOT* of effort. I've decided that I will propose just such a project later today, but I'll need help. Linkers aren't easy and the changes to DMD will be even worse. In the end though, we'll get a modular linker written in D and COFF support for DMD. But we need something in the mean time and for now the DI patch will suffice.

--
Adam Wilson
IRC: LightBender
Project Coordinator
The Horizon Project
http://www.thehorizonproject.org/

Reply via email to