Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Dart needs a REPL #4409

Open
DartBot opened this Issue · 9 comments

4 participants

@DartBot
Collaborator

This issue was originally filed by demis.b...@gmail.com


Dart needs a REPL - It's a glaring omission from a modern dynamic language :)

@iposva-google
Collaborator

Assigning to SDK for the moment, but there are many pieces in the VM on top of the getting the REPL binary built and included in the Editor.


Added Area-SDK, Triaged labels.

@DartBot
Collaborator

This comment was originally written by dharcourt@chromium.org


A good place for this Read–Eval–Print Loop would be the Dartium developer tools console (and eventually the Chrome console). Switching the console language between Dart and JavaScript could be achieved with a console switch/setting.

A console REPL would be preferable to a standalone or IDE hosted REPL because it would maintain state like a Smalltalk workspace and allow interaction with the DOM.

@DartBot
Collaborator

This comment was originally written by JayYoung990...@gmail.com


A console-based REPL in Dartium/Chrome would indeed be awesome, but this doesn't address the server-side use case.

@alan-knight
Collaborator

The Dartium console would be very nice, and exists now. You can't define a top-level function, but you can define one that's assigned to a variable or passed as a closure e.g.

[1, 2, 3].forEach((x) => print(x));
1
2
3
null
var f = (x) => x + 2;
[Dart Function] {}
f(5)
7
blah(x) => x + 3;
"'': error: line 2 pos 9: ')' expected
blah(x) => x + 3
        ^"

@DartBot
Collaborator

This comment was originally written by martyglaubit...@gmail.com


where this an improvement over ne REPL at all, it'd be much more
awesome to just being able to fire up the dartvm in repl mode. i got
somthing like "dart -i" in my mind...

Am Di, 4. Feb, 2014 um 9:41 ,dart@googlecode.com schrieb:

@DartBot
Collaborator

This comment was originally written by dharcourt@chromium.org


#­5: This doesn't work for me using the developer tools console ('SyntaxError: Unexpected token >' on the first line in Dartium 32.0.1700.58 (247491))... what am I missing? Is the Dart console somewhere else, or is there a setting to change?

#­4, #­6: I'll create a separate issue for a Dartium console if there isn't one, and this issue can stay focussed on a standalone REPL.

@DartBot
Collaborator

This comment was originally written by jesse.riggi...@gmail.com


I've found that I have to toggle the selector at the bottom and near the
left-middle of the tools window that says something like javascript context
to one of the dart packages. Once you do that, you should be able to
execute Dart code. Depending on what you need to access within your own
codebase, you may need to be more selective in your package choice.

I've only been using Dart for about 3 weeks, but I have to say that using
the Dartium web tools vs the Editor has ramped up my productivity (and I
just found out about it in the last 5 days :-) ). I think it should be
promoted more.

Hope that helps,
 Jesse

@DartBot
Collaborator

This comment was originally written by dharcourt@chromium.org


Thanks Jesse, that works! Very neat and useful...

There is no need for a new Dartium console issue and this issue can be returned to its standalone REPL focus. Apologies for the noise.

@lrhn
Collaborator

Issue #17133 has been merged into this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.