Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add module to handle configurations like flag information and formatting information. #310

Open
gltrost opened this issue Apr 6, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@gltrost
Copy link
Contributor

gltrost commented Apr 6, 2021

Right now, information from flags is passed around through the code-base, often having to be passed into several different functions before the information is used.

Likewise, some information like formatting information should exist and be explicitly in a single location in our code.

One way to deal with these issues is to write a new module that acts like an event-log/event-stream, possibly called log.ml, to handle such information.

@gltrost gltrost added the enhancement New feature or request label Apr 6, 2021
@ccasin
Copy link
Collaborator

ccasin commented Apr 6, 2021

I don't think I understand this suggestion. Config information must travel from the front-end of the tool to the location where it is used, so what does it mean for it to exist "explicitly in a single location"?

Generally using state passing style or a state monad are the standard ways to transport this information in a functional program. Certainly we could be more uniform, in this respect.

@codyroux
Copy link
Contributor

codyroux commented Apr 6, 2021

In many "real" systems, this just isn't practical, and there is a configuration module which contains runtime-specific information for the program.

Note that BAP itself works in this style, e.g. in this module: http://binaryanalysisplatform.github.io/bap/api/odoc/bap/Bap/Std/Self/Config/index.html

@codyroux
Copy link
Contributor

Note this line:

Format.fprintf fmt "Checking precondition with Z3.\n%!";

This prints to stderr by default, so at the very least we need to suppress this by default, or at least make it a call to info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants