Skip to content

Commit

Permalink
Started preparing for version 2.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
DevReaper0 committed Oct 20, 2022
1 parent 96cf47a commit 9f5fe65
Show file tree
Hide file tree
Showing 23 changed files with 392 additions and 502 deletions.
34 changes: 24 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
The format a slightly altered version of [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).

## [Unreleased]
## A Look to the Future
- Support for variables in the `catch` statement
- More error messages
- Complete requests HTTP library
- Better interfacing with python code from ParaCode
- The ability to use keyword arguments when calling a function
- **kwargs (Keyword Arguments)
- More exceptions
- More exceptions & error messages
- Better interfacing with python code from ParaCode
- An entire interfacing module for ParaCode/C++ communication to maintain parity and compatibility with the C++ port (Python interfacing probably won't be added to the port)
- A complete requests HTTP module
- A unit tests module
- A better icon

## [2.1.0] - CURRENTLY UNRELEASED
### Added
- Easy use of default parameters in functions
- *args (Non-Keyword Arguments)
- Complete regex support
- Some basic exceptions
- A reflection module
- Enums

### Changed
- Made the repl slightly nicer to look at
- Made dictionaries more internal.

### Fixed
- Fixed TimeDelta not working with optional arguments
- Fixed scenarios like `my_number != null && my_number > 0` crashing from the right side being evaluated even when the left side is false

### Removed
- PCPM executable (in the future, it will be installed via the ParaCode Installer)
- `installDependencies.py` as it has been unneeded for quite a while

### Security
- PCPM now supports publishing packages more securely and supports authentication. For examples on how to implement this in a package repository, see the changes made to the CDN

## [2.0.1] - 2021-10-18
### Fixed
- Fixed what happens when using `||` and `&&` if you had an expression after the operators. If you ran `"A" == "A" || "A" == "B"`, it would interpret it as `("A" == "A" || "A") == "B"`, so it would return false instead of true.
Expand Down Expand Up @@ -54,7 +69,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security
- PCPM package uploading doesn't require a login

[Unreleased]: https://github.com/DaRubyMiner360/ParaCode/compare/2.1.0...HEAD
[2.1.0]: https://github.com/DaRubyMiner360/ParaCode/compare/2.0.1...2.1.0
[2.0.1]: https://github.com/DaRubyMiner360/ParaCode/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/DaRubyMiner360/ParaCode/releases/tag/2.0.0
[2.1.0]: https://github.com/ParaCodeLang/ParaCode/compare/2.0.1...rewrite
[2.0.1]: https://github.com/ParaCodeLang/ParaCode/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/ParaCodeLang/ParaCode/releases/tag/2.0.0
Binary file removed PCPM
Binary file not shown.
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,60 @@ In ParaCode, all types are objects, and vice versa. Everything is an object, and

The core library in ParaCode is written in itself, even allowing for methods to be attached with the `Object.patch()` method at runtime. Types in ParaCode are built of `Object`s and have overloadable functions for operations such as addition, subtraction, multiplication, division, modulus, and compare. Types including String, Int, Float, and Bool are all defined completely in ParaCode, including all operations that can be done on them. For instance, the call operator can be overloaded, with an example being that when a Number is called `5(10)` it multiplies the values together, allowing for a math-like syntax in programming.

ParaCode also has many methods that have functional language characteristics for example Array mapping and lambdas, and new concept ideas such as [Prototypical Inheritance](https://en.wikipedia.org/wiki/Prototype-based_programming).
ParaCode also has many methods that have functional language characteristics for example Array mapping and lambdas, and new concept ideas such as [Prototypical Inheritance](https://en.wikipedia.org/wiki/Prototype-based_programming).

Later I plan to rewrite ParaCode in C/C++ for better speed, efficiency. I plan to keep ParaCode code and the standard library similar to how it is today.
I'm currently rewriting ParaCode in C++ for better speed and efficiency. I'm planning to keep ParaCode code and the standard library similar to how it is today, and even try maintaining version parity unless it becomes too much of a burden on me and the language itself.

[vars](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/00_vars.md) - How to declare and use variables
[vars](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/00_vars.md) - How to declare and use variables

[functions](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/10_functions.md) - Writing and calling functions
[functions](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/10_functions.md) - Writing and calling functions

[strings](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/15_strings.md) - Strings operations and interpolation
[strings](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/15_strings.md) - Strings operations and interpolation

[operators](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/16_operators.md) - Available operators + Operator overloading
[operators](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/16_operators.md) - Available operators + Operator overloading

[types](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/20_types.md) - Custom types
[types](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/20_types.md) - Custom types

[proto](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/30_proto.md) - Extending types using prototypical inheritance
[proto](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/30_proto.md) - Extending types using prototypical inheritance

[macros](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/35_macros.md) - Macros
[macros](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/35_macros.md) - Macros

[arrays](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/40_arrays.md) - Array operations
[arrays](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/40_arrays.md) - Array operations

[dictionary](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/41_dictionary.md) - Dictionary operations
[dictionary](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/41_dictionary.md) - Dictionary operations

[iterators](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/50_iterators.md) - Building custom iterator objects
[iterators](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/50_iterators.md) - Building custom iterator objects

[random](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/55_random.md) - Random number generation
[random](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/55_random.md) - Random number generation

[modules](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/60_modules.md) - Modules
[modules](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/60_modules.md) - Modules

[packages](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/61_packages.md) - Packages
[packages](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/61_packages.md) - Packages

[console](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/70_console.md) - Console input and output
[console](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/70_console.md) - Console input and output

[files](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/80_files.md) - File reading and writing
[files](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/80_files.md) - File reading and writing

[json](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/doc/81_json.md) - JSON reading and writing
[json](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/doc/81_json.md) - JSON reading and writing


### Examples

[embedding](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/examples/embed.py)
[embedding](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/examples/embed.py)

[numbers](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/examples/numbers.para)
[numbers](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/examples/numbers.para)

[strings](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/examples/string.para)
[strings](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/examples/string.para)

[patching](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/examples/patching.para)
[patching](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/examples/patching.para)

[operator overloading](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/examples/operator_overloading.para)
[operator overloading](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/examples/operator_overloading.para)

[tic tac toe](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/examples/ttt.para)
[tic tac toe](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/examples/ttt.para)

[pythagorean theorem calculator](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/examples/pythagorean.para)
[pythagorean theorem calculator](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/examples/pythagorean.para)

[rule110](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/examples/rule110.para)
[rule110](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/examples/rule110.para)

Be sure to check out our TicTacToe example!
Start the REPL by running `main.py` and call `tictactoe();` to try it out!
Expand All @@ -69,4 +69,4 @@ sh update.sh
```
Or, to install and update ParaCode, run everything from `update.sh`.

You can find the [Changelog](https://github.com/DaRubyMiner360/ParaCode/blob/rewrite/CHANGELOG.md) here.
You can find the [Changelog](https://github.com/ParaCodeLang/ParaCode/blob/rewrite/CHANGELOG.md) here.
16 changes: 11 additions & 5 deletions doc/61_packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,33 @@
You might want to use an external package
to expand upon the ParaCode codebase.

This page expects you to already have
PCPM installed. In the future, you'll
be able to rerun the installer to install
it, but for now, you have to [compile it yourself](https://github.com/ParaCodeLang/PCPM).

Let's get started by showing how to install
a package.
a package with the ParaCode Package
Manager, or PCPM for short.

You can install a package with:
```shell
./PCPM install PACKAGENAME
PCPM install PACKAGENAME
```
You can also use `get` instead of `install`.

You can update an installed package with:
```shell
./PCPM update PACKAGENAME
PCPM update PACKAGENAME
```

You can uninstall a package with:
```shell
./PCPM uninstall PACKAGENAME
PCPM uninstall PACKAGENAME
```
You can also use `remove` instead of `uninstall`.

You can publish a package with:
```shell
./PCPM publish PACKAGENAME VERSION
PCPM publish PACKAGENAME VERSION
```
2 changes: 1 addition & 1 deletion examples/numbers.para
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
let x = 10;

print("Initial value: "+x);
// set and add 10
// Set and add 10
x += 10;
print("Value after addition: "+x);
// Multiply x by 2
Expand Down
8 changes: 4 additions & 4 deletions examples/operator_overloading.para
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ let Person = Type.extend({
instance = {
name: str

// overload the | operator
// Overload the | operator
func __bitor__(self, other) {
return Person.new(self.name + ' ' + other.name);
}

// example of lambdas
// Example of lambdas
to_str: Func = self -> "Person [name: " + self.name + "]"
}

// constructor
// Constructor
func __construct__(self, name) {
self.name = name;
}
Expand All @@ -20,4 +20,4 @@ let Person = Type.extend({
let person_a = Person.new('Bruce');
let person_b = Person.new('Wayne');
let combined = person_a | person_b;
io.write_color(Console.RED, combined); // prints `Person [name: 'Bruce Wayne']` in red
io.write_color(Console.RED, combined); // Prints `Person [name: 'Bruce Wayne']` in red
6 changes: 3 additions & 3 deletions examples/patching.para
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Int.patch({
// overload object being called as a function.
// arguments are passed in as an array, so
// Overload object being called as a function.
// Arguments are passed in as an array, so
// you need to splat (*) the arguments, expanding
// from the first (the first argument would be the `Int` type
// itself)
Expand All @@ -10,4 +10,4 @@ Int.patch({
});

let result = 10(20);
print(result); // prints 200
print(result); // Prints 200
14 changes: 14 additions & 0 deletions examples/reflection.para
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import "std/util/reflection.para";

let T = Reflection.get(null, "int");
print(T);
let t = T.new(1);
print(t);

// Get and set variables
print(Reflection.get(T, "name"));
print(Reflection.get(t, "_value"));
Reflection.set(T, "name", "RenamedInt");
Reflection.set(t, "_value", 5);
print(Reflection.get(T, "name"));
print(Reflection.get(t, "_value"));
4 changes: 2 additions & 2 deletions examples/string.para
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// format string with "World"
// Format string with "World"
print("Hello, %!".format("World"));

// Multiply string by number
print("=" * 20);

// add 10 to 42
// Add 10 to 42
print(("42".to_int())+10);
85 changes: 0 additions & 85 deletions installDependencies.py

This file was deleted.

5 changes: 5 additions & 0 deletions interpreter/basic_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ def compare_value(self, other):

return True

def extract_value_member(self):
if self.lookup_member("_value") is not None:
return self.lookup_member("_value").value
return self

def extract_value(self):
return self

Expand Down
Loading

0 comments on commit 9f5fe65

Please sign in to comment.