InnocentZero's Treasure Chest

HomeFeedAbout MeList of interesting people

03 Aug 2025

My experiments with OCaml - 4

Alright, I was setting up the AST generator and I realized how painful it can truly be. No wonder every compiler writer complains of the parse phase itself. I'm taking an approach of not throwing in errors rn but let's see. I'd ideally want to be able to diagnose what's going wrong where, and then be able to debug print the AST that the compiler is generating.

I'm actually really concerned of returning None whenever parsing fails, because in some cases parsing is bound to fail. Anyways, let's see. Now I'm also wondering if the Some types can return something that's not what I want. Is that possible? Idk, but we'll see with time.

Tags: programming ocaml

Other posts
Creative Commons License
This website by Md Isfarul Haque is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.