Thyme IDE

About advanced scenes, and the Thyme scripting language used in Algodoo.

Thyme IDE

Postby TheLeandroNex01 » Tue Feb 05, 2019 1:09 am

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)
https://github.com/LeandroSQ/thyme-ide

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") }
TheLeandroNex01
 
Posts: 11
Joined: Mon Jan 19, 2015 3:20 am

Re: Thyme IDE

Postby Xray » Thu Feb 07, 2019 5:15 am

TheLeandroNex01--

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?

Thanks.
User avatar
Xray
 
Posts: 500
Joined: Sun Jun 17, 2012 6:12 am
Location: USA

Re: Thyme IDE

Postby TheLeandroNex01 » Thu Feb 07, 2019 8:40 pm

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

Why?]
* It has syntax highlight (So every word will be coloured accordly to its category) https://en.wikipedia.org/wiki/Syntax_highlighting
* It has auto-complete (So you start to type and it will give you some suggestions)https://en.wikipedia.org/wiki/Autocomplete#In_source_code_editors
* 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)https://en.wikipedia.org/wiki/Lint_(software)
* 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.
Image

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!.
TheLeandroNex01
 
Posts: 11
Joined: Mon Jan 19, 2015 3:20 am

Re: Thyme IDE

Postby Ken3344 » Fri Feb 08, 2019 12:02 am

This confused me for a bit, until I realized that it wasn't actually thyme! :lol: Anyways, what could this be used for?
Hello my name is Kenlimepie. I'm an Algodoo Enthusiast, and Marble Racer. I run a Youtube channel which is about Algodoo Marble Racing, but I am not afraid to design new ideas in this program. https://www.youtube.com/c/kenlimepie
Ken3344
 
Posts: 53
Joined: Mon Sep 05, 2016 8:44 pm

Re: Thyme IDE

Postby TheLeandroNex01 » Fri Feb 08, 2019 7:10 am

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


or
https://www.youtube.com/watch?v=VimVsslMEPk


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.
TheLeandroNex01
 
Posts: 11
Joined: Mon Jan 19, 2015 3:20 am

Re: Thyme IDE

Postby FRA32 » Fri Mar 15, 2019 11:23 pm

I noticed that this IDE has auto-complete for entity-related values, but no Intelli-sense regarding nested value's(such as app.grid..., scene.my..., 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.
FRA32
 
Posts: 227
Joined: Wed Dec 03, 2014 9:51 pm

Re: Thyme IDE

Postby s_noonan » Sun Jan 31, 2021 11:40 am

This is awesome. Very impressive. This must have taken some effort. It only took me 2 years to stumble across this. Tried it out with thousands of lines of code. Here are some things I found:
1. Fails on ++ when adding element to an array.
2. Fails on \" when escaping quotes.
3. Warns of missing ';' at end of line even if '}' at end of line.
s_noonan
 
Posts: 61
Joined: Tue Mar 30, 2010 2:25 am

Re: Thyme IDE

Postby Kitesurfer » Wed Feb 10, 2021 11:28 am

Nice work!
Kitesurfer
 
Posts: 10
Joined: Thu Jan 07, 2021 5:27 pm

Re: Thyme IDE

Postby TheLeandroNex01 » Fri Feb 19, 2021 5:14 pm

Hello there, it's been a while huh
So you can imagine how was I when I miss clicked a bookmark and got into algodoo's forum again, and saw that my post was still active

Sorry, I completely forgot about this project
So much stuff going on, job, college, stuff like that

I'm willing to take a look at those bugs s_noonan pointed out, if you could only send me the source code you've tried for debugging purposes it would definitely help!

About FRA32's comment, well I will take a look on this if it would be possible to implement intellisense on the project, but I cannot promise you that will be available anytime soon, since it's a lot of work and I would be doing all by myself
And regarding the parenthesis on the if statements, it was probably because of the nested if statements. I think it would be pretty nice to actually have some "settings screen" that would allow some customization regarding semantics, hints and even themes for the Editor maybe in the future.

Only for my own curiosity, does anybody still uses the editor? Is it stable?

It feels nice to revisit this post, thank you all for your time.
Best regards, Leandro a regular Brazilian once adicted to Algodoo
TheLeandroNex01
 
Posts: 11
Joined: Mon Jan 19, 2015 3:20 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 2 guests

cron