views:

591

answers:

31

Python language has a well known feature named interactive mode where interpreter can read commands directly from tty.
I tipically use this mode to test if a given module is in the classpath or to play around and test some snippets.

Do you know any other programming languages that has Interactive Mode?

If you can, give the name of the languages and where possible, a web reference.
If it is already mentioned, you can just vote for it.

+5  A: 
Pekka
Wrong link for PHP. http://www.phpsh.org/
Ignacio Vazquez-Abrams
Just run `php -a`, but it **sucks** compared to Python's shell.
Felix
`phpsh` is somewhat decent. Interestingly, it's written in Python.
intuited
+2  A: 

Ruby has irb, which is an interactive interpreter, and Ruby is quite similar to Python.

irb at Wikipedia
Ruby at Wikipedia

applechewer
+1  A: 

Ruby has it.. also Groovy has it (allowing you to test also Java code effectively).

Jack
+5  A: 

bash / tcsh / csh / ksh /...

they all are programming languages and have a CLI :)

pulegium
A: 

Erlang does, as well as Haskell and i'm guessing Ruby does. Also there are Javascript CLIs like Firebug

Tor Valamo
+4  A: 

Haskell even has two (mainstream) interactive interpreters, Hugs and ghci.

Thomas
+3  A: 

Lisp and Scheme have interactive mode.

Yaroslav
Have also used this feature of scheme...
AJ
Lisp was probably the first to invent this interactive way of programming.
Tadeusz A. Kadłubowski
+1  A: 

I guess one of the first was LISP. Just try clisp

ignatius
+1  A: 

Most scripting languages will read from stdin and execute code typed at the console if you don't specify a filename to run. Php and perl will all do it.

Ruby has irb.

Lua has a more formal interactive mode like python, which will show you the indent level of your code at the prompt. It's very helpful since lua is typically used as an embedded scripting language, and you don't have to run your full application to test out code snippets.

+1  A: 

Lua has an interactive mode as well.

Dacav
+1  A: 

Oh, I've forgotten the BASIC one :)

Yaroslav
A: 

Scala has REPL.

esycat
A: 

vb net

regards!

bpSz
+21  A: 

Most (all?) lisps (including common lisp, scheme and clojure), sml, ocaml, haskell, F#, erlang, scala, ruby, python, lua, groovy, prolog.

sepp2k
Great list, thanks.
systempuntoout
Yep, great list. Except that the ocaml one sucks.
p4bl0
Quite complete answer. Lacks prolog, though.
Tadeusz A. Kadłubowski
@Tadeusz: Fixed.
sepp2k
lacks JavaScript, which has interactive interpreters like Rhino or SpiderMonkey, and also the interactive command lines in all current-version browsers.
bcherry
@p4bl0: If by "ocaml one sucks" you mean it doesn't allow editing, use `rlwrap ocaml`. Even better, alias it in your shell - I'd never use `ocaml` without [email protected]: if you include interactive interpreters, add Perl too (http://use.perl.org/articles/07/08/30/1729255.shtml)
Amadan
+4  A: 

Tcl/tk has one. It's been there since day one. This is not a feature unique to Python.

Bryan Oakley
Actually, a Tcl interactive interpreter was first introduced as part of the TclX extension. The `tclsh` program was an innovation introduced in June 1993...
Donal Fellows
Thanks for the history lesson. I started using Tcl in '95 which is why I had assumed it had always been there.
Bryan Oakley
+1  A: 

Prolog has one as well

Chris Thompson
+2  A: 

C++.

Seriously.

KennyTM
And another: http://root.cern.ch/drupal/content/cint
Mike Dinsdale
+6  A: 

As has been pointed out lots of languages can be used interactively, though how conveniently they can be so used varies quite a bit. The interactive environment I'm most familiar with, and one that I have found among the most congenial of all the free environments for interactive programming I've tried (not that I've tried them all) is Slime, a mode for emacs that allows interaction with a running Common Lisp, and can also be used with Clojure, a Lisp for the JVM.

If Lisp isn't your cup of tea a variety of Smalltalk environments are worth mentioning. One of the interesting things about many Smalltalk systems is that they expose almost all of the code that implements the system in the programming environment- if you want you can browse or even rewrite parts of the programming environment as you are using it, just as you would write new code. In fact the line between the system provided to you and the code you are writing is pretty blurry. Squeak is an interesting free Smalltalk, and Cincom offers an evaluation version of their commercial Smalltalk, which is a great environment IMHO.

Anyway, if you're interested in playing with interactive environments you could do worse than to play with those two, though of course there are a lot of other systems out there that allow interactive programming to one degree or another.

T Duncan Smith
+1  A: 

Even Java has one!

It's called Beanshell: http://www.beanshell.org/

ahe
Beanshell is a scripting language, isn't it?
systempuntoout
Yes and no. You can just start an interactive session with the command bsh. It accepts full fledged Java code with all boilerplate attached but it also parses a simplified version of Java that feels more like a scripting language.
ahe
A: 

There's one for C#.

Ken
@Ken The link you posted goes to this article. Did you mean to post a link to the interactive C# shell?
Data Monk
csharp.exe (and gsharp.exe) are included in the distributions of the recent versions of Mono.
wRAR
This is why copy-paste coding is bad: I'm not very good at copy and paste. :P
Ken
+1  A: 

FORTH comes immediately to mind.

So does APL.

I remember seeing an interactive FORTRAN implementation on an SDS-930 (I think), many, many moons ago.

John R. Strohm
+1  A: 

You can do almost-interactive C# and VB.NET using LINQPad

mmsmatt
+2  A: 

Perl - interesting that there are so many answers before this

Mark
+1  A: 

Logo programming language.

Some implementations are so interactive that some people don't even use any other mode.

tomp
+1  A: 

There's a repl for C too.

p4bl0
Oh wow. That's very cool.
detly
A: 

Windows PowerShell: http://en.wikipedia.org/wiki/Windows_PowerShell

Yaroslav
Is it not just a shell?
systempuntoout
From Wikipedia: Windows PowerShell is an extensible automation engine from Microsoft, consisting of a command-line shell and associated scripting language.
Yaroslav
@systempuntoout: Every non-trivial "just a shell" has its own language, though not necessary useful, extensible or Turing-complete.
wRAR
+1  A: 

R statistic program ;)

chaostimmy
A: 

Boo is a nice middle ground between Python and C# - type-inference and procedural-compatible programming, with compatibity with .Net, plus ability to compile to CLR assemblies and .EXE's.

Paul McGuire
A: 

Basic on the VIC20 and C64

sal
A: 

Any interpreted language is most likely going to have one.

Austin Kelley Way
A: 

True to its name, the science-oriented and proprietary Interactive Data Language (usually just called IDL, but spelled out here to avoid confusion with the other IDL) has an interactive mode which many of its users utilize more often than they program in it.

GreenMatt