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

Possibility for improved usability for Clojerl REPL from a release? #85

Open
oubiwann opened this issue Jul 10, 2020 · 3 comments
Open

Comments

@oubiwann
Copy link
Contributor

oubiwann commented Jul 10, 2020

If I create a Clojerl release and start the app(s) in console mode (where PROJ_BIN points to an app's release script):

CODE_LOADING_MODE=interactive $(PROJ_BIN) console

I need to do the following to get a Clojerl REPL:

> 'clojure.main':main([<<"-r">>]).
Clojure 0.6.0
clje.user=> 

However, I can start the REPL directly from the CLI by doing this:

CODE_LOADING_MODE=interactive $(PROJ_BIN) start
$(PROJ_BIN) eval "'clojure.main':main([<<\"-r\">>])"
$(PROJ_BIN) attach;

Maybe there's a nicer way to provide this functionality for Clojerl developers?

@jfacorro
Copy link
Member

@oubiwann Did you have something specific in mind in terms of improved usability? What does LFE provide in this case? Is there an lfe:repl/0 function or something similar?

@oubiwann
Copy link
Contributor Author

I actually didn't have anything in mind! Was mostly opening this as a brainstorming ticket.

The LFE situation is actually less friendly, as the start/eval/attach option doesn't work for the LFE REPL 😢 It has no release-specific goodness to offer; you can only start up the release console and then lfe_shell:start().

Oh, so ... there is something that I've done for the updated LFE rebar3 plugin, though: I've added support for rebar3 lfe run-release (there's also a run and run-escript). Since the rebar3-generated release script is an actual shell script, this is a bit of a hack: the plugin uses rebar3 utils to assemble the path to the release bin dir and then uses os:cmd to call the script, supporting passing args to it (so that this sort of thing works: rebar3 lfe run-release start or rebar3 lfe run-release ping, etc.).

That might be more hackery than your interested in having as a part of the Clojerl rebar3 plugin?

Here's the code:

Hrm, not really sure it's worth it ... even if we provide a means of starting and evaling the Clojerl REPL, the user's ultimately going to have to type the full path to the script in order to get an interactive session with the console. Maybe you can think of something clever that will work? ;-)

@oubiwann
Copy link
Contributor Author

If you are interested in creating a rebar3_clojerl command to run a release, note that I have run into an issue I haven't had to time to sit down and sort out. I've created a ticket for it here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants