Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Elchemy REPL #154

Open
wende opened this issue Jul 16, 2017 · 6 comments
Open

Implement Elchemy REPL #154

wende opened this issue Jul 16, 2017 · 6 comments

Comments

@wende
Copy link
Owner

wende commented Jul 16, 2017

Functionality:
A REPL should take single lines of Elchemy, and produce an output of compiled Elixir code:

Examples:

elchemy> 2 + 5
7
elchemy> List.map ((+) 2) [1,2,3]
[3,4,5]
elchemy> Just 10
{10}
elchemy> Nothing
nil

Ideas:

  • Autocompletion on Tab press (Can be Elixir autocompletion since the syntax of variables and Module.function is the same)
  • Display compiled Elixir code when demanded
  • Compile the output back to Elchemy syntax (?)
  • Display the type of the output (?)

Possible implementation:

  • Node.js process wrapper around iex. Using Elchemy functions to compile String in and feed them out to wrapped process.
  • Listen for tab key and either send tab key to the process or use IEx.Autocomplete module
@wende
Copy link
Owner Author

wende commented Jul 16, 2017

For output clarity probably #93 is a must

@wende wende added the Blocked label Aug 18, 2017
@wende
Copy link
Owner Author

wende commented Aug 18, 2017

Blocked by #164

@wende wende removed this from the Elchemy 0.5 milestone Oct 15, 2017
@wende
Copy link
Owner Author

wende commented Nov 24, 2017

Not worth the effort. Closing in favor of #207

@wende wende closed this as completed Nov 24, 2017
@wende
Copy link
Owner Author

wende commented Feb 26, 2018

Resurrecting for discussion on possible implementations

@wende
Copy link
Owner Author

wende commented Aug 23, 2018

I think there's an option to hack this pretty easily:

  1. Write a simple Repl.elm file in Elchemy that understands the input to the repl and translates into related Elixir code
    a) If it looks like statement add to a module and reload the whole thing
    b) If it looks like expression treat it as a query and only print the output
  2. Download the whole Elchemy codebase
  3. Write an expect script to feed input information into elm repl launched in Elchemy codebase directory, and pass it further into Repl.input() function.
  4. If there were no errors take the output of code produced and feed it to iex repl
  5. Print out the result of both repl's (iex result and elm-repl type result) to the interface
  6. ???
  7. Profit

@wende
Copy link
Owner Author

wende commented Sep 22, 2018

Would be way easier to ship if #352 was done

@wende wende added the Blocked label Sep 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant