Skip to content

AmanCode22/ethos-lang

Repository files navigation

Ethos

Ethos Logo

A language that speaks for itself.

Ethos transpiles English-like syntax to Python. Every statement ends with a period. No brackets, no semicolons.

I built this solo. Class 9 student from India. Every line of code is mine.

Quick Example

ask "What's your name? " into name.

set greeting to "Hello, ".
say greeting.
say name.

set score to 95.

if score is above 90.
    say "That's an A.".
otherwise if score is at least 75.
    say "That's a B.".
otherwise.
    say "Keep going.".
end.

Installation

Windows / macOS

Download the installer from releases. The installer includes both Ethos and Forge (the package manager).

Linux

See LINUX_INSTALL.md for distro-specific instructions.

Core Features

  • English syntax - if, while, repeat, count loops all read like sentences
  • Type casting - set age to "25" to number.
  • String slicing - set piece to text from 0 to 5.
  • Functions - how to greet with name. / run greet with "Aman".
  • Imports - bring in math. then run math.sqrt with 16.
  • Hard Traits - Load compiled C/C++/Rust binaries via ctypes
  • Soft Traits - Install Python packages to ~/.ethos/traits/

Project Structure

ethos-lang/
├── main.py
├── requirements.txt
└── src/ethos/
    ├── cli.py          # REPL + file runner
    ├── lexer.py        # Sentence splitter + tokenizer
    ├── parser.py       # Transpiler (Ethos → Python)
    ├── executer.py     # Runtime + Hard Trait loader
    ├── stdlib_shim.py  # Forces stdlib into Nuitka binary
    └── version.py      # Version string

What's Next

  • Android via Termux
  • Hard Trait SDK for C/C++/Rust
  • Rust rewrite of the transpiler (planned for performance + memory safety)

Not planning right now: LSP, VSCode extensions, GUI IDE.

Contributing

Solo project. Contributions welcome, especially:

  • Hard Trait SDK bindings (Go, Java, Zig — I'm handling C/C++/Rust)
  • Bug reports and fixes

Open an issue before starting large features to avoid duplicate work.

Docs

Related

About

A conversational, English-like programming language running safely on Python

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages