porting Chez to ARM & RISC-V (aarch64 & rv64)

298 views
Skip to first unread message

Jesse Alama

unread,
May 1, 2020, 5:18:16 AM5/1/20
to Racket Developers
Paulo Matos and I have recently started porting Chez Scheme
to the ARM and RISC-V ISAs. We'll be focusing on the 64-bit
versions. The goal is to get Racket CS to run on those
architectures.

Motivation: ARM has rapidly grown over the years, and there
is speculation that Apple may soon adopt ARM in their PCs
and laptops (see, e.g.,
is already used in the iPhones and iPads, whereas their
laptops, desktops, and workstations are all x86. In the
mid-2000s, Apple switched from PowerPC to x86, which is
where we Mac users are today. The thinking is that a similar
switch might occur in the near-ish future, and it makes
sense to get Racket ready for that.

RISC-V is an exciting new(ish) architecture (or, better,
family of architectures). It has deep roots in academic
hardware research, and is even open source. So far,
RISC-V-based desktops, laptops, and servers are somewhat
uncommon (though they do exist), but they'll probably be
coming.

To our knowledge, no one is currently working on porting
Chez Scheme to aarch64, nor for rv64. If you are aware of
such efforts, please let us know.

We welcome comments and suggestions. Work will take place in
Paulo's clone of the Racket clone of Chez Scheme:


Jesse & Paulo

Juan Francisco Cantero Hurtado

unread,
May 1, 2020, 5:14:27 PM5/1/20
to racke...@googlegroups.com
Hi, thanks for working on the support for new platforms. My only
"request" is that when you add support for a new architecture with
Linux, add it also for the BSDs even if you can't test properly the
changes on *BSD. The Chez build system is way different to the
traditional build systems and that would help the package maintainers to
test your changes.

Cheers.


--
Juan Francisco Cantero Hurtado http://juanfra.info

Jesse Alama

unread,
May 3, 2020, 2:03:53 AM5/3/20
to Juan Francisco Cantero Hurtado, racke...@googlegroups.com
Hi Juan,

On 1 May 2020, at 23:14, Juan Francisco Cantero Hurtado wrote:

> Hi, thanks for working on the support for new platforms. My only
> "request" is that when you add support for a new architecture with
> Linux, add it also for the BSDs even if you can't test properly the
> changes on *BSD. The Chez build system is way different to the
> traditional build systems and that would help the package maintainers
> to test your changes.

No worries -- I myself work on FreeBSD and OpenBSD and not Linux, so my
workflow naturally guides me to getting things to work on those
platforms.

Jesse

Andre Garzia

unread,
May 5, 2020, 2:03:38 PM5/5/20
to racke...@googlegroups.com
I've been using an ARM64 machine as my main machine for many months now. It is a Surface Pro X and as far as I am aware it is the only high-specs ARM64 machine you can buy. Since it runs Windows 10, it has a built-in x86 Win32 32bits emulation, so I can run Racket compiled for Windows 32bits in it.

I tried to compile Racket (not the CS version) but failed when I reached some asm in libffi. It is a bit beyond my skills to be honest, I wanted to know if it was just a recompile away from running on Windows on ARM. Most VS based C/C++ projects are easy to recompile to ARM64 without any changes.

Another benefit of using this machine is that it gives me a full ARM64 Linux with WSL2 enabled. So with a single machine one can work on Windows and Linux version of Racket for ARM64 while still able to run Racket for win32 32bits. This would make it easier to cross-compile stuff from x86 to arm64 as we're in the bootstrap phase atm.

I'd love to help this port effort even though I am quite new at this.

Best
Andre

--
You received this message because you are subscribed to the Google Groups "Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-dev/801C8A52-7FDC-4FCE-BC24-B080FEA196A6%40lisp.sh.


--
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.

Brian Adkins

unread,
Jun 22, 2020, 5:57:20 PM6/22/20
to Racket Developers
On Friday, May 1, 2020 at 5:18:16 AM UTC-4, Jesse Alama wrote:
Paulo Matos and I have recently started porting Chez Scheme
to the ARM and RISC-V ISAs. We'll be focusing on the 64-bit
versions. The goal is to get Racket CS to run on those
architectures.
[...]

To our knowledge, no one is currently working on porting
Chez Scheme to aarch64, nor for rv64. If you are aware of
such efforts, please let us know.

We welcome comments and suggestions. Work will take place in
Paulo's clone of the Racket clone of Chez Scheme:


Jesse & Paulo

Forgive my ignorance here, but is it possible to do the porting work off the main Chez Scheme branch, or would that require extra work to then gain the benefit in the Racket fork of Chez Scheme? I emailed Andy Keep to see if he, or Kent, or others are planning on doing any work to port to ARM. Ideally there would be a single effort vs. two separate ports.

Paulo Matos

unread,
Jun 23, 2020, 3:04:44 AM6/23/20
to Racket Developers
Hi,

Myself and Jesse continue work on both ports and as I mentioned elsewhere in racket-users I will start devoting more time to this.
Our motivation for the port is to port RacketCS to these architectures. I have no interest in ChezScheme.
So, if I do the port and it works for RacketCS I will stop there and someone can come and modify that to work with ChezScheme. From my point of view that's a better use of my time than porting ChezScheme and then finding I need another month to modify that to work to RacketCS. One only has so much free time to devote to these things and I need to prioritize.

By the way, although this work is joint with Jesse, these are my feelings. Maybe Jesse would like to add more here.

Paulo Matos

Brian Adkins

unread,
Jun 23, 2020, 9:04:50 AM6/23/20
to Racket Developers
On Tuesday, June 23, 2020 at 3:04:44 AM UTC-4, Paulo Matos wrote:
Hi,

Myself and Jesse continue work on both ports and as I mentioned elsewhere in racket-users I will start devoting more time to this.
Our motivation for the port is to port RacketCS to these architectures. I have no interest in ChezScheme.
So, if I do the port and it works for RacketCS I will stop there and someone can come and modify that to work with ChezScheme. From my point of view that's a better use of my time than porting ChezScheme and then finding I need another month to modify that to work to RacketCS. One only has so much free time to devote to these things and I need to prioritize.

By the way, although this work is joint with Jesse, these are my feelings. Maybe Jesse would like to add more here.

Paulo Matos

Just to clarify, I'm appreciative of the work you and Jesse are doing here, and I'm not suggesting you make things harder on yourself.

I'm not familiar enough with the internals to know which way would be more effort in the long run. There is the effort of the initial port, but then I presume future updates to Chez Scheme will continue to be merged into the Racket fork periodically. It *seems* like the more Racket Chez diverges from Chez, the harder it will be to merge future updates to Chez, but I could be way off base here. The other factor is the possibility of the Chez folks becoming interested in helping out, and having a unified effort to do the port.

Matthew Flatt

unread,
Jun 23, 2020, 9:37:38 AM6/23/20
to Brian Adkins, Racket Developers
At Tue, 23 Jun 2020 06:04:50 -0700 (PDT), Brian Adkins wrote:
> I'm not familiar enough with the internals to know which way would be more
> effort in the long run. There is the effort of the initial port, but then I
> presume future updates to Chez Scheme will continue to be merged into the
> Racket fork periodically. It *seems* like the more Racket Chez diverges
> from Chez, the harder it will be to merge future updates to Chez, but I
> could be way off base here. The other factor is the possibility of the Chez
> folks becoming interested in helping out, and having a unified effort to do
> the port.

For a back end, there's not too much difference between Chez Scheme and
the Racket branch, so I expect the work will be easy to share.

Up until a few weeks ago, there would have been no difference at all,
but unboxing for floating-point arithmetic has changed the interface to
back ends. I think it might be slightly easier to "backport" a back end
that works with the Racket branch to one that works for the main Chez
Scheme branch. Or maybe unboxed floating-point arithmetic will be of
interest to the Chez Scheme developers, in which case the difference
would go away.


Matthew

Reply all
Reply to author
Forward
0 new messages