3 ms·
This may be the edge of what is off topic, but I’ve looked for a long time. I’ve worked on a compiler for a HM type checked language for a while. Since Septemb
by jeofken 5y ago
This may be the edge of what is off topic, but I’ve looked for a long time.
I’ve worked on a compiler for a HM type checked language for a while. Since September last year I’ve been stuck trying to implement tagged unions (such as Maybe). I’ve got all other features.
I’m looking for a tutor who would write a type checker with me in a screen sharing session. I’m located in Dalarna, Sweden atm, but can do any timezone that fits. I want to pay for this as I am really really curious to find out how it works! It’d probably be no more than around 100 LOC for just the type inferrer.
- akkartik 5y agoWhat language are you developing in? Is the project code up somewhere? No payment necessary, but I'd be happy to do a videocall with you. I've implemented tagged unions once, albeit with a very different syntax: https://akkartik.github.io/mu1/html/033exclusive_container.cc.html https://akkartik.github.io/mu1/html/033exclusive_container.c... (this is a Literate format that eventually tangles into C. The `scenario` blocks show what code in the language would look like. Though none of these is a good example. They all sidestep the type checker to some extent since they're creating raw objects in memory.) Anyways, I'd be happy to chat with you :) I suspect it'll be a short call. There's a likely a single sentence somewhere that will get you unstuck.
- jeofken 5y agoI’m writing it in OCaml, and for prototyping I like to make mini languages in a single file - just a definition of type and expression and a typeof function. Thanks for the offer! Sending you an email :-)
- jeofken 5y agoCan’t edit so adding: I write OCaml but am open minded. HM = Hindley-Milner My email is in my profile please feel free to get in touch regarding type checkers! Here is a type checker, lacking inferring, for tagged unions. What I need to figure out is how integrate this with the unification algo http://www.martinjosefsson.com/ocaml/compiler/interpreter/typecheck/type/2021/09/15/Simple_Union_Type_Enum_type_checker_in_OCaml.html http://www.martinjosefsson.com/ocaml/compiler/interpreter/ty...