On 2014-09-04, ais523 <
ais...@nethack4.org> wrote:
> However, INTERCAL obfuscators mostly don't exist for the reason that
> automatically doing any sort of transformation on INTERCAL source is
> difficult. For instance, consider the following program:
I tried that once... it's possible, but definitely not easy.
> (To gain more obfuscation, you would overload a variable to mean
> ".1$.2" then assign to that variable, which has the advantage that it
> also works in CLC-INTERCAL.)
Yes, I should allow assignment to calculations. We all know it's a
necessary feature which is planned for the next pre-escape, whenever
that happens. However I'd obfuscate by assigning to constants:
DO #1 <- #2
DO $1 <- #1
(this obviously assigns #2 to $2 and undoing the side effect on #1 is
left as an exercise to the reader; Oh, and this probably only works
in CLC-INTERCAL).
> (The threading problem, at least, could be partially solved via
> use of a no-op statement; the only safe no-op statement to use for the
> purpose, incidentally, is DON'T GIVE UP, due to the lack of a GIVING UP
> gerund.)
Very old versions of CLC-INTERCAL allowed that. That was due to a
documented compiler bug and of course all users are urged to upgrade to
a CLC-INTERCAL compiler which is less than 14 years old.
> Another possibility is to use a program like yuk to convert INTERCAL
> expressions into C, then convert the resulting C back into INTERCAL.
Well, that's similar the way I was going to do that all these years ago:
the CLC-INTERCAL compiler doesn't need to produce Perl, it can produce
other languages and the idea was to allow any input language to be used as
output too, possibly after (de)optimising. (There are traces of this all
over the CLC-INTERCAL compiler, the reason the grammars for the parser
look, ahem, unusual is because they are meant to to be operated as code
generators as well as parsers, although the functionality to do that is
simply not there).
One day when I feel like completing the next pre-escape of CLC-INTERCAL
I may look into obfuscators again. And think of the advantage of
operating CLC-INTERCAL in "reverse": in goes Perl (or C, or COBOL),
out goes INTERCAL (or Brainf*ck, or Whitespace).
Claudio Calvelli, author and allegedly maintainer of CLC-INTERCAL.