Zygorithm wrote:
Are there any gigantic performance leaps planned?
Async will make it so it doesn't totally crash when it tries to load giant projects, but it probably won't get that much faster (I'm not sure, though—it depends how optimized the code is right now).
Hardmath123 wrote:
I wonder how Scratch gets it so fast—I'm guessing (as n said) they use asynchronous loading.
They use Squeak, which can do manual world cycles inside of long-running scripts, so they just do a few of those. They also don't have to convert image and sound data to a different format.
Offline
nXIII wrote:
Async will make it so it doesn't totally crash when it tries to load giant projects, but it probably won't get that much faster (I'm not sure, though—it depends how optimized the code is right now).
Asynchronous loading can affect the user's perception of speed, but it does nothing to change the actual time requirement. So it works (subjectively) when the loading time is dominated by the running time and can be spread out thinly over the latter. When the user's experience is dominated by loading time, async won't help at all. I suppose one could try to take advantage of multicore processors by having the loading and running truly in parallel.
It's still a worthy effort, not for gargantuan projects, but to help me convince Jens to import the tool library all the time on startup.
Gargantuan projects shouldn't crash, though. By all means please find and fix whatever's causing that.
Offline
JS is single-threaded (I'm ignoring web workers because we don't use them), so when the serializer is running, user input is neither received nor handled and the display is never updated. Loading asynchronously would mean that we could continue receiving user input and updating the display (and allowing the browser to run its UI for non-multi-process browsers) while the serializer ran. It would do very little to change the load time (it might make it a tiny bit slower because each morphic.js display cycle takes some processing power), but would give the user a sense of the elapsed and remaining time as well as the total progress, and make Snap! feel more responsive.
I also said that if I made the (de)serializer asynchronous I'd rewrite it from scratch with speed as the primary concern, which could make it substantially faster.
To this end, I need some reasonably large projects which load in the current serializer, as well as some that fail to load due to errors and some that hang Snap! indefinitely. Contributions would be greatly appreciated
Offline
Anyone got any idea why i'm getting this error message?
I'm writing a text-based Snap! language in JS based on the [scratchblocks] syntax
Offline
joefarebrother wrote:
Anyone got any idea why i'm getting this error message?
Can you post the raw JS file? Much easier to debug that way.
You could also try JSLint; I sometimes find that a different error message, that helps find the problem.
I'm writing a text-based Snap! language in JS based on the [scratchblocks] syntax
Cool!
Last edited by blob8108 (2013-04-18 11:51:57)
Offline
Missing semicolon at end of line 30?
Offline
Hardmath123 wrote:
Missing semicolon at end of line 30?
One of the most common reasons for a program not functioning: A missing semicolon.
Last edited by nathanprocks (2013-04-18 12:13:53)
Offline
Hardmath123 wrote:
Missing semicolon at end of line 30?
There, hardmath spotted it! I was going crazy looking at the tiny text
Offline
nathanprocks wrote:
Hardmath123 wrote:
Missing semicolon at end of line 30?
One of the most common reasons for a program not functioning: A missing semicolon.
Also another reason I use Python. Semicolons are irritating for many reasons.
Offline
technoboy10 wrote:
another reason I use Python. Semicolons are irritating
Python has semicolons too, you know...
Offline
blob8108 wrote:
technoboy10 wrote:
another reason I use Python. Semicolons are irritating
Python has semicolons too, you know...
Yes, but not as many as C.
Offline
joefarebrother wrote:
Anyone got any idea why i'm getting this error message?
http://i.imgur.com/ixhNiuf.png
I'm writing a text-based Snap! language in JS based on the [scratchblocks] syntax
FYI lines 23-30 can be replaced with something like this:
code = code.replace(/([:)>\]] )([<>])( [:(<\[])/g, function (_, left, sign, right) { // Woo, regex emoticons return left + (sign === '<' ? '<' : '>') + right; });
(if you need dynamic regexes, the constructor is RegExp, not regExp)
Also, use forEach instead of for…in for looping through arrays (for…in is for objects, and even then it has problems [and even the solutions to those problems have problems]).
Last edited by nXIII (2013-04-18 16:28:30)
Offline
Hardmath123 wrote:
Missing semicolon at end of line 30?
Ah, thanks! it works now!
I'll share it as soon as i've written up the syntax and examples
Offline
@Hardmath I took another look at the giant xml file, and here are two few things that might help with the size of files that snapin8r generates:
- Don't pretty-print the XML. Whitespace alone accounts for 903,240 characters in that file (over 5% of the 17,424,524 total)
- base64-encode images rather than url-encoding them—it's much more efficient
Offline
I´m comunicating with a robot using the BYOB. The robot sends sensors' information and BYOB returns actions to the motors. But, when I use blocks that I've created to control de motor, using sensors values as conditions, the BYOB doesn´t atualize the sensors' values in the same speed that when I send them to BYOB. In this way I have a huge delay in the action of the motors. I think it´s because when the BYOB decodifies the mensage, with sensor's values, it takes a big delay.
Any suggestions of what can I do?
Does anyone had this problem?
Offline
bharvey wrote:
blob8108 wrote:
should I submit a github pull request?
Sure! Just don't put any colon-Ps in the code or Jens will get mad...
Offline
Question: Is coding late into the night a good idea?
Offline
blob8108 wrote:
Question: Is coding late into the night a good idea?
Depends, what're you programming?
Offline
technoboy10 wrote:
blob8108 wrote:
Question: Is coding late into the night a good idea?
Depends, what're you programming?
I just meant generally, as a kind of lifestyle thing...
Offline
blob8108 wrote:
Question: Is coding late into the night a good idea?
If you have school, it's a really bad idea. Otherwise, go ahead (but beware of awkward family situations ).
Offline
blob8108 wrote:
Question: Is coding late into the night a good idea?
It depends how important it is that your code actually work. Teams building life-critical software typically require programmers to quit work and go home at 5pm like normal people. On the other hand, if you're building the first prototype of some new idea, banging away at it round the clock for three days can foster great creativity, I think.
A friend of mine in college once decided to live on a 28-hour day because 28*6=24*7 and by rotating phase he'd be awake at the same time as each of his friends at least once in the week.
Offline
nXIII wrote:
If you have school, it's a really bad idea.
Only if you intend to attend classes. (Don't tell your parents I said that.)
But I can attest that it is a bad idea to stay up for 72 hours and then go to a class and sit in the front row. (I wasn't always as sensible as I am today.)
Offline