BobCode docs
BobCode is an online editor for BobShit — a chill bilingual (FR/EN)
interpreted language. You write code, hit Run, and BobAI executes it via
POST /bobcode/compile.
1. What is BobShit?
BobShit is a small interpreted language (runtime C, files .shit / .bs).
Keywords work in French and English. Soft mode (default) is forgiving:
missing end/fin, loose parentheses — it still tries to run
and may warn on stderr.
BobCode is the browser editor on top of that runtime: pure JS frontend +
BobAI auth (bobcode API key scope) + compile endpoint.
2. Syntax cheatsheet
Print — affiche
Print to stdout. Aliases: affiche, afficher, say, print.
affiche "yo bob"
affiche "score:", 42
Variables
Assign with =. Numbers, strings, bools (vrai/faux or true/false).
nom = "xem"
n = 7
affiche nom, n
Conditions — SI / if
SI n > 5 ALORS
affiche "moyen"
SINON
affiche "petit"
FIN
EN style also works: if / else / end.
Loops — POUR / for
POUR i DANS 1 JUSQUA 3
affiche i
FIN
While: TANTQUE / while … FIN / end.
Functions — fonction / fun
fonction saluer nom
affiche "bonjour", nom
FIN
saluer("xem")
Comments
Line comments start with #.
| FR | EN | Role |
|---|---|---|
affiche | say / print | stdout |
SI / SINON / ALORS | if / else / then | conditions |
POUR … DANS … JUSQUA | for … in … to | for-loop |
TANTQUE | while | while-loop |
fonction | fun / fn / def | functions |
FIN | end | end block |
3. How /bobcode/compile works
The editor (and any client) sends your source to BobAI. You need an API key
from bob.xem.yt/chat with scope
bobcode (or *).
POST https://bob.xem.yt/bobcode/compile
Authorization: Bearer sk-…
Content-Type: application/json
{
"code": "affiche \"hello\"",
"lang": "bobshit"
}
Success-ish JSON shape:
{
"ok": true,
"output": "hello\n",
"errors": "",
"exit_code": 0,
"lang": "bobshit"
}
lang— usebobshit(aliasesshit,bsalso accepted).- Optional
timeout— seconds, clamped ~1–15. - Auth failures →
401/ wrong scope →403/ rate limit →429.
4. Example snippets
Hello
# hello.bs
affiche "hello from BobCode"
Fizz-ish loop
POUR i DANS 1 JUSQUA 5
SI i == 3 ALORS
affiche "trois"
SINON
affiche i
FIN
FIN
Function + vars
fonction double x
RETOURNER x * 2
FIN
n = double(21)
affiche "n =", n
5. Links
- Editor —
https://bob.xem.yt/bobcode - Compile API docs — for programmatic use
- Get an API key — tick scope
bobcode - BobShit language docs
BobCode · POST /bobcode/compile · lang=bobshit · runtime 0.1.1