Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6053997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:06:11+00:00 2026-05-23T08:06:11+00:00

I am writing a compiler in Ocaml with Emacs. I am told that with

  • 0

I am writing a compiler in Ocaml with Emacs. I am told that with -annot a file .annot could be generated while compiling, which could help Emacs to show the type of my code. But it is odd that no .annot is generated after running this makefile. Could anyone tell me what is wrong with that?

Also, once i have got .annot, do I need to set up anything (for instance .emacs?) so that my Emacs read it and show the type of my code?

Thank you very much!

Edit1: after make clean and make, I have got the .annot… But I still do not know how to make use of this .annot in Emacs.

Edit2: actually it is necessary to follow this link, copy the files in a local folder, then update .emacs. Then when a .ml is edited in Emacs, C-c C-t returns its type from .annot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:06:11+00:00Added an answer on May 23, 2026 at 8:06 am

    Regarding your emacs inquiry –I don’t use emacs–, this is from the man-pages for ocamlc,

    -annot Dump detailed information about the compilation (types, bindings, tail-calls, etc). The information for file src.ml is put into file src.annot. In case of a type error, dump all the information inferred by the type-checker before the error. The src.annot file can be used with the emacs commands given in emacs/caml-types.el to display types and other annotations interactively.

    There are also other tools from the thread I mentioned previously.

    As for the Makefile not creating the .annot files, I made a mock directory and successfully had .annot files created. I also don’t see anything wrong with your Makefile. You may want to clean the directory and try again, or switch to another way to build your tool like ocamlbuild –which would require minimal setup, although, I haven’t used it with menhir.

    I will also note that -annot is new since OCaml 3.11.0, and prior the flag was -dtypes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am experimenting with writing a toy compiler in ocaml. Currently, I am trying
I'm writing a compiler which uses C as an intermediate code which is (Currently)
I'm writing a C University project and stumbled upon a compiler behavior which I
I'm writing a compiler that generates Jasmin code and want to invoke a method
I've heard of the idea of bootstrapping a language, that is, writing a compiler/interpreter
I'm writing a compiler that's generating LLVM IR instructions. I'm working extensively with vectors.
I'm in the process of writing a compiler that will be generating ELF executable
I am writing a compiler written in OCaml. Sometimes when there is an error
I am writing a compiler for a compiler design course that I am taking
I am writing a compiler program to read a text file. Some of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.