Skip to content
This repository was archived by the owner on Feb 1, 2021. It is now read-only.

Latest commit

 

History

History
209 lines (182 loc) · 5.26 KB

ROADMAP.md

File metadata and controls

209 lines (182 loc) · 5.26 KB

Roadmap

Roughly in order of priority, non exhaustive

Lexer

  • Triple quote strings (multiline) e.g """ abc """
  • Templated strings
  • Templated strings nested
  • Simple Strings e.g “abc”
  • Char literals e.g 'a'
  • Char unicode literals e.g '\uabcd'
  • Char escaped sequences literals e.g '\r'
  • All single character lex tokens e.g }
  • All multi character lex tokens e.g !==
  • Treat \r\n as newline
  • Nested comments
  • Doc comments
  • Identifiers (potentially with unicode)
  • Identifiers inside backticks e.g
    `foo bar`
    
  • Keywords
  • Don’t give out of bounds locations
  • Newline-sensitive
  • Annotations (e.g @Timeout)

Parser

  • Simple AST
  • Math expressions e.g 1 + 3
  • Strip comments, shebang, etc from ast before parsing
  • Math
  • Boolean logic e.g 1 > 2 != 3<4
  • Newline-sensitive
  • Range e.g 1..5
  • If
  • When
  • When with subject
  • Range test in when entry e.g when {4 in 1..5 -> 99 else 0}
  • Type test in when entry e.g when {4 is Int -> true else false}
  • Elvis operator
  • As expression
  • While
  • Do while
  • Val declaration e.g val a = 1
  • Var declaration e.g var a = 1
  • When with subject with binding e.g when (val x = 1) {0 -> 1; 1 -> 2; 2 -> 4; else x * 2}
  • Do while with binding e.g do {val a = 1} while (a < 10)
  • Explicit types e.g val a: Long = 1
  • Prefix increment/decrement operators e.g --a; ++a;
  • Postfix increment/decrement operators e.g a--; a++;
  • Variable assignement
  • Break
  • Continue
  • Simple inline functions declaration without arguments e.g fun add(): Int = a + b
  • Simple C-like functions declaration without arguments e.g fun add(): Int { a + b; }
  • Function call without arguments e.g add()
  • Simple inline functions declaration e.g fun add(a: Int, b: Int): Int = a + b
  • Simple C-like functions declaration e.g fun add(a: Int, b: Int): Unit { a + b; }
  • Function call e.g add(1, 5)
  • Return in function e.g fun add(a: Int, b: Int): Int { return a + b; }
  • Explicit type for function with block body (except Unit)
  • In expression e.g val a = 1 in 0..10
  • Is expression e.g val a = 1 is Int
  • Call function with named parameter
  • Default value for parameter in function
  • Tailrec function
  • Variadic function
  • Class
  • Data class
  • Enum
  • Shebang
  • Import
  • Package declaration
  • Try-catch
  • Finally
  • Annotations
  • Infix function
  • For
  • Special syntax for last function call argument if it is a callable e.g values.map { it * 2}
  • As expression
  • Jump expression with label e.g return@loop; break@foo; continue@bar;
  • Interface
  • Type alias
  • Visibility modifier
  • Generic
  • Contract
  • Generic constraint
  • Operator overloading
  • Extension function
  • Lambda
  • Sealed class
  • Inheritance
  • Object (i.e singleton)
  • Destructuring declaration
  • Delegation
  • Delegated properties

Type checker

  • Short type
  • UShort type
  • Byte type
  • UByte type
  • Nothing type
  • Any type
  • Smart casts
  • Nullable types
  • Type check math
  • Type check boolean logic
  • Type inference

Name resolution

  • Variable
  • Function call
  • Class resolver
  • Out of order resolution

Lint

  • Warning on shadowing
  • Warning on unused
  • Too many function arguments (255 for the JVM)

CLI

  • Simplify CLI (align with kotlinc?)
  • Add debug dump of the AST
  • Add debug dump of resolution & types
  • Show default paths of dependencies e.g stdlib
  • Give on the CLI paths of dependencies e.g stdlib

Errors

  • Ternary operator
  • Missing parentheses around if, while, for, when clause
  • Variations of a unicode literal '\u{abcde}' or \uabcde
  • Show hints on error
  • Show full line of source code on error
  • Show the exact location on the line of the error with description

Examples of using the project as a library

  • Add AST sexp dump
  • Write examples in rust
  • Write one example in another language (C? Python? Java with JNI?) -> simple stats, kotlinfmt, remove unused, loc count

Research

  • Type inference
  • Generics
  • Java Byte Code
  • Varargs
  • Null safety
  • Language server (?)

Code emitting

  • IR (?)
  • Lisp

JVM

  • println
  • int math
  • long math
  • float math
  • double math
  • hello world
  • binary operators (==, !=, <=, <, etc)
  • Test metadata size() calculations
  • Test metadata serialization
  • High level API to handle stack/locals/types
  • boolean
  • char
  • Conversion between types (?)
  • Track max stack/locals
  • if-else
  • while loop
  • Locals
  • Assignment
  • Functions
  • When
  • Break
  • Continue
  • Lines debug information
  • Local variables debug information
  • Package
  • Stack map frames (hard)

ASM

  • println
  • unique constants
  • hello world
  • int math
  • long math
  • Conversions between primitive types
  • (In)Equality test
  • While
  • For

Optimizations

none at the moment

TODO