INTERCAL

from Wikipedia, the free encyclopedia
Don Woods, co-author of INTERCAL, 2010
Jim Lyon, co-author of INTERCAL, 2005

INTERCAL , short for Compiler Language With No Pronouncable Acronym (compiler language without pronounceable acronym ), is an esoteric programming that on 26 May 1972 by Donald R. Woods was developed and James M. Lyon. This implementation used punch cards and EBCDIC . When converting to ASCII , the operator ¢ had to be replaced by $ and ⊻ by? be replaced. It was not until 1990 that Eric S. Raymond programmed the first UNIX implementation . Today INTERCAL is also available on DOS . Two versions are currently available: C-INTERCAL and CLC-INTERCAL. There is also Threaded Intercal.

INTERCAL was developed with the aim of parodying programming languages, making programming difficult and effectively making the resulting programs illegible. In this respect INTERCAL does not resemble any of the known programming languages, has very few language constructs and is difficult to learn.

INTERCAL is maintained by a small fan base and can be used by interested programmers to amuse them or solve puzzles. On a SUN SPARCStation-1 , an INTERCAL program needed more than 17 hours to use the Eratosthenes sieve to calculate all prime numbers smaller than 65536 (in other programming languages ​​less than a second). On an IBM 360/91 , it took 30 seconds to divide a 16-bit integer (i.e., a number less than 65536).

particularities

INTERCAL is particularly known for the command COME FROMthat was introduced with C-INTERCAL. This parodies the GOTO that occurs in some other programming languages, such as BASIC .

Almost all programming languages ​​allow comments in the program that are ignored by the compiler - such as /* ... */in C ++ . INTERCAL has the possibility of commenting on the code - at the same time everything that does not correspond to a valid command is ignored by the ick compiler , which opens up an interesting way of setting comments. For the same reason, troubleshooting in an INTERCAL program is extremely difficult.

The program will not compile if the programmer is not friendly enough and PLEASEwrites too seldom (error E079 PROGRAMMER IS INSUFFICIENTLY POLITE). On the other hand, if this word occurs too often, the compiler will fall in love with itself and refuse to work (E099 PROGRAMMER IS OVERLY POLITE).

Woods stated in an interview that Donald Knuth told him that INTERCAL's divisional routine contained a great hack that he wanted to include in The Art of Computer Programming .

Example ROT13 program

   (10) PLEASE DON'T GIVE UP
   (1) DO .2 <- '?.1$#64'~'#0$#65535'
   DO .2 <- '&"'.1~.2'~'"?'?.2~.2'$#32768"~"#0$#65535“'"$".2~.2“'~#1
   DO .3 <- '?#91$.1'~'#0$#65535'
   DO .3 <- '&"'#91~.3'~'"?'?.3~.3'$#32768"~"#0$#65535“'"$".3~.3“'~#1
   DO (11) NEXT
   DO (2) NEXT
   DO (12) NEXT
   (11) DO (13) NEXT
   PLEASE FORGET #1
   DO (12) NEXT
   (13) DO (14) NEXT
   PLEASE FORGET #2
   DO (12) NEXT
   (14) DO STASH .1
   DO .1 <- .3
   DO (1000) NEXT
   DO .1 <- .3
   DO .2 <- #1
   PLEASE DO (1000) NEXT
   DO RETRIEVE .1
   PLEASE RESUME .3
   (12) PLEASE FORGET #1
   DO .2 <- '?.1$#96'~'#0$#65535'
   DO .2 <- '&"'.1~.2'~'"?'?.2~.2'$#32768"~"#0$#65535“'"$".2~.2“'~#1
   DO .3 <- '?#123$.1'~'#0$#65535'
   DO .3 <- '&"'#123~.3'~'"?'?.3~.3'$#32768"~"#0$#65535“'"$".3~.3“'~#1
   PLEASE DO (15) NEXT
   PLEASE DO (3) NEXT
   DO (16) NEXT
   (15) DO (17) NEXT
   PLEASE FORGET #1
   DO (16) NEXT
   (17) DO (18) NEXT
   PLEASE FORGET #2
   DO (16) NEXT
   (18) PLEASE STASH .1
   DO .1 <- .3
   DO (1000) NEXT
   DO .1 <- .3
   DO .2 <- #1
   DO (1000) NEXT
   PLEASE RETRIEVE .1
   PLEASE RESUME .3
   (16) PLEASE FORGET #1
   DO RESUME #1
   (2) DO .2 <- #65
   DO (1010) NEXT
   PLEASE .1 <- .3
   PLEASE .2 <- #13
   DO (1000) NEXT
   DO STASH .3
   DO .1 <- .3
   DO .2 <- #26
   DO (1040) NEXT
   DO .1 <- .3
   DO (1030) NEXT
   DO .2 <- .3
   DO RETRIEVE .3
   DO .1 <- .3
   DO (1010) NEXT
   DO .1 <- .3
   DO .2 <- #65
   DO (1000) NEXT
   DO .1 <- .3
   DO RESUME #1
   (3) DO .2 <- #97
   DO (1010) NEXT
   DO .1 <- .3
   DO .2 <- #13
   DO (1000) NEXT
   DO STASH .3
   DO .1 <- .3
   DO .2 <- #26
   DO (1040) NEXT
   DO .1 <- .3
   DO (1030) NEXT
   DO .2 <- .3
   DO RETRIEVE .3
   DO .1 <- .3
   DO (1010) NEXT
   DO .1 <- .3
   DO .2 <- #97
   DO (1000) NEXT
   DO .1 <- .3
   DO RESUME #1
   DO COME FROM (10)
   DO .4 <- #0
   DO .5 <- #0
   DO STASH .4 + .5
   DO ,1 <- #1
   DO COME FROM (33)
   DO WRITE IN ,1
   DO .1 <- ,1 SUB #1
   DO (31) NEXT
   PLEASE DO .6 <- #1
   PLEASE DO (34) NEXT
   (32) PLEASE RESUME '?.1$#256'~'#256$#256'
   (31) DO (32) NEXT
   DO FORGET #1
   DO .6 <- #0
   PLEASE DO (34) NEXT
   (33) DON'T GIVE UP
   (34) DO .6 <- "?!6'$#1"~#3
   DO (40) NEXT
   DO GIVE UP
   (40) DO (41) NEXT
   PLEASE FORGET #1
   DO (42) NEXT
   (41) DO RESUME .6
   (42) DO FORGET #1
   DO RETRIEVE .4
   DO .2 <- .4
   DO (1000) NEXT
   DO .4 <- .3~#255
   DO .3 <- .4
   DO STASH .4
   DO .1 <- .3
   DO (1) NEXT
   DO .3 <- !1~#15'$!1~#240'
   DO .3 <- !3~#15'$!3~#240'
   DO .2 <- !3~#15'$!3~#240'
   DO .1 <- .5
   DO (1010) NEXT
   DO .5 <- .2
   DO ,1 SUB #1 <- .3
   PLEASE READ OUT ,1
   PLEASE RESUME #1

literature

  • Oliver Lau: Hexenwerk - A plea for esoteric programming languages . In: c't , 22/07, pp. 192-199 and c't extra , 02/09, pp. 40-45.

Web links

Commons : INTERCAL  - collection of images, videos and audio files

Individual evidence

  1. The A – Z of Programming Languages: INTERCAL (Interview with Donald R. Woods, English)
  2. Michael Mateas, Nick Montfort: A Box, Darkly: Obfuscation, Weird Languages, and Code Aesthetics (PDF).
  3. C-INTERCAL 0.29 Revamped Instruction Manual . catb.org
  4. ^ Naomi Hamilton: The AZ of Programming Languages: INTERCAL. In: TechWorld. July 4, 2008, accessed November 10, 2015 .