0
votes

In python, I add python and the path of the file, and my script will run.

In haskell, I invoke the GHC compiler on my file to make an executable, or I load GHCi and load the path of the file to use functions, and my script is running.

In Scheme, neither type of approach works for me. Everywhere I search, I only hear about emacs and SLIME. I am not interested in either. I just want to write scripts in notepad++ or any other simple text editor, and either run them through a scheme interpreter, or compile it into an exe, for the purpose of testing code from the MIT SICP book.

I installed MIT/GNU Scheme for learning purposes. I am not interested in Racket because of how different it is from Scheme now (I don't want to confuse myself further, I just want to learn the basics.)

One thing that is contributing to my confusion is the following. When I open mit-scheme through the start menu shortcut, it opens the edwin editor (its tutorial (C-h t command) is apparently "corrupted" so I can't use that instead of notepad++ nor would I want to at this point (just too frustrated with it)). The file location for the edwin editor is in the bin folder. The bin folder though, only has 2 files: mit-scheme.exe and dibutils.dll. If I double-click on mit-scheme.exe it just gives me an error, but apparently using the shortcut opens the edwin editor (that is supposed to be located in the same folder as mit-scheme.exe (it isn't)).

Why is all of this so convoluted? Isn't there a simple way to get my scheme scripts running? I just want to run things like:

(define hello-world
   (lambda ()
         (begin
    (write ‘Hello-World)
            (newline)
    (hello-world))))

Searching for solutions online was futile for me, I've already wasted many hours- so hopefully I can finally get an answer here.

Thank you.

EDIT: I am on windows 7 and *nix operating systems isn't an option.

2
Edwin is not a separate program. To run it mit-scheme --edit or call it from the REPL. But it's very similar to emacs in terms of key bindings. Which you are not interested in using or learning. Edwin has a nice debugger which can make things much easier further on. And a version of paredit which is almost mandatory for scheme or lisp. DrRacket also offers all of this, and may be easier to use.Rptx
Thanks. I am actually interested in emacs but not while trying to learn Scheme comprehensively. Was just feeling burnt-out from all the fruitless research into lisp/scheme and hundreds of implementations, editors, etc...Byte
Lisp is awesome and scheme is awesome but the lisp ecosystem is generally chaotic and confusing... not to mention *nix-oriented. Keep hacking and things will come into focus! If you can wrap your head around Haskell then I am confident you can hang with Scheme.ben author

2 Answers

2
votes

mit-scheme has the --load switch. thus

mit-scheme --load path/to/script.scm scrip2.scm -- args ...

I think you also can use Racket to run standard r6rs like this:

plt-r6rs script.scm 

For r5rs there is plt-r5rs. Racket can also make executables that run faster with raco exe script.scm.

EDIT

BTW: plt-r6rs is for running programs using the standard R6RS scehem report. plt-r5rs is for running programs using the standadr R5RS scheme report. I have no idea what you mean by "different it is from Scheme". Racket has it's own language, which is the default, which is it's own incompatible dialect of Scheme, but it is not a reason for not using the software. It's like not using gcc because it supports a non standard C++ language and ignoring that you can get ot to behave standard with switches.

There is only one R7RS-small implementation, the reference implementation chibi scheme. Every imlpementation is waiting for the full R7RS report I guess so it's R6RS which is the current standard.

The lists in R5RS and R6RS are mutable (but in R6RS you need to import (rnrs mutable-pairs), but thats a part of the standard. Try not import racket libraries from the standard schemes unless you have no other choice. Check the SRFIs first.

There are not so many Scheme versions and scheme implementations. For every popular programming language that has been for at least 10 years there are more than 3 implementations and several incompatible versions of the standard. If you think there are few implementations of the languages you mentioned you are quite wrong. Python has many implementations and incompatible standard versions. Haskell also has many implementations and versions of their standard. Scheme is from the 70s so it's been around for 40 years so it's only natural that there are more versions of Scheme than Haskell and Python.

0
votes

This is how I was able to run scheme code from notepad++,

I put to notepad++ run configuration:

"C:\Program Files (x86)\MIT-GNU Scheme\bin\mit-scheme.exe" --heap 512 --library "C:\Program Files (x86)\MIT-GNU Scheme\lib" --load "$(FULL_CURRENT_PATH)"

and then I was able to run. However, I had to save file first, otherwise it is not running. Also notice that (+ 2 2) is not printing as a result, But If I call procedures it is working fine.

sample