reasonml-editor / vscode-reasonml

OCaml & Reason support for Visual Studio Code
Apache License 2.0
491 stars 62 forks source link

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

Open enjoysmath opened 5 years ago

enjoysmath commented 5 years ago

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).