Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP #1

Open
17 of 58 tasks
toyboot4e opened this issue Aug 28, 2021 · 1 comment
Open
17 of 58 tasks

WIP #1

toyboot4e opened this issue Aug 28, 2021 · 1 comment

Comments

@toyboot4e
Copy link
Owner

toyboot4e commented Aug 28, 2021

Let's make it a real thing :)

1. Primitive language (WIP)

1-1. Frontend IR

  • Parse Item s
  • Lower procedure Body
  • Collect Body expressions and patterns into ExprScopeMap
  • Collect ItemScope and ExprScopeMap into Resolver

1-2. Simple type inference

  • Add type data subtable to procedure body: TypeTable
  • Infer types
  • Resolve paths to items and retrieve their types

1-3. Simple langauge features

  • Local variables (let)
  • i32, f32 and builtin operators
  • bool
  • Control flow 1 (when, unless, cond, while)
  • Explicit block scope (do)
  • User-defined procedures
  • Procedure call
  • Annotate procedure parameter types
  • return
  • Control flow 2 (loop, continue, break)
  • String literals
  • GC
  • Print functions
  • Assertions

1-4. Utilities

  • Debug representation of patterns and expressions
  • Accumulate diagnostics in each path
  • Rendering diagnostics

1-5. Basic IDE support

  • Diagnostics
  • Go to definition
  • Rename symbol
  • Inlay hints

1-6. More IRs

  • Validated IR?
  • BIR? (MIR-like CFG-based IR, but also for frontend)

2. Extendible the language (TODO)

2-1. User-defined types

  • Struct syntax support
  • Allow field access with dots (Path)

2-2. Missing features

  • Global variables
  • Pure functions (fn)
  • Inner items
  • Comprehensive match

2-3. Generics

  • Generic types, generic type inference
  • Generic function
  • Array
  • Map

2-4. Modules

  • Inline module (mod special form)
  • Visibility
  • Import resolution
  • Handle name resolution operators (:: or maybe .)

2-5. Macro support

  • Macro syntax
  • Virtual files originated from macros
  • Macro expansion pass

2-6. Multi file support

  • External modules
  • IDE support

3. More IDE features (TODO)

3-1. Features

  • Completions
  • Code snippets
  • Search symbols

3-2. Optimizations

  • Faster re-parse?

3-3. LSP

  • tower_lsp

4. Scripting features

  • Coroutines
  • Matching over macro inputs
  • Rust bindings(Vec, HashMap, etc.)
  • Typed path variables (over asset paths)
@toyboot4e
Copy link
Owner Author

toyboot4e commented Aug 18, 2022

ra hir_def notes

Data types

Type Item Body (patterns / expressions)
Arena ItemTree Body
Source map AstIdMap AstIdMap, BodySourceMap
Scope ItemScope (DefMap, ModuleData) ExprScopes

Terms

  • Arena: Push-only Vec
  • Interning: Fly object pattern, often with salsa IDs
  • Lowering: Converting AST into HIR types in Arena
  • Source map:
    • AstIdMap: Map between rather stable index (Idx) and AST syntax (SyntaxNodePtr)
    • BodySourceMap: Map betweens HIR Arena item's Idx and AST syntax (SyntaxNodePtr)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant