We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Threads

From Esolang
Jump to navigation Jump to search

Threads is an Esolang. It is multithreaded.

Commands

Code
Symbols Info
a Add one to the counter
s Subtract one from the counter
o Default: output the counter, dotted: output the following string or s for the variable
i Default: input into the counter, dotted: input into the string variable
( Start loop default: infinite, dotted: following number or c for the counter (can not be dotted)
) End loop (can be dotted)
t Make a thread to run the dotted code in (t.[a]), can also have a thread id (t0.[a])
[ Start code block default: run normal, dotted: run with arguments* (can not be dotted)
] end a code block (can be dotted)
q compile the current thread default: compiles to a.out, dotted: compiles to #
c comment (c.”this is a comment”)

* that are not in the compiler command

Arguments
Symbols Info
[blank] run the code normally
v Verbose (Created new thread! Added 1 to the counter!)
o Outputs to o.out (can be changed in the configuration file)
i Set the string to the current value of the file i.out
c Each code bloCk is a value on a staCk
e Extends the logic set using rules from e.out

Examples

Hello World:

o."Hello, World!"

Cat:

(i."" o.s)

XKCD Random Number:

t.[a a a a o] c."speed thread"

Fork Bomb:

(t.[t]) c."your computer will not survive this"

Compiler Example:

./threadsc.sh -voice hello.thr

Block Example:

[o.”Balls”].o