I have attempted to explore several solutions for improving TSL readability. However, using JavaScript’s native syntax to write should theoretically result in the least syntactic noise. This prototype tool may help if want to check the limit.
———————————————————————————————————–
I’ve removed the previous prototype and will re-implement a more robust version with preprocessing capabilities when I have the energy.
Just pay attention that the current TSL allows mixing JS calculations and TSL calculations and this is a hidden gem if used correctly. For example:
sum(value,i+2)
will calculate i+2 in Javascript and then generate code to add value and the result of i+2. This is just an oversimplified example that sometimes calculations are done in JS before they are passed to TSL.
Here is a more advanced example:
if(a>2) {...}
It implements conditional TSL code (controlled by JS). If JS if is translated to TSL If this conditionality is completely lost.
Your prototype is interesting, and has a potential. I hope you could develop it to capture the essence of TSL without loosing its full functionalities.
There are some minor bugs, you might want to fix (e.g. try 1+2).
Do you plan to support the prefix notation too? This might solve some issues: