Skip to content

Commit

Permalink
Release 0.0.2
Browse files Browse the repository at this point in the history
Added Commandline file support
  • Loading branch information
SujalChoudhari committed May 28, 2023
1 parent 5180bb1 commit 7efead6
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 20 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [0.0.2] - 28-05-2023
User Defined Functions

### Added
- User Defined Functions
- Closures
- Command line Execution of Interpreter

### Removed
- `return` keyword


## [0.0.1] - 25-05-2023
First Release (Coda Release-alpha)

Expand Down
35 changes: 24 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Coda
## C++ Objects Dynamic Architecture
Coda is an interpreted utility language designed to provide a flexible and efficient programming experience.
The name "Coda" represents its ability to complement existing coding languages by serving as a valuable addition
or extension to any software development project.
Coda is a C++-based interpreted language designed to allow for rapid development and execution of code.
Its built-in functions and libraries simplify common programming tasks, improving productivity.
Coda also offers high performance and versatility thanks to its implementation in C++.


## Features

Expand All @@ -20,33 +21,45 @@ To start using Coda, follow these steps:

1. Install the Coda interpreter.
2. Write your Coda code in a text file with the `.coda` extension.
3. Run the Coda code by executing the interpreter with the path to your code file.
Simply Run the Code, and start using it as a editor.
3. Run the Coda interpreter with the path to your Coda file as an argument.
For example, if your Coda file is named `hello.coda`, you would run the interpreter as follows:
```
Coda hello.coda
OR
Coda.exe hello.coda
```

# Development Roadmap
- [x] Lexer/Tokenizer
- [x] Parser
- [x] Interpreter
- [ ] Number Datatypes (int,float,byte,double) (removed)
- [x] Boolean Types (bool, uses c++ boolean in background)
- [x] Boolean Types (bool, uses C++ Boolean in background)
- [x] Strings
- [x] Variables (Assignment - dynamic)
- [x] Variables (Assignment - constants)
- [x] Variables (Look Up)
- [x] Objects (Js-like objects)
- [x] Native Functions (printing,inputs,sleep)
- [ ] User Defined functions
- [x] BuiltIn Functions (parse<data-type>,conversions)
- [x] User Defined functions
- [ ] Arrays
- [ ] BuiltIn Functions (parse<data-type>,conversions)
- [ ] Control Statements (if statements)
- [ ] Control Statements (for loops)
- [ ] Control Statements (while loops)
- [ ] Control Statements (forEach loops)
- [ ] Packages (importing and creating, potentially in C++ dll's))
- [ ] Packages (importing and creating, potentially in C++ dll))
- [ ] Object-Orientation

## Contributing
Contributions to the Coda language are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the official Coda GitHub repository.
Contributions to the Coda language are welcome!
If you encounter any issues or have suggestions for improvements,
please open an issue or submit a pull request on the official Coda GitHub repository.

## Changelog
See the [CHANGELOG](CHANGELOG.md) file for details.
Go through the Changelog to see the progress of the language.

## License
Coda is open-source software released under the MIT License.
30 changes: 21 additions & 9 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,30 @@ int repl() {
return 0;
}

int main() {

#ifdef _DEBUG

int main(int argc, char** argv) {
Coda::Runtime::Environment env = Coda::Runtime::Environment::root();
std::string filename;

Coda::Utils::FileReader fr = { "Test/func.coda" };
#ifdef _DEBUG
filename = "Test/func.coda";
#else
if (argc > 1) {
filename = argv[1];
}
else {
std::cout << "No file specified" << std::endl;
return 1;
}
#endif

Coda::Utils::FileReader fr = { filename };
std::string source = fr.readToString();

if (source.empty())
if (source.empty()) {
return 0;
}

Coda::Frontend::Lexer lexer = Coda::Frontend::Lexer();
std::vector<Coda::Frontend::Token> tokens = lexer.tokenise(source);
Expand All @@ -53,10 +67,8 @@ int main() {

IF_ERROR_RETURN(1);
Coda::Runtime::Interpreter inter = Coda::Runtime::Interpreter();
Coda::Runtime::Value out = inter.evaluateProgram(program, env);
inter.evaluateProgram(program, env);

#else
return repl();
return 0;
}

#endif
}

0 comments on commit 7efead6

Please sign in to comment.