Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run Scheme on Visual Studio Code?

I'm wondering how to run simple Scheme code on Visual Studio Code.

I've installed an extension called Scheme, but what is the next step..

I didn't find any details on the extension about how to run the code or the developer's contact ...

like image 385
YuanZheng Hu Avatar asked Mar 08 '18 21:03

YuanZheng Hu


3 Answers

Compiling Scheme on VSCode is quite easy by now.

Install the Code Runner extension.

For setting it up:

  • Open User Settings (ctrl + , by default)
  • Search for Code-runner: Executor Map By File Extension.
  • Press "Edit in settings.json"
  • Add the following:
"code-runner.executorMapByFileExtension": {
    ".scm": "racket"
}
  • Run the code directly with ctrl + alt + n or from the Command Palette (ctrl + shift + p) with Run Code
like image 143
T.Palludan Avatar answered Oct 16 '22 19:10

T.Palludan


If you just want to use VS Code because it's a good IDE (better than DRacket in terms of completion (parens, etc) and code navigation, I just discovered scheme on repl.it.

Doesn't appear that you can debug in Scheme. But it's a good start. (I'm getting the csi error as well).

like image 20
Jonathan Tuzman Avatar answered Oct 16 '22 19:10

Jonathan Tuzman


From looking at the github source it seems it only provide basic syntax highlighting support. Thus VSC is slightly better than Notepad, but not much.

To run you need to start one of the available scheme systems and run the file. It might be a way to do that from VSC, but it's not included in the extension.

I would have opted for DrRacket which is a IDE and an implementation of many Scheme standard languages. It can help you expand macros, debug and profile your code in the same place. Another great alternative is Emacs, but it requires a little more effort to set up. I have yet to hear about other alternatives.

like image 33
Sylwester Avatar answered Oct 16 '22 17:10

Sylwester