-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PropertyKey change, basic class synthesis and other fixes
- Loading branch information
1 parent
0b5f688
commit c10b772
Showing
62 changed files
with
4,821 additions
and
3,399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
> Building a type checker is hard. Here are some tricks that Ezno uses to keep the codebase small and simple | ||
### Specializing generics | ||
### Specialising/substituting generics | ||
Finding the values for generics is done during subtype checking #TODO | ||
|
||
### Object keys are types | ||
When `x.t` a `"t"` type is created. | ||
|
||
#TODO how does casting work | ||
|
||
## Internal #TODO | ||
|
||
- `Environment::parents_iter` | ||
- `get_on_ctx!` | ||
- `Logical` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
While Ezno is have a high JS compatibility, the following compromise the fundamentals of Ezno and are also advised as bad features to use. | ||
|
||
Note all of these are not supported in TSC either | ||
|
||
Not supporting in JavaScript: | ||
- dynamic import with a non-constant value. Can introduce unknown and unreliable side effects. | ||
- Also just avoid as they slow down things in the checker | ||
- Want something [this to be added](https://github.com/tc39/proposal-defer-import-eval) for lazy loading that is statically analyzable | ||
- `super` calls in a conditional context of a constructor | ||
- Really difficult to add the checker without adding enormous complexity and overhead | ||
- Means that reference errors | ||
- `eval` just don't | ||
- `with` | ||
|
||
Not supporting from TypeScript: | ||
- Function overloading syntax (use generics and matchings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[The specification](./specification.md) is a markdown document that defines what the behavior of Ezno's checker. It is meant to server both as documentation and what is currently supported as well as a test suite to ensure there isn't a regression in the checker. | ||
|
||
[specification.md](./specification.md) defines current behavior which works on the main branch. [staging.md](./staging.md) can be used as a well to introduce behavior during the implementation and remains separated from the rest. It can be enabled with the `staging` features and exclusively with `staging-only`. [to_implement.md](./to_implement.md) contains future tests that do not currently passed. They can be viewed as a target for the checker and copied to staging when ready to implement. | ||
|
||
These can all be ran as tests using the markdown to Rust test code transpiler in [build.rs](./build.rs). | ||
|
||
- The cases should be brief and only test a specific aspect of the language | ||
- Each block contains errors, the list afterwards is the expected errors | ||
- Comments can be in block quotes to explain additional details in the tests | ||
- Sections are at level three headings (`###`), tests are at level four headings (`####`), the tested code goes a code block with the language tag `ts` and errors in a bullet list after in order | ||
- Blocks can be split into files with a `// in file.ts` comment, below which all code is in the `file.ts` file. Default is `main.ts` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.