Hi again ;)<br><br><div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt;&gt; So, supposing you want to work with Miller
<br>&gt; Why no ?<br><br>Because you want to refactor Pd and because, I suppose that you've read<br>pd-list and/or pd-dev for some time.</blockquote><div><br><br>I did. And I've seen how this project works a little.<br>The thing is, it doesn't work as a truly open community, but this can change.
<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; To me, I shouldn't have to &quot;work with Miller&quot; or &quot;work with Mathieu&quot; or
<br>&gt; anything like this,<br><br>So you are going to work alone? Or you're going to reunite the family?</blockquote><div><br><br>At first, doing little splitting here and there could be done by one single person and I can do this.
<br>Now, as I said, the real issue is &quot;where do I cut&quot;, and &quot;how&quot;, and that's architecture, conception, and that has to be done with the whole &quot;family&quot;.<br>And as you pointed out, changing anything today means lots of work in merging.
<br><br>But if we don't want to do merging, we need to break down vanilla into pieces, and put these pieces together with others, like DD's GUI.<br><br>To me, making DesireData (or any other project) a viable solution starts with splitting vanilla into &quot;what you want to work on&quot; and &quot;the rest&quot;.
<br>Then, natural selection will come and we'll pick which solution is best.<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; simply because we are wasting way too much energy doing theses diffs /
<br>&gt; merge stuff. Having different branches is fine and even desirable (!),<br><br>If there's not going to be merging then what do you want the branches to<br>do? split further apart?<br><br>&gt; as long as it leads to more generic modules that can be tested and
<br>&gt; refined in more diverse cases.<br><br>do you do unit-testing?</blockquote><div><br><br>Here's my point of view : to be able to do unit testing, we need functions that are actually &quot;testable&quot;, and that means they are :
<br>- small<br>- not complex (small Cyclomatic number)
<br>- doing one single thing<br>- handling errors<br>- easily isolated from the rest of the program<br><br><br>I believe more in &quot;good conception leads to less bugs&quot;, and I'm not a big fan of unity testing myself. But it is a honorable goal to do unit-tests.
<br><br>This is how we could avoid quite a few stupid bugs :<br>=&gt; just look at callgraphs using Doxygen with callgraphs enabled, it's free &amp; easy and it'll show you a lot about the program structure (and where to &quot;cut&quot;)
<br>Attached is an Doxyfile example with callgraphs enabled. Takes a while to generate, and produces big callgraphs (from / to) images.<br>=&gt; running splint, uno, and others. It also shows some little pieces of dirt here and there.
<br><br>CCCC can also help us keeping track of the size of the code and its complexity, as a default of stuff like RSM, and to know where to start working first.<br>We don't necessarily need these tools, but they can help. 
<br><br>Some of you guys, Mac users, have access to Shark (part of XCode) for instance (<a href="http://developer.apple.com/tools/sharkoptimize.html">http://developer.apple.com/tools/sharkoptimize.html</a>).<br>I don't. But i'd be interested to see the results published on PD and see its memory usage, and to profile the application to have an idea of where we should focus efforts.
<br>Sure Kprof and others exist too, but it's not the same :)<br>There's also <a href="http://www.drugphish.ch/~jonny/cca.html">http://www.drugphish.ch/~jonny/cca.html</a><br><br>Anyway, the point is we have loads of tools to check and split the program and I used them on Pd.
<br>Now, my initial question was : &quot;ok, I found that lots can be improved : how do I propose improvments to the community that imply refactoring and splitting ?&quot;<br>And I see why everyone so far answered &quot;You're getting into social issue man, good luck !&quot;
<br>And that's why I'm saying : &quot;Fine, let's break things down so we can all work on Pd's development then&quot;<br>Now, I can't and don't want to do that by myself, behind closed doors or on a separate repository or do another useless fork : I need the adhesion of the &quot;community&quot;, or else I won't be able to make any changes... like many others who have been discouraged.
<br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; [Pd] deserves a clear roadmap,<br><br>Several people have their own roadmaps. Does it need one big shared one?
<br>Just how shared would that one be?</blockquote><div><br>Architecture goals should be shared. Then, on each SW component, everyone can do what they want, as long as they respect / define / communicate on interfaces.<br>
Again : it works with pd / externals.<br>m_pd.h is an API, Johannes has put together a documentation, and developments of externals take place.<br><br>The goals of each person are achievable as long as they don't interfere with other's : and that's where separating the codebase and functions is essential.
<br>The &quot;core&quot; should be as minimalist as possible, so it allows anyone to build their own &quot;Pd&quot; on top of it. (with any GUI, with any components, float or int, externals or not, network or not, full pack, whatever).
<br><br>The final distribution for users should still include everything possible as Hans is doing (congrats on the build farm btw).<br>But the code should allow us to carry on projects like PDa, ePD (embedded PD), make PD core into a plugin, or a standalone app with GriPD-reloaded, make it available on webservers, or anything people have been talking about for a while now.
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; I think this work on architecture will be mandatory as we add new<br>&gt; features (like video~)
<br><br>Do you think that adding a sixth video subsystem to pd is going to solve
<br>anything?</blockquote><div><br><br>I absolutely don't. What I think is adding it might present the advantage of making pd more modular than it is today, otherwise it's going to be hell.<br>Cuz we might ask ourselves : how do we integrate these new objects ? We need to treat audio, MIDI, video like any other external !
<br>We need to reduce Pd's core to the minimum possible (=put CoreLibs, Audio, MIDI, GUI aside of it).<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; The solution isn't to make forks on forks IMO : the key is to reduce the<br>&gt; amount of code to be merged. Making Pd more modular allows to work on<br>&gt; what you want,<br><br>You don't understand what I mean: there's a catch-22 (a deadlock) -
<br>modularizing may reduce the amount of merging in the long term, but in the<br>short term, it's increasing it, and that's what will prevent<br>modularization from happening in the current branches, despite its<br>benefits.
</blockquote><div><br><br>Mmh ... I guess we should start by putting everything on the table and splitting vanilla and stop working on devel and other branches, at first.<br>That way, DD's (and others) developments / merges could be easier right after.
<br>Since you understand french &quot;C'est un mal pour un bien&quot;.<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt;&gt; Again, my goal is not to alter pd in its behavior (yet),
<br>&gt;&gt; my goal is.<br><br>Actually, I also have the goal of refactoring, of course, but I can't<br>guarantee invariance of behaviour in any way...
</blockquote><div><br>That's true. It's a risk. But it needs to be taken, and it'll help understanding how we can improve Pd.<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; - Self explanatory naming (how many single letters variables and / or<br>&gt; funny functions names do we have ?)<br><br>most names don't have to be long, especially when local and also<br>especially when often used.
</blockquote><div><br><br>Let me take a quick example to illustrate my point :<br><br>(from s_inter.c, removed #ifdefs for this example)<br><br>void sys_set_priority(int higher) <br>{<br>&nbsp;&nbsp;&nbsp; struct sched_param par;<br>&nbsp;&nbsp;&nbsp; int p1 ,p2, p3;
<br>&nbsp;&nbsp;&nbsp; p1 = sched_get_priority_min(SCHED_FIFO);<br>&nbsp;&nbsp;&nbsp; p2 = sched_get_priority_max(SCHED_FIFO);<br><br>&nbsp;&nbsp;&nbsp; p3 = (higher ? p1 + 7 : p1 + 5);<br>&nbsp;&nbsp;&nbsp; par.sched_priority = p3;<br>&nbsp;&nbsp;&nbsp; if (sched_setscheduler(0,SCHED_FIFO,&amp;par) != -1)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fprintf(stderr, &quot;priority %d scheduling enabled.\n&quot;, p3);<br><br>&nbsp;&nbsp;&nbsp; if (mlockall(MCL_FUTURE) != -1) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fprintf(stderr, &quot;memory locking enabled.\n&quot;);<br>}<br><br>and <br><br>(quick and dirty version)
<br><br>int sys_set_priority(int higher) <br>{<br>&nbsp;&nbsp;&nbsp; struct sched_param pd_sched_settings;<br>&nbsp;&nbsp;&nbsp; int priority_min;<br>&nbsp;&nbsp;&nbsp; int priority_max;<br>&nbsp;&nbsp;&nbsp; int priority;<br>&nbsp;&nbsp;&nbsp; int error_desc;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; priority_min = sched_get_priority_min(SCHED_FIFO);
<br>&nbsp;&nbsp;&nbsp; priority_max = sched_get_priority_max(SCHED_FIFO);<br><br>&nbsp;&nbsp;&nbsp; priority = (higher ? priority_min + WATCHDOG_PRIORITY_BUMP : priority_min + PD_PRIORITY_BUMP);<br>&nbsp;&nbsp;&nbsp; pd_sched_settings.sched_priority = priority;<br><br>
&nbsp;&nbsp;&nbsp; if (sched_setscheduler(0, SCHED_FIFO, &amp;pd_sched_settings) != -1)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fprintf(stderr, &quot;priority %d scheduling enabled.\n&quot;, priority);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return (0);<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; error_desc=errno;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fprintf(stderr, &quot;couldn't change process priority to %d.\n&quot;, priority);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fprintf(stderr, &quot;%s (%d)&quot;, strerror(error_desc), error_desc);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return (WHATEVER_ERROR_TO_BE_DEFINED);
<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>(since this is ANOTHER function, so we separate it ! )<br><br>int sys_set_memory_lock(void)<br>{<br>&nbsp;&nbsp;&nbsp; int error_desc;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (mlockall(MCL_FUTURE) != -1)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fprintf(stderr, &quot;memory locking enabled.\n&quot;);
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return(0);<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; error_desc=errno;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fprintf(stderr, &quot;couldn't enable memory locking.\n&quot;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fprintf(stderr, &quot;%s (%d)&quot;, strerror(error_desc), error_desc);
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return (WHATEVER_ERROR_TO_BE_DEFINED);<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br><br>I know it's so not the &quot;best&quot; code ever and it is improvable, but I just wanted to illustrate my point.<br>For instance, <br>- Better error handling can be done here, 
<br>- Localization can be done here, <br>- Generic error function can be written, <br>- Safe fprintf can be used to avoid overflow.<br><br>An explicit name doesn't take more memory at runtime, and saves the dev brain power at coding time ;)
<br>And splitting functions won't make Pd noticeably slower, since these functions are called ONCE or TWICE throughout the whole program's runtime ;)<br>But it'll allow comprehension, flexibility, error handling, debug and testability.
<br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; - Getting rid of stuff.h which is a nonsense to me and having .h in modules<br>&gt; when required.<br><br>I agree about splitting s_stuff.h or otherwise cleanly indicating what its<br>sections are; however I don't know what you mean by having .h &quot;in&quot;
<br>modules. Is a &quot;module&quot; some kind of directory?</blockquote><div><br><br>Yes, like <br>/audio<br>|-/pd_audio.c, pd_audio.h<br>|--/alsa<br>|--/jack<br>|--/whatever<br><br>stuff.h already has sections. But there it is confusing and unsafe that all files include &quot;
stuff.h&quot; and can access anything declared in it ! It is against separation of variables, functions, structures and ... modularity !<br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; Maybe Pd's internals architecture could be a nice topic for a little IRC<br>&gt; meeting ?<br><br>I stopped caring about trying to organise PureData developers meetings
<br>some time ago. I think we've had seven of them. It didn't catch on.<br>I decided to call DesireData meetings instead, but the 2nd meeting is<br>loooong overdue.</blockquote><div><br><br>Communication is key. IRC isn't the best tool but it's a start.
<br>Meetings are nice too :) The one we had in Paris during the NIME06 was interesting.<br>I like launchpad, but we could also make a better use of <a href="http://puredata.info">puredata.info</a> wiki, or setup trac or anything like this.
<br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; Who's in ?<br><br>I could be in. Is this going to happen on #dataflow ?
</blockquote><div><br><br>Wherever you guys want. I think we need Miller on board though.<br>We need to know who's in, it's a community's job :)&nbsp;</div><br></div>I'd like to have Miller's point of view on this whole conversation too.
<br><br>++<br><br><br>