Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Mlang
Mlang
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 7
    • Issues 7
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • Verifisc
  • MlangMlang
  • Issues
  • #18

Closed
Open
Opened Sep 28, 2020 by Denis Merigoux@demerigoOwner

Create an OCaml backend for Mlang

Mlang currently only has a Python backend. The next backend that we would want to add is an OCaml backend, as we would want to perform fuzzing on the code generated from Mlang : https://caml.inria.fr/pub/docs/manual-ocaml/afl-fuzz.html.

The OCaml backend should follow a structure similar to the Python backend in src/mlang/backend_compilers/bir_to_python.ml, and use a type like this one for the values of the generated program:

type m_value =
 | Undefined 
 | Float of float 

Also, the generated OCaml should include preprocessor directives that link back to the original M and M++ source files for better error reporting during the fuzzing. This can be done using the following syntax:

(* file foo.ml *)
let bar = assert false in
# 5 "foo_1.ml"
let baz = assert false in
# 85 "foo_2.ml
let fizz = assert false in 

In this example, the assert false will point to:

  • bar -> line 2 of foo.ml
  • baz-> line 5 of foo_1.ml
  • fizz-> line 85 of foo_2.ml
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: verifisc/mlang#18