Skip to content

About

Looks like English, reads like English, and is english (also btw this is the IDE to run E++ and yes this is inspired by WeeklyHows video)

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

75 Commits

Folders and files

Repository files navigation

E++ 1.5b1

E++ is a small, English-like programming language with a browser Studio, a C++ command-line engine and a Python runner. Write text in double quotes, variables in single quotes, and maths as numbers and words.

let 'name' be "Ada"
say "Hello, ", 'name'
say 2 plus 3 times 4

What’s new in 1.5b1

1.5b1 is the release where E++ learns new words you write yourself, and where an error code finally means what it says.

  • Write your own library — the Studio's Library Creator takes a name and a few features, and each feature is a small E++ body. Save it and add library "Dice" starts working:

    add library "Dice"
    roll a die
    say flip a coin as words
    
  • .cenppl and .lepp — a .cenppl is an .enppl that carries the definition of the library it uses, so one file is a complete, readable project. A .lepp is that library sealed with the same audited container as a saved project, so it can be shared without its source showing.

  • libraries/ is the only place a library is found — drop a .lepp in the libraries folder of E++.zip and add library "Name" finds it. A .lepp anywhere else is ignored on purpose: a library that sits next to a program could arrive with the program.

  • offline.html — the whole Studio in one file. No server, no js/, no css/, no fetch: open it from a USB stick or an air-gapped machine and it runs, custom libraries included.

  • F codes mean the engine broke, not you — F001-F015 are now runtime faults: a custom runtime that will not load, memory exhaustion, a failed native bridge. Every mistake in your own program is an E code, including the lexical ones that used to be F: an unterminated string is E005, an unknown character E079, a broken escape E084. The catalogue is now 114 codes: 88 E, 6 W, 5 Z and 15 F.

Everything from 1.5a2 is still here: and, or and not in conditions, wait until, delete the file, repeat until, and booleans that print as True and False.

Start the Studio

Requirements: Node.js 18 or newer. No npm packages are needed to run the server.

npm start

Open http://localhost:8000 on that machine. On smaller screens, the same workspace scales down to fit. Use the activity bar for files and libraries and the Tools menu for project actions. The editor saves personal working copies in this browser. Learn opens the interactive lessons; Wiki opens the offline guide in the same tab, with a link back to Studio.

You can also open index.html directly for offline editing, Draw, Game and EShare. Or just open the github pages link I attached LIKE A NORMAL PERSON :/

Quick tutorials

1. Say hello

Create a file, type the following and press Run code:

say "Hello, world!"
say 7 plus 5

Text needs double quotes. say hello is an error (E001), not a shortcut for printing text.

2. Variables and questions

ask "What is your name?" and save the output as 'name'
say "Hello, ", 'name'
let 'score' be 10
say "Next score:", 'score' plus 1

Type your answer in the console. Variable names use single quotes and are case-insensitive.

3. Decisions and loops

let 'count' be 1
while 'count' is less than 4 do
  say 'count'
  let 'count' be 'count' plus 1
end while

repeat until 'count' is 7
  say 'count'
  let 'count' be 'count' plus 1
end repeat

4. Waiting and tidying up

Waiting is core E++ — no add line, ever:

say "One moment..."
wait 2 seconds
wait 250 milliseconds
sleep 0.5 seconds

let 'ready' be 1
wait until 'ready' is 1
say "Ready!"

add the "Files" library
write "Done." to file "notes.txt"
delete the file "notes.txt"

Try repeat 3 times … end repeat, or an if ... then followed by otherwise on the next line. Notes use note [text].

5. Two things at once (new in 1.5a2)

A condition can join two others with and, or or not. Every comparison you already know works on either side:

let 'score' be 12
let 'lives' be 3
let 'day' be "Saturday"

if 'score' is at least 10 and 'lives' is greater than 0 then say "Play on!"
if 'day' is "Saturday" or 'day' is "Sunday" then say "It is the weekend!"

let 'ready' be 0
if not 'ready' then say "Not ready yet"
if ('score' is 10 or 'score' is 12) and 'lives' is 3 then say "Grouped"

Loops and waits read them too: while 'n' is less than 5 and 'go' is true do, repeat until 'n' is 10 or 'stop' is true, and wait until 'ready' is true and 'count' is at least 3. A connector with no condition after it is E078.

5b. Write a library (new in 1.5b1)

Open Libraries → Library Creator, name it, and give it features. Each feature is the words you want to type plus a small E++ body:

note [@cenppl 1 name="Dice" version="1.0"]
note [@cenppl uses Random]
note [@cenppl feature "roll a die" kind=statement]

feature "roll a die":
let 'die' be a random number between 1 and 6
say "You rolled ", 'die'
end feature

Save it and the words work in that project straight away:

add library "Dice"
roll a die

Saving writes a .cenppl (readable, and a complete project on its own) and seals the same bytes into a .lepp with the key kept in this browser. Download .cenppl gives you the readable file; python3 libraries.py seal Dice.cenppl (or npm run library -- seal Dice.cenppl) gives you a shareable .lepp and prints its key.

To use a .lepp in E++.zip, put it in the libraries folder:

E++.zip/
  libraries/
    Dice.lepp

Then add library "Dice" finds it. Anywhere else in the archive it is ignored — a library is meant to be installed on purpose, not shipped beside a program.

5c. The offline Studio (new in 1.5b1)

offline.html is the whole Studio in one file: styles, scripts and the example libraries are inlined, so it needs no server and makes no requests. Open it from anywhere — a USB stick, a locked-down machine, a file:// path — and the editor, the run button, the tutorials and the Library Creator all work.

6. Draw an animated square (full Studio)

add library "Draw"
define 'pencil' as drawing sprite
set the speed of 'pencil' to 200
'pencil' move right "100"
'pencil' move down "100"
'pencil' move left "100"
'pencil' move up "100"

The default speed is 240 pixels/second. Change it per sprite with set the speed of 'pencil' to 60, 600, or instant. The console’s speed menu can change the selected cursor while it moves; arrows move it manually. Stop interrupts an animation. Draw is not in E++.zip.

7. Make a Game actor (full Studio)

  1. Add add library "Game" to a .enppl project. The Image button appears.
  2. Choose a local PNG, JPG, GIF, WEBP or SVG, name it hero, and link it. The panel inserts the actor code.
  3. Run the program. create the actor 'hero' uses the picture linked to that name. You can add put the actor 'hero' at 0 and 0 to position it at the centre.

An unreadable upload is refused; a broken existing link shows a message and a labelled tile. Upload the file again to relink it. Local uploads are embedded; URLs and relative paths in code still depend on those external resources.

EShare

Open Tools → EShare. Choose the current project or select an .enpp / .enppl file; copy the generated code and send it to someone. To open it, choose Import → Paste an EShare code. Imports are saved as new local copies without overwriting existing projects. Pictures are included when present. Plain E++ files and encrypted Studio downloads are supported; encrypted files must be unlockable with the keyring on the device creating the code.

EShare uses an authenticated encrypted container, but the decryption key is included in the share code so recipients can open it without setup. Anyone with the code can read the project: do not use it to protect secrets. Nothing is uploaded to a server. The old gallery API remains in the server for compatibility, but EShare replaces the gallery in Studio.

Command-line engines and testing

In the full source checkout, use:

make                           # build the native C++ engine
./epp -e 'say 2 plus 3'
python3 epp.py -e 'say "Hello"'
python3 lexer.py check program.enpp   # inspect tokens without running
python3 lexer.py tokens program.enpp --json
python3 lexer.py keywords --json
python3 lexer.py seal program.enpp --key HEX --out program.epp
make test                      # C++ and Python regression suite
npm test                       # JavaScript, diagnostics, lexer and gallery tests
make zip                       # rebuild E++.zip and epp_language.zip

E++ on Windows

epp.exe is the same engine, cross-compiled into one static 64-bit console program. Nothing else has to be installed on Windows — open PowerShell where the file is and run it:

.\epp.exe -e "say \"Hello from Windows\""
.\epp.exe examples\01_hello.enpp
.\epp.exe -e "let 'n' be 1`nwait at most 2 seconds until 'n' is 2`nsay \"Waited\""

Build it from any operating system with Zig (no Windows machine needed):

pip install ziglang
ZIG=$(python3 -c "import ziglang,os;print(os.path.join(os.path.dirname(ziglang.__file__),'zig'))") \
  make windows                # writes epp.exe

make windows runs tools/build-windows.mjs, which calls zig c++ --target=x86_64-windows-gnu ... -static. The result is a plain console program, so it works in PowerShell, Command Prompt, Windows Terminal and the VS Code integrated terminal alike. It is a build output, so it is not tracked in Git; build it whenever you want a fresh copy.

The full repository’s C++ and Python runners can use Colors, but have no Draw or Game canvas. The copies and native binary inside E++.zip reject Colors, Draw and Game with a helpful error, including after rebuilding from the ZIP’s source. In an extracted ZIP, make, make test and npm start work; rebuilding release archives and the npm test scripts require the full source checkout. For detailed build differences, see LANGUAGE.md.

In the full checkout, after make zip, run npm run test:distribution to check the extracted archives. Optional end-to-end tests require npm install and a Chromium/Chrome executable: set EPP_BROWSER to its path, then run npm run test:eshare, npm run test:studio:alpha and npm run test:distribution:browser.

Projects and safety

Export downloads a sealed project; Keys exports or imports the keyring needed to open it on another browser or machine. Keep both safe. EShare codes include the key needed to open them, so share them only with people you trust. Don’t run untrusted projects without reviewing them; native Python integration can execute Python on your computer.

The Studio uses src/lexer.cpp compiled to offline WebAssembly and consumes its tokens in a JavaScript evaluator. The native CLI separately uses the C++ parser and interpreter; the browser does not run those components. If the compiled lexer is unavailable, Studio stops with E601 rather than silently falling back. See WIKI.md for architecture, limitations and troubleshooting.

Licensed under Apache 2.0; third-party notices are in third_party/licenses/.

About

Looks like English, reads like English, and is english (also btw this is the IDE to run E++ and yes this is inspired by WeeklyHows video)

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages