langur

Windows installation

These are the general instructions, but I can't guarantee they will work for you.

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.

    1. If you have git installed on Windows (likely not, unless you're a programmer), the simplest way to install the needed packages may be to use go get from the command line ...

      go get github.com/rin01/decnum go get golang.org/x/text/language go get golang.org/x/text/unicode/norm

      You don't have to get git to install langur, but if you're interested, one of the following may provide the answers (and downloads) you need.


    2. If you don't have git and aren't interested, you should be able download zip files from the following.
      1. https://github.com/golang/text
      2. https://github.com/rin01/decnum/

      On the right side, you'll see a button that says "Clone or Download." Click the button and select "Download Zip."

      Clone or Download > Download Zip

      I put the golang.org folder under C:\Users\username\Go\src and the github.com folder under C:\Go\src. I don't guarantee that these are the right places, but that's how it worked for me.

    3. If you don't have git and aren't interested, you should be able download zip files from the following.
      1. github.com/golang/text
      2. github.com/rin01/decnum

      On the right side, you'll see a button that says "Clone or Download." Click the button and select "Download Zip."

      I put the golang.org folder under C:\Users\username\Go\src and the github.com folder under C:\Go\src. I don't guarantee that these are the right places, but that's how it worked for me.


  4. You'll need to copy the files from Go's regexp folder (something like C:\Go\src\regexp) to the C:\Users\%USERNAME%\go\src\langur\regexp folder. This is to account for the missing replace-with-maximum-count method in Go's standard library, which is needed to make langur's regex methods complete for re2. The following command might do what you need.

    copy C:\Go\src\regexp\ C:\Users\%USERNAME%\go\src\langur\regexp\

  5. You'll need to copy the files from Go's regexp folder (something like C:\Go\src\regexp) to the langur\regexp folder. This is to account for the missing replace-with-maximum-count method in Go's standard library, which is needed to make langur's regex methods complete for re2.

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

  7. 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\someboy 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

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

  11. Note that I'm deprecating the use of Windows line endings (CR/LF combination) in favor of Linux line endings (LF only). 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.

langur\regexp folder

langur\regexp folder before copying files
example langur\regexp folder before copying files

langur\regexp folder after copying files
example langur\regexp folder after copying files