langur

Windows installation

These are the general instructions for installing the current version of langur. If you're installing langur 0.5, click here.

Some images have been left out so that the text will be readable on a small screen. You need to view this page on a larger screen to see them.

  1. Install the Go language. It is available for Windows, macOS, and Linux.

  2. Preferably, install an integrated development environment (IDE) to use with Go. I've been using LiteIDE.

  3. Copy the \src\ files from the download archive to the appropriate Go source folder on your system (likely C:\Users\username\Go\src\). Put them here instead of next to the standard library files (C:\Go\src\). I initially put them in wrong place.

  4. I heard from a user that he installed the Go environment, and that took care of the compilers he needed. My experience with Windows was that gcc was not installed, and when I would try to build langur, I would get an error stating the "gcc" executable file could not be found. See the notes below about setting up gcc on Windows if it doesn't work for you.

    gcc executable file not found in %PATH%

    If it builds for you, and doesn't give an error message, such as missing gcc files, you won't need to do the following. I installed the CodeBlocks IDE just to get the gcc files that came with it. (CodeBlocks is tailored to C and does not work with Go.) You need the version that includes "mingw-setup", such as "codeblocks-17.12mingw-setup.exe". The site guru99 provides a link and instructions.

    I changed the path in LiteIDE to include the path to the gcc compiler. To do this, you need to edit the environment. Select Tools > Edit Current Environment.

    PATH=C:\PROGRA~2\CodeBlocks\MinGW\bin;%GOROOT%\bin;%PATH%

    Since my installation is contained within "Program Files (x86)", I use PROGRA~2 (since I couldn't see how to make LiteIDE work with a path containing spaces, having tried enclosing with quotes and such). This might be different on your system. You may need to type the following at the command prompt to determine the short folder name within which gcc is installed.

    C:\Users\username>dir /X ~1 c:\ Volume in drive C has no label. Volume Serial Number is ABCD-EFGH Directory of c:\ 01/01/2020 10:39 AM <DIR> Go 03/18/2019 11:52 PM <DIR> PerfLogs 01/07/2020 01:16 PM <DIR> PROGRA~1 Program Files 01/06/2020 09:43 AM <DIR> PROGRA~2 Program Files (x86) 12/30/2019 03:56 PM <DIR> Temp 12/30/2019 06:14 PM <DIR> Users 12/30/2019 11:04 PM <DIR> Windows 0 File(s) 0 bytes 7 Dir(s) 8,219,000,832 bytes free

  5. I heard from a user that he installed the Go environment, and that took care of the compilers he needed. My experience with Windows was that gcc was not installed, and when I would try to build langur, I would get an error stating the "gcc" executable file could not be found. See the notes below about setting up gcc on Windows if it doesn't work for you.

    If it builds for you, and doesn't give an error message, such as missing gcc files, you won't need to do the following. I installed the CodeBlocks IDE just to get the gcc files that came with it. (CodeBlocks is tailored to C and does not work with Go.) You need the version that includes "mingw-setup", such as "codeblocks-17.12mingw-setup.exe". The site guru99 provides a link and instructions.

    I changed the path in LiteIDE to include the path to the gcc compiler. To do this, you need to edit the environment. Select Tools > Edit Current Environment.

    Since my installation is contained within "Program Files (x86)", I use PROGRA~2 (since I couldn't see how to make LiteIDE work with a path containing spaces, having tried enclosing with quotes and such). This might be different on your system. You may need to type the following at the command prompt to determine the short folder name within which gcc is installed.

    C:\Users\username>dir /X ~1 c:\ Volume in drive C has no label. Volume Serial Number is ABCD-EFGH Directory of C:\Users\username File Not Found Directory of c:\ 01/01/2020 10:39 AM <DIR> Go 03/18/2019 11:52 PM <DIR> PerfLogs 01/07/2020 01:16 PM <DIR> PROGRA~1 Program Files 01/06/2020 09:43 AM <DIR> PROGRA~2 Program Files (x86) 12/30/2019 03:56 PM <DIR> Temp 12/30/2019 06:14 PM <DIR> Users 12/30/2019 11:04 PM <DIR> Windows 0 File(s) 0 bytes 7 Dir(s) 8,219,000,832 bytes free

  6. Open the file src\langur\main.go in the IDE and build it, and see if there are errors.
  7. You can also open the file src\langur\repl\main.go in the IDE and build and run it to use the REPL.
  8. You can test langur through the REPL. And, if you build langur, you can execute script files, of course.

  9. Note that langur expects Linux line endings (LF only), not Windows line endings. Any decent plain text editor will allow you to specify the type of line endings to use. On Windows, I find Notepad++ useful, and there are plenty of others, I'm sure. Notepad, which comes with Windows, is not useful in this regard, and will not break at a line feed. You'll notice in LiteIDE that the bottom right corner shows the line endings in use in the file, as well as the encoding.