Board index FlightGear Development Nasal

Dedicated Nasal IDE or editor?

Nasal is the scripting language of FlightGear.

Dedicated Nasal IDE or editor?

Postby awexome » Sun Apr 08, 2012 1:13 pm

Splendid

Thanx for your reply. I feel more confident to use this little handy code-spanner more often. I will double check in the Nasal for more references, I like to rely on fail-proof techniques in the long run.

Hooray wrote in Sun Apr 08, 2012 10:24 am:
Frankly, it really doesn't matter... Like I said, I wouldn't waste time stylistically optimizing code which is already short and readable enough.


It may be a small thing for some other people, but actually, I value such styling of seemingly little significance. I perceive less code for same functionality as better styling and optimization. They help keep my code and coding style small and little, which helps me to see clearly the big bugs that may be hiding around the ends of the code line :)

One is always careful when writing complex algorithm in Nasal - no errors could mean serious algorithm errors lurking around in dense code. Recently, I was thinking if the Nasal developers are considering making an IDE or adapting an existing suitable one (based on perl, python, etc.) to help mere mortals like like-self to code and live longer, away from the fears of 'missing and long lost' semi-colons and closing brackets. One accidental bump of the keyboard, the mouse gets a life of its own, and then a nice and well planned afternoon is ruined -

awexome.
When one thinks, one looks up to the skies.
I inspire, think, and seek the skies ------- mijiny <aka awexome[2138]>
awexome
 
Posts: 111
Joined: Sat Jan 21, 2012 11:24 am
Location: GMT
Callsign: SHA7
Version: GIT
OS: GNU

Re: Wind Correction Angle

Postby Hooray » Sun Apr 08, 2012 6:55 pm

One is always careful when writing complex algorithm in Nasal - no errors could mean serious algorithm errors lurking around in dense code. Recently, I was thinking if the Nasal developers are considering making an IDE or adapting an existing suitable one (based on perl, python, etc.) to help mere mortals like like-self to code and live longer, away from the fears of 'missing and long lost' semi-colons and closing brackets. One accidental bump of the keyboard, the mouse gets a life of its own, and then a nice and well planned afternoon is ruined -


There's Nasal syntax highlighting support available for a number of IDE/editors: http://wiki.flightgear.org/Howto:_Synta ... _for_Nasal

You are using Linux, right? Then, I'd suggest to check out the vim mode. Which is pretty useful:

Image

I am not sure, if we really need a completely new IDE for Nasal - most Nasal scripts are only useful in the context of the host application (i.e. FlightGear).

So, one could just as well look into extending the Nasal console to turn it into a little embedded IDE (i.e. saving/loading of snippets (trivial to implement), and possibly even some basic syntax highlighting for Nasal keywords (hacking PLIB's PUI GUI code)).

We actually talked about this a while ago: viewtopic.php?f=30&t=15276&p=150116&hilit=console+saving#p150096

So, you'd get tons of features (and native FG support) by using FG+XML GUI + Nasal as the framework for your own little "IDE". Using an external editor would just provide syntax highlighting support, but otherwise little FG/Nasal awareness or other support.

The only competing approach I could possibly see is using the AlgoScore modules. AlgoScore has cross-platform GUI bindings for GTK and tons of GUI scripting glue code, so that we could create our own little Nasal-driven GTK editor which could even connect to FlightGear via the property/telnet interface and provide "live" support.

Image
Image

AlgoScore also comes with its own built-in Nasal editor, too:

Image

A GUI editor based on the Nasal/GTK bindings, could natively run as part of FG, but also as an external editor.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11774
Joined: Tue Mar 25, 2008 8:40 am

Re: Wind Correction Angle

Postby awexome » Sun Apr 08, 2012 7:59 pm

Nice. While holding off the early celebration of this find, I hope it works for me.

awexome.
When one thinks, one looks up to the skies.
I inspire, think, and seek the skies ------- mijiny <aka awexome[2138]>
awexome
 
Posts: 111
Joined: Sat Jan 21, 2012 11:24 am
Location: GMT
Callsign: SHA7
Version: GIT
OS: GNU

Re: Wind Correction Angle

Postby awexome » Sun Apr 08, 2012 8:26 pm

Nice.

Gahhh.. Vim , you say. I'd rather use a bash shell :).

It is my opinion that Vim slows me down - I prefer to spend scarce time solving a problem than trying to remember the name of the tool that may be used to solve it :) But I know from experience it is very versatile and flexible for may application areas.
Notepad++, gEdit and Kate(KDE) are good but not quite so for debugging, for me.. I had hoped for something more Nasal specific. Algoscore may do the magic for me.

I am really trying to ignore the fact that I strongly feel dissatified using basic text interface for debugging code - any code. That alwasy leaves me feeling quite utter ... well, unaccomplished :)

awexome.
When one thinks, one looks up to the skies.
I inspire, think, and seek the skies ------- mijiny <aka awexome[2138]>
awexome
 
Posts: 111
Joined: Sat Jan 21, 2012 11:24 am
Location: GMT
Callsign: SHA7
Version: GIT
OS: GNU

Re: Wind Correction Angle

Postby Hooray » Sun Apr 08, 2012 8:42 pm

Sorry, I think you misunderstand: AlgoScore is NOT a Nasal text editor or IDE, it's simply another host application (with Nasal scripting support) which happens to include a Nasal editor. I only mentioned it because it would be possible to reuse some of the modules and code available in AlgoScore in order to create a new standalone GUI editor, which wouldn't just "support Nasal", but which could be written in Nasal itself - because the GUI (GTK) bindings are fully exposed to scripting space, so there's basically no need to write C or C++ code, and the code is multi-platform code too.

Just have a look here: http://svn.gna.org/viewcvs/algoscore/trunk/lib/
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11774
Joined: Tue Mar 25, 2008 8:40 am

Re: Wind Correction Angle

Postby awexome » Sun Apr 08, 2012 9:35 pm

Hi,

I C. Well, I hope something more suitable for me will come along shortly.

awexome.
When one thinks, one looks up to the skies.
I inspire, think, and seek the skies ------- mijiny <aka awexome[2138]>
awexome
 
Posts: 111
Joined: Sat Jan 21, 2012 11:24 am
Location: GMT
Callsign: SHA7
Version: GIT
OS: GNU

Re: Dedicated Nasal IDE or editor?

Postby mr_no » Mon Apr 30, 2012 10:54 am

U can use what I use.
http://www.scintilla.org/SciTE.html
U can create and specify the sintax for nasal too.

Or notepad++. I'm creating a Nasal syntax for it.
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 362
Joined: Thu Jan 19, 2012 2:20 pm

Re: Dedicated Nasal IDE or editor?

Postby Hooray » Wed May 02, 2012 12:39 pm

Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11774
Joined: Tue Mar 25, 2008 8:40 am

Re: Dedicated Nasal IDE or editor?

Postby mr_no » Fri May 04, 2012 5:19 pm

I've looked at that and it was very short with a few words.
This is mine and has many more keywords.
userDefineLang.xml
Code: Select all
<NotepadPlus>
    <UserLang name="Nasal" ext="nas">
        <Settings>
            <Global caseIgnored="yes" />
            <TreatAsSymbol comment="no" commentLine="yes" />
            <Prefix words1="no" words2="no" words3="no" words4="no" />
        </Settings>
        <KeywordLists>
            <Keywords name="Delimiters">&quot;00&quot;00</Keywords>
            <Keywords name="Folder+">{</Keywords>
            <Keywords name="Folder-">}</Keywords>
            <Keywords name="Operators">- ! ( ) * / : ; [ ] ^ | + &lt; = &gt;</Keywords>
            <Keywords name="Comment">1 2 0#</Keywords>
            <Keywords name="Words1">
               func return var if elsif else while for foreach forindex  break continue me arg parents nil and or
                     
               size keys append pop setsize subvec delete int num streq substr chr typeof compile call die
               sprintf caller closure find cmp split rand bind sort ghosttype id
         
         </Keywords>
            <Keywords name="Words2">
         getprop setprop print _fgcommand settimer _setlistener _cmdarg _interpolate rand srand directory removelistener systime
         geodtocart carttogeod geodinfo parsexml airportinfo abort

         isa fgcommand cmdarg abs interpolate setlistener defined printlog thisfunc printf values

         getType getName getIndex getValue setValue setIntValue setBoolValue setDoubleValue getParent getChild getChildren
         getAttribute setAttribute alias unalias getAliasTarget clearValue removeChild removeChildren getNode initNode
         getPath getBoolValue setValues getValues
         
         </Keywords>
            <Keywords name="Words3"> math sin cos exp ln sqrt atan2 e pi</Keywords>
            <Keywords name="Words4">
            close read write seek tell flush open readln stat SEEK_SET SEEK_CUR SEEK_END stdin stdout stderr sfld fld setfld buf
         </Keywords>
        </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="Verdana" fontStyle="0" />
            <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="000000" bgColor="FFFFFF" fontName="Verdana" fontStyle="0" />
            <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="Verdana" fontStyle="0" />
            <WordsStyle name="KEYWORD1" styleID="5" fgColor="00007F" bgColor="FFFFFF" fontName="Verdana" fontStyle="1" />
            <WordsStyle name="KEYWORD2" styleID="6" fgColor="00007F" bgColor="FFFFFF" fontName="Verdana" fontStyle="0" />
            <WordsStyle name="KEYWORD3" styleID="7" fgColor="AA0000" bgColor="FFFFFF" fontName="Verdana" fontStyle="0" />
            <WordsStyle name="KEYWORD4" styleID="8" fgColor="00AA00" bgColor="FFFFFF" fontName="Verdana" fontStyle="0" />
            <WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="Verdana" fontStyle="0" />
            <WordsStyle name="COMMENT LINE" styleID="2" fgColor="007F00" bgColor="FFFFFF" fontName="Verdana" fontStyle="0" />
            <WordsStyle name="NUMBER" styleID="4" fgColor="007F7F" bgColor="FFFFFF" fontName="Verdana" fontStyle="0" />
            <WordsStyle name="OPERATOR" styleID="10" fgColor="7F0000" bgColor="FFFFFF" fontName="Verdana" fontStyle="0" />
            <WordsStyle name="DELIMINER1" styleID="14" fgColor="7F007F" bgColor="FFFFFF" fontName="Verdana" fontStyle="0" />
            <WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="Verdana" fontStyle="0" />
            <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="Verdana" fontStyle="0" />
        </Styles>
    </UserLang>
</NotepadPlus>
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 362
Joined: Thu Jan 19, 2012 2:20 pm

Re: Dedicated Nasal IDE or editor?

Postby Hooray » Sat May 05, 2012 9:36 am

The most complete syntax highlighting mode for Nasal currently available is the vim mode, it even provides support for the generic Nasal modules in $FG_ROOT/Nasal (gui.nas, io.nas aircraft.nas etc): http://ompldr.org/vY2hsbw/nasal_api.html
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11774
Joined: Tue Mar 25, 2008 8:40 am


Return to Nasal

Who is online

Users browsing this forum: No registered users and 1 guest