<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-14096</id>
	<title>Nabble - Erlang Questions</title>
	<updated>2009-11-25T21:52:36Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/Erlang-Questions-f14096.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Erlang-Questions-f14096.html" />
	<subtitle type="html"></subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26524677</id>
	<title>Re: Erlang/OTP now at Github</title>
	<published>2009-11-25T21:52:36Z</published>
	<updated>2009-11-25T21:52:36Z</updated>
	<author>
		<name>Björn Gustavsson</name>
	</author>
	<content type="html">On Wed, Nov 25, 2009 at 3:20 PM, Juan Jose Comellas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26524677&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;juanjo@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Why was the commit history discarded? Wouldn't it be better to at
&lt;br&gt;&amp;gt; least preserve the history corresponding to the public releases? Maybe
&lt;br&gt;&amp;gt; you could use Matthew Foemmel's repository[1] in Github as a base.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [1] &lt;a href=&quot;http://github.com/mfoemmel/erlang-otp/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/mfoemmel/erlang-otp/&lt;/a&gt;&lt;br&gt;&lt;br&gt;I have added a wiki page explaining how you can prepend
&lt;br&gt;mfoemmel's history to our history by using two
&lt;br&gt;simple commands:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://wiki.github.com/erlang/otp/extending-the-history-of-erlangotp&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://wiki.github.com/erlang/otp/extending-the-history-of-erlangotp&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Björn Gustavsson, Erlang/OTP, Ericsson AB
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Erlang-OTP-now-at-Github-tp26513316p26524677.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26524058</id>
	<title>Re: Fastest pseudo-random number-generator: erlang:statistics(io) ?</title>
	<published>2009-11-25T19:57:40Z</published>
	<updated>2009-11-25T19:57:40Z</updated>
	<author>
		<name>Thijs Terlouw</name>
	</author>
	<content type="html">The new nif (native implemented functions) provide a great alternative
&lt;br&gt;to generate random numbers and timestamps, much faster than the Erlang
&lt;br&gt;alternatives!
&lt;br&gt;&lt;br&gt;The speed is about 1/2 to 1/3 of statistics(io), but still much faster
&lt;br&gt;than erlang:now().
&lt;br&gt;I simply used time(0) for the nif_now() and gettimeofday(&amp;tv, NULL)
&lt;br&gt;for the nif_random() functions.
&lt;br&gt;&lt;br&gt;nif's are a great addition to the language!
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;signature&quot;&gt;- Thijs Terlouw, &lt;a href=&quot;http://www.startinchina.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Shenzhen, China&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Fastest-pseudo-random-number-generator%3A-erlang%3Astatistics%28io%29---tp26497411p26524058.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26523566</id>
	<title>Erlang R13B03 *EXPERIMENTAL* FreeBSD port</title>
	<published>2009-11-25T18:29:00Z</published>
	<updated>2009-11-25T18:29:00Z</updated>
	<author>
		<name>Kenji Rikitake</name>
	</author>
	<content type="html">FreeBSD *EXPERIMENTAL* (unofficial) port for R13B03
&lt;br&gt;available at
&lt;br&gt;&lt;a href=&quot;http://www.ne.jp/asahi/bdx/info/software/erlang-r13b03,1-20091126-1.tar.gz&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ne.jp/asahi/bdx/info/software/erlang-r13b03,1-20091126-1.tar.gz&lt;/a&gt;&lt;br&gt;&lt;br&gt;KNOWN issues:
&lt;br&gt;&lt;br&gt;* NO JAVA test yet (WITHOUT_JAVA=yes set in the Makefile)
&lt;br&gt;* Makefile.man has been put dupes of snmp*.3 in MAN3/MAN6/MAN7
&lt;br&gt;&amp;nbsp; (necessary to remove errors on &amp;quot;make package&amp;quot;)
&lt;br&gt;* r13b02_1,1 fix (of Steve Vinocki's erlang.el) hasn't been merged
&lt;br&gt;&lt;br&gt;I've sent this port to Giacomo Olgeni (the official port maintainer) so
&lt;br&gt;I hope he'll use mine as a feedback source.
&lt;br&gt;&lt;br&gt;Kenji Rikitake
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Erlang-R13B03-*EXPERIMENTAL*-FreeBSD-port-tp26523566p26523566.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26522575</id>
	<title>Re: How to match on a nested record against a dict</title>
	<published>2009-11-25T16:09:28Z</published>
	<updated>2009-11-25T16:09:28Z</updated>
	<author>
		<name>Igor Ribeiro Sucupira</name>
	</author>
	<content type="html">If you don't need the values that you store in the dict (in your
&lt;br&gt;example, you store [] and never use it), you can use a sets instead of
&lt;br&gt;a dict. Usage is a little bit simpler:
&lt;br&gt;&lt;br&gt;-------------------------
&lt;br&gt;1&amp;gt; D = dict:store(&amp;quot;_see._tcp.local&amp;quot;, [], dict:new()).
&lt;br&gt;{dict,1,16,16,8,80,48,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {{[],[],[],[],
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [[&amp;quot;_see._tcp.local&amp;quot;]],
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [],[],[],[],[],[],[],[],[],[],[]}}}
&lt;br&gt;2&amp;gt; dict:find(&amp;quot;_see._tcp.local&amp;quot;, D).
&lt;br&gt;{ok,[]}
&lt;br&gt;&lt;br&gt;3&amp;gt; S = sets:add_element(&amp;quot;_see._tcp.local&amp;quot;, sets:new()).
&lt;br&gt;{set,1,16,16,8,80,48,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{{[],[],[],[],
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[&amp;quot;_see._tcp.local&amp;quot;],
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[],[],[],[],[],[],[],[],[],[],[]}}}
&lt;br&gt;4&amp;gt; sets:is_element(&amp;quot;_see._tcp.local&amp;quot;, S).
&lt;br&gt;true
&lt;br&gt;-------------------------
&lt;br&gt;&lt;br&gt;&lt;br&gt;See also gb_sets and ordsets.
&lt;br&gt;&lt;br&gt;Igor.
&lt;br&gt;&lt;br&gt;On Tue, Nov 24, 2009 at 7:25 PM, Jarrod Roberson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26522575&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jarrod@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Tue, Nov 24, 2009 at 3:18 PM, Jarrod Roberson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26522575&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jarrod@...&lt;/a&gt;&amp;gt;wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; process_dnsrec1(Sub,[#dns_rr{domain=Dom}|Rest]) -&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   case dict:find(Dom,Sub) of
&lt;br&gt;&amp;gt;&amp;gt;       [Result] -&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;           io:format(&amp;quot;Interesting domain ~p=~p~n&amp;quot;,[Dom,Result]);
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; thanks for reading I figured it out by trial and error.
&lt;br&gt;&amp;gt; I replaced the [Result] with {ok,Result} and it started working as expected
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;quot;The secret of joy in work is contained in one word - excellence. To
&lt;br&gt;know how to do something well is to enjoy it.&amp;quot; - Pearl S. Buck.
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/How-to-match-on-a-nested-record-against-a-dict-tp26463040p26522575.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26522541</id>
	<title>Re: A Generic API for controlling software  components</title>
	<published>2009-11-25T16:06:44Z</published>
	<updated>2009-11-25T16:06:44Z</updated>
	<author>
		<name>Garrett Smith-5</name>
	</author>
	<content type="html">On Wed, Nov 25, 2009 at 3:50 PM, Jayson Vantuyl &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26522541&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kagato@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; If you want to deprecate applications, that's fine, but understand that two packaging / distribution formats is a horrible idea.  It took forever in Python to unify eggs and setuptools.
&lt;br&gt;&lt;br&gt;I'd heartily second this. Python still doesn't have a unified
&lt;br&gt;packaging schema/toolset -- distutils and setuptools are still both in
&lt;br&gt;mainstream use, and it's a total pain.
&lt;br&gt;&lt;br&gt;I've done a fair amount of work in package management systems in the
&lt;br&gt;commercial/proprietary work. I've never seen a packaging scheme that
&lt;br&gt;didn't have some pretty annoying warts. This tends to lead to package
&lt;br&gt;manager proliferation as it's very tempting to start anew on this
&lt;br&gt;common problem. Unfortunately, what initially looks like not-a-wheel
&lt;br&gt;is probably just another wheel.
&lt;br&gt;&lt;br&gt;Unfortunately, I can only hand wave as I don't have a deep
&lt;br&gt;understanding of Erlang's current application/release scheme (though I
&lt;br&gt;have managed to used it :) I do think there's a reasonable burden to
&lt;br&gt;demonstrate why Erlang's application abstraction can't be evolved to
&lt;br&gt;support Python Egg or Ruby Gem like features. If the application
&lt;br&gt;scheme doesn't work, could application be morphed into components, or
&lt;br&gt;packages (also a common term for this)?
&lt;br&gt;&lt;br&gt;Is there something from Faxien that gets us closer to Joe's goal?
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://code.google.com/p/faxien/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/faxien/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Garrett
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/A-Generic-API-for-controlling-software-components-tp26510088p26522541.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26522304</id>
	<title>Re: Erlang/OTP now at Github</title>
	<published>2009-11-25T15:40:03Z</published>
	<updated>2009-11-25T15:40:03Z</updated>
	<author>
		<name>Steve Davis-5</name>
	</author>
	<content type="html">An event of significance -&amp;gt; mojombo has featured this on the GitHub
&lt;br&gt;main blog :)
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://github.com/blog/554-erlang-otp-now-on-github&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/blog/554-erlang-otp-now-on-github&lt;/a&gt;&lt;br&gt;&lt;br&gt;/s
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Erlang-OTP-now-at-Github-tp26513316p26522304.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26521030</id>
	<title>Re: A Generic API for controlling software components</title>
	<published>2009-11-25T13:59:35Z</published>
	<updated>2009-11-25T13:59:35Z</updated>
	<author>
		<name>Richard O'Keefe</name>
	</author>
	<content type="html">&lt;br&gt;On Nov 25, 2009, at 10:56 PM, Joe Armstrong wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Rule4: All components C must have a file called	
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $HOME/eComponents/C.ec/Preferences.pl
&lt;br&gt;&amp;gt; 	
&lt;br&gt;&amp;gt; 	 &amp;nbsp; The extension .pl means the file contains a property
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; list. Here is an example:
&lt;br&gt;&lt;br&gt;We already have .pl meaning Prolog and .pl meaning Perl.
&lt;br&gt;Since the property list uses Erlang syntax, how about
&lt;br&gt;.epl (Erlang Property List)?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Rule6: Code upgrade
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; We should upgrade an component C when it's expiry date has
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; been reached. To update an component we delete the entire
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; component under $HOME/eComponents/C.ec we install the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new component and run the command: C:install().
&lt;br&gt;&lt;br&gt;What happens if the expiry date is reached and there _isn't_ any
&lt;br&gt;new version, or the site the new version should be obtained from
&lt;br&gt;is unreachable?
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;There are many kinds of components.
&lt;br&gt;For example,
&lt;br&gt;&amp;nbsp; - there should be exactly one instance
&lt;br&gt;&amp;nbsp; - there should be at most one instance
&lt;br&gt;&amp;nbsp; - there can be up to N instances to share work
&lt;br&gt;&amp;nbsp; - there should be one instance per client
&lt;br&gt;...
&lt;br&gt;It isn't clear to me what range of component types this proposal
&lt;br&gt;is meant to cover.
&lt;br&gt;&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/A-Generic-API-for-controlling-software-components-tp26510088p26521030.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26520917</id>
	<title>Re: A Generic API for controlling software  components</title>
	<published>2009-11-25T13:50:03Z</published>
	<updated>2009-11-25T13:50:03Z</updated>
	<author>
		<name>Jayson Vantuyl-2</name>
	</author>
	<content type="html">&amp;gt; I guess you mean OTP applications? - If so then I disagree. To start
&lt;br&gt;&amp;gt; with the directory structure within
&lt;br&gt;&amp;gt; an OTP application is fixed which I don't really like. Also there is
&lt;br&gt;It's fine that you don't like it, however, what use case justifies it. &amp;nbsp;&amp;quot;Because I want to&amp;quot; is not really a reason. &amp;nbsp;If you don't want to do it for a reason, it's probably bad design. &amp;nbsp;No offense, really.
&lt;br&gt;&lt;br&gt;Here's what I don't want. &amp;nbsp;I don't want each component to have radically different layouts that require a ton of work to adapt to. &amp;nbsp;I want contributing to projects and deploying them to be easy. &amp;nbsp;Conventions solve this. &amp;nbsp;Unless you have a problem that &amp;quot;rigid directory structures&amp;quot; prevent you from solving, that's just not good enough.
&lt;br&gt;&lt;br&gt;&amp;gt; no construction rule
&lt;br&gt;&amp;gt; that says you are not allowed to write anything in the application
&lt;br&gt;&amp;gt; directory tree. I'd like to put the
&lt;br&gt;&amp;gt; entire component in a read-only area of disk for safety reasons (once
&lt;br&gt;&amp;gt; an initial install has been performed).
&lt;br&gt;This is a good idea. &amp;nbsp;Separate the mutable data from code. &amp;nbsp;This can be done perfectly well by convention, though.
&lt;br&gt;&lt;br&gt;&amp;gt; I have a differnt proposal for reducing duplicates - this is a
&lt;br&gt;&amp;gt; different problem.
&lt;br&gt;If the problem is that deployment and installation is a hassle, I beg to differ. &amp;nbsp;Part of the problem is that the core Erlang developers are often changing internal modules, so it is natural that their deployment system duplicates the entire system. &amp;nbsp;For most of us, we just need to overlay our little modules on top of the giant Erlang environment. &amp;nbsp;That's why I've been suggesting an overlay approach.
&lt;br&gt;&lt;br&gt;&amp;gt; Yes to deploying Erlang components *and upgrading them*
&lt;br&gt;Applications are in modules and have versions. &amp;nbsp;The upgrade case for Erlang applications is pretty much solid. &amp;nbsp;Now, the way that releases do it (mutating an existing installation) is not exactly ideal, and I'd love to make adapt it to something smarter.
&lt;br&gt;&lt;br&gt;&amp;gt; Sure. epkg etc. will be just a thin shell script layer over the API I suggested.
&lt;br&gt;&amp;gt; The CLI can be written as a thin layer over the API as well.
&lt;br&gt;I would welcome that. &amp;nbsp;I think that a gen_event is a good model for handling runtime CLI functions.
&lt;br&gt;&lt;br&gt;&amp;gt; because 90% is not enough
&lt;br&gt;Perhaps I wasn't clear. &amp;nbsp;I was suggesting you start from 90% done instead of start from 0% done. &amp;nbsp;Also, components and applications have enough conceptual overlap that it would only serve to be confusing.
&lt;br&gt;&lt;br&gt;If you want to deprecate applications, that's fine, but understand that two packaging / distribution formats is a horrible idea. &amp;nbsp;It took forever in Python to unify eggs and setuptools.
&lt;br&gt;&lt;br&gt;&amp;gt; Of course. I just want to download yaws, ejabberd etc. drop them into
&lt;br&gt;&amp;gt; my eComponent Directory
&lt;br&gt;&amp;gt; and that's it - they are installed and runnable.
&lt;br&gt;No, you don't. &amp;nbsp;:) &amp;nbsp;A list of steps is not what you want. &amp;nbsp;You want &amp;quot;installing components to be easy&amp;quot;. &amp;nbsp;Downloading a file and dropping it in can't run any code, can't make any decisions custom to your system, and can't autogenerate configuration. &amp;nbsp;All of these things are great strengths of &amp;quot;gem install&amp;quot; and &amp;quot;easy_install&amp;quot;. &amp;nbsp;The last thing you want is to have a dozen different component downloads.
&lt;br&gt;&lt;br&gt;For example, assume that RabbitMQ gets a bunch of C components that need building for three OSes. &amp;nbsp;Now assume that it gets a special federated mode that requires different configuration. &amp;nbsp;Next assume that it develops a multi-hosted version for hosting providers. &amp;nbsp;If each combination has to be packaged separately (i.e. because we can't build the C extensions or mutate the configuration on install) then we end up with 12 (3*2*2) packages!
&lt;br&gt;&lt;br&gt;Being devil's advocate here, let's say we do it your way and have &amp;quot;install code&amp;quot; that runs when you start it the first time we do a deployment. &amp;nbsp;Even with this code, it has very weird behavior. &amp;nbsp;The first time startup may take forever or fail if the extension fails to build. &amp;nbsp;Now we have to keep track of that process and recover gracefully from it. &amp;nbsp;It would have been far better to have had the &amp;quot;install&amp;quot; or &amp;quot;deploy&amp;quot; step fail.
&lt;br&gt;&lt;br&gt;Basically, I don't see any value to the extra step. &amp;nbsp;It should be &amp;quot;install&amp;quot; then &amp;quot;deploy&amp;quot;, and install should be smart. &amp;nbsp;If &amp;quot;install&amp;quot; is downloading a file and working with directories it's not smart.
&lt;br&gt;&lt;br&gt;Ironically, it's also not really that beneficial to anyone in terms of user experience. &amp;nbsp;Power users won't mind a single command in the shell. &amp;nbsp;Non-power users would rather click an icon (moving files around for them is scary). &amp;nbsp;It lands in a middle-ground that is probably less populated than you would think.
&lt;br&gt;&lt;br&gt;&amp;gt; Ok, I didn't fully specify this - fine to change the details here or
&lt;br&gt;&amp;gt; use an environment variable to point
&lt;br&gt;&amp;gt; to the directory.
&lt;br&gt;I think unobtrusive default + environmental variable is good here.
&lt;br&gt;&lt;br&gt;&amp;gt; This is the bit that is not enforced in OTP applications - I think
&lt;br&gt;&amp;gt; users are even encouraged to use the /priv
&lt;br&gt;&amp;gt; directory in an otp application
&lt;br&gt;Is there something about this that is hard to retrofit into applications? &amp;nbsp;The great thing is that it's all abstracted already--just change what comes back from code:priv_dir/1. &amp;nbsp;If people are doing it properly, their data should go where you want it to go.
&lt;br&gt;&lt;br&gt;I'd really recommend having a cascading/overlaying/shadowing setup. &amp;nbsp;Have everything search the deploy location, user location, and system location in that order. &amp;nbsp;Mutable data never is found outside of the deploy.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Ok .eplist then?
&lt;br&gt;That sounds good.
&lt;br&gt;&lt;br&gt;&amp;gt; Because I might not want to follow that particular convention. For
&lt;br&gt;&amp;gt; simple applications I usually put everything in one directory.
&lt;br&gt;&amp;gt; Actually this could be dropped, the system could scan the filesystem
&lt;br&gt;&amp;gt; to find the code paths
&lt;br&gt;&amp;gt; the first time you run the program.
&lt;br&gt;&amp;gt; directory
&lt;br&gt;One of the most misunderstood things about the Ruby community is their intolerance. &amp;nbsp;Don't get me wrong, some of them are intolerant bigots, just like you get anywhere. &amp;nbsp;However, a lot of the intolerance comes from a desire to have solid conventions. &amp;nbsp;If you have to write applications all day long, knobs are only helpful if they're invisible. &amp;nbsp;Every required parameter and every choice about where to put a directory is extra time before I have a working project and extra trouble when I come back to it six months later.
&lt;br&gt;&lt;br&gt;Having the ability to override a convention is fine, but it should have a default and it should require no configuration.
&lt;br&gt;&lt;br&gt;The scanning the filesystem part is a good one. &amp;nbsp;One of the ugly things about Python, Java, Ruby, and Erlang is management of the code path. &amp;nbsp;Java has it down with a set of mostly ugly conventions. &amp;nbsp;Ruby still does a lot of manhandling (mostly generating stub files that know where the real code is). &amp;nbsp;Python has, in my opinion, the best solution. &amp;nbsp;Specifically, in the &amp;quot;system&amp;quot; directory, you can drop .pth files that point to additional code paths. &amp;nbsp;This is fabulous in that it helps package managers (i.e. dpkg, rpm) plug in code in a manageable way. &amp;nbsp;If Erlang were to have, for example, .epth files in /usr/lib/erlang/bin, that would make an awesome hook for distribution managers. &amp;nbsp;Adding a .erlang directory (in the $HOME) with the same semantics would make it easy for users. &amp;nbsp;It would be nice to move the cookie and hosts file into that directory, but I understand that might be asking too much too soon.
&lt;br&gt;&lt;br&gt;&amp;gt; It's a hint to tell the package manager how often to check for updates
&lt;br&gt;&amp;gt; - I havn't thought through all the details
&lt;br&gt;&amp;gt; it could be something else:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; {checkForUpdates, everyTimeYouStart | dayly | hourly | weekly |
&lt;br&gt;&amp;gt; {after,Year,Month,Day} | {every, 10, minutes}}
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; etc.
&lt;br&gt;Most system administration tasks are done rarely (i.e. running updates with the package manager, which this is a hint for). &amp;nbsp;In this case, everybody else just downloads the current package list and compares it locally. &amp;nbsp;I don't think that hints are all that useful in comparison. &amp;nbsp;They can only generate false positives (expired but no update) and false negatives (not expired, but new update is out there).
&lt;br&gt;&lt;br&gt;&amp;gt; The designer of the program knows what is a sensible value here
&lt;br&gt;Upgrades can trash data. &amp;nbsp;It is not the designer's data. &amp;nbsp;I don't think it takes more than blowing away the data in your RabbitMQ or losing your ejabberd user database to see why this could be extraordinarily bad on a large scale. &amp;nbsp;Bugs happen. &amp;nbsp;Best to let the administrator be in the loop.
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; Again, I humbly suggest more traditional Unix pathnames. &amp;nbsp;How about $HOME/.erlang/library/&amp;lt;component&amp;gt;/&amp;lt;vsn&amp;gt;/prefs.epl?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; No worries ...
&lt;br&gt;Thank you.
&lt;br&gt;&lt;br&gt;&amp;gt; I guess the component framework would use the check for updates or
&lt;br&gt;&amp;gt; expiry date or whatever
&lt;br&gt;&amp;gt; to decide whether to do a check. The check would return a list of
&lt;br&gt;&amp;gt; improvements and the user would decide
&lt;br&gt;&amp;gt; whether or not to install them.
&lt;br&gt;Almost everything under the sun has an update command, but never does anything automatically. &amp;nbsp;I really think it would be prudent. &amp;nbsp;If you want to do &amp;quot;automatic updates&amp;quot;, I would at least suggest that you have it turned off by default, and have it turned on by a project, not the user. &amp;nbsp;The rationale is that the user of a component probably doesn't know enough about how the data is stored to keep it safe, but that the component developer should know.
&lt;br&gt;&lt;br&gt;&amp;gt; I guess we should also be able to roll back a version (which is why I
&lt;br&gt;&amp;gt; have eLibrary/ComponentName/VSN/data ..
&lt;br&gt;&amp;gt; tags.
&lt;br&gt;Definitely. &amp;nbsp;This is another reason that I suggested having a separate &amp;quot;deploy&amp;quot; step. &amp;nbsp;You no longer have to worry about upgrading an installation. &amp;nbsp;Each &amp;quot;version&amp;quot; is another deployment. &amp;nbsp;In this scenario, you can specify &amp;quot;migrations&amp;quot; to upgrade/downgrade the data, but the code is managed as a separate entity.
&lt;br&gt;&lt;br&gt;&amp;gt; It is pretty similar
&lt;br&gt;One is better than two. &amp;nbsp;:)
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Jayson Vantuyl
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26520917&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kagato@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/A-Generic-API-for-controlling-software-components-tp26510088p26520917.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26520958</id>
	<title>Re: Erlang &quot;object-oriented&quot; after all?</title>
	<published>2009-11-25T13:49:11Z</published>
	<updated>2009-11-25T13:49:11Z</updated>
	<author>
		<name>Olivier Boudeville</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;This is surely a shameless plug, but, in terms of OOP with Erlang, one
&lt;br&gt;might give WOOPER a try
&lt;br&gt;(&lt;a href=&quot;http://ceylan.sourceforge.net/main/documentation/wooper/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://ceylan.sourceforge.net/main/documentation/wooper/&lt;/a&gt;), as it
&lt;br&gt;basically provides most OOP constructs in order to rely on concurrent
&lt;br&gt;instances in pure Erlang.
&lt;br&gt;&lt;br&gt;Best regards,
&lt;br&gt;&lt;br&gt;Olivier.
&lt;br&gt;&lt;br&gt;Jachym Holecek a écrit :
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; # Michael Turner 2009-11-24:
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; I ran across a very interesting exchange with Alan Kay, who most likely
&lt;br&gt;&amp;gt;&amp;gt; coined the term &amp;quot;object-oriented programming.&amp;quot;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &lt;a href=&quot;http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; If you'll excuse some (only slightly tendentious) editing of his remarks:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; ----
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot;I thought of objects being like biological cells and/or individual
&lt;br&gt;&amp;gt;&amp;gt; computers on a network, only able to communicate with messages . . . .
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; No, you didn't. If you did, you would certainly have noticed that individual
&lt;br&gt;&amp;gt; cells/computers live concurrently and communicate asynchronously, which is not
&lt;br&gt;&amp;gt; how your objects behave.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; :-)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; SCNR, I still remember the disappointment of discovering (ages back) that
&lt;br&gt;&amp;gt; Objective-C objects didn't really fulfill the &amp;quot;they behave like real-world
&lt;br&gt;&amp;gt; objects&amp;quot; promise given by the (otherwise pretty good) NeXT book because
&lt;br&gt;&amp;gt; you couldn't &amp;quot;run objects in parallel&amp;quot; which sounded like something that
&lt;br&gt;&amp;gt; should obviously be possible.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; 	-- Jachym
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ________________________________________________________________
&lt;br&gt;&amp;gt; erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;&amp;gt; erlang-questions (at) erlang.org
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Erlang-%22object-oriented%22-after-all--tp26491493p26520958.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26517003</id>
	<title>Re: Question about erlang.log</title>
	<published>2009-11-25T09:24:29Z</published>
	<updated>2009-11-25T09:24:29Z</updated>
	<author>
		<name>Rob Charlton-3</name>
	</author>
	<content type="html">Wael Ebrahim wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I have a question about Erlang log. 
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; I have a target system and I want to increase the size and number of log
&lt;br&gt;&amp;gt; files named erlang.log.1 ....erlang.log.5 in the directory ROOT_DIR/log/
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; The default values are 5 files each one is 100K , but I had a very big
&lt;br&gt;&amp;gt; crash that was repeated multiple times causing these files to be
&lt;br&gt;&amp;gt; overwritten, and I couldn't reach its start.
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; I know I can use sasl for this kind of monitoring, but it doesn't log
&lt;br&gt;&amp;gt; the user input on the erlang shell as the erlang.log.x does.
&lt;br&gt;&amp;gt; Also sasl doesn't log any output except from standard applications, or
&lt;br&gt;&amp;gt; error_logger.
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; Any ideas about increasing size of these files &amp;quot;erlang.log.x&amp;quot; ???
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; Thanks in advance,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Wael Ebrahim
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;Before starting run_erl, you can set these environment variables:
&lt;br&gt;&lt;br&gt;export RUN_ERL_LOG_GENERATIONS=10
&lt;br&gt;export RUN_ERL_LOG_MAXSIZE=1000000
&lt;br&gt;&lt;br&gt;see &lt;a href=&quot;http://www.erlang.org/doc/man/run_erl.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/doc/man/run_erl.html&lt;/a&gt;&amp;nbsp;for more details
&lt;br&gt;&lt;br&gt;Cheers
&lt;br&gt;&lt;br&gt;Rob
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Erlang Training and Consulting Ltd
&lt;br&gt;www.erlang-consulting.com
&lt;br&gt;&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Question-about-erlang.log-tp26513772p26517003.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26515384</id>
	<title>Re: Erlang/OTP now at Github</title>
	<published>2009-11-25T08:00:46Z</published>
	<updated>2009-11-25T08:00:46Z</updated>
	<author>
		<name>Björn Gustavsson</name>
	</author>
	<content type="html">On Wed, Nov 25, 2009 at 3:20 PM, Juan Jose Comellas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26515384&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;juanjo@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Why was the commit history discarded? Wouldn't it be better to at
&lt;br&gt;&amp;gt; least preserve the history corresponding to the public releases? Maybe
&lt;br&gt;&amp;gt; you could use Matthew Foemmel's repository[1] in Github as a base.
&lt;br&gt;&lt;br&gt;Including the history would require approximately 300 Mb.
&lt;br&gt;&lt;br&gt;However, &amp;nbsp;we will probably provide an *optional* Erlang/OTP
&lt;br&gt;history that can be added using the new replace mechanism in
&lt;br&gt;git 1.6.5.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Björn Gustavsson, Erlang/OTP, Ericsson AB
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Erlang-OTP-now-at-Github-tp26513316p26515384.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26513833</id>
	<title>Re: Erlang/OTP R13B03 has been released</title>
	<published>2009-11-25T06:30:37Z</published>
	<updated>2009-11-25T06:30:37Z</updated>
	<author>
		<name>zambal</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;Thanks a lot for another OTP release!
&lt;br&gt;&lt;br&gt;I just wanted to say that the links to the torrent files are not
&lt;br&gt;correct. The correct links should be:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.erlang.org/download/torrents/otp_src_R13B03.tar.gz.torrent&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/download/torrents/otp_src_R13B03.tar.gz.torrent&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.erlang.org/download/torrents/otp_win32_R13B03.exe.torrent&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/download/torrents/otp_win32_R13B03.exe.torrent&lt;/a&gt;&lt;br&gt;&lt;br&gt;-
&lt;br&gt;vincent
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Erlang-OTP-R13B03-has-been-released-tp26513036p26513833.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26513772</id>
	<title>Question about erlang.log</title>
	<published>2009-11-25T06:21:27Z</published>
	<updated>2009-11-25T06:21:27Z</updated>
	<author>
		<name>Wael Ebrahim</name>
	</author>
	<content type="html">I have a question about Erlang log. 
&lt;br&gt;&amp;nbsp;
&lt;br&gt;I have a target system and I want to increase the size and number of log
&lt;br&gt;files named erlang.log.1 ....erlang.log.5 in the directory ROOT_DIR/log/
&lt;br&gt;&lt;br&gt;&amp;nbsp;
&lt;br&gt;The default values are 5 files each one is 100K , but I had a very big
&lt;br&gt;crash that was repeated multiple times causing these files to be
&lt;br&gt;overwritten, and I couldn't reach its start.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;I know I can use sasl for this kind of monitoring, but it doesn't log
&lt;br&gt;the user input on the erlang shell as the erlang.log.x does.
&lt;br&gt;Also sasl doesn't log any output except from standard applications, or
&lt;br&gt;error_logger.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;Any ideas about increasing size of these files &amp;quot;erlang.log.x&amp;quot; ???
&lt;br&gt;&amp;nbsp;
&lt;br&gt;Thanks in advance,
&lt;br&gt;&lt;br&gt;Wael Ebrahim
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Question-about-erlang.log-tp26513772p26513772.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26513702</id>
	<title>Re: Erlang/OTP now at Github</title>
	<published>2009-11-25T06:20:14Z</published>
	<updated>2009-11-25T06:20:14Z</updated>
	<author>
		<name>Juan Jose Comellas-4</name>
	</author>
	<content type="html">Why was the commit history discarded? Wouldn't it be better to at
&lt;br&gt;least preserve the history corresponding to the public releases? Maybe
&lt;br&gt;you could use Matthew Foemmel's repository[1] in Github as a base.
&lt;br&gt;&lt;br&gt;[1] &lt;a href=&quot;http://github.com/mfoemmel/erlang-otp/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/mfoemmel/erlang-otp/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;2009/11/25 Björn Gustavsson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26513702&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bgustavsson@...&lt;/a&gt;&amp;gt;
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The official git repository for Erlang/OTP can now be found at Github:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://github.com/erlang/otp&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/erlang/otp&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Build instructions can be found at:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://wiki.github.com/erlang/otp&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://wiki.github.com/erlang/otp&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; We plan to add more wiki pages with additional information in the
&lt;br&gt;&amp;gt; near future.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Björn Gustavsson, Erlang/OTP, Ericsson AB
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ________________________________________________________________
&lt;br&gt;&amp;gt; erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;&amp;gt; erlang-questions (at) erlang.org
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Erlang-OTP-now-at-Github-tp26513316p26513702.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26513562</id>
	<title>Re: Erlang &quot;object-oriented&quot; after all?</title>
	<published>2009-11-25T06:14:06Z</published>
	<updated>2009-11-25T06:14:06Z</updated>
	<author>
		<name>Jachym Holecek-3</name>
	</author>
	<content type="html"># Michael Turner 2009-11-24:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I ran across a very interesting exchange with Alan Kay, who most likely
&lt;br&gt;&amp;gt; coined the term &amp;quot;object-oriented programming.&amp;quot;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &lt;a href=&quot;http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; If you'll excuse some (only slightly tendentious) editing of his remarks:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ----
&lt;br&gt;&amp;gt; &amp;quot;I thought of objects being like biological cells and/or individual
&lt;br&gt;&amp;gt; computers on a network, only able to communicate with messages . . . .
&lt;/div&gt;&lt;br&gt;No, you didn't. If you did, you would certainly have noticed that individual
&lt;br&gt;cells/computers live concurrently and communicate asynchronously, which is not
&lt;br&gt;how your objects behave.
&lt;br&gt;&lt;br&gt;:-)
&lt;br&gt;&lt;br&gt;SCNR, I still remember the disappointment of discovering (ages back) that
&lt;br&gt;Objective-C objects didn't really fulfill the &amp;quot;they behave like real-world
&lt;br&gt;objects&amp;quot; promise given by the (otherwise pretty good) NeXT book because
&lt;br&gt;you couldn't &amp;quot;run objects in parallel&amp;quot; which sounded like something that
&lt;br&gt;should obviously be possible.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -- Jachym
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Erlang-%22object-oriented%22-after-all--tp26491493p26513562.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26513316</id>
	<title>Erlang/OTP now at Github</title>
	<published>2009-11-25T06:01:24Z</published>
	<updated>2009-11-25T06:01:24Z</updated>
	<author>
		<name>Björn Gustavsson</name>
	</author>
	<content type="html">The official git repository for Erlang/OTP can now be found at Github:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://github.com/erlang/otp&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/erlang/otp&lt;/a&gt;&lt;br&gt;&lt;br&gt;Build instructions can be found at:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://wiki.github.com/erlang/otp&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://wiki.github.com/erlang/otp&lt;/a&gt;&lt;br&gt;&lt;br&gt;We plan to add more wiki pages with additional information in the
&lt;br&gt;near future.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Björn Gustavsson, Erlang/OTP, Ericsson AB
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Erlang-OTP-now-at-Github-tp26513316p26513316.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26513231</id>
	<title>Re: mnesia:transform_table</title>
	<published>2009-11-25T06:00:59Z</published>
	<updated>2009-11-25T06:00:59Z</updated>
	<author>
		<name>andrew mmc</name>
	</author>
	<content type="html">That would be the reason I couldn't find it anywhere in the documentation
&lt;br&gt;then!
&lt;br&gt;&lt;br&gt;I'll just live with the old table name, it seems easier!
&lt;br&gt;&lt;br&gt;Thanks very much,
&lt;br&gt;&lt;br&gt;Andrew
&lt;br&gt;&lt;br&gt;2009/11/25 Håkan Mattsson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26513231&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;hakan@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 2009/11/25 andrew mmc &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26513231&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;andrewmmc@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; So I guess the next question, is: how do I change the table name!?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It is not supported. As a last resort you can do it off-line by creating a
&lt;br&gt;&amp;gt; backup, use mnesia:traverse_backup/8 to patch the backup and then
&lt;br&gt;&amp;gt; restore the database from the backup. But if you would do that you
&lt;br&gt;&amp;gt; could transform the records off-line also.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; /Håkan
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mnesia%3Atransform_table-tp26512368p26513231.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26513142</id>
	<title>Re: mnesia:transform_table</title>
	<published>2009-11-25T05:56:42Z</published>
	<updated>2009-11-25T05:56:42Z</updated>
	<author>
		<name>Håkan Mattsson-2</name>
	</author>
	<content type="html">2009/11/25 andrew mmc &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26513142&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;andrewmmc@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&lt;br&gt;&amp;gt; So I guess the next question, is: how do I change the table name!?
&lt;br&gt;&lt;br&gt;It is not supported. As a last resort you can do it off-line by creating a
&lt;br&gt;backup, use mnesia:traverse_backup/8 to patch the backup and then
&lt;br&gt;restore the database from the backup. But if you would do that you
&lt;br&gt;could transform the records off-line also.
&lt;br&gt;&lt;br&gt;/Håkan
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mnesia%3Atransform_table-tp26512368p26513142.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26513036</id>
	<title>Erlang/OTP R13B03 has been released</title>
	<published>2009-11-25T05:49:50Z</published>
	<updated>2009-11-25T05:49:50Z</updated>
	<author>
		<name>Björn Gustavsson</name>
	</author>
	<content type="html">Bug fix release : otp_src_R13B03
&lt;br&gt;Build date &amp;nbsp; &amp;nbsp; &amp;nbsp;: 2009-11-23
&lt;br&gt;&lt;br&gt;This is R13B03, the third maintenance release for the R13B major release.
&lt;br&gt;&lt;br&gt;You can find the README file for the release at
&lt;br&gt;&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://www.erlang.org/download/otp_src_R13B03.readme&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/download/otp_src_R13B03.readme&lt;/a&gt;&lt;br&gt;&lt;br&gt;The source distribution and binary distribution for Windows can be
&lt;br&gt;downloaded from
&lt;br&gt;&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://www.erlang.org/download/otp_src_R13B03.tar.gz&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/download/otp_src_R13B03.tar.gz&lt;/a&gt;&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://www.erlang.org/download/otp_win32_R13B03.exe&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/download/otp_win32_R13B03.exe&lt;/a&gt;&lt;br&gt;&lt;br&gt;The distribution can also be downloaded using the BitTorrent
&lt;br&gt;protocol. Use the following torrent files to download the source
&lt;br&gt;distribution and binary distribution for Windows:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://www.erlang.org/download/otp_src_R13B03.tar.gz.torrent&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/download/otp_src_R13B03.tar.gz.torrent&lt;/a&gt;&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://www.erlang.org/download/otp_win32_R13B03.exe.torrent&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/download/otp_win32_R13B03.exe.torrent&lt;/a&gt;&lt;br&gt;&lt;br&gt;Note: To unpack the TAR archive you need a GNU TAR compatible program.
&lt;br&gt;&lt;br&gt;For installation instructions please read the README file that is part
&lt;br&gt;of the distribution.
&lt;br&gt;&lt;br&gt;The on-line documentation can be found at: &lt;a href=&quot;http://www.erlang.org/doc/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/doc/&lt;/a&gt;&lt;br&gt;You can also download the complete HTML documentation or the Unix manual files
&lt;br&gt;&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://www.erlang.org/download/otp_doc_html_R13B03.tar.gz&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/download/otp_doc_html_R13B03.tar.gz&lt;/a&gt;&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://www.erlang.org/download/otp_doc_man_R13B03.tar.gz&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/download/otp_doc_man_R13B03.tar.gz&lt;/a&gt;&lt;br&gt;&lt;br&gt;We also want to thank those that sent us patches, suggestions and bug
&lt;br&gt;reports,
&lt;br&gt;&lt;br&gt;The OTP Team
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Björn Gustavsson, Erlang/OTP, Ericsson AB
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Erlang-OTP-R13B03-has-been-released-tp26513036p26513036.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26512981</id>
	<title>Re: mnesia:transform_table</title>
	<published>2009-11-25T05:47:39Z</published>
	<updated>2009-11-25T05:47:39Z</updated>
	<author>
		<name>andrew mmc</name>
	</author>
	<content type="html">Hi Håkan,
&lt;br&gt;&lt;br&gt;Thanks for your answer... Actually I see that it has worked - I expected the
&lt;br&gt;table name to change with the record name, but the name is the same as
&lt;br&gt;before. &amp;nbsp;I got an empty table because I used dirty_match_object without
&lt;br&gt;specifying the 'old' table name.
&lt;br&gt;&lt;br&gt;So I guess the next question, is: how do I change the table name!?
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;&lt;br&gt;Andrew
&lt;br&gt;&lt;br&gt;2009/11/25 Håkan Mattsson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26512981&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;hawk.mattsson@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; It looks like you have done the right thing. Perhaps you have
&lt;br&gt;&amp;gt; simplified your code too much in order to post it on the list?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I tried to reproduce your error, but it worked for me.
&lt;br&gt;&amp;gt; See the printouts and the test program below.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; /Håkan
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 16&amp;gt; foo:go(foo).
&lt;br&gt;&amp;gt; Before: [{old,7,49},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {old,6,36},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {old,4,16},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {old,1,1},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {old,9,81},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {old,10,100},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {old,8,64},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {old,2,4},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {old,3,9},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {old,5,25}]
&lt;br&gt;&amp;gt; Before: [{new,7,49,42},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {new,6,36,42},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {new,4,16,42},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {new,1,1,42},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {new,9,81,42},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {new,10,100,42},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {new,8,64,42},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {new,2,4,42},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {new,3,9,42},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {new,5,25,42}]
&lt;br&gt;&amp;gt; ok
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -module(foo).
&lt;br&gt;&amp;gt; -compile([export_all]).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -record(old, {key, val}).
&lt;br&gt;&amp;gt; -record(new, {key, val, extra}).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; go(Tab) -&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;mnesia:delete_table(Tab),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;{atomic, ok} = mnesia:create_table(Tab, [{attributes,
&lt;br&gt;&amp;gt; record_info(fields, old)},
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {record_name, old}]),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;[mnesia:dirty_write(Tab, #old{key = K, val = K*K}) || K &amp;lt;-
&lt;br&gt;&amp;gt; lists:seq(1,10)],
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;io:format(&amp;quot;Before: ~p\n&amp;quot;, [ets:tab2list(Tab)]),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Transformer =
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fun(#old{key = Key, val = Val}) -&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#new{key = Key, val = Val, extra = 42}
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;{atomic, ok} = mnesia:transform_table(Tab, Transformer,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;record_info(fields, new),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;io:format(&amp;quot;Before: ~p\n&amp;quot;, [ets:tab2list(Tab)]).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Wed, Nov 25, 2009 at 2:07 PM, andrew mmc &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26512981&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;andrewmmc@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; Hello,
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I needed to change the structure of an mnesia table. &amp;nbsp;I followed the
&lt;br&gt;&amp;gt; example
&lt;br&gt;&amp;gt; &amp;gt; in the documentation:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; -record(old, {key, val}).
&lt;br&gt;&amp;gt; &amp;gt; -record(new, {key, val, extra}).
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Transformer =
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; fun(X) when record(X, old) -&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;#new{key = X#old.key,
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; val = X#old.val,
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; extra = 42}
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; end,
&lt;br&gt;&amp;gt; &amp;gt; {atomic, ok} = mnesia:transform_table(foo, Transformer,
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;record_info(fields, new),
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new)
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Substituting the record names and field mappings as per my
&lt;br&gt;&amp;gt; &amp;gt; requirement. The transformation function works fine when I test it on
&lt;br&gt;&amp;gt; &amp;gt; a record of the old type, outputting the new record ok.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; However, now when I try to read from the new table, mnesia reports
&lt;br&gt;&amp;gt; &amp;gt; no_exists, and the old table still exists but reads as empty... &amp;nbsp;Where
&lt;br&gt;&amp;gt; &amp;gt; has my data gone?!
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Any help much appreciated!
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Regards,
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Andrew
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Wed, Nov 25, 2009 at 2:07 PM, andrew mmc &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26512981&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;andrewmmc@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; Hello,
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I needed to change the structure of an mnesia table. &amp;nbsp;I followed the
&lt;br&gt;&amp;gt; example
&lt;br&gt;&amp;gt; &amp;gt; in the documentation:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; -record(old, {key, val}).
&lt;br&gt;&amp;gt; &amp;gt; -record(new, {key, val, extra}).
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Transformer =
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; fun(X) when record(X, old) -&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;#new{key = X#old.key,
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; val = X#old.val,
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; extra = 42}
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; end,
&lt;br&gt;&amp;gt; &amp;gt; {atomic, ok} = mnesia:transform_table(foo, Transformer,
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;record_info(fields, new),
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new)
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Substituting the record names and field mappings as per my
&lt;br&gt;&amp;gt; &amp;gt; requirement. The transformation function works fine when I test it on
&lt;br&gt;&amp;gt; &amp;gt; a record of the old type, outputting the new record ok.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; However, now when I try to read from the new table, mnesia reports
&lt;br&gt;&amp;gt; &amp;gt; no_exists, and the old table still exists but reads as empty... &amp;nbsp;Where
&lt;br&gt;&amp;gt; &amp;gt; has my data gone?!
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Any help much appreciated!
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Regards,
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Andrew
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mnesia%3Atransform_table-tp26512368p26512981.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26512853</id>
	<title>Re: mnesia:transform_table</title>
	<published>2009-11-25T05:40:21Z</published>
	<updated>2009-11-25T05:40:21Z</updated>
	<author>
		<name>Håkan Mattsson</name>
	</author>
	<content type="html">It looks like you have done the right thing. Perhaps you have
&lt;br&gt;simplified your code too much in order to post it on the list?
&lt;br&gt;&lt;br&gt;I tried to reproduce your error, but it worked for me.
&lt;br&gt;See the printouts and the test program below.
&lt;br&gt;&lt;br&gt;/Håkan
&lt;br&gt;&lt;br&gt;16&amp;gt; foo:go(foo).
&lt;br&gt;Before: [{old,7,49},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{old,6,36},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{old,4,16},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{old,1,1},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{old,9,81},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{old,10,100},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{old,8,64},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{old,2,4},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{old,3,9},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{old,5,25}]
&lt;br&gt;Before: [{new,7,49,42},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{new,6,36,42},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{new,4,16,42},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{new,1,1,42},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{new,9,81,42},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{new,10,100,42},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{new,8,64,42},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{new,2,4,42},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{new,3,9,42},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{new,5,25,42}]
&lt;br&gt;ok
&lt;br&gt;&lt;br&gt;&lt;br&gt;-module(foo).
&lt;br&gt;-compile([export_all]).
&lt;br&gt;&lt;br&gt;-record(old, {key, val}).
&lt;br&gt;-record(new, {key, val, extra}).
&lt;br&gt;&lt;br&gt;go(Tab) -&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; mnesia:delete_table(Tab),
&lt;br&gt;&amp;nbsp; &amp;nbsp; {atomic, ok} = mnesia:create_table(Tab, [{attributes,
&lt;br&gt;record_info(fields, old)},
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{record_name, old}]),
&lt;br&gt;&amp;nbsp; &amp;nbsp; [mnesia:dirty_write(Tab, #old{key = K, val = K*K}) || K &amp;lt;- lists:seq(1,10)],
&lt;br&gt;&amp;nbsp; &amp;nbsp; io:format(&amp;quot;Before: ~p\n&amp;quot;, [ets:tab2list(Tab)]),
&lt;br&gt;&amp;nbsp; &amp;nbsp; Transformer =
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fun(#old{key = Key, val = Val}) -&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #new{key = Key, val = Val, extra = 42}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; {atomic, ok} = mnesia:transform_table(Tab, Transformer,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; record_info(fields, new),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new),
&lt;br&gt;&amp;nbsp; &amp;nbsp; io:format(&amp;quot;Before: ~p\n&amp;quot;, [ets:tab2list(Tab)]).
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;On Wed, Nov 25, 2009 at 2:07 PM, andrew mmc &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26512853&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;andrewmmc@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I needed to change the structure of an mnesia table. &amp;nbsp;I followed the example
&lt;br&gt;&amp;gt; in the documentation:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -record(old, {key, val}).
&lt;br&gt;&amp;gt; -record(new, {key, val, extra}).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Transformer =
&lt;br&gt;&amp;gt; &amp;nbsp; fun(X) when record(X, old) -&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;#new{key = X#old.key,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; val = X#old.val,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; extra = 42}
&lt;br&gt;&amp;gt; &amp;nbsp; end,
&lt;br&gt;&amp;gt; {atomic, ok} = mnesia:transform_table(foo, Transformer,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;record_info(fields, new),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Substituting the record names and field mappings as per my
&lt;br&gt;&amp;gt; requirement. The transformation function works fine when I test it on
&lt;br&gt;&amp;gt; a record of the old type, outputting the new record ok.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; However, now when I try to read from the new table, mnesia reports
&lt;br&gt;&amp;gt; no_exists, and the old table still exists but reads as empty... &amp;nbsp;Where
&lt;br&gt;&amp;gt; has my data gone?!
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Any help much appreciated!
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Andrew
&lt;/div&gt;&lt;br&gt;On Wed, Nov 25, 2009 at 2:07 PM, andrew mmc &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26512853&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;andrewmmc@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I needed to change the structure of an mnesia table.  I followed the example
&lt;br&gt;&amp;gt; in the documentation:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -record(old, {key, val}).
&lt;br&gt;&amp;gt; -record(new, {key, val, extra}).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Transformer =
&lt;br&gt;&amp;gt;   fun(X) when record(X, old) -&amp;gt;
&lt;br&gt;&amp;gt;      #new{key = X#old.key,
&lt;br&gt;&amp;gt;           val = X#old.val,
&lt;br&gt;&amp;gt;           extra = 42}
&lt;br&gt;&amp;gt;   end,
&lt;br&gt;&amp;gt; {atomic, ok} = mnesia:transform_table(foo, Transformer,
&lt;br&gt;&amp;gt;                                      record_info(fields, new),
&lt;br&gt;&amp;gt;                                      new)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Substituting the record names and field mappings as per my
&lt;br&gt;&amp;gt; requirement. The transformation function works fine when I test it on
&lt;br&gt;&amp;gt; a record of the old type, outputting the new record ok.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; However, now when I try to read from the new table, mnesia reports
&lt;br&gt;&amp;gt; no_exists, and the old table still exists but reads as empty...  Where
&lt;br&gt;&amp;gt; has my data gone?!
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Any help much appreciated!
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Andrew
&lt;/div&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mnesia%3Atransform_table-tp26512368p26512853.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26512461</id>
	<title>Re: A Generic API for controlling software  components</title>
	<published>2009-11-25T05:12:55Z</published>
	<updated>2009-11-25T05:12:55Z</updated>
	<author>
		<name>Joe Armstrong-2</name>
	</author>
	<content type="html">On Wed, Nov 25, 2009 at 1:40 PM, Jayson Vantuyl &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26512461&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kagato@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; First, let me take a stab at describing the goal (or what I think is and should be the goal) of components.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It seems that you're trying to address:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 1.  Unifying execution / configuration conventions across popular Erlang projects.
&lt;br&gt;&amp;gt; 2.  Putting some sort of management conventions around deployments of said products.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So, I don't think you're going to get a lot of traction on #2 unless it makes deployment easier.  Right now, those programs all have ad-hoc conventions precisely because Erlang's deployment conventions, while rock solid, are nearly impossible to use outside of an embedded environment.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If you really want to make things better (and I'm sure you do), here's what I suggest doing.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Don't create yet-another-packaging-abstraction (i.e. components).  Applications are perfectly fine for this.  Really.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;I guess you mean OTP applications? - If so then I disagree. To start
&lt;br&gt;with the directory structure within
&lt;br&gt;an OTP application is fixed which I don't really like. Also there is
&lt;br&gt;no construction rule
&lt;br&gt;that says you are not allowed to write anything in the application
&lt;br&gt;directory tree. I'd like to put the
&lt;br&gt;entire component in a read-only area of disk for safety reasons (once
&lt;br&gt;an initial install has been performed).
&lt;br&gt;&lt;br&gt;Some people want to put components into read-only memory for embedded
&lt;br&gt;devices - it also makes it
&lt;br&gt;easier to scan things for security reasons.
&lt;br&gt;&lt;br&gt;&amp;gt; Address the issues that make it hard to deploy Erlang applications.  Specifically, applications should probably be deployed as a set of modules in a second LIBDIR, that shadows the existing one, thereby reducing the number of duplicates of the entire environment (which is a current problem with Erlang's release stuff).  I already do this, and it's great.
&lt;br&gt;&lt;br&gt;I have a differnt proposal for reducing duplicates - this is a
&lt;br&gt;different problem.
&lt;br&gt;&lt;br&gt;Yes to deploying Erlang components *and upgrading them*
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Address issues that make deploying applications hard, in general.  The CLI itch is a good one to scratch.  Make it trivial to write a CLI event handler.  Make it a normal gen_event.  Maybe require a key in the app config (maybe {cli_handler,Module}) or perhaps just have a convention (something like an atom of the form '&amp;lt;application&amp;gt;_cli').  For that matter, make a distribution container that is more like a gem/egg.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I think this is really want you want.  Installing an Erlang application should be as easy as commands something like:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; # epkg install rabbitmq
&lt;br&gt;&amp;gt; ...downloads, builds, and installs rabbitmq code somewhere sane...
&lt;br&gt;&amp;gt; # epkg deploy rabbitmq mydeploy
&lt;br&gt;&amp;gt; ...generates a &amp;quot;deployment&amp;quot; somewhere, basically just config and state data, mydeploy is used to generate nodenames (i.e. mydeploy_rabbitmq_main, mydeploy_rabbitmq_helper, etc)...
&lt;br&gt;&amp;gt; # ectl mydeploy start
&lt;br&gt;&amp;gt; ...starts nodes specified for the deploy...
&lt;br&gt;&amp;gt; # ectl mydeploy flush_cache
&lt;br&gt;&amp;gt; ...since flush_cache is not implemented by ectl, it should be passed through to an event handler...
&lt;/div&gt;&lt;br&gt;Sure. epkg etc. will be just a thin shell script layer over the API I suggested.
&lt;br&gt;The CLI can be written as a thin layer over the API as well.
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Obviously there's a lot to go on under the covers, but anything more complex than that is, at best, a well engineered user-experience failure.  More importantly, I think the above captures what you should be doing.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; All of that said, here are my comments on the proposal, so far (most of which I've already stated above):
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; What I would like to do is manage all the components in a uniform manner.
&lt;br&gt;&amp;gt;&amp;gt; Much of this design is inspired by how Mac OS-X manages applications.
&lt;br&gt;&amp;gt; Why not just use the application framework, again?  It's 90% there for this.
&lt;br&gt;&lt;br&gt;because 90% is not enough
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; Is there anything about an application that makes it unsuitable (i.e. smaller than) a component?  I would just add this to an application.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; By manage I mean start and stop the component, upgrade the code,
&lt;br&gt;&amp;gt;&amp;gt; change the behavior of the component at run time and so on.
&lt;br&gt;&amp;gt; I think you're thinking in terms of actual user-level management, right?  Basically, this is to unify things like ejabberdctl and rabbitmqctl.  I think that's a fantastic idea.
&lt;br&gt;&lt;br&gt;Of course. I just want to download yaws, ejabberd etc. drop them into
&lt;br&gt;my eComponent Directory
&lt;br&gt;and that's it - they are installed and runnable.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Looking forward, I'd suggest taking a hard look at Ruby gems and Python distutils/setuputils/eggs.  I really think that it would make a lot of sense to take the existing Erlang release system and use it to make something not unlike a gem or egg (which it already kind of does, but at a whole-Erlang-system level, not a component level).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; As for the command line, it would be extremely handy to be able to have a convention where the nodename of a certain component was known, and there was a command line wrapper to send it commands.  Perhaps, have the component run a gen_event, and have &amp;quot;erlctl &amp;lt;component&amp;gt; &amp;lt;command&amp;gt; [args...]&amp;quot; generate an event in the node that the component runs in.  Extending edoc to generate commandline documentation would be killer here, too.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Here's a suggestion for a set of rules for managed components:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;    Draft 1 - 25 Nov 2009
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;    Rule1: All components are unpacked into the same top-level
&lt;br&gt;&amp;gt;&amp;gt;           directory (default $HOME/eComponent) and have the extension
&lt;br&gt;&amp;gt;&amp;gt;           .ec (Erlang component)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;           Example: Imagine I have installed mochiweb ejabberd and couchDB
&lt;br&gt;&amp;gt;&amp;gt;          then after installation I should see the following:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;          $pwd
&lt;br&gt;&amp;gt;&amp;gt;           /home/joe/eComponents
&lt;br&gt;&amp;gt;&amp;gt;           $ls
&lt;br&gt;&amp;gt;&amp;gt;           mochiweb.ec ejabberd.ec couchDB.ec
&lt;br&gt;&amp;gt; I don't think eComponents, as a non-hidden top-level directory is going to thrill the aesthetic sense of most Unix users.  I would humbly suggest something more like $HOME/.erlang/components/.  Or, better yet, a system directory (probably just in the Erlang code root) and a user directory ($HOME/.erlang/lib).
&lt;/div&gt;&lt;br&gt;Ok, I didn't fully specify this - fine to change the details here or
&lt;br&gt;use an environment variable to point
&lt;br&gt;to the directory.
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;    Rule2: A normal user should *never* have to examine any of the
&lt;br&gt;&amp;gt;&amp;gt;           files *inside* the component. To do so causes
&lt;br&gt;&amp;gt;&amp;gt;           &amp;quot;abstraction leakage&amp;quot; - I want to consider each of these
&lt;br&gt;&amp;gt;&amp;gt;           components as black boxes. Once installed the component
&lt;br&gt;&amp;gt;&amp;gt;          should be installed in a read-only disk area.
&lt;br&gt;&amp;gt; Certainly.
&lt;br&gt;&lt;br&gt;This is the bit that is not enforced in OTP applications - I think
&lt;br&gt;users are even encouraged to use the /priv
&lt;br&gt;directory in an otp application
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;    Rule3: The component should not break if relocated to a different
&lt;br&gt;&amp;gt;&amp;gt;           top-level directory. A simple &amp;quot;mv&amp;quot; command should suffice
&lt;br&gt;&amp;gt;&amp;gt;          So no hard-wired paths or links please.
&lt;br&gt;&amp;gt; Certainly.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;    Rule4: All components C must have a file called
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;           $HOME/eComponents/C.ec/Preferences.pl
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;          The extension .pl means the file contains a property
&lt;br&gt;&amp;gt;&amp;gt;           list. Here is an example:
&lt;br&gt;&amp;gt; .pl is bad mojo, as it's universally accepts to be Perl.  How about, .epl (i.e. Erlang Property List).
&lt;/div&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Ok .eplist then?
&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;           {codePath, &amp;quot;/bin&amp;quot;}.
&lt;br&gt;&amp;gt;&amp;gt;           {expiryDate, {2009,12,24}}.
&lt;br&gt;&amp;gt;&amp;gt;          {icon, &amp;quot;/images/myIcon.png&amp;quot;}
&lt;br&gt;&amp;gt;&amp;gt;          {version,1}
&lt;br&gt;&amp;gt;&amp;gt;           {myKey1, ...}
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;           The keys codePath, version, and expiryDate are obligatory
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;           Why do we need code path? - so that Erlang can find
&lt;br&gt;&amp;gt;&amp;gt;           a module called C.erl
&lt;br&gt;&amp;gt; If the code path is relative, what is gained by having it specifiable?  Why not just have a convention that it's ebin (or maybe have component/lib be added as an additional LIBDIR).
&lt;/div&gt;&lt;br&gt;Because I might not want to follow that particular convention. For
&lt;br&gt;simple applications I usually put everything in one directory.
&lt;br&gt;Actually this could be dropped, the system could scan the filesystem
&lt;br&gt;to find the code paths
&lt;br&gt;the first time you run the program.
&lt;br&gt;directory
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;           Expiry date has a &amp;quot;time to live for the component&amp;quot;
&lt;br&gt;&amp;gt;&amp;gt;           Version is used for local configuration data (see later)
&lt;br&gt;&amp;gt;&amp;gt;           Version numbers should start at one and be increased by one
&lt;br&gt;&amp;gt;&amp;gt;           for each new release.
&lt;br&gt;&amp;gt; The expiry time thing is confusing to me.  Is this automatically done by some program, or is it metadata for a person?
&lt;br&gt;&lt;br&gt;It's a hint to tell the package manager how often to check for updates
&lt;br&gt;- I havn't thought through all the details
&lt;br&gt;it could be something else:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{checkForUpdates, everyTimeYouStart | dayly | hourly | weekly |
&lt;br&gt;{after,Year,Month,Day} | {every, 10, minutes}}
&lt;br&gt;&lt;br&gt;etc.
&lt;br&gt;&lt;br&gt;The designer of the program knows what is a sensible value here
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;    Rule5: Local configuration data
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;           Local configuration data must not be stored under the
&lt;br&gt;&amp;gt;&amp;gt;           eComponents directory - (you can't remember we said the
&lt;br&gt;&amp;gt;&amp;gt;           component is in a read-only disk area - see rule2)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;           Local data for the component C must be stored
&lt;br&gt;&amp;gt;&amp;gt;           in the directory
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;           $HOME/eLibrary/ComponentName/Vsn
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;          Thus local preferences for ejabberd version 1
&lt;br&gt;&amp;gt;&amp;gt;          would be stored in the file
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;          $HOME/eLibrary/ejabberd/1/Preferences.pl
&lt;br&gt;&amp;gt; Again, I humbly suggest more traditional Unix pathnames.  How about $HOME/.erlang/library/&amp;lt;component&amp;gt;/&amp;lt;vsn&amp;gt;/prefs.epl?
&lt;/div&gt;&lt;br&gt;No worries ...
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;     Rule6: Code upgrade
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;           We should upgrade an component C when it's expiry date has
&lt;br&gt;&amp;gt;&amp;gt;           been reached. To update an component we delete the entire
&lt;br&gt;&amp;gt;&amp;gt;           component under $HOME/eComponents/C.ec we install the
&lt;br&gt;&amp;gt;&amp;gt;           new component and run the command: C:install().
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;           Data that is to be carried over between different versions
&lt;br&gt;&amp;gt;&amp;gt;           of the component is stored in $HOME/eLibrary/C/V/...
&lt;br&gt;&amp;gt; Is this done by the component framework?  Is this really a good idea to be done automatically?  Automatically deployed upgrades have generally been associated with tears and gnashing of teeth in my experience.
&lt;/div&gt;&lt;br&gt;I guess the component framework would use the check for updates or
&lt;br&gt;expiry date or whatever
&lt;br&gt;to decide whether to do a check. The check would return a list of
&lt;br&gt;improvements and the user would decide
&lt;br&gt;whether or not to install them.
&lt;br&gt;&lt;br&gt;I guess we should also be able to roll back a version (which is why I
&lt;br&gt;have eLibrary/ComponentName/VSN/data ..
&lt;br&gt;tags.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;     Rule7: management
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;         All components C must provide a module in the file
&lt;br&gt;&amp;gt;&amp;gt;         C_control.erl - so ejabberd provides ejabberd_control.erl
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;         The management API is as follows:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;         C:start_link() -&amp;gt; Pid
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;            create a controller process for the component.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;         Pid has the following protocol [see note 1 for notation]
&lt;br&gt;&amp;gt;&amp;gt;         PL is a property list (list of {Key::atom(), Value::any()}
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;          Pid !! {start, PL} =&amp;gt; ok | {error, Why}
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;             Cold start the component. PL is a property
&lt;br&gt;&amp;gt;&amp;gt;              list describing how the component should behave
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;         Pid !! {stop, PL} =&amp;gt; ok
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;             Stop the component
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;         Pid !! {modify, PL} =&amp;gt; ok | {error, Why}
&lt;br&gt;&amp;gt;&amp;gt;             Change the behavior of the component
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;         Pid !! info =&amp;gt; PL
&lt;br&gt;&amp;gt;&amp;gt;         Pid !! {info, [Keys]} =&amp;gt; [Values]
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;         Pid !! suspendLocal =&amp;gt; ok
&lt;br&gt;&amp;gt;&amp;gt;         Pid !! resumeLocal =&amp;gt; ok
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;               Suspend the component data can be written to
&lt;br&gt;&amp;gt;&amp;gt;               $HOME/eLibrary/ComponentName/Vsn/...
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;          Pid !! suspendRemote =&amp;gt; &amp;lt;&amp;lt;BinaryClosure&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;          Pid !! {resumeRemote, &amp;lt;&amp;lt;BinaryClosure&amp;gt;&amp;gt;} =&amp;gt; ok
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;                This ton suspend an component on one machine
&lt;br&gt;&amp;gt;&amp;gt;                and resume it on another
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This looks a lot like it could just use the existing application framework.  I don't think that most of this would even require breaking backwards-compatibility.
&lt;/div&gt;&lt;br&gt;It is pretty similar
&lt;br&gt;&lt;br&gt;/Joe
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Jayson Vantuyl
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26512461&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kagato@...&lt;/a&gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ________________________________________________________________
&lt;br&gt;&amp;gt; erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;&amp;gt; erlang-questions (at) erlang.org
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/A-Generic-API-for-controlling-software-components-tp26510088p26512461.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26512368</id>
	<title>mnesia:transform_table</title>
	<published>2009-11-25T05:07:21Z</published>
	<updated>2009-11-25T05:07:21Z</updated>
	<author>
		<name>andrew mmc</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I needed to change the structure of an mnesia table. &amp;nbsp;I followed the example
&lt;br&gt;in the documentation:
&lt;br&gt;&lt;br&gt;-record(old, {key, val}).
&lt;br&gt;-record(new, {key, val, extra}).
&lt;br&gt;&lt;br&gt;Transformer =
&lt;br&gt;&amp;nbsp; &amp;nbsp;fun(X) when record(X, old) -&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; #new{key = X#old.key,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;val = X#old.val,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;extra = 42}
&lt;br&gt;&amp;nbsp; &amp;nbsp;end,
&lt;br&gt;{atomic, ok} = mnesia:transform_table(foo, Transformer,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; record_info(fields, new),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new)
&lt;br&gt;&lt;br&gt;Substituting the record names and field mappings as per my
&lt;br&gt;requirement. The transformation function works fine when I test it on
&lt;br&gt;a record of the old type, outputting the new record ok.
&lt;br&gt;&lt;br&gt;However, now when I try to read from the new table, mnesia reports
&lt;br&gt;no_exists, and the old table still exists but reads as empty... &amp;nbsp;Where
&lt;br&gt;has my data gone?!
&lt;br&gt;&lt;br&gt;Any help much appreciated!
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&lt;br&gt;&lt;br&gt;Andrew
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mnesia%3Atransform_table-tp26512368p26512368.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26512048</id>
	<title>Re: A Generic API for controlling software   components</title>
	<published>2009-11-25T04:41:16Z</published>
	<updated>2009-11-25T04:41:16Z</updated>
	<author>
		<name>Frank Müller</name>
	</author>
	<content type="html">&amp;gt; The idea is sound. &amp;nbsp;The execution is suboptimal here. &amp;nbsp;The ending *.pl* is
&lt;br&gt;&amp;gt; embedded in the minds of a very large number of people as a perl script.
&lt;br&gt;&amp;gt; Choose perhaps a longer, more descriptive extension like, say, .proplist or
&lt;br&gt;&amp;gt; .propl or .plist or whatever?
&lt;br&gt;&lt;br&gt;.plist is used in OS X. So I would vite for .proplist.
&lt;br&gt;&lt;br&gt;mue
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;**
&lt;br&gt;** Frank Mueller / Oldenburg / Germany
&lt;br&gt;**
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/A-Generic-API-for-controlling-software-components-tp26510088p26512048.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26511979</id>
	<title>Re: A Generic API for controlling software components</title>
	<published>2009-11-25T04:40:21Z</published>
	<updated>2009-11-25T04:40:21Z</updated>
	<author>
		<name>Jayson Vantuyl-2</name>
	</author>
	<content type="html">First, let me take a stab at describing the goal (or what I think is and should be the goal) of components.
&lt;br&gt;&lt;br&gt;It seems that you're trying to address:
&lt;br&gt;&lt;br&gt;1. &amp;nbsp;Unifying execution / configuration conventions across popular Erlang projects.
&lt;br&gt;2. &amp;nbsp;Putting some sort of management conventions around deployments of said products.
&lt;br&gt;&lt;br&gt;So, I don't think you're going to get a lot of traction on #2 unless it makes deployment easier. &amp;nbsp;Right now, those programs all have ad-hoc conventions precisely because Erlang's deployment conventions, while rock solid, are nearly impossible to use outside of an embedded environment.
&lt;br&gt;&lt;br&gt;If you really want to make things better (and I'm sure you do), here's what I suggest doing.
&lt;br&gt;&lt;br&gt;Don't create yet-another-packaging-abstraction (i.e. components). &amp;nbsp;Applications are perfectly fine for this. &amp;nbsp;Really.
&lt;br&gt;&lt;br&gt;Address the issues that make it hard to deploy Erlang applications. &amp;nbsp;Specifically, applications should probably be deployed as a set of modules in a second LIBDIR, that shadows the existing one, thereby reducing the number of duplicates of the entire environment (which is a current problem with Erlang's release stuff). &amp;nbsp;I already do this, and it's great.
&lt;br&gt;&lt;br&gt;Address issues that make deploying applications hard, in general. &amp;nbsp;The CLI itch is a good one to scratch. &amp;nbsp;Make it trivial to write a CLI event handler. &amp;nbsp;Make it a normal gen_event. &amp;nbsp;Maybe require a key in the app config (maybe {cli_handler,Module}) or perhaps just have a convention (something like an atom of the form '&amp;lt;application&amp;gt;_cli'). &amp;nbsp;For that matter, make a distribution container that is more like a gem/egg.
&lt;br&gt;&lt;br&gt;I think this is really want you want. &amp;nbsp;Installing an Erlang application should be as easy as commands something like:
&lt;br&gt;&lt;br&gt;# epkg install rabbitmq
&lt;br&gt;...downloads, builds, and installs rabbitmq code somewhere sane...
&lt;br&gt;# epkg deploy rabbitmq mydeploy
&lt;br&gt;...generates a &amp;quot;deployment&amp;quot; somewhere, basically just config and state data, mydeploy is used to generate nodenames (i.e. mydeploy_rabbitmq_main, mydeploy_rabbitmq_helper, etc)...
&lt;br&gt;# ectl mydeploy start
&lt;br&gt;...starts nodes specified for the deploy...
&lt;br&gt;# ectl mydeploy flush_cache
&lt;br&gt;...since flush_cache is not implemented by ectl, it should be passed through to an event handler...
&lt;br&gt;&lt;br&gt;Obviously there's a lot to go on under the covers, but anything more complex than that is, at best, a well engineered user-experience failure. &amp;nbsp;More importantly, I think the above captures what you should be doing.
&lt;br&gt;&lt;br&gt;All of that said, here are my comments on the proposal, so far (most of which I've already stated above):
&lt;br&gt;&lt;br&gt;&amp;gt; What I would like to do is manage all the components in a uniform manner.
&lt;br&gt;&amp;gt; Much of this design is inspired by how Mac OS-X manages applications.
&lt;br&gt;Why not just use the application framework, again? &amp;nbsp;It's 90% there for this.
&lt;br&gt;&lt;br&gt;Is there anything about an application that makes it unsuitable (i.e. smaller than) a component? &amp;nbsp;I would just add this to an application.
&lt;br&gt;&lt;br&gt;&amp;gt; By manage I mean start and stop the component, upgrade the code,
&lt;br&gt;&amp;gt; change the behavior of the component at run time and so on.
&lt;br&gt;I think you're thinking in terms of actual user-level management, right? &amp;nbsp;Basically, this is to unify things like ejabberdctl and rabbitmqctl. &amp;nbsp;I think that's a fantastic idea.
&lt;br&gt;&lt;br&gt;Looking forward, I'd suggest taking a hard look at Ruby gems and Python distutils/setuputils/eggs. &amp;nbsp;I really think that it would make a lot of sense to take the existing Erlang release system and use it to make something not unlike a gem or egg (which it already kind of does, but at a whole-Erlang-system level, not a component level).
&lt;br&gt;&lt;br&gt;As for the command line, it would be extremely handy to be able to have a convention where the nodename of a certain component was known, and there was a command line wrapper to send it commands. &amp;nbsp;Perhaps, have the component run a gen_event, and have &amp;quot;erlctl &amp;lt;component&amp;gt; &amp;lt;command&amp;gt; [args...]&amp;quot; generate an event in the node that the component runs in. &amp;nbsp;Extending edoc to generate commandline documentation would be killer here, too.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Here's a suggestion for a set of rules for managed components:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Draft 1 - 25 Nov 2009
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Rule1: All components are unpacked into the same top-level
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; directory (default $HOME/eComponent) and have the extension
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .ec (Erlang component)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Example: Imagine I have installed mochiweb ejabberd and couchDB
&lt;br&gt;&amp;gt; 	 &amp;nbsp; then after installation I should see the following:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp; $pwd
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /home/joe/eComponents
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ls
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mochiweb.ec ejabberd.ec couchDB.ec
&lt;/div&gt;I don't think eComponents, as a non-hidden top-level directory is going to thrill the aesthetic sense of most Unix users. &amp;nbsp;I would humbly suggest something more like $HOME/.erlang/components/. &amp;nbsp;Or, better yet, a system directory (probably just in the Erlang code root) and a user directory ($HOME/.erlang/lib).
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Rule2: A normal user should *never* have to examine any of the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files *inside* the component. To do so causes
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;abstraction leakage&amp;quot; - I want to consider each of these
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; components as black boxes. Once installed the component
&lt;br&gt;&amp;gt; 	 &amp;nbsp; should be installed in a read-only disk area.
&lt;br&gt;Certainly.
&lt;br&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Rule3: The component should not break if relocated to a different
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; top-level directory. A simple &amp;quot;mv&amp;quot; command should suffice
&lt;br&gt;&amp;gt; 	 &amp;nbsp; So no hard-wired paths or links please.
&lt;br&gt;Certainly.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Rule4: All components C must have a file called	
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $HOME/eComponents/C.ec/Preferences.pl
&lt;br&gt;&amp;gt; 	
&lt;br&gt;&amp;gt; 	 &amp;nbsp; The extension .pl means the file contains a property
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; list. Here is an example:
&lt;br&gt;.pl is bad mojo, as it's universally accepts to be Perl. &amp;nbsp;How about, .epl (i.e. Erlang Property List).
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {codePath, &amp;quot;/bin&amp;quot;}.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {expiryDate, {2009,12,24}}.
&lt;br&gt;&amp;gt; 	 &amp;nbsp; {icon, &amp;quot;/images/myIcon.png&amp;quot;}
&lt;br&gt;&amp;gt; 	 &amp;nbsp; {version,1}	
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {myKey1, ...}
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The keys codePath, version, and expiryDate are obligatory
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Why do we need code path? - so that Erlang can find
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a module called C.erl
&lt;/div&gt;If the code path is relative, what is gained by having it specifiable? &amp;nbsp;Why not just have a convention that it's ebin (or maybe have component/lib be added as an additional LIBDIR).
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Expiry date has a &amp;quot;time to live for the component&amp;quot;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Version is used for local configuration data (see later)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Version numbers should start at one and be increased by one
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for each new release.
&lt;br&gt;The expiry time thing is confusing to me. &amp;nbsp;Is this automatically done by some program, or is it metadata for a person?
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Rule5: Local configuration data
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Local configuration data must not be stored under the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; eComponents directory - (you can't remember we said the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; component is in a read-only disk area - see rule2)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Local data for the component C must be stored
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; in the directory
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $HOME/eLibrary/ComponentName/Vsn
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp; Thus local preferences for ejabberd version 1
&lt;br&gt;&amp;gt; 	 &amp;nbsp; would be stored in the file
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp; $HOME/eLibrary/ejabberd/1/Preferences.pl
&lt;/div&gt;Again, I humbly suggest more traditional Unix pathnames. &amp;nbsp;How about $HOME/.erlang/library/&amp;lt;component&amp;gt;/&amp;lt;vsn&amp;gt;/prefs.epl?
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Rule6: Code upgrade
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; We should upgrade an component C when it's expiry date has
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; been reached. To update an component we delete the entire
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; component under $HOME/eComponents/C.ec we install the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new component and run the command: C:install().
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Data that is to be carried over between different versions
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; of the component is stored in $HOME/eLibrary/C/V/...
&lt;br&gt;Is this done by the component framework? &amp;nbsp;Is this really a good idea to be done automatically? &amp;nbsp;Automatically deployed upgrades have generally been associated with tears and gnashing of teeth in my experience.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Rule7: management
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; 	 &amp;nbsp;All components C must provide a module in the file
&lt;br&gt;&amp;gt; 	 &amp;nbsp;C_control.erl - so ejabberd provides ejabberd_control.erl
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp;The management API is as follows:
&lt;br&gt;&amp;gt; 	
&lt;br&gt;&amp;gt; 	 &amp;nbsp;C:start_link() -&amp;gt; Pid
&lt;br&gt;&amp;gt; 	
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; create a controller process for the component.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp;Pid has the following protocol [see note 1 for notation]
&lt;br&gt;&amp;gt; 	 &amp;nbsp;PL is a property list (list of {Key::atom(), Value::any()}
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Pid !! {start, PL} =&amp;gt; ok | {error, Why}
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp;Cold start the component. PL is a property
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;list describing how the component should behave
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp;Pid !! {stop, PL} =&amp;gt; ok
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp;Stop the component
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp;Pid !! {modify, PL} =&amp;gt; ok | {error, Why}
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp;Change the behavior of the component
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp;Pid !! info =&amp;gt; PL
&lt;br&gt;&amp;gt; 	 &amp;nbsp;Pid !! {info, [Keys]} =&amp;gt; [Values]
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp;Pid !! suspendLocal =&amp;gt; ok
&lt;br&gt;&amp;gt; 	 &amp;nbsp;Pid !! resumeLocal =&amp;gt; ok
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Suspend the component data can be written to
&lt;br&gt;&amp;gt; 		$HOME/eLibrary/ComponentName/Vsn/...
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp; Pid !! suspendRemote =&amp;gt; &amp;lt;&amp;lt;BinaryClosure&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; Pid !! {resumeRemote, &amp;lt;&amp;lt;BinaryClosure&amp;gt;&amp;gt;} =&amp;gt; ok
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; This ton suspend an component on one machine
&lt;br&gt;&amp;gt; 		 and resume it on another	
&lt;/div&gt;&lt;br&gt;This looks a lot like it could just use the existing application framework. &amp;nbsp;I don't think that most of this would even require breaking backwards-compatibility.
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Jayson Vantuyl
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26511979&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kagato@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/A-Generic-API-for-controlling-software-components-tp26510088p26511979.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26511878</id>
	<title>Re: A Generic API for controlling software  components</title>
	<published>2009-11-25T04:34:03Z</published>
	<updated>2009-11-25T04:34:03Z</updated>
	<author>
		<name>Michael Richter-5</name>
	</author>
	<content type="html">2009/11/25 Joe Armstrong &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26511878&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;erlang@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; Rule4: All components C must have a file called
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$HOME/eComponents/C.ec/Preferences.pl
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;The extension .pl means the file contains a property
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;list. Here is an example:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{codePath, &amp;quot;/bin&amp;quot;}.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{expiryDate, {2009,12,24}}.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{icon, &amp;quot;/images/myIcon.png&amp;quot;}
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{version,1}
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{myKey1, ...}
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;The keys codePath, version, and expiryDate are obligatory
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Why do we need code path? - so that Erlang can find
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a module called C.erl
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Expiry date has a &amp;quot;time to live for the component&amp;quot;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Version is used for local configuration data (see later)
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Version numbers should start at one and be increased by one
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for each new release.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Here I would like to have a consistent naming style. Until today most
&lt;br&gt;&amp;gt; parts of Erlang don't use
&lt;br&gt;&amp;gt; &amp;gt; camel case. I like it in Smalltalk, and I like the consistency inside
&lt;br&gt;&amp;gt; Scheme, and until today I
&lt;br&gt;&amp;gt; &amp;gt; like the consistency in Erlang. It's not like Python, where you can see
&lt;br&gt;&amp;gt; which libs are from the
&lt;br&gt;&amp;gt; &amp;gt; Smalltalk or Java side, from the .NET side or the C side. Awful. So it
&lt;br&gt;&amp;gt; should be called
&lt;br&gt;&amp;gt; &amp;gt; preferences.pl with code_path, expiry_date, and so on. Additionally I
&lt;br&gt;&amp;gt; would like nested
&lt;br&gt;&amp;gt; &amp;gt; preferences. My Tideland CEL celcfg module handles this well.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I use names_like_this for function and module names but namesLikeThis
&lt;br&gt;&amp;gt; for atoms in code
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;The idea is sound. &amp;nbsp;The execution is suboptimal here. &amp;nbsp;The ending *.pl* is
&lt;br&gt;embedded in the minds of a very large number of people as a perl script.
&lt;br&gt;Choose perhaps a longer, more descriptive extension like, say, .proplist or
&lt;br&gt;.propl or .plist or whatever?
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/A-Generic-API-for-controlling-software-components-tp26510088p26511878.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26511471</id>
	<title>Re: A Generic API for controlling software  components</title>
	<published>2009-11-25T03:54:16Z</published>
	<updated>2009-11-25T03:54:16Z</updated>
	<author>
		<name>Joe Armstrong-2</name>
	</author>
	<content type="html">On Wed, Nov 25, 2009 at 11:55 AM, Frank Mueller &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26511471&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;frank@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Joe,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; your idea sounds really good to me, even if I would like some changes.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;     Draft 1 - 25 Nov 2009
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;     Rule1: All components are unpacked into the same top-level
&lt;br&gt;&amp;gt;&amp;gt;            directory (default $HOME/eComponent) and have the extension
&lt;br&gt;&amp;gt;&amp;gt;            .ec (Erlang component)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;            Example: Imagine I have installed mochiweb ejabberd and couchDB
&lt;br&gt;&amp;gt;&amp;gt;          then after installation I should see the following:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;          $pwd
&lt;br&gt;&amp;gt;&amp;gt;            /home/joe/eComponents
&lt;br&gt;&amp;gt;&amp;gt;            $ls
&lt;br&gt;&amp;gt;&amp;gt;            mochiweb.ec ejabberd.ec couchDB.ec
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It's OK to have a default value for the directory, but I would like to have a defined variable
&lt;br&gt;&amp;gt; named $ECOMPONENT_HOME so that I can easily change it.
&lt;/div&gt;&lt;br&gt;Yes
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Rule 2 and 3 full ack.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;     Rule4: All components C must have a file called
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;            $HOME/eComponents/C.ec/Preferences.pl
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;          The extension .pl means the file contains a property
&lt;br&gt;&amp;gt;&amp;gt;            list. Here is an example:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;            {codePath, &amp;quot;/bin&amp;quot;}.
&lt;br&gt;&amp;gt;&amp;gt;            {expiryDate, {2009,12,24}}.
&lt;br&gt;&amp;gt;&amp;gt;          {icon, &amp;quot;/images/myIcon.png&amp;quot;}
&lt;br&gt;&amp;gt;&amp;gt;          {version,1}
&lt;br&gt;&amp;gt;&amp;gt;            {myKey1, ...}
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;            The keys codePath, version, and expiryDate are obligatory
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;            Why do we need code path? - so that Erlang can find
&lt;br&gt;&amp;gt;&amp;gt;            a module called C.erl
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;            Expiry date has a &amp;quot;time to live for the component&amp;quot;
&lt;br&gt;&amp;gt;&amp;gt;            Version is used for local configuration data (see later)
&lt;br&gt;&amp;gt;&amp;gt;            Version numbers should start at one and be increased by one
&lt;br&gt;&amp;gt;&amp;gt;            for each new release.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Here I would like to have a consistent naming style. Until today most parts of Erlang don't use
&lt;br&gt;&amp;gt; camel case. I like it in Smalltalk, and I like the consistency inside Scheme, and until today I
&lt;br&gt;&amp;gt; like the consistency in Erlang. It's not like Python, where you can see which libs are from the
&lt;br&gt;&amp;gt; Smalltalk or Java side, from the .NET side or the C side. Awful. So it should be called
&lt;br&gt;&amp;gt; preferences.pl with code_path, expiry_date, and so on. Additionally I would like nested
&lt;br&gt;&amp;gt; preferences. My Tideland CEL celcfg module handles this well.
&lt;/div&gt;&lt;br&gt;I use names_like_this for function and module names but namesLikeThis
&lt;br&gt;for atoms in code
&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;     Rule5: Local configuration data
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;            Local configuration data must not be stored under the
&lt;br&gt;&amp;gt;&amp;gt;            eComponents directory - (you can't remember we said the
&lt;br&gt;&amp;gt;&amp;gt;            component is in a read-only disk area - see rule2)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;            Local data for the component C must be stored
&lt;br&gt;&amp;gt;&amp;gt;            in the directory
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;            $HOME/eLibrary/ComponentName/Vsn
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;          Thus local preferences for ejabberd version 1
&lt;br&gt;&amp;gt;&amp;gt;          would be stored in the file
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;          $HOME/eLibrary/ejabberd/1/Preferences.pl
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Ack, but see comments above about env variable and naming.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Rule 6 and 7 again ack.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thx for this idea, Joe. I would like to make my Tideland EAS conforming to such a standard.
&lt;/div&gt;&lt;br&gt;Great - I'm going to write a generic manager to support this. But I'd
&lt;br&gt;like some discussion
&lt;br&gt;in the list first.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; mue
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; **
&lt;br&gt;&amp;gt; ** Frank Mueller / Oldenburg / Germany
&lt;br&gt;&amp;gt; **
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ________________________________________________________________
&lt;br&gt;&amp;gt; erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;&amp;gt; erlang-questions (at) erlang.org
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/A-Generic-API-for-controlling-software-components-tp26510088p26511471.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26510805</id>
	<title>Re: A Generic API for controlling software  components</title>
	<published>2009-11-25T02:55:39Z</published>
	<updated>2009-11-25T02:55:39Z</updated>
	<author>
		<name>Frank Müller</name>
	</author>
	<content type="html">Hi Joe,
&lt;br&gt;&lt;br&gt;your idea sounds really good to me, even if I would like some changes.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Draft 1 - 25 Nov 2009
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Rule1: All components are unpacked into the same top-level
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;directory (default $HOME/eComponent) and have the extension
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.ec (Erlang component)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Example: Imagine I have installed mochiweb ejabberd and couchDB
&lt;br&gt;&amp;gt; 	 &amp;nbsp; then after installation I should see the following:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; $pwd
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/home/joe/eComponents
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$ls
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mochiweb.ec ejabberd.ec couchDB.ec
&lt;/div&gt;&lt;br&gt;It's OK to have a default value for the directory, but I would like to have a defined variable
&lt;br&gt;named $ECOMPONENT_HOME so that I can easily change it.
&lt;br&gt;&lt;br&gt;Rule 2 and 3 full ack.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Rule4: All components C must have a file called
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$HOME/eComponents/C.ec/Preferences.pl
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; The extension .pl means the file contains a property
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;list. Here is an example:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{codePath, &amp;quot;/bin&amp;quot;}.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{expiryDate, {2009,12,24}}.
&lt;br&gt;&amp;gt; 	 &amp;nbsp; {icon, &amp;quot;/images/myIcon.png&amp;quot;}
&lt;br&gt;&amp;gt; 	 &amp;nbsp; {version,1}
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{myKey1, ...}
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;The keys codePath, version, and expiryDate are obligatory
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Why do we need code path? - so that Erlang can find
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a module called C.erl
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Expiry date has a &amp;quot;time to live for the component&amp;quot;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Version is used for local configuration data (see later)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Version numbers should start at one and be increased by one
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for each new release.
&lt;/div&gt;&lt;br&gt;Here I would like to have a consistent naming style. Until today most parts of Erlang don't use
&lt;br&gt;camel case. I like it in Smalltalk, and I like the consistency inside Scheme, and until today I
&lt;br&gt;like the consistency in Erlang. It's not like Python, where you can see which libs are from the
&lt;br&gt;Smalltalk or Java side, from the .NET side or the C side. Awful. So it should be called
&lt;br&gt;preferences.pl with code_path, expiry_date, and so on. Additionally I would like nested
&lt;br&gt;preferences. My Tideland CEL celcfg module handles this well.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Rule5: Local configuration data
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Local configuration data must not be stored under the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;eComponents directory - (you can't remember we said the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;component is in a read-only disk area - see rule2)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Local data for the component C must be stored
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;in the directory
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$HOME/eLibrary/ComponentName/Vsn
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; Thus local preferences for ejabberd version 1
&lt;br&gt;&amp;gt; 	 &amp;nbsp; would be stored in the file
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; $HOME/eLibrary/ejabberd/1/Preferences.pl
&lt;/div&gt;&lt;br&gt;Ack, but see comments above about env variable and naming.
&lt;br&gt;&lt;br&gt;Rule 6 and 7 again ack.
&lt;br&gt;&lt;br&gt;Thx for this idea, Joe. I would like to make my Tideland EAS conforming to such a standard.
&lt;br&gt;&lt;br&gt;mue
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;**
&lt;br&gt;** Frank Mueller / Oldenburg / Germany
&lt;br&gt;**
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/A-Generic-API-for-controlling-software-components-tp26510088p26510805.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26510088</id>
	<title>A Generic API for controlling software components</title>
	<published>2009-11-25T01:56:37Z</published>
	<updated>2009-11-25T01:56:37Z</updated>
	<author>
		<name>Joe Armstrong-2</name>
	</author>
	<content type="html">I would like to start a discussion about the generic control
&lt;br&gt;of software components. Let me start by describing the problem
&lt;br&gt;and a possible solution. I'd welcome feedback on this.
&lt;br&gt;&lt;br&gt;What's the problem?
&lt;br&gt;&lt;br&gt;To start with I'll use the term &amp;quot;component&amp;quot; rather than the word
&lt;br&gt;&amp;quot;application&amp;quot; since the word application has specific meaning in the OTP
&lt;br&gt;context.
&lt;br&gt;&lt;br&gt;To me a component is a black-box offering some functionality that I want
&lt;br&gt;to use in my project.
&lt;br&gt;&lt;br&gt;Examples of components are couchDB, mochiweb, rabbitMQ, ejabberd, yaws
&lt;br&gt;etc.
&lt;br&gt;&lt;br&gt;All these different components have chosen Ad Hock ways of controlling
&lt;br&gt;them. The way that I control couchDB and yaws is completely different.
&lt;br&gt;The way I upgrade the code is completely different.
&lt;br&gt;&lt;br&gt;What I would like to do is manage all the components in a uniform manner.
&lt;br&gt;Much of this design is inspired by how Mac OS-X manages applications.
&lt;br&gt;&lt;br&gt;By manage I mean start and stop the component, upgrade the code,
&lt;br&gt;change the behavior of the component at run time and so on.
&lt;br&gt;&lt;br&gt;Here's a suggestion for a set of rules for managed components:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Draft 1 - 25 Nov 2009
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Rule1: All components are unpacked into the same top-level
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;directory (default $HOME/eComponent) and have the extension
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.ec (Erlang component)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Example: Imagine I have installed mochiweb ejabberd and couchDB
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;then after installation I should see the following:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$pwd
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/home/joe/eComponents
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$ls
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mochiweb.ec ejabberd.ec couchDB.ec
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Rule2: A normal user should *never* have to examine any of the
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;files *inside* the component. To do so causes
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;abstraction leakage&amp;quot; - I want to consider each of these
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;components as black boxes. Once installed the component
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;should be installed in a read-only disk area.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Rule3: The component should not break if relocated to a different
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;top-level directory. A simple &amp;quot;mv&amp;quot; command should suffice
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;So no hard-wired paths or links please.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Rule4: All components C must have a file called	
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$HOME/eComponents/C.ec/Preferences.pl
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;The extension .pl means the file contains a property
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;list. Here is an example:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{codePath, &amp;quot;/bin&amp;quot;}.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{expiryDate, {2009,12,24}}.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{icon, &amp;quot;/images/myIcon.png&amp;quot;}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{version,1}	
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{myKey1, ...}
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;The keys codePath, version, and expiryDate are obligatory
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Why do we need code path? - so that Erlang can find
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a module called C.erl
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Expiry date has a &amp;quot;time to live for the component&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Version is used for local configuration data (see later)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Version numbers should start at one and be increased by one
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for each new release.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Rule5: Local configuration data
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Local configuration data must not be stored under the
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;eComponents directory - (you can't remember we said the
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;component is in a read-only disk area - see rule2)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Local data for the component C must be stored
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;in the directory
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$HOME/eLibrary/ComponentName/Vsn
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thus local preferences for ejabberd version 1
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;would be stored in the file
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$HOME/eLibrary/ejabberd/1/Preferences.pl
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Rule6: Code upgrade
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;We should upgrade an component C when it's expiry date has
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;been reached. To update an component we delete the entire
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;component under $HOME/eComponents/C.ec we install the
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new component and run the command: C:install().
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Data that is to be carried over between different versions
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;of the component is stored in $HOME/eLibrary/C/V/...
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Rule7: management
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;	 &amp;nbsp;All components C must provide a module in the file
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C_control.erl - so ejabberd provides ejabberd_control.erl
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The management API is as follows:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C:start_link() -&amp;gt; Pid
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;create a controller process for the component.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pid has the following protocol [see note 1 for notation]
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PL is a property list (list of {Key::atom(), Value::any()}
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pid !! {start, PL} =&amp;gt; ok | {error, Why}
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Cold start the component. PL is a property
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; list describing how the component should behave
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pid !! {stop, PL} =&amp;gt; ok
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Stop the component
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pid !! {modify, PL} =&amp;gt; ok | {error, Why}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Change the behavior of the component
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pid !! info =&amp;gt; PL
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pid !! {info, [Keys]} =&amp;gt; [Values]
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pid !! suspendLocal =&amp;gt; ok
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pid !! resumeLocal =&amp;gt; ok
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Suspend the component data can be written to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $HOME/eLibrary/ComponentName/Vsn/...
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Pid !! suspendRemote =&amp;gt; &amp;lt;&amp;lt;BinaryClosure&amp;gt;&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Pid !! {resumeRemote, &amp;lt;&amp;lt;BinaryClosure&amp;gt;&amp;gt;} =&amp;gt; ok
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;This ton suspend an component on one machine
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;and resume it on another	
&lt;br&gt;&lt;br&gt;Notes: 	 &amp;nbsp; &amp;nbsp; &amp;nbsp;	
&lt;br&gt;&lt;br&gt;[1] Notation
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Pid !! M =&amp;gt; A | B | C ...
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Is my notation for for a remote procedure call
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;This &amp;nbsp;means if you send Pid the message Pid ! {self(), M}
&lt;br&gt;you will eventually be send one of the messages {Pid,A} or {Pid,B}, ...
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;/Joe
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/A-Generic-API-for-controlling-software-components-tp26510088p26510088.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26508670</id>
	<title>Re: Record typing for dialyzer</title>
	<published>2009-11-24T23:44:06Z</published>
	<updated>2009-11-24T23:44:06Z</updated>
	<author>
		<name>Kostis Sagonas-2</name>
	</author>
	<content type="html">Bernard Duggan wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi list,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; We have a lot of auto-generated record types that we use to allow
&lt;br&gt;&amp;gt; our (newer, awesomer) erlang/mnesia code to interact with our (older,
&lt;br&gt;&amp;gt; less awesome, but we're stuck with it for now) C++/mysql code. &amp;nbsp;It
&lt;br&gt;&amp;gt; recently occurred to me that it would be a simple matter to add type
&lt;br&gt;&amp;gt; specifiers to the records to give dialyzer (which we love to death) some
&lt;br&gt;&amp;gt; extra info to work with. &amp;nbsp;And for the most part it was. &amp;nbsp;So we now have
&lt;br&gt;&amp;gt; nice auto-generated records of the form:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -record( person{
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; id :: integer(),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; name :: string(),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; is_awesome :: boolean()
&lt;br&gt;&amp;gt; }).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; which is great (and already helped us find several bugs - have I
&lt;br&gt;&amp;gt; mentioned we love dialyzer?). &amp;nbsp;We struck a problem, however, when we
&lt;br&gt;&amp;gt; used one of our records in a select statement thus:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Match = #person{name=&amp;quot;Bernie&amp;quot;, id='$1', _='_'},
&lt;br&gt;&amp;gt; mnesia:select(person, [{Match, [], [{{'$1'}}]}]),
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; At this point, dialyzer quite correctly points out that '$1' isn't an
&lt;br&gt;&amp;gt; integer and '_' isn't a boolean and so we've got no business assigning
&lt;br&gt;&amp;gt; them to fields typed as such.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; My solution, then was to add an extra type definition:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -type search_spec() :: '_' | '$1' | '$2' | '$3' | '$4' | '$5' | '$6' |
&lt;br&gt;&amp;gt; '$7' | '$8' | '$9'.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; and change all the record definitions to something like:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -record( person{
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; id :: integer() | search_spec(),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; name :: string() | search_spec(),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; is_awesome :: boolean() | search_spec()
&lt;br&gt;&amp;gt; }).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Now this solves the problem, but it really looks ugly and seems like
&lt;br&gt;&amp;gt; kind of a hack and I can't help but feel like there must be some more
&lt;br&gt;&amp;gt; elegant solution. &amp;nbsp;But I don't know what it is :) &amp;nbsp;Any input (even if
&lt;br&gt;&amp;gt; it's only &amp;quot;nope, there's no better way to do it&amp;quot;) would be greatly
&lt;br&gt;&amp;gt; appreciated.
&lt;/div&gt;&lt;br&gt;I am not aware of any cleaner way of doing what you want to do, so what 
&lt;br&gt;you've done is how I would personally also do it. &amp;nbsp;The only thing I 
&lt;br&gt;would recommend is to try to add these declarations as sparsely as 
&lt;br&gt;possible, meaning try to add them only to the record fields that are 
&lt;br&gt;used in match specifications in your program, not everywhere.
&lt;br&gt;&lt;br&gt;The problem is that you (and dialyzer) are up against a really bad 
&lt;br&gt;design decision in the language here, namely the use of &amp;quot;special&amp;quot; atoms 
&lt;br&gt;to represent variables in match specifications. &amp;nbsp;I sincerely hope that 
&lt;br&gt;this is fixed by Erlang providing an alternative way of writing match 
&lt;br&gt;specifications that does not lie about types.
&lt;br&gt;&lt;br&gt;Thanks for your thumbs up for dialyzer!
&lt;br&gt;&lt;br&gt;Kostis
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Record-typing-for-dialyzer-tp26505262p26508670.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26506276</id>
	<title>Re: Fastest pseudo-random number-generator: erlang:statistics(io) ?</title>
	<published>2009-11-24T17:33:00Z</published>
	<updated>2009-11-24T17:33:00Z</updated>
	<author>
		<name>Thijs Terlouw</name>
	</author>
	<content type="html">On Nov 25, 2:59 am, Jayson Vantuyl &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26506276&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kag...@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Is it too slow to run the result through erlang:phash/2?
&lt;br&gt;&lt;br&gt;I tested it, erlang:phash2(erlang:statistics(io), 10) it still is
&lt;br&gt;fast, but significantly slower than without. You are right that it
&lt;br&gt;immediately scales the result, so i tested with scaling the
&lt;br&gt;erlang:statistics(io) as well. I think the randomness (for my case)
&lt;br&gt;will not improve a lot, but I will keep this function in mind.
&lt;br&gt;&lt;br&gt;&lt;br&gt;On Nov 25, 12:10 am, &amp;quot;Zoltan Lajos Kis&amp;quot; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26506276&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ki...@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; How about process_info(self(), reductions). ?
&lt;br&gt;This one is also very fast (only a bit slower than statistics(io)),
&lt;br&gt;but I am concerned about the randomness of this function (at least in
&lt;br&gt;my case). I have many short-lived processes and it's likely that the
&lt;br&gt;number of reductions for each process might be quite similar if they
&lt;br&gt;follow similar code paths?
&lt;br&gt;&lt;br&gt;new benchmark results:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; erlang_now req/sec &amp;nbsp; 296667.7
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; stats_io req/sec &amp;nbsp;2638898.4
&lt;br&gt;&amp;nbsp; &amp;nbsp; stats_wall_clock req/sec &amp;nbsp; 289306.0
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;stats_runtime req/sec &amp;nbsp; 522258.4
&lt;br&gt;&amp;nbsp; &amp;nbsp; stats_reductions req/sec &amp;nbsp; 484499.9
&lt;br&gt;&amp;nbsp; &amp;nbsp;stats_cont_switch req/sec &amp;nbsp; 491190.3
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; random_uniform req/sec &amp;nbsp;1109517.1
&lt;br&gt;&amp;nbsp; process_info_reduc req/sec &amp;nbsp;2410724.8
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;phash2_io req/sec &amp;nbsp;1773493.0
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;stats_io_scaled req/sec &amp;nbsp;2357073.0
&lt;br&gt;&lt;br&gt;&lt;br&gt;tested like this:
&lt;br&gt;&lt;br&gt;---------------------------
&lt;br&gt;&lt;br&gt;test_random_speed(ParCount, SeqCount) -&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FunErlangNow = &amp;nbsp;fun() -&amp;gt; erlang:now() end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FunIO = &amp;nbsp;fun() -&amp;gt; erlang:statistics(io) end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FunWallClock = &amp;nbsp;fun() -&amp;gt; erlang:statistics(wall_clock) end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FunRuntime = &amp;nbsp;fun() -&amp;gt; erlang:statistics(runtime) end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FunReductions = &amp;nbsp;fun() -&amp;gt; erlang:statistics(reductions) end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FunContextSwitches = &amp;nbsp;fun() -&amp;gt; erlang:statistics(context_switches)
&lt;br&gt;end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FunRandomUniform = &amp;nbsp;fun() -&amp;gt; random:uniform() end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FunProcessInfoRed = fun() -&amp;gt; erlang:process_info(self(), reductions)
&lt;br&gt;end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FunPhashIO &amp;nbsp;= fun() -&amp;gt; erlang:phash2(erlang:statistics(io), 10) end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FunIOScaled = &amp;nbsp;fun() -&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {{input, Input}, {output, Output}} = erlang:statistics(io),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (Input+Output) rem 10
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end,
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test_fun_x_times_parallel(erlang_now, FunErlangNow, ParCount,
&lt;br&gt;SeqCount),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test_fun_x_times_parallel(stats_io, FunIO, ParCount, SeqCount),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test_fun_x_times_parallel(stats_wall_clock, FunWallClock, ParCount,
&lt;br&gt;SeqCount),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test_fun_x_times_parallel(stats_runtime, FunRuntime, ParCount,
&lt;br&gt;SeqCount),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test_fun_x_times_parallel(stats_reductions, FunReductions, ParCount,
&lt;br&gt;SeqCount),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test_fun_x_times_parallel(stats_cont_switch, FunContextSwitches,
&lt;br&gt;ParCount, SeqCount),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test_fun_x_times_parallel(random_uniform, FunRandomUniform, ParCount,
&lt;br&gt;SeqCount),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test_fun_x_times_parallel(process_info_reduc, FunProcessInfoRed,
&lt;br&gt;ParCount, SeqCount),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test_fun_x_times_parallel(phash2_io, FunPhashIO, ParCount, SeqCount),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test_fun_x_times_parallel(stats_io_scaled, FunIOScaled, ParCount,
&lt;br&gt;SeqCount),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ok.
&lt;br&gt;&lt;br&gt;&lt;br&gt;test_fun_x_times_parallel(Name, Fun, ParCount, SeqCount) -&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Tick = now(),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; app_util:pmap(
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fun(_) -&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lists:foreach(fun(_) -&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Fun()
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lists:seq(1, SeqCount))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lists:seq(1, ParCount),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [],
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 250000),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Tock = now(),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AvgTime = timer:now_diff(Tock, Tick)/1000,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Speed = ParCount*SeqCount*1000/AvgTime,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; io:format(&amp;quot;~20w req/sec ~10.1f ~n&amp;quot;, [Name, Speed]),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Speed.
&lt;br&gt;&lt;br&gt;&lt;br&gt;pmap(Fun, List, Nodes, Timeout) -&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SpawnFun =
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case length(Nodes) of
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 -&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fun spawn/1;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Length -&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NextNode = fun() -&amp;gt; lists:nth(random:uniform(Length), Nodes) end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fun(F) -&amp;gt; spawn(NextNode(), F) end
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Parent = self(),
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pids =
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SpawnFun(fun() -&amp;gt; Parent ! {self(), (catch Fun(Elem))} end)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; || Elem &amp;lt;- List
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ],
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; receive
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {Pid, Val} -&amp;gt; Val
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; after Timeout -&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; exit(timeout)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; || Pid &amp;lt;- Pids
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ].
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;signature&quot;&gt;- Thijs Terlouw, &lt;a href=&quot;http://www.startinchina.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Shenzhen, China&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Fastest-pseudo-random-number-generator%3A-erlang%3Astatistics%28io%29---tp26497411p26506276.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26505891</id>
	<title>Re: Record typing for dialyzer</title>
	<published>2009-11-24T16:51:41Z</published>
	<updated>2009-11-24T16:51:41Z</updated>
	<author>
		<name>Bernard Duggan-2</name>
	</author>
	<content type="html">That was another other option I toyed with - I ended up coming down on
&lt;br&gt;the side of keeping the &amp;quot;code&amp;quot; as un-hacked as possible and just messing
&lt;br&gt;with the headers and auto-generated stuff. &amp;nbsp;My reasoning being that I
&lt;br&gt;didn't want others in the team to have to re-solve the problem every
&lt;br&gt;time they wanted to use a select() statement. &amp;nbsp;Not that I'm saying it's
&lt;br&gt;not a perfectly valid solution, just explaining why I didn't choose it :)
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;B
&lt;br&gt;&lt;br&gt;Paul Mineiro wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I had the same problem.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I ended up keeping the type signature in the declaration strict, and using
&lt;br&gt;&amp;gt; setelement/3 to construct the type-violating version of the record that I
&lt;br&gt;&amp;gt; pass to mnesia:select/2.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- p
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Wed, 25 Nov 2009, Bernard Duggan wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; Hi list,
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; We have a lot of auto-generated record types that we use to allow
&lt;br&gt;&amp;gt;&amp;gt; our (newer, awesomer) erlang/mnesia code to interact with our (older,
&lt;br&gt;&amp;gt;&amp;gt; less awesome, but we're stuck with it for now) C++/mysql code. &amp;nbsp;It
&lt;br&gt;&amp;gt;&amp;gt; recently occurred to me that it would be a simple matter to add type
&lt;br&gt;&amp;gt;&amp;gt; specifiers to the records to give dialyzer (which we love to death) some
&lt;br&gt;&amp;gt;&amp;gt; extra info to work with. &amp;nbsp;And for the most part it was. &amp;nbsp;So we now have
&lt;br&gt;&amp;gt;&amp;gt; nice auto-generated records of the form:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; -record( person{
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; id :: integer(),
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; name :: string(),
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; is_awesome :: boolean()
&lt;br&gt;&amp;gt;&amp;gt; }).
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; which is great (and already helped us find several bugs - have I
&lt;br&gt;&amp;gt;&amp;gt; mentioned we love dialyzer?). &amp;nbsp;We struck a problem, however, when we
&lt;br&gt;&amp;gt;&amp;gt; used one of our records in a select statement thus:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Match = #person{name=&amp;quot;Bernie&amp;quot;, id='$1', _='_'},
&lt;br&gt;&amp;gt;&amp;gt; mnesia:select(person, [{Match, [], [{{'$1'}}]}]),
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; At this point, dialyzer quite correctly points out that '$1' isn't an
&lt;br&gt;&amp;gt;&amp;gt; integer and '_' isn't a boolean and so we've got no business assigning
&lt;br&gt;&amp;gt;&amp;gt; them to fields typed as such.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; My solution, then was to add an extra type definition:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; -type search_spec() :: '_' | '$1' | '$2' | '$3' | '$4' | '$5' | '$6' |
&lt;br&gt;&amp;gt;&amp;gt; '$7' | '$8' | '$9'.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; and change all the record definitions to something like:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; -record( person{
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; id :: integer() | search_spec(),
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; name :: string() | search_spec(),
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; is_awesome :: boolean() | search_spec()
&lt;br&gt;&amp;gt;&amp;gt; }).
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Now this solves the problem, but it really looks ugly and seems like
&lt;br&gt;&amp;gt;&amp;gt; kind of a hack and I can't help but feel like there must be some more
&lt;br&gt;&amp;gt;&amp;gt; elegant solution. &amp;nbsp;But I don't know what it is :) &amp;nbsp;Any input (even if
&lt;br&gt;&amp;gt;&amp;gt; it's only &amp;quot;nope, there's no better way to do it&amp;quot;) would be greatly
&lt;br&gt;&amp;gt;&amp;gt; appreciated.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Cheers,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Bernard
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; ________________________________________________________________
&lt;br&gt;&amp;gt;&amp;gt; erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; erlang-questions (at) erlang.org
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ________________________________________________________________
&lt;br&gt;&amp;gt; erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;&amp;gt; erlang-questions (at) erlang.org
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Record-typing-for-dialyzer-tp26505262p26505891.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26505638</id>
	<title>Re: Record typing for dialyzer</title>
	<published>2009-11-24T16:21:56Z</published>
	<updated>2009-11-24T16:21:56Z</updated>
	<author>
		<name>Paul Mineiro</name>
	</author>
	<content type="html">I had the same problem.
&lt;br&gt;&lt;br&gt;I ended up keeping the type signature in the declaration strict, and using
&lt;br&gt;setelement/3 to construct the type-violating version of the record that I
&lt;br&gt;pass to mnesia:select/2.
&lt;br&gt;&lt;br&gt;-- p
&lt;br&gt;&lt;br&gt;On Wed, 25 Nov 2009, Bernard Duggan wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi list,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; We have a lot of auto-generated record types that we use to allow
&lt;br&gt;&amp;gt; our (newer, awesomer) erlang/mnesia code to interact with our (older,
&lt;br&gt;&amp;gt; less awesome, but we're stuck with it for now) C++/mysql code. &amp;nbsp;It
&lt;br&gt;&amp;gt; recently occurred to me that it would be a simple matter to add type
&lt;br&gt;&amp;gt; specifiers to the records to give dialyzer (which we love to death) some
&lt;br&gt;&amp;gt; extra info to work with. &amp;nbsp;And for the most part it was. &amp;nbsp;So we now have
&lt;br&gt;&amp;gt; nice auto-generated records of the form:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -record( person{
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; id :: integer(),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; name :: string(),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; is_awesome :: boolean()
&lt;br&gt;&amp;gt; }).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; which is great (and already helped us find several bugs - have I
&lt;br&gt;&amp;gt; mentioned we love dialyzer?). &amp;nbsp;We struck a problem, however, when we
&lt;br&gt;&amp;gt; used one of our records in a select statement thus:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Match = #person{name=&amp;quot;Bernie&amp;quot;, id='$1', _='_'},
&lt;br&gt;&amp;gt; mnesia:select(person, [{Match, [], [{{'$1'}}]}]),
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; At this point, dialyzer quite correctly points out that '$1' isn't an
&lt;br&gt;&amp;gt; integer and '_' isn't a boolean and so we've got no business assigning
&lt;br&gt;&amp;gt; them to fields typed as such.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; My solution, then was to add an extra type definition:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -type search_spec() :: '_' | '$1' | '$2' | '$3' | '$4' | '$5' | '$6' |
&lt;br&gt;&amp;gt; '$7' | '$8' | '$9'.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; and change all the record definitions to something like:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -record( person{
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; id :: integer() | search_spec(),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; name :: string() | search_spec(),
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; is_awesome :: boolean() | search_spec()
&lt;br&gt;&amp;gt; }).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Now this solves the problem, but it really looks ugly and seems like
&lt;br&gt;&amp;gt; kind of a hack and I can't help but feel like there must be some more
&lt;br&gt;&amp;gt; elegant solution. &amp;nbsp;But I don't know what it is :) &amp;nbsp;Any input (even if
&lt;br&gt;&amp;gt; it's only &amp;quot;nope, there's no better way to do it&amp;quot;) would be greatly
&lt;br&gt;&amp;gt; appreciated.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Cheers,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Bernard
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ________________________________________________________________
&lt;br&gt;&amp;gt; erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;&amp;gt; erlang-questions (at) erlang.org
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Record-typing-for-dialyzer-tp26505262p26505638.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26505611</id>
	<title>Re: Re: list size 'causing VM &quot;problems&quot;</title>
	<published>2009-11-24T16:18:12Z</published>
	<updated>2009-11-24T16:18:12Z</updated>
	<author>
		<name>Steve Davis-5</name>
	</author>
	<content type="html">Hendrik Visage wrote:
&lt;br&gt;&amp;gt; the:
&lt;br&gt;&amp;gt; &amp;nbsp;List=read_lines(FD).
&lt;br&gt;&amp;gt; executes, doesn't *appear* to be using lots of VM space, and it
&lt;br&gt;&amp;gt; outputs the partial (being the shell it only prints a part of the
&lt;br&gt;&amp;gt; lines with the [...]...] stuff.
&lt;br&gt;&lt;br&gt;This appears to be an improvement!
&lt;br&gt;&lt;br&gt;&amp;gt; Then it *hangs* at that, not showing the prompt (this is inside
&lt;br&gt;&amp;gt; Aquamacs's erlang shell mode). This is then where it appears the
&lt;br&gt;&amp;gt; system goes &amp;quot;west&amp;quot;, as the memory utilization (as measured/shown by
&lt;br&gt;&amp;gt; the MacOSX Activity Monitor) starts to grow and grow. with the last
&lt;br&gt;&amp;gt; test (using the Accumulator as below) it grew to 7G at which point I
&lt;br&gt;&amp;gt; killed the beam.smp process.
&lt;br&gt;&lt;br&gt;Next I'd suspect your regex is causing issues. Try some logging to 
&lt;br&gt;figure out what lines are causing issues with the regex expression you 
&lt;br&gt;defined (and perhaps incorporate Ulf's suggestion to use binaries).
&lt;br&gt;&lt;br&gt;If you don't find a solution there, it could well be that you'll have to 
&lt;br&gt;push the results out to ETS as Ulf suggested (and my experience is that 
&lt;br&gt;Ulf is generally right about such things - not to mention the fact that 
&lt;br&gt;he has many more years of experience with OTP than I do).
&lt;br&gt;&lt;br&gt;/s
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/list-size-%27causing-VM-%22problems%22-tp26475374p26505611.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26505262</id>
	<title>Record typing for dialyzer</title>
	<published>2009-11-24T15:37:28Z</published>
	<updated>2009-11-24T15:37:28Z</updated>
	<author>
		<name>Bernard Duggan-2</name>
	</author>
	<content type="html">Hi list,
&lt;br&gt;&amp;nbsp; &amp;nbsp; We have a lot of auto-generated record types that we use to allow
&lt;br&gt;our (newer, awesomer) erlang/mnesia code to interact with our (older,
&lt;br&gt;less awesome, but we're stuck with it for now) C++/mysql code. &amp;nbsp;It
&lt;br&gt;recently occurred to me that it would be a simple matter to add type
&lt;br&gt;specifiers to the records to give dialyzer (which we love to death) some
&lt;br&gt;extra info to work with. &amp;nbsp;And for the most part it was. &amp;nbsp;So we now have
&lt;br&gt;nice auto-generated records of the form:
&lt;br&gt;&lt;br&gt;-record( person{
&lt;br&gt;&amp;nbsp; &amp;nbsp; id :: integer(),
&lt;br&gt;&amp;nbsp; &amp;nbsp; name :: string(),
&lt;br&gt;&amp;nbsp; &amp;nbsp; is_awesome :: boolean()
&lt;br&gt;}).
&lt;br&gt;&lt;br&gt;which is great (and already helped us find several bugs - have I
&lt;br&gt;mentioned we love dialyzer?). &amp;nbsp;We struck a problem, however, when we
&lt;br&gt;used one of our records in a select statement thus:
&lt;br&gt;&lt;br&gt;Match = #person{name=&amp;quot;Bernie&amp;quot;, id='$1', _='_'},
&lt;br&gt;mnesia:select(person, [{Match, [], [{{'$1'}}]}]),
&lt;br&gt;&lt;br&gt;At this point, dialyzer quite correctly points out that '$1' isn't an
&lt;br&gt;integer and '_' isn't a boolean and so we've got no business assigning
&lt;br&gt;them to fields typed as such.
&lt;br&gt;&lt;br&gt;My solution, then was to add an extra type definition:
&lt;br&gt;&lt;br&gt;-type search_spec() :: '_' | '$1' | '$2' | '$3' | '$4' | '$5' | '$6' |
&lt;br&gt;'$7' | '$8' | '$9'.
&lt;br&gt;&lt;br&gt;and change all the record definitions to something like:
&lt;br&gt;&lt;br&gt;-record( person{
&lt;br&gt;&amp;nbsp; &amp;nbsp; id :: integer() | search_spec(),
&lt;br&gt;&amp;nbsp; &amp;nbsp; name :: string() | search_spec(),
&lt;br&gt;&amp;nbsp; &amp;nbsp; is_awesome :: boolean() | search_spec()
&lt;br&gt;}).
&lt;br&gt;&lt;br&gt;Now this solves the problem, but it really looks ugly and seems like
&lt;br&gt;kind of a hack and I can't help but feel like there must be some more
&lt;br&gt;elegant solution. &amp;nbsp;But I don't know what it is :) &amp;nbsp;Any input (even if
&lt;br&gt;it's only &amp;quot;nope, there's no better way to do it&amp;quot;) would be greatly
&lt;br&gt;appreciated.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;Bernard
&lt;br&gt;&lt;br&gt;________________________________________________________________
&lt;br&gt;erlang-questions mailing list. See &lt;a href=&quot;http://www.erlang.org/faq.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.erlang.org/faq.html&lt;/a&gt;&lt;br&gt;erlang-questions (at) erlang.org
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Record-typing-for-dialyzer-tp26505262p26505262.html" />
</entry>

</feed>
