From pete-expires-20060401@REDACTED Sun Oct 1 07:49:56 2006 From: pete-expires-20060401@REDACTED (Pete Kazmier) Date: Sun, 01 Oct 2006 01:49:56 -0400 Subject: [erlang-questions] inets / tftpd bug and patch Message-ID: <871wps8u0r.fsf@coco.kazmier.com> I've just discovered the tftpd server in inets and have replaced the standard tftp daemon included on my linux box. It took a bit before I discovered the 'root_dir' option to tftp_file callback module. In case anyone is curious, I invoke it as: tftp:start([{callback, {".*", tftp_file, [{root_dir, "/tftpboot"}]}}]). This should limit all access to the "/tftpboot" directory; however, I believe there is a bug in tftp_file:filename_join/2. This function is used to merge root_dir with the client-supplied filename to ensure the client does not affect other parts of the filesystem. For example: 1> filename_join("/tftpboot", "file.txt"). "/tftpboot/file.txt" However, if the client sends an absolute path, the root_dir is ignored entirely: 2> filename_join("/tftpboot", "/file.txt"). "/file.txt" And judging by the code, this was not the intent: filename_join(Dir, Filename) -> case filename:pathtype(Filename) of absolute -> [_ | RelDir] = filename:split(Dir), filename:join([RelDir, Filename]); _ -> filename:join([Dir, Filename]) end. I believe the correct version should be: filename_join(Dir, Filename) -> case filename:pathtype(Filename) of absolute -> [_ | RelDir] = filename:split(Filename), % CHANGED filename:join([Dir | RelDir); % CHANGED _ -> filename:join([Dir, Filename]) end. Included is a patch. Thanks, Pete -------------- next part -------------- A non-text attachment was scrubbed... Name: tftp.patch Type: text/x-patch Size: 595 bytes Desc: Patch for tftp_file URL: From pete-expires-20060401@REDACTED Sun Oct 1 08:13:12 2006 From: pete-expires-20060401@REDACTED (Pete Kazmier) Date: Sun, 01 Oct 2006 02:13:12 -0400 Subject: [erlang-questions] inets / tftpd startup question Message-ID: <87ven47edj.fsf@coco.kazmier.com> As I mentioned in my previous email, I've started using the tftpd server included in inets. However, I'm having a hard time figuring out the best way to start it. I was hoping that this would work: $ erl -sname tftp -detached -eval 'tftp:start([{port,8069}]).' And then to stop it: $ erl -noshell -sname master -eval 'rpc:call(tftp@REDACTED, erlang, halt, []).' But for some reason, it does not appear to start. I never see it listening on port 8069. Am I using '-eval' correctly? Ideally, the above commands would go into a init script in my /etc/init.d directory. I'll also take advantage of the -heart option once I get this first part straightened away. Any help would be appreciated. Thanks, Pete From pete-expires-20061130@REDACTED Sun Oct 1 08:15:27 2006 From: pete-expires-20061130@REDACTED (Pete Kazmier) Date: Sun, 01 Oct 2006 02:15:27 -0400 Subject: [erlang-questions] inets / tftpd bug and patch References: <871wps8u0r.fsf@coco.kazmier.com> Message-ID: <87r6xs7e9s.fsf@coco.kazmier.com> Obviously, I included the wrong patch ... apologies: -------------- next part -------------- A non-text attachment was scrubbed... Name: tftp.patch Type: text/x-patch Size: 456 bytes Desc: Patch for tftp_file URL: From brainshampoo@REDACTED Sun Oct 1 14:37:14 2006 From: brainshampoo@REDACTED (charles) Date: Sun, 01 Oct 2006 13:37:14 +0100 Subject: [erlang-questions] Jinterface to RSA problem References: Message-ID: <20061001123714.821CC5A1F4@mail.erlangsystems.com> Hello, I am new to Erlang with some Java background. To put my mind at rest about some missing features I am trying to connect to the Java side using Jinterface. The Java side seems to be working well. I am also able to get the RSA public key string with a flush() in the shell of the Erlang side node, but I can't find a way to get it displayed in an .erl module. How can get the result back on the Erlang side? As I understand, I should spawn the remote module, some function inside it, and get it's Pid and receive from that Pid. But how can this be done on code that was started with the java command? Thank you for bearing with me. (The code for every Java and Erlang file I used follows.) I compiled the Java code with the following command: javac -cp .:/usr/local/lib/erlang/lib/jinterface-1.3/priv/OtpErlang.jar gurka3.java and started the Java node like this: java -DOtpConnection.trace=4 -classpath .:/usr/local/lib/erlang/lib/jinterface-1.3/priv/OtpErlang.jar gurka3 -> PUBLISH (r4) gurka@REDACTED port=49937 <- OK I then started another node: erl -sname node1 Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] Eshell V5.5 (abort with ^G) (node1@REDACTED)1> net_adm:ping(gurka@REDACTED). pong where I was able to ping the Java node (gurka@REDACTED) and confirm both nodes are up with epmd -names: epmd: up and running on port 4369 with data: name node1 at port 49940 name gurka at port 49937 I can also send a message with the required Key length message: (node1@REDACTED)2> {echo, gurka@REDACTED} ! {self(), 1024}. {<0.38.0>,1024} (node1@REDACTED)3> It gets answered on the Java node: <- REG_SEND {6,#Pid,',echo} {#Pid,1024} 1024 Sun RSA private CRT key, 1024 bits modulus: 11698592641286154................ -> SEND {2,',#Pid} [83,117,110,32,82,83,65,32,112,117,98,108,105,99,32,......... I can also flush the result sent to the erlang node in the shell: (node1@REDACTED)3> flush(). Shell got "Sun RSA public key, 1024 bitsn modulus: 116985926412861549643428351537401442068945395315880329380936347783710839103091897221317948145702186219833676989450017983327760320285286206568121060246142214498882101528329498904155872540711412245495224009570070210033560284058357681558690299799836757921261113112027577663369501534610442608629632562973393140053n public exponent: 65537" ok !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! My question is: How do I get the result inside an Erlang module? As I understand, I should spawn the remote module, some function inside it, and get it's Pid and receive from that Pid. But how can this be done on code that was started with the java command? My ignorance of Erlang shows in the code below: %% jinterfaceclient.erl -module(jinterfaceclient). -export([start/1, getKey/1]). start(L) -> spawn(fun() -> getKey(L) end). getKey(Length) -> {echo, gurka@REDACTED} ! {self(), Length}, c:flush(), receive {_,_,_,L} -> [L] end. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! My Java code follows: # RSAStuff2.java --------------------------------------------------------- import java.security.*; public class RSAStuff2 { public static String getPublicKey(int length) { // public static void main(String[] args) { PublicKey publicKey = null; try { KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); keyGen.initialize(length); KeyPair keypair = keyGen.genKeyPair(); PrivateKey privateKey = keypair.getPrivate(); System.out.println(privateKey); publicKey = keypair.getPublic(); // System.out.println(publicKey); } catch (java.security.NoSuchAlgorithmException e) { } return publicKey.toString(); } } # gurka3.java --------------------------------------------------------- import com.ericsson.otp.erlang.*; public class gurka3 { public static void main(String[] args) { OtpNode self = null; OtpMbox mbox = null; try { self = new OtpNode("gurka"); mbox = self.createMbox("echo"); } catch (Exception e) { System.out.println("" + e); } OtpErlangObject o; OtpErlangTuple msg; OtpErlangPid from; while (true) { try { o = mbox.receive(); if (o instanceof OtpErlangTuple) { msg = (OtpErlangTuple)o; from = (OtpErlangPid)(msg.elementAt(0)); OtpErlangLong length = (OtpErlangLong)(msg.elementAt(1)); System.out.println(length.intValue()); int l = length.intValue(); mbox.send(from,new OtpErlangList(RSAStuff2.getPublicKey(l))); } } catch (Exception e) { System.out.println("" + e); } } } } ------------------------------------------------------------------------------------ _________________________________________________________ Post sent from http://www.trapexit.org From vladdu55@REDACTED Sun Oct 1 16:14:04 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Sun, 1 Oct 2006 14:14:04 +0000 Subject: [erlang-questions] Jinterface to RSA problem In-Reply-To: <20061001123714.821CC5A1F4@mail.erlangsystems.com> References: <20061001123714.821CC5A1F4@mail.erlangsystems.com> Message-ID: <95be1d3b0610010714q5e6dbaa0kbaf46e57bdf74e87@mail.gmail.com> Hi and welcome, You have already found the answer yourself :-) getKey(Length) -> {echo, gurka@REDACTED} ! {self(), Length}, receive Msg -> Msg end. If you call (from the shell or not) jinterfaceclient:getKey(1024), you should get the value back. c:flush() *removes* any messages from the shell message queue, so if you call it, there's nothing to be received anymore. best regards, Vlad From vladdu55@REDACTED Sun Oct 1 16:20:17 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Sun, 1 Oct 2006 14:20:17 +0000 Subject: [erlang-questions] Intel and 80 cores In-Reply-To: <451EE8C2.4050501@gurusnetwork.org> References: <451CABEA.8010009@duomark.com> <451EB1EC.4030305@blueyonder.co.uk> <451EE8C2.4050501@gurusnetwork.org> Message-ID: <95be1d3b0610010720v32cddbadhe8544f1ae19bb439@mail.gmail.com> Hi, On 9/30/06, CyBerHigh wrote: > Some applications... I would say most applications. I would be more > impressed with a new hdd that allowed 3 G/s read and write speeds with > 1 ms seek times. Sadly hdd are not the 'cool' thing people brag > about. However as cpu and ram speeds get faster hdd will grow > slightly. Hopefully there is a large leep in performance some day soon. Well, things begin to happen on that front too: solid state memories. There are some 32GB flash "hdd killers" (see http://www.reghardware.co.uk/2006/03/21/samsung_unveils_ssd/) so I'd say the snowball is rolling. The main issue for now is the fact the flash memory has a limited lifetime (in number of reads/writes). best regards, Vlad From brainshampoo@REDACTED Sun Oct 1 16:46:24 2006 From: brainshampoo@REDACTED (charles) Date: Sun, 01 Oct 2006 15:46:24 +0100 Subject: [erlang-questions] Jinterface to RSA problem References: Message-ID: <20061001144624.B186A5A1F4@mail.erlangsystems.com> Thank you all the same for your prompt answer, Vlad. This Jinterface is very powerful and works so fast. I almost can't see any speed difference with my code executing in Java. This is one tool I'll add to my development kit. By the way, from now on I'm adopting Erlang. /Charles _________________________________________________________ Post sent from http://www.trapexit.org From david.nospam.hopwood@REDACTED Sun Oct 1 17:07:17 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Sun, 01 Oct 2006 16:07:17 +0100 Subject: [erlang-questions] inets / tftpd bug and patch In-Reply-To: <87r6xs7e9s.fsf@coco.kazmier.com> References: <871wps8u0r.fsf@coco.kazmier.com> <87r6xs7e9s.fsf@coco.kazmier.com> Message-ID: <451FD9A5.9080601@blueyonder.co.uk> Pete Kazmier wrote: > Obviously, I included the wrong patch ... apologies: > ------------------------------------------------------------------------ > > --- lib/inets/src/tftp/tftp_file.erl Wed May 3 04:24:29 2006 > +++ lib/inets/src/tftp/tftp_file.erl.new Sat Sep 30 22:35:08 2006 > @@ -269,8 +269,8 @@ > filename_join(Dir, Filename) -> > case filename:pathtype(Filename) of > absolute -> > - [_ | RelDir] = filename:split(Dir), > - filename:join([RelDir, Filename]); > + [_ | RelDir] = filename:split(Filename), > + filename:join([Dir | RelDir); Missing ']'. > _ -> > filename:join([Dir, Filename]) > end. -- David Hopwood From pete-expires-20061130@REDACTED Sun Oct 1 17:25:04 2006 From: pete-expires-20061130@REDACTED (Pete Kazmier) Date: Sun, 01 Oct 2006 11:25:04 -0400 Subject: [erlang-questions] inets / tftpd bug and patch References: <871wps8u0r.fsf@coco.kazmier.com> <87r6xs7e9s.fsf@coco.kazmier.com> <451FD9A5.9080601@blueyonder.co.uk> Message-ID: <87k63k6otr.fsf@coco.kazmier.com> David Hopwood writes: > Pete Kazmier wrote: >> - [_ | RelDir] = filename:split(Dir), >> - filename:join([RelDir, Filename]); >> + [_ | RelDir] = filename:split(Filename), >> + filename:join([Dir | RelDir); > > Missing ']'. You can tell it was almost 3am when I sent those emails ... Thanks, Pete From bjarne@REDACTED Sun Oct 1 20:10:54 2006 From: bjarne@REDACTED (=?iso-8859-1?Q?Bjarne_D=E4cker?=) Date: Sun, 1 Oct 2006 20:10:54 +0200 Subject: [erlang-questions] Erlang/OTP User Conference 2006 - Call for papers References: <20060721090314.CA7AD5A1E9@mail.erlangsystems.com> Message-ID: <000601c6e585$043e7150$502069d4@Dell> Dear Erlang friends, This year's Erlang/OTP User Conference, EUC, will take place in the usual location at Ericsson's in Stockholm on November 9. Please see the call for papers here http://www.erlang.se/euc/06/ Presentations could be academic papers, project reports, over-head slides etc. This year we have also booked some conference rooms on November 10 for seminars or discussions on particular topics, for example "making money using Erlang", multi-core Erlang etc. The dead-line for submissions is October 15 after which we will publish the programme and send out invitations to attend the EUC. All submissions and questions should be sent to euc@REDACTED Looking forward to seeing you all again Bjarne D?cker, chairman of EUC'06 From ok@REDACTED Mon Oct 2 00:58:16 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 2 Oct 2006 11:58:16 +1300 (NZDT) Subject: [erlang-questions] Intel and 80 cores Message-ID: <200610012258.k91MwGhH012502@atlas.otago.ac.nz> "Vlad Dumitrescu" wrote: Well, things begin to happen on that front too: solid state memories. There are some 32GB flash "hdd killers" (see http://www.reghardware.co.uk/2006/03/21/samsung_unveils_ssd/) so I'd say the snowball is rolling. That article says 'The company claimed the so-called "solid state disk" can access data three times faster than an HDD can and write files one-and-a-half times more quickly ...' For a solid-state device to only read 3 times faster than spinning lumps of metal is rather disappointing. Mind you, that's well worth having... From datacompboy@REDACTED Mon Oct 2 05:27:01 2006 From: datacompboy@REDACTED (datacompboy) Date: Mon, 02 Oct 2006 04:27:01 +0100 Subject: [erlang-questions] Bug ?! References: Message-ID: <20061002032701.70A275A1FC@mail.erlangsystems.com> Is that a bug of compiler? -module(a). -record(x, {a, b, c}). -export([bug/1]). bug(X) -> receive {msg, X#x.a} -> ok after 0 -> ok end. We got "illegal pattern" on {msg, X#x.a}. If we change code so: bug(X) -> XA = X#x.a, receive {msg, XA} -> ok after 0 -> ok end. it works. Is that bug of records compilation, or feature?! -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From damir@REDACTED Mon Oct 2 08:38:44 2006 From: damir@REDACTED (Damir Horvat) Date: Mon, 2 Oct 2006 08:38:44 +0200 Subject: [erlang-questions] Multiple core processors Message-ID: <20061002063844.GA97182@semp.x-si.org> Hi! How does Erlang take advantage of multiple core processors? erl binary does not link to any of system threading libs. How can then use more than one core? Cheers, Damir From vladdu55@REDACTED Mon Oct 2 08:42:55 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 2 Oct 2006 08:42:55 +0200 Subject: [erlang-questions] Intel and 80 cores In-Reply-To: <200610012258.k91MwGhH012502@atlas.otago.ac.nz> References: <200610012258.k91MwGhH012502@atlas.otago.ac.nz> Message-ID: <95be1d3b0610012342j66cd47e6v4860b51fef6e9462@mail.gmail.com> On 10/2/06, Richard A. O'Keefe wrote: > "Vlad Dumitrescu" wrote: > Well, things begin to happen on that front too: solid state memories. > There are some 32GB flash "hdd killers" (see > http://www.reghardware.co.uk/2006/03/21/samsung_unveils_ssd/) so I'd > say the snowball is rolling. > > That article says > 'The company claimed the so-called "solid state disk" can > access data three times faster than an HDD can and write files > one-and-a-half times more quickly ...' > > For a solid-state device to only read 3 times faster than spinning lumps > of metal is rather disappointing. Mind you, that's well worth having... So true, so true... but that was in March - now there are more companies producing the stuff (TDK for example). I'd give it a year or two before the rough edges are removed. There is also a longer term issue: I guess in the future there won't be any difference between "system RAM" and "hdd replacement flash RAM", but there will be systems with let's say 500GB RAM. I believe the PC architecture would need to change too. best regards, Vlad From valentin@REDACTED Mon Oct 2 10:08:30 2006 From: valentin@REDACTED (Valentin Micic) Date: Mon, 2 Oct 2006 10:08:30 +0200 Subject: [erlang-questions] Bug ?! References: <20061002032701.70A275A1FC@mail.erlangsystems.com> Message-ID: <00a901c6e5f9$f4e67840$6601a8c0@moneymaker2> No, this is not a compiler bug. One cannot use record accessor syntax for pattern matching. If you're interested in field "a" of the record "x", you could rewrite the whole thing like this: bug( X = #x{a=ValueOfA}) -> receive {msg, ValueOfA} -> ok after 0 -> also_ok end. or, since X hasn't been referenced anywhere: bug( #x{a=ValueOfA}) -> receive {msg, ValueOfA} -> ok after 0 -> also_ok end. The above mathces the function head to a record #x{} and then binds the complete record to variable X, and value of "a" to ValueOfA. As for receive statement, one can also use record syntax in pattern matching i.e.: bug( _ ) -> receive {msg, X = #x{}} -> ok after 0 -> also_ok end. Hope this clarify things a bit. V. ----- Original Message ----- From: "datacompboy" To: Sent: Monday, October 02, 2006 5:27 AM Subject: [erlang-questions] Bug ?! > > Is that a bug of compiler? > > -module(a). > -record(x, {a, b, c}). > -export([bug/1]). > > bug(X) -> > receive > {msg, X#x.a} -> ok > after 0 -> ok > end. > > We got "illegal pattern" on {msg, X#x.a}. > If we change code so: > bug(X) -> > XA = X#x.a, > receive > {msg, XA} -> ok > after 0 -> ok > end. > > it works. Is that bug of records compilation, or feature?! > -- > --- suicide proc near\n call death\n suicide endp > _________________________________________________________ > Post sent from http://www.trapexit.org > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From richardc@REDACTED Mon Oct 2 10:09:09 2006 From: richardc@REDACTED (Richard Carlsson) Date: Mon, 02 Oct 2006 10:09:09 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <20061002032701.70A275A1FC@mail.erlangsystems.com> References: <20061002032701.70A275A1FC@mail.erlangsystems.com> Message-ID: <4520C925.3020804@it.uu.se> datacompboy wrote: > Is that a bug of compiler? > > receive > {msg, X#x.a} -> ok > after 0 -> ok > end. > > We got "illegal pattern" on {msg, X#x.a}. This is not a bug. "X#x.a" cannot be used as a pattern. The following should work, though: receive {msg, Y} when Y == X#x.a -> ok after 0 -> ok end. /Richard From datacompboy@REDACTED Mon Oct 2 10:54:02 2006 From: datacompboy@REDACTED (datacompboy) Date: Mon, 02 Oct 2006 09:54:02 +0100 Subject: [erlang-questions] WebTools available References: Message-ID: <20061002085402.65F135A1FC@mail.erlangsystems.com> Is there somewhere additional WebTool's? WebTool analog for tv will be really good thing... -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From tobbe@REDACTED Mon Oct 2 11:02:59 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Mon, 02 Oct 2006 11:02:59 +0200 Subject: [erlang-questions] WebTools available In-Reply-To: <20061002085402.65F135A1FC@mail.erlangsystems.com> References: <20061002085402.65F135A1FC@mail.erlangsystems.com> Message-ID: datacompboy wrote: > Is there somewhere additional WebTool's? > > WebTool analog for tv will be really good thing... Take a look at 'ymnesia' in the Yaws CVS (or in jungerl/yfront). -- Tobbe > -- > --- suicide proc near\n call death\n suicide endp > _________________________________________________________ > Post sent from http://www.trapexit.org > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From yan.guiborat@REDACTED Mon Oct 2 11:22:49 2006 From: yan.guiborat@REDACTED (netboz) Date: Mon, 2 Oct 2006 02:22:49 -0700 (PDT) Subject: [erlang-questions] Making your own behaviours Message-ID: <6598219.post@talk.nabble.com> Hi, Still looking how have some kind of "ressources permissions" at a "process level" into a node. Well if only I could write my own behaviours, I'm almost sure there is a solution in this direction. But, I can't find any documentation about writing behaviours, I remember seeing something about it some time ago, but not anymore. Could anyone tell me where I could find such kind of documentation, I'll have a look to supervisor souce code meanwhile. Thanks, -- View this message in context: http://www.nabble.com/Making-your-own-behaviours-tf2368536.html#a6598219 Sent from the Erlang Questions mailing list archive at Nabble.com. From mats.cronqvist@REDACTED Mon Oct 2 09:35:26 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 02 Oct 2006 09:35:26 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <20061002032701.70A275A1FC@mail.erlangsystems.com> References: <20061002032701.70A275A1FC@mail.erlangsystems.com> Message-ID: <4520C13E.5040209@ericsson.com> datacompboy wrote: > Is that a bug of compiler? > > -module(a). > -record(x, {a, b, c}). > -export([bug/1]). > > bug(X) -> > receive > {msg, X#x.a} -> ok > after 0 -> ok > end. > > We got "illegal pattern" on {msg, X#x.a}. > If we change code so: > bug(X) -> > XA = X#x.a, > receive > {msg, XA} -> ok > after 0 -> ok > end. > > it works. Is that bug of records compilation, or feature?! it's an artifact of the (rather lame) way records are implemented. (X#x.a is essentially a macro for element(?INDEX(a,x),X), where INDEX is the field position of a in x). so, a feature :> mats From datacompboy@REDACTED Mon Oct 2 12:15:42 2006 From: datacompboy@REDACTED (datacompboy) Date: Mon, 02 Oct 2006 11:15:42 +0100 Subject: [erlang-questions] WebTools available References: Message-ID: <20061002101542.6D40F5A1F4@mail.erlangsystems.com> tobbe wrote: Take a look at 'ymnesia' in the Yaws CVS (or in jungerl/yfront). (end of quote) pfwwweeff!! lot of code, installation of libpam-dev (to build yaws), lot of additional application to start... and see that it doesn't works! :)))) ok, got it works will by change shown below... and that only for view, no sorting, nothing! ok, will try patch tv to add webtool's behaviour. --- src/ymnesia.erl     2006-10-02 11:11:09.000000000 +0100 +++ ../../../yaws/src/ymnesia.erl       2006-09-06 12:22:17.000000000 +0100 @@ -145,7 +147,7 @@      case catch ?MNESIA(table_info, [Table, attributes]) of         Headers when list(Headers) ->             Vp = view_pattern(Cbox, map(fun(X) -> a2l(X) end, Headers)), -           {Q, Result} = do_query(Table, Sp), +           {Q, Result} = do_query(Sp),             {ehtml,              [{head, [],                [meta() ++ @@ -241,9 +243,9 @@  massage(W) ->      lists:flatten(io_lib:format("~p",[W])). -do_query(Table, Sp) -> -    {lists:flatten(io_lib:format("mnesia:match_object(~p,~p)", [Table,Sp])), -     lists:keysort(2, ?MNESIA(dirty_match_object, [Table, Sp]))}. +do_query(Sp) -> +    {lists:flatten(io_lib:format("mnesia:match_object(~p)", [Sp])), +     lists:keysort(2, ?MNESIA(dirty_match_object, [Sp]))}.  error_page(Msg) ->      {html, -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From samuelrivas@REDACTED Mon Oct 2 13:51:49 2006 From: samuelrivas@REDACTED (Samuel Rivas) Date: Mon, 2 Oct 2006 13:51:49 +0200 Subject: [erlang-questions] Making your own behaviours In-Reply-To: <6598219.post@talk.nabble.com> References: <6598219.post@talk.nabble.com> Message-ID: <20061002115149.GB24842@lambdastream.com> netboz wrote: > Well if only I could write my own behaviours, I'm almost sure there is a > solution in this direction. > But, I can't find any documentation about writing behaviours, I remember > seeing something about it > some time ago, but not anymore. There is a "cascading behaviours" turorial in trapexit: http://wiki.trapexit.org/index.php/Cascading_Behaviours Regards -- Samuel From hakan@REDACTED Mon Oct 2 16:43:45 2006 From: hakan@REDACTED (Hakan Mattsson) Date: Mon, 2 Oct 2006 16:43:45 +0200 (CEST) Subject: [erlang-questions] inets / tftpd bug and patch In-Reply-To: <871wps8u0r.fsf@coco.kazmier.com> References: <871wps8u0r.fsf@coco.kazmier.com> Message-ID: On Sun, 1 Oct 2006, Pete Kazmier wrote: PK> I believe the correct version should be: PK> PK> filename_join(Dir, Filename) -> PK> case filename:pathtype(Filename) of PK> absolute -> PK> [_ | RelDir] = filename:split(Filename), % CHANGED PK> filename:join([Dir | RelDir); % CHANGED PK> _ -> PK> filename:join([Dir, Filename]) PK> end. PK> PK> Included is a patch. Yes, you are right. Thanks for the patch. /H?kan From bengt.kleberg@REDACTED Mon Oct 2 09:11:50 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 02 Oct 2006 09:11:50 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <20061002032701.70A275A1FC@mail.erlangsystems.com> References: <20061002032701.70A275A1FC@mail.erlangsystems.com> Message-ID: <4520BBB6.4040303@ericsson.com> On 2006-10-02 05:27, datacompboy wrote: > Is that a bug of compiler? > > -module(a). > -record(x, {a, b, c}). > -export([bug/1]). > > bug(X) -> > receive > {msg, X#x.a} -> ok > after 0 -> ok > end. the notation X#x.a is (after the pre-processor has pre-processed it) a function call. you are not allowed function calls in the receive statement. ie, this is (also) wrong: bug(X) -> receive {msg, func(X)} -> ok after 0 -> ok end; func(_X) -> ok. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From hakan@REDACTED Mon Oct 2 16:55:48 2006 From: hakan@REDACTED (Hakan Mattsson) Date: Mon, 2 Oct 2006 16:55:48 +0200 (CEST) Subject: [erlang-questions] inets / tftpd bug and patch In-Reply-To: <87r6xs7e9s.fsf@coco.kazmier.com> References: <871wps8u0r.fsf@coco.kazmier.com> <87r6xs7e9s.fsf@coco.kazmier.com> Message-ID: On Sun, 1 Oct 2006, Pete Kazmier wrote: PK> Obviously, I included the wrong patch ... apologies: It does not matter. The important thing was that you reported the bug. I had already taken the liberty of changing the patch slightly. Thank again. /H?kan From gefla@REDACTED Mon Oct 2 22:43:18 2006 From: gefla@REDACTED (Gerd Flaig) Date: Mon, 02 Oct 2006 22:43:18 +0200 Subject: [erlang-questions] Multiple core processors References: <20061002063844.GA97182@semp.x-si.org> Message-ID: <87mz8ee9eh.fsf@kilo.pond.sub.org> Damir Horvat writes: > How does Erlang take advantage of multiple core processors? erl binary > does not link to any of system threading libs. How can then use more > than one core? it does on my system: % ldd /usr/lib/erlang/erts-5.5.1/bin/beam libdl.so.2 => /lib/libdl.so.2 (0x00002aaaaabc2000) libm.so.6 => /lib/libm.so.6 (0x00002aaaaacc4000) libncurses.so.5 => /lib/libncurses.so.5 (0x00002aaaaae49000) libpthread.so.0 => /lib/libpthread.so.0 (0x00002aaaaafa5000) librt.so.1 => /lib/librt.so.1 (0x00002aaaab0bb000) libc.so.6 => /lib/libc.so.6 (0x00002aaaab1c3000) /lib64/ld-linux-x86-64.so.2 (0x00002aaaaaaab000) I just checked, even versions below R11 use libpthread, even though the virtual machine only uses one thread in those. To make use of more than one processor for Erlang code, you either have to run multiple nodes on one host or use at least R11. Goodbyte, Gerd. -- The last thing one knows in constructing a work is what to put first. -- Blaise Pascal From taavi@REDACTED Mon Oct 2 23:35:14 2006 From: taavi@REDACTED (Taavi Talvik) Date: Tue, 3 Oct 2006 00:35:14 +0300 Subject: [erlang-questions] Multiple core processors In-Reply-To: <87mz8ee9eh.fsf@kilo.pond.sub.org> References: <20061002063844.GA97182@semp.x-si.org> <87mz8ee9eh.fsf@kilo.pond.sub.org> Message-ID: <6e8b339963ea0c025898fd4eb8147a09@uninet.ee> On Oct 2, 2006, at 11:43 PM, Gerd Flaig wrote: > Damir Horvat writes: > >> How does Erlang take advantage of multiple core processors? erl binary >> does not link to any of system threading libs. How can then use more >> than one core? > > it does on my system: > > % ldd /usr/lib/erlang/erts-5.5.1/bin/beam > libdl.so.2 => /lib/libdl.so.2 (0x00002aaaaabc2000) > libm.so.6 => /lib/libm.so.6 (0x00002aaaaacc4000) > libncurses.so.5 => /lib/libncurses.so.5 (0x00002aaaaae49000) > libpthread.so.0 => /lib/libpthread.so.0 (0x00002aaaaafa5000) > librt.so.1 => /lib/librt.so.1 (0x00002aaaab0bb000) > libc.so.6 => /lib/libc.so.6 (0x00002aaaab1c3000) > /lib64/ld-linux-x86-64.so.2 (0x00002aaaaaaab000) > > I just checked, even versions below R11 use libpthread, even though > the virtual machine only uses one thread in those. To make use of more > than one processor for Erlang code, you either have to run multiple > nodes on one host or use at least R11. I can be mistaken, but even earlier Erlang VM-s used separate OS thread for io (ports). best regards, taavi From ok@REDACTED Tue Oct 3 01:38:38 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 3 Oct 2006 12:38:38 +1300 (NZDT) Subject: [erlang-questions] Bug ?! Message-ID: <200610022338.k92NccH0022798@atlas.otago.ac.nz> We've seen a number of explanations for why #. isn't allowed in a pattern match. Basically, it's because that expands to element(, ), and that happens not to be allowed. Of course, it could be given a different expansion, so the question of whether field access SHOULD be allowed in a pattern remains open. My first reaction was "well, a reasonable user wanted to use it, so why not?" The more I thought about it, the less I liked it, but I can't quite put my finger on why not. It's something to do with blurring the distinction between patterns and expressions too much. Can anyone else put it into words? From ckerr@REDACTED Tue Oct 3 02:36:45 2006 From: ckerr@REDACTED (Cameron Kerr) Date: Tue, 3 Oct 2006 13:36:45 +1300 Subject: [erlang-questions] Multiple core processors In-Reply-To: <20061002063844.GA97182@semp.x-si.org> References: <20061002063844.GA97182@semp.x-si.org> Message-ID: <052B1089-8452-442E-87ED-6DA0BAD55591@cs.otago.ac.nz> And is there a benchmarking process/document/result for multicore-etc machines. I have an opportunity to use a Sun UltraSPARC T2000 running Solaris and Linux, and would like to get an idea of the likely performance metrics compared to classically threaded programs. Thanks, Cameron From datacompboy@REDACTED Tue Oct 3 06:59:44 2006 From: datacompboy@REDACTED (datacompboy) Date: Tue, 03 Oct 2006 05:59:44 +0100 Subject: [erlang-questions] Bug ?! References: Message-ID: <20061003045944.5F6DF5A1FC@mail.erlangsystems.com> Quote: Basically, it's because that expands to element(, ), and that happens not to be allowed. (end of quote) Yes, right, but I just think that compiler can do such: Var#rec.val -> expands to LambdaVar=element(#rec.val, Var), LambdaVar so matching possible. And optimization pass should just remove LambdaVar in cases like X = Y#recy.xval. But i'm not sure about optimizations of erlang, so can't say is that possible in current realization -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From gefla@REDACTED Tue Oct 3 09:25:21 2006 From: gefla@REDACTED (Gerd Flaig) Date: Tue, 03 Oct 2006 09:25:21 +0200 Subject: [erlang-questions] Multiple core processors References: <20061002063844.GA97182@semp.x-si.org> <052B1089-8452-442E-87ED-6DA0BAD55591@cs.otago.ac.nz> Message-ID: <87irj1eu8u.fsf@kilo.pond.sub.org> Cameron Kerr writes: > And is there a benchmarking process/document/result for multicore-etc > machines. I have an opportunity to use a Sun UltraSPARC T2000 running > Solaris and Linux, and would like to get an idea of the likely > performance metrics compared to classically threaded programs. there has been some discussion about this in June: http://thread.gmane.org/gmane.comp.lang.erlang.general/15639/focus=15643 What I gather from the conversation is that there is a global disk IO lock which leads to performance degradation in disk IO intensive applications, however there are plans to improve the situation. If I had to make a wild guess, I'd expect that the process ring benchmark would scale almost linearly with the number of processors. Goodbyte, Gerd. -- The last thing one knows in constructing a work is what to put first. -- Blaise Pascal From richardc@REDACTED Tue Oct 3 09:52:16 2006 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 03 Oct 2006 09:52:16 +0200 Subject: [erlang-questions] Multiple core processors In-Reply-To: <87irj1eu8u.fsf@kilo.pond.sub.org> References: <20061002063844.GA97182@semp.x-si.org> <052B1089-8452-442E-87ED-6DA0BAD55591@cs.otago.ac.nz> <87irj1eu8u.fsf@kilo.pond.sub.org> Message-ID: <452216B0.1020000@it.uu.se> Gerd Flaig wrote: > Cameron Kerr writes: > >> And is there a benchmarking process/document/result for multicore-etc >> machines. I have an opportunity to use a Sun UltraSPARC T2000 running >> Solaris and Linux, and would like to get an idea of the likely >> performance metrics compared to classically threaded programs. > > there has been some discussion about this in June: > > http://thread.gmane.org/gmane.comp.lang.erlang.general/15639/focus=15643 There are also some benchmark results in the R11 release notes: http://www.erlang.org/doc/doc-5.5/doc/highlights.html > If I had to make a wild guess, I'd expect that the process ring > benchmark would scale almost linearly with the number of processors. Probably not, since the typical ring benchmark only has one active process at a time. If there were multiple messages being circulated simultaneously, things would be different. /Richard From richardc@REDACTED Tue Oct 3 10:45:11 2006 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 03 Oct 2006 10:45:11 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <200610022338.k92NccH0022798@atlas.otago.ac.nz> References: <200610022338.k92NccH0022798@atlas.otago.ac.nz> Message-ID: <45222317.1020305@it.uu.se> Richard A. O'Keefe wrote: > We've seen a number of explanations for why #. > isn't allowed in a pattern match. Basically, it's because that expands > to element(, ), and that happens not to be allowed. To make things clear to everybody: the syntax checking stage (which happens before expansion) has never allowed it, regardless of whether it could be translated to reasonable code. It has simply never been done. > Of course, it could be given a different expansion, so the question > of whether field access SHOULD be allowed in a pattern remains open. Precisely. > My first reaction was "well, a reasonable user wanted to use it, so why not?" > The more I thought about it, the less I liked it, but I can't quite put my > finger on why not. It's something to do with blurring the distinction > between patterns and expressions too much. Can anyone else put it into words? I'll make an attempt: All currently allowed patterns describe the structure of the data in a compositional way, outside-in, with variables for the blank parts. This goes even for string-prefix patterns using the ++ operator, as in `f("xyz"++Xs)->...' (or even Haskell's n+k patterns). Previously bound variables add an extra constraint: `{foo, X}->...', where X is a bound variable, is equivalent to `{foo, Y} when Y =:= X ->...' (where Y is a new variable), but the pattern is still compositional. Allowing a pattern such as X#r.a, however, introduces a more general computation: it does not describe a record #r{a=..., ...} in the position of the pattern, but a constraint `{foo, Y} when Y =:= X#r.a ->...' (which in this case performs a decomposition). If this is allowed, there is no real reason why not arbitrary expressions (that may occur in guards) should be allowed, using the same expansion - but that would probably make guards rather unreadable and go against the "spirit of patterns" - it breaks compositionality (in the intuitive sense - I'm not trying to be formal here). `X#r.a' has a superficial look and feel that is close to the other (allowed) record patterns, which is probably why one may easily think that it should also be allowed, but it is really rather different. /Richard From datacompboy@REDACTED Tue Oct 3 11:23:56 2006 From: datacompboy@REDACTED (datacompboy) Date: Tue, 03 Oct 2006 10:23:56 +0100 Subject: [erlang-questions] Mnesia table type References: Message-ID: <20061003092357.236CC5A1FA@mail.erlangsystems.com> Hello anybody! Am I right, and mnesia can't change "set" to "bag" for existent table? -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From ulf.wiger@REDACTED Tue Oct 3 11:24:36 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Tue, 3 Oct 2006 11:24:36 +0200 Subject: [erlang-questions] Multiple core processors In-Reply-To: <452216B0.1020000@it.uu.se> Message-ID: The "Big bang" benchmark, which has been used to test the scalability of SMP Erlang in fact starts 1000 processes, which then communicate in a broadcast fashion, each process pinging every other process. In other words, it's not a simple ring benchmark.(*) This benchmark actually shows super-linear scalability, in the sense that with N processors, you get better than N times the speedup, compared to the single-CPU case. This was discussed briefly in http://www.erlang.org/ml-archive/erlang-questions/200605/msg00196.html BR, Ulf W (*) The standard ring benchmark is pretty serial, as Richark points out. It also has the curious property that it is perfect for the current "hybrid heap" implementation, since it copies the message only the first time it's sent, and the ring benchmark typically passes the same message around thousands of times. (: Benchmarks are a tricky business... > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of > Richard Carlsson > Sent: den 3 oktober 2006 09:52 > To: erlang-questions@REDACTED > Cc: Gerd Flaig > Subject: Re: [erlang-questions] Multiple core processors > > Gerd Flaig wrote: > > Cameron Kerr writes: > > > >> And is there a benchmarking process/document/result for > multicore-etc > >> machines. I have an opportunity to use a Sun UltraSPARC > T2000 running > >> Solaris and Linux, and would like to get an idea of the likely > >> performance metrics compared to classically threaded programs. > > > > there has been some discussion about this in June: > > > > > > > http://thread.gmane.org/gmane.comp.lang.erlang.general/15639/focus=156 > > 43 > > There are also some benchmark results in the R11 release notes: > http://www.erlang.org/doc/doc-5.5/doc/highlights.html > > > If I had to make a wild guess, I'd expect that the process ring > > benchmark would scale almost linearly with the number of processors. > > Probably not, since the typical ring benchmark only has one > active process at a time. If there were multiple messages > being circulated simultaneously, things would be different. > > /Richard > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bend@REDACTED Tue Oct 3 11:30:40 2006 From: bend@REDACTED (Ben Dougall) Date: Tue, 3 Oct 2006 10:30:40 +0100 Subject: [erlang-questions] how are erlang process lightweight? Message-ID: Hello, I'm trying to find out how Erlang processes work / what they're made of. I know they don't share their memory with each other (have their own heaps), in order to communicate do so by message passing that are serialised data. They run one after another, per cpu/core. The schedular decides which process should get to go next. They stop processing when they come to a point where they're waiting for a message or after they've been processing for a certain amount of time. All this is handled by the language/runtime system and happens within user space. Each process is very lightweight. I'm struggling to find out how they're lightweight. They're stackless? Is that correct? On the stack, with things that use them, local variables are stored. What happens to a process's local variables when it's switched out of control (due to coming to a point where it's waiting for a message or reached its time limit)? Each process must have local variables don't they? So what happens to them? Where do they get stored? If you have a set of local variables per process then how is each process considered so lightweight? And if you don't have a set of local variables per process then how can they operate reasonably -- local variables persisting seem essential? A set of local variables must get stored per process and if you have hundreds of thousands of processes that's not so lightweight is it? Also how do processes correspond to functions? Is it just one function per process? Processes and functions are very much tied up with each other; one to one? Any info or pointers to things that contain info on this would be much appreciated. Thanks, Ben. From hakan@REDACTED Tue Oct 3 11:46:22 2006 From: hakan@REDACTED (Hakan Mattsson) Date: Tue, 3 Oct 2006 11:46:22 +0200 (CEST) Subject: [erlang-questions] inets / tftpd startup question In-Reply-To: <87ven47edj.fsf@coco.kazmier.com> References: <87ven47edj.fsf@coco.kazmier.com> Message-ID: On Sun, 1 Oct 2006, Pete Kazmier wrote: PK> As I mentioned in my previous email, I've started using the tftpd PK> server included in inets. However, I'm having a hard time figuring PK> out the best way to start it. I was hoping that this would work: PK> PK> $ erl -sname tftp -detached -eval 'tftp:start([{port,8069}]).' The TFTP daemon is linked to its parent process and will terminate when its parent dies. In this case the parent does not survive the startup. As the TFTP code is a part of the inets application, it is complient with its (rather static) service concept. In order to start the TFTP daemon as an inets service, you can either put the following in a config file (in this case tftp.config): [ {inets, [{services, [{tftpd, [{port, 8069}]}]}]} ]. and start the TFTP daemon with: erl -sname tftp -config tftp.config -s tftp or do it as a one-liner: erl -sname tftp -detached -inets services '[{tftpd, [{port, 8069}]}]' -s tftp The trailing '-s tftp' is just a convenient way of invoking application:start(inets). /H?kan From hakan@REDACTED Tue Oct 3 11:50:33 2006 From: hakan@REDACTED (Hakan Mattsson) Date: Tue, 3 Oct 2006 11:50:33 +0200 (CEST) Subject: [erlang-questions] Mnesia table type In-Reply-To: <20061003092357.236CC5A1FA@mail.erlangsystems.com> References: <20061003092357.236CC5A1FA@mail.erlangsystems.com> Message-ID: On Tue, 3 Oct 2006, datacompboy wrote: > Am I right, and mnesia can't change "set" to "bag" > for existent table? Yes, you are right. It is not possible to change the table type of an existing Mnesia table. /H?kan From ulf.wiger@REDACTED Tue Oct 3 12:23:00 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Tue, 3 Oct 2006 12:23:00 +0200 Subject: [erlang-questions] how are erlang process lightweight? In-Reply-To: Message-ID: Check out the recent thread at Lambda the Ultimate: "What Makes Erlang Processess Tick?" http://lambda-the-ultimate.org/node/1742 BR, Ulf W > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Ben Dougall > Sent: den 3 oktober 2006 11:31 > To: erlang-questions@REDACTED > Subject: [erlang-questions] how are erlang process lightweight? > > Hello, > > I'm trying to find out how Erlang processes work / what > they're made of. I know they don't share their memory with > each other (have their own heaps), in order to communicate do > so by message passing that are serialised data. They run one > after another, per cpu/core. The schedular decides which > process should get to go next. They stop processing when they > come to a point where they're waiting for a message or after > they've been processing for a certain amount of time. > All this is handled by the language/runtime system and > happens within user space. > > Each process is very lightweight. I'm struggling to find out > how they're lightweight. They're stackless? Is that correct? > On the stack, with things that use them, local variables are > stored. What happens to a process's local variables when it's > switched out of control (due to coming to a point where it's > waiting for a message or reached its time limit)? Each > process must have local variables don't they? So what happens > to them? Where do they get stored? If you have a set of local > variables per process then how is each process considered so > lightweight? And if you don't have a set of local variables > per process then how can they operate reasonably -- local > variables persisting seem essential? A set of local variables > must get stored per process and if you have hundreds of > thousands of processes that's not so lightweight is it? > > Also how do processes correspond to functions? Is it just one > function per process? Processes and functions are very much > tied up with each other; one to one? > > Any info or pointers to things that contain info on this > would be much appreciated. > > Thanks, Ben. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From mats.cronqvist@REDACTED Tue Oct 3 13:03:23 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Tue, 03 Oct 2006 13:03:23 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <45222317.1020305@it.uu.se> References: <200610022338.k92NccH0022798@atlas.otago.ac.nz> <45222317.1020305@it.uu.se> Message-ID: <4522437B.8070002@ericsson.com> Richard Carlsson wrote: > Richard A. O'Keefe wrote: >> Of course, it could be given a different expansion, so the question >> of whether field access SHOULD be allowed in a pattern remains open. [...] > Allowing a pattern such as X#r.a, however, introduces a more general > computation: it does not describe a record #r{a=..., ...} in the > position of the pattern, but a constraint `{foo, Y} when Y =:= X#r.a > ->...' (which in this case performs a decomposition). If this is > allowed, there is no real reason why not arbitrary expressions (that may > occur in guards) should be allowed, using the same expansion and that would be a bad thing? apparently, since... > but that > would probably make guards rather unreadable and go against the "spirit > of patterns" - it breaks compositionality (in the intuitive sense - I'm > not trying to be formal here). that is way too philosophical for my (admittedly weak) mind. it seems good to me. perhaps richard has an example of such an "unreadable guard"? > `X#r.a' has a superficial look and feel that is close to the other > (allowed) record patterns, which is probably why one may easily think > that it should also be allowed, but it is really rather different. seems like a pretty obvious way to describe a constraint to me. mats From richardc@REDACTED Tue Oct 3 13:03:28 2006 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 03 Oct 2006 13:03:28 +0200 Subject: [erlang-questions] how are erlang process lightweight? In-Reply-To: References: Message-ID: <45224380.2010309@it.uu.se> Ben Dougall wrote: > I'm trying to find out how Erlang processes work / what they're made > of. As Ulf said, chech out the discussion at LtU, but here are some quick answers to fill in the blanks: > They stop processing when they come to a point where they're waiting > for a message or after they've been processing for a certain amount > of time. All this is handled by the language/runtime system and > happens within user space. Yes. Process switching is not triggered by real time, but by a counter which is decremented at (approximately) each function call. (Using interrupts has too much overhead.) > Each process is very lightweight. I'm struggling to find out how > they're lightweight. They're stackless? Is that correct? No, each process has a stack. But the stack is initially very small (on the order of 16-32 words, I think), and grows as needed. > What happens to a process's local variables when it's switched out of > control (due to coming to a point where it's waiting for a message or > reached its time limit)? Each process must have local variables don't > they? So what happens to them? Where do they get stored? If you have > a set of local variables per process then how is each process > considered so lightweight? Of course processes have local variables, and these are stored on the stack while the process is switched out. How much memory is used (stack plus heap) per process depends completely on what the process does and how it was written. Processes which only receive messages and respond to them quickly before going back to sleep, and which do not need to keep track of state between messages, might never need to grow their stacks at all, and might only use heap memory temporarily. > if you have hundreds of thousands of processes that's not so > lightweight is it? Yes it is, compared to threads which typically need at least a few K of allocated stack regardless of whether it will be used. Thread implementations have become better in recent years, but Erlang processes are still lightweight any way you count. > Also how do processes correspond to functions? Is it just one > function per process? Processes and functions are very much tied up > with each other; one to one? Functions are just program text. Just like several people can read from the same piece of paper, several processes may run the same code simultaneously (and usually do). For example, a single function might implement the main loop of a server process, with 100.000 process instances running that loop at the same time (and not all of them being at the same program point). /Richard From bend@REDACTED Tue Oct 3 13:25:37 2006 From: bend@REDACTED (Ben Dougall) Date: Tue, 3 Oct 2006 12:25:37 +0100 Subject: [erlang-questions] how are erlang process lightweight? In-Reply-To: Message-ID: Hello Ulf, Yes, thanks -- already read it and followed the links, and asked a previous similar question in that forum "what are the differences between erlang process and pthread threads?". Does the "What Makes Erlang Processess Tick?" thread and any of its answers and links address what happens to local variables of each process? The info that I said below in my question on this list was got from that "What Makes Erlang Processess Tick?" thread. Also this was useful: "Erlang Style Concurrency". This was quite interesting from "Erlang Style Concurrency": "[Erlang processes are] very cheap to start up and destroy and are very fast to switch between because under the hood they're simply functions." So that seems to be the thing, so far as memory footprint goes: threads have a stack and that stack is, as usual, made up or an indefinite number of frames -- potentially many/infinite -- grows per new function call. Whereas Erlang processes are tied very tightly (one to one) to functions, and a function's memory usage amount to one frame of a stack. So an Erlang process is limited to a frame of a stack. Am I on the right track there? It's the memory footprint of an Erlang process and the memory footprint of a normal thread -- comparison of the two I'm interested in. I still can't help feel that, if what I've just said is correct, that the Erlang process way and the normal thread way are just two different ways of organising the same thing and amount to the same size of memory footprint. If you have one thread and call three functions from that thread then you have a stack with three frames. If you want to do the same work with Erlang processes then you'd need three Erlang processes each using up their own frame -- so three frames. Much the same memory footprint, just organised/named differently. I suppose you organise your Erlang funtions/processes accordingly. If those three function calls are often done one after the other, then don't have them as separate functions -- have them as one function. Any corrections of any of that would be appreciated. Thanks, Ben. On Tuesday, October 3, 2006, at 11:23 am, Ulf Wiger (TN/EAB) wrote: > > Check out the recent thread at Lambda the Ultimate: > > "What Makes Erlang Processess Tick?" > > http://lambda-the-ultimate.org/node/1742 > > BR, > Ulf W > >> -----Original Message----- >> From: erlang-questions-bounces@REDACTED >> [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Ben Dougall >> Sent: den 3 oktober 2006 11:31 >> To: erlang-questions@REDACTED >> Subject: [erlang-questions] how are erlang process lightweight? >> >> Hello, >> >> I'm trying to find out how Erlang processes work / what >> they're made of. I know they don't share their memory with >> each other (have their own heaps), in order to communicate do >> so by message passing that are serialised data. They run one >> after another, per cpu/core. The schedular decides which >> process should get to go next. They stop processing when they >> come to a point where they're waiting for a message or after >> they've been processing for a certain amount of time. >> All this is handled by the language/runtime system and >> happens within user space. >> >> Each process is very lightweight. I'm struggling to find out >> how they're lightweight. They're stackless? Is that correct? >> On the stack, with things that use them, local variables are >> stored. What happens to a process's local variables when it's >> switched out of control (due to coming to a point where it's >> waiting for a message or reached its time limit)? Each >> process must have local variables don't they? So what happens >> to them? Where do they get stored? If you have a set of local >> variables per process then how is each process considered so >> lightweight? And if you don't have a set of local variables >> per process then how can they operate reasonably -- local >> variables persisting seem essential? A set of local variables >> must get stored per process and if you have hundreds of >> thousands of processes that's not so lightweight is it? >> >> Also how do processes correspond to functions? Is it just one >> function per process? Processes and functions are very much >> tied up with each other; one to one? >> >> Any info or pointers to things that contain info on this >> would be much appreciated. >> >> Thanks, Ben. >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > From bend@REDACTED Tue Oct 3 13:33:36 2006 From: bend@REDACTED (Ben Dougall) Date: Tue, 3 Oct 2006 12:33:36 +0100 Subject: [erlang-questions] how are erlang process lightweight? In-Reply-To: <45224380.2010309@it.uu.se> Message-ID: <024CE03A-52D3-11DB-8432-0030653F9ECE@freenet.co.uk> Richard, On Tuesday, October 3, 2006, at 12:03 pm, Richard Carlsson wrote: > No, each process has a stack. But the stack is initially very small > (on the order of 16-32 words, I think), and grows as needed. Thanks very much for the reply. Having only skimmed it I now see that my response to Ulf's reply is full of rubbish. Will read/digest your reply fully now. Thanks, Ben. From sean.hinde@REDACTED Tue Oct 3 13:58:05 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Tue, 3 Oct 2006 12:58:05 +0100 Subject: [erlang-questions] how are erlang process lightweight? In-Reply-To: References: Message-ID: <32C4F547-6652-4435-A5B4-F5DB6BF0F7D9@gmail.com> On 3 Oct 2006, at 12:25, Ben Dougall wrote: > > So that seems to be the thing, so far as memory footprint goes: > threads > have a stack and that stack is, as usual, made up or an indefinite > number of frames -- potentially many/infinite -- grows per new > function > call. Whereas Erlang processes are tied very tightly (one to one) to > functions, and a function's memory usage amount to one frame of a > stack. So an Erlang process is limited to a frame of a stack. This is where you are going wrong. An erlang function is only related to a process in the sense that processes evaluate functions. Each process has its own stack that can grow/shrink as much as it needs. It is not nearly as different to pthreads as you describe. The efficiency gains of Erlang are *only* those of being able to optimise process switching and do custom memory management. Erlang processes are actually more akin to UNIX processes as they do not share state. Think of them as exactly like UNIX processes with much less overhead and much nicer message passing. Having the flexibility to implement language specific memory management and process switching with custom message passing are big wins until UNIX implements the same things directly. I suspect that is not likely to happen soon. Sean From cyberdanx@REDACTED Tue Oct 3 14:00:19 2006 From: cyberdanx@REDACTED (Chris Campbell) Date: Tue, 3 Oct 2006 13:00:19 +0100 Subject: [erlang-questions] Yaws mailing list Message-ID: Hi, Is anyone else having problems with the yaws mailing list? My messages are sent back saying they'll be retried for 2 days. Then the mail system says it can't due to a call From cyberdanx@REDACTED Tue Oct 3 14:02:59 2006 From: cyberdanx@REDACTED (Chris Campbell) Date: Tue, 3 Oct 2006 13:02:59 +0100 Subject: [erlang-questions] Yaws mailing list In-Reply-To: References: Message-ID: woops. Didn't mean to send it. Is anyone else having problems with the yaws mailing list? My messages are sent back saying they'll be retried for 2 days. Then the mail system says it can't due to an error verifying sender via call out of similar. Cheers, Chris From bend@REDACTED Tue Oct 3 14:45:05 2006 From: bend@REDACTED (Ben Dougall) Date: Tue, 3 Oct 2006 13:45:05 +0100 Subject: [erlang-questions] how are erlang process lightweight? In-Reply-To: <45224380.2010309@it.uu.se> Message-ID: On Tuesday, October 3, 2006, at 12:03 pm, Richard Carlsson wrote: >> Each process is very lightweight. I'm struggling to find out how >> they're lightweight. They're stackless? Is that correct? > > No, each process has a stack. But the stack is initially very small > (on the order of 16-32 words, I think), and grows as needed. > >> What happens to a process's local variables when it's switched out of >> control (due to coming to a point where it's waiting for a message or >> reached its time limit)? Each process must have local variables don't >> they? So what happens to them? Where do they get stored? If you have >> a set of local variables per process then how is each process >> considered so lightweight? > > Of course processes have local variables, and these are stored on the > stack while the process is switched out. How much memory is used (stack > plus heap) per process depends completely on what the process does and > how it was written. Processes which only receive messages and respond > to them quickly before going back to sleep, and which do not need to > keep track of state between messages, might never need to grow their > stacks at all, and might only use heap memory temporarily. Sounds so similar to a thread? What's the main difference in terms of memory usage? Just packed more efficiently? >> if you have hundreds of thousands of processes that's not so >> lightweight is it? > > Yes it is, compared to threads which typically need at least a few K of > allocated stack regardless of whether it will be used. Thread > implementations have become better in recent years, but Erlang > processes > are still lightweight any way you count. So now I'm thinking the only difference between a thread and an Erlang process, so far as memory footprint goes, is the packing of each frame in the stack, and possibly the loss of some not so essential variables of the frame format? I'm still puzzled by the fact that there is considered such a difference in resource consumption, especially in the amount of memory used, between a thread and an Erlang process. Maybe it's not so much the memory footprint that is so lightweight with Erlang processes compared with threads, but the savings that having all this handled in user space gives? So Erlang processes don't give so much of a memory space saving, but a data-shifting-round saving? Thanks, Ben. From bend@REDACTED Tue Oct 3 14:47:14 2006 From: bend@REDACTED (Ben Dougall) Date: Tue, 3 Oct 2006 13:47:14 +0100 Subject: [erlang-questions] how are erlang process lightweight? In-Reply-To: <32C4F547-6652-4435-A5B4-F5DB6BF0F7D9@gmail.com> Message-ID: <4B6F2F14-52DD-11DB-8432-0030653F9ECE@freenet.co.uk> On Tuesday, October 3, 2006, at 12:58 pm, Sean Hinde wrote: > On 3 Oct 2006, at 12:25, Ben Dougall wrote: > >> So that seems to be the thing, so far as memory footprint goes: >> threads >> have a stack and that stack is, as usual, made up or an indefinite >> number of frames -- potentially many/infinite -- grows per new >> function >> call. Whereas Erlang processes are tied very tightly (one to one) to >> functions, and a function's memory usage amount to one frame of a >> stack. So an Erlang process is limited to a frame of a stack. > > This is where you are going wrong. An erlang function is only related > to a process in the sense that processes evaluate functions. Each > process has its own stack that can grow/shrink as much as it needs. > > It is not nearly as different to pthreads as you describe. The > efficiency gains of Erlang are *only* those of being able to optimise > process switching and do custom memory management. I've just coming to that conclusion from Richard's reply, as from what he was saying there is not much difference between thread and Erlang process memory footprints. > Erlang processes are actually more akin to UNIX processes as they do > not share state. Think of them as exactly like UNIX processes with > much less overhead and much nicer message passing. Yes I understand that. It was how they've ended up so light is what I was interested in. And I now realise that it's the fact that it's all (the switching etc.) handled in user space by the Erlang system where the efficiency/saving comes from. So it's not so much a saving of memory space (although I guess there is at least a bit of memory space saving) but a saving in the amount of memory-shifting-round that the machine needs to do. Less memory-shifting-round is necessary with E.P.s than threads. > Having the flexibility to implement language specific memory > management and process switching with custom message passing are big > wins until UNIX implements the same things directly. I suspect that is > not likely to happen soon. Right, thanks very much, Ben. From richardc@REDACTED Tue Oct 3 14:47:46 2006 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 03 Oct 2006 14:47:46 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <4522437B.8070002@ericsson.com> References: <200610022338.k92NccH0022798@atlas.otago.ac.nz> <45222317.1020305@it.uu.se> <4522437B.8070002@ericsson.com> Message-ID: <45225BF2.4080509@it.uu.se> Mats Cronqvist wrote: > perhaps richard has an example of such an "unreadable guard"? Take a clause like the following: {frob,Xyzzy#plugh.ouch*4711+length(Stuff),Fred} when Fred > 0 -> First of all, it gets pretty hard to see what the _structure_ of the thing is (a tuple with three elements). If you rewrite it: {frob,N,Fred} when N =:= Xyzzy#plugh.ouch*4711+length(Stuff), Fred > 0 -> it is easier on the eyes, I hope you agree. But that might not be the best argument, since it is quite possible to write complicated patterns using only lists and tuples. But there is also the question of variable bindings: in which cases should it be required that a variable is already bound, and in which cases can it be a new variable? Compare: X * 4711 length(Stuff) R#r.a and [X|Y] {foo, X} "abc" ++ Xs (We already see this problem in binary-patterns, where the size parameter must be bound - if it were a new variable, the pattern matching would have to do a linear search to find the first match.) If we said that a pattern could be any expression, but new variables can only occur as arguments of primitive data constructors, not of any other operators or functions, it might work, but I feel that it gets too hard for the reader (including myself) to follow what is going on in a pattern when you mix computation and matching. /Richard From bend@REDACTED Tue Oct 3 15:03:57 2006 From: bend@REDACTED (Ben Dougall) Date: Tue, 3 Oct 2006 14:03:57 +0100 Subject: [erlang-questions] how are erlang process lightweight? In-Reply-To: <024CE03A-52D3-11DB-8432-0030653F9ECE@freenet.co.uk> Message-ID: So to sum up, from an implementation of Erlang processes point of view, Erlang processes are _very_ similar to threads apart from: - each process/thread has it's own memory space which is never shared with others, and they communicate via message passing. - the mechanics of the process/thread is not handled by the OS outside user space, but by the Erlang runtime system in user space -- inside the programme's process(that use of "process" being the normal unix one). And the savings of doing all the switching etc. in user space is a main reason Erlang processes can be so lightweight. That, and also the loss of the need for locks etc. Thanks, Ben. From gordonguthrie@REDACTED Tue Oct 3 15:23:14 2006 From: gordonguthrie@REDACTED (Gordon Guthrie) Date: Tue, 3 Oct 2006 14:23:14 +0100 (BST) Subject: [erlang-questions] how are erlang process lightweight? In-Reply-To: References: <024CE03A-52D3-11DB-8432-0030653F9ECE@freenet.co.uk> Message-ID: <38501.194.72.110.12.1159881794.squirrel@backawinner.gg> Ben > So to sum up, from an implementation of Erlang processes point of view, > Erlang processes are _very_ similar to threads apart from: Well on pre-R11 Erlang bear in mind that they all run inside a single operating system thread... > - each process/thread has it's own memory space which is never shared > with others, and they communicate via message passing. They communicate by message passing ONLY which means there is no overhead for suspended processes (ie processes in receive-> ) as they can only be 'awakened' by another process (or timed out by the runtime) > - the mechanics of the process/thread is not handled by the OS outside > user space, but by the Erlang runtime system in user space -- inside > the programme's process(that use of "process" being the normal unix > one). Yes, but the programme's THREAD as above... > And the savings of doing all the switching etc. in user space is a main > reason Erlang processes can be so lightweight. That, and also the loss > of the need for locks etc. Gordon From chandrashekhar.mullaparthi@REDACTED Tue Oct 3 15:30:05 2006 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Tue, 3 Oct 2006 14:30:05 +0100 Subject: [erlang-questions] Vacancy at T-Mobile UK Message-ID: Hello, We have a vacancy in our test team in T-Mobile UK. There is usually quite a lot of testing of systems implemented using Erlang/OTP. If you are interested, check out: http://careers.peopleclick.com/jobposts/Client40_TMobile/BU1/EXTERNAL/pck317-68469.htm You can apply online. cheers Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From surindar.shanthi@REDACTED Tue Oct 3 17:27:26 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Tue, 3 Oct 2006 20:57:26 +0530 Subject: [erlang-questions] Error in Crypto module Message-ID: <42ea5fb60610030827g3d413f0dha5bad586ac1fdcc2@mail.gmail.com> Dear all, While I'm running crypto:start(). The following error message is thrown from erl.exe *"The application has failed to start because LIBEAY32.dll was not found. Re-installing the application may fix this problem"* ** I have re-installed erlang. Still I'm facing this problem. Please help me in solving the problem Note:I'm using Windows XP OS. Thanks in advance, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From shelton.ms@REDACTED Tue Oct 3 17:53:20 2006 From: shelton.ms@REDACTED (Shelton Tang) Date: Tue, 3 Oct 2006 23:53:20 +0800 Subject: [erlang-questions] Finding IP addresses in a PC In-Reply-To: <20060919062856.GA4222@nodo2.lambdastream.com> References: <71270.1998961158619485060.JavaMail.root@vms068.mailsrvcs.net> <20060919062856.GA4222@nodo2.lambdastream.com> Message-ID: <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> I have one NIC with the address {192,168,0,150} on my Vista machine. If I call inet:getiflist(), it returns ["51.0.861.291","100.0.0.721"]. Anybody know how to convert it to a valid format? From shelton.ms@REDACTED Tue Oct 3 17:59:04 2006 From: shelton.ms@REDACTED (Shelton Tang) Date: Tue, 3 Oct 2006 23:59:04 +0800 Subject: [erlang-questions] Why does the restart strategy "{one_for_one, 10, 10}" still kill my application? Message-ID: <27ccae8e0610030859i717becf4x6dab71487514b268@mail.gmail.com> I am writing an application. In myapp_sup:init, I use the restart stragey "{one_for_one, 10, 10}". For some reason, one process in the three will exit since an invalid socket operation. However, I found the entire tree will be killed in this case. I use "transient" as the type and also try "temporary". But same result. Can anybody give me a hand? From wilbjor@REDACTED Tue Oct 3 18:05:22 2006 From: wilbjor@REDACTED (Jordan Wilberding) Date: Tue, 03 Oct 2006 11:05:22 -0500 Subject: [erlang-questions] Finding IP addresses in a PC In-Reply-To: <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> References: <71270.1998961158619485060.JavaMail.root@vms068.mailsrvcs.net> <20060919062856.GA4222@nodo2.lambdastream.com> <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> Message-ID: <45228A42.4040707@iit.edu> On my computer it returns: {ok,["lo","eth0"]} But anyways, the strings are just in reverse, so do this: lists:map(fun(X) -> lists:reverse(X) end, List) where List is ["51.0.861.291","100.0.0.721"] in your case. Thanks! Jordan Wilberding Shelton Tang wrote: > I have one NIC with the address {192,168,0,150} on my Vista machine. > If I call inet:getiflist(), it returns > ["51.0.861.291","100.0.0.721"]. > > Anybody know how to convert it to a valid format? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From harveyd@REDACTED Tue Oct 3 18:14:36 2006 From: harveyd@REDACTED (Dale Harvey) Date: Tue, 3 Oct 2006 17:14:36 +0100 Subject: [erlang-questions] Finding IP addresses in a PC In-Reply-To: <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> References: <71270.1998961158619485060.JavaMail.root@vms068.mailsrvcs.net> <20060919062856.GA4222@nodo2.lambdastream.com> <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> Message-ID: 1> {ok, L} = inet:getiflist(). {ok,["671.832.891.751","100.0.0.721"]} 2> [lists:reverse(I) || I <- L]. ["157.198.238.176","127.0.0.001"] this isnt my code, i just recognised the question from another mailing list thread -------------- next part -------------- An HTML attachment was scrubbed... URL: From igwan@REDACTED Tue Oct 3 19:05:28 2006 From: igwan@REDACTED (igwan) Date: Tue, 03 Oct 2006 19:05:28 +0200 Subject: [erlang-questions] Error in Crypto module In-Reply-To: <42ea5fb60610030827g3d413f0dha5bad586ac1fdcc2@mail.gmail.com> References: <42ea5fb60610030827g3d413f0dha5bad586ac1fdcc2@mail.gmail.com> Message-ID: <45229858.8050702@free.fr> Hello, You have to install OpenSSL, because the crypto application depends on it : http://www.slproweb.com/products/Win32OpenSSL.html Surindar Sivanesan a ?crit : > > Dear all, > While I'm running crypto:start(). The following error message is > thrown from erl.exe > > /"The application has failed to start because LIBEAY32.dll was not > found. Re-installing the application may fix this problem"/ > // > I have re-installed erlang. Still I'm facing this problem. > Please help me in solving the problem > Note:I'm using Windows XP OS. > > Thanks in advance, > S.Surindar > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From mickael.remond@REDACTED Tue Oct 3 19:03:21 2006 From: mickael.remond@REDACTED (Mickael Remond) Date: Tue, 3 Oct 2006 19:03:21 +0200 Subject: [erlang-questions] Error in Crypto module In-Reply-To: <42ea5fb60610030827g3d413f0dha5bad586ac1fdcc2@mail.gmail.com> References: <42ea5fb60610030827g3d413f0dha5bad586ac1fdcc2@mail.gmail.com> Message-ID: <20061003170321.GB10272@memphis.colubris.lan> Hello, * Surindar Sivanesan [2006-10-03 20:57:26 +0530]: > Dear all, > While I'm running crypto:start(). The following error message is thrown from > erl.exe > > *"The application has failed to start because LIBEAY32.dll was not found. > Re-installing the application may fix this problem"* > ** This library is provided by OpenSSL. You need to install OpenSSL on your windows machine. A version seems to be downloadable from there: http://www.slproweb.com/products/Win32OpenSSL.html I hope this helps, -- Micka?l R?mond http://www.process-one.net/ From bob@REDACTED Tue Oct 3 19:17:22 2006 From: bob@REDACTED (Bob Ippolito) Date: Tue, 3 Oct 2006 10:17:22 -0700 Subject: [erlang-questions] how are erlang process lightweight? In-Reply-To: <4B6F2F14-52DD-11DB-8432-0030653F9ECE@freenet.co.uk> References: <32C4F547-6652-4435-A5B4-F5DB6BF0F7D9@gmail.com> <4B6F2F14-52DD-11DB-8432-0030653F9ECE@freenet.co.uk> Message-ID: <6a36e7290610031017t6ad9e724ka6b84652e4906aa@mail.gmail.com> On 10/3/06, Ben Dougall wrote: > > On Tuesday, October 3, 2006, at 12:58 pm, Sean Hinde wrote: > > > On 3 Oct 2006, at 12:25, Ben Dougall wrote: > > > >> So that seems to be the thing, so far as memory footprint goes: > >> threads > >> have a stack and that stack is, as usual, made up or an indefinite > >> number of frames -- potentially many/infinite -- grows per new > >> function > >> call. Whereas Erlang processes are tied very tightly (one to one) to > >> functions, and a function's memory usage amount to one frame of a > >> stack. So an Erlang process is limited to a frame of a stack. > > > > This is where you are going wrong. An erlang function is only related > > to a process in the sense that processes evaluate functions. Each > > process has its own stack that can grow/shrink as much as it needs. > > > > It is not nearly as different to pthreads as you describe. The > > efficiency gains of Erlang are *only* those of being able to optimise > > process switching and do custom memory management. > > I've just coming to that conclusion from Richard's reply, as from what > he was saying there is not much difference between thread and Erlang > process memory footprints. > > > Erlang processes are actually more akin to UNIX processes as they do > > not share state. Think of them as exactly like UNIX processes with > > much less overhead and much nicer message passing. > > Yes I understand that. It was how they've ended up so light is what I > was interested in. And I now realise that it's the fact that it's all > (the switching etc.) handled in user space by the Erlang system where > the efficiency/saving comes from. So it's not so much a saving of > memory space (although I guess there is at least a bit of memory space > saving) but a saving in the amount of memory-shifting-round that the > machine needs to do. Less memory-shifting-round is necessary with E.P.s > than threads. The way switching is done and the contract that Erlang processes have with the scheduler are different than with pthreads. The fixed overhead Erlang process overhead is less than what it takes just to save the state of all the CPU registers on some platforms (if it is on the order of 16-32 words)! Also, the stack of a pthread has to be preallocated and of a fixed size, and there's other bookkeeping that pthreads do that Erlang processes do not have to. So, switching is faster and processes are cheaper. If pthreads didn't suck, we wouldn't be here ;) -bob From david.nospam.hopwood@REDACTED Tue Oct 3 22:15:00 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Tue, 03 Oct 2006 21:15:00 +0100 Subject: [erlang-questions] Finding IP addresses in a PC In-Reply-To: <45228A42.4040707@iit.edu> References: <71270.1998961158619485060.JavaMail.root@vms068.mailsrvcs.net> <20060919062856.GA4222@nodo2.lambdastream.com> <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> <45228A42.4040707@iit.edu> Message-ID: <4522C4C4.7090300@blueyonder.co.uk> Jordan Wilberding wrote: > On my computer it returns: > > {ok,["lo","eth0"]} > > But anyways, the strings are just in reverse, so do this: > > lists:map(fun(X) -> lists:reverse(X) end, List) > > where List is ["51.0.861.291","100.0.0.721"] in your case. That would produce the wrong result (192.168.0.15 instead of 192.168.0.150). Has anyone tried to investigate this strange bug? I've written C code to get the interface list on Windows, using GetAdaptorsInfo, and that function seemed to do precisely what the MSDN documentation said it should do. -- David Hopwood From robert.virding@REDACTED Tue Oct 3 22:29:47 2006 From: robert.virding@REDACTED (Robert Virding) Date: Tue, 03 Oct 2006 22:29:47 +0200 Subject: [erlang-questions] scope of variables In-Reply-To: <95be1d3b0609290439k32b482a6v4cc0cd7f5e8629f3@mail.gmail.com> References: <44FBD154.1010103@it.uu.se> <95be1d3b0609040114i255f0164qdc1998a9792ab3e5@mail.gmail.com> <44FC0ABD.7080309@it.uu.se> <95be1d3b0609040436w2b067228y679c115f750b98d5@mail.gmail.com> <44FC2450.60407@it.uu.se> <95be1d3b0609040617o755f02fj224dddc80d9ca1c9@mail.gmail.com> <4518512F.8090802@it.uu.se> <95be1d3b0609290439k32b482a6v4cc0cd7f5e8629f3@mail.gmail.com> Message-ID: <4522C83B.40908@telia.com> Vlad Dumitrescu wrote: > A few other applications of this "compile a customized variant of this > function given these static parameters" could be > > * sparse vector multiplication, where all zero elements would just > eliminated from the calculation > * regexps, where it is possible (but I'm not sure if it applies to the > general case) to generate specializations of the generic algorithm > that are very close to hand-crafted variants. Well the second one will soon be possible. The new regexp.erl I will be releasing soon (real soon now) will contain a function which builds a struture representing the regexp (a DFA for it). Just for you Joe. :-) With this someone (me) could write a parse_transform which transforms calls to regexp into speocialised local functions for matching regexps. Robert From robert.virding@REDACTED Tue Oct 3 22:39:12 2006 From: robert.virding@REDACTED (Robert Virding) Date: Tue, 03 Oct 2006 22:39:12 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <20061003045944.5F6DF5A1FC@mail.erlangsystems.com> References: <20061003045944.5F6DF5A1FC@mail.erlangsystems.com> Message-ID: <4522CA70.2030003@telia.com> A pattern is describes a data structure. On the LHS you use it to test the struture of and pull apart a term while on the RHS you use it to build a term. I agree with Richard that the result of allowing such constructs in patterns will lead to things difficult to understand, both syntactically and semantically. Yes, you can give LOTS of examples which are easy to understand but once you release to a poor unspecting public you would be surprised at some of the things they will do with it. I believe it is important to keep things clean, consistent and elegant otherwise you will end up with a language built on exceptions. Robert datacompboy wrote: > > Quote: > Basically, it's because that expands to element(, ), and that happens not to be allowed. > (end of quote) > > > Yes, right, but I just think that compiler can do such: > > Var#rec.val -> expands to LambdaVar=element(#rec.val, Var), LambdaVar > so matching possible. > And optimization pass should just remove LambdaVar in cases like > X = Y#recy.xval. > > But i'm not sure about optimizations of erlang, so can't say is that possible in current realization > -- > --- suicide proc near\n call death\n suicide endp > _________________________________________________________ > Post sent from http://www.trapexit.org > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From thomasl_erlang@REDACTED Tue Oct 3 23:06:24 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 3 Oct 2006 14:06:24 -0700 (PDT) Subject: [erlang-questions] Bug ?! In-Reply-To: <4522CA70.2030003@telia.com> Message-ID: <20061003210624.22238.qmail@web38810.mail.mud.yahoo.com> --- Robert Virding wrote: > I believe it is important to keep things clean, > consistent and elegant > otherwise you will end up with a language built on > exceptions. So what is your opinion on Erlang of today? (half :-) Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From ok@REDACTED Wed Oct 4 02:18:51 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 4 Oct 2006 13:18:51 +1300 (NZDT) Subject: [erlang-questions] how are erlang process lightweight? Message-ID: <200610040018.k940Ip8t030684@atlas.otago.ac.nz> Ben Dougall is still confused. And THIS is confusing him: This was quite interesting from "Erlang Style Concurrency": "[Erlang processes are] very cheap to start up and destroy and are very fast to switch between because under the hood they're simply functions." Erlang processes are *NOT* functions. Erlang process : Erlang function :: Posix or Windows thread : C function The principles are exactly the same. However, (1) Posix and Windows thread implementations are SEVERELY limited by the fact that they are designed to support statically typed languages with no garbage collector information which can create pointers to objects in the stacks and save those pointers anywhere. That means that Posix and Windows thread implementations CANNOT MOVE OR RESIZE STACKS, because they don't know where the pointers are and could not fix them. (Note that static typing isn't the main problem; the Burroughs B6700 operating system could and did dynamically move and resize stacks with no worries at all, because the hardware required pointers to be tagged, so the operating system could be absolutely sure of finding and fixing all of them. I was stunned back in 1979 to discover how primitive other computers were.) Because Posix and Windows thread implementations cannot move or resize stacks, (A) you the programmer have to say how big they will be (B) to get this right it is absolutely essential that the C compiler tell you how big stack frames are (but it never does) and how deep the stack can get (but it never does that either). So you have to over-estimate with a rather large safety factor. (C) heaven help you if you guess wrong, because the hardware, operating system, and run-time library will cheerfully see your program crash and burn. So you REALLY have to over-estimate with a very large safety factor. Erlang does keep around enough information (for garbage collection) so that it CAN find and fix all the necessary pointers whenever a stack has to be moved or resized. So (D) you never have to make guesses, and (E) stacks can start very small => lightweight in memory use. (2) Posix and Windows thread implementations need the help of the operating system for several key operations. Context switches are known to be very very bad for caches; a paper from DEC WRL showed that in that system a context switch could foul up your cache to the point where it took many thousands of instructions to recover, and of course by that time you have another context switch. The Erlang process implementation is user-level, sometimes called "green threads". No kernel memory is needed for an Erlang process. Erlang process switching does mean that the stack data for the process switched out of is gradually lost from the cache, BUT what goes into the instruction cache is the emulator, and that stays cached. There are no traps out to the operating system and back again (which can be quite slow; deep recursion on SPARCs used to be very painful because of that). So Erlang process switching is cheap => lightweight in time. (3) You might imagine that Java solves problems (1) and (2), and indeed it does. But Java is an imperative programming language; computation proceeds by smashing the state of mutable objects. If two or more processes try to access the same mutable object they can get terribly confused. So every access to an object that *might* be shared with another process has to be 'synchronised' (or is it 'synchronized'? I wish they had chosen a word that everyone agreed how to spell). This is called "locking". Much of the locking is done implicitly when you call synchronised methods, but that doesn't affect the point that there has to be a heck of a lot of it. Java implementors have put unbelievable amounts of work into trying to make locking fast. They still can't make it as fast as not locking. Although Java had Vector, it acquired ArrayList. What's the difference? Vector expects to be shared, and does oodles of locking; ArrayList expects not to be shared, and does no locking. It's faster. Although Java had StringBuffer, it acquired StringBuilder? What's the difference? Just that StringBuffer expects to be shared, and does oodles of locking; StringBuilder has exactly the same interface but expects not to be shared, and does no locking. It's faster. In Erlang, there are no mutable data structures[*], and in any case, no process can access another process's data in any way, so there is no need for locking in routine calculations. Obviously, loading and unloading modules requires locking, and data base access had better involve some kind of locking, but routine calculations marching over data structures and building results DON'T need any locking. [*] I lied: there is something called "the process dictionary". But that is not and cannot be shared with any other process, so you STILL don't need locking. Result: Erlang needs little or no locking for routine calculations => lightweight in time. Even message sending and receiving could, I believe, be done without locking using lock-free queues. I have no idea whether it would be worth while. From ok@REDACTED Wed Oct 4 02:38:07 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 4 Oct 2006 13:38:07 +1300 (NZDT) Subject: [erlang-questions] Bug ?! Message-ID: <200610040038.k940c710030550@atlas.otago.ac.nz> Richard Carlsson reminds me of something: Compare: X * 4711 length(Stuff) R#r.a and [X|Y] {foo, X} "abc" ++ Xs Ever since I met them, I have *loved* n+k patterns in Haskell. For example, if I want to define factorial, I can do factorial 0 = 1 factorial n@(m+1) = n * factorial m The semantics I want for this is + matches if (1) >= and (2) matches - (Compile-time check: is a strictly positive integer) I would really like to be able to write factorial(0) -> 1; factorial(N = (M+1)) -> N * factorial(M). in Erlang. Note that the semantics I have defined for this makes this SAFER than factorial(0) -> 1; factorial(N) -> N * factorial(N-1). But also, when working with binary, ternary, and quaternary trees, I have wanted to do this: f(1) -> ...; f(2*K+0) -> ...; f(2*K+1) -> .... where the semantics is * + matches if (1) >= and (2) ( - ) mod = 0 and (3) matches ( - ) div (Compile-time check: >= 0 and > 1, both integers.) The special case of 2*_+_ can of course be done with bit tests and shifts. This would certainly conflict with the use of function calls in patterns. From surindar.shanthi@REDACTED Wed Oct 4 06:20:45 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Wed, 4 Oct 2006 09:50:45 +0530 Subject: [erlang-questions] Finding IP addresses in a PC In-Reply-To: <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> References: <71270.1998961158619485060.JavaMail.root@vms068.mailsrvcs.net> <20060919062856.GA4222@nodo2.lambdastream.com> <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> Message-ID: <42ea5fb60610032120y355111cfl3669ef8a91294ad7@mail.gmail.com> The following code might return the correct IP by calling ip:list() from erl shell -module(ip). -export([list/0]). list()-> IpAddress=inet:getiflist(), case IpAddress of {ok,IpList}-> format_ip(IpList,[]); _-> io:fwrite("Error ~p in getting ip list\n",[IpAddress]) end. format_ip(Iplist,FormatedList)-> case Iplist of []-> FormatedList; _-> Ip=hd(Iplist), ReversedIp=lists:reverse(string:tokens(Ip,".")), FormatedIP=check_ip(ReversedIp,""), format_ip(tl(Iplist),FormatedList++[FormatedIP]) end. check_ip(IpList,Return)-> case IpList of []-> Return; _-> IpPart=lists:reverse(hd(IpList)), case length(IpPart) of 3-> NewPart=integer_to_list(list_to_integer(IpPart)), case Return of ""-> check_ip(tl(IpList),Return++NewPart); _-> check_ip(tl(IpList),Return++"."++NewPart) end; 2-> NewPart=integer_to_list(list_to_integer(IpPart++"0")), case Return of ""-> check_ip(tl(IpList),Return++NewPart); _-> check_ip(tl(IpList),Return++"."++NewPart) end; 1-> NewPart=integer_to_list(list_to_integer(IpPart++"00")), case Return of ""-> check_ip(tl(IpList),Return++NewPart); _-> check_ip(tl(IpList),Return++"."++NewPart) end; _-> io:fwrite("Illegal IP length\n") end end. On 10/3/06, Shelton Tang wrote: > > I have one NIC with the address {192,168,0,150} on my Vista machine. > If I call inet:getiflist(), it returns > ["51.0.861.291","100.0.0.721"]. > > Anybody know how to convert it to a valid format? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanjaya@REDACTED Wed Oct 4 07:05:04 2006 From: sanjaya@REDACTED (Sanjaya Vitharana) Date: Wed, 4 Oct 2006 10:35:04 +0530 Subject: [erlang-questions] ei_decode ??? Message-ID: <044c01c6e772$a9979750$9a0a10ac@wavenet.lk> Hi Consider a List [A,B] where A,B=ANY integer (including 0..255) So how to decode it using ei_decode functions?? Reason: (condsidering ei_get_type(buf, &index, &type, &size)) 1.) [A,B] where ANY of A,B > 255 so [A,B] = List (ei_decode_list_header(...) works fine here) 2.) [A,B] where A,B <= 255 so [A,B] = String (in this case how to use ei_decode_string(...) to decode the values of A,B ??) of course I can use tuple to do this quickly. But like to know how to decode 2.) for my general knowledge Thanks in advance Sanjaya Vitharana -------------- next part -------------- An HTML attachment was scrubbed... URL: From rlenglet@REDACTED Wed Oct 4 07:47:42 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Wed, 4 Oct 2006 14:47:42 +0900 Subject: [erlang-questions] ei_decode ??? In-Reply-To: <044c01c6e772$a9979750$9a0a10ac@wavenet.lk> References: <044c01c6e772$a9979750$9a0a10ac@wavenet.lk> Message-ID: <200610041447.43130.rlenglet@users.forge.objectweb.org> Sanjaya Vitharana wrote: > Consider a List [A,B] where A,B=ANY integer (including 0..255) > > So how to decode it using ei_decode functions?? In that case, if the list contains only integers in [0..255], and if the list is flat, it will always be encoded as a string. Otherwise, it will be encoded as a list of integers. > Reason: > (condsidering ei_get_type(buf, &index, &type, &size)) > 1.) [A,B] where ANY of A,B > 255 so [A,B] = List > (ei_decode_list_header(...) works fine here) 2.) [A,B] where > A,B <= 255 so [A,B] = String (in this case how to use > ei_decode_string(...) to decode the values of A,B ??) > > of course I can use tuple to do this quickly. But like to know > how to decode 2.) for my general knowledge Here is a general and efficient algorithm for decoding a list of integers, simplified from actual code from Dryverl: void foo(char *buffer, int *index) { int is_string = 0; char *string_buffer = NULL; int size = 0; unsigned long val = 0L; int i = 0; ei_get_type(buffer, index, &is_string, &size); if (is_string = (is_string == ERL_STRING_EXT)) { /* Skip the string type and length. */ *index += 1 + 2; } else { /* Skip the list type and length. */ ei_decode_list_header(buffer, index, NULL); } /* Decode and display every integer in the list. */ for (i = 0; i < size; i++) { if (is_string) { val = ((unsigned char*)buffer)[(*index)++]; } else { ei_decode_ulong(buffer, index, &val); } printf("%lu\r\n", val); } /* Decode the tail of the list, if it was not empty. We assume that the list is flat, i.e. the tail is [], which encoded as one byte. */ if ((!is_string) && (size > 0)) *index++; /* Or, more conventionally: if ((!is_string) && (size > 0)) ei_decode_list_header(buffer, index, NULL); */ } You have to add error handling everywhere. I omitted it here for clarity. An undocumented function of ei is ei_decode_intlist. But my version above is more efficient, because it does no copy of data into a new array. Regards, -- Romain LENGLET Pr. Chiba Shigeru Group Dept. of Mathematical and Computing Sciences Tokyo Institute of Technology From mats.cronqvist@REDACTED Wed Oct 4 08:57:31 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Wed, 04 Oct 2006 08:57:31 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <4522CA70.2030003@telia.com> References: <20061003045944.5F6DF5A1FC@mail.erlangsystems.com> <4522CA70.2030003@telia.com> Message-ID: <45235B5B.4080904@ericsson.com> Robert Virding wrote: > I believe it is important to keep things clean, consistent and elegant > otherwise you will end up with a language built on exceptions. aha! so that's why this works? -define(foo,bla. go()->?foo. more to the point, i still fail to see how this; receive X#r.a -> do_a(); is more unclean, inconsistent and inelegant than this; XRA = X#r.a, receive XRA -> do_a(); but hey, i'll take richard & richard's word for it. mats From ok@REDACTED Wed Oct 4 09:20:08 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 4 Oct 2006 20:20:08 +1300 (NZDT) Subject: [erlang-questions] Bug ?! Message-ID: <200610040720.k947K8sR022178@atlas.otago.ac.nz> Robert Virding wrote: > I believe it is important to keep things clean, consistent and elegant > otherwise you will end up with a language built on exceptions. Mats Cronqvist replied: aha! so that's why this works? -define(foo,bla. go()->?foo. I wrote the paper "Delenda est preprocessor" *years* ago. Really, if all that was originally wanted was named constants, just = . at top level would have done the trick. more to the point, i still fail to see how this; receive X#r.a -> do_a(); is more unclean, inconsistent and inelegant than this; XRA = X#r.a, receive XRA -> do_a(); but hey, i'll take richard & richard's word for it. Consider this argument: At present, EVERY place that a variable may appear in a pattern, it is legal for either a bound variable (check it!) or an unbound variable (bind it!) to appear; therefore, everywhere that a variable may appear in a pattern it is legal to place a wildcard. This addition breaks that rule into a thousand sharp-edged splinters. I've finally put my finger on what I don't like about it. Consider also that we currently have "two-part matching": PATTERNS check the SHAPE of terms, GUARDS check the VALUES. (Yes, I know this is imprecise, but we all know what I mean.) So at the moment, there is one obvious place to put X#r.a: it is *not* a test for a particular shape, so it must go in the guard. (Just like hd, tl, and element, which it so very closely resembles.) receive XRA when XRA = X#r.a -> do_a(); isn't hard to write, and currently isn't hard to think. There is a weakness in this argument: testing whether something is a particular kind of record is *obviously* a test of its shape, so it really does belong in the pattern, not the guard. Arguably, "is some kind of list" and "is some kind of tuple" are also "shape" questions rather than "value" questions. So we could imagine an enhanced pattern language including something like (this is off the cuff; NOT a polished suggestion): [*] a list of any size (including 0 or 1) {*} a tuple of any size (including 0 or 1) #r{*} an instance of record type r <<*>> a binary of any size This is reasonably iconic, "*" should suggest 0 or more, and the fact that there is no variable or wildcard there correctly suggests that you can't bind anything to this inner "sequence". From raimo+erlang-questions@REDACTED Wed Oct 4 10:33:11 2006 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 4 Oct 2006 10:33:11 +0200 Subject: [erlang-questions] : Finding IP addresses in a PC In-Reply-To: <42ea5fb60610032120y355111cfl3669ef8a91294ad7@mail.gmail.com> References: <71270.1998961158619485060.JavaMail.root@vms068.mailsrvcs.net> <20060919062856.GA4222@nodo2.lambdastream.com> <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> <42ea5fb60610032120y355111cfl3669ef8a91294ad7@mail.gmail.com> Message-ID: <20061004083311.GB17959@erix.ericsson.se> This is absolutely a bug, that we have not had time to investigate. We can reproduce it easily. All windows machines seem to exhibit this behaviour. We will see when we can find the time to correct it... On Wed, Oct 04, 2006 at 09:50:45AM +0530, Surindar Sivanesan wrote: > The following code might return the correct IP by calling ip:list() from erl > shell > > > > -module(ip). > -export([list/0]). > > list()-> > IpAddress=inet:getiflist(), > case IpAddress of > {ok,IpList}-> > format_ip(IpList,[]); > _-> > io:fwrite("Error ~p in getting ip list\n",[IpAddress]) > end. > > format_ip(Iplist,FormatedList)-> > case Iplist of > []-> > FormatedList; > _-> > Ip=hd(Iplist), > ReversedIp=lists:reverse(string:tokens(Ip,".")), > FormatedIP=check_ip(ReversedIp,""), > format_ip(tl(Iplist),FormatedList++[FormatedIP]) > end. > > check_ip(IpList,Return)-> > case IpList of > []-> > Return; > _-> > IpPart=lists:reverse(hd(IpList)), > case length(IpPart) of > 3-> > NewPart=integer_to_list(list_to_integer(IpPart)), > case Return of > ""-> > check_ip(tl(IpList),Return++NewPart); > _-> > check_ip(tl(IpList),Return++"."++NewPart) > end; > 2-> > NewPart=integer_to_list(list_to_integer(IpPart++"0")), > case Return of > ""-> > check_ip(tl(IpList),Return++NewPart); > _-> > check_ip(tl(IpList),Return++"."++NewPart) > end; > 1-> > NewPart=integer_to_list(list_to_integer(IpPart++"00")), > case Return of > ""-> > check_ip(tl(IpList),Return++NewPart); > _-> > check_ip(tl(IpList),Return++"."++NewPart) > end; > _-> > io:fwrite("Illegal IP length\n") > end > end. > > > On 10/3/06, Shelton Tang wrote: > > > >I have one NIC with the address {192,168,0,150} on my Vista machine. > >If I call inet:getiflist(), it returns > >["51.0.861.291","100.0.0.721"]. > > > >Anybody know how to convert it to a valid format? > >_______________________________________________ > >erlang-questions mailing list > >erlang-questions@REDACTED > >http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > with regards, > S.Surindar > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From richardc@REDACTED Wed Oct 4 10:33:12 2006 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 04 Oct 2006 10:33:12 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <200610040038.k940c710030550@atlas.otago.ac.nz> References: <200610040038.k940c710030550@atlas.otago.ac.nz> Message-ID: <452371C8.7060409@it.uu.se> Richard A. O'Keefe wrote: > Ever since I met them, I have *loved* n+k patterns in Haskell. I agree that they are very cute. Probably too cute. For a detailed discussion by the Haskell nomenklatura: http://www.cs.chalmers.se/~rjmh/Haskell/Messages/Decision.cgi?id=203 (Although at least part of their problem has to do with typing.) > But also, when working with binary, ternary, and quaternary trees, > I have wanted to do this: > > f(1) -> ...; > f(2*K+0) -> ...; > f(2*K+1) -> .... It is really very pretty. One almost wants to pick it up and cuddle it. But it's probably the kind of feature that is catering too much for a special case while at the same time not really being useful all that often in real code. /Richard From richardc@REDACTED Wed Oct 4 10:58:17 2006 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 04 Oct 2006 10:58:17 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <200610040720.k947K8sR022178@atlas.otago.ac.nz> References: <200610040720.k947K8sR022178@atlas.otago.ac.nz> Message-ID: <452377A9.8000002@it.uu.se> Richard A. O'Keefe wrote: > So we could imagine an > enhanced pattern language including something like (this is off the > cuff; NOT a polished suggestion): > > [*] a list of any size (including 0 or 1) > {*} a tuple of any size (including 0 or 1) > #r{*} an instance of record type r > <<*>> a binary of any size I think some variant of ellipsis would look better, e.g.: [..] {..} <<..>> (And even today, you only need to write #r{} to match any r-instance.) /Richard From Bob.Cowdery@REDACTED Wed Oct 4 11:01:12 2006 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Wed, 4 Oct 2006 10:01:12 +0100 Subject: [erlang-questions] Question about potential application Message-ID: <3A76756EED583B43A4AD704E29CCD07974117F@mail.aprsmartlogik.com> Hi I am considereing Erlang as a bus to connect a pipeline process that performs certain work on documents that pass down the pipeline. There will be many stages in the pipeline all of which need to be scalable. Much of the real work will need to be carried out by existing C++ code at least in the near future. I can envisage a network of nodes that use C-drivers.Each node could instantiate multiple drivers as required and the node could be duplicated for scaling and resiliance. So far, so good. My question is about the data that passes through the workflow. The data is unstructured (documents) or semi-structured (XML at present) and can be large, lets say up to 100KB. Is it sensible to ship that data over Erlang end-to-end, does anybody do similar things. Other possibilities are to manage the data separately within or outside of Erlang and pass references only.I feel the first way is somewhat cleaner and without potential bottlenecks but the data size and transforms between the C and Erlang world worry me. Any thoughts appreciated. Bob From surindar.shanthi@REDACTED Wed Oct 4 11:51:22 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Wed, 4 Oct 2006 15:21:22 +0530 Subject: [erlang-questions] Error in Crypto module In-Reply-To: <20061003170321.GB10272@memphis.colubris.lan> References: <42ea5fb60610030827g3d413f0dha5bad586ac1fdcc2@mail.gmail.com> <20061003170321.GB10272@memphis.colubris.lan> Message-ID: <42ea5fb60610040251p6c041662l2a219a9a9d7df245@mail.gmail.com> Dear all, Thanks for you timely reply. After installing OpenSSL, it Crypto server is started. Thank you once again. On 10/3/06, Mickael Remond wrote: > > Hello, > > * Surindar Sivanesan [2006-10-03 20:57:26 > +0530]: > > > Dear all, > > While I'm running crypto:start(). The following error message is thrown > from > > erl.exe > > > > *"The application has failed to start because LIBEAY32.dll was not > found. > > Re-installing the application may fix this problem"* > > ** > > This library is provided by OpenSSL. You need to install OpenSSL on your > windows machine. > > A version seems to be downloadable from there: > http://www.slproweb.com/products/Win32OpenSSL.html > > I hope this helps, > > -- > Micka?l R?mond > http://www.process-one.net/ > -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From gunilla@REDACTED Wed Oct 4 13:45:52 2006 From: gunilla@REDACTED (Gunilla Arendt) Date: Wed, 04 Oct 2006 13:45:52 +0200 Subject: [erlang-questions] Making your own behaviours In-Reply-To: <6598219.post@talk.nabble.com> References: <6598219.post@talk.nabble.com> Message-ID: <45239EF0.6090400@erix.ericsson.se> There is a part about user-defined behaviors in the chapter "Sys and Proc_Lib" in OTP Design Principles in the Erlang/OTP documentation. / Gunilla netboz wrote: > Hi, > > Still looking how have some kind of "ressources permissions" at a "process > level" into a node. > > Well if only I could write my own behaviours, I'm almost sure there is a > solution in this direction. > But, I can't find any documentation about writing behaviours, I remember > seeing something about it > some time ago, but not anymore. > > Could anyone tell me where I could find such kind of documentation, I'll > have a look to supervisor souce code > meanwhile. > > Thanks, > > > > From gunilla@REDACTED Wed Oct 4 13:51:06 2006 From: gunilla@REDACTED (Gunilla Arendt) Date: Wed, 04 Oct 2006 13:51:06 +0200 Subject: [erlang-questions] Why does the restart strategy "{one_for_one, 10, 10}" still kill my application? In-Reply-To: <27ccae8e0610030859i717becf4x6dab71487514b268@mail.gmail.com> References: <27ccae8e0610030859i717becf4x6dab71487514b268@mail.gmail.com> Message-ID: <4523A02A.4030307@erix.ericsson.se> How do you see the the entire process tree is killed, what error messages do you get? Use the start_sasl boot script to ensure you see the supervisor and error reports. ("erl -boot start_sasl"). / Gunilla Shelton Tang wrote: > I am writing an application. In myapp_sup:init, I use the restart > stragey "{one_for_one, 10, 10}". For some reason, one process in the > three will exit since an invalid socket operation. However, I found > the entire tree will be killed in this case. I use "transient" as the > type and also try "temporary". But same result. Can anybody give me > a hand? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > From doug.mansell@REDACTED Wed Oct 4 14:25:03 2006 From: doug.mansell@REDACTED (doug mansell) Date: Wed, 4 Oct 2006 20:25:03 +0800 Subject: [erlang-questions] : Finding IP addresses in a PC In-Reply-To: <20061004083311.GB17959@erix.ericsson.se> References: <71270.1998961158619485060.JavaMail.root@vms068.mailsrvcs.net> <20060919062856.GA4222@nodo2.lambdastream.com> <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> <42ea5fb60610032120y355111cfl3669ef8a91294ad7@mail.gmail.com> <20061004083311.GB17959@erix.ericsson.se> Message-ID: yes... fmt_addr in inet_drv.c is all back-to-front! try this one instead: /* format address in dot notation */ static char* fmt_addr(unsigned long x, char* ptr) { int i; for (i = 0; i < 4; i++) { int nb[3]; int y = x & 0xff; x >>= 8; nb[0] = y % 10; y /= 10; nb[1] = y % 10; y /= 10; nb[2] = y % 10; y /= 10; switch((nb[2]>0 ? 3 : (nb[1]>0 ? 2 : 1))) { case 3: *ptr++ = nb[2] + '0'; case 2: *ptr++ = nb[1] + '0'; case 1: *ptr++ = nb[0] + '0'; } *ptr++ = '.'; } *(ptr-1) = '\0'; return ptr; } (sorry, no patch... i'm a windows developer!) :) On 10/4/06, Raimo Niskanen wrote: > This is absolutely a bug, that we have not had time to > investigate. We can reproduce it easily. All windows > machines seem to exhibit this behaviour. > > We will see when we can find the time to correct it... > > > > On Wed, Oct 04, 2006 at 09:50:45AM +0530, Surindar Sivanesan wrote: > > The following code might return the correct IP by calling ip:list() from erl > > shell > > > > > > > > -module(ip). > > -export([list/0]). > > > > list()-> > > IpAddress=inet:getiflist(), > > case IpAddress of > > {ok,IpList}-> > > format_ip(IpList,[]); > > _-> > > io:fwrite("Error ~p in getting ip list\n",[IpAddress]) > > end. > > > > format_ip(Iplist,FormatedList)-> > > case Iplist of > > []-> > > FormatedList; > > _-> > > Ip=hd(Iplist), > > ReversedIp=lists:reverse(string:tokens(Ip,".")), > > FormatedIP=check_ip(ReversedIp,""), > > format_ip(tl(Iplist),FormatedList++[FormatedIP]) > > end. > > > > check_ip(IpList,Return)-> > > case IpList of > > []-> > > Return; > > _-> > > IpPart=lists:reverse(hd(IpList)), > > case length(IpPart) of > > 3-> > > NewPart=integer_to_list(list_to_integer(IpPart)), > > case Return of > > ""-> > > check_ip(tl(IpList),Return++NewPart); > > _-> > > check_ip(tl(IpList),Return++"."++NewPart) > > end; > > 2-> > > NewPart=integer_to_list(list_to_integer(IpPart++"0")), > > case Return of > > ""-> > > check_ip(tl(IpList),Return++NewPart); > > _-> > > check_ip(tl(IpList),Return++"."++NewPart) > > end; > > 1-> > > NewPart=integer_to_list(list_to_integer(IpPart++"00")), > > case Return of > > ""-> > > check_ip(tl(IpList),Return++NewPart); > > _-> > > check_ip(tl(IpList),Return++"."++NewPart) > > end; > > _-> > > io:fwrite("Illegal IP length\n") > > end > > end. > > > > > > On 10/3/06, Shelton Tang wrote: > > > > > >I have one NIC with the address {192,168,0,150} on my Vista machine. > > >If I call inet:getiflist(), it returns > > >["51.0.861.291","100.0.0.721"]. > > > > > >Anybody know how to convert it to a valid format? > > >_______________________________________________ > > >erlang-questions mailing list > > >erlang-questions@REDACTED > > >http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > -- > > with regards, > > S.Surindar > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From sami.vaisanen@REDACTED Wed Oct 4 15:19:44 2006 From: sami.vaisanen@REDACTED (=?ISO-8859-1?Q?Sami_V=E4is=E4nen?=) Date: Wed, 04 Oct 2006 16:19:44 +0300 Subject: [erlang-questions] Parenting needed Message-ID: <4523B4F0.9080208@icecom.fi> Hello, First off some background information. I have an application (written in C++) that loads some plugins, i.e. .so libraries. The application also registers itself as an erlang node and is able to receive messages from other Erlang nodes on the network and respond to those. It has some built in functionality but for the most part it will just act as a gateway between the plugins and the erlang environment by passing messages (and arbitrary message data in tuples) to a given plugin and then sending back the response. Some of the operations performed by the plugins will be asynchronous, i.e. be performed in a separate thread and will later result in the generation of response event(s). The basic premise is that the C++ application remains fairly simple, unaware of the distributed nature of the system and just enables new functionality (i.e. legacy C/C++ code) to be plugged into the system fairly easily. Now Im in the process of building a distributed layer on top of the the C++ application so that the distributed Erlang nodes will "abstract away" a particular configuration of the C++ application. As an example on computer C1 I might have the C++ application running with plugins P1 and P2, on computer C2 the same application running with only plugin P3. Yet to any client connecting to the system (TCP connection) to any Erlang node, the client should be able to see all features of the system irrespective of the node the client is connected to. I.e. a client connecting to computer C1 should be able to request service from plugin P3 transparently. In a similar fashion any events generated by the background threads within the plugins should be propagated througout the system among some "publishable" system wide data. Erlang is a wholly new environment to me, and I have just been working with it for a few weeks with mainly writing code to interact with the C++ application (which I also wrote). I have just finished reading Joe Armstrong's thesis about how to build fault tolerant distributed applications and have grasped the basic ideology behind behaviours and reusing components such as gen_server. However what I dont understand is how to incorporate these patterns into the system Im about to build. In other words what I'm asking is some kind of general guidelines or ideas how to possibly structure the system and what to start looking at. Basically just gentle poking in the right direction. Im sure that with some hacking I could translate a basic C++ based design into equivalent Erlang code (and save a lot of time while doing it), but Im afraid this would not be "idiomatic" use of Erlang and would result in "WTF"ism and less than desirable implementation. So if anyone bothers to offer some parental guidance that would be greatly appreciated. Thank you and sorry for the lengthy post. - Sami From raimo+erlang-questions@REDACTED Wed Oct 4 15:39:06 2006 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 4 Oct 2006 15:39:06 +0200 Subject: [erlang-questions] : : Finding IP addresses in a PC In-Reply-To: References: <71270.1998961158619485060.JavaMail.root@vms068.mailsrvcs.net> <20060919062856.GA4222@nodo2.lambdastream.com> <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> <42ea5fb60610032120y355111cfl3669ef8a91294ad7@mail.gmail.com> <20061004083311.GB17959@erix.ericsson.se> Message-ID: <20061004133906.GA7014@erix.ericsson.se> I was thinking more in the line of using inet_ntoa() and inet_addr(), or rather use ntohl() and htonl() around the current fmt_addr(), or even rewrite fmt_addr to take a char[] as input, in network byte order. Rewriting fmt_addr() as you suggested works on little-endian machines such as Intel, and there are not many big-endian Windows platforms out there, but I think it is a confusing and wrong(tm) way to do it. On Wed, Oct 04, 2006 at 08:25:03PM +0800, doug mansell wrote: > yes... fmt_addr in inet_drv.c is all back-to-front! > > try this one instead: > > > /* format address in dot notation */ > static char* fmt_addr(unsigned long x, char* ptr) > { > int i; > for (i = 0; i < 4; i++) { > int nb[3]; > int y = x & 0xff; > x >>= 8; > nb[0] = y % 10; y /= 10; > nb[1] = y % 10; y /= 10; > nb[2] = y % 10; y /= 10; > switch((nb[2]>0 ? 3 : (nb[1]>0 ? 2 : 1))) { > case 3: *ptr++ = nb[2] + '0'; > case 2: *ptr++ = nb[1] + '0'; > case 1: *ptr++ = nb[0] + '0'; > } > *ptr++ = '.'; > } > *(ptr-1) = '\0'; > return ptr; > } > > > (sorry, no patch... i'm a windows developer!) :) > > > > On 10/4/06, Raimo Niskanen wrote: > > This is absolutely a bug, that we have not had time to > > investigate. We can reproduce it easily. All windows > > machines seem to exhibit this behaviour. > > > > We will see when we can find the time to correct it... > > > > > > > > On Wed, Oct 04, 2006 at 09:50:45AM +0530, Surindar Sivanesan wrote: > > > The following code might return the correct IP by calling ip:list() from erl > > > shell > > > > > > > > > > > > -module(ip). > > > -export([list/0]). > > > > > > list()-> > > > IpAddress=inet:getiflist(), > > > case IpAddress of > > > {ok,IpList}-> > > > format_ip(IpList,[]); > > > _-> > > > io:fwrite("Error ~p in getting ip list\n",[IpAddress]) > > > end. > > > > > > format_ip(Iplist,FormatedList)-> > > > case Iplist of > > > []-> > > > FormatedList; > > > _-> > > > Ip=hd(Iplist), > > > ReversedIp=lists:reverse(string:tokens(Ip,".")), > > > FormatedIP=check_ip(ReversedIp,""), > > > format_ip(tl(Iplist),FormatedList++[FormatedIP]) > > > end. > > > > > > check_ip(IpList,Return)-> > > > case IpList of > > > []-> > > > Return; > > > _-> > > > IpPart=lists:reverse(hd(IpList)), > > > case length(IpPart) of > > > 3-> > > > NewPart=integer_to_list(list_to_integer(IpPart)), > > > case Return of > > > ""-> > > > check_ip(tl(IpList),Return++NewPart); > > > _-> > > > check_ip(tl(IpList),Return++"."++NewPart) > > > end; > > > 2-> > > > NewPart=integer_to_list(list_to_integer(IpPart++"0")), > > > case Return of > > > ""-> > > > check_ip(tl(IpList),Return++NewPart); > > > _-> > > > check_ip(tl(IpList),Return++"."++NewPart) > > > end; > > > 1-> > > > NewPart=integer_to_list(list_to_integer(IpPart++"00")), > > > case Return of > > > ""-> > > > check_ip(tl(IpList),Return++NewPart); > > > _-> > > > check_ip(tl(IpList),Return++"."++NewPart) > > > end; > > > _-> > > > io:fwrite("Illegal IP length\n") > > > end > > > end. > > > > > > > > > On 10/3/06, Shelton Tang wrote: > > > > > > > >I have one NIC with the address {192,168,0,150} on my Vista machine. > > > >If I call inet:getiflist(), it returns > > > >["51.0.861.291","100.0.0.721"]. > > > > > > > >Anybody know how to convert it to a valid format? > > > >_______________________________________________ > > > >erlang-questions mailing list > > > >erlang-questions@REDACTED > > > >http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > -- > > > with regards, > > > S.Surindar > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From dmitriid@REDACTED Wed Oct 4 16:42:51 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Wed, 4 Oct 2006 17:42:51 +0300 Subject: [erlang-questions] [maven-erlang] Package additional fles Message-ID: First of all - I love it :) I love anything automated. So - I love it :)) However, I was wondering... Is there a way to specify additional files and directories to include in packaging deployment? Because my project will be packaged with an additional config direcotry... -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.nospam.hopwood@REDACTED Wed Oct 4 17:05:05 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Wed, 04 Oct 2006 16:05:05 +0100 Subject: [erlang-questions] : Finding IP addresses in a PC In-Reply-To: <20061004083021.GA17959@erix.ericsson.se> References: <71270.1998961158619485060.JavaMail.root@vms068.mailsrvcs.net> <20060919062856.GA4222@nodo2.lambdastream.com> <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> <45228A42.4040707@iit.edu> <4522C4C4.7090300@blueyonder.co.uk> <20061004083021.GA17959@erix.ericsson.se> Message-ID: <4523CDA1.5070701@blueyonder.co.uk> Raimo Niskanen wrote: > Hello. > > I am trying to pursue this bug, and i want to know which > function you used since I can not find GetAdaptorsInfo on > msdn.microsoft.com. You need to #include and . Note that this API has some limitations (no IPv6 support, only one address returned per adapter), but it is available on Windows versions earlier than XP. Ideally, Erlang would use GetAdaptersAddresses if available, and fall back to GetAdaptersInfo if not. An "adapter" corresponds to a connection in 'Network Connections' (I also have code to get the Network Connection name for each adapter, if you need that, but it relies on undocumented registry entries). -- David Hopwood From david.nospam.hopwood@REDACTED Wed Oct 4 17:54:11 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Wed, 04 Oct 2006 16:54:11 +0100 Subject: [erlang-questions] : : Finding IP addresses in a PC In-Reply-To: <20061004133906.GA7014@erix.ericsson.se> References: <71270.1998961158619485060.JavaMail.root@vms068.mailsrvcs.net> <20060919062856.GA4222@nodo2.lambdastream.com> <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> <42ea5fb60610032120y355111cfl3669ef8a91294ad7@mail.gmail.com> <20061004083311.GB17959@erix.ericsson.se> <20061004133906.GA7014@erix.ericsson.se> Message-ID: <4523D923.80301@blueyonder.co.uk> Raimo Niskanen wrote: > I was thinking more in the line of using inet_ntoa() and inet_addr(), > or rather use ntohl() and htonl() around the current fmt_addr(), > or even rewrite fmt_addr to take a char[] as input, in > network byte order. > > Rewriting fmt_addr() as you suggested works on little-endian > machines such as Intel, and there are not many big-endian > Windows platforms out there, but I think it is > a confusing and wrong(tm) way to do it. If you use GetAdaptersInfo, the string formatting is done for you in the IpAddress.String field: IP_ADAPTER_INFO dummy; DWORD len = 0; if (GetAdaptersInfo(&dummy, &len) != ERROR_BUFFER_OVERFLOW || len == 0) { return FAILED; } IP_ADAPTER_INFO pAdapters = (IP_ADAPTER_INFO *) malloc(len); if (pAdapters == NULL) { return FAILED; } DWORD err = GetAdaptersInfo(pAdapters, &len); if (err != ERROR_SUCCESS) { return FAILED; } do { IP_ADDR_STRING *pip = &pAdapters->IpAddressList; while (pip != NULL) { add_address(pip->IpAddress.String); pip = pip->Next; } pAdapters = pAdapters->Next; } while (pAdapters != NULL); I wrote: > Note that this API has some limitations (no IPv6 support, only one address > returned per adapter) Correction: it can return multiple addresses for each adapter, as shown above. GetAdaptersAddresses is only needed for IPv6. -- David Hopwood From david.nospam.hopwood@REDACTED Wed Oct 4 18:12:57 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Wed, 04 Oct 2006 17:12:57 +0100 Subject: [erlang-questions] : : Finding IP addresses in a PC In-Reply-To: <4523D923.80301@blueyonder.co.uk> References: <71270.1998961158619485060.JavaMail.root@vms068.mailsrvcs.net> <20060919062856.GA4222@nodo2.lambdastream.com> <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> <42ea5fb60610032120y355111cfl3669ef8a91294ad7@mail.gmail.com> <20061004083311.GB17959@erix.ericsson.se> <20061004133906.GA7014@erix.ericsson.se> <4523D923.80301@blueyonder.co.uk> Message-ID: <4523DD89.1040707@blueyonder.co.uk> David Hopwood wrote: > If you use GetAdaptersInfo, the string formatting is done for you in > the IpAddress.String field: > > IP_ADAPTER_INFO dummy; > DWORD len = 0; > if (GetAdaptersInfo(&dummy, &len) != ERROR_BUFFER_OVERFLOW || len == 0) { > return FAILED; > } > > IP_ADAPTER_INFO pAdapters = (IP_ADAPTER_INFO *) malloc(len); IP_ADAPTER_INFO *pAdapters = ... -- David Hopwood From tgruben@REDACTED Wed Oct 4 18:34:32 2006 From: tgruben@REDACTED (Todd Gruben) Date: Wed, 4 Oct 2006 11:34:32 -0500 Subject: [erlang-questions] Newbie MySQL driver question Message-ID: <97758c860610040934k22a7aff4t3beaae01a348c306@mail.gmail.com> Ok so let me preface this question with the fact that this is my first erlang application. I have downloaded the "Re-vamped" mysql driver and have successully ran the test code connecting to my database. My eventual goal is to query a whole cluster of databases via an erlang/web services interface. Below is a chunk out of my test module: log_it(Level,Fmt,Args) -> io:format(Fmt,Args). test() -> crypto:start(), io:format("Starting ~n"), {ok,p1} = mysql_conn:start("127.0.0.1", 7771,"dummy_user", "EASY_PASSWORD", "dbFIRST_DB", log_it ), io:format("Phase 1 ~n"), ---------------------------------------- i get the following message when i try and run test() ----------------------------------------- =ERROR REPORT==== 4-Oct-2006::11:30:44 === Error in process <0.39.0> with exit value: {function_clause,[{mysql_conn,do_recv,[log_it,<0.40.0 >,undefined]},{mysql_conn,mysql_init,5},{mysql_conn,init,7}]} ---------------------------------------- I am thinking this is an error in construction of my log_it function. Any idea's what I am missing? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From shelton.ms@REDACTED Wed Oct 4 19:33:57 2006 From: shelton.ms@REDACTED (Shelton Tang) Date: Thu, 5 Oct 2006 01:33:57 +0800 Subject: [erlang-questions] Why does the restart strategy "{one_for_one, 10, 10}" still kill my application? In-Reply-To: <4523A02A.4030307@erix.ericsson.se> References: <27ccae8e0610030859i717becf4x6dab71487514b268@mail.gmail.com> <4523A02A.4030307@erix.ericsson.se> Message-ID: <27ccae8e0610041033t40ddc640n9cb5682cd21b304e@mail.gmail.com> Hi Gunilla, Thank you for the info. When I start erl with "erl -boot start_sasl", the last outuput shows the sup shutdown is because of one child shutdown. The child calls gen_tcp:listen/2 but got eaddrnotavail since i got a wrong IP from inet:getiflist. so my question is, do I need to trap_exit in my supervisor? Regards, Shelton On 10/4/06, Gunilla Arendt wrote: > How do you see the the entire process tree is killed, what error > messages do you get? Use the start_sasl boot script to ensure you > see the supervisor and error reports. ("erl -boot start_sasl") > > / Gunilla > > Shelton Tang wrote: > > I am writing an application. In myapp_sup:init, I use the restart > > stragey "{one_for_one, 10, 10}". For some reason, one process in the > > three will exit since an invalid socket operation. However, I found > > the entire tree will be killed in this case. I use "transient" as the > > type and also try "temporary". But same result. Can anybody give me > > a hand? > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From taavi@REDACTED Wed Oct 4 19:55:08 2006 From: taavi@REDACTED (Taavi Talvik) Date: Wed, 4 Oct 2006 20:55:08 +0300 Subject: [erlang-questions] Why does the restart strategy "{one_for_one, 10, 10}" still kill my application? In-Reply-To: <27ccae8e0610041033t40ddc640n9cb5682cd21b304e@mail.gmail.com> References: <27ccae8e0610030859i717becf4x6dab71487514b268@mail.gmail.com> <4523A02A.4030307@erix.ericsson.se> <27ccae8e0610041033t40ddc640n9cb5682cd21b304e@mail.gmail.com> Message-ID: On Oct 4, 2006, at 8:33 PM, Shelton Tang wrote: > Hi Gunilla, > > Thank you for the info. When I start erl with "erl -boot start_sasl", > the last outuput shows the sup shutdown is because of one child > shutdown. The child calls gen_tcp:listen/2 but got eaddrnotavail since > i got a wrong IP from inet:getiflist. > > so my question is, do I need to trap_exit in my supervisor? Your problem seems to be in application startup phase. As principle: child init function should succeed and real work should be done in server "runtime" logic this allows supervisory hierarchy started and errors are later handled as normal runtime errors supervisor assumes, that initialization is lightweight operation - something like passing parameters best regards, taavi From yarivvv@REDACTED Wed Oct 4 20:54:56 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 4 Oct 2006 14:54:56 -0400 Subject: [erlang-questions] Newbie MySQL driver question In-Reply-To: <97758c860610040934k22a7aff4t3beaae01a348c306@mail.gmail.com> References: <97758c860610040934k22a7aff4t3beaae01a348c306@mail.gmail.com> Message-ID: <17244f480610041154n3f8de70asaa0733717c6ee8de@mail.gmail.com> Hi, This is an area of the documentation I need to clarify. The revamped driver has a different logging function from the old driver. It looks like this: log(Module::atom(), Line::integer(), Level::atom(), Fun::function()). Module: name of module Line: line number Level: debug | warn | error Fun: a function that returns {Msg::string(), Params::[Param]} The default log function is implemented as follows: log(Module, Line, _Level, FormatFun) -> {Format, Arguments} = FormatFun(), io:format("~w:~b: "++ Format ++ "~n", [Module, Line] ++ Arguments). The reason for this interface is that it gives you control over what level of logging messages are instantiated, not just displayed. This can significantly lower the cost of logging, especially when debug logging is turned off (at the expense of a small overhead of the function call). To make life easier, the MySQL driver uses the following macros: -define(Log(LogFun,Level,Msg), LogFun(?MODULE,?LINE,Level,fun()-> {Msg,[]} end)). -define(Log2(LogFun,Level,Msg,Params), LogFun(?MODULE,?LINE,Level,fun()-> {Msg,Params} end)). (Btw, it just struck me that having explicit parameters for the module name and line number is unnecessary because they can be added to the list of parameters -- I guess I didn't notice it earlier because I always use those macros... :-/ ). I hope this makes sense. Let me know if you have any problems. BR Yariv On 10/4/06, Todd Gruben wrote: > Ok so let me preface this question with the fact that this is my first > erlang application. I have downloaded the "Re-vamped" mysql driver and have > successully ran the test code connecting to my database. My eventual goal > is to query a whole cluster of databases via an erlang/web services > interface. Below is a chunk out of my test module: > > log_it(Level,Fmt,Args) -> > io:format(Fmt,Args). > > test() -> > > crypto:start(), > io:format("Starting ~n"), > > {ok,p1} = mysql_conn:start("127.0.0.1 ", 7771,"dummy_user", "EASY_PASSWORD", > "dbFIRST_DB", log_it ), > io:format("Phase 1 ~n"), > > ---------------------------------------- > > i get the following message when i try and run test() > ----------------------------------------- > =ERROR REPORT==== 4-Oct-2006::11:30:44 === > Error in process <0.39.0> with exit value: > {function_clause,[{mysql_conn,do_recv,[log_it,<0.40.0>,undefined]},{mysql_conn,mysql_init,5},{mysql_conn,init,7}]} > ---------------------------------------- > I am thinking this is an error in construction of my log_it function. Any > idea's what I am missing? > > thanks > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > From roger.larsson@REDACTED Wed Oct 4 22:53:41 2006 From: roger.larsson@REDACTED (Roger Larsson) Date: Wed, 4 Oct 2006 22:53:41 +0200 Subject: [erlang-questions] init (Unix boot process) replacement in Erlang? Message-ID: <200610042253.41830.roger.larsson@norran.net> http://www.linux.com/article.pl?sid=06/09/18/1623244 Found this article about an event triggered init system Shouldn't/Isn't Erlang be a perfect fit for this? Even allowing replacing parts of it without rebooting! /RogerL From bend@REDACTED Wed Oct 4 23:47:53 2006 From: bend@REDACTED (Ben Dougall) Date: Wed, 4 Oct 2006 22:47:53 +0100 Subject: [erlang-questions] how are erlang process lightweight? In-Reply-To: <200610040018.k940Ip8t030684@atlas.otago.ac.nz> Message-ID: Hello Richard, > Ben Dougall is still confused. > > And THIS is confusing him: > This was quite interesting from "Erlang Style Concurrency": "[Erlang > processes are] very cheap to start up and destroy and are very fast to > switch between because under the hood they're simply functions." > > Erlang processes are *NOT* functions. I did think Erlang processes and functions might be the same (have a one to one relationship) to start with mainly because of that above statement but not after Richard Carlsson's reply. After I'd read his reply I fully understood that this was not the case so I'm not still confused on that issue at all now. (more below). > Erlang process : Erlang function > :: > Posix or Windows thread : C function > > The principles are exactly the same. > However, > > (1) Posix and Windows thread implementations are SEVERELY limited > by > the fact that they are designed to support statically typed > languages with no garbage collector information which can > create > pointers to objects in the stacks and save those pointers anywhere. > > That means that Posix and Windows thread implementations > CANNOT MOVE OR RESIZE STACKS, because they don't know where the > pointers are and could not fix them. (Note that static typing > isn't the main problem; the Burroughs B6700 operating system > could and did dynamically move and resize stacks with no worries > at all, because the hardware required pointers to be tagged, so > the operating system could be absolutely sure of finding and > fixing all of them. I was stunned back in 1979 to discover how > primitive other computers were.) > > Because Posix and Windows thread implementations cannot move or > resize stacks, > (A) you the programmer have to say how big they will be > (B) to get this right it is absolutely essential that the C > compiler tell you how big stack frames are (but it never does) > and how deep the stack can get (but it never does that either). > So you have to over-estimate with a rather large safety factor. > (C) heaven help you if you guess wrong, because the hardware, > operating system, and run-time library will cheerfully see > your program crash and burn. > So you REALLY have to over-estimate with a very large safety > factor. > > Erlang does keep around enough information (for garbage collection) > so that it CAN find and fix all the necessary pointers whenever a > stack has to be moved or resized. So > (D) you never have to make guesses, and > (E) stacks can start very small => lightweight in memory use. > > (2) Posix and Windows thread implementations need the help of the > operating system for several key operations. Context switches > are known to be very very bad for caches; a paper from DEC WRL > showed that in that system a context switch could foul up your > cache to the point where it took many thousands of instructions > to recover, and of course by that time you have another context > switch. > > The Erlang process implementation is user-level, sometimes > called "green threads". No kernel memory is needed for an > Erlang process. Erlang process switching does mean that the > stack data for the process switched out of is gradually lost > from the cache, BUT what goes into the instruction cache is the > emulator, and that stays cached. There are no traps out to the > operating system and back again (which can be quite slow; deep > recursion on SPARCs used to be very painful because of that). > So Erlang process switching is cheap => lightweight in time. > > (3) You might imagine that Java solves problems (1) and (2), and > indeed it does. But Java is an imperative programming language; > computation proceeds by smashing the state of mutable objects. > If two or more processes try to access the same mutable object > they can get terribly confused. So every access to an object > that *might* be shared with another process has to be 'synchronised' > (or is it 'synchronized'? I wish they had chosen a word that > everyone agreed how to spell). This is called "locking". Much of > the locking is done implicitly when you call synchronised methods, > but that doesn't affect the point that there has to be a heck of a > lot of it. > > Java implementors have put unbelievable amounts of work into trying > to make locking fast. They still can't make it as fast as not > locking. > Although Java had Vector, it acquired ArrayList. What's the > difference? Vector expects to be shared, and does oodles of locking; > ArrayList expects not to be shared, and does no locking. It's faster. > Although Java had StringBuffer, it acquired StringBuilder? What's > the difference? Just that StringBuffer expects to be shared, and > does oodles of locking; StringBuilder has exactly the same interface > but expects not to be shared, and does no locking. It's faster. > > In Erlang, there are no mutable data structures[*], and in any case, > no process can access another process's data in any way, so there is > no need for locking in routine calculations. Obviously, loading and > unloading modules requires locking, and data base access had better > involve some kind of locking, but routine calculations marching over > data structures and building results DON'T need any locking. > [*] I lied: there is something called "the process dictionary". > But that is not and cannot be shared with any other process, so you > STILL don't need locking. > > Result: Erlang needs little or no locking for routine calculations > => lightweight in time. > > Even message sending and receiving could, I believe, be done > without locking using lock-free queues. I have no idea whether it > would be worth while. Right, comparing normal threads to Erlang processes, I was starting to think there wasn't so much of a memory space saving so far as E.P.s go -- a bit but not much. But from from what you're saying there is quite a bit of saving because of the inflexible and large nature of thread's stacks. I already appreciated that time savings come from no shared memory so no locks, and scheduling and switching done in user space so much less work required by the machine in shifting stuff round when switching but had missed the savings of memory part. Thanks for all the info. Very useful. Haven't soaked it up fully yet -- will do. Thanks, Ben. From ok@REDACTED Thu Oct 5 02:08:22 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 5 Oct 2006 13:08:22 +1300 (NZDT) Subject: [erlang-questions] Bug ?! Message-ID: <200610050008.k9508MQ9030797@atlas.otago.ac.nz> Richard Carlsson wrote: I agree that [(n+k) patterns] are very cute. Probably too cute. For a detailed discussion by the Haskell nomenklatura: http://www.cs.chalmers.se/~rjmh/Haskell/Messages/Decision.cgi?id=203 If you do see that, note in particular the first two paragraphs: "we have an extra reason not to change the (n+k) syntax" "n+k patterns will stay" "they should either be in or out and they're in!na If we look at Colin Runciman's arguments, for example: (0) + isn't a constructor -- this is not just an argument against n+k, it is an argument against abstract patterns or views of any kind. (n+k isn't quite definable in my abstract patterns proposal, but n+1 is.) This could be fixed by using some symbol other than +; if the syntax were (for argument's sake) 1'(x) or 2'(x) instead of x+1 or x+2, we could also allow 1'(x) or 2'(x) as a construction form in expressions (with the condition that x >= 0). (1) the test n>=0 is a hidden side condition -- the side condition is precisely why we WANT this pattern. I believe this could be fixed by the same approach as (0): if there were a quasi-constructor k' for each positive integer k, which raised an exception of its argument were not a natural number, then the "side-condition" could no longer be honestly called "hidden", because it would apply always and everywhere. (2) it is forbidden in a top-level pattern -- well, it shouldn't be. This argument doesn't apply at all to Erlang, where function definitions are not top-level patterns; there aren't any of those. (3) other patterns can be made more specific by putting a constant for a variable but while n+2 is legal, 2+2 isn't -- fix that by making 2+2 legal. He also argues that n+2 is legal but n+m is not; if we used k' as a quasi-constructor, where the ' is *part of the token*, that problem also would disappear. It would be no stranger that 2'(n) cannot be generalised to m'(n) than that F2(n) cannot be generalised to (F m)(n). (4) n+k looks like an aid to equational reasoning but isn't -- true, but it is hard to take that argument seriously: does anyone expect it to be? This argument would hold no force whatever if the ' syntax were used. "Suppose f is defined by the sole equation f 1'(n) = 0. Is this a law: for all integer expressions n, f '(n) = 0?" Not quite, but it IS a law for all expressions n with natural number values. The range condition here is no more surprising or exceptional than "if f is defined by f n = 0" it is NOT a law that "for all integer expressions n, f n = 0", not in a strict language like Haskell it isn't, because the expression might fail to have a value. (5) "Superficially, it encourages careful case analysis, but again it undermines it" -- turns out to be an attack on n+k syntax FOR DOING ITS JOB. The job of n+k syntax is to *NOT* handle negative numbers. (6) Why not c*n+k patterns, where 0 <= k < c -- but that is precisely what I asked for in my previous message. (7) Uses of n+k in existing code are easily detected, and easily translated into (n+k)-free equivalents -- half true. Yes, n+k is easy to detect. No, a compiler can "easily" translate it away, but a human cannot "easily" transform all occurrences of n+k into *READABLE* equivalents. That's why I want N+k in Erlang, so that code can be written in a safer (in cases where you would have forgotten the range check) and more readable (in cases where you would not) way. This is an argument that n+k *can* be eliminated, not that it *should*. (8) Omitting n+k would simplify the language -- and so would eliminating if-then-else, short-circuit and, short-circuit or, 'where', and a host of other bits of syntactic sugar. Simplicity is not an absolute goal. (There are some truly bizarre things in GHC, some of them seriously considered for Haskell-prime.) (9) Retaining n+k would be controversial -- so would omitting it. So this doesn't really count as an argument against it. Those are reasonably typical arguments, and Richard Bird did a superb job of demolishing them. For example, "(0-3) The anomaly remarks abotu + not being a constructor are all, of course, true. But in 14 years of teaching, I have never found that they cause students any confusion." David Lester's argument that the use of n+k patterns limits your code to integral types, when some more general arithmetic type might have been usable otherwise, is true enough for Haskell, but totally irrelevant to Erlang. Even for Haskell, the argument is bogus, because n+k COULD be made to work for any instance of Num. Here's how: define (n+k) to match v when signum (v - fromInteger k) /= signum (fromInteger (-1) `asTypeOf` v) n matches v - fromInteger k Let's suppose we want to answer arguments (0), (1), (2 does not apply in Erlang), (3), arguably (4), (5), part of (6) that I omitted, but in a design for Erlang. For any positive integer literal k, #+k is a postfix unary operator #-k is a postfix unary operator these operators are "quasi-constructors". That is, they act like constructors, and may be used in expressions and in patterns, but unlike list and tuple constructors (but like binary constructors) their arguments are restricted. In an expression, the (left) argument - of #+k must evaluate to a non-negative integer x, the result is x+k; - of #-k must evaluate to a non-positive integer x, the result is x-k. In a pattern, the (left) argument - of #+k must be a non-negative integer literal x, matching (x+k), or a variable bound to a non-negative integer x, matching (x+k), or an unbound variable or wild-card X, in which case the pattern matches any integer y greater than or equal to k and binds X to y-k; - of #-k must be a non-positive integer literal x, matching (x-k), or a variable bound ro a non-negative integer x, matching (x-k), or an unbound variable or wild-card X, in which case the pattern matches any integer y less than or equal to -k and binds X to y+k. X#+k matches e#+k if and only if integer(e), e >= 0, X = e X#-k matches e#-k if and only if integer(e), e =< 0, X = e Now we can do a three-way analysis: factorial(N = M#+1) -> N * factorial(M); factorial(0) -> 1; factorial(_#-1) -> exit({badarith,[{?MODULE,factorial,1}]}). > But also, when working with binary, ternary, and quaternary trees, > I have wanted to do this: > > f(1) -> ...; > f(2*K+0) -> ...; > f(2*K+1) -> .... It is really very pretty. One almost wants to pick it up and cuddle it. But it's probably the kind of feature that is catering too much for a special case while at the same time not really being useful all that often in real code. Oddly enough "we don't provide this obviously useful generalisation of n+k" is one of the standard arguments brought out by people who oppose n+k. There seem to be quite a few people who regard this as a natural extension of pattern matching, even if they see it as undesirable on deeper reflection. Let me put it this way: Lisp has been around for decades without any kind of pattern matching at all. Get used to the Lisp style, and you find yourself thinking "all this pattern matching is catering too much for a few special cases while at the same time not really being useful all that often in real code, what with sequence functions and CLOS and all sorts of things you can't write patterns for". If we _had_ c*n+k patterns we might well find them useful a lot in real code. Maybe not. I *do* know that I use n+k patterns a lot in Haskell and wish for them a lot in Erlang, In the same way, the more I look at let P = E0 then E1, ... for Q <- ... in Result the more I find uses for it and the more I find that it would simplify and clarify existing code. (I managed to shrink one chunk of someone else's Erlang code by nearly a factor of three this way.) What you find useful depends on what you have available to use. From ok@REDACTED Thu Oct 5 02:30:19 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 5 Oct 2006 13:30:19 +1300 (NZDT) Subject: [erlang-questions] Bug ?! Message-ID: <200610050030.k950UJ9H034474@atlas.otago.ac.nz> Richard O'Keefe | Richard Carlsson | Pattern proposed | counter-proposed | meaning ----------------+------------------+-------- [*] | [..] | a list of any size, including 0 or 1. {*} | {..} | a tuple of any size, including 0 or 1. <<*>> | <<..>> | a binary of any size, including 0 or 1. #r{*} | | any instance of record type r | #r{} | existing syntax for the same thing I was about to make an argument about #r{*} versus #r{}, but on reflection lists, tuples, and binaries are sequences, and records aren't. So maybe it is a good thing for them to look different. The first column gets by with no new tokens. The second column requires a new "short ellipsis" token. Darn it, the second column does look better. It's just that I have painful memories of ",.." in DEC-10 Prolog. From ke.han@REDACTED Thu Oct 5 04:31:15 2006 From: ke.han@REDACTED (ke han) Date: Thu, 5 Oct 2006 10:31:15 +0800 Subject: [erlang-questions] Solaris 10 equiv to kqueue or epoll? Message-ID: <2EF68AC7-ABB2-409C-A285-EDA664235F11@redstarling.com> I am looking at using Solaris 10 on Sun's Opteron server for erlang. My app will eventually need to handle large number of sockets. On FreeBSD, I can leverage the built in kqueue support. How does erlang (R10 or R11) on Solaris 10 handle large socket groups? thanks, ke han From bengt.kleberg@REDACTED Thu Oct 5 08:40:25 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 05 Oct 2006 08:40:25 +0200 Subject: [erlang-questions] Solaris 10 equiv to kqueue or epoll? In-Reply-To: <2EF68AC7-ABB2-409C-A285-EDA664235F11@redstarling.com> References: <2EF68AC7-ABB2-409C-A285-EDA664235F11@redstarling.com> Message-ID: <4524A8D9.7090603@ericsson.com> On 2006-10-05 04:31, ke han wrote: > I am looking at using Solaris 10 on Sun's Opteron server for erlang. > My app will eventually need to handle large number of sockets. On > FreeBSD, I can leverage the built in kqueue support. > How does erlang (R10 or R11) on Solaris 10 handle large socket groups? on solaris the large number of sockets interface is called /dev/poll: http://access1.sun.com/techarticles/devpoll.html bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From raimo+erlang-questions@REDACTED Thu Oct 5 09:19:50 2006 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 5 Oct 2006 09:19:50 +0200 Subject: [erlang-questions] : : : Finding IP addresses in a PC In-Reply-To: <4523DD89.1040707@blueyonder.co.uk> References: <71270.1998961158619485060.JavaMail.root@vms068.mailsrvcs.net> <20060919062856.GA4222@nodo2.lambdastream.com> <27ccae8e0610030853xdb38305ycebeabdfbf6dcc73@mail.gmail.com> <42ea5fb60610032120y355111cfl3669ef8a91294ad7@mail.gmail.com> <20061004083311.GB17959@erix.ericsson.se> <20061004133906.GA7014@erix.ericsson.se> <4523D923.80301@blueyonder.co.uk> <4523DD89.1040707@blueyonder.co.uk> Message-ID: <20061005071950.GA26870@erix.ericsson.se> The current implementation uses WSAIoctl(..., SIO_GET_INTERFACE_LIST, ...) are there any particular backdraws with it. The interface today has got inet:getiflist() that returns a list of interface names; on a typical linux box -> {ok,["eth0","lo0"]}, and then inet:ifget("lo0", [addr]) -> {ok,[{addr,{127,0,0,1}]}. It seems to me more logical that inet:getiflist() on Windows returns a list of adapter names, that can be used as arguments to inet:ifget(). Today the adapter names on windows are generated as the IPv4 address string of the adapter, but they should probably be the "real" adapter names (are they as clumsy as "Eternet adapter Local Area Connection 1"?). That might be an argument for using GetAdaptersInfo. Are there any more? On Wed, Oct 04, 2006 at 05:12:57PM +0100, David Hopwood wrote: > David Hopwood wrote: > > If you use GetAdaptersInfo, the string formatting is done for you in > > the IpAddress.String field: > > > > IP_ADAPTER_INFO dummy; > > DWORD len = 0; > > if (GetAdaptersInfo(&dummy, &len) != ERROR_BUFFER_OVERFLOW || len == 0) { > > return FAILED; > > } > > > > IP_ADAPTER_INFO pAdapters = (IP_ADAPTER_INFO *) malloc(len); > > IP_ADAPTER_INFO *pAdapters = ... > > -- > David Hopwood > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From erlang@REDACTED Thu Oct 5 09:30:05 2006 From: erlang@REDACTED (Joe Armstrong) Date: Thu, 5 Oct 2006 09:30:05 +0200 Subject: [erlang-questions] Multiple modules Message-ID: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> Modules ... thoughts Any opinion about and "endmod." declaration: Proposal The file myapp.erl might contain -module(foo). .... .... -endmod. -module(bar). ... ... -endmod. Compiling this produces myapp.beam loading myapp.beam loads all the code in foo, bar, ..., this has several advantages: 1) distribute only one file 2) modules in file cannot live a life of their own and become separated 3) code loading is faster /Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Thu Oct 5 09:31:18 2006 From: erlang@REDACTED (Joe Armstrong) Date: Thu, 5 Oct 2006 09:31:18 +0200 Subject: [erlang-questions] Process declarations Message-ID: <9b08084c0610050031m468daf6aj72fd8f45bb0366a4@mail.gmail.com> Process declarations: Thinking out loud.... Proposal 1 (Radical) ========== Do away with spawn. Replace with a process keyword: Today ===== -module(foo). -export([bar/1]). bar(X) -> receive X -> ... end. -module(bar). ... g(X, Y) -> Pid = spawn(foo, bar, [X]), ... Tomorrow?? ========== -module(foo). -export([bar/1]). process bar(X) -> receive X -> ... end. -module(bar). ... g(X, Y) -> Pid = foo:bar(X), ... Why? So that we can name processes. Things without names we cannot talk about. So if we write: f(X, Y) -> ... process g(X, Y) -> ... Then evaluating A = f(X, Y) works as usual But Z = g(X, Y) *always* results in Z being a Pid Proposal 2 (Conservative) ========================= -module(glurk). -export([foo/1]). -process([bar/2]). foo(X) -> 1. bar(X, Y) -> spawn(fun() -> 1 end). Extend the parser to understand -process attributes (as above) Note this implies that the function is exported from the module, which would put an end to the horribly practise of artificially exporting functions that are known to be targets of spawns. /Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From richardc@REDACTED Thu Oct 5 09:48:10 2006 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 05 Oct 2006 09:48:10 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <200610050030.k950UJ9H034474@atlas.otago.ac.nz> References: <200610050030.k950UJ9H034474@atlas.otago.ac.nz> Message-ID: <4524B8BA.8070109@it.uu.se> Richard A. O'Keefe wrote: > Darn it, the second column does look better. > > It's just that I have painful memories of ",.." in DEC-10 Prolog. Care to elaborate? (I've been fiddling with list syntax variations, and I was thinking that "[x,y,..]" would be an improvement on "[x,y|_]", on several levels: less prone to undetected typo mistakes, easier to write, and easier to read.) /Richard From bengt.kleberg@REDACTED Thu Oct 5 09:48:47 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 05 Oct 2006 09:48:47 +0200 Subject: [erlang-questions] Multiple modules In-Reply-To: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> Message-ID: <4524B8DF.6080208@ericsson.com> On 2006-10-05 09:30, Joe Armstrong wrote: ...deleted > loading myapp.beam loads all the code in foo, bar, ..., this > has several advantages: > > 1) distribute only one file > 2) modules in file cannot live a life of their own and become > separated > 3) code loading is faster another advantage. the following error goes away: ''beam/beam_load.c(939): Error loading module tmp: module name in object code is asd'' bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From chsu79@REDACTED Thu Oct 5 09:54:31 2006 From: chsu79@REDACTED (Christian S) Date: Thu, 5 Oct 2006 09:54:31 +0200 Subject: [erlang-questions] Multiple modules In-Reply-To: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> Message-ID: > 1) distribute only one file > 2) modules in file cannot live a life of their own and become > separated > 3) code loading is faster 4) Natural syntax for defining new modules in the shell. From vladdu55@REDACTED Thu Oct 5 10:13:29 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 5 Oct 2006 10:13:29 +0200 Subject: [erlang-questions] Process declarations In-Reply-To: <9b08084c0610050031m468daf6aj72fd8f45bb0366a4@mail.gmail.com> References: <9b08084c0610050031m468daf6aj72fd8f45bb0366a4@mail.gmail.com> Message-ID: <95be1d3b0610050113y6aa6f5d9y558f9b5503901ffc@mail.gmail.com> Hi, On 10/5/06, Joe Armstrong wrote: > Process declarations: > Proposal 1 (Radical) > ========== > Do away with spawn. Replace with a process keyword: If I understand correctly, you mean that calls to functions declared as 'process' Z = g(X, Y) will become in fact syntactic sugar for Z = spawn(fun()->g(X, Y) end)) I also suppose you meant a similar thing for the second proposal (because as stated, it only changes having to 'export' a function to having to 'process' it, which doesn't amount to much. I'll have to think more about it, but the first reaction is that this loses some flexibility. I might like to be able to call g(X, Y) both as a regular function and as a process starter. Don't know if this is meaningful in practice. A third option (almost as radical as the first) but where this flexibility is kept, is to move the 'process' directive to the place of the call. In other words, we could make 'spawn' a kekyword and have Z = spawn g(X, Y) mean Z = spawn(fun()->g(X, Y) end)) while being able to call Z = g(X, Y) too. Actually, it's not even necessary to make spawn a keyword. We could have something that in practice amounts to a macro call Z = new_spawn(g(X, Y)) where we can't use 'spawn' because we'd shadow the case where g(X,Y) returns a fun that is to be spawned and I can't come up with a better suggestion for a name. A parse transform to do that is easy to write - the crux would be that we shouldn't have to declare it in every module... best regards, Vlad From chsu79@REDACTED Thu Oct 5 10:21:57 2006 From: chsu79@REDACTED (Christian S) Date: Thu, 5 Oct 2006 10:21:57 +0200 Subject: [erlang-questions] Process declarations In-Reply-To: <9b08084c0610050031m468daf6aj72fd8f45bb0366a4@mail.gmail.com> References: <9b08084c0610050031m468daf6aj72fd8f45bb0366a4@mail.gmail.com> Message-ID: On 10/5/06, Joe Armstrong wrote: > Thinking out loud.... Ditto. > Tomorrow?? > ========== > process bar(X) -> > receive > X -> ... > end. > Proposal 2 (Conservative) > ========================= > -process([bar/2]). In the past there was talk about marking some functions as side-effect free so they could be allowed in guards. User defined guards. http://www.erlang.org/ml-archive/erlang-questions/200309/msg00263.html What I'm getting at is that perhaps one want a more generalized 'mark-up-this-function-as-a' feature. -fundef(foobar/1, [process, {doc, "Awaits an X and returns an ellipsis."}]) foobar(X) -> receive X -> ... end. My god that looked ugly. But it reuses syntax we know. The 'doc' part is inspired by common lisp's docstrings (short-descriptions (of-function (features))). From erlang@REDACTED Thu Oct 5 10:22:10 2006 From: erlang@REDACTED (Joe Armstrong) Date: Thu, 5 Oct 2006 10:22:10 +0200 Subject: [erlang-questions] escript lives Message-ID: <9b08084c0610050122q27e7ca66le3a6d1a1d9dc6841@mail.gmail.com> I have made escript work again. 'twas lost - but now it is found. Escript is a scripting interface to Erlang (see the history below) Questions: This is tested only on Solaris and bash on R11B The script bit needs some funny quoting that may not work on other systems. I would be grateful if you could let me know of any abnormalities that occur on other platforms - also if any windows users can run this I'd like to know what you think the best way to set this up is. /Joe 1) 3-april-2001 Joe Armstrong amd Robert Virding write escript. This is a pure erlang applications that allows erlang modules to be used as scripts: Example: ./factorial 123 factorial 123 = 1214630436702532967576624324188129585545 4217088483382315328918161829235892362167 6688311569606126402021707358352212940477 8259109157041165147218602951990626164673 0733907419814952960000000000000000000000 000000 The file factorial contains the following: #!/usr/bin/env escript %% %% Usage: %% factorial %% Example of an interpreted script -export([main/1]). main([X]) -> case (catch list_to_integer(X)) of {'EXIT', _} -> usage(); J -> N = fac(J), io:format("factorial ~w = ~w~n",[J, N]) end; main(_) -> usage(). usage() -> io:format("Usage factorial ~n"). fac(0) -> 1; fac(N) -> N * fac(N-1). 2) Escript has a rather long startup time time ./factorial 1 ... real 0m0.745s So I investigated why. The reason has to do with code loading ... 3) I wrote SAE - stand-alone Erlang to solve this Then I implemented escript in SAE escript with SAE started very quickly (0.0N) seconds (ish) 4) Integration of SAE with the standard release was pretty difficult (lots of modules have to be changed) 5) SAE never made it into the main release - but parts of it found there way into the bootstrap compiler. 6) escript ran for a while on SAE - but every new release of ERlang required major effort to get it running again. 7) Escript stops working on the latest version of the system, because it now depends upon SAE which is broken. ... 8) I stop using escript and forget about it. 9) I start writing a book. <>. 10) I want to describe loads of *useful* and little known tools. 11) I want make sure that escript works. 12) I google escript - since I??ve now *lost* the code 13) Google finds escript on MY web site (holy cows) - irony yes. This is the old "pure-erlang" version "pre SAE" 14) I compile this version It is broken. It depends upon a hacked version of erl_eval this needs syncing with the latest version. 15) I look at the latest version of erl_eval I find this comment: %% Is used by standalone Erlang (escript). %% Also used by shell.erl. -export([match_clause/4]). I suspect that erl_eval.erl is "up to date" with my hacked version, I check - it is. 16) I wonder. "is escript" in the *current* system? 17) I check yes - it's in erts/boot/src/escript.erl 18) Does it work? no 19) I fix it It works 20) Is it installed by default? No 21) Is it documented No 22) I fix it - fix the documentation and post to the Erlang list /Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: escript-4.0.tgz Type: application/x-gzip Size: 5354 bytes Desc: not available URL: From vladdu55@REDACTED Thu Oct 5 10:31:09 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 5 Oct 2006 10:31:09 +0200 Subject: [erlang-questions] Multiple modules In-Reply-To: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> Message-ID: <95be1d3b0610050131i7e1b99c8o5a557b6c859acc6e@mail.gmail.com> Hi, On 10/5/06, Joe Armstrong wrote: > Modules ... thoughts > 1) distribute only one file > 2) modules in file cannot live a life of their own and become > separated > 3) code loading is faster If the modules can't live a life of their own, why would they need to be separate modules? The only advantage I see would be a partitioning of the namespace, but is it a strong enough argument? Actually, I can see a possible application - only one module is visible externally and the others just support it and are hidden (i.e. the compiler mangles the name beyond accidental use). Then the module namespace would be cleaner too (and no more "app_module" names ;-) What would you like to use this for, Joe? regards, Vlad From vladdu55@REDACTED Thu Oct 5 10:32:50 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 5 Oct 2006 10:32:50 +0200 Subject: [erlang-questions] Multiple modules In-Reply-To: References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> Message-ID: <95be1d3b0610050132p3f3b9fc4o4cf436c48f1630f@mail.gmail.com> On 10/5/06, Christian S wrote: > 4) Natural syntax for defining new modules in the shell. As a personal opinion, I would much rather see some kind of integrated editor than being able to define modules in the shell. regards, Vlad From erlang@REDACTED Thu Oct 5 10:38:31 2006 From: erlang@REDACTED (Joe Armstrong) Date: Thu, 5 Oct 2006 10:38:31 +0200 Subject: [erlang-questions] Multiple modules In-Reply-To: <95be1d3b0610050131i7e1b99c8o5a557b6c859acc6e@mail.gmail.com> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> <95be1d3b0610050131i7e1b99c8o5a557b6c859acc6e@mail.gmail.com> Message-ID: <9b08084c0610050138l288a01d0g8b0834e3f7ea3e06@mail.gmail.com> I often have a number of small but related modules and it would be nice to distributed them as a single file. Conceptually an application *is* one thing - so I'd like to distribute one file /Joe On 10/5/06, Vlad Dumitrescu wrote: > > Hi, > > On 10/5/06, Joe Armstrong wrote: > > Modules ... thoughts > > 1) distribute only one file > > 2) modules in file cannot live a life of their own and become > > separated > > 3) code loading is faster > > If the modules can't live a life of their own, why would they need to > be separate modules? The only advantage I see would be a partitioning > of the namespace, but is it a strong enough argument? > > Actually, I can see a possible application - only one module is > visible externally and the others just support it and are hidden (i.e. > the compiler mangles the name beyond accidental use). Then the module > namespace would be cleaner too (and no more "app_module" names ;-) > > What would you like to use this for, Joe? > > regards, > Vlad > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Thu Oct 5 10:44:12 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 5 Oct 2006 10:44:12 +0200 Subject: [erlang-questions] Multiple modules In-Reply-To: <9b08084c0610050138l288a01d0g8b0834e3f7ea3e06@mail.gmail.com> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> <95be1d3b0610050131i7e1b99c8o5a557b6c859acc6e@mail.gmail.com> <9b08084c0610050138l288a01d0g8b0834e3f7ea3e06@mail.gmail.com> Message-ID: <95be1d3b0610050144q3b423edei3e5140e3a8ffd328@mail.gmail.com> On 10/5/06, Joe Armstrong wrote: > I often have a number of small but related modules and it would be > nice to distributed them as a single file. > > Conceptually an application *is* one thing - so I'd like to distribute one > file Yes, I agree. But this has some semantic effects too (like linking the modules together tightly), that need to be tought over. Personally, I use zip or tar for the "one file" effect without any semantic side-effects ;-) regards, Vlad From richardc@REDACTED Thu Oct 5 10:50:26 2006 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 05 Oct 2006 10:50:26 +0200 Subject: [erlang-questions] Process declarations In-Reply-To: References: <9b08084c0610050031m468daf6aj72fd8f45bb0366a4@mail.gmail.com> Message-ID: <4524C752.6050101@it.uu.se> Christian S wrote: > What I'm getting at is that perhaps one want a more generalized > 'mark-up-this-function-as-a' feature. > > -fundef(foobar/1, [process, {doc, "Awaits an X and returns an ellipsis."}]) > foobar(X) -> > receive > X -> ... > end. > > > My god that looked ugly. But it reuses syntax we know. If you would write it like this (perhaps even uglier, but never mind): -meta({{foobar,1}, [process, {doc, "..."}]}). you don't have to add anything to the language - just teach the compiler and other tools to use the information. (Declarations on the form "-Atom(Term)" are generic module attributes with key Atom and value Term, except of course for the pre-defined declarations such as "-module(m)".) That said, I think it is generally a very bad idea to declare how an entity is expected to be used, when you ultimately have no control over how it will be used in practice (especially some years down the road). Declarations that lie are worse than no declarations at all. (Of course, that does not apply if the declarations are merely hints.) And some declarations simply cannot be trusted, such as "is side effect free"; such properties must be derived by the compiler. /Richard From bengt.kleberg@REDACTED Thu Oct 5 10:51:24 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 05 Oct 2006 10:51:24 +0200 Subject: [erlang-questions] escript lives In-Reply-To: <9b08084c0610050122q27e7ca66le3a6d1a1d9dc6841@mail.gmail.com> References: <9b08084c0610050122q27e7ca66le3a6d1a1d9dc6841@mail.gmail.com> Message-ID: <4524C78C.5080802@ericsson.com> On 2006-10-05 10:22, Joe Armstrong wrote: > I have made escript work again. 'twas lost - but now it is found. ...deleted > 22) I fix it - fix the documentation > and post to the Erlang list thank you. i used it a lot, but had to switch to a home-brew method when it stopped working. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From rlenglet@REDACTED Thu Oct 5 10:54:03 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Thu, 5 Oct 2006 17:54:03 +0900 Subject: [erlang-questions] Multiple modules In-Reply-To: <9b08084c0610050138l288a01d0g8b0834e3f7ea3e06@mail.gmail.com> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> <95be1d3b0610050131i7e1b99c8o5a557b6c859acc6e@mail.gmail.com> <9b08084c0610050138l288a01d0g8b0834e3f7ea3e06@mail.gmail.com> Message-ID: <200610051754.03664.rlenglet@users.forge.objectweb.org> Joe Armstrong wrote: > I often have a number of small but related modules and it > would be nice to distributed them as a single file. > > Conceptually an application *is* one thing - so I'd like to > distribute one file Then, why not simply add support for .zip files in the code loader? Like .jar files in Java? -- Romain LENGLET From bengt.kleberg@REDACTED Thu Oct 5 10:58:43 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 05 Oct 2006 10:58:43 +0200 Subject: [erlang-questions] Process declarations In-Reply-To: <9b08084c0610050031m468daf6aj72fd8f45bb0366a4@mail.gmail.com> References: <9b08084c0610050031m468daf6aj72fd8f45bb0366a4@mail.gmail.com> Message-ID: <4524C943.5080201@ericsson.com> On 2006-10-05 09:31, Joe Armstrong wrote: ...deleted > spawn(fun() -> 1 end). ...deleted > Note this implies that the function is exported from the module, > which would put an end to the horribly practise of artificially > exporting functions that are known to be targets of spawns. you have yourself already shown how to never export functions known to be targets of spawns. i only use spawn/1,2, considering the older versions (/3,4) as deprecated. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From rlenglet@REDACTED Thu Oct 5 11:03:26 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Thu, 5 Oct 2006 18:03:26 +0900 Subject: [erlang-questions] Multiple modules In-Reply-To: <95be1d3b0610050144q3b423edei3e5140e3a8ffd328@mail.gmail.com> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> <9b08084c0610050138l288a01d0g8b0834e3f7ea3e06@mail.gmail.com> <95be1d3b0610050144q3b423edei3e5140e3a8ffd328@mail.gmail.com> Message-ID: <200610051803.27155.rlenglet@users.forge.objectweb.org> Vlad Dumitrescu wrote: > On 10/5/06, Joe Armstrong wrote: > > I often have a number of small but related modules and it > > would be nice to distributed them as a single file. > > > > Conceptually an application *is* one thing - so I'd like to > > distribute one file > > Yes, I agree. But this has some semantic effects too (like > linking the modules together tightly), that need to be tought > over. > > Personally, I use zip or tar for the "one file" effect without > any semantic side-effects ;-) And it seems that the support for archives is already there: the erl_tar module in stdlib supports archives compressed with gzip (.tar.gz). I am not sure if making the code loader depend on this module in stdlib is a nice idea... -- Romain LENGLET From bengt.kleberg@REDACTED Thu Oct 5 11:09:46 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 05 Oct 2006 11:09:46 +0200 Subject: [erlang-questions] Multiple modules In-Reply-To: <200610051754.03664.rlenglet@users.forge.objectweb.org> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> <95be1d3b0610050131i7e1b99c8o5a557b6c859acc6e@mail.gmail.com> <9b08084c0610050138l288a01d0g8b0834e3f7ea3e06@mail.gmail.com> <200610051754.03664.rlenglet@users.forge.objectweb.org> Message-ID: <4524CBDA.2000304@ericsson.com> On 2006-10-05 10:54, Romain Lenglet wrote: ...deleted > Then, why not simply add support for .zip files in the code > loader? Like .jar files in Java? is .zip files archives? does the zlib module handle that kind of archives? otherwise it would be simpler to use .tgz archives, since both gzip and tar is already provided in erlang. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From vladdu55@REDACTED Thu Oct 5 11:18:05 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 5 Oct 2006 11:18:05 +0200 Subject: [erlang-questions] [spam] Welcome to the Waterfall 2006 conference! Message-ID: <95be1d3b0610050218i31ffa7b1o443da6515404f965@mail.gmail.com> I thought this could be of interest to every programmer worth the name. ;-D http://www.waterfall2006.com/ regards, Vlad From dmitriid@REDACTED Thu Oct 5 11:59:12 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Thu, 5 Oct 2006 12:59:12 +0300 Subject: [erlang-questions] Erlide, different ebin paths Message-ID: I've successfully "married" Maven and Erlide, but before I post the solution to Trapexit Wiki, I need to solve an unpleasant problem related to Erlide. When I specify a different "Build output" folder in project properties, Erlide compiles everything ok, but the newly compiled modules are not picked up by the console, resulting in {undef, _} errors on any calls. Is this related to the way OTP handles ebinaries, or can this be circumvented by Erlide? -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Thu Oct 5 12:19:23 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 5 Oct 2006 12:19:23 +0200 Subject: [erlang-questions] Erlide, different ebin paths In-Reply-To: References: Message-ID: <95be1d3b0610050319n791fd2ecr13f69a1f53f877d@mail.gmail.com> Hi, On 10/5/06, Dmitrii Dimandt wrote: > I've successfully "married" Maven and Erlide, but before I post the solution > to Trapexit Wiki, I need to solve an unpleasant problem related to Erlide. > > When I specify a different "Build output" folder in project properties, > Erlide compiles everything ok, but the newly compiled modules are not picked > up by the console, resulting in {undef, _} errors on any calls. I am certain it's Erlide who's at fault here. There's no automatic reload mechanism in the standard distribution. The Erlide build process should also reload the new beam files, but I guess there's a glitch that make it work only from the default directory. The attempt att providing complete configuration options has probably overlooked a hardcoded value. I will check it, but please post a bug report at http://sourceforge.net/tracker/?group_id=58889&atid=489191 best regards, Vlad From bob@REDACTED Thu Oct 5 12:38:40 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 5 Oct 2006 03:38:40 -0700 Subject: [erlang-questions] Multiple modules In-Reply-To: <4524CBDA.2000304@ericsson.com> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> <95be1d3b0610050131i7e1b99c8o5a557b6c859acc6e@mail.gmail.com> <9b08084c0610050138l288a01d0g8b0834e3f7ea3e06@mail.gmail.com> <200610051754.03664.rlenglet@users.forge.objectweb.org> <4524CBDA.2000304@ericsson.com> Message-ID: <6a36e7290610050338s3770037bj4eea001af14cc9a8@mail.gmail.com> On 10/5/06, Bengt Kleberg wrote: > On 2006-10-05 10:54, Romain Lenglet wrote: > ...deleted > > Then, why not simply add support for .zip files in the code > > loader? Like .jar files in Java? > > is .zip files archives? > does the zlib module handle that kind of archives? > > otherwise it would be simpler to use .tgz archives, since both gzip and > tar is already provided in erlang. zip files have a manifest at the end, so it's quick to see what's in there. You don't have to decompress anything. That's why many (most?) languages that have code archives use something derivative of zip. Another interesting feature of zip is that the spec only specifies the end of the file. You can have an arbitrary amount of data at the front of a zip file. Self-extracting zips and other installer-like-things can often be operated on directly with normal zip tools, since they always start from the end looking for the magic bytes and the manifest. -bob From james.hague@REDACTED Thu Oct 5 15:54:24 2006 From: james.hague@REDACTED (James Hague) Date: Thu, 5 Oct 2006 08:54:24 -0500 Subject: [erlang-questions] Process declarations In-Reply-To: <9b08084c0610050031m468daf6aj72fd8f45bb0366a4@mail.gmail.com> References: <9b08084c0610050031m468daf6aj72fd8f45bb0366a4@mail.gmail.com> Message-ID: On 10/5/06, Joe Armstrong wrote: > Z = g(X, Y) > > *always* results in Z being a Pid So if calling g is an implied spawn, how do specify that you want spawn_link instead? From gordonguthrie@REDACTED Thu Oct 5 16:15:20 2006 From: gordonguthrie@REDACTED (Gordon Guthrie) Date: Thu, 5 Oct 2006 15:15:20 +0100 (BST) Subject: [erlang-questions] Erlang on Google Code Search Message-ID: <42681.194.72.110.12.1160057720.squirrel@backawinner.gg> Folks Seeing as Google has just lauchned its new code search facility I thought I would give all things Erlang a spin... http://www.google.com/codesearch Lots of things get found easy-osey: * the main OTP releases * the jungerl * yaws * tsung * the dialyzer I get bored quick :( You may want to look for your own repositories and suggest them to Google if they are not there: http://www.google.com/codesearch/addcode Toodle-Pip! Gordon From thomasl_erlang@REDACTED Thu Oct 5 16:47:14 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 5 Oct 2006 07:47:14 -0700 (PDT) Subject: [erlang-questions] Process declarations In-Reply-To: <4524C943.5080201@ericsson.com> Message-ID: <20061005144714.18335.qmail@web38803.mail.mud.yahoo.com> --- Bengt Kleberg wrote: > you have yourself already shown how to never export > functions known to > be targets of spawns. i only use spawn/1,2, > considering the older > versions (/3,4) as deprecated. Are the spawn(fun() -> ... end) functions safe for code change? Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From yarivvv@REDACTED Thu Oct 5 17:03:59 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 5 Oct 2006 11:03:59 -0400 Subject: [erlang-questions] Erlang on Google Code Search In-Reply-To: <42681.194.72.110.12.1160057720.squirrel@backawinner.gg> References: <42681.194.72.110.12.1160057720.squirrel@backawinner.gg> Message-ID: <17244f480610050803w2590d849heb1f8cf8ee406ef0@mail.gmail.com> Every Erlang project that's hosted on Google Code is automatically indexed. Some examples: ErlyDB, Smerl, ErlSQL, Revamed MySQL Driver :) Yariv On 10/5/06, Gordon Guthrie wrote: > Folks > > Seeing as Google has just lauchned its new code search facility I thought > I would give all things Erlang a spin... > > http://www.google.com/codesearch > > Lots of things get found easy-osey: > * the main OTP releases > * the jungerl > * yaws > * tsung > * the dialyzer > > I get bored quick :( > > You may want to look for your own repositories and suggest them to Google > if they are not there: > > http://www.google.com/codesearch/addcode > > Toodle-Pip! > > Gordon > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From richardc@REDACTED Thu Oct 5 17:32:43 2006 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 05 Oct 2006 17:32:43 +0200 Subject: [erlang-questions] Process declarations In-Reply-To: <20061005144714.18335.qmail@web38803.mail.mud.yahoo.com> References: <20061005144714.18335.qmail@web38803.mail.mud.yahoo.com> Message-ID: <4525259B.4020700@it.uu.se> Thomas Lindgren wrote: > Are the spawn(fun() -> ... end) functions safe for > code change? (That might have been a rhetorical question, but I think its worthwhile to try to dispel some of the FUD around spawn and funs.) As long as you use them like that (with the fun written explicitly inline, or at least being created in the same module as the spawn), and as long as the fun-body quickly does a *tail call* so that no stack references point back to the fun, then the process is *not* sensitive to code change (of the module containing the fun). Writing a process like this, however, would be bad for you: spawn(fun()-> m1:main(), m2:say_goodbye() end) presuming the process will spend most of its time in main(), there will be a reference to the code of the fun on the process stack until it returns from main() and enters say_goodbye(). Even if the other functions reside in separate modules, updating the code that contains this fun will cause the process to die at the second code change when the original code is forced out of the system. *But*, that is a basic rule for writing code for long-running processes: when they enter the code for the main loop (or state machine), they should not have return pointers to other modules on their call stack. The following would be the same kind of mistake as the fun above: %% in module m0 start() -> spawn(m1, p, []). %% in module m1 p() -> m2:main(), m3:say_goodbye(). because the process would be sensitive to updates of m1, even though it spends almost all of its lifetime in m2 and m3. If you do something like this: run(F) -> spawn(F). where F might come from some external source, then of course the fun F might be dead already when you try to do the spawn - but that is no different from this kind of code: run(F) -> F(). If you need to store funs for some time (so that code change might happen meanwhile), then use the form "fun m:f/n", which is not sensitive to code changes, and has no problem with being passed from one node to another. What I'm trying to say is basically: don't be afraid of funs - they are not the problem. Engage brain before writing process code. /Richard From bjarne@REDACTED Thu Oct 5 17:37:22 2006 From: bjarne@REDACTED (=?iso-8859-1?Q?Bjarne_D=E4cker?=) Date: Thu, 5 Oct 2006 17:37:22 +0200 Subject: [erlang-questions] ACM SIGPLAN Erlang Workshop References: <21D61D04-1218-4B8D-994D-36E27593C813@process-one.net> Message-ID: <002e01c6e895$78e48090$2c2069d4@Dell> Dear all, The overhead slides from most of the talks are now available at the workshop website http://www.erlang.se/workshop/2006/ plus some photos to show what we were really up to. Best wishes Bjarne D?cker From ok@REDACTED Fri Oct 6 00:14:04 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 6 Oct 2006 11:14:04 +1300 (NZDT) Subject: [erlang-questions] Bug ?! Message-ID: <200610052214.k95ME4tB038375@atlas.otago.ac.nz> I wrote: > It's just that I have painful memories of ",.." in DEC-10 Prolog. Richard Carlsson asked: Care to elaborate? (I've been fiddling with list syntax variations, and I was thinking that "[x,y,..]" would be an improvement on "[x,y|_]", on several levels: less prone to undetected typo mistakes, easier to write, and easier to read.) Problem 1: is ,.. one token or two? (a) if you make it one token, then you have all sorts of problems: (1) ,.. is one token but in [.,.,.] ,. is two tokens, and in [...,...,...] ,... is two tokens again, and of course ,.2 had better be comma nought-point-two. (2) careful writers who put spaces after commas want to put a space after this one, [a, b, .. c] (b) if you make it two tokens, then you hve other problems: (1) if you can have a space there, why not a newline? why not a comment? So X = [1, 2, 3, % this can go on for some time .. L] (2) you have a token which would otherwise belong to an established class of tokens (including +, ++, .+, --, -, .-, ..., ...., ....) but which can only occur in one place and then doesn't mean what they do. Problem 2: ,.. just plain doesn't work the way people expect. They expect to write [..,X,Y] = L % oops, only allowed at end [X,Y,..] = L % oops, something must follow .. [X,Y..Z] = L % oops, a comma must precede .. [X,Y,..,Z] = L % oops, a comma may not follow .. [X,Y,..Z] = L % !!OOPS!! I was expecting Z to be the % last element of L, but it's a tail! In fact, for someone fluent in Latin-based writing systems that make use of ellipses, ,.. is appallingly HARD to get right. In particular, your [x,y,..] is one of the cases that wasn't allowed, any more than [x,y|_] was allowed. When ,.. was removed from Prolog, no-one was sorry to see it go. Given that . has so many other uses, I would expect that ,.. would be MORE prone to mistakes. Given the conflicts between ,.. and common practice in natural language, and the absence of such conflicts between | and natural language, I would expect ,.. to be HARDER to read. There's no enemy so dangerous as a false friend. From Bob.Cowdery@REDACTED Fri Oct 6 09:24:48 2006 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Fri, 6 Oct 2006 08:24:48 +0100 Subject: [erlang-questions] Question about potential application Message-ID: <3A76756EED583B43A4AD704E29CCD079741183@mail.aprsmartlogik.com> Rich Thanks for responding. I have since discovered we need to cater for very large documents (100MB+) even though the majority will be very much smaller. I am considering a shared memory solution where the message is effectively in shared memory and a reference is passed so the next process in line can attach. If it needs to go across a machine boundary then its only one transfer. If anybody knows any reason why this might be problematical I would appreciate hearing about it. Bob -----Original Message----- From: RCB [mailto:rcbeerman@REDACTED] Sent: Wed 04/10/2006 16:55 To: Bob Cowdery Cc: Subject: Re: [erlang-questions] Question about potential application Bob, I wrote a commercial application in Erlang that does something similar. Instead of using the ! operator to transport large quantities of data between nodes, I chose to use gen_tcp calls directly. I did this mostly because I understood the performance characteristics of gen_tcp under heavy load. It works very well, btw. Let me know if you have specific implementation questions. Rich On 10/4/06, Bob Cowdery wrote: Hi I am considereing Erlang as a bus to connect a pipeline process that performs certain work on documents that pass down the pipeline. There will be many stages in the pipeline all of which need to be scalable. Much of the real work will need to be carried out by existing C++ code at least in the near future. I can envisage a network of nodes that use C-drivers.Each node could instantiate multiple drivers as required and the node could be duplicated for scaling and resiliance. So far, so good. My question is about the data that passes through the workflow. The data is unstructured (documents) or semi-structured (XML at present) and can be large, lets say up to 100KB. Is it sensible to ship that data over Erlang end-to-end, does anybody do similar things. Other possibilities are to manage the data separately within or outside of Erlang and pass references only.I feel the first way is somewhat cleaner and without potential bottlenecks but the data size and transforms between the! C and Erlang world worry me. Any thoughts appreciated. Bob _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions -- Rich Beerman Cupertino, California mobile: 408/221-2444 fax: 408/255-7944 From richardc@REDACTED Fri Oct 6 11:22:44 2006 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 06 Oct 2006 11:22:44 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <200610052214.k95ME4tB038375@atlas.otago.ac.nz> References: <200610052214.k95ME4tB038375@atlas.otago.ac.nz> Message-ID: <45262064.1070703@it.uu.se> Richard A. O'Keefe wrote: > Problem 1: is ,.. one token or two? > (a) if you make it one token, then you have all sorts of problems: > (1) ,.. is one token but in [.,.,.] ,. is two tokens, and in > [...,...,...] ,... is two tokens again, and of course ,.2 had > better be comma nought-point-two. > (2) careful writers who put spaces after commas want to put a space > after this one, [a, b, .. c] Of course. My intention was to make '..' one token. Not that I think this should be added to Erlang, mind you - I was just experimenting with language design. (Side note: in Erlang, a float cannot be written '.2' - it must be '0.2'.) > (b) if you make it two tokens, then you hve other problems: > (1) if you can have a space there, why not a newline? why not a comment? > So X = [1, 2, 3, > % this can go on for some time > .. L] Sure. But that is not very different from normal Prolog/Erlang syntax: X = [1, 2, 3 % this can go on for some time |L] (that there is no comma after the '3' is not much of a visual cue in a larger chunk of code). If the |-syntax is not a problem, I don't see why the ..-syntax should be one. > (2) you have a token which would otherwise belong to an established > class of tokens (including +, ++, .+, --, -, .-, ..., ...., ....) > but which can only occur in one place and then doesn't mean what > they do. I'm not sure I follow you here. > Problem 2: ,.. just plain doesn't work the way people expect. > They expect to write > [..,X,Y] = L % oops, only allowed at end > [X,Y,..] = L % oops, something must follow .. > [X,Y..Z] = L % oops, a comma must precede .. > [X,Y,..,Z] = L % oops, a comma may not follow .. > [X,Y,..Z] = L % !!OOPS!! I was expecting Z to be the > % last element of L, but it's a tail! > > In fact, for someone fluent in Latin-based writing systems that make > use of ellipses, ,.. is appallingly HARD to get right. In particular, > your [x,y,..] is one of the cases that wasn't allowed, any more than > [x,y|_] was allowed. > > When ,.. was removed from Prolog, no-one was sorry to see it go. It seems that they were trying to do too much. As you noted, the variant that I suggested was the only one that they did _not_ implement. But let's reverse the situation: _only_ the following forms should be allowed: [..], [x,..], [x,y,..], and so on. It should be simple for people to remember that they cannot expect this to work except in a tail position. (At least as easy to remember as, say, that n in n+k must be >0, and that e.g. n*n+k is not allowed but c*n+k is.) > Given that . has so many other uses, I would expect > that ,.. would be MORE prone to mistakes. The trouble with the |-syntax is that it only takes a single keystroke to change the meaning of the constructed data, and once it has happened, it is pretty hard to notice that a ',' somewhere should really be a '|'. (I have seen this kind of bug survive for years in production code.) > Given the conflicts between ,.. and common practice in natural language, > and the absence of such conflicts between | and natural language, > I would expect ,.. to be HARDER to read. Actually, I find it quite visible. I have experimented with rewriting largish chunks of existing code, and overall, I think that e.g. f([{x,42},{y,17},..])-> has a more distinct visual signature than the corresponding Erlang syntax f([{x,42},{y,17}|_])->. (Another thing entirely is of course that I have to press shift to produce both the | and the _ - and none of them stay in the same place when I switch keyboard layouts.) /Richard From dmitriid@REDACTED Fri Oct 6 13:08:42 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Fri, 6 Oct 2006 14:08:42 +0300 Subject: [erlang-questions] Maven + Erlang + Erlide Tutorials Message-ID: I've added the following articles on Trapexit wiki: Tutorial on how to install Maven, erlang-plugin and make it work http://wiki.trapexit.org/index.php/Maven_and_Erlang Tutorial on how to make Maven and Erlide work together (note that you need Erlide version 0.3.26 or higher to do this - thanks, Vlad!): http://wiki.trapexit.org/index.php/Maven_and_Erlide -------------- next part -------------- An HTML attachment was scrubbed... URL: From ft@REDACTED Fri Oct 6 13:44:21 2006 From: ft@REDACTED (Fredrik Thulin) Date: Fri, 6 Oct 2006 13:44:21 +0200 Subject: [erlang-questions] compiling erlang in cygwin Message-ID: <02b701c6e93c$c3fc28b0$0b7ba8c0@it.su.se> Hi I'm currently testing Windows as my desktop operating system, after having used Linux for that purpose for ten years. While having a Start button is very funny, it isn't too amusing if I can't bring some old habits along =). I want to continue developing in Erlang in a console window (with tabs, found it - http://console.sf.net), using Emacs (not XEmacs). I've installed Cygwin and lots of things to make my new desktop feel almost like it should, but I have a problem - I can't compile Erlang/OTP R11B-1 in Cygwin, and I don't like werl.exe. Does anyone know how to make it work? It seems that the problem is with inet_gethost not being compiled correctly. I have tried plain ./configure as well as ./configure --target=win32. Thanks for any advice /Fredrik From shelton.ms@REDACTED Fri Oct 6 13:44:26 2006 From: shelton.ms@REDACTED (Shelton Tang) Date: Fri, 6 Oct 2006 19:44:26 +0800 Subject: [erlang-questions] Why does the restart strategy "{one_for_one, 10, 10}" still kill my application? In-Reply-To: References: <27ccae8e0610030859i717becf4x6dab71487514b268@mail.gmail.com> <4523A02A.4030307@erix.ericsson.se> <27ccae8e0610041033t40ddc640n9cb5682cd21b304e@mail.gmail.com> Message-ID: <27ccae8e0610060444p2fc277a7s7254f54ad0071366@mail.gmail.com> get it. I'm thinkg how to change the code and test it again. thank you. On 10/5/06, Taavi Talvik wrote: > > On Oct 4, 2006, at 8:33 PM, Shelton Tang wrote: > > > Hi Gunilla, > > > > Thank you for the info. When I start erl with "erl -boot start_sasl", > > the last outuput shows the sup shutdown is because of one child > > shutdown. The child calls gen_tcp:listen/2 but got eaddrnotavail since > > i got a wrong IP from inet:getiflist. > > > > so my question is, do I need to trap_exit in my supervisor? > > Your problem seems to be in application startup phase. > > As principle: > child init function should succeed and real work > should be done in server "runtime" logic > > this allows supervisory hierarchy started and > errors are later handled as normal runtime errors > > supervisor assumes, that initialization is lightweight > operation - something like passing parameters > > best regards, > taavi > > From vladdu55@REDACTED Fri Oct 6 14:00:25 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 6 Oct 2006 14:00:25 +0200 Subject: [erlang-questions] compiling erlang in cygwin In-Reply-To: <02b701c6e93c$c3fc28b0$0b7ba8c0@it.su.se> References: <02b701c6e93c$c3fc28b0$0b7ba8c0@it.su.se> Message-ID: <95be1d3b0610060500l2af15d2bhfac6578fca0aa762@mail.gmail.com> On 10/6/06, Fredrik Thulin wrote: > I'm currently testing Windows as my desktop operating system, after > having used Linux for that purpose for ten years. Hi, I only have a workaround: use the precompiled Windows version - there's an erl.exe too :-) If you have patched the code, then another workaround is to compile as recommended, with VisualC... not a fun experience, I agree. regards, Vlad From ft@REDACTED Fri Oct 6 14:08:09 2006 From: ft@REDACTED (Fredrik Thulin) Date: Fri, 6 Oct 2006 14:08:09 +0200 Subject: [erlang-questions] compiling erlang in cygwin References: <02b701c6e93c$c3fc28b0$0b7ba8c0@it.su.se> <95be1d3b0610060500l2af15d2bhfac6578fca0aa762@mail.gmail.com> Message-ID: <030901c6e940$198122b0$0b7ba8c0@it.su.se> Vlad Dumitrescu wrote: > On 10/6/06, Fredrik Thulin wrote: >> I'm currently testing Windows as my desktop operating system, after >> having used Linux for that purpose for ten years. > > Hi, > > I only have a workaround: use the precompiled Windows version - > there's an erl.exe too :-) Hey, you're right! I hadn't noticed. It is clearly friday. I'm guessing it isn't compiled with readline - it behaves rather strange when I press enter : $ /cygdrive/c/Program\ Files/erl5.5.1/bin/erl.exe Eshell V5.5.1 (abort with ^G) 1> 1.1 . 1.10000 2> Thanks! /Fredrik From vladdu55@REDACTED Fri Oct 6 14:11:50 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 6 Oct 2006 14:11:50 +0200 Subject: [erlang-questions] compiling erlang in cygwin In-Reply-To: <030901c6e940$198122b0$0b7ba8c0@it.su.se> References: <02b701c6e93c$c3fc28b0$0b7ba8c0@it.su.se> <95be1d3b0610060500l2af15d2bhfac6578fca0aa762@mail.gmail.com> <030901c6e940$198122b0$0b7ba8c0@it.su.se> Message-ID: <95be1d3b0610060511xb5ca9cdx76c4be153056e4c2@mail.gmail.com> On 10/6/06, Fredrik Thulin wrote: > Vlad Dumitrescu wrote: > > I only have a workaround: use the precompiled Windows version - > > there's an erl.exe too :-) > Hey, you're right! I hadn't noticed. It is clearly friday. Yes, the erl.exe in Windows isn't too user friendly. On the other hand, if you're going to use emacs, then it's not a big issue. regards, Vlad From erlang@REDACTED Fri Oct 6 14:36:40 2006 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 6 Oct 2006 14:36:40 +0200 Subject: [erlang-questions] bug in file:pread Message-ID: <9b08084c0610060536nf4daf66oe0a5cb4e03a60ae1@mail.gmail.com> pread(Handle, {eof,-N}, N) appears to be broken or have I misunderstood something? /Joe -module(bug1). -compile(export_all). bug() -> File = "test.bin", file:write_file(File, [<<"123456789">>]), {ok, FileHandle} = file:open(File, [binary,raw,read]), X1 = file:pread(FileHandle, 1, 2), X2 = file:position(FileHandle, {eof,-4}), X3 = file:pread(FileHandle, {eof,-4}, 3), io:format("X1=~p~nX2=~p~nX3=~p~n~n",[X1,X2,X3]), file:close(FileHandle). 1> c(bug1). {ok,bug1} 2> bug1:bug(). X1={ok,<<"23">>} X2={ok,5} X3={error,einval} ok -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Fri Oct 6 15:22:24 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Fri, 06 Oct 2006 15:22:24 +0200 Subject: [erlang-questions] bug in file:pread In-Reply-To: <9b08084c0610060536nf4daf66oe0a5cb4e03a60ae1@mail.gmail.com> References: <9b08084c0610060536nf4daf66oe0a5cb4e03a60ae1@mail.gmail.com> Message-ID: <45265890.7090301@ericsson.com> On 2006-10-06 14:36, Joe Armstrong wrote: > pread(Handle, {eof,-N}, N) appears to be broken or have I misunderstood > something? > > /Joe > > -module(bug1). > > -compile(export_all). > > bug() -> > File = "test.bin", > file:write_file(File, [<<"123456789">>]), > {ok, FileHandle} = file:open(File, [binary,raw,read]), i think the following extract from the manual is of importance: ''If IoDevice has been opened in raw mode, some restrictions apply: Location is only allowed to be an integer;'' bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From Bob.Cowdery@REDACTED Fri Oct 6 15:25:06 2006 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Fri, 6 Oct 2006 14:25:06 +0100 Subject: [erlang-questions] {error, no_driver_init} Message-ID: <3A76756EED583B43A4AD704E29CCD079741185@mail.aprsmartlogik.com> Hi I am trying to get a port driver to work on Windows. This is just the example in the tutorial . I can get it going on Linux but I get the no_driver_init error on Windows. I have built this with Visual Studio Express, so it's VC8. I am wondering if Erlang is built with VC6 and therefore the library is incompatible. Could this be the case? Other than that maybe its incorrect flag settings. I have set it to build C but don't know what else might be important. Any help appreciated. Thanks Bob From pbaur@REDACTED Fri Oct 6 19:45:11 2006 From: pbaur@REDACTED (Patrick Baur) Date: Fri, 6 Oct 2006 19:45:11 +0200 Subject: [erlang-questions] Porting erl-interface Message-ID: <1AA5D8A8-ECE2-48BA-A5B6-64EFDBDCDBCF@dplanet.ch> Hi! I'd like to implement an Erlang C node under an exoitc OS (zOS aka MVS, to be precise). While it sure would be nice to have Erlang there, it's not necessary, and porting the erl-interface libraries would be enough. My question is, how much of "core" Erlang stuff is needed (included) in erl-interface? From a very quick scan of the sources in lib/erl-interface it looks like it is standalone, i.e. does not need other parts of Erlang. Is my impression correct? If not, what else is needed? Regards, Patrick. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2415 bytes Desc: not available URL: From ncharpentier@REDACTED Fri Oct 6 20:39:17 2006 From: ncharpentier@REDACTED (Nicolas Charpentier) Date: Fri, 06 Oct 2006 20:39:17 +0200 Subject: [erlang-questions] {error, no_driver_init} In-Reply-To: <3A76756EED583B43A4AD704E29CCD079741185@mail.aprsmartlogik.com> References: <3A76756EED583B43A4AD704E29CCD079741185@mail.aprsmartlogik.com> Message-ID: <4526A2D5.6030007@free.fr> Bob Cowdery a ?crit : > > Hi > > > > I am trying to get a port driver to work on Windows. This is just the example in the tutorial . I can get it going on Linux but I get the no_driver_init error on Windows. I have built this with Visual Studio Express, so it's VC8. I am wondering if Erlang is built with VC6 and therefore the library is incompatible. Could this be the case? Other than that maybe its incorrect flag settings. I have set it to build C but don't know what else might be important. > > > > Any help appreciated. > > > > Thanks > > Bob Hi, There is long time I didn't play with drivers but I remember this kind of trouble. Check that your driver is exporting the driver_init() function. (You can easily check this with DependencyWalker [1] ). I also remember that the sample didn't work with me I had to do as follow: ErlDrvEntry messenger_driver_entry = { NULL, /* F_PTR init, N/A */ messenger_driver_start, messenger_driver_stop, messenger_driver_output, NULL, NULL, "messenger_driver", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; extern "C" { DRIVER_INIT (messenger_driver) { return &messenger_driver_entry; } } Regards, Nicolas [1] DependencyWalker : http://www.dependencywalker.com/ From cv.erl.q@REDACTED Fri Oct 6 22:12:21 2006 From: cv.erl.q@REDACTED (Costel Vrinceanu) Date: Fri, 6 Oct 2006 13:12:21 -0700 Subject: [erlang-questions] Multiple modules In-Reply-To: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> Message-ID: <369d63980610061312k1d26b5e6xf87fdeaab48823c4@mail.gmail.com> If we separate files from modules/make them orthogonal, then it should work both ways: N modules in 1 file or 1 module in N files or N modules in M files On 10/5/06, Joe Armstrong wrote: > Modules ... thoughts > > Any opinion about and "endmod." declaration: > > Proposal > > The file myapp.erl might contain > > -module(foo). > .... > .... > -endmod. > > -module(bar). > ... > ... > -endmod. > > Compiling this produces > > myapp.beam > > loading myapp.beam loads all the code in foo, bar, ..., this > has several advantages: > > 1) distribute only one file > 2) modules in file cannot live a life of their own and become > separated > 3) code loading is faster > > /Joe > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > From robert.virding@REDACTED Fri Oct 6 23:35:00 2006 From: robert.virding@REDACTED (Robert Virding) Date: Fri, 06 Oct 2006 23:35:00 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <45235B5B.4080904@ericsson.com> References: <20061003045944.5F6DF5A1FC@mail.erlangsystems.com> <4522CA70.2030003@telia.com> <45235B5B.4080904@ericsson.com> Message-ID: <4526CC04.6020706@telia.com> Mats Cronqvist wrote: > Robert Virding wrote: > >> I believe it is important to keep things clean, consistent and elegant >> otherwise you will end up with a language built on exceptions. > > > aha! so that's why this works? > > -define(foo,bla. > go()->?foo. As I wrote in the not too distant past here in erlang-questions: macros were a joke! Although you may need a slightly warped sense of humour to appreciate it. > more to the point, i still fail to see how this; > > receive > X#r.a -> do_a(); > > is more unclean, inconsistent and inelegant than this; > > XRA = X#r.a, > receive > XRA -> do_a(); If X#r.a is a valid pattern then what does this mean? f(X#r.a) -> {yes,X}. It's a valid pattern, so what does it mean? > but hey, i'll take richard & richard's word for it. You don't have to take Richard's word for it, but you should really think through your suggestions properly to see their full implications. Not just the immediate case in which you are interested. We don't need more ugly hacks in there! And I personally think that the following way of writing it is a much cleaner and more elegant Erlang: receive XRA when XRA == X#r.a -> do_a(); As Richard pointed out. Robert From ycaouette@REDACTED Sat Oct 7 06:04:52 2006 From: ycaouette@REDACTED (Yanni Caouette) Date: Sat, 7 Oct 2006 00:04:52 -0400 Subject: [erlang-questions] EUnit 2.0 alpha (compile issue) Message-ID: I can't seem to find the dedicated forum for EUnit. My apology if I am posting at the wrong place. I grabbed eunit from svn (http://svn.process-one.net/contribs/trunk/eunit). My module with unit tests: % File: test.erl -module(test). -compile(export_all). -include_lib("eunit/include/eunit.hrl"). my_1st_test() -> ok. I tried to compile in console and got the following error. > c(test). ./test.erl:none: error in parse transform 'eunit_autoexport': {undef, [{eunit_autoexport, parse_transform, [[{attribute, 1, file, {"./test.erl",1}}, ...... I understand eunit 2.0 is still alpha, but I'd really appreciate if I could use some help to get me going. Thanks, Yanni From tty.erlang@REDACTED Sat Oct 7 06:43:26 2006 From: tty.erlang@REDACTED (t ty) Date: Sat, 7 Oct 2006 00:43:26 -0400 Subject: [erlang-questions] EUnit 2.0 alpha (compile issue) In-Reply-To: References: Message-ID: <290b3ba10610062143w59f2327dkffab7483ebea2a1c@mail.gmail.com> The error occured because you do not have the path to the eunit_autoexport beam files. >From the command line run: erl -pa You can test it by doing a l(eunit_autoexport). {module,eunit_autoexport) >From this point your compile would work. t From ycaouette@REDACTED Sat Oct 7 11:23:41 2006 From: ycaouette@REDACTED (Yanni Caouette) Date: Sat, 7 Oct 2006 05:23:41 -0400 Subject: [erlang-questions] EUnit 2.0 alpha (compile issue) In-Reply-To: <290b3ba10610062143w59f2327dkffab7483ebea2a1c@mail.gmail.com> References: <290b3ba10610062143w59f2327dkffab7483ebea2a1c@mail.gmail.com> Message-ID: Thanks for the tip. That's exactly what I was missing. Yanni On 10/7/06, t ty wrote: > The error occured because you do not have the path to the > eunit_autoexport beam files. > > From the command line run: > > erl -pa > > You can test it by doing a > > l(eunit_autoexport). > {module,eunit_autoexport) > > From this point your compile would work. > > t > From surindar.shanthi@REDACTED Sat Oct 7 11:41:03 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Sat, 7 Oct 2006 15:11:03 +0530 Subject: [erlang-questions] Running a shell automatically Message-ID: <42ea5fb60610070241hc41a261xf9d0632f864c72@mail.gmail.com> Dear all, I have two applications both are built in erlang. But both these applications need to communicate via TCP/IP Communication. Now i used to run both the applications separately. (After running the server application, i will run the client application from another shell). Is it possible to run the second application ( Client shell) by running only the server application (without starting Client shell explicitly). Please guide me if this facility available in Erlang Thanks in advance. -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Sat Oct 7 14:36:07 2006 From: serge@REDACTED (Serge Aleynikov) Date: Sat, 07 Oct 2006 08:36:07 -0400 Subject: [erlang-questions] Running a shell automatically In-Reply-To: <42ea5fb60610070241hc41a261xf9d0632f864c72@mail.gmail.com> References: <42ea5fb60610070241hc41a261xf9d0632f864c72@mail.gmail.com> Message-ID: <45279F37.7080608@hq.idt.net> You can look into the slave module: http://www.erlang.org/doc/doc-5.5.1/lib/stdlib-1.14.1/doc/html/slave.html It allows to start slave nodes (via rsh, ssh, etc) controlled by the master node. Serge Surindar Sivanesan wrote: > Dear all, > > I have two applications both are built in erlang. > But both these applications need to communicate via TCP/IP Communication. > Now i used to run both the applications separately. (After running the > server application, i will run the client application from another shell). > Is it possible to run the second application ( Client shell) by running > only > the server application (without starting Client shell explicitly). > Please guide me if this facility available in Erlang > Thanks in advance. > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From ke.han@REDACTED Sat Oct 7 14:54:08 2006 From: ke.han@REDACTED (ke han) Date: Sat, 7 Oct 2006 20:54:08 +0800 Subject: [erlang-questions] multi-core scheduler affinity Message-ID: <9BA8AA10-0FA8-4B9F-B4EB-49467AFA8E74@redstarling.com> I have a yaws app and also another app which I would like to run in the same erlang vm. I have 4 CPU cores in the server and not much else running so I could give the erlang VM 2 or more scheduler processes. I would like s to enable the yaws app to have its processes managed mostly through one scheduler and the other supervised group of processes by another. I don't need this to be strict, but am guessing the overall performance of each app would be best if the schedulers were somehow kept separate. The nature of the app is such that the yaws app can degrade if load gets high but the other app should not degrade due to spikes in the yaws HTTP requests. I can always run this as two separate erlang VMs, but am checking to see if I am missing something. thanks, ke han From surindar.shanthi@REDACTED Sat Oct 7 15:08:36 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Sat, 7 Oct 2006 18:38:36 +0530 Subject: [erlang-questions] Running a shell automatically In-Reply-To: <45279F37.7080608@hq.idt.net> References: <42ea5fb60610070241hc41a261xf9d0632f864c72@mail.gmail.com> <45279F37.7080608@hq.idt.net> Message-ID: <42ea5fb60610070608k3af74d39tb7705f7da9a0c190@mail.gmail.com> Dear Serge, Thaks for your valid information. I will work it out. On 10/7/06, Serge Aleynikov wrote: > > You can look into the slave module: > > http://www.erlang.org/doc/doc-5.5.1/lib/stdlib-1.14.1/doc/html/slave.html > > It allows to start slave nodes (via rsh, ssh, etc) controlled by the > master node. > > Serge > > Surindar Sivanesan wrote: > > Dear all, > > > > I have two applications both are built in erlang. > > But both these applications need to communicate via TCP/IP > Communication. > > Now i used to run both the applications separately. (After running the > > server application, i will run the client application from another > shell). > > Is it possible to run the second application ( Client shell) by running > > only > > the server application (without starting Client shell explicitly). > > Please guide me if this facility available in Erlang > > Thanks in advance. > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From ycaouette@REDACTED Sat Oct 7 22:38:50 2006 From: ycaouette@REDACTED (Yanni Caouette) Date: Sat, 7 Oct 2006 16:38:50 -0400 Subject: [erlang-questions] erlrt and eunit Message-ID: Wonderfing if anyone has experience with running eunit from an erlrt install. I downloaded erlrt from http://erlrt.process-one.net. I installed eunit through erlrt. A success. 1> erlrt:install(eunit). + compiler md5=<<117,247,31,20,59,49,187,223,230,188,28,31,36,37,173,248>> + eunit md5=<<116,109,241,222,72,56,212,43,38,81,146,46,71,211,144,94>> ok Then I tried to compile a module. No problem. 2> c(mytest). {ok,mytest} When running the test, I was encountered with this error. 3> mytest:test(). =ERROR REPORT==== 7-Oct-2006::16:30:24 === {undef,[{test,test,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} It looked as if the function mytest:test() is not auto exported by eunit. Any idea? Yanni p.s. Coming off test-driven projects which makes heavy uses of install systems (ruby gem/python easyinstall), I confess I am a bit obsessed with having a reliable unit testing framework as well as an easy-to-use package management system. I am very new to Erlang and still trying to find my way. I would really appreciate your advice. From richardc@REDACTED Sat Oct 7 23:14:27 2006 From: richardc@REDACTED (Richard Carlsson) Date: Sat, 07 Oct 2006 23:14:27 +0200 Subject: [erlang-questions] erlrt and eunit In-Reply-To: References: Message-ID: <452818B3.1050506@it.uu.se> Yanni Caouette wrote: > Then I tried to compile a module. No problem. > 2> c(mytest). > {ok,mytest} > > When running the test, I was encountered with this error. > 3> mytest:test(). > =ERROR REPORT==== 7-Oct-2006::16:30:24 === > {undef,[{test,test,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > It looked as if the function mytest:test() is not auto exported by > eunit. Any idea? Something is odd with that report: it says that "test:test()" is undefined, but you called "mytest:test()". Also, I don't know what version of eunit that you get if you use erlrt, so it's a bit hard to know what could be wrong. /Richard From ycaouette@REDACTED Sat Oct 7 23:36:24 2006 From: ycaouette@REDACTED (Yanni Caouette) Date: Sat, 7 Oct 2006 17:36:24 -0400 Subject: [erlang-questions] erlrt and eunit In-Reply-To: <452818B3.1050506@it.uu.se> References: <452818B3.1050506@it.uu.se> Message-ID: My bad! I have mytest.erl and test.erl, almost same except different module names. When editing the post, I used the error report for test.erl. Sorry for the confusion. I installed eunit-2.0 using erlrt. I am able to see it under erlrt/erlang/lib. (Starting with the minimum install, erlrt also picked up compiler-4.3.12, which I assume was due to dependency.) Here is the list of files in erlrt/erlang/lib/eunit-2.0: eunit-2.0/ eunit-2.0/include eunit-2.0/include/eunit_test.hrl eunit-2.0/include/eunit_off.hrl eunit-2.0/include/eunit_auto.hrl eunit-2.0/include/eunit.hrl eunit-2.0/ebin eunit-2.0/ebin/eunit_test.beam eunit-2.0/ebin/code_monitor.beam eunit-2.0/ebin/eunit_autoexport.beam eunit-2.0/ebin/file_monitor.beam eunit-2.0/ebin/eunit_tty.beam eunit-2.0/ebin/eunit_proc.beam eunit-2.0/ebin/eunit_data.beam eunit-2.0/ebin/eunit_lib.beam eunit-2.0/ebin/autoload.beam eunit-2.0/ebin/eunit_server.beam eunit-2.0/ebin/eunit_serial.beam eunit-2.0/src eunit-2.0/src/test.erl eunit-2.0/src/eunit_tty.erl eunit-2.0/src/eunit_data.erl eunit-2.0/src/eunit_test.erl eunit-2.0/src/eunit_internal.hrl eunit-2.0/src/eunit_server.erl eunit-2.0/src/eunit.erl eunit-2.0/src/eunit_lib.erl eunit-2.0/src/code_monitor.erl eunit-2.0/src/eunit_serial.erl eunit-2.0/src/autoload.erl eunit-2.0/src/eunit_proc.erl eunit-2.0/src/Makefile eunit-2.0/src/file_monitor.erl eunit-2.0/src/eunit_autoexport.erl eunit-2.0/doc eunit-2.0/doc/NOTES.txt eunit-2.0/doc/overview.edoc Here is mytest.erl. -module(mytest). -compile(export_all). -include_lib("eunit/include/eunit.hrl"). my1_test() -> ?assert(1 == 1). my2_test() -> ?assertNot(0 == 1). And here is the output. Erlang (BEAM) emulator version 5.4.13 [source] [hipe] [threads:0] Erlang/OTP R10B-10 linux-x86 stripped runtime environment Eshell V5.4.13 (abort with ^G) 1> c(mytest). {ok,mytest} 2> mytest:test(). =ERROR REPORT==== 7-Oct-2006::17:32:11 === Error in process <0.30.0> with exit value: {undef,[{mytest,test,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} ** exited: {undef,[{mytest,test,[]}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** Thanks for your help. Yanni On 10/7/06, Richard Carlsson wrote: > Yanni Caouette wrote: > > Then I tried to compile a module. No problem. > > 2> c(mytest). > > {ok,mytest} > > > > When running the test, I was encountered with this error. > > 3> mytest:test(). > > =ERROR REPORT==== 7-Oct-2006::16:30:24 === > > {undef,[{test,test,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > > > It looked as if the function mytest:test() is not auto exported by > > eunit. Any idea? > > Something is odd with that report: it says that "test:test()" is > undefined, but you called "mytest:test()". Also, I don't know what > version of eunit that you get if you use erlrt, so it's a bit hard to > know what could be wrong. > > /Richard > From olivier.sambourg@REDACTED Sat Oct 7 23:47:46 2006 From: olivier.sambourg@REDACTED (Olivier Sambourg) Date: Sat, 7 Oct 2006 23:47:46 +0200 Subject: [erlang-questions] erlrt and eunit In-Reply-To: References: <452818B3.1050506@it.uu.se> Message-ID: Hi, It ***may*** have to do with the order of your -compile and -include_lib directives (because of the preprocess treatment applied by EUnit) Can you try : -module(mytest). -include_lib("eunit/include/eunit.hrl"). -compile(export_all). -- Olivier On 10/7/06, Yanni Caouette wrote: > > My bad! I have mytest.erl and test.erl, almost same except different > module names. When editing the post, I used the error report for > test.erl. Sorry for the confusion. > > I installed eunit-2.0 using erlrt. I am able to see it under > erlrt/erlang/lib. (Starting with the minimum install, erlrt also > picked up compiler-4.3.12, which I assume was due to dependency.) > > Here is the list of files in erlrt/erlang/lib/eunit-2.0: > > eunit-2.0/ > eunit-2.0/include > eunit-2.0/include/eunit_test.hrl > eunit-2.0/include/eunit_off.hrl > eunit-2.0/include/eunit_auto.hrl > eunit-2.0/include/eunit.hrl > eunit-2.0/ebin > eunit-2.0/ebin/eunit_test.beam > eunit-2.0/ebin/code_monitor.beam > eunit-2.0/ebin/eunit_autoexport.beam > eunit-2.0/ebin/file_monitor.beam > eunit-2.0/ebin/eunit_tty.beam > eunit-2.0/ebin/eunit_proc.beam > eunit-2.0/ebin/eunit_data.beam > eunit-2.0/ebin/eunit_lib.beam > eunit-2.0/ebin/autoload.beam > eunit-2.0/ebin/eunit_server.beam > eunit-2.0/ebin/eunit_serial.beam > eunit-2.0/src > eunit-2.0/src/test.erl > eunit-2.0/src/eunit_tty.erl > eunit-2.0/src/eunit_data.erl > eunit-2.0/src/eunit_test.erl > eunit-2.0/src/eunit_internal.hrl > eunit-2.0/src/eunit_server.erl > eunit-2.0/src/eunit.erl > eunit-2.0/src/eunit_lib.erl > eunit-2.0/src/code_monitor.erl > eunit-2.0/src/eunit_serial.erl > eunit-2.0/src/autoload.erl > eunit-2.0/src/eunit_proc.erl > eunit-2.0/src/Makefile > eunit-2.0/src/file_monitor.erl > eunit-2.0/src/eunit_autoexport.erl > eunit-2.0/doc > eunit-2.0/doc/NOTES.txt > eunit-2.0/doc/overview.edoc > > Here is mytest.erl. > > -module(mytest). > -compile(export_all). > -include_lib("eunit/include/eunit.hrl"). > > my1_test() -> ?assert(1 == 1). > my2_test() -> ?assertNot(0 == 1). > > And here is the output. > > Erlang (BEAM) emulator version 5.4.13 [source] [hipe] [threads:0] > > Erlang/OTP R10B-10 linux-x86 stripped runtime environment > Eshell V5.4.13 (abort with ^G) > 1> c(mytest). > {ok,mytest} > 2> mytest:test(). > > =ERROR REPORT==== 7-Oct-2006::17:32:11 === > Error in process <0.30.0> with exit value: > > {undef,[{mytest,test,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > ** exited: {undef,[{mytest,test,[]}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > Thanks for your help. > > Yanni > > On 10/7/06, Richard Carlsson wrote: > > Yanni Caouette wrote: > > > Then I tried to compile a module. No problem. > > > 2> c(mytest). > > > {ok,mytest} > > > > > > When running the test, I was encountered with this error. > > > 3> mytest:test(). > > > =ERROR REPORT==== 7-Oct-2006::16:30:24 === > > > > {undef,[{test,test,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > > > > > It looked as if the function mytest:test() is not auto exported by > > > eunit. Any idea? > > > > Something is odd with that report: it says that "test:test()" is > > undefined, but you called "mytest:test()". Also, I don't know what > > version of eunit that you get if you use erlrt, so it's a bit hard to > > know what could be wrong. > > > > /Richard > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ycaouette@REDACTED Sun Oct 8 00:07:21 2006 From: ycaouette@REDACTED (Yanni Caouette) Date: Sat, 7 Oct 2006 18:07:21 -0400 Subject: [erlang-questions] erlrt and eunit In-Reply-To: References: <452818B3.1050506@it.uu.se> Message-ID: On 10/7/06, Olivier Sambourg wrote: > And if you try : > -module(mytest). > -export([]). > -include_lib("eunit/include/eunit.hrl"). Thanks. It did not help either. 1> c(mytest). ./mytest.erl:10: Warning: function my1_test/0 is unused ./mytest.erl:10: Warning: function my2_test/0 is unused {ok,mytest} 2> mytest:test(). =ERROR REPORT==== 7-Oct-2006::18:09:30 === Error in process <0.30.0> with exit value: {undef,[{mytest,test,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} From goertzen@REDACTED Sun Oct 8 01:11:35 2006 From: goertzen@REDACTED (Daniel Goertzen) Date: Sat, 07 Oct 2006 18:11:35 -0500 Subject: [erlang-questions] Multiple modules In-Reply-To: <369d63980610061312k1d26b5e6xf87fdeaab48823c4@mail.gmail.com> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> <369d63980610061312k1d26b5e6xf87fdeaab48823c4@mail.gmail.com> Message-ID: <45283427.6070001@ertw.com> That starts to strongly resemble the way C++ namespaces work. Using the mnesia app as an example, the app source files are well decomposed into their functional areas, for example: mnesia_subscr.erl, mnesia_controller.erl, mnesia_checkpoint.erl, etc. But the entire API for mnesia is really exported through the module "mnesia", and mnesia.erl contains lots of functions that just relay calls to other modules. Wouldn't it make more sense for each of the files (ex, mnesia_subscr.erl) to be able to directly export bits and pieces into the mnesia module/namespace? And this leads to the question of nested modules like C++ nested namespaces. I've found that nested namespaces in C++ have helped me keep names short and natural and remove concern over collisions. Consider this erlang example: Erlang makes me name stuff like this... myapp:foo_dostuff(...) myapp:bar_dostuff(...) When I'd really like to say it like this... myapp:foo:dostuff(...) myapp:bar:dostuff(...) Disclaimer: I've written large c++ programs, but not any large elrang programs yet. Please correct me if I've missed out on some erlang feature. Cheers, Dan. Costel Vrinceanu wrote: > If we separate files from modules/make them orthogonal, then it should > work both ways: > N modules in 1 file > or > 1 module in N files > or > N modules in M files > > On 10/5/06, Joe Armstrong wrote: > >> Modules ... thoughts >> >> Any opinion about and "endmod." declaration: >> >> Proposal >> >> The file myapp.erl might contain >> >> -module(foo). >> .... >> .... >> -endmod. >> >> -module(bar). >> ... >> ... >> -endmod. >> >> Compiling this produces >> >> myapp.beam >> >> loading myapp.beam loads all the code in foo, bar, ..., this >> has several advantages: >> >> 1) distribute only one file >> 2) modules in file cannot live a life of their own and become >> separated >> 3) code loading is faster >> >> /Joe >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> >> >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > From tty.erlang@REDACTED Sun Oct 8 04:43:42 2006 From: tty.erlang@REDACTED (t ty) Date: Sat, 7 Oct 2006 22:43:42 -0400 Subject: [erlang-questions] erlrt and eunit In-Reply-To: References: <452818B3.1050506@it.uu.se> Message-ID: <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> I was having problems, quite similar to your, on v5.4.10. The latest OTP version solved it. I'm not sure if its related but you could give a newer version a go. Granted I'm not sure if erlrt is using v5.5.1. t On 10/7/06, Yanni Caouette wrote: > On 10/7/06, Olivier Sambourg wrote: > > And if you try : > > -module(mytest). > > -export([]). > > -include_lib("eunit/include/eunit.hrl"). > > Thanks. It did not help either. > > 1> c(mytest). > ./mytest.erl:10: Warning: function my1_test/0 is unused > ./mytest.erl:10: Warning: function my2_test/0 is unused > {ok,mytest} > > 2> mytest:test(). > > =ERROR REPORT==== 7-Oct-2006::18:09:30 === > Error in process <0.30.0> with exit value: > {undef,[{mytest,test,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From ycaouette@REDACTED Sun Oct 8 07:33:52 2006 From: ycaouette@REDACTED (Yanni Caouette) Date: Sun, 8 Oct 2006 01:33:52 -0400 Subject: [erlang-questions] erlrt and eunit In-Reply-To: <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> References: <452818B3.1050506@it.uu.se> <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> Message-ID: Finally I was able to figure out what the problem was. It turns out eunit 2.0 installed from erlrt is not up to date! After I replace it with the latest in svn (http://svn.process-one.net/contribs/trunk/eunit), it worked. I should have checked that sooner. Thanks for all the replies. Yanni On 10/7/06, t ty wrote: > I was having problems, quite similar to your, on v5.4.10. The latest > OTP version solved it. I'm not sure if its related but you could give > a newer version a go. Granted I'm not sure if erlrt is using v5.5.1. > > t From datacompboy@REDACTED Sun Oct 8 09:03:38 2006 From: datacompboy@REDACTED (datacompboy) Date: Sun, 08 Oct 2006 08:03:38 +0100 Subject: [erlang-questions] CC: erl segmentation fault in http_base_64 References: Message-ID: <20061008070339.0E0F35A1F9@mail.erlangsystems.com> On http_base_64:decode("dGVzda==a"). erl dies with "Instruction at ... referenced memory at .... The memory could not be written" This happen at least on windows and linux platforms, R11B -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From christophe.romain@REDACTED Sun Oct 8 09:07:24 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Sun, 8 Oct 2006 09:07:24 +0200 Subject: [erlang-questions] erlrt and eunit In-Reply-To: <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> References: <452818B3.1050506@it.uu.se> <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> Message-ID: > Granted I'm not sure if erlrt is using v5.5.1. erlrt will not support 5.5 and is not maintained anymore. CEAN will. CEAN is comming really soon now, bringing all erlrt functionalities and much more with up to date packages. (actually 200 binary packages for 17 platforms). I'm late with CEAN and still need some time to validate few things. by now, erlrt packages may be out of date as eunit. From stevej@REDACTED Sun Oct 8 09:11:03 2006 From: stevej@REDACTED (Steve Jenson) Date: Sun, 8 Oct 2006 00:11:03 -0700 Subject: [erlang-questions] Solaris 10 equiv to kqueue or epoll? In-Reply-To: <2EF68AC7-ABB2-409C-A285-EDA664235F11@redstarling.com> References: <2EF68AC7-ABB2-409C-A285-EDA664235F11@redstarling.com> Message-ID: <81d74c280610080011r54725d22rc3f74148a670f1e@mail.gmail.com> Solaris 10 has Event Ports but I don't think Erlang uses them. http://developers.sun.com/solaris/articles/event_completion.html On a side note, it would be interested to see if erlang could be ported to use libevent so that when event ports are added to libevent, they would automatically picked up with just a recompile on erlang. Steve On 10/4/06, ke han wrote: > I am looking at using Solaris 10 on Sun's Opteron server for erlang. > My app will eventually need to handle large number of sockets. On > FreeBSD, I can leverage the built in kqueue support. > How does erlang (R10 or R11) on Solaris 10 handle large socket groups? > thanks, ke han > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > From datacompboy@REDACTED Sun Oct 8 09:35:52 2006 From: datacompboy@REDACTED (datacompboy) Date: Sun, 08 Oct 2006 08:35:52 +0100 Subject: [erlang-questions] CC: erl segmentation fault in http_base_64 References: Message-ID: <20061008073552.53CEE5A41B@mail.erlangsystems.com> datacompboy wrote: http_base_64:decode("dGVzda==a"). (end of quote) Intresting info: if start debugger and parse module http_base_64 from inets, we got =ERROR REPORT==== 8-Oct-2006::14:15:27 === Error in process <0.129.0> with exit value: {badarith,[{http_base_64,decode_base64_list,[{[29,26,pad,pad],"n"},"set"]}]} ** exited: {badarith,[{http_base_64,decode_base64_list,[{[29,26,pad,pad],"n"},"set"]}]} ** so, looks like that are core bug in runtime system! ... but for http_base_64 fix are simple: change decode_base64_list({[Sixtet1,Sixtet2,pad,pad], []}, Acc) -> to decode_base64_list({[Sixtet1,Sixtet2,pad,pad], _}, Acc) -> and decode_base64_list({[Sixtet1,Sixtet2,Sixtet3,pad], []}, Acc) -> to decode_base64_list({[Sixtet1,Sixtet2,Sixtet3,pad], _}, Acc) -> -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From datacompboy@REDACTED Sun Oct 8 11:16:46 2006 From: datacompboy@REDACTED (datacompboy) Date: Sun, 08 Oct 2006 10:16:46 +0100 Subject: [erlang-questions] top() References: Message-ID: <20061008091646.57CB85A1F8@mail.erlangsystems.com> is there method to see the top() of erlang processes? I mean, N of most long-running, cpu-eating, memory-growed etc processes? like unix top :) -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From qrilka@REDACTED Sun Oct 8 12:15:51 2006 From: qrilka@REDACTED (Kirill Zaborski) Date: Sun, 8 Oct 2006 14:15:51 +0400 Subject: [erlang-questions] erlrt and eunit In-Reply-To: References: <452818B3.1050506@it.uu.se> <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> Message-ID: <337538cb0610080315x61e00dd5s4641ff454109691@mail.gmail.com> When will we see CEAN? I've tried to install erlrt on my Windows machine ( http://erlrt.process-one.net/R11B/windows/base.tar.gz) - there are bugs in paths (pointing ot C:\Program Files\...), I've corrected them but werl crashes saying: ---------------------------- (no error logger present) error: "Error in process <0.1.0> with exit value: {bad arg,[{erl_prim_loader,check_file_result,3},{init,get_boot,1},{init,get_boot,2},{ init,do_boot,3}]} " {"init terminating in do_boot",{badarg,[{erl_prim_loader,check_file_result,3},{i nit,get_boot,1},{init,get_boot,2},{init,do_boot,3}]}} Crash dump was written to: erl_crash.dump init terminating in do_boot () Abnormal termination ---------------------------- The same with R10B version What am I doing wrong? On 10/8/06, Christophe Romain wrote: > > > Granted I'm not sure if erlrt is using v5.5.1. > > erlrt will not support 5.5 and is not maintained anymore. > CEAN will. > CEAN is comming really soon now, bringing all erlrt functionalities and > much more > with up to date packages. (actually 200 binary packages for 17 > platforms). > I'm late with CEAN and still need some time to validate few things. > > by now, erlrt packages may be out of date as eunit. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Sun Oct 8 14:52:21 2006 From: serge@REDACTED (Serge Aleynikov) Date: Sun, 08 Oct 2006 08:52:21 -0400 Subject: [erlang-questions] top() In-Reply-To: <20061008091646.57CB85A1F8@mail.erlangsystems.com> References: <20061008091646.57CB85A1F8@mail.erlangsystems.com> Message-ID: <4528F485.50009@hq.idt.net> What do you think this tool might be called? ... etop! http://www.erlang.org/doc/doc-5.5.1/lib/observer-0.9.7/doc/html/index.html http://www.erlang.org/doc/doc-5.5.1/lib/observer-0.9.7/doc/html/etop_ug.html#2 And here's the corresponding unix script to run it: /path/to/erlang/lib/observer-0.9.7/priv/bin/etop Serge datacompboy wrote: > is there method to see the top() of erlang processes? > I mean, N of most long-running, cpu-eating, memory-growed etc processes? like unix top :) > -- > --- suicide proc near\n call death\n suicide endp > _________________________________________________________ > Post sent from http://www.trapexit.org > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From datacompboy@REDACTED Sun Oct 8 15:14:02 2006 From: datacompboy@REDACTED (datacompboy) Date: Sun, 08 Oct 2006 14:14:02 +0100 Subject: [erlang-questions] top() References: Message-ID: <20061008131402.7A86A5A1F8@mail.erlangsystems.com> asergey wrote: What do you think this tool might be called? ... etop! (end of quote) ooo... where was my eyes :) thanks! -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From ke.han@REDACTED Sun Oct 8 17:12:30 2006 From: ke.han@REDACTED (ke han) Date: Sun, 8 Oct 2006 23:12:30 +0800 Subject: [erlang-questions] Solaris 10 equiv to kqueue or epoll? In-Reply-To: <81d74c280610080011r54725d22rc3f74148a670f1e@mail.gmail.com> References: <2EF68AC7-ABB2-409C-A285-EDA664235F11@redstarling.com> <81d74c280610080011r54725d22rc3f74148a670f1e@mail.gmail.com> Message-ID: <35A027CA-5CD9-4E70-A173-32645D343902@redstarling.com> Interesting...thanks for pointing this out...Windows has its own proprietary API for this sort of thing. I built a java solution around this 6 years ago. We were able to handle 50,000 active sockets on a single cpu 800 Mhz Windows 2000 Server (only 2GB RAM) with no degradation which beat the pants off the top end $250,000 Sun solution that could only handle 5,000 connections. The value of optimizing socket events should not to be underestimated. ke han On Oct 8, 2006, at 3:11 PM, Steve Jenson wrote: > Solaris 10 has Event Ports but I don't think Erlang uses them. > > http://developers.sun.com/solaris/articles/event_completion.html > > On a side note, it would be interested to see if erlang could be > ported to use libevent so that when event ports are added to libevent, > they would automatically picked up with just a recompile on erlang. > > Steve > > On 10/4/06, ke han wrote: >> I am looking at using Solaris 10 on Sun's Opteron server for erlang. >> My app will eventually need to handle large number of sockets. On >> FreeBSD, I can leverage the built in kqueue support. >> How does erlang (R10 or R11) on Solaris 10 handle large socket >> groups? >> thanks, ke han >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> From alex.arnon@REDACTED Sun Oct 8 18:32:11 2006 From: alex.arnon@REDACTED (Alex Arnon) Date: Sun, 8 Oct 2006 18:32:11 +0200 Subject: [erlang-questions] Multiple modules In-Reply-To: <45283427.6070001@ertw.com> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> <369d63980610061312k1d26b5e6xf87fdeaab48823c4@mail.gmail.com> <45283427.6070001@ertw.com> Message-ID: <944da41d0610080932s27c1e445i910faf6d7e0ad133@mail.gmail.com> On 10/8/06, Daniel Goertzen wrote: > > That starts to strongly resemble the way C++ namespaces work. > > Using the mnesia app as an example, the app source files are well > decomposed into their functional areas, for example: mnesia_subscr.erl, > mnesia_controller.erl, mnesia_checkpoint.erl, etc. But the entire API > for mnesia is really exported through the module "mnesia", and > mnesia.erl contains lots of functions that just relay calls to other > modules. Wouldn't it make more sense for each of the files (ex, > mnesia_subscr.erl) to be able to directly export bits and pieces into > the mnesia module/namespace? > > And this leads to the question of nested modules like C++ nested > namespaces. I've found that nested namespaces in C++ have helped me > keep names short and natural and remove concern over collisions. > Consider this erlang example: > > Erlang makes me name stuff like this... > > myapp:foo_dostuff(...) > myapp:bar_dostuff(...) > > > When I'd really like to say it like this... > > myapp:foo:dostuff(...) > myapp:bar:dostuff(...) > > > Disclaimer: I've written large c++ programs, but not any large elrang > programs yet. Please correct me if I've missed out on some erlang > feature. > > Cheers, > Dan. I can see where this would be useful. What about the X.X notation (e.g. in erlsoap)? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob@REDACTED Sun Oct 8 21:08:31 2006 From: bob@REDACTED (Bob Ippolito) Date: Sun, 8 Oct 2006 12:08:31 -0700 Subject: [erlang-questions] Multiple modules In-Reply-To: <944da41d0610080932s27c1e445i910faf6d7e0ad133@mail.gmail.com> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> <369d63980610061312k1d26b5e6xf87fdeaab48823c4@mail.gmail.com> <45283427.6070001@ertw.com> <944da41d0610080932s27c1e445i910faf6d7e0ad133@mail.gmail.com> Message-ID: <6a36e7290610081208v63f572f0lacebe708faa3d6d8@mail.gmail.com> On 10/8/06, Alex Arnon wrote: > > > On 10/8/06, Daniel Goertzen wrote: > > That starts to strongly resemble the way C++ namespaces work. > > > > Using the mnesia app as an example, the app source files are well > > decomposed into their functional areas, for example: mnesia_subscr.erl, > > mnesia_controller.erl, mnesia_checkpoint.erl, etc. But the entire API > > for mnesia is really exported through the module "mnesia", and > > mnesia.erl contains lots of functions that just relay calls to other > > modules. Wouldn't it make more sense for each of the files (ex, > > mnesia_subscr.erl) to be able to directly export bits and pieces into > > the mnesia module/namespace? > > > > And this leads to the question of nested modules like C++ nested > > namespaces. I've found that nested namespaces in C++ have helped me > > keep names short and natural and remove concern over collisions. > > Consider this erlang example: > > > > Erlang makes me name stuff like this... > > > > myapp:foo_dostuff(...) > > myapp:bar_dostuff(...) > > > > > > When I'd really like to say it like this... > > > > myapp:foo:dostuff(...) > > myapp:bar:dostuff(...) > > > > > > Disclaimer: I've written large c++ programs, but not any large elrang > > programs yet. Please correct me if I've missed out on some erlang > feature. > > > > Cheers, > > Dan. > > > > I can see where this would be useful. > What about the X.X notation (e.g. in erlsoap)? That actually works.. http://www.erlang.se/publications/packages.html -bob From bob@REDACTED Sun Oct 8 21:18:57 2006 From: bob@REDACTED (Bob Ippolito) Date: Sun, 8 Oct 2006 12:18:57 -0700 Subject: [erlang-questions] CC: erl segmentation fault in http_base_64 In-Reply-To: <20061008073552.53CEE5A41B@mail.erlangsystems.com> References: <20061008073552.53CEE5A41B@mail.erlangsystems.com> Message-ID: <6a36e7290610081218i7dad197eydad7d0285262ef17@mail.gmail.com> On 10/8/06, datacompboy wrote: > > > datacompboy wrote: > http_base_64:decode("dGVzda==a"). > (end of quote) I can reproduce this bug on Mac OS X on Intel with R11B-1. Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00000008 0x00000008 in ?? () (gdb) bt #0 0x00000008 in ?? () #1 0x012e4edc in ?? () Previous frame inner to this frame (corrupt stack?) Note that ssl_base64:decode works correctly. 1> ssl_base64:decode("dGVzda==a"). ** exited: {function_clause,[{ssl_base64,decode1,["a"]}, {ssl_base64,decode1,1}, {ssl_base64,decode,1}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** =ERROR REPORT==== 8-Oct-2006::12:17:53 === Error in process <0.31.0> with exit value: {function_clause,[{ssl_base64,decode1,["a"]},{ssl_base64,decode1,1},{ssl_base64,decode,1},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} -bob From ok@REDACTED Mon Oct 9 01:30:56 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 9 Oct 2006 12:30:56 +1300 (NZDT) Subject: [erlang-questions] Bug ?! Message-ID: <200610082330.k98NUuPu500821@atlas.otago.ac.nz> I wrote about ,.. in Prolog: > (b) if you make it two tokens, then you hve other problems: > (1) if you can have a space there, why not a newline? why not a comment? > So X = [1, 2, 3, > % this can go on for some time > .. L] Richard Carlsson replied: Sure. But that is not very different from normal Prolog/Erlang syntax: X = [1, 2, 3 % this can go on for some time |L] (that there is no comma after the '3' is not much of a visual cue in a larger chunk of code). If the |-syntax is not a problem, I don't see why the ..-syntax should be one. The issue was not "visual cue" but "arbitrary amounts of white space and commentary in the middle of a SINGLE logical token". To the extent that "visual cue" is relevant here, it's not the ABSENCE of a visual cue that is at issue, but the PRESENCE of a MISLEADING one.u Put it this way, ",.." has *no* known advantages over "|". > Problem 1: is ,.. one token or two? > (a) if you make it one token, then you have all sorts of problems: > (1) ,.. is one token but in [.,.,.] ,. is two tokens, and in > [...,...,...] ,... is two tokens again, and of course ,.2 had > better be comma nought-point-two. > (2) careful writers who put spaces after commas want to put a space > after this one, [a, b, .. c] Of course. My intention was to make '..' one token. Nononono. I didn't ask whether ".." was one token, but whether ",.." was one token. Different issue. > (2) you have a token which would otherwise belong to an established > class of tokens (including +, ++, .+, --, -, .-, ..., ...., ....) > but which can only occur in one place and then doesn't mean what > they do. I'm not sure I follow you here. Try taking what I wrote literally. Remember that the set of operator-like tokens in Prolog is open, not closed as it is in Erlang, and I was talking about Prolog. Remembering that we are discussing Prolog experience with ,..; consider [.] [..] [...] [....] are all one-element lists [.,.] [...,...] [....,....] are all two-element lists [.,.,.] [...,...,...] [....,....,....] are all three-element lists but [..,..] was NOT a two-element list [..,..,..] was NOT a three-element list and you can't say that wasn't confusing. > Problem 2: ,.. just plain doesn't work the way people expect. > They expect to write > [..,X,Y] = L % oops, only allowed at end > [X,Y,..] = L % oops, something must follow .. > [X,Y..Z] = L % oops, a comma must precede .. > [X,Y,..,Z] = L % oops, a comma may not follow .. > [X,Y,..Z] = L % !!OOPS!! I was expecting Z to be the > % last element of L, but it's a tail! > > In fact, for someone fluent in Latin-based writing systems that make > use of ellipses, ,.. is appallingly HARD to get right. In particular, > your [x,y,..] is one of the cases that wasn't allowed, any more than > [x,y|_] was allowed. > > When ,.. was removed from Prolog, no-one was sorry to see it go. It seems that they were trying to do too much. As you noted, the variant that I suggested was the only one that they did _not_ implement. No, that's not what I said, and they didn't try to do too much. What I said is that people who are used to writing English *EXPECTED* .. to work in ways that in fact it didn't. The only variant that was implemented was this: ::= '[' ']' | '[' ::= ']' | ',' '..' ']' | ',' But let's reverse the situation: _only_ the following forms should be allowed: [..], [x,..], [x,y,..], and so on. Now you are going to confuse the people who expect [X,..,Z] to work. No, the more I look at it, the better my original proposal with [*] looks. '..' gets used very reasonably and effectively in Haskell. If '..' ever means anything in Erlang, I should prefer it to do the Haskell thing. The trouble with the |-syntax is that it only takes a single keystroke to change the meaning of the constructed data, and once it has happened, it is pretty hard to notice that a ',' somewhere should really be a '|'. (I have seen this kind of bug survive for years in production code.) Do I need to point out that this is not a plausible typing error? To get from the "," key to the "|" key you have to go up diagonally two and then across three. It's not like the "," and ";" keys (up diagonally one, across one) which are even visually similar. "|" is visually very different from ",". It is, to state the blindingly obvious, considerably taller, whereas ",.." is all on one line. We simply are not talking about TYPOs here, but about THINKOs, and changing the tokens isn't likely to help with THINKOs. (Another thing entirely is of course that I have to press shift to produce both the | and the _ - and none of them stay in the same place when I switch keyboard layouts.) I also have to press shift. But heck, let's get some numbers here. I wrote a tiny AWK script and ran it over the lib/stdlib/src/*.?rl files in Erlang R11B. 1257014 lower = 65.71% unshifted key-presses 237850 upper = 12.43% shifted key-presses 344629 space = 18.02% space key 15285 tab = 0.80% tab key 58130 enter = 3.04% enter key 3114 |_ uses uses of "|" followed by "_" 3832 |X uses uses of "|" followed by a named variable Changing "|_" to ",.." would trade 6118 shifted keypresses for 9342 unshifted keypresses. This would indeed reduce the number of shifted keypresses by about two and a half percent, but since only about 1 keypress in 8 is shifted, that's not a big saving overall. Shifting could be reduced in an editor: On entry of a right bracket, if the preceding characters are "\-" or "|-" or "\_" (or whatever suits your keyboard), change them to "|_". If the preceding characters match |, or \, ask if they should be converted to | . That's Erlang-specific, of course. Changing "|_" to ",.." would still leave more than half of the uses of "|" in lib/stdlib/ untouched, and if "[X|Y]" is allowed it is hard to see why '[X|_]" wouldn't also be allowed in a pattern. It is not clear how having two different notations would help. The point of the [*], {*}, <<*>> proposal was to have a simple way to say something that _cannot_ be currently said in a pattern, at least for [*] and {*}. From bengt.kleberg@REDACTED Mon Oct 9 08:50:58 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 09 Oct 2006 08:50:58 +0200 Subject: [erlang-questions] Multiple modules In-Reply-To: <369d63980610061312k1d26b5e6xf87fdeaab48823c4@mail.gmail.com> References: <9b08084c0610050030w122a3d05n5d908fd4354f9639@mail.gmail.com> <369d63980610061312k1d26b5e6xf87fdeaab48823c4@mail.gmail.com> Message-ID: <4529F152.9060409@ericsson.com> On 2006-10-06 22:12, Costel Vrinceanu wrote: > If we separate files from modules/make them orthogonal, then it should > work both ways: ...deleted > 1 module in N files > or > N modules in M files what benefits would these bring? i am not saying that they only have drawbacks (difficult for maintainers, code change problems, etc), just that i do not see the benefits. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From mats.cronqvist@REDACTED Mon Oct 9 09:21:00 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 09 Oct 2006 09:21:00 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <4526CC04.6020706@telia.com> References: <20061003045944.5F6DF5A1FC@mail.erlangsystems.com> <4522CA70.2030003@telia.com> <45235B5B.4080904@ericsson.com> <4526CC04.6020706@telia.com> Message-ID: <4529F85C.5060606@ericsson.com> Robert Virding wrote: > As I wrote in the not too distant past here in erlang-questions: macros > were a joke! Although you may need a slightly warped sense of humour to > appreciate it. it might have been funny to you, but it brings me daily pain. the permissiveness of the preprocessor is in my opinion the #1 maintainability issue in my project. and how anyone can find allowing unbalanced parentheses "funny" is beyond me. >> more to the point, i still fail to see how this; >> >> receive >> X#r.a -> do_a(); >> >> is more unclean, inconsistent and inelegant than this; >> >> XRA = X#r.a, >> receive >> XRA -> do_a(); > > If X#r.a is a valid pattern then what does this mean? > > f(X#r.a) -> {yes,X}. > > It's a valid pattern, so what does it mean? yeah, fine, i am enlightened. thank you. >> but hey, i'll take richard & richard's word for it. > > You don't have to take Richard's word for it, but you should really > think through your suggestions properly to see their full implications. > Not just the immediate case in which you are interested. apparently i don't. i can just claim it was a joke. mats From christophe.romain@REDACTED Mon Oct 9 10:18:09 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Mon, 09 Oct 2006 10:18:09 +0200 Subject: [erlang-questions] erlrt and eunit In-Reply-To: <337538cb0610080315x61e00dd5s4641ff454109691@mail.gmail.com> References: <452818B3.1050506@it.uu.se> <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> <337538cb0610080315x61e00dd5s4641ff454109691@mail.gmail.com> Message-ID: <7ab0dde1515d1cfc6a6309a917aaf768@process-one.net> Hello, > When will we see CEAN? it needs some testing, but it's really close to the beta release. i know about the windows erlrt bug. still did not have time to look at it. any relation to absolute path ? From qrilka@REDACTED Mon Oct 9 10:23:28 2006 From: qrilka@REDACTED (Kirill Zaborski) Date: Mon, 9 Oct 2006 12:23:28 +0400 Subject: [erlang-questions] erlrt and eunit In-Reply-To: <7ab0dde1515d1cfc6a6309a917aaf768@process-one.net> References: <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> <337538cb0610080315x61e00dd5s4641ff454109691@mail.gmail.com> <7ab0dde1515d1cfc6a6309a917aaf768@process-one.net> Message-ID: <337538cb0610090123s722c8786o989d50cf1527bd59@mail.gmail.com> On 10/9/06, Christophe Romain wrote: > > Hello, > > > When will we see CEAN? > it needs some testing, but it's really close to the beta release. Is there any date? i know about the windows erlrt bug. > still did not have time to look at it. > any relation to absolute path ? > > I've fixed the paths with no success (actual error was in pervious letter). I'm an Erlang newbie so at the moment I don't know how to find where the problem is - just can not get erl.exe from erlrt distribution running. -------------- next part -------------- An HTML attachment was scrubbed... URL: From christophe.romain@REDACTED Mon Oct 9 10:49:42 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Mon, 09 Oct 2006 10:49:42 +0200 Subject: [erlang-questions] erlrt and eunit In-Reply-To: <337538cb0610090123s722c8786o989d50cf1527bd59@mail.gmail.com> References: <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> <337538cb0610080315x61e00dd5s4641ff454109691@mail.gmail.com> <7ab0dde1515d1cfc6a6309a917aaf768@process-one.net> <337538cb0610090123s722c8786o989d50cf1527bd59@mail.gmail.com> Message-ID: > Is there any date? no. few testing of the build chain are needed. i'll let the list know when all will be ready for beta release. From bob@REDACTED Mon Oct 9 11:29:19 2006 From: bob@REDACTED (Bob Ippolito) Date: Mon, 9 Oct 2006 02:29:19 -0700 Subject: [erlang-questions] erlrt and eunit In-Reply-To: References: <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> <337538cb0610080315x61e00dd5s4641ff454109691@mail.gmail.com> <7ab0dde1515d1cfc6a6309a917aaf768@process-one.net> <337538cb0610090123s722c8786o989d50cf1527bd59@mail.gmail.com> Message-ID: <6a36e7290610090229m7e54a5c9t5887eb4ec08aefa0@mail.gmail.com> On 10/9/06, Christophe Romain wrote: > > Is there any date? > > no. > few testing of the build chain are needed. > i'll let the list know when all will be ready for beta release. The list would be able to help more if there was a public SVN available. There are a few of us that would be willing to test and fix bugs. -bob From ycaouette@REDACTED Mon Oct 9 14:45:55 2006 From: ycaouette@REDACTED (Yanni Caouette) Date: Mon, 9 Oct 2006 08:45:55 -0400 Subject: [erlang-questions] erlrt and eunit In-Reply-To: <6a36e7290610090229m7e54a5c9t5887eb4ec08aefa0@mail.gmail.com> References: <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> <337538cb0610080315x61e00dd5s4641ff454109691@mail.gmail.com> <7ab0dde1515d1cfc6a6309a917aaf768@process-one.net> <337538cb0610090123s722c8786o989d50cf1527bd59@mail.gmail.com> <6a36e7290610090229m7e54a5c9t5887eb4ec08aefa0@mail.gmail.com> Message-ID: > The list would be able to help more if there was a public SVN > available. There are a few of us that would be willing to test and fix > bugs. Count me in as well. Something like CEAN will certainly benefit everyone. I have followed first erlmerge, then erlrt. Now I can't wait for CEAN. From qrilka@REDACTED Mon Oct 9 15:06:46 2006 From: qrilka@REDACTED (Kirill Zaborski) Date: Mon, 9 Oct 2006 17:06:46 +0400 Subject: [erlang-questions] erlrt and eunit In-Reply-To: References: <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> <337538cb0610080315x61e00dd5s4641ff454109691@mail.gmail.com> <7ab0dde1515d1cfc6a6309a917aaf768@process-one.net> <337538cb0610090123s722c8786o989d50cf1527bd59@mail.gmail.com> <6a36e7290610090229m7e54a5c9t5887eb4ec08aefa0@mail.gmail.com> Message-ID: <337538cb0610090606o2118cc67h643727f0d9e66361@mail.gmail.com> On 10/9/06, Yanni Caouette wrote: > > > The list would be able to help more if there was a public SVN > > available. There are a few of us that would be willing to test and fix > > bugs. > > Count me in as well. Something like CEAN will certainly benefit > everyone. I have followed first erlmerge, then erlrt. Now I can't wait > for CEAN. me too BTW, Cristophe - will there be any way to post new libraries to CEAN? And what about using its runtime for our own repository (for project)? Because not all the code will be interesting to the community, I think. -------------- next part -------------- An HTML attachment was scrubbed... URL: From olivier.sambourg@REDACTED Mon Oct 9 15:24:14 2006 From: olivier.sambourg@REDACTED (Olivier Sambourg) Date: Mon, 9 Oct 2006 15:24:14 +0200 Subject: [erlang-questions] erlrt and eunit In-Reply-To: <337538cb0610090606o2118cc67h643727f0d9e66361@mail.gmail.com> References: <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> <337538cb0610080315x61e00dd5s4641ff454109691@mail.gmail.com> <7ab0dde1515d1cfc6a6309a917aaf768@process-one.net> <337538cb0610090123s722c8786o989d50cf1527bd59@mail.gmail.com> <6a36e7290610090229m7e54a5c9t5887eb4ec08aefa0@mail.gmail.com> <337538cb0610090606o2118cc67h643727f0d9e66361@mail.gmail.com> Message-ID: I'm interested too, CEAN could be the perfect tool for maven-erlang dependencies management. Olivier On 10/9/06, Kirill Zaborski wrote: > > > > On 10/9/06, Yanni Caouette wrote: > > > > > The list would be able to help more if there was a public SVN > > > available. There are a few of us that would be willing to test and fix > > > > > bugs. > > > > Count me in as well. Something like CEAN will certainly benefit > > everyone. I have followed first erlmerge, then erlrt. Now I can't wait > > for CEAN. > > > me too > BTW, Cristophe - will there be any way to post new libraries to CEAN? And > what about using its runtime for our own repository (for project)? Because > not all the code will be interesting to the community, I think. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitriid@REDACTED Mon Oct 9 16:07:20 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Mon, 9 Oct 2006 17:07:20 +0300 Subject: [erlang-questions] erlrt and eunit In-Reply-To: <337538cb0610090606o2118cc67h643727f0d9e66361@mail.gmail.com> References: <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> <337538cb0610080315x61e00dd5s4641ff454109691@mail.gmail.com> <7ab0dde1515d1cfc6a6309a917aaf768@process-one.net> <337538cb0610090123s722c8786o989d50cf1527bd59@mail.gmail.com> <6a36e7290610090229m7e54a5c9t5887eb4ec08aefa0@mail.gmail.com> <337538cb0610090606o2118cc67h643727f0d9e66361@mail.gmail.com> Message-ID: On 10/9/06, Kirill Zaborski wrote: > > > > On 10/9/06, Yanni Caouette wrote: > > > > > The list would be able to help more if there was a public SVN > > > available. There are a few of us that would be willing to test and fix > > > > > bugs. > > > > Count me in as well. Something like CEAN will certainly benefit > > everyone. I have followed first erlmerge, then erlrt. Now I can't wait > > for CEAN. > > > me too > BTW, Cristophe - will there be any way to post new libraries to CEAN? And > what about using its runtime for our own repository (for project)? Because > not all the code will be interesting to the community, I think. > I would definitely love CEAN to evolve into something similar to Ruby Gems .... :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From jasonwtucker@REDACTED Mon Oct 9 16:34:54 2006 From: jasonwtucker@REDACTED (Jason Tucker) Date: Mon, 9 Oct 2006 10:34:54 -0400 Subject: [erlang-questions] Compile problem - R11B-1 Message-ID: Hello - I have previously been able to compile and use R10B-5. I am now trying to compile R11B-1 on a different machine. My 'configure' worked fine, with no errors, but when I try to make, this is what I get: [jtucker@REDACTED otp_src_R11B-1]$gmake cd erts/emulator && ERL_TOP=/home/jtucker/src/otp_src_R11B-1 gmake generate depend gmake[1]: Entering directory `/home/jtucker/src/otp_src_R11B-1/erts/emulator' gmake -f sparc-sun-solaris2.10/Makefile generate gmake[2]: Entering directory `/home/jtucker/src/otp_src_R11B-1/erts/emulator' cd /home/jtucker/src/otp_src_R11B-1/lib/kernel/ebin/../src && gmake ../ebin/otp_ring0.beam gmake[3]: Entering directory `/home/jtucker/src/otp_src_R11B-1/lib/kernel/src' erlc -W +debug_info +strict_record_tests -I../include -o../ebin otp_ring0.erl gmake[3]: erlc: Command not found gmake[3]: *** [../ebin/otp_ring0.beam] Error 127 gmake[3]: Leaving directory `/home/jtucker/src/otp_src_R11B-1/lib/kernel/src' gmake[2]: *** [/home/jtucker/src/otp_src_R11B-1/lib/kernel/ebin/otp_ring0.beam] Error 2 gmake[2]: Leaving directory `/home/jtucker/src/otp_src_R11B-1/erts/emulator' gmake[1]: *** [generate] Error 2 gmake[1]: Leaving directory `/home/jtucker/src/otp_src_R11B-1/erts/emulator' gmake: *** [depend] Error 2 Considering this is a brand new build, where would it expect to find a functional 'erlc'? Any suggestiions? Thanks, __Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bob.Cowdery@REDACTED Mon Oct 9 16:57:14 2006 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Mon, 9 Oct 2006 15:57:14 +0100 Subject: [erlang-questions] {error, no_driver_init} Message-ID: <3A76756EED583B43A4AD704E29CCD079715CB9@mail.aprsmartlogik.com> Bob Cowdery a ?crit : > > Hi > > > > I am trying to get a port driver to work on Windows. This is just the example in the tutorial . I can get it going on Linux but I get the no_driver_init error on Windows. I have built this with Visual Studio Express, so it's VC8. I am wondering if Erlang is built with VC6 and therefore the library is incompatible. Could this be the case? Other than that maybe its incorrect flag settings. I have set it to build C but don't know what else might be important. > > > > Any help appreciated. > > > > Thanks > > Bob Hi, There is long time I didn't play with drivers but I remember this kind of trouble. Check that your driver is exporting the driver_init() function. (You can easily check this with DependencyWalker [1] ). I also remember that the sample didn't work with me I had to do as follow: ErlDrvEntry messenger_driver_entry = { NULL, /* F_PTR init, N/A */ messenger_driver_start, messenger_driver_stop, messenger_driver_output, NULL, NULL, "messenger_driver", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; extern "C" { DRIVER_INIT (messenger_driver) { return &messenger_driver_entry; } } Regards, Nicolas ------------------ Nicolas Thanks for the hint. I did get it working but had to compile it as C++ and then extern "C" the exported method. I checked and it was exported fine when compiled as C but Erlang just couldn't see it. I don't like things I can't explain so if anyone knows why this is I would be pleased to hear. Thanks Bob [1] DependencyWalker : http://www.dependencywalker.com/ From bjorn@REDACTED Mon Oct 9 17:38:48 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 09 Oct 2006 17:38:48 +0200 Subject: [erlang-questions] CC: erl segmentation fault in http_base_64 In-Reply-To: <20061008070339.0E0F35A1F9@mail.erlangsystems.com> References: <20061008070339.0E0F35A1F9@mail.erlangsystems.com> Message-ID: Thanks for the bug report. A correction will be included in R11B-2. Also thanks to Per Gustafsson from HiPE for emailing a short test module showing the bug and a suggestion how to fix it. /Bjorn "datacompboy" writes: > On > http_base_64:decode("dGVzda==a"). > erl dies with "Instruction at ... referenced memory at .... The memory could not be written" > > This happen at least on windows and linux platforms, R11B > -- > --- suicide proc near\n call death\n suicide endp > _________________________________________________________ > Post sent from http://www.trapexit.org > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From igwan@REDACTED Mon Oct 9 19:45:14 2006 From: igwan@REDACTED (igwan) Date: Mon, 09 Oct 2006 19:45:14 +0200 Subject: [erlang-questions] Is epmd secure ? (SSL distribution) Message-ID: <452A8AAA.3080205@free.fr> Hello, I have to connect a number of nodes through the internet. I configured the SSL distribution mechanism but still have some questions about security. - Is the epmd deamon vulnerable ? I noticed that running it in debug mode (epmd -d) on the console, it receives requests from starting nodes (even SSL) via IP (am I right ?). Can a attacker send multiple register requests or resolve request and take the server down this way ? Is the protocol used by epmd secure when running a SSL node ? - Is it possible to set the listen port used by a SSL node in any way ? Reading through the doc, I tried "-ssl_dist_opt proxylsport 51300" and "-ssl_dist_opt port 51300" to no avail, I see the epmd trace still show a random port being registered. I have thought of bypassing the epmd thing, and do its work giving a static configuration, like [{sslnode1@REDACTED, 51300}, {sslnode2@REDACTED, 51301}, {sslnode3@REDACTED, 51300}, ...] on each node, but is that possible to configure such things ? Sorry if the questions already have been asked, I didn't find anything related. Thanks for your help, igwan From jasonwtucker@REDACTED Mon Oct 9 20:41:30 2006 From: jasonwtucker@REDACTED (Jason Tucker) Date: Mon, 9 Oct 2006 14:41:30 -0400 Subject: [erlang-questions] Compile problem - R11B-1 In-Reply-To: References: Message-ID: For the record, I was able to successfully compile R11B-0, but R11B-1 fails with the error I previously noted. I will continue my work with R11B-0 for now. Thanks, __Jason On 10/9/06, Jason Tucker wrote: > > Hello - > > I have previously been able to compile and use R10B-5. I am now trying to > compile R11B-1 on a different machine. My 'configure' worked fine, with no > errors, but when I try to make, this is what I get: > > [jtucker@REDACTED otp_src_R11B-1]$gmake > cd erts/emulator && ERL_TOP=/home/jtucker/src/otp_src_R11B-1 gmake > generate depend > gmake[1]: Entering directory > `/home/jtucker/src/otp_src_R11B-1/erts/emulator' > gmake -f sparc-sun-solaris2.10/Makefile generate > gmake[2]: Entering directory > `/home/jtucker/src/otp_src_R11B-1/erts/emulator' > cd /home/jtucker/src/otp_src_R11B-1/lib/kernel/ebin/../src && gmake > ../ebin/otp_ring0.beam > gmake[3]: Entering directory > `/home/jtucker/src/otp_src_R11B-1/lib/kernel/src' > erlc -W +debug_info +strict_record_tests -I../include -o../ebin > otp_ring0.erl > gmake[3]: erlc: Command not found > gmake[3]: *** [../ebin/otp_ring0.beam] Error 127 > gmake[3]: Leaving directory > `/home/jtucker/src/otp_src_R11B-1/lib/kernel/src' > gmake[2]: *** > [/home/jtucker/src/otp_src_R11B-1/lib/kernel/ebin/otp_ring0.beam] Error 2 > gmake[2]: Leaving directory > `/home/jtucker/src/otp_src_R11B-1/erts/emulator' > gmake[1]: *** [generate] Error 2 > gmake[1]: Leaving directory > `/home/jtucker/src/otp_src_R11B-1/erts/emulator' > gmake: *** [depend] Error 2 > > Considering this is a brand new build, where would it expect to find a > functional 'erlc'? > > Any suggestiions? > > Thanks, > > __Jason > -------------- next part -------------- An HTML attachment was scrubbed... URL: From francesco@REDACTED Mon Oct 9 22:43:31 2006 From: francesco@REDACTED (francesco) Date: Mon, 09 Oct 2006 21:43:31 +0100 Subject: [erlang-questions] Reusable Web Applications / Tools References: Message-ID: <20061009204331.8FE2B5A1F4@mail.erlangsystems.com> Hi, I am trying to compile a list and get feedback on available tools and components for Erlang web based development. As we presented in Portland, writing web components in Erlang is efficient and results in resilient fast applications. Based on our (Very non academic) benchmarks, takes as much as conventional languages and provides an excellent throughput. The problem we keep on stumbling across is lack of components, which means we need to reinvent the wheel every time. I've started a thread on trapexit to discuss the subject, and try to list existing components. I started a thread on trapexit to discuss this: http://forum.trapexit.org/viewtopic.php?t=6478 Regards, Francesco -- -- http://www.erlang-consulting.com _________________________________________________________ Post sent from http://www.trapexit.org From robert.virding@REDACTED Mon Oct 9 22:50:22 2006 From: robert.virding@REDACTED (Robert Virding) Date: Mon, 09 Oct 2006 22:50:22 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <4529F85C.5060606@ericsson.com> References: <20061003045944.5F6DF5A1FC@mail.erlangsystems.com> <4522CA70.2030003@telia.com> <45235B5B.4080904@ericsson.com> <4526CC04.6020706@telia.com> <4529F85C.5060606@ericsson.com> Message-ID: <452AB60E.1000707@telia.com> Mats Cronqvist wrote: > Robert Virding wrote: > >> As I wrote in the not too distant past here in erlang-questions: >> macros were a joke! Although you may need a slightly warped sense of >> humour to appreciate it. > > it might have been funny to you, but it brings me daily pain. the > permissiveness of the preprocessor is in my opinion the #1 > maintainability issue in my project. > and how anyone can find allowing unbalanced parentheses "funny" is > beyond me. Then treat it as a bug and fix it. It is not carved in stone. It wasn't the unbalanced parentheses which were the joke but macros as such. I don't think that the rest of the preprocessor is too permissive, it tries to detect errors. >> You don't have to take Richard's word for it, but you should really >> think through your suggestions properly to see their full >> implications. Not just the immediate case in which you are interested. > > apparently i don't. i can just claim it was a joke. Of course. Robert From datacompboy@REDACTED Tue Oct 10 06:47:42 2006 From: datacompboy@REDACTED (datacompboy) Date: Tue, 10 Oct 2006 05:47:42 +0100 Subject: [erlang-questions] CC: erl segmentation fault in http_base_64 References: Message-ID: <20061010044742.AE8795A1F8@mail.erlangsystems.com> Guest wrote: A correction will be included in R11B-2. (end of quote) Is am right, and this crashdump was reproduceable in other cases other than http_base_64 ? -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From matthias@REDACTED Tue Oct 10 08:35:22 2006 From: matthias@REDACTED (Matthias Lang) Date: Tue, 10 Oct 2006 08:35:22 +0200 Subject: [erlang-questions] CC: erl segmentation fault in http_base_64 In-Reply-To: <20061010044742.AE8795A1F8@mail.erlangsystems.com> References: <20061010044742.AE8795A1F8@mail.erlangsystems.com> Message-ID: <17707.16170.137984.396104@antilipe.corelatus.se> datacompboy writes: > Is am right, and this crashdump was reproduceable in other cases other than http_base_64 ? Yes. http_base_64 is just plain Erlang code. You can find it in your installation, e.g. on a unix system: ~ >locate http_base_64.erl /usr/local/lib/erlang/lib/inets-4.7.2/src/http_base_64.erl and then it's an interesting little exercise in "differential analysis" to cut it down to a shorter program which also crashes. Here's how far I got in fifteen minutes: -module(dcb). -export([crash/0]). crash() -> crash(0,atom). crash(_,X) -> 0 bsl (X bsl 1) bsl 0. Matthias From raimo+erlang-questions@REDACTED Tue Oct 10 09:07:00 2006 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Tue, 10 Oct 2006 09:07:00 +0200 Subject: [erlang-questions] : {error, no_driver_init} In-Reply-To: <3A76756EED583B43A4AD704E29CCD079715CB9@mail.aprsmartlogik.com> References: <3A76756EED583B43A4AD704E29CCD079715CB9@mail.aprsmartlogik.com> Message-ID: <20061010070700.GA17142@erix.ericsson.se> On Mon, Oct 09, 2006 at 03:57:14PM +0100, Bob Cowdery wrote: > > Bob Cowdery a ?crit : > > > Hi > > > > > > I am trying to get a port driver to work on Windows. This is just > the example in the tutorial . I can get it going on Linux but I get the > no_driver_init error on Windows. I have built this with Visual Studio > Express, so it's VC8. I am wondering if Erlang is built with VC6 and > therefore the library is incompatible. Could this be the case? Other > than that maybe its incorrect flag settings. I have set it to build C > but don't know what else might be important. Well, the Erlang VM is built using an ancient VC6, that is true. If that makes the library incompatible is more than I know... > > > > > > Any help appreciated. > > > > > > Thanks > > > Bob > > > Hi, > There is long time I didn't play with drivers but I remember this kind > of trouble. > Check that your driver is exporting the driver_init() function. (You can > easily check this with DependencyWalker [1] ). > I also remember that the sample didn't work with me I had to do as follow: > > ErlDrvEntry messenger_driver_entry = { > NULL, /* F_PTR init, N/A */ > messenger_driver_start, > messenger_driver_stop, > messenger_driver_output, > NULL, > NULL, > "messenger_driver", > NULL, > NULL, > NULL, > NULL, > NULL, > NULL, > NULL, > NULL, > NULL > }; > > extern "C" > { > DRIVER_INIT (messenger_driver) > { > return &messenger_driver_entry; > } > } > > Regards, > Nicolas > > ------------------ > Nicolas > > Thanks for the hint. I did get it working but had to compile it as C++ and then extern "C" the exported method. I checked and it was exported fine when compiled as C but Erlang just couldn't see it. I don't like things I can't explain so if anyone knows why this is I would be pleased to hear. > > Thanks > Bob > > > [1] DependencyWalker : http://www.dependencywalker.com/ > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From christophe.romain@REDACTED Tue Oct 10 10:39:32 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Tue, 10 Oct 2006 10:39:32 +0200 Subject: [erlang-questions] erlrt and eunit In-Reply-To: <337538cb0610090606o2118cc67h643727f0d9e66361@mail.gmail.com> References: <290b3ba10610071943l56c3ef29ie460729e73210aae@mail.gmail.com> <337538cb0610080315x61e00dd5s4641ff454109691@mail.gmail.com> <7ab0dde1515d1cfc6a6309a917aaf768@process-one.net> <337538cb0610090123s722c8786o989d50cf1527bd59@mail.gmail.com> <6a36e7290610090229m7e54a5c9t5887eb4ec08aefa0@mail.gmail.com> <337538cb0610090606o2118cc67h643727f0d9e66361@mail.gmail.com> Message-ID: <573d002629b0fe45b2c67883fd0dd8e9@process-one.net> > BTW, Cristophe - will there be any way to post new libraries to CEAN? of course, a packaging guide will be available on the site. a build script will be available to create small archives for architecture dependent files. all libraries come with a.pub file. i have generated many of them, but a big check will be needed. some are still to be written. i note that many people want to contribute and test. i will publish soon all info needed to test cean. best regards. From tobbe@REDACTED Tue Oct 10 11:06:27 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Tue, 10 Oct 2006 11:06:27 +0200 Subject: [erlang-questions] CC: erl segmentation fault in http_base_64 In-Reply-To: <17707.16170.137984.396104@antilipe.corelatus.se> References: <20061010044742.AE8795A1F8@mail.erlangsystems.com> <17707.16170.137984.396104@antilipe.corelatus.se> Message-ID: Meanwhile, it is good to have the Dialyzer: # dialyzer -c dcb.beam Checking whether the initial PLT exists and is up-to-date... yes Proceeding with analysis... {dcb,crash,2}: Call to function 'bsl' with signature ((integer(),integer()) -> integer()) will fail since the arguments are of type ('atom',1)! done (warnings were emitted) --Tobbe Matthias Lang wrote: > datacompboy writes: > > > Is am right, and this crashdump was reproduceable in other cases other than http_base_64 ? > > Yes. > > http_base_64 is just plain Erlang code. You can find it in your > installation, e.g. on a unix system: > > ~ >locate http_base_64.erl > /usr/local/lib/erlang/lib/inets-4.7.2/src/http_base_64.erl > > and then it's an interesting little exercise in "differential > analysis" to cut it down to a shorter program which also > crashes. Here's how far I got in fifteen minutes: > > -module(dcb). > -export([crash/0]). > > crash() -> crash(0,atom). > crash(_,X) -> 0 bsl (X bsl 1) bsl 0. > > Matthias > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From erlang@REDACTED Tue Oct 10 13:39:47 2006 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 10 Oct 2006 13:39:47 +0200 Subject: [erlang-questions] GS widgets Message-ID: <9b08084c0610100439webc768dw594d056a615ed3c3@mail.gmail.com> Has anybody made any gs widgets that they would like to share? I need a few little GUI widgets that run 'out-of-the-box' with the Erlang distribution - gs seems the only way to do this. I wrote a simple io_widget suitable for a simple chat program (enclosed) Does anybody have any other simple gs widgets? - I'd like to make a library of similar widgets (run the widget with io_widget:test() /Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: io_widget.erl Type: application/octet-stream Size: 1818 bytes Desc: not available URL: From richardc@REDACTED Tue Oct 10 14:09:11 2006 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 10 Oct 2006 14:09:11 +0200 Subject: [erlang-questions] Bug ?! In-Reply-To: <200610082330.k98NUuPu500821@atlas.otago.ac.nz> References: <200610082330.k98NUuPu500821@atlas.otago.ac.nz> Message-ID: <452B8D67.7080409@it.uu.se> Richard A. O'Keefe wrote: > > (2) you have a token which would otherwise belong to an established > > class of tokens (including +, ++, .+, --, -, .-, ..., ...., ....) > > but which can only occur in one place and then doesn't mean what > > they do. > > I'm not sure I follow you here. > > Try taking what I wrote literally. > Remember that the set of operator-like tokens in Prolog is open, > not closed as it is in Erlang, and I was talking about Prolog. Ah. That was a Prolog feature that I was not aware of. (Tried briefly to google for some more details about this, but failed. Got a reference?) > Remembering that we are discussing Prolog experience with ,..; consider > > > [.] [..] [...] [....] are all one-element lists > [.,.] [...,...] [....,....] are all two-element lists > [.,.,.] [...,...,...] [....,....,....] are all three-element lists > > but [..,..] was NOT a two-element list > [..,..,..] was NOT a three-element list > > and you can't say that wasn't confusing. It certainly was, I agree. > It seems that they were trying to do too much. As you noted, the variant > that I suggested was the only one that they did _not_ implement. > > No, that's not what I said, and they didn't try to do too much. > What I said is that people who are used to writing English *EXPECTED* > .. to work in ways that in fact it didn't. > The only variant that was implemented was this: > > ::= '[' ']' > | '[' > ::= ']' > | ',' '..' ']' > | ',' Ok, that was not as general as I first thought. I still think it was too much, though: a pattern that has a matching cost proportional to the size of the input, rather than only to the size of the pattern, is a too powerful primitive (in my opinion) - if one includes that, one might as well start adding patterns for nesting tuples to arbitrary depths. (Of course, such a powerful matching language could be very useful, but it changes the "feel" of patterns rather radically.) It now looks to me that since the above patterns _could_ do such a powerful matching, many people naturally expected that the other variants should also work, since they have the same or lower complexity. > But let's reverse the situation: _only_ the following forms > should be allowed: [..], [x,..], [x,y,..], and so on. > > Now you are going to confuse the people who expect [X,..,Z] to work. Not much, I don't think, if the basic rule is that patterns do not seek. > No, the more I look at it, the better my original proposal with [*] > looks. '..' gets used very reasonably and effectively in Haskell. > If '..' ever means anything in Erlang, I should prefer it to do the > Haskell thing. Haskell uses it for (lazily generated) sequences, as in [1,3..9] (and a comma is not allowed before or after the '..'). But they don't allow that syntax in patterns, it seems. Pity - it would have been a nice symmetry. And conversely, if I had ,..-patterns in a language, I would also like to be able to use that syntax for generating lists. > Do I need to point out that this is not a plausible typing error? > To get from the "," key to the "|" key you have to go up diagonally two > and then across three. It's not like the "," and ";" keys (up diagonally > one, across one) which are even visually similar. "|" is visually very > different from ",". It is, to state the blindingly obvious, considerably > taller, whereas ",.." is all on one line. We simply are not talking > about TYPOs here, but about THINKOs, and changing the tokens isn't > likely to help with THINKOs. In an ideal world, every action that our body takes is the result of careful cerebral planning and execution. However, in reality it is not uncommon to think one thing and have your body do something else, even without your conscious self noticing. Therefore, I still would classify this kind of error as a typo. It is not quite the same thing as e.g. dividing instead of multiplying when solving an equation, or getting an off-by-one error when traversing an array. > Changing "|_" to ",.." would trade 6118 shifted keypresses for > 9342 unshifted keypresses. This would indeed reduce the number of > shifted keypresses by about two and a half percent, but since only about > 1 keypress in 8 is shifted, that's not a big saving overall. Ah, but you didn't count the number of extra keypresses needed to delete the mistyped character and try it again from a different key. :-) No, it would not have a large impact on the number of shifted keypresses (few things would, since the overwhelming majority of all program characters are unshifted). But personally, I'd be happy to avoid |_ (it actually took me 7 keypresses to type that, since I was using Swedish keyboard layout and missed the "?" - oops, I meant "_"). > Changing "|_" to ",.." would still leave more than half of the uses of "|" > in lib/stdlib/ untouched, and if "[X|Y]" is allowed it is hard to see why > '[X|_]" wouldn't also be allowed in a pattern. It is not clear how having > two different notations would help. Ah - I didn't say anything about two different notations, now did I? In fact, I was thinking about scrapping the separate cons operator altogether. But that's another thing. > The point of the [*], {*}, <<*>> proposal was to have a simple way to > say something that _cannot_ be currently said in a pattern, at least for > [*] and {*}. Yes, that would still be useful (at least for tuples). I just find it unfortunate to use * for that purpose in a proper programming language - it drags in horrible command shell connotations that put a shiver up my spine. What semantics did you have in mind for '[*]' (in Erlang)? The is_list(X) test only checks for is-cons-or-nil. Should [*]/[..] be a synonym, or did you imagine it as checking for proper list-ness? /Richard C. From ulf.wiger@REDACTED Tue Oct 10 14:38:46 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Tue, 10 Oct 2006 14:38:46 +0200 Subject: [erlang-questions] peak months on erlang-questions Message-ID: While digging through the archives, I had reason to note that August was a record month: 1025 messages on the list! The only months I found that had more than 500 messages were: Aug '06: 1025 Feb '03: 740 Jun '06: 623 Sep '06: 621 Mar '03: 542 Jan '06: 526 Feb '06: 514 Apart from the peak in early 2003, all the top months are from this year with August towering above the rest. You can find nice overview graphs at: http://gmane.org/details.php?group=gmane.comp.lang.erlang.general BR, Ulf W From serge@REDACTED Tue Oct 10 18:08:07 2006 From: serge@REDACTED (Serge Aleynikov) Date: Tue, 10 Oct 2006 12:08:07 -0400 Subject: [erlang-questions] Local IP address in UDP packets Message-ID: <452BC567.9080101@hq.idt.net> Hi, We have a UDP server process that starts listening on the {0,0,0,0} address of a host with multiple IPs. It needs to know the local destination IP address that a UDP packet was received on, as well as to force the source IP address for an outgoing packet to be set from a given local IP (using a socket bound to {0,0,0,0}). Currently gen_udp / inet_drv don't support this feature, though this feature is available on some OS's with special socket options. For instance, on Linux IP_PKTINFO socket option gives ancillary packet info containing local address. I'd like to extend inet_drv.c to support this feature. This brings a question on how to do this in a least intrusive manner without breaking existing gen_udp API. I have the following proposal: 1. A new udp socket option gets introduced in inet and gen_udp: local_address 2. If that option is set then: a. packets in active mode are delivered as: {udp, Socket, FromIP, ToIP, InPortNo, Packet} b. packets in passive mode are obtained by: gen_udp:recv(S, Len) -> {ok, {FromAddress, ToAddress, Port, Packet}} | {error, Reason} c. packets are sent using: gen_udp:send(Socket, FromAddress, ToAddress, Port, Packet) This way the new format of received tuples would *only* be effective if the 'local_address' option is set. How does it sound? Serge -- Serge Aleynikov Routing R&D, IDT Telecom Tel: +1 (973) 438-3436 Fax: +1 (973) 438-1464 From ok@REDACTED Wed Oct 11 02:03:43 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 11 Oct 2006 13:03:43 +1300 (NZDT) Subject: [erlang-questions] Bug ?! Message-ID: <200610110003.k9B03hXe366428@atlas.otago.ac.nz> > Remember that the set of operator-like tokens in Prolog is open, > not closed as it is in Erlang, and I was talking about Prolog. Ah. That was a Prolog feature that I was not aware of. (Tried briefly to google for some more details about this, but failed. Got a reference?) Any Prolog manual. Look for op/3. The SWI Prolog manual is available for free download (SWI is open source). > The only variant that was implemented was this: > > ::= '[' ']' > | '[' > ::= ']' > | ',' '..' ']' > | ',' Ok, that was not as general as I first thought. I still think it was too much, though: a pattern that has a matching cost proportional to the size of the input, rather than only to the size of the pattern, is a too powerful primitive (in my opinion) I don't know how this misunderstanding arose. I thought I said quite explicitly before that ", .." was the old spelling for "|". The pattern [X,Y,..Z] in DEC-10 Prolog meant *precisely* the same as [X,Y|Z]. It certainly didn't check that Z was a list. (It couldn't: in Prolog that would have required pattern matching to be able to *generate* the infinite set of lists.) There is one lingering trace of ",.." in ISO Prolog, and that is the "univ" predicate (=..)/2. > Now you are going to confuse the people who expect [X,..,Z] to work. Not much, I don't think, if the basic rule is that patterns do not seek. You expect beginners to know that there _is_ such a rule? It's not an obvious feature of a pattern language; Unix wildcard filenames have no such rule, and the pattern matching language in Interlisp didn't. (My first abandoned Prolog project was a translator from Interlisp list patterns to Prolog patterns. By the time I understood the relationship between the two well enough, I found that I no longer wanted it!) > Changing "|_" to ",.." would trade 6118 shifted keypresses for > 9342 unshifted keypresses. This would indeed reduce the number of > shifted keypresses by about two and a half percent, but since only about > 1 keypress in 8 is shifted, that's not a big saving overall. Ah, but you didn't count the number of extra keypresses needed to delete the mistyped character and try it again from a different key. :-) No, because that is unknowable, and in my experience, close to 0. Clearly your experience, with a different keyboard, is different. > The point of the [*], {*}, <<*>> proposal was to have a simple way to > say something that _cannot_ be currently said in a pattern, at least for > [*] and {*}. Yes, that would still be useful (at least for tuples). I just find it unfortunate to use * for that purpose in a proper programming language - it drags in horrible command shell connotations that put a shiver up my spine. The connotation it drags in for me is "Kleene closure" (think "* in regular expressions"), which is exactly right. What semantics did you have in mind for '[*]' (in Erlang)? The is_list(X) test only checks for is-cons-or-nil. Should [*]/[..] be a synonym, or did you imagine it as checking for proper list-ness? To put it another way, should f(X = [*]) -> g(X). have the effect of f(X) when is_list(X) -> g(X). or of f(X) when length(X) >= 0 -> g(X). If Erlang didn't already have length() in guards, I would be feeling awkward about introducing a kind of pattern that could take a long time. (Mind you, f(X, X) can ALSO take a long time.) In cases where I would like to use [*], I would be processing all the elements later on (or at any rate touching all the cells), so the cost would pay off. I have always felt that is_list(X) is a very misleading way to express is_empty_or_a_pair(X). So [*] in a pattern is equivalent to X in the pattern and length(X) >= 0 added to the guard. From erlangX@REDACTED Wed Oct 11 08:13:48 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Tue, 10 Oct 2006 23:13:48 -0700 Subject: [erlang-questions] Is epmd secure ? (SSL distribution) In-Reply-To: <452A8AAA.3080205@free.fr> References: <452A8AAA.3080205@free.fr> Message-ID: <20061011061348.GS13679@delora.autosys.us> googling for ... distributed erlang firewall provides this thread ... http://www.erlang.org/ml-archive/erlang-questions/200605/msg00336.html ~M On Mon, Oct 09, 2006 at 07:45:14PM +0200, igwan wrote: > Hello, > > I have to connect a number of nodes through the internet. I configured > the SSL distribution mechanism but still have some questions about security. > > - Is the epmd deamon vulnerable ? I noticed that running it in debug > mode (epmd -d) on the console, it receives requests from starting nodes > (even SSL) via IP (am I right ?). Can a attacker send multiple register > requests or resolve request and take the server down this way ? Is the > protocol used by epmd secure when running a SSL node ? > > - Is it possible to set the listen port used by a SSL node in any way ? > Reading through the doc, I tried "-ssl_dist_opt proxylsport 51300" and > "-ssl_dist_opt port 51300" to no avail, I see the epmd trace still show > a random port being registered. > > I have thought of bypassing the epmd thing, and do its work giving a > static configuration, like > [{sslnode1@REDACTED, 51300}, > {sslnode2@REDACTED, 51301}, > {sslnode3@REDACTED, 51300}, > ...] > on each node, but is that possible to configure such things ? > > Sorry if the questions already have been asked, I didn't find anything > related. > > Thanks for your help, > > igwan > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- Michael McDaniel Portland, Oregon, USA http://autosys.us +1 503 283 5284 From igwan@REDACTED Wed Oct 11 12:45:16 2006 From: igwan@REDACTED (igwan) Date: Wed, 11 Oct 2006 12:45:16 +0200 Subject: [erlang-questions] Is epmd secure ? (SSL distribution) In-Reply-To: <20061011061348.GS13679@delora.autosys.us> References: <452A8AAA.3080205@free.fr> <20061011061348.GS13679@delora.autosys.us> Message-ID: <452CCB3C.9060201@free.fr> Many thanx Michael McDaniel a ?crit : > googling for ... > > distributed erlang firewall > > provides this thread ... > > http://www.erlang.org/ml-archive/erlang-questions/200605/msg00336.html > > From jces@REDACTED Wed Oct 11 19:32:15 2006 From: jces@REDACTED (jces@REDACTED) Date: Wed, 11 Oct 2006 10:32:15 -0700 Subject: [erlang-questions] newbie question re: JINI Message-ID: <200610111732.k9BHWF0M016382@mail.monad.com> (I mean to ask this only for edification, not to get into some flame fest :-) I've been reading up a little bit on things like MPI, MPI2 and JINI and noted a curious comment at http://www.artima.com/forums/flat.jsp?forum=276&thread=179964 that "If you need to solve the problem of somehow giving an arbitrarily large number of machines the same bit of byte code, and do that in a secure manner, I don't know of anything else but Jini that can do that." Which led me to wonder how such things are or might be done in Erlang. (I've only just started learning the language - it is hard to find the free time - but the field of parallel/distributed systems is so interesting and of course ever more relevant even to "desktop" folks.) sincerely, -Jon. From chris.newcombe@REDACTED Wed Oct 11 23:00:07 2006 From: chris.newcombe@REDACTED (Chris Newcombe) Date: Wed, 11 Oct 2006 14:00:07 -0700 Subject: [erlang-questions] bug in ibrowse handling of HEAD and DELETE Message-ID: <781dd98c0610111400g68852b2eq8eeaa0fd2bcd4d9b@mail.gmail.com> Hi, I'm using ibrowse to access a web service. (Thankyou for making it available!) I hit a bug when using HEAD or DELETE methods (i.e. those that don't return a response body). The HEAD or DELETE request succeeds, but the ibrowse gen_server's state is not fully reset, so the next request hangs for a timeout of 30+ seconds. I fixed this for my case with the patch below. However, I don't yet use the pipelined-request feature (I do requests one at a time). So I don't know if this is the truly correct fix. i.e. Perhaps State_2#state.cur_req should be set to the tail of of the request queue and not 'undefined'? Sorry, I didn't have time to write tests to check that. regards, Chris Newcombe % diff ibrowse/src/ibrowse_http_client.erl.original ibrowse/src/ibrowse_http_client.erl 658c658 < parse_response(Data_1, State_2#state{reqs=Reqs_1}); --- > parse_response(Data_1, State_2#state{reqs=Reqs_1, cur_req=undefined}); 679c679 < parse_response(Data_1, State_2#state{reqs=Reqs_1}); --- > parse_response(Data_1, State_2#state{reqs=Reqs_1, cur_req=undefined}); From yarivvv@REDACTED Wed Oct 11 23:32:50 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 11 Oct 2006 17:32:50 -0400 Subject: [erlang-questions] Recless Message-ID: <17244f480610111432r31c86c08t1b8f80d500a463af@mail.gmail.com> Hi, I created an experimental parse transform that uses type inference to simplify record access and manipulation syntax. For example, it lets you write this: NewProject = Project.owner.address.city = 'Boston'. instead of this: NewProject = Project#project{owner = (Project#project.owner)#person{address = ((Project#project.owner)#person.address)#address{city = 'Boston'}}}. Recless is about 75% finished, but before I sink any more time into it, I would like to ask the Erlang community members for their feedback. Is this something you want? Do you see any substantial dangers for conflict with the standard Erlang syntax? The full story is here http://yarivsblog.com/articles/2006/10/11/recless-a-type-inferring-parse-transform-for-erlang-experimental Best regards, Yariv From ulf@REDACTED Wed Oct 11 23:57:30 2006 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 11 Oct 2006 23:57:30 +0200 Subject: [erlang-questions] Recless In-Reply-To: <17244f480610111432r31c86c08t1b8f80d500a463af@mail.gmail.com> References: <17244f480610111432r31c86c08t1b8f80d500a463af@mail.gmail.com> Message-ID: Den 2006-10-11 23:32:50 skrev Yariv Sadan : > Hi, > > I created an experimental parse transform that uses type inference to > simplify record access and manipulation syntax. For example, it lets > you write this: > > NewProject = Project.owner.address.city = 'Boston'. > > instead of this: > > NewProject = > Project#project{owner = > (Project#project.owner)#person{address = > ((Project#project.owner)#person.address)#address{city = > 'Boston'}}}. > > Recless is about 75% finished, but before I sink any more time into > it, I would like to ask the Erlang community members for their > feedback. Is this something you want? Do you see any substantial > dangers for conflict with the standard Erlang syntax? I thought that this example: NewProject = Project.owner.address.city = "Boston". clashes with existing syntax. How about: NewProject = Project.owner.address{city = "Boston"} Because you can perfectly well do this today: X = Y = 17 which binds both X and Y to 17. You may also want to think about how it clashes with packages (if it does - I can't come up with an example at the moment.) Otherwise, I like the idea. BR, Ulf W -- Ulf Wiger From yarivvv@REDACTED Thu Oct 12 01:01:25 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 11 Oct 2006 19:01:25 -0400 Subject: [erlang-questions] Recless In-Reply-To: References: <17244f480610111432r31c86c08t1b8f80d500a463af@mail.gmail.com> Message-ID: <17244f480610111601j6c3a9934pb618ca1979c03b8a@mail.gmail.com> Hi, > > NewProject = Project.owner.address{city = "Boston"} The above statement results in an invalid syntax error when I try to parse it with io:parse_erl_expr. It clearly doesn't conflict with the Erlang syntax, but the existing Erlang parser doesn't allow it. Any other ideas? Thanks Yariv From alex.arnon@REDACTED Thu Oct 12 07:48:29 2006 From: alex.arnon@REDACTED (Alex Arnon) Date: Thu, 12 Oct 2006 07:48:29 +0200 Subject: [erlang-questions] Recless In-Reply-To: <17244f480610111601j6c3a9934pb618ca1979c03b8a@mail.gmail.com> References: <17244f480610111432r31c86c08t1b8f80d500a463af@mail.gmail.com> <17244f480610111601j6c3a9934pb618ca1979c03b8a@mail.gmail.com> Message-ID: <944da41d0610112248t6f3e5ad2q1005985a3951a7b3@mail.gmail.com> I think Ulf's idea is solid - it would also allow one to set several fields at once. In any case, ANYTHING that will make record access more terse (and "sane":) ) is welcome :). On 10/12/06, Yariv Sadan wrote: > > Hi, > > > > > NewProject = Project.owner.address{city = "Boston"} > > The above statement results in an invalid syntax error when I try to > parse it with io:parse_erl_expr. It clearly doesn't conflict with the > Erlang syntax, but the existing Erlang parser doesn't allow it. Any > other ideas? > > Thanks > Yariv > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bob.Cowdery@REDACTED Thu Oct 12 08:59:25 2006 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Thu, 12 Oct 2006 07:59:25 +0100 Subject: [erlang-questions] Packaging for distribution Message-ID: <3A76756EED583B43A4AD704E29CCD079715CBB@mail.aprsmartlogik.com> Hi I am trying to promote erlang for some commercial work we are doing. The sticking point is a lack of any distribution format that could package it as an executable. I understand that stand-alone erlang has not been maintained. What do people do for packaging and distribution? Thanks Bob From ml.cyresse@REDACTED Thu Oct 12 09:02:50 2006 From: ml.cyresse@REDACTED (Liam Clarke) Date: Thu, 12 Oct 2006 20:02:50 +1300 Subject: [erlang-questions] List comprehensions Message-ID: <452DE89A.1010508@gmail.com> Hi all, Just reading the manual on list comprehensions, and looking at the comprehension to return all permutations of a sequence: perms([]) ->[[]]; perms(L) -> [[H|T] || H <- L, T <- perms(L--[H])]. I'm having trouble with understanding what's happening. I assume it's evaluated left to right from the ||, and I'm sort of grasping the general interplay of the generators and the recursion, but I'm also missing it at the same point. I think I get how dual generators work now - [[H|[T]] || H <- [a,b,c],T <- [1,2,3]] will yield [[a,1],[a,2],[a,3],[b,1],[b,2],[b,3],[c,1],[c,2],[c,3]] How could I rewrite the permutations comprehension as a function so I can sprinkle it with io:format()s so as to understand what's happening better? Regards, Liam Clarke From vladdu55@REDACTED Thu Oct 12 09:25:01 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 12 Oct 2006 09:25:01 +0200 Subject: [erlang-questions] Recless In-Reply-To: <944da41d0610112248t6f3e5ad2q1005985a3951a7b3@mail.gmail.com> References: <17244f480610111432r31c86c08t1b8f80d500a463af@mail.gmail.com> <17244f480610111601j6c3a9934pb618ca1979c03b8a@mail.gmail.com> <944da41d0610112248t6f3e5ad2q1005985a3951a7b3@mail.gmail.com> Message-ID: <95be1d3b0610120025vb074d79q9a9727fa34e628e7@mail.gmail.com> hi, This looks like a good idea to work further with. There are some problems about it, however: * the syntax issue, of course. I think that attempts to just use a parse transform (as opposed to change the parser itself) won't provide very readable results. Or as with the a.b.c.d suggestion, it will clash with something else. * since one is required to declare the types of record variables, I'm not sure how easy it would be to use. Should the default value of a record field serve as a type declaration? How to handle 'undefined' values then? We would have to handle the equivalent of NullPointerExceptions :-\ Finally, as a personal wish, I would rather see an implementation of Richard O'Keefe's abstract patterns proposal (see http://www.erlang.org/ml-archive/erlang-questions/200309/msg00309.html). It might need to be revised a little, since it is a few years old. best regards, Vlad From chsu79@REDACTED Thu Oct 12 09:43:03 2006 From: chsu79@REDACTED (Christian S) Date: Thu, 12 Oct 2006 09:43:03 +0200 Subject: [erlang-questions] newbie question re: JINI In-Reply-To: <200610111732.k9BHWF0M016382@mail.monad.com> References: <200610111732.k9BHWF0M016382@mail.monad.com> Message-ID: On 10/11/06, jces@REDACTED wrote: > that "If you need to solve the problem of somehow giving an arbitrarily > large number of machines the same bit of byte code, and do that in a > secure manner, I don't know of anything else but Jini that can do that." > Which led me to wonder how such things are or might be done in Erlang. Erlang distribution doesnt have such a security model. It is full access or no access . You need to implement your own security on top of it, such as building an evaluator/interpreter for parse trees. Of course it has to only allow code to do "secure" things. Otherwise you have to backend in underlying security (such as unix process sandboxing), one erlang vm per user on the arbitrary large number of machines. From klacke@REDACTED Thu Oct 12 10:00:43 2006 From: klacke@REDACTED (Claes Wikstrom) Date: Thu, 12 Oct 2006 10:00:43 +0200 Subject: [erlang-questions] Packaging for distribution In-Reply-To: <3A76756EED583B43A4AD704E29CCD079715CBB@mail.aprsmartlogik.com> References: <3A76756EED583B43A4AD704E29CCD079715CBB@mail.aprsmartlogik.com> Message-ID: <452DF62B.4040808@hyber.org> Bob Cowdery wrote: > Hi > > I am trying to promote erlang for some commercial work we are doing. > The sticking point is a lack of any distribution format that could package it as an executable. The most straightforward is a tailor made shell script which a) parses your cmdline flags and b) invokes erlang Possibly together with an install script which sed's the install dir into a bunch of relevant files Nothing fancy - but workable /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control cellphone: +46 70 2097763 From ke.han@REDACTED Thu Oct 12 10:49:55 2006 From: ke.han@REDACTED (ke han) Date: Thu, 12 Oct 2006 16:49:55 +0800 Subject: [erlang-questions] Packaging for distribution In-Reply-To: <3A76756EED583B43A4AD704E29CCD079715CBB@mail.aprsmartlogik.com> References: <3A76756EED583B43A4AD704E29CCD079715CBB@mail.aprsmartlogik.com> Message-ID: <21977CE3-54B8-41D6-81C4-1204D28846F9@redstarling.com> Bob, Package as an executable? If this is a sticking point, I suppose you have to add Java, Perl, Ruby and just about any other language to this category. The general approach is to have your language, erlang original and third party libraries in their default system install structure and then have your custom app in its own structure. Then just run erlang and reference your environment constraints. Erlang does a very good job of being able to install multiple version of erts and libraries within the same structure. Notice the version number after library name directories? erts follows this same version convention as this allows different version of core erlang and libraries to coexist on the same server. You can choose which version of erts and libraries to use by erlang's app config file methods or do something custom in your app to load the versions of libraries you want. Having things for a packaged executable install (like a Windows client app) is not compatible with general server admin practices. Assuming you are talking about a server app. If you need a packaged client for use in what is generally poorly managed client workstations, then we're back to needing some different packaging tools. The bottom line is that for server apps, erlang does a very good job of following tried and true Unix admin practices. ke han On Oct 12, 2006, at 2:59 PM, Bob Cowdery wrote: > Hi > > I am trying to promote erlang for some commercial work we are > doing. The sticking point is a lack of any distribution format that > could package it as an executable. I understand that stand-alone > erlang has not been maintained. What do people do for packaging and > distribution? > > Thanks > Bob > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From richardc@REDACTED Thu Oct 12 11:22:14 2006 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 12 Oct 2006 11:22:14 +0200 Subject: [erlang-questions] List comprehensions In-Reply-To: <452DE89A.1010508@gmail.com> References: <452DE89A.1010508@gmail.com> Message-ID: <452E0946.3050304@it.uu.se> Liam Clarke wrote: > How could I rewrite the permutations comprehension as a function so I > can sprinkle it with io:format()s so as to understand what's happening > better? I really don't think that would be much helpful in this case. It drowns you in mostly irrelevant details instead of helping you focus on the concept of comprehensions. More below. > I think I get how dual generators work now - > [[H|[T]] || H <- [a,b,c],T <- [1,2,3]] > > will yield > > [[a,1],[a,2],[a,3],[b,1],[b,2],[b,3],[c,1],[c,2],[c,3]] Yes. Note that [H | [T] ] could be written [H | [T | [] ] ], or (much simpler) [H, T]. Contrast this to [H | T], which "adds" H to the beginning of the list T. It's a bit misleading to use 'T' in the former case, since it is not used as a "tail", but as a second element. > perms([]) ->[[]]; > perms(L) -> > [[H|T] || H <- L, T <- perms(L--[H])]. > > I'm having trouble with understanding what's happening. I assume it's > evaluated left to right from the ||, and I'm sort of grasping the > general interplay of the generators and the recursion, but I'm also > missing it at the same point. Read it like this: An empty list only has one, trivial, permutation. For a nonempty list L, its permutations are all lists [H|T] such that: - the first element H is an element in L - the rest (T) is a permutation of the remaining elements of L after you remove the element H. Since the two generators will produce all combinations of picking an element H in L and some permutation of L--[H], you know you will get all permutations of L. You also know what order the combinations will be produced in (compare your dual generator example above), since this is part of the specified behaviour of list comprehensions. Try to think equationally rather than procedurally; it helps not only here, but in most kinds of recursive functions. /Richard From chandrashekhar.mullaparthi@REDACTED Thu Oct 12 11:27:15 2006 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Thu, 12 Oct 2006 10:27:15 +0100 Subject: [erlang-questions] bug in ibrowse handling of HEAD and DELETE In-Reply-To: <781dd98c0610111400g68852b2eq8eeaa0fd2bcd4d9b@mail.gmail.com> References: <781dd98c0610111400g68852b2eq8eeaa0fd2bcd4d9b@mail.gmail.com> Message-ID: Hi Chris, Thanks for the bug report. I've made a fix and checked it into jungerl in sourceforge. I've tested the fix and it works. I've done a bit of regression testing and all looks ok. cheers Chandru On 11/10/06, Chris Newcombe wrote: > > Hi, > > I'm using ibrowse to access a web service. (Thankyou for making it > available!) > > I hit a bug when using HEAD or DELETE methods (i.e. those that don't > return a response body). > > The HEAD or DELETE request succeeds, but the ibrowse gen_server's > state is not fully reset, so the next request hangs for a timeout of > 30+ seconds. > > I fixed this for my case with the patch below. > > However, I don't yet use the pipelined-request feature (I do requests > one at a time). So I don't know if this is the truly correct fix. > i.e. Perhaps State_2#state.cur_req should be set to the tail of of the > request queue and not 'undefined'? Sorry, I didn't have time to write > tests to check that. > > regards, > > Chris Newcombe > > % diff ibrowse/src/ibrowse_http_client.erl.original > ibrowse/src/ibrowse_http_client.erl > 658c658 > < parse_response(Data_1, State_2#state{reqs=Reqs_1}); > --- > > parse_response(Data_1, State_2#state{reqs=Reqs_1, > cur_req=undefined}); > 679c679 > < parse_response(Data_1, State_2#state{reqs=Reqs_1}); > --- > > parse_response(Data_1, State_2#state{reqs=Reqs_1, > cur_req=undefined}); > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yarivvv@REDACTED Thu Oct 12 14:34:29 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 12 Oct 2006 08:34:29 -0400 Subject: [erlang-questions] Recless In-Reply-To: <95be1d3b0610120025vb074d79q9a9727fa34e628e7@mail.gmail.com> References: <17244f480610111432r31c86c08t1b8f80d500a463af@mail.gmail.com> <17244f480610111601j6c3a9934pb618ca1979c03b8a@mail.gmail.com> <944da41d0610112248t6f3e5ad2q1005985a3951a7b3@mail.gmail.com> <95be1d3b0610120025vb074d79q9a9727fa34e628e7@mail.gmail.com> Message-ID: <17244f480610120534w5b298e62m5b9cf6f582f9c02a@mail.gmail.com> Hi > This looks like a good idea to work further with. > > There are some problems about it, however: > * the syntax issue, of course. I think that attempts to just use a > parse transform (as opposed to change the parser itself) won't provide > very readable results. Or as with the a.b.c.d suggestion, it will > clash with something else. Recless only applies a transformation to expressions that start with a variable name, e.g. A.b.c.d but not a.b.c.d (at least, that's what it *should* do -- otherwise, it's a bug). If it can't ascertain that A is of a record type that has the field 'c', and that 'c' the field 'c' is an instance of a record type has a field 'd', then it will compain about a type inference error but and abandon the transformation. Btw, only setters currently have the aformentioned syntax conflict. Getters are safe (I'm pretty sure). E.g. Ciry = Project.owner.city works. > * since one is required to declare the types of record variables, > I'm not sure how easy it would be to use. Should the default value of > a record field serve as a type declaration? How to handle 'undefined' > values then? We would have to handle the equivalent of > NullPointerExceptions :-\ Recless does look at the default declaration for a record. It searches for fields that are records by default, and when it sees a record instantiation, it applies the full type to the variable it matches against. For example, this works: -record(bar, {d,e,f = "baz"}). -record(foo, {a,b,c=bar{})). test() -> A = foo{} undefined = A.b, "baz" = A.c.f. Recless also understands lists and tuple matching. E.g. [A.B] = [foo{}, foo{}], "baz" = A.c.f, "baz" = B.c.f works. > > Finally, as a personal wish, I would rather see an implementation of > Richard O'Keefe's abstract patterns proposal (see > http://www.erlang.org/ml-archive/erlang-questions/200309/msg00309.html). > It might need to be revised a little, since it is a few years old. That would be very nice :) Regards, Yariv From yarivvv@REDACTED Thu Oct 12 14:40:26 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 12 Oct 2006 08:40:26 -0400 Subject: [erlang-questions] Recless In-Reply-To: <17244f480610120534w5b298e62m5b9cf6f582f9c02a@mail.gmail.com> References: <17244f480610111432r31c86c08t1b8f80d500a463af@mail.gmail.com> <17244f480610111601j6c3a9934pb618ca1979c03b8a@mail.gmail.com> <944da41d0610112248t6f3e5ad2q1005985a3951a7b3@mail.gmail.com> <95be1d3b0610120025vb074d79q9a9727fa34e628e7@mail.gmail.com> <17244f480610120534w5b298e62m5b9cf6f582f9c02a@mail.gmail.com> Message-ID: <17244f480610120540u3217e983vdafd6ecba7e0b5b0@mail.gmail.com> Sorry, typo: > > [A.B] = [foo{}, foo{}], [A,B] = [foo{}, foo{}] (A and B are separated by a comma). From dirtyundies@REDACTED Fri Oct 13 01:14:33 2006 From: dirtyundies@REDACTED (Mikkel Jensen) Date: Thu, 12 Oct 2006 16:14:33 -0700 (PDT) Subject: [erlang-questions] Yaws on Windows Message-ID: <6787026.post@talk.nabble.com> Hi, I'm using Erlide and the Maven plugin to develop an Erlang application on XP. I would like to be able to run Yaws as part of the application but I can't find a way to install it!? Since Yaws is written entirely in Erlang I would think I could just compile the .erl and .hrl files along with my other project files. It compiles fine but gives the following error on start: ** exited: {{badmatch,{error,{"no such file or directory","yaws.app"}}}, [{yaws,start_embedded,3}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** I guess I'm missing something fundamental here, but what? - Mikkel -- View this message in context: http://www.nabble.com/Yaws-on-Windows-tf2433937.html#a6787026 Sent from the Erlang Questions mailing list archive at Nabble.com. From tobbe@REDACTED Fri Oct 13 08:27:03 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Fri, 13 Oct 2006 08:27:03 +0200 Subject: [erlang-questions] Yaws on Windows In-Reply-To: <6787026.post@talk.nabble.com> References: <6787026.post@talk.nabble.com> Message-ID: Look at the Yaws wiki and see if that can be of any help: http://yaws.hyber.org/wiki/showPage.yaws?node=home --Tobbe Mikkel Jensen wrote: > Hi, > > I'm using Erlide and the Maven plugin to develop an Erlang application on > XP. > I would like to be able to run Yaws as part of the application but I can't > find a way to install it!? > Since Yaws is written entirely in Erlang I would think I could just compile > the .erl and .hrl files along with my other project files. > It compiles fine but gives the following error on start: > > ** exited: {{badmatch,{error,{"no such file or directory","yaws.app"}}}, > [{yaws,start_embedded,3}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > I guess I'm missing something fundamental here, but what? > > - Mikkel From Bob.Cowdery@REDACTED Fri Oct 13 09:12:57 2006 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Fri, 13 Oct 2006 08:12:57 +0100 Subject: [erlang-questions] Packaging for distribution Message-ID: <3A76756EED583B43A4AD704E29CCD079741189@mail.aprsmartlogik.com> Thankyou for all the replies which I am following through. Just to add some information, some customers in sensitive industries only allow certified applications and dynamic libraries. Embedding everything in the application executable avoids these issues. There are lots of grey areas around this that I don't fully understand yet but in essence the less pieces that end up in the file system the better. Ideally I'm looking for something equivalent to PyToExe for Python. Regards Bob -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED]On Behalf Of Bob Cowdery Sent: 12 October 2006 07:59 To: Erlang-Questions (E-mail) Subject: [erlang-questions] Packaging for distribution Hi I am trying to promote erlang for some commercial work we are doing. The sticking point is a lack of any distribution format that could package it as an executable. I understand that stand-alone erlang has not been maintained. What do people do for packaging and distribution? Thanks Bob _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From dmitriid@REDACTED Fri Oct 13 10:09:36 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Fri, 13 Oct 2006 11:09:36 +0300 Subject: [erlang-questions] Yaws on Windows In-Reply-To: <6787026.post@talk.nabble.com> References: <6787026.post@talk.nabble.com> Message-ID: On 10/13/06, Mikkel Jensen wrote: > > > Hi, > > I'm using Erlide and the Maven plugin to develop an Erlang application on > XP. > I would like to be able to run Yaws as part of the application but I can't > find a way to install it!? You need this link: http://yaws.hyber.org/wiki/showPage.yaws?node=YawsAndWin32 Since Yaws is written entirely in Erlang I would think I could just compile > the .erl and .hrl files along with my other project files. > It compiles fine but gives the following error on start: > > ** exited: {{badmatch,{error,{"no such file or directory","yaws.app"}}}, > [{yaws,start_embedded,3}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > I guess I'm missing something fundamental here, but what? > > - Mikkel > -- > View this message in context: > http://www.nabble.com/Yaws-on-Windows-tf2433937.html#a6787026 > Sent from the Erlang Questions mailing list archive at Nabble.com. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gefla@REDACTED Fri Oct 13 10:41:48 2006 From: gefla@REDACTED (Gerd Flaig) Date: Fri, 13 Oct 2006 10:41:48 +0200 Subject: [erlang-questions] Parenting needed References: <4523B4F0.9080208@icecom.fi> Message-ID: <87lknktxo3.fsf@kilo.pond.sub.org> Sami V?is?nen writes: > In other words what I'm asking is some kind of general guidelines or > ideas how to possibly structure the system and what to start looking > at. Basically just gentle poking in the right direction. one thing I wonder about: As far as I understand, your C++ services act on streams of messages and produce streams of messages. Why put them all in the same address space instead of connecting them to your Erlang nodes via open_port? That way, you get better fault isolation. Regarding request routing, it's hard to give much meaningful advice without knowing more about your goals. A simple implementation may use pg2 to create a process group for each service, which is used by a request router running on each node to pass the request and caller information to the service. Pg2 chooses a local process in the group if there is one, otherwise it chooses one randomly. If you need load balancing, you could make your request router broadcast (e.g. via rpc:abcast(nodes(), request_router, ...)) load information, integrate received load information and use that for request routing. I found the OTP documentation most helpful, so I'd recommend digging deeper into it. There's a wealth of information in there. Pay special attention to the kernel and stdlib documentation. Goodbyte, Gerd. -- The last thing one knows in constructing a work is what to put first. -- Blaise Pascal From jay@REDACTED Fri Oct 13 14:10:58 2006 From: jay@REDACTED (Jay Nelson) Date: Fri, 13 Oct 2006 05:10:58 -0700 Subject: [erlang-questions] Parallel List Comprehension Message-ID: <452F8252.1060100@duomark.com> Sounds sort of like overkill doesn't it? I want to be able to read in a GB-sized binary, chop it into a list of sub-binaries very quickly and then filter some subset of the 1M+ elements that result. The final step would be to hang on to the 15 elements I care about, drop all references to the original binary and purge the excess from memory. It would be nice if my shiny new 80-core Intel chip could help me out here! Granted, if my architecture is such that it requires copying the initial data it might not pay off well. But let's take the current situation where I can have 4, 8 or 16 schedulers and presumably can arrange that very large binary to be shared. As long as my elements are big enough, they will also be pointing to the original shared binary. The trick now is returning the resulting list. The 2nd most straight forward approach on four cores would give me (I only wrote it this way to show why there are 4 different results that are each lists -- Core1 etc represents the first element, Results1 represents the rest of the list): [[Core1 | Results1], [Core2 | Results2], [Core3 | Results3], [Core4 | Results4]] (because the 1st most straight forward approach would give me 4 lists which would get appended or flattened and result in rewriting those millions of cons cells, possibly running out of memory in the process). Not particularly appealing. I could accomplish this by slicing the list myself, spinning off separate processes and collecting the results. If I could query for the number of schedulers it would be somewhat flexibly but still icky. Now suppose the compiler or runtime could arrange this for me very efficiently. The best I could come up with is an open-cdr coded list that gets nconc'ed to reuse the space (hmm, that probably makes no sense unless you happen to be an old time lisper). Suppose the runtime determined there would be a benefit in parallelizing the comprehension*. It could construct an internal "list of open ended elements" which was some new internal data type that cannot be generated any other way than by a list comprehension. In the above example, the lists are illegal in the following way: every ResultsX has as its final two elements [LastElement . OpenCdrFlag] OpenCdrFlag would be a new internal atom that represents a lazy value that has not been supplied yet. A list terminated by OpenCdrFlag can only be a member of the internal "list of open ended elements" or a return value. The recipe is like this: 1) Determine how many schedulers to use 2) Split the list into non-overlapping serial sections (could be pipelined to each scheduler and have it bite off just the head number of elements it needs before passing it on) 3) Run a list comprehension in parallel for each chunk 4) Return each result as an OpenCdrList 5) Collect the results in an internal "list of open ended elements" in serial order 6) nconc them together (replace the OpenCdrFlag with a pointer to the next open list and null in the last) An "open ended element" should have a header field that indicates the location of the OpenCdrFlag so the append is very fast. Similar thinking should go into the plans for binary comprehensions. -------- *Hand waving here... Ok, initially it might be easiest to let the user decide by using [ 2*X ||| X <-List] where the three vertical bars means do it in parallel. This would allow an experimental implementation that wouldn't impact anyone. Later we could try to make it more automatic. [The problem is if you have to scan the list to see how big it is relative to the number of processors, you might as well not parallelize or do the scanning in parallel and abort the comprehension if it will take too long.] --------- Any thoughts? jay From chsu79@REDACTED Fri Oct 13 14:46:55 2006 From: chsu79@REDACTED (Christian S) Date: Fri, 13 Oct 2006 14:46:55 +0200 Subject: [erlang-questions] Parallel List Comprehension In-Reply-To: <452F8252.1060100@duomark.com> References: <452F8252.1060100@duomark.com> Message-ID: > Any thoughts? I dont understand what you're talking about. This gigabyte size chunk of data contains of some kind of blocks around 1kb in size so it amounts to about a million of them? You want to paralellize the processing of these blocks? From ingela@REDACTED Fri Oct 13 17:11:49 2006 From: ingela@REDACTED (Ingela Anderton) Date: Fri, 13 Oct 2006 17:11:49 +0200 Subject: [erlang-questions] Inets is alive and kicking ;) Message-ID: <17711.44213.176539.194072@gargle.gargle.HOWL> Hi! I have been away for a while (parental leave), and during this time there has been some some reports of problems with the inets http client, especially regarding chunked encoding. I just want to say that I have found those bugs and fixed them. (Some inets bugs where also fixed by my co-workers but proably not announced on this list). Here is a list of things that I have done since I came back and that are being released in a near future: Bug fixes ---------- Extensions and trailers where not properly handled by the chunk decoding implementation. In some cases if a body contained the sequence "\r\n0" and was chunked encoded this sequence was incorrectly interpreted as the last chunk. A request resulting in an empty body is now returned without any delays. When http:request/4 was used with a configured proxy, and the webserver returns 3XX code, http:request/4 entered an endless loop. Two problems was solved in this area, the absolute uri is now updated when a redirect is issued, so that the problem in this case will not arise, and the redirection endless loop detection was fixed so that will actually detect potential endless loops. http_request.erl didn't handle https URIs, which meant that redirects from ESI did not work. New features ------------ When using asynchronous HTTP-request it is now possible to receive "200-responses" as streams instead of having to wait until the whole response has been delivered. Possibility to stream a request body to a file. -- m.v.h Ingela Ericsson AB - OTP team From cyberlync@REDACTED Fri Oct 13 20:40:01 2006 From: cyberlync@REDACTED (Eric Merritt) Date: Fri, 13 Oct 2006 11:40:01 -0700 Subject: [erlang-questions] Reason for "format string not a textual constant" Message-ID: Guys, I have a little build system that I put together. By default it turns on all of the available warnings/error messages. For the most part this is a good thing. However, in a couple of places where pass a non-constant string to io:format I get the warning "format string not a textual constant". Whats the reasoning behind this warning? Thanks, Eric From patrickerj@REDACTED Sat Oct 14 18:59:09 2006 From: patrickerj@REDACTED (Pat e) Date: Sat, 14 Oct 2006 18:59:09 +0200 Subject: [erlang-questions] Erlang mail server Message-ID: Hello, Is there any kind of appropriate mail server written in Erlang that can be comparable to postfix or qmail server? If there are Yaws and (E)jabber, then why the heck i can't find (E)mail?? Thank you in advance, Patrick From chsu79@REDACTED Sat Oct 14 19:41:28 2006 From: chsu79@REDACTED (Christian S) Date: Sat, 14 Oct 2006 19:41:28 +0200 Subject: [erlang-questions] Erlang mail server In-Reply-To: References: Message-ID: Because you havent written it yet. On 10/14/06, Pat e wrote: > If there are Yaws and (E)jabber, then why the heck i can't find (E)mail?? From nightphotos@REDACTED Sat Oct 14 23:02:26 2006 From: nightphotos@REDACTED (Wayne Vucenic) Date: Sat, 14 Oct 2006 14:02:26 -0700 Subject: [erlang-questions] Parallel List Comprehension In-Reply-To: <452F8252.1060100@duomark.com> References: <452F8252.1060100@duomark.com> Message-ID: Hi Jay, I really like your open-cdr coded list idea. Prolog has a similar construct, the difference-list. Difference-lists are efficient, and often lead to elegant implementations. Prolog doesn't limit this to lists, nor restrict it to the final element, but allows any kind of incomplete data structure. Perhaps we could generalize your proposal to also allow tuples of the form {foo, openCdrFlag, {bar, baz}} where we can nconc a list or tuple in place of the openCdrFlag. (In this case we should pick a more general name than openCdrFlag). Wayne --- Wayne Vucenic No Bugs Software Ruby, C#, and Erlang Agile Contract Programming in Silicon Valley On 10/13/06, Jay Nelson wrote: > Sounds sort of like overkill doesn't it? I want to be able to read in a > GB-sized binary, chop it into a list of sub-binaries very quickly and > then filter some subset of the 1M+ elements that result. The final step > would be to hang on to the 15 elements I care about, drop all references > to the original binary and purge the excess from memory. > > It would be nice if my shiny new 80-core Intel chip could help me out here! > > Granted, if my architecture is such that it requires copying the initial > data it might not pay off well. But let's take the current situation > where I can have 4, 8 or 16 schedulers and presumably can arrange that > very large binary to be shared. As long as my elements are big enough, > they will also be pointing to the original shared binary. The trick now > is returning the resulting list. > > The 2nd most straight forward approach on four cores would give me (I > only wrote it this way to show why there are 4 different results that > are each lists -- Core1 etc represents the first element, Results1 > represents the rest of the list): > > [[Core1 | Results1], [Core2 | Results2], [Core3 | Results3], [Core4 | > Results4]] > > > (because the 1st most straight forward approach would give me 4 lists > which would get appended or flattened and result in rewriting those > millions of cons cells, possibly running out of memory in the process). > > > Not particularly appealing. I could accomplish this by slicing the list > myself, spinning off separate processes and collecting the results. If > I could query for the number of schedulers it would be somewhat flexibly > but still icky. > > > Now suppose the compiler or runtime could arrange this for me very > efficiently. The best I could come up with is an open-cdr coded list > that gets nconc'ed to reuse the space (hmm, that probably makes no sense > unless you happen to be an old time lisper). > > Suppose the runtime determined there would be a benefit in parallelizing > the comprehension*. It could construct an internal "list of open ended > elements" which was some new internal data type that cannot be generated > any other way than by a list comprehension. In the above example, the > lists are illegal in the following way: > > every ResultsX has as its final two elements [LastElement . OpenCdrFlag] > > OpenCdrFlag would be a new internal atom that represents a lazy value > that has not been supplied yet. A list terminated by OpenCdrFlag can > only be a member of the internal "list of open ended elements" or a > return value. > > > The recipe is like this: > > 1) Determine how many schedulers to use > 2) Split the list into non-overlapping serial sections (could be > pipelined to each scheduler and have it bite off just the head number of > elements it needs before passing it on) > 3) Run a list comprehension in parallel for each chunk > 4) Return each result as an OpenCdrList > 5) Collect the results in an internal "list of open ended elements" in > serial order > 6) nconc them together (replace the OpenCdrFlag with a pointer to the > next open list and null in the last) > > An "open ended element" should have a header field that indicates the > location of the OpenCdrFlag so the append is very fast. > > > Similar thinking should go into the plans for binary comprehensions. > > > -------- > *Hand waving here... > > > Ok, initially it might be easiest to let the user decide by using [ 2*X > ||| X <-List] > where the three vertical bars means do it in parallel. This would > allow an experimental implementation that wouldn't impact anyone. Later > we could try to make it more automatic. > > [The problem is if you have to scan the list to see how big it is > relative to the number of processors, you might as well not parallelize > or do the scanning in parallel and abort the comprehension if it will > take too long.] > > --------- > > > Any thoughts? > > jay > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From fritchie@REDACTED Sat Oct 14 23:59:23 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Sat, 14 Oct 2006 16:59:23 -0500 Subject: [erlang-questions] ErlLounge in the San Francisco/San Jose area? Message-ID: <200610142159.k9ELxNeV010516@snookles.snookles.com> Good afternoon. As I've started packing for a flight out to San Francisco to visit my employer's HQ, I asked myself ... Hey, I've never tried triggering/organizing an ErlLounge out there. I'll be in San Mateo (not quite half-way between San Francisco and San Jose) for a week and a half, starting tomorrow 10/16. If there are other Erlang folk who'd like to get together for an ErlLounge(*) between then and 10/25, please email me. If you have a suggestion of where to meet, please suggest! (I'm from Minneapolis, so I'd accept any advice from a local/native.) According to my schedule, the evenings of Monday 10/23 and Tuesday 10/24 look like the most promising nights. I know that I'm busy on Wednesday 10/18 and could not attend on that night. -Scott (*) ErlLounge: noun? intransitive verb? To drink beer, eat food, and talk about Erlang. Usually in that order. From nightphotos@REDACTED Sun Oct 15 21:33:33 2006 From: nightphotos@REDACTED (Wayne Vucenic) Date: Sun, 15 Oct 2006 12:33:33 -0700 Subject: [erlang-questions] escript lives In-Reply-To: <9b08084c0610050122q27e7ca66le3a6d1a1d9dc6841@mail.gmail.com> References: <9b08084c0610050122q27e7ca66le3a6d1a1d9dc6841@mail.gmail.com> Message-ID: Hi Joe, > 9) I start writing a book. <>. I'm definitely looking forward to your new book. Is it available yet? > I would be grateful if you could let me know of any abnormalities that > occur on other platforms - also if any windows users can run this I'd > like to know what you think the best way to set this up is. I'd like to get this working on Windows. I decided to start with Mac OS X as I expected that to be easier. It wasn't hard to get it running, but I did encounter several of those abnormalities: I'm using Erlang R11B-1 on Mac OS X 10.4.7 with bash. Mini:~/erlang/escript-4.0 wayne$ make erlc escript.erl make: *** No rule to make target `.beam', needed by `all'. Stop. as the erlc line above suggests, it actually did make the .beam file, so I'm not sure why it thinks it needs to remake it but can't. Mini:~/erlang/escript-4.0 wayne$ ls Makefile escript.erl factorial fibi make_d_output escript.beam escript.html fibc history mk_escript.sh Mini:~/erlang/escript-4.0 wayne$ make make: *** No rule to make target `.beam', needed by `all'. Stop. I've attached the output from "make -d", in case that sheds some light on this. to work around this, I changed the Makefile line all: ${BEAM_FILES} escript to all: escript.beam escript this gets us past the .beam error, but now it has trouble making escript Mini:~/erlang/escript-4.0 wayne$ make ./mk_escript.sh make: ./mk_escript.sh: Command not found make: *** [escript] Error 127 so I tried running mk_escript.sh directly, rather than with make Mini:~/erlang/escript-4.0 wayne$ ./mk_escript.sh : bad interpreter: No such file or directory apparently it doesn't like the #! /bin/bash line, but that is the correct path to bash: Mini:~/erlang/escript-4.0 wayne$ which bash /bin/bash so I removed the #! line and tried again Mini:~/erlang/escript-4.0 wayne$ ./mk_escript.sh : command not foundne 9: (the above is not a typo, it really did say "foundne") Now it apparently doesn't like that line 9 is blank, so I remove line 9 And it works: Mini:~/erlang/escript-4.0 wayne$ ./mk_escript.sh Mini:~/erlang/escript-4.0 wayne$ ./fibc 20 fib 20 = 10946 Let me know if you'd like me to try anything else on OS X. It may be a little while before I have time to try this on Windows, but when I do I'll post my results. Wayne --- Wayne Vucenic No Bugs Software Ruby, C#, and Erlang Agile Contract Programming in Silicon Valley On 10/5/06, Joe Armstrong wrote: > I have made escript work again. 'twas lost - but now it is found. > > Escript is a scripting interface to Erlang (see the history below) > > Questions: This is tested only on Solaris and bash on R11B > > The script bit needs some funny quoting that may not work on other systems. > > I would be grateful if you could let me know of any abnormalities that occur > on other platforms - > also if any windows users can run this I'd like to know what you think the > best way to > set this up is. > > /Joe > 1) 3-april-2001 > > Joe Armstrong amd Robert Virding write escript. > > This is a pure erlang applications that allows erlang modules > to be used as scripts: > > Example: > > ./factorial 123 > factorial 123 = > 1214630436702532967576624324188129585545 > > 4217088483382315328918161829235892362167 > > 6688311569606126402021707358352212940477 > > 8259109157041165147218602951990626164673 > > 0733907419814952960000000000000000000000 > 000000 > > The file factorial contains the following: > > #!/usr/bin/env escript > > %% > %% Usage: > %% factorial > > %% Example of an interpreted script > > -export([main/1]). > > main([X]) -> > case (catch list_to_integer(X)) of > {'EXIT', _} -> > usage(); > J -> > N = fac(J), > io:format("factorial ~w = ~w~n",[J, N]) > end; > main(_) -> > usage(). > > usage() -> > io:format("Usage factorial ~n"). > > fac(0) -> 1; > fac(N) -> > N * fac(N-1). > > 2) Escript has a rather long startup time > > time ./factorial 1 > ... > real 0m0.745s > > So I investigated why. The reason has to do with code loading ... > > 3) I wrote SAE - stand-alone Erlang to solve this > Then I implemented escript in SAE > > escript with SAE started very quickly (0.0N) seconds (ish) > > 4) Integration of SAE with the standard release was pretty difficult > (lots of modules have to be changed) > > 5) SAE never made it into the main release - but parts of it > found there way into the bootstrap compiler. > > 6) escript ran for a while on SAE - but every new release > of ERlang required major effort to get it running again. > > 7) Escript stops working on the latest version of the system, > because it now depends upon SAE which is broken. > > ... > > 8) I stop using escript and forget about it. > > 9) I start writing a book. <>. > > 10) I want to describe loads of *useful* and little known tools. > > 11) I want make sure that escript works. > > 12) I google escript - since I??ve now *lost* the code > > 13) Google finds escript on MY web site (holy cows) - irony yes. > > This is the old "pure-erlang" version "pre SAE" > > 14) I compile this version > > It is broken. > > It depends upon a hacked version of erl_eval > this needs syncing with the latest version. > > 15) I look at the latest version of erl_eval > > I find this comment: > > %% Is used by standalone Erlang (escript). > %% Also used by shell.erl . > -export([match_clause/4]). > > I suspect that erl_eval.erl is "up to date" with my hacked version, > I check - it is. > > 16) I wonder. > > "is escript" in the *current* system? > > 17) I check > > yes - it's in erts/boot/src/escript.erl > > 18) Does it work? > > no > > 19) I fix it > > It works > > 20) Is it installed by default? > > No > > 21) Is it documented > > No > > 22) I fix it - fix the documentation > and post to the Erlang list > > /Joe > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: make_d_output.zip Type: application/zip Size: 3341 bytes Desc: not available URL: From ingela@REDACTED Mon Oct 16 08:25:28 2006 From: ingela@REDACTED (Ingela Anderton) Date: Mon, 16 Oct 2006 08:25:28 +0200 Subject: [erlang-questions] Inets is alive and kicking ;) References: <17711.44213.176539.194072@gargle.gargle.HOWL> Message-ID: <17715.9688.386960.530173@gargle.gargle.HOWL> Dmitrii Dimandt wrote: > It is also impossible to provide a login and a password for proxy servers. I > wonder if this could make into inets I could. Sounds like it should be a minor fix. -- m.v.h Ingela Ericsson AB - OTP team From dmitriid@REDACTED Mon Oct 16 08:53:45 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Mon, 16 Oct 2006 09:53:45 +0300 Subject: [erlang-questions] Erlang interpreter errors Message-ID: This is a direct translation of the following message: http://gzip.rsdn.ru/Forum/Message.aspx?mid=2164020&only=1 by somebody other than me :) Here goes: Whatever Erlang interpreter spits out on error cannot be called an error message in my opinion. So here's the question: are there any patches/hacks/whatever that can allow me to see more meaningful error messages? And of course, another one: what lead to appearance of such horrible messages? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Mon Oct 16 09:11:06 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 16 Oct 2006 09:11:06 +0200 Subject: [erlang-questions] escript lives In-Reply-To: References: <9b08084c0610050122q27e7ca66le3a6d1a1d9dc6841@mail.gmail.com> Message-ID: <4533308A.8060500@ericsson.com> On 2006-10-15 21:33, Wayne Vucenic wrote: ...deleted > Mini:~/erlang/escript-4.0 wayne$ make > erlc escript.erl > make: *** No rule to make target `.beam', needed by `all'. Stop. > > as the erlc line above suggests, it actually did make the .beam file, > so I'm not sure why it thinks it needs to remake it but can't. the erlc line says it will create escript.beam. the ''No rule'' line talks about a a file called ''.beam''. did you get one of those? the reason for this error is that ''BEAM_FILES = $(MODS:=.beam)'' in the Makefile probably gets expanded to ''.beam''. in the Makefile, try to replace ''all: ${BEAM_FILES} escript'' with all: echo ${BEAM_FILES} and run make again. email the output, please. ...deleted > to work around this, I changed the Makefile line > > all: ${BEAM_FILES} escript > > to > > all: escript.beam escript > > this gets us past the .beam error, but now it has trouble making escript > > Mini:~/erlang/escript-4.0 wayne$ make > ./mk_escript.sh > make: ./mk_escript.sh: Command not found > make: *** [escript] Error 127 i think that the mode of ''mk_escript.sh'' has lost the executable (x) flag. if you untar all files into a new directory, what is the mode of mk_escript.sh? if it is not executable you could add chmod +x mk_escript.sh in the Makefile just before ./mk_escript.sh well, actually joe should. or escript could get put into jungerl and anybody could. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From francesco@REDACTED Mon Oct 16 13:53:01 2006 From: francesco@REDACTED (francesco) Date: Mon, 16 Oct 2006 12:53:01 +0100 Subject: [erlang-questions] 2006 Obfuscated Erlang Competition! References: Message-ID: <20061016115301.78B795A1FD@mail.erlangsystems.com> A quick announcement to let you know that there will be an obfuscated Erlang competition in conjunction with the 2006 Erlang User Conference. Submit your code by November 3rd and illustrate how some of the subtleties of Erlang be used and abused. Winners will be announced at the conference, and if needed, receive a code review (On top of other interesting prizes) :-) . Last year's winning entries are here: http://www.erlang-consulting.com/obfuscatederlang2005.html For more information, rules, prizes, judges and more, visit this page: http://www.erlang-consulting.com/obfuscatederlang.html Have fun, Francesco -- -- http://www.erlang-consulting.com _________________________________________________________ Post sent from http://www.trapexit.org From xpdoka@REDACTED Mon Oct 16 14:00:56 2006 From: xpdoka@REDACTED (xpdoka) Date: Mon, 16 Oct 2006 13:00:56 +0100 Subject: [erlang-questions] Reason for "format string not a textual constant" References: Message-ID: <20061016120056.49E1B5A1FF@mail.erlangsystems.com> Hi Eric, When io:format's first argument (the format string) is a constant string, the compiler can check it and issue a warning if the string is invalid, or has the wrong number of control sequences compared to the number of elements in the second argument. When the format string is not a constant, the compiler can warn you that it is unable to give you those previews warnings! Cheers, Dominic -- Dominic Williams http://www.dominicwilliams.net ---- _________________________________________________________ Post sent from http://www.trapexit.org From casper2000a@REDACTED Mon Oct 16 14:24:50 2006 From: casper2000a@REDACTED (Eranga Udesh) Date: Mon, 16 Oct 2006 17:54:50 +0530 Subject: [erlang-questions] Mnesia Fragmented tables..... feature or bug? Message-ID: <20061016122456.0FDEC19DC18C@mail.wavenet.lk> Hi, In a Fragmented Table, when I ran select/4, I get {Objects, Cont}. According to the returned result, it looks to me that select only runs in the First Table Fragment, even though the result count is less than the NObjects value specified. However, if I iterate select/1 in the Cont returned until '$end_of_table', I can get all the other results. I suppose select/4 should do the iteration in all the Table Fragment, until the returned record count becomes > NObjects. Is this a bug or feature in Mnesia Frag Access Module? As an example, pls check the code snippet attached. To run it, Start Erlang: erl -sname test -mnesia dir "/tmp/mnesia_test'" -setcookie mnesia_test Initialize Db: mnesia_test:init(). Add some records to the Db: mnesia_test:save_retry(123456, 1000, 1, 1). mnesia_test:save_retry(124456, 1300, 2, 1). mnesia_test:save_retry(223456, 1040, 1, 14). mnesia_test:save_retry(123156, 1400, 1, 11). Dump all the Db Records: mnesia_test:read_all_retry(). Do a select/3 mnesia_test:read_retry_by_time1(1500). Do a single select/4 mnesia_test:read_retry_by_time2(1500). Do a select/4 followed by subsequent calls to select/1 until '$end_of_table' mnesia_test:read_retry_by_time3(1500). Please advice. Thanks, - Eranga -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mnesia_test.erl Type: application/octet-stream Size: 7442 bytes Desc: not available URL: From casper2000a@REDACTED Mon Oct 16 14:31:58 2006 From: casper2000a@REDACTED (Eranga Udesh) Date: Mon, 16 Oct 2006 18:01:58 +0530 Subject: [erlang-questions] Erl-SIGTRAN Message-ID: <20061016123201.1D58819DC186@mail.wavenet.lk> Hi, I wonder if it's feasible to develop a SIGTRAN stack on pure Erlang? How will be the performance? Is there anybody who has worked in a related area? Thanks, - Eranga -------------- next part -------------- An HTML attachment was scrubbed... URL: From dgud@REDACTED Mon Oct 16 14:42:55 2006 From: dgud@REDACTED (Dan Gudmundsson) Date: Mon, 16 Oct 2006 14:42:55 +0200 Subject: [erlang-questions] Mnesia Fragmented tables..... feature or bug? In-Reply-To: <20061016122456.0FDEC19DC18C@mail.wavenet.lk> References: <20061016122456.0FDEC19DC18C@mail.wavenet.lk> Message-ID: <17715.32335.526285.24069@rian.du.uab.ericsson.se> >From the man page: For efficiency the NObjects is a recommendation only and the result may contain anything from an empty list to all available results. /Dan Eranga Udesh writes: > Hi, > > > > In a Fragmented Table, when I ran select/4, I get {Objects, Cont}. According > to the returned result, it looks to me that select only runs in the First > Table Fragment, even though the result count is less than the NObjects value > specified. However, if I iterate select/1 in the Cont returned until > '$end_of_table', I can get all the other results. I suppose select/4 should > do the iteration in all the Table Fragment, until the returned record count > becomes > NObjects. Is this a bug or feature in Mnesia Frag Access Module? From serge@REDACTED Mon Oct 16 15:06:50 2006 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 16 Oct 2006 09:06:50 -0400 Subject: [erlang-questions] Local IP address in UDP packets In-Reply-To: References: Message-ID: <453383EA.3060304@hq.idt.net> Kenneth, See in-line. Kenneth Lundin (AS/EAB) wrote: >> -----Original Message----- >> From: Serge Aleynikov [mailto:serge@REDACTED] >> Sent: den 10 oktober 2006 18:08 >> To: Erlang Users' List >> Subject: Local IP address in UDP packets >> >> Hi, >> >> We have a UDP server process that starts listening on the >> {0,0,0,0} address of a host with multiple IPs. It needs to >> know the local destination IP address that a UDP packet was >> received on, > > Why can't you explicitly receive on a specific IP address and by that > knowing > the IP address the UDP packet was received on? A typical use case for this is as following. Two hosts are configured with Virtual IP (VIP) balancing software (using a project like http://linux-ha.org). This way a VIP can be migrated from one host to another based on network conditions or operator action. It may not be possible to receive notifications from such a process indicating that a VIP was activated on current host. Additionally, there might be multiple VIPs balanced between N hosts, where each VIP may get dynamically assigned to any host in the subnet. I would like to have a UDP server listening on 0.0.0.0 address. This way a turn up of a new VIP won't require to change any server properties nor restart the server - packets received on *any* IP address on that host (on a given port) will get delivered to the server process. This adds a requirement to know which IP a packet was received on. [...] > We discussed this, here are our initial thoughts: > - That the presence of an option ("local_address") changes the format of > received packages > is not good. In that case we would prefer to introduce a new generic > format for received packages > where data which is inly present if a certain option is set is put in a > separate list with > optional data. Like this : {udp_packet, Socket, IP, InPortNo, Packet, > OptionalData} > Optional data would in your example a) above look like this: > [{toip,ToIp}]. I agree, this indeed sounds like a better idea. > - On how many platforms can the option 'local_address' be supported? > (Windows?, Linux, MacOSx?, Solaris?) Knowing the target local IP on reception of a packet seems to be available on many platforms (though via distinct stack-specific API). We only checked that sending packets from a specific local IP is supported on Linux, and partially on Solaris (Solaris =< 10 doesn't allow to specify the local IP address. This Solaris limitation seemed to be fixed in the OpenSolaris project, but we haven't checked if Solaris 11 fixes the issue as well). > And what should happen on platforms that don't support the > option? > An error when the option is set? or silently swallow the option without > any, ... no that is not good. I think returning an error would be a better choice. > - What is the real usecase when the option is needed? You explain above, > but why do you want/need to do like that? See above. We are planning to patch inet_drv.c for enabling this feature some time this or next week. If you are interested I can send you the patch. Regards, Serge From surindar.shanthi@REDACTED Mon Oct 16 15:12:15 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Mon, 16 Oct 2006 18:42:15 +0530 Subject: [erlang-questions] Finding closed socket Message-ID: <42ea5fb60610160612v3b32fcdes6575fb089057fca@mail.gmail.com> Dear all, I have client server application. If network cable is unplugged at the client PC, the server is not able to detect the communication breakage. I have given gen_tcp:listen(Port,[{active,false},{packet,0},{keepalive,true}]) in the server. If any option is available to detect it at the server end, it will be very useful to me. Thanks in advance! -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Mon Oct 16 15:16:49 2006 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 16 Oct 2006 09:16:49 -0400 Subject: [erlang-questions] Erl-SIGTRAN In-Reply-To: <20061016123201.1D58819DC186@mail.wavenet.lk> References: <20061016123201.1D58819DC186@mail.wavenet.lk> Message-ID: <45338641.9040608@hq.idt.net> We implemented the kernel SCTP binding for Erlang, as well as a pure Erlang M3UA. The SCTP performance is comparable to TCP. M3UA doesn't add much overhead as its mere job is to run a fairly simple state machine, relay messages to/from its user part, and react on association up/down events. Generally the presence of binary pattern matching and good concurrency model in Erlang makes it a good choice for implementing networking protocols... Serge Eranga Udesh wrote: > Hi, > > > > I wonder if it's feasible to develop a SIGTRAN stack on pure Erlang? How > will be the performance? Is there anybody who has worked in a related area? > > > > Thanks, > > - Eranga > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From ft@REDACTED Mon Oct 16 15:54:42 2006 From: ft@REDACTED (Fredrik Thulin) Date: Mon, 16 Oct 2006 09:54:42 -0400 Subject: [erlang-questions] Local IP address in UDP packets References: <453383EA.3060304@hq.idt.net> Message-ID: <044301c6f12a$a39550b0$117ba8c0@it.su.se> Serge Aleynikov wrote: ... >> - What is the real usecase when the option is needed? You explain >> above, but why do you want/need to do like that? > > See above. > > We are planning to patch inet_drv.c for enabling this feature some > time this or next week. If you are interested I can send you the > patch. I would just like to express my support for Serge's patch. In my project (YXA SIP server), I have worked around this by doing what you (Kenneth) offered as an alternative, have one UDP socket for every IP on the host and use this socket for distinguishing to which IP a packet was sent, and for sending packets using a specific source IP myself. This has two disadvantages though, 1) figuring out which IP addresses a hosts network interfaces has cannot be done with documented functions (no, I don't count os:cmd/1) - you have to use the undocumented inet:getiflist/0 and inet:ifget/2. 2) If network interfaces are added, you have to poke the Erlang application (YXA) to have it re-scan the network interfaces. This is inferior to what the situation would be with Serge's patch. /Fredrik From chsu79@REDACTED Mon Oct 16 18:12:33 2006 From: chsu79@REDACTED (Christian S) Date: Mon, 16 Oct 2006 18:12:33 +0200 Subject: [erlang-questions] Finding closed socket In-Reply-To: <42ea5fb60610160612v3b32fcdes6575fb089057fca@mail.gmail.com> References: <42ea5fb60610160612v3b32fcdes6575fb089057fca@mail.gmail.com> Message-ID: This is a common problem and the solution is a bit of a "pattern": Use ping messages in your protocol to see that the other end is still there. I.e. modify your protocol so it has a "noop" ping-pong request-reply. TCP keepalives are almost unusable since the interval between keepalives is often unusably long, and OS implementations of tcp stacks do typically not allow you to change this on a per-socket level, instead it is OS-global. PS. Come to think of it. Is this still true and why do we accept it? Gosh BSD-socket interface is lame. I want keepalives sent to my socket controller process! On 10/16/06, Surindar Sivanesan wrote: > Dear all, > > I have client server application. > If network cable is unplugged at the client PC, the server is not able to > detect the communication breakage. > I have given > gen_tcp:listen(Port,[{active,false},{packet,0},{keepalive,true}]) > in the server. > If any option is available to detect it at the server end, it will be very > useful to me. > Thanks in advance! > -- > with regards, > S.Surindar > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > From bjarne@REDACTED Mon Oct 16 18:28:11 2006 From: bjarne@REDACTED (=?iso-8859-1?Q?Bjarne_D=E4cker?=) Date: Mon, 16 Oct 2006 18:28:11 +0200 Subject: [erlang-questions] Erlang/OTP User Conference 2006 - Invitation to attend References: <20060721090314.CA7AD5A1E9@mail.erlangsystems.com> <000601c6e585$043e7150$502069d4@Dell> Message-ID: <006c01c6f141$c84b3ca0$0100007f@Dell> Dear Erlang friends, You are all most welcome to this year's Erlang/OTP User Conference, EUC, which will take place on November 9 at the usual location at Ericsson's in Stockholm. Please see the invitation and preliminary program here http://www.erlang.se/euc/06/ The conference will end by a kindly sponsored ErLounge. This year the EUC will be followed by some seminars on November 10 in smaller fora. Real hackers will have a challenge in the Obfuscated Erlang Competition http://www.erlang-consulting.com/obfuscatederlang.html Registrations and questions should be sent to euc@REDACTED Looking forward to seeing you all again Bjarne D?cker, chairman of EUC'06 From eproxus@REDACTED Mon Oct 16 18:58:55 2006 From: eproxus@REDACTED (Adam Lindberg) Date: Mon, 16 Oct 2006 17:58:55 +0100 Subject: [erlang-questions] What are the default module compiler directives? Message-ID: <6344005f0610160958q1152b59ft25fd210caf4c7c8@mail.gmail.com> Hi all, I know that there are some compiler directives like -author, -vsn etc. Is there an official list of these anywhere? They are not listed in the compiler man page. Thanks in advance -- Adam Lindberg Web: http://www.namsisi.com/ From richardc@REDACTED Mon Oct 16 19:40:03 2006 From: richardc@REDACTED (Richard Carlsson) Date: Mon, 16 Oct 2006 19:40:03 +0200 Subject: [erlang-questions] Erlang interpreter errors In-Reply-To: References: Message-ID: <4533C3F3.1020102@it.uu.se> Dmitrii Dimandt wrote: > This is a direct translation of the following message: > http://gzip.rsdn.ru/Forum/Message.aspx?mid=2164020&only=1 > by somebody > other than me :) > > Here goes: > Whatever Erlang interpreter spits out on error cannot be called an error > message in my opinion. So here's the question: are there any > patches/hacks/whatever that can allow me to see more meaningful error > messages? And of course, another one: what lead to appearance of such > horrible messages? > > Thank you I have tried nagging OTP about including this patch (attached) for quite some time, but they don't seem to care much about it. I use it myself, anyway. /Richard -- "Having users is like optimization: the wise course is to delay it." -- Paul Graham -------------- next part -------------- A non-text attachment was scrubbed... Name: shell.erl.diff Type: text/x-patch Size: 2862 bytes Desc: not available URL: From cyberlync@REDACTED Mon Oct 16 21:00:44 2006 From: cyberlync@REDACTED (Eric Merritt) Date: Mon, 16 Oct 2006 12:00:44 -0700 Subject: [erlang-questions] Reason for "format string not a textual constant" In-Reply-To: <20061016120056.49E1B5A1FF@mail.erlangsystems.com> References: <20061016120056.49E1B5A1FF@mail.erlangsystems.com> Message-ID: Ah, so it's a warning that it can't give warnings. That makes a quite a bit of sense, though the warning itself could be worded better. On 10/16/06, xpdoka wrote: > > Hi Eric, > > When io:format's first argument (the format string) is a constant string, the compiler can check it and issue a warning if the string is invalid, or has the wrong number of control sequences compared to the number of elements in the second argument. When the format string is not a constant, the compiler can warn you that it is unable to give you those previews warnings! > > Cheers, > Dominic > -- > Dominic Williams > http://www.dominicwilliams.net > > ---- > _________________________________________________________ > Post sent from http://www.trapexit.org > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From taavi@REDACTED Mon Oct 16 21:45:06 2006 From: taavi@REDACTED (Taavi Talvik) Date: Mon, 16 Oct 2006 22:45:06 +0300 Subject: [erlang-questions] What are the default module compiler directives? In-Reply-To: <6344005f0610160958q1152b59ft25fd210caf4c7c8@mail.gmail.com> References: <6344005f0610160958q1152b59ft25fd210caf4c7c8@mail.gmail.com> Message-ID: > > I know that there are some compiler directives like -author, -vsn etc. > Is there an official list of these anywhere? They are not listed in > the compiler man page. From Erlang reference manual: http://www.erlang.org/doc/doc-5.5.1/doc/reference_manual/ modules.html#4.2 4.2 Module Attributes A module attribute defines a certain property of a module. A module attribute consists of a tag and a value. -Tag(Value). Tag must be an atom, while Value must be a literal term. Any module attribute can be specified. The attributes are stored in the compiled code and can be retrieved by using, for example, the function beam_lib:chunks/2. There are several module attributes with predefined meanings, some of which have arity two, but user-defined module attributes must have arity one. Basicly - those are generic constructions. And you are free to introduce your own, when necessary. best regards, taavi From nightphotos@REDACTED Mon Oct 16 23:42:57 2006 From: nightphotos@REDACTED (Wayne Vucenic) Date: Mon, 16 Oct 2006 14:42:57 -0700 Subject: [erlang-questions] escript lives In-Reply-To: <4533308A.8060500@ericsson.com> References: <9b08084c0610050122q27e7ca66le3a6d1a1d9dc6841@mail.gmail.com> <4533308A.8060500@ericsson.com> Message-ID: Hi Bengt, I was able to resolve one of the problem I was seeing. Since my goal is to get this working on Windows, I had unzipped the files on Windows and was working with them there. When I decided to try OS X, I copied over the unzipped files. Instead I now tried moving over Joe's .tgz file and unzipping it on OS X. This fixes the problem I was seeing with mk_escript.sh. I'm not sure what the significant difference was, as that file had the x flag even when copied from Windows. But I'm still having some difficulties with trying to make '.beam'. I start with a new clean extract on OS X of Joe's .tgz file: Mini:~/erlang/escript-4.0 wayne$ ls -la total 88 drwx------ 11 wayne wayne 374 Oct 16 13:55 . drwxr-xr-x 12 wayne wayne 408 Oct 16 13:54 .. -rw------- 1 wayne wayne 6148 Oct 16 13:55 .DS_Store -rwx------ 1 wayne wayne 545 Oct 5 01:21 Makefile -rwx------ 1 wayne wayne 5291 Oct 5 01:21 escript.erl -rwx------ 1 wayne wayne 2736 Oct 5 01:21 escript.html -rwx------ 1 wayne wayne 396 Oct 5 01:21 factorial -rwx------ 1 wayne wayne 478 Oct 5 01:21 fibc -rwx------ 1 wayne wayne 390 Oct 5 01:21 fibi -rwx------ 1 wayne wayne 3113 Oct 5 01:21 history -rwx------ 1 wayne wayne 309 Oct 5 01:21 mk_escript.sh Mini:~/erlang/escript-4.0 wayne$ make erlc escript.erl make: *** No rule to make target `.beam', needed by `all'. Stop. a .beam file was not created: Mini:~/erlang/escript-4.0 wayne$ ls -la total 96 drwx------ 12 wayne wayne 408 Oct 16 13:58 . drwxr-xr-x 12 wayne wayne 408 Oct 16 13:54 .. -rw------- 1 wayne wayne 6148 Oct 16 13:55 .DS_Store -rwx------ 1 wayne wayne 545 Oct 5 01:21 Makefile -rw-r--r-- 1 wayne wayne 4092 Oct 16 13:58 escript.beam -rwx------ 1 wayne wayne 5291 Oct 5 01:21 escript.erl -rwx------ 1 wayne wayne 2736 Oct 5 01:21 escript.html -rwx------ 1 wayne wayne 396 Oct 5 01:21 factorial -rwx------ 1 wayne wayne 478 Oct 5 01:21 fibc -rwx------ 1 wayne wayne 390 Oct 5 01:21 fibi -rwx------ 1 wayne wayne 3113 Oct 5 01:21 history -rwx------ 1 wayne wayne 309 Oct 5 01:21 mk_escript.sh changed Makefile to all: echo ${BEAM_FILES} as you suggested: Mini:~/erlang/escript-4.0 wayne$ make echo escript.beam .beam escript.beam .beam well, that explains what we're seeing. It correctly makes escript.beam, then fails to make .beam changed Makefile to all: escript.beam escript to get past this error, and now it works: Mini:~/erlang/escript-4.0 wayne$ make ./mk_escript.sh Mini:~/erlang/escript-4.0 wayne$ ./fibc 20 fib 20 = 10946 One fix would be to change the first 3 lines in the Makefile from MODS = escript ERL_FILES = $(MODS:=.erl) BEAM_FILES = $(MODS:=.beam) to ERL_FILES = escript.erl BEAM_FILES = escript.beam With this one change it all builds correctly. Thanks, Wayne --- Wayne Vucenic No Bugs Software Ruby, C#, and Erlang Agile Contract Programming in Silicon Valley From robert.virding@REDACTED Mon Oct 16 23:43:32 2006 From: robert.virding@REDACTED (Robert Virding) Date: Mon, 16 Oct 2006 23:43:32 +0200 Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <20061003210624.22238.qmail@web38810.mail.mud.yahoo.com> References: <20061003210624.22238.qmail@web38810.mail.mud.yahoo.com> Message-ID: <4533FD04.4000708@telia.com> Thomas Lindgren wrote: > > --- Robert Virding wrote: > > >>I believe it is important to keep things clean, >>consistent and elegant >>otherwise you will end up with a language built on >>exceptions. > > > So what is your opinion on Erlang of today? (half :-) > > Best, > Thomas I have been debating with myself whether to answer this but in the end I gave in and decided that I would. Omn the whole I think we got things right but there are some things which are wrong. Some are new, some are old and some are even my fault. :-) So here is a collection of comments, major and minor (major marked with +): - The naming and argument orders of the standard libraries is inconsistent. While this can seem trivial it does break the principle of least astonishment and therefore causes unnecessary problems. - The syntax could have been cleaned up a bit. No, I don't see any problems with having ';' as separator not a terminator. Being able to write "foo(X) -> X;." sucks. + Should have had proper variable scoping, what is right for Prolog is not best for Erlang. I would also have all variables in patterns as fresh variables and have explicit tests for equality with already bound variables. + The concept of what a BIF (Built In function) is is a mess. Now it seems to mean something written in C. That is something we addressed in the standard and got right. A BIF is a function which is part of the langauge but without special syntax. So spawn and link are just as much Erlang as ! and receive but they look like functions. BIFs have the same dignity as the emulator, both ARE the language. What language a BIF is written in is irrelevant. Most BIFs can be called through the module erlang so having the module erlang as part of OTP just does not make sense. - Some of the BIF names are too long, tget and tset would have been better. - A suggestion in the standard was to have BIFsin different modules not just erlang, for example atom, tuple, number, proc, ... This would have been much better and could have been added with a minimum of trouble. + There is no layering in the standard libraries, all is part of OTP. This make is difficult to build small, stand-alone application. In essence you tend to get what OO was accused of: you want the banana but get the whole gorilla as well. Yes, you can make a tool which extracts what you want but that is a work-around not a fix. Many of the libraries are so fundamental that having them managed by OTP does not really make sense, they are below that necessary for it. Joe and I discussed this alot and we agreed on the principle but not on all the details. I would like to see something like: ____________________________________________________________________ erlang emulator + BIFs (see above) ____________________________________________________________________ basic libraries - lists, file, io etc. (maybe layered as well) ____________________________________________________________________ | OTP | included applications - compiler, etc | _________________________________________________ user apps, OTP based or otherwise ____________________________________________________________________ The system is useable without OTP and applications can choose at what level they need the libraries. I hope the diagram is understandable. - Binaries are nice but I don't really like the bit syntax, although I haven't really sat down and come up with a better alternative. - Records as they stand are not beautiful. However, it is important to remember that when they were introduced it was an absolute requirement that they would be as fast as using tuples directly. Even this implementation was suspect. I kid you not. - Structs or dictionaries as suggested by Richard O'K would be a BIG WIN. + All forms of communication between processes should be asynchronous. Messages signals, links, ALL of them. You send them off and depending on what you do you may get an exit signal back. Originally the only thing which broke this principle was sending to a local registered process, now, however, more things break it. Link for example. Why worry you may ask. Well, everything which is asynchronous will automatically scale to distributed systems, synchronous calls don't! This may also affect multi-core implementations which are going to be very important. + Originally there were two basically different types of objects in Erlang: static terms and things with dynamic state, processes. A process is something which has process semantics, you communicate through messages, can link to it and exchange exit signals. N.B. how a process is implemented is irrelevant it is the external semantics which define a process. Unfortunately there two (at least) things in erlangwhich don't conform to this principle, ETS tables and ports. They're coming next. + ETS tables are neither and this causes problems. ETS was conceived to solve two main problems: fast, near constant access to large tables; and to get around the garbage collection problem in the erlang implementation. If you have a LARGE process then it is noticeable when the emulator stops during a collection. This problem still exists today. The solution to the second problem was to keep ETS tables in a completely separate area and copy data to/from processes. Unfortunately this implementation detail, which it is, affected the interface and instead of solving the real problem, i.e. the copying, work-arounds were added to minimise this, match_XXXX, select_XXXX, ms_transforms. No one can claim that match patterns and matchspecs are beautiful or fit in with the rest of erlang. These are just work-arounds to minimise copying and would be unnecessary if the implementations was fixed. Then you could use a proper pattern to select and all you would need is fold. Getting back ETS tables are neither static data or processes and break the principle. + Ports are funny. Originally when they were conceived they had only process semantics, in fact we actually debated whether to have a separate data type at all. They were modelled on UNIX streams, the idea being that you could insert various filters along the way without the users noticing. This is no problem with processes. However, the the various port_XXXX commands were added and now ports are different. Ironically, the manual calls the process interface illogical because it is different from the function interface. - if should really have been what cond is today. Is cond today? - The abstract form of the erlang syntax should have been in a form which could be described by records. - and/or and andalso/orelse are different semantically and having both is a win, although some people don't think so. - catch should not have been an operator but instead catch ... end. - Erlang does not need currying. - Erlang was originally designed to follow the KISS principle. + Perhaps we should have defined the message interface more often instead of wrapping everything in an access function? You can do more with the interface. + You need both link and monitor_process, it would have been better to have a more basic primitive on which both are built. Easier to under stand the interactions. Having everything consistent makes it easier to understand and lessens the risk of strange interactions. If everything is a process and obeys the (asynchronous) process semantics then it easier to understand the interactions. They will all be explicit in the code (even the mistakes :-)) and not so dependant on which order you do things because sometimes you get a fault and sometimes a signal so if they are in the wrong order then somethings won't get done. Special cases just cause problems in the long run. That's about it for the first go. I will willingly debate any of my comments on the erlang, but don't expect me to change my mind. Being, as I am, right. Robert "I'm not arrogant, I'm right!" From ramrita@REDACTED Tue Oct 17 04:01:31 2006 From: ramrita@REDACTED (Amrita Roy) Date: Tue, 17 Oct 2006 03:01:31 +0100 Subject: [erlang-questions] hot-code replacement Message-ID: can anyone tell me in detail about the hot-code replacement feature in erlang and how it works... Also i am a bit confused if this feature is inherent to erlang or implemented just as a added function.. thanks _________________________________________________________________ Windows Live? Messenger has arrived. Click here to download it for free! http://imagine-msn.com/messenger/launch80/?locale=en-gb From jces@REDACTED Tue Oct 17 04:41:42 2006 From: jces@REDACTED (jces@REDACTED) Date: Mon, 16 Oct 2006 19:41:42 -0700 Subject: [erlang-questions] hot-code replacement References: Message-ID: <200610170241.k9H2fg95014075@mail.monad.com> >can anyone tell me in detail about the hot-code replacement feature in >erlang and how it works... Also i am a bit confused if this feature is >inherent to erlang or implemented just as a added function.. Hello, I recently learned about it and used it; use the fully qualified name of the function in the tail-recursive-call "module:function()" rather than simply "function()". Then, to go even further, you can use "?MODULE:function()" so that you can change the module name any time, I guess. That ends up with something like: -module(test). -export([start/1]). start(Arg) -> receive finished -> io:write(Arg); not_finished -> ?MODULE:start(Arg+1) end. (lerl@REDACTED)1> c("src/test", [{outdir, "/src/"}, debug_info]). {ok,test} (lerl@REDACTED)2> Pid = spawn(test,start,[1]). <0.44.0> (lerl@REDACTED)3> Pid!not_finished. not_finished (lerl@REDACTED)4> Pid!finished. 2finished (lerl@REDACTED)5> From jces@REDACTED Tue Oct 17 04:43:17 2006 From: jces@REDACTED (jces@REDACTED) Date: Mon, 16 Oct 2006 19:43:17 -0700 Subject: [erlang-questions] hot-code replacement In-Reply-To: References: Message-ID: <200610170243.k9H2hHFT014092@mail.monad.com> >can anyone tell me in detail about the hot-code replacement feature in >erlang and how it works... Also i am a bit confused if this feature is >inherent to erlang or implemented just as a added function.. I'd like to add on to the question: how do data structure changes interact with code replacement? How can you change the definition of a record in a module and then cleanly use that, or are code updates just about functions definitions? From jces@REDACTED Tue Oct 17 05:22:10 2006 From: jces@REDACTED (jces@REDACTED) Date: Mon, 16 Oct 2006 20:22:10 -0700 Subject: [erlang-questions] hot-code replacement In-Reply-To: <200610170241.k9H2fg95014075@mail.monad.com> References: <200610170241.k9H2fg95014075@mail.monad.com> Message-ID: <200610170322.k9H3MADL015675@mail.monad.com> Cont'd: after >(lerl@REDACTED)3> Pid!not_finished. >not_finished you can edit start/1's "not_finished" section to a) io:write and b) increment Arg by different amount. start(Arg) -> receive finished -> io:write(Arg); not_finished -> io:write(Arg), ?MODULE:start(Arg+42) end. then re-compile it in the running erlang shell. Send the same old Pid, not a new one, a "not_finished" message and it will a) increment Arg by 1 because the new version is not in place just yet, and b) load the new version. Send it another "not_finished" message and this time a) you will see the new io:write happen, and b) Art is incremented by 42. Finally, send it "finished" to see a final value, like 45. From casper2000a@REDACTED Tue Oct 17 06:51:25 2006 From: casper2000a@REDACTED (Eranga Udesh) Date: Tue, 17 Oct 2006 10:21:25 +0530 Subject: [erlang-questions] Mnesia Fragmented tables..... feature or bug? In-Reply-To: <17715.32335.526285.24069@rian.du.uab.ericsson.se> Message-ID: <20061017045130.5A56D19DC1E6@mail.wavenet.lk> Thanks for the reply. However my question is when using Fragmented tables and Frag module, the returned result is only by traversing the 1st fragment of the table and is an empty list (if no matching data in 1st fragment), even there matching data in other fragments. Is it due to something I do wrong or that is how it is? Thanks, - Eranga -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Dan Gudmundsson Sent: Monday, October 16, 2006 6:13 PM To: erlang-questions@REDACTED Subject: [erlang-questions] Mnesia Fragmented tables..... feature or bug? >From the man page: For efficiency the NObjects is a recommendation only and the result may contain anything from an empty list to all available results. /Dan Eranga Udesh writes: > Hi, > > > > In a Fragmented Table, when I ran select/4, I get {Objects, Cont}. According > to the returned result, it looks to me that select only runs in the First > Table Fragment, even though the result count is less than the NObjects value > specified. However, if I iterate select/1 in the Cont returned until > '$end_of_table', I can get all the other results. I suppose select/4 should > do the iteration in all the Table Fragment, until the returned record count > becomes > NObjects. Is this a bug or feature in Mnesia Frag Access Module? _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From surindar.shanthi@REDACTED Tue Oct 17 07:19:10 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Tue, 17 Oct 2006 10:49:10 +0530 Subject: [erlang-questions] Finding closed socket In-Reply-To: References: <42ea5fb60610160612v3b32fcdes6575fb089057fca@mail.gmail.com> Message-ID: <42ea5fb60610162219p20c0a1a7g2d0b0a0f012f793a@mail.gmail.com> Hi Server and client are communicating. Then i disabled the network at client PC. The client application returns {error,econnreset}. Nothing is triggered at server side. Then i send a message from server to client but the gen_tcp:send result is returned as 'ok' instead of '{error,Reason}'. On 10/16/06, Christian S wrote: > > This is a common problem and the solution is a bit of a "pattern": > > Use ping messages in your protocol to see that the other end is still > there. I.e. modify your protocol so it has a "noop" ping-pong > request-reply. > > TCP keepalives are almost unusable since the interval between > keepalives is often unusably long, and OS implementations of tcp > stacks do typically not allow you to change this on a per-socket > level, instead it is OS-global. > > PS. Come to think of it. Is this still true and why do we accept it? > Gosh BSD-socket interface is lame. I want keepalives sent to my socket > controller process! > > On 10/16/06, Surindar Sivanesan wrote: > > Dear all, > > > > I have client server application. > > If network cable is unplugged at the client PC, the server is not able > to > > detect the communication breakage. > > I have given > > gen_tcp:listen(Port,[{active,false},{packet,0},{keepalive,true}]) > > in the server. > > If any option is available to detect it at the server end, it will be > very > > useful to me. > > Thanks in advance! > > -- > > with regards, > > S.Surindar > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From fritchie@REDACTED Tue Oct 17 07:39:00 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Tue, 17 Oct 2006 00:39:00 -0500 Subject: [erlang-questions] ErlLounge in the San Francisco/San Jose area? In-Reply-To: Message of "Sat, 14 Oct 2006 16:59:23 CDT." <200610142159.k9ELxNeV010516@snookles.snookles.com> Message-ID: <200610170539.k9H5d0tL014980@snookles.snookles.com> The ErlLounge in the San Francisco/Bay Area will be hosted by SiliconValleyPatterns, a loose-knit group that (quite coincidentally) is studying Erlang this month as part of their "language buffet #27". The ErlLoung date is Tuesday 10/24, 7-9pm, at Hobee's in Cupertino. See http://c2.com/cgi/wiki?SiliconValleyPatternsGroup for Hobee's address, link to the Yahoo Groups mailing list archives, etc. If you're in the neighborhood, please stop by. -Scott From matthias@REDACTED Tue Oct 17 08:26:59 2006 From: matthias@REDACTED (Matthias Lang) Date: Tue, 17 Oct 2006 08:26:59 +0200 Subject: [erlang-questions] Finding closed socket In-Reply-To: <42ea5fb60610162219p20c0a1a7g2d0b0a0f012f793a@mail.gmail.com> References: <42ea5fb60610160612v3b32fcdes6575fb089057fca@mail.gmail.com> <42ea5fb60610162219p20c0a1a7g2d0b0a0f012f793a@mail.gmail.com> Message-ID: <17716.30643.610421.225034@antilipe.corelatus.se> Surindar Sivanesan writes: > Hi > Server and client are communicating. > Then i disabled the network at client PC. The client application returns > {error,econnreset}. > Nothing is triggered at server side. > Then i send a message from server to client but the gen_tcp:send result is > returned as 'ok' instead of '{error,Reason}'. ok is the correct result. Christian's protocol allows you to detect a lack of network connectivity within a time of your choosing, i.e. the timeout you choose for receiving the pong. Your implementation of fairly exactly half of what Christian suggested doesn't solve the problem you're attempting to solve. Matthias From dgud@REDACTED Tue Oct 17 09:04:57 2006 From: dgud@REDACTED (Dan Gudmundsson) Date: Tue, 17 Oct 2006 09:04:57 +0200 Subject: [erlang-questions] Mnesia Fragmented tables..... feature or bug? In-Reply-To: <20061017045130.5A56D19DC1E6@mail.wavenet.lk> References: <17715.32335.526285.24069@rian.du.uab.ericsson.se> <20061017045130.5A56D19DC1E6@mail.wavenet.lk> Message-ID: <17716.32921.853190.511507@rian.du.uab.ericsson.se> That is why the disclaimer is there, you will have to keep iterating until you get '$end_of_table'. Mnesia doesn't count the results returned by [d]ets: select, (and only gets one part-table at the time for fragmented tables). But you can also get '[]' several times when iterating select on a disc_only_table. Mnesia also compensates for the operations you have done previously in the same transaction. So if you write 3000 records to an empty table and then do the select (in the same transaction) you will get all 3000 records directly. The option is there to let you chunk you through a table without using all your memory, not to give you an exact number of matches. /Dan Eranga Udesh writes: > Thanks for the reply. > > However my question is when using Fragmented tables and Frag module, the > returned result is only by traversing the 1st fragment of the table and is > an empty list (if no matching data in 1st fragment), even there matching > data in other fragments. > > Is it due to something I do wrong or that is how it is? > > Thanks, > - Eranga > > > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Dan Gudmundsson > Sent: Monday, October 16, 2006 6:13 PM > To: erlang-questions@REDACTED > Subject: [erlang-questions] Mnesia Fragmented tables..... feature or bug? > > > >From the man page: > > For efficiency the NObjects is a recommendation only and the result > may contain anything from an empty list to all available results. > > /Dan > > > Eranga Udesh writes: > > Hi, > > > > > > > > In a Fragmented Table, when I ran select/4, I get {Objects, Cont}. > According > > to the returned result, it looks to me that select only runs in the First > > Table Fragment, even though the result count is less than the NObjects > value > > specified. However, if I iterate select/1 in the Cont returned until > > '$end_of_table', I can get all the other results. I suppose select/4 > should > > do the iteration in all the Table Fragment, until the returned record > count > > becomes > NObjects. Is this a bug or feature in Mnesia Frag Access > Module? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- Dan Gudmundsson Project: Mnesia, Erlang/OTP Ericsson Utvecklings AB Phone: +46 8 727 5762 UAB/AUL/IO Mobile: +46 70 519 9469 S-125 25 Stockholm Visit addr: Armborstv 14 From gunilla@REDACTED Tue Oct 17 09:11:00 2006 From: gunilla@REDACTED (Gunilla Arendt) Date: Tue, 17 Oct 2006 09:11:00 +0200 Subject: [erlang-questions] hot-code replacement In-Reply-To: References: Message-ID: <45348204.2060107@erix.ericsson.se> Code replacement is described in the Erlang Reference Manual, see chapter Compilation and Code Loading. Regards, Gunilla Amrita Roy wrote: > can anyone tell me in detail about the hot-code replacement feature in > erlang and how it works... Also i am a bit confused if this feature is > inherent to erlang or implemented just as a added function.. > > thanks > From bengt.kleberg@REDACTED Tue Oct 17 09:22:04 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 17 Oct 2006 09:22:04 +0200 Subject: [erlang-questions] hot-code replacement In-Reply-To: <200610170243.k9H2hHFT014092@mail.monad.com> References: <200610170243.k9H2hHFT014092@mail.monad.com> Message-ID: <4534849C.4010108@ericsson.com> On 2006-10-17 04:43, jces@REDACTED wrote: >> can anyone tell me in detail about the hot-code replacement feature in >> erlang and how it works... Also i am a bit confused if this feature is >> inherent to erlang or implemented just as a added function.. > > I'd like to add on to the question: how do data structure changes interact > with code replacement? How can you change the definition of a record in a > module and then cleanly use that, or are code updates just about functions > definitions? you only replace functions, but the new functions could be using new data structure (ie, record) definitions. see mnesia:transform_table() for an aide to handle table updates. if you are using a gen_server you will have a code_change/3 callback that should update loop data. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From casper2000a@REDACTED Tue Oct 17 09:24:53 2006 From: casper2000a@REDACTED (Eranga Udesh) Date: Tue, 17 Oct 2006 12:54:53 +0530 Subject: [erlang-questions] Mnesia Fragmented tables..... feature or bug? In-Reply-To: <17716.32921.853190.511507@rian.du.uab.ericsson.se> Message-ID: <20061017072501.3AAB319DC25E@mail.wavenet.lk> Thanks. It clears my doubts. Cheers, - Eranga -----Original Message----- From: Dan Gudmundsson [mailto:dgud@REDACTED] Sent: Tuesday, October 17, 2006 12:35 PM To: Eranga Udesh Cc: erlang-questions@REDACTED Subject: RE: [erlang-questions] Mnesia Fragmented tables..... feature or bug? That is why the disclaimer is there, you will have to keep iterating until you get '$end_of_table'. Mnesia doesn't count the results returned by [d]ets: select, (and only gets one part-table at the time for fragmented tables). But you can also get '[]' several times when iterating select on a disc_only_table. Mnesia also compensates for the operations you have done previously in the same transaction. So if you write 3000 records to an empty table and then do the select (in the same transaction) you will get all 3000 records directly. The option is there to let you chunk you through a table without using all your memory, not to give you an exact number of matches. /Dan Eranga Udesh writes: > Thanks for the reply. > > However my question is when using Fragmented tables and Frag module, the > returned result is only by traversing the 1st fragment of the table and is > an empty list (if no matching data in 1st fragment), even there matching > data in other fragments. > > Is it due to something I do wrong or that is how it is? > > Thanks, > - Eranga > > > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Dan Gudmundsson > Sent: Monday, October 16, 2006 6:13 PM > To: erlang-questions@REDACTED > Subject: [erlang-questions] Mnesia Fragmented tables..... feature or bug? > > > >From the man page: > > For efficiency the NObjects is a recommendation only and the result > may contain anything from an empty list to all available results. > > /Dan > > > Eranga Udesh writes: > > Hi, > > > > > > > > In a Fragmented Table, when I ran select/4, I get {Objects, Cont}. > According > > to the returned result, it looks to me that select only runs in the First > > Table Fragment, even though the result count is less than the NObjects > value > > specified. However, if I iterate select/1 in the Cont returned until > > '$end_of_table', I can get all the other results. I suppose select/4 > should > > do the iteration in all the Table Fragment, until the returned record > count > > becomes > NObjects. Is this a bug or feature in Mnesia Frag Access > Module? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- Dan Gudmundsson Project: Mnesia, Erlang/OTP Ericsson Utvecklings AB Phone: +46 8 727 5762 UAB/AUL/IO Mobile: +46 70 519 9469 S-125 25 Stockholm Visit addr: Armborstv 14 From dmitriid@REDACTED Tue Oct 17 09:30:08 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Tue, 17 Oct 2006 10:30:08 +0300 Subject: [erlang-questions] Erlang interpreter errors In-Reply-To: <4533C3F3.1020102@it.uu.se> References: <4533C3F3.1020102@it.uu.se> Message-ID: hank you! On 10/16/06, Richard Carlsson wrote: > > Dmitrii Dimandt wrote: > > This is a direct translation of the following message: > > http://gzip.rsdn.ru/Forum/Message.aspx?mid=2164020&only=1 > > by somebody > > other than me :) > > > > Here goes: > > Whatever Erlang interpreter spits out on error cannot be called an error > > message in my opinion. So here's the question: are there any > > patches/hacks/whatever that can allow me to see more meaningful error > > messages? And of course, another one: what lead to appearance of such > > horrible messages? > > > > Thank you > > I have tried nagging OTP about including this patch (attached) > for quite some time, but they don't seem to care much about it. > I use it myself, anyway. > > /Richard > > > -- > "Having users is like optimization: the wise course is to delay it." > -- Paul Graham > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Tue Oct 17 09:30:47 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 17 Oct 2006 09:30:47 +0200 Subject: [erlang-questions] escript lives In-Reply-To: References: <9b08084c0610050122q27e7ca66le3a6d1a1d9dc6841@mail.gmail.com> <4533308A.8060500@ericsson.com> Message-ID: <453486A7.6050107@ericsson.com> On 2006-10-16 23:42, Wayne Vucenic wrote: ...deleted > moving over Joe's .tgz file and unzipping it on OS X. This > fixes the problem I was seeing with mk_escript.sh. I'm not good. ...deleted > changed Makefile to > all: > echo ${BEAM_FILES} > as you suggested: > > Mini:~/erlang/escript-4.0 wayne$ make > echo escript.beam .beam > escript.beam .beam > > well, that explains what we're seeing. It correctly makes > escript.beam, then fails to make .beam i did not expect make to get escript.beam right, so there i was wrong. but i did get the error location right. yay me :-) ...deleted > One fix would be to change the first 3 lines in the Makefile from > > MODS = escript > ERL_FILES = $(MODS:=.erl) > BEAM_FILES = $(MODS:=.beam) > > to > > ERL_FILES = escript.erl > BEAM_FILES = escript.beam > > With this one change it all builds correctly. i think your solution is the right one for escripts makefile. generally speaking, using make is a problem. this is just a minor nuisance, for the real problems see (among others) http://aegis.sourceforge.net/auug97.pdf bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From peter@REDACTED Tue Oct 17 14:54:11 2006 From: peter@REDACTED (Peter Mechlenborg) Date: Tue, 17 Oct 2006 14:54:11 +0200 Subject: [erlang-questions] Sexp front end for Erlang? Message-ID: <4534D273.8080704@mu.dk> Hi, I'm new to the list, but I hope that I'm not too far off topic. At the company I work for, we have recently started implementing a domain specific language with an Erlang back end and have a prototype compiler written in Common Lisp. Instead of generating Erlang source code directly, the compiler has two phases with an sexp layer in between, that is, the first phase in the compiler generates sexp's corresponding to Erlang code, and the second phase generates Erlang source code from the sexp's. Currently the sexp layer is very simple, but I was wondering if someone else has played with the idea of an sexp-based front end for Erlang, or even made one? If so I would be very interested to hear more about it. I tried to google for something like the above, but I did not find anything. Have fun, -- Peter Mechlenborg From garry@REDACTED Tue Oct 17 15:39:06 2006 From: garry@REDACTED (Garry Hodgson) Date: Tue, 17 Oct 2006 09:39:06 -0400 (EDT) Subject: [erlang-questions] Sexp front end for Erlang? In-Reply-To: <4534D273.8080704@mu.dk> References: <4534D273.8080704@mu.dk> Message-ID: <2006101709391161092346@k2.sage.att.com> Peter Mechlenborg wrote: > At the company I work for, we have recently started implementing a > domain specific language with an Erlang back end and have a prototype > compiler written in Common Lisp. Instead of generating Erlang source > code directly, the compiler has two phases with an sexp layer in > between, that is, the first phase in the compiler generates sexp's > corresponding to Erlang code, and the second phase generates Erlang > source code from the sexp's. i can't answer your question, but i'm curious why you didn't just develop the compiler in erlang? seems like it would've been simpler, and easier to integrate with the back end functionality you want. ---- Garry Hodgson, Senior Software Geek, AT&T CSO But I'm not giving in an inch to fear 'Cause I promised myself this year I feel like I owe it...to someone. From peter@REDACTED Tue Oct 17 16:49:45 2006 From: peter@REDACTED (Peter Mechlenborg) Date: Tue, 17 Oct 2006 16:49:45 +0200 Subject: [erlang-questions] Sexp front end for Erlang? In-Reply-To: <2006101709391161092346@k2.sage.att.com> References: <4534D273.8080704@mu.dk> <2006101709391161092346@k2.sage.att.com> Message-ID: <4534ED89.4030403@mu.dk> Garry Hodgson wrote: > Peter Mechlenborg wrote: > > >> At the company I work for, we have recently started implementing a >> domain specific language with an Erlang back end and have a prototype >> compiler written in Common Lisp. Instead of generating Erlang source >> code directly, the compiler has two phases with an sexp layer in >> between, that is, the first phase in the compiler generates sexp's >> corresponding to Erlang code, and the second phase generates Erlang >> source code from the sexp's. >> > > i can't answer your question, but i'm curious why you didn't just develop > the compiler in erlang? seems like it would've been simpler, and easier > to integrate with the back end functionality you want. > Well, mostly because I like Common Lisp a lot, although I must confess that Erlang has gained a lot on CL since I started using it, it's a great language. Another reason for doing it in CL was that the prototype dsl uses sexp's as syntax, so I didn't have to build a parser. (I could probably have used Erlang terms instead of sexp's to get the same advantage, and building the dsl as an internal language in Erlang might have made somethings easier, but I also think it would have made the coupling between the dsl and the back end stronger than we would want). I think that an sexp-erlang might be a fun idea, particularly in connection with macros, but then again, it might just be me having crazy thoughts :-). Have fun, -- Peter From yarivvv@REDACTED Tue Oct 17 20:21:13 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 17 Oct 2006 14:21:13 -0400 Subject: [erlang-questions] ErlTL: A Simple Erlang Template Language Message-ID: <17244f480610171121m5aeeef22p7f5373f4b0278cfa@mail.gmail.com> Hi, I created a simple template language called ErlTL that makes it easy to embed Erlang expressions in large amounts of textual binary data. It compiles template files into .beam files for good performance, and it gives line-precise error reporting. For more information, visit http://yarivsblog.com/articles/2006/10/17/introducting-erltl-a-simple-erlang-template-language You can get it here http://code.google.com/p/erltl Please let me know if you have any problems or suggestions! Thanks Yariv From jasonwtucker@REDACTED Tue Oct 17 20:36:22 2006 From: jasonwtucker@REDACTED (Jason Tucker) Date: Tue, 17 Oct 2006 14:36:22 -0400 Subject: [erlang-questions] R11B-1 on SPARC Solaris 10? Message-ID: Has anyone successfully built R11B-1 on Solaris 10 SPARC? I have successfully built just about every version, including R11B-0, but R11B-1 fails miserably at 'make depend', and I've been unsuccessful so far in trying to trace down the problem. NOTE that I can get it to build on Solaris 9... just not 10. I'm continuing to look into it, but if anyone has any gems of wisdom that might help out, I'd appreciate it: [jtucker@REDACTED otp_src_R11B-1]$gmake depend cd erts/emulator && ERL_TOP=/home/jtucker/src/otp_src_R11B-1 gmake generate depend gmake[1]: Entering directory `/home/jtucker/src/otp_src_R11B-1/erts/emulator' gmake -f sparc-sun-solaris2.10/Makefile generate gmake[2]: Entering directory `/home/jtucker/src/otp_src_R11B-1/erts/emulator' LANG=C /usr/bin/perl5 utils/beam_makeops -outdir sparc-sun-solaris2.10/opt/plain \ -emulator /home/jtucker/src/otp_src_R11B-1/lib/compiler/src/genop.tab beam/ops.tab beam/frag_ops.tab hipe/hipe_ops.tab LANG=C /usr/bin/perl5 utils/make_tables -src sparc-sun-solaris2.10 -include sparc-sun-solaris2.10 beam/atom.names beam/bif.tab hipe/hipe_bif0.tab hipe/hipe_bif1.tab hipe/hipe_bif2.tab hipe/hipe_sparc.tab LANG=C /usr/bin/perl5 utils/make_version -o sparc-sun-solaris2.10/erl_version.h R11B 5.5.1 sparc-sun-solaris2.10 LANG=C /usr/bin/perl5 utils/make_driver_tab -o sparc-sun-solaris2.10/driver_tab.c obj/sparc-sun-solaris2.10/opt/plain/efile_drv.o obj/sparc-sun-solaris2.10/opt/plain/ddll_drv.o obj/sparc-sun-solaris2.10/opt/plain/inet_drv.o obj/sparc- sun-solaris2.10/opt/plain/zlib_drv.o obj/sparc-sun-solaris2.10/opt/plain/ram_file_drv.o obj/sparc-sun-solaris2.10 /opt/plain/ttsl_drv.o LANG=C /usr/bin/perl5 utils/make_alloc_types -src beam/erl_alloc.types -dst sparc-sun-solaris2.10 /opt/plain/erl_alloc_types.h threads hipe unix cd /home/jtucker/src/otp_src_R11B-1/lib/kernel/ebin/../src && gmake ../ebin/otp_ring0.beam gmake[3]: Entering directory `/home/jtucker/src/otp_src_R11B-1/lib/kernel/src' erlc -W +debug_info +strict_record_tests -I../include -o../ebin otp_ring0.erl gmake[3]: erlc: Command not found gmake[3]: *** [../ebin/otp_ring0.beam] Error 127 gmake[3]: Leaving directory `/home/jtucker/src/otp_src_R11B-1/lib/kernel/src' gmake[2]: *** [/home/jtucker/src/otp_src_R11B-1/lib/kernel/ebin/otp_ring0.beam] Error 2 gmake[2]: Leaving directory `/home/jtucker/src/otp_src_R11B-1/erts/emulator' gmake[1]: *** [generate] Error 2 gmake[1]: Leaving directory `/home/jtucker/src/otp_src_R11B-1/erts/emulator' gmake: *** [depend] Error 2 __Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From jasonwtucker@REDACTED Tue Oct 17 20:52:51 2006 From: jasonwtucker@REDACTED (Jason Tucker) Date: Tue, 17 Oct 2006 14:52:51 -0400 Subject: [erlang-questions] R11B-1 on SPARC Solaris 10? In-Reply-To: References: Message-ID: Hmmm... the only reason 'make depend' worked for me on Solaris 9 is because I had a previous version of erlc in my $PATH. If I remove that, it suffers the same problem... erlc doesn't get built. __Jason On 10/17/06, Jason Tucker wrote: > > Has anyone successfully built R11B-1 on Solaris 10 SPARC? I have > successfully built just about every version, including R11B-0, but R11B-1 > fails miserably at 'make depend', and I've been unsuccessful so far in > trying to trace down the problem. NOTE that I can get it to build on Solaris > 9... just not 10. I'm continuing to look into it, but if anyone has any gems > of wisdom that might help out, I'd appreciate it: > > [jtucker@REDACTED otp_src_R11B-1]$gmake depend > cd erts/emulator && ERL_TOP=/home/jtucker/src/otp_src_R11B-1 gmake > generate depend > gmake[1]: Entering directory > `/home/jtucker/src/otp_src_R11B-1/erts/emulator' > gmake -f sparc-sun-solaris2.10/Makefile generate > gmake[2]: Entering directory > `/home/jtucker/src/otp_src_R11B-1/erts/emulator' > LANG=C /usr/bin/perl5 utils/beam_makeops -outdir sparc-sun-solaris2.10/opt/plain > \ > -emulator > /home/jtucker/src/otp_src_R11B-1/lib/compiler/src/genop.tab beam/ops.tab > beam/frag_ops.tab hipe/hipe_ops.tab > LANG=C /usr/bin/perl5 utils/make_tables -src sparc-sun-solaris2.10-include > sparc-sun-solaris2.10 beam/atom.names beam/bif.tab hipe/hipe_bif0.tab > hipe/hipe_bif1.tab hipe/hipe_bif2.tab hipe/hipe_sparc.tab > LANG=C /usr/bin/perl5 utils/make_version -o sparc-sun-solaris2.10/erl_version.h > R11B 5.5.1 sparc-sun-solaris2.10 > LANG=C /usr/bin/perl5 utils/make_driver_tab -o sparc-sun-solaris2.10/driver_tab.c > obj/sparc-sun-solaris2.10/opt/plain/efile_drv.o obj/sparc-sun-solaris2.10/opt/plain/ddll_drv.o > obj/sparc-sun-solaris2.10/opt/plain/inet_drv.o obj/sparc- sun-solaris2.10/opt/plain/zlib_drv.o > obj/sparc-sun-solaris2.10/opt/plain/ram_file_drv.o obj/sparc- > sun-solaris2.10/opt/plain/ttsl_drv.o > LANG=C /usr/bin/perl5 utils/make_alloc_types -src beam/erl_alloc.types > -dst sparc-sun-solaris2.10 /opt/plain/erl_alloc_types.h threads hipe unix > cd /home/jtucker/src/otp_src_R11B-1/lib/kernel/ebin/../src && gmake > ../ebin/otp_ring0.beam > gmake[3]: Entering directory > `/home/jtucker/src/otp_src_R11B-1/lib/kernel/src' > erlc -W +debug_info +strict_record_tests -I../include -o../ebin > otp_ring0.erl > gmake[3]: erlc: Command not found > gmake[3]: *** [../ebin/otp_ring0.beam] Error 127 > gmake[3]: Leaving directory > `/home/jtucker/src/otp_src_R11B-1/lib/kernel/src' > gmake[2]: *** > [/home/jtucker/src/otp_src_R11B-1/lib/kernel/ebin/otp_ring0.beam] Error 2 > gmake[2]: Leaving directory > `/home/jtucker/src/otp_src_R11B-1/erts/emulator' > gmake[1]: *** [generate] Error 2 > gmake[1]: Leaving directory > `/home/jtucker/src/otp_src_R11B-1/erts/emulator' > gmake: *** [depend] Error 2 > > __Jason > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeff@REDACTED Tue Oct 17 21:49:14 2006 From: jeff@REDACTED (Jeff Wood) Date: Tue, 17 Oct 2006 12:49:14 -0700 Subject: [erlang-questions] Sexp front end for Erlang? In-Reply-To: <4534ED89.4030403@mu.dk> References: <4534D273.8080704@mu.dk> <2006101709391161092346@k2.sage.att.com> <4534ED89.4030403@mu.dk> Message-ID: <453533BA.6060106@dark-light.com> Peter Mechlenborg wrote: >Garry Hodgson wrote: > > >>Peter Mechlenborg wrote: >> >> >> >> >>>At the company I work for, we have recently started implementing a >>>domain specific language with an Erlang back end and have a prototype >>>compiler written in Common Lisp. Instead of generating Erlang source >>>code directly, the compiler has two phases with an sexp layer in >>>between, that is, the first phase in the compiler generates sexp's >>>corresponding to Erlang code, and the second phase generates Erlang >>>source code from the sexp's. >>> >>> >>> >>i can't answer your question, but i'm curious why you didn't just develop >>the compiler in erlang? seems like it would've been simpler, and easier >>to integrate with the back end functionality you want. >> >> >> >Well, mostly because I like Common Lisp a lot, although I must confess >that Erlang has gained a lot on CL since I started using it, it's a >great language. Another reason for doing it in CL was that the >prototype dsl uses sexp's as syntax, so I didn't have to build a parser. >(I could probably have used Erlang terms instead of sexp's to get the >same advantage, and building the dsl as an internal language in Erlang >might have made somethings easier, but I also think it would have made >the coupling between the dsl and the back end stronger than we would want). > >I think that an sexp-erlang might be a fun idea, particularly in >connection with macros, but then again, it might just be me having crazy >thoughts :-). > >Have fun, > > -- Peter >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://www.erlang.org/mailman/listinfo/erlang-questions > > You can always go take a look @ Termite ... it's an implementation of much of Erlang ( core ) under Gambit scheme ... not "exactly" what you're after, but I figured it was worth mentioning. jd From robert.virding@REDACTED Tue Oct 17 22:12:58 2006 From: robert.virding@REDACTED (Robert Virding) Date: Tue, 17 Oct 2006 22:12:58 +0200 Subject: [erlang-questions] Sexp front end for Erlang? In-Reply-To: <4534D273.8080704@mu.dk> References: <4534D273.8080704@mu.dk> Message-ID: <4535394A.4080006@telia.com> Peter Mechlenborg wrote: > Hi, > > I'm new to the list, but I hope that I'm not too far off topic. > > At the company I work for, we have recently started implementing a > domain specific language with an Erlang back end and have a prototype > compiler written in Common Lisp. Instead of generating Erlang source > code directly, the compiler has two phases with an sexp layer in > between, that is, the first phase in the compiler generates sexp's > corresponding to Erlang code, and the second phase generates Erlang > source code from the sexp's. > > Currently the sexp layer is very simple, but I was wondering if someone > else has played with the idea of an sexp-based front end for Erlang, or > even made one? If so I would be very interested to hear more about it. > > I tried to google for something like the above, but I did not find anything. As far as I know no one has done an sexp-based front end. There would be no problems in actually doing it but you would end up doing quite a lot of work. The problem is that most of the system uses tuples almost exclusively to represent structures and lists to represent, well, lists. Lisp uses sexps, ie lists, for much much more. Even if you defined a sexp-based syntax, which you seem to have done, then you would to convert this to tuples to process in the compiler and evaluator. The return values from most built-ins and libraries use tuples for structures so all return values would seem strange from a list pow. Unfortunately, while it could be done, it just wouldn't fit with the rest of the system. Which is a great shame as lisp syntax IS cool and you can do a lot of fun things with it which is difficult with erlang. Pity, Robert (defun ask (?proc ?ques) (send ?proc ?ques) (receive ((?proc ?repl) () ?repl))) From robert.virding@REDACTED Tue Oct 17 22:37:41 2006 From: robert.virding@REDACTED (Robert Virding) Date: Tue, 17 Oct 2006 22:37:41 +0200 Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <4533FD04.4000708@telia.com> References: <20061003210624.22238.qmail@web38810.mail.mud.yahoo.com> <4533FD04.4000708@telia.com> Message-ID: <45353F15.5060807@telia.com> Forgot to add another major fault: + The difference between exits and errors (previously called faults) is definitely bogus and a big mistake to boot. Originally there was no noticeable difference between exits and errors, doing '1+a' and exit(badarg) would give you the same thing at all levels. THIS WAS INTENTIONAL! For the same reason doing exit/2 had exactly the same effect on the other processas exiting the current process. If you read Joe's thesis you uses exit like this. Then someone added stacktraces to errors. This was good thing of course, but now exits and errors were different. Unfortunately instead of fixing exit/1 this difference was cemented by adding erlang:error (before that erlang:fault) and separating both in try. So instead of one uniform mechanism now there are similar but different and incompatible ones. This is a similar problem as with links and process monitoring. Robert P.S. I still don't understand how someone could break link/1. The fix to unlink is ok. Robert Virding wrote: > Thomas Lindgren wrote: > >>--- Robert Virding wrote: >> >> >> >>>I believe it is important to keep things clean, >>>consistent and elegant >>>otherwise you will end up with a language built on >>>exceptions. >> >> >>So what is your opinion on Erlang of today? (half :-) >> >>Best, >>Thomas > > > I have been debating with myself whether to answer this but in the end I > gave in and decided that I would. > > Omn the whole I think we got things right but there are some things > which are wrong. Some are new, some are old and some are even my fault. > :-) So here is a collection of comments, major and minor (major marked > with +): > > - The naming and argument orders of the standard libraries is > inconsistent. While this can seem trivial it does break the principle of > least astonishment and therefore causes unnecessary problems. > > - The syntax could have been cleaned up a bit. No, I don't see any > problems with having ';' as separator not a terminator. Being able to > write "foo(X) -> X;." sucks. > > + Should have had proper variable scoping, what is right for Prolog is > not best for Erlang. I would also have all variables in patterns as > fresh variables and have explicit tests for equality with already bound > variables. > > + The concept of what a BIF (Built In function) is is a mess. Now it > seems to mean something written in C. That is something we addressed in > the standard and got right. A BIF is a function which is part of the > langauge but without special syntax. So spawn and link are just as much > Erlang as ! and receive but they look like functions. BIFs have the same > dignity as the emulator, both ARE the language. > > What language a BIF is written in is irrelevant. > > Most BIFs can be called through the module erlang so having the module > erlang as part of OTP just does not make sense. > > - Some of the BIF names are too long, tget and tset would have been better. > > - A suggestion in the standard was to have BIFsin different modules not > just erlang, for example atom, tuple, number, proc, ... This would have > been much better and could have been added with a minimum of trouble. > > + There is no layering in the standard libraries, all is part of OTP. > This make is difficult to build small, stand-alone application. In > essence you tend to get what OO was accused of: you want the banana but > get the whole gorilla as well. Yes, you can make a tool which extracts > what you want but that is a work-around not a fix. > > Many of the libraries are so fundamental that having them managed by OTP > does not really make sense, they are below that necessary for it. > > Joe and I discussed this alot and we agreed on the principle but not on > all the details. I would like to see something like: > > ____________________________________________________________________ > > erlang emulator + BIFs (see above) > ____________________________________________________________________ > > basic libraries - lists, file, io etc. (maybe layered as well) > ____________________________________________________________________ > | > OTP | included applications - compiler, etc | > _________________________________________________ > > user apps, OTP based or otherwise > ____________________________________________________________________ > > The system is useable without OTP and applications can choose at what > level they need the libraries. I hope the diagram is understandable. > > - Binaries are nice but I don't really like the bit syntax, although I > haven't really sat down and come up with a better alternative. > > - Records as they stand are not beautiful. However, it is important to > remember that when they were introduced it was an absolute requirement > that they would be as fast as using tuples directly. Even this > implementation was suspect. I kid you not. > > - Structs or dictionaries as suggested by Richard O'K would be a BIG WIN. > > + All forms of communication between processes should be asynchronous. > Messages signals, links, ALL of them. You send them off and depending on > what you do you may get an exit signal back. Originally the only thing > which broke this principle was sending to a local registered process, > now, however, more things break it. Link for example. > > Why worry you may ask. Well, everything which is asynchronous will > automatically scale to distributed systems, synchronous calls don't! > This may also affect multi-core implementations which are going to be > very important. > > + Originally there were two basically different types of objects in > Erlang: static terms and things with dynamic state, processes. > > A process is something which has process semantics, you communicate > through messages, can link to it and exchange exit signals. N.B. how a > process is implemented is irrelevant it is the external semantics which > define a process. > > Unfortunately there two (at least) things in erlangwhich don't conform > to this principle, ETS tables and ports. They're coming next. > > + ETS tables are neither and this causes problems. ETS was conceived to > solve two main problems: fast, near constant access to large tables; and > to get around the garbage collection problem in the erlang > implementation. If you have a LARGE process then it is noticeable when > the emulator stops during a collection. This problem still exists today. > > The solution to the second problem was to keep ETS tables in a > completely separate area and copy data to/from processes. Unfortunately > this implementation detail, which it is, affected the interface and > instead of solving the real problem, i.e. the copying, work-arounds were > added to minimise this, match_XXXX, select_XXXX, ms_transforms. No one > can claim that match patterns and matchspecs are beautiful or fit in > with the rest of erlang. These are just work-arounds to minimise copying > and would be unnecessary if the implementations was fixed. Then you > could use a proper pattern to select and all you would need is fold. > > Getting back ETS tables are neither static data or processes and break > the principle. > > + Ports are funny. Originally when they were conceived they had only > process semantics, in fact we actually debated whether to have a > separate data type at all. They were modelled on UNIX streams, the idea > being that you could insert various filters along the way without the > users noticing. This is no problem with processes. > > However, the the various port_XXXX commands were added and now ports are > different. Ironically, the manual calls the process interface illogical > because it is different from the function interface. > > - if should really have been what cond is today. Is cond today? > > - The abstract form of the erlang syntax should have been in a form > which could be described by records. > > - and/or and andalso/orelse are different semantically and having both > is a win, although some people don't think so. > > - catch should not have been an operator but instead catch ... end. > > - Erlang does not need currying. > > - Erlang was originally designed to follow the KISS principle. > > + Perhaps we should have defined the message interface more often > instead of wrapping everything in an access function? You can do more > with the interface. > > + You need both link and monitor_process, it would have been better to > have a more basic primitive on which both are built. Easier to under > stand the interactions. > > Having everything consistent makes it easier to understand and lessens > the risk of strange interactions. If everything is a process and obeys > the (asynchronous) process semantics then it easier to understand the > interactions. They will all be explicit in the code (even the mistakes > :-)) and not so dependant on which order you do things because sometimes > you get a fault and sometimes a signal so if they are in the wrong order > then somethings won't get done. > > Special cases just cause problems in the long run. > > That's about it for the first go. I will willingly debate any of my > comments on the erlang, but don't expect me to change my mind. Being, as > I am, right. > > Robert > > "I'm not arrogant, I'm right!" > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From robert.virding@REDACTED Tue Oct 17 22:44:31 2006 From: robert.virding@REDACTED (Robert Virding) Date: Tue, 17 Oct 2006 22:44:31 +0200 Subject: [erlang-questions] Improved regexp.erl Message-ID: <453540AF.7040607@telia.com> I have added an upgraded, drop-in replacement to the user contributions in trapexit.org. It allows for compilation of regular expressions. They can either be used directly in the functions in the module, as with regexp:parse, or the DFA built from the regexps can be returned. Read the documentation. Robert From robert.virding@REDACTED Tue Oct 17 23:08:16 2006 From: robert.virding@REDACTED (Robert Virding) Date: Tue, 17 Oct 2006 23:08:16 +0200 Subject: [erlang-questions] Indentity parse transform Message-ID: <45354640.2000305@telia.com> Long ago I wrote an identity parse transform, i.e. one that can handle all code but returns the original code. Does anyone know where I can find it? It doesn't seem to be in the distribution, at least I can't find it. Robert From yarivvv@REDACTED Tue Oct 17 23:43:06 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 17 Oct 2006 17:43:06 -0400 Subject: [erlang-questions] Improved regexp.erl In-Reply-To: <453540AF.7040607@telia.com> References: <453540AF.7040607@telia.com> Message-ID: <17244f480610171443m80fdf62x261a9ae5f90a633a@mail.gmail.com> Hi Robert, Thanks for the new regexp module! Have you ran any benchmarks comparing its performance to the old module? Also, I remember your mentioning it would be able to work with binaries. Is that capability implemented? Thanks Yariv On 10/17/06, Robert Virding wrote: > I have added an upgraded, drop-in replacement to the user contributions > in trapexit.org. It allows for compilation of regular expressions. They > can either be used directly in the functions in the module, as with > regexp:parse, or the DFA built from the regexps can be returned. Read > the documentation. > > Robert > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From brad@REDACTED Wed Oct 18 02:00:54 2006 From: brad@REDACTED (Brad Marshall) Date: Tue, 17 Oct 2006 18:00:54 -0600 Subject: [erlang-questions] Bug in Inets handling of PUT? Message-ID: I'm calling a web service with a PUT via http:request/6. The PUT results in a 200 and a content length of zero. The zero-length response seems to be causing the request to hang until the keepalive timeout expires and the socket closes. If I make the change below then the PUT works perfectly: diff httpc_response.erl httpc_response.erl.original 61c61 < N when N >= Length -> --- > N when N >= Length, Length > 0 -> I'm new to Erlang so please point me in the right direction if I'm off base. I've checked the RFC and it seems valid for a PUT to have a zero-length response. Oh, and I tried this in ibrowse and it worked perfectly, but I'd much rather use a built-in if possible. Any tips on solving this are greatly appreciated. Thanks, brad ________________________________________________ Message sent using UebiMiau 2.7.9 From brad@REDACTED Wed Oct 18 02:01:36 2006 From: brad@REDACTED (Brad Marshall) Date: Tue, 17 Oct 2006 18:01:36 -0600 Subject: [erlang-questions] Bug in Inets handling of PUT? Message-ID: <18f98eaf3b19f2e1891cfeeee3f3e439@207.171.180.101> I'm calling a web service with a PUT via http:request/6. The PUT results in a 200 and a content length of zero. The zero-length response seems to be causing the request to hang until the keepalive timeout expires and the socket closes. If I make the change below then the PUT works perfectly: diff httpc_response.erl httpc_response.erl.original 61c61 < N when N >= Length -> --- > N when N >= Length, Length > 0 -> I'm new to Erlang so please point me in the right direction if I'm off base. I've checked the RFC and it seems valid for a PUT to have a zero-length response. Oh, and I tried this in ibrowse and it worked perfectly, but I'd much rather use a built-in if possible. Any tips on solving this are greatly appreciated. Thanks, brad ________________________________________________ Message sent using UebiMiau 2.7.9 From jces@REDACTED Wed Oct 18 02:24:52 2006 From: jces@REDACTED (jces@REDACTED) Date: Tue, 17 Oct 2006 17:24:52 -0700 Subject: [erlang-questions] a candidate application for Erlang Message-ID: <200610180024.k9I0OqHF010234@mail.monad.com> (I seem to recall the occasional person asking for Erlang project suggestions.) Seems like handling zillions of connections in order to foil spammers might be well-suited to Erlang: http://www.onlamp.com/pub/a/onlamp/2006/10/12/asynchronous_events.html From robert.virding@REDACTED Wed Oct 18 02:38:14 2006 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 18 Oct 2006 02:38:14 +0200 Subject: [erlang-questions] Improved regexp.erl In-Reply-To: <17244f480610171443m80fdf62x261a9ae5f90a633a@mail.gmail.com> References: <453540AF.7040607@telia.com> <17244f480610171443m80fdf62x261a9ae5f90a633a@mail.gmail.com> Message-ID: <45357776.90708@telia.com> Hi Yariv, No serious benchmarks, only small tests. Comparing doing regexp:parse to regexp:compile and then regexp:matches on a large file (400kB) I found small speed up on straight regexps like "abc", and large speed up for regexps with many alternatives like "[a-z]+". No binaries yet. Not difficult to do if you can accept doing either pure lists OR a binary. Doing iolists becomes complicated. This keeping the same interface as now. Also planning to do a parse transform which compiles regexp into code within the module. Similar code to what leex generates. This will be better at compile time as there wil be no need to build a structure to interpret at runtime as regexp:compile does. This is really not difficult either. If I can find my old parse transform identity function. Robert Yariv Sadan wrote: > Hi Robert, > > Thanks for the new regexp module! Have you ran any benchmarks > comparing its performance to the old module? Also, I remember your > mentioning it would be able to work with binaries. Is that capability > implemented? > > Thanks > Yariv > > On 10/17/06, Robert Virding wrote: > >> I have added an upgraded, drop-in replacement to the user contributions >> in trapexit.org. It allows for compilation of regular expressions. They >> can either be used directly in the functions in the module, as with >> regexp:parse, or the DFA built from the regexps can be returned. Read >> the documentation. >> >> Robert >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > From chris.newcombe@REDACTED Wed Oct 18 06:12:37 2006 From: chris.newcombe@REDACTED (Chris Newcombe) Date: Tue, 17 Oct 2006 21:12:37 -0700 Subject: [erlang-questions] Thread-safety of driver_alloc/realloc/free_binary Message-ID: <781dd98c0610172112j7f28bb49xab82b589d9ea98ec@mail.gmail.com> (To the maintainers of erts/emulator/beam/io.c ... ) Hi, I'm working on an update to Scott Lystig Fritchie's Erlang Driver Toolkit, including a significantly enhanced driver for Berkeley DB. I hope to be able to release this soon as open-source. The update includes features such as multiple private resizable threadpools per port instance (supported in both 'linked-in' and 'spawned-pipe' modes). One problem is that, when getting data from Berkeley DB, the driver needs to allocate driver binaries. Ideally, it would like to to do so from within the driver's private threadpools. But of course, driver_alloc/realloc/free_binary are not documented as thread-safe. So currently the Berkeley DB driver has to allocate each piece of data twice (once with malloc and later with driver_alloc_binary), and copy it once. And the copying is done in the Erlang scheduler thread, which blocks the VM unecessarily. This appears to be changing. I found the following comments in otp_src_R11B-1/erts/emulator/beam/io.c * - driver_alloc_binary() is thread safe (efile driver depend on it). * - driver_realloc_binary(), and driver_free_binary() are *not* thread safe. Unfortunately, to avoid the copying the Berkeley DB driver needs to call all 3 of these functions from private threads. So, please could the realloc & free functions also be made thread-safe, and documented as such? This would be a major performance benefit for many multi-threaded drivers (not just the efile driver mentioned in the comment), Many thanks for considering this, Chris From ingela@REDACTED Wed Oct 18 08:25:55 2006 From: ingela@REDACTED (Ingela Anderton) Date: Wed, 18 Oct 2006 08:25:55 +0200 Subject: [erlang-questions] Bug in Inets handling of PUT? Message-ID: <17717.51443.990859.886214@gargle.gargle.HOWL> You are right it is a bug in inets. However it is already fixed. (It has been reported before.) It will be part of the next open source release. YouI'm calling a web service with a PUT via http:request/6. The PUT results in a 200 and a content length of zero. The zero-length response seems to be causing the request to hang until the keepalive timeout expires and the socket closes. If I make the change below then the PUT works perfectly: diff httpc_response.erl httpc_response.erl.original 61c61 < N when N >= Length -> --- > N when N >= Length, Length > 0 -> I'm new to Erlang so please point me in the right direction if I'm off base. I've checked the RFC and it seems valid for a PUT to have a zero-length response. Oh, and I tried this in ibrowse and it worked perfectly, but I'd much rather use a built-in if possible. Any tips on solving this are greatly appreciated. Thanks, -- m.v.h Ingela //The highway of life is always under construction. // |\ _,,,--,,_ ,) /,`.-'`' -, ;-;;' |,4- ) )-,_ ) /\ '---''(_/--' (_/-' Ericsson AB - OTP team From bjorn@REDACTED Wed Oct 18 08:45:51 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 18 Oct 2006 08:45:51 +0200 Subject: [erlang-questions] Indentity parse transform In-Reply-To: <45354640.2000305@telia.com> References: <45354640.2000305@telia.com> Message-ID: It's in stdlib/examples. /Bjorn Robert Virding writes: > Long ago I wrote an identity parse transform, i.e. one that can handle > all code but returns the original code. Does anyone know where I can > find it? It doesn't seem to be in the distribution, at least I can't > find it. > > Robert > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From vladdu55@REDACTED Wed Oct 18 08:52:39 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 18 Oct 2006 08:52:39 +0200 Subject: [erlang-questions] Indentity parse transform In-Reply-To: <45354640.2000305@telia.com> References: <45354640.2000305@telia.com> Message-ID: <95be1d3b0610172352w1e8c9263udc7edd5d9fa479a8@mail.gmail.com> Hi, Are you referring to stdlib/examples/erl_id_trans.erl? You might want to consider instead Ulf's transform helpers, that make the job much easier (you don't have to write anything for the parts that are untouched) regards, Vlad On 10/17/06, Robert Virding wrote: > Long ago I wrote an identity parse transform, i.e. one that can handle > all code but returns the original code. Does anyone know where I can > find it? It doesn't seem to be in the distribution, at least I can't > find it. > > Robert > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From patrik@REDACTED Wed Oct 18 09:16:40 2006 From: patrik@REDACTED (Patrik Winroth) Date: Wed, 18 Oct 2006 09:16:40 +0200 Subject: [erlang-questions] a candidate application for Erlang In-Reply-To: <200610180024.k9I0OqHF010234@mail.monad.com> References: <200610180024.k9I0OqHF010234@mail.monad.com> Message-ID: This has actually already been done in Erlang. The Erlang startup Bluetail made a Mail Robustifier (BMR) back in 1999. BMR was heavily used by a large swedish ISP which developed it further 2001-2003, when me and Jenny Dybendahl implemented very similar functionality (we called it tarpitting) to what is described in the Onlamp article. /BR Patrik. On Oct 18, 2006, at 2:24 AM, jces@REDACTED wrote: > > (I seem to recall the occasional person asking for Erlang project > suggestions.) Seems like handling zillions of connections in order > to foil > spammers might be well-suited to Erlang: > > http://www.onlamp.com/pub/a/onlamp/2006/10/12/asynchronous_events.html > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From ugglan@REDACTED Wed Oct 18 12:19:44 2006 From: ugglan@REDACTED (=?ISO-8859-1?Q?Tobias_L=F6fgren?=) Date: Wed, 18 Oct 2006 12:19:44 +0200 Subject: [erlang-questions] Bug in Inets handling of PUT? In-Reply-To: <18f98eaf3b19f2e1891cfeeee3f3e439@207.171.180.101> References: <18f98eaf3b19f2e1891cfeeee3f3e439@207.171.180.101> Message-ID: <5c402a550610180319u59de482bx3421b52a9d462ca8@mail.gmail.com> I've had this problem aswell, as Ingela said elsewhere the fix is coming in the next release of erlang. Until then you can use this version of whole_body in httpc_response.erl: whole_body(Body, Length) -> case size(Body) of N when N < Length, N > 0 -> {?MODULE, whole_body, [Body, Length]}; %% OBS! The Server may close the connection to indicate that the %% whole body is now sent instead of sending an lengh %% indicator.In this case the lengh indicator will be %% 0 but N > 0 and we want to match the last branch in %% this function as the connection is not yet closed. N when N >= Length, Length > 0 -> %% Potential trailing garbage will be thrown away in %% format_response/1 Some servers may send a 100-continue %% response without the client requesting it through an %% expect header in this case the trailing bytes may be %% part of the real response message. {ok, Body}; 0 when 0 == Length -> %% The body is empty {ok, Body}; _ -> {?MODULE, whole_body, [Body, Length]} end. /tobias On 10/18/06, Brad Marshall wrote: > > I'm calling a web service with a PUT via http:request/6. The PUT results > in > a 200 and a content length of zero. The zero-length response seems to be > causing the request to hang until the keepalive timeout expires and the > socket closes. If I make the change below then the PUT works perfectly: > > diff httpc_response.erl httpc_response.erl.original > 61c61 > < N when N >= Length -> > --- > > N when N >= Length, Length > 0 -> > > I'm new to Erlang so please point me in the right direction if I'm off > base. > I've checked the RFC and it seems valid for a PUT to have a zero-length > response. Oh, and I tried this in ibrowse and it worked perfectly, but > I'd > much rather use a built-in if possible. > > Any tips on solving this are greatly appreciated. > > Thanks, > brad > > ________________________________________________ > Message sent using UebiMiau 2.7.9 > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From surindar.shanthi@REDACTED Wed Oct 18 16:36:01 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Wed, 18 Oct 2006 20:06:01 +0530 Subject: [erlang-questions] odbc:sql_query/2 problem Message-ID: <42ea5fb60610180736o31f8e5c7v83e08ef5b4632951@mail.gmail.com> Dear all, I'm using erlang 5.4.3 Using ODBC, I'm using Store Procedure (SP) which first updates and then selects contents in a table. The function odbc:sql_query/2 is returning {error,"No SQL driver information avaiable" }. ( The same SP is perfectly working in MS SQL query analyser) If Ichange the order of operation of SP such that it first select the and then update the contents, the function odbc:sql_query/2 is working perfectly. Is it a bug in erlang? -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From js.pedron@REDACTED Wed Oct 18 17:33:41 2006 From: js.pedron@REDACTED (=?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?=) Date: Wed, 18 Oct 2006 17:33:41 +0200 Subject: [erlang-questions] erl_ddll bugfixes Message-ID: <45364955.2010903@meetic-corp.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, Note: I posted a mail a week ago on erlang-patches@ about a bug in erl_ddll but didn't get any feedback so I try again here. erl_ddll contains a bug with reference count. You'll find an example of it in my first mail: http://www.erlang.org/pipermail/erlang-patches/2006-October/000164.html To sum up quickly the problem, ddll_server will only keep a reference for the first and the last processes who loaded a library. Every in-between process references will be dropped with each call to erl_ddll:load_driver/2. The consequence is that if the first and the last processes unload the driver, the library will be effectively unloaded and every still running port drivers will become unusable. Since then, I found another bug regarding the link established between ddll_server and the process who called erl_ddll:load_driver/2. This link exists only between ddll_server and the first process. Following processes who load the same library won't have a link and if they exit without calling erl_ddll:unload_driver/1, their reference in ddll_server will remain there until ddll_server terminates. These two bugs exist at least from R10B-7 up to R11B-1. - -- Jean-S?bastien P?dron Meetic Corp. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFNklVa+xGJsFYOlMRAvJOAJ4qKOgbDJt17QUxx6WuAN2mpmm6UQCgy1+2 +UeV0bjkxt4c7D1MMF9f7lg= =ZL0b -----END PGP SIGNATURE----- -------------- next part -------------- A non-text attachment was scrubbed... Name: otp_src_R11B-1-erl_ddll-reference_count.patch Type: text/x-patch Size: 604 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: otp_src_R11B-1-erl_ddll-process-link.patch Type: text/x-patch Size: 461 bytes Desc: not available URL: From jasonwtucker@REDACTED Wed Oct 18 20:40:04 2006 From: jasonwtucker@REDACTED (Jason Tucker) Date: Wed, 18 Oct 2006 14:40:04 -0400 Subject: [erlang-questions] R11B-1 on SPARC Solaris 10? In-Reply-To: References: Message-ID: OK, I tried one more thing... this time I extracted the R11B-1 source into the same path as the R11B-0 source, and tried compiling again. This seemed to work fine... the build and install went well. As far as I can tell, I've got a functional R11B-1 install here. Just seems odd to me that this was necessary. __Jason On 10/17/06, Jason Tucker wrote: > > Hmmm... the only reason 'make depend' worked for me on Solaris 9 is > because I had a previous version of erlc in my $PATH. If I remove that, it > suffers the same problem... erlc doesn't get built. > > __Jason > > On 10/17/06, Jason Tucker wrote: > > > > Has anyone successfully built R11B-1 on Solaris 10 SPARC? I have > > successfully built just about every version, including R11B-0, but R11B-1 > > fails miserably at 'make depend', and I've been unsuccessful so far in > > trying to trace down the problem. NOTE that I can get it to build on Solaris > > 9... just not 10. I'm continuing to look into it, but if anyone has any gems > > of wisdom that might help out, I'd appreciate it: > > > > [jtucker@REDACTED otp_src_R11B-1]$gmake depend > > cd erts/emulator && ERL_TOP=/home/jtucker/src/otp_src_R11B-1 gmake > > generate depend > > gmake[1]: Entering directory > > `/home/jtucker/src/otp_src_R11B-1/erts/emulator' > > gmake -f sparc-sun-solaris2.10/Makefile generate > > gmake[2]: Entering directory > > `/home/jtucker/src/otp_src_R11B-1/erts/emulator' > > LANG=C /usr/bin/perl5 utils/beam_makeops -outdir sparc-sun-solaris2.10/opt/plain > > \ > > -emulator > > /home/jtucker/src/otp_src_R11B-1/lib/compiler/src/genop.tab beam/ops.tab > > beam/frag_ops.tab hipe/hipe_ops.tab > > LANG=C /usr/bin/perl5 utils/make_tables -src sparc-sun-solaris2.10-include > > sparc-sun-solaris2.10 beam/atom.names beam/bif.tab hipe/hipe_bif0.tab > > hipe/hipe_bif1.tab hipe/hipe_bif2.tab hipe/hipe_sparc.tab > > LANG=C /usr/bin/perl5 utils/make_version -o sparc-sun-solaris2.10/erl_version.h > > R11B 5.5.1 sparc-sun-solaris2.10 > > LANG=C /usr/bin/perl5 utils/make_driver_tab -o sparc-sun-solaris2.10/driver_tab.c > > obj/sparc-sun-solaris2.10/opt/plain/efile_drv.o obj/sparc- > > sun-solaris2.10/opt/plain/ddll_drv.o obj/sparc-sun-solaris2.10/opt/plain/inet_drv.o > > obj/sparc- sun-solaris2.10/opt/plain/zlib_drv.o obj/sparc- > > sun-solaris2.10/opt/plain/ram_file_drv.o obj/sparc-sun-solaris2.10 > > /opt/plain/ttsl_drv.o > > LANG=C /usr/bin/perl5 utils/make_alloc_types -src beam/erl_alloc.types > > -dst sparc-sun-solaris2.10 /opt/plain/erl_alloc_types.h threads hipe > > unix > > cd /home/jtucker/src/otp_src_R11B-1/lib/kernel/ebin/../src && gmake > > ../ebin/otp_ring0.beam > > gmake[3]: Entering directory > > `/home/jtucker/src/otp_src_R11B-1/lib/kernel/src' > > erlc -W +debug_info +strict_record_tests -I../include -o../ebin > > otp_ring0.erl > > gmake[3]: erlc: Command not found > > gmake[3]: *** [../ebin/otp_ring0.beam] Error 127 > > gmake[3]: Leaving directory > > `/home/jtucker/src/otp_src_R11B-1/lib/kernel/src' > > gmake[2]: *** > > [/home/jtucker/src/otp_src_R11B-1/lib/kernel/ebin/otp_ring0.beam] Error 2 > > gmake[2]: Leaving directory > > `/home/jtucker/src/otp_src_R11B-1/erts/emulator' > > gmake[1]: *** [generate] Error 2 > > gmake[1]: Leaving directory > > `/home/jtucker/src/otp_src_R11B-1/erts/emulator' > > gmake: *** [depend] Error 2 > > > > __Jason > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fritchie@REDACTED Wed Oct 18 20:51:03 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Wed, 18 Oct 2006 13:51:03 -0500 Subject: [erlang-questions] Sexp front end for Erlang? In-Reply-To: Message of "Tue, 17 Oct 2006 14:54:11 +0200." <4534D273.8080704@mu.dk> Message-ID: <200610181851.k9IIp32w024846@snookles.snookles.com> >>>>> "pm" == Peter Mechlenborg writes: pm> Currently the sexp layer is very simple, but I was wondering if pm> someone else has played with the idea of an sexp-based front end pm> for Erlang, or even made one? This is off-topic ... but there's a paper in the Scheme workshop from the ACM ICFP 2006 that discusses the advantages & disadvantages of using sexprs for RPC across multiple applications, languages, platforms, etc. (It's not SOAP, hooray) http://scheme2006.cs.uchicago.edu/ "Experiences with Scheme in an Electro-Optics Laboratory" -Scott From calmasy@REDACTED Thu Oct 19 01:59:02 2006 From: calmasy@REDACTED (=?ISO-8859-1?Q?Count_L=E1szl=F3_de_Alm=E1sy?=) Date: Wed, 18 Oct 2006 17:59:02 -0600 Subject: [erlang-questions] Erlang for a SMTP server? Message-ID: Greetings, I'm still new to Erlang, so bear with me if this is a dumb question. Basically, I'm being tasked to write a simple SMTP proxy for my company for incoming mail that answers on port 25, performs some rudimentary anti-spam checks, and then forwards the connection along to the "real" SMTP server, which may either be running on the same machine under a different port, or on a different host's port 25. The idea is that this will be the application that has direct exposure to the Internet, reject as much obvious spam mail as possible, and then let the rest sail through for the real SMTP server to handle. It must be ultra scalable, supporting upwards of thousands of concurrent connections. Is Erlang a good choice for such a task? The other platforms I'm looking at are stackless Python and Twisted Python, but Erlang seems like it might be a more natural choice. Thanks. From michael206@REDACTED Thu Oct 19 07:31:20 2006 From: michael206@REDACTED (Michael Leonhard) Date: Thu, 19 Oct 2006 00:31:20 -0500 Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <45353F15.5060807@telia.com> References: <20061003210624.22238.qmail@web38810.mail.mud.yahoo.com> <4533FD04.4000708@telia.com> <45353F15.5060807@telia.com> Message-ID: <21f8b6e20610182231i769df6d6ua2842645cb1cc29a@mail.gmail.com> I discovered Erlang only 2 years ago, but can appreciate most of the points Robert expressed. Erlang is a great language that can evolve to become greater. It seems as though everyone acknowledges the shortcomings of the current Erlang, but no one can improve it because of the need for backwards compatibility. Erlang is already breaking out into the mainstream development community. Now Ericsson's mountains of Erlang code seem like a dead weight attached to Erlang's neck, preventing it from bursting through the surface of the ocean of obscurity. Erlang needs to reach the surface and get a breath of fresh air. How about forking the language and redesigning it to fix the problems? -Michael Michael Leonhard michael206@REDACTED http://tamale.net/ On 10/17/06, Robert Virding wrote: > > Omn the whole I think we got things right but there are some things > > which are wrong. Some are new, some are old and some are even my fault. > > :-) So here is a collection of comments, major and minor (major marked > > with +): > > Joe and I discussed this alot and we agreed on the principle but not on > > all the details. I would like to see something like: > > Having everything consistent makes it easier to understand and lessens > > the risk of strange interactions. If everything is a process and obeys > > That's about it for the first go. I will willingly debate any of my > > comments on the erlang, but don't expect me to change my mind. Being, as > > I am, right. > > > > Robert From bjorn@REDACTED Thu Oct 19 08:53:07 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 19 Oct 2006 08:53:07 +0200 Subject: [erlang-questions] erl_ddll bugfixes In-Reply-To: <45364955.2010903@meetic-corp.com> References: <45364955.2010903@meetic-corp.com> Message-ID: Thanks for the bug report. We read all emails but we are often slow to answer them. In this case, we are in the progress of totally rewriting the erl_ddll code for the R11B-2 release. The bugs you mentioned will be corrected, as well as other issues. /Bjorn Jean-S?bastien P?dron writes: > * PGP Signed by an unknown key: 10/18/2006 at 05:33:41 PM > > Hello, > > Note: I posted a mail a week ago on erlang-patches@ about a bug in > erl_ddll but didn't get any feedback so I try again here. > > erl_ddll contains a bug with reference count. You'll find an example of > it in my first mail: > http://www.erlang.org/pipermail/erlang-patches/2006-October/000164.html > > To sum up quickly the problem, ddll_server will only keep a reference > for the first and the last processes who loaded a library. Every > in-between process references will be dropped with each call to > erl_ddll:load_driver/2. > > The consequence is that if the first and the last processes unload the > driver, the library will be effectively unloaded and every still running > port drivers will become unusable. > > Since then, I found another bug regarding the link established between > ddll_server and the process who called erl_ddll:load_driver/2. This link > exists only between ddll_server and the first process. Following > processes who load the same library won't have a link and if they exit > without calling erl_ddll:unload_driver/1, their reference in ddll_server > will remain there until ddll_server terminates. > > These two bugs exist at least from R10B-7 up to R11B-1. > > -- > Jean-S??bastien P??dron > Meetic Corp. > > * Unknown Key > * 0xC1583A53 (L) > > --- otp_src_R11B-1-orig/lib/kernel/src/erl_ddll.erl 2006-05-03 09:59:12.000000000 +0200 > +++ otp_src_R11B-1/lib/kernel/src/erl_ddll.erl 2006-10-10 15:08:58.000000000 +0200 > @@ -164,8 +164,8 @@ > > increment_process_count([{From, Count}|Rest], From, Result) -> > Result ++ [{From, Count+1}|Rest]; > -increment_process_count([Process|Rest], From, _Result) -> > - increment_process_count(Rest, From, [Process|Rest]); > +increment_process_count([Process|Rest], From, Result) -> > + increment_process_count(Rest, From, [Process|Result]); > increment_process_count([], From, Result) -> > [{From, 1}|Result]. > > --- otp_src_R11B-1-orig/lib/kernel/src/erl_ddll.erl 2006-10-11 15:07:22.000000000 +0200 > +++ otp_src_R11B-1/lib/kernel/src/erl_ddll.erl 2006-10-11 15:05:33.000000000 +0200 > @@ -167,6 +167,7 @@ > increment_process_count([Process|Rest], From, _Result) -> > increment_process_count(Rest, From, [Process|Rest]); > increment_process_count([], From, Result) -> > + link(From), > [{From, 1}|Result]. > > %% Decrements the reference count for Driver in process From, > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From dmitriid@REDACTED Thu Oct 19 10:12:31 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Thu, 19 Oct 2006 11:12:31 +0300 Subject: [erlang-questions] ErlTL: A Simple Erlang Template Language In-Reply-To: <17244f480610171121m5aeeef22p7f5373f4b0278cfa@mail.gmail.com> References: <17244f480610171121m5aeeef22p7f5373f4b0278cfa@mail.gmail.com> Message-ID: Hi. Couldn't reply on your site as reply form seems to be broken. I've tried compiling a UTF-8 template file. Hoorah! :) It works just fine However, it wouldn't work if <%? [What, Where, Objects, Action] = Data %> wasn't the first line of the template. Even inserting a newline before that would result in the following error: {error,{misplaced_top_expression,{line,2}, "<%? [What, Where, Objects, Action] = Data %>\r "}} This error appeared for both ASCII and UTF-8 files. I wonder if I should have reported this as a bug instead of polluting the maillist... On 10/17/06, Yariv Sadan wrote: > > Hi, > > I created a simple template language called ErlTL that makes it easy > to embed Erlang expressions in large amounts of textual binary data. > It compiles template files into .beam files for good performance, and > it gives line-precise error reporting. For more information, visit > > > http://yarivsblog.com/articles/2006/10/17/introducting-erltl-a-simple-erlang-template-language > > You can get it here > > http://code.google.com/p/erltl > > Please let me know if you have any problems or suggestions! > > Thanks > Yariv > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From js.pedron@REDACTED Thu Oct 19 10:23:50 2006 From: js.pedron@REDACTED (=?ISO-8859-1?Q?Jean-S=E9bastien_P=E9dron?=) Date: Thu, 19 Oct 2006 10:23:50 +0200 Subject: [erlang-questions] erl_ddll bugfixes In-Reply-To: References: <45364955.2010903@meetic-corp.com> Message-ID: <45373616.8020508@meetic-corp.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 19.10.2006 08:53, Bjorn Gustavsson wrote: > We read all emails but we are often slow to answer them. It's ok. > In this case, we are in the progress of totally rewriting > the erl_ddll code for the R11B-2 release. The bugs you > mentioned will be corrected, as well as other issues. This is a great news. We're looking forward to get our hands on this release! Thanks a lot for your work. - -- Jean-S?bastien P?dron Meetic Corp. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFNzYWa+xGJsFYOlMRAncGAKClp5Ja4N3u6O43iBtiMCtcoHo5NwCfSOuw DkZYdmXhLGWi42XA08Hjhe8= =S5aP -----END PGP SIGNATURE----- From ke.han@REDACTED Thu Oct 19 13:22:24 2006 From: ke.han@REDACTED (ke han) Date: Thu, 19 Oct 2006 19:22:24 +0800 Subject: [erlang-questions] Erlang for a SMTP server? In-Reply-To: References: Message-ID: <8D1CF670-F0AF-4D28-BA7B-560523F55FB6@redstarling.com> This question was just answered yesterday...See mailist post titled: "a candidate application for Erlang". It speaks directly to using erlang as a robust smtp server. In short, erlang is highly suitable for such an app...I wouldn't consider using anything else. ke han On Oct 19, 2006, at 7:59 AM, Count L?szl? de Alm?sy wrote: > Greetings, > > I'm still new to Erlang, so bear with me if this is a dumb question. > Basically, I'm being tasked to write a simple SMTP proxy for my > company for incoming mail that answers on port 25, performs some > rudimentary anti-spam checks, and then forwards the connection along > to the "real" SMTP server, which may either be running on the same > machine under a different port, or on a different host's port 25. The > idea is that this will be the application that has direct exposure to > the Internet, reject as much obvious spam mail as possible, and then > let the rest sail through for the real SMTP server to handle. It > must be > ultra scalable, supporting upwards of thousands of concurrent > connections. Is Erlang a good choice for such a task? The other > platforms I'm looking at are stackless Python and Twisted Python, but > Erlang seems like it might be a more natural choice. > > Thanks. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From garry@REDACTED Thu Oct 19 16:07:25 2006 From: garry@REDACTED (Garry Hodgson) Date: Thu, 19 Oct 2006 10:07:25 -0400 (EDT) Subject: [erlang-questions] Erlang for a SMTP server? In-Reply-To: References: Message-ID: <2006101910071161266845@k2.sage.att.com> wrote: > I'm still new to Erlang, so bear with me if this is a dumb question. > Basically, I'm being tasked to write a simple SMTP proxy ... > It must be > ultra scalable, supporting upwards of thousands of concurrent > connections. Is Erlang a good choice for such a task? erlang is an excellent choice for something like this. a word of advice: if you're looking to build a production quality service, make sure you build it on top of otp, rather than rolling your own. otp can seem a little daunting when you're first starting erlang, but it's well worth the effort if you're building serious systems. the docs are pretty good, and there are some good tutorials around now. i wish i'd gone this route when i started. would've saved me a lot of effort, and resulted in a much better system. > The other > platforms I'm looking at are stackless Python and Twisted Python, but > Erlang seems like it might be a more natural choice. if for some reason you can't use erlang, twisted is a very nice framework for building network servers. i can't speak to its scalability, though. no experience with that. ---- Garry Hodgson, Senior Software Geek, AT&T CSO But I'm not giving in an inch to fear 'Cause I promised myself this year I feel like I owe it...to someone. From serge@REDACTED Thu Oct 19 18:50:11 2006 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 19 Oct 2006 12:50:11 -0400 Subject: [erlang-questions] segfault bug Message-ID: <4537ACC3.7060709@hq.idt.net> Hi, This bug was submitted to the erlang-bugs list by one of our developers, but I wanted to copy it to this list in case it's missed. $ uname -a Linux drp01dev.corp.idt.net 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005 i686 i686 i386 GNU/Linux $ cat t.erl -module(t). -compile(export_all). test() -> [A,B,C] = [1,a,a], (A bsl 1) bor (B bsl 1) bor C. $ erl Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] Eshell V5.5 (abort with ^G) 1> c(t). {ok,t} 2> t:test(). Segmentation fault -- Serge Aleynikov Routing R&D, IDT Telecom Tel: +1 (973) 438-3436 Fax: +1 (973) 438-1464 From yarivvv@REDACTED Thu Oct 19 19:35:31 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 19 Oct 2006 13:35:31 -0400 Subject: [erlang-questions] ErlTL: A Simple Erlang Template Language In-Reply-To: References: <17244f480610171121m5aeeef22p7f5373f4b0278cfa@mail.gmail.com> Message-ID: <17244f480610191035x1fdd2e8bsa80c77b0849d2f28@mail.gmail.com> On 10/19/06, Dmitrii Dimandt wrote: > Hi. Couldn't reply on your site as reply form seems to be broken. The story of my blog. I need to restart it almost on a daily basis to make comments work. Somebody should port Typo to Erlang ;) > > I've tried compiling a UTF-8 template file. Hoorah! :) It works just fine Sweet! > > However, it wouldn't work if > <%? [What, Where, Objects, Action] = Data %> > wasn't the first line of the template. > > Even inserting a newline before that would result in the following error: > > {error,{misplaced_top_expression,{line,2}, > "<%? [What, Where, > Objects, Action] = Data %>\r > "}} > > This error appeared for both ASCII and UTF-8 files. > > I wonder if I should have reported this as a bug instead of polluting the > maillist... Thanks for reporting. I'll look into that. BR Yariv From yarivvv@REDACTED Thu Oct 19 19:52:56 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 19 Oct 2006 13:52:56 -0400 Subject: [erlang-questions] ErlTL: A Simple Erlang Template Language In-Reply-To: References: <17244f480610171121m5aeeef22p7f5373f4b0278cfa@mail.gmail.com> Message-ID: <17244f480610191052y532d4644gb92f0222bffb109c@mail.gmail.com> > However, it wouldn't work if > <%? [What, Where, Objects, Action] = Data %> > wasn't the first line of the template. > > Even inserting a newline before that would result in the following error: > > {error,{misplaced_top_expression,{line,2}, > "<%? [What, Where, > Objects, Action] = Data %>\r > "}} > > This error appeared for both ASCII and UTF-8 files. Actually, this line is supposed to appear before all other lines because it's a top level expression. Top level expressions aren't part of the function's output, so they must appear first. Adding a newline before it is tantamount to adding a binary expression to the output, which means that the top level expression doesn't precede all output expressions anymore. I could change the error to a warning, but first, can you show me a template that absolutely requires changing the existing error handling behavior? Thanks, Yariv From jces@REDACTED Fri Oct 20 00:04:41 2006 From: jces@REDACTED (jces@REDACTED) Date: Thu, 19 Oct 2006 15:04:41 -0700 Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <21f8b6e20610182231i769df6d6ua2842645cb1cc29a@mail.gmail.com> References: <20061003210624.22238.qmail@web38810.mail.mud.yahoo.com> <4533FD04.4000708@telia.com> <45353F15.5060807@telia.com> <21f8b6e20610182231i769df6d6ua2842645cb1cc29a@mail.gmail.com> Message-ID: <200610192204.k9JM4g8n002033@mail.monad.com> >fresh air. How about forking the language and redesigning it to fix >the problems? Per the JVM biosphere, another out-there possibility is to write wrappers around Erlang, allowing for new syntax and e.g. better error parsing. From james.hague@REDACTED Fri Oct 20 00:18:51 2006 From: james.hague@REDACTED (James Hague) Date: Thu, 19 Oct 2006 17:18:51 -0500 Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <21f8b6e20610182231i769df6d6ua2842645cb1cc29a@mail.gmail.com> References: <20061003210624.22238.qmail@web38810.mail.mud.yahoo.com> <4533FD04.4000708@telia.com> <45353F15.5060807@telia.com> <21f8b6e20610182231i769df6d6ua2842645cb1cc29a@mail.gmail.com> Message-ID: On 10/19/06, Michael Leonhard wrote: > > How about forking the language and redesigning it to fix the problems? There's the language and then there's the libraries. The libraries, IMO, have a lot more warts in them than the language. I've posted about some of these before, and so have other people. There's basic stuff like lists:keysearch pointlessly wrapping the result in a tuple, to the confusion between the different dictionary and tree types. These changes are time consuming but easy enough to make (assuming you don't care about compatibility). For big changes to the language, like variable scoping rules, the easiest approach is to compile "Erlang 2" source to Erlang, then use BEAM/HIPE to run it. From calmasy@REDACTED Fri Oct 20 01:29:14 2006 From: calmasy@REDACTED (=?ISO-8859-1?Q?Count_L=E1szl=F3_de_Alm=E1sy?=) Date: Thu, 19 Oct 2006 17:29:14 -0600 Subject: [erlang-questions] Erlang for a SMTP server? In-Reply-To: <2006101910071161266845@k2.sage.att.com> References: <2006101910071161266845@k2.sage.att.com> Message-ID: Thanks to everyone for all the feedback and advice, it's been *extremely* helpful. One thing I've not been able to find is an Erlang implementation of an SMTP server, whether real or just a prototype. Does anyone have such a thing? I thought it would be useful to use as a reference and to help get me started quicker. From jay@REDACTED Fri Oct 20 02:16:33 2006 From: jay@REDACTED (Jay Nelson) Date: Thu, 19 Oct 2006 17:16:33 -0700 Subject: [erlang-questions] Erlang for a SMTP Server? Message-ID: <45381561.7040708@duomark.com> While erlang seems the perfect language and I always enjoy implementing alternative solutions to problems that have previously been solved, if you are under the gun to produce something for your job you might want to look at OpenBSD. There is a spamd (spam daemon) that comes with the installation. Setup your firewall to relay packets to your SMTP server, but use the spamd to block spam. It uses whitelisting and greylisting, forces everyone to try twice before they get into the whitelist and stutters very slowly at spammers. It's been around for a while, it works and it takes very little load on a machine. At the same time you will be able to take full control of firewalling and logging all packets that come through your external machine. jay From chris.double@REDACTED Fri Oct 20 03:17:09 2006 From: chris.double@REDACTED (Chris Double) Date: Fri, 20 Oct 2006 14:17:09 +1300 Subject: [erlang-questions] Erlang for a SMTP server? In-Reply-To: References: <2006101910071161266845@k2.sage.att.com> Message-ID: > One thing I've not been able to find is an Erlang implementation of an > SMTP server, whether real or just a prototype. Does anyone have such > a thing? I thought it would be useful to use as a reference and to > help get me started quicker. This blog talks about an SMTP server being developed in Erlang: http://www.spamfreeemail.com/blogs/SMTP/ Chris. -- http://www.bluishcoder.co.nz From patrickerj@REDACTED Fri Oct 20 05:55:40 2006 From: patrickerj@REDACTED (Pat e) Date: Fri, 20 Oct 2006 05:55:40 +0200 Subject: [erlang-questions] MySQL cluster Message-ID: We are prepairing rather big web project that will end up with tens of TB of data. Now, is it any worth to juice out Mnesia or just go with MySQL Cluster? If we would use Mnesia we would use PAX storage model vs. N-array storage model. Ulf... what do you think? From Martin.Logan@REDACTED Fri Oct 20 06:57:40 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Thu, 19 Oct 2006 23:57:40 -0500 Subject: [erlang-questions] New tutorial - Building an OTP Application Message-ID: <26AB42AB6A76E2419D26E66ECF1538462CF6CE@chiresexc02.resource.corp.lcl> I have just added a new tutorial to the trap-exit HowTo section entitled "Building an OTP Application". This tutorial walks the reader through the entire process of building a well formed OTP application and release. This should be especially helpful to beginners in aiding them to understand OTP and best practices. Comments and questions are welcome. http://wiki.trapexit.org/index.php/Building_An_OTP_Application -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitriid@REDACTED Fri Oct 20 08:29:07 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Fri, 20 Oct 2006 09:29:07 +0300 Subject: [erlang-questions] ErlTL: A Simple Erlang Template Language In-Reply-To: <17244f480610191052y532d4644gb92f0222bffb109c@mail.gmail.com> References: <17244f480610171121m5aeeef22p7f5373f4b0278cfa@mail.gmail.com> <17244f480610191052y532d4644gb92f0222bffb109c@mail.gmail.com> Message-ID: On 10/19/06, Yariv Sadan wrote: > > > However, it wouldn't work if > > <%? [What, Where, Objects, Action] = Data %> > > wasn't the first line of the template. > > > > Even inserting a newline before that would result in the following > error: > > > > > {error,{misplaced_top_expression,{line,2}, > > "<%? [What, Where, > > Objects, Action] = Data %>\r > > "}} > > > > This error appeared for both ASCII and UTF-8 files. > > Actually, this line is supposed to appear before all other lines > because it's a top level expression. Top level expressions aren't part > of the function's output, so they must appear first. Adding a newline > before it is tantamount to adding a binary expression to the output, > which means that the top level expression doesn't precede all output > expressions anymore. Oh, ok. I see that. Quite logical, actually :) However, this error also appears if I insert a comment line there (as per example in your blog) I could change the error to a warning, but first, > can you show me a template that absolutely requires changing the > existing error handling behavior? No, it's ok now that I understand it :) Thanks, > Yariv > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Fri Oct 20 08:35:42 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Fri, 20 Oct 2006 08:35:42 +0200 Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: References: <20061003210624.22238.qmail@web38810.mail.mud.yahoo.com> <4533FD04.4000708@telia.com> <45353F15.5060807@telia.com> <21f8b6e20610182231i769df6d6ua2842645cb1cc29a@mail.gmail.com> Message-ID: <45386E3E.3040300@ericsson.com> On 2006-10-20 00:18, James Hague wrote: > There's the language and then there's the libraries. The libraries, > IMO, have a lot more warts in them than the language. I've posted > about some of these before, and so have other people. There's basic > stuff like lists:keysearch pointlessly wrapping the result in a tuple, > to the confusion between the different dictionary and tree types. > These changes are time consuming but easy enough to make (assuming you > don't care about compatibility). the compatibility problem could be handled if richard carlsons ''new standard libraries'' suggestion (using nested modules) was adopted. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From jahakala@REDACTED Fri Oct 20 08:49:32 2006 From: jahakala@REDACTED (Jani Hakala) Date: Fri, 20 Oct 2006 09:49:32 +0300 Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: (James Hague's message of "Thu\, 19 Oct 2006 17\:18\:51 -0500") References: <20061003210624.22238.qmail@web38810.mail.mud.yahoo.com> <4533FD04.4000708@telia.com> <45353F15.5060807@telia.com> <21f8b6e20610182231i769df6d6ua2842645cb1cc29a@mail.gmail.com> Message-ID: <871wp3lbwj.fsf@pingviini.kortex.jyu.fi> "James Hague" writes: > On 10/19/06, Michael Leonhard wrote: >> >> How about forking the language and redesigning it to fix the problems? > > There's the language and then there's the libraries. The libraries, > IMO, have a lot more warts in them than the language. I've posted > about some of these before, and so have other people. There's basic > stuff like lists:keysearch pointlessly wrapping the result in a > tuple, > Is it pointless? At least it's easy to do something like {value, Tuple} = lists:keysearch(Key, N, TupleList) in one line if the alternative result (false) means that something is really wrong in the code or input data. Jani Hakala From yerl@REDACTED Fri Oct 20 09:59:43 2006 From: yerl@REDACTED (yerl@REDACTED) Date: Fri, 20 Oct 2006 09:59:43 +0200 Subject: [erlang-questions] New tutorial - Building an OTP Application Message-ID: An HTML attachment was scrubbed... URL: From ulf.wiger@REDACTED Fri Oct 20 14:28:26 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Fri, 20 Oct 2006 14:28:26 +0200 Subject: [erlang-questions] MySQL cluster In-Reply-To: Message-ID: I don't think I'd attempt something like that in mnesia without first doing a lot of experimentation. While mnesia clusters should scale fairly well towards some 50 or so nodes (perhaps more), with no more than a few Gb of RAM capacity on each node, you won't get up to tens of TB. Still, it's the disk storage, and backup/restore that would worry me most. My general assumption is that if you haven't carefully designed your dbms to work well with that kind of data volume, most likely it won't work. Which DBMS is the best for terabyte data storage, I can't say. You have a number of SQL DBMS:s to choose from. BR, Ulf W -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Pat e Sent: den 20 oktober 2006 05:56 To: erlang-questions@REDACTED Subject: [erlang-questions] MySQL cluster We are prepairing rather big web project that will end up with tens of TB of data. Now, is it any worth to juice out Mnesia or just go with MySQL Cluster? If we would use Mnesia we would use PAX storage model vs. N-array storage model. Ulf... what do you think? _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From dmitriid@REDACTED Fri Oct 20 14:40:51 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Fri, 20 Oct 2006 15:40:51 +0300 Subject: [erlang-questions] MySQL cluster In-Reply-To: References: Message-ID: What's the optimum maximum size for Mnesia then? A bout a couple of gigabytes? Or more? On 10/20/06, Ulf Wiger (TN/EAB) wrote: > > > I don't think I'd attempt something like that in mnesia without first > doing a lot of experimentation. While mnesia clusters should scale > fairly well towards some 50 or so nodes (perhaps more), with no more > than a few Gb of RAM capacity on each node, you won't get up to tens of > TB. Still, it's the disk storage, and backup/restore that would worry me > most. > > My general assumption is that if you haven't carefully designed your > dbms to work well with that kind of data volume, most likely it won't > work. > > Which DBMS is the best for terabyte data storage, I can't say. You have > a number of SQL DBMS:s to choose from. > > BR, > Ulf W > > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Pat e > Sent: den 20 oktober 2006 05:56 > To: erlang-questions@REDACTED > Subject: [erlang-questions] MySQL cluster > > We are prepairing rather big web project that will end up with tens of > TB of data. > > Now, is it any worth to juice out Mnesia or just go with MySQL Cluster? > > If we would use Mnesia we would use > PAX storage model vs. N-array storage > model. > > Ulf... what do you think? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.wiger@REDACTED Fri Oct 20 14:42:48 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Fri, 20 Oct 2006 14:42:48 +0200 Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <45353F15.5060807@telia.com> Message-ID: Of course, the changes you speak of were made in order to address real shortcomings in the original solution (even though it may have been regular and elegant). One major problem with link was that it was two-way (and therefore didn't work well as a monitor), and had process-global scope (i.e. you couldn't safely do link-request-await_reply-unlink, since some other function (or the other process) might call unlink and quietly remove the link.) The symmetry of exit messages probably would have worked if erlang had really been a pure message passing environment, perhaps more in line with Morrison's flow-based programming, but given that it leaned quite heavily towards sequential programming as well, regular exceptions with stack traces were really necessary. BR, Ulf W -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Robert Virding Sent: den 17 oktober 2006 22:38 Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) Forgot to add another major fault: + The difference between exits and errors (previously called faults) is definitely bogus and a big mistake to boot. Originally there was no noticeable difference between exits and errors, doing '1+a' and exit(badarg) would give you the same thing at all levels. THIS WAS INTENTIONAL! For the same reason doing exit/2 had exactly the same effect on the other processas exiting the current process. If you read Joe's thesis you uses exit like this. Then someone added stacktraces to errors. This was good thing of course, but now exits and errors were different. Unfortunately instead of fixing exit/1 this difference was cemented by adding erlang:error (before that erlang:fault) and separating both in try. So instead of one uniform mechanism now there are similar but different and incompatible ones. This is a similar problem as with links and process monitoring. Robert P.S. I still don't understand how someone could break link/1. The fix to unlink is ok. Robert Virding wrote: > Thomas Lindgren wrote: > >>--- Robert Virding wrote: >> >> >> >>>I believe it is important to keep things clean, >>>consistent and elegant >>>otherwise you will end up with a language built on >>>exceptions. >> >> >>So what is your opinion on Erlang of today? (half :-) >> >>Best, >>Thomas > > > I have been debating with myself whether to answer this but in the end I > gave in and decided that I would. > > Omn the whole I think we got things right but there are some things > which are wrong. Some are new, some are old and some are even my fault. > :-) So here is a collection of comments, major and minor (major marked > with +): > > - The naming and argument orders of the standard libraries is > inconsistent. While this can seem trivial it does break the principle of > least astonishment and therefore causes unnecessary problems. > > - The syntax could have been cleaned up a bit. No, I don't see any > problems with having ';' as separator not a terminator. Being able to > write "foo(X) -> X;." sucks. > > + Should have had proper variable scoping, what is right for Prolog is > not best for Erlang. I would also have all variables in patterns as > fresh variables and have explicit tests for equality with already bound > variables. > > + The concept of what a BIF (Built In function) is is a mess. Now it > seems to mean something written in C. That is something we addressed in > the standard and got right. A BIF is a function which is part of the > langauge but without special syntax. So spawn and link are just as much > Erlang as ! and receive but they look like functions. BIFs have the same > dignity as the emulator, both ARE the language. > > What language a BIF is written in is irrelevant. > > Most BIFs can be called through the module erlang so having the module > erlang as part of OTP just does not make sense. > > - Some of the BIF names are too long, tget and tset would have been better. > > - A suggestion in the standard was to have BIFsin different modules not > just erlang, for example atom, tuple, number, proc, ... This would have > been much better and could have been added with a minimum of trouble. > > + There is no layering in the standard libraries, all is part of OTP. > This make is difficult to build small, stand-alone application. In > essence you tend to get what OO was accused of: you want the banana but > get the whole gorilla as well. Yes, you can make a tool which extracts > what you want but that is a work-around not a fix. > > Many of the libraries are so fundamental that having them managed by OTP > does not really make sense, they are below that necessary for it. > > Joe and I discussed this alot and we agreed on the principle but not on > all the details. I would like to see something like: > > ____________________________________________________________________ > > erlang emulator + BIFs (see above) > ____________________________________________________________________ > > basic libraries - lists, file, io etc. (maybe layered as well) > ____________________________________________________________________ > | > OTP | included applications - compiler, etc | > _________________________________________________ > > user apps, OTP based or otherwise > ____________________________________________________________________ > > The system is useable without OTP and applications can choose at what > level they need the libraries. I hope the diagram is understandable. > > - Binaries are nice but I don't really like the bit syntax, although I > haven't really sat down and come up with a better alternative. > > - Records as they stand are not beautiful. However, it is important to > remember that when they were introduced it was an absolute requirement > that they would be as fast as using tuples directly. Even this > implementation was suspect. I kid you not. > > - Structs or dictionaries as suggested by Richard O'K would be a BIG WIN. > > + All forms of communication between processes should be asynchronous. > Messages signals, links, ALL of them. You send them off and depending on > what you do you may get an exit signal back. Originally the only thing > which broke this principle was sending to a local registered process, > now, however, more things break it. Link for example. > > Why worry you may ask. Well, everything which is asynchronous will > automatically scale to distributed systems, synchronous calls don't! > This may also affect multi-core implementations which are going to be > very important. > > + Originally there were two basically different types of objects in > Erlang: static terms and things with dynamic state, processes. > > A process is something which has process semantics, you communicate > through messages, can link to it and exchange exit signals. N.B. how a > process is implemented is irrelevant it is the external semantics which > define a process. > > Unfortunately there two (at least) things in erlangwhich don't conform > to this principle, ETS tables and ports. They're coming next. > > + ETS tables are neither and this causes problems. ETS was conceived to > solve two main problems: fast, near constant access to large tables; and > to get around the garbage collection problem in the erlang > implementation. If you have a LARGE process then it is noticeable when > the emulator stops during a collection. This problem still exists today. > > The solution to the second problem was to keep ETS tables in a > completely separate area and copy data to/from processes. Unfortunately > this implementation detail, which it is, affected the interface and > instead of solving the real problem, i.e. the copying, work-arounds were > added to minimise this, match_XXXX, select_XXXX, ms_transforms. No one > can claim that match patterns and matchspecs are beautiful or fit in > with the rest of erlang. These are just work-arounds to minimise copying > and would be unnecessary if the implementations was fixed. Then you > could use a proper pattern to select and all you would need is fold. > > Getting back ETS tables are neither static data or processes and break > the principle. > > + Ports are funny. Originally when they were conceived they had only > process semantics, in fact we actually debated whether to have a > separate data type at all. They were modelled on UNIX streams, the idea > being that you could insert various filters along the way without the > users noticing. This is no problem with processes. > > However, the the various port_XXXX commands were added and now ports are > different. Ironically, the manual calls the process interface illogical > because it is different from the function interface. > > - if should really have been what cond is today. Is cond today? > > - The abstract form of the erlang syntax should have been in a form > which could be described by records. > > - and/or and andalso/orelse are different semantically and having both > is a win, although some people don't think so. > > - catch should not have been an operator but instead catch ... end. > > - Erlang does not need currying. > > - Erlang was originally designed to follow the KISS principle. > > + Perhaps we should have defined the message interface more often > instead of wrapping everything in an access function? You can do more > with the interface. > > + You need both link and monitor_process, it would have been better to > have a more basic primitive on which both are built. Easier to under > stand the interactions. > > Having everything consistent makes it easier to understand and lessens > the risk of strange interactions. If everything is a process and obeys > the (asynchronous) process semantics then it easier to understand the > interactions. They will all be explicit in the code (even the mistakes > :-)) and not so dependant on which order you do things because sometimes > you get a fault and sometimes a signal so if they are in the wrong order > then somethings won't get done. > > Special cases just cause problems in the long run. > > That's about it for the first go. I will willingly debate any of my > comments on the erlang, but don't expect me to change my mind. Being, as > I am, right. > > Robert > > "I'm not arrogant, I'm right!" > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From rickard.s.green@REDACTED Fri Oct 20 15:13:26 2006 From: rickard.s.green@REDACTED (Rickard Green) Date: Fri, 20 Oct 2006 15:13:26 +0200 Subject: [erlang-questions] Thread-safety of driver_alloc/realloc/free_binary In-Reply-To: <781dd98c0610172112j7f28bb49xab82b589d9ea98ec@mail.gmail.com> References: <781dd98c0610172112j7f28bb49xab82b589d9ea98ec@mail.gmail.com> Message-ID: <4538CB76.4070803@ericsson.com> They are all thread safe in the emulator with smp support, but they will probably never be thread safe in the emulator without smp support. The thread unsafe part is the reference counting of binaries. Making them thread safe would cause overhead for all reference counted binaries, not just driver binaries. We don't want to slow down all binary management as it is now, but we might make them thread safe in the future if threaded drivers should become very common (but don't count on it). BR, Rickard Green, Erlang/OTP Chris Newcombe wrote: > (To the maintainers of erts/emulator/beam/io.c ... ) > > Hi, > > I'm working on an update to Scott Lystig Fritchie's Erlang Driver > Toolkit, including a significantly enhanced driver for Berkeley DB. I > hope to be able to release this soon as open-source. > > The update includes features such as multiple private resizable > threadpools per port instance (supported in both 'linked-in' and > 'spawned-pipe' modes). > > One problem is that, when getting data from Berkeley DB, the driver > needs to allocate driver binaries. Ideally, it would like to to do so > from within the driver's private threadpools. But of course, > driver_alloc/realloc/free_binary are not documented as thread-safe. > > So currently the Berkeley DB driver has to allocate each piece of data > twice (once with malloc and later with driver_alloc_binary), and copy > it once. And the copying is done in the Erlang scheduler thread, > which blocks the VM unecessarily. > > This appears to be changing. I found the following comments in > otp_src_R11B-1/erts/emulator/beam/io.c > > * - driver_alloc_binary() is thread safe (efile driver depend on it). > * - driver_realloc_binary(), and driver_free_binary() are *not* thread safe. > > Unfortunately, to avoid the copying the Berkeley DB driver needs to > call all 3 of these functions from private threads. > > So, please could the realloc & free functions also be made > thread-safe, and documented as such? This would be a major > performance benefit for many multi-threaded drivers (not just the > efile driver mentioned in the comment), > > Many thanks for considering this, > > Chris > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From chsu79@REDACTED Fri Oct 20 15:49:47 2006 From: chsu79@REDACTED (Christian S) Date: Fri, 20 Oct 2006 15:49:47 +0200 Subject: [erlang-questions] MySQL cluster In-Reply-To: References: Message-ID: On 10/20/06, Dmitrii Dimandt wrote: > What's the optimum maximum size for Mnesia then? A bout a couple of > gigabytes? Or more? What should such a number for maximum size try to optimize? A note about picking database after storage size needs: Using mnesia instead of an external database always have advantages in terms of "impedance matching" (Mnesia has erlang's datatypes by virtue of being erlang and you can query mnesia faster than anything connected to through tcp). This often makes it worthwile to hack around mnesia to store some data outside of it. One would easily reach a storage size of 1Tb for a site like flickr. Does that mean mnesia wouldnt be sufficient for building such a site? Or perhaps it could be a good idea to build an application that replicates images across nodes outside of mnesia, and have mnesia store small image ids to reference them. From rickard.s.green@REDACTED Fri Oct 20 15:41:04 2006 From: rickard.s.green@REDACTED (Rickard Green) Date: Fri, 20 Oct 2006 15:41:04 +0200 Subject: [erlang-questions] Solaris 10 equiv to kqueue or epoll? In-Reply-To: <35A027CA-5CD9-4E70-A173-32645D343902@redstarling.com> References: <2EF68AC7-ABB2-409C-A285-EDA664235F11@redstarling.com> <81d74c280610080011r54725d22rc3f74148a670f1e@mail.gmail.com> <35A027CA-5CD9-4E70-A173-32645D343902@redstarling.com> Message-ID: <4538D1F0.5080600@ericsson.com> The emulator does not use solaris event ports, but we plan to implement the kernel poll feature using them some time in the future (but I don't know when). I don't think the non-smp emulator will benefit from event ports compared to /dev/poll, but the smp emulator might. In order to be able to use /dev/poll you have to pass the --enable-kernel-poll command line argument to configure when building OTP. You also have to pass the command line argument +Ktrue to erl when starting the emulator. BR, Rickard Green, Erlang/OTP ke han wrote: > Interesting...thanks for pointing this out...Windows has its own > proprietary API for this sort of thing. > I built a java solution around this 6 years ago. We were able to > handle 50,000 active sockets on a single cpu 800 Mhz Windows 2000 > Server (only 2GB RAM) with no degradation which beat the pants off > the top end $250,000 Sun solution that could only handle 5,000 > connections. > The value of optimizing socket events should not to be underestimated. > ke han > > > On Oct 8, 2006, at 3:11 PM, Steve Jenson wrote: > >> Solaris 10 has Event Ports but I don't think Erlang uses them. >> >> http://developers.sun.com/solaris/articles/event_completion.html >> >> On a side note, it would be interested to see if erlang could be >> ported to use libevent so that when event ports are added to libevent, >> they would automatically picked up with just a recompile on erlang. >> >> Steve >> >> On 10/4/06, ke han wrote: >>> I am looking at using Solaris 10 on Sun's Opteron server for erlang. >>> My app will eventually need to handle large number of sockets. On >>> FreeBSD, I can leverage the built in kqueue support. >>> How does erlang (R10 or R11) on Solaris 10 handle large socket >>> groups? >>> thanks, ke han >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://www.erlang.org/mailman/listinfo/erlang-questions >>> >>> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From calmasy@REDACTED Fri Oct 20 16:31:27 2006 From: calmasy@REDACTED (=?ISO-8859-1?Q?Count_L=E1szl=F3_de_Alm=E1sy?=) Date: Fri, 20 Oct 2006 08:31:27 -0600 Subject: [erlang-questions] Erlang for a SMTP server? In-Reply-To: References: <2006101910071161266845@k2.sage.att.com> Message-ID: On 10/19/06, Chris Double wrote: > > One thing I've not been able to find is an Erlang implementation of an > > SMTP server, whether real or just a prototype. Does anyone have such > > a thing? I thought it would be useful to use as a reference and to > > help get me started quicker. > > This blog talks about an SMTP server being developed in Erlang: > > http://www.spamfreeemail.com/blogs/SMTP/ No code available, though. From wilbjor@REDACTED Fri Oct 20 17:10:14 2006 From: wilbjor@REDACTED (Jordan Wilberding) Date: Fri, 20 Oct 2006 10:10:14 -0500 Subject: [erlang-questions] More SSL problems In-Reply-To: References: Message-ID: <4538E6D6.9000507@iit.edu> It seems like whenever I ask a question about SSL I never get a straight answer. Should SSL be completely working with Erlang/OTP? I have had problems getting ssl_dist to work, but even more oddly I seem to randomly get the following error: [erlang@REDACTED test]$ erl -name test Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] Eshell V5.5 (abort with ^G) (test@REDACTED)1> ssl:start(). =INFO REPORT==== 20-Oct-2006::11:04:58 === application: ssl exited: {shutdown,{ssl_app,start,[normal,[]]}} type: temporary {error,{shutdown,{ssl_app,start,[normal,[]]}}} It doesn't happen either, it just seems to come and go. Is SSL just flaky? Thanks! Jordan Wilberding From ingela@REDACTED Fri Oct 20 17:17:59 2006 From: ingela@REDACTED (Ingela Anderton) Date: Fri, 20 Oct 2006 17:17:59 +0200 Subject: [erlang-questions] odbc:sql_query/2 problem References: Message-ID: <17720.59559.18773.68272@gargle.gargle.HOWL> > I'm using erlang 5.4.3 > Using ODBC, I'm using Store Procedure (SP) which first updates and then > selects contents in a table. > The function odbc:sql_query/2 is returning {error,"No SQL driver information > avaiable" }. > ( The same SP is perfectly working in MS SQL query analyser) > If Ichange the order of operation of SP such that it first select the and > then update the contents, the function odbc:sql_query/2 is working > perfectly. > Is it a bug in erlang? A bug perhaps, in erlang no. It could be a bug in the erlang odbc port program. My guess would be that the order of the operations in the stored procedure effects the return value from the odbc c-API function SQLExecDirect, and in the case where an error is returned the SQLExecDirect function returns some sort of "special case success" that is not handled by the odbc port program. This is my guess. If you would be able to write a small c-program to find out what is returned for your stored procedure maybe we could find out if I am right. That is the best I can do from the information provide. -- Ingela Ericsson AB - OTP team From Martin.Logan@REDACTED Fri Oct 20 18:15:42 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Fri, 20 Oct 2006 11:15:42 -0500 Subject: [erlang-questions] Erlang for a SMTP server? In-Reply-To: <2006101910071161266845@k2.sage.att.com> Message-ID: <26AB42AB6A76E2419D26E66ECF1538462CF6D5@chiresexc02.resource.corp.lcl> erlang is an excellent choice for something like this. a word of advice: if you're looking to build a production quality service, make sure you build it on top of otp, rather than rolling your own. otp can seem a little daunting when you're first starting erlang, but it's well worth the effort if you're building serious systems. the docs are pretty good, and there are some good tutorials around now. ------------- OTP is the right way to go and I agree it can be daunting, but not so daunting I hope when you have a standard build system and a good tutorial that walks you right through the process. http://www.erlware.org http://wiki.trapexit.org/index.php/Building_An_OTP_Application Cheers, Martin From rsaccon@REDACTED Fri Oct 20 19:18:48 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Fri, 20 Oct 2006 15:18:48 -0200 Subject: [erlang-questions] MySQL cluster In-Reply-To: References: Message-ID: I had the same question and I am currently investigating in using mnesia just as cache for a clustered web application running on amazon EC2 and the real storage is on amazon S3 (which is kind of Berkley DB webservice) and capable to store any number of TBs ... On 10/20/06, Christian S wrote: > On 10/20/06, Dmitrii Dimandt wrote: > > What's the optimum maximum size for Mnesia then? A bout a couple of > > gigabytes? Or more? > > What should such a number for maximum size try to optimize? > > A note about picking database after storage size needs: > > Using mnesia instead of an external database always have advantages in > terms of "impedance matching" (Mnesia has erlang's datatypes by virtue > of being erlang and you can query mnesia faster than anything > connected to through tcp). This often makes it worthwile to hack > around mnesia to store some data outside of it. > > One would easily reach a storage size of 1Tb for a site like flickr. > Does that mean mnesia wouldnt be sufficient for building such a site? > Or perhaps it could be a good idea to build an application that > replicates images across nodes outside of mnesia, and have mnesia > store small image ids to reference them. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- Roberto Saccon From yarivvv@REDACTED Fri Oct 20 19:50:43 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Fri, 20 Oct 2006 13:50:43 -0400 Subject: [erlang-questions] MySQL cluster In-Reply-To: References: Message-ID: <17244f480610201050l24f98ab5l606a30ba54d59d9b@mail.gmail.com> Sounds like a fascinating combination! Please let us know what you find. Cheers, Yariv On 10/20/06, Roberto Saccon wrote: > I had the same question and I am currently investigating in using > mnesia just as cache for a clustered web application running on amazon > EC2 and the real storage is on amazon S3 (which is kind of Berkley DB > webservice) and capable to store any number of TBs ... > > On 10/20/06, Christian S wrote: > > On 10/20/06, Dmitrii Dimandt wrote: > > > What's the optimum maximum size for Mnesia then? A bout a couple of > > > gigabytes? Or more? > > > > What should such a number for maximum size try to optimize? > > > > A note about picking database after storage size needs: > > > > Using mnesia instead of an external database always have advantages in > > terms of "impedance matching" (Mnesia has erlang's datatypes by virtue > > of being erlang and you can query mnesia faster than anything > > connected to through tcp). This often makes it worthwile to hack > > around mnesia to store some data outside of it. > > > > One would easily reach a storage size of 1Tb for a site like flickr. > > Does that mean mnesia wouldnt be sufficient for building such a site? > > Or perhaps it could be a good idea to build an application that > > replicates images across nodes outside of mnesia, and have mnesia > > store small image ids to reference them. > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > -- > Roberto Saccon > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From rich@REDACTED Fri Oct 20 20:04:14 2006 From: rich@REDACTED (Richard Kilmer) Date: Fri, 20 Oct 2006 14:04:14 -0400 Subject: [erlang-questions] Simple web server example on trapexit source... Message-ID: <846B6C86-3B6A-4BAB-AD5D-50202689B0E5@infoether.com> The following example on trapexit: http://wiki.trapexit.org/index.php/ A_fast_web_server_demonstrating_some_undocumented_Erlang_features Has the code listed in the wiki page, but not a reference to download the source. I can cut and paste it, but I just want to ensure that I am placing the right snippets in the right files. Could the author of this (Sean?) please post a location for the source files? Thanks...and thanks Sean for a great example :-) Best, Rich Kilmer From kenneth.lundin@REDACTED Fri Oct 20 22:40:28 2006 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 20 Oct 2006 22:40:28 +0200 Subject: [erlang-questions] More SSL problems In-Reply-To: <4538E6D6.9000507@iit.edu> References: <4538E6D6.9000507@iit.edu> Message-ID: As far as I know SSL works well, it is used in products in combination with the http server in the inets application. I also think that the very same ssl application is used with good result together with the YAWS web-server. I should remark that inet_ssl_dist i.e running the Erlang distribution over SSL is not used much and not in any products that I am aware of. As I recall it inet_ssl_dist was mostly written as an example to illustrate that the Erlang distribution can be carried over other protocols than TCP. To my knowledge the distribution over SSL works on the platforms we test. If you get the problem below "randomly" with the same build and installation of Erlang I think it is strange. I anyway suspect that the problem has with the shared library openssl probably that it can't be found or has wrong version. The openssl library is something that you must provide yourself in your installation it is not part of the Erlang distribution. If you run the same case as you show below under "truss" you will be able to find out. Regards Kenneth On 10/20/06, Jordan Wilberding wrote: > It seems like whenever I ask a question about SSL I never get a straight > answer. Should SSL be completely working with Erlang/OTP? > > I have had problems getting ssl_dist to work, but even more oddly I seem > to randomly get the following error: > > [erlang@REDACTED test]$ erl -name test > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] > > Eshell V5.5 (abort with ^G) > (test@REDACTED)1> ssl:start(). > > =INFO REPORT==== 20-Oct-2006::11:04:58 === > application: ssl > exited: {shutdown,{ssl_app,start,[normal,[]]}} > type: temporary > {error,{shutdown,{ssl_app,start,[normal,[]]}}} > > It doesn't happen either, it just seems to come and go. Is SSL just flaky? > > Thanks! > Jordan Wilberding > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From kenneth.lundin@REDACTED Fri Oct 20 23:12:03 2006 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 20 Oct 2006 23:12:03 +0200 Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <21f8b6e20610182231i769df6d6ua2842645cb1cc29a@mail.gmail.com> References: <20061003210624.22238.qmail@web38810.mail.mud.yahoo.com> <4533FD04.4000708@telia.com> <45353F15.5060807@telia.com> <21f8b6e20610182231i769df6d6ua2842645cb1cc29a@mail.gmail.com> Message-ID: I would like to comment this: Erlang as a language has flaws, but I think that is the case with most languages. I don't agree that this is the major problem that stops Erlang from beeing more successful. I also think that one of the major strenghts with Erlang is the backward compatibility both on the language level, the libraries and on the .beam format level. This is beneficial for most users not only Ericsson. I am not strongly against an evolution of the language or to design a new language which keeps all the strengths of Erlang of today and removes the flaws. I don't know how that language should look like to become a great success perhaps it should have a syntax very similar with java or javascript or some other well known language (similar on the token and operator syntax level I mean) But I still think it is best to continue the slow path with an evolution or the current language, keeping backward compatibility as much as possible. There are other things which are more important than to drastically change the language. Improvements in the Erlang VM, Standalone Erlang, A good GUI binding, SMP support, ... /Kenneth (Responsible for the Erlang team at Ericsson) On 10/19/06, Michael Leonhard wrote: > I discovered Erlang only 2 years ago, but can appreciate most of the > points Robert expressed. Erlang is a great language that can evolve > to become greater. It seems as though everyone acknowledges the > shortcomings of the current Erlang, but no one can improve it because > of the need for backwards compatibility. Erlang is already breaking > out into the mainstream development community. Now Ericsson's > mountains of Erlang code seem like a dead weight attached to Erlang's > neck, preventing it from bursting through the surface of the ocean of > obscurity. Erlang needs to reach the surface and get a breath of > fresh air. How about forking the language and redesigning it to fix > the problems? > > -Michael > > Michael Leonhard > michael206@REDACTED > http://tamale.net/ > > On 10/17/06, Robert Virding wrote: > > > > Omn the whole I think we got things right but there are some things > > > which are wrong. Some are new, some are old and some are even my fault. > > > :-) So here is a collection of comments, major and minor (major marked > > > with +): > > > > Joe and I discussed this alot and we agreed on the principle but not on > > > all the details. I would like to see something like: > > > > Having everything consistent makes it easier to understand and lessens > > > the risk of strange interactions. If everything is a process and obeys > > > > That's about it for the first go. I will willingly debate any of my > > > comments on the erlang, but don't expect me to change my mind. Being, as > > > I am, right. > > > > > > Robert > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From fritchie@REDACTED Sat Oct 21 04:31:48 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Fri, 20 Oct 2006 21:31:48 -0500 Subject: [erlang-questions] MySQL cluster In-Reply-To: Message of "Fri, 20 Oct 2006 15:18:48 -0200." Message-ID: <200610210231.k9L2Vm8q039283@snookles.snookles.com> >> On 10/20/06, Dmitrii Dimandt wrote: > What's >> the optimum maximum size for Mnesia then? A bout a couple of > >> gigabytes? Or more? >>>>> "rs" == Roberto Saccon writes: rs> I had the same question and I am currently investigating in using rs> mnesia just as cache for a clustered web application running on rs> amazon EC2 and the real storage is on amazon S3 [...] These sizing questions are popping up on a regular basis now, getting to be FAQ frequency. Speaking of which, the Erlang FAQ at http://www.erlang.org/faq/x1409.html is quite useful. Especially if you keep in mind how Mneisa stores ram_copies, disc_copies, and disc_only_copies tables. The first two use RAM data structures. They're limited by virtual RAM availability, though (for practical performance reasons) they're really limited by physical RAM availability. For the last few months I've been using Mnesia + disc_copies for with 8-12GB total table sizes on a 16GB RAM Linux box. The OS has an annoying tendency to start paging out some of pages waaaaay too early (there's 4-8 GB RAM left, why start reclaiming my pages, grrrr). IIRC, Ulf Wiger has reported putting about 15GB of data into Mnesia disc_copies tables. The last method, disc_only_copies, uses a disk-based structure. Its limitations and work-arounds are: limitation workaround ---------- ---------- 2GB file size per table Use Mnesia fragmentation to split large tables into < 2GB fragments Long startup time when tables None, though "long" is a relative are not closed "nicely". word, so the startup cost to re-scan the hash table structures on disk may not be too long. Terabytes of disc_only_copies data is probably not practical, but I've never measured it, so I don't know. :-) Finding 16GB RAM machines isn't nearly so difficult these days. If you need fast access to data, Mnesia is quite fast. For a 7GB Mnesia data set, I have a complex query that's 9x faster than the (properly indexed and tuned) SQL equivalent for MySQL 5.iforget (InnoDB tables) and 20x faster than PostgreSQL 7.something?.(*) For high availability purposes, naturally, you need 2x machines (or more) with "enough" RAM. The original poster (?) was asking about comparison with MySQL Cluster? If so, IIRC that product is also a main memory database, so you'll have the similar "You want me to buy WHAT?" problems with your boss. :-) I don't have any measurements on the relative memory efficiency/compactness of the same data in Mnesia vs. MySQL cluster. -Scott (*) No I haven't tried MySQL Cluster or TimesTen, but I'm hoping for some free time to try it out. From calmasy@REDACTED Sat Oct 21 07:06:51 2006 From: calmasy@REDACTED (=?ISO-8859-1?Q?Count_L=E1szl=F3_de_Alm=E1sy?=) Date: Fri, 20 Oct 2006 23:06:51 -0600 Subject: [erlang-questions] hipe on freebsd/x86 Message-ID: I've noticed that on my FreeBSD 5.4/x86 machine that hipe is not built by default. I have to add '--enable-hipe' (an undocumented option) to ./configure, and then it gets compiled in. Is this the right behavior? Shouldn't hipe just be picked up automatically on platforms like FreeBSD that support it? BTW, can anyone point me to a comprehensive list of OS/platform combos that hipe is available on? I've not been able to find this, and am just using trial and error. So far it seems to work on Linux (x86 and amd64) and freebsd/x86, but NOT on openbsd/x86 or solaris/x86. Thanks. From mikpe@REDACTED Sat Oct 21 11:56:30 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Sat, 21 Oct 2006 11:56:30 +0200 (MEST) Subject: [erlang-questions] hipe on freebsd/x86 Message-ID: <200610210956.k9L9uU5q015164@harpo.it.uu.se> On Fri, 20 Oct 2006 23:06:51 -0600, wrote: >I've noticed that on my FreeBSD 5.4/x86 machine that hipe is not built >by default. I have to add '--enable-hipe' (an undocumented option) to >./configure, and then it gets compiled in. Is this the right >behavior? Shouldn't hipe just be picked up automatically on platforms >like FreeBSD that support it? HiPE is autoenabled on supported platforms. However, "supported" does not mean "seems to maybe work on", it means that we regularly test on those platforms and will fix problems if/when they occur. >BTW, can anyone point me to a comprehensive list of OS/platform combos >that hipe is available on? I've not been able to find this, and am >just using trial and error. So far it seems to work on Linux (x86 and >amd64) and freebsd/x86, but NOT on openbsd/x86 or solaris/x86. x86: 386 and newer CPUs supported on Linux and Solaris 9. On Linux NPTL glibc is preferred, or a LinuxThreads glibc configured to access thread state via a segment register ("floating stacks"). With a non-floating stacks glibc you must build the system without thread support if you want HiPE support. HiPE/x86 used to work on Solaris 8, and may work on Solaris 10, but we only have access to a Solaris 9 box for testing. AMD64/Intel64: supported on Linux. PowerPC: supports 32-bit user-mode processes on Linux and OSX. ARM: supports big-endian v5 CPUs (XScale) on Linux. SPARC: supports v9 CPUs running 32-bit user-mode on Solaris and Linux. HiPE/x86 should work on OSX, and may work on FreeBSD, but since we don't have those systems we won't pretend to support them. User can still ./configure --enable-hipe if their systems do in fact work with HiPE. That ./configure --help doesn't list --enable-hipe is a bug; I'll make sure that it gets fixed before R11B-2. /Mikael From valentin@REDACTED Sat Oct 21 13:05:42 2006 From: valentin@REDACTED (Valentin Micic) Date: Sat, 21 Oct 2006 13:05:42 +0200 Subject: [erlang-questions] Fw: Berkely DB was: MySQL cluster Message-ID: <035601c6f500$db1d1840$6501a8c0@moneymaker2> Could anyone indicate what are main issues with Berkeley DB, assuming that one does not require SQL nor flexible data-model? Thanks in advance. V. > ----- Original Message ----- > From: "Roberto Saccon" > To: "Christian S" > Cc: > Sent: Friday, October 20, 2006 7:18 PM > Subject: Re: [erlang-questions] MySQL cluster > > >>I had the same question and I am currently investigating in using >> mnesia just as cache for a clustered web application running on amazon >> EC2 and the real storage is on amazon S3 (which is kind of Berkley DB >> webservice) and capable to store any number of TBs ... >> >> On 10/20/06, Christian S wrote: >>> On 10/20/06, Dmitrii Dimandt wrote: >>> > What's the optimum maximum size for Mnesia then? A bout a couple of >>> > gigabytes? Or more? >>> >>> What should such a number for maximum size try to optimize? >>> >>> A note about picking database after storage size needs: >>> >>> Using mnesia instead of an external database always have advantages in >>> terms of "impedance matching" (Mnesia has erlang's datatypes by virtue >>> of being erlang and you can query mnesia faster than anything >>> connected to through tcp). This often makes it worthwile to hack >>> around mnesia to store some data outside of it. >>> >>> One would easily reach a storage size of 1Tb for a site like flickr. >>> Does that mean mnesia wouldnt be sufficient for building such a site? >>> Or perhaps it could be a good idea to build an application that >>> replicates images across nodes outside of mnesia, and have mnesia >>> store small image ids to reference them. >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://www.erlang.org/mailman/listinfo/erlang-questions >>> >> >> >> -- >> Roberto Saccon >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > From tty.erlang@REDACTED Sat Oct 21 15:54:30 2006 From: tty.erlang@REDACTED (t ty) Date: Sat, 21 Oct 2006 09:54:30 -0400 Subject: [erlang-questions] Fw: Berkely DB was: MySQL cluster In-Reply-To: <035601c6f500$db1d1840$6501a8c0@moneymaker2> References: <035601c6f500$db1d1840$6501a8c0@moneymaker2> Message-ID: <290b3ba10610210654n430c797ds64c975c0abae784@mail.gmail.com> Emil's paper "Evaluation of Database Management Systems for Erlang" at http://www.erlang-consulting.com/aboutus/erlangarticles.html covers some of the issues. t On 10/21/06, Valentin Micic wrote: > Could anyone indicate what are main issues with Berkeley DB, assuming that > one does not require SQL nor flexible data-model? > Thanks in advance. > > V. > > > ----- Original Message ----- > > From: "Roberto Saccon" > > To: "Christian S" > > Cc: > > Sent: Friday, October 20, 2006 7:18 PM > > Subject: Re: [erlang-questions] MySQL cluster > > > > > >>I had the same question and I am currently investigating in using > >> mnesia just as cache for a clustered web application running on amazon > >> EC2 and the real storage is on amazon S3 (which is kind of Berkley DB > >> webservice) and capable to store any number of TBs ... > >> > >> On 10/20/06, Christian S wrote: > >>> On 10/20/06, Dmitrii Dimandt wrote: > >>> > What's the optimum maximum size for Mnesia then? A bout a couple of > >>> > gigabytes? Or more? > >>> > >>> What should such a number for maximum size try to optimize? > >>> > >>> A note about picking database after storage size needs: > >>> > >>> Using mnesia instead of an external database always have advantages in > >>> terms of "impedance matching" (Mnesia has erlang's datatypes by virtue > >>> of being erlang and you can query mnesia faster than anything > >>> connected to through tcp). This often makes it worthwile to hack > >>> around mnesia to store some data outside of it. > >>> > >>> One would easily reach a storage size of 1Tb for a site like flickr. > >>> Does that mean mnesia wouldnt be sufficient for building such a site? > >>> Or perhaps it could be a good idea to build an application that > >>> replicates images across nodes outside of mnesia, and have mnesia > >>> store small image ids to reference them. > >>> _______________________________________________ > >>> erlang-questions mailing list > >>> erlang-questions@REDACTED > >>> http://www.erlang.org/mailman/listinfo/erlang-questions > >>> > >> > >> > >> -- > >> Roberto Saccon > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From valentin@REDACTED Sat Oct 21 16:01:53 2006 From: valentin@REDACTED (Valentin Micic) Date: Sat, 21 Oct 2006 16:01:53 +0200 Subject: [erlang-questions] Fw: Berkely DB was: MySQL cluster References: <035601c6f500$db1d1840$6501a8c0@moneymaker2> <290b3ba10610210654n430c797ds64c975c0abae784@mail.gmail.com> Message-ID: <037f01c6f519$76a4fef0$6501a8c0@moneymaker2> No offence, I've read Emil's document, and as much as I appreciate his comparative analysis, I was hoping to get feedback from somebody that is actually using it. V. ----- Original Message ----- From: "t ty" To: "Valentin Micic" Cc: Sent: Saturday, October 21, 2006 3:54 PM Subject: Re: [erlang-questions] Fw: Berkely DB was: MySQL cluster > Emil's paper "Evaluation of Database Management Systems for Erlang" at > > http://www.erlang-consulting.com/aboutus/erlangarticles.html > > covers some of the issues. > > t > > On 10/21/06, Valentin Micic wrote: >> Could anyone indicate what are main issues with Berkeley DB, assuming >> that >> one does not require SQL nor flexible data-model? >> Thanks in advance. >> >> V. >> >> > ----- Original Message ----- >> > From: "Roberto Saccon" >> > To: "Christian S" >> > Cc: >> > Sent: Friday, October 20, 2006 7:18 PM >> > Subject: Re: [erlang-questions] MySQL cluster >> > >> > >> >>I had the same question and I am currently investigating in using >> >> mnesia just as cache for a clustered web application running on amazon >> >> EC2 and the real storage is on amazon S3 (which is kind of Berkley DB >> >> webservice) and capable to store any number of TBs ... >> >> >> >> On 10/20/06, Christian S wrote: >> >>> On 10/20/06, Dmitrii Dimandt wrote: >> >>> > What's the optimum maximum size for Mnesia then? A bout a couple of >> >>> > gigabytes? Or more? >> >>> >> >>> What should such a number for maximum size try to optimize? >> >>> >> >>> A note about picking database after storage size needs: >> >>> >> >>> Using mnesia instead of an external database always have advantages >> >>> in >> >>> terms of "impedance matching" (Mnesia has erlang's datatypes by >> >>> virtue >> >>> of being erlang and you can query mnesia faster than anything >> >>> connected to through tcp). This often makes it worthwile to hack >> >>> around mnesia to store some data outside of it. >> >>> >> >>> One would easily reach a storage size of 1Tb for a site like flickr. >> >>> Does that mean mnesia wouldnt be sufficient for building such a site? >> >>> Or perhaps it could be a good idea to build an application that >> >>> replicates images across nodes outside of mnesia, and have mnesia >> >>> store small image ids to reference them. >> >>> _______________________________________________ >> >>> erlang-questions mailing list >> >>> erlang-questions@REDACTED >> >>> http://www.erlang.org/mailman/listinfo/erlang-questions >> >>> >> >> >> >> >> >> -- >> >> Roberto Saccon >> >> _______________________________________________ >> >> erlang-questions mailing list >> >> erlang-questions@REDACTED >> >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> From patrickerj@REDACTED Sat Oct 21 16:32:34 2006 From: patrickerj@REDACTED (Pat e) Date: Sat, 21 Oct 2006 16:32:34 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL(tm) :) Message-ID: How much work would it be needed to tweak Mnesia for massive database storing? Will it be necessary to completley rewrite mnesia for multi-terabyte disk-only tables? Has anyone have any idea how to bypass 2GB limit for disk only tables, and how to effecivlly operate ram caching? I think we will need to develop some blueprint in next years of how to develop such powerful upgrade for Mnesia. Ulf... again, can you help? :) From patrickerj@REDACTED Sat Oct 21 19:12:48 2006 From: patrickerj@REDACTED (Pat e) Date: Sat, 21 Oct 2006 19:12:48 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL(tm) :) Message-ID: Mnesia is using Judy-array, right (i presume they limit the table to max 3GB size)? What about hash tables? I am not pretty much into it. :) From jay@REDACTED Sat Oct 21 19:21:40 2006 From: jay@REDACTED (Jay Nelson) Date: Sat, 21 Oct 2006 10:21:40 -0700 Subject: [erlang-questions] MySQL Cluster Message-ID: <453A5724.5060108@duomark.com> Pat e wrote: > We are prepairing rather big web project that > will end up with tens of TB of data. Scott wrote: > These sizing questions are popping up on a regular basis now, getting > to be FAQ frequency. I'll second that. > No I haven't tried MySQL Cluster or TimesTen, but I'm hoping for > some free time to try it out. I work for a Wall Street firm. We used to have our trading client running on Solaris, C++ and X-Windows using Sybase. Competitors started rolling out PC-based solutions and the traders said they didn't want 2 boxes on their desk. The whole industry has shifted to PC-based trading applications. We went with the whole Visual Studio C++, Times Ten database, Tibco messaging, blah, blah. When the individual trader databases started approaching 1GB we could no longer use Times Ten because they map to a virtual file in RAM. So we started looking at compressing the data. That bought a few months. Then we started looking at Sybase RAM versions which turned out to be much faster. Meanwhile the backend backoffice stuff ran on Solaris with Sybase. The log files started getting too big to deal with. Then the databases started get too big to deal with. Now the pressure is on to send an order to the floor in 5 ms which leaves not only not enough time to touch a DB, but not enough time to touch the disk. We are in the process of eliminating databases. Why did we use them in the first place? You just do. If you are an engineer and I say I need to store a lot of data and your answer is not "A database!", you fail CS101. No one ever asks, "how do you want to access it, why do you think you need a database". =============================== "My website needs 20TB of data in the database..." Why? Are they pictures or movies? => Do not store them in a database. Do you have 20 Billion users, each with 1000 bytes of data? => Double check your numbers. Do you have 1M users with backup data of 20MB each? => Store the 1M users in a database, store the rest some other way. =============================== Pat e writes: > Will it be necessary to completley rewrite mnesia for multi-terabyte disk-only tables? That depends. Is it possible for you to look at your problem differently so that it doesn't require multi-terabyte disk-only tables? =============================== What is the real problem you want to solve? Why do you think you need a database? Why is it so big? How often will it be queried? How often will it be modified? Is it really an archive or a transaction log? Now, if you are monitoring the sales of canned beans across all shopper club members in real time to tune your factory production line -- then you've got a real problem. Generally, when you push the limits of technology you look at tweaking it. When you move several orders of magnitude beyond the current state of the art, you need to look at the basics of the problem, the underpinnings of the technology and think about coming up with a new alternative designed for the new problem space. jay From yerl@REDACTED Sat Oct 21 19:26:19 2006 From: yerl@REDACTED (Yerl) Date: Sat, 21 Oct 2006 19:26:19 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL(tm) :) In-Reply-To: References: Message-ID: <453A583B.4040207@club-internet.fr> Hi There! Pat e a ?crit : > Mnesia is using Judy-array, right (i presume they limit the table to > max 3GB size)? > Is it true? Really, JudyArray? > What about hash tables? > > I can help on this field, as I implemented several Hash Tables libraries (open addressing, chaining ...) during open source devs. cheers Youn?s From yerl@REDACTED Sat Oct 21 19:38:16 2006 From: yerl@REDACTED (Yerl) Date: Sat, 21 Oct 2006 19:38:16 +0200 Subject: [erlang-questions] MySQL Cluster In-Reply-To: <453A5724.5060108@duomark.com> References: <453A5724.5060108@duomark.com> Message-ID: <453A5B08.7040401@club-internet.fr> Hi ! I agree with Jay. It's depends on what data are. At work, we daily mange/access/operate on ~ 200To database growing every year (+100To each year at least). This isn't really a DB, but a clever data management system running on 86 ultra cheap nodes. The DB contains 4000 million web documents. Any document access is time bounded (less than 40ms). The algorithm behind the scene performs O(log(N)) in the worst case. Thus, I can sleep happy each night. cheers Youn?s Jay Nelson a ?crit : > Pat e wrote: > > > We are prepairing rather big web project that > > will end up with tens of TB of data. > > Scott wrote: > > > These sizing questions are popping up on a regular basis now, getting > > to be FAQ frequency. > > I'll second that. > > > No I haven't tried MySQL Cluster or TimesTen, but I'm hoping for > > some free time to try it out. > > I work for a Wall Street firm. We used to have our trading client > running on Solaris, C++ and X-Windows using Sybase. Competitors started > rolling out PC-based solutions and the traders said they didn't want 2 > boxes on their desk. The whole industry has shifted to PC-based trading > applications. > > We went with the whole Visual Studio C++, Times Ten database, Tibco > messaging, blah, blah. > > When the individual trader databases started approaching 1GB we could no > longer use Times Ten because they map to a virtual file in RAM. So we > started looking at compressing the data. That bought a few months. > Then we started looking at Sybase RAM versions which turned out to be > much faster. > > Meanwhile the backend backoffice stuff ran on Solaris with Sybase. The > log files started getting too big to deal with. Then the databases > started get too big to deal with. Now the pressure is on to send an > order to the floor in 5 ms which leaves not only not enough time to > touch a DB, but not enough time to touch the disk. > > We are in the process of eliminating databases. Why did we use them in > the first place? You just do. If you are an engineer and I say I need > to store a lot of data and your answer is not "A database!", you fail > CS101. No one ever asks, "how do you want to access it, why do you > think you need a database". > > =============================== > > "My website needs 20TB of data in the database..." > > Why? Are they pictures or movies? => Do not store them in a database. > Do you have 20 Billion users, each with 1000 bytes of data? => Double > check your numbers. > > Do you have 1M users with backup data of 20MB each? => Store the 1M > users in a database, store the rest some other way. > > =============================== > > Pat e writes: > > > Will it be necessary to completley rewrite mnesia for multi-terabyte > disk-only > tables? > > That depends. Is it possible for you to look at your problem > differently so that > it doesn't require multi-terabyte disk-only tables? > > =============================== > > What is the real problem you want to solve? > Why do you think you need a database? > Why is it so big? > How often will it be queried? > How often will it be modified? > Is it really an archive or a transaction log? > > Now, if you are monitoring the sales of canned beans across all shopper > club members in real time to tune your factory production line -- then > you've got a real problem. > > Generally, when you push the limits of technology you look at tweaking > it. When you move several orders of magnitude beyond the current state > of the art, you need to look at the basics of the problem, the > underpinnings of the technology and think about coming up with a new > alternative designed for the new problem space. > > jay > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > From mikpe@REDACTED Sat Oct 21 20:09:28 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Sat, 21 Oct 2006 20:09:28 +0200 (MEST) Subject: [erlang-questions] hipe on freebsd/x86 Message-ID: <200610211809.k9LI9SkB015806@harpo.it.uu.se> On Sat, 21 Oct 2006 11:13:51 -0600, Mikael Pettersson wrote: >> HiPE/x86 used to work on Solaris 8, and may work on Solaris 10, but >> we only have access to a Solaris 9 box for testing. > >On my SunOS 5.9/x86 box, compiling HiPE failed. I can provide output >of those errors if that would be useful. Please do, and include details about the toolchain you used (versions, configuration options, etc). >> HiPE/x86 should work on OSX, and may work on FreeBSD, but since we >> don't have those systems we won't pretend to support them. User can >> still ./configure --enable-hipe if their systems do in fact work >> with HiPE. > >Is HiPE maintained outside of Ericcson? The README for R11B says the >following, so I assumed FreeBSD was a supported platform for HiPE: > >At Ericsson we have a "Daily Build and Test" that runs on: > > Operating system Version > ----------------------------------------------------------- > Solaris/Sparc 2.8 (1) > Linux/Suse x86 9.2 > Linux/Suse Amd64 9.2 > Linux/Suse Amd64 10.0 > Linux/Montavista PPC 3.1 > FreeBSD x86 5.0 > Mac OS X 10.3.9 (2) > Mac OS X 10.4.6 (2) > Windows XP > Windows 2003 The HiPE group is a research group at Uppsala University. We do have close ties with Ericsson, but as we don't work at Ericsson we don't have access to their test machines. /Mikael From tobez@REDACTED Sat Oct 21 20:52:30 2006 From: tobez@REDACTED (Anton Berezin) Date: Sat, 21 Oct 2006 20:52:30 +0200 Subject: [erlang-questions] hipe on freebsd/x86 In-Reply-To: References: Message-ID: <20061021185230.GB32479@heechee.tobez.org> On Fri, Oct 20, 2006 at 11:06:51PM -0600, Count L?szl? de Alm?sy wrote: > I've noticed that on my FreeBSD 5.4/x86 machine that hipe is not built > by default. I have to add '--enable-hipe' (an undocumented option) to > ./configure, and then it gets compiled in. Is this the right > behavior? Shouldn't hipe just be picked up automatically on platforms > like FreeBSD that support it? Hmm, any particular reason you do not build Erlang from ports? At least the recent version of it has .if ${ARCH} == "i386" CONFIGURE_ARGS+= --enable-hipe .endif meaning it is enabled by default on your architecture. \Anton. -- We're going for 'working' here. 'clean' is for people with skills... -- Flemming Jacobsen From patrickerj@REDACTED Sat Oct 21 21:13:32 2006 From: patrickerj@REDACTED (Pat e) Date: Sat, 21 Oct 2006 21:13:32 +0200 Subject: [erlang-questions] MySQL Cluster Message-ID: Jay said: "Now, if you are monitoring the sales of canned beans across all shopper club members in real time to tune your factory production line -- then you've got a real problem." Something like that. :( From ulf@REDACTED Sat Oct 21 21:27:38 2006 From: ulf@REDACTED (Ulf Wiger) Date: Sat, 21 Oct 2006 21:27:38 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL(tm) :) In-Reply-To: References: Message-ID: Den 2006-10-21 16:32:34 skrev Pat e : > How much work would it be needed to tweak Mnesia for massive database > storing? I think more than tweaking is involved, as Jay pointed out. You may, for example, read the following document from a vendor that claims to manage database storage in the petabyte range: http://www.teradata.com/t/pdf.aspx?a=83673&b=84876 (They may even have some patents that will get in the way of such tweaking...) > Will it be necessary to completley rewrite mnesia for > multi-terabyte disk-only tables? Quite possibly, but this seems like an unrealistic undertaking. OTOH, developing pieces that would bring erlang closer to supporting multi-gigabyte disk storage solutions might be of value. Then again, the larger the data volume, the higher the price of failure (most likely). There are products that can do this today. They are usually quite expensive, but then again, most people who juggle terabytes of data are prepared to pay a pretty large sum of money for solid products and support. It's a difficult problem, to say the least. I would assume that if anyone would develop such a beast in Erlang, they wouldn't put it up on SourceForge, but sell it for big bucks. ;) > Has anyone have any idea how to bypass 2GB limit for > disk only tables, and how to effecivlly operate ram caching? You may google on 'site:erlang.org dets limit' and find several posts on the list on this topic. Here are two: http://www.erlang.org/ml-archive/erlang-questions/200004/msg00077.html http://www.erlang.org/ml-archive/erlang-questions/200604/msg00264.html As H?kan Mattsson's post (first one above) points out, ram caching would only solve one problem. Remote table load remains to be solved as well. > I think we will need to develop some blueprint in next years of > how to develop such powerful upgrade for Mnesia. > > Ulf... again, can you help? :) Not much, I think. I prototyped a low-level interface, as part of the rdbms patches, that would allow for plugging in other table types in mnesia. I did toy with the idea of trying to use it for a caching disk-only table type, but haven't even started an implementation for it. I'm not completely convinced that the (external_copies) approach I took was the right one, and (more importantly), neither is Dan Gudmundsson, who maintains mnesia. And right now, I have lots of other things that get higher priority. BR, Ulf W -- Ulf Wiger From calmasy@REDACTED Sat Oct 21 21:34:55 2006 From: calmasy@REDACTED (=?ISO-8859-1?Q?Count_L=E1szl=F3_de_Alm=E1sy?=) Date: Sat, 21 Oct 2006 13:34:55 -0600 Subject: [erlang-questions] hipe on freebsd/x86 In-Reply-To: <200610211809.k9LI9SkB015806@harpo.it.uu.se> References: <200610211809.k9LI9SkB015806@harpo.it.uu.se> Message-ID: On 10/21/06, Mikael Pettersson wrote: > >At Ericsson we have a "Daily Build and Test" that runs on: > > > > Operating system Version > > ----------------------------------------------------------- > > Solaris/Sparc 2.8 (1) > > Linux/Suse x86 9.2 > > Linux/Suse Amd64 9.2 > > Linux/Suse Amd64 10.0 > > Linux/Montavista PPC 3.1 > > FreeBSD x86 5.0 > > Mac OS X 10.3.9 (2) > > Mac OS X 10.4.6 (2) > > Windows XP > > Windows 2003 > > The HiPE group is a research group at Uppsala University. > We do have close ties with Ericsson, but as we don't work > at Ericsson we don't have access to their test machines. Ah, I see. Maybe they could allow you access? It would be really nice to have tier1 HiPE support for FreeBSD/x86 and FreeBSD/amd64. From calmasy@REDACTED Sat Oct 21 21:36:34 2006 From: calmasy@REDACTED (=?ISO-8859-1?Q?Count_L=E1szl=F3_de_Alm=E1sy?=) Date: Sat, 21 Oct 2006 13:36:34 -0600 Subject: [erlang-questions] hipe on freebsd/x86 In-Reply-To: <20061021185230.GB32479@heechee.tobez.org> References: <20061021185230.GB32479@heechee.tobez.org> Message-ID: On 10/21/06, Anton Berezin wrote: > Hmm, any particular reason you do not build Erlang from ports? At least the > recent version of it has > > .if ${ARCH} == "i386" > CONFIGURE_ARGS+= --enable-hipe > .endif > > meaning it is enabled by default on your architecture. At this point I haven't decided on FreeBSD as the implementation platform for what I'm working on. I'm just trying to gain a better understanding of what platforms support what options, and support them best. So, I'm playing with tarballs. From calmasy@REDACTED Sat Oct 21 21:33:38 2006 From: calmasy@REDACTED (=?ISO-8859-1?Q?Count_L=E1szl=F3_de_Alm=E1sy?=) Date: Sat, 21 Oct 2006 13:33:38 -0600 Subject: [erlang-questions] hipe on freebsd/x86 In-Reply-To: <200610211809.k9LI9SkB015806@harpo.it.uu.se> References: <200610211809.k9LI9SkB015806@harpo.it.uu.se> Message-ID: On 10/21/06, Mikael Pettersson wrote: >>On my SunOS 5.9/x86 box, compiling HiPE failed. I can provide output >>of those errors if that would be useful. > > Please do, and include details about the toolchain you used > (versions, configuration options, etc). SunOS x86-solaris1 5.9 Generic_112234-10 i86pc i386 i86pc Solaris Using gcc 3.3.2 and GNU make. No configuration options, just "./configure && gmake" gcc -g -O2 -I/home/users/c/ca/calmasy/src/sol_x86/otp_src_R11B-1/erts/i386-pc-solaris2.9 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHYBRID -DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Ibeam -Isys/unix -Isys/common -Ii386-pc-solaris2.9/opt/hybrid -Ii386-pc-solaris2.9 -Izlib -Ihipe -I../include/internal -I../include/internal/i386-pc-solaris2.9 -c hipe/hipe_x86_glue.S -o obj/i386-pc-solaris2.9/opt/hybrid/hipe_x86_glue.o Assembler: "/var/tmp//cc8haeIU.s", line 1 : Syntax error "/var/tmp//cc8haeIU.s", line 8 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 8 : Syntax error "/var/tmp//cc8haeIU.s", line 8 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 9 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 9 : Syntax error "/var/tmp//cc8haeIU.s", line 9 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 23 : Syntax error "/var/tmp//cc8haeIU.s", line 35 : Syntax error "/var/tmp//cc8haeIU.s", line 37 : Syntax error "/var/tmp//cc8haeIU.s", line 41 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 41 : Syntax error "/var/tmp//cc8haeIU.s", line 41 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 51 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 51 : Syntax error "/var/tmp//cc8haeIU.s", line 51 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 57 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 57 : Syntax error "/var/tmp//cc8haeIU.s", line 57 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 70 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 70 : Syntax error "/var/tmp//cc8haeIU.s", line 70 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 83 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 83 : Syntax error "/var/tmp//cc8haeIU.s", line 83 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 95 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 95 : Syntax error "/var/tmp//cc8haeIU.s", line 95 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 110 : Illegal mnemonic "/var/tmp//cc8haeIU.s", line 110 : Syntax error "/var/tmp//cc8haeIU.s", line 110 : Illegal mnemonic Too many errors - Goodbye make[3]: *** [obj/i386-pc-solaris2.9/opt/hybrid/hipe_x86_glue.o] Error 1 make[3]: Leaving directory `/home/users/c/ca/calmasy/src/sol_x86/otp_src_R11B-1/erts/emulator' make[2]: *** [opt] Error 2 make[2]: Leaving directory `/home/users/c/ca/calmasy/src/sol_x86/otp_src_R11B-1/erts/emulator' make[1]: *** [hybrid] Error 2 make[1]: Leaving directory `/home/users/c/ca/calmasy/src/sol_x86/otp_src_R11B-1/erts' make: *** [emulator] Error 2 From patrickerj@REDACTED Sat Oct 21 22:00:19 2006 From: patrickerj@REDACTED (Pat e) Date: Sat, 21 Oct 2006 22:00:19 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL(tm) :) In-Reply-To: References: Message-ID: On 10/21/06, Ulf Wiger wrote: > Den 2006-10-21 16:32:34 skrev Pat e : > > > How much work would it be needed to tweak Mnesia for massive database > > storing? > > I think more than tweaking is involved, as Jay pointed out. > You may, for example, read the following document from a > vendor that claims to manage database storage in the petabyte > range: > > http://www.teradata.com/t/pdf.aspx?a=83673&b=84876 > That's cool, but let the Wal-Mart use that :) > (They may even have some patents that will get in the way > of such tweaking...) > > > > Will it be necessary to completley rewrite mnesia for > > multi-terabyte disk-only tables? > > Quite possibly, but this seems like an unrealistic undertaking. > OTOH, developing pieces that would bring erlang closer to > supporting multi-gigabyte disk storage solutions might be > of value. > > Then again, the larger the data volume, the higher the price > of failure (most likely). There are products that can do this > today. They are usually quite expensive, but then again, most > people who juggle terabytes of data are prepared to pay a pretty > large sum of money for solid products and support. It's a > difficult problem, to say the least. > > I would assume that if anyone would develop such a beast in > Erlang, they wouldn't put it up on SourceForge, but sell it > for big bucks. ;) > That's for sure, although forking several MM's$US upfront without knowing if the project will pay it off is a bit risky. :) It's more cautious to take the SourceForge way, and from there build forward - only there is a problem from transacting with two or three database systems instead of one. That is why i ask about TB sizes.... imagine in year one having say 10 to 20 thousand subscribed users, and then going to 5 to 10 million users, AND keeping the staff of 1 to 2 developers (we could take extra 200 employees, fork some 10 to 15MM$US on several thousand servers upfront ... THEN WHAT??? if it goes wrong... VC's will want to hang us :( > > > Has anyone have any idea how to bypass 2GB limit for > > disk only tables, and how to effecivlly operate ram caching? > > > You may google on 'site:erlang.org dets limit' and find several posts on > the list on this topic. Here are two: > > http://www.erlang.org/ml-archive/erlang-questions/200004/msg00077.html > > http://www.erlang.org/ml-archive/erlang-questions/200604/msg00264.html > > As H?kan Mattsson's post (first one above) points out, ram caching > would only solve one problem. Remote table load remains to be > solved as well. > > > > I think we will need to develop some blueprint in next years of > > how to develop such powerful upgrade for Mnesia. > > > > Ulf... again, can you help? :) > > Not much, I think. I prototyped a low-level interface, > as part of the rdbms patches, that would allow for plugging in > other table types in mnesia. I did toy with the idea of trying > to use it for a caching disk-only table type, but haven't even > started an implementation for it. I'm not completely convinced > that the (external_copies) approach I took was the right one, > and (more importantly), neither is Dan Gudmundsson, who > maintains mnesia. > > And right now, I have lots of other things that get higher > priority. > Tell us more :) On 10/21/06, Pat e wrote: > On 10/21/06, Ulf Wiger wrote: > > Den 2006-10-21 16:32:34 skrev Pat e : > > > > > How much work would it be needed to tweak Mnesia for massive database > > > storing? > > > > I think more than tweaking is involved, as Jay pointed out. > > You may, for example, read the following document from a > > vendor that claims to manage database storage in the petabyte > > range: > > > > http://www.teradata.com/t/pdf.aspx?a=83673&b=84876 > > > That's cool, but let the Wal-Mart use that :) > > > (They may even have some patents that will get in the way > > of such tweaking...) > > > > > > > Will it be necessary to completley rewrite mnesia for > > > multi-terabyte disk-only tables? > > > > Quite possibly, but this seems like an unrealistic undertaking. > > OTOH, developing pieces that would bring erlang closer to > > supporting multi-gigabyte disk storage solutions might be > > of value. > > > > Then again, the larger the data volume, the higher the price > > of failure (most likely). There are products that can do this > > today. They are usually quite expensive, but then again, most > > people who juggle terabytes of data are prepared to pay a pretty > > large sum of money for solid products and support. It's a > > difficult problem, to say the least. > > > > I would assume that if anyone would develop such a beast in > > Erlang, they wouldn't put it up on SourceForge, but sell it > > for big bucks. ;) > > > That's for sure, although forking several MM's$US upfront without > knowing if the project will pay it off is a bit risky. :) > > It's more cautious to take the SourceForge way, and from there > build forward - only there is a problem from transacting with > two or three database systems instead of one. > That is why i ask about TB sizes.... imagine in year one > having say 10 to 20 thousand subscribed users, and then > going to 5 to 10 million users, AND keeping the staff of > 1 to 2 developers (we could take extra 200 employees, > fork some 10 to 15MM$US on several thousand servers > upfront ... THEN WHAT??? if it goes wrong... VC's will > want to hang us :( > > > > > > Has anyone have any idea how to bypass 2GB limit for > > > disk only tables, and how to effecivlly operate ram caching? > > > > > > You may google on 'site:erlang.org dets limit' and find several posts on > > the list on this topic. Here are two: > > > > http://www.erlang.org/ml-archive/erlang-questions/200004/msg00077.html > > > > http://www.erlang.org/ml-archive/erlang-questions/200604/msg00264.html > > > > As H?kan Mattsson's post (first one above) points out, ram caching > > would only solve one problem. Remote table load remains to be > > solved as well. > > > > > > > I think we will need to develop some blueprint in next years of > > > how to develop such powerful upgrade for Mnesia. > > > > > > Ulf... again, can you help? :) > > > > Not much, I think. I prototyped a low-level interface, > > as part of the rdbms patches, that would allow for plugging in > > other table types in mnesia. I did toy with the idea of trying > > to use it for a caching disk-only table type, but haven't even > > started an implementation for it. I'm not completely convinced > > that the (external_copies) approach I took was the right one, > > and (more importantly), neither is Dan Gudmundsson, who > > maintains mnesia. > > > > And right now, I have lots of other things that get higher > > priority. > > > Tell us more :) > > > BR, > > Ulf W > > -- > > Ulf Wiger > > > From calmasy@REDACTED Sat Oct 21 19:13:51 2006 From: calmasy@REDACTED (=?ISO-8859-1?Q?Count_L=E1szl=F3_de_Alm=E1sy?=) Date: Sat, 21 Oct 2006 11:13:51 -0600 Subject: [erlang-questions] hipe on freebsd/x86 In-Reply-To: <200610210956.k9L9uU5q015164@harpo.it.uu.se> References: <200610210956.k9L9uU5q015164@harpo.it.uu.se> Message-ID: On 10/21/06, Mikael Pettersson wrote: > HiPE is autoenabled on supported platforms. However, "supported" > does not mean "seems to maybe work on", it means that we regularly > test on those platforms and will fix problems if/when they occur. I see. Thanks for the clarification. > HiPE/x86 used to work on Solaris 8, and may work on Solaris 10, but > we only have access to a Solaris 9 box for testing. On my SunOS 5.9/x86 box, compiling HiPE failed. I can provide output of those errors if that would be useful. > HiPE/x86 should work on OSX, and may work on FreeBSD, but since we > don't have those systems we won't pretend to support them. User can > still ./configure --enable-hipe if their systems do in fact work > with HiPE. Is HiPE maintained outside of Ericcson? The README for R11B says the following, so I assumed FreeBSD was a supported platform for HiPE: At Ericsson we have a "Daily Build and Test" that runs on: Operating system Version ----------------------------------------------------------- Solaris/Sparc 2.8 (1) Linux/Suse x86 9.2 Linux/Suse Amd64 9.2 Linux/Suse Amd64 10.0 Linux/Montavista PPC 3.1 FreeBSD x86 5.0 Mac OS X 10.3.9 (2) Mac OS X 10.4.6 (2) Windows XP Windows 2003 From yarivvv@REDACTED Sat Oct 21 23:59:00 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Sat, 21 Oct 2006 17:59:00 -0400 Subject: [erlang-questions] MySQL cluster - MnesiaXXL(tm) :) In-Reply-To: References: Message-ID: <17244f480610211459n3f1b970anf2597127710d9641@mail.gmail.com> Hi, > > It's more cautious to take the SourceForge way, and from there > build forward - only there is a problem from transacting with > two or three database systems instead of one. > That is why i ask about TB sizes.... imagine in year one > having say 10 to 20 thousand subscribed users, and then > going to 5 to 10 million users, AND keeping the staff of > 1 to 2 developers (we could take extra 200 employees, > fork some 10 to 15MM$US on several thousand servers > upfront ... THEN WHAT??? if it goes wrong... VC's will > want to hang us :( IMO, if you need to potentially store large data sets, and you might need to run non-trivial queries on relational data, why take the risk with Mnesia? There are very good open source SQL database engines that have proven to be able to handle the task, whereas with Mnesia there's some uncertainty. Plus, you can use ErlyDB to bridge the semantic gap with SQL databases (although right now only MySQL is supported out of the box) in a very natural way. Btw, I'm not anti-Mnesia. I think Mnesia + MySQL is a great combination, where Mnesia acts like a distributed cache for live application data and MySQL holds long-term, high-volume data, that you also may need to indexed for full text search (MySQL has a few solutions in this area). My 2c, Regards, Yariv From patrickerj@REDACTED Sun Oct 22 00:07:55 2006 From: patrickerj@REDACTED (Pat e) Date: Sun, 22 Oct 2006 00:07:55 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL(tm) :) In-Reply-To: <17244f480610211459n3f1b970anf2597127710d9641@mail.gmail.com> References: <17244f480610211459n3f1b970anf2597127710d9641@mail.gmail.com> Message-ID: Same idea here, although having only one system would be much easier, that is why i asked about if Mnesia could be enhanced. BTW nice apps roling Yariv. :) On 10/21/06, Yariv Sadan wrote: > Hi, > > > > > It's more cautious to take the SourceForge way, and from there > > build forward - only there is a problem from transacting with > > two or three database systems instead of one. > > That is why i ask about TB sizes.... imagine in year one > > having say 10 to 20 thousand subscribed users, and then > > going to 5 to 10 million users, AND keeping the staff of > > 1 to 2 developers (we could take extra 200 employees, > > fork some 10 to 15MM$US on several thousand servers > > upfront ... THEN WHAT??? if it goes wrong... VC's will > > want to hang us :( > > IMO, if you need to potentially store large data sets, and you might > need to run non-trivial queries on relational data, why take the risk > with Mnesia? There are very good open source SQL database engines that > have proven to be able to handle the task, whereas with Mnesia there's > some uncertainty. Plus, you can use ErlyDB to bridge the semantic gap > with SQL databases (although right now only MySQL is supported out of > the box) in a very natural way. > > Btw, I'm not anti-Mnesia. I think Mnesia + MySQL is a great > combination, where Mnesia acts like a distributed cache for live > application data and MySQL holds long-term, high-volume data, that you > also may need to indexed for full text search (MySQL has a few > solutions in this area). > > My 2c, > > Regards, > Yariv > From mikpe@REDACTED Sun Oct 22 02:10:25 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Sun, 22 Oct 2006 02:10:25 +0200 (MEST) Subject: [erlang-questions] hipe on freebsd/x86 Message-ID: <200610220010.k9M0APDY017408@harpo.it.uu.se> On Sat, 21 Oct 2006 13:33:38 -0600, wrote: >>>On my SunOS 5.9/x86 box, compiling HiPE failed. I can provide output >>>of those errors if that would be useful. >> >> Please do, and include details about the toolchain you used >> (versions, configuration options, etc). > >SunOS x86-solaris1 5.9 Generic_112234-10 i86pc i386 i86pc Solaris > >Using gcc 3.3.2 and GNU make. No configuration options, just >"./configure && gmake" > >gcc -g -O2 -I/home/users/c/ca/calmasy/src/sol_x86/otp_src_R11B-1/erts/i386-pc-solaris2.9 > -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHYBRID -DHAVE_CONFIG_H >-Wall -Wstrict-prototypes -Wmissing-prototypes -DUSE_THREADS >-D_THREAD_SAFE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Ibeam >-Isys/unix -Isys/common -Ii386-pc-solaris2.9/opt/hybrid >-Ii386-pc-solaris2.9 -Izlib -Ihipe -I../include/internal >-I../include/internal/i386-pc-solaris2.9 -c hipe/hipe_x86_glue.S -o >obj/i386-pc-solaris2.9/opt/hybrid/hipe_x86_glue.o >Assembler: > "/var/tmp//cc8haeIU.s", line 1 : Syntax error > "/var/tmp//cc8haeIU.s", line 8 : Illegal mnemonic > "/var/tmp//cc8haeIU.s", line 8 : Syntax error > "/var/tmp//cc8haeIU.s", line 8 : Illegal mnemonic > "/var/tmp//cc8haeIU.s", line 9 : Illegal mnemonic > "/var/tmp//cc8haeIU.s", line 9 : Syntax error > "/var/tmp//cc8haeIU.s", line 9 : Illegal mnemonic etc Looks like your gcc is using Sun's assembler. That won't work due to Sun's braindead assembly syntax. You need the GNU binutils, and gcc must be configured --with-gnu-as, and possibly also --with-as=/path/to/gnu/as, before being built. Your gcc is ancient anyway, so you may as well take this opportunity to update to gcc-3.4.6 or better yet gcc-4.1.1. /Mikael From datacompboy@REDACTED Sun Oct 22 06:29:31 2006 From: datacompboy@REDACTED (datacompboy) Date: Sun, 22 Oct 2006 05:29:31 +0100 Subject: [erlang-questions] Change name of mnesia node References: Message-ID: <20061022042931.9D4BF5A1FA@mail.erlangsystems.com> Is that possible to catch files from mnesia database, initialized for other mnesia node name? I.e. change mnesia node name when old name unavailable? Right now after mnesia:start() with new name it loads schema, and waits for node with old name to up... :/ -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From anders.nygren@REDACTED Sun Oct 22 16:48:39 2006 From: anders.nygren@REDACTED (Anders Nygren) Date: Sun, 22 Oct 2006 09:48:39 -0500 Subject: [erlang-questions] Change name of mnesia node In-Reply-To: <20061022042931.9D4BF5A1FA@mail.erlangsystems.com> References: <20061022042931.9D4BF5A1FA@mail.erlangsystems.com> Message-ID: On 10/21/06, datacompboy wrote: > > Is that possible to catch files from mnesia database, initialized for other mnesia node name? > I.e. change mnesia node name when old name unavailable? > Right now after mnesia:start() with new name it loads schema, and waits for node with old name to up... :/ See the mnesia user's guide ch 6.9.1, it has an example on how to do this. /Anders From datacompboy@REDACTED Sun Oct 22 17:03:58 2006 From: datacompboy@REDACTED (datacompboy) Date: Sun, 22 Oct 2006 16:03:58 +0100 Subject: [erlang-questions] Change name of mnesia node References: Message-ID: <20061022150358.3F4055A06A@mail.erlangsystems.com> anders_n wrote: See the mnesia user's guide ch 6.9.1, it has an example on how to do this. (end of quote) Many thanks! Have missed that while read... -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From yan.guiborat@REDACTED Sun Oct 22 22:36:13 2006 From: yan.guiborat@REDACTED (netboz) Date: Sun, 22 Oct 2006 13:36:13 -0700 (PDT) Subject: [erlang-questions] Driver to a C++ lib Message-ID: <6945352.post@talk.nabble.com> Hi, I preparing myself to build a driver to communicate with a C++ library. I have been hanging around into the documentation I could find, and I would like your advices about this. Is EDTK able to communicate with C++ ? May be I should demangle the method call ? Is Dryverl able to do this with a lttle less work ? what's about SWIG ? Is it the only solution (I would prefer to avoid it). Thanks to everybody, netboz -- View this message in context: http://www.nabble.com/Driver-to-a-C%2B%2B-lib-tf2491216.html#a6945352 Sent from the Erlang Questions mailing list archive at Nabble.com. From valentin@REDACTED Sun Oct 22 23:06:22 2006 From: valentin@REDACTED (Valentin Micic) Date: Sun, 22 Oct 2006 23:06:22 +0200 Subject: [erlang-questions] Driver to a C++ lib References: <6945352.post@talk.nabble.com> Message-ID: <000c01c6f61d$ef734030$6601a8c0@moneymaker2> I've been using C++ with Erlang libraries without any problems. All you have to do is to declare all driver's callback functions within extern "C" block. The same is true for all the ei.lib functions -- simply include all relevant header files within extern "C" block. Hope this helps. V. ----- Original Message ----- From: "netboz" To: Sent: Sunday, October 22, 2006 10:36 PM Subject: [erlang-questions] Driver to a C++ lib > > Hi, > > > I preparing myself to build a driver to communicate with a C++ library. > I have been hanging around into the documentation I could find, and I > would > like your > advices about this. > > Is EDTK able to communicate with C++ ? May be I should demangle the method > call ? > Is Dryverl able to do this with a lttle less work ? > > what's about SWIG ? Is it the only solution (I would prefer to avoid it). > > Thanks to everybody, > > netboz > -- > View this message in context: > http://www.nabble.com/Driver-to-a-C%2B%2B-lib-tf2491216.html#a6945352 > Sent from the Erlang Questions mailing list archive at Nabble.com. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From robert.virding@REDACTED Sun Oct 22 23:20:36 2006 From: robert.virding@REDACTED (Robert Virding) Date: Sun, 22 Oct 2006 23:20:36 +0200 Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: References: Message-ID: <453BE0A4.7050108@telia.com> Ulf, I was a little unclear about what I was complaining with link. It was not the monitoring in itself, which does have its place. With links there are 3 parameters which describe the link: signal/message, single/multiple and uni-/bidirectional. With link/1 you get a signal-single-bidirectional connection berween the processes and with monitor/1 you get a message-multiple-unidirectional connection. You could of course have any combination of these parameters that you need. My main complaint is that instead of generalising the basic link construct - connecting two processes to exchange termination information - it is defined as something different. So instead of ONE versatile basic construction you now have TWO restricted ones neither solving the whole problem. Basically it is just a hack added to solve a specific problem with no real thought given to its place in the whole, just another special case. I know: this is only ONE thing so why worry? But I think too much has been added to solve specific problems without thinking about the language as whole. There has been no holistic view to Erlang just adding fixes as they arise. In the end you get a mess. I think sometimes you should refuse adding stuff which might solve one user's problem but is not good for the system as a whole, which affects all users. Robert P.S. If I wanted to be really picky I could also say that the name monitor is a misnomer as it is really not monitoring the process, just detecting its termination. A REAL monitor would tell much more of what is going on. And things should have a name which reflects what they do. Ulf Wiger (TN/EAB) wrote: > Of course, the changes you speak of were made in order to address real > shortcomings in the original solution (even though it may have been > regular and elegant). One major problem with link was that it was > two-way (and therefore didn't work well as a monitor), and had > process-global scope (i.e. you couldn't safely do > link-request-await_reply-unlink, since some other function (or the other > process) might call unlink and quietly remove the link.) > > The symmetry of exit messages probably would have worked if erlang had > really been a pure message passing environment, perhaps more in line > with Morrison's flow-based programming, but given that it leaned quite > heavily towards sequential programming as well, regular exceptions with > stack traces were really necessary. > > BR, > Ulf W From robert.virding@REDACTED Sun Oct 22 23:28:25 2006 From: robert.virding@REDACTED (Robert Virding) Date: Sun, 22 Oct 2006 23:28:25 +0200 Subject: [erlang-questions] Bugfix to regexp.erl Message-ID: <453BE279.2010104@telia.com> Here is a small patch to my regexp.erl which fixes wo small but important bugs in the code, one old, one new: 482c482 < re_apply(eos, More, [$\n|S], P) -> re_apply_more(More, S, P); --- > re_apply(eos, More, [$\n|_]=S, P) -> re_apply_more(More, S, P); 535c535 < comp_apply([], P, St, DFA, _Accept) -> --- > comp_apply([], P, St, DFA, Accept) -> 538c538 < #dfa_state{accept=false} -> nomatch --- > #dfa_state{accept=false} -> Accept The first patch should also be applied to the official regexp. This patch is also in trapexit.org as a reply to the original posting. Robert From patrickerj@REDACTED Mon Oct 23 00:17:43 2006 From: patrickerj@REDACTED (Pat e) Date: Mon, 23 Oct 2006 00:17:43 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL Message-ID: BTW After all is it wise to gamble (i know all of you will say it isn't :) a site reputation and speed when all Mnesia sh#t blows up into your face... but we need real time, and that is where Mnesia it seems shines! Why real time... well lets say you want AJAX tech implemented for all future 5 million users, with all of them contacting each other RT, and not have single glitch in delivery time and reliability (well something like big phone switch operator), and also have for the ease of use (LOL :) have user data on Mnesia disk tables ;) I know I'm boring, and that you talked about it many times, but if you don't try - you don't fly (and if you fly, you can also dive easily :=). Patrick From ulf@REDACTED Mon Oct 23 07:15:51 2006 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 23 Oct 2006 07:15:51 +0200 Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <453BE0A4.7050108@telia.com> References: <453BE0A4.7050108@telia.com> Message-ID: Den 2006-10-22 23:20:36 skrev Robert Virding : > With links there are 3 parameters which describe the link: > signal/message, single/multiple and uni-/bidirectional. With link/1 you > get a signal-single-bidirectional connection berween the processes and > with monitor/1 you get a message-multiple-unidirectional connection. You > could of course have any combination of these parameters that you need. > > My main complaint is that instead of generalising the basic link > construct - connecting two processes to exchange termination information > - it is defined as something different. So instead of ONE versatile > basic construction you now have TWO restricted ones neither solving the > whole problem. If you have a suggestion of how this could be accomplished nicely in one function, I'm sure there is still time to consider its introduction. I gather you wouldn't call it monitor/2 and demonitor/1, so the introduction of monitor shouldn't be much in the way. ;-) I agree that it's a bit unfortunate to have two different specialized constructs, at least on principle. The problem that arises when you don't pick the right generic construct from the start is that it does get more difficult to fix it later. Now, people are used to links being signal-single- bidirectional, and would be confused if they started acting differently. Monitors have the advantage of NOT being links; therefore, they can behave differently without causing consternation among the users. Years ago, there was a suggestion to make registered send act just like normal send (i.e. not crash if the name didn't exist). While this was logical and consistent, and therefore probably an improvement, one practical effect was that some code that would previously crash in certain situations, would now hang forever. So, elegance had to give way to backward compatibility. Actually, monitors were born in the wake of this. BR, Ulf W -- Ulf Wiger From ulf@REDACTED Mon Oct 23 07:18:07 2006 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 23 Oct 2006 07:18:07 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: References: Message-ID: Den 2006-10-23 00:17:43 skrev Pat e : > BTW > After all is it wise to gamble (i know all of you will say it isn't :) > a site reputation and speed when all Mnesia sh#t blows up into your > face... but we need real time, and that is where Mnesia it seems > shines! > Why real time... well lets say you want AJAX tech implemented for all > future 5 million users, with all of them contacting each other RT, and > not have single glitch in delivery time and reliability (well > something like big phone switch operator), and also have for the ease > of use (LOL :) have user data on Mnesia disk tables ;) > > I know I'm boring, and that you talked about it many times, but if you > don't try - you don't fly (and if you fly, you can also dive easily > :=). That kind of attitude helps further the state of Open Source. What would we do without people who were willing to play on the bleeding edge? (: BR, Ulf W -- Ulf Wiger From jay@REDACTED Mon Oct 23 08:01:18 2006 From: jay@REDACTED (Jay Nelson) Date: Sun, 22 Oct 2006 23:01:18 -0700 Subject: [erlang-questions] MySQL Cluster Message-ID: <453C5AAE.8050405@duomark.com> The Count wrote: > Interesting post, thanks. But my obvious question is, what are you > going to use instead of databases? Just files stored on disk or > network-attached storage or something? The main point was that the latency of writing anything at all to disk during the transaction made our solution slower than the competition. That would cause us to lose business. We must run with redundant memory copies only for real-time performance. If the power goes out, it better not take out all the RAM so the redundancy has to be spread in the way that a phone switch is. We originally used databases because it was convenient to look at the state of an order that had several transactions against it by querying a database. It was not necessary to satisfy the client's requirements. It was convenient for us, but ended up costing too much for the service to be competitive. Now we have to make convenience be an after the fact feature, and thus we have more freedom with how to implement it. --- Prior to the discovery and spread of Oracle-type SQL, the world was a bleak and barren place where no transactions of any kind could occur, and all business sank in the jungle quicksand... Wait! That's not how it was. Didn't IBM have some big computers that had millions of customers bank accounts and people were able to query on name, account number, etc. In fact I recall writing software to lookup names that sound similar to the incorrect spelling typed in by the operator (Soundex). And we didn't even have databases! Hmm, seems like there was something like multiple indexes and a file with records in it. But that was pretty old, it must not have worked well. Google, I'm sure, is using MySQL... or are they paying Oracle to get big scale... hmmm, well they must be using a database because they are looking up documents in real time and you couldn't find them any other way... I guess their ads have to be in a database too... Wow! they must have terabytes of data in a database that they query in real time... No wait! I thought I read they use something new they invented... what was it... oh, yeah, a file system. With PC components velcroed to a table to save money on metal boxes. --- My point is, if you have a problem that is very difficult, or orders of magnitude beyond what any of your competitors are doing, you are not likely to find an off-the-shelf or open source solution. You will have to innovate and come up with a technique that is so different from everyone else that they dismiss you as not understanding how to write software. Didn't erlang's "write once" variables and "let it die" attitude seem odd? Watch the movie "The World's Fastest Indian" and you might get an idea of what I mean. jay From rvg@REDACTED Mon Oct 23 13:26:31 2006 From: rvg@REDACTED (Rudolph van Graan) Date: Mon, 23 Oct 2006 13:26:31 +0200 Subject: [erlang-questions] What does this mean? Message-ID: <15FA01AC-2B24-4A4E-8DB2-00AD0AE96356@patternmatched.com> 1> TYPE ASSERTION FAILED, file beam/erl_term.c, line 105: tag_val_def: 0x18 Rudolph van Graan Software Architect Pattern Matched Technologies E-Mail: rvg@REDACTED Tel: 086 1000 700 (SA Only) Mobile: +27 83 390 7767 Fax: +27 12 665 9566 Web: www.patternmatched.com From patrickerj@REDACTED Mon Oct 23 13:51:24 2006 From: patrickerj@REDACTED (Pat e) Date: Mon, 23 Oct 2006 13:51:24 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: References: Message-ID: Is there something similar to Hierachichal Data Fromat written in Erlang? They are using Pthreads, but not supportning multithreading. Patrick On 10/23/06, Ulf Wiger wrote: > Den 2006-10-23 00:17:43 skrev Pat e : > > > BTW > > After all is it wise to gamble (i know all of you will say it isn't :) > > a site reputation and speed when all Mnesia sh#t blows up into your > > face... but we need real time, and that is where Mnesia it seems > > shines! > > Why real time... well lets say you want AJAX tech implemented for all > > future 5 million users, with all of them contacting each other RT, and > > not have single glitch in delivery time and reliability (well > > something like big phone switch operator), and also have for the ease > > of use (LOL :) have user data on Mnesia disk tables ;) > > > > I know I'm boring, and that you talked about it many times, but if you > > don't try - you don't fly (and if you fly, you can also dive easily > > :=). > > That kind of attitude helps further the state of Open Source. > What would we do without people who were willing to play on the > bleeding edge? (: > > BR, > Ulf W > -- > Ulf Wiger > From mikpe@REDACTED Mon Oct 23 14:24:26 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 23 Oct 2006 14:24:26 +0200 Subject: [erlang-questions] What does this mean? In-Reply-To: <15FA01AC-2B24-4A4E-8DB2-00AD0AE96356@patternmatched.com> References: <15FA01AC-2B24-4A4E-8DB2-00AD0AE96356@patternmatched.com> Message-ID: <17724.46202.479718.168097@alkaid.it.uu.se> Rudolph van Graan writes: > 1> TYPE ASSERTION FAILED, file beam/erl_term.c, line 105: > tag_val_def: 0x18 It means that you should immediately prepare a bug report containing at least the version of OTP you're using, the environment in which it is being run (OS version), the tools used to compile it (compiler and version), and a recipe for reproducing the error. This message is potentially serious and must be investigated. /Mikael From rvg@REDACTED Mon Oct 23 14:31:57 2006 From: rvg@REDACTED (Rudolph van Graan) Date: Mon, 23 Oct 2006 14:31:57 +0200 Subject: [erlang-questions] What does this mean? In-Reply-To: <17724.46202.479718.168097@alkaid.it.uu.se> References: <15FA01AC-2B24-4A4E-8DB2-00AD0AE96356@patternmatched.com> <17724.46202.479718.168097@alkaid.it.uu.se> Message-ID: Hi Mikael... This is just it - it is a production machine that simply dies with the message below. erts is 5.4.6 on linux. I don't have any more info on that. Will try to reproduce. Rudolph van Graan Software Architect Pattern Matched Technologies E-Mail: rvg@REDACTED Tel: 086 1000 700 (SA Only) Mobile: +27 83 390 7767 Fax: +27 12 665 9566 Web: www.patternmatched.com On Oct 23, 2006, at 2:24 PM, Mikael Pettersson wrote: > Rudolph van Graan writes: >> 1> TYPE ASSERTION FAILED, file beam/erl_term.c, line 105: >> tag_val_def: 0x18 > > It means that you should immediately prepare a bug report > containing at least the version of OTP you're using, the > environment in which it is being run (OS version), the > tools used to compile it (compiler and version), and a > recipe for reproducing the error. > > This message is potentially serious and must be investigated. > > /Mikael > From patrickerj@REDACTED Mon Oct 23 14:34:01 2006 From: patrickerj@REDACTED (Pat e) Date: Mon, 23 Oct 2006 14:34:01 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: References: Message-ID: Sorry, :) HDF5 has that already.. I dont know if HDF is wise choice for user data storage?? Has anyone experience with Mnesia + HDF5? Thanks, Patrick Eerjavec On 10/23/06, Pat e wrote: > Is there something similar to Hierachichal Data Fromat written in Erlang? > They are using Pthreads, but not supportning multithreading. > > Patrick > > On 10/23/06, Ulf Wiger wrote: > > Den 2006-10-23 00:17:43 skrev Pat e : > > > > > BTW > > > After all is it wise to gamble (i know all of you will say it isn't :) > > > a site reputation and speed when all Mnesia sh#t blows up into your > > > face... but we need real time, and that is where Mnesia it seems > > > shines! > > > Why real time... well lets say you want AJAX tech implemented for all > > > future 5 million users, with all of them contacting each other RT, and > > > not have single glitch in delivery time and reliability (well > > > something like big phone switch operator), and also have for the ease > > > of use (LOL :) have user data on Mnesia disk tables ;) > > > > > > I know I'm boring, and that you talked about it many times, but if you > > > don't try - you don't fly (and if you fly, you can also dive easily > > > :=). > > > > That kind of attitude helps further the state of Open Source. > > What would we do without people who were willing to play on the > > bleeding edge? (: > > > > BR, > > Ulf W > > -- > > Ulf Wiger > > > From rvg@REDACTED Mon Oct 23 14:59:20 2006 From: rvg@REDACTED (Rudolph van Graan) Date: Mon, 23 Oct 2006 14:59:20 +0200 Subject: [erlang-questions] What does this mean? In-Reply-To: <17724.46202.479718.168097@alkaid.it.uu.se> References: <15FA01AC-2B24-4A4E-8DB2-00AD0AE96356@patternmatched.com> <17724.46202.479718.168097@alkaid.it.uu.se> Message-ID: <75498278-24A4-41C3-97E8-79FAE98FB869@patternmatched.com> Hey again, Is it possible for a corrupt mnesia table to trigger this error? Rudolph van Graan Software Architect Pattern Matched Technologies E-Mail: rvg@REDACTED Tel: 086 1000 700 (SA Only) Mobile: +27 83 390 7767 Fax: +27 12 665 9566 Web: www.patternmatched.com On Oct 23, 2006, at 2:24 PM, Mikael Pettersson wrote: > Rudolph van Graan writes: >> 1> TYPE ASSERTION FAILED, file beam/erl_term.c, line 105: >> tag_val_def: 0x18 > > It means that you should immediately prepare a bug report > containing at least the version of OTP you're using, the > environment in which it is being run (OS version), the > tools used to compile it (compiler and version), and a > recipe for reproducing the error. > > This message is potentially serious and must be investigated. > > /Mikael > From mikpe@REDACTED Mon Oct 23 15:42:44 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 23 Oct 2006 15:42:44 +0200 Subject: [erlang-questions] What does this mean? In-Reply-To: <75498278-24A4-41C3-97E8-79FAE98FB869@patternmatched.com> References: <15FA01AC-2B24-4A4E-8DB2-00AD0AE96356@patternmatched.com> <17724.46202.479718.168097@alkaid.it.uu.se> <75498278-24A4-41C3-97E8-79FAE98FB869@patternmatched.com> Message-ID: <17724.50900.888437.403027@alkaid.it.uu.se> Rudolph van Graan writes: > Hey again, > > Is it possible for a corrupt mnesia table to trigger this error? > > Rudolph van Graan > > Software Architect > Pattern Matched Technologies > > E-Mail: rvg@REDACTED > Tel: 086 1000 700 (SA Only) > Mobile: +27 83 390 7767 > Fax: +27 12 665 9566 > Web: www.patternmatched.com > > > On Oct 23, 2006, at 2:24 PM, Mikael Pettersson wrote: > > > Rudolph van Graan writes: > >> 1> TYPE ASSERTION FAILED, file beam/erl_term.c, line 105: > >> tag_val_def: 0x18 > > > > It means that you should immediately prepare a bug report > > containing at least the version of OTP you're using, the > > environment in which it is being run (OS version), the > > tools used to compile it (compiler and version), and a > > recipe for reproducing the error. > > > > This message is potentially serious and must be investigated. The message can be triggered by two different kinds of error: 1. A logic error in the BEAM runtime system causing it to access data using type-incorrect accessors. 2. Corrupt data that no longer matches the runtime system's expectations. I don't know enough about mnesia to comment on whether it could be the culprit here. /Mikael From valentin@REDACTED Mon Oct 23 16:06:58 2006 From: valentin@REDACTED (Valentin Micic) Date: Mon, 23 Oct 2006 16:06:58 +0200 Subject: [erlang-questions] What does this mean? References: <15FA01AC-2B24-4A4E-8DB2-00AD0AE96356@patternmatched.com><17724.46202.479718.168097@alkaid.it.uu.se><75498278-24A4-41C3-97E8-79FAE98FB869@patternmatched.com> <17724.50900.888437.403027@alkaid.it.uu.se> Message-ID: <008501c6f6ac$87f13ea0$6601a8c0@moneymaker2> Similar things were happening (more violently though -- core dump) before, when attempting to use binary_to_term for selected binary values. Could it be that you have a bunch of binary data that you're trying to convert back to erlang terms? V. ----- Original Message ----- From: "Mikael Pettersson" To: "Rudolph van Graan" Cc: "Erlang List" Sent: Monday, October 23, 2006 3:42 PM Subject: Re: [erlang-questions] What does this mean? > Rudolph van Graan writes: > > Hey again, > > > > Is it possible for a corrupt mnesia table to trigger this error? > > > > Rudolph van Graan > > > > Software Architect > > Pattern Matched Technologies > > > > E-Mail: rvg@REDACTED > > Tel: 086 1000 700 (SA Only) > > Mobile: +27 83 390 7767 > > Fax: +27 12 665 9566 > > Web: www.patternmatched.com > > > > > > On Oct 23, 2006, at 2:24 PM, Mikael Pettersson wrote: > > > > > Rudolph van Graan writes: > > >> 1> TYPE ASSERTION FAILED, file beam/erl_term.c, line 105: > > >> tag_val_def: 0x18 > > > > > > It means that you should immediately prepare a bug report > > > containing at least the version of OTP you're using, the > > > environment in which it is being run (OS version), the > > > tools used to compile it (compiler and version), and a > > > recipe for reproducing the error. > > > > > > This message is potentially serious and must be investigated. > > The message can be triggered by two different kinds of error: > 1. A logic error in the BEAM runtime system causing it to access > data using type-incorrect accessors. > 2. Corrupt data that no longer matches the runtime system's > expectations. > > I don't know enough about mnesia to comment on whether it > could be the culprit here. > > /Mikael > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From rvg@REDACTED Mon Oct 23 16:16:41 2006 From: rvg@REDACTED (Rudolph van Graan) Date: Mon, 23 Oct 2006 16:16:41 +0200 Subject: [erlang-questions] What does this mean? In-Reply-To: <008501c6f6ac$87f13ea0$6601a8c0@moneymaker2> References: <15FA01AC-2B24-4A4E-8DB2-00AD0AE96356@patternmatched.com><17724.46202.479718.168097@alkaid.it.uu.se><75498278-24A4-41C3-97E8-79FAE98FB869@patternmatched.com> <17724.50900.888437.403027@alkaid.it.uu.se> <008501c6f6ac$87f13ea0$6601a8c0@moneymaker2> Message-ID: <317E53C3-7797-4639-AACB-7D901667B892@patternmatched.com> Hey, The only code in the system that has a binary_to_term: ./mnesia/src/mnesia_lib.erl: Core = binary_to_term(Bin), ./mnesia/src/mnesia_tm.erl: Commit = binary_to_term(Bin), ./mnesia/src/mnesia_tm.erl: do_abort(Tid, binary_to_term(Bin)); ./mnesia/src/mnesia_tm.erl: do_commit(Tid, binary_to_term(Bin)); ./mnesia/src/mnesia_tm.erl: do_commit(Tid, binary_to_term(Bin), DumperMode); ./mnesia/src/mnesia_tm.erl: binary(Commit0) -> binary_to_term (Commit0); ./mnesia/src/mnesia_tm.erl: binary(Commit0) -> binary_to_term(Commit0); That is why I wondered about mnesia and corrupt tables. Rudolph van Graan Software Architect Pattern Matched Technologies E-Mail: rvg@REDACTED Tel: 086 1000 700 (SA Only) Mobile: +27 83 390 7767 Fax: +27 12 665 9566 Web: www.patternmatched.com On Oct 23, 2006, at 4:06 PM, Valentin Micic wrote: > Similar things were happening (more violently though -- core dump) > before, when attempting to use binary_to_term for selected binary > values. > Could it be that you have a bunch of binary data that you're trying > to convert back to erlang terms? > > V. > > ----- Original Message ----- From: "Mikael Pettersson" > > To: "Rudolph van Graan" > Cc: "Erlang List" > Sent: Monday, October 23, 2006 3:42 PM > Subject: Re: [erlang-questions] What does this mean? > > >> Rudolph van Graan writes: >> > Hey again, >> > >> > Is it possible for a corrupt mnesia table to trigger this error? >> > >> > Rudolph van Graan >> > >> > Software Architect >> > Pattern Matched Technologies >> > >> > E-Mail: rvg@REDACTED >> > Tel: 086 1000 700 (SA Only) >> > Mobile: +27 83 390 7767 >> > Fax: +27 12 665 9566 >> > Web: www.patternmatched.com >> > >> > >> > On Oct 23, 2006, at 2:24 PM, Mikael Pettersson wrote: >> > >> > > Rudolph van Graan writes: >> > >> 1> TYPE ASSERTION FAILED, file beam/erl_term.c, line 105: >> > >> tag_val_def: 0x18 >> > > >> > > It means that you should immediately prepare a bug report >> > > containing at least the version of OTP you're using, the >> > > environment in which it is being run (OS version), the >> > > tools used to compile it (compiler and version), and a >> > > recipe for reproducing the error. >> > > >> > > This message is potentially serious and must be investigated. >> >> The message can be triggered by two different kinds of error: >> 1. A logic error in the BEAM runtime system causing it to access >> data using type-incorrect accessors. >> 2. Corrupt data that no longer matches the runtime system's >> expectations. >> >> I don't know enough about mnesia to comment on whether it >> could be the culprit here. >> >> /Mikael >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > From valentin@REDACTED Mon Oct 23 16:32:49 2006 From: valentin@REDACTED (Valentin Micic) Date: Mon, 23 Oct 2006 16:32:49 +0200 Subject: [erlang-questions] What does this mean? References: <15FA01AC-2B24-4A4E-8DB2-00AD0AE96356@patternmatched.com><17724.46202.479718.168097@alkaid.it.uu.se><75498278-24A4-41C3-97E8-79FAE98FB869@patternmatched.com> <17724.50900.888437.403027@alkaid.it.uu.se> <008501c6f6ac$87f13ea0$6601a8c0@moneymaker2> <317E53C3-7797-4639-AACB-7D901667B892@patternmatched.com> Message-ID: <009701c6f6b0$271c9760$6601a8c0@moneymaker2> Natural question would be, I guess -- how do these tables got corrupted in a first place ;-). V. ----- Original Message ----- From: "Rudolph van Graan" To: "Valentin Micic" Cc: "Erlang List" Sent: Monday, October 23, 2006 4:16 PM Subject: Re: [erlang-questions] What does this mean? > Hey, > > The only code in the system that has a binary_to_term: > > ./mnesia/src/mnesia_lib.erl: Core = binary_to_term(Bin), > ./mnesia/src/mnesia_tm.erl: Commit = binary_to_term(Bin), > ./mnesia/src/mnesia_tm.erl: do_abort(Tid, binary_to_term(Bin)); > ./mnesia/src/mnesia_tm.erl: do_commit(Tid, binary_to_term(Bin)); > ./mnesia/src/mnesia_tm.erl: do_commit(Tid, binary_to_term(Bin), > DumperMode); > ./mnesia/src/mnesia_tm.erl: binary(Commit0) -> binary_to_term > (Commit0); > ./mnesia/src/mnesia_tm.erl: binary(Commit0) -> > binary_to_term(Commit0); > > That is why I wondered about mnesia and corrupt tables. > > Rudolph van Graan > > Software Architect > Pattern Matched Technologies > > E-Mail: rvg@REDACTED > Tel: 086 1000 700 (SA Only) > Mobile: +27 83 390 7767 > Fax: +27 12 665 9566 > Web: www.patternmatched.com > > > On Oct 23, 2006, at 4:06 PM, Valentin Micic wrote: > >> Similar things were happening (more violently though -- core dump) >> before, when attempting to use binary_to_term for selected binary >> values. >> Could it be that you have a bunch of binary data that you're trying to >> convert back to erlang terms? >> >> V. >> >> ----- Original Message ----- From: "Mikael Pettersson" >> To: "Rudolph van Graan" >> Cc: "Erlang List" >> Sent: Monday, October 23, 2006 3:42 PM >> Subject: Re: [erlang-questions] What does this mean? >> >> >>> Rudolph van Graan writes: >>> > Hey again, >>> > >>> > Is it possible for a corrupt mnesia table to trigger this error? >>> > >>> > Rudolph van Graan >>> > >>> > Software Architect >>> > Pattern Matched Technologies >>> > >>> > E-Mail: rvg@REDACTED >>> > Tel: 086 1000 700 (SA Only) >>> > Mobile: +27 83 390 7767 >>> > Fax: +27 12 665 9566 >>> > Web: www.patternmatched.com >>> > >>> > >>> > On Oct 23, 2006, at 2:24 PM, Mikael Pettersson wrote: >>> > >>> > > Rudolph van Graan writes: >>> > >> 1> TYPE ASSERTION FAILED, file beam/erl_term.c, line 105: >>> > >> tag_val_def: 0x18 >>> > > >>> > > It means that you should immediately prepare a bug report >>> > > containing at least the version of OTP you're using, the >>> > > environment in which it is being run (OS version), the >>> > > tools used to compile it (compiler and version), and a >>> > > recipe for reproducing the error. >>> > > >>> > > This message is potentially serious and must be investigated. >>> >>> The message can be triggered by two different kinds of error: >>> 1. A logic error in the BEAM runtime system causing it to access >>> data using type-incorrect accessors. >>> 2. Corrupt data that no longer matches the runtime system's >>> expectations. >>> >>> I don't know enough about mnesia to comment on whether it >>> could be the culprit here. >>> >>> /Mikael >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> > > From twanvds@REDACTED Mon Oct 23 16:48:07 2006 From: twanvds@REDACTED (twanvds@REDACTED) Date: Mon, 23 Oct 2006 16:48:07 +0200 (CEST) Subject: [erlang-questions] Using winpcap with Erlang Message-ID: <19404.83.80.64.66.1161614887.squirrel@webmail.xs4all.nl> Hi all, has anyone here experience with integrating Erlang and winpcap? I'm planning to develop an Erlang testing harness/framework for products with "embedded" ip interfaces. And I need to test low level ip. Is there any good reason /not/ to use Erlang + winpcap for this purpose. Can someone suggest an approach which is more likely to succeed? thanks regards. /Twan From mikpe@REDACTED Mon Oct 23 17:12:56 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 23 Oct 2006 17:12:56 +0200 (MEST) Subject: [erlang-questions] Bug in HiPE on x86-64? Message-ID: <200610231512.k9NFCudk011258@alkaid.it.uu.se> On Tue, 20 Jun 2006 17:52:31 +0200, Mikael Pettersson wrote: > Stefan Axelsson L \(LN/EAB\) writes: > > Hi, I'm seeing different behaviour depending on whether a module is > > compiled with HiPE and without, when I make a call with a function > > argument. It works when I wrap the function in an anonymous function > > though. Is this a feature or a bug? I've read the documentation and > > while there are a few differences noted, nothing really jumps out at me > > that would explain this (I'm a relative newbie to Erlang, so that's not > > to say isn't in there of course). > > > > Below are a few test cases that provoke the deviation. In the first case > > the evaluation succeeds and in the second I get an error message. > > Removing the -smp switch makes no difference. As mentioned, invoking the > > test as: "merge_sort:test_sort(1000000, 1, fun(N,Xs)-> > > merge_sort:merge_sort(N,Xs) end)/1000000." works, i.e. Produces the > > expected results. > > > > This is on an AMD Opteron x86-64. The code and details are included > > below. > ... > > sax@REDACTED:~/Erlang> erl -smp > > Erlang (BEAM) emulator version 5.5 [source] [64-bit] [smp:2] > > [async-threads:0] [hipe] > > > > Eshell V5.5 (abort with ^G) > > 1> c(merge_sort,native). > > {ok,merge_sort} > > 2> merge_sort:test_sort(1000000, 1, fun > > merge_sort:merge_sort/2)/1000000. > > ** exited: {{badfun,#Fun},[]} ** > > 3> > > =ERROR REPORT==== 20-Jun-2006::11:10:20 === > > Error in process <0.32.0> with exit value: > > {{badfun,#Fun},[]} > > I've reproduced this problem on 32-bit PowerPC. It's not dependent on > architecture or word size; instead, the issue appears to be that these > pseudo-closures (values of fun M:F/A expressions) aren't recognized by > HiPE-generated code as function values. > > Thanks for reporting this. We'll look into it. This bug has now been fixed, and HiPE should handle non-closure fun values correctly starting with R11B-2. As a bonus HiPE will also handle the old {M,F}-tuples-as-funs abomination correctly starting with R11B-2. /Mikael From rcbeerman@REDACTED Mon Oct 23 17:26:03 2006 From: rcbeerman@REDACTED (RCB) Date: Mon, 23 Oct 2006 08:26:03 -0700 Subject: [erlang-questions] What does this mean? In-Reply-To: <15FA01AC-2B24-4A4E-8DB2-00AD0AE96356@patternmatched.com> References: <15FA01AC-2B24-4A4E-8DB2-00AD0AE96356@patternmatched.com> Message-ID: I've seen this once in a moderately loaded, network i/o bound proxy-like application. The app was running on an epoll patched R10 release (I don't recall the exact version.) I quickly looked through the sources and eventually suspected the epoll patch as culprit. Since I never saw this before on an unpatched erlang system, I stopped using the epoll patch, and after some time, eventually migrated to R11. It never happened again. BTW, there was little or no disk activity on this erlang node, and mnesia was not running on this machine. Rich On 10/23/06, Rudolph van Graan wrote: > > 1> TYPE ASSERTION FAILED, file beam/erl_term.c, line 105: > tag_val_def: 0x18 > > -- Rich Beerman Cupertino, California mobile: 408/221-2444 fax: 408/255-7944 -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandrashekhar.mullaparthi@REDACTED Mon Oct 23 18:17:54 2006 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Mon, 23 Oct 2006 17:17:54 +0100 Subject: [erlang-questions] More SSL problems In-Reply-To: <4538E6D6.9000507@iit.edu> References: <4538E6D6.9000507@iit.edu> Message-ID: On 20/10/06, Jordan Wilberding wrote: > > It seems like whenever I ask a question about SSL I never get a straight > answer. Should SSL be completely working with Erlang/OTP? > > I have had problems getting ssl_dist to work, but even more oddly I seem > to randomly get the following error: > > [erlang@REDACTED test]$ erl -name test > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] > > Eshell V5.5 (abort with ^G) > (test@REDACTED)1> ssl:start(). > > =INFO REPORT==== 20-Oct-2006::11:04:58 === > application: ssl > exited: {shutdown,{ssl_app,start,[normal,[]]}} > type: temporary > {error,{shutdown,{ssl_app,start,[normal,[]]}}} > > It doesn't happen either, it just seems to come and go. Is SSL just flaky? Start the sasl application first. Then you might see some more meaningful error reports. cheers Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From yarivvv@REDACTED Mon Oct 23 18:44:16 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 23 Oct 2006 12:44:16 -0400 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: References: Message-ID: <17244f480610230944q4bc3c501h33ed413f32d057a0@mail.gmail.com> On 10/22/06, Pat e wrote: > BTW > After all is it wise to gamble (i know all of you will say it isn't :) > a site reputation and speed when all Mnesia sh#t blows up into your > face... but we need real time, and that is where Mnesia it seems > shines! > Why real time... well lets say you want AJAX tech implemented for all > future 5 million users, with all of them contacting each other RT, and > not have single glitch in delivery time and reliability (well > something like big phone switch operator), and also have for the ease > of use (LOL :) have user data on Mnesia disk tables ;) I disagree :) I know what you're thinking: MySQL = database Mnesia = database MySQL + Mnesia = 2 databases = SCARY However, this changes greatly when you change your thinking so that Mnesia = cache MySQL + Mnesia = database + cache = "easy, and everyone is doing it" (in fact, I believe I've heard of some popular hack called memcachd, no ? :) ) To build your app, all you need besides MySQL is one Mnesia table that holds {Node, UserId} tuples. When user A send tries to send a message to user B, you look up the tuple where UserId == B and then you go Node ! {msg, A, B, Msg} That's it. If you want to render HTML pages that display large amounts of data such as user profiles, etc, you user ErlyDB to write the horriby complex expression user:find_id(17) That's all there is to it. At least, that's my take on the problem (without knowing much about what the problem is) :) > > I know I'm boring, and that you talked about it many times, but if you > don't try - you don't fly (and if you fly, you can also dive easily > :=). And if you are going to fly, use a plane instead of hacking yourself a pair of wings :) BR Yariv From yerl@REDACTED Mon Oct 23 19:06:00 2006 From: yerl@REDACTED (Yerl) Date: Mon, 23 Oct 2006 19:06:00 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: <17244f480610230944q4bc3c501h33ed413f32d057a0@mail.gmail.com> References: <17244f480610230944q4bc3c501h33ed413f32d057a0@mail.gmail.com> Message-ID: <453CF678.9020401@club-internet.fr> An HTML attachment was scrubbed... URL: From yarivvv@REDACTED Mon Oct 23 19:18:04 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 23 Oct 2006 13:18:04 -0400 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: <453CF678.9020401@club-internet.fr> References: <17244f480610230944q4bc3c501h33ed413f32d057a0@mail.gmail.com> <453CF678.9020401@club-internet.fr> Message-ID: <17244f480610231018x6950362u4c95925051fa3a13@mail.gmail.com> Hi! I think memcached is the best cache available _assuming you're not using Erlang_, but if you are building an Erlang app, I can't see why you would want to use memcachd instead of Mnesia. - Mnesia runs in the same memory space as Yaws, which means it's insanely fast. - Mnesia is a piece of cake to use. - Mnesia is easy to reconfigure in runtime. - Mnesia simplifies your architecture because you don't need to install 3rd party components. - Mnesia has a lot of capabilities that memcached doesn't have, including disc_copy storage, ACID transactions, etc. If I were to build an Erlang webapp (which is purely hypothetical :) ) I wouldn't look past Mnesia. I can't see a reason to think that memcached is any better. Regards, Yariv On 10/23/06, Yerl wrote: > > Hi There! > I disagree too Yariv. > In this case, what just don't use the best cache available: memcached > (http://www.danga.com/memcached/) instead of Mnesia. > memcahched = cache > MySQL + memcahched = database + cache = "easy, and everyone need to do it" > > cheers > Youn?s > > > Yariv Sadan a ?crit : > On 10/22/06, Pat e wrote: > > > BTW > After all is it wise to gamble (i know all of you will say it isn't :) > a site reputation and speed when all Mnesia sh#t blows up into your > face... but we need real time, and that is where Mnesia it seems > shines! > Why real time... well lets say you want AJAX tech implemented for all > future 5 million users, with all of them contacting each other RT, and > not have single glitch in delivery time and reliability (well > something like big phone switch operator), and also have for the ease > of use (LOL :) have user data on Mnesia disk tables ;) > > I disagree :) > > I know what you're thinking: > > MySQL = database > Mnesia = database > MySQL + Mnesia = 2 databases = SCARY > > However, this changes greatly when you change your thinking so that > > Mnesia = cache > MySQL + Mnesia = database + cache = "easy, and everyone is doing it" > > (in fact, I believe I've heard of some popular hack called memcachd, no ? :) > ) > > To build your app, all you need besides MySQL is one Mnesia table that > holds {Node, UserId} tuples. When user A send tries to send a message > to user B, you look up the tuple where UserId == B and then you go > > Node ! {msg, A, B, Msg} > > That's it. If you want to render HTML pages that display large amounts > of data such as user profiles, etc, you user ErlyDB to write the > horriby complex expression > > user:find_id(17) > > That's all there is to it. > > At least, that's my take on the problem (without knowing much about > what the problem is) :) > > > > > > I know I'm boring, and that you talked about it many times, but if you > don't try - you don't fly (and if you fly, you can also dive easily > :=). > > And if you are going to fly, use a plane instead of hacking yourself a > pair of wings :) > > BR > Yariv > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > From yerl@REDACTED Mon Oct 23 19:38:26 2006 From: yerl@REDACTED (Yerl) Date: Mon, 23 Oct 2006 19:38:26 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: <17244f480610231018x6950362u4c95925051fa3a13@mail.gmail.com> References: <17244f480610230944q4bc3c501h33ed413f32d057a0@mail.gmail.com> <453CF678.9020401@club-internet.fr> <17244f480610231018x6950362u4c95925051fa3a13@mail.gmail.com> Message-ID: <453CFE12.10803@club-internet.fr> Hi! > I think memcached is the best cache available _assuming you're not > using Erlang_, but if you are building an Erlang app, I can't see why > you would want to use memcachd instead of Mnesia. > > - Mnesia runs in the same memory space as Yaws, which means it's > insanely fast. > - Mnesia is a piece of cake to use. > - Mnesia is easy to reconfigure in runtime. > - Mnesia simplifies your architecture because you don't need to > install 3rd party components. > - Mnesia has a lot of capabilities that memcached doesn't have, > including disc_copy storage, ACID transactions, etc. > Completely agree with you on these points if you only work in Erlang world. At work, we need the best sofware for the best task. Our code is mainly written in C/C++. > If I were to build an Erlang webapp (which is purely hypothetical :) ) > I wouldn't look past Mnesia. I can't see a reason to think that > memcached is any better. > What the experience showed me is to never say that thing is better than another one before doing some benchmarks. As what we supposed with Yaws (don't miss understand me, I like and use Yaws at work, at home , anywhere ;-) ) the first time we've use it, Zeus WS is 3/2 times faster on static/dynamic content (our production web server is about 10 times faster). Did you really play with memcached before? It's incredibly fast and reliable piece of code. cheers Youn?s > Regards, > Yariv > > > On 10/23/06, Yerl wrote: >> >> Hi There! >> I disagree too Yariv. >> In this case, what just don't use the best cache available: memcached >> (http://www.danga.com/memcached/) instead of Mnesia. >> memcahched = cache >> MySQL + memcahched = database + cache = "easy, and everyone need to >> do it" >> >> cheers >> Youn?s >> >> >> Yariv Sadan a ?crit : >> On 10/22/06, Pat e wrote: >> >> >> BTW >> After all is it wise to gamble (i know all of you will say it isn't :) >> a site reputation and speed when all Mnesia sh#t blows up into your >> face... but we need real time, and that is where Mnesia it seems >> shines! >> Why real time... well lets say you want AJAX tech implemented for all >> future 5 million users, with all of them contacting each other RT, and >> not have single glitch in delivery time and reliability (well >> something like big phone switch operator), and also have for the ease >> of use (LOL :) have user data on Mnesia disk tables ;) >> >> I disagree :) >> >> I know what you're thinking: >> >> MySQL = database >> Mnesia = database >> MySQL + Mnesia = 2 databases = SCARY >> >> However, this changes greatly when you change your thinking so that >> >> Mnesia = cache >> MySQL + Mnesia = database + cache = "easy, and everyone is doing it" >> >> (in fact, I believe I've heard of some popular hack called memcachd, >> no ? :) >> ) >> >> To build your app, all you need besides MySQL is one Mnesia table that >> holds {Node, UserId} tuples. When user A send tries to send a message >> to user B, you look up the tuple where UserId == B and then you go >> >> Node ! {msg, A, B, Msg} >> >> That's it. If you want to render HTML pages that display large amounts >> of data such as user profiles, etc, you user ErlyDB to write the >> horriby complex expression >> >> user:find_id(17) >> >> That's all there is to it. >> >> At least, that's my take on the problem (without knowing much about >> what the problem is) :) >> >> >> >> >> >> I know I'm boring, and that you talked about it many times, but if you >> don't try - you don't fly (and if you fly, you can also dive easily >> :=). >> >> And if you are going to fly, use a plane instead of hacking yourself a >> pair of wings :) >> >> BR >> Yariv >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> >> >> >> > > From patrickerj@REDACTED Mon Oct 23 19:40:21 2006 From: patrickerj@REDACTED (Pat e) Date: Mon, 23 Oct 2006 19:40:21 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: <17244f480610230944q4bc3c501h33ed413f32d057a0@mail.gmail.com> References: <17244f480610230944q4bc3c501h33ed413f32d057a0@mail.gmail.com> Message-ID: Is Erlang Memcached finished? Patrick On 10/23/06, Yariv Sadan wrote: > On 10/22/06, Pat e wrote: > > BTW > > After all is it wise to gamble (i know all of you will say it isn't :) > > a site reputation and speed when all Mnesia sh#t blows up into your > > face... but we need real time, and that is where Mnesia it seems > > shines! > > Why real time... well lets say you want AJAX tech implemented for all > > future 5 million users, with all of them contacting each other RT, and > > not have single glitch in delivery time and reliability (well > > something like big phone switch operator), and also have for the ease > > of use (LOL :) have user data on Mnesia disk tables ;) > > I disagree :) > > I know what you're thinking: > > MySQL = database > Mnesia = database > MySQL + Mnesia = 2 databases = SCARY > > However, this changes greatly when you change your thinking so that > > Mnesia = cache > MySQL + Mnesia = database + cache = "easy, and everyone is doing it" > > (in fact, I believe I've heard of some popular hack called memcachd, no ? :) ) > > To build your app, all you need besides MySQL is one Mnesia table that > holds {Node, UserId} tuples. When user A send tries to send a message > to user B, you look up the tuple where UserId == B and then you go > > Node ! {msg, A, B, Msg} > > That's it. If you want to render HTML pages that display large amounts > of data such as user profiles, etc, you user ErlyDB to write the > horriby complex expression > > user:find_id(17) > > That's all there is to it. > > At least, that's my take on the problem (without knowing much about > what the problem is) :) > > > > > > > I know I'm boring, and that you talked about it many times, but if you > > don't try - you don't fly (and if you fly, you can also dive easily > > :=). > > And if you are going to fly, use a plane instead of hacking yourself a > pair of wings :) > > BR > Yariv > From yarivvv@REDACTED Mon Oct 23 19:45:44 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 23 Oct 2006 13:45:44 -0400 Subject: [erlang-questions] MySQL driver update Message-ID: <17244f480610231045o77246d23lfcc770ae919ba343@mail.gmail.com> Hi, I fixed a (relatively minor) bug in the Revamped driver, where the logging function wasn't properly called in mysql_recv.erl. You can get the fix from the 0.9.6 branch. Cheers, Yariv From yarivvv@REDACTED Mon Oct 23 19:50:18 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 23 Oct 2006 13:50:18 -0400 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: <453CFE12.10803@club-internet.fr> References: <17244f480610230944q4bc3c501h33ed413f32d057a0@mail.gmail.com> <453CF678.9020401@club-internet.fr> <17244f480610231018x6950362u4c95925051fa3a13@mail.gmail.com> <453CFE12.10803@club-internet.fr> Message-ID: <17244f480610231050n2b02d482ve7ae8946957c9390@mail.gmail.com> Hi, > Completely agree with you on these points if you only work in Erlang world. > At work, we need the best sofware for the best task. Our code is mainly > written in C/C++. Yes, from C/C++, it makes total sense to use memcached. Btw, by saying 'hack' I didn't mean to suggest that memcached is a bad piece of software, but that many web frameworks have to use it because their languages don't have something as cool as Mnesia :) > > If I were to build an Erlang webapp (which is purely hypothetical :) ) > > I wouldn't look past Mnesia. I can't see a reason to think that > > memcached is any better. > > > What the experience showed me is to never say that thing is better than > another one before doing some benchmarks. > As what we supposed with Yaws (don't miss understand me, I like and use > Yaws at work, at home , anywhere ;-) ) the first time we've use it, Zeus > WS is 3/2 times faster on static/dynamic content (our production web > server is about 10 times faster). >From my experience, it's also hard to compare benchmarks. Are the pages identical? How is the dynamic content generated (ehtml, ErlTL, etc)? What kind of database drivers are involved? There are so many moving parts to a webapp that it's often hard to isolate the real reasons for performance differences. Cheers, Yariv From patrickerj@REDACTED Mon Oct 23 19:57:41 2006 From: patrickerj@REDACTED (Pat e) Date: Mon, 23 Oct 2006 19:57:41 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: <17244f480610231018x6950362u4c95925051fa3a13@mail.gmail.com> References: <17244f480610230944q4bc3c501h33ed413f32d057a0@mail.gmail.com> <453CF678.9020401@club-internet.fr> <17244f480610231018x6950362u4c95925051fa3a13@mail.gmail.com> Message-ID: Also for example if we wanted to have Mnesia RAM-only serving (if it can serve tables on 128GB RAM machine - that will have to be benchmaked.....!! :) ) - with MySQL backing up data what would be the path best threaded - if it's safe to thread that path at all.. :) Patrick On 10/23/06, Yariv Sadan wrote: > Hi! > > I think memcached is the best cache available _assuming you're not > using Erlang_, but if you are building an Erlang app, I can't see why > you would want to use memcachd instead of Mnesia. > > - Mnesia runs in the same memory space as Yaws, which means it's insanely fast. > - Mnesia is a piece of cake to use. > - Mnesia is easy to reconfigure in runtime. > - Mnesia simplifies your architecture because you don't need to > install 3rd party components. > - Mnesia has a lot of capabilities that memcached doesn't have, > including disc_copy storage, ACID transactions, etc. > > If I were to build an Erlang webapp (which is purely hypothetical :) ) > I wouldn't look past Mnesia. I can't see a reason to think that > memcached is any better. > > Regards, > Yariv > > > On 10/23/06, Yerl wrote: > > > > Hi There! > > I disagree too Yariv. > > In this case, what just don't use the best cache available: memcached > > (http://www.danga.com/memcached/) instead of Mnesia. > > memcahched = cache > > MySQL + memcahched = database + cache = "easy, and everyone need to do it" > > > > cheers > > Youn?s > > > > > > Yariv Sadan a ?crit : > > On 10/22/06, Pat e wrote: > > > > > > BTW > > After all is it wise to gamble (i know all of you will say it isn't :) > > a site reputation and speed when all Mnesia sh#t blows up into your > > face... but we need real time, and that is where Mnesia it seems > > shines! > > Why real time... well lets say you want AJAX tech implemented for all > > future 5 million users, with all of them contacting each other RT, and > > not have single glitch in delivery time and reliability (well > > something like big phone switch operator), and also have for the ease > > of use (LOL :) have user data on Mnesia disk tables ;) > > > > I disagree :) > > > > I know what you're thinking: > > > > MySQL = database > > Mnesia = database > > MySQL + Mnesia = 2 databases = SCARY > > > > However, this changes greatly when you change your thinking so that > > > > Mnesia = cache > > MySQL + Mnesia = database + cache = "easy, and everyone is doing it" > > > > (in fact, I believe I've heard of some popular hack called memcachd, no ? :) > > ) > > > > To build your app, all you need besides MySQL is one Mnesia table that > > holds {Node, UserId} tuples. When user A send tries to send a message > > to user B, you look up the tuple where UserId == B and then you go > > > > Node ! {msg, A, B, Msg} > > > > That's it. If you want to render HTML pages that display large amounts > > of data such as user profiles, etc, you user ErlyDB to write the > > horriby complex expression > > > > user:find_id(17) > > > > That's all there is to it. > > > > At least, that's my take on the problem (without knowing much about > > what the problem is) :) > > > > > > > > > > > > I know I'm boring, and that you talked about it many times, but if you > > don't try - you don't fly (and if you fly, you can also dive easily > > :=). > > > > And if you are going to fly, use a plane instead of hacking yourself a > > pair of wings :) > > > > BR > > Yariv > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > From rath64@REDACTED Mon Oct 23 20:24:28 2006 From: rath64@REDACTED (Tim Rath) Date: Mon, 23 Oct 2006 13:24:28 -0500 (CDT) Subject: [erlang-questions] Fw: Berkely DB was: MySQL cluster Message-ID: <2007525.886311161627869068.JavaMail.root@vms073.mailsrvcs.net> I've been using Berkeley Db from Erlang for a while now, and contrary to Emil's analysis, I think it is an excellent choice, (we're basing a major project on it.) We're also using their high availability clustering support. That said, there are some drawbacks to be aware of. First I'll assume you are familiar with Berkeley DB, and so understand the trade-offs between using it and a sql based alternative. Given that, the first thing that you will find is the lack of a good Erlang driver. My collegue is working on changing that. He is in the process of getting his internal (to our company) Bdb driver approved for open sourcing, and (I think) is in the final stages, so hopefully that will be available soon. Next, it really helps to know a lot about the Berkeley Db products, and a relationship with the Sleepycat folks doesn't hurt either (well, we're using their very latest and greatest feature support, so we go back and forth with them all the time - if you stick to the tried and true, this is not so necessary.) And beyond the high availability clustering support, which will get you to a certain scale, (it is a single master solution), further distributed (e.g. partitioning) support is all up to you to provide. Thus far, we've been very happy with it as a solution. We selected it based on in-house expertise with Berkeley Db though. If you are a MySql expert, and know nothing about Berkeley Db, the draw might not be so great. I'll privately mail my collegue to see if he has any more advice to offer you. He wrote all of the Erlang Bdb support, and knows leagues more about Bdb than I. -Tim >From: Valentin Micic >Date: 2006/10/21 Sat AM 09:01:53 CDT >To: t ty >Cc: erlang-questions@REDACTED >Subject: Re: [erlang-questions] Fw: Berkely DB was: MySQL cluster >No offence, I've read Emil's document, and as much as I appreciate his >comparative analysis, I was hoping to get feedback from somebody that is >actually using it. > >V. > >----- Original Message ----- >From: "t ty" >To: "Valentin Micic" >Cc: >Sent: Saturday, October 21, 2006 3:54 PM >Subject: Re: [erlang-questions] Fw: Berkely DB was: MySQL cluster > > >> Emil's paper "Evaluation of Database Management Systems for Erlang" at >> >> http://www.erlang-consulting.com/aboutus/erlangarticles.html >> >> covers some of the issues. >> >> t >> >> On 10/21/06, Valentin Micic wrote: >>> Could anyone indicate what are main issues with Berkeley DB, assuming >>> that >>> one does not require SQL nor flexible data-model? >>> Thanks in advance. >>> >>> V. >>> >>> > ----- Original Message ----- >>> > From: "Roberto Saccon" >>> > To: "Christian S" >>> > Cc: >>> > Sent: Friday, October 20, 2006 7:18 PM >>> > Subject: Re: [erlang-questions] MySQL cluster >>> > >>> > >>> >>I had the same question and I am currently investigating in using >>> >> mnesia just as cache for a clustered web application running on amazon >>> >> EC2 and the real storage is on amazon S3 (which is kind of Berkley DB >>> >> webservice) and capable to store any number of TBs ... >>> >> >>> >> On 10/20/06, Christian S wrote: >>> >>> On 10/20/06, Dmitrii Dimandt wrote: >>> >>> > What's the optimum maximum size for Mnesia then? A bout a couple of >>> >>> > gigabytes? Or more? >>> >>> >>> >>> What should such a number for maximum size try to optimize? >>> >>> >>> >>> A note about picking database after storage size needs: >>> >>> >>> >>> Using mnesia instead of an external database always have advantages >>> >>> in >>> >>> terms of "impedance matching" (Mnesia has erlang's datatypes by >>> >>> virtue >>> >>> of being erlang and you can query mnesia faster than anything >>> >>> connected to through tcp). This often makes it worthwile to hack >>> >>> around mnesia to store some data outside of it. >>> >>> >>> >>> One would easily reach a storage size of 1Tb for a site like flickr. >>> >>> Does that mean mnesia wouldnt be sufficient for building such a site? >>> >>> Or perhaps it could be a good idea to build an application that >>> >>> replicates images across nodes outside of mnesia, and have mnesia >>> >>> store small image ids to reference them. >>> >>> _______________________________________________ >>> >>> erlang-questions mailing list >>> >>> erlang-questions@REDACTED >>> >>> http://www.erlang.org/mailman/listinfo/erlang-questions >>> >>> >>> >> >>> >> >>> >> -- >>> >> Roberto Saccon >>> >> _______________________________________________ >>> >> erlang-questions mailing list >>> >> erlang-questions@REDACTED >>> >> http://www.erlang.org/mailman/listinfo/erlang-questions >>> > >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://www.erlang.org/mailman/listinfo/erlang-questions >>> > >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://www.erlang.org/mailman/listinfo/erlang-questions From yan.guiborat@REDACTED Mon Oct 23 22:34:27 2006 From: yan.guiborat@REDACTED (netboz) Date: Mon, 23 Oct 2006 13:34:27 -0700 (PDT) Subject: [erlang-questions] edtk under windows Message-ID: <6961495.post@talk.nabble.com> Hi again, Is someone aware if EDTK is working under win32 systems ? I hear from here to there that it isn't. I have seen Valentin wrote that it isn't working but that there is few to do to make it so. Moreover, I know ESDL is working under win32 systems (because wings3D is working), so may be it is working... I guess I should discover by myself if it is or not working ;-) but anyway any clue would be thanksfully welcome. please help me Netboz -- View this message in context: http://www.nabble.com/edtk-under-windows-tf2497344.html#a6961495 Sent from the Erlang Questions mailing list archive at Nabble.com. From klacke@REDACTED Mon Oct 23 22:40:24 2006 From: klacke@REDACTED (Claes Wikstrom) Date: Mon, 23 Oct 2006 22:40:24 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: <17244f480610231050n2b02d482ve7ae8946957c9390@mail.gmail.com> References: <17244f480610230944q4bc3c501h33ed413f32d057a0@mail.gmail.com> <453CF678.9020401@club-internet.fr> <17244f480610231018x6950362u4c95925051fa3a13@mail.gmail.com> <453CFE12.10803@club-internet.fr> <17244f480610231050n2b02d482ve7ae8946957c9390@mail.gmail.com> Message-ID: <453D28B8.2000509@hyber.org> Yariv Sadan wrote: >> As what we supposed with Yaws (don't miss understand me, I like and use >> Yaws at work, at home , anywhere ;-) ) the first time we've use it, Zeus >> WS is 3/2 times faster on static/dynamic content (our production web >> server is about 10 times faster). Zeus is certainly faster than yaws on static content - a lot of web servers are. I do however have a really hard time to believe that any web server is faster than yaws on dynamic content. Yaws has the dyn-content producer so tightly integrated inside the actual web server so in order do better than yaws on dynamic content we would have to 1. implement in C 2. do not use OS thread, use event loop + state machine 3. integrate dynlanguage (php ??) inside the web server loop and precompile (JIT) the php pages 4. Write a proper php compiler which produces assembly code. (and even worse - if we compare to the yaws_api:ehtml_expander which is a small partial evaluator which is built into the HTML producer. It's not especially easy to use and few people use it but it is worth the effort when we want to squeeze those extra cycles) A lot of work that is. Lats time I measured was on apache2 + php and yaws was running circles around it. Maybe time to redo that and publish results. /klacke From klacke@REDACTED Mon Oct 23 22:45:47 2006 From: klacke@REDACTED (Claes Wikstrom) Date: Mon, 23 Oct 2006 22:45:47 +0200 Subject: [erlang-questions] Fw: Berkely DB was: MySQL cluster In-Reply-To: <2007525.886311161627869068.JavaMail.root@vms073.mailsrvcs.net> References: <2007525.886311161627869068.JavaMail.root@vms073.mailsrvcs.net> Message-ID: <453D29FB.4050707@hyber.org> Tim Rath wrote: > I've been using Berkeley Db from Erlang for a while now, A good driver for bdb is sorely missing. I think a lot of people would use that from erlang. A lot of the time SQL tables are ... well overly complicated to use from erlang. Using a bdb driver (or gdbm, but bdb is much better) you'd typically just store terms and if the terms are reasonably arranged, making app specific searches is both fast and easy. Please make that extra effort and release it. Cheers /klacke From yerl@REDACTED Tue Oct 24 00:26:24 2006 From: yerl@REDACTED (Yerl) Date: Tue, 24 Oct 2006 00:26:24 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: <453D28B8.2000509@hyber.org> References: <17244f480610230944q4bc3c501h33ed413f32d057a0@mail.gmail.com> <453CF678.9020401@club-internet.fr> <17244f480610231018x6950362u4c95925051fa3a13@mail.gmail.com> <453CFE12.10803@club-internet.fr> <17244f480610231050n2b02d482ve7ae8946957c9390@mail.gmail.com> <453D28B8.2000509@hyber.org> Message-ID: <453D4190.8000200@club-internet.fr> Hi guys! > Zeus is certainly faster than yaws on static content - a lot of web > servers > are. I do however have a really hard time to believe that any web > server is > faster than yaws on dynamic content. > Zeus do all its cooking in kernel space and reduce to the max context switching between user and kernel space. You can't go faster than that. It's simply impossible Claes. Add whatever you want to Yaws, and do it for years, you'll never reach kernel space speed. Sorry for this bad news. > Yaws has the dyn-content producer so tightly integrated inside the > actual web server so in order do better than yaws on dynamic content > we would have to > > 1. implement in C What's the problem with C? Erlang is in C? Unix(-like) are in C? Even Plan9 is in C (almost)? Do you know anything better than Plan9? Any good thing is in C and after that in Erlang ;-) I've no objection against C. It's a problem for people comming from very high level languages without good OS/compiler knowledges. Our team (very little team, just 2 motivated persons) developped a C API with a complete OOP style support. We have classes, inheritance, composition, exception handling, objects persistence, and ultra optimized set of data structures. Our moto is simple: "optimize for small size" (nothing more than 10Kb). Ah I forget the main component, our memory manger (~600 bytes). With it, we can allocate more than 200M objects per/sec in very very cheap today machine (~0 cache misses). It's almost the perfect language (after Fortran 66* of course ;-) see note below) > 2. do not use OS thread, use event loop + state machine Yes, never use OS thread. I'm using libevent instead. For state machine, I'm using a stacked st. > 3. integrate dynlanguage (php ??) inside the web server loop > and precompile (JIT) the php pages No, not necessary in my case. Using so high level language will introduce unpredictable behaviours. > 4. Write a proper php compiler which produces assembly code. > > (and even worse - if we compare to the yaws_api:ehtml_expander > which is a small partial evaluator which is built into the > HTML producer. It's not especially easy to use and few people use it > but it is worth the effort when we want to squeeze those extra cycles) > > I agree with you Claes. What I want to explain is simple. Using a generic API could perform well, but using a specific, thighted API is the best when you're looking for maximum performance. Note: * Fortran 66: if you can read in French, see: http://www.systella.fr/~bertrand/veritable.html cheers Youn?s From valentin@REDACTED Tue Oct 24 01:10:10 2006 From: valentin@REDACTED (Valentin Micic) Date: Tue, 24 Oct 2006 01:10:10 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL References: <17244f480610230944q4bc3c501h33ed413f32d057a0@mail.gmail.com> <453CF678.9020401@club-internet.fr> <17244f480610231018x6950362u4c95925051fa3a13@mail.gmail.com> <453CFE12.10803@club-internet.fr><17244f480610231050n2b02d482ve7ae8946957c9390@mail.gmail.com><453D28B8.2000509@hyber.org> <453D4190.8000200@club-internet.fr> Message-ID: <010e01c6f6f8$65dafad0$6601a8c0@moneymaker2> Helo? Is this thread still about mnesia & MySQL? V. ----- Original Message ----- From: "Yerl" To: "Claes Wikstrom" ; "Yariv Sadan" ; "Pat e" ; Sent: Tuesday, October 24, 2006 12:26 AM Subject: Re: [erlang-questions] MySQL cluster - MnesiaXXL Hi guys! > Zeus is certainly faster than yaws on static content - a lot of web > servers > are. I do however have a really hard time to believe that any web > server is > faster than yaws on dynamic content. > Zeus do all its cooking in kernel space and reduce to the max context switching between user and kernel space. You can't go faster than that. It's simply impossible Claes. Add whatever you want to Yaws, and do it for years, you'll never reach kernel space speed. Sorry for this bad news. > Yaws has the dyn-content producer so tightly integrated inside the > actual web server so in order do better than yaws on dynamic content > we would have to > > 1. implement in C What's the problem with C? Erlang is in C? Unix(-like) are in C? Even Plan9 is in C (almost)? Do you know anything better than Plan9? Any good thing is in C and after that in Erlang ;-) I've no objection against C. It's a problem for people comming from very high level languages without good OS/compiler knowledges. Our team (very little team, just 2 motivated persons) developped a C API with a complete OOP style support. We have classes, inheritance, composition, exception handling, objects persistence, and ultra optimized set of data structures. Our moto is simple: "optimize for small size" (nothing more than 10Kb). Ah I forget the main component, our memory manger (~600 bytes). With it, we can allocate more than 200M objects per/sec in very very cheap today machine (~0 cache misses). It's almost the perfect language (after Fortran 66* of course ;-) see note below) > 2. do not use OS thread, use event loop + state machine Yes, never use OS thread. I'm using libevent instead. For state machine, I'm using a stacked st. > 3. integrate dynlanguage (php ??) inside the web server loop > and precompile (JIT) the php pages No, not necessary in my case. Using so high level language will introduce unpredictable behaviours. > 4. Write a proper php compiler which produces assembly code. > > (and even worse - if we compare to the yaws_api:ehtml_expander > which is a small partial evaluator which is built into the > HTML producer. It's not especially easy to use and few people use it > but it is worth the effort when we want to squeeze those extra cycles) > > I agree with you Claes. What I want to explain is simple. Using a generic API could perform well, but using a specific, thighted API is the best when you're looking for maximum performance. Note: * Fortran 66: if you can read in French, see: http://www.systella.fr/~bertrand/veritable.html cheers Youn?s _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From klacke@REDACTED Tue Oct 24 08:01:55 2006 From: klacke@REDACTED (Claes Wikstrom) Date: Tue, 24 Oct 2006 08:01:55 +0200 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: <453D4190.8000200@club-internet.fr> References: <17244f480610230944q4bc3c501h33ed413f32d057a0@mail.gmail.com> <453CF678.9020401@club-internet.fr> <17244f480610231018x6950362u4c95925051fa3a13@mail.gmail.com> <453CFE12.10803@club-internet.fr> <17244f480610231050n2b02d482ve7ae8946957c9390@mail.gmail.com> <453D28B8.2000509@hyber.org> <453D4190.8000200@club-internet.fr> Message-ID: <453DAC53.6010009@hyber.org> Yerl wrote: > > Zeus do all its cooking in kernel space and reduce to the max context > switching between user and kernel space. > You can't go faster than that. What's so good about generating dynamic content in kernel? Why would that be faster ? Is the dynamic-content-lang-interpreter in kernel too ? Sounds bad/flaky > What's the problem with C? Nothing - I love C. > Erlang is in C? I know - I wrote large parts of that C code. /klacke From zoltan.peter.toth@REDACTED Tue Oct 24 11:06:11 2006 From: zoltan.peter.toth@REDACTED (Zoltan Peter Toth) Date: Tue, 24 Oct 2006 11:06:11 +0200 Subject: [erlang-questions] SMP: per-scheduler proc. info Message-ID: <453DD783.8080309@ericsson.com> Hi, An SMP question: Is there any possibility to query the number of erlang processes allocated to a particular scheduler ? Maybe even a list of those PIDs ? Is it so that a process is allocated to a scheduler at creation and never reallocated later ? Thx, Zoltan From bjorn@REDACTED Tue Oct 24 12:02:17 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 24 Oct 2006 12:02:17 +0200 Subject: [erlang-questions] SMP: per-scheduler proc. info In-Reply-To: <453DD783.8080309@ericsson.com> References: <453DD783.8080309@ericsson.com> Message-ID: Zoltan Peter Toth writes: > Hi, > > An SMP question: > Is there any possibility to query the number of erlang processes > allocated to a particular > scheduler ? Maybe even a list of those PIDs ? > No. > Is it so that a process is allocated to a scheduler at creation and > never reallocated later ? > No, it's not. The next ready scheduler thread will run the next runnable process. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From arndt@REDACTED Tue Oct 24 16:28:57 2006 From: arndt@REDACTED (Arndt Jonasson) Date: Tue, 24 Oct 2006 16:28:57 +0200 Subject: [erlang-questions] xmerl and DTD Message-ID: <17726.9001.351186.990909@jurij2.tail-f.com> I have problems using xmerl to validate an XML document using a DTD. The DTD looks like this: The document looks like this: When I do xmerl_scan:file("test.xml", [{doctype_DTD, "test.dtd"}, {validation, true}]) I get this crash: 535- fatal: {failed_validation,{function_clause, [{xmerl_validate, choice, [[b,c], [], 37, remove, {xmerl_scanner, undefined, no, ... If I change the a1 elements in the document to a2 (i.e., using a simpler DTD element rule), the scan+validation work. If I remove all whitespace in the a1 document, it works too. If my document looks like this: it works too. So whitespace as such seems not to be the problem, but it is not tolerated at one particular point. ('xmllint' declares the original document valid, by the way.) Am I doing something wrong, have misunderstood something, or is this a bug in xmerl? From chandrashekhar.mullaparthi@REDACTED Tue Oct 24 19:16:14 2006 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Tue, 24 Oct 2006 18:16:14 +0100 Subject: [erlang-questions] [Fwd: Message passing benchmark on smp emulator] In-Reply-To: <440DBA4A.60700@ericsson.com> References: <440DBA4A.60700@ericsson.com> Message-ID: Hi, I tried this benchmark on a 8-CPU (4 dual core) AMD Opteron server running Solaris 10. Here are the results. It looks pretty good. elastigirl:chandru 92 # /usr/local/otp_R11B-1/bin/erl -smp Erlang (BEAM) emulator version 5.5.1 [source] [64-bit] [smp:8] [async-threads:0] Eshell V5.5.1 (abort with ^G) 1> big:bang(50). 16759 % 16 ms 2> big:bang(100). 100620 % 100 ms 3> big:bang(300). 927302 % 927 ms 4> big:bang(500). 2384194 % 2.4 secs 5> big:bang(600). 3780862 % 3.8 secs 6> big:bang(700). 5359640 % 5.3 secs 7> big:bang(800). 7995201 % 8 secs 8> big:bang(900). 9918226 % 9.9 secs 9> big:bang(1000). 14688772 % 14.6 secs 11> big:bang(2000). 111368322 % 111 secs cheers Chandru On 07/03/06, Rickard Green wrote: > > Trying again... > > -------- Original Message -------- > Subject: Message passing benchmark on smp emulator > Date: Tue, 07 Mar 2006 17:30:40 +0100 > From: Rickard Green > Newsgroups: erix.mailing-list.erlang-questions > > The message passing benchmark used in estone (and bstone) isn't very > well suited for the smp emulator since it sends a message in a ring > (more or less only 1 process runnable all the time). > > In order to be able to take advantage of an smp emulator I wrote another > message passing benchmark. In this benchmark all participating processes > sends a message to all processes and waits for replies on the sent > messages. > > I've attached the benchmark. Run like this: > big:bang(NoOfParticipatingProcesses). > > I ran the benchmark on a machine with two hyperthreaded Xeon 2.40GHz > processors. > > big:bang(50): > * r10b completed after about 0.014 seconds. > * p11b with 4 schedulers completed after about 0.018 seconds. > > big:bang(100): > * r10b completed after about 0.088 seconds. > * p11b with 4 schedulers completed after about 0.088 seconds. > > big:bang(300): > * r10b completed after about 2.6 seconds. > * p11b with 4 schedulers completed after about 1.0 seconds. > > big:bang(500): > * r10b completed after about 10.7 seconds. > * p11b with 4 schedulers completed after about 3.5 seconds. > > big:bang(600): > * r10b completed after about 18.0 seconds. > * p11b with 4 schedulers completed after about 5.8 seconds. > > big:bang(700): > * r10b completed after about 27.0 seconds. > * p11b with 4 schedulers completed after about 9.3 seconds. > > Quite a good result I guess. > > Note that this is a special case and these kind of speedups are not > expected for an arbitrary Erlang program. > > If you want to try yourself download a P11B snapshot at: > http://www.erlang.org/download/snapshots/ > remember to enable smp support: > ./configure --enable-smp-support --disable-lock-checking > > You can change the number of schedulers used by passing the > +S command line argument to erl or by calling: > erlang:system_flag(schedulers, NoOfSchedulers) -> {ok|PosixError, > CurrentNo, OldNo} > > /Rickard Green, Erlang/OTP > > > > > %%%------------------------------------------------------------------- > %%% File : big.erl > %%% Author : Rickard Green > %%% Description : A simple message passing benchmark > %%% > %%% Created : 30 Dec 2005 by Rickard Green > %%%------------------------------------------------------------------- > -module(big). > > -export([bang/1]). > > pinger([], [], true) -> > receive > {procs, Procs, ReportTo} -> > pinger(Procs, [], ReportTo) > end; > pinger([], [], false) -> > receive {ping, From} -> From ! {pong, self()} end, > pinger([],[],false); > pinger([], [], ReportTo) -> > ReportTo ! {done, self()}, > pinger([],[],false); > pinger([],[Po|Pos] = Pongers, ReportTo) -> > receive > {ping, From} -> > From ! {pong, self()}, > pinger([], Pongers, ReportTo); > {pong, Po} -> > pinger([], Pos, ReportTo) > end; > pinger([Pi|Pis], Pongers, ReportTo) -> > receive {ping, From} -> From ! {pong, self()} > after 0 -> ok > end, > Pi ! {ping, self()}, > pinger(Pis, [Pi|Pongers], ReportTo). > > spawn_procs(N) when N =< 0 -> > []; > spawn_procs(N) -> > [spawn_link(fun () -> pinger([],[],true) end) | spawn_procs(N-1)]. > > send_procs([], Msg) -> > Msg; > send_procs([P|Ps], Msg) -> > P ! Msg, > send_procs(Ps, Msg). > > receive_msgs([]) -> > ok; > receive_msgs([M|Ms]) -> > receive > M -> > receive_msgs(Ms) > end. > > bang(N) when integer(N) -> > Procs = spawn_procs(N), > RMsgs = lists:map(fun (P) -> {done, P} end, Procs), > Start = now(), > send_procs(Procs, {procs, Procs, self()}), > receive_msgs(RMsgs), > Stop = now(), > lists:foreach(fun (P) -> exit(P, normal) end, Procs), > timer:now_diff(Stop, Start). > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandrashekhar.mullaparthi@REDACTED Tue Oct 24 19:24:20 2006 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Tue, 24 Oct 2006 18:24:20 +0100 Subject: [erlang-questions] R11B-1 on Solaris 10 Message-ID: Hi, We tried building 64-bit R11B-1 on a AMD Opteron platform running Solaris 10. The only way we could get it to build was by changing line 1352 in erts/configure to: i86pc) ARCH=amd64;; It seems that 'uname -p' returns i386 instead of x86_64 under Solaris 10. Has the OTP team ever tried building on this configuration? Is there any way to specify this on the command line as an option to 'configure' ? It would be nice to have this work "out of the box". The resulting building seems to work but I've only tried the big bang benchmark by Rickard Green. Yet to try out some "real" apps. cheers Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay@REDACTED Wed Oct 25 06:22:59 2006 From: jay@REDACTED (Jay Nelson) Date: Tue, 24 Oct 2006 21:22:59 -0700 Subject: [erlang-questions] memcached (was MySQL Cluster - Mnesia XXL) Message-ID: <453EE6A3.10601@duomark.com> Pat e wrote: > Is Erlang Memcached finished? For some ideas of how to go about implementing it, see my paper from this year's ICFP erlang conference entitled "Concurrent Caching". http://www.duomark.com/erlang/index.html jay From mikpe@REDACTED Wed Oct 25 09:39:52 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 25 Oct 2006 09:39:52 +0200 (MEST) Subject: [erlang-questions] R11B-1 on Solaris 10 Message-ID: <200610250739.k9P7dqgt007323@harpo.it.uu.se> On Tue, 24 Oct 2006 18:24:20 +0100, Chandru wrote: > We tried building 64-bit R11B-1 on a AMD Opteron platform running Solaris > 10. The only way we could get it to build was by changing line 1352 in > erts/configure to: > > i86pc) ARCH=amd64;; > > It seems that 'uname -p' returns i386 instead of x86_64 under Solaris 10. I see that Solaris' `man uname` describes -p as preferred over -m, but they fail to mention that uname -p is functionally inferior to -m. In any case, what does `uname -a`, `isalist`, and `optisa `isalist`` report on Solaris 10 on AMD64? erts/configure.in uses `uname -m` not `uname -p`, so unless Sun has broken uname, it should report 64-bit capability. As a last resort (if Sun indeed broke uname), we can add a test in erts/configure.in to check for 64-bit capability via the C compiler. /Mikael From rsaccon@REDACTED Wed Oct 25 10:30:29 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Wed, 25 Oct 2006 06:30:29 -0200 Subject: [erlang-questions] memcached (was MySQL Cluster - Mnesia XXL) In-Reply-To: <453EE6A3.10601@duomark.com> References: <453EE6A3.10601@duomark.com> Message-ID: Interesting paper ! What would be the advantages if the concurrent cache as described on the paper would be combined with mnesia (as suggested on the slides) ? Just better manageability (allowing use of the mnesia tools), because the data is in mnesia tables, or is there anything else I am not seeing yet ? reagrds Roberto On 10/25/06, Jay Nelson wrote: > Pat e wrote: > > > Is Erlang Memcached finished? > > For some ideas of how to go about implementing it, see my paper from > this year's ICFP erlang conference entitled "Concurrent Caching". > > http://www.duomark.com/erlang/index.html > > > jay > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- Roberto Saccon From erlang-questions@REDACTED Wed Oct 25 10:46:05 2006 From: erlang-questions@REDACTED (Peter-Henry Mander) Date: Wed, 25 Oct 2006 09:46:05 +0100 Subject: [erlang-questions] R11B-1 on Solaris 10 Message-ID: <20061025094605.63c85889.erlang-questions@manderhanyu.plus.com> Hi Mikael, This is the output of isalist, optisa and psrinfo: [510] isalist amd64 pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86 [511] optisa isalist (no output) [512] psrinfo 0 on-line since 10/04/2006 11:59:37 1 on-line since 10/04/2006 11:59:40 2 on-line since 10/04/2006 11:59:42 3 on-line since 10/04/2006 11:59:44 4 on-line since 10/04/2006 11:59:46 5 on-line since 10/04/2006 11:59:48 6 on-line since 10/04/2006 11:59:50 7 on-line since 10/04/2006 11:59:52 [513] uname -a SunOS elastigirl 5.10 Generic_118844-26 i86pc i386 i86pc [514] uname -m i86pc It does look as if Sun broke uname. The error reported is: configure: error: cannot build smp enabled emulator since hardware platform (x86 wordsize=8) is not supported Maybe a fix would be to asume that wordsize=8 on x86 indicates AMD x86_94 or Intel EMT-64 CPU if the OS is Solaris? Pete. on Wed Oct 25 09:39:52 CEST 2006, Mikael Pettersson wrote: I see that Solaris' `man uname` describes -p as preferred over -m, but they fail to mention that uname -p is functionally inferior to -m. In any case, what does `uname -a`, `isalist`, and `optisa `isalist`` report on Solaris 10 on AMD64? erts/configure.in uses `uname -m` not `uname -p`, so unless Sun has broken uname, it should report 64-bit capability. As a last resort (if Sun indeed broke uname), we can add a test in erts/configure.in to check for 64-bit capability via the C compiler. From xpdoka@REDACTED Wed Oct 25 13:25:23 2006 From: xpdoka@REDACTED (Dominic Williams) Date: Wed, 25 Oct 2006 13:25:23 +0200 (CEST) Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <453F23F2.5060307@cellicium.com> References: <453F23F2.5060307@cellicium.com> Message-ID: <28509.83.204.231.121.1161775523.squirrel@www.geekisp.com> Michael wrote: > How about forking the language and redesigning it to fix > the problems? I think forking the language would be a mistake: - It would be a pity to split the community and expend energy in different directions - It might not even result in a better language (evolution often gets better results than revolution) However, I do find that backward compatibility is too often offered as a reason not to make some changes, particularly of the kind that correct past mistakes. As a result, Erlang is growing, but not cleaned up. I think the solution is to offer, along with the changes, refactoring tools to bring existing code up to date. Regards, Dominic Williams http://www.dominicwilliams.net ---- From chandrashekhar.mullaparthi@REDACTED Wed Oct 25 13:55:05 2006 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Wed, 25 Oct 2006 12:55:05 +0100 Subject: [erlang-questions] R11B-1 on Solaris 10 In-Reply-To: <200610250739.k9P7dqgt007323@harpo.it.uu.se> References: <200610250739.k9P7dqgt007323@harpo.it.uu.se> Message-ID: On 25/10/06, Mikael Pettersson wrote: > > On Tue, 24 Oct 2006 18:24:20 +0100, Chandru < > chandrashekhar.mullaparthi@REDACTED> wrote: > > We tried building 64-bit R11B-1 on a AMD Opteron platform running > Solaris > > 10. The only way we could get it to build was by changing line 1352 in > > erts/configure to: > > > > i86pc) ARCH=amd64;; > > > > It seems that 'uname -p' returns i386 instead of x86_64 under Solaris > 10. > > I see that Solaris' `man uname` describes -p as preferred over -m, but > they fail to mention that uname -p is functionally inferior to -m. > > In any case, what does `uname -a`, `isalist`, and `optisa `isalist`` > report on Solaris 10 on AMD64? Small correction to what Peter posted. # optisa `isalist` amd64 cheers Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From dot@REDACTED Wed Oct 25 14:45:16 2006 From: dot@REDACTED (Tony Finch) Date: Wed, 25 Oct 2006 13:45:16 +0100 Subject: [erlang-questions] Process declarations In-Reply-To: <9b08084c0610050031m468daf6aj72fd8f45bb0366a4@mail.gmail.com> References: <9b08084c0610050031m468daf6aj72fd8f45bb0366a4@mail.gmail.com> Message-ID: On Thu, 5 Oct 2006, Joe Armstrong wrote: > Process declarations: > Do away with spawn. Replace with a process keyword: > So that we can name processes. Things without names we cannot talk about. I think this is a bad idea because it's moving away from the capability model, where posession of a pid implies permission to communicate with it, and if you don't have the pid you can't. The pid *is* the name. Also, I'm not sure how your proposal deals with multiple processes running the annotated code. Tony. -- f.a.n.finch http://dotat.at/ HEBRIDES: NORTHEAST 5 OR 6 VEERING EAST 6 OR 7 PERHAPS GALE 8 LATER. SHOWERS THEN RAIN. MODERATE OR GOOD. From james.hague@REDACTED Wed Oct 25 15:51:03 2006 From: james.hague@REDACTED (James Hague) Date: Wed, 25 Oct 2006 08:51:03 -0500 Subject: [erlang-questions] iterators in Erlang Message-ID: I've recently been brushing up on my Python, because I'm teaching a class using it. What's surprising to me is how much modern Python relies on iterators (an "iterator" being an object that returns one value at a time in a sequence). Where lists:seq(1,100000) returns a large list in erlang, xrange(1,100000+1) in Python generates one value at a time. Then you can sum these values with sum(xrange(1,100000+1)) and there's still no intermediate list. Even more interesting is that iterators have evolved into generators, which are a poor man's processes). People are twisting generators to get cooperative multitasking. What jumps out at me is how natural this stuff is to do in Erlang, and yet the iterator/generator style isn't an inherent part of the Erlang libraries. I'm not sure if it really *should* be, of course, but I was curious why Erlang never went down this path. James From serge@REDACTED Wed Oct 25 16:25:31 2006 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 25 Oct 2006 10:25:31 -0400 Subject: [erlang-questions] iterators in Erlang In-Reply-To: References: Message-ID: <453F73DB.1070604@hq.idt.net> Perhaps this is because of the intent to keep functions pure functional? xrange seems to rely on side-effects (i.e. storing internally the current element counter) that may cause issues with concurrency. However, it can be safely implemented in a separate process. It would indeed be nice if such a construct existed in Erlang/OTP. This would be similar to OCaml streams. Streams are sequences of elements (that can potentially be infinite). The evaluation of a part of a stream is done in a lazy manner on demand, whenever it is needed by the current computation. Examples could be that you initialize a stream with a string, file, socket or some other generator, and use it just like a list by fetching one element (or binary pattern) at a time: process_stream ( make_stream({file, FileName}) ). process_stream([: :]) -> io:put_chars("\n"); process_stream([: Ch | Tail :]) -> io:format("~c ", [Ch]), process_stream(Tail). Regards, Serge James Hague wrote: > I've recently been brushing up on my Python, because I'm teaching a > class using it. What's surprising to me is how much modern Python > relies on iterators (an "iterator" being an object that returns one > value at a time in a sequence). Where lists:seq(1,100000) returns a > large list in erlang, xrange(1,100000+1) in Python generates one value > at a time. Then you can sum these values with sum(xrange(1,100000+1)) > and there's still no intermediate list. > > Even more interesting is that iterators have evolved into generators, > which are a poor man's processes). People are twisting generators to > get cooperative multitasking. > > What jumps out at me is how natural this stuff is to do in Erlang, and > yet the iterator/generator style isn't an inherent part of the Erlang > libraries. I'm not sure if it really *should* be, of course, but I > was curious why Erlang never went down this path. > > James > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From richardc@REDACTED Wed Oct 25 16:37:05 2006 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 25 Oct 2006 16:37:05 +0200 Subject: [erlang-questions] iterators in Erlang In-Reply-To: References: Message-ID: <453F7691.5060307@it.uu.se> James Hague wrote: > What jumps out at me is how natural this stuff is to do in Erlang, and > yet the iterator/generator style isn't an inherent part of the Erlang > libraries. I'm not sure if it really *should* be, of course, but I > was curious why Erlang never went down this path. It's simply much cheaper to do this sort of thing using coroutines. With processes, you have to send a message to request the next element and wait for the reply, and even if that can be pretty fast in Erlang, it is not nearly as fast as a coroutine call. Another thing is that a coroutine cannot suddenly go away and leave the client hanging. So, if you had some kind of generator construct in Erlang, would you want it to map onto processes, or would you prefer real coroutines? Perhaps a good start would be if someone wrote a generator library based on processes. There was some early research by Erik Stenman of the HiPE project on creating shortcuts for request/reply without going through the scheduler and the message queue, but it never got beyond experimental. See Erik's Ph.D. thesis for details: http://www.diva-portal.org/diva/getDocument?urn_nbn_se_uu_diva-2688-1__fulltext.pdf /Richard From rrerlang@REDACTED Wed Oct 25 16:51:40 2006 From: rrerlang@REDACTED (Robert Raschke) Date: Wed, 25 Oct 2006 15:51:40 +0100 Subject: [erlang-questions] iterators in Erlang In-Reply-To: Message-ID: <9de25305dee0e6ddde94da194cefeb26@tombob.com> James wrote: > I've recently been brushing up on my Python, because I'm teaching a > class using it. What's surprising to me is how much modern Python > relies on iterators (an "iterator" being an object that returns one > value at a time in a sequence). Where lists:seq(1,100000) returns a > large list in erlang, xrange(1,100000+1) in Python generates one value > at a time. Then you can sum these values with sum(xrange(1,100000+1)) > and there's still no intermediate list. > > Even more interesting is that iterators have evolved into generators, > which are a poor man's processes). People are twisting generators to > get cooperative multitasking. I wonder if someone from the Icon (http://www.cs.arizona.edu/icon/intro.htm) team has migrated to Python. Icon seems to have gone down the most rigorous route in using generators, co-expressions, and goal-oriented evaluation. Fabulous language that in my ideal world would have pre-empted all the perl/php/*script/python cruft that came afterwards. > What jumps out at me is how natural this stuff is to do in Erlang, and > yet the iterator/generator style isn't an inherent part of the Erlang > libraries. I'm not sure if it really *should* be, of course, but I > was curious why Erlang never went down this path. I'm not up to date with Python, but what kinds of control structures does it provide enumerate values from a generator? Is it the OO iterator concept of having to explicitly call some kind of next() method? In that case there appears not to be any obvious advantage over "just" writing processes in Erlang to generate values and communicating with messages. Robby From markm@REDACTED Wed Oct 25 18:56:14 2006 From: markm@REDACTED (Mark S. Miller) Date: Wed, 25 Oct 2006 09:56:14 -0700 Subject: [erlang-questions] Capability model? (was: Process declarations) In-Reply-To: References: <9b08084c0610050031m468daf6aj72fd8f45bb0366a4@mail.gmail.com> Message-ID: <453F972E.5080902@cs.jhu.edu> Tony Finch wrote: > On Thu, 5 Oct 2006, Joe Armstrong wrote: > >> Process declarations: >> Do away with spawn. Replace with a process keyword: >> So that we can name processes. Things without names we cannot talk about. > > I think this is a bad idea because it's moving away from the capability > model, where posession of a pid implies permission to communicate with it, > and if you don't have the pid you can't. The pid *is* the name. Also, I'm > not sure how your proposal deals with multiple processes running the > annotated code. Currently, the underlying logic of Erlang perfectly supports the capability model, but current Erlang practice does not. The main problems as I see it: * pids are currently forgeable, by unserialization from a guessable representation. * Common Erlang practice is to register pids in a global name table. * Common Erlang practice is for process A to perform an RPC to process B by giving the B direct access to A's pid, and for A to distinguish B's response from further requests by A's clients by forgeable convention. This practice permits B to make requests of A, and it permits other clients of A to send to A a forged response to A's outstanding call to B. All these problems are easily fixed while keeping the sense of Erlang. Only the first is fundamental, but is probably also the least painful. As has been discussed here previously, A can fix the last problem by creating an intermediate process, A2, to receive the response to this one request. It would then give B A2's pid. This change would be the most painful, as it would require pervasive changes to existing libraries. So Erlang is at a fork in the road. It is well positioned to move towards capabilities if there's enough interest, and enough willingness to pay the price. Or if not, it may as well move away, because there's no benefit to remaining in this middle ground. When considering this choice, ask whether Erlang has any other plausible route for supporting distributed security. -- Text by me above is hereby placed in the public domain Cheers, --MarkM From james.hague@REDACTED Wed Oct 25 19:10:31 2006 From: james.hague@REDACTED (James Hague) Date: Wed, 25 Oct 2006 12:10:31 -0500 Subject: [erlang-questions] iterators in Erlang In-Reply-To: <9de25305dee0e6ddde94da194cefeb26@tombob.com> References: <9de25305dee0e6ddde94da194cefeb26@tombob.com> Message-ID: On 10/25/06, Robert Raschke wrote: > > I'm not up to date with Python, but what kinds of control structures > does it provide enumerate values from a generator? Is it the OO > iterator concept of having to explicitly call some kind of next() > method? In that case there appears not to be any obvious advantage > over "just" writing processes in Erlang to generate values and > communicating with messages. "for" in Python works automatically with generators: for line in file: print line "file" in this case is an interator that returns each line in a file. This also works with list comprehensions: [i for i in xrange(10)*2] James From robert.virding@REDACTED Wed Oct 25 22:48:14 2006 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 25 Oct 2006 22:48:14 +0200 Subject: [erlang-questions] Improved regexp.erl In-Reply-To: <17244f480610171443m80fdf62x261a9ae5f90a633a@mail.gmail.com> References: <453540AF.7040607@telia.com> <17244f480610171443m80fdf62x261a9ae5f90a633a@mail.gmail.com> Message-ID: <453FCD8E.4090204@telia.com> I have added a new version of regexp.erl which contains the earlier mentioned patches to trapexit.org. Same thread in User contributions. I have also done some simple benchmarking on a 1.7 GHz laptop. I have done regexp:matches/1, i.e. return a list of all non-overlaping matches, on a 1 M element list (1 Mbfile) containing repeated copies of erlog_int.erl. For the pattern "[a-z]+_[a-z]", which returns over _14000_ matches, this took about 0.5 sec, including building the list. It is a simple pattern but tests quite alot. The test was done using the regexp:compile/1 option in the new regexp as well as a prototyp of regexp_transform which builds specialised code for each regexp. The compile/1 was about 10% slower. I think this is fast enough to be useful. I plan to write a version for binaries and will return when that is done. What requirements do people have? Robert Yariv Sadan wrote: > Hi Robert, > > Thanks for the new regexp module! Have you ran any benchmarks > comparing its performance to the old module? Also, I remember your > mentioning it would be able to work with binaries. Is that capability > implemented? > > Thanks > Yariv > > On 10/17/06, Robert Virding wrote: > >> I have added an upgraded, drop-in replacement to the user contributions >> in trapexit.org. It allows for compilation of regular expressions. They >> can either be used directly in the functions in the module, as with >> regexp:parse, or the DFA built from the regexps can be returned. Read >> the documentation. >> >> Robert >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > From tobbe@REDACTED Wed Oct 25 23:32:52 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Wed, 25 Oct 2006 23:32:52 +0200 Subject: [erlang-questions] iterators in Erlang In-Reply-To: References: Message-ID: Just for the fun of it. Here is some old code playing with the 'stream' concept: http://forum.trapexit.org/viewtopic.php?p=22424#22424 Makes it possible to write expressions such as: 1> streams:first(10, streams:primes()). [2,3,5,7,11,13,17,19,23,29] 2> hd(lists:reverse(streams:first(2000, streams:pi()))). 3.14399 Cheers, Tobbe James Hague skrev: > I've recently been brushing up on my Python, because I'm teaching a > class using it. What's surprising to me is how much modern Python > relies on iterators (an "iterator" being an object that returns one > value at a time in a sequence). Where lists:seq(1,100000) returns a > large list in erlang, xrange(1,100000+1) in Python generates one value > at a time. Then you can sum these values with sum(xrange(1,100000+1)) > and there's still no intermediate list. > > Even more interesting is that iterators have evolved into generators, > which are a poor man's processes). People are twisting generators to > get cooperative multitasking. > > What jumps out at me is how natural this stuff is to do in Erlang, and > yet the iterator/generator style isn't an inherent part of the Erlang > libraries. I'm not sure if it really *should* be, of course, but I > was curious why Erlang never went down this path. > > James > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From markm@REDACTED Thu Oct 26 00:18:25 2006 From: markm@REDACTED (Mark S. Miller) Date: Wed, 25 Oct 2006 15:18:25 -0700 Subject: [erlang-questions] Capability model? In-Reply-To: <200610252013.k9PKDfNn015413@krumkake.jetcafe.org> References: <200610252013.k9PKDfNn015413@krumkake.jetcafe.org> Message-ID: <453FE2B1.2010600@cs.jhu.edu> Jim Larson wrote: > Joe Armstrong once floated a proposal for core Erlang syntax for > RPC: "!!". This may have been just syntactic sugar for a standard > library call, instead of a true core mechanism - but it it were a > true core mechanism, it could be made capability-safe. > > A library-only change for capability-safe RPC would probably be > worthwhile if the code change were the only cost - but we'd have > to deal with the performance implications - processes and messages > are cheap, but are they cheap enough to not suffer for an extra > message and spawn/process cleanup per RPC call? OTOH, any effort > put into improving the compiler and runtime to minimize this extra > overhead for capability-safe RPC would also yield great benefits > for the system as a whole. This does sound good. If necessary for performance, I imagine one could even define "!!" as a primitive whose semantics was defined by equivalence to an expansion involving a process spawn, but whose implementation used other means. If we believe we could do this if we needed to, then we can proceed assuming "!!" and postpone worrying about whether it expands to a spawn or is a new primitive. > The Erlang practice of a global name table could be made more > suitable for capability-safety by reinterpreting its use as syntactic > sugar for an RPC to a name-to-pid mapping server - whose own pid > would be stored in the - sigh - process dictionary. By allowing > installation of a new mapping server, we could then have containment. > Similar changes would need to be made for the distributed Erlang > functionality. Why is this name table useful at all? Could you live without it? We have no such thing in E and we haven't missed it. -- Text by me above is hereby placed in the public domain Cheers, --MarkM From erlq@REDACTED Thu Oct 26 03:33:08 2006 From: erlq@REDACTED (Rob) Date: Wed, 25 Oct 2006 18:33:08 -0700 Subject: [erlang-questions] R11B-1 on Solaris 10 In-Reply-To: <20061025094605.63c85889.erlang-questions@manderhanyu.plus.com> References: <20061025094605.63c85889.erlang-questions@manderhanyu.plus.com> Message-ID: <45401054.70200@itsbeen.sent.com> Peter-Henry Mander wrote: > Hi Mikael, > > This is the output of isalist, optisa and psrinfo: > > [510] isalist > amd64 pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86 > [511] optisa isalist > (no output) > [512] psrinfo > 0 on-line since 10/04/2006 11:59:37 > 1 on-line since 10/04/2006 11:59:40 > 2 on-line since 10/04/2006 11:59:42 > 3 on-line since 10/04/2006 11:59:44 > 4 on-line since 10/04/2006 11:59:46 > 5 on-line since 10/04/2006 11:59:48 > 6 on-line since 10/04/2006 11:59:50 > 7 on-line since 10/04/2006 11:59:52 > [513] uname -a > SunOS elastigirl 5.10 Generic_118844-26 i86pc i386 i86pc > [514] uname -m > i86pc > > It does look as if Sun broke uname. > > The error reported is: > configure: error: cannot build smp enabled emulator since hardware platform (x86 wordsize=8) is not supported > > Maybe a fix would be to asume that wordsize=8 on x86 indicates AMD x86_94 or Intel EMT-64 CPU if the OS is Solaris? > > Pete. > > > on Wed Oct 25 09:39:52 CEST 2006, Mikael Pettersson wrote: > > I see that Solaris' `man uname` describes -p as preferred over -m, but > they fail to mention that uname -p is functionally inferior to -m. > > In any case, what does `uname -a`, `isalist`, and `optisa `isalist`` > report on Solaris 10 on AMD64? > > erts/configure.in uses `uname -m` not `uname -p`, so unless Sun has > broken uname, it should report 64-bit capability. > > As a last resort (if Sun indeed broke uname), we can add a test in > erts/configure.in to check for 64-bit capability via the C compiler. For comparison purposes, here is the output from the same commands on my Solaris Express box (SuperMicro P4 3.0 GHz HyperThreaded, 2 GB RAM): # uname -a SunOS sm1 5.11 snv_46 i86pc i386 i86pc # uname -p i386 # uname -m i86pc # psrinfo -v Status of virtual processor 0 as of: 10/25/2006 12:56:30 on-line since 10/09/2006 20:13:37. The i386 processor operates at 3000 MHz, and has an i387 compatible floating point processor. Status of virtual processor 1 as of: 10/25/2006 12:56:30 on-line since 10/09/2006 20:13:45. The i386 processor operates at 3000 MHz, and has an i387 compatible floating point processor. * Pete what is the output for your machine with -v ? * * Note the i386 in my listing... * # isalist amd64 pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86 # optisa isalist # optisa `isalist` amd64 # dmesg | more ... Oct 9 20:13:35 sm1 unix: [ID 126719 kern.info] features: 10fffdf Oct 9 20:13:35 sm1 unix: [ID 168242 kern.info] mem = 2087420K (0x7f67f000) Oct 9 20:13:35 sm1 rootnex: [ID 466748 kern.info] root nexus = i86pc ... Oct 9 20:13:43 sm1 unix: [ID 950921 kern.info] cpu0: x86 (chipid 0x0 GenuineIntel family 15 model 4 step 3 clock 3000 MHz) Oct 9 20:13:43 sm1 unix: [ID 950921 kern.info] cpu0: Intel(r) Pentium(r) 4 CPU 3.00GHz Oct 9 20:13:43 sm1 unix: [ID 950921 kern.info] cpu1: x86 (chipid 0x0 GenuineIntel family 15 model 4 step 3 clock 3000 MHz) Oct 9 20:13:43 sm1 unix: [ID 950921 kern.info] cpu1: Intel(r) Pentium(r) 4 CPU 3.00GHz Oct 9 20:13:45 sm1 unix: [ID 557827 kern.info] cpu1 initialization complete - online # ./configure --enable-smp-support --disable-odbc At 15:55 # gmake At 16:19 # gmake install My times for running the smp version of the bigbang benchmark were worse that the non-smp runs, probably because my box isn't really smp. Some ideas for people with true (not hyperthreaded) SMP Solaris boxes to try. With pbind and priocntl you can bind your processes to certain processors or processor groups. In the past, with Solaris 2.51, I was able to assign 3 of 4 processors to my sybase engine processes and give them extremely long time quantums, so that they were never context switched or migrated. It would be interesting to see the results of benchmarks varying --enable-threads, smp, hipe, processor binding and process time quantum changes. If a system is dedicated solely for the purpose of running a single app, I never understood the point of the normal variable scheduler. I don't want my dedicated app to have its time quantum _and_ priority reduced just because it was hogging CPU, I want it to hog all the CPU it wants to hog. With the new Solaris FX scheduler priority you can set a process (or group of processes) to have a fixed priority and more importantly a fixed and long time quantum. In an 8 processor box, you could set processors 1-7 to a group then bind your app to it. I like to leave processor 0 free with no bound processes to handle interrupts and since I had heard rumors that the OS in some cases treats processor 0 specially (I am not sure that Solaris does this). Below are some example runs with mpstat output, but again this doesn't show what would happen with true smp. Rob PS If anyone know the commands to do the same things in linux 2.6.x, please let me know - TIA. # start smp erlang shell bash-3.00# erl -smp Erlang (BEAM) emulator version 5.5.1 [source] [smp:2] [async-threads:0] [hipe] Eshell V5.5.1 (abort with ^G) 1> big:bang(1000). http://www.princeton.edu/~psg/unix/solaris/troubleshoot/mpstat.html bash-3.00# mpstat 8 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 312 0 0 327 224 88 9 13 0 0 7921 32 1 0 67 1 571 0 0 51 5 80 10 14 0 0 11398 44 2 0 54 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 274 0 0 329 226 85 11 14 0 0 8907 45 1 0 54 1 316 0 0 50 5 80 12 14 0 0 9731 53 1 0 46 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 215 0 0 325 223 61 11 12 0 0 9864 61 1 0 37 1 126 0 0 58 5 101 10 13 0 0 5911 37 1 0 61 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 73 0 0 328 225 60 14 13 0 0 4496 66 1 0 34 1 23 0 0 60 5 105 9 13 0 0 1382 34 1 0 65 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 37 0 0 326 224 53 12 12 0 0 2043 69 0 0 31 1 16 0 0 61 5 105 8 12 0 0 906 31 0 0 68 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 36 0 0 327 224 30 12 8 0 0 2107 86 0 0 14 1 6 0 0 70 5 130 6 9 0 0 399 14 0 0 85 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 17 0 0 326 224 50 12 12 0 0 1736 72 0 0 27 1 7 0 0 64 5 112 9 11 0 0 597 28 1 0 72 # start up erlang shell (no smp) bash-3.00# erl Erlang (BEAM) emulator version 5.5.1 [source] [async-threads:0] [hipe] Eshell V5.5.1 (abort with ^G) # get the OS process id bash-3.00# ps -elf | grep erl 0 S root 15720 5242 0 40 20 ? 55282 ? 16:45:07 pts/5 2:36 /usr/local/lib/erlang/erts-5.5.1/bi # bind that process to processor #1 bash-3.00# pbind -b 1 15720 process id 15720: was not bound, now 1 10> big:bang(1000). # Note how now only psr 1 is using any CPU and the reduced csw for psr 1 and reduced migr bash-3.00# mpstat 8 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 0 325 223 139 0 3 0 0 41 0 0 0 99 1 519 0 0 27 5 24 20 4 0 0 19089 98 2 0 0 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 0 325 224 139 0 3 0 0 43 0 0 0 99 1 549 0 0 27 5 24 20 3 0 0 18199 97 3 0 0 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 0 326 224 139 0 3 0 0 40 0 0 0 99 1 205 0 0 28 5 25 20 3 0 0 10856 99 1 0 0 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 0 328 226 140 0 3 0 0 38 0 0 0 99 1 80 0 0 28 5 24 20 2 0 0 4007 99 1 0 0 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 0 326 224 138 0 4 0 0 42 0 0 0 99 1 46 0 0 29 5 27 21 4 0 0 2469 100 0 0 0 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 0 327 225 141 0 3 0 0 45 0 0 0 99 1 28 0 0 27 5 23 19 3 0 0 2087 100 0 0 0 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 0 326 224 139 0 3 0 0 42 0 0 0 100 1 2 0 0 28 5 24 21 3 0 0 1391 100 0 0 0 59126403 # assign the running erlang shell process to the FX scheduling class # and give it an obscenely large time quantum (and fairly high priority) bash-3.00# priocntl -s -c FX -m 59 -p 59 -t 99999 -i pid 15720 # show us the scheduling classes and details for each OS process bash-3.00# priocntl -d -i all ... FIXED PRIORITY PROCESSES: PID FXUPRILIM FXUPRI FXTQNTM 0 60 60 20000 15720 59 59 100000 <---- yahooo ! bash-3.00# ps -lfp 0 F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD 1 T root 0 0 0 39 0 ? 0 Oct 09 ? 0:40 sched bash-3.00# ps -lfp 15720 F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD 0 S root 15720 5242 0 40 1 ? 88306 ? 16:45:07 pts/5 4:33 /usr/local/lib/erlang/erts-5.5.1/bi 11> big:bang(1000). # Note how now csw/icsw/migr counts are further reduced, # using a true smp machine we should be able to reduce the psr 1 csw/migr count to near zero bash-3.00# mpstat 8 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 0 326 224 226 0 2 0 0 52 0 0 0 99 1 585 0 0 13 5 9 5 1 0 0 19921 97 3 0 0 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 23 330 224 241 0 2 4 0 49 0 1 0 99 1 561 0 2 112 78 11 9 2 5 0 17652 97 3 0 0 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 17 333 224 240 2 2 1 0 53 0 1 0 99 1 217 0 4 67 39 12 9 2 1 0 10895 98 2 0 0 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 4 326 223 237 0 1 0 0 51 0 0 0 99 1 80 0 0 24 13 7 5 1 0 0 3947 99 1 0 0 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 4 341 224 228 3 1 0 0 50 0 0 0 99 1 47 0 0 27 13 24 8 1 0 0 2506 100 0 0 0 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 2 326 224 237 0 1 0 0 51 0 0 0 99 1 32 0 0 17 9 6 4 1 0 0 2103 100 0 0 0 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 0 331 224 241 4 1 0 0 60 0 0 0 99 1 1 0 0 16 5 14 8 1 0 0 1429 100 0 0 0 From brad@REDACTED Thu Oct 26 05:20:07 2006 From: brad@REDACTED (Brad Marshall) Date: Wed, 25 Oct 2006 21:20:07 -0600 Subject: [erlang-questions] Inets unencoding question Message-ID: I'm using http:request and it calls http_uri:parse_http. Http_uri:parse_http seems to unencode the request as part of its parsing. I.e. %25 becomes %. Unfortunately, the web service I'm calling requires a digital signature with the request, so the request no longer matches the digital signature. I'm not sure of the reasoning behind this, and I'm certainly open to discussion to the contrary, but this seems like a bug. I've tried this request in other http clients (Perl, Java) and neither performs an unencode. Also, this particular implementation seems to violate the RFC whereby multiple unencoding is not allowed as it may alter the intent of the URI (the http_uri:parse_http unencoding is recursing on the unencoded portion). Given my very light Erlang skills it's entirely possible I'm mis-interpreting the processing but my tests seem to bear this out. Can anyone confirm or deny? Or suggest a means of turning this off? Or explain why this is correct? Thanks, brad ________________________________________________ Message sent using UebiMiau 2.7.9 From fritchie@REDACTED Thu Oct 26 06:34:11 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Wed, 25 Oct 2006 23:34:11 -0500 Subject: [erlang-questions] MySQL cluster - MnesiaXXL In-Reply-To: Message of "Mon, 23 Oct 2006 19:57:41 +0200." Message-ID: <200610260434.k9Q4YB1J070550@snookles.snookles.com> >>>>> "pe" == Pat e writes: pe> Also for example if we wanted to have Mnesia RAM-only serving (if pe> it can serve tables on 128GB RAM machine - [...] Having 16GB machines at my disposal, Mnesia works quite well. I'd hope that something 8x larger would behave just as well. Memcached in Erlang is pretty easy to do: ets gets you most of the way there. I've done exactly a memcached-like thing in Erlang + Mnesia, except for a few different, proprietary tweaks ... and having different availability requirements (which makes life more complicated than memcached's niche). My app isn't as fast as memcached, but then again, my app is so much faster than its requirements that I haven't bothered optimizing that part of the app. Several thousand updates/sec in Mnesia-replicated tables is good enough for now. :-) Mnesia does a lot of extra stuff that memcached doesn't, so apples vs. apples comparisons aren't easy. Re-implementing the memcached protocol in Erlang would be a short exercise. A good learning project for novices? The protocol is short, it does something useful, and you don't have write your own client code for testing the server ... unless you want to write both. -Scott From erlangX@REDACTED Thu Oct 26 06:56:22 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Wed, 25 Oct 2006 21:56:22 -0700 Subject: [erlang-questions] Inets unencoding question In-Reply-To: References: Message-ID: <20061026045622.GN16462@delora.autosys.us> On Wed, Oct 25, 2006 at 09:20:07PM -0600, Brad Marshall wrote: > I'm using http:request and it calls http_uri:parse_http. > Http_uri:parse_http seems to unencode the request as part of its parsing. > I.e. %25 becomes %. Unfortunately, the web service I'm calling requires a > digital signature with the request, so the request no longer matches the > digital signature. > > I'm not sure of the reasoning behind this, and I'm certainly open to > discussion to the contrary, but this seems like a bug. I've tried this > request in other http clients (Perl, Java) and neither performs an unencode. > Also, this particular implementation seems to violate the RFC whereby > multiple unencoding is not allowed as it may alter the intent of the URI > (the http_uri:parse_http unencoding is recursing on the unencoded portion). > > Given my very light Erlang skills it's entirely possible I'm > mis-interpreting the processing but my tests seem to bear this out. Can > anyone confirm or deny? Or suggest a means of turning this off? Or explain > why this is correct? > > Thanks, > brad > > ________________________________________________ I dug up the following old code I had. I compile and run my_module:geturl("http://some.url.domain.com"). that contains a %25 and I can see the %25, not a '.' Can you post some code you think is behaving badly and a URL to test with ? geturl(Url) -> application:start(inets), X = http:request(Url), case X of {ok, { {_Version, 200, _ReasonPhrase}, _Headers, Body} } -> Body; _ -> X end. ~Michael From ok@REDACTED Thu Oct 26 07:04:22 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 26 Oct 2006 18:04:22 +1300 (NZDT) Subject: [erlang-questions] Capability model? Message-ID: <200610260504.k9Q54M8t178407@atlas.otago.ac.nz> One of the first proposals I ever made for Erlang was a MODULE-PRIVATE naming system for processes. The idea was that the declaration -pidname(Name). would set up Name as a module-private (unexported and unexportable) single-process "registry". At that time, virtually all the uses of the process registry that I could find *should* have been module-private and presumably would have been if there had been any kind of module- private registry to use. As far as I can see, if we're going to change anything about processes, names should go. We don't require numbers to have names; we don't any longer require functions to have names; why require processes to have names? From surindar.shanthi@REDACTED Thu Oct 26 08:09:13 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Thu, 26 Oct 2006 11:39:13 +0530 Subject: [erlang-questions] Erlang shell crashes Message-ID: <42ea5fb60610252309g859afc8w5d6d731b9b78d154@mail.gmail.com> Dear all, I'm using erlang emulator version 5.4.3 for running an application that has to be run round the clock. The application has ran perfectly for more than 15 hours. Then the erlang shell is terminated abnormally. The general information of the crash report is Slogan eheap_alloc: Cannot allocate 373664380 bytes of memory (of type "heap"). Node name 'nonode@REDACTED' Crashdump created on Thu Oct 26 08:48:46 2006 System version Erlang (BEAM) emulator version 5.4.3 [threads:0] Compiled Wed Dec 15 12:59:41 2004 Memory allocated 1111921780 bytes Atoms 5644 Processes 716 ETS tables 76 Funs 370 Whether any latest erlang version can solve this problem? Is there any settings available to solve this problem? I'm running erlang using werl.exe; Whether running erlang using erl.exe will show any difference? Please clarify... Thanks in advance. -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From ft@REDACTED Thu Oct 26 08:39:53 2006 From: ft@REDACTED (Fredrik Thulin) Date: Thu, 26 Oct 2006 08:39:53 +0200 Subject: [erlang-questions] Improved regexp.erl References: <453540AF.7040607@telia.com><17244f480610171443m80fdf62x261a9ae5f90a633a@mail.gmail.com> <453FCD8E.4090204@telia.com> Message-ID: <006c01c6f8c9$8bb77990$191e0bc1@it.su.se> Robert Virding wrote: ... > What requirements do people have? In YXA, we still have a modified regexp.erl (modified by Magnus Ahltorp a long long time ago) that can return a list of all groups in a match. Example : 1> group_regexp:groups("foobar", "foo(.+)"). {match,["bar"]} 2> This we then use to perform substitutions, so that in the end the following is possible : 3> L. [{"^0000([1-9].+)$","+\\1"}, {"^000([1-9].+)$","+46\\1"}, {"^00([1-9].+)$","+468\\1"}] 4> util:regexp_rewrite("000319876543", L). "+46319876543" 5> util:regexp_rewrite("00162000", L). "+468162000" 6> Maybe there is a way to do it with the current regexp.erl (the one in R11B-1 I mean), in which case I would like to know about it =) but if there isn't then that is a requirement for me. Many thanks /Fredrik From raimo+erlang-questions@REDACTED Thu Oct 26 09:21:44 2006 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 26 Oct 2006 09:21:44 +0200 Subject: [erlang-questions] Erlang shell crashes In-Reply-To: <42ea5fb60610252309g859afc8w5d6d731b9b78d154@mail.gmail.com> References: <42ea5fb60610252309g859afc8w5d6d731b9b78d154@mail.gmail.com> Message-ID: <20061026072144.GA27213@erix.ericsson.se> It seems your application has a process that is growing continously, and after 15 hours its attemt to allocate a 356 MByte heap failed due to insufficient memory. Your total allocated memory is 1060 MByte of which roughly 356 MByte should be the old heap of the offendng process, leaving 704 MByte for the rest of the beam emulator. That is also a large emulator. Is your application deliberately using lots of memory? You can use the crashdump_viewer to inspect the crashdump and find out more about the offending process. You can also use 'top' from another OS shell while your application runs to verify that the beam emulator is growing continously and slowly, that being a fatal problem. The beam emulator's OS process ID can be found with os:getpid(). On Thu, Oct 26, 2006 at 11:39:13AM +0530, Surindar Sivanesan wrote: > Dear all, > > I'm using erlang emulator version 5.4.3 for running an application that has > to be run round the clock. > The application has ran perfectly for more than 15 hours. > Then the erlang shell is terminated abnormally. > The general information of the crash report is > > Slogan eheap_alloc: Cannot allocate 373664380 bytes of memory (of type > "heap"). Node name 'nonode@REDACTED' Crashdump created on Thu Oct 26 08:48:46 > 2006 System version Erlang (BEAM) emulator version 5.4.3 [threads:0] > Compiled > Wed Dec 15 12:59:41 2004 Memory allocated 1111921780 bytes Atoms 5644 > Processes > 716 ETS tables 76 Funs 370 > > Whether any latest erlang version can solve this problem? > Is there any settings available to solve this problem? > I'm running erlang using werl.exe; Whether running erlang using erl.exe will > show any difference? > Please clarify... > Thanks in advance. > > -- > with regards, > S.Surindar > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From ingela@REDACTED Thu Oct 26 10:03:27 2006 From: ingela@REDACTED (Ingela Anderton) Date: Thu, 26 Oct 2006 10:03:27 +0200 Subject: [erlang-questions] Inets unencoding question References: Message-ID: <17728.27599.496438.723166@gargle.gargle.HOWL> Hi! The implementation of the http_uri module has always been a mystery to me. It is probably wrong. That is why I wrote a new one when I was going to fix the problem that it did not handle URIs with ipv6 addresses. The new version will be part of the next open source release. When I try to test the old module however it seems that % becomes %25 not the other way around. Regardless if you could send an exampel of an uri that you think is handle incorrectly I will add it to our test cases of this module. >I'm using http:request and it calls http_uri:parse_http. >Http_uri:parse_http seems to unencode the request as part of its parsing. >I.e. %25 becomes %. Unfortunately, the web service I'm calling requires a >digital signature with the request, so the request no longer matches the >digital signature. >I'm not sure of the reasoning behind this, and I'm certainly open to >discussion to the contrary, but this seems like a bug. I've tried this >request in other http clients (Perl, Java) and neither performs an unencode. > Also, this particular implementation seems to violate the RFC whereby >multiple unencoding is not allowed as it may alter the intent of the URI >(the http_uri:parse_http unencoding is recursing on the unencoded portion). >Given my very light Erlang skills it's entirely possible I'm >mis-interpreting the processing but my tests seem to bear this out. Can >anyone confirm or deny? Or suggest a means of turning this off? Or explain >why this is correct? -- Ingela Ericsson AB - OTP team From sanjaya@REDACTED Thu Oct 26 10:33:21 2006 From: sanjaya@REDACTED (Sanjaya Vitharana) Date: Thu, 26 Oct 2006 14:03:21 +0530 Subject: [erlang-questions] VoiceXML interpreter in erlang ? Message-ID: <0b8701c6f8d9$69a21760$9a0810ac@wavenet.lk> Hi ... All, Is there anybody who has worked in developing VoiceXML interpreter in Erlang ? regards, Sanjaya Vitharana. -------------- next part -------------- An HTML attachment was scrubbed... URL: From surindar.shanthi@REDACTED Thu Oct 26 11:21:22 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Thu, 26 Oct 2006 14:51:22 +0530 Subject: [erlang-questions] Erlang shell crashes In-Reply-To: <20061026072144.GA27213@erix.ericsson.se> References: <42ea5fb60610252309g859afc8w5d6d731b9b78d154@mail.gmail.com> <20061026072144.GA27213@erix.ericsson.se> Message-ID: <42ea5fb60610260221t20a5270fs530682cea2d95fe@mail.gmail.com> >From the crash dump viewer, I have noticed that the stack+heap size and message queue lenght are high for some processes. Pid Name/Spawned as State Reductions Stack+heap *MsgQ Length * <0.128.0>> controling_process Waiting 162446666 10946 380465 <0.60.0>> logwriter Garbing (limited info) 12549099 93416095 272345 Here, the *logwriter* uses ODBC connectivity and write the log to MS SQL DB. All the other process in this application uses *logwriter *process to write log. On 10/26/06, Raimo Niskanen wrote: > > It seems your application has a process that is growing continously, > and after 15 hours its attemt to allocate a 356 MByte heap failed > due to insufficient memory. > > Your total allocated memory is 1060 MByte of which roughly 356 MByte > should be the old heap of the offendng process, leaving 704 MByte > for the rest of the beam emulator. That is also a large emulator. > Is your application deliberately using lots of memory? > > You can use the crashdump_viewer to inspect the crashdump and find out > more about the offending process. You can also use 'top' from another > OS shell while your application runs to verify that the beam > emulator is growing continously and slowly, that being a fatal problem. > > The beam emulator's OS process ID can be found with os:getpid(). > > On Thu, Oct 26, 2006 at 11:39:13AM +0530, Surindar Sivanesan wrote: > > Dear all, > > > > I'm using erlang emulator version 5.4.3 for running an application that > has > > to be run round the clock. > > The application has ran perfectly for more than 15 hours. > > Then the erlang shell is terminated abnormally. > > The general information of the crash report is > > > > Slogan eheap_alloc: Cannot allocate 373664380 bytes of memory (of type > > "heap"). Node name 'nonode@REDACTED' Crashdump created on Thu Oct 26 > 08:48:46 > > 2006 System version Erlang (BEAM) emulator version 5.4.3 [threads:0] > > Compiled > > Wed Dec 15 12:59:41 2004 Memory allocated 1111921780 bytes Atoms 5644 > > Processes > > 716 ETS tables 76 Funs 370 > > > > Whether any latest erlang version can solve this problem? > > Is there any settings available to solve this problem? > > I'm running erlang using werl.exe; Whether running erlang using erl.exewill > > show any difference? > > Please clarify... > > Thanks in advance. > > > > -- > > with regards, > > S.Surindar > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From surindar.shanthi@REDACTED Thu Oct 26 11:38:24 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Thu, 26 Oct 2006 15:08:24 +0530 Subject: [erlang-questions] Erlang shell crashes In-Reply-To: <42ea5fb60610260221t20a5270fs530682cea2d95fe@mail.gmail.com> References: <42ea5fb60610252309g859afc8w5d6d731b9b78d154@mail.gmail.com> <20061026072144.GA27213@erix.ericsson.se> <42ea5fb60610260221t20a5270fs530682cea2d95fe@mail.gmail.com> Message-ID: <42ea5fb60610260238l48738860p95b6975e8e868b5a@mail.gmail.com> Also, I need to know about the term *Reductions. * What does it mean? Is it should be minimum or maximum for better performance? (How is it measured?) On 10/26/06, Surindar Sivanesan wrote: > > From the crash dump viewer, I have noticed that the stack+heap size and > message queue lenght are high for some processes. > > Pid Name/Spawned > as > State > Reductions > Stack+heap > *MsgQ Length > * <0.128.0> > controling_process Waiting 162446666 10946 380465 <0.60.0> > logwriter Garbing (limited info) 12549099 93416095 272345 > > Here, the *logwriter* uses ODBC connectivity and write the log to MS SQL > DB. > All the other process in this application uses *logwriter *process to > write log. > > On 10/26/06, Raimo Niskanen > wrote: > > > > It seems your application has a process that is growing continously, > > and after 15 hours its attemt to allocate a 356 MByte heap failed > > due to insufficient memory. > > > > Your total allocated memory is 1060 MByte of which roughly 356 MByte > > should be the old heap of the offendng process, leaving 704 MByte > > for the rest of the beam emulator. That is also a large emulator. > > Is your application deliberately using lots of memory? > > > > You can use the crashdump_viewer to inspect the crashdump and find out > > more about the offending process. You can also use 'top' from another > > OS shell while your application runs to verify that the beam > > emulator is growing continously and slowly, that being a fatal problem. > > > > The beam emulator's OS process ID can be found with os:getpid(). > > > > On Thu, Oct 26, 2006 at 11:39:13AM +0530, Surindar Sivanesan wrote: > > > Dear all, > > > > > > I'm using erlang emulator version 5.4.3 for running an application > > that has > > > to be run round the clock. > > > The application has ran perfectly for more than 15 hours. > > > Then the erlang shell is terminated abnormally. > > > The general information of the crash report is > > > > > > Slogan eheap_alloc: Cannot allocate 373664380 bytes of memory (of > > type > > > "heap"). Node name 'nonode@REDACTED' Crashdump created on Thu Oct 26 > > 08:48:46 > > > 2006 System version Erlang (BEAM) emulator version 5.4.3 [threads:0] > > > Compiled > > > Wed Dec 15 12:59:41 2004 Memory allocated 1111921780 bytes Atoms 5644 > > > Processes > > > 716 ETS tables 76 Funs 370 > > > > > > Whether any latest erlang version can solve this problem? > > > Is there any settings available to solve this problem? > > > I'm running erlang using werl.exe; Whether running erlang using > > erl.exe will > > > show any difference? > > > Please clarify... > > > Thanks in advance. > > > > > > -- > > > with regards, > > > S.Surindar > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > > > > > -- > with regards, > S.Surindar -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.hinde@REDACTED Thu Oct 26 12:13:54 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Thu, 26 Oct 2006 11:13:54 +0100 Subject: [erlang-questions] Erlang shell crashes In-Reply-To: <42ea5fb60610260238l48738860p95b6975e8e868b5a@mail.gmail.com> References: <42ea5fb60610252309g859afc8w5d6d731b9b78d154@mail.gmail.com> <20061026072144.GA27213@erix.ericsson.se> <42ea5fb60610260221t20a5270fs530682cea2d95fe@mail.gmail.com> <42ea5fb60610260238l48738860p95b6975e8e868b5a@mail.gmail.com> Message-ID: <43CB49A3-74AD-4011-8D90-DC7E859E7470@gmail.com> On 26 Oct 2006, at 10:38, Surindar Sivanesan wrote: > Also, I need to know about the term Reductions. > What does it mean? > Is it should be minimum or maximum for better performance? (How is > it measured?) Reductions is approx equivalent to the number of function calls that the process has ever executed. > > > On 10/26/06, Surindar Sivanesan wrote: > From the crash dump viewer, I have noticed that the stack+heap size > and message queue lenght are high for some processes. > > PidName/Spawned asStateReductions Stack+heap MsgQ Length > <0.128.0>controling_processWaiting16244666610946380465 > <0.60.0> logwriterGarbing (limited info)1254909993416095272345 > > Here, the logwriter uses ODBC connectivity and write the log to MS > SQL DB. > All the other process in this application uses logwriter process to > write log. The problem here is that you are sending async messages to the logwriter faster than it can process them. One simple fix could be to make the requests to the logwriter syncronous (i.e. use gen_server:call() ) A more sophisticated solution could be to collect chunks of messages to be logged until a few hundred are collected and then spawn a process to write them. That way the gen_server:call from all the other processes will never have to wait for disk. Allowing a process to collect huge message queues is one sure way to kill the performance of the whole system - far worse than the overhead of using gen_server:call in such situations. I have been persuaded that this is not because of message queue traversals, but instead is some artifact of having huge live datasets on the message queue for the garbage collector to deal with. Sean From raimo+erlang-questions@REDACTED Thu Oct 26 12:30:50 2006 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 26 Oct 2006 12:30:50 +0200 Subject: [erlang-questions] : Erlang shell crashes In-Reply-To: <42ea5fb60610260221t20a5270fs530682cea2d95fe@mail.gmail.com> References: <42ea5fb60610252309g859afc8w5d6d731b9b78d154@mail.gmail.com> <20061026072144.GA27213@erix.ericsson.se> <42ea5fb60610260221t20a5270fs530682cea2d95fe@mail.gmail.com> Message-ID: <20061026103050.GA5392@erix.ericsson.se> On Thu, Oct 26, 2006 at 02:51:22PM +0530, Surindar Sivanesan wrote: > >From the crash dump viewer, I have noticed that the stack+heap size and > message queue lenght are high for some processes. > If the message queue length is high for some processes that mostly means that they do not read messages as they should. Message queue lengths are mostly 1 or 0. The question is probably: what did they do instead of receive? (Fill the heap!?) The stackdump (in the crashdump viewer) may tell. > Pid > Name/Spawned > as > State > Reductions > Stack+heap > *MsgQ > Length > * > <0.128.0>> > controling_process Waiting 162446666 10946 380465 > <0.60.0>> > logwriter Garbing (limited info) 12549099 93416095 272345 > > Here, the *logwriter* uses ODBC connectivity and write the log to MS SQL DB. > All the other process in this application uses *logwriter *process to > write log. > > On 10/26/06, Raimo Niskanen wrote: > > > >It seems your application has a process that is growing continously, > >and after 15 hours its attemt to allocate a 356 MByte heap failed > >due to insufficient memory. > > > >Your total allocated memory is 1060 MByte of which roughly 356 MByte > >should be the old heap of the offendng process, leaving 704 MByte > >for the rest of the beam emulator. That is also a large emulator. > >Is your application deliberately using lots of memory? > > > >You can use the crashdump_viewer to inspect the crashdump and find out > >more about the offending process. You can also use 'top' from another > >OS shell while your application runs to verify that the beam > >emulator is growing continously and slowly, that being a fatal problem. > > > >The beam emulator's OS process ID can be found with os:getpid(). > > > >On Thu, Oct 26, 2006 at 11:39:13AM +0530, Surindar Sivanesan wrote: > >> Dear all, > >> > >> I'm using erlang emulator version 5.4.3 for running an application that > >has > >> to be run round the clock. > >> The application has ran perfectly for more than 15 hours. > >> Then the erlang shell is terminated abnormally. > >> The general information of the crash report is > >> > >> Slogan eheap_alloc: Cannot allocate 373664380 bytes of memory (of type > >> "heap"). Node name 'nonode@REDACTED' Crashdump created on Thu Oct 26 > >08:48:46 > >> 2006 System version Erlang (BEAM) emulator version 5.4.3 [threads:0] > >> Compiled > >> Wed Dec 15 12:59:41 2004 Memory allocated 1111921780 bytes Atoms 5644 > >> Processes > >> 716 ETS tables 76 Funs 370 > >> > >> Whether any latest erlang version can solve this problem? > >> Is there any settings available to solve this problem? > >> I'm running erlang using werl.exe; Whether running erlang using > >erl.exewill > >> show any difference? > >> Please clarify... > >> Thanks in advance. > >> > >> -- > >> with regards, > >> S.Surindar > > > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > >-- > > > >/ Raimo Niskanen, Erlang/OTP, Ericsson AB > > > > > > -- > with regards, > S.Surindar > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From mats.cronqvist@REDACTED Thu Oct 26 13:25:25 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Thu, 26 Oct 2006 13:25:25 +0200 Subject: [erlang-questions] Improved regexp.erl In-Reply-To: <006c01c6f8c9$8bb77990$191e0bc1@it.su.se> References: <453540AF.7040607@telia.com><17244f480610171443m80fdf62x261a9ae5f90a633a@mail.gmail.com> <453FCD8E.4090204@telia.com> <006c01c6f8c9$8bb77990$191e0bc1@it.su.se> Message-ID: <45409B25.1000802@ericsson.com> Fredrik Thulin wrote: > Robert Virding wrote: > ... >> What requirements do people have? > > In YXA, we still have a modified regexp.erl (modified by Magnus Ahltorp > a long long time ago) that can return a list of all groups in a match. [...] > Maybe there is a way to do it with the current regexp.erl (the one in > R11B-1 I mean), in which case I would like to know about it =) but if > there isn't then that is a requirement for me. returning list of groups is a very basic requirement. i use gregexp from jungerl. mats From kostis@REDACTED Thu Oct 26 18:13:04 2006 From: kostis@REDACTED (kostis@REDACTED) Date: Thu, 26 Oct 2006 18:13:04 +0200 (MEST) Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) Message-ID: <200610261613.k9QGD4dU016351@spikklubban.it.uu.se> Dominic Williams wrote: > > However, I do find that backward compatibility is too often > offered as a reason not to make some changes, particularly > of the kind that correct past mistakes. As a result, Erlang > is growing, but not cleaned up. > > I think the solution is to offer, along with the changes, > refactoring tools to bring existing code up to date. I very much agree with the comments of Dominic. In the (not so distant) past, I've seen a certain reluctance to clean up Erlang and I was never particularly convinced by the arguments which were offered to explain this reluctance. really long time before they are made default. There is still no option to disallow two-tuples as funs. Kostis From jozsef.berces@REDACTED Thu Oct 26 16:17:57 2006 From: jozsef.berces@REDACTED (=?iso-8859-1?Q?J=F3zsef_B=E9rces_=28LA/ETH=29?=) Date: Thu, 26 Oct 2006 16:17:57 +0200 Subject: [erlang-questions] comet Message-ID: Hi, I tried to play a little bit with comet using Erlang OTP R8B. Unfortunately, neither examples work, what I see that erl_com:create_dispatch never hangs, never returns. Does anyone has any experince with comet? How to make it working? Thanks in advance, Jozsef -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad@REDACTED Thu Oct 26 19:31:07 2006 From: brad@REDACTED (Brad Marshall) Date: Thu, 26 Oct 2006 11:31:07 -0600 Subject: [erlang-questions] Inets unencoding question Message-ID: <5b260424999cfd447577dae766453c36@207.171.180.101> Sorry, should have included my test cases in the explanation. This example should be sent as-is, but arrives unencoded: http://www.somedomain.com/%2Eabc arrives as: http://www.somedomain.com/.abc This example is double-unencoded: http://www.somedomain.com/%252Eabc arrives as: http://www.somedomain.com/.abc This example causes the parser to error out: http://www.somedomain.com/%25abc Thanks, brad --------- Original Message -------- From: ingela@REDACTED To: erlang-questions@REDACTED Subject: Re: [erlang-questions] Inets unencoding question Date: 26/10/06 04:10 > > Hi! > > The implementation of the http_uri module has always been a mystery to > me. It is probably wrong. That is why I wrote a new one when I was > going to fix the problem that it did not handle URIs with ipv6 > addresses. The new version will be part of the next open source release. > When I try to test the old module however it seems > that % becomes %25 not the other way around. Regardless if > you could send an exampel of an uri that you think is handle > incorrectly I will add it to our test cases of this module. > > >I'm using http:request and it calls http_uri:parse_http. > >Http_uri:parse_http seems to unencode the request as part of its parsing. > >I.e. %25 becomes %. Unfortunately, the web service I'm calling requires a > >digital signature with the request, so the request no longer matches the > >digital signature. > > >I'm not sure of the reasoning behind this, and I'm certainly open to > >discussion to the contrary, but this seems like a bug. I've tried this > >request in other http clients (Perl, Java) and neither performs an unencode. > > Also, this particular implementation seems to violate the RFC whereby > >multiple unencoding is not allowed as it may alter the intent of the URI > >(the http_uri:parse_http unencoding is recursing on the unencoded portion). > > >Given my very light Erlang skills it's entirely possible I'm > >mis-interpreting the processing but my tests seem to bear this out. Can > >anyone confirm or deny? Or suggest a means of turning this off? Or explain > >why this is correct? > > -- > Ingela > > Ericsson AB - OTP team > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > ________________________________________________ Message sent using UebiMiau 2.7.9 From pabloay@REDACTED Thu Oct 26 20:12:56 2006 From: pabloay@REDACTED (=?ISO-8859-1?Q?Pablo_=C1lvarez_Y=E1=F1ez?=) Date: Thu, 26 Oct 2006 20:12:56 +0200 Subject: [erlang-questions] java and erlang communication error Message-ID: Hello, I need to call java functions from an erlang program. I have seen the examples into the ic lib directory (lib/ic-4.2.11). but if I execute an erlang node calling the java node (or vice versa) I get the following error: ----> In the java server: Initialization exception : java.io.IOException: expected 2 bytes, got EOF after 0 bytes at com.ericsson.otp.erlang.AbstractConnection.readSock( AbstractConnection.java:861) at com.ericsson.otp.erlang.AbstractConnection.read2BytePackage( AbstractConnection.java:1037) at com.ericsson.otp.erlang.AbstractConnection.recvChallengeReply( AbstractConnection.java:1186) at com.ericsson.otp.erlang.AbstractConnection.doAccept( AbstractConnection.java:875) at com.ericsson.otp.erlang.AbstractConnection.( AbstractConnection.java:153) at com.ericsson.otp.erlang.OtpConnection.(OtpConnection.java :63) at com.ericsson.otp.erlang.OtpSelf.accept(OtpSelf.java:177) at server.main(server.java:39) -----> In the erlang client (client@REDACTED)1> client:call(). Init...ok ** exited: {{nodedown,babbis@REDACTED}, {gen_server,call, [{rmod_random_impl,babbis@REDACTED}, rmod_random_produce, infinity]}} ** =ERROR REPORT==== 26-Oct-2006::20:02:42 === Error in process <0.41.0> on node 'client@REDACTED' with exit value: {badarg,[{erlang,list_to_existing_atom,["babbis@REDACTED "]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]} ******************************** However, I can get communication between the java client and server (and it is supposed that they act as erlang nodes). I think it is some problem with the type conversion. I am using the Erlang last release (R11B-1). Does anybody know something about it, or how to solve the problem? Thanks -- Pablo ?lvarez Y??ez M?s de mi en http://azulneon.blogsome.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From markm@REDACTED Thu Oct 26 21:43:58 2006 From: markm@REDACTED (Mark S. Miller) Date: Thu, 26 Oct 2006 12:43:58 -0700 Subject: [erlang-questions] Capability model? In-Reply-To: <200610260214.k9Q2EUNn015973@krumkake.jetcafe.org> References: <200610260214.k9Q2EUNn015973@krumkake.jetcafe.org> Message-ID: <45410FFE.80802@cs.jhu.edu> Jim Larson wrote: > I find registered processes useful for two reasons. > > First, it increases modularity by allowing deeply-nested code to > send a message without passing the target Pid as an explicit parameter > through each and every intermediate function. A standard situation > is error logging. Other functional languages handle this through > monads or other fanciness, but the Erlang way is to be simple and > functional at a micro-level, and work around any problems through > impure message-passing and other environmental services at the > macro-level. Regarding named access to a given pid from various functions within a process, isn't this what lexical scoping is for? Why not simply bind a variable to this pid, in just the way you bind a variable to any other value? If the intent is to escape the discipline imposed by lexical scoping, then you are likely also escaping the discipline needed for secure object-capability programming. Could you provide some motivating examples? > Second, since the communication endpoint is also the unit of failure, > you need *something* to use as a stable address in case the target > process crashes and gets restarted. This suggests that if we > re-interpret process registration as syntactic sugar plus an OTP > service, the supervisory tree might be the right place to implement > the process registry too. It could mean a lot of extra steps in > message sending, but as with the capa-safe RPC transformation > mentioned earlier, any optimizations to soften the impact would > have a general benefit to the system. See section 17.3 of . -- Text by me above is hereby placed in the public domain Cheers, --MarkM From kostis@REDACTED Thu Oct 26 23:35:20 2006 From: kostis@REDACTED (kostis@REDACTED) Date: Thu, 26 Oct 2006 23:35:20 +0200 (MEST) Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) Message-ID: <200610262135.k9QLZKQL016025@spikklubban.it.uu.se> [Apologies, my first mail somehow ended up corrupt in the list.] Dominic Williams wrote: > > However, I do find that backward compatibility is too often > offered as a reason not to make some changes, particularly > of the kind that correct past mistakes. As a result, Erlang > is growing, but not cleaned up. > > I think the solution is to offer, along with the changes, > refactoring tools to bring existing code up to date. I very much agree with the comments of Dominic. In the (not so distant) past, I've seen a certain reluctance to clean up Erlang and I was never particularly convinced by the arguments which were offered to explain this reluctance. Even changes that are totally safe and in no way do not break backwards compatibility (e.g. the compiler warn about unused variables) or fix things that are obviously wrong (e.g. the compiler test that proper records are used: see +strict_record_tests) take really long time before they are made default. There is still no option to disallow two-tuples as funs... I can continue, but it would be more interesting to also read some arguments from users who are pro maintaining backwards compatibility. Kostis From robert.virding@REDACTED Fri Oct 27 00:20:40 2006 From: robert.virding@REDACTED (Robert Virding) Date: Fri, 27 Oct 2006 00:20:40 +0200 Subject: [erlang-questions] Improved regexp.erl In-Reply-To: <45409B25.1000802@ericsson.com> References: <453540AF.7040607@telia.com><17244f480610171443m80fdf62x261a9ae5f90a633a@mail.gmail.com> <453FCD8E.4090204@telia.com> <006c01c6f8c9$8bb77990$191e0bc1@it.su.se> <45409B25.1000802@ericsson.com> Message-ID: <454134B8.90901@telia.com> I agree with both of you. There is no proble doing it with the interpreted regexps but I haven't yet looked at doing it in the compiled version. and the difference in speed makes it worth it. Soon I will have a parse transform which compiles at compile-time. Saves ou doing explicit regexp:compile. Robert Mats Cronqvist wrote: > Fredrik Thulin wrote: > >> Robert Virding wrote: >> ... >> >>> What requirements do people have? >> >> >> In YXA, we still have a modified regexp.erl (modified by Magnus >> Ahltorp a long long time ago) that can return a list of all groups in >> a match. > > [...] > >> Maybe there is a way to do it with the current regexp.erl (the one in >> R11B-1 I mean), in which case I would like to know about it =) but if >> there isn't then that is a requirement for me. > > > returning list of groups is a very basic requirement. i use gregexp > from jungerl. > > mats > From sandhya.adabala@REDACTED Fri Oct 27 06:32:52 2006 From: sandhya.adabala@REDACTED (sandhya.adabala@REDACTED) Date: Fri, 27 Oct 2006 10:02:52 +0530 Subject: [erlang-questions] Erlang Nodes Reconnection problem Message-ID: <7BCD17BB75C4464D866EB5A20D5E889E0897E5@HYD-MKD-MBX01.wipro.com> Hi All, We are facing a very strange problem with erlang run time system "Erlang (BEAM) emulator version 5.3.6.3". Here is the problem: We have an erlang node running on solaris PC which communicates with another erlang node running on Linux PC. Whenever the Linux PC is halted[Solaris Erlang Node waits in a loop for reconnection to linux PC Node] and restarted after a long time say 12 hrs,the communication between the erlang nodes on Linux PC and Solaris box is not happening properly.After the long halt the solaris erlang node is able to send messages to Linux erlang node,but the replies sent by Linux PC are reaching the erlang node very late say after 2-3 hrs.We had to restart the solaris erlang node to make everything work normally.We are not facing the issue if the linux PC is halted and restarted after 1-3 Hrs. We are stuck up with this issue and couldn't progress much on this. Could any one of you help me in resolving this issue Thans & Regards, Sandhya The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bertil.karlsson@REDACTED Fri Oct 27 08:51:38 2006 From: bertil.karlsson@REDACTED (Bertil Karlsson) Date: Fri, 27 Oct 2006 08:51:38 +0200 Subject: [erlang-questions] xmerl and DTD Message-ID: <4541AC7A.9010302@ericsson.com> I tried the same as you describe below, and it works fine for me. I am using the last release of OTP. /Bertil Arndt Jonasson wrote: >I have problems using xmerl to validate an XML document using a DTD. > >The DTD looks like this: > > > > > > > >The document looks like this: > > > > > > > > > > >When I do > >xmerl_scan:file("test.xml", [{doctype_DTD, "test.dtd"}, {validation, true}]) > >I get this crash: > > 535- fatal: {failed_validation,{function_clause, > [{xmerl_validate, > choice, > [[b,c], > [], > 37, > remove, > {xmerl_scanner, > undefined, > no, > ... > From arndt@REDACTED Fri Oct 27 09:41:50 2006 From: arndt@REDACTED (Arndt Jonasson) Date: Fri, 27 Oct 2006 09:41:50 +0200 Subject: [erlang-questions] xmerl and DTD In-Reply-To: <4541AC7A.9010302@ericsson.com> References: <4541AC7A.9010302@ericsson.com> Message-ID: <17729.47166.303212.929990@jurij2.tail-f.com> Bertil Karlsson writes: > I tried the same as you describe below, and it works fine for me. > I am using the last release of OTP. Thank you! It seems I was using R10. With R11, it works for me too. From patrick.remy@REDACTED Fri Oct 27 09:49:48 2006 From: patrick.remy@REDACTED (Patrick REMY) Date: Fri, 27 Oct 2006 09:49:48 +0200 Subject: [erlang-questions] Erlang position in Paris Message-ID: <1161935388.3194.246.camel@tx1xp> Hello, We have open positions for Erlang software developers. If you are interested, see http://www.cellicium.com/ussd/team_with_us/ or have a chat with Dominic Williams or Pascal Brisset in Stockholm at the Erlang User Conference. Cheers, Patrick REMY From bengt.kleberg@REDACTED Fri Oct 27 10:13:06 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Fri, 27 Oct 2006 10:13:06 +0200 Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <200610262135.k9QLZKQL016025@spikklubban.it.uu.se> References: <200610262135.k9QLZKQL016025@spikklubban.it.uu.se> Message-ID: <4541BF92.3000305@ericsson.com> On 2006-10-26 23:35, kostis@REDACTED wrote: ...deleted > I can continue, but it would be more interesting to also read some > arguments from users who are pro maintaining backwards compatibility. perhaps the users that are _really_ interested in backwards compatibility are not on the list? i would imagine (speculation) that large commercial users that pay for erlang are more into backwards compatibility, and less into erlang-questions. as always, i could be wrong. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From chandrashekhar.mullaparthi@REDACTED Fri Oct 27 10:48:48 2006 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Fri, 27 Oct 2006 09:48:48 +0100 Subject: [erlang-questions] Erlang Nodes Reconnection problem In-Reply-To: <7BCD17BB75C4464D866EB5A20D5E889E0897E5@HYD-MKD-MBX01.wipro.com> References: <7BCD17BB75C4464D866EB5A20D5E889E0897E5@HYD-MKD-MBX01.wipro.com> Message-ID: Hi, Can you snoop on the traffic using snoop/tcpdump or some such tool and see what messages are flying on the network? Or you can try erlsnoop to observe messages being exchanged. http://www.erlang.org/contrib/erlsnoop-1.0.tgz Chandru On 27/10/06, sandhya.adabala@REDACTED wrote: > > > Hi All, > > We are facing a very strange problem with erlang run time system > "Erlang (BEAM) emulator version 5.3.6.3". > > Here is the problem: > > We have an erlang node running on solaris PC which > communicates with another erlang node running on Linux PC. > Whenever the Linux PC is halted[Solaris Erlang Node waits in a loop for > reconnection to linux PC Node] and restarted after a long time say 12 > hrs,the communication between the erlang nodes on Linux PC and Solaris box > is not happening properly.After the long halt the solaris erlang node is > able to send messages to Linux erlang node,but the replies sent by Linux > PC are reaching the erlang node very late say after 2-3 hrs.We had to > restart the solaris erlang node to make everything work normally.We are > not facing the issue if the linux PC is halted and restarted after 1-3 Hrs. > > We are stuck up with this issue and couldn't progress much > on this. > > Could any one of you help me in resolving this issue > > > Thans & Regards, > Sandhya > > > > The information contained in this electronic message and any attachments > to this message are intended for the exclusive use of the addressee(s) and > may contain proprietary, confidential or privileged information. If you are > not the intended recipient, you should not disseminate, distribute or copy > this e-mail. Please notify the sender immediately and destroy all copies of > this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient > should check this email and any attachments for the presence of viruses. The > company accepts no liability for any damage caused by any virus transmitted > by this email. > > www.wipro.com > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Fri Oct 27 11:03:53 2006 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 27 Oct 2006 11:03:53 +0200 Subject: [erlang-questions] : Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <4541BF92.3000305@ericsson.com> References: <200610262135.k9QLZKQL016025@spikklubban.it.uu.se> <4541BF92.3000305@ericsson.com> Message-ID: <20061027090353.GA6647@erix.ericsson.se> On Fri, Oct 27, 2006 at 10:13:06AM +0200, Bengt Kleberg wrote: > On 2006-10-26 23:35, kostis@REDACTED wrote: > ...deleted > > I can continue, but it would be more interesting to also read some > > arguments from users who are pro maintaining backwards compatibility. > > perhaps the users that are _really_ interested in backwards > compatibility are not on the list? > i would imagine (speculation) that large commercial users that pay for > erlang are more into backwards compatibility, and less into > erlang-questions. > > as always, i could be wrong. > I think you are sooo right. If there is _ANY_ suspicion a new release would cause _ANY_ upgrade problems the customers paying most of our salaries will _NOT_ take the new release and we will be stuck maintaining the old release forever, adding new features from new releases when they desire; essentially forking Erlang/OTP into two. And that is something we do not need. > > bengt > -- > EPO guidelines 1978: "If the contribution to the known art resides > solely in a computer program then the subject matter is not > patentable in whatever manner it may be presented in the claims." > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From francesco@REDACTED Fri Oct 27 13:05:03 2006 From: francesco@REDACTED (Francesco Cesarini) Date: Fri, 27 Oct 2006 12:05:03 +0100 Subject: [erlang-questions] Erlang position in Paris In-Reply-To: <1161935388.3194.246.camel@tx1xp> References: <1161935388.3194.246.camel@tx1xp> Message-ID: <4541E7DF.1010308@erlang-consulting.com> I've created a page in the trapexit.org wiki for people to post Erlang jobs. Patrick, I've also added yours. Feel free to edit as you please, and others, feel free to add your open positions. The URL is http://wiki.trapexit.org/index.php/ErlangJobs Regards, Francesco -- http://www.erlang-consulting.com Patrick REMY wrote: >Hello, > >We have open positions for Erlang software developers. > >If you are interested, see http://www.cellicium.com/ussd/team_with_us/ >or have a chat with Dominic Williams or Pascal Brisset in Stockholm at >the Erlang User Conference. > >Cheers, > >Patrick REMY > >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://www.erlang.org/mailman/listinfo/erlang-questions > > > > From pabloay@REDACTED Fri Oct 27 13:15:22 2006 From: pabloay@REDACTED (=?ISO-8859-1?Q?Pablo_=C1lvarez_Y=E1=F1ez?=) Date: Fri, 27 Oct 2006 13:15:22 +0200 Subject: [erlang-questions] probelm between java and erlang nodes Message-ID: Hello, I need to call java functions from an erlang program. I have seen the examples into the IC lib directory (lib/ic-4.2.11), but if I execute an erlang node calling the java node (or vice versa) I get the following error: ----> In the java server: Initialization exception : java.io.IOException: expected 2 bytes, got EOF after 0 bytes at com.ericsson.otp.erlang.AbstractConnection.readSock(AbstractConnection.java :861) at com.ericsson.otp.erlang.AbstractConnection.read2BytePackage(AbstractConnection.java:1037) at com.ericsson.otp.erlang.AbstractConnection.recvChallengeReply(AbstractConnection.java:1186) at com.ericsson.otp.erlang.AbstractConnection.doAccept(AbstractConnection.java:875) at com.ericsson.otp.erlang.AbstractConnection.(AbstractConnection.java:153) at com.ericsson.otp.erlang.OtpConnection .(OtpConnection.java:63) at com.ericsson.otp.erlang.OtpSelf.accept(OtpSelf.java:177) at server.main(server.java:39) -----> In the erlang client (client@REDACTED)1> client:call(). Init...ok ** exited: {{nodedown,babbis@REDACTED}, {gen_server,call, [{rmod_random_impl,babbis@REDACTED}, rmod_random_produce, infinity]}} ** =ERROR REPORT==== 26-Oct-2006::20:02:42 === Error in process <0.41.0> on node 'client@REDACTED' with exit value: {badarg,[{erlang,list_to_existing_atom,["babbis@REDACTED"]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]} ******************************** However, I can get communication between the java client and server (and it is supposed that they act as erlang nodes). I think it is some problem with the type conversion. I am using the Erlang last release (R11B-1). Does anybody know something about it, or how to solve the problem? Thanks -- Pablo ?lvarez Y??ez http://azulneon.blogsome.com From vladdu55@REDACTED Fri Oct 27 13:17:28 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 27 Oct 2006 13:17:28 +0200 Subject: [erlang-questions] new binaries implementation Message-ID: <95be1d3b0610270417n7a9a3782m9f46130ce1eaa46e@mail.gmail.com> Hi, What's the status on the new binaries implementation, as presented last year at EUC? The hope was it would make it into R11, but it hasn't yet. best regards, Vlad From chsu79@REDACTED Fri Oct 27 13:23:58 2006 From: chsu79@REDACTED (Christian S) Date: Fri, 27 Oct 2006 13:23:58 +0200 Subject: [erlang-questions] What is this naming convention? Message-ID: val(Var) -> case ?catch_val(Var) of {'EXIT', _ReASoN_} -> mnesia_lib:other_val(Var, _ReASoN_); _VaLuE_ -> _VaLuE_ end. from mnesia/mnesia_lib.erl is _BoReD_ProGRAMmeR_ style? From vladdu55@REDACTED Fri Oct 27 13:31:00 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 27 Oct 2006 13:31:00 +0200 Subject: [erlang-questions] probelm between java and erlang nodes In-Reply-To: References: Message-ID: <95be1d3b0610270431k2f4eddcdwfbf59c681f8c6939@mail.gmail.com> On 10/27/06, Pablo ?lvarez Y??ez wrote: > ** exited: {{nodedown,babbis@REDACTED}, > >badarg, [{erlang, list_to_existing_atom, ["babbis@REDACTED"]}, ... Hi, Look at how the node names are registered - the mismatch above might be the cause. Also, there may a problem with the name resolution because Java and Erlang look for host names in different ways. There was a thread here on the list about that recently. regards, Vlad From dgud@REDACTED Fri Oct 27 13:36:07 2006 From: dgud@REDACTED (Dan Gudmundsson) Date: Fri, 27 Oct 2006 13:36:07 +0200 Subject: [erlang-questions] What is this naming convention? In-Reply-To: References: Message-ID: <17729.61223.662572.94877@rian.du.uab.ericsson.se> Whats wrong with it... For a short time it was a macro.. /Dan Christian S writes: > val(Var) -> > case ?catch_val(Var) of > {'EXIT', _ReASoN_} -> mnesia_lib:other_val(Var, _ReASoN_); > _VaLuE_ -> _VaLuE_ > end. > > from mnesia/mnesia_lib.erl > > is _BoReD_ProGRAMmeR_ style? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From pabloay@REDACTED Fri Oct 27 13:49:10 2006 From: pabloay@REDACTED (=?ISO-8859-1?Q?Pablo_=C1lvarez_Y=E1=F1ez?=) Date: Fri, 27 Oct 2006 13:49:10 +0200 Subject: [erlang-questions] probelm between java and erlang nodes In-Reply-To: <95be1d3b0610270431k2f4eddcdwfbf59c681f8c6939@mail.gmail.com> References: <95be1d3b0610270431k2f4eddcdwfbf59c681f8c6939@mail.gmail.com> Message-ID: Hi, > Look at how the node names are registered - the mismatch above might > be the cause. > > Also, there may a problem with the name resolution because Java and > Erlang look for host names in different ways. There was a thread here > on the list about that recently. > > regards, > Vlad > Thanks. I have read the other thread. I had my old IP in the /etc/hosts file. Now everything is working well... -- Pablo ?lvarez Y??ez http://azulneon.blogsome.com From chsu79@REDACTED Fri Oct 27 13:57:03 2006 From: chsu79@REDACTED (Christian S) Date: Fri, 27 Oct 2006 13:57:03 +0200 Subject: [erlang-questions] What is this naming convention? In-Reply-To: <17729.61223.662572.94877@rian.du.uab.ericsson.se> References: <17729.61223.662572.94877@rian.du.uab.ericsson.se> Message-ID: Well, I was mostly curious if it encoded some transfer of wisdom among mnesia hackers. A secret language that say something without using comments? I'm just trying to orient myself in the codebase to see if it is possible to query an index for record's primary keys only. To allow me to use several such primary key lists and perform set intersections to implement an SQLish "... WHERE A = 1 AND B = 2", only looking up the primary keys in the intersection so less records are involved. On 10/27/06, Dan Gudmundsson wrote: > > Whats wrong with it... > > For a short time it was a macro.. > > /Dan > > Christian S writes: > > val(Var) -> > > case ?catch_val(Var) of > > {'EXIT', _ReASoN_} -> mnesia_lib:other_val(Var, _ReASoN_); > > _VaLuE_ -> _VaLuE_ > > end. > > > > from mnesia/mnesia_lib.erl > > > > is _BoReD_ProGRAMmeR_ style? > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > From bjorn@REDACTED Fri Oct 27 14:10:43 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 27 Oct 2006 14:10:43 +0200 Subject: [erlang-questions] new binaries implementation In-Reply-To: <95be1d3b0610270417n7a9a3782m9f46130ce1eaa46e@mail.gmail.com> References: <95be1d3b0610270417n7a9a3782m9f46130ce1eaa46e@mail.gmail.com> Message-ID: It will probably be included in R11B-3. /Bjorn "Vlad Dumitrescu" writes: > Hi, > > What's the status on the new binaries implementation, as presented > last year at EUC? The hope was it would make it into R11, but it > hasn't yet. > > best regards, > Vlad > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From vladdu55@REDACTED Fri Oct 27 14:17:13 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 27 Oct 2006 14:17:13 +0200 Subject: [erlang-questions] new binaries implementation In-Reply-To: References: <95be1d3b0610270417n7a9a3782m9f46130ce1eaa46e@mail.gmail.com> Message-ID: <95be1d3b0610270517y338de941n424a03633371a32c@mail.gmail.com> Wonderful, thank you! regards, Vlad On 27 Oct 2006 14:10:43 +0200, Bjorn Gustavsson wrote: > It will probably be included in R11B-3. > > /Bjorn > > "Vlad Dumitrescu" writes: > > > Hi, > > > > What's the status on the new binaries implementation, as presented > > last year at EUC? The hope was it would make it into R11, but it > > hasn't yet. > > > > best regards, > > Vlad > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From ft@REDACTED Fri Oct 27 14:18:01 2006 From: ft@REDACTED (Fredrik Thulin) Date: Fri, 27 Oct 2006 14:18:01 +0200 Subject: [erlang-questions] What is this naming convention? References: <17729.61223.662572.94877@rian.du.uab.ericsson.se> Message-ID: <043401c6f9c1$f258fb80$191e0bc1@it.su.se> Christian S wrote: > Well, I was mostly curious if it encoded some transfer of wisdom among > mnesia hackers. A secret language that say something without using > comments? ... > On 10/27/06, Dan Gudmundsson wrote: >> >> Whats wrong with it... >> >> For a short time it was a macro.. ^^^^^ This was actually the wisdom, although it sounds like it went by you. When you write a macro, you typically choose very strange variable names (if you have variables in your macro) to not accidentally 'collide' with variable names that might be used in the function 'calling' the macro. /Fredrik From ulf.wiger@REDACTED Fri Oct 27 15:16:48 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Fri, 27 Oct 2006 15:16:48 +0200 Subject: [erlang-questions] : Was Re: Bug ?! now Erlang comment (LONGLONG) In-Reply-To: <20061027090353.GA6647@erix.ericsson.se> Message-ID: Raimo Niskanen wrote: > > If there is _ANY_ suspicion a new release would cause _ANY_ > upgrade problems the customers paying most of our salaries > will _NOT_ take the new release and we will be stuck > maintaining the old release forever, adding new features from > new releases when they desire; essentially forking Erlang/OTP > into two. > > And that is something we do not need. This commercial user still recalls an OTP release back in the early days that took us three months to integrate into our system. Not all of that was OTP's fault, but there were lots of incompatibilities, several of which were not even documented, and a recompile was mandatory. This was long ago, and OTP took the opportunity to improve tremendously already in the next release. Nowadays, we don't even debate whether we should incorporate new OTP releases as they come out. It's a given, and we've gotten used to such outstanding quality that new OTP releases is regarded as an opportunity rather than as a potential source of problems - even by our project managers. Reminiscing about the good old days is fine, but I'd rather not relive them. (: BR, Ulf W From ulf.wiger@REDACTED Fri Oct 27 15:41:54 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Fri, 27 Oct 2006 15:41:54 +0200 Subject: [erlang-questions] Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <200610262135.k9QLZKQL016025@spikklubban.it.uu.se> Message-ID: Kostis wrote: > > Dominic Williams wrote: > > > > I think the solution is to offer, along with the changes, > refactoring > > tools to bring existing code up to date. > > I very much agree with the comments of Dominic. > > [...] > > I can continue, but it would be more interesting to also read > some arguments from users who are pro maintaining backwards > compatibility. I think our position on this issue is that as long as we are told about potential incompatibilities, and there are good ways to find (and perhaps fix) the affected bits of code, we try to be supportive of things that improve the language. BR, Ulf W From erlangx@REDACTED Fri Oct 27 15:55:17 2006 From: erlangx@REDACTED (Michael McDaniel) Date: Fri, 27 Oct 2006 06:55:17 -0700 Subject: [erlang-questions] probelm between java and erlang nodes In-Reply-To: References: Message-ID: <20061027135517.GT5739@delora.autosys.us> On Fri, Oct 27, 2006 at 01:15:22PM +0200, Pablo ?lvarez Y??ez wrote: > Hello, > I need to call java functions from an erlang program. I have seen the > examples into the IC lib directory (lib/ic-4.2.11), but if I execute > an erlang node calling the java node (or vice versa) I get the > following error: > > ----> In the java server: > > Initialization exception : > java.io.IOException: expected 2 bytes, got EOF after 0 bytes > at com.ericsson.otp.erlang.AbstractConnection.readSock(AbstractConnection.java > :861) > at com.ericsson.otp.erlang.AbstractConnection.read2BytePackage(AbstractConnection.java:1037) > at com.ericsson.otp.erlang.AbstractConnection.recvChallengeReply(AbstractConnection.java:1186) > at com.ericsson.otp.erlang.AbstractConnection.doAccept(AbstractConnection.java:875) > at com.ericsson.otp.erlang.AbstractConnection.(AbstractConnection.java:153) > at com.ericsson.otp.erlang.OtpConnection .(OtpConnection.java:63) > at com.ericsson.otp.erlang.OtpSelf.accept(OtpSelf.java:177) > at server.main(server.java:39) > > -----> In the erlang client > > (client@REDACTED)1> client:call(). > Init...ok > ** exited: {{nodedown,babbis@REDACTED}, > {gen_server,call, > [{rmod_random_impl,babbis@REDACTED}, > rmod_random_produce, > infinity]}} ** > > =ERROR REPORT==== 26-Oct-2006::20:02:42 === > Error in process <0.41.0> on node 'client@REDACTED' with exit value: > {badarg,[{erlang,list_to_existing_atom,["babbis@REDACTED"]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]} > > ******************************** > > However, I can get communication between the java client and server > (and it is supposed that they act as erlang nodes). I think it is some > problem with the type conversion. I am using the Erlang last release > (R11B-1). > Does anybody know something about it, or how to solve the problem? > > Thanks > > -- > Pablo ?lvarez Y??ez > http://azulneon.blogsome.com > ______________________________________________________________________ does atom 'babbis@REDACTED' already exist ? From the reference manual ... " list_to_existing_atom(String) -> atom() Types: String = string() Returns the atom whose text representation is String, but only if there already exists such atom. Failure: badarg if there does not already exist an atom whose text representation is String. " ~Michael From xpdoka@REDACTED Fri Oct 27 16:01:51 2006 From: xpdoka@REDACTED (Dominic Williams) Date: Fri, 27 Oct 2006 16:01:51 +0200 (CEST) Subject: [erlang-questions] Orber and the DII Message-ID: <44671.86.205.89.11.1161957711.squirrel@www.geekisp.com> Hello, Am I right in thinking, after a good look at the documentation, that Orber does not support the Dynamic Invocation Interface (DII) ? Cheers, Dominic Williams http://www.dominicwilliams.net ---- From nick@REDACTED Fri Oct 27 17:11:41 2006 From: nick@REDACTED (Niclas Eklund) Date: Fri, 27 Oct 2006 17:11:41 +0200 (MEST) Subject: [erlang-questions] Orber and the DII In-Reply-To: <44671.86.205.89.11.1161957711.squirrel@www.geekisp.com> Message-ID: Hello! Yes, your observation is correct, there are no official support for DII. The reason for this that it hasn't been a high prio issue (i.e. requests from customers). /Nick On Fri, 27 Oct 2006, Dominic Williams wrote: > Hello, > > Am I right in thinking, after a good look at the documentation, that Orber > does not support the Dynamic Invocation Interface (DII) ? > > Cheers, > > Dominic Williams > http://www.dominicwilliams.net > > ---- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From adam@REDACTED Fri Oct 27 17:26:34 2006 From: adam@REDACTED (Adam Lindberg) Date: Fri, 27 Oct 2006 16:26:34 +0100 Subject: [erlang-questions] Erlang Search Engine Message-ID: <6344005f0610270826x363b0b1er8a1e007ad24df06d@mail.gmail.com> Hi everyone I've just created an Erlang Search Engine with the new Google Co-op service. Try it out! http://google.com/coop/cse?cx=010191726936039894090%3Aqfrt1ypt5ey Bookmark that URL and use it whenever you need Erlang information. So far only a few sites are added, like erlang.org/.se, trapexit.org etc. But it is open! So you can add Erlang sites to it! This will improve the engine! -- Adam Lindberg, Software Developer Erlang Training & Consulting Ltd Mobile: +447960726016 401 Fruit and Wool Exchange, Brushfield Street London, E1 6EL United Kingdom http://www.erlang-consulting.com/ From adam@REDACTED Fri Oct 27 18:20:43 2006 From: adam@REDACTED (Adam Lindberg) Date: Fri, 27 Oct 2006 17:20:43 +0100 Subject: [erlang-questions] Erlang Search Engine Message-ID: <6344005f0610270920l73e4d105tcb48d13c7ae2e0e7@mail.gmail.com> Hi everyone I've just created an Erlang Search Engine with the new Google Co-op service. Try it out! http://google.com/coop/cse?cx=010191726936039894090%3Aqfrt1ypt5ey Bookmark that URL and use it whenever you need Erlang information. So far only a few sites are added, like erlang.org/.se, trapexit.org etc. But it is open! So you can add Erlang sites to it! This will improve the engine! -- Adam Lindberg, Software Developer Erlang Training & Consulting Ltd Mobile: +447960726016 401 Fruit and Wool Exchange, Brushfield Street London, E1 6EL United Kingdom http://www.erlang-consulting.com/ From chris.newcombe@REDACTED Fri Oct 27 18:59:26 2006 From: chris.newcombe@REDACTED (Chris Newcombe) Date: Fri, 27 Oct 2006 09:59:26 -0700 Subject: [erlang-questions] Thread-safety of driver_alloc/realloc/free_binary In-Reply-To: <4538CB76.4070803@ericsson.com> References: <781dd98c0610172112j7f28bb49xab82b589d9ea98ec@mail.gmail.com> <4538CB76.4070803@ericsson.com> Message-ID: <781dd98c0610270959j3c728f35n16c77f6323679046@mail.gmail.com> This is great news -- thanks. Is there a way to test at runtime if the emulator is running in smp mode? many thanks, Chris On 10/20/06, Rickard Green wrote: > They are all thread safe in the emulator with smp support, but they will > probably never be thread safe in the emulator without smp support. > > The thread unsafe part is the reference counting of binaries. Making > them thread safe would cause overhead for all reference counted > binaries, not just driver binaries. We don't want to slow down all > binary management as it is now, but we might make them thread safe in > the future if threaded drivers should become very common (but don't > count on it). > > BR, > Rickard Green, Erlang/OTP > > Chris Newcombe wrote: > > (To the maintainers of erts/emulator/beam/io.c ... ) > > > > Hi, > > > > I'm working on an update to Scott Lystig Fritchie's Erlang Driver > > Toolkit, including a significantly enhanced driver for Berkeley DB. I > > hope to be able to release this soon as open-source. > > > > The update includes features such as multiple private resizable > > threadpools per port instance (supported in both 'linked-in' and > > 'spawned-pipe' modes). > > > > One problem is that, when getting data from Berkeley DB, the driver > > needs to allocate driver binaries. Ideally, it would like to to do so > > from within the driver's private threadpools. But of course, > > driver_alloc/realloc/free_binary are not documented as thread-safe. > > > > So currently the Berkeley DB driver has to allocate each piece of data > > twice (once with malloc and later with driver_alloc_binary), and copy > > it once. And the copying is done in the Erlang scheduler thread, > > which blocks the VM unecessarily. > > > > This appears to be changing. I found the following comments in > > otp_src_R11B-1/erts/emulator/beam/io.c > > > > * - driver_alloc_binary() is thread safe (efile driver depend on it). > > * - driver_realloc_binary(), and driver_free_binary() are *not* thread safe. > > > > Unfortunately, to avoid the copying the Berkeley DB driver needs to > > call all 3 of these functions from private threads. > > > > So, please could the realloc & free functions also be made > > thread-safe, and documented as such? This would be a major > > performance benefit for many multi-threaded drivers (not just the > > efile driver mentioned in the comment), > > > > Many thanks for considering this, > > > > Chris > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > From chsu79@REDACTED Fri Oct 27 19:06:48 2006 From: chsu79@REDACTED (Christian S) Date: Fri, 27 Oct 2006 19:06:48 +0200 Subject: [erlang-questions] Erlang Search Engine In-Reply-To: <6344005f0610270920l73e4d105tcb48d13c7ae2e0e7@mail.gmail.com> References: <6344005f0610270920l73e4d105tcb48d13c7ae2e0e7@mail.gmail.com> Message-ID: Is it possible to make the url more memorable? From wilbjor@REDACTED Fri Oct 27 19:42:03 2006 From: wilbjor@REDACTED (Jordan Wilberding) Date: Fri, 27 Oct 2006 12:42:03 -0500 Subject: [erlang-questions] Erlang Search Engine In-Reply-To: References: <6344005f0610270920l73e4d105tcb48d13c7ae2e0e7@mail.gmail.com> Message-ID: <454244EB.5060905@iit.edu> Maybe Erlang.org or trapexit.org could integrate this into their site? Thanks! Jordan Wilberding Christian S wrote: > Is it possible to make the url more memorable? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From jefcrane@REDACTED Fri Oct 27 20:08:11 2006 From: jefcrane@REDACTED (Jeff Crane) Date: Fri, 27 Oct 2006 11:08:11 -0700 (PDT) Subject: [erlang-questions] : Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <20061027090353.GA6647@erix.ericsson.se> Message-ID: <20061027180811.53681.qmail@web31601.mail.mud.yahoo.com> --- Raimo Niskanen wrote: > If there is _ANY_ suspicion a new release would > cause _ANY_ upgrade > problems the customers paying most of our salaries > will _NOT_ take > the new release and we will be stuck maintaining the > old release > forever, adding new features from new releases when > they desire; > essentially forking Erlang/OTP into two. > > And that is something we do not need. If the only barrier to a language adhering to it's own standards is commercial pressure, I would think that fork is appropriate. Otherwise, the standards should be modified to be more practical (less restrictive), since that ends up being the overriding factor in deciding changes to the language. Personally I would love to see less arcane "having to learn about a package implementations" (mnesia), while trying to learn Erlang. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From ulf@REDACTED Fri Oct 27 23:16:56 2006 From: ulf@REDACTED (Ulf Wiger) Date: Fri, 27 Oct 2006 23:16:56 +0200 Subject: [erlang-questions] : Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <20061027180811.53681.qmail@web31601.mail.mud.yahoo.com> References: <20061027180811.53681.qmail@web31601.mail.mud.yahoo.com> Message-ID: Den 2006-10-27 20:08:11 skrev Jeff Crane : > If the only barrier to a language adhering to it's own > standards is commercial pressure, I would think that > fork is appropriate. Otherwise, the standards should > be modified to be more practical (less restrictive), > since that ends up being the overriding factor in > deciding changes to the language. I'm sorry, but I don't quite understand what you're trying to say. What standards? Since Erlang is Open Source, there is of course nothing stopping you from forking. There have, in fact, been competing versions of Erlang in the past (e.g. HiPE, ETOS), but I've gotten the impression that several users stick with the Ericsson distribution since they really want something that is as reliable as possible. A conservative stance on backwards compatibility tends to come with the territory if you want to boast having your products running in several "five nines" installations. But as Erlang grows into different markets, perhaps there will eventually be sufficient interest in a sligthly different, perhaps "sexier" Erlang, that a fork may stand a chance of attracting enough users. Maybe after 14 years, I've gotten so used to Erlang's quirks that I'm blind to the need for a more aggressive stance on language evolution. But I still think it would be much more fruitful to spend some energy on developing good analysis and refactoring tools to help migrate the millions of lines of existing Erlang code to new, incompatible versions of the language. BR, Ulf W -- Ulf Wiger From yarivvv@REDACTED Fri Oct 27 23:19:49 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Fri, 27 Oct 2006 17:19:49 -0400 Subject: [erlang-questions] ErlyWeb Message-ID: <17244f480610271419m793d723cj3f89e8f1e00648f7@mail.gmail.com> Hi, I created a nice MVC framework for Erlang designed to work with Yaws and make the development of database-driven webapps a snap. You can check out this link for more info: http://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erlang-twist-on-web-framworks Please let me know of any bugs, suggestions, etc. Cheers, Yariv From bob@REDACTED Sat Oct 28 00:04:02 2006 From: bob@REDACTED (Bob Ippolito) Date: Fri, 27 Oct 2006 15:04:02 -0700 Subject: [erlang-questions] : Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: References: <20061027180811.53681.qmail@web31601.mail.mud.yahoo.com> Message-ID: <6a36e7290610271504n208f3929g4fef4589c0368b3f@mail.gmail.com> On 10/27/06, Ulf Wiger wrote: > Den 2006-10-27 20:08:11 skrev Jeff Crane : > > > If the only barrier to a language adhering to it's own > > standards is commercial pressure, I would think that > > fork is appropriate. Otherwise, the standards should > > be modified to be more practical (less restrictive), > > since that ends up being the overriding factor in > > deciding changes to the language. > > I'm sorry, but I don't quite understand what you're > trying to say. What standards? > > Since Erlang is Open Source, there is of course nothing > stopping you from forking. There have, in fact, been > competing versions of Erlang in the past (e.g. HiPE, > ETOS), but I've gotten the impression that several > users stick with the Ericsson distribution since they > really want something that is as reliable as possible. > > A conservative stance on backwards compatibility tends > to come with the territory if you want to boast having > your products running in several "five nines" > installations. But as Erlang grows into different markets, > perhaps there will eventually be sufficient interest in > a sligthly different, perhaps "sexier" Erlang, that a > fork may stand a chance of attracting enough users. > > Maybe after 14 years, I've gotten so used to Erlang's > quirks that I'm blind to the need for a more aggressive > stance on language evolution. But I still think it > would be much more fruitful to spend some energy on > developing good analysis and refactoring tools to > help migrate the millions of lines of existing Erlang > code to new, incompatible versions of the language. As a relatively new user to Erlang there's only three things that I've noticed that would've helped me out in any significant way: 1. Better record syntax. Current syntax is very repetitive. It's also not obvious how to do "schema evolution" of records without changing their name (at least temporarily). I think I'd be very happy with "structs" as proposed by Joe Armstrong in 2001 [1] -- the performance characteristics of records are much less important to me than having a data structure with named fields for maintainability. 2. Bit matching syntax. All of my gripes seem to have been addressed at EUC 05 in the "Bit-level Binaries and Generalized Comprehensions in Erlang" paper [2], but are not yet in an OTP release. 3. Easier ways to do parse transforms. There are places in code where I want to do very predictable things based on a static lookup table that I'd like to have in compiled code. I started doing this by -define()'ing a big static tuple, but I've noticed that the VM does a very bad job if you stick a giant constant tuple in a function whose sole purpose is to pull a record out of it. For some reason the tuple gets allocated and deallocated a lot, rather than being constant in the module (HiPE optimized this case correctly, but I don't always compile with HiPE). ... of course better error reporting would always help, e.g. for a missing comma or a semicolon where it does not belong would help. Sometimes the error ends up with a nonsense line number (e.g. end of module). However, one quickly gets used to writing code with a very low occurrence of these sorts of errors, and also it becomes much easier to track such errors down. This was really only part of the learning curve, rather than a consistent problem. [1] http://www.erlang.org/ml-archive/erlang-questions/200301/msg00103.html [2] http://www.erlang.se/euc/05/1640PerKostis.pdf Note that NONE of these are backwards incompatible changes. I'm quite happy with Erlang as it is, but there are obvious ways to improve it. It also seems that other people have already thought of *and* implemented these things, it just takes time to migrate to the OTP distribution. As a point of reference Python, Erlang, JavaScript, and C are currently my main languages (in roughly that order of preference and use). -bob From ulf@REDACTED Sat Oct 28 01:14:38 2006 From: ulf@REDACTED (Ulf Wiger) Date: Sat, 28 Oct 2006 01:14:38 +0200 Subject: [erlang-questions] : Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <6a36e7290610271504n208f3929g4fef4589c0368b3f@mail.gmail.com> References: <20061027180811.53681.qmail@web31601.mail.mud.yahoo.com> <6a36e7290610271504n208f3929g4fef4589c0368b3f@mail.gmail.com> Message-ID: Den 2006-10-28 00:04:02 skrev Bob Ippolito : > As a relatively new user to Erlang there's only three > things that I've noticed that would've helped me out > in any significant way: > > 1. Better record syntax. Current syntax is very repetitive. > It's also not obvious how to do "schema evolution" of records > without changing their name (at least temporarily). Agreed. > I think I'd be very happy with "structs" as proposed by Joe > Armstrong in 2001 [1] -- the performance characteristics of > records are much less important to me than having a data > structure with named fields for maintainability. I think it's mainly a matter of time before there's a replacement for records. It is widely agreed that there is a need for something like 'structs', but there are a couple of ideas on what that something should look like, and then there is the matter of coming up with an efficient implementation. > 2. Bit matching syntax. All of my gripes seem to have > been addressed at EUC 05 in the "Bit-level Binaries and > Generalized Comprehensions in Erlang" paper [2], but are > not yet in an OTP release. As I understood Bj?rn G's recent post, this is forthcoming. I believe this is great. > 3. Easier ways to do parse transforms. There are places > in code where I want to do very predictable things based > on a static lookup table that I'd like to have in compiled > code. How funny. I just wrote such a parse transform yesterday. (: I was quite pleased with how it turned out. I pretty much used the exprecs module from the user contributions at trap_exit. I agree that parse transforms should be easier. I've made a few attempts at making it so. There should really be a reusable library, and I think that one could be made, perhaps based on e.g. the exprecs module, or at least along the same lines (using syntax_tools). Some things, like how to do proper error reporting from within a parse transform, are undocumented. It took me a while to figure out how to do it. > http://www.erlang.org/ml-archive/erlang-questions/200301/msg00103.html > [2] http://www.erlang.se/euc/05/1640PerKostis.pdf > Note that NONE of these are backwards incompatible changes. > I'm quite happy with Erlang as it is, but there are obvious > ways to improve it. There is some low-hanging fruit, where Open Source users can easily help out. Adding structs, or things like the bit syntax additions, are certainly more daunting tasks. > It also seems that other people have already thought of *and* > implemented these things, it just takes time to migrate to the > OTP distribution. The time it takes for changes to migrate into OTP can depend on a number of things: - Some of the proposed changes offer a partial solution, but in order to make it into OTP, 'someone' has to finish the job, write the documentation and test suites, etc. It would be easier to help with this if the OTP documentation sources and test suites were available, of course. There are reasons why they aren't at this time, but it may change (some of the test suites are in fact available.) - Someone usually needs to at least consider things like sanity, consistency and generality. This process can be helped by doing a short write-up as part of the contribution. These things take time, and if the OTP team has to do all of it, it will of course slow down the process. - IPR issues are something that a company like Ericsson has to take seriously, since (being a big company) it's a rather likely target of copyright law suits. Sometimes, it can be a lot easier to simply leave certain libraries outside of OTP, because - let's face it - reverse patent searches are virtually impossible to conduct. BR, Ulf W -- Ulf Wiger From rickard.s.green@REDACTED Sat Oct 28 01:40:28 2006 From: rickard.s.green@REDACTED (Rickard Green) Date: Sat, 28 Oct 2006 01:40:28 +0200 Subject: [erlang-questions] Thread-safety of driver_alloc/realloc/free_binary In-Reply-To: <781dd98c0610270959j3c728f35n16c77f6323679046@mail.gmail.com> References: <781dd98c0610172112j7f28bb49xab82b589d9ea98ec@mail.gmail.com> <4538CB76.4070803@ericsson.com> <781dd98c0610270959j3c728f35n16c77f6323679046@mail.gmail.com> Message-ID: <454298EC.5070005@ericsson.com> It is currently not possible to test whether it is an emulator with smp support or not from the driver, but this will be possible some time in the future. From an Erlang program you can use erlang:system_info(smp_support) (since R11B-0). Compile two versions of the driver and decide which one to load based on the result returned from erlang:system_info(smp_support). BR, Rickard Green, Erlang/OTP Chris Newcombe wrote: > This is great news -- thanks. > > Is there a way to test at runtime if the emulator is running in smp mode? > > many thanks, > > Chris > > On 10/20/06, Rickard Green wrote: >> They are all thread safe in the emulator with smp support, but they will >> probably never be thread safe in the emulator without smp support. >> >> The thread unsafe part is the reference counting of binaries. Making >> them thread safe would cause overhead for all reference counted >> binaries, not just driver binaries. We don't want to slow down all >> binary management as it is now, but we might make them thread safe in >> the future if threaded drivers should become very common (but don't >> count on it). >> >> BR, >> Rickard Green, Erlang/OTP >> >> Chris Newcombe wrote: >> > (To the maintainers of erts/emulator/beam/io.c ... ) >> > >> > Hi, >> > >> > I'm working on an update to Scott Lystig Fritchie's Erlang Driver >> > Toolkit, including a significantly enhanced driver for Berkeley DB. I >> > hope to be able to release this soon as open-source. >> > >> > The update includes features such as multiple private resizable >> > threadpools per port instance (supported in both 'linked-in' and >> > 'spawned-pipe' modes). >> > >> > One problem is that, when getting data from Berkeley DB, the driver >> > needs to allocate driver binaries. Ideally, it would like to to do so >> > from within the driver's private threadpools. But of course, >> > driver_alloc/realloc/free_binary are not documented as thread-safe. >> > >> > So currently the Berkeley DB driver has to allocate each piece of data >> > twice (once with malloc and later with driver_alloc_binary), and copy >> > it once. And the copying is done in the Erlang scheduler thread, >> > which blocks the VM unecessarily. >> > >> > This appears to be changing. I found the following comments in >> > otp_src_R11B-1/erts/emulator/beam/io.c >> > >> > * - driver_alloc_binary() is thread safe (efile driver depend on it). >> > * - driver_realloc_binary(), and driver_free_binary() are *not* >> thread safe. >> > >> > Unfortunately, to avoid the copying the Berkeley DB driver needs to >> > call all 3 of these functions from private threads. >> > >> > So, please could the realloc & free functions also be made >> > thread-safe, and documented as such? This would be a major >> > performance benefit for many multi-threaded drivers (not just the >> > efile driver mentioned in the comment), >> > >> > Many thanks for considering this, >> > >> > Chris >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://www.erlang.org/mailman/listinfo/erlang-questions >> > >> > From bjorn@REDACTED Sat Oct 28 07:38:31 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 28 Oct 2006 07:38:31 +0200 Subject: [erlang-questions] : Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: <6a36e7290610271504n208f3929g4fef4589c0368b3f@mail.gmail.com> References: <20061027180811.53681.qmail@web31601.mail.mud.yahoo.com> <6a36e7290610271504n208f3929g4fef4589c0368b3f@mail.gmail.com> Message-ID: "Bob Ippolito" writes: [...] > I started doing this by > -define()'ing a big static tuple, but I've noticed that the VM does a > very bad job if you stick a giant constant tuple in a function whose > sole purpose is to pull a record out of it. For some reason the tuple > gets allocated and deallocated a lot, rather than being constant in > the module (HiPE optimized this case correctly, but I don't always > compile with HiPE). We are working on that. A future release will support a constant pool for each module. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From jces@REDACTED Sat Oct 28 08:09:32 2006 From: jces@REDACTED (jces@REDACTED) Date: Fri, 27 Oct 2006 23:09:32 -0700 Subject: [erlang-questions] 'embedded' erlang? Message-ID: <200610280609.k9S69Wjr028269@mail.monad.com> Googling around, I think I've seen this come up once or twice w/out anything produced (I'm not saying that is bad, I'm not expecting to produce anything myself, I'm just seeing it as a still open research topic)... Anybody have a guess what the minimum size of Erlang might be, with an eye towards embedded - or at least portable - systems? They can be pretty well-endowed with decent CPU'S (tho usually no FPU) and a decent few gigs of flash RAM. I wonder to what extent the ideas behind the VM could be implemented on top of some other VM that has embedded versions (JME)? There's the Scala actors stuff which looks interesting, if it keeps on being developed. (Tho I'd rather just be able to have a device that can run Linux and thus Erlang "directly".) From dmitrii@REDACTED Sat Oct 28 08:42:35 2006 From: dmitrii@REDACTED (Dmitrii Dimandt) Date: Sat, 28 Oct 2006 09:42:35 +0300 Subject: [erlang-questions] Erlang Search Engine In-Reply-To: <6344005f0610270826x363b0b1er8a1e007ad24df06d@mail.gmail.com> References: <6344005f0610270826x363b0b1er8a1e007ad24df06d@mail.gmail.com> Message-ID: On 10/27/06, Adam Lindberg wrote: > > Hi everyone > > I've just created an Erlang Search Engine with the new Google Co-op > service. Try it out! > http://google.com/coop/cse?cx=010191726936039894090%3Aqfrt1ypt5ey > > Bookmark that URL and use it whenever you need Erlang information. So > far only a few sites are added, like erlang.org/.se, trapexit.org etc. > > But it is open! So you can add Erlang sites to it! This will improve the > engine! Hmm... Do we need to volunteer to contribute in order to add sites? I've volunteered :) Actually, I wanted to add Yariv Sadan's blog to the engine :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias@REDACTED Sat Oct 28 10:06:07 2006 From: matthias@REDACTED (Matthias Lang) Date: Sat, 28 Oct 2006 10:06:07 +0200 Subject: [erlang-questions] 'embedded' erlang? In-Reply-To: <200610280609.k9S69Wjr028269@mail.monad.com> References: <200610280609.k9S69Wjr028269@mail.monad.com> Message-ID: <17731.3951.106792.453808@antilipe.corelatus.se> jces@REDACTED writes: > Googling around, I think I've seen this come up once or twice w/out > anything produced (I'm not saying that is bad, I'm not expecting to > produce anything myself, I'm just seeing it as a still open research > topic)... Anybody have a guess what the minimum size of Erlang might be, > with an eye towards embedded - or at least portable - systems? They can be > pretty well-endowed with decent CPU'S (tho usually no FPU) and a decent > few gigs of flash RAM. Flash space: if you start with Erlang/OTP and strip it without actually changing anything, it's reasonably straightforward to fit Erlang/OTP into 3MByte of disk space. There are several companies who have independently done that for products. DRAM/CPU grunt: Corelatus' original generation of hardware, which has been in live service at dozens of sites for years, runs Erlang just fine on a 50MHz FPU-less CPU with 32MB of DRAM. Independently, Brian Zhou has Erlang running on a chewing-gum-packet sized linux box called a 'gumstix'. See also: http://wiki.trapexit.org/index.php/Cross_compiling So, for what I call practical purposes, it's a closed topic. It's been done, it works, anyone competent can do it, nobody's going to get a PhD and no space in academic journals needs to be filled. > I wonder to what extent the ideas behind the VM could be implemented on > top of some other VM that has embedded versions (JME)? There's the Scala > actors stuff which looks interesting, if it keeps on being > developed. I guess this is where the research is... Given the rapid rate of extinction of hardware as wimpy as my above examples, it's hard for unimaginative people like me to see the point of trying to "go even smaller". Matthias From dmitrii@REDACTED Sat Oct 28 10:35:21 2006 From: dmitrii@REDACTED (Dmitrii Dimandt) Date: Sat, 28 Oct 2006 11:35:21 +0300 Subject: [erlang-questions] ErlyWeb In-Reply-To: <17244f480610271419m793d723cj3f89e8f1e00648f7@mail.gmail.com> References: <17244f480610271419m793d723cj3f89e8f1e00648f7@mail.gmail.com> Message-ID: On 10/28/06, Yariv Sadan wrote: > > Hi, > > I created a nice MVC framework for Erlang designed to work with Yaws > and make the development of database-driven webapps a snap. > > You can check out this link for more info: > > > http://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erlang-twist-on-web-framworks > > Please let me know of any bugs, suggestions, etc. Currently ErlyWeb creates the following directory structure: /apps/music/components/musician.erl /apps/music/components/musician_controller.erl /apps/music/components/musician_view.erl It might be easier for a large web app to keep controllers and views in separate folders, like so: /apps/music/components/controllers/musician_controller.erl /apps/music/components/views/musician_view.erl -------------- next part -------------- An HTML attachment was scrubbed... URL: From kg9020@REDACTED Sat Oct 28 17:28:48 2006 From: kg9020@REDACTED (a) Date: Sat, 28 Oct 2006 10:28:48 -0500 Subject: [erlang-questions] asterisk pbx Message-ID: Hello, I just came from Astricon in Dallas, And I noticed several issues brought up that possily erlang could solve ... i am not a developer and I have just be exposed to erlang as of this summer. Has anyone thought of this ..... open source pbx built on a open source teleco grade lang like Erlang ??? From orbitz@REDACTED Sat Oct 28 17:53:33 2006 From: orbitz@REDACTED (orbitz@REDACTED) Date: Sat, 28 Oct 2006 11:53:33 -0400 Subject: [erlang-questions] asterisk pbx In-Reply-To: References: Message-ID: No, nobody has thought of that. On Oct 28, 2006, at 11:28 AM, a wrote: > Hello, > > I just came from Astricon in Dallas, > > And I noticed several issues brought up that possily erlang could > solve ... i am not a developer and I have just be exposed to erlang > as of this summer. > > Has anyone thought of this ..... open source pbx built on a open > source teleco grade lang like Erlang ??? > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From b88zhou@REDACTED Sat Oct 28 18:34:19 2006 From: b88zhou@REDACTED (Brian Zhou) Date: Sat, 28 Oct 2006 16:34:19 +0000 (UTC) Subject: [erlang-questions] 'embedded' erlang? References: <200610280609.k9S69Wjr028269@mail.monad.com> <17731.3951.106792.453808@antilipe.corelatus.se> Message-ID: Matthias Lang corelatus.se> writes: > > DRAM/CPU grunt: Corelatus' original generation of hardware, which has > been in live service at dozens of sites for years, runs Erlang just > fine on a 50MHz FPU-less CPU with 32MB of DRAM. Independently, Brian > Zhou has Erlang running on a chewing-gum-packet sized linux box called > a 'gumstix'. > A correction to the detail, the device I cross built erlang to run is linksys nslu2 - http://www.amazon.com/Linksys-Storage-Disk-Drives-NSLU2/dp/B0001FSCZO/sr=8-1/qid=1162053095 which has 266MHz ARM CPU, 32MB RAM, and USB for storage. > > See also: > > http://wiki.trapexit.org/index.php/Cross_compiling > I've added pointers to nslu2 (optware) mk file and openembedded bitbake recipe to the wiki page. Cheers, -Brian From b88zhou@REDACTED Sat Oct 28 18:45:49 2006 From: b88zhou@REDACTED (Brian Zhou) Date: Sat, 28 Oct 2006 16:45:49 +0000 (UTC) Subject: [erlang-questions] ErlyWeb References: <17244f480610271419m793d723cj3f89e8f1e00648f7@mail.gmail.com> Message-ID: Yariv Sadan gmail.com> writes: > > Hi, > > I created a nice MVC framework for Erlang designed to work with Yaws > and make the development of database-driven webapps a snap. > > You can check out this link for more info: > > http://yarivsblog.com/articles/2006/10/27/introducing-erlyweb-the-erlang-twist-on-web-framworks > > Please let me know of any bugs, suggestions, etc. > > Cheers, > Yariv > Java has servlet and filter, python has wsgi (one simple interface that brings order to python web development), what is Erlang's way for web component interoperatability? -Brian From matthias@REDACTED Sat Oct 28 22:17:47 2006 From: matthias@REDACTED (Matthias Lang) Date: Sat, 28 Oct 2006 22:17:47 +0200 Subject: [erlang-questions] 'embedded' erlang? In-Reply-To: References: <200610280609.k9S69Wjr028269@mail.monad.com> <17731.3951.106792.453808@antilipe.corelatus.se> Message-ID: <17731.47851.960983.905415@antilipe.corelatus.se> Matthias > > Independently, Brian Zhou has Erlang running on a Matthias > > chewing-gum-packet sized linux box called a 'gumstix'. Brian > A correction to the detail, the device I cross built erlang Brian > to run is linksys nslu2 Oh, ok. So, there _two_ small-ish, cheap-ish devices running recent versions of Erlang, the nslu2 via you and the gumstix via Pascal Brisset: http://www.erlang.org/ml-archive/erlang-questions/200511/msg00078.html Brian > I've added pointers to nslu2 (optware) mk file and Brian > openembedded bitbake recipe to the wiki page. Thanks. Matthias From david.nospam.hopwood@REDACTED Sat Oct 28 22:32:08 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Sat, 28 Oct 2006 21:32:08 +0100 Subject: [erlang-questions] Erlang Nodes Reconnection problem In-Reply-To: <7BCD17BB75C4464D866EB5A20D5E889E0897E5@HYD-MKD-MBX01.wipro.com> References: <7BCD17BB75C4464D866EB5A20D5E889E0897E5@HYD-MKD-MBX01.wipro.com> Message-ID: <4543BE48.2050801@blueyonder.co.uk> sandhya.adabala@REDACTED wrote: > We are facing a very strange problem with erlang run time system > "Erlang (BEAM) emulator version 5.3.6.3". > > Here is the problem: > We have an erlang node running on solaris PC which > communicates with another erlang node running on Linux PC. > Whenever the Linux PC is halted[Solaris Erlang Node waits in a loop for > reconnection to linux PC Node] and restarted after a long time say 12 > hrs,the communication between the erlang nodes on Linux PC and Solaris > box is not happening properly.After the long halt the solaris erlang > node is able to send messages to Linux erlang node,but the replies sent > by Linux PC are reaching the erlang node very late say after 2-3 hrs. That sounds like a symptom of a retry timer with an exponential backoff, which has not been limited to a maximum duration between retries. I don't know where such a timer would be in Erlang/OTP. -- David Hopwood From yarivvv@REDACTED Sat Oct 28 22:46:44 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Sat, 28 Oct 2006 16:46:44 -0400 Subject: [erlang-questions] ErlyWeb In-Reply-To: References: <17244f480610271419m793d723cj3f89e8f1e00648f7@mail.gmail.com> Message-ID: <17244f480610281346g6b8137dewaa0e6768db008dc8@mail.gmail.com> I thought about this folder structure, and my opinion was that the nested folder structure is unnecessary for the majority of applications. Having a flat directory makes it easy to open files in an IDE such as emacs, and it also allows you to easily install 3rd party components by dragging and dropping. I think ErlyWeb should support the nested structure if you want it, but it shouldn't be the default. BR Yariv > > Currently ErlyWeb creates the following directory structure: > /apps/music/components/musician.erl > /apps/music/components/musician_controller.erl > /apps/music/components/musician_view.erl > > It might be easier for a large web app to keep controllers and views in > separate folders, like so: > /apps/music/components/controllers/musician_controller.erl > /apps/music/components/views/musician_view.erl > From mikael.karlsson@REDACTED Sun Oct 29 08:45:08 2006 From: mikael.karlsson@REDACTED (Mikael Karlsson) Date: Sun, 29 Oct 2006 08:45:08 +0100 Subject: [erlang-questions] ErlyWeb In-Reply-To: <17244f480610281346g6b8137dewaa0e6768db008dc8@mail.gmail.com> References: <17244f480610271419m793d723cj3f89e8f1e00648f7@mail.gmail.com> <17244f480610281346g6b8137dewaa0e6768db008dc8@mail.gmail.com> Message-ID: <200610290845.09114.mikael.karlsson@creado.com> ErlyWeb looks great ! A flat directory structure is probably enough for most thing. If you consider a nested structure I suggest you use the "erlang packages" extension by Richard Carlsson. It is included in Erlang, but not so well documented for some reason. http://www.erlang.se/publications/packages.html http://www.it.uu.se/research/publications/reports/2000-001/ Regards Mikael l?rdag 28 oktober 2006 22:46 skrev Yariv Sadan: > I thought about this folder structure, and my opinion was that the > nested folder structure is unnecessary for the majority of > applications. Having a flat directory makes it easy to open files in > an IDE such as emacs, and it also allows you to easily install 3rd > party components by dragging and dropping. > > I think ErlyWeb should support the nested structure if you want it, > but it shouldn't be the default. > > BR > Yariv > > > Currently ErlyWeb creates the following directory structure: > > /apps/music/components/musician.erl > > /apps/music/components/musician_controller.erl > > /apps/music/components/musician_view.erl > > > > It might be easier for a large web app to keep controllers and views in > > separate folders, like so: > > /apps/music/components/controllers/musician_controller.erl > > /apps/music/components/views/musician_view.erl > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From alex.arnon@REDACTED Sun Oct 29 10:18:00 2006 From: alex.arnon@REDACTED (Alex Arnon) Date: Sun, 29 Oct 2006 11:18:00 +0200 Subject: [erlang-questions] asterisk pbx In-Reply-To: References: Message-ID: <944da41d0610290118t2788d590m18b8d55d7cb309e3@mail.gmail.com> Yes that's right, move along, nothing to see here :) On 10/28/06, orbitz@REDACTED wrote: > > No, nobody has thought of that. > > On Oct 28, 2006, at 11:28 AM, a wrote: > > > Hello, > > > > I just came from Astricon in Dallas, > > > > And I noticed several issues brought up that possily erlang could > > solve ... i am not a developer and I have just be exposed to erlang > > as of this summer. > > > > Has anyone thought of this ..... open source pbx built on a open > > source teleco grade lang like Erlang ??? > > > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From surindar.shanthi@REDACTED Sun Oct 29 10:38:21 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Sun, 29 Oct 2006 15:08:21 +0530 Subject: [erlang-questions] : Erlang shell crashes In-Reply-To: <20061026103050.GA5392@erix.ericsson.se> References: <42ea5fb60610252309g859afc8w5d6d731b9b78d154@mail.gmail.com> <20061026072144.GA27213@erix.ericsson.se> <42ea5fb60610260221t20a5270fs530682cea2d95fe@mail.gmail.com> <20061026103050.GA5392@erix.ericsson.se> Message-ID: <42ea5fb60610290138x7be59af7jd4c706da08c817ff@mail.gmail.com> I have found that tail recursive function is found in the logwriter process. I have fixed that and again ran that application. It again crashes after 4 hours. Some processes has very high message q length. The slogan of crash report is *eheap_alloc: Cannot allocate 373664380 bytes of memory (of type "old_heap"). * Is there any settings available to solve this problem? On 10/26/06, Raimo Niskanen wrote: > > On Thu, Oct 26, 2006 at 02:51:22PM +0530, Surindar Sivanesan wrote: > > >From the crash dump viewer, I have noticed that the stack+heap size and > > message queue lenght are high for some processes. > > > > If the message queue length is high for some processes that mostly > means that they do not read messages as they should. Message queue > lengths are mostly 1 or 0. > > The question is probably: what did they do instead of receive? > (Fill the heap!?) The stackdump (in the crashdump viewer) may tell. > > > > > Pid > > > Name/Spawned > > as< > http://localhost:8888/cdv_erl/crashdump_viewer/sort_procs?sort=name_func> > > State < > http://localhost:8888/cdv_erl/crashdump_viewer/sort_procs?sort=state> > > Reductions< > http://localhost:8888/cdv_erl/crashdump_viewer/sort_procs?sort=reds> > > Stack+heap< > http://localhost:8888/cdv_erl/crashdump_viewer/sort_procs?sort=mem> > > *MsgQ > > Length< > http://localhost:8888/cdv_erl/crashdump_viewer/sort_procs?sort=msg_q_len> > > * > > <0.128.0>< > http://localhost:8888/cdv_erl/crashdump_viewer/proc_details?pid=<0.128.0>> > > controling_process Waiting 162446666 10946 380465 > > <0.60.0>< > http://localhost:8888/cdv_erl/crashdump_viewer/proc_details?pid=<0.60.0>> > > logwriter Garbing (limited info) 12549099 93416095 272345 > > > > Here, the *logwriter* uses ODBC connectivity and write the log to MS SQL > DB. > > All the other process in this application uses *logwriter *process to > > write log. > > > > On 10/26/06, Raimo Niskanen > wrote: > > > > > >It seems your application has a process that is growing continously, > > >and after 15 hours its attemt to allocate a 356 MByte heap failed > > >due to insufficient memory. > > > > > >Your total allocated memory is 1060 MByte of which roughly 356 MByte > > >should be the old heap of the offendng process, leaving 704 MByte > > >for the rest of the beam emulator. That is also a large emulator. > > >Is your application deliberately using lots of memory? > > > > > >You can use the crashdump_viewer to inspect the crashdump and find out > > >more about the offending process. You can also use 'top' from another > > >OS shell while your application runs to verify that the beam > > >emulator is growing continously and slowly, that being a fatal problem. > > > > > >The beam emulator's OS process ID can be found with os:getpid(). > > > > > >On Thu, Oct 26, 2006 at 11:39:13AM +0530, Surindar Sivanesan wrote: > > >> Dear all, > > >> > > >> I'm using erlang emulator version 5.4.3 for running an application > that > > >has > > >> to be run round the clock. > > >> The application has ran perfectly for more than 15 hours. > > >> Then the erlang shell is terminated abnormally. > > >> The general information of the crash report is > > >> > > >> Slogan eheap_alloc: Cannot allocate 373664380 bytes of memory (of > type > > >> "heap"). Node name 'nonode@REDACTED' Crashdump created on Thu Oct 26 > > >08:48:46 > > >> 2006 System version Erlang (BEAM) emulator version 5.4.3 [threads:0] > > >> Compiled > > >> Wed Dec 15 12:59:41 2004 Memory allocated 1111921780 bytes Atoms 5644 > > >> Processes > > >> 716 ETS tables 76 Funs 370 > > >> > > >> Whether any latest erlang version can solve this problem? > > >> Is there any settings available to solve this problem? > > >> I'm running erlang using werl.exe; Whether running erlang using > > >erl.exewill > > >> show any difference? > > >> Please clarify... > > >> Thanks in advance. > > >> > > >> -- > > >> with regards, > > >> S.Surindar > > > > > >> _______________________________________________ > > >> erlang-questions mailing list > > >> erlang-questions@REDACTED > > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > >-- > > > > > >/ Raimo Niskanen, Erlang/OTP, Ericsson AB > > > > > > > > > > > -- > > with regards, > > S.Surindar > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.hinde@REDACTED Sun Oct 29 19:50:06 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Sun, 29 Oct 2006 18:50:06 +0000 Subject: [erlang-questions] : Erlang shell crashes In-Reply-To: <42ea5fb60610290138x7be59af7jd4c706da08c817ff@mail.gmail.com> References: <42ea5fb60610252309g859afc8w5d6d731b9b78d154@mail.gmail.com> <20061026072144.GA27213@erix.ericsson.se> <42ea5fb60610260221t20a5270fs530682cea2d95fe@mail.gmail.com> <20061026103050.GA5392@erix.ericsson.se> <42ea5fb60610290138x7be59af7jd4c706da08c817ff@mail.gmail.com> Message-ID: <6A732B6B-E88A-4262-BC68-818C21B126B5@gmail.com> Hi, Unfortunately this problem cannot be fixed by switching a magic flag. It must be fixed in your application. If you have parts of the system producing async messages faster than the process that consumes them is scheduled then you *will* run out of memory. The solution is probably as simple as using gen_server:call instead of gen_server:cast. Sean On 29 Oct 2006, at 09:38, Surindar Sivanesan wrote: > I have found that tail recursive function is found in the logwriter > process. > I have fixed that and again ran that application. > It again crashes after 4 hours. > Some processes has very high message q length. > The slogan of crash report is eheap_alloc: Cannot allocate > 373664380 bytes of memory (of type "old_heap"). > Is there any settings available to solve this problem? > > > > On 10/26/06, Raimo Niskanen questions@REDACTED> wrote: On Thu, Oct 26, 2006 at > 02:51:22PM +0530, Surindar Sivanesan wrote: > > >From the crash dump viewer, I have noticed that the stack+heap > size and > > message queue lenght are high for some processes. > > > > If the message queue length is high for some processes that mostly > means that they do not read messages as they should. Message queue > lengths are mostly 1 or 0. > > The question is probably: what did they do instead of receive? > (Fill the heap!?) The stackdump (in the crashdump viewer) may tell. > > > > > Pid < http://localhost:8888/cdv_erl/crashdump_viewer/sort_procs? > sort=pid> > > Name/Spawned > > as sort=name_func > > > State sort=state> > > Reductions< http://localhost:8888/cdv_erl/crashdump_viewer/ > sort_procs?sort=reds> > > Stack+heap sort_procs?sort=mem > > > *MsgQ > > Length sort=msg_q_len> > > * > > < 0.128.0> proc_details?pid=<0.128.0>> > > controling_process Waiting 162446666 10946 380465 > > <0.60.0> proc_details?pid=<0.60.0>> > > logwriter Garbing (limited info) 12549099 93416095 272345 > > > > Here, the *logwriter* uses ODBC connectivity and write the log to > MS SQL DB. > > All the other process in this application uses *logwriter > *process to > > write log. > > > > On 10/26/06, Raimo Niskanen < raimo+erlang- > questions@REDACTED> wrote: > > > > > >It seems your application has a process that is growing > continously, > > >and after 15 hours its attemt to allocate a 356 MByte heap failed > > >due to insufficient memory. > > > > > >Your total allocated memory is 1060 MByte of which roughly 356 > MByte > > >should be the old heap of the offendng process, leaving 704 MByte > > >for the rest of the beam emulator. That is also a large emulator. > > >Is your application deliberately using lots of memory? > > > > > >You can use the crashdump_viewer to inspect the crashdump and > find out > > >more about the offending process. You can also use 'top' from > another > > >OS shell while your application runs to verify that the beam > > >emulator is growing continously and slowly, that being a fatal > problem. > > > > > >The beam emulator's OS process ID can be found with os:getpid(). > > > > > >On Thu, Oct 26, 2006 at 11:39:13AM +0530, Surindar Sivanesan wrote: > > >> Dear all, > > >> > > >> I'm using erlang emulator version 5.4.3 for running an > application that > > >has > > >> to be run round the clock. > > >> The application has ran perfectly for more than 15 hours. > > >> Then the erlang shell is terminated abnormally. > > >> The general information of the crash report is > > >> > > >> Slogan eheap_alloc: Cannot allocate 373664380 bytes of memory > (of type > > >> "heap"). Node name 'nonode@REDACTED' Crashdump created on Thu > Oct 26 > > >08:48:46 > > >> 2006 System version Erlang (BEAM) emulator version 5.4.3 > [threads:0] > > >> Compiled > > >> Wed Dec 15 12:59:41 2004 Memory allocated 1111921780 bytes > Atoms 5644 > > >> Processes > > >> 716 ETS tables 76 Funs 370 > > >> > > >> Whether any latest erlang version can solve this problem? > > >> Is there any settings available to solve this problem? > > >> I'm running erlang using werl.exe; Whether running erlang using > > >erl.exewill > > >> show any difference? > > >> Please clarify... > > >> Thanks in advance. > > >> > > >> -- > > >> with regards, > > >> S.Surindar > > > > > >> _______________________________________________ > > >> erlang-questions mailing list > > >> erlang-questions@REDACTED > > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > >-- > > > > > >/ Raimo Niskanen, Erlang/OTP, Ericsson AB > > > > > > > > > > > -- > > with regards, > > S.Surindar > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > > > -- > with regards, > S.Surindar > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From jay@REDACTED Mon Oct 30 00:23:09 2006 From: jay@REDACTED (Jay Nelson) Date: Sun, 29 Oct 2006 15:23:09 -0800 Subject: [erlang-questions] Erlang shell crashes Message-ID: <454537DD.6030209@duomark.com> Sean suggested: > The solution is probably as simple as using gen_server:call instead > of gen_server:cast. Also verify that for every message send (i.e., Pid ! Msg) there is somewhere that you receive the message. If you are using receive patterns that do not match up, messages will accumulate that can never be removed. You should also use a catch all message to remove any messages you were not expecting: receive {From, expected_msg, Data} -> do_something(Data); AnyUnexpectedMsg -> log_and_skip_handling(AnyUnexpectedMsg) end. jay From james.hague@REDACTED Mon Oct 30 00:23:47 2006 From: james.hague@REDACTED (James Hague) Date: Sun, 29 Oct 2006 17:23:47 -0600 Subject: [erlang-questions] : Was Re: Bug ?! now Erlang comment (LONG LONG) In-Reply-To: References: <20061027180811.53681.qmail@web31601.mail.mud.yahoo.com> <6a36e7290610271504n208f3929g4fef4589c0368b3f@mail.gmail.com> Message-ID: On 28 Oct 2006 07:38:31 +0200, Bjorn Gustavsson wrote: > > We are working on that. A future release will support a constant pool > for each module. Fantastic! Glad to hear it! This one has been a long time coming :) James From ulf@REDACTED Mon Oct 30 00:53:58 2006 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 30 Oct 2006 00:53:58 +0100 Subject: [erlang-questions] ErlyWeb In-Reply-To: References: <17244f480610271419m793d723cj3f89e8f1e00648f7@mail.gmail.com> Message-ID: Den 2006-10-28 18:45:49 skrev Brian Zhou : > > Java has servlet and filter, python has wsgi (one simple interface > that brings order to python web development), what is Erlang's way > for web component interoperatability? I thought I'd give that one a stab at the upcoming EUC. It may have been a bad call to name the presentation "Erlhive - Safe Erlang Reloaded". What it's really about is trying to create a framework for safe, web-driven development of multi-user web applications. My focus is squarely on the back-end mechanisms. I'll rely on others to provide the stuff needed to actually qualify as a "web" framework. Since EUC is less than two weeks away, I thought I'd focus on actually having something to release by then. Also, it's less fun presenting something if you've already told all through the mailing list. (: BR, Ulf W -- Ulf Wiger From vances@REDACTED Mon Oct 30 02:40:21 2006 From: vances@REDACTED (Vance Shipley) Date: Sun, 29 Oct 2006 20:40:21 -0500 Subject: [erlang-questions] Autoconf & Erlang Message-ID: <20061030014021.GA30674@frogman.motivity.ca> Folks, I just discovered that macros have made their way into GNU Autoconf for working with Erlang. I didnt recall seeing anything here about it so I thought it worth mentioning. Apparently we have Romain Lenglet to thank: http://www.csg.is.titech.ac.jp/~lenglet/archives/2006/09/index.html#e2006-09-05T20_16_04.txt -Vance From hal@REDACTED Mon Oct 30 04:22:52 2006 From: hal@REDACTED (Hal Snyder) Date: Sun, 29 Oct 2006 21:22:52 -0600 Subject: [erlang-questions] Autoconf & Erlang In-Reply-To: <20061030014021.GA30674@frogman.motivity.ca> References: <20061030014021.GA30674@frogman.motivity.ca> Message-ID: FYI, here's a summary of the toolchain we use for Erlang on a VoIP platform. It covers build system, release management, and configuration management. It uses autoconf tools extensively. Auto- tools simplify selection of development vs. release versions of dependencies, aid in portability, simplify creation of source distributions, and work well with packaging tools (which are designed/ maintained with high degree of autoconf support). libraries and applications: spec. file a few lines of eterms naming app and configurables code generation / boilerplate create automake files: configure.ac, Makefile.am, vsn.mk supervisor application main .erl module .yaws status and configuration pages specific source additional modules as needed for this lib or app autotools (automake, autoconf) compile beams, create distfile netbsd pkgsrc main target OS: intel Solaris cfengine deploy on platform Erlang nodes are similar: spec. file eterms naming node and component apps and libs code generation / boilerplate create automake files: configure.ac, Makefile.am, vsn.mk autotools (automake, autoconf): produce: .boot .script .sh - may run in home directory in test mode distfile netbsd pkgsrc main target OS: intel Solaris cfengine deploy on platform On Oct 29, 2006, at 7:40 PM, Vance Shipley wrote: > Folks, > > I just discovered that macros have made their way into > GNU Autoconf for working with Erlang. I didnt recall > seeing anything here about it so I thought it worth > mentioning. Apparently we have Romain Lenglet to thank: > > http://www.csg.is.titech.ac.jp/~lenglet/archives/2006/09/ > index.html#e2006-09-05T20_16_04.txt From rlenglet@REDACTED Mon Oct 30 04:47:21 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Mon, 30 Oct 2006 12:47:21 +0900 Subject: [erlang-questions] Autoconf & Erlang In-Reply-To: <20061030014021.GA30674@frogman.motivity.ca> References: <20061030014021.GA30674@frogman.motivity.ca> Message-ID: <200610301247.21357.rlenglet@users.forge.objectweb.org> Hi, You give me an excellent occasion to advertise for my talk at the EUC 2006 in Stockholm, next week! (^_^) http://www.erlang.se/euc/06/ "Using GNU Autoconf to Configure Erlang Programs." In addition to an introduction to the use of Autoconf and particularly of the Erlang-related macros, I will introduce a few new macros that I want to submit soon. The slides will be publicly available afterwards, of course. Regards, On Monday 30th October 2006 10:40, Vance Shipley wrote: > Folks, > > I just discovered that macros have made their way into > GNU Autoconf for working with Erlang. I didnt recall > seeing anything here about it so I thought it worth > mentioning. Apparently we have Romain Lenglet to thank: > > http://www.csg.is.titech.ac.jp/~lenglet/archives/2006/09/index >.html#e2006-09-05T20_16_04.txt > > -Vance > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- Romain LENGLET From calmasy@REDACTED Mon Oct 30 07:09:26 2006 From: calmasy@REDACTED (=?ISO-8859-1?Q?Count_L=E1szl=F3_de_Alm=E1sy?=) Date: Sun, 29 Oct 2006 23:09:26 -0700 Subject: [erlang-questions] Erlang Search Engine In-Reply-To: References: <6344005f0610270920l73e4d105tcb48d13c7ae2e0e7@mail.gmail.com> Message-ID: On 10/27/06, Christian S wrote: > Is it possible to make the url more memorable? http://shurl.org/erlang -- Cheers, L?szl? From dmitrii@REDACTED Mon Oct 30 09:17:31 2006 From: dmitrii@REDACTED (Dmitrii Dimandt) Date: Mon, 30 Oct 2006 10:17:31 +0200 Subject: [erlang-questions] ErlyWeb In-Reply-To: <17244f480610281346g6b8137dewaa0e6768db008dc8@mail.gmail.com> References: <17244f480610271419m793d723cj3f89e8f1e00648f7@mail.gmail.com> <17244f480610281346g6b8137dewaa0e6768db008dc8@mail.gmail.com> Message-ID: On 10/28/06, Yariv Sadan wrote: > > I thought about this folder structure, and my opinion was that the > nested folder structure is unnecessary for the majority of > applications. Having a flat directory makes it easy to open files in > an IDE such as emacs, and it also allows you to easily install 3rd > party components by dragging and dropping. > > I think ErlyWeb should support the nested structure if you want it, > but it shouldn't be the default. The thing is that I'm currently fighting with a sort of an e-commerce site using ColdFusion on Wheels . For instance, for one of my controllers I have 23 views (16 actions, 7 partials). This could become ugly in a flat directory real fast :) If ErlyWeb coudl support nested directories (simple switch in options somewehere, perhaps), I'd quit my job and start developing such apps on my own solely in Erlang :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From rasmussen.bryan@REDACTED Mon Oct 30 10:14:34 2006 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Mon, 30 Oct 2006 10:14:34 +0100 Subject: [erlang-questions] 'embedded' erlang? In-Reply-To: References: <200610280609.k9S69Wjr028269@mail.monad.com> <17731.3951.106792.453808@antilipe.corelatus.se> Message-ID: <3bb44c6e0610300114g11738816w55ed7e557fbe0d01@mail.gmail.com> > > > A correction to the detail, the device I cross built erlang to run is linksys > nslu2 - Any particularly useful things you've found to run erlang on linksys? Cheers, Bryan Rasmussen From adam@REDACTED Mon Oct 30 10:25:42 2006 From: adam@REDACTED (Adam Lindberg) Date: Mon, 30 Oct 2006 09:25:42 +0000 Subject: [erlang-questions] Erlang Search Engine In-Reply-To: References: <6344005f0610270826x363b0b1er8a1e007ad24df06d@mail.gmail.com> Message-ID: <6344005f0610300125x33d998b4la4349b9a8299e34d@mail.gmail.com> Well, now all volounteers have been added! So please start to add useful links. This is done by clicking 'Edit this search engine' and going to the 'Sites' tab. Also editing 'Refinements' could be useful for you. On 10/28/06, Dmitrii Dimandt wrote: > > > On 10/27/06, Adam Lindberg wrote: > > Hi everyone > > > > I've just created an Erlang Search Engine with the new Google Co-op > > service. Try it out! > > > http://google.com/coop/cse?cx=010191726936039894090%3Aqfrt1ypt5ey > > > > Bookmark that URL and use it whenever you need Erlang information. So > > far only a few sites are added, like erlang.org/.se, trapexit.org etc. > > > > But it is open! So you can add Erlang sites to it! This will improve the > engine! > > > Hmm... Do we need to volunteer to contribute in order to add sites? I've > volunteered :) Actually, I wanted to add Yariv Sadan's blog to the engine :) > -- Adam Lindberg Mobile: +447960721616 Web: http://www.namsisi.com From dcs619@REDACTED Mon Oct 30 11:19:52 2006 From: dcs619@REDACTED (David Clarke Stevens) Date: Mon, 30 Oct 2006 05:19:52 -0500 Subject: [erlang-questions] getting started with IO: question about syntax Message-ID: I know this is a typical noob question, but I'm just getting into Erlang and can't seem to get it working correctly. I've written a simple factorial function that I want to display text with, but the compiler complains about syntax...any help would be appreciated!! -module(factorial). -export([main/0]). main() -> io:format("The factorial of 5 is: "). fac(5). fac(X) -> if X == 1 -> 1; else -> X * fac(X - 1) end. The compile error I'm getting is: 21> c(factorial). ./factorial.erl:6: syntax error before: '.' ./factorial.erl:8: Warning: function fac/1 is unused error -------------- next part -------------- An HTML attachment was scrubbed... URL: From rlenglet@REDACTED Mon Oct 30 11:35:24 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Mon, 30 Oct 2006 19:35:24 +0900 Subject: [erlang-questions] getting started with IO: question about syntax In-Reply-To: References: Message-ID: <200610301935.24559.rlenglet@users.forge.objectweb.org> David Clarke Stevens wrote: > I know this is a typical noob question, but I'm just getting > into Erlang and can't seem to get it working correctly. I've > written a simple factorial function that I want to display > text with, but the compiler complains about syntax...any help > would be appreciated!! > > -module(factorial). > -export([main/0]). > > main() -> > io:format("The factorial of 5 is: "). The line above should terminate with a comma, not a period. > fac(5). > > fac(X) -> > if X == 1 -> > 1; > else -> > X * fac(X - 1) > end. > > The compile error I'm getting is: > 21> c(factorial). > ./factorial.erl:6: syntax error before: '.' > ./factorial.erl:8: Warning: function fac/1 is unused > error -- Romain LENGLET From vladdu55@REDACTED Mon Oct 30 11:39:07 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 30 Oct 2006 11:39:07 +0100 Subject: [erlang-questions] getting started with IO: question about syntax In-Reply-To: References: Message-ID: <95be1d3b0610300239x2a5ae6d8pdeab5595bd72d5e9@mail.gmail.com> Hi, Try like this > -module(factorial). > -export([main/0]). > > main() -> > io:format("The factorial of 5 is: ~w~n", [fac(5)]). %%% change here > > fac(X) -> > if X == 1 -> > 1; > true -> %%% change here > X * fac(X - 1) > end. Good luck! /Vlad From ben@REDACTED Mon Oct 30 11:50:32 2006 From: ben@REDACTED (Ben Butler-Cole) Date: Mon, 30 Oct 2006 02:50:32 -0800 (PST) Subject: [erlang-questions] Handling unexpected messages (was Re: Erlang shell crashes) Message-ID: <20061030105032.71738.qmail@web30808.mail.mud.yahoo.com> Jay Nelson said: > You should also use a catch all message to remove any messages you were not expecting: > > receive > {From, expected_msg, Data} -> > do_something(Data); > AnyUnexpectedMsg -> > log_and_skip_handling(AnyUnexpectedMsg) > end. I'm writing my first Erlang system and need to decide general policies for this kind of thing. Is there not an argument for exiting if you get an unexpected message rather than just ignoring it? I suppose that opens you up to a denial of service attack if your Pids or process names aren't completely secure. What is the standard way of dealing with this? Ben From kostis@REDACTED Mon Oct 30 11:57:59 2006 From: kostis@REDACTED (Kostis Sagonas) Date: Mon, 30 Oct 2006 11:57:59 +0100 Subject: [erlang-questions] Erlang shell crashes In-Reply-To: <454537DD.6030209@duomark.com> References: <454537DD.6030209@duomark.com> Message-ID: <4545DAB7.5000005@cs.ntua.gr> Jay Nelson wrote: > > Also verify that for every message send (i.e., Pid ! Msg) there is somewhere > that you receive the message. If you are using receive patterns that do not > match up, messages will accumulate that can never be removed. In the context of the Dialyzer tool, we want for a long time now to extend its analysis so that it is also able to detect concurrency bugs like this one -- I have even written a research proposal to a Swedish funding agency that, if funded, promises to do exactly this type of static analysis. Although the analysis needed is not trivial, we (think we) know exactly how to do this, but doing it never made it high on our priority list partly due to lack of "real" test cases where such defect detection is needed. We would very much appreciate if Erlang users send us code which suffers exactly from this type of problem. We promise we will not use this code for any other purposes. > You should also use a catch all message to remove any messages you were not expecting: > > receive > {From, expected_msg, Data} -> > do_something(Data); > AnyUnexpectedMsg -> > log_and_skip_handling(AnyUnexpectedMsg) > end. Doing this, of course solves this problem by potentially hiding it under the carpet, right? Kostis From chsu79@REDACTED Mon Oct 30 12:12:19 2006 From: chsu79@REDACTED (Christian S) Date: Mon, 30 Oct 2006 12:12:19 +0100 Subject: [erlang-questions] Handling unexpected messages (was Re: Erlang shell crashes) In-Reply-To: <20061030105032.71738.qmail@web30808.mail.mud.yahoo.com> References: <20061030105032.71738.qmail@web30808.mail.mud.yahoo.com> Message-ID: On 10/30/06, Ben Butler-Cole wrote: > I'm writing my first Erlang system and need to decide general policies for this kind of thing. Is there not an argument for exiting if you get an unexpected message rather than just ignoring it? I suppose that opens you up to a denial of service attack if your Pids or process names aren't completely secure. If you have malicious code in your erlang system it can do far worse things. All code in an erlang system is granted access to every corner. There is no such things as secure pids or process names to it. Yes it is probably a good idea to crash on the unexpected. Write programs for the expected and crash when expectations aren't met. Continuing a program when something unexpected has happened is to walk on thin ice on a lake of undefined behavior. From sean.hinde@REDACTED Mon Oct 30 12:43:19 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Mon, 30 Oct 2006 11:43:19 +0000 Subject: [erlang-questions] Handling unexpected messages (was Re: Erlang shell crashes) In-Reply-To: References: <20061030105032.71738.qmail@web30808.mail.mud.yahoo.com> Message-ID: On 30 Oct 2006, at 11:12, Christian S wrote: > On 10/30/06, Ben Butler-Cole wrote: >> I'm writing my first Erlang system and need to decide general >> policies for this kind of thing. Is there not an argument for >> exiting if you get an unexpected message rather than just ignoring >> it? I suppose that opens you up to a denial of service attack if >> your Pids or process names aren't completely secure. > > If you have malicious code in your erlang system it can do far worse > things. All code in an erlang system is granted access to every > corner. There is no such things as secure pids or process names to it. > > Yes it is probably a good idea to crash on the unexpected. Write > programs for the expected and crash when expectations aren't met. > Continuing a program when something unexpected has happened is to walk > on thin ice on a lake of undefined behavior. As a contrary argument, many of the messages passed in a typical large Erlang system (at least in Telecoms) have nothing whatever to do with core function. To crash some core function process because some broken maintenance module sends it a duff status request is almost certainly not the right thing to do. Much better to log the duff request and ignore it. Sean > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From yarivvv@REDACTED Mon Oct 30 14:56:24 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 30 Oct 2006 08:56:24 -0500 Subject: [erlang-questions] ErlyWeb In-Reply-To: References: <17244f480610271419m793d723cj3f89e8f1e00648f7@mail.gmail.com> <17244f480610281346g6b8137dewaa0e6768db008dc8@mail.gmail.com> Message-ID: <17244f480610300556j309149bcvb74760d5b2107e55@mail.gmail.com> > > The thing is that I'm currently fighting with a sort of an e-commerce site > using ColdFusion on Wheels. For instance, for one of my controllers I have > 23 views (16 actions, 7 partials). This could become ugly in a flat > directory real fast :) If ErlyWeb coudl support nested directories (simple > switch in options somewehere, perhaps), I'd quit my job and start developing > such apps on my own solely in Erlang :) > It'll have this support in the next version :) Yariv From valentin@REDACTED Mon Oct 30 15:18:01 2006 From: valentin@REDACTED (Valentin Micic) Date: Mon, 30 Oct 2006 16:18:01 +0200 Subject: [erlang-questions] Handling unexpected messages (was Re: Erlangshell crashes) References: <20061030105032.71738.qmail@web30808.mail.mud.yahoo.com> Message-ID: <020701c6fc2e$37c10690$6601a8c0@moneymaker2> Another thing that might be useful, is to prevent a malicious code from being executed in a first place. One way is to start a run time using restricted shell, and ensure that only code intended to run can be started (although this is not going to cover erlang rpc calls -- that may be handled at a different level). Such a shell may enforce some form of login, and hence, some role-driven access rights etc. We did something to that end a while ago, but still did not deploy it in any production system, thus cannot say how useful or problematic it might be. But it's a start. V. ----- Original Message ----- From: "Sean Hinde" To: "Christian S" Cc: Sent: Monday, October 30, 2006 1:43 PM Subject: Re: [erlang-questions] Handling unexpected messages (was Re: Erlangshell crashes) > > On 30 Oct 2006, at 11:12, Christian S wrote: > >> On 10/30/06, Ben Butler-Cole wrote: >>> I'm writing my first Erlang system and need to decide general >>> policies for this kind of thing. Is there not an argument for >>> exiting if you get an unexpected message rather than just ignoring >>> it? I suppose that opens you up to a denial of service attack if >>> your Pids or process names aren't completely secure. >> >> If you have malicious code in your erlang system it can do far worse >> things. All code in an erlang system is granted access to every >> corner. There is no such things as secure pids or process names to it. >> >> Yes it is probably a good idea to crash on the unexpected. Write >> programs for the expected and crash when expectations aren't met. >> Continuing a program when something unexpected has happened is to walk >> on thin ice on a lake of undefined behavior. > > As a contrary argument, many of the messages passed in a typical > large Erlang system (at least in Telecoms) have nothing whatever to > do with core function. To crash some core function process because > some broken maintenance module sends it a duff status request is > almost certainly not the right thing to do. Much better to log the > duff request and ignore it. > > Sean > >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From Bob.Cowdery@REDACTED Mon Oct 30 16:54:01 2006 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Mon, 30 Oct 2006 15:54:01 -0000 Subject: [erlang-questions] Local and remote sends Message-ID: <3A76756EED583B43A4AD704E29CCD079741195@mail.aprsmartlogik.com> Hi I have a process that usually sends to a CNode, however, for testing I use erlang processes running in the same session. My sends are of the form: {any, From} ! {GatewayPid} When I am testing this does not work and gives an argument error on running and I have to change it to: >From ! {GatewayPid} Is there some form that will work in both situations? Thanks Bob From yarivvv@REDACTED Mon Oct 30 17:40:56 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 30 Oct 2006 11:40:56 -0500 Subject: [erlang-questions] ErlyWeb In-Reply-To: <200610290845.09114.mikael.karlsson@creado.com> References: <17244f480610271419m793d723cj3f89e8f1e00648f7@mail.gmail.com> <17244f480610281346g6b8137dewaa0e6768db008dc8@mail.gmail.com> <200610290845.09114.mikael.karlsson@creado.com> Message-ID: <17244f480610300840j6303a369mc8c8654d6eeb68cd@mail.gmail.com> On 10/29/06, Mikael Karlsson wrote: > ErlyWeb looks great ! Looks like you're not the only one who shares this opinion: http://yarivsblog.com/articles/2006/10/30/erlyweb-visitor-map-day-1 :) Yariv From Martin.Logan@REDACTED Mon Oct 30 17:59:05 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Mon, 30 Oct 2006 10:59:05 -0600 Subject: [erlang-questions] Handling unexpected messages (was Re: Erlangshell crashes) In-Reply-To: Message-ID: <26AB42AB6A76E2419D26E66ECF1538462CF73B@chiresexc02.resource.corp.lcl> -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Sean Hinde Sent: Monday, October 30, 2006 5:43 AM To: Christian S Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] Handling unexpected messages (was Re: Erlangshell crashes) On 30 Oct 2006, at 11:12, Christian S wrote: > On 10/30/06, Ben Butler-Cole wrote: >> I'm writing my first Erlang system and need to decide general >> policies for this kind of thing. Is there not an argument for >> exiting if you get an unexpected message rather than just ignoring >> it? I suppose that opens you up to a denial of service attack if >> your Pids or process names aren't completely secure. I tend to let things crash. The reason being, there should be no unexpected messages to any of your processes, if you have one, it is just like any other error in Erlang. The basic way of handling errors in Erlang to let the process crash, then be restored to its base state through supervision. You will get an error in your SASL log if you have it enabled - which you should. There are exceptions to this; for example sometimes you need to provide user feedback on an error. If you are faced with one of these exceptions then do what you must, otherwise stick to the tried and true, simple and clean, paradigm of crash only software. Cheers, Martin From Martin.Logan@REDACTED Mon Oct 30 18:15:54 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Mon, 30 Oct 2006 11:15:54 -0600 Subject: [erlang-questions] Erlang shell crashes In-Reply-To: <454537DD.6030209@duomark.com> Message-ID: <26AB42AB6A76E2419D26E66ECF1538462CF73C@chiresexc02.resource.corp.lcl> Jay wrote: Also verify that for every message send (i.e., Pid ! Msg) there is somewhere that you receive the message. If you are using receive patterns that do not match up, messages will accumulate that can never be removed. ---------------------------------------------------- The messages a process can receive and understand is called its alphabet. If you use modules as the basic unit of encapsulation for an alphabet you will minimize errant messaging. Try to write modules that contain only a single process definition, and don't let your alphabet for that process leak outside of that module. Bad --- -module(messager). send(Msg, Pid) -> Pid ! {msg, Msg}. -module(messagee). loop(State) -> receive {msg, Msg} -> do_stuff(Msg); Error -> handle_error(Msg) end ... loop(StatePrime) Good ---- -module(encapsulate) send(Msg) -> registered_name_of_this_process ! {?MODULE, Msg}. loop(State) -> receive {?MODULE, Msg} -> do_stuff(Msg) end ... loop(StatePrime). You can see with the second version, the good version, that the process only accepts messages sent from within the same module with the tag ?MODULE. If you follow this idiom you will effectively reduce problems with errant messaging. Cheers, Martin From thomasl_erlang@REDACTED Mon Oct 30 18:15:59 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Mon, 30 Oct 2006 09:15:59 -0800 (PST) Subject: [erlang-questions] Erlang shell crashes In-Reply-To: <4545DAB7.5000005@cs.ntua.gr> Message-ID: <20061030171559.71266.qmail@web38807.mail.mud.yahoo.com> --- Kostis Sagonas wrote: > Although the analysis needed is not trivial, we > (think we) know exactly > how to do this, but doing it never made it high on > our priority list > partly due to lack of "real" test cases where such > defect detection is > needed. We would very much appreciate if Erlang > users send us code > which suffers exactly from this type of problem. We > promise we will not > use this code for any other purposes. How about checking the OTP code? A starter case might be to analyze some variations on gen_server and gen_fsm. I believe Sven-Olof Nystr?m's analyzer derived "mailbox types". I'm not sure how well this worked in practice. http://user.it.uu.se/~svenolof/SA/ Presumably, all you model checking people out there also have wrestled with the basic problem. (Thomas Arts or Lars-Ake Fredlund for instance?) Are there any practical experiences to be told? > > You should also use a catch all message to remove > any messages you were not expecting: > > > > receive > > {From, expected_msg, Data} -> > > do_something(Data); > > AnyUnexpectedMsg -> > > log_and_skip_handling(AnyUnexpectedMsg) > > end. > > Doing this, of course solves this problem by > potentially hiding it under > the carpet, right? If one could tell the hypothetical analyzer to flag messages or interactions that end up in the catch-all clause, then we would both handle unexpected messages at runtime (e.g., messages arriving from some other node running who knows what) AND get warnings at analysis-time. Best, Thomas ____________________________________________________________________________________ Access over 1 million songs - Yahoo! Music Unlimited (http://music.yahoo.com/unlimited) From lukas@REDACTED Mon Oct 30 19:22:39 2006 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 30 Oct 2006 18:22:39 +0000 Subject: [erlang-questions] Bug in Crypto Application Message-ID: <6a2eaa910610301022x214427dw3f6278d4df7d19bb@mail.gmail.com> There seems to be a bug when compiling the Crypto Application. It compiles fine, but when you try to load it it fails. To fix this I had to add -fno-stack-protector to the CFLAGS so that the make command looks like this: $ gcc -c -o ../priv/obj/i686-pc-linux-gnu/crypto_drv.o -g -O2 -I/home/lukas/Desktop/otp_src_R11B-1/erts/i686-pc-linux-gnu -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS -fPIC -fno-stack-protector -I/usr/include -I../../..//erts/emulator/beam -I../../..//erts/emulator/sys/unix crypto_drv.c $ ld -shared -L/usr/lib -R/usr/lib \ > -o ../priv/lib/i686-pc-linux-gnu/crypto_drv.so ../priv/obj/i686-pc-linux-gnu/crypto_drv.o -lcrypto Lukas From bjarne@REDACTED Mon Oct 30 20:50:38 2006 From: bjarne@REDACTED (=?iso-8859-1?Q?Bjarne_D=E4cker?=) Date: Mon, 30 Oct 2006 20:50:38 +0100 Subject: [erlang-questions] Erlang/OTP User Conference 2006 Message-ID: <002001c6fc5c$e2d18310$081269d4@Dell> Dear Erlang friends, If you intend to come to the Erlang User Conference on Thursday November 9 http://www.erlang.se/euc/06/ you will need to register on Monday November 6 by the very latest so that we can prepare badges and notify the Ericsson reception to let you in. Please pass this information on to anybody that you know might plan to attend. Registrations and questions should be sent to euc@REDACTED Also do not forget the Obfuscated Erlang Competition http://www.erlang-consulting.com/obfuscatederlang.html where the dead-line is Friday November 3. Looking forward to seeing you all again Bjarne D?cker, chairman of EUC'06 From cyberlync@REDACTED Mon Oct 30 23:07:54 2006 From: cyberlync@REDACTED (Eric Merritt) Date: Mon, 30 Oct 2006 14:07:54 -0800 Subject: [erlang-questions] Package Support/Use Message-ID: Guys, Why aren't packages used more often? They have been in the language for more than three years or so now. All of the tools bugs that I found when I first evaluated them seem to be resolved. Very little of the FOSS code I see uses them and none of the OTP code. Although, I do hear rumblings from individuals that they use them. I do see quite a lot of _ style code. This is semantically equivalent to packages so why not just use packages? This is mostly a bit of curiosity on my part. I have started using packages again and found it to be pretty useful and I just wonder about other peoples experiences. Thanks, Eric From matthew.reilly@REDACTED Mon Oct 30 23:54:21 2006 From: matthew.reilly@REDACTED (Matthew Reilly) Date: Mon, 30 Oct 2006 14:54:21 -0800 Subject: [erlang-questions] Package Support/Use In-Reply-To: References: Message-ID: <1162248862.26664.299.camel@matt.sipphone.com> On Mon, 2006-10-30 at 14:07 -0800, Eric Merritt wrote: > Guys, > > Why aren't packages used more often? They have been in the language > for more than three years or so now. The documentation is pretty slim -- there's the packages(3) man page (which doesn't seem to be referenced by many (any) other man pages). The erlang reference manual (e.g. http://www.erlang.se/doc/doc-5.5.1/doc/reference_manual/part_frame.html) doesn't mention them (as far as I can tell). Since there are not many examples of their use, perhaps the main reason is plain old obscurity. As a self taught Erlang user, I've only heard about them from a couple emails on this list. The first thing I did when I saw a post about them was go to the reference manual and when I didn't find them in there I assumed they were not a standard part of the language. > Thanks, > Eric > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- Matthew Reilly matthew.reilly@REDACTED Gizmo Project name: matt From sean.hinde@REDACTED Tue Oct 31 00:11:28 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Mon, 30 Oct 2006 23:11:28 +0000 Subject: [erlang-questions] Package Support/Use In-Reply-To: References: Message-ID: On 30 Oct 2006, at 22:07, Eric Merritt wrote: > Guys, > > Why aren't packages used more often? They have been in the language > for more than three years or so now. All of the tools bugs that I > found when I first evaluated them seem to be resolved. Very little of > the FOSS code I see uses them and none of the OTP code. Although, I do > hear rumblings from individuals that they use them. I do see quite a > lot of _ style code. This is semantically equivalent to > packages so why not just use packages? This is mostly a bit of > curiosity on my part. I have started using packages again and found it > to be pretty useful and I just wonder about other peoples experiences. A couple of shallow theories (but maybe some truth..): 1. It looks a bit like Java and is therefore not to the taste of many hardcore Erlang hackers. 2. It is pretty tedious traversing up and down deep directory structures with Emacs, and most Erlang hackers I have come across use Emacs for everything ! Maybe it is simply a solution to a problem that does not exist (yet) Sean From hal@REDACTED Tue Oct 31 00:14:42 2006 From: hal@REDACTED (Hal Snyder) Date: Mon, 30 Oct 2006 17:14:42 -0600 Subject: [erlang-questions] Package Support/Use In-Reply-To: <1162248862.26664.299.camel@matt.sipphone.com> References: <1162248862.26664.299.camel@matt.sipphone.com> Message-ID: <94DEB2F4-756E-4B2B-ABEC-28D8F6BA3DAD@vailsys.com> I've been out of the loop for awhile, but IIRC packages weren't fully integrated into the release system, boot & script files, etc. Or did that change? On Oct 30, 2006, at 4:54 PM, Matthew Reilly wrote: > > On Mon, 2006-10-30 at 14:07 -0800, Eric Merritt wrote: >> Guys, >> >> Why aren't packages used more often? They have been in the language >> for more than three years or so now. > > The documentation is pretty slim -- there's the packages(3) man page > (which doesn't seem to be referenced by many (any) other man pages). > > The erlang reference manual (e.g. > http://www.erlang.se/doc/doc-5.5.1/doc/reference_manual/ > part_frame.html) > doesn't mention them (as far as I can tell). > > Since there are not many examples of their use, perhaps the main > reason > is plain old obscurity. As a self taught Erlang user, I've only heard > about them from a couple emails on this list. The first thing I did > when > I saw a post about them was go to the reference manual and when I > didn't > find them in there I assumed they were not a standard part of the > language. From ulf@REDACTED Tue Oct 31 00:33:45 2006 From: ulf@REDACTED (Ulf Wiger) Date: Tue, 31 Oct 2006 00:33:45 +0100 Subject: [erlang-questions] Package Support/Use In-Reply-To: <1162248862.26664.299.camel@matt.sipphone.com> References: <1162248862.26664.299.camel@matt.sipphone.com> Message-ID: Packages aren't supported. That's the main reason why they're not better documented. There used to be a problem with embedded code loading and packages, but that was years ago. It was the erl_prim_loader that didn't understand the package convention. I don't know if it has been fixed. Otherwise, I think packages work just fine. There may still be some debate as to whether they are a useful addition, and while the jury is out on that one, packages are likely to stay experimental. BR, Ulf W Den 2006-10-30 23:54:21 skrev Matthew Reilly : > > On Mon, 2006-10-30 at 14:07 -0800, Eric Merritt wrote: >> Guys, >> >> Why aren't packages used more often? They have been in the language >> for more than three years or so now. > > The documentation is pretty slim -- there's the packages(3) man page > (which doesn't seem to be referenced by many (any) other man pages). > > The erlang reference manual (e.g. > http://www.erlang.se/doc/doc-5.5.1/doc/reference_manual/part_frame.html) > doesn't mention them (as far as I can tell). > > Since there are not many examples of their use, perhaps the main reason > is plain old obscurity. As a self taught Erlang user, I've only heard > about them from a couple emails on this list. The first thing I did when > I saw a post about them was go to the reference manual and when I didn't > find them in there I assumed they were not a standard part of the > language. > >> Thanks, >> Eric >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions -- Ulf Wiger From cyberlync@REDACTED Tue Oct 31 01:23:36 2006 From: cyberlync@REDACTED (Eric Merritt) Date: Mon, 30 Oct 2006 16:23:36 -0800 Subject: [erlang-questions] Package Support/Use In-Reply-To: References: <1162248862.26664.299.camel@matt.sipphone.com> Message-ID: On 10/30/06, Ulf Wiger wrote: > > Otherwise, I think packages work just fine. There may still > be some debate as to whether they are a useful addition, > and while the jury is out on that one, packages are likely > to stay experimental. Shouldn't that debate happen then? Having this quasi experimental aspect of the language that some find useful and some don't that may or may not go away seems to be a problem. From bjorn@REDACTED Tue Oct 31 06:44:52 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 31 Oct 2006 06:44:52 +0100 Subject: [erlang-questions] Bug in Crypto Application In-Reply-To: <6a2eaa910610301022x214427dw3f6278d4df7d19bb@mail.gmail.com> References: <6a2eaa910610301022x214427dw3f6278d4df7d19bb@mail.gmail.com> Message-ID: Which platform is that? Given the path -I/home/lukas/Desktop... I guess Mac OS X, but which version is it? /Bjorn "Lukas Larsson" writes: > There seems to be a bug when compiling the Crypto Application. It > compiles fine, but when you try to load it it fails. To fix this I had > to add -fno-stack-protector to the CFLAGS so that the make command > looks like this: > > $ gcc -c -o ../priv/obj/i686-pc-linux-gnu/crypto_drv.o -g -O2 > -I/home/lukas/Desktop/otp_src_R11B-1/erts/i686-pc-linux-gnu > -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE > -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT > -D_POSIX_THREAD_SAFE_FUNCTIONS -fPIC -fno-stack-protector > -I/usr/include -I../../..//erts/emulator/beam > -I../../..//erts/emulator/sys/unix crypto_drv.c > > $ ld -shared -L/usr/lib -R/usr/lib \ > > -o ../priv/lib/i686-pc-linux-gnu/crypto_drv.so ../priv/obj/i686-pc-linux-gnu/crypto_drv.o -lcrypto > > Lukas > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From kalap.kabat@REDACTED Tue Oct 31 07:31:22 2006 From: kalap.kabat@REDACTED (user) Date: Tue, 31 Oct 2006 06:31:22 +0000 (UTC) Subject: [erlang-questions] Package Support/Use References: Message-ID: Sean Hinde gmail.com> writes: > > 2. It is pretty tedious traversing up and down deep directory > structures with Emacs, It is not, only if you're an Emacs newbie. See FileCache, Icicles, GlobalFF, etc. http://www.emacswiki.org/cgi-bin/wiki/LocateFilesAnywhere From mikael.karlsson@REDACTED Tue Oct 31 08:02:30 2006 From: mikael.karlsson@REDACTED (Mikael Karlsson) Date: Tue, 31 Oct 2006 08:02:30 +0100 Subject: [erlang-questions] ErlyWeb In-Reply-To: <17244f480610300840j6303a369mc8c8654d6eeb68cd@mail.gmail.com> References: <17244f480610271419m793d723cj3f89e8f1e00648f7@mail.gmail.com> <200610290845.09114.mikael.karlsson@creado.com> <17244f480610300840j6303a369mc8c8654d6eeb68cd@mail.gmail.com> Message-ID: <200610310802.31407.mikael.karlsson@creado.com> Ahh, good to know that I am not alone :-) Question: Can I use ErlyWeb with AJAX(Json) style of web programming ? Observation: Erlang/OTP by default packages the app/ebin and app/priv directories into releases (functions like systools:make_tar/2 etc). So you might consider using priv/www (or priv/docroot) instead of www as your docroot directory. Not a big deal really since you can include other directories too with optional parameters to systools:make_tar, but it could be good to stick to the OTP default way. Yaws itself does not do this, but uses the www directory for some reason. Maybe the Yaws www files are not supposed to be in ones own web application release. Regards Mikael m?ndag 30 oktober 2006 17:40 skrev Yariv Sadan: > On 10/29/06, Mikael Karlsson wrote: > > ErlyWeb looks great ! > > Looks like you're not the only one who shares this opinion: > > http://yarivsblog.com/articles/2006/10/30/erlyweb-visitor-map-day-1 > > :) > > Yariv From bjorn@REDACTED Tue Oct 31 07:52:56 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 31 Oct 2006 07:52:56 +0100 Subject: [erlang-questions] What does this mean? In-Reply-To: <15FA01AC-2B24-4A4E-8DB2-00AD0AE96356@patternmatched.com> References: <15FA01AC-2B24-4A4E-8DB2-00AD0AE96356@patternmatched.com> Message-ID: We have found one bug where the emulator generates that kind of type assertion while writing an erl_crash.dump file (just before terminating). If that is the bug you encountered, it is basically harmless before the system (for some reason) was already about to terminate. The bug will be corrected in R11B-2. /Bjorn P.S. Here is some code that reproduces the problem. (Run t:t().) t() -> X = y, E = id([a,b,c]), F = fun(X) -> lists:member(X, E) end, t(E, F). t(E, F) -> t2(E), F. t2(E) -> do_halt(), E. id(I) -> I. do_halt() -> io:format("~p\n", [self()]), erlang:halt("system halted"). Rudolph van Graan writes: > 1> TYPE ASSERTION FAILED, file beam/erl_term.c, line 105: > tag_val_def: 0x18 > > Rudolph van Graan > > Software Architect > Pattern Matched Technologies > > E-Mail: rvg@REDACTED > Tel: 086 1000 700 (SA Only) > Mobile: +27 83 390 7767 > Fax: +27 12 665 9566 > Web: www.patternmatched.com > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From datacompboy@REDACTED Tue Oct 31 09:36:56 2006 From: datacompboy@REDACTED (datacompboy) Date: Tue, 31 Oct 2006 08:36:56 +0000 Subject: [erlang-questions] Release patchlevel relnotes References: Message-ID: <20061031083656.2516B5A1FA@mail.erlangsystems.com> Hi everybody! Where I can find release notes for patchlevel releases? Compilation of changes in all application in release -1B, -2B etc. -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From sean.hinde@REDACTED Tue Oct 31 10:21:51 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Tue, 31 Oct 2006 09:21:51 +0000 Subject: [erlang-questions] Package Support/Use In-Reply-To: References: Message-ID: <96EEE65C-11BE-4A20-93CC-5FA018BCD516@gmail.com> On 31 Oct 2006, at 06:31, user wrote: > Sean Hinde gmail.com> writes: >> >> 2. It is pretty tedious traversing up and down deep directory >> structures with Emacs, > > It is not, only if you're an Emacs newbie. > > See FileCache, Icicles, GlobalFF, etc. > > http://www.emacswiki.org/cgi-bin/wiki/LocateFilesAnywhere So then we should have uniquely named source code files anyway. The only benefit of Packages becomes lost. Sean > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From ft@REDACTED Tue Oct 31 10:30:58 2006 From: ft@REDACTED (Fredrik Thulin) Date: Tue, 31 Oct 2006 10:30:58 +0100 Subject: [erlang-questions] Release patchlevel relnotes References: <20061031083656.2516B5A1FA@mail.erlangsystems.com> Message-ID: <006201c6fccf$48312d10$4c1e0bc1@it.su.se> datacompboy wrote: > Hi everybody! > > Where I can find release notes for patchlevel releases? > Compilation of changes in all application in release -1B, -2B etc. Precisely where one could expect - on the web site, next to the download link for each version. /Fredrik From bengt.kleberg@REDACTED Tue Oct 31 10:32:51 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 31 Oct 2006 10:32:51 +0100 Subject: [erlang-questions] Package Support/Use In-Reply-To: References: <1162248862.26664.299.camel@matt.sipphone.com> Message-ID: <45471843.9090208@ericsson.com> On 2006-10-31 01:23, Eric Merritt wrote: > Having this quasi experimental > aspect of the language that some find useful and some don't that may > or may not go away seems to be a problem. i would like to have packages. the constant threat of them going away (since they are experimental) stops me from using them. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From bengt.kleberg@REDACTED Tue Oct 31 10:38:19 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 31 Oct 2006 10:38:19 +0100 Subject: [erlang-questions] escript location? Message-ID: <4547198B.10108@ericsson.com> greetings, i tried to find escript(-4.0) while at home. google only showed me to the mail list, and the attachment was not available (that i could see) in the saved messages there. i have it at work and have sent it home today so there is no hurry. but next time, when i do not have it, where should i look? bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From datacompboy@REDACTED Tue Oct 31 10:54:16 2006 From: datacompboy@REDACTED (datacompboy) Date: Tue, 31 Oct 2006 09:54:16 +0000 Subject: [erlang-questions] Release patchlevel relnotes References: Message-ID: <20061031095416.DD5395A1F8@mail.erlangsystems.com> F> Precisely where one could expect - on the web site, next to the download link for each version. OooO!O! Thanks, Fredrik! :) Just have missed that readme -- --- suicide proc near\n call death\n suicide endp _________________________________________________________ Post sent from http://www.trapexit.org From lukas@REDACTED Tue Oct 31 11:39:17 2006 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 31 Oct 2006 10:39:17 +0000 Subject: [erlang-questions] Bug in Crypto Application In-Reply-To: References: <6a2eaa910610301022x214427dw3f6278d4df7d19bb@mail.gmail.com> Message-ID: <6a2eaa910610310239t21294229kf886b998a2a2cbe3@mail.gmail.com> I'm running the Edgy Ubuntu version. I think that it was gcc4 which caused this error to occur but I'm not sure. I just searched the web for the same error message that I got when trying to do a erl_ddll:load_driver on the crypto_drv file and found that adding that flag would fix the error, which it did. Lukas On 31 Oct 2006 06:44:52 +0100, Bjorn Gustavsson wrote: > Which platform is that? > > Given the path -I/home/lukas/Desktop... I guess Mac OS X, but which version is > it? > > /Bjorn > > "Lukas Larsson" writes: > > > There seems to be a bug when compiling the Crypto Application. It > > compiles fine, but when you try to load it it fails. To fix this I had > > to add -fno-stack-protector to the CFLAGS so that the make command > > looks like this: > > > > $ gcc -c -o ../priv/obj/i686-pc-linux-gnu/crypto_drv.o -g -O2 > > -I/home/lukas/Desktop/otp_src_R11B-1/erts/i686-pc-linux-gnu > > -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE > > -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT > > -D_POSIX_THREAD_SAFE_FUNCTIONS -fPIC -fno-stack-protector > > -I/usr/include -I../../..//erts/emulator/beam > > -I../../..//erts/emulator/sys/unix crypto_drv.c > > > > $ ld -shared -L/usr/lib -R/usr/lib \ > > > -o ../priv/lib/i686-pc-linux-gnu/crypto_drv.so ../priv/obj/i686-pc-linux-gnu/crypto_drv.o -lcrypto > > > > Lukas > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From yerl@REDACTED Tue Oct 31 11:39:36 2006 From: yerl@REDACTED (yerl@REDACTED) Date: Tue, 31 Oct 2006 11:39:36 +0100 Subject: [erlang-questions] escript location? Message-ID: An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Tue Oct 31 11:43:03 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 31 Oct 2006 02:43:03 -0800 (PST) Subject: [erlang-questions] Package Support/Use In-Reply-To: Message-ID: <20061031104303.79049.qmail@web38807.mail.mud.yahoo.com> --- Eric Merritt wrote: > Guys, > > Why aren't packages used more often? They have > been in the language > for more than three years or so now. All of the > tools bugs that I > found when I first evaluated them seem to be > resolved. Two things for me: 1. The semantics of packages and module names is dodgy (as far as I know). http://www.erlang.org/ml-archive/erlang-questions/200304/msg00288.html 2. I see no big win from using packages, as compared to staying with regular modules. Basically, I'm not convinced packages are the right solution, and there's been no compelling reason to switch. Best, Thomas ____________________________________________________________________________________ Everyone is raving about the all-new Yahoo! Mail (http://advision.webevents.yahoo.com/mailbeta/) From bengt.kleberg@REDACTED Tue Oct 31 12:37:48 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 31 Oct 2006 12:37:48 +0100 Subject: [erlang-questions] Local and remote sends In-Reply-To: <3A76756EED583B43A4AD704E29CCD079741195@mail.aprsmartlogik.com> References: <3A76756EED583B43A4AD704E29CCD079741195@mail.aprsmartlogik.com> Message-ID: <4547358C.4030202@ericsson.com> On 2006-10-30 16:54, Bob Cowdery wrote: > Hi > > I have a process that usually sends to a CNode, however, for testing I use erlang processes running in the same session. My sends are of the form: > {any, From} ! {GatewayPid} > When I am testing this does not work and gives an argument error on running and I have to change it to: >>From ! {GatewayPid} > Is there some form that will work in both situations? is it correct that 'any' is the registered name of a process? and that From is the node name (also atom) you want to reach? then sending to From during testing is an error and should not work. you should have a pid (or registered name), not a node name. i think i must have misunderstood something here. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From Bob.Cowdery@REDACTED Tue Oct 31 13:18:45 2006 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Tue, 31 Oct 2006 12:18:45 -0000 Subject: [erlang-questions] Local and remote sends Message-ID: <3A76756EED583B43A4AD704E29CCD079741196@mail.aprsmartlogik.com> On 2006-10-30 16:54, Bob Cowdery wrote: > Hi > > I have a process that usually sends to a CNode, however, for testing I use erlang processes running in the same session. My sends are of the form: > {any, From} ! {GatewayPid} > When I am testing this does not work and gives an argument error on running and I have to change it to: >>From ! {GatewayPid} > Is there some form that will work in both situations? >> is it correct that 'any' is the registered name of a process? >> and that From is the node name (also atom) you want to reach? > >> then sending to From during testing is an error and should not work. you >> should have a pid (or registered name), not a node name. >> >> i think i must have misunderstood something here. As far as I can tell I have two different situations. When working locally in one erlang session the From is a Pid (the Pid of the sender to which I am replying) which I need to use directly as the target of the send. When the From is a CNode there is no Pid, just a short name in my case (e.g. c1@REDACTED) and I need to use a tuple to address it like {any, c1@REDACTED}. The 'any' is a registered name but is ignored for all intent and purpose, so it's just any old atom as far as I am concerned. It explains this a bit in the interoperability tutorial on page 20. I guess I need to test the address and see what form it is. Do you know of any simple way to determin a Pid from a short address apart from looking at the makeup and deducing what it is. Bob -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From richardc@REDACTED Tue Oct 31 13:36:39 2006 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 31 Oct 2006 13:36:39 +0100 Subject: [erlang-questions] Package Support/Use In-Reply-To: <20061031104303.79049.qmail@web38807.mail.mud.yahoo.com> References: <20061031104303.79049.qmail@web38807.mail.mud.yahoo.com> Message-ID: <45474357.2000808@it.uu.se> Thomas Lindgren wrote: > 1. The semantics of packages and module names is dodgy > (as far as I know). > http://www.erlang.org/ml-archive/erlang-questions/200304/msg00288.html Seems I never answered that last post of yours in that thread. I'll try to do so now. Your example was: -module(foo.bar). -compile(export_all). f1() -> m:f(X). f2() -> Mod = m, Mod:f(X). where f1() and f2() do not do the same thing if the module is in a package (as it is in this example): f1() calls 'foo.m':'f'(X) (the name is expanded in the call context) while f2() calls 'm':'f'(X). This does break referential transparency, i admit. What you need to keep in mind is that if you do move the module name out of the call context and into a variable, you must make sure to use its full name. This was the (minor, I think) price paid for making the package system work. The documentation for the package system makes a clear distinction between the unqualified module name and the full module name. In Erlang code that does not use packages, these are always the same, and the ?MODULE macro will always expand to the full name. Furthermore, the M:F(X) notation as well as the apply*/N and spawn*/N built-in functions always use the full module name. So, if you have code in some (unpackaged) module bar that uses a *full* module name "Mod = m", then that m will still refer to the same module even if the containing module bar is renamed to foo.bar. Basically, there is never any run-time expansion of module names, because the necessary context is in general missing if you pass an unexpanded name as an atom. Hence, all module names being passed around are always full names, which means that e.g. an old module such as gen_server, written entirely without any knowledge about such things as packages, can work with a packaged callback module whose full name might be something like foo.bar.my_server. But what I think you were looking for, was to have a way of getting the full name of a "local" module as an atom, given only its unqualified name. In fact, I had experimentally included a pseudo-BIF 'expanded(Atom)' (or some such name) - expanded at compile time, if possible. But at the time, I was a bit afraid to add a new predefined name and was not sure how useful it would turn out to be, so it was never included in the system. Mea culpa, I guess. But it is not too late to add such an operator now. Its semantics could easily be defined in terms of the full name of the containing module, i.e., the value of ?MODULE, and a couple of the name- manipulation functions in the 'packages' kernel module. Making the compiler recognize and expand it statically when possible, is quite simple, and can be done regardless of whether the function is automatically imported or not. Any name suggestions? /Richard PS. Now that I look at it, none of the exported functions in the 'packages' module are documented. This should be fixed. From vladdu55@REDACTED Tue Oct 31 13:47:08 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 31 Oct 2006 13:47:08 +0100 Subject: [erlang-questions] Local and remote sends In-Reply-To: <3A76756EED583B43A4AD704E29CCD079741196@mail.aprsmartlogik.com> References: <3A76756EED583B43A4AD704E29CCD079741196@mail.aprsmartlogik.com> Message-ID: <95be1d3b0610310447y273ca84bq350c2a4fd2531907@mail.gmail.com> Hi, On 10/31/06, Bob Cowdery wrote: > I guess I need to test the address and see what form it is. Do you know of any simple way to determin a Pid from a short address apart from looking at the makeup and deducing what it is. Try is_pid(Pid) ;-) How does From get set? The "right" way is to receive it from the client (who sends a Pid) and then it can be used as From ! Message regardless of whether it's local or remote. This means the C node has to send it's pid to a registered process on the Erlang node first. Of course, if the Erlang side has to initiate the conversation, there's little choice. Something like the following might make it more portable -ifdef(LOCAL_TEST). -define(DEST, local_process_name). -else. -define(DEST, {any, cnode@REDACTED}). -endif. ..... ?DEST! GatewayPid. best regards, Vlad From xpdoka@REDACTED Tue Oct 31 14:30:45 2006 From: xpdoka@REDACTED (Dominic Williams) Date: Tue, 31 Oct 2006 14:30:45 +0100 (CET) Subject: [erlang-questions] Local and remote sends In-Reply-To: <3A76756EED583B43A4AD704E29CCD079741196@mail.aprsmartlogik.com> References: <3A76756EED583B43A4AD704E29CCD079741196@mail.aprsmartlogik.com> Message-ID: <38278.83.204.242.174.1162301445.squirrel@www.geekisp.com> Hi Bob, > I have a process that usually sends to a CNode, however, > for testing I use erlang processes running in the same > session. My sends are of the form: > {any, From} ! {GatewayPid} > When I am testing this does not work and gives an argument > error on running and I have to change it to: > From ! {GatewayPid} > Is there some form that will work in both situations? This is perfect example of what's wrong with naming processes. It's exactly like having global variables. The code is dependent on some global ressource which can't easily be substituted by another. The solution is for your code NOT TO KNOW who (and in your case what) it is sending messages to. Pass it the destination of send operations in some way (extra argument to each function, extra initialisation argument, parameter of an abstract module...) Testing (and reuse) becomes even easier if you go even more abstract: pass your code a function that it calls instead of sending messages... Regards, Dominic Williams http://www.dominicwilliams.net ---- From Bob.Cowdery@REDACTED Tue Oct 31 14:32:15 2006 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Tue, 31 Oct 2006 13:32:15 -0000 Subject: [erlang-questions] FW: Local and remote sends Message-ID: <3A76756EED583B43A4AD704E29CCD079715CD4@mail.aprsmartlogik.com> On 2006-10-31 13:18, Bob Cowdery wrote: > On 2006-10-30 16:54, Bob Cowdery wrote: >> Hi >> >> I have a process that usually sends to a CNode, however, for >> testing I use erlang processes running in the same session. My >> sends are of the form: {any, From} ! {GatewayPid} When I am testing >> this does not work and gives an argument error on running and I >> have to change it to: >>> From ! {GatewayPid} >> Is there some form that will work in both situations? > >>> is it correct that 'any' is the registered name of a process? and >>> that From is the node name (also atom) you want to reach? then >>> sending to From during testing is an error and should not work. >>> you should have a pid (or registered name), not a node name. >>> >>> i think i must have misunderstood something here. > > As far as I can tell I have two different situations. When working > locally in one erlang session the From is a Pid (the Pid of the > sender to which I am replying) which I need to use directly as the > target of the send. When the From is a CNode there is no Pid, just a >> it is somewhat confusing to have the same variable name in these cases. >> presumably it is perfectly fine when seen in context, but there is no >> context here. please consider adding context, or having different names. It's just a receive loop server_loop(Registrations, Classes) -> receive %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Register a new actor %% %% @From the erlang short-name or Pid %% @Class the class of this client %% @Mode one of [client, server, both] %% @Access one of [default, polling, none] %% @Format one of [TBD] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {new_reg, From, Class, Mode, Access, Format} -> ... so could get called from any type of node or process. I guess there could be a different pattern depending on the type of 'From' but all the code is common except for that one instance of replying with From or {any, From}. > short name in my case (e.g. c1@REDACTED) and I need to use a tuple to > address it like {any, c1@REDACTED}. The 'any' is a registered name but is > ignored for all intent and purpose, so it's just any old atom as far > as I am concerned. It explains this a bit in the interoperability > tutorial on page 20. >> when i go to the interoperability tutorial >> http://www.erlang.org/doc/doc-5.5.1/doc/tutorial/part_frame.html >> i have no page numbers. could you give me the chapter/paragraph instead? 7.1 > I guess I need to test the address and see what form it is. Do you > know of any simple way to determin a Pid from a short address apart > from looking at the makeup and deducing what it is. >> erlang:is_pid/1 is a good way to see if you have a pid. Thanks, that works fine. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From Bob.Cowdery@REDACTED Tue Oct 31 14:37:08 2006 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Tue, 31 Oct 2006 13:37:08 -0000 Subject: [erlang-questions] Local and remote sends Message-ID: <3A76756EED583B43A4AD704E29CCD079715CD5@mail.aprsmartlogik.com> Hi, On 10/31/06, Bob Cowdery wrote: > I guess I need to test the address and see what form it is. Do you know of any simple way to determin a Pid from a short address apart from looking at the makeup and deducing what it is. Try is_pid(Pid) ;-) > How does From get set? The client passes its address in the message > The "right" way is to receive it from the client (who sends a Pid) and > then it can be used as From ! Message regardless of whether it's local > or remote. This means the C node has to send it's pid to a registered > process on the Erlang node first. As far as I know a CNode does not have a Pid unless I read the documentation wrong. It only has a short or long name. Of course, if the Erlang side has to initiate the conversation, there's little choice. Something like the following might make it more portable -ifdef(LOCAL_TEST). -define(DEST, local_process_name). -else. -define(DEST, {any, cnode@REDACTED}). -endif. ..... ?DEST! GatewayPid. Not investigated macros yet. Mind you, there's lots I've not investigated yet. The simple Pid test seems to have fixed the actual problem although it's probably not the 'right' way to do it. regards Bob From vladdu55@REDACTED Tue Oct 31 14:47:47 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 31 Oct 2006 14:47:47 +0100 Subject: [erlang-questions] Local and remote sends In-Reply-To: <3A76756EED583B43A4AD704E29CCD079715CD5@mail.aprsmartlogik.com> References: <3A76756EED583B43A4AD704E29CCD079715CD5@mail.aprsmartlogik.com> Message-ID: <95be1d3b0610310547v56d89205t3f0e8acc96c08220@mail.gmail.com> On 10/31/06, Bob Cowdery wrote: > As far as I know a CNode does not have a Pid unless I read the documentation wrong. It only has a short or long name. Oh, yes. I got a little confused because I mostly interop with Java nodes and jinterface implements mailboxes which have each their own pid... I supposed there is something similar for C nodes, but it probably doesn't. regards, Vlad From gunilla@REDACTED Tue Oct 31 14:46:51 2006 From: gunilla@REDACTED (Gunilla Arendt) Date: Tue, 31 Oct 2006 14:46:51 +0100 Subject: [erlang-questions] FW: Local and remote sends In-Reply-To: <3A76756EED583B43A4AD704E29CCD079715CD4@mail.aprsmartlogik.com> References: <3A76756EED583B43A4AD704E29CCD079715CD4@mail.aprsmartlogik.com> Message-ID: <454753CB.4020000@erix.ericsson.se> If I'm understanding this right, you send a message to a CNode using {any, Node} ! {GatewayPid} and wants to use the same format to send a message to an Erlang pid? Then register your pid as 'any'. (b@REDACTED)2> Pid = m:s(). <0.44.0> (b@REDACTED)3> register(any, P). true And, from another (or the same) node: (a@REDACTED)1> {any, b@REDACTED} ! hello. hello / Gunilla Bob Cowdery wrote: > On 2006-10-31 13:18, Bob Cowdery wrote: >> On 2006-10-30 16:54, Bob Cowdery wrote: >>> Hi >>> >>> I have a process that usually sends to a CNode, however, for >>> testing I use erlang processes running in the same session. My >>> sends are of the form: {any, From} ! {GatewayPid} When I am testing >>> this does not work and gives an argument error on running and I >>> have to change it to: >>>> From ! {GatewayPid} >>> Is there some form that will work in both situations? >>>> is it correct that 'any' is the registered name of a process? and >>>> that From is the node name (also atom) you want to reach? then >>>> sending to From during testing is an error and should not work. >>>> you should have a pid (or registered name), not a node name. >>>> >>>> i think i must have misunderstood something here. >> As far as I can tell I have two different situations. When working >> locally in one erlang session the From is a Pid (the Pid of the >> sender to which I am replying) which I need to use directly as the >> target of the send. When the From is a CNode there is no Pid, just a > >>> it is somewhat confusing to have the same variable name in these cases. >>> presumably it is perfectly fine when seen in context, but there is no >>> context here. please consider adding context, or having different names. > It's just a receive loop > > server_loop(Registrations, Classes) -> > receive > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > %% Register a new actor > %% > %% @From the erlang short-name or Pid > %% @Class the class of this client > %% @Mode one of [client, server, both] > %% @Access one of [default, polling, none] > %% @Format one of [TBD] > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > {new_reg, From, Class, Mode, Access, Format} -> > ... > > so could get called from any type of node or process. I guess there could be a different pattern depending on the type of 'From' but all the code is common except for that one instance of replying with From or {any, From}. > >> short name in my case (e.g. c1@REDACTED) and I need to use a tuple to >> address it like {any, c1@REDACTED}. The 'any' is a registered name but is >> ignored for all intent and purpose, so it's just any old atom as far >> as I am concerned. It explains this a bit in the interoperability >> tutorial on page 20. > >>> when i go to the interoperability tutorial >>> http://www.erlang.org/doc/doc-5.5.1/doc/tutorial/part_frame.html >>> i have no page numbers. could you give me the chapter/paragraph instead? > 7.1 > >> I guess I need to test the address and see what form it is. Do you >> know of any simple way to determin a Pid from a short address apart >> from looking at the makeup and deducing what it is. > >>> erlang:is_pid/1 is a good way to see if you have a pid. > Thanks, that works fine. > > bengt From Bob.Cowdery@REDACTED Tue Oct 31 16:45:16 2006 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Tue, 31 Oct 2006 15:45:16 -0000 Subject: [erlang-questions] FW: Local and remote sends Message-ID: <3A76756EED583B43A4AD704E29CCD079715CD8@mail.aprsmartlogik.com> Yes, thanks for the suggestion, I could do that but the test processes are already registered as their own names (given on starting each instance) as a convienient way to talk to them. I will experiment a little and see which is the most appropriate thing to do. Bob If I'm understanding this right, you send a message to a CNode using {any, Node} ! {GatewayPid} and wants to use the same format to send a message to an Erlang pid? Then register your pid as 'any'. (b@REDACTED)2> Pid = m:s(). <0.44.0> (b@REDACTED)3> register(any, P). true And, from another (or the same) node: (a@REDACTED)1> {any, b@REDACTED} ! hello. hello / Gunilla Bob Cowdery wrote: > On 2006-10-31 13:18, Bob Cowdery wrote: >> On 2006-10-30 16:54, Bob Cowdery wrote: >>> Hi >>> >>> I have a process that usually sends to a CNode, however, for >>> testing I use erlang processes running in the same session. My >>> sends are of the form: {any, From} ! {GatewayPid} When I am testing >>> this does not work and gives an argument error on running and I >>> have to change it to: >>>> From ! {GatewayPid} >>> Is there some form that will work in both situations? >>>> is it correct that 'any' is the registered name of a process? and >>>> that From is the node name (also atom) you want to reach? then >>>> sending to From during testing is an error and should not work. >>>> you should have a pid (or registered name), not a node name. >>>> >>>> i think i must have misunderstood something here. >> As far as I can tell I have two different situations. When working >> locally in one erlang session the From is a Pid (the Pid of the >> sender to which I am replying) which I need to use directly as the >> target of the send. When the From is a CNode there is no Pid, just a > >>> it is somewhat confusing to have the same variable name in these cases. >>> presumably it is perfectly fine when seen in context, but there is no >>> context here. please consider adding context, or having different names. > It's just a receive loop > > server_loop(Registrations, Classes) -> > receive > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > %% Register a new actor > %% > %% @From the erlang short-name or Pid > %% @Class the class of this client > %% @Mode one of [client, server, both] > %% @Access one of [default, polling, none] > %% @Format one of [TBD] > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > {new_reg, From, Class, Mode, Access, Format} -> > ... > > so could get called from any type of node or process. I guess there could be a different pattern depending on the type of 'From' but all the code is common except for that one instance of replying with From or {any, From}. > >> short name in my case (e.g. c1@REDACTED) and I need to use a tuple to >> address it like {any, c1@REDACTED}. The 'any' is a registered name but is >> ignored for all intent and purpose, so it's just any old atom as far >> as I am concerned. It explains this a bit in the interoperability >> tutorial on page 20. > >>> when i go to the interoperability tutorial >>> http://www.erlang.org/doc/doc-5.5.1/doc/tutorial/part_frame.html >>> i have no page numbers. could you give me the chapter/paragraph instead? > 7.1 > >> I guess I need to test the address and see what form it is. Do you >> know of any simple way to determin a Pid from a short address apart >> from looking at the makeup and deducing what it is. > >>> erlang:is_pid/1 is a good way to see if you have a pid. > Thanks, that works fine. > > bengt _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From kalap.kabat@REDACTED Tue Oct 31 17:07:35 2006 From: kalap.kabat@REDACTED (user) Date: Tue, 31 Oct 2006 16:07:35 +0000 (UTC) Subject: [erlang-questions] Package Support/Use References: <96EEE65C-11BE-4A20-93CC-5FA018BCD516@gmail.com> Message-ID: Sean Hinde gmail.com> writes: > > So then we should have uniquely named source code > files anyway. The only benefit of Packages becomes lost. > Well, if you look closer you'll see the listed solutions only require unique *path* names and that's not the same thing. From cyberlync@REDACTED Tue Oct 31 20:22:04 2006 From: cyberlync@REDACTED (Eric Merritt) Date: Tue, 31 Oct 2006 11:22:04 -0800 Subject: [erlang-questions] Package Support/Use In-Reply-To: References: <96EEE65C-11BE-4A20-93CC-5FA018BCD516@gmail.com> Message-ID: So package names and module names are semantically equivalent. These are both solutions to the namespace issue. The namespace problem isn't that bad and we will never have the function name collision problem of C. However, even module name collisions can become annoying as more and more open source code becomes available. Thats actually what really worries me. This will never be a problem for large proprietary code bases but it can very well be a problem for the open source community that is currently building around erlang. Granted there is always ability to use the _ convention and I do. However, this isn't anything more then a hack and not even an elegant one at that. Package names offer a well understood and well tested solution to this problem. They are even in the language right now, but their unsupported (going away any time) status makes them unusable. So if packages aren't palatable to everyone what solution is. On 10/31/06, user wrote: > Sean Hinde gmail.com> writes: > > > > So then we should have uniquely named source code > > files anyway. The only benefit of Packages becomes lost. > > > > Well, if you look closer you'll see the listed solutions only require unique > *path* names and that's not the same thing. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From ulf@REDACTED Tue Oct 31 22:39:11 2006 From: ulf@REDACTED (Ulf Wiger) Date: Tue, 31 Oct 2006 22:39:11 +0100 Subject: [erlang-questions] Package Support/Use In-Reply-To: References: <96EEE65C-11BE-4A20-93CC-5FA018BCD516@gmail.com> Message-ID: Den 2006-10-31 20:22:04 skrev Eric Merritt : > So package names and module names are semantically equivalent. These > are both solutions to the namespace issue. The namespace problem isn't > that bad and we will never have the function name collision problem of > C. However, even module name collisions can become annoying as more > and more open source code becomes available. Thats actually what > really worries me. I agree, and that's been my main reason to support the package concept. In my(*) soon to be released application, erlhive, I rely heavily on both packages and parameterized modules.) (*) Mine and Joe's, to be clear. BR, Ulf W -- Ulf Wiger From cyberlync@REDACTED Tue Oct 31 22:51:22 2006 From: cyberlync@REDACTED (Eric Merritt) Date: Tue, 31 Oct 2006 13:51:22 -0800 Subject: [erlang-questions] Package Support/Use In-Reply-To: References: <96EEE65C-11BE-4A20-93CC-5FA018BCD516@gmail.com> Message-ID: So that being the case, whats required for packages to become a first class feature of the language? More specifically whats the path toward this goal? I ask this not as a troll but as a somewhat concerned member of the community. On 10/31/06, Ulf Wiger wrote: > Den 2006-10-31 20:22:04 skrev Eric Merritt : > > > So package names and module names are semantically equivalent. These > > are both solutions to the namespace issue. The namespace problem isn't > > that bad and we will never have the function name collision problem of > > C. However, even module name collisions can become annoying as more > > and more open source code becomes available. Thats actually what > > really worries me. > > I agree, and that's been my main reason to support the package concept. > > In my(*) soon to be released application, erlhive, I rely heavily > on both packages and parameterized modules.) > > (*) Mine and Joe's, to be clear. > > BR, > Ulf W > -- > Ulf Wiger >