u0_a211@localhost:~$ apt search crystal$
Sorting... Done
Full Text Search... Done
crystal/stable 1.9.0 aarch64
Fast and statically typed, compiled language with Ruby-like syntax
u0_a211@localhost:~$ apt info crystal
Package: crystal
Version: 1.9.0
Maintainer: @HertzDevil
Installed-Size: 23.9 MB
Depends: libc++, libevent, libgc, libgmp, libiconv, libllvm (<< 17), libxml2, libyaml, openssl, pcre2, zlib
Recommends: clang, libffi, make, pkg-config
Homepage: https://crystal-lang.org
Download-Size: 3590 kB
APT-Sources: https://packages.termux.dev/apt/termux-main stable/main aarch64 Packages
Description: Fast and statically typed, compiled language with Ruby-like syntax
The playground and all third-party dependencies in the standard library are available. The interpreter is currently not built. Note that -Duse_libiconv is not enabled by default at the moment, and without that flag you will end up linking against the far less useful system iconv in Bionic.
Crystal can be installed with just pkg install crystal. If you have Docker, you could also clone the build environment and try building Crystal locally with scripts/run-docker.sh scripts/build-package.sh -I -a aarch64 crystal.
$ pkg install crystal
Checking availability of current mirror: ok
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package crystal
get version (fails):
$ crystal -v
No command crystal found, did you mean:
Command crontab in package cronie
Command prtstat in package psmisc
Is it normal that compiling small programs take 15s? My system is Android 13, Snapdragon 695, 6/128. Everytime I compile one of my toy programs “codegen (bc+obj)” takes around 13-14s. Rust package takes less than 3s compiling those same programs(rust versions of course). I hope this can be improved.
I dont’t think it’s incremental compilation since I delete the cache before I build/run those rust programs. And it is true even for first build/run. And incremental compilation is disabled for --release profile in rust.
AFAIU it’s technically possible, but static linking on Android is not recommended or really useful. Statically linked executables are not exactly portable, they can break between Android versions.
I like this. When I am at the bus stop waiting for the bus to come, I can open my smart phone, look at a simple question and snippet posted on the Crystal forum, launch Termux, launch vi, save it to a file, compile and run it, see what happens, and write a reply. Just the fact that Crystal runs on a smart phone is amazing, but also practical.