3 ms·
I couldn't easily find any info about the interpreter being available from the binary releases? Since this is from 2021, is it already available?
by rvieira 4y ago
I couldn't easily find any info about the interpreter being available from the binary releases? Since this is from 2021, is it already available?
- compumike 4y agoSadly 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.
- hbien 4y agoIt's not in the official binary releases yet. You'll have to compile your own Crystal via `make interpreter=1` to use it. Instructions here: https://crystal-lang.org/install/from_sources/ https://crystal-lang.org/install/from_sources/