crystal-community / Icr

Licence: mit
Interactive console for Crystal programming language

Programming Languages

crystal
512 projects

Labels

Projects that are alternatives of or similar to Icr

Rcrl
Read-Compile-Run-Loop: tiny and powerful interactive C++ compiler (REPL)
Stars: ✭ 332 (-26.55%)
Mutual labels:  repl
Konch
Configures your Python shell.
Stars: ✭ 393 (-13.05%)
Mutual labels:  repl
Reveal
Read Eval Visualize Loop for Clojure
Stars: ✭ 412 (-8.85%)
Mutual labels:  repl
Racket Rash
The Reckless Racket Shell
Stars: ✭ 358 (-20.8%)
Mutual labels:  repl
Replete Ios
ClojureScript REPL iOS app
Stars: ✭ 381 (-15.71%)
Mutual labels:  repl
Janeway
🌌 A Node.js console REPL with object inspection and many other features
Stars: ✭ 398 (-11.95%)
Mutual labels:  repl
Ielixir
Jupyter's kernel for Elixir programming language
Stars: ✭ 312 (-30.97%)
Mutual labels:  repl
Winrepl
x86 and x64 assembly "read-eval-print loop" shell for Windows
Stars: ✭ 424 (-6.19%)
Mutual labels:  repl
Scope Capture
Project your Clojure(Script) REPL into the same context as your code when it ran
Stars: ✭ 392 (-13.27%)
Mutual labels:  repl
Ok
An open-source interpreter for the K5 programming language.
Stars: ✭ 408 (-9.73%)
Mutual labels:  repl
Wac
WebAssembly interpreter in C
Stars: ✭ 372 (-17.7%)
Mutual labels:  repl
Hydrogen
Run code interactively, inspect data, and plot. All the power of Jupyter kernels, inside your favorite text editor.
Stars: ✭ 3,763 (+732.52%)
Mutual labels:  repl
Graphql Dataloader Boilerplate
Very simple boilerplate using GraphQL and DataLoader
Stars: ✭ 405 (-10.4%)
Mutual labels:  repl
Babel Time Travel
Time travel through babel transformations one by one (implemented in the Babel REPL now)
Stars: ✭ 338 (-25.22%)
Mutual labels:  repl
Cascade
A Just-In-Time Compiler for Verilog from VMware Research
Stars: ✭ 413 (-8.63%)
Mutual labels:  repl
Maria
A ClojureScript coding environment for beginners.
Stars: ✭ 330 (-26.99%)
Mutual labels:  repl
Carp
Carp is a programming language designed to work well for interactive and performance sensitive use cases like games, sound synthesis and visualizations.
Stars: ✭ 4,389 (+871.02%)
Mutual labels:  repl
Piggieback
nREPL support for ClojureScript REPLs
Stars: ✭ 452 (+0%)
Mutual labels:  repl
Urepl
In-game powerful REPL environment for Unity3D.
Stars: ✭ 418 (-7.52%)
Mutual labels:  repl
Inim
Interactive Nim Shell / REPL / Playground
Stars: ✭ 407 (-9.96%)
Mutual labels:  repl

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].