Page 6 of 12
Re: Custom DSP Code 2 (comunity project)
Posted: Fri Mar 20, 2015 3:56 pm
by Youlean
Thanks KG for huge effort to finish this project...
BTW, how it is going word editor for the code generator? Did you found solution for text coloring?
Re: Custom DSP Code 2 (comunity project)
Posted: Fri Mar 20, 2015 4:20 pm
by KG_is_back
Youlean wrote:Thanks KG for huge effort to finish this project...
BTW, how it is going word editor for the code generator? Did you found solution for text coloring?
unfortunately no progress with the code editor... If someone makes a text editor, that can display editable coloured text, I will happily add an output to the compiler to send expected data for the coloured text display. DSPcode2 will have to go without a code-editor until then.
I've almost finished adding functions to the compiler and I will post it here for beta testing, probably today.
Re: Custom DSP Code 2 (comunity project)
Posted: Fri Mar 20, 2015 5:36 pm
by Youlean
Well, I have made this
Customizable Selector that I think that I can modify to draw each letter with different color. There is one limitation though, draw loop can not draw more than 1000 characters at the time, but I could chain multiple of them together... Only question mark would be the performance, but I think that it should be OK, because selector is quite fast. Actually, if you can break the code into a peaces like
max(in,in1) to break to
max be in first string line, than (in,in1) in second string line, this could be speed up the process even more, but if you can not do this, you could output float array with numbers that could determent characters colors.
Also, I am not sure if you would like to use green editor for the your project, because now is everything going towards Ruby and ASM...
Re: Custom DSP Code 2 (comunity project)
Posted: Fri Mar 20, 2015 11:43 pm
by KG_is_back
Here it is

I need a lot of beta-testers!!!
Some features I've promised are still missing, but they may be added in future updates (namely reading/writing by pointer, inlineASM and declaring functions in the code itself)...
Hopefully there will not be too many bugs. BTW When compiler gives ruby errors, it's usually because you have a typo in the code.
Re: Custom DSP Code 2 (comunity project)
Posted: Sat Mar 21, 2015 12:43 am
by RJHollins
Might this start a mini course in DSP coding right here in FS forums ??
Like a real beginner course
If I had, or knew ANY DSP coding ... I might be able to even test this DSP Code2

Re: Custom DSP Code 2 (comunity project)
Posted: Sat Mar 21, 2015 8:58 am
by tulamide
That's your baby, I can tell from looking at the code. You've put so much effort in it! I like how you use regexp and how you got more and more experienced with Ruby during development - and that you finally tried to use indentation, which makes the code much more readable
You're so right when it comes to debugging. When you say "the debugger", I ask "what debugger?" The watch method is just that. I can watch a value. I'm missing features like stopping execution at certain code lines, having a way to see a variable's content throughout execution and not just at a certain point in time via watch, step execution (for example during loops) and much more.
But to help you in debugging, here's a simple, yet effective tip:
'watch' uses the to_s method to show the object's content. This method is like any other method, so you can create your own and it will be used instead of the fallback from the underlying class. You could use this to get whatever you want to inspect when calling "watch compiler". Best of all is, that you can format the resulting string just as you prefer. Here's a simple example:
- to_s.fsm
- (481 Bytes) Downloaded 1016 times
EDIT: You might also think about using a module instead of a class and then bind the module to the executing Ruby edit instance (the one that now calls compiler) using "extend modulename" (now all module methods are part only of that instance of the ruby edit class). But then you would also need to implement a reset-method that is called each time a new string is "inputted".
Re: Custom DSP Code 2 (comunity project)
Posted: Sat Mar 21, 2015 3:54 pm
by djbrynte
how about making some assembler modules?
Re: Custom DSP Code 2 (comunity project)
Posted: Sun Mar 22, 2015 12:45 am
by KG_is_back
tulamide wrote:That's your baby, I can tell from looking at the code. You've put so much effort in it! I like how you use regexp and how you got more and more experienced with Ruby during development - and that you finally tried to use indentation, which makes the code much more readable
You're so right when it comes to debugging. When you say "the debugger", I ask "what debugger?" The watch method is just that. I can watch a value. I'm missing features like stopping execution at certain code lines, having a way to see a variable's content throughout execution and not just at a certain point in time via watch, step execution (for example during loops) and much more.
But to help you in debugging, here's a simple, yet effective tip:
'watch' uses the to_s method to show the object's content. This method is like any other method, so you can create your own and it will be used instead of the fallback from the underlying class. You could use this to get whatever you want to inspect when calling "watch compiler". Best of all is, that you can format the resulting string just as you prefer. Here's a simple example:
to_s.fsm
EDIT: You might also think about using a module instead of a class and then bind the module to the executing Ruby edit instance (the one that now calls compiler) using "extend modulename" (now all module methods are part only of that instance of the ruby edit class). But then you would also need to implement a reset-method that is called each time a new string is "inputted".
Yeah, I've learned a lot of things along the road (and discovered regexp, which basically saved me from making hideously large string comparison lines.). Most of the compiler uses (nested) arrays and strings, whuch should have a specific format, so most common error is the "no []method for nil" or "no + method for nil" when inputs are not in the correct form (like a value in array is missing or something). that also stops the execution, so the .to_s method would probably not execute. The only way I know about how to find those errors is to put a return with some default value at random places and localize the problem.
I'm not planning to do massive changes to the compiler anymore, except those updates mentioned above if I even get to those. I really want to take some time off, focus on music, school and my dog. This project took me literally days (day=24h of work time) - not just coding, but also inventing many of the concepts from a scratch (because it was usually easier than spending months on research of the topic). I've thought about it while eating breakfast, while driving car or while taking bath. Hell, I've even worked on it in my dreams (I mean I literally had dreams of me coding this thing... do you guys have that too or am I getin' nuts? ).
Now please guys, beta-test!! Meanwhile I'll be eating whipped cream with blackberries and recovering "code mana". I have another project in my mind

Re: Custom DSP Code 2 (comunity project)
Posted: Sun Mar 22, 2015 12:57 am
by RJHollins
(I mean I literally had dreams of me coding this thing... do you guys have that too or am I getin' nuts? ).
Maybe

But I've experienced the same, and not just FS stuff.
There have been plenty of nights were 'sleeping' was more torturous than getting back up to go work or test an idea.
Re: Custom DSP Code 2 (comunity project)
Posted: Sun Mar 22, 2015 1:19 am
by martinvicanek
Me too! Maybe we're all nuts?
