monome / druid

terminal interface for crow
GNU General Public License v3.0
35 stars 16 forks source link

Design question: Fit and purpose of `u` and `r` commands in REPL #35

Closed simonvanderveldt closed 4 years ago

simonvanderveldt commented 4 years ago

We have two commands in the REPL that to me feel a bit off, u (upload) and r (run).

According to the help they operate on files and allow one to either run the contents of this file or write them to flash and then run them.

IMHO there are a couple of issues with these commands:

Now if we do want to keep this functionality there are some other issues:

@trentgill @tehn What do you think?

tehn commented 4 years ago

i appreciate that maiden splits off meta-commands with a semicolon, ie ;restart which acts on the entire system rather than the currently running LVM (a command which is also invalid lua, hence signaling meta-ness). perhaps this is part of the issue you're having, is the name-spacing?

agreed that there's no need for a default sketch.lua --- it's even weirder now that druid can be "run from anywhere" given the pip install. the convenience of up-arrow makes it unnecessary as a shortcut

not sure what you mean by extra args. i wouldn't ever expect there to be more args than a single file path (sorry, i haven't kept up closely with druid--- so many fires)

simonvanderveldt commented 4 years ago

i appreciate that maiden splits off meta-commands with a semicolon, ie ;restart which acts on the entire system rather than the currently running LVM (a command which is also invalid lua, hence signaling meta-ness). perhaps this is part of the issue you're having, is the name-spacing?

I think it's more that it doesn't really make sense to me to do stuff like uploading a file from the filesystem in an interactive session/REPL. Or formulated the other way around: The interactive session is there for interactive/immediate stuff, like setting an output to some value and seeing/hearing that happen immediately. Or monitoring the inputs and seeing their values change immediately. Writing a whole script doesn't seem to match with that interactive/exploratory purpose. (might also just be me, that's why I'm asking :slightly_smiling_face:)

tehn commented 4 years ago

the docs explain the setup--- i think it makes sense.

editor side-by-side with druid. during development you'll want to live-query via the REPL for debugging. and upload to get your thing working. i actually have no idea how you're successfully make a script otherwise. you'd need three windows--- one for just a script uploader?

simonvanderveldt commented 4 years ago

i actually have no idea how you're successfully make a script otherwise. you'd need three windows--- one for just a script uploader?

Ah, OK, like this you mean? https://monome.org/docs/crow/scripting/#stage-two-executing That explains it. Also relevant because only one process can open a serial device at a time, meaning one would need to choose between REPL or command-line, which wouldn't work by default.

Personally now that #30 is merged I'd prefer to integrate it into my editor so the normal build commands upload to/run it on crow but that can be done later.

This does mean that we then probably want some way of properly navigating the filesystem within druid.

tehn commented 4 years ago

by navigating the file system i would be fine with just a quick meta command to print a list of the *.lua files in the current working folder

simonvanderveldt commented 4 years ago

I was thinking something like this? image

szvsw commented 4 years ago

agree with @tehn that all that is needed for navigating the file system is a command to print a list of lua files in the current working folder.

I don't think that there should be another method of navigating within druid. It is really easy to quickly q out of druid, cd to a new location, and then druid back into druid. in most cases, you will already enter druid from your folder where you store all of your crow scripts.

it is already a lot for people to learn how to nav the command line using cd; seems unnecessary/overkill to have to learn how to do it in druid as well.

just my 2c.

simonvanderveldt commented 4 years ago

OK, thanks for the feedback/info. I totally missed the usecase of running druid side by side with an editor :)

I'll create a follow-up issue for adding some form of directory browsing and will create a PR to remove the hardcoded "sketch.lua" stuff.