jrincayc / ucblogo-code Goto Github PK
View Code? Open in Web Editor NEWBerkeley Logo interpreter
Home Page: https://people.eecs.berkeley.edu/~bh/logo.html
License: GNU General Public License v3.0
Berkeley Logo interpreter
Home Page: https://people.eecs.berkeley.edu/~bh/logo.html
License: GNU General Public License v3.0
I downloaded UCBLogo-6.0.dmg.gz
. First OSX couldn't figure out how to open it because it's not actually a gzip archive. I removed the .gz
and ran it as a .dmg
and that worked. I could access the drive contents inside.
But after moving UCBLogo to my Applications folder, I tried to run it and it's incompatible with OSX High Sierra because it's a 32-bit application. Apparently newer OSX is not compatible with anything that isn't 64-bit. So now I'm stuck.
When I enter a command in the default size and then change the size of the window, a ghost turtle is created the next time I enter a command. Further commands do not create a ghost, unless the turtle continues in the same direction as it was when the screen was resized.
I am running Logo on Xfce Linux.
When debugging by stepping through a procedure, the user initiated pause / continue sequence seems to have a bug in it. On continue, the evaluation does not resume. The code isn't precisely hanging, since it can be broken out of again with a stop or pause; but, it doesn't behave in the expected manner for a debugging session.
I have a code change which I believe addresses the issue - I'll submit a PR with it.
The {RETURN}
and {ALT-P}
sequences indicate user input during the stepping sequence.
? TO FOO
> LOCAL "BAR
> MAKE "BAR 10
> PRINT :BAR
> END
FOO defined
? STEP "FOO
? FOO
[LOCAL "BAR] >>> {RETURN}
[MAKE "BAR 10] >>> {RETURN}
[PRINT :BAR] >>> {ALT-P} Pausing...
FOO? PRINT :BAR
10
FOO? MAKE "BAR 20
FOO? PRINT :BAR
20
FOO? (CO)
20
?
After entering the (CO)
command, the UI hangs until the user inputs a pause command or stop command.
At that point, things appear to be in a state which isn't able to resume execution.
i am learning logo, and came by this when invoking edit in the interpreter:
ASSERT INFO:
./src/gtk/textctrl.cpp(1917): assert ""start >= 0 && end <= l"" failed in SetStyle(): invalid range in wxTextCtrl::SetStyle
BACKTRACE:
[1] wxTextCtrl::SetStyle(long, long, wxTextAttr const&)
[2] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[3] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[4] wxEvtHandler::TryHereOnly(wxEvent&)
[5] wxEvtHandler::ProcessEventLocally(wxEvent&)
[6] wxEvtHandler::ProcessEvent(wxEvent&)
[7] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[8] wxTextEntryBase::SendTextUpdatedEvent(wxWindow*)
[9] wxTextEntry::DoSetValue(wxString const&, int)
[10] wxTextAreaBase::DoLoadFile(wxString const&, int)
[11] wxEntry(int&, wchar_t**)
[12] __libc_start_main
attached is a screenshot of the popup.
? repeat 100 [print "x wait 1]
should print x, wait a second, print x, wait a second, etc. What happens instead is that nothing happens for 100 seconds and then 100 "x"s appear all at once.
It would be useful if people using brew ( https://brew.sh/ ) could install ucblogo with brew.
As in get a recipe added to brew so that:
brew install ucblogo
worked
Hello,
after reading the instructions here (thank you for that!) to get the latest ucblogo working on MAC OS with wxWidgets, i still get the issue where logo crashes when invoking the edit command. I know this was an issue with Brian harvey's last release, is this still an issue with the latest? Im running MAC OS Catalina if that helps. Many thanks.
When trying to build this on docker
FROM alpine:3 AS builder
RUN apk add --update alpine-sdk git autoconf automake libtool gettext wxgtk
WORKDIR /logo
RUN git clone https://github.com/jrincayc/ucblogo-code .
RUN autoupdate \
&& autoreconf --install \
&& ./configure \
&& make
this is the output
#9 sha256:bd84a55c3942878a235a76be0f43657b169773ed66878789fcd65de661549b16
#9 1.045 configure.ac:100: warning: The preprocessor macro `STDC_HEADERS' is obsolete.
#9 1.045 Except in unusual embedded environments, you can safely include all
#9 1.045 ISO C90 headers unconditionally.
#9 3.313 configure.ac:100: warning: The preprocessor macro `STDC_HEADERS' is obsolete.
#9 3.313 configure.ac:100: Except in unusual embedded environments, you can safely include all
#9 3.313 configure.ac:100: ISO C90 headers unconditionally.
#9 3.970 configure.ac:12: installing './compile'
#9 3.972 configure.ac:7: installing './install-sh'
#9 3.973 configure.ac:7: installing './missing'
#9 4.000 Makefile.am: installing './depcomp'
#9 4.149 docs/Makefile.am:1: installing 'docs/texinfo.tex'
#9 4.320 checking for a BSD-compatible install... /usr/bin/install -c
#9 4.528 checking whether build environment is sane... yes
#9 4.535 checking for a race-free mkdir -p... ./install-sh -c -d
#9 4.540 checking for gawk... no
#9 4.540 checking for mawk... no
#9 4.540 checking for nawk... no
#9 4.540 checking for awk... awk
#9 4.541 checking whether make sets $(MAKE)... yes
#9 4.548 checking whether make supports nested variables... yes
#9 4.554 checking for gcc... gcc
#9 4.577 checking whether the C compiler works... yes
#9 4.613 checking for C compiler default output file name... a.out
#9 4.614 checking for suffix of executables...
#9 4.653 checking whether we are cross compiling... no
#9 4.692 checking for suffix of object files... o
#9 4.718 checking whether the compiler supports GNU C... yes
#9 4.745 checking whether gcc accepts -g... yes
#9 4.771 checking for gcc option to enable C11 features... none needed
#9 4.851 checking whether gcc understands -c and -o together... yes
#9 4.900 checking whether make supports the include directive... yes (GNU style)
#9 4.908 checking dependency style of gcc... gcc3
#9 4.941 checking for g++... g++
#9 4.960 checking whether the compiler supports GNU C++... yes
#9 4.988 checking whether g++ accepts -g... yes
#9 5.015 checking for g++ option to enable C++11 features... none needed
#9 5.099 checking dependency style of g++... gcc3
#9 5.131 checking enable_objects... no
#9 5.132 checking enable_gitid... no
#9 5.132 configure: No WX_CONFIG_CHECK available
#9 5.132 checking enable_x11... no
#9 5.132 checking enable_docs... yes
#9 5.133 ./configure: line 5311: AX_CFLAGS_WARN_ALL: not found
#9 5.133 ./configure: line 5312: syntax error: unexpected word (expecting ")")
Please advise.
I ran autoreconf --install and ./configure as per the README.
I am getting an error:
./configure: line 4737: AX_CFLAGS_WARN_ALL: command not found
./configure: line 4738: syntax error near unexpected token -Wno-write-strings,' ./configure: line 4738:
AX_CHECK_COMPILE_FLAG(-Wno-write-strings,'
I am building on an Ubuntu 20.04 system. Version of autoreconf is 2.69
When running a build from the main branch, I'm seeing a couple of OSX rendering issues.
On startup, the terminal is obscured in the top left corner:
The editor displays text as white foreground on white background:
Selecting the text does display accurate contents, so this appears to be only a rendering issue:
I have a code change which I believe addresses both issues - I'll submit a PR with it.
After building on MacOS Monterey, I get:
$ ./ucblogo
Changing logolib from /usr/local/share/ucblogo/logolib to /Users/perry/src/ucblogo/ucblogo-code/logolib
Error -- Can't read Messages file.
logolib: /Users/perry/src/ucblogo/ucblogo-code/Contents/Resources/logolib
$
Clearly there is something more I should be doing, but the README doesn't say what.
BTW, it would also be useful if the README mentioned all the prerequisites that need to be installed (for example, what versions of wxWidgets work? README does not say. I guessed that 3.2 would work but who knows.)
In the documentation it states that unmatched parenthesis (among other things) while reading a list will cause a continuation of input, but UCBLogo will accept a closing bracket. The closing bracket prevents UCBLogo from properly accepting a closing parenthesis. For example:
? PRINT [ Errors make me sad. :( ]
~ )
unexpected ')'
On Windows version 6.1, if I try to run a logo script from the command line, the script is not executed. Logo GUI is displayed instead (according to UCB Logo manual, this should not be the case), but nevertheless, the script is not running.
Steps to produce misbihavior:
print [This is my script] bye
"c:\Program Files (x86)\UCBLogo\ucblogo.exe" example.logo
Result: nothing is printed on console, nor in the GUI window.
There should be a command line argument to configure to enable object logo.
Would it be possible to avoid the annoying scroll of the command input window that happens when the current input position is at the bottom of the window and the up cursor key is pressed to recall the previous input? This makes it impossible to see the recalled line until the scroll bar is used to bring it back into view. (This happens with version 6.1 running on Linux. I haven't tested other situations.)
Edit: I've just tried UCB Logo using wxWidgets 3.0.5 (I was previously using 3.0.2) and this problem has gone away. Maybe it can be considered to no longer be a problem or perhaps a change could/should be made to make sure it doesn't happen, rather than leaving it to the whim of wxWidgets (if that is what is happening).
Look up PENREVERSE in the manual. You'll find a cross-reference to REVERSE, but the two have nothing to do with each other. (The first is in Graphics and the second is a list operation.) There are bunches like that.
Also, in the HTML version, the very first line is full of TeX commands.
When I have this procedure:
to proc
goto "tag2
print [this shouldn't print]
tag "tag1
print [this shouldn't print, either]
end
and then call it, I get an error. That is expected. What is surprising is the line that is output showing where UCBLogo thinks the error occurred.
EXPECTED: ---------------------------------------------
goto doesn't like tag2 as input in proc
[goto "tag2]
OUTPUT: -----------------------------------------------
goto doesn't like tag2 as input in proc
[print [this shouldn't print, either]]
When the text editor (the one called up by EDIT/EDALL) contains just a single character, deleting that character produces a pop-up warning with the message: assert "start >= 0 && end <= l" failed in SetStyle(): invalid range in wxTextCtrl::SetStyle
This occurs when GetLastPosition() returns zero in TextEditor::SetThisFont(...), in TextEditor.cpp.
Modifying this function to not call SetStyle(...) when GetLastPosition() returns zero seems to correct this bug.
Update: Avoiding the call to SetStyle(...) when GetLastPosition() returns zero isn't a perfect solution because now text entered at the very beginning of the first line is given the wrong typeface, but it's still better than the error message pop-up. Unfortunately, I don't have enough knowledge of programming with wxWidgets to know what else to try.
UCB Logo 6.1 running under Linux:
? print (random 10 20)
10
? print (random 10 20)
10
? print (random 10 20)
10
and so on...
I haven't had a chance to look into why this happens, but surely this is a simple oversight in the implementation of RANDOM.
My Son is learning Logo, following along with the Secret Coders book series. We've run into an issue with the edall
command in UCBLogo 6.2 on MacOS. We got to a point in the tutorials where they introduced TO
and suggested we enter the procedure using the EDALL
command. When we enter EDALL
, UCBLogo crashes.
I reproduced this behavior on two macs across three user accounts running two different OS X versions (High Sierra and Catalina). It also exists in UCBLogo 6.1.
If I first use the REPL interface and define a command there, then I'm able to use EDALL
to edit or add to it.
On a Raspberry Pi, exiting the EDIT
command results in ucblogo hanging and ignoring further user input.
This can be reproduced by giving the command EDIT "foo
and then pressing [ALT-A]
. (It also exhibits the bug with more typical usage patterns; but, this is the shortest path to reproduce). Control will not return to the command prompt and further keypresses will be ignored.
I have a code change which I believe addresses the issue - I'll submit a PR with it.
Raspbian 10.6 (buster) w/ wxWidgets 3.0.5
On MacOS when I try to select text one of two things happens:
The chances of which one will occur seem to be about 50/50.
On Windows I can select and copy, but when I paste to Wordpad the text is unrecognizable.
Finish the object oriented logo additions. These are in #ifdef OBJECTS
blocks.
On MacOS 12.4 Monterey, autoconf 2.71:
$ autoreconf --install
configure.ac:5: warning: The macro `AC_CONFIG_HEADER' is obsolete.
configure.ac:5: You should run autoupdate.
./lib/autoconf/status.m4:719: AC_CONFIG_HEADER is expanded from...
configure.ac:5: the top level
configure.ac:100: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:100: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:100: the top level
configure.ac:12: installing './compile'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
Makefile.am: installing './depcomp'
docs/Makefile.am:1: installing 'docs/texinfo.tex'
compiling generates a lot of warnings, especially with wxWidgets. Fixing them would be good.
When I type this:
.MACRO AA
STOP
END
AA
The application crashes. This occurs in both the MacOS and Windows versions. (My Fedora VM is broken so i can't test there right now.)
UCB Logo 6.1 running on Linux.
If the colour value given to FILLED is too large, Logo sometimes exits with SIGTRAP or SIGSEGV or generates a pop-up error message that reports './src/gtk/colour.cpp(241): assert "IsOk()" failed in GetColor(): invalid colour' and gives the options Stop or Continue. Selecting either of these then usually results in Logo exiting immediately with SIGTRAP or SIGSEGV. Occasionally, Logo does not exit straight away after selecting Stop or Continue, but apparently continues to function normally for a while and then without further warming terminates with SIGTRAP or SIGSEGV. The precise behaviour seems unpredictable.
I don't know exactly how large the colour value has to be to cause this problem, but I find that 500 seems not to and 600 has every time I've tried it. Example:
filled 600 [fd 100 rt 90 fd 150]
Clearly 600 is an unreasonably large value to give to FILLED, but I think it should not cause Logo to crash. I note that SETPC does not have this problem, values > 1000000 work perfectly well and get mapped to one of the colours.
P.S. I hope you don't mind me logging all these bugs and oddities. I've recently started experimenting with Logo and am finding quite a lot of rough edges in UCB Logo. Still, it's proving to be useful and educational.
? cslsload "fsm
? game 1
will clear the screen and display the word "accept" in lower case. Then what should happen is you type in letters from the set [abc] one at a time, and the letter you typed is echoed, and the "accept" may change to "reject" or back, depending on whether the string on the current line is accepted or rejected (game 1 accepts [ab]*), then when you type enter a capital ACCEPT or REJECT follows the string on that line and you start over with an empty string.
What does happen is that the letters you type don't appear, or maybe one letter appears but not the rest of them.
If a procedure similar to the following is defined
to stuff [ 1 ]
print [Any Logo you like here]
end
then UCB Logo exits with a segmentation fault as soon as the procedure is invoked.
Is this even a valid thing to define? My knowledge isn't good enough to be certain, but I suspect it might not be. Perhaps such a definition should be rejected in the first place.
The wxWidgets text cursor doesn't work on OSX or Linux.
The following cause a segfault:
to arcr :r :deg
repeat :deg [forward :r right 1]
end
to circles
repeat 9 [arcr 1 360 right 40]
end
I can reliably reproduce this problem with UCB Logo 6.1 running on Linux by doing the following:
Start Logo and define one or more things in it.
Use File -> Save Logo Session or File -> Save As (it doesn't matter which) to save the definitions to a file. This works as expected.
If you like, change/add some definitions in Logo or don't, it doesn't make any difference.
Use File -> Save Logo Session.
A new file containing the Logo definitions is created. The file previously created is not updated. The new file has a short name consisting of seemingly random characters. For example, Logo has just created a file called ' 9[K:?' for me. Occasionally no new file is created and neither is the previous file updated; perhaps this is because of an attempt to create a file with an invalid name.
I should think that use of Save Logo Session after the first one is either using an uninitialised buffer for the file name or the buffer that holds the file name following the first use is getting overwritten by something.
Sticking to using File -> Save As every time for saving avoids the problem.
Update: From some further brief experimentation, it seems this problem only happens if the first save is initiated from the File menu. If SAVE "filename is used from within Logo, then subsequent saves using SAVE or File -> Save Logo Session seem to work correctly.
I'm not exactly certain that this is an error. There are a lot of steps involved, and I don't know where to isolate the issue or if I have misinterpreted the intended actions. I am attempting to:
I expected to read the line with its modifications. What I got instead was the original line without its modifications.
make "f "TestFileIO6.txt
openwrite :f
setwrite :f
print [this was another test]
closeall
openupdate :f
setwrite :f
setwritepos 2
type "at
setread :f
setreadpos 0
make "a readrawline
closeall
erf :f
print :a
EXPECTED: ---------------------------------------------
that was another test
OUTPUT: -----------------------------------------------
this was another test
The building editor isnt helpfull since is lacking a visible cursor to me.
I tried setting the editor shell variable and using the seteditor command
but nothing change.
Alexandros
The following example (adapted from CSLS, second volume, pg 74-75) does not work using UCBLogo 6.2, Windows 10.
Welcome to Berkeley Logo version 6.2
? define "example [[] [print "first] [print "last]]
? example
first
last
But if the following is defined
? define "example lput [print "new] butlast text "example
UCB Logo exits (with a segmentation fault?).
Thank you.
Guido Gay
I'm running the latest release of UCBLogo on MacOS, using wxWidgets.
input:
show `[foo baz ,[bf [a b c]] garply ,@[bf [a b c]]]
expected output:
[foo baz [b c] garply b c]
actual output:
I don't know how to `
This also makes itself apparent when trying to use cascade
.
I learned from Dr. Harvey's personal page that UCBLogo is again under active development.
Great news, I must say!
Is there a goal to add Unicode support?
Anyway, based on my own experience, UCBLogo interpreter, in accompany with awesome three volumes of CSLS, are the best, richest and the most comprehensive environment available both for computer hobbyists who interested in Logo philosophy of education and for independent learners.
So many thanks to @brianharvey for great effort made to provide everyone with such excellent environment and to @jrincayc for taking over further development!
KEYP is defined to turn off echo and go into character-at-a-time input mode. That's the right thing for the single-character-command sorts of user interfaces I was writing in Logo at the time, but today I want to be in line mode (so the user gets Unixy line editing ability) and still find out if there's a line ready to read. So either it should have an optional input
(KEYP "LINE) or there should be a new LINEP predicate.
The README has some old information that needs updating before the release. Also, consider combining README and README.md
? cslsload "fsm
? game 1
Now select Stop from the Logo menu. Crashes.
I'm on MacOS 10.13.
I read Abelson's book and i wonder are there any libraries for ucblogo , like for
vector handling etc.
thanks.
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?
ucblogo --script file.lg
So we can use it on a box without a GUI system (like *NIX without X).
Thank you.
Calling SETWRITE with input consisting of a list with one word causes crash. Example:
SETWRITE [WORD]
The quit option in the File menu works, but there's also a quit option on the UCBLogo (leftmost) menu, which does nothing.
download Logo v6.1 from https://people.eecs.berkeley.edu/~bh/logo.html
intall in /Applications
click on UCB-Logo Icon
to "junk
pr "FOO
end
junk
FOO
po "junk
to junk
pr "FOO
end
ed "junk
to junk
pr "foo
end
close & accept changes
po "junk
to junk
pr foo
end
junk
I don't know how. to. foo in junk
ed "junk
to junk
pr "bar
end
close & accept changes
save f
erall
load f
po "junk
to junk
pr bar
end
ed "junk
to junk
pr "bar
end
When a list is run and then modified and then run again, the changes are ignored during execution.
Example 1:
make "a [print "hello]
run :a
.setbf :a ["hi]
run :a
EXPECTED: ---------------------------------------------
hello
hi
OUTPUT: -----------------------------------------------
hello
hello
Example 2:
make "a [show [hello]]
run :a
.setfirst :a "print
run :a
EXPECTED: ---------------------------------------------
[hello]
hello
OUTPUT: -----------------------------------------------
[hello]
[hello]
README.me says
The current version is 6.2
but the current version as of 4 months ago is actually 6.2.2. Maybe it would be simpler not to list the current version in the readme so that you don't have to keep updating it.
In a procedure, a command that doesn't output to OUTPUT (an error) is misdiagnosed in the error text.
For example:
to six
output print 6
end
six
EXPECTED: ---------------------------------------------
6
print didn't output to output
OUTPUT: -----------------------------------------------
6
You don't say what to do with nothing
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.