Welcome to %s forums

BrainModular Users Forum

Login Register

fastscript debugging

I need help on a Patch
Post Reply
jjbonkers
Member
Posts: 35
Contact:

Unread post by jjbonkers » 16 Feb 2014, 23:26

Hi I'm working on a patch that contains a fastscript. Is there any way to debug the script such as to easily output the value of a variable or set breakpoints and step through the script?

Thx

J

ceasless
Member
Posts: 330
Contact:

Unread post by ceasless » 17 Feb 2014, 11:45

One quick way is:

Code: Select all

writeln('value of x is '+inttostr(x));
Note the awkward use of '+' as concatenation even while the language demands explicit casting of integer to string.

Regarding breakpoints and other debuggerness, I haven't the foggiest clue.

I would love to see Lua adopted at some point. I know other users were asking for Python, but in my opinion that is a huge mistake (heavier runtime, slower execution). Lua is the clear winner for application scripting, especially in performance critical applications.

jjbonkers
Member
Posts: 35
Contact:

Unread post by jjbonkers » 17 Feb 2014, 14:48

Thanks ceasless, will give that a try.

Yeah I find that lack of debug options is adding quite a lot of time to getting the thing to work especially for more complex scripts. Personally I prefer Pascal style language coz I know it better than Lua but whatever will work with breakpoints/watches is good...

ceasless
Member
Posts: 330
Contact:

Unread post by ceasless » 19 Feb 2014, 19:36

Well the advantage of Lua is that if you are having an issue it should be an actual logic error you have made in your program. With Pascal it is also as likely to be some missing piece of 'boilerplate'. In other words, in a Lua solution there are fewer lines to look over, and less code in general that you can make a typo or other syntactical error in.

When I say 'boilerplate' I'm thinking for instance of looping over arrays to set each value to zero. Or looping over arrays using a 'for' statement and iterating a counter at all. But these are basic 'static' versus 'dynamic' talking points. For scripting purposes, 'dynamic' won this debate quite some time ago, in the Dark Ages when the Internet adopted Perl and hasn't looked back since (though Perl code now feels almost archaeological in a similar way to Pascal).

All that said, in the real world Usine's scripting abilities are really amazing when you consider the capabilities of the platform. The stuff you can do in a small amount of code is stuff that would take a lot of effort to do almost anywhere else (including patches!).

So I do not want to seem like I am badmouthing Usine, or Pascal, or the Pascal scripting in Usine. It just seems like a slightly odd fit to script such a dynamic and expressive environment in such a strict and formal (see 'boilerplate') language. There are likely real benefits to keeping scripting in Usine statically typed, though. It's easy to appreciate the complexity of all these wires and signals flying around and still doing what's expected.

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests