惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
WordPress大学
WordPress大学
小众软件
小众软件
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
腾讯CDC
量子位
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
Scott Helme
Scott Helme
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
Jina AI
Jina AI
Attack and Defense Labs
Attack and Defense Labs
S
SegmentFault 最新的问题
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
Google Online Security Blog
Google Online Security Blog
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
罗磊的独立博客
L
LINUX DO - 最新话题
博客园 - Franky
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
The Last Watchdog
The Last Watchdog
J
Java Code Geeks
AI
AI
C
Cisco Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
Help Net Security
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
I
Intezer
S
Securelist

Kenneth Friedman

Alan Kay Answers Introducing, Toski Marginal Notes MIT: Second Year Masters Oh The Places I've Been Introducing, Scribr The 2034 Website Open With Sublime Real and Spectacular
MIT Scheme on Apple Silicon (M1 Mac)
Kenneth Friedman · 2021-12-27 · via Kenneth Friedman

Instructions for compiling and running MIT/GNU Scheme.

Despite rumors on the internet — from the GNU website, no less —  you can in fact run MIT Scheme on a computer with Apple Silicon (aka, an M1 Mac). This post will provide step-by-step instructions for getting Scheme up and running on a shiny new Mac.

The key is to macOS's built-in emulation system to run the x86 version of MIT Scheme. Scheme won't be running natively on Apple Silicon, but it will be running — and sometimes that's enough.

There are three parts to this setup:

  1. Download x86 Scheme
  2. Run Terminal in Emulation Mode
  3. Fix the Source Code

It's not a pretty solution, but at least it's fairly straightforward, and I estimate that it should take about 15 minutes to follow the setup steps below.

This guide has been tested on MacOS Monterey, version 12.0.1. I would guess that these instructions will apply to any recent version of MacOS.

1. Download x86 Scheme

You'll first need to download Scheme, making sure to download the x86 architecture version.

1.1: Navigate to the MIT Scheme page on the GNU website.

1.2: Scroll down to the Downloads section, look at the Stable Release table, and click or download the "Unix binary" link for the x86-64 architecture.

At the time of writing this, the stable version is 11.2.

2. Run Terminal in Emulation Mode

Next, you'll need to run a version of Terminal in emulation mode, to ensure that the compilation step uses x86 instructions.

2.1: Navigate to Terminal.app in Finder. This is most likely in /Applications/Utilities.

2.2: Duplicate the Terminal app by right clicking and selecting Duplicate.

2.3: Rename the newly duplicated Terminal app, so that you can differentiate between the two Terminals. I named mine Terminal (Rosetta) – but the name choice is up to you.

2.4: Right click on your new Terminal —  Terminal (Rosetta) — and select Get Info.

2.5: In the Get Info Window, check the box Open With Rosetta.

3. Fix the Source Code

This may sound like the hardest part, but it's not too bad. The source code as-is does not compile, even in emulation mode. There are two lines of code that need to be changed.

3.1: Edit the macosx-starter.c file:

This file should be located at mit-scheme-11.2/src/microcode/macosx-starter.c.

Use the text editor of your choice and navigate to line 58. It should currently read:

pid = (vfork ());

The vfork command has been deprecated in favor of, simply, fork.

Modify the command by deleting the character 'v'. So line 58 should now read:

pid = (fork ());

3.2: Edit the uxsig.c file:

This file should be located at mit-scheme-11.2/src/microcode/uxsig.c.

Use the text editor of your choice and navigate to line 1197. It should currently read:

debug_back_trace ((outf_channel) to_dump);

This line won't compile. I'm not sure why, but it appears safe to comment out. Either delete the line, or simply add two slashes in the front of the line. I prefer commenting out:

  // debug_back_trace ((outf_channel) to_dump);

3.3: You've now made the necessary changes to the source code, and you are ready to compile.

Using the Terminal (Rosetta) app, cd into the mit-scheme-11.2/src folder.

From there, run the following three commands:

				./configure
				make
				make install

Scheme should now be properly installed. You will not need to use Rosetta Terminal to run scheme, it was only needed for the compilation steps.

To confirm it's working, open a normal (non-Rosetta) Terminal window. Type scheme or mit-scheme. You should see the Scheme REPL, and you are on your way.

(Note: if you use this guide and run into issues, please feel free to contact me and I can try to help.)