Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Unable to run first ocaml "hello world" program. #284

Description

@enjoysmath

Here is my launch config:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "OCaml",
            "type": "ocamldebug",
            "request": "launch",
            "program": "${workspaceRoot}/Main.re",
            "console": "internalConsole",
            "stopOnEntry": false
        }
    ]
}

Here is the code:

let main ()  =
        output_string stdout "Hello world!\n";;

main ()  ;;

I've also tried:

let run () => {
  print_endline "Hello world";
};

let add2 x => x + 2;

Though it's obviously not a code problem. The Debug mode runs for 3 seconds then terminates, with nothing printed to any of the output consoles and no errors shown.

This is a travesty as you want new users of the OCaml language, yet you don't offer any way for them to actually run code.... So please help me get started. I am not interested in running OCaml in vim or emacs. I would like an IDE. If not possible, I will have to either choose not to code my project or to do it all in C++ (or something stupid). I need to learn OCaml so that I can understand and modify the CoqIDE (a tool for mathematics).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions