This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1751 2010-09-13 20:54:19

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

nXIII wrote:

does anyone have a really fast dictionary class?

Here's my hashtable project.  Constant time lookup and insert.  But, as Jens says, not worth it unless you have 100-odd items probably.  (I haven't done timing measurements to find the exact break-even point.)


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#1752 2010-09-13 21:38:05

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

nXIII wrote:

does anyone have a really fast dictionary class?

Here's my hashtable project.  Constant time lookup and insert.  But, as Jens says, not worth it unless you have 100-odd items probably.  (I haven't done timing measurements to find the exact break-even point.)

that project gives me an error when I click on the stage...

EDIT: Didn't happen on the second time...

Last edited by Lucario621 (2010-09-13 21:38:30)


http://i.imgur.com/WBkM2QQ.png

Offline

 

#1753 2010-09-13 22:41:31

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Lucario621 wrote:

that project gives me an error when I click on the stage...

Doesn't happen for me even the first time.  smile   Was it just a red Error balloon, or a Smalltalk error?


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#1754 2010-09-14 14:49:06

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

nXIII wrote:

does anyone have a really fast dictionary class?

Here's my hashtable project.  Constant time lookup and insert.  But, as Jens says, not worth it unless you have 100-odd items probably.  (I haven't done timing measurements to find the exact break-even point.)

Ah. Okay, then, I just need some more functions! (And maybe some operators)


nXIII

Offline

 

#1755 2010-09-14 14:56:55

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: BYOB 3 - Discussion Thread

dictionary class


what is it?


You can now reach me on Twitter @johnnydean1_

Offline

 

#1756 2010-09-14 15:57:50

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

A class which models a dictionary...?


nXIII

Offline

 

#1757 2010-09-14 19:40:57

rubiks_cube_guy238
Scratcher
Registered: 2009-07-02
Posts: 100+

Re: BYOB 3 - Discussion Thread

nXIII wrote:

Yes, but that depends how big the function list is! It might not be so reasonable after all!  tongue
The problem is that I also used associative lists for variables, so they're a little slow, but that's the only dictionary that's used at runtime, the rest is compiled (YAY!).
I just need a few more than 3 or 4 functions, and maybe some special-casing with assignment/operators (I haven't made operators yet  tongue )
Sadly, no lambdas yet, but they're on the list! Remarkably, they would be quite easy to implement, it just means a little more work by the parser.
EDIT: Actually, the work would be in the evaluator because it would just leave the compiled code as it is instead of evaluating it.

I made a little compiler thingy at one point. What I did for the variables was that while the code is compiled, it replaces every variable with a number index for a list called 'tempVars'. How would it know that it was a variable and not a number? It used a command called VAR: to access a variable.

Hopes this helps, and I can't wait to see this!


The glass is never half full nor half empty; it is twice as large as it needs to be.

Offline

 

#1758 2010-09-14 20:55:08

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

rubiks_cube_guy238 wrote:

nXIII wrote:

Yes, but that depends how big the function list is! It might not be so reasonable after all!  tongue
The problem is that I also used associative lists for variables, so they're a little slow, but that's the only dictionary that's used at runtime, the rest is compiled (YAY!).
I just need a few more than 3 or 4 functions, and maybe some special-casing with assignment/operators (I haven't made operators yet  tongue )
Sadly, no lambdas yet, but they're on the list! Remarkably, they would be quite easy to implement, it just means a little more work by the parser.
EDIT: Actually, the work would be in the evaluator because it would just leave the compiled code as it is instead of evaluating it.

I made a little compiler thingy at one point. What I did for the variables was that while the code is compiled, it replaces every variable with a number index for a list called 'tempVars'. How would it know that it was a variable and not a number? It used a command called VAR: to access a variable.

Hopes this helps, and I can't wait to see this!

Mine doesn't compile the variables, it just adds them when they're declared at runtime.


nXIII

Offline

 

#1759 2010-09-15 01:17:38

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

New release 3.0.4:

Jens wrote:

this release introduces the following changes, new features and bugfixes:

new features:
-------------------

1) block variables have been eliminated

The new block editor doesn't have a variables pallette pane any more. Instead of the old "make a block variable" button you should use the SCRIPT VARIABLES block mechanism instead. Block variables in existing projects are automatically migrated into script variables when BYOB reads the project file, so you should not encounter any compatibility issues, else it's a bug.

As a result I've also been able to make the block editor's default / minimum extent smaller.

Please note that you can use any number of SCRIPT VARIABLE blocks at any position within a single script. Also (accidentally) declaring a script variable more than once does no harm.

2) inline variable templates can now be deleted individually

Variable templates in lambda blocks (formal parameters) and in the SCRIPT VARIABLES block can now be deleted individually via their context menu, i.e. you can now remove var blobs "in the middle" of the list.

3) turning script variables into inputs

As an alternative way of declaring inputs you can also drag and drop script variables onto custom block prototypes (and then delete them from the SCRIPT VARIABLES block or rename them there)

bug fixes:
-------------

- variadic inputs of type unevaluated boolean now show up correctly
- variadic inputs of type predicate, reporter, command or C-Slot now save their contents correctly
- inputs slots of type unevaluated boolean no longer cause "funny" blocks to appear when their type gets changed
- embedded reporters with attached comments no longer cause program crashes when saved
- changing a new custom block's shape no longer triggers an internal error message
- some more I've forgotten right now  :-)

Thanks for all the testing and the excellent bug reports! Some RETURN block related issues remain to be fixed soon in a more experimental release.

- Enjoy!


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#1760 2010-09-15 14:42:23

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

1) block variables have been eliminated

The new block editor doesn't have a variables pallette pane any more. Instead of the old "make a block variable" button you should use the SCRIPT VARIABLES block mechanism instead. Block variables in existing projects are automatically migrated into script variables when BYOB reads the project file, so you should not encounter any compatibility issues, else it's a bug.

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

Look, ever had this happen to you?
You want to make a big class, with a few instance variables at the top. You're making the outer reporter lambda and you've just made ten really big methods. Now you need to reference the variables "Foo", "Bar", "Baz", "H", "J", and "K", but to do that you have to scroll all the way back to the top SIX TIMES and then let autoscroll take you back down very slowly. Script variable blocks need to either hover at the top of the script, but fixed there so scrolling down still yields a visible "Script variables" block, or they need to add their variable blocks to a palette. I find it very annoying to scroll up, down, up, down just to get variable blocks.


nXIII

Offline

 

#1761 2010-09-15 16:16:26

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hmm, nXIII, good point.

    But inputs and script variables are lexically scoped and the block editor is modeless. This opens up ways around having to "scroll all the way to the top SIX TIMES and then let autoscroll take you back down very slowly", because for those kinds of variables it doesn't matter where they originate from. Instead all that counts it their name.

For example,

    (1) you can deposit any number of copies of inputs or script variables in the main window's scripting pane or in another block editor instance, before scrolling to their destination.

    (2) you can also duplicate the SCRIPT VARS block to somewhere else (the main window) and drag off variable blobs from there (and afterwards delete the SCRIPT VARS block again).

    (3) you can drag in any other same-named input from either another open block editor or from another lambda block (THE SCRIPT WITH INPUTS / THE BLOCK WITH INPUTS), script variable or even upvar of another custom block instance.

    (4) come on - autoscrolling isn't that slow  smile  (should I make it faster?)


Jens Mönig

Offline

 

#1762 2010-09-15 16:19:12

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

True, I didn't think of using other block vars blocks.

Jens wrote:

(4) come on - autoscrolling isn't that slow  smile  (should I make it faster?)

Maybe it should scroll depending on the distance to the edge of the pane. Or does it already do that?


nXIII

Offline

 

#1763 2010-09-15 16:29:43

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Jens wrote:

it doesn't matter where they originate from. Instead all that counts it their name.

If this is true then we might as well give them a Panther-style variable blob with text input.  (I guess this is an argument for scope coloring; it could be a brown blob.)

But as I said on bugzilla I think the whole scope business needs to be rethought.

Meanwhile, what I generally do is find a nearby reference and control-click-duplicate it.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#1764 2010-09-15 16:30:56

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

nXIII wrote:

You're making the outer reporter lambda and you've just made ten really big methods.

Sample projects gratefully accepted.  smile


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#1765 2010-09-15 16:38:25

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Jens wrote:

(1) you can deposit any number of copies ...

(2) you can also duplicate the SCRIPT VARS block ...

(3) you can drag in any other same-named input ...

These are much too clever.  We can't rely on kids inventing such techniques.  There's something to nXIII's idea of a hovering SV block, or else maybe the Variables palette should have a variable blob with a pulldown like the one in the SET block.

Last edited by bharvey (2010-09-15 16:39:05)


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#1766 2010-09-15 16:40:39

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Ooh, if you turn scope coloring on, the pulled-down list of variables should have the top half against an orange background and the bottom half brown.  smile


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#1767 2010-09-15 17:06:33

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Ooh, if you turn scope coloring on, the pulled-down list of variables should have the top half against an orange background and the bottom half brown.  smile

even better, make the preview icons be images!


nXIII

Offline

 

#1768 2010-09-15 17:30:47

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: BYOB 3 - Discussion Thread

This looks like 3.1 in planning...

I'm excited!  big_smile

Offline

 

#1769 2010-09-15 17:54:17

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Sample projects gratefully accepted.  smile

By imitating JFK " The question is to ask what Byob can't make for you,  but to ask what you can already do with Byob..."

At this time Byob is very comprehensive programming language, a genial cross-fertilization between Scratch, Lambda and First-class languages like Lisp and Logo. It has a tremendous potential of applications in a large range of domains. Byob "raises the ceiling and widen the walls" of Scratch-like applications.

Of course it lacks a lot of features used by everyone with many other languages. The list of "absent" features of Byob can be endless : Byob is not done for flle management, not for real-time applications, not for the kind of tinkery used in Windows HMI like pick-lists, buttons, choice-lists, check boxes. And so what ?

Look at the million of applications already written  with Scratch which is much less powerful, comprehensive and versatile than Byob... There is already "a lot of grain to grind"...

Offline

 

#1770 2010-09-15 18:17:48

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

xly wrote:

Look at the million of applications already written  with Scratch which is much less powerful, comprehensive and versatile than Byob... There is already "a lot of grain to grind"...

Yup, I agree.  I guess this is part of the thinking behind Jens's anti-modding rant  smile  on that other forum.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#1771 2010-09-15 18:47:42

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

What if a collapsable Script Variables pane was brought back but with the add/remove buttons taken out...instead it just contained blobs for all the variables you've created with [script vars]. It sounds like interface bloat, but NXIII is right. Blobs in general are a pain to work with, and anything that makes them hard to find isn't doing anything to streamline the program. Just my two cents.  smile


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#1772 2010-09-15 18:48:34

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Jens's anti-modding rant

I wouldn't really consider it anti-modding, it was more specifically against the type of modding which seems to be popular currently.


nXIII

Offline

 

#1773 2010-09-15 18:51:26

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Also, the 3.04 link that was posted apparently still links to 3.03!


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#1774 2010-09-15 22:00:43

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

fullmoon wrote:

Also, the 3.04 link that was posted apparently still links to 3.03!

Are you sure?  It seems right to me!


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#1775 2010-09-15 22:02:01

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

fullmoon wrote:

What if a collapsable Script Variables pane was brought back but with the add/remove buttons taken out...

Yeah, that might be a good compromise.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

Board footer