Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.

A temporarly repo for an idea to create a programming language that can be compiled into other languages

License

Notifications You must be signed in to change notification settings

mjarkk/general_programming_language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE: REPO MOVED TO talpalang/talpa

Talpa a General Programming Language

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 foo<bar> or []string
        • Don't fail on these types
        • Parse these types into something usable instaid of a string
      • Inline types
        • structs struct{}
        • arrays []string
        • enums enum{}
      • global types
        • structs struct foo {}
        • enums enum foo {}
        • custom types type foo = []bar
    • Actions
      • Variables
        • Keyword and name let a, const a
        • Variable type let a: string
        • assignment let foo = "bar" or let foo = bar()
      • Function
        • default foo()
        • arguments foo(bar, "baz")
      • Static actions
        • return
        • loop {}
        • while true {}
        • for foo in bar {}
    • Importing
      • Detecting to import someting
      • Validating imports
      • Detect import cycles
      • Propper debugging
        • Error messages show file origin
  • Parsing stage 2 verifying the data and making it more accessible

    • Validating all types
      • User created types
      • Buildin types
    • List of actions
      • Make it impossible to set variable without using it
  • 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

About

A temporarly repo for an idea to create a programming language that can be compiled into other languages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages