Page 1 of 1

Thyme IDE

PostPosted: Tue Feb 05, 2019 1:09 am
by TheLeandroNex01
Hello guys, how are you going?

Let me tell ya a beautiful history first!
There was a time that i used to spent the hole day in algodoo, practicing my Scripting Skills, and i know, the design 'thing' isn't my area.
Well, past week i decided to download Algodoo again, just to show for a friend of mine, and that made me use the Software again, now i'm 17 years old, i already do work on this area, i'm Android developer (Thanks to Algodoo) and one of my passions is Compilers and Interpreters. Using that knowledge i made a special thing, a Thyme script editor (Yup, you did read that right)

No more Notepad++ 'cos we got Syntax validation too, using a "Compiler like" structure of code.

Why did i made this? I was trying to make a fullly functional drone to test an idea for my term paper, and i got frustated 'cos algodoo itself doesn't has a decent syntax error log. So i decided to build this (For emocional reasons too)

Enough of writing, here it is the source code (And online demo)

Feel free to contribute <3

(Just to explain, i do force to use ';' on the end of every statement and also, when using the code you need to do only assignments)
So a correct code would be:
Code: Select all
_P = 0; _I = 0; _D = 0; _lastAngle = 0; _leftThrusterForce = 0; _rightThrusterForce = 0;
// Or
postStep = (e)=>{
// Inside of a function you can do anything
// But outside, you are only able to declare variables

Instead of just pasting the function's inner code, like:
Code: Select all
(e)=>{ Console.print ("Hello World") }

Re: Thyme IDE

PostPosted: Thu Feb 07, 2019 5:15 am
by Xray

I looked over your source code, and WOW! You must have spent many hours working on it. So, how would it benefit a mediocre programmer like myself who creates all of my Algodoo scenes using Thyme script? And how difficult is the learning curve for an average programmer with average experience? Did you create a tutorial?


Re: Thyme IDE

PostPosted: Thu Feb 07, 2019 8:40 pm
by TheLeandroNex01
Xray :) thanks for commenting i appreciate that!

Well, it's an editor for Thyme, so instead of writing scripts in Algodoo or Notepad++ you would use my editor instead

* It has syntax highlight (So every word will be coloured accordly to its category)
* It has auto-complete (So you start to type and it will give you some suggestions)
* It has Algodoo's properties already defined (So you can write "angVel" and it would know that is a keyword, highlight that and auto-suggest for you)
* It has syntax checking (So if you, let's say, forgot a ')' in some line, the editor will point that out for ya)
* It has suggestions enabled (So it will remember you to use ';' in the end of every line, for instance)

This you would not get from Algodoo, and some of this functionalities, neither in Notepad++.

While pasting a invalid Script into Algodoo's will give you:
Code: Select all
WARNING - Caught exception: line 1'=': Bad placement of =: Too many tokens on left hand side (was 2, should only be one), Source\script\Parser.cpp:241: class SharedPtr<class script::CodeBlock> script::Parser::Parse(const class std::vector<class script::Token,class std::allocator<class script::Token> > &, class SharedPtr<class script::Reflected>)\n Parse error: line '=': Bad placement of =: Too many tokens on left hand side (was 2, should only be one)

My editor will give you this "Annotations", and hovering the mouse over it will give a "hint" of what is wrong with your code.

So, instead of lookin trough the lines and try to guess what is wrong, the editor will do that for you!

Maybe i gonna make a video teaching how to use this. I guess that this project could help the Algodoo's gods like X-Ray, Kilinich, S-noonan (and others) to make better scenes even faster!.

Re: Thyme IDE

PostPosted: Fri Feb 08, 2019 12:02 am
by Ken3344
This confused me for a bit, until I realized that it wasn't actually thyme! :lol: Anyways, what could this be used for?

Re: Thyme IDE

PostPosted: Fri Feb 08, 2019 7:10 am
by TheLeandroNex01
First of all, just warning you guys... My english isn't good, at all (and it gets worse when i try to speech and not write). So please be pacient with me :)

I did post a video on Youtube showing the basic concept of this project


EDIT: I did some transcriptions of what i did say on this video. So if you could not understand a thing of what a said. Just enable CC.

Re: Thyme IDE

PostPosted: Fri Mar 15, 2019 11:23 pm
by FRA32
I noticed that this IDE has auto-complete for entity-related values, but no Intelli-sense regarding nested value's(such as app.grid...,, sim.frequency, e.normal, etc.). These would certainly be additions that would make this IDE perfect. Unfortunally I never had any experience with making an entire IDE and my Javascript skills are pretty weak, so unfortunally I can't really offer you my help for these things, should you decide to implement them.

Another thing I noticed: Why does the IDE suggest the placement of paranthesises around IF-Conditions? It doesn't really make sense, as it would be similar to suggestiong the placement of paranthesises around equations like angle = (math.pi/2+math.atan2(...)). They only should be placed if it is required for chaining multiple boolean equations.