PUT (Proficient Universal Transformer) is an experimental programming language designed for machine learning and scientific computing tasks. It aims to combine the simplicity of high-level languages with the performance needed for intensive computations.
Currently, PUT supports:
- Basic arithmetic operations
- Variable declarations and assignments
- Parenthesized expressions
- Tensor operations (creation, addition)
- Project configuration via
.zom
files
- Rust (latest stable version)
- Cargo (comes with Rust)
-
Clone the repository:
git clone https://github.com/yourusername/put-lang.git cd put-lang
-
Build the project:
cargo build
To run the PUT interpreter:
cargo run
This will execute the sample code in main.rs
and demonstrate basic language features and tensor operations.
src/main.rs
: Entry point and demo codesrc/ast.rs
: Abstract Syntax Tree definitionssrc/lexer.rs
: Lexical analysissrc/parser.rs
: Parsing logicsrc/token.rs
: Token definitionssrc/zom_parser.rs
: Parser for .zom configuration filessrc/tensor.rs
: Tensor operations for machine learning
Here's a simple PUT program:
var x = (42 + 5) * 2 - 3 / 1.5;
Tensor operations:
let t1 = Tensor::new(vec![1.0, 2.0, 3.0, 4.0], vec![2, 2]);
let t2 = Tensor::new(vec![5.0, 6.0, 7.0, 8.0], vec![2, 2]);
let t3 = &t1 + &t2;
Run the test suite with:
cargo test
- Implement more tensor operations (subtraction, multiplication, division)
- Add support for machine learning algorithms (linear regression, neural networks)
- Enhance language syntax for ML-specific operations
- Implement a REPL (Read-Eval-Print Loop) for interactive use
- Add GPU acceleration for tensor operations
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.
This means you are free to:
- Use the software for any purpose
- Change the software to suit your needs
- Share the software with your friends and neighbors
- Share the changes you make
Under the following conditions:
- If you distribute this software, you must provide the source code
- Any modifications you make must also be licensed under the GNU GPLv2
- You must include a copy of the license with the software
For more details, see the GNU General Public License v2.0.
- Rust programming language and community
- Inspiration from Python, Julia, and TensorFlow