4 ms·
Sadly no, the interpreter seems to not be available yet in the official binaries. You may use "crystal eval" for one-off commands (and can use this to, for exam
by compumike 4y ago
Sadly no, the interpreter seems to not be available yet in the official binaries. You may use "crystal eval" for one-off commands (and can use this to, for example, require a local .cr file and call a particular method), but that's certainly not the same as an interpreter. :P
docker run --rm -it crystallang/crystal:1.4.1-alpine
/ # crystal i
Crystal was compiled without interpreter support
/ # crystal eval '3.times { |i| puts "Hello #{i}" }'
Hello 0
Hello 1
Hello 2
/ # crystal eval 'require "http/client"; puts HTTP::Client.get("https://news.ycombinator.com/").body.split("\n").first'
<html lang="en" op="news"><head><meta name="referrer" content="origin"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" type="text/css" href="news.css?E6T8vRgACsBJvJjCXAU8">
I tried the non-alpine package as well. No dice.