sampsyo / cs6120

advanced compilers
https://www.cs.cornell.edu/courses/cs6120/2023fa/
MIT License
739 stars 157 forks source link

Project Proposal: Dependent Types in OCaml #313

Closed alaiasolkobreslin closed 2 years ago

alaiasolkobreslin commented 2 years ago

What will you do?

My goal for the final project is to implement an OCaml-like language that also supports dependent types. Although Coq already exists, I think it will be a good learning experience to implement a typechecker that deals with dependent types. I want this language to be based on the Calculus of Constructions.

How will you do it?

I already started a project called Hazel (with Cornell student, Chris Lam) with a similar goal in mind in the summer of 2020, but didn't fully think through how dependent types were going to come into play. We have already implemented a lexer and parser and have started a typechecker for our language. The main tasks in this project include extending the lexer and parser to support dependent types and fully implementing the typechecker. The original goal when I started this project was to gain experience with writing compilers for functional programming languages since we did not have that opportunity in 4120. For now, I think a reasonable goal would be to implement an interpreter for this project and finish the compiler when the semester is over. Although Chris isn't a student here anymore, he might continue to contribute to this project.

How will you empirically measure success?

I will measure success based on how many theorems and proofs can be encoded and successfully typechecked in this language. I am thinking of using some exercises in the first chapter of Software Foundations (SF) as I think we will be successful if we can prove some of the most basic theorems from SF.

Team members:

@FlyingRockSquirrel

sampsyo commented 2 years ago

OK, this all sounds cool! To distill the plan, your aim is to implement type checking & interpretation, with compilation (“extraction,” I think, in the dependent types world?) as a stretch goal.

Before you get started, can you please nail down exactly what the evaluation will consist of? Some questions you could answer, for example, include:

alaiasolkobreslin commented 2 years ago
sampsyo commented 2 years ago

OK! This all sounds good, but I want to challenge you to do one extra thing: think of something you can measure quantitatively, not just qualitatively. Is there some kind of percentage you can calculate to quantify support? Find some numerator and denominator that you pick now, before finishing the project, and commit to reporting after finishing it—such that, the bigger the number, the more "successful" you can say you have been. Do you have any thoughts about what that number will be?