[Cs-dev] Design advice sought
Date | 2013-11-12 10:02 |
From | john ffitch |
Subject | [Cs-dev] Design advice sought |
There was a request for automatic loading of UDOs (from Rory I think). As a result I now have code that looks for the environment variable CS_UDO_DIR to identify a location and includes all files in it ending in .udo Questions: 1: is this the correct/best envvar to use? 2: Should it also include .inc files or everything? Also this code uses #include before reading the orchestra which might limit the utility. And there is no ordering control over the #includes. If that was important it might be possible to address. ==John ffitch ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2013-11-12 10:31 |
From | Rory Walsh |
Subject | Re: [Cs-dev] Design advice sought |
Hi John, thanks for looking into this. If CS_UDO_DIR is not set, will it automatically look in the same directory as the .csd file? To avoid the use of includes, could Csound not search the UDO_DIR on startup for all .udo files and simply compile them on the fly in instr0 before the score runs? Of course there is little point of compiling them all if they are not needed, so I'm not sure how to best address that. To be honest, if we had a new tag called |
Date | 2013-11-12 11:04 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Design advice sought |
I also agree this should not be enabled by default, maybe a preprocessor line can be used? #loadudos |
Date | 2013-11-12 11:11 |
From | Rory Walsh |
Subject | Re: [Cs-dev] Design advice sought |
What do you think about an additional |
Date | 2013-11-12 11:47 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Design advice sought |
Only if this is in addition to having UDOs in the orchestra body (otherwise we will break compatibility). But if you want to hide UDOs, you should use #include (or any proposed method to load all UDOs). Victor On 12 Nov 2013, at 11:11, Rory Walsh |
Date | 2013-11-12 11:57 |
From | Rory Walsh |
Subject | Re: [Cs-dev] Design advice sought |
Yes, it would be in addition. It's nice to have them included in the files, but not so nice that they have to be in instr0 space. With an additional csUDO section, I could provide my students with a basic .csd file, containing a number of utility UDOs at the bottom. I could even set it up to be the default .csd file used by CsoundQT or WinXound when students start a new file. On 12 November 2013 11:47, Victor Lazzarini |
Date | 2013-11-12 13:26 |
From | joachim heintz |
Subject | Re: [Cs-dev] Design advice sought |
i like the idea of an additional |
Date | 2013-11-12 15:09 |
From | Richard Henninger |
Subject | Re: [Cs-dev] Design advice sought |
Attachments | None None |
Why not make sure to permit #include statements along with inline UDO code in a new <csUDO> section to get the best of both worlds?
I presume that having the #include for UDO’s isolated within their own <csUDO> section would handle the timing issue that was worrying john by permitting their internal structures to be built at their optimal moment during compilation independently of
building other compiler structures. Presumably, non-UDO code in this section would be a compiler error whether inline or included.
This way, you can combine libraries and inline code as appropriate for a given piece.
Richard Henninger
richard@rghmusic.com i like the idea of an additional <csudo> tag which could be placed at
the end of the whole .csd file. i agree it would make the code much more readable for complex udos. best - joachim Am 12.11.2013 12:57, schrieb Rory Walsh: > Yes, it would be in addition. It's nice to have them included in the > files, but not so nice that they have to be in instr0 space. With an > additional csUDO section, I could provide my students with a basic > .csd file, containing a number of utility UDOs at the bottom. I could > even set it up to be the default .csd file used by CsoundQT or > WinXound when students start a new file. > > On 12 November 2013 11:47, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: >> Only if this is in addition to having UDOs in the orchestra body (otherwise we will break compatibility). >> But if you want to hide UDOs, you should use #include (or any proposed method to load all UDOs). >> >> Victor >> On 12 Nov 2013, at 11:11, Rory Walsh <rorywalsh@ear.ie> wrote: >> >>> What do you think about an additional <csUDO> option? f I could hide >>> all the UDO stuff at the end of the csd file it would be great, and >>> one could ensure that all UDOs stay within the .csd file, which is of >>> course one of the major advantages to the current system. >>> >>> On 12 November 2013 11:04, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: >>>> I also agree this should not be enabled by default, maybe a preprocessor line >>>> can be used? >>>> >>>> #loadudos <path> >>>> >>>> >>>> On 12 Nov 2013, at 10:31, Rory Walsh <rorywalsh@ear.ie> wrote: >>>> >>>>> Hi John, thanks for looking into this. If CS_UDO_DIR is not set, will >>>>> it automatically look in the same directory as the .csd file? To avoid >>>>> the use of includes, could Csound not search the UDO_DIR on startup >>>>> for all .udo files and simply compile them on the fly in instr0 before >>>>> the score runs? Of course there is little point of compiling them all >>>>> if they are not needed, so I'm not sure how to best address that. To >>>>> be honest, if we had a new tag called <csUDO></csUDO> that could be >>>>> placed at the bottom of the csd file I'd be happy to just use that. >>>>> The problem I have with the current system is that it usually scares >>>>> the bejisus out of students when they see these complex UDOs before >>>>> instruments definitions. Before doing any more work on this maybe we >>>>> should hear from others and see what they think? >>>>> >>>>> On 12 November 2013 10:02, john ffitch <jpff@codemist.co.uk> wrote: >>>>>> There was a request for automatic loading of UDOs (from Rory I think). >>>>>> As a result I now have code that looks for the environment variable >>>>>> CS_UDO_DIR to identify a location and includes all files in it ending >>>>>> in .udo >>>>>> >>>>>> Questions: >>>>>> 1: is this the correct/best envvar to use? >>>>>> >>>>>> 2: Should it also include .inc files or everything? >>>>>> >>>>>> Also this code uses #include before reading the orchestra which might >>>>>> limit the utility. And there is no ordering control over the >>>>>> #includes. If that was important it might be possible to address. >>>>>> >>>>>> ==John ffitch >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> November Webinars for C, C++, Fortran Developers >>>>>> Accelerate application performance with scalable programming models. Explore >>>>>> techniques for threading, error checking, porting, and tuning. Get the most >>>>>> from the latest Intel processors and coprocessors. See abstracts and register >>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk >>>>>> _______________________________________________ >>>>>> Csound-devel mailing list >>>>>> Csound-devel@lists.sourceforge.net >>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> November Webinars for C, C++, Fortran Developers >>>>> Accelerate application performance with scalable programming models. Explore >>>>> techniques for threading, error checking, porting, and tuning. Get the most >>>>> from the latest Intel processors and coprocessors. See abstracts and register >>>>> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk >>>>> _______________________________________________ >>>>> Csound-devel mailing list >>>>> Csound-devel@lists.sourceforge.net >>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> November Webinars for C, C++, Fortran Developers >>>> Accelerate application performance with scalable programming models. Explore >>>> techniques for threading, error checking, porting, and tuning. Get the most >>>> from the latest Intel processors and coprocessors. See abstracts and register >>>> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Csound-devel mailing list >>>> Csound-devel@lists.sourceforge.net >>>> https://lists.sourceforge.net/lists/listinfo/csound-devel >>> >>> ------------------------------------------------------------------------------ >>> November Webinars for C, C++, Fortran Developers >>> Accelerate application performance with scalable programming models. Explore >>> techniques for threading, error checking, porting, and tuning. Get the most >>> from the latest Intel processors and coprocessors. See abstracts and register >>> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Csound-devel mailing list >>> Csound-devel@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/csound-devel >> >> >> ------------------------------------------------------------------------------ >> November Webinars for C, C++, Fortran Developers >> Accelerate application performance with scalable programming models. Explore >> techniques for threading, error checking, porting, and tuning. Get the most >> from the latest Intel processors and coprocessors. See abstracts and register >> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk >> _______________________________________________ >> Csound-devel mailing list >> Csound-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/csound-devel > > ------------------------------------------------------------------------------ > November Webinars for C, C++, Fortran Developers > Accelerate application performance with scalable programming models. Explore > techniques for threading, error checking, porting, and tuning. Get the most > from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk > _______________________________________________ > Csound-devel mailing list > Csound-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/csound-devel > ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/csound-devel |
Date | 2013-11-12 16:09 |
From | Rory Walsh |
Subject | Re: [Cs-dev] Design advice sought |
I agree, one must be able to continue to use the system as is, be it with include's, or inline code. I think an environment variable is also a nice touch. And a dedicated csUDO section would be the icing on the cake ;) On 12 November 2013 15:09, Richard Henninger |
Date | 2013-11-12 16:21 |
From | Steven Yi |
Subject | Re: [Cs-dev] Design advice sought |
Attachments | None None |
I have to vote -1 on all this. I don't like the idea of adding more tags for this, as I think it's confusing to have some kind of out of order processing of text. I think it'd be better to use #includes, and just teach project management and code organization early, rather than cater to specific problem and introduce, IMO, a harder to reason system. If there's an #include, it signifies "we're using something from somewhere else". We can reason when it gets included as it follows the line-by-line processing. With CsUDO tags, we suddenly get: "Okay, there's an opcode you've never seen before, but it's going to work, even though it shows up later in the code, but it gets processed first". With that as a start, then suddenly we have to start wondering, well, what else gets processed before my code? What exactly is the processing model for the code? Also, what if someone defines a UDO with one name in CsUDO, then in the main code they use that UDO, redefine the UDO, then use the new one? There's problems being introduced that I think could make one thing easier but lots of other things harder.
As for CS_UDO_DIR, I think it's problematic too as an auto-load, at least in its current implementation. I do see in systems like python, java, haskell, etc. that there is a prelude that gets loaded. I guess in lisps the correllary would be a system image that's loaded. If we could have a default file that loads, maybe one called system.inc or default.inc, one that would then #include other files, then at least we'd have an easy to reason way of ordering things. Users could alter their system.inc to #include some other UDO include that might include other udo includes, etc. This would make it a little more ordered I think.
Anyways, my 2 cents. :) Thanks! steven On Tue, Nov 12, 2013 at 11:09 AM, Rory Walsh <rorywalsh@ear.ie> wrote: I agree, one must be able to continue to use the system as is, be it |
Date | 2013-11-12 17:01 |
From | Rory Walsh |
Subject | Re: [Cs-dev] Design advice sought |
Thanks for your feedback Steven. I can see your point about the order of processing. I guess it could lead to some confusion. However, I'd rather not have to teach project management to my first year students who have zero experience with programming :) I'd love to use UDOs more in my teaching, but without #includes they bloat orchestra sections to the extent that it's often hard to find instrument definitions. How about something like this which makes it explicit that we are inserting code from another section of the Csd file: |
Date | 2013-11-12 17:10 |
From | Tito Latini |
Subject | Re: [Cs-dev] Design advice sought |
Attachments | None |
Date | 2013-11-12 17:12 |
From | jpff@cs.bath.ac.uk |
Subject | Re: [Cs-dev] Design advice sought |
Attachments | None |
Date | 2013-11-12 17:54 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Design advice sought |
Attachments | None None |
I basically agree with Steven. You could encourage your students to use CsoundQt, which enables one to move quickly from one element of a csd to another with ease.
Regards, Mike ----------------------------------------------------- Michael GoginsIrreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Tue, Nov 12, 2013 at 12:01 PM, Rory Walsh <rorywalsh@ear.ie> wrote: Thanks for your feedback Steven. I can see your point about the order |
Date | 2013-11-12 18:03 |
From | Rory Walsh |
Subject | Re: [Cs-dev] Design advice sought |
Ok, message received! I'll just use '#include' from now on. I'm very glad to have had a discussion about it, and the last thing I want is for developers to spend time on certain things when there are bigger fish to fry. What's that I hear... did someone mention user defined data types :) On 12 November 2013 17:54, Michael Gogins |