-
Notifications
You must be signed in to change notification settings - Fork 34
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
[Feature Request] Decouple the GUI and the interpreter #92
Comments
This might not be exactly what you're looking for; but, I thought it might be close enough to be worth mentioning. If you build the latest release (6.2.1) on a *NIX system without a GUI, it should be possible to just run a script file that doesn't contain any turtle commands by passing it as a command line argument:
And you should be able to pass in command line arguments to the logo script by using a single hyphen
More DetailsConcretely, if I set up a Linux VM using a Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/bionic64"
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get upgrade -y
apt-get -y install build-essential \
autoconf \
automake \
libtool \
texinfo \
texlive
SHELL
end Then
I can create a file
And run it like so:
For passing arguments, I can modify
And run it like so:
|
... and if you start a text file with |
Oh, Thank you @dmalec, so for now, instead of using a |
This should use a no-GUI logo installation if I don't have X on my box :) |
You're welcome @KDr2, no worries :). That's essentially how I have my dev setup running - one checkout configured for wxWidgets GUI builds and one for non-GUI builds. |
Furthermore, if we already had a configuring option for turning the GUI on or off, is it hard to make it a runtime option? |
It's an interesting idea and I think it resonates with people. This broad idea was mentioned in a comment on another, now closed, issue regarding getting script loading working in the GUI version: #36 (comment) There are a few challenges I can see: wxWidgets side I looked at documentation for wxWidgets and had a hard time finding anything about dynamically deciding whether to open a GUI or run as a console application. It seems like wxWidgets is fairly opinionated about wanting to own the application lifecycle and applications having some amount of GUI. That said, I'm still learning how the wxWidgets lifecycle and framework work, so I may be incorrect in my core understanding. (EDIT: I may have spoken too soon, this looks like something worth digging into: https://docs.wxwidgets.org/3.0/classwx_app_console.html) ucblogo side Earlier versions of ucblogo were built on a variety of different platforms with very different libraries/calls available. So, the config option is removing all code not relevant to the target platform prior to compiling (since the other platforms' code would not be able to compile). The way the GUI mode is toggled on and off via config is in line with that model. I tend to mentally model wxWidgets as a being a full virtual platform that happens to be capable of compiling and running in a number of different environments (not saying this is technically accurate; but, it's my "just so story" when I navigate the code). That said, I think there are ways code could be refactored to handle this type of GUI/non-GUI mode, just setting expectations that my personal estimate here is that it's not a simple change. All of the above said, I'm curious what others think - if there's additional challenges here or if the two above have straightforward solutions :) |
As said in the title, could we provide a script mode that has nothing to do with the turtle and the GUI, just run a script file like what
load
does?So we can use it on a box without a GUI system (like *NIX without X).
Thank you.
The text was updated successfully, but these errors were encountered: