Migrating from EZ-Script to JavaScript

Description

How to move your code from EZ-Script to JavaScript. JavaScript offers faster execution and more features.

Why?

Why migrate from EZ-Script to JavaScript? The answer is performance and functionality. While EZ-Script appears straightforward, it is very similar to JavaScript. The most significant differences will be outlined in this tutorial. However, JavaScript can organize commands in groups, called classes. These command groups make JavaScript more organized and easier to find the correct command that you're looking for.

Performance

The Synthiam implementation of JavaScript in ARC is fast... very fast! It outperforms EZ-Script by a significant magnitude. Take for instance, a benchmark between the two languages by counting to 1,000,000.

JavaScript (1.1 seconds)

User-inserted image

EZ-Script (2 minutes, 5 seconds)

User-inserted image


ARC Pro

Upgrade to ARC Pro

Don't limit your robot's potential – subscribe to ARC Pro and transform it into a dynamic, intelligent machine.

#1  

Wow that is totally great info to know, thanks!

#2  

Thanks for this Tutorial @DJ. It will be invaluable as I change over my many scripts from EZ Script to JavaScript! I'm excited to see how my robot's arm servo react to the new faster language. I have some pretty complex scripts (for me anyway. LOL).

PRO
Synthiam
#3  

I think you'll find that the new scripts you write will be even smaller and faster. Probably easier to read as well. I can always help you change some over if you post one. That'll give you examples of how the difference would be.

#4   — Edited

But just to be clear, the EZ scripts should still mostly work in Arc? I tried 2 that still worked no conversion. Just slower most likely.

PRO
Synthiam
#5  

Yeah, EZ-Script works in ARC. This is a tutorial to help people migrate to a faster and more feature-rich language.

#6  

Wow @DJ. That's an amazing offer. Thanks! I'll post one soon. I think I have covid now and need to get past that first. Can't quite thing straight right now. LOL.

PRO
Synthiam
#7  

Oh boy, it seems everyone is getting covid these days. I'm feeling left out. I hope you're doing well and binge-watching a lot of tv! Drink soup and dream about robots.

#8  

Thanks DJ. I'm coming to the end of it I hope. Feeling better. Don't feel left out. Only good thing about this is now I have some antibodies for a while. LOL. Stay healthy!