Code Monkey home page Code Monkey logo

self's People

Contributors

adamspitz avatar bystroushaak avatar cfbolz avatar davidungar avatar doublec avatar dram avatar krono avatar leeduhem avatar openenglishbible avatar rrthomas avatar russellallen avatar somethingelseentirely avatar spdegabrielle avatar zenspider avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

self's Issues

Where's the debugger?

Handbook says that a debugger will be opened when an error is triggered, but I can not find it, only an error message is displayed, see screenshot for more detail.

Did I do anything wrong?

screenshot

VM core dumped on OS X

Crash report here: https://gist.github.com/dccb07871d358d3815ce

I was using Demo.snap with the latest OS X Self build. I think it was triggered by an accidental mouse click I made somewhere, but I wasn't paying too much attention at the time, sorry. Hope the crash report helps -- looks like the backtrace might be useful.

Webserver.self fileServlet is prone to directory travesal attack

The webserver exampleServlets fileServlet code is prone to a directory traversal attack. Setup with:

webserver startOn: 9090
a: webserver exampleServlets fileServlet copy
a baseDirectory: '/tmp/test.html'
webserver registerServlet: a At: 'test'

The following demonstrates the attack:

$ curl http://127.0.0.1:9090/test/test.html
....test.html is shown....
$ curl http://127.0.0.1:9090/test/../../etc/passwd
..../etc/passwd is shown....

Working around this is somewhat problematic. The realpath function can be used to canonicalize a filename such that symbolic links, path traversal, etc is removed. The servlet should use this, or something like it, then check that baseDirectory (also canonicalized) is the prefix of that path.

What is privacy specification?

"3.2. Slot descriptors" in handbook says:

A slot descriptor consists of an optional privacy specification, followed by the slot name and an optional initializer.

But I can not find further description of "privacy specification", so what is it?

Building a Self-inspired JavaScript prototypal system

This is just a request for information: JavaScript supports prototypal inheritance and techniques, indeed JS was built with Self in mind.

What I'm looking for is how to transfer "the magic" Self has of friction-free, very fluid development.

The system is an Agent Based Modeling framework, modeled after NetLogo. Here's our work so far:
http://agentscript.org
.. and we're upgrading from its current CoffeeScript form to the latest JS: e6, so moving to prototypal methods would be reasonable.

But I'm not sure how to properly use prototypal methodologies to achieve Self's breakthrough in direct usage .. "thinking in Self".

Any pointers?

Self doesn't find arialBold (4.4)

I cannot see any text in the UI, here's the output from a Demo run on Arch Linux.

chi ~ % Self -s /usr/share/self/0/Demo-4.4.snap
for I386:  LogVMMessages = true
for I386:  PrintScriptName  = true
for I386:  Inline = true
for I386:  SICDeferUncommonBranches = false (not implemented)
for I386:  SICReplaceOnStack = false (not implemented)
for I386:  SaveOutgoingArgumentsOfPatchedFrames = true

  Welcome to the Self system!  (Version 4.4)


Copyright 1992-2009 AUTHORS, Sun Microsystems, Inc. and Stanford University.
See the LICENSE file for license information.

Type _Credits for full credits.

VM version: 4.1.13

Adjusting VM for better UI2 performance:
  _MaxPICSize: 25
  _Flush
"Self 1" unknown font: arialBold
^C
  ----------------Interrupt-----------------
  Waiting:
    <0> waiting process: perProcessGlobals prompt mainInputLoop             
  ------------------------------------------
  Select a process (or q to quit scheduler): q
  Scheduler shut down.
  ------------------------------------------
VM# 
chi ~ % locate arial
/usr/share/fonts/TTF/arial.ttf
/usr/share/fonts/TTF/arialbd.ttf
/usr/share/fonts/TTF/arialbi.ttf
/usr/share/fonts/TTF/ariali.ttf

What are `printStringState` and `printStringName`?

In comment of defaultBehavior printString, printStringState and printStringName are mentioned, but no implementor or sender of them can be found.

Objects that print should understand the messages printString, and printStringSize:. Children of the lobby may implement just the message printString and inherit reasonable behavior for the other three messages. (Or may implement printStringState, or printStringName.)

BTW, what are those other three messages?

Handbook typos

Hello,
I've been working through the Self handbook that's posted on selflanguage.org, and think I've found a couple typos that are important:

1. On the langref page, near the top, under the Code section. The code sample is rendered as
1 to: 5 \* i By: 2 \* j Do: [\|:k \| k print ]
I'm new, but I don't believe the 's are valid?
Sorry, just noticed that was fixed in source.

  1. On the morphic page, about halfway down,
    To set the module for the new morphs home slot, invoke “Show annotation” on the ovalMorph slot in the globals object, type “ovalMorph” in the module field, and accept the change (Figure 11).
    Should it be ovalModule instead of ovalMorph as show in the pictures?

(recent change) fonts are unhappy on Linux.

I don't think it's just fonts. Here's an album with two screenshots: https://imgur.com/a/sKTE9

The first image is with the world built from commit 7aef6e8 and the second from d521340

The snapshot I built yesterday (before I filed #44) works fine, as does Clean.snap (both with today's vm).

Also, I read #7 but I'm not sure how to influence the font the system wants to use. I see verdana hard-coded into a bunch of places in the code.

gaps in doco

OK. Thanks to your help I got the VM built. Now what?

It seems to me that there's a huge gap in the doco regarding actually using self, esp out of the build directory.

I can't go from building the VM to running self via the doco. Additionally, I have no idea how to use the instructions on how to build the world. Here is some of my confusion illustrated:

10071 % find . -type f -name Self
./controller/osx/Self.app/Contents/MacOS/Self
./vm/Self.app/Contents/MacOS/Self

The first one wants to use X11 for some reason. The second doesn't. Why are they different but named the same?

Running the second one:

10072 % open vm/Self.app/
The application cannot be opened because its executable is missing.

and if I run the actual binary:

10074 % ./vm/Self.app/Contents/MacOS/Self 
Self Virtual Machine Version 4.1.13, Mon 13 Jan 14 15:40:57 Mac OS X i386 (4.5.0-1-g1a5f8ac)
Copyright 1989-2003: The Self Group (type _Credits for credits)

for I386:  LogVMMessages = true
for I386:  PrintScriptName  = true
for I386:  Inline = true
for I386:  SICDeferUncommonBranches = false (not implemented)
for I386:  SICReplaceOnStack = false (not implemented)
for I386:  SaveOutgoingArgumentsOfPatchedFrames = true
VM# desktop open
A lookup error happened while sending the message
    desktop
to
    lobby.
Subsequently, the lookup error message
    undefinedSelector:Receiver:Type:Delegatee:MethodHolder:Arguments:
was sent to
    <0>,
and was also not understood, causing the process to be aborted by the Self VM.

#0 (<error>:1): desktop = ( | self* = lobby. delegatee = nil. selector = 'desktop'. | 
"undefined selector error;
this method was automatically generated by the VM."
 )


#1 (<stdin>:1): <top level expr> = ( | self* = lobby. | desktop open )

or:

VM# _Spy: true
false <1>: ( | parent* = lobby. | )
VM# 'worldBuilder.self' _RunScript
A lookup error happened while sending the message
    primitiveFailedError:Name:
to
    'worldBuilder.self'.
Subsequently, the lookup error message
    undefinedSelector:Receiver:Type:Delegatee:MethodHolder:Arguments:
was sent to
    <0>,
and was also not understood, causing the process to be aborted by the Self VM.

#0 (<error>:1): primitiveFailedError:Name: = ( | self* = 'worldBuilder.self'. :arg1 = 'ENOENT'. :arg2 = '_RunScript'. delegatee = nil. selector = 'primitiveFailedError:Name:'. | 
"undefined selector error;
this method was automatically generated by the VM."
 )


#1 (<stdin>:1): <top level expr> = ( | self* = lobby. | 'worldBuilder.self' _RunScript )

This one was done because I overlooked the prose and went straight to the instructions. Having step 1 includecd objects would have helped.

Even more confusing:

10083 % find . -type f -perm -100
./.git/hooks/applypatch-msg.sample
./.git/hooks/commit-msg.sample
./.git/hooks/post-update.sample
./.git/hooks/pre-applypatch.sample
./.git/hooks/pre-commit.sample
./.git/hooks/pre-push.sample
./.git/hooks/pre-rebase.sample
./.git/hooks/prepare-commit-msg.sample
./.git/hooks/update.sample
./CMakeFiles/2.8.12.1/CMakeDetermineCompilerABI_C.bin
./CMakeFiles/2.8.12.1/CMakeDetermineCompilerABI_CXX.bin
...
./website/static/images/img01.jpg
./website/static/images/img02.jpg
./website/static/images/img03.jpg
./website/static/images/spacer.gif
10084 % find . -type f -perm -100 | wc -l
    1918

1900+ files are executable in the checkout. Why are source code and jpgs marked executable in the checkout? This just obscures discovery.

Naming and residence of mirrors

I kind of think following sentences in Mirrors section in handbook is not correct now.

The file init.self moves these prototypes to the mirrors subcategory of the prototypes category of the lobby namespace. Because mirrors is not a parent slot, the names of the mirror prototypes always include the “mirrors” prefix.

"browse all size" fails when Morphic is loaded

I have build a new world using the worldBuilder script and chose to load Morphic and declined loading the X11 UI. Then without starting Morphic, I have executed

browse all size

Which leads to a Segmentation Fault. When I do not load the Morphic UI and run the command in a bare Self world the message works.

I am running the Linux VM from the homepage on a Ubuntu 15.10.

Naming objects in morphic is broken

Create a new object and get an outliner on it.

Double click the object title so that a text entry box opens.

Fill in a name, click the green 'accept' button.

Naming fails with walkback.

Outliner title can not be changed

If I double-click the title of an outliner, an editor will be shown, but after I change the content and click accept button, title do not change.

Error after typing Ctrl-D in Self terminal shell (Linux)

In Linux, typing Ctrl-D in Self terminal shell cause following error and leave shell unusable:

"Self 1" To debug in ui2, type:      selfProcessModel debugProcess: 0 as
to debug in console, type:  attach: 0
to dump stack, type:        0 as printError.
[Tue Oct 18 13:25:27 2016] error -- Error: EOF reached before min transfer limit while trying to read file "<stdin>". Receiver is: traits unixFile stdin.

After reading code in traits inputLoop, I think the original intention would be quit Self silently.

Inner methods are no longer supported?

When trying the first example in Language Reference in handbook, I encountered an "inner methods" error.

Code to run:

( | slot1. slot2 | 'here is some code' printLine )

Error reported:

inner methods are no longer supported, slot-list within a sub expression is not legal.

Is LangRef needed to be updated?

BTW, this error message seems to be a bit obscure, what is inner method?

'worldBuilder.self' _RunScript doesn't work out of the box

I downloaded the DMG file for Mac OS X and followed the instructions as written here. Unfortunately, I couldn't get the world to build. Here is the error message I got:

VM# 'worldBuilder.self' _RunScript
A lookup error happened while sending the message
        primitiveFailedError:Name:
to
        'worldBuilder.self'.
Subsequently, the lookup error message
        undefinedSelector:Receiver:Type:Delegatee:MethodHolder:Arguments:
was sent to
        <2>,
and was also not understood, causing the process to be aborted by the Self VM.

#0 (<error>:1): primitiveFailedError:Name: = ( | self* = 'worldBuilder.self'. :arg1 = 'ENOENT'. :arg2 = '_RunScript'. delegatee = nil. selector = 'primitiveFailedError:Name:'. | 
"undefined selector error;
this method was automatically generated by the VM."
 )


#1 (<stdin>:1): <top level expr> = ( | self* = lobby. | 'worldBuilder.self' _RunScript )

I am running on the El Capitan version of OS X, version 10.11.1.

How to export changes?

I'd like to contribute some image-level source back to you, but I'm not familiar with self's workflow. In smalltalk, I'd have a "changes" file on the side and could just send you that. In self? No clue. I saw the "Changed Modules" browser and it did list my edit, but it didn't provide a diff or chunk and I mistakenly(?) wrote the change out. Now it lists nothing and I don't know how best to grab my stuff and prepare it for you.

Travis build failed

Travis build failed with following message:

Unable to find image '32bit/ubuntu:14.04' locally

Pulling repository docker.io/32bit/ubuntu

docker: Tag 14.04 not found in repository docker.io/32bit/ubuntu

webserver.self example servlets don't have a parent prototype for methods

The example servlets in the webserver.self code don't have a parent object with the methods. The methods are instead directly in the servlet object itself. This has the issue that when changes are made to the example serverlet code it is not propogated to servlets that are already instantiated. Example:

bootstrap read: 'webserver' From: 'applications'
webserver startOn: 9090
webserver registerServlet: (webserver exampleServlets fileServlet copy) at: 'test'
...modify fileserverlet handleUrl method...
...our servlet at /test will not have the changes...

I think the methods should be implemented in a parent object to faciliate updating/debugging a live server. Thoughts?

Building on OSX

I'm a bit stumped:

10027 % clang --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
10028 % git clean -fdx
Removing CMakeCache.txt
Removing CMakeFiles/
Removing Makefile
Removing cmake_install.cmake
Removing configureVmDate.cmake
Removing incls/
Removing includeDB
Removing tools/CMakeFiles/
Removing tools/Makefile
Removing tools/cmake_install.cmake
Removing vm/CMakeFiles/
Removing vm/Makefile
Removing vm/Self.app/
Removing vm/_glue/
Removing vm/cmake_install.cmake
Removing vm/src/CMakeFiles/
Removing vm/src/Makefile
Removing vm/src/cmake_install.cmake
10029 % CC=clang CXX=clang++ cmake .
-- The C compiler identification is Clang 5.0.0
-- The CXX compiler identification is Clang 5.0.0
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- The ASM compiler identification is Clang
-- Found assembler: /usr/bin/clang
-- Preparing for Mac OS X on i386
-- Preparing Self VM 4.1.13 (build 4.5.0)
-- Using Quartz plaform windows.
-- Configuring for build level optimized
-- Found Curses: /usr/lib/libcurses.dylib  
-- Configuring done
-- Generating done
-- Build files have been written to: /MyApplications/dev/self4.5/self
10030 % CC=clang CXX=clang++ cmake --build .
Scanning dependencies of target makeDeps
[  1%] Building CXX object vm/CMakeFiles/makeDeps.dir/build_support/makeDeps.cpp.o
/MyApplications/dev/self4.5/self/vm/build_support/makeDeps.cpp:65:11: fatal error: 'stdio.h' file not found
# include <stdio.h>
          ^
1 error generated.
make[2]: *** [vm/CMakeFiles/makeDeps.dir/build_support/makeDeps.cpp.o] Error 1
make[1]: *** [vm/CMakeFiles/makeDeps.dir/all] Error 2
make: *** [all] Error 2

The same is true for GCC. I've got the latest version of xcode w/ the command line tools installed.

I just built ruby as a sanity check.

vm: find_prior_reference() is very slow

I profiled the buildworld step and I get the impression that find_prior_reference() is very slow:

    20.70%     Self  Self               [.] find_prior_reference                                                                                                                  
     6.60%     Self  Self               [.] addrDesc::isPrimitive()                                                                                                               
     3.99%     Self  Self               [.] addrDesc::isOop()                                                                                                                     
     3.72%     Self  Self               [.] addrDesc::isCall()                                                                                                                    
     3.68%     Self  Self               [.] PendingSelfSignals::check(SelfSignal)                                                                                                 
     3.68%     Self  libc-2.18.so       [.] __strlen_sse2_bsf                                                                                                                     
     3.58%     Self  Self               [.] addrDesc::referent(OopNCode*)                                                                                                         
     3.39%     Self  Self               [.] OopNCode::switch_pointers(oopClass*, oopClass*, BoundedListTemplate<nmethod*>*)                                                       
    20.70%     Self  Self               [.] find_prior_reference                                                                                                                  
               |
               --- find_prior_reference
                  |          
                   --20.67%-- space::switch_pointers_in_region(oopClass*, oopClass*, oopClass**, oopClass**)
                             |          
                             |--11.90%-- space::switch_pointers(oopClass*, oopClass*)
                             |          |          
                             |           --11.71%-- newGeneration::switch_pointers(oopClass*, oopClass*)
                             |                     universe::switch_pointers(oopClass*, oopClass*)
                             |                     Map::define(oopClass*, oopClass*)
                             |                     slotsMapDeps::define(oopClass*, oopClass*)
                             |                     oopClass::define(oopClass*)
                             |                     oopClass::define_prim(oopClass*, void*)

find_prior_reference() seems to be doing a linear scan. I made it log the number of iterations on each call. Here is the top 10 from a run of 50M samples:

count | steps
17922279 31
  28254 14
  14895 3
  10968 40
  10178 10
   7569 26
   6351 16
   6008 7
   2181 18
   2179 28

numpy tells me that the mean average is about 82 iterations with a standard deviation of > 4600.

The bulk of the calls goes through those 31 iterations but the variance is high: there are nearly 3,000 find_prior_reference() calls that iterate over 100,000 or more elements and nearly 500 scanning over half a million elements.

failed to load `core.snap`

Loading core.snap failed with following error:

#9 (<error>:1): x11Globals = ( | self* = <7>. delegatee = nil. selector = 'x11Globals'. | 
"undefined selector error;
this method was automatically generated by the VM."
 )


#10 (../objects/core/hosts.self:1097): graphicsSystemGlobals = ( | self* = <7>. |  
            x11Globals )


#11 (../objects/core/hosts.self:1417): setGraphicsDependentGlobals = ( | self* = <9>. mir <- <10> "nil". |  
            mir: (reflect: globals).
            "Use frozenDefine to keep module cache clean."
            [graphicsDependentGlobals]. "browsing"
            mir frozenDefine: (mir copyAt: 'graphicsDependentGlobals' 
                                PutContents:  reflect: osForThisHost graphicsSystemGlobals. ).
            self )

Will module be set automatically when adding new slots?

In a footnote in 6. How to Program in Self in handbook, it says that:

If you examine the slot’s annotation (available via the slot menu) it will show that the system has guessed that the new slot (named “me”) should be saved in the “programmingExamples” module, and that instead of saving its actual contents, the slot should just be initialized to the string ‘Gumby’.

But currently no module is set, not sure which one goes wrong, doc or code?

Argument slots cannot be parent slots?

"3.1.6. Methods" says "an ordinary method always has an implicit parent argument slot named self", but "3.2.4. Parent slots" says "Argument slots cannot be parent slots."

Apparently there is conflict between them, then which one is correct?

Clipboard support in X11

Currently, Self use cut buffers to support copy&paste in X11, but KDE (maybe other some other WMs) do not support it.

I have to use xcutsel to manually transfer contents between cut buffers and selections.

P.S. xcb can be used to monitor cut buffers.

See https://en.wikipedia.org/wiki/X_Window_selection for more details about clipboards in X11.

Mention `saveAs:` in handbook

I think including a brief description of saveAs: in handbook is helpful, e.g. in "How to build the world" section, and also quitNoSave or quit.

I learned those methods from scripts in release directory.

`log info: sequence elems` cause "log dispatcher" process crash

When evaling log info: sequence elems in shell, log dispatcher process will be crashed with following backtrace:

## Stack trace for process <0>
##____Rcvr___Selector/Block__________File:line__________Method-holder/location_
#5    <2>    asByte                  <error>:1          nil
#6    <3>    at:Put:IfAbsent:        core/string:619    traits string
#7    <3>    at:Put:                 core/indexable:687 traits mut...Indexable
#8    <4>    [r at: k P...k: k succ] core/indexable:706 [] in copyContaining:
#9    <4>    value:With:             core/d...avior:419 defaultBehavior
#10   <5>    [b value: ...) With: i] core/indexable:276 [] in do:
#11   <5>    value:With:             core/d...avior:419 defaultBehavior
#12   <6>    [block val...i + step.] core/i...ation:168 [] in to:B...itive:Do:
#13   <7>    [value ifF... b value.] core/block:600     [] in whileTrue:
#14   <7>    loop                    core/block:258     traits block
#15   <8>    whileTrue:              core/block:600     traits block
#16   <9>    to:ByPositive:Do:       core/i...ation:166 traits integer
#17   <10>   [^ to: end...Do: block] core/i...ation:136 [] in to:By:Do:
#18   <11>   ifTrue:False:           core/boolean:170   true
#19   <11>   ifTrue:                 core/boolean:237   traits boolean
#20   <9>    to:By:Do:               core/i...ation:136 traits integer
#21   <9>    to:Do:                  core/i...ation:177 traits integer
#22   <12>   do:                     core/indexable:275 traits indexable
#23   <13>   copyContaining:         core/indexable:704 traits mut...Indexable
#24   <12>   asString                core/c...ction:174 traits collection
#25   <14>   ansiString              core/systemLog:202 log entry parent
#26   <15>   [stderr wr... '), '\n'] core/systemLog:683 [] in handle:
...

Fails to build with gcc on Linux

I was trying to build git master HEAD.

I'm sorry, I'm not a C++ or cmake expert (but I do speak C and autotools, so I should be able to do any tests you'd like!). The end of my build goes:

Linking CXX executable Self
/usr/bin/ld.bfd.real: cannot find -lX11
/usr/bin/ld.bfd.real: cannot find -lXext
collect2: error: ld returned 1 exit status
make[2]: *** [vm/Self] Error 1
make[1]: *** [vm/CMakeFiles/Self.dir/all] Error 2
make: *** [all] Error 2

I have libX11-dev installed on my Ubuntu 14.04 system, so I can't see why it would be a problem, except that, being arch-specific, it's at /usr/lib/x86_64-linux/gnu/libX11.so. However, this isn't normally a problem when linking C programs (it's in the compiler's normal link path).

Is "^" an operator or not?

In handbook 3.4.5. Operators, ^ is said to be reserved and is not an operator, but in adjacent Examples ^ is included, so is ^ an operator or not?

Self Tutorials

Hey, thanks so much for maintaining this project! It's running just fine on OS X 10.11.1 El Capitan. I'm really interested in the self development and programming model -- and I have a very slight passing familiarity with smalltalk. Where's a good place to get started learning how to use this thing? What's happened to the intro displayed at 1:44 in this video? https://www.youtube.com/watch?v=YR4pFk0xj9w

world: cannot create image with no ui support

This happens for me on both Linux and OS X:

VM# 'worldBuilder.self' _RunScript.
reading worldBuilder.self...
<snip>
Load UI2 (Morphic)? (y/N)
> n
Load UI1 (X11 only)? (y/N)
> n
verifying newgen: eden from to oldgen: old0 z p r S v O m N M i  done
Starting: Refilling module cache...
Warning: 1 slot exists without belonging to any module.
To examine these slots,
1. Select "Changed Modules" from the middle-button background menu,
2. Select "Expatriate Slots" from the middle-button menu on the "Changed Modules" object.
Finished: Refilling module cache
"Self 0" quit
Save to Snapshot before quitting? 
  y => save, then quit
  n => quit without saving
  RET => cancel
Response: y
Snapshot file name? [RET => Snapshot] 
Saving object code in snapshot is currently disabled.

    1. Enable
    2. Disable
[Type the number of your selection]
1
Snapshot compression is currently disabled.

    1. Enable
    2. Disable
[Type the number of your selection]
1
Code cache size (code only) ? [RET => 16777216] 
Change object heap sizes y/[n] ? 
Starting: Thoroughly cleaning up memory......
No 'releaseObjects' slot found in a slots object.
To debug in ui2, type:      selfProcessModel debugProcess: 5 as
to debug in console, type:  attach: 5
to dump stack, type:        5 as printError.
"Self 1" 5 as printError.
No 'releaseObjects' slot found in a slots object.
## Stack trace for process <5>
##____Rcvr___Selector/Block__________File:line__________Method-holder/location_
#5    <6>    releaseObjects          <error>:1          a slots object         
#6    <7>    [desktop r...seObjects] core/s...balls:489 [] in releaseObjects   
#7    <8>    ifTrue:False:           core/boolean:42    false                  
#8    <8>    ifFalse:                core/boolean:223   traits boolean         
#9    <9>    releaseObjects          core/s...balls:486 memory                 
#10   <10>   [emptyTras...ckCleanup] core/s...balls:848 [] in thoroughCleanup: 
#11   <10>   onNonLocal...rn:IfFail: core/block:333     traits block           
#12   <10>   onReturn:IfFail:        core/block:358     traits block           
#13   <10>   onReturn:               core/block:345     traits block           
#14   <11>   [('Startin...ntLine ].] core/stdin:368     [] in show...dy:While: 
#15   <8>    ifTrue:False:           core/boolean:42    false                  
#16   <8>    ifFalse:True:           core/boolean:230   traits boolean         
#17   <12>   showEverybody:While:    core/stdin:367     userQuery              
#18   <9>    thoroughCleanup:        core/s...balls:845 memory                 
#19   <13>   saveThenQuit            core/shortcuts:218 shell shortcuts        
#20   <14>   [^saveThenQuit]         core/shortcuts:169 [] in quit             
#21   <15>   ifTrue:False:           core/boolean:170   true                   
#22   <15>   ifTrue:                 core/boolean:237   traits boolean         
#23   <13>   quit                    core/shortcuts:162 shell shortcuts        
#24   <13>   <top level expr>        <the prompt>:1     shell                  
a process(suspended process: quit >>> No 'releaseObjects' slot found in a slots object.)
"Self 2" desktop
a slots object
"Self 3" ui
No 'ui' slot found in shell.
To debug in ui2, type:      selfProcessModel debugProcess: 16 as
to debug in console, type:  attach: 16
to dump stack, type:        16 as printError.

The filename abbreviating is somewhat unhelpful but I gather the error originates in the releaseObjects method in objects/core/systemOddballs.self.

It has a 'is there a desktop object?' check but I suspect it also needs a 'does the desktop object have a releaseObjects method?' check.

Or is the expected behavior that there should be no desktop object when no UI has been selected?

Transparency Bug

Transparency Bug

When you have a transparent morph that fills the entire screen, the background and morphs behind it will no longer show and thus the transparency effect breaks.
This is due to funky 90's Optimization, when drawing was very expensive.

  • filterMorphsIn:Intersecting:Into:RedrawBoxesInto:Offset
  • drawMorphs:Intersecting:On:Offset

are the buggers here.

drawMorphs: is lazy and asks filterMorphsIn: for the morphs that should be drawn because they intersect the current screen. The morphs to be drawn are put into the filterMorphsIn:Intersecting:Into: morphsToDraw list.
The return type is actually a boolean indicating that a rectangular morph fills the entire screen( if returning false). This decides for drawMorphs weather it is worth to draw the background or not, since in the old days there was no transparency in self.

Possible fix:
Throw the boolean out and let filterMorphs return a list of morphs to draw, this would require a change of the method name but I think it's worth it. Also change the logic of it so that it does not stop when there is a screen filling morph like it does now.
Throw out the legacy optimization in drawMorphs.

Cheers Jan

Usage of `fileStream`?

When searching for file operations, I find object fileStream, but just can't figure out the purpose of it.

Where is Self's license?

There are many comments that refer to the "LICENSE" file for license information, but I cannot find such a file.

vm: high cpu usage in terminal

To reproduce: look at top(1) when ./vm/Self is running in another terminal. It always hovers at 5-10% CPU usage on my machine.

Here is what I think happens: The SIGALRM signal handler that's installed by what I suspect is the scheduler (profiler?) seems to run at a 100 Hz frequency. When you start a shell, all those signals cause the fread() that is called by InteractiveScanner::read_next_char() to keep returning from and re-entering the read() system call.

When inspected with strace, it looks like this:

--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
rt_sigreturn()                          = 3
read(0, 0x9d6627f, 1)                   = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
rt_sigreturn()                          = 3
read(0, 0x9d6627f, 1)                   = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
rt_sigreturn()                          = 3
read(0, 0x9d6627f, 1)                   = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
rt_sigreturn()                          = 3
read(0, 0x9d6627f, 1)                   = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
rt_sigreturn()                          = 3
read(0, 0x9d6627f, 1)                   = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---

Or with dtrace:

  3    507                  sigreturn:entry
              libsystem_c.dylib`OSAtomicAnd32
              0xffffffff
              libsystem_c.dylib`_sread+0x23
              libsystem_c.dylib`__srefill1+0x22
              libsystem_c.dylib`__fread+0xe1
              libsystem_c.dylib`fread+0x42
              Self`InteractiveScanner::read_next_char()+0x48
              Self`Scanner::get_char()+0x45
              Self`Scanner::is_done()+0x1a
              Self`run_the_VM()+0x266
              Self`ReturnOffTopOfProcess

  3    931              read_nocancel:entry
              libsystem_kernel.dylib`__read_nocancel+0xa
              libsystem_c.dylib`_sread+0x23
              libsystem_c.dylib`__srefill1+0x22
              libsystem_c.dylib`__fread+0xe1
              libsystem_c.dylib`fread+0x42
              Self`InteractiveScanner::read_next_char()+0x48
              Self`Scanner::get_char()+0x45
              Self`Scanner::is_done()+0x1a
              Self`run_the_VM()+0x266
              Self`ReturnOffTopOfProcess

(ad infinitum)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.