So it seems that semi-colons and braces (;
, {
, and }
) are under threat.
New languages are shunning them and their use seems to be dwindling. So what's
happening to all those unused characters? We've put them to work, that's what.
Introducing Colonoscopy, a
Rho′′, among
others [NSFW],
influenced language designed purely to use up characters that are no longer seen
as useful in trendy, modern languages.
Colonoscopy is a turing complete language with 8 operators. These operators
translate to BF and C
as follows:
Symbol | BF | C | Description |
---|---|---|---|
;} |
+ |
++ptr; |
Move the pointer to the right |
;{ |
- |
--ptr; |
Move the pointer to the left |
;;} |
> |
++*ptr; |
Increment the memory cell under the pointer |
;;{ |
< |
--*ptr; |
Decrement the memory cell under the pointer |
;;;} |
. |
putchar(*ptr) |
Output the character signified by the cell at the pointer |
;;;{ |
, |
*ptr=getchar(); |
Input a character and store it in the cell at the pointer |
{{ |
[ |
while (*ptr) { |
Jump past the matching }} if the cell under the pointer is 0 |
}} |
] |
} |
Jump back to the matching {{ |
In addition, each command must be terminated with a semi-colon. Other than
EOF
, no other characters are allowed in a colonoscopy program. Those are
reserved for other languages that think that ;
, {
and }
are too good for
them.
An interpreter, written in Go (because irony) is available in this package to allow you to play with Colonoscopy scripts.
go get github.com/domdavis/colonoscopy
go install github.com/domdavis/colonoscopy
colonoscopy <sourcefile>
Convention is that Colonoscopy files use a
.cl
suffix.
The following is an implementation of "Hello World!" written in Colonoscopy:
;;};;;};;;};;;};;;};;;};;;};;;};{{;;};;;};;;};;;};;;};{{;;};;;};;;};;};;;};;;};;;};;};;;};;;};;;};;};;;};;{;;{;;{;;{;;;{;}};;};;;};;};;;};;};;;{;;};;};;;};{{;;{;}};;{;;;{;}};;};;};;;;};;};;;{;;;{;;;{;;;;};;;};;;};;;};;;};;;};;;};;;};;;;};;;;};;;};;;};;;};;;;};;};;};;;;};;{;;;{;;;;};;{;;;;};;;};;;};;;};;;;};;;{;;;{;;;{;;;{;;;{;;;{;;;;};;;{;;;{;;;{;;;{;;;{;;;{;;;{;;;{;;;;};;};;};;;};;;;};;};;;};;;};;;;};
$ colonoscopy example.cl
Tokenising...done.
Hello World!
Execution complete!
Why not? Also, it helps with learning Go. Also this.
It's turing complete, so yes.
Probably not.
Doubtful. I'm not sure the code to read characters from stdin
is cross
platform, the tokeniser is likely very naive and inefficient, plus I can't be
sure it's bug free as I used SDD (Satire Driven Programming) and there is only
one manual test. Hell, I don't even know if the install instructions work
properly ;) - Appears they do, at least on the Docker image I tried :D
Converter from Ook!, and other such languages. Maybe a proper compiler. Who knows.
Public Domain