Running scheme on windows

Running scheme on windows

If you have trouble installing MIT/GNU Scheme, one common cause is that your download was corrupted. Either try downloading it again, or check your download against the md5 checksums.

Note that the documentation (in HTML form) comes with the distribution. Find it and create a bookmark in your web browser.

Running MIT/GNU Scheme from CS machines

You will need to use your CS account (which you will be getting if you don’t already have one). You can remotely log in to the freebsd.remote pool from any computer on the internet.

You might find it most convenient to log in from a UNIX computer, because you can then X-host windows running on the remote machine. It is possible to do this through Windows, but you’re on your own setting it up. You can also run emacs and scheme through a terminal (i.e., text) interface.

Using MIT/GNU Scheme

There are three ways you can use MIT/GNU Scheme. In order of my recommendation, they are:

    Run Scheme as an inferior process under gnu-emacs or xemacs. (This option is not available under Windows.)

Run Scheme through Edwin, the emacs-like editor that comes with MIT Scheme. (Works in Windows too)

  • Run Scheme standalone (and edit your code in some other editor).
  • I do not recommend running MIT/GNU Scheme standalone because there is no command line editing. Besides, I strongly recommend using emacs or Edwin to write your code, so you might as well run your code through them anyway.

    If you’re using Windows, you don’t have the choice of using Scheme through gnu-emacs. However, you may want to download gnu-emacs anyway and use it to edit your code (because it is more user friendly than Edwin) and then using Edwin to run and debug. You can download emacs for Windows from http://ftp.gnu.org/gnu/windows/emacs/. (You have your choice of a «bare», regular, or «full» binary.) You may also be interested in the Emacs Windows FAQ.

    If you’re using UNIX of some sort, I suggest using gnu-emacs. Here’s a comparison of the advantages and disadvantages of Edwin and gnu-emacs:

    Edwin gnu-emacs
    + scheme editing mode with electric parentheses + scheme editing mode electric parentheses
    + M-p and M-n scroll through command history — Can only yank previous command with C-c C-y
    — Doesn’t work with the X-cut buffer + X-cut buffer can be used to cut and paste between windows
    — Missing some emacs features + It’s real emacs!
    + Has nice debugging interface — Text debugging interface
    — No pull down menus + Pull down menus

    As a gnu-emacs «power user», I find Edwin kind of annoying because of missing gnu-emacs features, so I work using the gnu-emacs interface and only use edwin for some debugging sessions. (I usually use text debugging through gnu-emacs.) You may very well want the (relative) user-friendliness of emacs over Edwin, but if you know (or are willing to learn) emacs well enough that you don’t need the pull down menus and such, then you may prefer Edwin.

    Running Scheme under gnu-emacs

    This file should replace the xscheme.elc file that comes with emacs. You’ll have to find the appropriate directory on your system. On my Mandrake Linux system, this is the directory: /usr/share/emacs/21.3/lisp. (This step is not necessary if you are running MIT/GNU Scheme from the CS department machines.)

    Add the following line to your

  • Start (or restart) emacs, and it will load MIT Scheme’s xscheme library.
  • To exit emacs, type C-x C-c (that’s control-x followed by control-c).

    Running Edwin

    To exit Edwin, type C-x C-c (that’s control-x followed by control-c).

    Running Scheme standalone

    To exit scheme, type «(exit)«.

    Using Emacs/Edwin with Scheme

    Learn emacs

    Here are some other emacs resources you may find useful:

    • A tutorial introduction to emacs
    • Indiana knowledge base Emacs quick reference
    • There is extensive emacs (and other) documentation in emacs’s «Info» mode which provides a sort of hypertext. Type C-h i to get into Info mode. Of course, you’ll have to learn a little bit about navigating in this mode.

    You may find better references for learning emacs on the web. (If so, let me know and I’ll add links here.)

    The Scheme interaction buffer

    In the Scheme interaction buffer, you can type Scheme expressions and use one of the following commands to send them to the Scheme process to be evaluated:

      M-z sends the current expression; it looks for an open paren in the leftmost column and sends all the text from there up to the cursor position, and then to the right of the cursor until all parentheses are balanced.

  • C-x C-e sends the expression to the left of the cursor; it looks left from the cursor until it has a complete expression and then sends that to the scheme interpreter.
  • Experiment with these commands until you understand how to send the expression you want to the Scheme interpreter.

    If you make an error, you will get a beep and some error messages about calling RESTART. From here, you can get back to the top level of the Scheme interpreter by typing C-c C-c. You can also enter the (regular) debugger by typing (debug). In Edwin, it may offer to start the debugger for you.

    In Edwin, M-p and M-n will take you through the previous commands sent to the scheme interpreter. In emacs, C-c C-y will yank the previous command.

    Scheme program buffers

    The M-z and C-x C-e commands work the same in this buffer as they do in a scheme interaction buffer. The result will be printed in the *scheme* buffer but also briefly displayed under the mode line of the emacs/Edwin window. These commands are useful for sending a single function to Scheme while you are developing a program.

    The M-o command sends the entire buffer to the scheme interpreter.

    Emacs/Edwin will indent you code for you! just press tab at the beginning of each line, and the cursor will move to the proper point to begin typing.

    When typing comments, M-j will act like the return key except that it will start the next line with the comment character. In emacs,M-q will reflow a paragraph and properly comment it. (Edwin can do this too, but see below for how to set this nondefault keybinding in Edwin.)

    For more information

    There are a number of other emacs/Edwin commands that you will find useful. Refer to:

      My Top 10 keybindings for Edwin/Emacs below.

    See the GNU emacs section of the User’s manual. The key bindings for MIT Scheme under emacs are all supported in Edwin.

  • For more information on Edwin (especially on the debugger), see the Edwin section of the User’s manual.
  • Is there way to run MIT scheme interpreter under emacs on Windows?

    I am a newbie for Lisp, and trying to run MIT scheme interpreter under emacs on Windows. But info seems all indicate that this is impossible. http://www.cs.rpi.edu/academics/courses/fall05/ai/scheme/starting.html http://www.gnu.org/software/mit-scheme/

    So I wonder if there is a way to do so. Thanks.

    4 Answers 4

    The following works for me. You’d obviously need to add your paths. If I omit the —library option, then upon startup mit-scheme complains about not finding it’s runtime band.

    In the scheme buffer:

    It was rather easy to install. See this question about it’s installation. He seemed to get it running OK: running scheme from emacs

    I had tried what you want on WINDOWS 7, independent terminal could be popped up outside emacs but with error info in REPL. It seems that there was no official support for this feature on windows, Racket works fine with the geiser package, maybe you could try it.

    This interface works under unix only, because it requires unix signals for its operation. Porting it to Windows would require reimplementing the interface to eliminate the use of signals. We have no plans to do this. To invoke Scheme from Emacs, load the xscheme library, then use M-x run-scheme. You may give run-scheme a prefx argument, in which case it will allow you to edit the command line that is used to invoke Scheme. Do not remove the —emacs option!

    Running scheme on windows

    Build-and-Run-Scheme-Visual Studio Code

    This Repository holds the instructions to successfully get Visual Studio Code to Build Scheme code using ChickenScheme, and Run it on Windows, Linux, or PortableApps

    This Project Requires the Code Runner Extension. You can get it Here: link to CodeRunner

    You will need MinGW to build Chicken Scheme. You can find out how to install it from here: link to MinGW

    After Install, you can continue on with the tutorial.

    PortableApps is a great software for running portable windows apps across different windows machines directly from your Flashdrive. I use it for a customized MobaXterm, Visual Studio Code, QDIR, Sublime Text, PDF Reader, and many more apps.

    The most important App to get is Visual Subst. link to Visual Subst

    This lets you map your flash drive to a constant Drive letter, so your applications always work with that drive letter.

    You can download Portable apps here: link to PortableApps

    Working with Linux

    Working with Chicken Scheme and Visual Studio code in Linux is simple, as Nothing must be added to your path after you install chicken correctly.

    Installing Chicken in Linux

    You can Install Chicken By following the Instructions at link to ChickenScheme

    Or following the instructions in the file: Build_Chicken_Linux.txt in the Scripts/Linux directory of this repository.

    Configuring Code Runner to work with Scheme in Linux

    Open Settings in Visual Studio Code and navigate to user Setting (The JSON one)

    The file: Compile_Script_Linux.sh located in the Scripts/Linux directory of this repository is the script that will build your code, so put it where you like in your system and copy this path.

    The file: Compile_Script_Visual Studio Code_Settings_Linux.txt in the Scripts/Linux directory of this repository shows the code you must recalibrate for your system. Use the path you obtained above in place of my path in the file.

    Then copy the JSON code to your User Settings JSON in Visual Studio Code and Save.

    Working with Windows

    Working with Chicken Scheme and Visual Studio code in Windows takes a little more effort, as sometimes MinGW and Chicken Scheme don’t get added to the environment path in windows. No matter, these scripts take care of it.

    Installing Chicken in Windows

    You can Install Chicken By following the Instructions at link to ChickenScheme and Build with MinGW.

    Or follow the instructions in the file: Build_Chicken_Windows.txt in the Scripts/Windows directory of this repository.

    Configuring Code Runner to work with Scheme in Windows

    Open Settings in Visual Studio Code and navigate to user Setting (The JSON one)

    The file: Compile_Script_Windows.ps1 located in the Scripts/Windows directory of this repository is the script that will build your code, so put it where you like in your system and copy this path.

    The file: Compile_Script_Visual Studio Code_Settings_Windows.txt in the Scripts/Windows directory of this repository shows the code you must recalibrate for your system. Use the path you obtained above in place of my path in the file.

    Then copy the JSON code to your User Settings JSON in Visual Studio Code and Save.

    Working with Portable Apps

    Installing Visual Studio Code Portable

    You can Install Visual Studio Portable by downloading the zip archive of Visual Studio code from here: Link to Visual Studio Code Zip

    Then extract it to your flash drive, and inside that extracted folder, create a folder named «data». This is the Persistent storage of all your Visual Studio Code Settings.

    Installing Chicken in PortableApps

    You can Install MinGW Portable by installing it to a windows computer, (Installing MinGW does not require admin rights), and then copying the folder to your PortableApps Directory.

    You can then run a command prompt, and navigate to the MinGW/bin folder to:

    Download chicken from source, extract it to a folder in the PortableApps directory, and follow the instructions in the file:

    Build_Chicken_Portable.txt in the Scripts/Portable directory of this repository.

    Make sure to change the directory to suit your needs, but do not use a \ just because you are on windows. Use the «/» as directed.

    Configuring Code Runner to work with Scheme in PortableApps

    Open Settings in Visual Studio Code and navigate to user Setting (The JSON one)

    The file: Compile_Script_Portable.ps1 located in the Scripts/Portable directory of this repository is the script that will build your code, so put it where you like on your flash drive and copy this path.

    The file: Compile_Script_Visual Studio Code_Settings_WPortable.txt in the Scripts/Portable directory of this repository shows the code you must recalibrate for your system. Use the path you obtained above in place of my path in the file.

    Then copy the JSON code to your User Settings JSON in Visual Studio Code and Save.

    Using Portable apps

    Whenever you plug your flash drive into a new computer, you can run Visual Subst to map your drive to a drive letter you prefer. You could also create an autorun.inf if you so desired.

    For example, my flash drive always goes to F or G when I plug it into library computers, however I map it to J, so when I launch portable Apps (after mapping), all my programs work correctly. (QDIR opens my 4 saved directories without error, and building scheme code works as well.).

    Running your Code

    If you open a .scm file in Visual Studio Code, and click the Code Runner Play Button, or otherwise, Control-Alt-N, your scheme code will build in the directory it is located in, and will create a file with the same name but missing an extension.

    An xterm terminal will automatically launch and allow you to interface with your code. It will not automatically exit, it will bring you back to the location of the executable, if you may wish to run it again.

    If have included a Scheme Example that takes user input, called: fib-recursive.scm, located in the Examples Directory of this repository.

    If you follow the instructions above to build you code, you should see the program asking you for a number.

    Verify that the code works — As in, don’t use the value 5 of course, as the Fibonacci of 5 is 5. Try The Fibonacci of 7, 8, 9.

    About

    This Repository holds the instructions to succesfully get Visual Studio Code to Build Scheme code using ChickenScheme, and Run it on Windows, Linux, or PortableApps

    Читайте также:  Неверно задано имя папки windows 10 word
    Оцените статью
    Adblock
    detector