# Re: What is the difference between ir and iirb?

**URL:** <https://www.ruby-forum.com/t/re-what-is-the-difference-between-ir-and-iirb/177002>\
**Category:** IronRuby\
**Created:** [October 9, 2009, 4:09pm UTC](https://www.ruby-forum.com/t/re-what-is-the-difference-between-ir-and-iirb/177002 "2009-10-09T16:09:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![raker\_t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Post date:** [October 9, 2009, 4:09pm UTC](https://www.ruby-forum.com/t/re-what-is-the-difference-between-ir-and-iirb/177002/1 "2009-10-09T16:09:38Z")

</div>

Iirb is actually a library and has more features.

Iirb:

- can set the prompt in a .irbrc file
- can be nested (you can start a new irb session from within irb, even  
giving it a new target object to use as self)
- as a library, irb can be incorporated into other projects

Irb is the REPL for MRI, it just happens that the current design of the  
DLR gives a REPL pretty easily, so ir.exe is also a REPL.

JD

* * *

From: Shay F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: October 09, 2009 1:54 AM  
To: removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: [Ironruby-core] What is the difference between ir and iirb?

When no arguments are passed, they both start a REPL console only that  
iirb shows the time of each operation. Are there more differences?

Thanks,  
Shay.

---

<div class="post-metadata">

**Author:** ![raker\_t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Post date:** [October 16, 2009, 1:59am UTC](https://www.ruby-forum.com/t/re-what-is-the-difference-between-ir-and-iirb/177002/2 "2009-10-16T01:59:38Z")

</div>

IRB actually doesn’t show the time by default, it shows what “self” is,  
along with the line number and nested line number. Also, ir.exe’s REPL  
does not set the TOPLEVEL\_BINDING constant, though running a file or a  
snippet with ir.exe does:

$\>ir.exe  
IronRuby 0.9.1.0 on .NET 2.0.50727.4927  
Copyright (c) Microsoft Corporation. All rights reserved.

> > > TOPLEVEL\_BINDING  
> > > c:\dev\vsl1s\Merlin\Main\Languages\Ruby\Libraries.LCA\_RESTRICTED\Builtins\ModuleOps.cs:805:in  
> > > `const  
> > > \_missing’: uninitialized constant Object::TOPLEVEL\_BINDING (NameError)  
> > > from :0

$\>iirb  
irb(main):001:0\> TOPLEVEL\_BINDING  
=\> IronRuby.Builtins.Binding

$\>ruby -e “puts TOPLEVEL\_BINDING”  
#Binding:0x3030acc

$\>rbd -e “puts TOPLEVEL\_BINDING”  
IronRuby.Builtins.Binding

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Jim D.  
Sent: Friday, October 09, 2009 7:05 AM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Ironruby-core] What is the difference between ir and iirb?

Iirb is actually a library and has more features.

Iirb:

- can set the prompt in a .irbrc file
- can be nested (you can start a new irb session from within irb, even  
giving it a new target object to use as self)
- as a library, irb can be incorporated into other projects

Irb is the REPL for MRI, it just happens that the current design of the  
DLR gives a REPL pretty easily, so ir.exe is also a REPL.

JD

* * *

From: Shay F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: October 09, 2009 1:54 AM  
To: removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: [Ironruby-core] What is the difference between ir and iirb?  
When no arguments are passed, they both start a REPL console only that  
iirb shows the time of each operation. Are there more differences?

Thanks,  
Shay.
