-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTODO
More file actions
111 lines (101 loc) · 4.11 KB
/
Copy pathTODO
File metadata and controls
111 lines (101 loc) · 4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
fix type inference issues
- redefining fns means the final generalized type is not known until the last
definition, so if we instantiate a fn before the last definition, the type
checker will be too permissive
- ensure fn args are not generalized. particularly an issue if an arg is
reassigned inside a fn
- deal with recursion. also, mutual recursion via global fns / closures / typeinsts
fix typeclass issues
- fix issue with passing a function as an argument where we don't know how
many context typevars that function will need passed in
- allow default fn defs inside typeclasses
- allow typeclasses over type constructors
- allow contexts for typeinst headers
- allow constructed types in typeinst headers
implement these recommendations: https://www.microsoft.com/en-us/research/wp-content/uploads/1997/01/multi.pdf
- including multi-parameter type classes with functional dependencies
implement number types other than i32
- use multi-param typeclasses for division
- figure out defaulting / coercion
- do we need monomorphism restriction?
implement exponent operator
add a lexer to keep ids from running together
add exceptions
typealias xtype = {a :: atype, b :: btype}
- allow xtype k = {a :: k, b :: int}
object type in typeclass specifies required keys
- allow parsing of object type in typeclass context
- implement by copying key subsets of object args, or log(n) key lookup?
- deal with generalization of fn obj properties
disallow recursive types?
constructed types
- restrict where types can be constructed / unboxed
- disallow conjoining =| clauses with anything other than 'and'
- allow e.g. a =| Just 23
- figure out type defaulting for ambiguous destructed types?
- allow nested destructions
- syntactic sugar: question marks unpack maybes
- deal with unboxed variable scopes
- restrict to parent if / while statement
- disallow variable overwriting by unboxing
- allow unpacking of function args
- allow naming of boxed type with @ notation
- also allow cases via matchargs
- ensure cases are exhaustive
add syntax for global constants
fix parser bug where node's empty child array leads to undefined key
ensure hash function returns positive value
add Char literals and fns
parse escaped sequences from strings
add ternary operator
optional, named fn arguments
add error handling with pretty error messages
- audit to ensure all user errors are handled properly
allow closures
memory management
good namespacing / module system
- allows specifying exported types / functions
- maybe _ specifies module-private fn / data, or unmodifiable object field
- automatic documentation that scrapes comments directly above fn defs
json support
functional language constructs built in (map, filter, reduce, etc)
compose operator in prelude
alternative fn calling syntax: var.fn(arg) where var is passed as first arg of fn
compatible with js and typescript
- package as npm module
- can require js, ts, or bs as modules
interactive prompt
add documentation
LONG TERM IDEAS
promises built in
- any function can be easily wrapped in a promise
- cancelable
- async / await or .then syntax?
- automatically run functional async fns as goroutines?
- incorporate go channels?
by default, functions do not inherit parent scope
- also by default, no argument object / array mutation inside functions ->
- can be made a closure with =>
- can allow mutation with ->>
- or both with =>>
optimizations
- SSA to remove unnecessary statements
- warn about unused variables
- leave primitives unboxed when possible
- inline functions when possible
currying?
- a(_, 23, _) means curry with 23 as the second argument
immutable vars / fields?
gadts?
'memoize' fn in prelude, operates only on functional functions?
- can specify if objects returned should be copies or references
generalized ffi to easily incorporate c, python libs
json config file (e.g. detect overflow, check array bounds) for debugging vs. performance
super long-term: SIMD / GPU / FPGA support
SYNTACTIC SUGAR??
specify infix notation
operator overloading
macros
- alternative lisp output / code syntax?
js-esque bracket-based version with bjs filename
underscore_case pragma converts to camelCase behind the scenes