Carp/docs/Todo.md

77 lines
4.5 KiB
Markdown
Raw Normal View History

2017-10-10 14:20:59 +03:00
# Todo
2017-11-20 12:15:57 +03:00
## Milestones
* 0.3 - Hopefully done soon, fixing the most pressing issues.
2017-12-07 20:11:10 +03:00
* 0.4 - A nice minimal version of the language. Should be possible to use for somewhat realistic projects.
2017-11-20 12:15:57 +03:00
* 1.0 - The completed version of the language with all planned features and extra nice ergonomics.
2017-10-10 14:20:59 +03:00
## Critical Bugs
2017-12-28 19:24:58 +03:00
* [0.3] Need to refactor the sorting of bindings! Hacked it for now with Obj.hs:277 "visitType (Just _) = 50"
2017-12-08 16:36:40 +03:00
* [0.3] When referring to nonexisting type in 'the' form, the compiler barfs.
2017-11-20 12:15:57 +03:00
* [0.3] Can't define globals with heap allocated types (String, structs, etc.)
2017-12-13 10:45:31 +03:00
* [0.3] The compiler can crash when defining invalid struct types, it should present nice errors instead.
* [0.3] Allocate enough memory in the Array.str and struct.str functions.
* [0.3] When composing interfaces the concretizer needs to run more times to make sure that all types are figured out.
2017-10-17 10:02:12 +03:00
2017-10-10 14:20:59 +03:00
## Big Language Features
2017-12-05 14:24:03 +03:00
* [0.4] Distinguish immutable/mutable refs?
2017-11-20 12:15:57 +03:00
* [0.4] Generic data types (apart from Array, which already is)
2017-12-13 10:45:31 +03:00
* [0.4] Doc strings.
2017-11-20 12:15:57 +03:00
* [1.0] Tagged unions (also known as "sum types" or "enums")
2017-12-07 20:11:10 +03:00
* [1.0] Lambdas (anonymous functions) that compile on Windows and don't leak memory!
2017-10-10 14:20:59 +03:00
## Smaller Language Features ("niceties")
2017-12-07 20:11:10 +03:00
* [0.3] Errors in macros should present the code location of both the macro and of the code that uses of it.
2017-12-13 10:45:31 +03:00
* [0.3] If main returns the value of a function returning a generic type it will fail (because there is no constraint for "Int or ()")
2017-12-22 16:49:13 +03:00
* [0.3] Optimization: Implement '=' for refs to numeric types, that way Array.= can aviod copying each element before comparing them.
2017-12-13 10:45:31 +03:00
* [0.4] Reintroduce the p-string patch but with support for embedded string literals.
* [0.4] Should be possible to read float literal without '.', eg. "3f" (because that's how they print sometimes)
* [0.4] Defining a local variable messes up unqualified lookup of function with the same name, e.g. (let [words (words &s)] ...)
2017-12-04 09:40:06 +03:00
* [0.4] The type error when setting a variable but missing the '&' is confusing: "Can't unify Int with &Int"
2017-12-13 10:45:31 +03:00
* [0.4] Good string functions
2017-11-21 14:35:35 +03:00
* [1.0] A way to assert compiler errors in tests
2017-11-20 12:15:57 +03:00
* [1.0] Rename type variables from t0, t1, t2 to a, b, c, etc.
2017-11-20 10:04:29 +03:00
## Macro System
2017-11-20 12:15:57 +03:00
* [0.3] Some lists and similar things generated by built in dynamic functions like 'cons' etc don't create proper Info for their XObjs
2017-12-13 10:45:31 +03:00
2017-11-20 12:15:57 +03:00
* [1.0] Quasiquote
* [1.0] Splicing in macros
* [1.0] Pattern matching on arguments in macros?
2017-11-20 10:04:29 +03:00
2017-11-20 10:05:08 +03:00
## Tooling
2017-12-23 16:10:44 +03:00
* [0.3] Project setting for turning off bound checks and similar.
* [0.3] Errors in the parser or emitter don't stop evaluation, only errors during evaluation?
2017-11-20 12:15:57 +03:00
* [0.3] Somehow make it possible to enter ":t foo" at the REPL (can't be done now because each atom is evaluated separately)
2017-12-15 17:31:56 +03:00
* [0.3] The (project-set! ...) command should accept args of various types, not just String.
2017-12-13 10:45:31 +03:00
2017-11-20 12:15:57 +03:00
* [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)
* [0.4] Entering the name of a symbol at the REPL prints nothing.
2017-12-23 15:54:47 +03:00
* [0.4] Show "call stack" when getting an error during concretization.
2017-12-13 10:45:31 +03:00
2017-11-20 12:15:57 +03:00
* [1.0] Preserve whitespace to allow saving forms back to disk
* [1.0] Refactorings at the REPL. Rename, extract function, add/remove parameter?
2017-11-20 10:05:08 +03:00
## Code generation
2017-11-20 12:15:57 +03:00
* [1.X] LLVM backend
* [?] Emit #LINE macros in the generated C code
2017-11-20 10:05:08 +03:00
2017-11-20 10:04:29 +03:00
## 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. Or rewrite it as a normal function, that should solve it.
* [1.0] Would be nice if Info from deftypes propagated to the templates for source location of their member functions.
2017-11-20 12:15:57 +03:00
* [1.0] Remove unnecessary Array-functions and rewrite them in Carp?
* [1.0] "Setting" of string literals? (let [x "a"] (set! x @"b"))
2017-10-10 14:20:59 +03:00
2017-10-10 14:50:47 +03:00
## Language Design Considerations
2017-10-12 09:05:54 +03:00
* What's the correct type of the variable in a set!-form, i.e. (set! &x value) or (set! x value)
2017-10-10 21:13:58 +03:00
* How should passing primitive types (that do not care about being referenced) as ref:ed parameters be handled?
2017-10-12 09:05:54 +03:00
* How to handle heap allocated values? Box type with reference count?
2017-10-12 22:20:18 +03:00
* Fixed-size stack allocated arrays would be useful (also as members of structs)
* Macros in modules must be qualified right now, is that a good long-term solution?
2017-11-20 10:04:29 +03:00
* 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?