Carp/docs/Todo.md
Erik Svedäng ea1d62a635 Todo done.
2017-11-22 12:43:56 +01:00

3.4 KiB

Todo

Milestones

  • 0.3 - Hopefully done soon, fixing the most pressing issues.
  • 0.4 - A nice minimal version of the language. Should be possible to use for small projects.
  • 1.0 - The completed version of the language with all planned features and extra nice ergonomics.

Critical Bugs

  • [0.3] Can't define globals with heap allocated types (String, structs, etc.)
  • [0.3] The compiler can crash when defining invalid struct types, it should present nice errors instead

Big Language Features

  • [0.3] Allow evaluation of dynamic functions in the REPL and give access to the Commands from dynamic code
  • [0.3] Platform defines and optional compilation (requires dynamic evaluation of code at the REPL)
  • [0.4] Generic data types (apart from Array, which already is)
  • [0.4] Doc strings
  • [1.0] Tagged unions (also known as "sum types" or "enums")
  • [1.0] Lambdas (anonymous functions)

Smaller Language Features ("niceties")

  • [0.3] Rename 'aset!' to 'set!'
  • [0.3] Good string functions
  • [1.0] A way to assert compiler errors in tests
  • [1.0] Rename type variables from t0, t1, t2 to a, b, c, etc.

Macro System

  • [0.3] Some lists and similar things generated by built in dynamic functions like 'cons' etc don't create proper Info for their XObjs
  • [1.0] Quasiquote
  • [1.0] Splicing in macros
  • [1.0] Pattern matching on arguments in macros?

Tooling

  • [0.3] Stop evalutaion of forms after errors to avoid "Trying to refer to undefined symbol" error
  • [0.3] Somehow make it possible to enter ":t foo" at the REPL (can't be done now because each atom is evaluated separately)
  • [0.4] Print a warning when changing the type of a function (can create bugs by overriding earlier declarations with the same name)
  • [0.4] Hide instances of templates/generic functions when printing the environment (by default, allow it as a setting)
  • [1.0] Preserve whitespace to allow saving forms back to disk
  • [1.0] Refactorings at the REPL. Rename, extract function, add/remove parameter?
  • [?] Enable printing of typed AST:s at the REPL to help debug unresolved type variables etc.

Code generation

  • [1.X] LLVM backend
  • [?] Emit #LINE macros in the generated C code

Ugliness

  • [0.3] The 'range' function is fully generic (for all 'a') but only compiles when 'a' is numeric type. Make a check for this in the template.
  • [1.0] Remove unnecessary Array-functions and rewrite them in Carp?

Language Design Considerations

  • What's the correct type of the variable in a set!-form, i.e. (set! &x value) or (set! x value)
  • Is some kind of interface/typeclass construct worthwhile?
  • How should passing primitive types (that do not care about being referenced) as ref:ed parameters be handled?
  • How to handle heap allocated values? Box type with reference count?
  • Fixed-size stack allocated arrays would be useful (also as members of structs)
  • Look over how many times the function 'annotateOne' in Infer.hs actually needs to be applied to a form
  • Macros in modules must be qualified right now, is that a good long-term solution?
  • Should macros calling non-macros/non-dynamicfunctions just fail instead of returning an unvealuated list which is pretty confusing?
  • Should @ work for all types, not just the 'use':d ones?
  • Allow use of 'the' as a wrapper when defining a variable or function, i.e. (the (Fn [Int] Int) (defn [x] x))?
  • Being able to use 'the' in function parameter declarations, i.e. (defn f [(the Int x)] x) to enforce a type?