Package: harmony
HarmonyHarmony is a programming language designed for testing and experimenting with concurrent code.HarmonyInstalling Python3Installing GraphvizInstall Harmony via PipFor Windows UsersFor CS Deparment Linux Machine UsersAdding Scripts to PATHCommand-Line HarmonyHarmony on VSCodeUpdating HarmonyTroubleshootingModifying your PATH variableReading the Source CodeFor more information, please visit the official pagehttps://harmony.cs.cornell.edu.Harmony requires the following to be installed:Python (version 3.6 or higher)GraphvizC Compiler (potentially potential)In the following instructions, Windows users using WSL should follows instructions for Linux.For users of a Cornell CS Department Linux machine, e.g.<netid>@ugclinux.cs.cornell.edu, you likely do not need to installPython3orGraphvizbecause they may be available already. However, you can verify that they are available by runningpython3 --versionanddot -Vrespectively.Installing Python3Harmony requires Python (version 3.6 or higher) to be installed. If you do not have Python3 already installed, download and install Python depending on your OS (Windows, Mac, Linux, etc) on the officialPython site. Be sure to download the installer for Python version3.6or higher.In the installer, the default installation settings will also addpip. If you choose to run the installer with custom settings, be sure thatpipgets installed.On the command line, you can check if Python has been successfully installed by running the following:python--version## If python does not work or if python gives version 2.Xpython3--versionInstalling GraphvizHarmony usesGraphvizto visualize the state changes in a program. For example, the following Harmony program can produce the subsequent graph.# Filename: example.hnydefa():print"A"defb():print"B"spawna()spwanb()# Run with [harmony -o example.png example.hny]Instructions for installing the latest version of Graphviz can be foundhere.ForWindowsusers, when running the installer, make sure to select the optionAdd Graphviz to the system PATH for current userso that the commanddotis available to produce the graphs.Install Harmony via PipAfter installingpython, you should also be able to use the commandpip. Run the following command to get the latest version of Harmony:pipinstall--userharmony## If pip fails try pip3pip3install--userharmonyFor Windows UsersForWindowsusers: you may encounter the error message along the lines of the following when installingharmony:error:MicrosoftVisualC++14.0orgreaterisrequired.Getitwith"Microsoft C++ Build Tools":<linktovisualstudio-cppbuildtools>This is to be expected if you had not installed the "Microsoft C++ Build Tools" before. Navigate to the outputted link and pressDownload Build Toolsto download the installer. When you run the installer, you will encounter a selection screen such as the following:SelectDesktop development with C++in theDesktop & Mobilesection and then install.Note that this will likely take a while. When it finishes installing, runpip install harmonyagain.For CS Deparment Linux Machine UsersIt may be possible thatpipis not available on your Linux machine. In that case, you will need to download and build the source code directly.Go tohttps://pypi.org/project/harmony/#files. There, you should find aharmony-1.2.x.tar.gzfor the latest version of Harmony. Download the file onto your local machine and then send it to the Linux machine viascp.Alternatively, you can download the file directly from the Linux machine viawget. Right click on the download link to the file and copy the link address. Then on the Linux machine, run the following:wget<linkcopiedfrompypi.org>Once you have thetar.gzfile on your Linux machine, run the following commands:# Change the version number accordingly if necessarygzip-dharmony-1.2.2767.tar.gz
tar-xfharmony-1.2.2767.tarcdharmony-1.2.2767
python3setup.pyinstall--userYou can find the latest releaseshere.Afterward, you will likely need to add the directory with theharmonycommand to your environmentPATH. You can get the directory with the script by runningpython3 -m site --user-base, which will output something like/home/<net-id>/.local. Add this directory to yourPATH(Seeherefor more information on how to do so).Adding Scripts to PATHWhen installing Harmony, you may encounter a warning on the command line of something like the following:WARNING:Thescriptharmonyisinstalledin'/path/with/harmony/'whichisnotonPATH.ConsideraddingthisdirectorytoPATHor,ifyouprefertosuppressthiswarning,use--no-warn-script-location.If you do not see this warning, then you can continue.Otherwise, add that path displayed in the message to yourPATHvariable. Seeherefor extra information on editing thePATHvariable.Command-Line HarmonyOnce you have installedharmony, you should be able to use theharmonycommand on your command line.You check which version you have by runningharmony --version.Harmony on VSCodeHarmony is available as an extension on VSCode, which includes syntax highlighting and basic parser checks.Please seeherefor a guide on the basic usage of the VSCode extension.Updating HarmonyHarmony can be updated by running the followingpipcommand on the command line:pipinstall--upgradeharmonyIn Harmony versions1.2.0and higher, the compiler will output a warning if the currently installed version of Harmony is outdated and an updated one can be installed.TroubleshootingThe following section provides some guide for how to resolve common issues.Modifying your PATH variableWindows:Search forEdit environment variablesin the search bar. You can add it either to thePathassociated with your account or the systemPath.Select the variablePathin the user variables section and then click "Edit", which opens a new pane.Click "New" to add a new path, for example, the directory containinggccor thepipscripts.Complete your changes by pressing "Ok".You will have to restart your command line (and VSCode if you are using the extension) to have the changes take effect.MacOS / Linux:Open the Terminal application. Check which shell is running on the Terminal. You check which one you have by runningecho "$SHELL".The following instructions are forbashandzsh. Open the~/.bash_profilefile (for bash users) or the~/.zsh_profilefile (for zsh users) using your favorite text editor, such asvim,nano,emacs, orTextEdit. Then, add the following command to the end of the file, where/path/to/addis to be substituted:exportPATH=$PATH:/path/to/add/Save the file.You will have to restart Terminal (and VSCode if you are using the extension) to have the changes take effect.Reading the Source CodeThe compose.pdf file is the beginning of a document explaining how Harmony works.