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

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

Open
enjoysmath opened this issue Aug 23, 2019 · 0 comments
Open

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

enjoysmath opened this issue Aug 23, 2019 · 0 comments

Comments

@enjoysmath
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@enjoysmath and others