Git Product home page Git Product logo

icr's Introduction

ICR - Interactive Crystal Build Status

Interactive console for Crystal Programming Language.

Usage

It's like irb, but for Crystal:

GIF demo

Require local files

You can require local files by relative path (starts with ./):

require "./src/my_cool_lib"

Libs can also be required from the cli:

$ icr -r colorize -r ./src/my_cool_lib

Installation

Prerequisites:

  • The latest version of crystal.
  • Readline (for Debian/Ubuntu install libreadline6-dev package).
  • LLVM development files.

Clone the repo:

git clone https://github.com/crystal-community/icr.git

Switch to repo-directory:

cd icr

Build:

make

Install:

sudo make install

As a shard dependency

If you would like to include icr as a dependency, you can add it to your shard.yml

dependencies:
  icr:
    github: crystal-community/icr
    branch: master

Then just run shards install from your project!

Enjoy!

Arch Linux

Arch Linux users can install ICR from AUR.

How does it work?

  • Every time you press Enter it adds a new instruction, generates a new crystal program, and executes it.
  • The output is split into 2 parts: regular program output (e.g. output from puts 10) and the value returned by the last command.
  • The regular output is saved, and when you type a new instruction, a new program is generated. The saved output is subtracted from the new output, and the difference is printed out. It creates an illusion that only new instructions are executed :)

Commands and special locals

  • paste - enables paste mode
  • debug - toggles debug mode off and on. In debug mode icr will print the code before executing it
  • quit or exit - exits current interactive console
  • reset - clears out all of the accumulated commands
  • __ - holds the result of the last expression. Example:
icr > "5" + "2"
=> "52"
icr > __.to_i - 10
=> 42

Update check

ICR periodically checks for the new releases on Github. If your current version is out of date, it will simply show you a notice at start.

You can disable this behavior using --disable-update-check CLI flag.

Development

To run tests:

make test

Editor integration

  • inf-crystal.el - Connects REPL buffer to the ICR subprocess in Emacs

Contributors

  • greyblake Potapov Sergey - creator, maintainer
  • BlaXpirit Oleh Prypin - fixes for Crystal 0.16
  • puppetpies Brian Hood - support of records
  • jwoertink Jeremy Woertink - support of -r option and number of other contributions
  • veelenga V. Elenhaupt - maintenance
  • MakeNowJust TSUYUSATO Kitsune - syntax highlight support

icr's People

Contributors

alexwayfer avatar anicholson avatar bfontaine avatar brantou avatar canhascodez avatar coderhs avatar faustinoaq avatar georgeu2000 avatar greyblake avatar hashnuke avatar icyleaf avatar jgillich avatar jkthorne avatar jwoertink avatar ktaragorn avatar makenowjust avatar mamantoha avatar marcosdsanchez avatar mikemcquaid avatar oprypin avatar porcupine96 avatar puppetpies avatar russ avatar russolsen avatar sija avatar srcrip avatar veelenga avatar yashko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

icr's Issues

Enable function listing with tab

It would be great if icr can list down all the functionality of a type say an integer in icr. The example below is taken from IPython
screen shot 2018-01-10 at 11 09 53 am

Makefile error

When attempting to use the makefile I was gretted with the 2 following errors:
"Cannot find -levent" and "Cannot find -lyaml".

I managed to fix that by temporarily renaming libevent-2.1.so.6 to libevent.so and libyaml-0.so.2 to libyaml.so.

After that the makefile worked, however in Order to then execute icr I had to rename them back and create a copy of the libevent.so so that libevent.so and libevent-2.1.so.6 both exist.

I am not sure what the error here is, but maybe you can make sense of it. Fresh install of Solus, if that helps.

crash on exit

icr(0.10.2) > exit 0
Index out of bounds (IndexError)
[94223738376844] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738375187] ???
[94223738351027] main +12531
[140137587783184] __libc_start_main +240
[94223738313417] _start +41
[0] ???

Installation on Mac OS via brew

It would be awesome to easily install it via brew:

$ brew install crystal-icr

or if it is possible:

$ brew install icr

Checkout an example of homebrew repository for crystal app.

Thank you guys!

Hey. I'd like to thank to all of you guys, who help maintain this repo. ❤️
Despite Crystal community is relatively small, I am very glad to see how friendly and inspiring it can be!
Thanks for replying to the new open issues, doing cleanups and improvements.
Without you this project (and some others) would be dead.

Build needs to link against a termcap library on some systems

Currently out of the box build fails on some systems (e.g. latest Slackware Linux).

From what I gather [1] the readline library might not be explicitly linked to one providing termcap capabilities, so it needs to be explicitly given to the linker. On Slackware either --link-flags "-lncurses" or --link-flags "-ltermcap" works.

Not sure though if automatic detection, settling for one of the two libs or just a mention in the documentation would be preferred solution.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=499837

Fails to build on macOS

I've installed the latest Crystal via homebrew:

crystal -v
Crystal 0.24.1 (2018-01-27)

LLVM: 5.0.1
Default target: x86_64-apple-macosx

And have installed all the required libraries:

xcode-select --install
brew install \
  bdw-gc \
  gmp \
  libevent \
  libxml2 \
  libyaml \
  llvm
brew link llvm --force

And am getting the following error when running make:

$ make
/usr/local/bin/crystal build --release --no-debug -o bin/icr src/icr/cli.cr
Package libssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libssl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libssl' found
Package libcrypto was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcrypto.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcrypto' found

How do I get the required openssl libs into my PKG_CONFIG_PATH path?

Icr shows errors next instruction after calling Dir.mkdir(), Dir.mkdir_p() and Dir.rmdir()

When I try to use Dir.mkdir() in icr the next instructions always will fail with error complaining about it exists. From source code it's just trying to run mkdir() on every recompilation and thats why error shows.

The same goes for Dir.rmdir() and Dir.mkdir_p().

crabonature@crap:~[130]$ icr

icr(0.24.1) > Dir.mkdir("bla bla")
 => 0

icr(0.24.1) > 1 + 1
Unable to create directory 'bla bla': File exists (Errno)
  from Dir::mkdir<String, Int32>:Int32
  from Dir::mkdir<String>:Int32
  from __icr_exec__:Int32
  from __crystal_main
  from _crystal_main<Int32, Pointer(Pointer(UInt8))>:Nil
  from Crystal::main_user_code<Int32, Pointer(Pointer(UInt8))>:Nil
  from Crystal::main<Int32, Pointer(Pointer(UInt8))>:Int32
  from main

add simple-prompt option

hello there

would you please implement --simple-prompt option which hides icr(0.24.2) > to be just > or make an option to specify the prompt itself

Thanks!

Build failing on Archlinux

==> Downloading crystal-icr PKGBUILD from AUR...
x .SRCINFO
x .gitignore
x PKGBUILD
crystal-icr 0.2.14-1 (2017-01-31 21:18)
( Unsupported package: Potentially dangerous ! )
==> Edit PKGBUILD ? [Y/n] ("A" to abort)
==> ------------------------------------
==> y

==> crystal-icr dependencies:

  • crystal (already installed)
  • readline (already installed)
  • llvm (package found) [makedepend]

==> Continue building crystal-icr ? [Y/n]
==> -------------------------------------
==> y

==> Building and installing package
==> Install or build missing dependencies for crystal-icr:
[sudo] password for fiifi:
resolving dependencies...
looking for conflicting packages...

Packages (1) llvm-4.0.0-2

Total Download Size: 20.96 MiB
Total Installed Size: 140.08 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
error: failed retrieving file 'llvm-4.0.0-2-x86_64.pkg.tar.xz' from mirror.f4st.host : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds----c o o o o o o o ] 66%
llvm-4.0.0-2-x86_64 12.3 KiB -821.84K/s --:-- [co o o o o o o o o o o o o o o o o o o o o o o ] llvm-4.0.0-2-x86_64 41.0 KiB -509.15K/s --:-- [co o o o o o o o o o o o o o o o o o o o o o o ] llvm-4.0.0-2-x86_64 166.8 KiB -180.01K/s --:-- [-C o o o o o o o o o o o o o o o o o o o o o o ] llvm-4.0.0-2-x86_64 7.0 MiB 84.7K/s 01:25 [----------------------------------------------------------------------] 100%
(1/1) checking keys in keyring [----------------------------------------------------------------------] 100%
(1/1) checking package integrity [----------------------------------------------------------------------] 100%
(1/1) loading package files [----------------------------------------------------------------------] 100%
(1/1) checking for file conflicts [----------------------------------------------------------------------] 100%
(1/1) checking available disk space [----------------------------------------------------------------------] 100%
:: Processing package changes...
(1/1) installing llvm [----------------------------------------------------------------------] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
==> Making package: crystal-icr 0.2.14-1 (Fri May 5 16:34:20 GMT 2017)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Downloading v0.2.14.tar.gz...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 130 0 130 0 0 137 0 --:--:-- --:--:-- --:--:-- 137
100 82111 0 82111 0 0 36474 0 --:--:-- 0:00:02 --:--:-- 205k
==> Validating source files with sha256sums...
v0.2.14.tar.gz ... Passed
==> Extracting sources...
-> Extracting v0.2.14.tar.gz with bsdtar
==> Starting build()...
/usr/bin/crystal build --release -o bin/icr src/icr/cli.cr
==> Starting check()...
/usr/bin/crystal build --release -o bin/icr src/icr/cli.cr
/usr/bin/crystal spec
...................F......

Failures:

  1. icr command errors prints runtime error without crashing
    Failure/Error: output.should match /invalid Int32: 5a (ArgumentError)/

    Expected: "icr(0.22.0) > "5a".to_i\nInvalid Int32: 5a (ArgumentError)\n0x443f7b: *CallStack::unwind:Array(Pointer(Void)) at ??\n0x457875: to_i32 at /usr/lib/crystal/string.cr 418:5\n0x45776c: to_i at /usr/lib/crystal/string.cr 319:5\n0x442350: icr_exec at /tmp/yaourt-tmp-fiifi/aur-crystal-icr/src/crystal-icr-0.2.14/.icr_ngi4kLvKTiCk0achuFw7bQ.cr 3:3\n0x43305d: __crystal_main at /tmp/yaourt-tmp-fiifi/aur-crystal-icr/src/crystal-icr-0.2.14/.icr_ngi4kLvKTiCk0achuFw7bQ.cr 5:26\n0x442229: main at /usr/lib/crystal/main.cr 12:15\n0x7f89a63c4511: __libc_start_main at ??\n0x43296a: _start at ??\n0x0: ??? at ??\nicr(0.22.0) >"
    to match: /invalid Int32: 5a (ArgumentError)/

    spec/integration/icr_spec.cr:174

Finished in 58.34 seconds
26 examples, 1 failures, 0 errors, 0 pending

Failed examples:

crystal spec spec/integration/icr_spec.cr:171 # icr command errors prints runtime error without crashing
make: *** [Makefile:10: test] Error 1
==> ERROR: A failure occurred in check().
Aborting...
==> ERROR: Makepkg was unable to build crystal-icr.

String opretator << fails

icr(0.10.0) > "avc" << "cd"
Index out of bounds (IndexError)
[4319989] ???
[4294275] main +12547
[139952626604869] __libc_start_main +245
[4257081] ???
[0] ???

unexpected token error

This small snippet comes from one of the crystal samples.

icr(0.19.1) > module Screen
icr(0.19.1) >   TILES = {
icr(0.19.1) >           0 => {:white, nil},
unterminated hash literal
icr(0.19.1) > 2 => {:black, :white},
unexpected token: =>
icr(0.19.1) > }
icr(0.19.1) >   end

These errors prevent you from pasting any more of the example in.

Wrong output

When I compile file with code:

puts "5a".to_i

I don't get errors on building and get exception on executing:

invalid Int32: 5a (ArgumentError)
[4348647] *CallStack::unwind:Array(Pointer(Void)) +87
[4348538] *CallStack#initialize<CallStack>:Array(Pointer(Void)) +10
[4348490] *CallStack::new:CallStack +42
[4348383] *Exception +31
[4348317] *ArgumentError#initialize<ArgumentError, String>:CallStack +29
[4348257] *ArgumentError::new<String>:ArgumentError +97
[4346497] *String#to_i32<String, Int32, Bool, Bool, Bool, Bool>:Int32 +257
[4346224] *String#to_i<String, Int32, Bool, Bool, Bool, Bool>:Int32 +32
[4346172] *String#to_i<String>:Int32 +92
[4322853] ???
[4330153] main +41
[140684254578192] __libc_start_main +240
[4279081] _start +41
[0] ???

But now icr:

icr(0.12.0) > "5a".to_i

icr(0.12.0) >

OS X El Capitan Errors

I updated Crystal and just installed icr version 0.2.13 via Homebrew. And am getting an error in ICR

$ icr
icr(0.20.3) > 2 + 2
Error: unknown command: /Users/runeimp/Google
icr(0.20.3) >

Doesn't matter what I type I get the same error as a result. 😞

API for library to show object's summary

I wonder if there could be any APIs for library to show summary for the object that it create.

For example in irb there are something like :

001 > require "statsample"
     => true
002 > [1,2,3].to_vector
     => #<Daru::Vector(3)>
           0   1
           1   2
           2   3 

Empty inputs print the last value

Hello,

I’m not sure this is intentional. If you type, e.g. 2+2 it gives you 4 but if you press enter any number of times after that it’ll always give you 4:

$ ./bin/icr
icr(0.11.0) > 2+2
 => 4
icr(0.11.0) >
 => 4
icr(0.11.0) >
 => 4
icr(0.11.0) >
 => 4
icr(0.11.0) >

This is the same if you press ^D, which, in irb (and most REPLs), allows you to quit:

$ ./bin/icr
icr(0.11.0) > 2+2
 => 4
icr(0.11.0) > ^D => 4
icr(0.11.0) > ^D => 4

If you press enter at the very beginning you’ll get nil instead of the previous value.

Error with that postinstall

Ok, so for some reason, it's not working for me now. I have no idea why, but I'm looking in to it. When installing icr as a dependency of a project, the shard installs, but never runs the postinstall. It still works when the path to icr is local though... Once I figure this out, I'll submit a PR to fix it, but just wanted to notify anyone having the same issue.

Time stored in a variable changes on every access

When you store Time.now into a variable. Any access to the variable will always be different.

steps to reproduce.

15:11 $ icr
icr(0.21.0) > current_time = Time.now
 => 2017-03-06 15:38:40 -0800
icr(0.21.0) > current_time
 => 2017-03-06 15:38:43 -0800
icr(0.21.0) > current_time
 => 2017-03-06 15:38:48 -0800
icr(0.21.0) >

icr version

$ icr -v
icr version 0.2.13
Author: Potapov Sergey
Homepage: https://github.com/greyblake/crystal-icr

crystal-version

$ crystal -v
Crystal 0.21.0 (2017-02-21)

Enums error

Hi!
i study Crystal-lang document.
enum is error
so, i can't use enum : (

Syntax error in .icr_goOw6J5s0L5tnfIjIBE-kg.cr:2: can't define enum inside def
  enum Color
  ^

compiled error after upgraded to crystal 0.20.0

MemoryIO has renamed to IO::Memory in this version which leads to the following error

/usr/bin/crystal build --release -o bin/icr src/icr/cli.cr 
Error in src/icr/cli.cr:2: while requiring "../icr"

require "../icr"

in src/icr.cr:3: while requiring "io/memory_io": can't find file 'io/memory_io'

require "io/memory_io"
^

make: *** [build] Error 1

Create a release tag

Hi @veelenga @greyblake ICR is being used in Amber CLI. Would be useful to release a stable tag line v0.3.0 or v0.2.15 to avoid using master and avoid unexpected changes.

Thanks you crystal-community for maintain this shard! <3

dynamic constant assignment

I am unable to declare a constant inside ICR.
I am getting this error.

TRANSACTION = 0
dynamic constant assignment

      TRANSACTION = 0

when I ran it in a file, i got the output and all went well.

Feature: Using ctrl-C

When using IRB, if you're writing out multi-line code, and you make a typo, you can use ctrl-C to sort of reset you back to normal. Take this for example:

[14:07PM] crystal-icr (bugs/alias)$ irb
2.3.1 :001 > class Dog
2.3.1 :002?>   def bark
2.3.1 :003?>     ebd
2.3.1 :004?>     ^C
2.3.1 :004 > 1 + 1
 => 2 
2.3.1 :005 > puts "back to normal"
back to normal
 => nil 

With ICR currently, if you hit ctrl-C, then it will completely exits the session back to your main prompt. If you've been spending time building out an example, then you will have lost setting up variables and such.

Since this needs to work a bit different than how IRB works, my plan would be to create some sort of status that knows if the current state is ok or not. Then catching Signal::INT would basically clear everything back to the last good state.

If you like the idea, then I'll work on sending a PR.

Behavioral difference when reassigning variable in multi-line blocks

While I was pleasantly surprised that icr supported multiline blocks, there does seem to be some lingering issues. Specifically, I have found that if your first usage of a variable in a block is assigning that variable using the same variable in the RHS, regardless of that variable already being assigned outside the block, it causes an error:

icr(0.20.0) > i = 0
 => 0
icr(0.20.0) > 10.times do |a|
icr(0.20.0) >   i = i + a
can't use variable name 'i' inside assignment to variable 'i'
icr(0.20.0) >
icr(0.20.0) > 10.times {|a| i = i + a}
 => 10

As you can see, doing it all in a single line has no issue.

I'm assuming this is because icr is detecting that you're in a block and trying to validate the inner code stand-alone. If this is the case, I would recommend simply not validating until the outer-most block is exited.

Make (build) error

~/Projects/crystal/crystal-icr $ uname -a
Linux AlexNote-Arch 4.4.1-2-ARCH #1 SMP PREEMPT Wed Feb 3 13:12:33 UTC 2016 x86_64 GNU/Linux

~/Projects/crystal/crystal-icr $ make
/usr/bin/crystal build --release -o bin/icr src/icr/cli.cr 
./.crystal/home/alex/Projects/crystal/crystal-icr/src/icr/cli.cr/_main.o: In function `__crystal_main':
main_module:(.text+0x50bd): undefined reference to `LLVMInitializeX86TargetInfo'
main_module:(.text+0x50c2): undefined reference to `LLVMInitializeX86Target'
main_module:(.text+0x50c7): undefined reference to `LLVMInitializeX86TargetMC'
main_module:(.text+0x50cc): undefined reference to `LLVMInitializeX86AsmPrinter'
main_module:(.text+0x50d1): undefined reference to `LLVMInitializeX86AsmParser'
main_module:(.text+0x50d6): undefined reference to `LLVMLinkInMCJIT'
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc -o "bin/icr" "${@}"  -rdynamic  `(llvm-config-3.6 --libs --system-libs --ldflags 2> /dev/null) || (llvm-config-3.5 --libs --system-libs --ldflags 2> /dev/null) || (llvm-config --libs --system-libs --ldflags 2>/dev/null)` -lstdc++ -lcrypto -lreadline -levent -lrt -lpcre -lgc -lpthread -ldl`
Makefile:5: recipe for target 'build' failed
make: *** [build] Error 1

Feature: paste mode

How about adding a paste mode? :)

Something like:

paste mode

I provided a very simple implementation in a PR. #56

What is the state of macro support?

macro a_macro
  42
end
icr(0.22.0) > macro a_macro
icr(0.22.0) >   42
icr(0.22.0) >   end
can't define macro inside def

  macro a
  ^
icr(0.22.0) > 

Are macro unsupported? if yes, maybe add a section in the readme mentionning that?
Is it possible to support them in any way?

broke after execute "make" command

I'm running OSX 10.10.4 and I just clone down the project and do the make command then it broke with something unexpected.

Error: execution of command failed with code: 1: `cc -o "/Users/[USERNAME]/src/crystal/crystal-icr/bin/icr" "${@}"  -rdynamic  /usr/local/Cellar/crystal-lang/0.14.2/src/llvm/ext/llvm_ext.o `(llvm-config-3.6 --libs --system-libs --ldflags 2> /dev/null) || (llvm-config-3.5 --libs --system-libs --ldflags 2> /dev/null) || (llvm-config --libs --system-libs --ldflags 2>/dev/null)` -lstdc++ -lcrypto -lreadline /usr/local/Cellar/crystal-lang/0.14.2/src/ext/libcrystal.a -levent -lpcre -liconv -lgc -lpthread -ldl`

Unable to define records in icr

icr(0.18.6) > record Person, first_name : String, last_name : String do
icr(0.18.6) >
icr(0.18.6) > def full_name
icr(0.18.6) > "#{first_name} #{last_name}"
icr(0.18.6) > end
icr(0.18.6) >
icr(0.18.6) > end
Syntax error in ./.icr_yNuX8BhwZzkOz4suZmFkSA.cr:4: can't define def inside def

def full_name
^
icr(0.18.6) >
icr(0.18.6) > a = Person.new("Mike", "Nog")
Error in ./.icr_yNuX8BhwZzkOz4suZmFkSA.cr:5: instantiating 'icr_exec()'

puts "|||YIH22hSkVQN|||#{icr_exec.inspect}"
^~~~~~~~~~~~

in ./.icr_yNuX8BhwZzkOz4suZmFkSA.cr:2: undefined constant Person

a = Person.new("Mike", "Nog")
^~~~~~

redeclaring method issue

Redefining method with the same name causes that all previous usages of that method are recalled again.

For example:

duplicate method call

Is that expected behaviour?

Rely libreadline6-dev on Ubuntu

/usr/bin/ld: cannot find -lreadline
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc -o "cli" "${@}"  -rdynamic  -lcrypto -lreadline /opt/crystal/src/ext/libcrystal.a -levent -lrt -lpcre -lgc -lpthread -ldl`

I think README should point out it.

Going full REPL

You know, not just re-running a file. What needs to be done?

Error target icr failed to compile:

On Ubuntu 18.04 LTS, make gives this error. Crystal 0.24.2; LLVM: 4.0.0. OpenSSL is installed. I think I'm missing a package, but I can't figure out which one. Any help is greatly appreciated.

_main.o: In function `__crystal_main':
/usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to `SSL_library_init'
/usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to `SSL_load_error_strings'
/usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to `OPENSSL_add_all_algorithms_noconf'
/usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to `ERR_load_crypto_strings'
_main.o: In function `default_method':
/usr/share/crystal/src/openssl/ssl/context.cr:4: undefined reference to `SSLv23_method'
_main.o: In function `~procProc(LibCrypto::X509_STORE_CTX, Pointer(Void), Int32)@/usr/share/crystal/src/openssl/ssl/context.cr:100':
/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:34: undefined reference to `sk_num'
/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:35: undefined reference to `sk_value'
/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:(.text+0x58166): undefined reference to `sk_pop_free'
/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:66: undefined reference to `sk_pop_free'
/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:(.text+0x58257): undefined reference to `sk_pop_free'
/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:66: undefined reference to `sk_pop_free'
_main.o: In function `~procProc(Pointer(Void), Nil)@/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:66':
/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:(.text+0x58321): undefined reference to `sk_free'
_main.o: In function `~proc2Proc(Pointer(Void), Nil)@/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:66':
/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:(.text+0x58331): undefined reference to `sk_free'
_main.o: In function `~proc3Proc(Pointer(Void), Nil)@/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:66':
/usr/share/crystal/src/pointer.cr:(.text+0x58981): undefined reference to `sk_free'
_main.o: In function `~proc4Proc(Pointer(Void), Nil)@/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:66':
/usr/share/crystal/src/pointer.cr:(.text+0x58991): undefined reference to `sk_free'
_main.o: In function `~proc5Proc(Pointer(Void), Nil)@/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:66':
/usr/share/crystal/src/pointer.cr:(.text+0x589a1): undefined reference to `sk_free'
_main.o:/usr/share/crystal/src/pointer.cr:(.text+0x589b1): more undefined references to `sk_free' follow
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o '/home/lewisb/src/crystal/icr/bin/icr'  -rdynamic  -lreadline -lyaml -lz `command -v pkg-config > /dev/null && pkg-config --libs libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs libcrypto || printf %s '-lcrypto'` -lpcre -lm -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`

Makefile:7: recipe for target 'build' failed
make: *** [build] Error 1

Unable to alias const in global scope

I get the error can't define alias inside def when trying to define an alias.

icr(0.19.4) > module Mod
icr(0.19.4) >   end
 => ok
icr(0.19.4) > alias M = Mod
can't define alias inside def

  alias M = Mod
  ^

Output of command only works once

This is what happens when I'm trying to execute small code pieces within icr:
screen shot 2017-05-24 at 14 45 46

I only get an output on the first attempt. I'm running crystal within an Ubuntu Vagrant box.

Command type detection bug

Test case - Reference.new == Reference.new
Even though this is an equality check, this is being caught as a constant_assignment command and so is wrongly treated. You do not get the output of the command.

Reset does not work

When i enter icr do whatever (same thing happens when i do nothing first also) and enter reset
I get the following error

undefined local variable or method 'reset'

  reset
  ^~~~~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.