Skip to content

talpalang/talpa

Repository files navigation

Talpa a General Programming Language

Rust Contributor Covenant GitHub

A WIP programming language designed to be compiled into many other languages. For more information, see the OSI issue.

Currently, the language contains very few working features. When adding new features, the project follows test-driven development practices.

Roadmap

This roadmap is used to track the progress on the project. If you add a feature and all tests pass, tick it off below.

  • Parsing stage 1 (Parse the code into types)

    • Functions
      • Function keyword and body detection fn FunctionName() {}
      • Function arguments fn foo(bar string) {}
      • Function response fn foo() string {}
    • Types
      • Name parsing string, foo, bar123, int, i8
      • Extending types parsing or []string
      • Inline types
      • arrays []string
      • structs struct foo {} & struct {}
      • enums enum foo {} & enum {}
      • custom types `type foo = []bar``
    • Actions
      • Variables
      • Function
        • default foo()
        • arguments foo(bar, "baz")
      • Static actions
        • return
        • loop {}
        • while true {}
        • for foo in bar {}
        • if foo {} else if bar {} else {}
        • match
          • match foo { }
          • match foo { _ => {} }
          • match foo { bar => {} _ => {} }
    • Importing
      • Detecting to import something
      • Validating imports
      • Detect import cycles
      • Proper debugging
        • Error messages show file origin
  • Parsing stage 2 verifying the data and making it more accessible

    • Output
      • Error logging
      • Warning logging
    • Functions
      • Name
    • Enums, Structs, Global Types
      • Name
    • Validate types names
      • Duplicates
      • Reference to other types must exist
    • List of actions
      • Make it impossible to set variable without using it
      • No duplicated variable names
      • No variable references that do not exist
  • Documentation

    • Code examples for the currently support language features in tests
    • A Markdown file with code examples (see docs)
      • What is currently supported (see docs)
      • List of language features goals like how should inline function work etc.. (see dev plans)

Testing

As the project uses test-driven development, it is important tests are run when making changes. Tests can be run by using the following commands in the command line.

# Run all tests
cargo test

# Run a specific test
cargo test -- --nocapture test_empty

# Run all tests with function in the name
cargo test function

Design Goals

Some design goals I think are important:

  • Preferably no dependencies
  • No non cargo tools required to build this project (By installing rust you should have everything to get started working on this though I might require rust nightly if needed)

License

MIT

Releases

No releases published

Packages

No packages published

Languages