Development progress and changes over time.
- Bug fixes
Plan:
- Delegating initializers
- Default parameters
- enumerations
- Bug fixes
Plan:
- Start to implement enumerations
- Definite enum backed by any value (default UInt32)
- Implement new STL methods, operators, etc.
- Many, many more bugfixes
- Address (Nov 20, 2018 Plan 5)
- Add backend contextual generic initialization.
- Add mangling for generic specializations.
- Adjust
getFunctionName
to support generic function mangling. - Modify
ScopeInitItem
for better stringification representation. CallResolver
now stores contextual return type.- Add contextual construction support to
layoutType
- Default initializers now support
selfType
. - Context propagation
- Initializers now support deep context propagation
- Context now also propagates type context.
Function
now supports generics for generic type construction.- Static generic methods
- Support static fields on generic methods
- Add
Pointer<T>.sizeof()
- Add allocation intrinsics
- A lot more misc bug fixes
Plan:
- Implement native initializers (abandoned)
- Prohibit generic static fields.
- Delegating initializers
- Do away with 'prec' types. Only one type with implicit type conversions.
- Implement property negotiation (Nov 19, 2018 Plan 2)
- Add upward negotiation (Nov 20, 2018 Plan 1)
- Modify
PropertyResolver
for proper ambiguity resolution. - Add
TypeContext
stringification and propogation. - Support laying out generic types.
- Address (Nov 20, 2018 Plan 4)
- Refactor initializers.
- Make functions so backendRefs are used.
- Fix bug where global variables would be declared as constants.
Plan:
- Need to figure out upwards negotiation
- Do we need upward negotiation for backend?
- Should backend have access to type contexts.
- Is special behavior needed to compile default inits.
- Add mangler to
TypeContext
- Adjust test runner to avoid duplicate stdlib.
- Add
contextualType(TypeContext)
toGenericParameterItem
- Implement (Nov 19, 2018 Plan 4)
- Implement (Nov 19, 2018 Plan 1)
- Implement (Nov 19, 2018 Plan 6)
Plan:
- ScopeGenericSpecialization probably maybe might need to perhaps maybe be a ScopeTypeItem
- Other resolve classes probably also need to support generics.
- Also need to support method generics.
- Change CallResolver to use objects
- Verify generic and non-generic functions cannot be mixed with same name
- Probably need to de-duplicate
ScopeGenericSpecialization
s
- Add documentation about the different APIs
- Add
vsl/interop
for creating VSL binary compat items.
- Add a
contextualType(TypeContext)
(Nov 4, 2017 Plan 2.5)- This allows resolving generics in context.
Plan:
- Differentiate between explicit and implicit
castableTo
.
- Added constraint which specifies whether an expression can return multiple candidates. This allows lower-level errors to be thrown (Nov 9, 2018 Plan 3)
Plan:
- Adjust
CallResolver
to return multiple candidates when applicable.- This may not be needed we'll see.
- Adjusted
CallResolver
to type deduct in context of function type.
Plan:
- Right now if ANY candidate throws error an overall error will be thrown this
means OVERLOADING WILL NOT WORK. (ADDRESSED)
- Planned fix is to make resolvers return empty array if no candidates.
- Ambiguity can throw error.
CallResolver
best candidate can be optimized to not need the second val pass if apendingTies
array is added.- Add a constraint which specifies that lower-level errors can be thrown
- Modified call resolver to be able to properly handle metatypes.
Plan:
- Modify
CallResolver
to be able to evaluate parameters in the context of the function type.
-
Looks like the
GenericParameterItem
is not aScopeTypeItem
so when checking its type such as in an assignment that would fail. -
What is removed
ScopeGenericItem
as seemed to be a dupe ofGenericParameterItem
. -
Fixed so
GenericParameterItem
conforms toScopeTypeItem
which allows generic params to be used in expressions or type statements. -
Removed
GenericInstance
because instead,ScopeGenericSpecialization( MetaClass(originalClass), originalSpecialization.parameters )
can be used. -
Switched
TypeLookup.GenericLookup
to useScopeGenericSpecialization
.
Plan:
- have the resolvers identify GenericSpecialization and work on the source class while passing the parameters in context.
- The generic context should be like a stack and mismatches are errors.
- so as a result all properties, calls etc. should pop this.
- calls should re-push the specialization if a parameter is returned.
- properties should also re-push the specialization if a parameter is returned.
- No idea if nested generics would still work but the stack concept to my understanding might encounter errors with nested generics.
TypeLookup
needs context/negotiation
Ensure these constraints:
- Multiple overloads of same generic type
- Generic types can be matched to their methods for example.
- Perhaps avoiding deduplication of specializations?
Diagram of how the stack based resolution nature would work
class B<U> {
let x: U
}
class A<T> {
let b: B<T>
}
let a = A<Int>(b: B<Int>( x: 1 ) ).b.x
// | [T: Int] | | | |
// | [] | | |
// | [U: Int] | |
// | [U: Int] |
// | [U: Int T: Int]
//
- Fixed some bugs in typealias ambiguity and now stores position.
- DocGen now does not check output directory if JSON output.
Plan:
- Generics need to being wrapped
- NEED to be being propagated.