BobCode

Docs · BobShit syntax & compile

Editor API ▶ Open editor

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.

live · bob.xem.yt/bobcode runtime BobShit 0.1.1 lang=bobshit

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.

Full language playground & reference: bob.xem.yt/bobshit · lang docs

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 #.

FRENRole
affichesay / printstdout
SI / SINON / ALORSif / else / thenconditions
POUR … DANS … JUSQUAfor … in … tofor-loop
TANTQUEwhilewhile-loop
fonctionfun / fn / deffunctions
FINendend 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"
}
Devs: full curl examples & response fields → /bobcode/api

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

BobCode · POST /bobcode/compile · lang=bobshit · runtime 0.1.1