by abhorrence · 6y ago · 0 comments
- global inference is more trouble than its worth. some way to opt sections of code out of global inference in exchange for faster compile times and better type error messages would be wonderful
- conflicting/duplicate C bindings in libraries aren’t easy (or even possible sometimes) to reconcile
- a lot of standard library interfaces to system stuff (e.g. sockets) are hard to extend for additional uses. there’s a number of reasons for this, but among them: enums wrapping simple integer based enums, but not actually covering all the values.
- parser is hard to reuse outside of the compiler itself, which is an impediment to making neat tools.
- some strange choices around co/contra-variance when dealing with arrays
I think this is long-gone isn't it? It's local now.
> parser is hard to reuse outside of the compiler itself
A problem we repeat again and again!
module Example
def self.some_method
"string"
end
class Foo
getter :var1
def initialize
@var1 = SomeUtilities.something
end
end
module SomeUtilities
def self.something
Example.some_method
end
def self.do_something_with_string(input : String)
puts input
end
end
end
Example::SomeUtilities.do_something_with_string(Example::Foo.new)
If you change Example.some_method to return :symbol, you now get a type error on the final line.