3 ms·
Hi HN! I’ve been working on this language for about 4 months now. While not “complete”, it does have a number of nice features like virtual functions, type inf
by neeeeees 7y ago
Hi HN!
I’ve been working on this language for about 4 months now. While not “complete”, it does have a number of nice features like virtual functions, type inference, etc.
I reckon it will not be truly useful until GC is added, and that’s what I’m currently working on.
Any feedback is welcome and appreciated!
- jdmoreira 7y agoI think it’s great that more and more people are spending time working on programming languages. I have a few questions for you about the type system / type checking. Does llvm make it easier to implement a statically type language than other backends? For example luajit? And how did you learn to implement the typechecker? Is it algorithm W?
- neeeeees 7y ago1) LLVM IR is strongly typed, which makes it very challenging to implement a dynamically-typed language on top of it. AFAIK, there aren't many (any?) successful such implementations of dynamically-typed languages. I haven't used other backend libraries, but I do think that looser typing at the IR level would make it a lot harder to catch implementation bugs; at least with LLVM, you are likely to hit an assertion if you break typing rules in the IR. 2) The type-checker is fairly ad-hoc, and I admittedly didn't look much into the literature here. The general idea is that since variable/function/class field types are explicitly typed, every expression can be checked for violating it's expected type. Implementation-wise, this is facilitated using the visitor pattern [1]. For certain expressions, some extra flexibility is allowed - for example, assigning an object of a child class to a variable of the parent class is not a type error. [1] https://github.com/neeilan/neeilang/blob/master/src/type-checker.cc https://github.com/neeilan/neeilang/blob/master/src/type-che...
- dilap 7y agoWhat's the motivation? Just a personal itch, or is there something special you're hoping to achieve?
- neeeeees 7y agoJust an itch to understand the tools of the trade better!