Emojicode
2016fragletMCP + fragletc
Esoteric programming language.
Hello World
#!/usr/bin/env sh
set -e
cd /hello-world
emojicodec -o hello-world -S /artifacts/emojicode/build hello-world.π || exit 1
./hello-worldCoding Guide
Language Version
Emojicode (as installed in this container; run emojicodec --version inside the container if you need the exact version).
Execution Model
- Compiled language using the
emojicodeccompiler. - Your fraglet replaces the entire contents between
π BEGIN_FRAGLETandπ END_FRAGLETinhello-world.π. - The resulting file is compiled and run as a normal Emojicode program.
Key Characteristics
- Emoji-based syntax for all core constructs (entry point, blocks, variables, printing, comments).
- Compiled to native code; errors are reported by
emojicodecwith file/position info. - Block-structured with explicit start (
π) and end (π) delimiters. - Statement-terminated with
βοΈ.
Fragment Authoring
- You write a complete Emojicode program. Your fraglet is not injected into
mainor any other function body. - You must include:
- Program entry:
π - A top-level block:
π...π - Whatever statements you want to run inside that block.
- Program entry:
- The minimal shape looks like:
π π
β¦your statementsβ¦
πMental Model
You write a full, valid Emojicode program, starting with π and a π β¦ π block, and we compile and run it as-is.
Nothing is injected for you and no main wrapper is added β if your program wouldnβt compile with emojicodec on its own, it wonβt compile as a fraglet.
Basic Syntax
πβ Program entry point.π/πβ Block start / end.πβ Print statement.π€β¦π€β String literal delimiters.βοΈβ Statement terminator.πβ Comment / annotation.
Variables and Types
ππβ Declare a mutable variable.- Common types:
π’β Integer.π‘β String.
- Example declaration:
ππ x π’ 5βοΈExamples
Minimal Hello World
This is the smallest program you should expect to compile and run as a fraglet in this vein:
π π
π π€Hello from Emojicode fraglet!π€βοΈ
πVariables and printing
A slightly richer example with a variable and formatted output:
π π
ππ times π’ 3βοΈ
π π€About to greetβ¦π€βοΈ
π π€Hello π€βοΈ
π π€We greeted π€βοΈ
π π€times: π€βοΈ
π timesβοΈ
πBoth examples are complete programs: if you drop them between π BEGIN_FRAGLET and π END_FRAGLET in hello-world.π, they should compile and run under this fraglet vein.
Caveats
- Full program required: Fragments that are just statements like
π π€Helloπ€βοΈwithoutπ πβ¦πwill fail to compile. - Compiler errors are authoritative: If execution fails, read the
emojicodecerror message and iterate until it compiles β this guide describes the expected structure, but the compiler is the final arbiter. - Ensure your editor supports Unicode emoji so characters are preserved correctly.
- String literals must be wrapped in
π€delimiters. - Every statement (including variable declarations and prints) must end with
βοΈ. - Variable declarations require the
ππprefix and an appropriate type emoji.
Fraglet Scripts
Test
#!/usr/bin/env -S fragletc --vein=emojicode
π π
π π€Hello World!π€βοΈ
π