From tobbe@REDACTED Fri Sep 1 09:35:50 2000 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 01 Sep 2000 09:35:50 +0200 Subject: QNX thoughts (off-topic) In-Reply-To: "Vlad Dumitrescu"'s message of "Thu, 31 Aug 2000 22:39:01 +0200" References: Message-ID: > I wonder if anyone knows if the threads and the IPC in QNX (especially the upcoming Neutrino) are lightweight enough to match the Erlang counterparts. If they do, then a very interesting vision begins to appear: an Erlang process becoming a QNX thread, with the messaging being passed natively... the Erlang runtime becomes just another OS extension, and the (Erlang-type) processes in the system need not be in Erlang anymore, but in any language... the beauty of the Erlang system, it's features encompassing the whole OS... I think Geoff Wong have been working on an Erlang implementation like this. Initially it is running on Linux, but I belive the intention is (has been ?) to port it to QNX. (Sorry Geoff if I'm wrong here... ;-) Cheers /Tobbe From bjorn@REDACTED Fri Sep 1 12:14:48 2000 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 01 Sep 2000 12:14:48 +0200 Subject: noshell problem In-Reply-To: Mickael Remond's message of "28 Aug 2000 13:34:09 +0200" References: <87snrphert.fsf@western.ird.idealx.com> <39AA46B5.EC804BCE@erix.ericsson.se> <87snrpfwlq.fsf@western.ird.idealx.com> Message-ID: > > This option is not documented though ("man erl" does not show this option, > which is however pretty useful). > The -detached option will be documented in R7B. /Bj?rn -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From luc.taesch@REDACTED Fri Sep 1 16:24:59 2000 From: luc.taesch@REDACTED (luc.taesch@REDACTED) Date: Fri, 1 Sep 2000 16:24:59 +0200 Subject: compile erlang to bin on intel Message-ID: if i need to compile erlang to binary, on an intel machine, what is ther status ? ( this is for ease of distribution over differents machine, id like to have just a self contained binary to move around) what are the restriction of etos, gerl ? anybody having experience on that ? can i, say, compile the standard library without modif ? ( btw the link to etos seems broken . anybody got news of that ?) http://www.iro.umontreal.ca/~etos/ From joe@REDACTED Fri Sep 1 16:35:39 2000 From: joe@REDACTED (Joe Armstrong) Date: Fri, 1 Sep 2000 16:35:39 +0200 (CEST) Subject: Jobs In-Reply-To: Message-ID: +--------------------+ | Bluetail is hiring | +--------------------+ Don't waste your brain come and work us .... The story so far ... Bluetail does stuff in Erlang - we believe we can do stuff faster in Erlang than any other way - we did some stuff and then ... We got bought up by Alteon << who has been bought up by Nortel >> This means that the stuff we do will be sold by *lots* of salespeople. This means we get an opportunity to change the (programming) world .... and so we want to employ more "development engineers" - << people who can do stuff that we can sell :-) >> to join in the fun. How we work ----------- Get stuff done Have some fun Make some money Make an impact We: 1) Have idea 2) Try the idea out on some customers 3) Implement it (yourself or with help) 4) Deliver to trial customers 5) If the trial customers like it get zillions of salespeople to sell it or back to 1) Note that: - the cycle time here is very short (think months - not years) - You will be expected to implement and sell your own ideas, or you may end up helping somebody else implement their ideas - Non profitable project will be ruthlessly cut Who we want ----------- - Brilliant programmers (must know C, Erlang, ... Unix) - Pragmatists (We *really try* to delivery most stuff in Erlang, but if this is too slow, we'll happily drop Erlang and do it in C. We even write Java if the customers want it :-) - Evangelists who get stuff done We believe in FP (and Erlang in particular). We believe that we can do stuff faster and better in Erlang than any other language. - People with lots of "hands on computing experiences", typical everyday jobs might be: - rig Linux on some weird hardware - write a new emacs mode - read 25 RFCs and figure out what the "real problem" is - talk to a customer - give an Erlang course - Fly to the states with 24 hours notice - ... Extract pluses --------------- Non of these are essential! - In depth knowledge of wireless stuff (WAP, Imode, ...) - In depth knowledge of distributed programming or programming embedded highly available systems - Knowledge of protocols (TCP/IP, IPv6, ICQ, Freenet ...) - Speak Swedish Benefits -------- - Money (we pay you :-) - You'll learn a lot (not theory but "learning by doing") /Joe -- Joe Armstrong, Bluetail AB, tel: +46 8-545 550 00 S:t Eriksgatan 44, fax: +46 8-545 550 50 SE-112 32 Stockholm, Sweden info: www.bluetail.com From vances@REDACTED Fri Sep 1 17:37:24 2000 From: vances@REDACTED (Vance Shipley) Date: Fri, 1 Sep 2000 11:37:24 -0400 Subject: erl_interface and ALIVE Message-ID: I am having some trouble with erl_interface where the communications between the C process and Erlang seem to get bunged up. One problem I have is that when many messages are sent quickly to Erlang from C some/many will fail with EAGAIN ("Resource temporarily unavailable"). I am still thinking through whether this problem should best be solved by changes to erl_interface and/or to my C code. Another problem which I do not yet understand is that sometimes the Erlang node will produce the following messages in the logs: ===== ALIVE Fri Sep 1 11:32:49 2000 ===== ALIVE Fri Sep 1 11:32:49 2000 ===== ALIVE Fri Sep 1 11:32:49 2000 ===== ALIVE Fri Sep 1 11:32:49 2000 ===== ALIVE Fri Sep 1 11:32:49 2000 ===== ALIVE Fri Sep 1 11:32:49 2000 ===== ALIVE Fri Sep 1 11:32:49 2000 ===== ALIVE Fri Sep 1 11:32:49 2000 ===== ALIVE Fri Sep 1 11:32:49 2000 ===== ALIVE Fri Sep 1 11:32:49 2000 ===== ALIVE Fri Sep 1 11:32:49 2000 Hmmm... any ideas? -Vance From etxuwig@REDACTED Fri Sep 1 21:07:43 2000 From: etxuwig@REDACTED (Ulf Wiger) Date: Fri, 1 Sep 2000 21:07:43 +0200 (MET DST) Subject: erl_interface and ALIVE In-Reply-To: Message-ID: On Fri, 1 Sep 2000, Vance Shipley wrote: >Another problem which I do not yet understand is that >sometimes the Erlang node will produce the following >messages in the logs: > >===== ALIVE Fri Sep 1 11:32:49 2000 > >===== ALIVE Fri Sep 1 11:32:49 2000 > >===== ALIVE Fri Sep 1 11:32:49 2000 These entries are written to mark that the node is up and running, even though it is not outputting anything to the shell. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Network Architecture & Product Strategies mob: +46 70 519 81 95 Ericsson Telecom AB, Datacom Networks and IP Services Varuv?gen 9, ?lvsj?, S-126 25 Stockholm, Sweden From vances@REDACTED Fri Sep 1 21:23:57 2000 From: vances@REDACTED (Vance Shipley) Date: Fri, 1 Sep 2000 15:23:57 -0400 Subject: erl_interface and ALIVE In-Reply-To: Message-ID: Uff, Yes, but check out the times! My buffers are filling up with these messages as they are produced many times a second. This seems to be produced by run_erl. In run_erl.c: /* Enter the work loop */ timeout.tv_sec = LOG_ALIVE_MINUTES*60; timeout.tv_usec = 0; while (1) { maxfd = MAX(rfd, mfd); FD_ZERO(&readfds); FD_SET(rfd, &readfds); FD_SET(mfd, &readfds); time(&last_activity); ready = select(maxfd + 1, &readfds, NULL, NULL, &timeout); if (ready < 0) { /* Some error occured */ error("Error in select."); exit(1); } else { /* Check how long time we've been inactive */ time_t now; time(&now); if(!ready || now - last_activity > LOG_ACTIVITY_MINUTES*60) { /* Either a time out: 15 minutes without action, */ /* or something is coming in right now, but it's a long time */ /* since last time, so let's write a time stamp this message */ sprintf(buf, "\n===== %s%s", ready?"":"ALIVE ", ctime(&now)); write_to_log(&lfd, &lognum, buf, strlen(buf)); } } I believe that what is happening is that select is returning 0 at these times. It gets into a state where it gets stuck doing this. It hasn't timed out though as it's been far, far less than a minute. I think I'll test and report errno and see what it says... -Vance } >Another problem which I do not yet understand is that } >sometimes the Erlang node will produce the following } >messages in the logs: } > } >===== ALIVE Fri Sep 1 11:32:49 2000 } > } >===== ALIVE Fri Sep 1 11:32:49 2000 } > } >===== ALIVE Fri Sep 1 11:32:49 2000 } } } These entries are written to mark that the node is up and running, } even though it is not outputting anything to the shell. } } /Uffe From mikl@REDACTED Sun Sep 3 22:49:57 2000 From: mikl@REDACTED (Mickael Remond) Date: 03 Sep 2000 22:49:57 +0200 Subject: gen_tcp: lost message Message-ID: <87vgwdi4ju.fsf@louxor.home> Hi, I am working on an IRC client in Erlang and I get some ping timeout very often. When a lot of data are send to a channel, it seems that I do not receive the PING request from thus server and thus are unable to answer... I have tried both the active and passive mode, but I am still losing data. Is it really possible (I mean are the message queued ?) ? What should I do to trap all messages and avoids overflow ? Thank you in advance for you help. -- Micka?l R?mond From doug@REDACTED Mon Sep 4 00:24:19 2000 From: doug@REDACTED (Doug Bagley) Date: 03 Sep 2000 17:24:19 -0500 Subject: beginner needs help with sieve program Message-ID: Hi, I just started learning about erlang a couple days ago. The first thing I wanted to do was to see how efficiently I could program a sieve of eratosthenes for numbers 2 to 8192. Basically I need help finding the bug in the first attempt and I'd also be interested if anyone has suggestions on how to write a speedy sieve. The following is my first attempt, which has runtimes that compare favorably with Perl, Tcl, Python and Guile, but it has a bug in it: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % sieve.erl % I run it like this: % > erl -compile sieve ; erl -noinput -s sieve main 100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -module(sieve). -export([main/1]). -import(io, [fwrite/2]). -import(lists, [seq/2, filter/2]). -import(math, [sqrt/1]). %% get the program argument, which is how many test iterations %% to run main(Args) -> [Tmp] = Args, Iter = list_to_integer(atom_to_list(Tmp)), test(Iter), halt(0). %% run the test N times test(N) -> Primes = sieve(8192), %% there is a bug in our sieve which lets says 2197 is prime %% but it is not, it is a multiple of 13 %% all the other 1028 primes in the list are okay though %% so i fudge the correct answer for now Count = length(Primes) - 1, case N > 1 of true -> test(N-1); false -> fwrite("Count: ~w\n", [Count]) end. sieve(Size) -> sieve(2, sqrt(Size), seq(2,Size)). sieve(Start, End, Seq) -> case Start > End of true -> Seq; false -> sieve(Start + 1, End, remove_multiples(Start, Start+Start, Seq)) end. %% remove multiples of Num from a list without using modulus %% I've rewritten this 2 different ways using case %% and I get the same results remove_multiples(Num, Next, [H|T]) when H < Next -> [H | remove_multiples(Num, Next, T)]; remove_multiples(Num, Next, [H|T]) when H == Next -> remove_multiples(Num, Next+Num, T); remove_multiples(Num, Next, [H|T]) when H > Next -> [H | remove_multiples(Num, Next+Num, T)]; remove_multiples(X, Y, []) -> []. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% The next attempt was to use modulus and write it in a very short, hopefully, erlang way. This produces correct results, but is incredibly slow. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % sieve.erl % I run it like this: % > erl -compile sieve ; erl -noinput -s sieve main 100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -module(sieve). -export([main/1]). -import(io, [fwrite/2]). -import(lists, [seq/2, filter/2]). main(Args) -> [Tmp] = Args, Iter = list_to_integer(atom_to_list(Tmp)), test(Iter), halt(0). test(N) -> Primes = sieve(8192), Count = length(Primes), case N > 1 of true -> test(N-1); false -> fwrite("Count: ~w\n", [Count]) end. sieve(Size) -> sievel(seq(2,Size)). sievel([H|T]) -> [H | sievel(filter(fun(N) -> N rem H > 0 end, T))]; sievel([]) -> []. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% From maurice@REDACTED Mon Sep 4 02:00:08 2000 From: maurice@REDACTED (Maurice Castro) Date: Mon, 4 Sep 2000 11:00:08 +1100 (EST) Subject: beginner needs help with sieve program In-Reply-To: from Doug Bagley at "Sep 3, 2000 05:24:19 pm" Message-ID: <200009040000.LAA24678@parallel.serc.rmit.edu.au> The Erastoshenes prime number sieve is an excelent starting problem for Erlang ... in fact I set it as an exercise in my book. A sample solution is provided. http://www.serc.rmit.edu.au/~maurice/erlbk/ http://www.serc.rmit.edu.au/~maurice/erlbk/eg/choice/erasto.erl This example delibarately does not use: funs, and many of the functions provided in the modules. Although the provided functions are often more efficient, they tend to distract from the learning process. It turns out that it is the remove multiples routine that is at fault ... from your comments it is clear that you have already established this. My theory is that the problem is actually a problem in the algorithm not in the Erlang implemenation as the immediate cause of the problem is that remove multiples attempts to evaluate over the following arguments: T = [2197, 2201, 2203 | ...] H = 2183 Next = 2184 Num = 13 The algorithm is `unlucky' here as the value of H is exactly 13 more than the value next. Hence the logic of the algorithm lets you down. Maurice Castro From doug@REDACTED Mon Sep 4 04:50:28 2000 From: doug@REDACTED (Doug Bagley) Date: 03 Sep 2000 21:50:28 -0500 Subject: beginner needs help with sieve program In-Reply-To: Maurice Castro's message of "Mon, 4 Sep 2000 11:00:08 +1100 (EST)" References: <200009040000.LAA24678@parallel.serc.rmit.edu.au> Message-ID: Maurice Castro writes: > The Erastoshenes prime number sieve is an excelent starting problem for > Erlang ... in fact I set it as an exercise in my book. A sample solution > is provided. > > http://www.serc.rmit.edu.au/~maurice/erlbk/ > http://www.serc.rmit.edu.au/~maurice/erlbk/eg/choice/erasto.erl Thanks for the hint ... I had made a stupid error, of course! Here's the fixed version, but yours is still almost 3 times faster than mine. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -module(sieve). -export([main/1]). -import(io, [fwrite/2]). -import(lists, [seq/2, filter/2]). -import(math, [sqrt/1]). %% get the program argument, which is how many test iterations %% to run main(Args) -> [Tmp] = Args, Iter = list_to_integer(atom_to_list(Tmp)), test(Iter), halt(0). test(N) -> Primes = sieve(8192), Count = length(Primes), case N > 1 of true -> test(N-1); false -> fwrite("Count: ~w\n", [Count]) end. sieve(Size) -> sieve(2, sqrt(Size), seq(2,Size)). sieve(Start, End, Seq) -> case Start > End of true -> Seq; false -> sieve(Start + 1, End, remove_multiples(Start, Start+Start, Seq)) end. %% remove multiples of Num from a list without using modulus % if Head of list is less than the Next multiple we seek % simply recurse on Tail remove_multiples(Num, Next, [H|T]) when H < Next -> [H | remove_multiples(Num, Next, T)]; % this is the rule that actually removes a multiple % when Head of List matches Next multiple we seek. remove_multiples(Num, Next, [H|T]) when H == Next -> remove_multiples(Num, Next+Num, T); % when we find that the Head is greater than the Next multiple % we seek, it's time to increment Next by Num remove_multiples(Num, Next, List) when hd(List) > Next -> remove_multiples(Num, Next+Num, List); % end of list remove_multiples(_, _, []) -> []. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Cheers, Doug From kenneth@REDACTED Mon Sep 4 12:55:39 2000 From: kenneth@REDACTED (Kenneth Lundin) Date: Mon, 04 Sep 2000 12:55:39 +0200 Subject: Beta version of Open Source Erlang available for download Message-ID: <39B37FAB.D65BE10A@erix.ericsson.se> A beta version called R7A of the next to come Open Source Erlang is now available for download. See http://www.erlang.org for highlights, documentation and download. We appreciate that you try this version and give feedback which help us to make a better final version (planned to be ready within approximately a month). -- Kenneth Lundin Ericsson Utvecklings AB kenneth@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 57 25 125 25 ?lvsj? From mickael.remond@REDACTED Mon Sep 4 14:11:15 2000 From: mickael.remond@REDACTED (Mickael Remond) Date: 04 Sep 2000 14:11:15 +0200 Subject: gen_tcp: lost message In-Reply-To: Mickael Remond's message of "03 Sep 2000 22:49:57 +0200" References: <87vgwdi4ju.fsf@louxor.home> Message-ID: <87lmx89x24.fsf@western.ird.idealx.com> >>>>> "Mickael" == Mickael Remond writes: > Hi, > I am working on an IRC client in Erlang and I get some ping timeout very > often. > When a lot of data are send to a channel, it seems that I do not receive the > PING request from thus server and thus are unable to answer... > I have tried both the active and passive mode, but I am still losing data. > Is it really possible (I mean are the message queued ?) ? In fact I think I have some ideas of what is going wrong in my code : too much time between two accepts. This way the tcp listen queue can be flooded if this queue is too short... I will correct my code accordingly, but is it also possible to increase the size of the tcp listen queue ? -- Micka?l From Sean.Hinde@REDACTED Mon Sep 4 14:22:23 2000 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 4 Sep 2000 13:22:23 +0100 Subject: QNX thoughts (off-topic) Message-ID: <402DD461F109D411977E0008C791C3125650E5@imp02mbx.one2one.co.uk> > > I wonder if anyone knows if the threads and the IPC in QNX > (especially the upcoming Neutrino) are lightweight enough to > match the Erlang counterparts. If they do, then a very > interesting vision begins to appear: an Erlang process > becoming a QNX thread, with the messaging being passed > natively... the Erlang runtime becomes just another OS > extension, and the (Erlang-type) processes in the system need > not be in Erlang anymore, but in any language... the beauty > of the Erlang system, it's features encompassing the whole OS... My initial thoughts were to do a QNX implementation of the distributed erlang protocol using native QNET. This wouldn't be too hard - especially given the work already done in R7 on tidying *_dist.erl up :-). It would have the advantage of bringing all the clever comms resilience to a set of erlang nodes. Thinking past this I started to come across a few differences in approach which don't map very well. QNX message passing is synchronous - the calling thread blocks until a reply is received (with an optional timeout). This means there is no concept of a mailbox with pattern matched selective receive, which potentially implies that QNX message passing is relegated to moving messages between native erlang mailboxes. I agree it sounds an extraordinarily powerful match and my thinking got almost as carried away as yours! Erlang as the native language for QNX indeed! And if Geoff is working on some part of it that is fantastic. Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From luc.taesch@REDACTED Mon Sep 4 15:14:04 2000 From: luc.taesch@REDACTED (luc.taesch@REDACTED) Date: Mon, 4 Sep 2000 15:14:04 +0200 Subject: patch to mnesia Message-ID: im happy to ( humbly ?) contribute my first patch.(well, maybe). on mnesia 3.8.2, linux, i cant have mnesia:load_textfile working. i found that in mnesia_text.erl, L78, make_tabs/1 uses: case catch mnesia:table_info(Tab, size) of {'EXIT', _} -> %% non-existing table to check the prior existence to the table Tab. unfortunately, mnesia:table_info( non_existent_table, size) returns 0 on my release., and not {EXIT..} (which is fair) ill suggest using table_info(Tab, record_info) instead, which does reply exit for a non_existent_table. another one : line 80 Attrs is a list, so case mnesia:create_table(Tab, [{attributes, [Attrs]}]) should be: case mnesia:create_table(Tab, [{attributes, Attrs}]) here is the final working code code : diff /home/luc/test/otp_src_R6B-0/lib/mnesia/src/mnesia_text.erl /usr/local/lib/erlang/lib/mnesia-3.8.2/src/mnesia_text.erl 78c78 < case catch mnesia:table_info(Tab, size) of --- > case catch mnesia:table_info(Tab, record_info) of 80c80 < case mnesia:create_table(Tab, [{attributes, [Attrs]}]) of --- > case mnesia:create_table(Tab, [{attributes, Attrs}]) of [luc@REDACTED src]$ From hakan@REDACTED Mon Sep 4 15:40:52 2000 From: hakan@REDACTED (Hakan Mattsson) Date: Mon, 4 Sep 2000 15:40:52 +0200 (MET DST) Subject: patch to mnesia In-Reply-To: Message-ID: These two errors has been fixed in Mnesia 3.9.2 (now available in Erlang/OTP R7A). But thanks anyway for your debugging effort! /H?kan PS. The external textfile format is not intended to be used in real products. Please, follow the advice in the Mnesia man-page: "Only use this function for educational purposes. Use other functions to deal with real backups." --- H?kan Mattsson Ericsson Computer Science Laboratory http://www.ericsson.se/cslab/~hakan On Mon, 4 Sep 2000 luc.taesch@REDACTED wrote: > im happy to ( humbly ?) contribute my first patch.(well, maybe). > > on mnesia 3.8.2, linux, i cant have mnesia:load_textfile working. > > i found that in mnesia_text.erl, L78, make_tabs/1 uses: > case catch mnesia:table_info(Tab, size) of > {'EXIT', _} -> %% non-existing table > to check the prior existence to the table Tab. > > unfortunately, mnesia:table_info( non_existent_table, size) returns 0 on my > release., and not {EXIT..} (which is fair) > > ill suggest using table_info(Tab, record_info) instead, which does reply exit > for a non_existent_table. > > another one > : line 80 Attrs is a list, so > case mnesia:create_table(Tab, [{attributes, [Attrs]}]) > should be: > case mnesia:create_table(Tab, [{attributes, Attrs}]) > > > here is the final working code code : > > diff /home/luc/test/otp_src_R6B-0/lib/mnesia/src/mnesia_text.erl > /usr/local/lib/erlang/lib/mnesia-3.8.2/src/mnesia_text.erl > 78c78 > < case catch mnesia:table_info(Tab, size) of > --- > > case catch mnesia:table_info(Tab, record_info) of > 80c80 > < case mnesia:create_table(Tab, [{attributes, [Attrs]}]) of > --- > > case mnesia:create_table(Tab, [{attributes, Attrs}]) of > [luc@REDACTED src]$ > From luc.taesch@REDACTED Mon Sep 4 15:50:58 2000 From: luc.taesch@REDACTED (luc.taesch@REDACTED) Date: Mon, 4 Sep 2000 15:50:58 +0200 Subject: patch to mnesia Message-ID: > -----Original Message----- > From: hakan [mailto:hakan@REDACTED] > Sent: Montag, 4. September 2000 15:41 > To: Taesch, Luc > Cc: hakan; erlang-questions > Subject: Re: patch to mnesia > > > > These two errors has been fixed in Mnesia 3.9.2 > (now available in Erlang/OTP R7A). good to hear ! ( im half surprised, as nobody really frowned when i raised this question a while ago. i was suspecting it was working in some other enviroment/release) > But thanks > anyway for your debugging effort! > most welcomed ! > /H?kan > > PS. > > The external textfile format is not intended to be used > in real products. Please, follow the advice in the Mnesia > man-page: > > "Only use this function for educational purposes. > Use other functions to deal with real backups." > in fact , im not using it for backups, but during the evolutionary phase of development. we have a very short cycle, XP style, and we find convenient to be able to dump the db to textfiles, -either to preserve the data in case of break of the schema ( and we can at least edit by hand the existing data), - or to prepare test data, especially when the (editing) front end is not ready for inputing. any comments ? if u have any idea on adapting schema more automatically, ure most welcomed ! From hakan@REDACTED Mon Sep 4 17:15:04 2000 From: hakan@REDACTED (Hakan Mattsson) Date: Mon, 4 Sep 2000 17:15:04 +0200 (MET DST) Subject: patch to mnesia In-Reply-To: Message-ID: On Mon, 4 Sep 2000 luc.taesch@REDACTED wrote: > > The external textfile format is not intended to be used > > in real products. Please, follow the advice in the Mnesia > > man-page: > > > > "Only use this function for educational purposes. > > Use other functions to deal with real backups." > > > > in fact , im not using it for backups, but during the evolutionary phase of > development. we have a very short cycle, XP style, and we find convenient to be > able to dump the db to textfiles, > -either to preserve the data in case of break of the schema ( and we can at > least edit by hand the existing data), If you with "break of the schema" mean that the database schema file is broken you should use the backup utilities to protect your system. If you with "break of the schema" mean that you have changed the record definitions you may either use mnesia:transform_table to perform on-line changes of the schema or apply mnesia:traverse_backup on a backup if you prefer to do it off-line. > - or to prepare test data, especially when the (editing) front end is not ready > for inputing. > > any comments ? > if u have any idea on adapting schema more automatically, ure most welcomed ! The functions in Mnesia that deals with the textual format (mnesia:dump_to_textfile/1 and mnesia:load_textfile/1) has many shortcomings, such as: - the file format is vulnerable for crashes - only local data is handled - only a subset of Erlang's data types is handled - only designed to cope with small tables - ... The internal file format (tables, logs, backups) in Mnesia has been designed with crash recovery in mind. Even if the filesystem gets currupt and later fixed by fsck, Mnesia can in most cases repair its files (sometimes by discarding corrupt data) and be able to start. During development and testing this default behaviour may suffice. But in order to be able to recover from any kind of failures you must backup your system regulary to a media separate from the database media (at least to another disk partition, but preferrably to a remote disk or tape situated at another geographical location). The Mnesia backup utilities with its callback API is designed to cope with this. Instead of editing the plain textfile you may use the table viewer tool (tv) which has the ability of editing tables. You may either edit the database directly on-line or perform the edits off-line in a mirror database. /H?kan --- H?kan Mattsson Ericsson Computer Science Laboratory http://www.ericsson.se/cslab/~hakan From taavi@REDACTED Mon Sep 4 18:46:14 2000 From: taavi@REDACTED (Taavi Talvik) Date: Mon, 4 Sep 2000 18:46:14 +0200 (EET) Subject: R7A and jdk 1.2 Message-ID: Hello! Is there any paticular reason why jdk 1.2 is a must? Not all platforms where R6 was supported have functional jdk 1.2 port (example FreeBSD). best regards, taavi ----------------------------------------------------------- Taavi Talvik | Internet: taavi@REDACTED Unineti Andmeside AS | phone: +372 6405150 Ravala pst. 10 | fax: +372 6405151 Tallinn 10143, Estonia | From sabry@REDACTED Mon Sep 4 19:46:51 2000 From: sabry@REDACTED (Amr Sabry) Date: Mon, 04 Sep 2000 12:46:51 -0500 Subject: Call for Papers (Continuations Workshop CW'01) References: <8p05ar$snn$1@wanadoo.fr> <39b3b25e.27844917@news.wanadoo.fr> Message-ID: <39B3E00B.A3F55F1A@cs.indiana.edu> The Third ACM SIGPLAN Workshop on Continuations (CW'01) London, England, Jan. 16, 2001 Collocated with POPL '01 (Jan. 17, 2001 -- Jan. 19, 2001) http://www.cs.indiana.edu/~sabry/cw01/ The notion of continuations is ubiquitous in many different areas of computer science, including category theory, compilers, logic, operating systems, programming, and semantics. Following on the 1992 and 1997 ACM SIGPLAN Workshops on Continuations (http://www.brics.dk/~cw97/), we are organizing a new workshop to provide a forum for the presentation and discussion of new results and work in progress aimed at a better understanding of the nature of continuations, the relation of continuations to other areas of logic and computer science, and exciting new applications of continuations in contexts such as mobile threads, simulation, distributed systems, graphical user interfaces, and education. Participants wishing to give short formal presentations are asked to send a short abstract (less than four pages) to sabry@REDACTED Abstracts will be judged on originality, significance, correctness, and clarity. Abstracts must describe work unpublished in refereed venues, and must not submitted for publication elsewhere (i.e., either a conference or a journal) An informal proceedings will be distributed at the workshop and will be available subsequently as an Indiana University technical report. As for CW'92 and CW'97 http://www.wkap.nl/issuetoc.htm/1388-3690+11+2+1998 http://www.wkap.nl/issuetoc.htm/1388-3690+12+1+1999 a special issue of the international journal Higher-Order and Symbolic Computation (HOSC, http://www.wkap.nl/journals/lasc) dedicated to CW'01, will be planned afterwards. Important Dates and Submission Details October 1, 2000: Deadline for submission of abstracts. November 5, 2000: Notification. December 3, 2000: Camera-ready copy. January 16, 2001: CW'01 in London From sgelkins@REDACTED Mon Sep 4 20:09:11 2000 From: sgelkins@REDACTED (Steve Elkins) Date: Mon, 04 Sep 2000 14:09:11 -0400 Subject: novice question Message-ID: <39B3E547.D9567FE1@bellsouth.net> Hi, I've run into a few problems getting 2 nodes on the same machine connected. I hope someone on the list will tell me what I should look at next. Details follow. I've killed and restarted epmd with 2 -d flags... sge@REDACTED:16$ ./epmd -d -d epmd: Mon Sep 4 13:42:59 2000: epmd running - daemon = 0 epmd: Mon Sep 4 13:42:59 2000: try to initiate listening port 4369 epmd: Mon Sep 4 13:42:59 2000: starting epmd: Mon Sep 4 13:42:59 2000: entering the main select() loop In another window... sge@REDACTED:56$ erl -sname bank Erlang (BEAM) emulator version 4.9.1 [source] Eshell V4.9.1 (abort with ^G) (bank@REDACTED)1> ...and back in the 1st window... epmd: Mon Sep 4 13:43:10 2000: opening connection on file descriptor 4 epmd: Mon Sep 4 13:43:10 2000: got 19 bytes ***** 00000000 00 11 78 b4 41 4d 00 00 05 00 05 00 04 62 61 6e |..x.AM.......ban| ***** 00000010 6b 00 00 |k..| epmd: Mon Sep 4 13:43:10 2000: ** got ALIVE2_REQ epmd: Mon Sep 4 13:43:10 2000: registering 'bank:2', port 46145 epmd: Mon Sep 4 13:43:10 2000: type 77 proto 0 highvsn 5 lowvsn 5 epmd: Mon Sep 4 13:43:10 2000: got 4 bytes ***** 00000000 79 00 00 02 |y...| epmd: Mon Sep 4 13:43:10 2000: ** sent ALIVE2_RESP for "bank" ...in a 3rd window... sge@REDACTED:12$ /usr/local/lib/erlang/bin/epmd -names epmd: up and running on port 4369 with data: name bank at port 14917 sge@REDACTED:13$ ...and back in the 1st window... epmd: Mon Sep 4 13:47:44 2000: opening connection on file descriptor 5 epmd: Mon Sep 4 13:47:44 2000: got 3 bytes ***** 00000000 00 01 6e |..n| epmd: Mon Sep 4 13:47:44 2000: ** got NAMES_REQ epmd: Mon Sep 4 13:47:44 2000: got 4 bytes ***** 00000000 00 00 11 11 |....| epmd: Mon Sep 4 13:47:44 2000: got 24 bytes ***** 00000000 6e 61 6d 65 20 62 61 6e 6b 20 61 74 20 70 6f 72 |name bank at por| ***** 00000010 74 20 34 36 31 34 35 0a |t 46145.| epmd: Mon Sep 4 13:47:44 2000: ** sent NAMES_RESP epmd: Mon Sep 4 13:47:44 2000: closing connection on file descriptor 5 ...which all makes sense, but... (bank@REDACTED)1> net_adm:names(). {error,nxdomain} (bank@REDACTED)2> ...hmmm? nslookup works here for short name, long name, and dotted quad. net_adm:host_file() parses my .hosts.erlang file ok. Still with me? What other information should I provide? Got into this trying to run the Erlang book's banking example in chapter 6. Works fine in a single shell, of course, but I got a nodedown when trying to talk between 2 nodes and started poking around. I'm on OpenBSD 2.7. Thanks for reading, Steve From bjowi@REDACTED Mon Sep 4 15:04:42 2000 From: bjowi@REDACTED (=?ISO-8859-1?Q?Bj=F6rn Wingman?=) Date: Mon, 4 Sep 2000 15:04:42 +0200 (MET DST) Subject: Beta version of Open Source Erlang available for download In-Reply-To: <39B37FAB.D65BE10A@erix.ericsson.se> (message from Kenneth Lundin on Mon, 04 Sep 2000 12:55:39 +0200) References: <39B37FAB.D65BE10A@erix.ericsson.se> Message-ID: <200009041304.PAA03606@sture.lysator.liu.se> > A beta version called R7A of the next to come Open Source Erlang is > now available for download. I have some problems compiling this (on solaris), which I think were present in R6B too. The configure scripts seem to detect the wrong version of perl, and also of install. The version of perl I want to use is first in my PATH, but configure always takes /usr/local/bin/perl. This perl doesn't have all modules needed, and so the compilation fails with: /usr/local/bin/perl utils/beam_makeops -outdir sparc-sun-solaris2.7 -emulator \ /home/bjowi/otp_src_R7A-0/lib/compiler/src/genop.tab beam/ops.tab Can't locate vars.pm in @INC at utils/beam_makeops line 21. BEGIN failed--compilation aborted at utils/beam_makeops line 21. Also, /usr/ucb/install is used instead of the nice GNU install I have. In the configure scripts, it seems that /usr/ucb/install is always chosen on solaris. /Bj?rn Wingman From not.for.email@REDACTED Tue Sep 5 08:11:46 2000 From: not.for.email@REDACTED (Gordon Beaton) Date: 5 Sep 2000 06:11:46 GMT Subject: R7A and jdk 1.2 References: Message-ID: <8p22r2$1bu$1@news.du.uab.ericsson.se> On 4 Sep 2000 16:46:14 GMT, Taavi Talvik wrote: > Is there any paticular reason why jdk 1.2 is a must? Not all > platforms where R6 was supported have functional jdk 1.2 port > (example FreeBSD). To run erlang it isn't. However some parts of Jinterface use classes that aren't available with 1.1 JDKs, for example WeakReferences and some things from Collections. /gordon -- g o r d o n . b e a t o n @ e r i c s s o n . c o m software architecture laboratory ericsson research stockholm, sweden From raimo@REDACTED Tue Sep 5 10:25:21 2000 From: raimo@REDACTED (Raimo Niskanen) Date: Tue, 05 Sep 2000 10:25:21 +0200 Subject: novice question References: <39B3E547.D9567FE1@bellsouth.net> Message-ID: <39B4ADF1.F6A6DE09@erix.ericsson.se> Hi. epmd is automatically started if needed when the node is started. Try this: In window 1 erl -sname bank In window 2 erl -sname sge when erlang has started net_adm:ping('bank@REDACTED'). You should get the response 'pong' from that, 'pang' means failure net_adm:nodes(). net_adm:ping/1 is not at all the only way to establish a connection, in fact a connection is established whenever necessary. You rarely need to bother with epmd. For example, if the a process on the node bank@REDACTED registers a name with erlang:register(Name, Pid), when a process on node sge@REDACTED sends using {Name, Node} ! Message, the connection is automatically established. / Raimo Niskanen, Erlang/OTP Steve Elkins wrote: > > Hi, > > I've run into a few problems getting 2 nodes on the same machine > connected. I hope someone on the list will tell me what I should > look at next. Details follow. > > I've killed and restarted epmd with 2 -d flags... > > sge@REDACTED:16$ ./epmd -d -d > epmd: Mon Sep 4 13:42:59 2000: epmd running - daemon = 0 > epmd: Mon Sep 4 13:42:59 2000: try to initiate listening port 4369 > epmd: Mon Sep 4 13:42:59 2000: starting > epmd: Mon Sep 4 13:42:59 2000: entering the main select() loop > > In another window... > > sge@REDACTED:56$ erl -sname bank > Erlang (BEAM) emulator version 4.9.1 [source] > > Eshell V4.9.1 (abort with ^G) > (bank@REDACTED)1> > > ...and back in the 1st window... > > epmd: Mon Sep 4 13:43:10 2000: opening connection on file descriptor 4 > epmd: Mon Sep 4 13:43:10 2000: got 19 bytes > ***** 00000000 00 11 78 b4 41 4d 00 00 05 00 05 00 04 62 61 6e |..x.AM.......ban| > ***** 00000010 6b 00 00 |k..| > epmd: Mon Sep 4 13:43:10 2000: ** got ALIVE2_REQ > epmd: Mon Sep 4 13:43:10 2000: registering 'bank:2', port 46145 > epmd: Mon Sep 4 13:43:10 2000: type 77 proto 0 highvsn 5 lowvsn 5 > epmd: Mon Sep 4 13:43:10 2000: got 4 bytes > ***** 00000000 79 00 00 02 |y...| > epmd: Mon Sep 4 13:43:10 2000: ** sent ALIVE2_RESP for "bank" > > ...in a 3rd window... > > sge@REDACTED:12$ /usr/local/lib/erlang/bin/epmd -names > epmd: up and running on port 4369 with data: > name bank at port 14917 > sge@REDACTED:13$ > > ...and back in the 1st window... > > epmd: Mon Sep 4 13:47:44 2000: opening connection on file descriptor 5 > epmd: Mon Sep 4 13:47:44 2000: got 3 bytes > ***** 00000000 00 01 6e |..n| > epmd: Mon Sep 4 13:47:44 2000: ** got NAMES_REQ > epmd: Mon Sep 4 13:47:44 2000: got 4 bytes > ***** 00000000 00 00 11 11 |....| > epmd: Mon Sep 4 13:47:44 2000: got 24 bytes > ***** 00000000 6e 61 6d 65 20 62 61 6e 6b 20 61 74 20 70 6f 72 |name bank at por| > ***** 00000010 74 20 34 36 31 34 35 0a |t 46145.| > epmd: Mon Sep 4 13:47:44 2000: ** sent NAMES_RESP > epmd: Mon Sep 4 13:47:44 2000: closing connection on file descriptor 5 > > ...which all makes sense, but... > > (bank@REDACTED)1> net_adm:names(). > {error,nxdomain} > (bank@REDACTED)2> > > ...hmmm? nslookup works here for short name, long name, and dotted > quad. net_adm:host_file() parses my .hosts.erlang file ok. > > Still with me? What other information should I provide? Got into > this trying to run the Erlang book's banking example in chapter 6. > Works fine in a single shell, of course, but I got a nodedown when > trying to talk between 2 nodes and started poking around. I'm on > OpenBSD 2.7. > > Thanks for reading, > Steve From sgelkins@REDACTED Tue Sep 5 11:01:09 2000 From: sgelkins@REDACTED (Steve Elkins) Date: Tue, 05 Sep 2000 05:01:09 -0400 Subject: novice question References: <39B3E547.D9567FE1@bellsouth.net> <39B4ADF1.F6A6DE09@erix.ericsson.se> Message-ID: <39B4B655.522C8C19@bellsouth.net> Raimo Niskanen wrote: > > Hi. > > epmd is automatically started if needed when the node is started. > > Try this: > > In window 1 > erl -sname bank > > In window 2 > erl -sname sge > when erlang has started > net_adm:ping('bank@REDACTED'). > You should get the response 'pong' from that, 'pang' means failure Thanks, I should've said that I'd tried that, too. pang is what I get. > net_adm:nodes(). > > net_adm:ping/1 is not at all the only way to establish a connection, in > fact a connection is established whenever necessary. You rarely need to > bother with epmd. For example, if the a process on the node bank@REDACTED > registers a name with erlang:register(Name, Pid), when a process on node > sge@REDACTED sends using {Name, Node} ! Message, the connection is > automatically established. And I should have made clear that the failure of this is what led me to my experiments with epmd -d -d and names(). Pascal Brisset wrote: > > > (bank@REDACTED)1> net_adm:names(). > > {error,nxdomain} > > I have similar name resolutions problems on a system with dynamic IP > (Linux, ADSL, DHCP). Use tcpdump to see which addresses Erlang is > trying to resolve or contact. Haven't tried this yet, but I certainly will, because... > For a quick start, try "erl -sname bank@REDACTED". ...this gives me {error,nxdomain} too. Thanks very much to both of you. > Steve Elkins wrote: > > > > Hi, > > > > I've run into a few problems getting 2 nodes on the same machine > > connected. I hope someone on the list will tell me what I should > > look at next. Details follow. > > > > I've killed and restarted epmd with 2 -d flags... > > > > sge@REDACTED:16$ ./epmd -d -d > > epmd: Mon Sep 4 13:42:59 2000: epmd running - daemon = 0 > > epmd: Mon Sep 4 13:42:59 2000: try to initiate listening port 4369 > > epmd: Mon Sep 4 13:42:59 2000: starting > > epmd: Mon Sep 4 13:42:59 2000: entering the main select() loop > > > > In another window... > > > > sge@REDACTED:56$ erl -sname bank > > Erlang (BEAM) emulator version 4.9.1 [source] > > > > Eshell V4.9.1 (abort with ^G) > > (bank@REDACTED)1> > > > > ...and back in the 1st window... > > > > epmd: Mon Sep 4 13:43:10 2000: opening connection on file descriptor 4 > > epmd: Mon Sep 4 13:43:10 2000: got 19 bytes > > ***** 00000000 00 11 78 b4 41 4d 00 00 05 00 05 00 04 62 61 6e |..x.AM.......ban| > > ***** 00000010 6b 00 00 |k..| > > epmd: Mon Sep 4 13:43:10 2000: ** got ALIVE2_REQ > > epmd: Mon Sep 4 13:43:10 2000: registering 'bank:2', port 46145 > > epmd: Mon Sep 4 13:43:10 2000: type 77 proto 0 highvsn 5 lowvsn 5 > > epmd: Mon Sep 4 13:43:10 2000: got 4 bytes > > ***** 00000000 79 00 00 02 |y...| > > epmd: Mon Sep 4 13:43:10 2000: ** sent ALIVE2_RESP for "bank" > > > > ...in a 3rd window... > > > > sge@REDACTED:12$ /usr/local/lib/erlang/bin/epmd -names > > epmd: up and running on port 4369 with data: > > name bank at port 14917 > > sge@REDACTED:13$ > > > > ...and back in the 1st window... > > > > epmd: Mon Sep 4 13:47:44 2000: opening connection on file descriptor 5 > > epmd: Mon Sep 4 13:47:44 2000: got 3 bytes > > ***** 00000000 00 01 6e |..n| > > epmd: Mon Sep 4 13:47:44 2000: ** got NAMES_REQ > > epmd: Mon Sep 4 13:47:44 2000: got 4 bytes > > ***** 00000000 00 00 11 11 |....| > > epmd: Mon Sep 4 13:47:44 2000: got 24 bytes > > ***** 00000000 6e 61 6d 65 20 62 61 6e 6b 20 61 74 20 70 6f 72 |name bank at por| > > ***** 00000010 74 20 34 36 31 34 35 0a |t 46145.| > > epmd: Mon Sep 4 13:47:44 2000: ** sent NAMES_RESP > > epmd: Mon Sep 4 13:47:44 2000: closing connection on file descriptor 5 > > > > ...which all makes sense, but... > > > > (bank@REDACTED)1> net_adm:names(). > > {error,nxdomain} > > (bank@REDACTED)2> > > > > ...hmmm? nslookup works here for short name, long name, and dotted > > quad. net_adm:host_file() parses my .hosts.erlang file ok. > > > > Still with me? What other information should I provide? Got into > > this trying to run the Erlang book's banking example in chapter 6. > > Works fine in a single shell, of course, but I got a nodedown when > > trying to talk between 2 nodes and started poking around. I'm on > > OpenBSD 2.7. > > > > Thanks for reading, > > Steve From luc.taesch@REDACTED Tue Sep 5 14:54:05 2000 From: luc.taesch@REDACTED (luc.taesch@REDACTED) Date: Tue, 5 Sep 2000 14:54:05 +0200 Subject: debugger load Message-ID: when debugging, are there any other way tzhan the menu to load some debugger settings ? From tobbe@REDACTED Tue Sep 5 15:00:34 2000 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 05 Sep 2000 15:00:34 +0200 Subject: debugger load In-Reply-To: luc.taesch@ubs.com's message of "Tue, 5 Sep 2000 14:54:05 +0200" References: Message-ID: Look at the int.erl and i.erl modules. Here are som useful shell commands: ii(Mod) %% Debug this Module ii(Mod, Switches), ib(Mod,Line) %% Set break point iaa(init) %% attach (bring up window) at entry of module iaa(break) %% attach (bring up window) when hitting breakpoint im() %% bring up the monitor Cheers /Tobbe From olgeni@REDACTED Tue Sep 5 20:57:14 2000 From: olgeni@REDACTED (Jimmy Olgeni) Date: Tue, 5 Sep 2000 20:57:14 +0200 (CEST) Subject: R7A and jdk 1.2 In-Reply-To: <8p22r2$1bu$1@news.du.uab.ericsson.se> Message-ID: On 5 Sep 2000, Gordon Beaton wrote: > To run erlang it isn't. However some parts of Jinterface use classes > that aren't available with 1.1 JDKs, for example WeakReferences and > some things from Collections. Did anybody try to use the linux jdk-1.2.2 under freebsd emulation (/usr/ports/java/linux-jdk/) ? It should work... (no I didn't try it yet :)) bye, Jimmy From bjowi@REDACTED Fri Sep 8 16:31:53 2000 From: bjowi@REDACTED (=?ISO-8859-1?Q?Bj=F6rn Wingman?=) Date: Fri, 8 Sep 2000 16:31:53 +0200 (MET DST) Subject: Orber 3.1.7 ior problem Message-ID: <200009081431.QAA02996@sture.lysator.liu.se> In release R7A with orber 3.1.7, this IOR is not accepted by string_to_object: IOR:000000000000001849444c3a57697461732f496f725365727665723a312e300000000001000000000000009000010200000000126173746531352e6964612e6c69752e736500b8510000003414010f004e555000000013000000000000000100696f72736572766572000000000000000001696f727365727665726368696c640000000300000000000000080000000054414f000000000100000014000000000001000100000000000101090000000054414f000000000400000000 This is the error message: =ERROR REPORT==== 8-Sep-2000::16:22:37 === Error in process <0.33.0> on node 'beta@REDACTED' with exit value: {{nocatch,{'EXCEPTION',{'NO_IMPLEMENT',[],0,'COMPLETED_NO'}}},[{erlang,throw,[{'EXCEPTION',{'NO_IMPLEMENT',[],0,'COMPLETED_NO'}}]},... ** exited: {{nocatch,{'EXCEPTION',{'NO_IMPLEMENT',[],0,'COMPLETED_NO'}}}, [{erlang,throw, [{'EXCEPTION',{'NO_IMPLEMENT',[],0,'COMPLETED_NO'}}]}, {corba,raise,1}, {iop_ior,decode_profiles,2}, {iop_ior,decode,4}, {corba,string_to_object,1}, {erl_eval,expr,3}, {erl_eval,exprs,4}, {shell,eval_loop,2}]} ** The IOR is produced by the TAO/ACE orb, and according to the ILU IOR parser it is IIOP 1.2. /Bj?rn Wingman From nick@REDACTED Fri Sep 8 16:50:43 2000 From: nick@REDACTED (Niclas Eklund) Date: Fri, 8 Sep 2000 16:50:43 +0200 (MET DST) Subject: Orber 3.1.7 ior problem In-Reply-To: <200009081431.QAA02996@sture.lysator.liu.se> Message-ID: On Fri, 8 Sep 2000, =?ISO-8859-1?Q?Bj=F6rn Wingman?= wrote: > In release R7A with orber 3.1.7, this IOR is not accepted by > string_to_object: > > This is the error message: > > The IOR is produced by the TAO/ACE orb, and according to the ILU IOR > parser it is IIOP 1.2. Hello! That is correct (version 1.2). Currently Orber only support 1.0 and 1.1. You must configure the ORB you want to communicate with to use one of the supported versions. /Nick From vances@REDACTED Fri Sep 8 20:58:14 2000 From: vances@REDACTED (Vance Shipley) Date: Fri, 8 Sep 2000 14:58:14 -0400 Subject: run_erl under Linux (was: erl_interface and ALIVE) In-Reply-To: Message-ID: I did dresolve this problem. Testing showed that select was returning 0 yet it had not timed out yet. The solution turned out to be setting the define USE_SETPGRP_NOARGS. The following snippet from run_erl.c was the source of the problem: /* disassociate from control terminal */ #ifdef USE_SETPGRP_NOARGS /* SysV */ setpgrp(); #else #ifdef USE_SETPGRP /* BSD */ setpgrp(0,getpid()); #else /* POSIX */ setsid(); #endif It had been using setsid(). -Vance } Yes, but check out the times! My buffers are filling up } with these messages as they are produced many times a second. } } This seems to be produced by run_erl. In run_erl.c: } } /* Enter the work loop */ } } timeout.tv_sec = LOG_ALIVE_MINUTES*60; } timeout.tv_usec = 0; } while (1) { } maxfd = MAX(rfd, mfd); } FD_ZERO(&readfds); } FD_SET(rfd, &readfds); } FD_SET(mfd, &readfds); } time(&last_activity); } ready = select(maxfd + 1, &readfds, NULL, NULL, &timeout); } if (ready < 0) { } /* Some error occured */ } error("Error in select."); } exit(1); } } else { } /* Check how long time we've been inactive */ } time_t now; } time(&now); } if(!ready || now - last_activity > LOG_ACTIVITY_MINUTES*60) { } /* Either a time out: 15 minutes without action, */ } /* or something is coming in right now, but it's a long time */ } /* since last time, so let's write a time stamp this message */ } sprintf(buf, "\n===== %s%s", ready?"":"ALIVE ", ctime(&now)); } write_to_log(&lfd, &lognum, buf, strlen(buf)); } } } } } } } I believe that what is happening is that select is returning 0 at } these times. It gets into a state where it gets stuck doing this. } It hasn't timed out though as it's been far, far less than a minute. } } I think I'll test and report errno and see what it says... } } -Vance } } } } >Another problem which I do not yet understand is that } } >sometimes the Erlang node will produce the following } } >messages in the logs: } } > } } >===== ALIVE Fri Sep 1 11:32:49 2000 } } > } } >===== ALIVE Fri Sep 1 11:32:49 2000 } } > } } >===== ALIVE Fri Sep 1 11:32:49 2000 } } } } } } These entries are written to mark that the node is up and running, } } even though it is not outputting anything to the shell. } } } } /Uffe } } From vances@REDACTED Sat Sep 9 00:18:41 2000 From: vances@REDACTED (Vance Shipley) Date: Fri, 8 Sep 2000 18:18:41 -0400 Subject: run_erl under Linux (was: erl_interface and ALIVE) In-Reply-To: Message-ID: Unhappily this problem has _NOT_ gone away after all. It had been happening right away but now it happens after the first inactivity timeout. :( -Vance } I did dresolve this problem. Testing showed that select was } returning 0 yet it had not timed out yet. The solution turned } out to be setting the define USE_SETPGRP_NOARGS. The following } snippet from run_erl.c was the source of the problem: } } /* disassociate from control terminal */ } #ifdef USE_SETPGRP_NOARGS /* SysV */ } setpgrp(); } #else } #ifdef USE_SETPGRP /* BSD */ } setpgrp(0,getpid()); } #else /* POSIX */ } setsid(); } #endif } } It had been using setsid(). From sgelkins@REDACTED Sat Sep 9 03:11:01 2000 From: sgelkins@REDACTED (Steve Elkins) Date: Fri, 08 Sep 2000 21:11:01 -0400 Subject: novice question Message-ID: <39B98E25.D67155A@bellsouth.net> Hi, Managed to fix this and thought I should explain what I did. Poked around in the source starting with net_adm:names/0 and made a lucky guess. Added... lookup file bind ...to resolv.conf and {error,nxdomain} went away. Then some empty lists, but there's a patch for that on the Bugs & Fixes page. Steve -------- Original Message -------- Subject: novice question Date: Mon, 04 Sep 2000 14:09:11 -0400 From: Steve Elkins To: erlang-questions@REDACTED Hi, I've run into a few problems getting 2 nodes on the same machine connected. I hope someone on the list will tell me what I should look at next. Details follow. I've killed and restarted epmd with 2 -d flags... sge@REDACTED:16$ ./epmd -d -d epmd: Mon Sep 4 13:42:59 2000: epmd running - daemon = 0 epmd: Mon Sep 4 13:42:59 2000: try to initiate listening port 4369 epmd: Mon Sep 4 13:42:59 2000: starting epmd: Mon Sep 4 13:42:59 2000: entering the main select() loop In another window... sge@REDACTED:56$ erl -sname bank Erlang (BEAM) emulator version 4.9.1 [source] Eshell V4.9.1 (abort with ^G) (bank@REDACTED)1> ...and back in the 1st window... epmd: Mon Sep 4 13:43:10 2000: opening connection on file descriptor 4 epmd: Mon Sep 4 13:43:10 2000: got 19 bytes ***** 00000000 00 11 78 b4 41 4d 00 00 05 00 05 00 04 62 61 6e |..x.AM.......ban| ***** 00000010 6b 00 00 |k..| epmd: Mon Sep 4 13:43:10 2000: ** got ALIVE2_REQ epmd: Mon Sep 4 13:43:10 2000: registering 'bank:2', port 46145 epmd: Mon Sep 4 13:43:10 2000: type 77 proto 0 highvsn 5 lowvsn 5 epmd: Mon Sep 4 13:43:10 2000: got 4 bytes ***** 00000000 79 00 00 02 |y...| epmd: Mon Sep 4 13:43:10 2000: ** sent ALIVE2_RESP for "bank" ...in a 3rd window... sge@REDACTED:12$ /usr/local/lib/erlang/bin/epmd -names epmd: up and running on port 4369 with data: name bank at port 14917 sge@REDACTED:13$ ...and back in the 1st window... epmd: Mon Sep 4 13:47:44 2000: opening connection on file descriptor 5 epmd: Mon Sep 4 13:47:44 2000: got 3 bytes ***** 00000000 00 01 6e |..n| epmd: Mon Sep 4 13:47:44 2000: ** got NAMES_REQ epmd: Mon Sep 4 13:47:44 2000: got 4 bytes ***** 00000000 00 00 11 11 |....| epmd: Mon Sep 4 13:47:44 2000: got 24 bytes ***** 00000000 6e 61 6d 65 20 62 61 6e 6b 20 61 74 20 70 6f 72 |name bank at por| ***** 00000010 74 20 34 36 31 34 35 0a |t 46145.| epmd: Mon Sep 4 13:47:44 2000: ** sent NAMES_RESP epmd: Mon Sep 4 13:47:44 2000: closing connection on file descriptor 5 ...which all makes sense, but... (bank@REDACTED)1> net_adm:names(). {error,nxdomain} (bank@REDACTED)2> ...hmmm? nslookup works here for short name, long name, and dotted quad. net_adm:host_file() parses my .hosts.erlang file ok. Still with me? What other information should I provide? Got into this trying to run the Erlang book's banking example in chapter 6. Works fine in a single shell, of course, but I got a nodedown when trying to talk between 2 nodes and started poking around. I'm on OpenBSD 2.7. Thanks for reading, Steve From thantos@REDACTED Sat Sep 9 03:47:24 2000 From: thantos@REDACTED (Alexander Williams) Date: Fri, 8 Sep 2000 21:47:24 -0400 Subject: R7 on 64-bit OS Message-ID: <20000908214724.A904@gw.total-web.net> Its probably worth noting, though I may be the only one that cares (:)), that R7 doesn't compile under Linux on the Alpha, and more's the pity. I fully admit I'm not guru enough to spearhead the porting effort, but I'm able to deliver up build logs, etc, if there's developer interest. Note that I haven't tried building it on Tru64 Unix with Compaq's native compiler, yet. I'm somewhat afraid to ... -- Alexander Williams (thantos@REDACTED) | In the End, "Blue Jester needs food." | Oblivion "Blue Jester needs fuku-wearing cuties." | Always http://www.chancel.org | Wins From dne@REDACTED Sat Sep 9 04:51:51 2000 From: dne@REDACTED (Daniel Neri) Date: 09 Sep 2000 04:51:51 +0200 Subject: novice question In-Reply-To: Steve Elkins's message of "Fri, 08 Sep 2000 21:11:01 -0400" References: <39B98E25.D67155A@bellsouth.net> Message-ID: <87bsxymg54.fsf@nowhere.mayonnaise.net> Steve Elkins writes: > Poked around in the source starting with net_adm:names/0 and > made a lucky guess. Added... > > lookup file bind > > ...to resolv.conf and {error,nxdomain} went away. Yes, I was just about to report this problem; inet:gethostbyname/1 always fails with {error, nxdomain} if /etc/resolv.conf has no "lookup" option (instead of assuming some reasonable default lookup order). Best wishes, --Daniel -- Daniel Neri dne@REDACTED From enano@REDACTED Sat Sep 9 11:51:05 2000 From: enano@REDACTED (Miguel Barreiro Paz) Date: Sat, 9 Sep 2000 11:51:05 +0200 (CEST) Subject: R7 on 64-bit OS In-Reply-To: <20000908214724.A904@gw.total-web.net> Message-ID: On Fri, 8 Sep 2000, Alexander Williams wrote: > Its probably worth noting, though I may be the only one that cares > (:)), that R7 doesn't compile under Linux on the Alpha, and more's the You're not the only who cares, I assume, as some weeks ago there was a thread on this list about erlang on 64-bit iron. AFAIR, R6B doesn't work on alpha. I tried compiling under digital unix with -taso which forces pointers that fit in 32 bits, but Erlang appears to require gcc. Regards, From thantos@REDACTED Sat Sep 9 12:01:41 2000 From: thantos@REDACTED (Alexander Williams) Date: Sat, 9 Sep 2000 06:01:41 -0400 Subject: R7 on 64-bit OS In-Reply-To: ; from enano@fi.udc.es on Sat, Sep 09, 2000 at 11:51:05AM +0200 References: <20000908214724.A904@gw.total-web.net> Message-ID: <20000909060141.A14530@gw.total-web.net> On Sat, Sep 09, 2000 at 11:51:05AM +0200, Miguel Barreiro Paz wrote: > You're not the only who cares, I assume, as some weeks ago there > was a thread on this list about erlang on 64-bit iron. AFAIR, R6B doesn't > work on alpha. I tried compiling under digital unix with -taso which > forces pointers that fit in 32 bits, but Erlang appears to require gcc. Right, that I'd tried already. I'm sitting here in the lab at work, surrounded by TurboLasers, a GS or two, and a huge pile of Alpha desktops, plus some 2100's and 2000's ... It would be awfully nice to put an Erlang node on every single one of them and use them as a distributed compute farm ... I'd settle for putting a node on the handfull of Alpha/Linux-SuSE 6.4 boxen I have. Not as impressive, but certainly not worth shaking a stick at. :) -- Alexander Williams (thantos@REDACTED) | In the End, "Blue Jester needs food." | Oblivion "Blue Jester needs fuku-wearing cuties." | Always http://www.chancel.org | Wins From sgelkins@REDACTED Sat Sep 9 18:41:27 2000 From: sgelkins@REDACTED (Steve Elkins) Date: Sat, 09 Sep 2000 12:41:27 -0400 Subject: novice question Message-ID: <39BA6837.CF0495BF@bellsouth.net> Meant to cc the list. -------- Original Message -------- Subject: Re: novice question Date: Sat, 09 Sep 2000 12:06:55 -0400 From: Steve Elkins To: Daniel Neri References: <39B98E25.D67155A@REDACTED> <87bsxymg54.fsf@REDACTED> Daniel Neri wrote: > Yes, I was just about to report this problem; inet:gethostbyname/1 > always fails with {error, nxdomain} if /etc/resolv.conf has no > "lookup" option (instead of assuming some reasonable default lookup > order). inet_db seems to be the relevant table. Without a lookup option, res_lookup has an empty list next to it and the nxdomain error shows up. The result of 'lookup file bind' in resolv.conf: (jill@REDACTED)3> ets:tab2list(inet_db). [... {res_domain,[]}, {res_retry,3}, {res_ns,[{{205,152,0,5},53}]}, {res_lookup,[file,dns]}, ...] The result of not having a lookup option: {res_lookup,[]}, Regards, Steve From Anusart.Prechavutikhun@REDACTED Mon Sep 11 04:08:31 2000 From: Anusart.Prechavutikhun@REDACTED (Anusart Prechavutikhun (ECT)) Date: Mon, 11 Sep 2000 04:08:31 +0200 Subject: Erlang course Message-ID: <2189C5001218D31186710060089D5FEDFDE83C@ETHHQNT151> Hi I would to know about Erlang course. Could you tell me when the Erlang course will be arranged ? If you can help me , please send me information as soon as possible. B/G Anusart P. Network Design and solution Engineer Ericsson (Thailand)Ltd. From caw@REDACTED Mon Sep 11 06:02:27 2000 From: caw@REDACTED (Chris Wright) Date: Mon, 11 Sep 2000 15:02:27 +1100 Subject: Installing and using the Unix serial port module Message-ID: <39BC5953.62B7D44F@cs.mu.oz.au> Hi, I'm very new to erlang, so I've got the serial module for erlang to compile under linux (had to comment out some of the speed definitions). I'll submit the modified version (to whom?). uname -> Linux icu-0.shcn.com.au 2.2.14-12smp #1 SMP Tue Apr 25 12:22:15 EDT 2000 i686 unknown Where should I put the files? (I couldn't find 'How do I install extension modules' in the FAQ), and could someone give me a cookbook explanation of how to fire up the terminal module. When I do terminal:gs_init (with speed as a parameteter) I get a brief flash of a GUI, and then nothing. . What looks like a PID (?) is returned. Thanks very much chris Dr. Chris Wright Intensive Care Unit Monash Medical Centre Clayton VIC 3168 Australia From Matthias.Lang@REDACTED Mon Sep 11 14:32:39 2000 From: Matthias.Lang@REDACTED (Matthias.Lang@REDACTED) Date: Mon, 11 Sep 2000 14:32:39 +0200 (MET DST) Subject: Erlang course Message-ID: <14780.53479.239705.568456@gargle.gargle.HOWL> Anusart wrote: > I would to know about Erlang course. Could you tell me > when the Erlang course will be arranged ? If you can help me, > please send me information as soon as possible. The erlang.se has a whole page about training at http://www.erlang.se/training/index.shtml It also mentions that you can send mail to training@REDACTED Matthias From Matthias.Lang@REDACTED Mon Sep 11 14:40:17 2000 From: Matthias.Lang@REDACTED (Matthias.Lang@REDACTED) Date: Mon, 11 Sep 2000 14:40:17 +0200 (MET DST) Subject: Installing and using the Unix serial port module In-Reply-To: <39BC5953.62B7D44F@cs.mu.oz.au> References: <39BC5953.62B7D44F@cs.mu.oz.au> Message-ID: <14780.53937.562237.967189@gargle.gargle.HOWL> Hi, > I've got the serial module for erlang to compile under linux (had to > comment out some of the speed definitions). I'll submit the modified > version (to whom?). This situation has come up a couple of times in the past few weeks. The 'user contributions' page (http://www.erlang.org/user.html) has a mechanism for adding contributions, but it doesn't really allow for contributions to be updated by people other than the original author. I can think of a few ways of handling this (a) Send the person modifying the module to the original author and get them to sort it out between themselves. (b) Someone here makes a decision whether the modification goes in or not. Comments? In the case of the serial driver, Johan Bevemyr is the author and you can find his mail address in the 'serial.pub' file which came with serial (I won't put it here in case he's worried about spam). Matthias From jasbirnagi@REDACTED Mon Sep 11 15:24:07 2000 From: jasbirnagi@REDACTED (Jasbir Nagi) Date: Mon, 11 Sep 2000 13:24:07 GMT Subject: writing a simple function Message-ID: Hi, I'm new to erlang programming, and I'm trying to work out how to write a programme that Erlang can Compile that imports a function from another module, and iterates that function, say, 1000 times. (For timer purposes, so I can work out how long it is taking). What would the basic template be? (ie what do for loops look like, how is a function imported/exported, how are variables initialized etc.) nagi _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. From Matthias.Lang@REDACTED Mon Sep 11 15:38:58 2000 From: Matthias.Lang@REDACTED (Matthias.Lang@REDACTED) Date: Mon, 11 Sep 2000 15:38:58 +0200 (MET DST) Subject: writing a simple function In-Reply-To: References: Message-ID: <14780.57458.881216.275646@gargle.gargle.HOWL> Hi, It sounds like doing the online course would help. You can find it, and some other suggestions, at http://www.erlang.org/starting.html Matthias ------------------------------ To directly answer your question, here's a program which prints 'hello' 1000 times by calling the 'fwrite' function in the module 'hello' 1000 times, after importing it: -module(time). -export([go/0]). -import(io, [fwrite/1]). go() -> Start = time(), loop(1000), {Start, time()}. loop(0) -> done; loop(N) -> fwrite("hello"), loop(N-1). It returns the start and finish times. On my machine they differ by about a second. > I'm new to erlang programming, and I'm trying to work out how to write a > programme that Erlang can Compile that imports a function from another > module, and iterates that function, say, 1000 times. (For timer purposes, so > I can work out how long it is taking). > > What would the basic template be? (ie what do for loops look like, how is a > function imported/exported, how are variables initialized etc.) > > nagi > _________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > > Share information about yourself, create your own public profile at > http://profiles.msn.com. > From luke@REDACTED Mon Sep 11 15:51:01 2000 From: luke@REDACTED (Luke Gorrie) Date: 11 Sep 2000 15:51:01 +0200 Subject: writing a simple function In-Reply-To: Matthias.Lang@ericsson.com's message of "Mon, 11 Sep 2000 15:38:58 +0200 (MET DST)" References: <14780.57458.881216.275646@gargle.gargle.HOWL> Message-ID: Matthias.Lang@REDACTED writes: > To directly answer your question, here's a program which prints > 'hello' 1000 times by calling the 'fwrite' function in the module > 'hello' 1000 times, after importing it: .. or to slightly less directly answer it, not taking "import" literally in the erlang sense, here's a generic way that you might write such a module: -module(looptime). -author('luke@REDACTED'). -export([time/4, dotimes/4]). %% Time how long it takes to apply Function of Module to Arguments N times. %% Example usage: %% looptime:time(100000, erlang, now, []). %% Returns: {ok, Micros} | {error, Reason} time(N, Module, Function, Arguments) -> case timer:tc(?MODULE, dotimes, [N, Module, Function, Arguments]) of {_, {'EXIT', R}} -> {error, R}; {Time, _} -> {ok, Time} end. dotimes(0, M, F, A) -> ok; dotimes(N, M, F, A) -> apply(M, F, A), dotimes(N-1, M, F, A). Cheers, Luke From joe@REDACTED Mon Sep 11 16:03:53 2000 From: joe@REDACTED (Joe Armstrong) Date: Mon, 11 Sep 2000 16:03:53 +0200 (CEST) Subject: writing a simple function In-Reply-To: Message-ID: Ummm. I did it twice. Once with a dummy loop to assess the overhead in the timeing process itself :-) Thus .. -module(time_it). -export([time_fun/2, time_fun/3, fac/1]). time_fun(String, Fun) -> time_fun(String, Fun, 1). time_fun(String, Fun, N) -> statistics(runtime), time1(N, fun() -> true end), %% <- time a dummy loop {_,T1} = statistics(runtime), time1(N, Fun), %% <- and the real thing {_, T2} = statistics(runtime), %% T is in milliseconds io:format("T1 = ~p T2=~p~n",[T1, T2]), Dt = T2 - T1, %% the real thing - the dummy loop if Dt =< 0 -> io:format("~s took 0 -- try increasing the number of tests~n", [String]); true -> R = Dt/N, io:format("~s took ~p ms~n", [String, R]) end. time1(0, _) -> true; time1(N, Fun) -> Fun(),time1(N-1, Fun). fac(0) -> 1; fac(N) -> N * fac(N-1). %% example > time_it:time_fun("factorial", fun() -> time_it:fac(200) end,1000). T1 = 0 T2=440 factorial took 0.440000 ms /Joe -- Joe Armstrong, Bluetail AB, tel: +46 8-545 550 00 S:t Eriksgatan 44, fax: +46 8-545 550 50 SE-112 32 Stockholm, Sweden info: www.bluetail.com > Matthias.Lang@REDACTED writes: > > > To directly answer your question, here's a program which prints > > 'hello' 1000 times by calling the 'fwrite' function in the module > > 'hello' 1000 times, after importing it: > > .. or to slightly less directly answer it, not taking "import" > literally in the erlang sense, here's a generic way that you might > write such a module: > > -module(looptime). > -author('luke@REDACTED'). > > -export([time/4, dotimes/4]). > > %% Time how long it takes to apply Function of Module to Arguments N times. > %% Example usage: > %% looptime:time(100000, erlang, now, []). > %% Returns: {ok, Micros} | {error, Reason} > time(N, Module, Function, Arguments) -> > case timer:tc(?MODULE, dotimes, [N, Module, Function, Arguments]) of > {_, {'EXIT', R}} -> > {error, R}; > {Time, _} -> > {ok, Time} > end. > > dotimes(0, M, F, A) -> > ok; > dotimes(N, M, F, A) -> > apply(M, F, A), > dotimes(N-1, M, F, A). > > Cheers, > Luke > -- From not.for.email@REDACTED Tue Sep 12 13:34:41 2000 From: not.for.email@REDACTED (Gordon Beaton) Date: 12 Sep 2000 11:34:41 GMT Subject: erl_interface and ALIVE References: , Message-ID: <8pl4ch$8fk$1@news.du.uab.ericsson.se> In erix.mailing-list.erlang-questions, you wrote: > Yes, but check out the times! My buffers are filling up > with these messages as they are produced many times a second. > > This seems to be produced by run_erl. In run_erl.c: > > /* Enter the work loop */ > > timeout.tv_sec = LOG_ALIVE_MINUTES*60; > timeout.tv_usec = 0; > while (1) { > maxfd = MAX(rfd, mfd); > FD_ZERO(&readfds); > FD_SET(rfd, &readfds); > FD_SET(mfd, &readfds); > time(&last_activity); > ready = select(maxfd + 1, &readfds, NULL, NULL, &timeout); Now I see it... Since select() modifies the contents of timeout on some systems (notably linux), it needs to be (re-) set on each pass of the loop (before select() is called), not outside the loop as in your version. This has already been fixed in r7a. /gordon -- g o r d o n . b e a t o n @ e r i c s s o n . c o m software architecture laboratory ericsson research stockholm, sweden From luc.taesch@REDACTED Tue Sep 12 16:06:42 2000 From: luc.taesch@REDACTED (Luc Taesch) Date: Tue, 12 Sep 2000 16:06:42 +0200 Subject: navigate digraph Message-ID: <39BE3872.F5AB9558@ubs.com> are there any functions to navigate digraph ? ( ideally, some HoF). i realise that the schema i was implemeinting was in fact a graph, so i may use digraph, but i havent found navigation around that. ( ive done already something, but i realise some thinking should have been put into that, already) ( e.g, the classical nav for tree, is deep first, of breadth first). or any papers ? From luc.taesch@REDACTED Tue Sep 12 16:10:05 2000 From: luc.taesch@REDACTED (Luc Taesch) Date: Tue, 12 Sep 2000 16:10:05 +0200 Subject: path to debugger Message-ID: <39BE393D.871199AA@ubs.com> btw, ive done a patch to the debugger to load a state file, from a command line ( to include in batch file (like 'make debug_test'), and avoid File/Load everytime by hand). i cant post it on the list, as the mailer refuse it because of the size. anybody interested, please email, or tell me what i should do with it. From johnny12@REDACTED Tue Sep 5 16:01:25 2000 From: johnny12@REDACTED (boy) Date: Tue, 5 Sep 2000 22:01:25 +0800 Subject: =?big5?B?pbulQKz2s8ymbrPMw/ixb6q6pECmuL73t3w=?= Message-ID: <200009121657.e8CGvrV16099@hades.cslab.ericsson.net> Subject: ?????????!!????????????? > ???,??????????!! > ?????????,???????? > ?????????SOHO??? > ?????????? > ??????????????????? > ??????,????????!????????????????> ????? ???: > http://www.100fect.com/is.php3?id=20140689 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jamesh@REDACTED Wed Sep 13 20:23:07 2000 From: jamesh@REDACTED (James Hague) Date: Wed, 13 Sep 2000 13:23:07 -0500 Subject: Binary syntax is very nice! Message-ID: <3.0.32.20000913132307.00e7b7fc@volition-inc.com> The binary syntax in R7 is *useful*. I'm now thinking about using Erlang as a general purpose data-munging language--much like Perl is for text. Kinda pushes Erlang even more toward being a Big Language, but in this case I think it was worth it. A pat on the back to everyone involved! [In case anyone missed it, a beta release of R7 is available from www.erlang.org] James From vladdu@REDACTED Thu Sep 14 12:02:19 2000 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Thu, 14 Sep 2000 12:02:19 +0200 Subject: R7A for Windows Message-ID: Hi! Is R7A going to be released for Windows, or do we have to wait for R7B, which is not far away? >From the docs, the new release seems great, can't wait to get it working! /Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From per@REDACTED Thu Sep 14 12:51:04 2000 From: per@REDACTED (Per Bergqvist) Date: Thu, 14 Sep 2000 12:51:04 +0200 Subject: R7A for Windows References: Message-ID: <39C0AD98.4306D576@cellpt.com> I'm currently fixing up the build tools (on my very limited spare time) to build under Windows only. It works and build R7 fine but is still a bit too messy to be released. I'll try to clean it up during the weekend and maybe some else can assist to finalize it. As an alternative, join CellPoint and get paid to do it ;-) Please let me know by email. /Per Director - WAP Innovation & Development CellPoint Systems AB mobile: +46707473644 email: per@REDACTED Vlad Dumitrescu wrote: > Hi! Is R7A going to be released for Windows, or do we have to wait > for R7B, which is not far away? From the docs, the new release seems > great, can't wait to get it working!/Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From kent@REDACTED Thu Sep 14 14:15:31 2000 From: kent@REDACTED (Kent Boortz) Date: 14 Sep 2000 14:15:31 +0200 Subject: R7A for Windows In-Reply-To: "Vlad Dumitrescu"'s message of "Thu, 14 Sep 2000 12:02:19 +0200" References: Message-ID: > Is R7A going to be released for Windows, or do we have to wait for > R7B, which is not far away? Yes, it should have been released the day after the Unix release. Now it is there. Unfortunately the file is huge, 20 Mb. We will look into splitting up the package for R7B. It was my mistake that it wasn't available for download until now, sorry about that, kent From thantos@REDACTED Thu Sep 14 14:27:07 2000 From: thantos@REDACTED (Alexander Williams) Date: Thu, 14 Sep 2000 08:27:07 -0400 Subject: R7A for Windows In-Reply-To: <39C0AD98.4306D576@cellpt.com>; from per@cellpt.com on Thu, Sep 14, 2000 at 12:51:04PM +0200 References: <39C0AD98.4306D576@cellpt.com> Message-ID: <20000914082707.A16454@gw.total-web.net> On Thu, Sep 14, 2000 at 12:51:04PM +0200, Per Bergqvist wrote: > As an alternative, join CellPoint and get paid to do it ;-) Personally, I'd love to but I think the commute from the States every day might be a bit much. ;) -- Alexander Williams (thantos@REDACTED) | In the End, "Blue Jester needs food." | Oblivion "Blue Jester needs fuku-wearing cuties." | Always http://www.chancel.org | Wins From jamesh@REDACTED Thu Sep 14 16:28:33 2000 From: jamesh@REDACTED (James Hague) Date: Thu, 14 Sep 2000 09:28:33 -0500 Subject: R7A for Windows Message-ID: <3.0.32.20000914092833.00fb68f8@volition-inc.com> >Yes, it should have been released the day after the Unix release. Now >it is there. Unfortunately the file is huge, 20 Mb. We will look >into splitting up the package for R7B. Why is it so huge? Are the sources in there as well? From ltaesch@REDACTED Sat Sep 16 11:15:54 2000 From: ltaesch@REDACTED (Luc Taesch) Date: Sat, 16 Sep 2000 11:15:54 +0200 Subject: about graphics and GUI Message-ID: <39C33A4A.8DAE1019@europemail.com> 1) when using toolbars, say table monitor, we can see the "graphics initialising" which take a while. is the delay it due to the erlang, or some lib ? is it using tk, or gs ? where are the ineffcencies coming from ? (no flamewar intended ) 2) is it possible to integrate erlang with c++, or c only ? 3) Qt libs is now under GPL. would it be interesting to use it as a multi plateform interface, ? ( http://www.trolltech.com/products/qt/designer/sshots.html ; qt is used in kde: www.kde.org) 4) how complex would it be it to hack gs to use qt instead of whaever is used ? 5) whoever experimented binding erlang to graphics, where a re coming the inefficiencies, and difficulties ? 6) did anybody looked at what haskell libs did ? (as another func. language example) -- First, they ignore you. Then, they laugh at you. Then, they fight you. Then, you win. --- Gandhi. Working code is what matter, not your market capitalization. --Kurt granroth From kent@REDACTED Sun Sep 17 14:28:24 2000 From: kent@REDACTED (Kent Boortz) Date: 17 Sep 2000 14:28:24 +0200 Subject: about graphics and GUI In-Reply-To: Luc Taesch's message of "Sat, 16 Sep 2000 11:15:54 +0200" References: <39C33A4A.8DAE1019@europemail.com> Message-ID: I will try to answer, maybe someone else can fill in. > 1) when using toolbars, say table monitor, we can see the "graphics > initialising" which take a while. is the delay it due to the > erlang, or some lib ? is it using tk, or gs ? where are the > ineffcencies coming from ? (no flamewar intended ) I can't say what is taking the time but the GS library is very inefficient. Lots of strings are sent from the Erlang node to an external OS process. But I can't repeat the problem, my home machine is so fast I don't even see a the dialog you talk about ;-) > 2) is it possible to integrate erlang with c++, or c only ? How do you want to integrate Erlang with C++? CORBA and other "high level" integration is no problem. ERL_INTERFACE is written for C but has the usual #ifdef __cplusplus extern "C" { #endif to make the functions callable from C++. Even the header file for writing Erlang linked in drivers is adjusted to work for C++. But here are no classes for Erlang and C++ integration that I know of. > 3) Qt libs is now under GPL. would it be interesting to use it as a > multi plateform interface, ? > ( http://www.trolltech.com/products/qt/designer/sshots.html ; > qt is used in kde: www.kde.org) There have been several discussions in the past about what GUI library to use and how to interface to that library. But we never got to a decision what to do about it. Lack of time and resources has put it all to a very low priority here at the commercial side of Erlang. > 4) how complex would it be it to hack gs to use qt instead of > whaever is used ? Lots of work I think. We tried to make the Erlang GS frontend generic but the Tk way of handling graphics shows up here and there. I haven't looked at Qt but I suspect it works very different than Tk. Even at the basic level different GUI libraries tend to differ, some create the container first and then create elements to fill them with, others create the elements first and then the container. > 5) whoever experimented binding erlang to graphics, where a re > coming the inefficiencies, and difficulties ? One problem is where to put your time and money ;-) When I worked at SICS we built the SICStus Prolog GUI interface around the InterViews GUI library, then InterViews died. When GS was created Tk looked like the way to go. Will it be Qt or GTK+ or both? If GS was truely generic we could switch from one backend to another over time. We also want to support the Windows platform. Qt and soon also GTK+ seem to support it. But do they support the "native look and feel" on Windows, i.e. does the GUI components look and work like the Windows user expects without Erlang programmerwriting code for it? We have that problem with GS, it is based on an old Tk version that doesn't support Windows native look and feel. Another problem is on what level to interface the GUI library. In GS we built our own interface to fit Erlang but this hides lots of features that Tk has but GS hasn't. The Erlang GTK application (unsupported direct interface to Tk that are part of the OpenSource release) approach has the drawback that it doesn't include Tcl. High level widgets written in Tcl can't be used (I'm not 100% that this is true). You also have to choose if you want to link the Erlang executable together with the GUI library. The GUI library code may contain bugs that takes down the Erlang node. This was the reason why GS is an external process. The drawback is the performance lost having to communicate with the other OS process. A drawback with using GS as a frontend to a Qt backend is that we can't design our GUI with the graphical GUI builders available for Qt. Maybe the idea of having an interface, like GS, to a GUI library in Erlang isn't a good idea at all. You can write the GUI in C++ and communicate with Erlang at the application level instead. This of cause require that you define your own communication between the Erlang application and the corresponding C++ program and the fast start up development time using GS is lost but it is something to consider. A new backend for GS using Qt would of cause be great. If I was the one to do it I think I would try to write some sort of frontend specification and write a generator program to generate most of the backend code, both on the Erlang side and the C++ side. This way new object could easily be added and changes in the communication model just require a change in the generator. kent From R.Mascarell@REDACTED Sun Sep 17 18:49:00 2000 From: R.Mascarell@REDACTED (Rosa Mascarell Dauder) Date: Sun, 17 Sep 2000 18:49:00 +0200 Subject: erl_interface-3.2.2 Message-ID: <13ahci-1lUlQOC@fwd02.sul.t-online.com> Hi. I am trying to check if Erl_interface works under Windows 98 I have chosen the example from: http://www.erlang.org/doc/r7a/doc/tutorial/part_frame.html in order to be sure that the system does not crash due to my faults. I updated my software downloading the new release Erlang 5.0/ OTP R7A. Since this release has been tested using gcc 2.8 runing in Windows NT WorkStation 4.0. I have updated my C compiler to gcc 2.8.0 from: http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/index.html I have check that the compiler was not able to compile the file ei.c from the tutorial. The error I got is that the gcc is not able to process the erl_interface.h and ei.h files (parse errors). Do you know why that could hapen? Do you know any other free C compiler able to compile and link these files? Thanks / Rosa From R.Mascarell@REDACTED Sun Sep 17 23:00:32 2000 From: R.Mascarell@REDACTED (Rosa Mascarell Dauder) Date: Sun, 17 Sep 2000 23:00:32 +0200 Subject: erl_interface-3.2.2 Message-ID: <13alY8-0Cc35kC@fwd07.sul.t-online.com> Hi. I am trying to check if Erl_interface works under Windows 98. I have chosen the example from: http://www.erlang.org/doc/r7a/doc/tutorial/part_frame.html in order to be sure that the system does not crash due to my faults. I updated my software downloading the new release Erlang 5.0/ OTP R7A. Since this release has been tested using gcc 2.8 runing in Windows NT WorkStation 4.0. I have updated my C compiler to gcc 2.8.0 from: http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/index.html I have checked that the compiler was not able to compile the file ei.c from the tutorial. The error I got is that the gcc is not able to process the erl_interface.h and ei.h files (parse errors). Do you know why that could hapen? Do you know any other free C compiler able to compile and link these files? Thanks / Rosa From ltaesch@REDACTED Sat Sep 16 21:37:16 2000 From: ltaesch@REDACTED (Luc Taesch) Date: Sat, 16 Sep 2000 21:37:16 +0200 Subject: about graphics and GUI References: <39C33A4A.8DAE1019@europemail.com> Message-ID: <39C3CBEC.B75E1447@europemail.com> Kent Boortz wrote: > I will try to answer, maybe someone else can fill in. thks for ure detailled answer. > > > > 1) when using toolbars, say table monitor, we can see the "graphics > > initialising" which take a while. is the delay it due to the > > erlang, or some lib ? is it using tk, or gs ? where are the > > ineffcencies coming from ? (no flamewar intended ) > > I can't say what is taking the time but the GS library is very > inefficient. Lots of strings are sent from the Erlang node to an > external OS process. > > But I can't repeat the problem, my home machine is so fast I don't > even see a the dialog you talk about ;-) im runing on a p3 450 128 mo, and the 2startng takes 0.5 to 1-2 s. hm ? is it some engine start ? > > > > 2) is it possible to integrate erlang with c++, or c only ? > > How do you want to integrate Erlang with C++? i dont know yet, but i thought i read somewhere u cannot. > CORBA and other "high > level" integration is no problem. ERL_INTERFACE is written for C but > has the usual > > #ifdef __cplusplus > extern "C" { > #endif > > to make the functions callable from C++. Even the header file for > writing Erlang linked in drivers is adjusted to work for C++. > > > > 3) Qt libs is now under GPL. would it be interesting to use it as a > > multi plateform interface, ? > > ( http://www.trolltech.com/products/qt/designer/sshots.html ; > > qt is used in kde: www.kde.org) > > > > We also want to support the Windows platform. Qt and soon also GTK+ > seem to support it. But do they support the "native look and feel" on > Windows, Qt does . look at the previous link. this is one of the strength (on top of being nice to look at) > Another problem is on what level to interface the GUI library. In GS > we built our own interface to fit Erlang but this hides lots of > features that Tk has but GS hasn't. The Erlang GTK application > (unsupported direct interface to Tk that are part of the OpenSource > release) approach has the drawback that it doesn't include Tcl. High > level widgets written in Tcl can't be used (I'm not 100% that this is > true). thats the common issue with leveraging the interface. > > > You also have to choose if you want to link the Erlang executable > together with the GUI library. The GUI library code may contain bugs > that takes down the Erlang node. This was the reason why GS is an > external process. The drawback is the performance lost having to > communicate with the other OS process. good point. havent thought of, but in eiffel we had this problem too. > > > A drawback with using GS as a frontend to a Qt backend is that we > can't design our GUI with the graphical GUI builders available for > Qt. Maybe the idea of having an interface, like GS, to a GUI library > in Erlang isn't a good idea at all. You can write the GUI in C++ and > communicate with Erlang at the application level instead. This of > cause require that you define your own communication between the > Erlang application and the corresponding C++ program and the fast > start up development time using GS is lost but it is something to > consider. the standard would be the protocol then, rather than the interface. ? > > > > A new backend for GS using Qt would of cause be great. If I was the > one to do it I think I would try to write some sort of frontend > specification and write a generator program to generate most of the > backend code, both on the Erlang side and the C++ side. This way new > object could easily be added and changes in the communication model > just require a change in the generator. interesting. do u know of any research in that area ? another point, has anybody looked at the haskell community work ? are there any academics work around that ? > > > kent -- First, they ignore you. Then, they laugh at you. Then, they fight you. Then, you win. --- Gandhi. Working code is what matter, not your market capitalization. --Kurt granroth -------------- next part -------------- An HTML attachment was scrubbed... URL: From ltaesch@REDACTED Sat Sep 16 23:36:06 2000 From: ltaesch@REDACTED (Luc Taesch) Date: Sat, 16 Sep 2000 23:36:06 +0200 Subject: about graphics and GUI References: <39C33A4A.8DAE1019@europemail.com> <39C3CBEC.B75E1447@europemail.com> Message-ID: <39C3E7C6.A112D781@europemail.com> >> >> >> A drawback with using GS as a frontend to a Qt backend is that we >> can't design our GUI with the graphical GUI builders available for >> Qt. Maybe the idea of having an interface, like GS, to a GUI library >> >> in Erlang isn't a good idea at all. You can write the GUI in C++ and >> >> communicate with Erlang at the application level instead. This of >> cause require that you define your own communication between the >> Erlang application and the corresponding C++ program and the fast >> start up development time using GS is lost but it is something to >> consider. > > the standard would be the protocol then, rather than the interface. ? > >> > it seems its the approach taken by kde2 /based on qt 2,2), and the dcop approach see http://www.arrakis.es/~rlarrosa/tutorial/p5.html tutorial taken from, http://developer.kde.org/documentation/tutorials.html typically, one program define the ui (or even dynamically load it from xml), and the server has just to implement a series of DCOP slots (functions). the server can be in other languages, and an example of python biding is given as an example. http://www.arrakis.es/~rlarrosa/tutorial/p6.html From joe@REDACTED Mon Sep 18 09:36:03 2000 From: joe@REDACTED (Joe Armstrong) Date: Mon, 18 Sep 2000 09:36:03 +0200 (CEST) Subject: Documentation code. Message-ID: Hello OTPers, I guess you read this list ... Are there any thoughts about publically releasing the OTP documentation code? By this I mean the sgml -> Tex/html/man code? I think it would be a good idea to release this code so that people can contribute applications that are documented with OTP "look and feel". At the moment if I want to write any documentation I'd have to choose the docbook dtd for documentation - this is sub-optimal since the OPT dtds *were* designed for documenting Erlang. Another question: Where is the OTP documentation going? - I can see a few alternatives. 1) Become "mainstream" i.e. aim for DocBook convergence and use jade/DSSL to transform to HTML/PDF/MIFF 2) Use some non-mainstream "weirdo" sub-optimal technology MS-word or Framemaker 3) Support and maintain the erldoc DTD's and the transformation code [and possibly migrate to XML] If you want a "documentation system" (and not just a random hodge podge of miscellaneous bits of paper that goes under the name of documentation) then I guess 3) is the right way to go. But 3) will wither and die without a user community - so please guys - release the code. BTW - a very nice community project would be to take the existing code for 3) and "open sourcify it" and hack in support for MIFF, and (difficult) do the transformations in Jade. Another nice project would be to transform the existing SGML documentation into a suitable format for on-line browsing and help in the command line shell. /Joe -- Joe Armstrong, Bluetail AB, tel: +46 8-545 550 00 S:t Eriksgatan 44, fax: +46 8-545 550 50 SE-112 32 Stockholm, Sweden info: www.bluetail.com From not.for.email@REDACTED Mon Sep 18 09:45:31 2000 From: not.for.email@REDACTED (Gordon Beaton) Date: 18 Sep 2000 07:45:31 GMT Subject: erl_interface-3.2.2 References: <13alY8-0Cc35kC@fwd07.sul.t-online.com> Message-ID: <8q4h6r$2t6$1@news.du.uab.ericsson.se> On 17 Sep 2000 21:00:32 GMT, Rosa Mascarell Dauder wrote: I have checked that the compiler was not able to compile the file ei.c > from the tutorial. > > The error I got is that the gcc is not able to process the > erl_interface.h and ei.h files (parse errors). I suggest that you post your actual code, the command you tried to compile it with, and the actual error messages from the compiler. Otherwise we can only guess where the problem might be. /gordon -- g o r d o n . b e a t o n @ e r i c s s o n . c o m software architecture laboratory ericsson research stockholm, sweden From ltaesch@REDACTED Sun Sep 17 08:16:05 2000 From: ltaesch@REDACTED (Luc Taesch) Date: Sun, 17 Sep 2000 08:16:05 +0200 Subject: about graphics and GUI References: <39C33A4A.8DAE1019@europemail.com> Message-ID: <39C461A5.D0B0FC64@europemail.com> Kent Boortz wrote: > > A new backend for GS using Qt would of cause be great. If I was the > one to do it I think I would try to write some sort of frontend > specification and write a generator program to generate most of the > backend code, both on the Erlang side and the C++ side. This way new > object could easily be added and changes in the communication model > just require a change in the generator. the kde seems toi have the same idea : the kde already gave a try for tcl-perl.. etc , and they uses swig : http://www.swig.org/ > > > kent -- First, they ignore you. Then, they laugh at you. Then, they fight you. Then, you win. --- Gandhi. Working code is what matter, not your market capitalization. --Kurt granroth -------------- next part -------------- An HTML attachment was scrubbed... URL: From Sean.Hinde@REDACTED Mon Sep 18 11:44:51 2000 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 18 Sep 2000 10:44:51 +0100 Subject: about graphics and GUI Message-ID: <402DD461F109D411977E0008C791C31256512D@imp02mbx.one2one.co.uk> I looked at this a bit a while back and it seemed that most of the other language bindings used their equivalent of the old Interface Generator to generate all the code. (i.e. given a set of C header files, generate the equivalent interface in the native language). Since the demise of IG there doesn't appear to be an easy mechanism (write your own generator..) Maybe there would be some scope in having a preliminary stage in the IC compilation process to munge C header files into something usable by this? Sean > -----Original Message----- > From: Luc Taesch [mailto:ltaesch@REDACTED] > Sent: 16 September 2000 22:36 > To: Kent Boortz; erlang-questions@REDACTED > Subject: Re: about graphics and GUI > > > >> > >> > >> A drawback with using GS as a frontend to a Qt backend is that we > >> can't design our GUI with the graphical GUI builders available for > >> Qt. Maybe the idea of having an interface, like GS, to a > GUI library > >> > >> in Erlang isn't a good idea at all. You can write the GUI > in C++ and > >> > >> communicate with Erlang at the application level instead. This of > >> cause require that you define your own communication between the > >> Erlang application and the corresponding C++ program and the fast > >> start up development time using GS is lost but it is something to > >> consider. > > > > the standard would be the protocol then, rather than the > interface. ? > > > >> > > > > it seems its the approach taken by kde2 /based on qt 2,2), > and the dcop > approach > see > http://www.arrakis.es/~rlarrosa/tutorial/p5.html > tutorial taken from, > http://developer.kde.org/documentation/tutorials.html > > typically, one program define the ui (or even dynamically load it from > xml), and the server has just to implement a series of DCOP slots > (functions). > > the server can be in other languages, and an example of > python biding is > given as an example. > http://www.arrakis.es/~rlarrosa/tutorial/p6.html > > > > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From gunilla@REDACTED Mon Sep 18 12:07:40 2000 From: gunilla@REDACTED (Gunilla Hugosson) Date: Mon, 18 Sep 2000 12:07:40 +0200 Subject: about graphics and GUI References: <39C33A4A.8DAE1019@europemail.com> Message-ID: <39C5E96C.97344872@erix.ericsson.se> Luc Taesch wrote: > > 1) when using toolbars, say table monitor, we can see the "graphics initialising" which take a while. > > is the delay it due to the erlang, or some lib ? Hi Luc, It's just a feature of TV, a progress window shown while the processes necessary for monitoring a table are started and the window is created. Since it shouldn't take TV longer to open a window than any other tool (Pman, Debugger, etc), maybe it should be removed to avoid any confusion. Regards, Gunilla From dgud@REDACTED Mon Sep 18 12:11:16 2000 From: dgud@REDACTED (Dan Gudmundsson) Date: Mon, 18 Sep 2000 12:11:16 +0200 (MET DST) Subject: about graphics and GUI In-Reply-To: <402DD461F109D411977E0008C791C31256512D@imp02mbx.one2one.co.uk> References: <402DD461F109D411977E0008C791C31256512D@imp02mbx.one2one.co.uk> Message-ID: <14789.59972.389382.337562@gargle.gargle.HOWL> With the new binary syntax it is really easy to write a program that does this if the source header file/interface is well written.. I wrote one in couple of hours that could generate 75% of the opengl functions for example.. /Dan Sean Hinde writes: > I looked at this a bit a while back and it seemed that most of the other > language bindings used their equivalent of the old Interface Generator to > generate all the code. (i.e. given a set of C header files, generate the > equivalent interface in the native language). Since the demise of IG there > doesn't appear to be an easy mechanism (write your own generator..) > > Maybe there would be some scope in having a preliminary stage in the IC > compilation process to munge C header files into something usable by this? > > Sean > > > -----Original Message----- > > From: Luc Taesch [mailto:ltaesch@REDACTED] > > Sent: 16 September 2000 22:36 > > To: Kent Boortz; erlang-questions@REDACTED > > Subject: Re: about graphics and GUI > > > > > > >> > > >> > > >> A drawback with using GS as a frontend to a Qt backend is that we > > >> can't design our GUI with the graphical GUI builders available for > > >> Qt. Maybe the idea of having an interface, like GS, to a > > GUI library > > >> > > >> in Erlang isn't a good idea at all. You can write the GUI > > in C++ and > > >> > > >> communicate with Erlang at the application level instead. This of > > >> cause require that you define your own communication between the > > >> Erlang application and the corresponding C++ program and the fast > > >> start up development time using GS is lost but it is something to > > >> consider. > > > > > > the standard would be the protocol then, rather than the > > interface. ? > > > > > >> > > > > > > > it seems its the approach taken by kde2 /based on qt 2,2), > > and the dcop > > approach > > see > > http://www.arrakis.es/~rlarrosa/tutorial/p5.html > > tutorial taken from, > > http://developer.kde.org/documentation/tutorials.html > > > > typically, one program define the ui (or even dynamically load it from > > xml), and the server has just to implement a series of DCOP slots > > (functions). > > > > the server can be in other languages, and an example of > > python biding is > > given as an example. > > http://www.arrakis.es/~rlarrosa/tutorial/p6.html > > > > > > > > > > > > NOTICE AND DISCLAIMER: > This email (including attachments) is confidential. If you have received > this email in error please notify the sender immediately and delete this > email from your system without copying or disseminating it or placing any > reliance upon its contents. We cannot accept liability for any breaches of > confidence arising through use of email. Any opinions expressed in this > email (including attachments) are those of the author and do not necessarily > reflect our opinions. We will not accept responsibility for any commitments > made by our employees outside the scope of our business. We do not warrant > the accuracy or completeness of such information. > -- Dan Gudmundsson Project: Mnesia, Erlang/OTP Ericsson Utvecklings AB Phone: +46 8 727 5762 UAB/F/P Mobile: +46 70 519 9469 S-125 25 Stockholm Visit addr: Armborstv 1 From cesarini@REDACTED Mon Sep 18 12:31:31 2000 From: cesarini@REDACTED (Francesco Cesarini) Date: Mon, 18 Sep 2000 11:31:31 +0100 Subject: about graphics and GUI References: <39C33A4A.8DAE1019@europemail.com> <39C5E96C.97344872@erix.ericsson.se> Message-ID: <39C5EF03.60FB9BD9@terminus.ericsson.se> > Since it shouldn't take TV longer to > open a window than any other tool (Pman, Debugger, etc), > maybe it should be removed to avoid any confusion. The problem with the TV is that it does take longer (on a slow machine, much much longer) to start the table windows. This is because unlike Pman and the Debugger, TV does not use the grid object (which creates a few lines and positions the text). Instead, it creates every cell in the grid (as GS object) so as to allow the resizing of the column width. In addition, if the table being read is huge, all objects are created before it is displayed. (If the table is not huge, lots of empty objects are created instead). An option would be to create the visible part first and display it. Once done, the parts not visible in the window could be created.... Or insert a resize option in the grid object and use that instead. Rgds, FC -- Francesco Cesarini Erlang/OTP consultant Cellular: INT+44-7776 250381 ECN: 832-707192 URL: http://welcome.to/cesarini.consulting From ltaesch@REDACTED Sun Sep 17 09:19:57 2000 From: ltaesch@REDACTED (Luc Taesch) Date: Sun, 17 Sep 2000 09:19:57 +0200 Subject: about graphics and GUI References: <39C33A4A.8DAE1019@europemail.com> <39C5E96C.97344872@erix.ericsson.se> Message-ID: <39C4709D.790D7E82@europemail.com> Gunilla Hugosson wrote: > Luc Taesch wrote: > > > > 1) when using toolbars, say table monitor, we can see the "graphics initialising" which take a while. > > > > is the delay it due to the erlang, or some lib ? > > Hi Luc, > > It's just a feature of TV, a progress window shown while > the processes necessary for monitoring a table are started and > the window is created. Since it shouldn't take TV longer to > open a window than any other tool (Pman, Debugger, etc), ok, but opening a debug (say attach on new/exit/break) is not instantaneous (say, a long breating...) im running linux, p3 450, 128MO. are ure windows opeing instantaneous ? could it be a platform issue ? > > maybe it should be removed to avoid any confusion. > > Regards, Gunilla -- First, they ignore you. Then, they laugh at you. Then, they fight you. Then, you win. --- Gandhi. Working code is what matter, not your market capitalization. --Kurt granroth From ltaesch@REDACTED Sun Sep 17 09:53:14 2000 From: ltaesch@REDACTED (Luc Taesch) Date: Sun, 17 Sep 2000 09:53:14 +0200 Subject: about graphics and GUI References: <39C33A4A.8DAE1019@europemail.com> <39C5E96C.97344872@erix.ericsson.se> <39C5EF03.60FB9BD9@terminus.ericsson.se> Message-ID: <39C4786A.18BEE4CA@europemail.com> Francesco Cesarini wrote: > > Since it shouldn't take TV longer to > > open a window than any other tool (Pman, Debugger, etc), > > maybe it should be removed to avoid any confusion. > > The problem with the TV is that it does take longer (on a slow machine, > much much longer) to start the table windows. This is because unlike > Pman and the Debugger [ .. ] > (If the table is not huge, lots of empty objects > are created instead). ah, that sounds better. at least, i understand now. > > > An option would be to create the visible part first and display it. Once > done, the parts not visible in the window could be created.... Or insert > a resize option in the grid object and use that instead. > > Rgds, > FC > still, when in debug, if i do , say search, 1 or 2 second may lapse before the search windows get focus. any idea about that ? i m trying to assess it its: - tk (gs is tk based, is it ?) -gs -erlang , or func approach to that im too newby to get the point the about that. mnesia has proven that func language can be efficient for side effect. so now, i to to understand why graphical side effect are not efficient. > Francesco Cesarini > > Erlang/OTP consultant > Cellular: INT+44-7776 250381 > ECN: 832-707192 > URL: http://welcome.to/cesarini.consulting -- First, they ignore you. Then, they laugh at you. Then, they fight you. Then, you win. --- Gandhi. Working code is what matter, not your market capitalization. --Kurt granroth From tobbe@REDACTED Mon Sep 18 13:34:17 2000 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 18 Sep 2000 13:34:17 +0200 Subject: ig-2.0 Message-ID: The Interface Generator (IG) is back in business ! I've got permission from the OTP team to continue to maintain IG. It requires (and works nice with) OTP-R7A. I have also written some new documentation, re-worked and added some new examples (e.g how to interface the curses library). http://www.bluetail.com/~tobbe/ig/doc.new/ Enjoy /Tobbe From cesarini@REDACTED Mon Sep 18 13:42:37 2000 From: cesarini@REDACTED (Francesco Cesarini) Date: Mon, 18 Sep 2000 12:42:37 +0100 Subject: about graphics and GUI References: <39C33A4A.8DAE1019@europemail.com> <39C5E96C.97344872@erix.ericsson.se> <39C5EF03.60FB9BD9@terminus.ericsson.se> <39C4786A.18BEE4CA@europemail.com> Message-ID: <39C5FFAD.5FA1D17A@terminus.ericsson.se> > still, when in debug, if i do , say search, 1 or 2 second may lapse before > the search windows get focus. any idea about that ? > > i m trying to assess it its: > - tk (gs is tk based, is it ?) > -gs > -erlang , or func approach to that I haven't looked at GS in 4 years, but if I recall correctly, it has to do with the implementation, where the major bottleneck is the Erlang to TCL communication. It all goes through one socket, and all commands have to be converted to strings. I think Tony Rogvall solved that problem by implementing an Erlang to TK (ETK) package on which he was able to demo some fairly efficient applications. If you are planing on building a GUI, you should maybe look at that. (I am not sure if it is stored in the Erlang Archive heaven, or is released in some other form). Check out the archives and the older erlang releases. (First came out with Erlang 47.4.1). Regards, Francesco -- Francesco Cesarini Erlang/OTP consultant Cellular: INT+44-7776 250381 ECN: 832-707192 URL: http://welcome.to/cesarini.consulting From bjowi@REDACTED Mon Sep 18 17:10:53 2000 From: bjowi@REDACTED (=?ISO-8859-1?Q?Bj=F6rn Wingman?=) Date: Mon, 18 Sep 2000 17:10:53 +0200 (MET DST) Subject: ic and modules Message-ID: <200009181510.RAA28259@sture.lysator.liu.se> I'm using modules and includes in my idl files, like this: #include "types.idl" module Foo interface Bar { myType returnStuff(); // myType declared in types.idl }; }; In R6B I had to manually merge types.idl with the other idl files, but in R7A (with ic 4.0.4) includes seem to work. However, the oe_register/0 functions in the generated code doesn't include any orber_ifr:'Repository_create_module' call for the top module (Foo, in this case), like the code generated with the old ic from R6B and the merged idl-files. It looked like this with the old ic: OE_1 = orber_ifr:'Repository_create_module'(OE_IFR, "IDL:Foo:1.0", "Foo", "1.0"), instead, there is this call: OE_1 = oe_get_top_module(OE_IFR, "IDL:Foo:1.0", "Foo", "1.0"), which fails, because the module foo isn't registered. How do I tell ic to generate code to register a top module entry in the ifr? Is there some option that I haven't found? /Bj?rn Wingman From nick@REDACTED Tue Sep 19 08:50:52 2000 From: nick@REDACTED (Niclas Eklund) Date: Tue, 19 Sep 2000 08:50:52 +0200 (MET DST) Subject: ic and modules In-Reply-To: <200009181510.RAA28259@sture.lysator.liu.se> Message-ID: On Mon, 18 Sep 2000, =?ISO-8859-1?Q?Bj=F6rn Wingman?= wrote: > I'm using modules and includes in my idl files, like this: > > #include "types.idl" > > module Foo > interface Bar > { > myType returnStuff(); // myType declared in types.idl > }; > }; > > In R6B I had to manually merge types.idl with the other idl files, but > in R7A (with ic 4.0.4) includes seem to work. > > However, the oe_register/0 functions in the generated code doesn't > include any orber_ifr:'Repository_create_module' call for the top > module (Foo, in this case), like the code generated with the old ic > from R6B and the merged idl-files. It looked like this with the old > ic: > > OE_1 = orber_ifr:'Repository_create_module'(OE_IFR, "IDL:Foo:1.0", "Foo", "1.0"), > > instead, there is this call: > > OE_1 = oe_get_top_module(OE_IFR, "IDL:Foo:1.0", "Foo", "1.0"), > > which fails, because the module foo isn't registered. > > How do I tell ic to generate code to register a top module entry in > the ifr? Is there some option that I haven't found? Hello! The function oe_get_top_module was added to allow users to define multiple module definitions. For example: // File A.idl module M { interface I { ... }; }; // File B.idl module M { interface J { ... }; }; The function oe_get_top_module looks like: oe_get_top_module(OE_IFR, ID, Name, Version) -> case orber_ifr:'Repository_lookup_id'(OE_IFR, ID) of [] -> orber_ifr:'Repository_create_module'(OE_IFR, ID, Name, Version); Mod -> Mod end. Hence, if module M not have been registered before it will be created, otherwise the existing definition will be used. Have you registered the included IDL-file as well (i.e. types.idl)? If you look in the oe_XXX file the function include_reg_test/1 states which file you must register first. /Nick From qramika@REDACTED Tue Sep 19 09:48:09 2000 From: qramika@REDACTED (Karlsson Mikael) Date: Tue, 19 Sep 2000 09:48:09 +0200 (MET DST) Subject: about graphics and GUI Message-ID: <200009190748.JAA14098@nic.era-a.ericsson.se> This sounds interesting, but I do not understand were the binary syntax comes in. Is it together with the IC application? Could you give an example? /Mikael > With the new binary syntax it is really easy to write a program that > does this if the source header file/interface is well written.. > I wrote one in couple of hours that could generate 75% of the > opengl functions for example.. > /Dan >Sean Hinde writes: > > I looked at this a bit a while back and it seemed that most of the other > > language bindings used their equivalent of the old Interface Generator to > > generate all the code. (i.e. given a set of C header files, generate the > > equivalent interface in the native language). Since the demise of IG there > > doesn't appear to be an easy mechanism (write your own generator..) > > > > Maybe there would be some scope in having a preliminary stage in the IC > > compilation process to munge C header files into something usable by this? > > > > Sean From dgud@REDACTED Tue Sep 19 10:43:10 2000 From: dgud@REDACTED (Dan Gudmundsson) Date: Tue, 19 Sep 2000 10:43:10 +0200 (MET DST) Subject: about graphics and GUI In-Reply-To: <200009190748.JAA14098@nic.era-a.ericsson.se> References: <200009190748.JAA14098@nic.era-a.ericsson.se> Message-ID: <14791.10014.445501.663409@gargle.gargle.HOWL> Karlsson Mikael writes: > This sounds interesting, but I do not understand were the binary > syntax comes in. Is it together with the IC application? > > Could you give an example? > > /Mikael > > > With the new binary syntax it is really easy to write a program that > > does this if the source header file/interface is well written.. > > > I wrote one in couple of hours that could generate 75% of the > > opengl functions for example.. > > > /Dan > Sure, as I said the opengl api is really nice/easy. All the used types are simple types so I didn't have poke around with structures and complex C types. I generated stubs for all the functions into 5 files and modified them by hand. For example every function that returns something (i.e. all glGet* functions) are handwritten, but even in these functions most of the work is generated and I had to handle pointers, allocate memory for arrays and such. For example this declaration in gl.h GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); Generates the following: ----------------------------------- gl.erl (the erlang API) %% Func: clearColor %% Args: %% Returns: %% C-API func: void glClearColor(GLclampf red, GLclampf green, %% GLclampf blue, GLclampf alpha) clearColor(Red, Green, Blue, Alpha) -> cast(?glClearColor, <>). ----------------------------------- esdl_gl.c (the c-wrapper function) int egl_clearColor (int len, char * buff) { char * bp; GLclampf red; GLclampf green; GLclampf blue; GLclampf alpha; bp = ARGS(buff); red = getFloat32be(bp); green = getFloat32be(bp); blue = getFloat32be(bp); alpha = getFloat32be(bp); glClearColor(red, green, blue, alpha); return 0; } ----------------------------------- sdl_wrapper.c (cases for a big switch with every supported function) case glClearColorFunc: egl_clearColor(len, buff); break; ----------------------------------- And function definitions in .h and .hrl files for the macros.. The main loop in the C-program read packages from stdin calls the wrapper function, which calls the library function and then (if any) writes the result on stdout. read_packet and write_packet is copied from the erlang book. Then I have the macros get8/put8() put32be()/get32be()... to convert values on the C side to the appropriate types... (copied from the erl_interface src) /Dan From Sean.Hinde@REDACTED Tue Sep 19 11:27:16 2000 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 19 Sep 2000 10:27:16 +0100 Subject: about graphics and GUI Message-ID: <402DD461F109D411977E0008C791C312565134@imp02mbx.one2one.co.uk> Dan, > I generated stubs for all the functions into 5 files and > modified them by hand. For example every function that returns > something (i.e. all glGet* functions) are handwritten, but even > in these functions most of the work is generated and I had to > handle pointers, allocate memory for arrays and such. So part of this program was a preprocessor and parser for the C header files? I don't quite yet see that it is that easy to derive all the meaning required from a C header like this one: > For example this declaration in gl.h > GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, > GLboolean blue, GLboolean alpha ); It would be fascinating to see at least part of your program if you are able and happy to release it (or release something similar). Even though as you say it is nothing like complete it could still give some of us a clue in the right direction. Thanks very much, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From tobbe@REDACTED Tue Sep 19 11:42:42 2000 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 19 Sep 2000 11:42:42 +0200 Subject: about graphics and GUI In-Reply-To: Sean Hinde's message of "Tue, 19 Sep 2000 10:27:16 +0100" References: <402DD461F109D411977E0008C791C312565134@imp02mbx.one2one.co.uk> Message-ID: > It would be fascinating to see at least part of your program if > you are able and happy to release it (or release something similar). If not binary syntax is a must you may well try IG for this. http://www.bluetail.com/~tobbe/ig/doc.new/ Cheers /Tobbe From dgud@REDACTED Tue Sep 19 11:55:22 2000 From: dgud@REDACTED (Dan Gudmundsson) Date: Tue, 19 Sep 2000 11:55:22 +0200 (MET DST) Subject: about graphics and GUI In-Reply-To: <402DD461F109D411977E0008C791C312565134@imp02mbx.one2one.co.uk> References: <402DD461F109D411977E0008C791C312565134@imp02mbx.one2one.co.uk> Message-ID: <14791.14346.258626.58600@gargle.gargle.HOWL> Sean Hinde writes: > It would be fascinating to see at least part of your program if you are able > and happy to release it (or release something similar). Even though as you > say it is nothing like complete it could still give some of us a clue in the > right direction. I'll release as soon as I have done some testing and written atleast one comment line.. :-) /Dan > > Thanks very much, > Sean > From Sean.Hinde@REDACTED Tue Sep 19 12:00:59 2000 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 19 Sep 2000 11:00:59 +0100 Subject: about graphics and GUI Message-ID: <402DD461F109D411977E0008C791C312565135@imp02mbx.one2one.co.uk> Hi Tobbe, > If not binary syntax is a must you may well try IG for this. I have downloaded it and plan to have a play when I get some time. It would be useful though if someone could explain what the pitfalls are which led Ericsson to drop it from Erlang/OTP in the first place. I think I read somewhere that it was to do with people getting themselves into a mess in their use of it..? Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From tobbe@REDACTED Tue Sep 19 12:10:08 2000 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 19 Sep 2000 12:10:08 +0200 Subject: about graphics and GUI In-Reply-To: Sean Hinde's message of "Tue, 19 Sep 2000 11:00:59 +0100" References: <402DD461F109D411977E0008C791C312565135@imp02mbx.one2one.co.uk> Message-ID: > I have downloaded it and plan to have a play when I get some time. It would > be useful though if someone could explain what the pitfalls are which led > Ericsson to drop it from Erlang/OTP in the first place. I think I read > somewhere that it was to do with people getting themselves into a mess in > their use of it..? Well, I admit it is not as complete and polished as the IC stuff but I have found it to be very useful (not surprisingly perhaps... :-) Cheers /Tobbe From mickael.remond@REDACTED Tue Sep 19 14:43:53 2000 From: mickael.remond@REDACTED (Mickael Remond) Date: 19 Sep 2000 14:43:53 +0200 Subject: R7A : Segmentation fault Message-ID: <877l881rhy.fsf@western.ird.idealx.com> I found a bug (at least on my machine) that make the beam virtual machine crash (Version R7A). The following code might reproduce the bug on your machine. -------------- next part -------------- A non-text attachment was scrubbed... Name: bugreport.erl Type: application/octet-stream Size: 631 bytes Desc: not available URL: -------------- next part -------------- the file:list_dir/1 function crash the beam virtual machine when we have 999 or more file in the directory. This function is working perfectly on the stable Erlang release. I hope this help. -- Micka?l R?mond - mickael.remond@REDACTED - http://IDEALX.com From bjowi@REDACTED Tue Sep 19 15:34:30 2000 From: bjowi@REDACTED (=?ISO-8859-1?Q?Bj=F6rn Wingman?=) Date: Tue, 19 Sep 2000 15:34:30 +0200 (MET DST) Subject: R7A : Segmentation fault In-Reply-To: <877l881rhy.fsf@western.ird.idealx.com> (message from Mickael Remond on 19 Sep 2000 14:43:53 +0200) References: <877l881rhy.fsf@western.ird.idealx.com> Message-ID: <200009191334.PAA11293@sture.lysator.liu.se> > I found a bug (at least on my machine) that make the beam virtual > machine crash (Version R7A). >the file:list_dir/1 function crash the beam virtual machine when we have 999 >or more file in the directory. >This function is working perfectly on the stable Erlang release. Nope, works fine on my Ultra. (Solaris 7) I succesfully created 1004 files. (Which took forever) /Bj?rn Wingman From mickael.remond@REDACTED Tue Sep 19 15:55:13 2000 From: mickael.remond@REDACTED (Mickael Remond) Date: 19 Sep 2000 15:55:13 +0200 Subject: R7A : Segmentation fault In-Reply-To: "Björn Wingman"'s message of "Tue, 19 Sep 2000 15:34:30 +0200 (MET DST)" References: <877l881rhy.fsf@western.ird.idealx.com> <200009191334.PAA11293@sture.lysator.liu.se> Message-ID: <87pum0zdtq.fsf@western.ird.idealx.com> >>>>> "Bj?rn" == Bj?rn Wingman writes: >> I found a bug (at least on my machine) that make the beam virtual >> machine crash (Version R7A). >> the file:list_dir/1 function crash the beam virtual machine when we have 999 >> or more file in the directory. >> This function is working perfectly on the stable Erlang release. > Nope, works fine on my Ultra. (Solaris 7) > I succesfully created 1004 files. (Which took forever) Oups. I forgot to say that this problem happens on Linux (I am using a Debian 2.2). A friend of mine seems to have the same issue (segmentation fault). I might try tonight on a Windows computer, but this might indeed be a Linux specific problem... Thank you for your feedback. -- Micka?l R?mond - mickael.remond@REDACTED - http://IDEALX.com - 01 44 42 00 38 From vances@REDACTED Tue Sep 19 18:15:17 2000 From: vances@REDACTED (Vance Shipley) Date: Tue, 19 Sep 2000 12:15:17 -0400 Subject: R7A : Segmentation fault In-Reply-To: <877l881rhy.fsf@western.ird.idealx.com> Message-ID: Mickael, I have R7A on Redhat Linux here so I gave it a try. Seems to work fine here: $ uname -a Linux nitrogen 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown $ ./bin/erl Erlang (BEAM) emulator version 5.0 [source] Eshell V5.0 (abort with ^G) 1> c(bugreport). {ok,bugreport} 2> bugreport:loop(1004). Created file : 1 - file:list_dir length : 1003 Created file : 2 - file:list_dir length : 1003 .... Created file : 999 - file:list_dir length : 999 Created file : 1000 - file:list_dir length : 1000 Created file : 1001 - file:list_dir length : 1001 Created file : 1002 - file:list_dir length : 1002 Created file : 1003 - file:list_dir length : 1003 ok 3> -Vance From mickael.remond@REDACTED Tue Sep 19 19:05:57 2000 From: mickael.remond@REDACTED (Mickael Remond) Date: 19 Sep 2000 19:05:57 +0200 Subject: R7A : Segmentation fault In-Reply-To: "Vance Shipley"'s message of "Tue, 19 Sep 2000 12:15:17 -0400" References: Message-ID: <87snqw1fd6.fsf@western.ird.idealx.com> >>>>> "Vance" == Vance Shipley writes: > Mickael, > I have R7A on Redhat Linux here so I gave it a try. > Seems to work fine here: > $ uname -a > Linux nitrogen 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown > $ ./bin/erl > Erlang (BEAM) emulator version 5.0 [source] > Eshell V5.0 (abort with ^G) 1> c(bugreport). > {ok,bugreport} 2> bugreport:loop(1004). > Created file : 1 - file:list_dir length : 1003 > Created file : 2 - file:list_dir length : 1003 > .... > Created file : 999 - file:list_dir length : 999 > Created file : 1000 - file:list_dir length : 1000 > Created file : 1001 - file:list_dir length : 1001 > Created file : 1002 - file:list_dir length : 1002 > Created file : 1003 - file:list_dir length : 1003 > ok 3> > -Vance That's very strange... This might be my gcc version... I don't know. Here is my result. Here is my session: $ uname -a Linux western 2.2.15 #1 ven jun 9 14:05:59 CEST 2000 i686 unknown $ ./bin/erl Erlang (BEAM) emulator version 5.0 [source] Eshell V5.0 (abort with ^G) 1> c(bugreport). {ok,bugreport} 2> bugreport:loop(1004). Ends by .... Created file : 995 - file:list_dir length : 995 Created file : 996 - file:list_dir length : 996 Created file : 997 - file:list_dir length : 997 Created file : 998 - file:list_dir length : 998 Created file : 999 - Erreur de segmentation Any idea ? -- Micka?l R?mond - mickael.remond@REDACTED - http://IDEALX.com - 01 44 42 00 38 From achrist@REDACTED Tue Sep 19 23:53:37 2000 From: achrist@REDACTED (Al Christians) Date: Tue, 19 Sep 2000 14:53:37 -0700 Subject: Very Reliable Web Server for NT? Message-ID: <39C7E061.5FB0F194@easystreet.com> I've developed some applications for NT (using Delphi) and now my marketing partner is finding markets that seem to need some kind of application service provider setup rather than to run the software standalone on their own machines. They are very small and not very computer literate operations, and they need to make the same data available for viewing and updating from multiple locations. So, now, almost as an afterthought, we are thinking of converting these applications to be web-accessible, setting up a server, and renting the apps out via a standard web browser interface. Delphi includes features that are supposed to be able to turn my apps into web servers, but I don't trust then to stay up 24x7. Since this is an afterthought almost, we don't want to devote any significant effort to keeping the server up, as in perpetually. The load won't be great -- I doubt that we'd ever have more than 10 users at a time. Erlang being promoted for very high reliability, I have ... Questions for this list: 1. Is there any ways that using an Erlang web server as the front end for Delphi apps would be a good way to improve the overall reliability and availability of the server? We would want some way for the Windows apps to crash (as Windows apps sometimes do) without bringing down the server, and with the server to able to continue serving other users and to keep serving up new instances of the crashed apps. 2. Would turning the Delphi apps into Com components and accessing them with Comet be any more robust than simply turning the Delphi apps into http servers? Does Comet protect the client from a crash in a Com component? 3. Any other better ways to get what we want, ie, a server that will allow access to Windows applications without stop or significant human intervention for weeks or months at a run? TIA very much. Al From joe@REDACTED Wed Sep 20 09:59:52 2000 From: joe@REDACTED (Joe Armstrong) Date: Wed, 20 Sep 2000 09:59:52 +0200 (CEST) Subject: Very Reliable Web Server for NT? In-Reply-To: <39C7E061.5FB0F194@easystreet.com> Message-ID: On Tue, 19 Sep 2000, Al Christians wrote: > I've developed some applications for NT (using Delphi) and now > my marketing partner is finding markets that seem to need > some kind of application service provider setup rather > than to run the software standalone on their own machines. They > are very small and not very computer literate operations, and > they need to make the same data available for viewing and updating > from multiple locations. > > So, now, almost as an afterthought, we are thinking of converting > these applications to be web-accessible, setting up a server, and > renting the apps out via a standard web browser interface. Delphi > includes features that are supposed to be able to turn my apps into > web servers, but I don't trust then to stay up 24x7. Since this is > an afterthought almost, we don't want to devote any significant > effort to keeping the server up, as in perpetually. The load won't > be great -- I doubt that we'd ever have more than 10 users at a > time. Erlang being promoted for very high reliability, I have ... > > Questions for this list: > > 1. Is there any ways that using an Erlang web server as the front end > for Delphi apps would be a good way to improve the overall reliability > and availability of the server? We would want some way for the Windows > apps to crash (as Windows apps sometimes do) without bringing down the > server, and with the server to able to continue serving other users and > to keep serving up new instances of the crashed apps. > Yes and no :-) If you want to make highly reliable applications you will have to start thinking architecturally. You will need at least two machines - for obvious reasons you cannot make reliable systems with one machine. With two machines you at least have a chance - provided both don't crash simultaneously! Three machines is even better. Once to act as a front-end. The other two to service the requests. If you want 24x7 you also have to consider (in detail) what happens as you upgraded you applications. i.e. how do you do "in service upgrade without loss of service". All of the above *is* pretty difficult - and in the general case virtually impossible - If you make certain limiting assumptions (for example that all transactions occur in bounded time) - then the problem becomes tractable. So, for example, making reliable HTTP sessions is "easy" (actually it's not that easy) because the sessions are short - but making a reliable server for streaming media is much more difficult. I don't want to be pessimistic but your opening words "almost as an afterthought" don't give me good vibes. You *can* make highly reliable 24x7 apps. and hot swap code etc. BUT you have to design them to do this from the very beginning. There is no magic dust that you can sprinkle over a faulty architecture that will suddenly make it work reliably. In the circumstances the best you can do is run your windows apps. on physically separated boxes and "ping" them to see if they are working - if they fail you must arrange to take them out of service and/or restart them. How you do depends upon the nature of the applications. This is what "eddie" did (sort of). You can download eddie from http://www.eddieware.org/ > Would turning the Delphi apps into Com components and accessing them > with Comet be any more robust than simply turning the Delphi apps into > http servers? Does Comet protect the client from a crash in a Com > component? > > 3. Any other better ways to get what we want, ie, a server that will > allow access to Windows applications without stop or significant human > intervention for weeks or months at a run? Dream on. If you want reliability you will have to design it in from the start. You should aim at very simple "obviously correct" solutions and you should isolate the components so that failure of one component will not effect the rest of the system. /Joe -- Joe Armstrong, Bluetail AB, tel: +46 8-545 550 00 S:t Eriksgatan 44, fax: +46 8-545 550 50 SE-112 32 Stockholm, Sweden info: www.bluetail.com From gunilla@REDACTED Wed Sep 20 10:10:57 2000 From: gunilla@REDACTED (Gunilla Hugosson) Date: Wed, 20 Sep 2000 10:10:57 +0200 Subject: about graphics and GUI References: <402DD461F109D411977E0008C791C312565135@imp02mbx.one2one.co.uk> Message-ID: <39C87111.D7D1A6D@erix.ericsson.se> The reason for dropping IG is that it takes too much time and effort maintaining two applications doing more and less the same thing, and we (OTP) consider IC better since it uses a standardized way of describing interfaces (IDL) and can generate interfaces Erlang-Erlang/C/Java, not only Erlang-C. Don't know about any people getting into a mess. Regards, Gunilla Sean Hinde wrote: > > Hi Tobbe, > > > If not binary syntax is a must you may well try IG for this. > > I have downloaded it and plan to have a play when I get some time. It would > be useful though if someone could explain what the pitfalls are which led > Ericsson to drop it from Erlang/OTP in the first place. I think I read > somewhere that it was to do with people getting themselves into a mess in > their use of it..? > > Sean > From nick@REDACTED Wed Sep 20 10:39:05 2000 From: nick@REDACTED (Niclas Eklund) Date: Wed, 20 Sep 2000 10:39:05 +0200 (MET DST) Subject: about graphics and GUI In-Reply-To: <39C87111.D7D1A6D@erix.ericsson.se> Message-ID: On Wed, 20 Sep 2000, Gunilla Hugosson wrote: > The reason for dropping IG is that it takes too much time > and effort maintaining two applications doing more and less > the same thing, and we (OTP) consider IC better since it uses > a standardized way of describing interfaces (IDL) and can > generate interfaces Erlang-Erlang/C/Java, not only Erlang-C. > Don't know about any people getting into a mess. > > Regards, Gunilla ... and last, but not least, CORBA which give you easy access to a lot of platforms and Language bindings (Erlang, Java, C/C++, Ada, etc). /Nick > Sean Hinde wrote: > > > > Hi Tobbe, > > > > > If not binary syntax is a must you may well try IG for this. > > > > I have downloaded it and plan to have a play when I get some time. It would > > be useful though if someone could explain what the pitfalls are which led > > Ericsson to drop it from Erlang/OTP in the first place. I think I read > > somewhere that it was to do with people getting themselves into a mess in > > their use of it..? > > > > Sean From raimo@REDACTED Wed Sep 20 10:50:48 2000 From: raimo@REDACTED (Raimo Niskanen) Date: Wed, 20 Sep 2000 10:50:48 +0200 Subject: R7A : Segmentation fault References: <87snqw1fd6.fsf@western.ird.idealx.com> Message-ID: <39C87A68.849D8844@erix.ericsson.se> Mickael Remond wrote: > Here is my session: > > $ uname -a > Linux western 2.2.15 #1 ven jun 9 14:05:59 CEST 2000 i686 unknown > > $ ./bin/erl > Erlang (BEAM) emulator version 5.0 [source] > > Eshell V5.0 (abort with ^G) > 1> c(bugreport). > {ok,bugreport} > 2> bugreport:loop(1004). > > Ends by > .... > > Created file : 995 - file:list_dir length : 995 > Created file : 996 - file:list_dir length : 996 > Created file : 997 - file:list_dir length : 997 > Created file : 998 - file:list_dir length : 998 > Created file : 999 - Erreur de segmentation > > Any idea ? > > -- > Micka?l R?mond - mickael.remond@REDACTED > - http://IDEALX.com > - 01 44 42 00 38 I have a Debian 2.2 laptop and can reproduce your fault, just like You. I hacked your code to not write at /tmp/test, but on $CWD/test (which is ~/tmp/test) and then there is no problem. One suggestion is that there is something fishy about the /tmp directory. If it lies in virtual memory or is treated specially in any way (special filesystem, number of allowed inodes, ...) this may be the reason, and I am not enough Linux guru to know, but I know that one shall not be suprised to find that the /tmp directory has size limitations in some way or another. / Raimo Niskanen, Erlang/OTP From raimo@REDACTED Wed Sep 20 11:02:16 2000 From: raimo@REDACTED (Raimo Niskanen) Date: Wed, 20 Sep 2000 11:02:16 +0200 Subject: R7A : Segmentation fault References: <87snqw1fd6.fsf@western.ird.idealx.com> <39C87A68.849D8844@erix.ericsson.se> Message-ID: <39C87D18.5C87EE25@erix.ericsson.se> And, I must add, unfortunately the Erlang emulator does not handle out of memory in a too controlled manor, so "segmentation fault" is a probable response to out of virtual memory. This might be the case if /tmp competes with the virtual memory. /Raimo Niskanen, Erlang/OTP Raimo Niskanen wrote: > > Mickael Remond wrote: > > Here is my session: > > > > $ uname -a > > Linux western 2.2.15 #1 ven jun 9 14:05:59 CEST 2000 i686 unknown > > > > $ ./bin/erl > > Erlang (BEAM) emulator version 5.0 [source] > > > > Eshell V5.0 (abort with ^G) > > 1> c(bugreport). > > {ok,bugreport} > > 2> bugreport:loop(1004). > > > > Ends by > > .... > > > > Created file : 995 - file:list_dir length : 995 > > Created file : 996 - file:list_dir length : 996 > > Created file : 997 - file:list_dir length : 997 > > Created file : 998 - file:list_dir length : 998 > > Created file : 999 - Erreur de segmentation > > > > Any idea ? > > > > -- > > Micka?l R?mond - mickael.remond@REDACTED > > - http://IDEALX.com > > - 01 44 42 00 38 > > I have a Debian 2.2 laptop and can reproduce your fault, just like You. > > I hacked your code to not write at /tmp/test, but on $CWD/test (which is > ~/tmp/test) and then there is no problem. > > One suggestion is that there is something fishy about the /tmp > directory. If it lies in virtual memory or is treated specially in any > way (special filesystem, number of allowed inodes, ...) this may be the > reason, and I am not enough Linux guru to know, but I know that one > shall not be suprised to find that the /tmp directory has size > limitations in some way or another. > > / Raimo Niskanen, Erlang/OTP From raimo@REDACTED Wed Sep 20 13:30:27 2000 From: raimo@REDACTED (Raimo Niskanen) Date: Wed, 20 Sep 2000 13:30:27 +0200 Subject: R7A : Segmentation fault References: <87snqw1fd6.fsf@western.ird.idealx.com> <39C87A68.849D8844@erix.ericsson.se> Message-ID: <39C89FD3.155F11C0@erix.ericsson.se> Sorry about confusing You. We think we have found the error, it's in the Erlang beam emulator. It was not related to the /tmp directory, I hacked Your code wrong so the error never occured. In fact the segmentation fault shows up when calling file:list_dir('directory') on any diretory containing 999 files or more. (for Debian Linux 2.2) This is caused by a function efile_drv.c that happened to become recursive when we tried to introduce threaded I/O (and now just run one thread), so the stack became exhausted at 999 files. This should happen on all versions of Unix, not just Debian Linux 2.2, the question is just for how many files. We are working on the problem. / Raimo Niskanen, Erlang/OTP Raimo Niskanen wrote: > > Mickael Remond wrote: > > Here is my session: > > > > $ uname -a > > Linux western 2.2.15 #1 ven jun 9 14:05:59 CEST 2000 i686 unknown > > > > $ ./bin/erl > > Erlang (BEAM) emulator version 5.0 [source] > > > > Eshell V5.0 (abort with ^G) > > 1> c(bugreport). > > {ok,bugreport} > > 2> bugreport:loop(1004). > > > > Ends by > > .... > > > > Created file : 995 - file:list_dir length : 995 > > Created file : 996 - file:list_dir length : 996 > > Created file : 997 - file:list_dir length : 997 > > Created file : 998 - file:list_dir length : 998 > > Created file : 999 - Erreur de segmentation > > > > Any idea ? > > > > -- > > Micka?l R?mond - mickael.remond@REDACTED > > - http://IDEALX.com > > - 01 44 42 00 38 > > I have a Debian 2.2 laptop and can reproduce your fault, just like You. > > I hacked your code to not write at /tmp/test, but on $CWD/test (which is > ~/tmp/test) and then there is no problem. > > One suggestion is that there is something fishy about the /tmp > directory. If it lies in virtual memory or is treated specially in any > way (special filesystem, number of allowed inodes, ...) this may be the > reason, and I am not enough Linux guru to know, but I know that one > shall not be suprised to find that the /tmp directory has size > limitations in some way or another. > > And, I must add, unfortunately the Erlang emulator does not handle out > of memory in a too controlled manor, so "segmentation fault" is a > probable response to out of virtual memory. This might be the case if > /tmp competes with the virtual memory. > > /Raimo Niskanen, Erlang/OTP From mickael.remond@REDACTED Wed Sep 20 14:07:16 2000 From: mickael.remond@REDACTED (Mickael Remond) Date: 20 Sep 2000 14:07:16 +0200 Subject: R7A : Segmentation fault In-Reply-To: Raimo Niskanen's message of "Wed, 20 Sep 2000 13:30:27 +0200" References: <87snqw1fd6.fsf@western.ird.idealx.com> <39C87A68.849D8844@erix.ericsson.se> <39C89FD3.155F11C0@erix.ericsson.se> Message-ID: <871yyf1d3f.fsf@western.ird.idealx.com> >>>>> "Raimo" == Raimo Niskanen writes: > This is caused by a function efile_drv.c that happened to become > recursive when we tried to introduce threaded I/O (and now just run one > thread), so the stack became exhausted at 999 files. This should happen > on all versions of Unix, not just Debian Linux 2.2, the question is just > for how many files. > We are working on the problem. I am happy to have this this bug right now. It will no show up in the final release. Thank you for your great support ! -- Micka?l R?mond - mickael.remond@REDACTED - http://IDEALX.com - 01 44 42 00 38 From stephen.wight@REDACTED Wed Sep 20 20:30:50 2000 From: stephen.wight@REDACTED (stephen.wight@REDACTED) Date: Wed, 20 Sep 2000 11:30:50 -0700 (PDT) Subject: mnemosyne:string_to_handle() unpleasantness Message-ID: <14793.602.2484.601487@bathory.tradeum.com> I would like to compose a list comprehension query in a non-Erlang environment and pass the query clause as a string to mnemosyne. I'm unable to use the "undocumented" string_to_handle() function without getting an error from erl_parse:normalize(), which is reported by mnemosyne:setup_query(). I'm testing this with a trivial LC query embedded in a function - note my two alternative query construction methods for debugging; this is to verify that the same LC compiles and runs correctly when used 'normally': evalq() -> Q = mnemosyne:string_to_handle("query [X || X <- table(atable)] end."), %% Q = query [X || X <- table(atable)] end, case mnesia:transaction(fun() -> mnemosyne:eval(Q) end) of {aborted, Err} -> io:format("transaction aborted ~n", []), Err; {atomic, QueryResult} -> io:format("query result ~n", []), QueryResult; _ -> false end. The error object being returned looks like this: 21> mntools:evalq(). transaction aborted {function_clause,[{mnemosyne,setup_query, [{'EXIT',{function_clause, [{erl_parse, normalise, [{call, 0, {atom,0,'MNEMOSYNE RULE'}, [{tuple,0,[{...}|...]}]}]}, {erl_parse,normalise_list,1}, {erl_parse,normalise,1}, {erl_parse,normalise_list,1}, {erl_parse,normalise,1}, {mnemosyne_lc, '-one_lc_to_handle/1-fun-1-', 2}, {lists,foldl,3}, {mnemosyne_lc,one_lc_to_handle,1}| more]}}]}, {mnemosyne,cursor,2}, {mnemosyne,eval,1}, {mnesia_tm,apply_fun,2}, {mnesia_tm,execute_transaction,4}, {mntools,evalq,0}, {erl_eval,expr,3}, {erl_eval,exprs,4}| more]} Thanks for any help or suggestions for an alternative route to get this done!! -steve wight From luc.taesch@REDACTED Thu Sep 21 16:18:02 2000 From: luc.taesch@REDACTED (luc.taesch@REDACTED) Date: Thu, 21 Sep 2000 16:18:02 +0200 Subject: a funny one. Message-ID: a funny one. i though about last day talk mentionning all gs message going thru ONE process, and pointed as a bottelneck. will it be better with more processes? then i thought : imagine a real time strategy game, like CC or warcraft. u have 100 to 1000 sprites to move around ( not all on your screen but it may happen) what if any of these instance of charaacters would be a processes, sending info to some game engine, and receiving it, maybe also from peer sprites ? any prediction if it would hold ? can we imagine some 200 sprites walking around, animated by 200 processes ? From vladdu@REDACTED Thu Sep 21 16:33:45 2000 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Thu, 21 Sep 2000 16:33:45 +0200 Subject: The new BEAM pointer tagging Message-ID: Hi! Where can I find some more info about the new tagging scheme? The documents at the HiPe site (which I only browsed superficially) mention only the JAM engine... thanks in advance /Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From mickael.remond@REDACTED Thu Sep 21 16:53:44 2000 From: mickael.remond@REDACTED (Mickael Remond) Date: 21 Sep 2000 16:53:44 +0200 Subject: match specifications Message-ID: <87og1hx0cm.fsf@western.ird.idealx.com> Hello, I have just discovered the match specifications in Erlang. This syntax seem to be fairly powerfull, but I did not realise how to actually do the real match. Does someone here has some example code to show us how this feature works ? Thank you in advance. -- Micka?l R?mond - mickael.remond@REDACTED - http://IDEALX.com - 01 44 42 00 38 From mickael.remond@REDACTED Thu Sep 21 17:11:20 2000 From: mickael.remond@REDACTED (Mickael Remond) Date: 21 Sep 2000 17:11:20 +0200 Subject: a funny one. In-Reply-To: luc.taesch@ubs.com's message of "Thu, 21 Sep 2000 16:18:02 +0200" References: Message-ID: <873ditwzjb.fsf@western.ird.idealx.com> >>>>> ">>>>> "luc" == luc taesch writes: > a funny one. i though about last day talk mentionning all gs message > going thru ONE process, and pointed as a bottelneck. will it be better > with more processes? > then i thought : > imagine a real time strategy game, like CC or warcraft. > u have 100 to 1000 sprites to move around ( not all on your screen but it may > happen) I don't about the graphics animation part but one of my dream would be to start coding a strategy game in Erlang, with one process by unit... -- Micka?l From jamesh@REDACTED Fri Sep 22 00:22:13 2000 From: jamesh@REDACTED (James Hague) Date: Thu, 21 Sep 2000 17:22:13 -0500 Subject: a funny one. Message-ID: <3.0.32.20000921172213.00fdab98@volition-inc.com> At 04:18 PM 9/21/00 +0200, luc.taesch@REDACTED wrote: > >what if any of these instance of charaacters would be a processes, sending info >to some game engine, and receiving it, maybe also from peer sprites ? > >any prediction if it would hold ? can we imagine some 200 sprites walking >around, animated by 200 processes ? I've thought about this, being a professional game programmer. The trick here is that games seem to have much going on at once, but there's a definite serial nature to it all. Contrast that to a web server, which is handling hundreds of separate, simultaneous transactions. Is there much benefit to using lots of small processes if everything ends up being lock and step in the end? I'm not sure. It depends on the game. James From bjowi@REDACTED Fri Sep 22 17:13:46 2000 From: bjowi@REDACTED (=?ISO-8859-1?Q?Bj=F6rn Wingman?=) Date: Fri, 22 Sep 2000 17:13:46 +0200 (MET DST) Subject: TAO implrepo and erlang Message-ID: <200009221513.RAA25504@sture.lysator.liu.se> When I try to talk to the TAO orb implementation repository (as a client) from erlang, I get an exception at a late stage (I think) of the call. For example: corba:string_to_object("corbaloc:iiop:localhost:42915/fooserver) will return this exception: {'EXCEPTION',{'MARSHAL',[],104,'COMPLETED_MAYBE'}}]}, on a call to cdr_decode:dec_type(tk_objref, {1,0}, , 24, big) ... or perhaps it's the orber_iiop_outrequest:handle_cast(reply |...) that crashes. /Bj?rn Wingman From bbisaillon@REDACTED Sat Sep 23 03:25:35 2000 From: bbisaillon@REDACTED (Brian Bisaillon) Date: Fri, 22 Sep 2000 21:25:35 -0400 Subject: Severe memory leak problem Message-ID: <00092221365301.03079@webdata.dyndns.org> I'm pretty new to Erlang and I'm writing a multi-threaded chat server. I have this problem where if I make a client program continuously send data to my server, the beam process that runs the servers keeps increasing in memory (reported by top). If I leave it on long enough my system becomes very unstable and even crashes. I've traced the memory leak to an area of my code. I don't understand why it is happening though. The code works and to me everything looks fine. It even looks like all the variables are reinitialized in my program with every tail recursive call. I don't understand why it keeps sucking up more memory. I have attached the client & server source code to this email. Can someone please help me out on this? If you run the debugger, set a breakpoint somewhere in the receive_packet function and step through it. At the same time look at the memory being used by the beam process. You'll notice that as you step through it, the memory will keep increasing. I even tried the new R7A version of Erlang and it still didn't fix the problem. It's a serious problem because if I had say 100 clients sending data simultaneously, my server would run out of memory. Compared to something like Apache or other servers that can handle many clients and use little memory, it's not a good thing. Maybe it's a design flaw in my program? Suggestions needed :-) Thanks a lot! It's important to me because it's part of a project I'm doing for college. I decided to do it because I had already coded a big part of my chat server so why not :-) -------------- next part -------------- A non-text attachment was scrubbed... Name: mtclient.erl Type: text/english Size: 742 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mtserver.erl Type: text/english Size: 7224 bytes Desc: not available URL: From dne@REDACTED Sat Sep 23 15:22:49 2000 From: dne@REDACTED (Daniel Neri) Date: 23 Sep 2000 15:22:49 +0200 Subject: Severe memory leak problem In-Reply-To: Brian Bisaillon's message of "Fri, 22 Sep 2000 21:25:35 -0400" References: <00092221365301.03079@webdata.dyndns.org> Message-ID: <87itrnb5ue.fsf@nowhere.mayonnaise.net> Brian Bisaillon writes: > It even looks like all the variables are reinitialized in my program > with every tail recursive call. I don't understand why it keeps > sucking up more memory. Your receive_packet/2 function is unfortunately *not* tail-recursive. A tail call has to be the "last" call, and in this case it is not (e.g. a call to parse_clientcmds/2 follows it). See also http://www.erlang.se/doc/programming_rules.shtml#HDR20 Best wishes, --Daniel -- Daniel Neri dne@REDACTED From stimuli@REDACTED Sat Sep 23 16:12:56 2000 From: stimuli@REDACTED (Jeffrey Straszhiem) Date: Sat, 23 Sep 2000 10:12:56 -0400 Subject: Severe memory leak problem In-Reply-To: <00092221365301.03079@webdata.dyndns.org> References: <00092221365301.03079@webdata.dyndns.org> Message-ID: <20000923101256.A694@bzzt.shadow.net> I think the problem is in the part here: . . . % If "\r\n" was not found, call the receive loop % with NewString true -> receive_packet(AcceptSocket, NewString) end, % If "\r\n" was found, parse the chat commands parse_clientcmds(AcceptSocket, NewString) . . . If no newline is found, then this function calls receive_packet, from which it never returns. Unfortunately the compiler can't know this, and the flow of control would otherwise fall to the parse_clientcmds below. This receive_packet call will not be identified as tail recursive, and the stack frame will be left intact for its return, which of course never happens. You need to restructure the flow of this function. Warning: I only started learning Erlang last week, so I could be completely wrong :) -- -- Jeffrey Straszheim | A sufficiently advanced -- Systems Engineer, Programmer | regular expression is -- http://www.shadow.net/~stimuli | indistinguishable from -- stimuli AT shadow DOT net | magic From aba3600@REDACTED Mon Sep 25 03:10:47 2000 From: aba3600@REDACTED (Andy with Recycled Electrons) Date: Sun, 24 Sep 2000 20:10:47 -0500 (CDT) Subject: Tuples as paramters Message-ID: Hi.. I've got a newbie question; What's wrong with this code: % NON-FUNCTIONAL nadd({mean1, variance1, number_samples1}, {mean2, variance2, number_samples2}) -> % N1 + N2 {mean1 + mean2, % mean variance1 + variance2, % variance (number_samples1 + number_samples2)/2 % number of samples }. It is supposed to take 2 parameters, each a 3-element tuple, and return a 3-element tuple. It is exported from a module called "poedt" that is correctly compiled into the Erlang system. I've tried the following code (run under OTP R6B) with Lists instead of Tuples, and it worked. I then changed from Lists to Tuples, and it gives me: 2> c(poedt). {ok,poedt} 3> poedt:nadd({1,2,3},{12,11,10}). =ERROR REPORT==== 24-Sep-2000::20:08:37 === Error in process <0.34.0> with exit value: {function_clause,[{poedt,nadd,[{1,2,3 },{12,11,10}]},{erl_eval,expr,3},{erl_eval,exprs,4},{shell,eval_loop,2}]} ** exited: {function_clause,[{poedt,nadd,[{1,2,3},{12,11,10}]}, {erl_eval,expr,3}, {erl_eval,exprs,4}, {shell,eval_loop,2}]} ** Thanks in advance for any information you can provide! Andy Allen Recycled Electrons email: andy@REDACTED From bbisaillon@REDACTED Mon Sep 25 03:13:38 2000 From: bbisaillon@REDACTED (Brian Bisaillon) Date: Sun, 24 Sep 2000 21:13:38 -0400 Subject: Severe memory leak problem fixed! Message-ID: <003901c0268d$d74bfee0$1c01a8c0@webdata.dyndns.org> Thanks a lot for everyone's help. The problem was I had to put the parse_clientcmds call after the string:substr(NewString, 1, Pos-1), before the ; in the receive_packet function where the if Pos =/= 0 -> was. After doing that it fixed the memory leak and it actually impressed me quite a bit. I launched 4 clients to send data to the server continuously (so the server was getting pounded with packets) and it only used up to 200KBytes (rough estimate) of RAM to process all that stuff. Quite a big improvement! Thanks so much! -------------- next part -------------- An HTML attachment was scrubbed... URL: From stimuli@REDACTED Mon Sep 25 05:05:53 2000 From: stimuli@REDACTED (Jeffrey Straszhiem) Date: Sun, 24 Sep 2000 23:05:53 -0400 Subject: Tuples as paramters In-Reply-To: References: Message-ID: <20000924230553.A693@bzzt.shadow.net> On Sun, Sep 24, 2000 at 08:10:47PM -0500, Andy with Recycled Electrons wrote: > Hi.. Hello. > I've got a newbie question; What's wrong with this code: Don't worry, I'm a newbie too. > % NON-FUNCTIONAL > nadd({mean1, variance1, number_samples1}, > {mean2, variance2, number_samples2}) -> % N1 + N2 > {mean1 + mean2, % mean > variance1 + variance2, % variance > (number_samples1 + number_samples2)/2 % number of samples > }. Variables in Erlang must start with an uppercase letter. The compiler assumes that you are trying to match a pattern with atoms names mean1, variance1, etc.; instead of variables by those names. Try giving them uppercase names, like this: nadd( {Mean1, Variance1, NumSamples1}, {Mean2, Variance2, NumSamples2}) -> {Mean1 + Mean2, Variance1 + Variance2, (NumSamples1 + NumSamples2) /2 }. See if this doesn't give better results. Just to help in the future, the cryptic error message that you got was telling you that the interpreter could not find a matching function clause for the arguments. That is, of the patterns you listed, none matched the actual data. You can tell this by changing the full stop in your bad code to a semicolon, and adding another clause like so: nadd(A,B) -> {here, A, B}. If you then try you will see it returns: {here, {1,2,3}, {10,11,12}} or whatever your exact numbers were. This is because the triples end up matching to the variables A and B, where they wouldn't match the atoms mean1, mean2, and so forth. Does this make sense now? :) -- -- Jeffrey Straszheim | A sufficiently advanced -- Systems Engineer, Programmer | regular expression is -- http://www.shadow.net/~stimuli | indistinguishable from -- stimuli AT shadow DOT net | magic From nick@REDACTED Mon Sep 25 09:40:55 2000 From: nick@REDACTED (Niclas Eklund) Date: Mon, 25 Sep 2000 09:40:55 +0200 (MET DST) Subject: TAO implrepo and erlang In-Reply-To: <200009221513.RAA25504@sture.lysator.liu.se> Message-ID: > When I try to talk to the TAO orb implementation repository (as a > client) from erlang, I get an exception at a late stage (I think) of > the call. For example: > > corba:string_to_object("corbaloc:iiop:localhost:42915/fooserver) > > will return this exception: > > {'EXCEPTION',{'MARSHAL',[],104,'COMPLETED_MAYBE'}}]}, > > on a call to cdr_decode:dec_type(tk_objref, {1,0}, > , > 24, big) > > ... or perhaps it's the orber_iiop_outrequest:handle_cast(reply |...) > that crashes. Hello! It seems like the TAO orb replied with a 'location_forward' which cause cdr_decode:dec_type to be invoked, but not with the correct arguments. To avoid this exception update dec_reply/5 'location_forward' case to use: {R, _, _} = dec_objref(Version, Rest, Len, ByteOrder), instead of: {R, _, _} = dec_type('tk_objref', Version, Rest, Len, ByteOrder), now no exception should be raised. /Nick From Matthias.Lang@REDACTED Mon Sep 25 19:00:59 2000 From: Matthias.Lang@REDACTED (Matthias.Lang@REDACTED) Date: Mon, 25 Sep 2000 19:00:59 +0200 (MET DST) Subject: base64 encoding using the new binary syntax Message-ID: <14799.33995.877332.239830@gargle.gargle.HOWL> Hi, About a year ago there was some discussion on the erlang list (or maybe it was an internal Ericsson discussion) about base64 encoding (as used in MIME) using the binary syntax. Since the binary syntax is here now, maybe people are interested in exploring its performance characteristics. Here's something to start the discussion. Performance of the attached module when en(de)coding rfc2045.txt (71kb) on my 167MHz ultrasparc: Erlang bitsyntax unix 'mimencode' program ------------------------------------------------------------------- encoding: 1.07 s 0.045s decoding: 10.2 s 0.035s The 20x slowdown on encoding looks familiar ;-). I haven't investigated why the decoding is so much slower, I'd guess there's an equivalent but uglier and faster approach. Matthias (I appreciate that a port program or a linked-in driver is a better approach if speed is crucial. That's not the point here.) %% Base 64 encoder/decoder. See RFC2045 -module(mime). -export([pack/1, unpack/1]). pack(List) when list(List) -> pack(list_to_binary(List)); pack(Bin) when binary(Bin) -> acc_pack(Bin, <<>>). acc_pack(<>, Acc) -> acc_pack(T, <>); acc_pack(Bin, Acc) -> <>. unpack(Bin) when binary(Bin) -> dec(Bin, [], <<>>). %% base-64 encoding: take 6 bits at a time from the head of the binary %% and emit it as 8 bit characters. enc(<>) -> AA = int_to_b64(A), BB = int_to_b64(B), CC = int_to_b64(C), DD = int_to_b64(D), <>; enc(<>) -> AA = int_to_b64(A), BB = int_to_b64(B), CC = int_to_b64(C bsl 2), <>; enc(<>) -> AA = int_to_b64(A), BB = int_to_b64(B bsl 4), <>; enc(<<>>) -> <<>>. %% Decoding. Works by consuming groups of 4 input characters to create %% a group of 3 output characters, with the three special-cases for %% end-of-input first: dec(<<>>, [], Acc) -> Acc; dec(<<>>, [R,Q,P], Acc) -> <>; dec(<<>>, [Q,P], Acc) -> <>; dec(Bin, [S,R,Q,P], Acc) -> dec(Bin, [], <>); dec(<>, List, Acc) -> case b64_to_int(A) of ignore -> dec(T, List, Acc); Sixbits -> dec(T, [Sixbits|List], Acc) end. b64_to_int(X) when X >= $A, X =< $Z -> X - $A; b64_to_int(X) when X >= $a, X =< $z -> X - $a + 26; b64_to_int(X) when X >= $0, X =< $9 -> X - $0 + 52; b64_to_int($+) -> 62; b64_to_int($/) -> 63; b64_to_int(_) -> ignore. int_to_b64(X) when X >= 0, X =< 25 -> X + $A; int_to_b64(X) when X >= 26, X =< 51 -> X - 26 + $a; int_to_b64(X) when X >= 52, X =< 61 -> X - 52 + $0; int_to_b64(62) -> $+; int_to_b64(63) -> $/. %%---------------------------------------------------------------------- Warning: earlier versions of R7A, possibly including the one on the erlang.org site have a bug in the binary syntax which causes the wrong clause to be chosen in some cases. The above mime decoder avoids the bug. If your erlang has the bug, clause:test() will return multi_byte_binary: -module(clause). -export([test/0, f/1]). test() -> A = list_to_binary([1]), <> = A, f(A). f(<>) -> single_byte_binary; f(<>) -> multi_byte_binary. From Sean.Hinde@REDACTED Mon Sep 25 20:04:33 2000 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 25 Sep 2000 19:04:33 +0100 Subject: base64 encoding using the new binary syntax Message-ID: <402DD461F109D411977E0008C791C312565175@imp02mbx.one2one.co.uk> Mattias, > Since the binary syntax is here now, maybe people are interested in > exploring its performance characteristics. Here's something to start > the discussion. Performance of the attached module when en(de)coding > rfc2045.txt (71kb) on my 167MHz ultrasparc: Running the profiler (using rfc2719 - 48kB) on my laptop has the following result: 16> eprof:analyse(). FUNCTION CALLS TIME ****** Process <0.56.0> -- 100 % of profiled time *** bitbase64:enc/1 17116 51 % bitbase64:acc_pack/2 901 30 % bitbase64:int_to_b64/1 64862 19 % eprof:call/4 1 0 % bitbase64:pack/1 1 0 % Total time: 1.60 Measurement overhead: 1.06 ok I think this means that per call: acc_pack/1 takes 0.179 mS enc/1 takes 0.016 ms int_to_b64 takes 0.00158 mS All acc_pack is doing is splitting a binary and joining another so this does seem a little excessive... Rgds, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Sean.Hinde@REDACTED Mon Sep 25 21:37:37 2000 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 25 Sep 2000 20:37:37 +0100 Subject: base64 encoding using the new binary syntax Message-ID: <402DD461F109D411977E0008C791C312565176@imp02mbx.one2one.co.uk> Some more observations: If in the shell you do: 74> A=lists:duplicate(40000,3). [3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3|...] 75> B=list_to_binary(A). <<3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3|... 40000 bytes>> 76> <>. <<3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3|... 80000 bytes>> 77> A++A. [3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3|...] <> visibly takes ages but A++A. returns immediately! Also: 79> io:format("~p",[<>]). <<3>>ok OR 80> io:format("~p",[B]). <<3>>ok doesn't look very correct. Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From aba3600@REDACTED Tue Sep 26 02:35:27 2000 From: aba3600@REDACTED (Andy with Recycled Electrons) Date: Mon, 25 Sep 2000 19:35:27 -0500 (CDT) Subject: Random # Generator in Erlang? Message-ID: Is there a random number generator in Erlang? Has anyone written one? Sincerely, Andy Allen Recycled Electrons email: andy@REDACTED From andrew@REDACTED Tue Sep 26 05:33:41 2000 From: andrew@REDACTED (Andrew Wallace) Date: Tue, 26 Sep 2000 14:33:41 +1100 Subject: Random # Generator in Erlang? References: Message-ID: <39D01915.A86803E8@lodbroker.com> see http://www.erlang.org/doc/r7a/lib/stdlib-1.9/doc/html/random.html Andy with Recycled Electrons wrote: > > Is there a random number generator in Erlang? > > Has anyone written one? > > Sincerely, > > Andy Allen > Recycled Electrons > email: andy@REDACTED From bjorn@REDACTED Tue Sep 26 10:47:41 2000 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 26 Sep 2000 10:47:41 +0200 Subject: base64 encoding using the new binary syntax In-Reply-To: Matthias.Lang@ericsson.com's message of "Mon, 25 Sep 2000 19:00:59 +0200 (MET DST)" References: <14799.33995.877332.239830@gargle.gargle.HOWL> Message-ID: The bit syntax as currently implemented always copies binaries in construction expressions such as: <> It is actually faster to construct lists of binaries and use list_to_binary/1 to combine them. For an example, see my version of the mime module below. /Bjorn > Hi, > > About a year ago there was some discussion on the erlang list (or > maybe it was an internal Ericsson discussion) about base64 encoding > (as used in MIME) using the binary syntax. > > Since the binary syntax is here now, maybe people are interested in > exploring its performance characteristics. Here's something to start > the discussion. Performance of the attached module when en(de)coding > rfc2045.txt (71kb) on my 167MHz ultrasparc: > > Erlang bitsyntax unix 'mimencode' program > ------------------------------------------------------------------- > encoding: 1.07 s 0.045s > decoding: 10.2 s 0.035s > > The 20x slowdown on encoding looks familiar ;-). I haven't > investigated why the decoding is so much slower, I'd guess there's an > equivalent but uglier and faster approach. > > Matthias -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? -module(mime2). -export([pack/1, unpack/1]). pack(List) when list(List) -> pack(list_to_binary(List)); pack(Bin) when binary(Bin) -> acc_pack(Bin, []). acc_pack(<>, Acc) -> acc_pack(T, [Acc,enc(Bin),$\n]); acc_pack(Bin, Acc) -> list_to_binary([Acc,enc(Bin),$\n]). unpack(Bin) when binary(Bin) -> list_to_binary(dec(Bin)). %% base-64 encoding: take 6 bits at a time from the head of the binary %% and emit it as 8 bit characters. enc(Bin) -> list_to_binary(enc1(Bin)). enc1(<>) -> AA = int_to_b64(A), BB = int_to_b64(B), CC = int_to_b64(C), DD = int_to_b64(D), [AA, BB, CC, DD| enc1(T)]; enc1(<>) -> AA = int_to_b64(A), BB = int_to_b64(B), CC = int_to_b64(C bsl 2), [AA, BB, CC, $=]; enc1(<>) -> AA = int_to_b64(A), BB = int_to_b64(B bsl 4), [AA, BB, $=, $=]; enc1(<<>>) -> []. %% Decoding. Works by consuming groups of 4 input characters to create %% a group of 3 output characters, with the three special-cases for %% end-of-input first: dec(Bin) -> dec(512, Bin, [], []). dec(0, Bin, List, Acc) -> dec(512, Bin, List, [list_to_binary(Acc)]); dec(N, <<>>, [], Acc) -> Acc; dec(N, <<>>, [R,Q,P], Acc) -> [Acc|<>]; dec(N, <<>>, [Q,P], Acc) -> [Acc|<>]; dec(N, Bin, [S,R,Q,P], Acc) -> dec(N-1, Bin, [], [Acc|<>]); dec(N, <>, List, Acc) -> case b64_to_int(A) of ignore -> dec(N, T, List, Acc); Sixbits -> dec(N, T, [Sixbits|List], Acc) end. b64_to_int(X) when X >= $A, X =< $Z -> X - $A; b64_to_int(X) when X >= $a, X =< $z -> X - $a + 26; b64_to_int(X) when X >= $0, X =< $9 -> X - $0 + 52; b64_to_int($+) -> 62; b64_to_int($/) -> 63; b64_to_int(_) -> ignore. int_to_b64(X) when X >= 0, X =< 25 -> X + $A; int_to_b64(X) when X >= 26, X =< 51 -> X - 26 + $a; int_to_b64(X) when X >= 52, X =< 61 -> X - 52 + $0; int_to_b64(62) -> $+; int_to_b64(63) -> $/. Matthias.Lang@REDACTED writes: > Hi, > > About a year ago there was some discussion on the erlang list (or > maybe it was an internal Ericsson discussion) about base64 encoding > (as used in MIME) using the binary syntax. > > Since the binary syntax is here now, maybe people are interested in > exploring its performance characteristics. Here's something to start > the discussion. Performance of the attached module when en(de)coding > rfc2045.txt (71kb) on my 167MHz ultrasparc: > > Erlang bitsyntax unix 'mimencode' program > ------------------------------------------------------------------- > encoding: 1.07 s 0.045s > decoding: 10.2 s 0.035s > > The 20x slowdown on encoding looks familiar ;-). I haven't > investigated why the decoding is so much slower, I'd guess there's an > equivalent but uglier and faster approach. > > Matthias > > (I appreciate that a port program or a linked-in driver is a better > approach if speed is crucial. That's not the point here.) > > %% Base 64 encoder/decoder. See RFC2045 > -module(mime). > -export([pack/1, unpack/1]). > > pack(List) when list(List) -> > pack(list_to_binary(List)); > > pack(Bin) when binary(Bin) -> > acc_pack(Bin, <<>>). > > acc_pack(<>, Acc) -> > acc_pack(T, <>); > > acc_pack(Bin, Acc) -> > <>. > > unpack(Bin) when binary(Bin) -> > dec(Bin, [], <<>>). > > %% base-64 encoding: take 6 bits at a time from the head of the binary > %% and emit it as 8 bit characters. > > enc(<>) -> > AA = int_to_b64(A), > BB = int_to_b64(B), > CC = int_to_b64(C), > DD = int_to_b64(D), > <>; > > enc(<>) -> > AA = int_to_b64(A), > BB = int_to_b64(B), > CC = int_to_b64(C bsl 2), > <>; > > enc(<>) -> > AA = int_to_b64(A), > BB = int_to_b64(B bsl 4), > <>; > > enc(<<>>) -> <<>>. > > %% Decoding. Works by consuming groups of 4 input characters to create > %% a group of 3 output characters, with the three special-cases for > %% end-of-input first: > > dec(<<>>, [], Acc) -> Acc; > dec(<<>>, [R,Q,P], Acc) -> <>; > dec(<<>>, [Q,P], Acc) -> <>; > > dec(Bin, [S,R,Q,P], Acc) -> dec(Bin, [], <>); > > dec(<>, List, Acc) -> > case b64_to_int(A) of > ignore -> dec(T, List, Acc); > Sixbits -> dec(T, [Sixbits|List], Acc) > end. > > b64_to_int(X) when X >= $A, X =< $Z -> X - $A; > b64_to_int(X) when X >= $a, X =< $z -> X - $a + 26; > b64_to_int(X) when X >= $0, X =< $9 -> X - $0 + 52; > b64_to_int($+) -> 62; > b64_to_int($/) -> 63; > b64_to_int(_) -> ignore. > > int_to_b64(X) when X >= 0, X =< 25 -> X + $A; > int_to_b64(X) when X >= 26, X =< 51 -> X - 26 + $a; > int_to_b64(X) when X >= 52, X =< 61 -> X - 52 + $0; > int_to_b64(62) -> $+; > int_to_b64(63) -> $/. > > > %%---------------------------------------------------------------------- > Warning: earlier versions of R7A, possibly including the one on the > erlang.org site have a bug in the binary syntax which causes the wrong > clause to be chosen in some cases. The above mime decoder avoids the > bug. If your erlang has the bug, clause:test() will return multi_byte_binary: > > -module(clause). > -export([test/0, f/1]). > > test() -> > A = list_to_binary([1]), > <> = A, > f(A). > > f(<>) -> single_byte_binary; > f(<>) -> multi_byte_binary. > From bjorn@REDACTED Tue Sep 26 10:52:29 2000 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 26 Sep 2000 10:52:29 +0200 Subject: base64 encoding using the new binary syntax In-Reply-To: Sean Hinde's message of "Mon, 25 Sep 2000 20:37:37 +0100" References: <402DD461F109D411977E0008C791C312565176@imp02mbx.one2one.co.uk> Message-ID: Sean Hinde writes: > Some more observations: > > If in the shell you do: > > 74> A=lists:duplicate(40000,3). > [3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3|...] > 75> B=list_to_binary(A). > <<3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3|... 40000 > bytes>> > 76> <>. > <<3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3|... 80000 > bytes>> > 77> A++A. > [3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3|...] > > <> visibly takes ages but A++A. returns immediately! The evaluation of bit syntax expressions in the shell is done in pure Erlang. Actually it converts the binaries to lists of bits, combines and converts the resulting list of bits to a binary. We might optimise this a little in R8. In compiled code, the expression <> will evaluate much faster than in the shell, but list_to_binary([B|B]) is somewhat faster. > > Also: > > 79> io:format("~p",[<>]). > <<3>>ok This is a bug that has been corrected in R7B. /Bjorn -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From dgud@REDACTED Tue Sep 26 12:52:49 2000 From: dgud@REDACTED (Dan Gudmundsson) Date: Tue, 26 Sep 2000 12:52:49 +0200 (MET DST) Subject: mnemosyne:string_to_handle() unpleasantness In-Reply-To: <14793.602.2484.601487@bathory.tradeum.com> References: <14793.602.2484.601487@bathory.tradeum.com> Message-ID: <14800.32769.395083.599486@gargle.gargle.HOWL> Hi I have looked a little at your problems, since it is an undocumented function, we don't support it, or put any effort to keep them working. It seems that the functionality broke when we optimized mnemosyne a bit, You can try to change it back with the following diff in mnemosyne_lc.erl: 654,655c658,663 < {mk_call(?MODULE, the_query, [{Pattern0,Goal0,S#s{mquery=[]}}], Line), < S1}; --- > MkGetRecDefs = fun() -> > {call,0,{atom,0,'MNEMOSYNE RULE'}, > [erl_parse:abstract({data,record_defs})]} > end, > S_temp = S#s{mquery=[],options=[],recdefs=MkGetRecDefs}, > {mk_call(?MODULE, the_query, [{Pattern0,Goal0,S_temp}], Line), S1}; I don't know if it works, but it's one of the changes that happend, during the time. /Dan stephen.wight@REDACTED writes: > > I would like to compose a list comprehension query in a non-Erlang > environment and pass the query clause as a string to mnemosyne. > > I'm unable to use the "undocumented" string_to_handle() function > without getting an error from erl_parse:normalize(), which is reported > by mnemosyne:setup_query(). > > I'm testing this with a trivial LC query embedded in a function - > note my two alternative query construction methods for debugging; > this is to verify that the same LC compiles and runs correctly > when used 'normally': > > evalq() -> > Q = mnemosyne:string_to_handle("query [X || X <- table(atable)] end."), > %% Q = query [X || X <- table(atable)] end, > > case mnesia:transaction(fun() -> mnemosyne:eval(Q) end) of > {aborted, Err} -> > io:format("transaction aborted ~n", []), > Err; > {atomic, QueryResult} -> > io:format("query result ~n", []), > QueryResult; > _ -> > false > end. > > > The error object being returned looks like this: > > 21> mntools:evalq(). > transaction aborted > {function_clause,[{mnemosyne,setup_query, > [{'EXIT',{function_clause, > [{erl_parse, > normalise, > [{call, > 0, > {atom,0,'MNEMOSYNE RULE'}, > [{tuple,0,[{...}|...]}]}]}, > {erl_parse,normalise_list,1}, > {erl_parse,normalise,1}, > {erl_parse,normalise_list,1}, > {erl_parse,normalise,1}, > {mnemosyne_lc, > '-one_lc_to_handle/1-fun-1-', > 2}, > {lists,foldl,3}, > {mnemosyne_lc,one_lc_to_handle,1}| > more]}}]}, > {mnemosyne,cursor,2}, > {mnemosyne,eval,1}, > {mnesia_tm,apply_fun,2}, > {mnesia_tm,execute_transaction,4}, > {mntools,evalq,0}, > {erl_eval,expr,3}, > {erl_eval,exprs,4}| > more]} > > > Thanks for any help or suggestions for an alternative route to > get this done!! > > -steve wight > > > > -- Dan Gudmundsson Project: Mnesia, Erlang/OTP Ericsson Utvecklings AB Phone: +46 8 727 5762 UAB/F/P Mobile: +46 70 519 9469 S-125 25 Stockholm Visit addr: Armborstv 1 From thantos@REDACTED Tue Sep 26 13:51:22 2000 From: thantos@REDACTED (Alexander Williams) Date: Tue, 26 Sep 2000 07:51:22 -0400 Subject: Dissapearance of hash()? Message-ID: <20000926075122.A2560@gw.total-web.net> OK, here I am, hacking through Erlang's _Concurrent Programming in Erlang_ (an excellent book, I add), and it goes into extolling the virtues of hash(). Being an earnest student, I try it ... No go, at least in the shell of R7A. Am I not catching that it moved to a STDLIB library? (I really need an overall index for the whole of the Erlang online documentation ... I keep butting my head into references I just can't seem to chase down well. Surely someone can write a little program to merge the current indices, right? ;)) -- Alexander Williams (thantos@REDACTED) | In the End, "Blue Jester needs food." | Oblivion "Blue Jester needs fuku-wearing cuties." | Always http://www.chancel.org | Wins From Sean.Hinde@REDACTED Tue Sep 26 14:19:29 2000 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 26 Sep 2000 13:19:29 +0100 Subject: Dissapearance of hash()? Message-ID: <402DD461F109D411977E0008C791C31256517B@imp02mbx.one2one.co.uk> You can find all (most) BIFs in the docs for the erlang module. So hash/2 is found as erlang:hash/2 Sean > -----Original Message----- > From: Alexander Williams [mailto:thantos@REDACTED] > Sent: 26 September 2000 12:51 > To: erlang-questions@REDACTED > Subject: Dissapearance of hash()? > > > OK, here I am, hacking through Erlang's _Concurrent Programming in > Erlang_ (an excellent book, I add), and it goes into extolling the > virtues of hash(). Being an earnest student, I try it ... > > No go, at least in the shell of R7A. > > Am I not catching that it moved to a STDLIB library? (I really need > an overall index for the whole of the Erlang online documentation > ... I keep butting my head into references I just can't seem to chase > down well. Surely someone can write a little program to merge the > current indices, right? ;)) > > -- > Alexander Williams (thantos@REDACTED) | In the End, > "Blue Jester needs food." | Oblivion > "Blue Jester needs fuku-wearing cuties." | Always > http://www.chancel.org | Wins > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From thantos@REDACTED Tue Sep 26 14:42:11 2000 From: thantos@REDACTED (Alexander Williams) Date: Tue, 26 Sep 2000 08:42:11 -0400 Subject: Dissapearance of hash()? In-Reply-To: <402DD461F109D411977E0008C791C31256517B@imp02mbx.one2one.co.uk>; from Sean.Hinde@one2one.co.uk on Tue, Sep 26, 2000 at 01:19:29PM +0100 References: <402DD461F109D411977E0008C791C31256517B@imp02mbx.one2one.co.uk> Message-ID: <20000926084211.A3189@gw.total-web.net> On Tue, Sep 26, 2000 at 01:19:29PM +0100, Sean Hinde wrote: > You can find all (most) BIFs in the docs for the erlang module. So hash/2 is > found as erlang:hash/2 Hmmmmm ... hash/2 is callable as erlang:hash/2 ... but an m(erlang) doesn't show hash amongst the exports of the module. Minor bug? -- Alexander Williams (thantos@REDACTED) | In the End, "Blue Jester needs food." | Oblivion "Blue Jester needs fuku-wearing cuties." | Always http://www.chancel.org | Wins From Sean.Hinde@REDACTED Tue Sep 26 14:47:34 2000 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 26 Sep 2000 13:47:34 +0100 Subject: Dissapearance of hash()? Message-ID: <402DD461F109D411977E0008C791C31256517D@imp02mbx.one2one.co.uk> I asked this as well one some time ago. The answer is that BIFs do not show up with m(). Try m(ets) and see how much you get. The reason seems to be simply that m/1 calls module_info in the compiled beam file which only knows about what has been compiled in there. Sean > -----Original Message----- > From: Alexander Williams [mailto:thantos@REDACTED] > Sent: 26 September 2000 13:42 > To: Sean Hinde > Cc: erlang-questions@REDACTED > Subject: Re: Dissapearance of hash()? > > > On Tue, Sep 26, 2000 at 01:19:29PM +0100, Sean Hinde wrote: > > You can find all (most) BIFs in the docs for the erlang > module. So hash/2 is > > found as erlang:hash/2 > > Hmmmmm ... hash/2 is callable as erlang:hash/2 ... but an m(erlang) > doesn't show hash amongst the exports of the module. Minor bug? > > -- > Alexander Williams (thantos@REDACTED) | In the End, > "Blue Jester needs food." | Oblivion > "Blue Jester needs fuku-wearing cuties." | Always > http://www.chancel.org | Wins > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Matthias.Lang@REDACTED Tue Sep 26 17:17:19 2000 From: Matthias.Lang@REDACTED (Matthias.Lang@REDACTED) Date: Tue, 26 Sep 2000 17:17:19 +0200 (MET DST) Subject: base64 encoding using the new binary syntax In-Reply-To: References: <14799.33995.877332.239830@gargle.gargle.HOWL> Message-ID: <14800.48639.619977.775358@gargle.gargle.HOWL> Bjorn Gustavsson writes: > The bit syntax as currently implemented always copies binaries > in construction expressions such as: > > <> Interesting. Maybe it'd be useful to add a few lines to the online manual (http://www.erlang.org/doc/r7a/doc/extensions/part_frame.html) about performance---I'd been assuming that all the assertions made in Tony and Klacke's original paper were true, e.g. they guarantee O(1) concatenation. Now that I think about it, I remember someone saying that "segmented binaries" hadn't been implemented, so I should have known. So, I think it's now something like: Operation big-O Notes ---------------------------------------------------------------------- <>. O(M + N) i.e. it copies <> = X. O(M + N) if this also copies, otherwise O(1) <<_:N/binary, B:M/binary>> = X. O(M) just guessing, O(1) if the above is <> = X. O(N) just guessing, ditto The other thing which might be worth mentioning in the "what was dropped" section is case-insensitve string matching. Updated performance: Matthias bitsyntax Bj?rn bitsyntax 'mimencode' program ------------------------------------------------------------------- encoding: 1.07 s 0.33s 0.045s decoding: 10.2 s 0.75s 0.035s That seems reasonable. Matthias From Michelle.Burns@REDACTED Tue Sep 26 17:29:57 2000 From: Michelle.Burns@REDACTED (Michelle Burns) Date: Tue, 26 Sep 2000 17:29:57 +0200 Subject: Bad Arg Message-ID: <39D0C0F5.639F3E40@etx.ericsson.se> Hello, I am working with MPLS on the AXD301 and I get the following error "Bad Type" when I try to write to a mnesia table: (mich@REDACTED)295> mnesia:dirty_write(lsp_xconnect,{lsp_xconnect,{[10,10,10,10],1,[20,20,20,20],2},1,2,3}). ** exited: {aborted,{bad_type,{lsp_xconnect, {"\n\n\n\n",1,[20,20,20,20],2}, 1, 2, 3}}} ** I register the mnesia table at initialisation with a four tuple Key: ok = rcmI:create_mnesia_table(lsp_xconnect, [{disc_copies,base}], [{type,set}, {snmp, [{key, {fix_string, % incipaddr integer, % inclabel fix_string, % outgipaddr integer % outglabel }}]}, {attributes, record_info(fields, lsp_xconnect)}]). My lsp_xconnect record is defined: -record(lsp_xconnect, {%% cross connection for provisioned lsps key_tuple, %% {IncIpAddr, IncLabel, OutgIpAddr, OutgLabel} traff_descr=0, %% defaults to TdIndex of 0 (best effort) lsp_name, %% string admin_status }). Could you please help to explain why this error occurs. As far as I can see, I am using the correct key ? Thanks, Michelle From bjorn@REDACTED Tue Sep 26 18:15:53 2000 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 26 Sep 2000 18:15:53 +0200 Subject: base64 encoding using the new binary syntax In-Reply-To: Matthias.Lang@ericsson.com's message of "Tue, 26 Sep 2000 17:17:19 +0200 (MET DST)" References: <14799.33995.877332.239830@gargle.gargle.HOWL> <14800.48639.619977.775358@gargle.gargle.HOWL> Message-ID: Matthias.Lang@REDACTED writes: > Bjorn Gustavsson writes: > > > The bit syntax as currently implemented always copies binaries > > in construction expressions such as: > > > > <> > > Interesting. Maybe it'd be useful to add a few lines to the online > manual (http://www.erlang.org/doc/r7a/doc/extensions/part_frame.html) > about performance---I'd been assuming that all the assertions made in > Tony and Klacke's original paper were true, e.g. they guarantee O(1) > concatenation. Now that I think about it, I remember someone saying > that "segmented binaries" hadn't been implemented, so I should have known. There are some information about performance issues in the bit syntax documentation in R7B. > > So, I think it's now something like: > > Operation big-O Notes > ---------------------------------------------------------------------- > <>. O(M + N) i.e. it copies Correct. > <> = X. O(M + N) if this also copies, otherwise O(1) In matching, byte-aligned binaries are not copied. They are split using a sub binary. The sub binary object contains a reference to the original binary, the starting position in it and the length. Non-aligned binaries as in <<_:3, A:N/binary, _:5>> = X, A. are copied into a new binary. (There will be no copy if A is not used later in the function.) > <<_:N/binary, B:M/binary>> = X. O(M) just guessing, O(1) if the above is > <> = X. O(N) just guessing, ditto Yes, O(1). Actually, as your examples are written, neither A nor B will be used after the match, so no sub binaries will be created. Basically your examples just verify that size(X) == N+M > > The other thing which might be worth mentioning in the "what was > dropped" section is case-insensitve string matching. > > Updated performance: > > Matthias bitsyntax Bj?rn bitsyntax 'mimencode' program > ------------------------------------------------------------------- > encoding: 1.07 s 0.33s 0.045s > decoding: 10.2 s 0.75s 0.035s The difference between our versions will increase if you run it on larger files. > > That seems reasonable. > > Matthias > /Bjorn -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From Michelle.Burns@REDACTED Tue Sep 26 18:40:49 2000 From: Michelle.Burns@REDACTED (Michelle Burns) Date: Tue, 26 Sep 2000 18:40:49 +0200 Subject: Bad Arg References: <39D0C0F5.639F3E40@etx.ericsson.se> Message-ID: <39D0D191.1390A501@etx.ericsson.se> Hello again! I worked out the problem. I had recomplied one of the modules with a new version of my header file, where had I added a new field to the record lsp_xconnect. Hence, there was a record definition inconsistency. / Michelle Michelle Burns wrote: > > Hello, > > I am working with MPLS on the AXD301 and I get the following error "Bad > Type" > when I try to write to a mnesia table: > > (mich@REDACTED)295> > mnesia:dirty_write(lsp_xconnect,{lsp_xconnect,{[10,10,10,10],1,[20,20,20,20],2},1,2,3}). > ** exited: {aborted,{bad_type,{lsp_xconnect, > {"\n\n\n\n",1,[20,20,20,20],2}, > 1, > 2, > 3}}} ** > > I register the mnesia table at initialisation with a four tuple Key: > > ok = rcmI:create_mnesia_table(lsp_xconnect, > [{disc_copies,base}], > [{type,set}, > {snmp, [{key, {fix_string, % incipaddr > integer, % inclabel > fix_string, % outgipaddr > integer % outglabel > }}]}, > {attributes, > record_info(fields, lsp_xconnect)}]). > > My lsp_xconnect record is defined: > > -record(lsp_xconnect, > {%% cross connection for provisioned lsps > key_tuple, %% {IncIpAddr, IncLabel, OutgIpAddr, > OutgLabel} > traff_descr=0, %% defaults to TdIndex of 0 (best effort) > lsp_name, %% string > admin_status > }). > > Could you please help to explain why this error occurs. As far as I can > see, I am using > the correct key ? > > Thanks, > Michelle From dne@REDACTED Tue Sep 26 23:38:11 2000 From: dne@REDACTED (Daniel Neri) Date: 26 Sep 2000 23:38:11 +0200 Subject: Bad Arg In-Reply-To: Michelle Burns's message of "Tue, 26 Sep 2000 18:40:49 +0200" References: <39D0C0F5.639F3E40@etx.ericsson.se> <39D0D191.1390A501@etx.ericsson.se> Message-ID: <87pulqomv0.fsf@nowhere.mayonnaise.net> Michelle Burns writes: > I worked out the problem. I had recomplied one of the modules with a > new version of my header file, where had I added a new field to the > record lsp_xconnect. Hence, there was a record definition > inconsistency. Makes you wish for something beyond the current preprocessor "hack" (as I was told it was in the first place)... Regards, --Daniel -- Daniel Neri dne@REDACTED From sgelkins@REDACTED Wed Sep 27 04:11:54 2000 From: sgelkins@REDACTED (Steve Elkins) Date: Tue, 26 Sep 2000 22:11:54 -0400 Subject: Mnesia test suite tweak Message-ID: <39D1576A.48CF40F2@bellsouth.net> Hi, In case other novices stumble over this, the Mnesia test suite mentioned in 7.4 of the FAQ... http://www.ericsson.se/cslab/~hakan/mnesia_test_3.8.2.tgz ...has a very small problem in the 1st suggested test, 'silly'. As written, Config goes into a nested list, like... [[{nodes, Nodes}]] ...and silly2 (invoked from silly) fails to run. Removing the extra []s makes mt:t(silly) run to completion, or until the 5 minute timer expires. Regards, Steve --------8<-------->8-------- sge:90$ diff -c mnesia_install_test.erl.ORIG mnesia_install_test.erl *** mnesia_install_test.erl.ORIG Mon Sep 25 22:31:03 2000 --- mnesia_install_test.erl Tue Sep 26 06:30:28 2000 *************** *** 54,60 **** Nodes = [node()] ++ nodes(), mnesia_test_lib:kill_mnesia(Nodes), Config = [{nodes, Nodes}], ! mnesia_test_lib:eval_test_case(?MODULE, silly2, [Config]). silly2(Config) when list(Config) -> [Node1 | _] = Nodes = ?acquire_nodes(3, Config), --- 54,60 ---- Nodes = [node()] ++ nodes(), mnesia_test_lib:kill_mnesia(Nodes), Config = [{nodes, Nodes}], ! mnesia_test_lib:eval_test_case(?MODULE, silly2, Config). silly2(Config) when list(Config) -> [Node1 | _] = Nodes = ?acquire_nodes(3, Config), sge:91$ From etxuwig@REDACTED Wed Sep 27 09:29:40 2000 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 27 Sep 2000 09:29:40 +0200 (MET DST) Subject: handling partitioned networks Message-ID: I read Sean Hinde's EUC2000 report -- good stuff! There was a passage in there about the problems with partitioned networks. I agree, this is a very tough nut to crack. I will describe some of the things we've done at AXD 301 to address this problem: 1. We have a fully redundant system with N mated pairs at the Erlang level. 2. The first mated pair, termed the base pair, runs the O&M functionality; if both of these nodes crash, the system is considered to be down; these nodes also have the mnesia schema on disk. 3. All other nodes have a ram copy of the schema (using mnesia's 'extra_db_nodes' variable); if they lose contact with both base nodes, they will restart. 4. We have implemented a patch to net_kernel, which is supported by OTP (in R5B and R7B as I understand it): "-kernel dist_auto_connect once" will allow nodes to automatically connect only one time (happens when the "second" node starts up), but as soon as communication fails, one of the nodes will have to restart for communication to be re-established (there is a possibility to explicitly connect as well, but we don't use that) 5. (4) is combined with a "backdoor" system, where a process on each node periodically sends a UDP "alive" message to all other (statically known) nodes; upon receipt of an "alive" message from a node which is not in the nodes() list, one can conclude that the network has been partitioned. Through the same UDP connection, the nodes can negotiate who should restart. 6. Mnesia has a "master nodes" concept, where one can specify a set of nodes from which the tables should unconditionally be loaded. When a node restarts to resolve inconsistency, it will set master nodes to the other nodes known to be good at the time. 7. There is a possibility of table load deadlock, where two nodes cannot decide who has the most recent copies. To detect this, we have a process calling mnesia:wait_for_tables/2 early in the startup phase. The table wait processes on each node send messages to each other upon each wait_for_tables() timeout, performing a WFG analysis to determine whether nodes are waiting for each other. This is not air tight (I think), because nodes can go down or come up late during the table load phase and mess things up, but I think we cover most possible events. Actually, I think most of this could be implemented in a fairly generic way. The part that needs to be customized for a particular system is mainly the logic deciding who should restart to resolve a partitioned network situation. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Network Architecture & Product Strategies mob: +46 70 519 81 95 Ericsson Telecom AB, Datacom Networks and IP Services Varuv?gen 9, ?lvsj?, S-126 25 Stockholm, Sweden From hakan@REDACTED Wed Sep 27 10:19:59 2000 From: hakan@REDACTED (Hakan Mattsson) Date: Wed, 27 Sep 2000 10:19:59 +0200 (MET DST) Subject: Mnesia test suite tweak In-Reply-To: <39D1576A.48CF40F2@bellsouth.net> Message-ID: On Tue, 26 Sep 2000, Steve Elkins wrote: Steve> In case other novices stumble over this, the Mnesia test suite Steve> mentioned in 7.4 of the FAQ... Steve> Steve> http://www.ericsson.se/cslab/~hakan/mnesia_test_3.8.2.tgz Steve> Steve> ...has a very small problem in the 1st suggested test, 'silly'. Steve> As written, Config goes into a nested list, like... Steve> Steve> [[{nodes, Nodes}]] Steve> Steve> ...and silly2 (invoked from silly) fails to run. Removing the Steve> extra []s makes mt:t(silly) run to completion, or until the 5 Steve> minute timer expires. Thanks, for pointing this "silly" error out. A newer version of the test suite (whithout that particular error) is now available at: http://www.ericsson.se/cslab/~hakan/mnesia_test_3.9.2.tgz It matches Mnesia 3.9.2, newly released in Erlang/OTP R7A. /H?kan --- H?kan Mattsson Ericsson Computer Science Laboratory http://www.ericsson.se/cslab/~hakan From Sean.Hinde@REDACTED Wed Sep 27 12:47:34 2000 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Wed, 27 Sep 2000 11:47:34 +0100 Subject: handling partitioned networks Message-ID: <402DD461F109D411977E0008C791C312565189@imp02mbx.one2one.co.uk> Uffe, Thanks for the info - it is a tough nut no doubt about it. My system uses all disc based tables so I'm not sure a scheme like you use in AXD301 will quite fit. In eddie they have some mechanism which tries to work out islands of nodes which have been partitioned and then set_master_nodes and restart some of the smaller groups. Again this doesn't seem appropriate for my system which has pairs of redundant nodes holding persistent data. I my case I shouldn't have lost too much data during a partitioned network outage so better tools to manually bring the whole thing back up in parallel without getting into deadlocks would be very useful.. e.g. set_master_nodes only seems to kick in if the nodes still detect they are partitioned, it would be useful to be able to force a table/schema load from another node regardless of the perceived status. I have also seen research on schemes where logs are kept during partitioned network outages and on startup the nodes negotiate conflicts and work themselves back into a consistent state but this is pretty mindbending stuff. I'll think some more about each of your mechanisms. Thanks and Rgds, Sean > -----Original Message----- > From: Ulf Wiger [mailto:etxuwig@REDACTED] > Sent: 27 September 2000 08:30 > To: erlang-questions@REDACTED > Subject: handling partitioned networks > > > > I read Sean Hinde's EUC2000 report -- good stuff! > > There was a passage in there about the problems with partitioned > networks. I agree, this is a very tough nut to crack. > > I will describe some of the things we've done at AXD 301 to > address this problem: > > 1. We have a fully redundant system with N mated pairs at the > Erlang level. > > 2. The first mated pair, termed the base pair, runs the O&M > functionality; if both of these nodes crash, the system is > considered to be down; these nodes also have the mnesia > schema on disk. > > 3. All other nodes have a ram copy of the schema (using mnesia's > 'extra_db_nodes' variable); if they lose contact with both > base nodes, they will restart. > > 4. We have implemented a patch to net_kernel, which is supported > by OTP (in R5B and R7B as I understand it): > "-kernel dist_auto_connect once" will allow nodes to automatically > connect only one time (happens when the "second" node starts up), > but as soon as communication fails, one of the nodes will have > to restart for communication to be re-established (there is a > possibility to explicitly connect as well, but we don't use that) > > 5. (4) is combined with a "backdoor" system, where a process on > each node periodically sends a UDP "alive" message to all > other (statically known) nodes; upon receipt of an "alive" > message from a node which is not in the nodes() list, one can > conclude that the network has been partitioned. Through the > same UDP connection, the nodes can negotiate who should restart. > > 6. Mnesia has a "master nodes" concept, where one can specify a > set of nodes from which the tables should unconditionally be > loaded. When a node restarts to resolve inconsistency, it will > set master nodes to the other nodes known to be good at the time. > > 7. There is a possibility of table load deadlock, where two nodes > cannot decide who has the most recent copies. To detect this, > we have a process calling mnesia:wait_for_tables/2 early in > the startup phase. The table wait processes on each node > send messages to each other upon each wait_for_tables() timeout, > performing a WFG analysis to determine whether nodes are > waiting for each other. This is not air tight (I think), because > nodes can go down or come up late during the table load phase > and mess things up, but I think we cover most possible events. > > > Actually, I think most of this could be implemented in a fairly > generic way. The part that needs to be customized for a particular > system is mainly the logic deciding who should restart to resolve a > partitioned network situation. > > /Uffe > -- > Ulf Wiger tfn: +46 8 719 81 95 > Network Architecture & Product Strategies mob: +46 70 519 81 95 > Ericsson Telecom AB, Datacom Networks and IP Services > Varuv?gen 9, ?lvsj?, S-126 25 Stockholm, Sweden > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Nils.N.Flemstrom@REDACTED Wed Sep 27 13:13:36 2000 From: Nils.N.Flemstrom@REDACTED (Nils.N.Flemstrom@REDACTED) Date: Wed, 27 Sep 2000 13:13:36 +0200 Subject: Erlang and IPv6 Message-ID: Hi, I'm working on making a server(Erlang) to support IPv6. I have come to the conclusion that Erlang today don't support IPv6(not gen_tcp or gen_udp). I suppose I could use ports and use socket communication outside Erlang. Anyone who has a better suggestion? Nils Flemstr?m, Sweden. From etxuwig@REDACTED Wed Sep 27 14:26:16 2000 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 27 Sep 2000 14:26:16 +0200 (MET DST) Subject: make of OTP applications Message-ID: It's bugged me for quite some time that there isn't good make support for .app files. The different steps that should be taken each time, and which should be automated, are: - Verify that the .app file is syntactically correct - Verify that the 'modules' listing includes all modules in the ebin/ directory - Verify that the 'vsn' attribute corresponds to the app version suffix in the filename. The attached shellscript does the above, assuming that your template app file has been named .appSrc, and has placeholders for 'id', 'vsn', and 'modules'. Example, ccviewer.appSrc: {application, ccviewer, [{description, "Web-Based ClearCase browser tool"}, {id, "&id&"}, {vsn, "&vsn&"}, {modules, "&modules&"}, ...]}. The script can surely be improved. For one thing, it should probably not be a sequence of Erlang commands piped into an Erlang shell, but that was my quick-and-dirty approach. I thought I'd share it with you anyway. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Network Architecture & Product Strategies mob: +46 70 519 81 95 Ericsson Telecom AB, Datacom Networks and IP Services Varuv?gen 9, ?lvsj?, S-126 25 Stockholm, Sweden -------------- next part -------------- A non-text attachment was scrubbed... Name: app_make.sh Type: application/x-sh Size: 1100 bytes Desc: app_make.sh URL: From tony@REDACTED Wed Sep 27 15:16:46 2000 From: tony@REDACTED (Tony Rogvall) Date: Wed, 27 Sep 2000 15:16:46 +0200 Subject: Erlang and IPv6 References: Message-ID: <39D1F33E.3EED6774@bluetail.com> Nils.N.Flemstrom@REDACTED wrote: > Hi, > > I'm working on making a server(Erlang) to support IPv6. I have come to > the conclusion that Erlang today don't support IPv6(not gen_tcp or > gen_udp). I suppose I could use ports and use socket communication > outside Erlang. Anyone who has a better suggestion? > > Nils Flemstr?m, Sweden. Erlang DO support IPv6 and has done so for several year. We even had the FIRST web server running on the IPv6 test network :-) The status is that the OTP group does not update the ipv6 modules since there are no real request for it. But here is the updated modules you need for running R7 on top of IPv6. To run distributed erlang on IPv6 you write: erl -[s]name -proto_dist inet6_tcp To use ipv6 for gen_tcp in a "normal" system you write gen_tcp:connect(IP, Port, [{tcp_module,inet6_tcp} | Opts]). Or you set the default tcp_module in your local .inetrc file (I do not think this feature is documented) All of this stuff of course requires a kernel that supports IPv6 ! (not default on linux) Please give me some feedback on progress .... Regards -- /Tony -------------- next part -------------- %% ``The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved via the world wide web at http://www.erlang.org/. %% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. %% %% The Initial Developer of the Original Code is Ericsson Utvecklings AB. %% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings %% AB. All Rights Reserved.'' %% %% $Id$ %% -module(inet6_tcp). -export([connect/3, connect/4, listen/2, accept/1, accept/2, close/1]). -export([send/2, recv/2, recv/3, unrecv/2]). -export([controlling_process/2]). -export([fdopen/2]). -export([getserv/1, getaddr/1, getaddr/2, getaddrs/1, getaddrs/2]). -include("inet_int.hrl"). %% inet_tcp port lookup getserv(Port) when integer(Port) -> {ok, Port}; getserv(Name) when atom(Name) -> inet:getservbyname(Name,tcp). %% inet_tcp address lookup getaddr(Address) -> inet:getaddr(Address, inet6). getaddr(Address,Timer) -> inet:getaddr_tm(Address, inet6, Timer). %% inet_tcp address lookup getaddrs(Address) -> inet:getaddrs(Address, inet6). getaddrs(Address,Timer) -> inet:getaddrs_tm(Address,inet6,Timer). %% %% Send data on a socket %% send(Socket, Packet) -> prim_inet:send(Socket, Packet). %% %% Receive data from a socket (inactive only) %% recv(Socket, Length) -> prim_inet:recv(Socket, Length). recv(Socket, Length, Timeout) -> prim_inet:recv(Socket, Length, Timeout). unrecv(Socket, Data) -> prim_inet:unrecv(Socket, Data). %% %% Close a socket (async) %% close(Socket) -> inet:tcp_close(Socket). %% %% Set controlling process %% FIXE ME: move messages to new owner!!! %% controlling_process(Socket, NewOwner) -> inet:tcp_controlling_process(Socket, NewOwner). %% %% Connect %% connect(Address, Port, Opts) -> do_connect(Address, Port, Opts, infinity). connect(Address, Port, Opts, infinity) -> do_connect(Address, Port, Opts, infinity); connect(Address, Port, Opts, Timeout) when integer(Timeout), Timeout >= 0 -> do_connect(Address, Port, Opts, Timeout). do_connect(Addr = {A,B,C,D,E,F,G,H}, Port, Opts, Time) when ?ip6(A,B,C,D,E,F,G,H), integer(Port) -> case inet:connect_options(Opts, inet6) of {error, Reason} -> exit(Reason); {ok, R} -> Fd = R#connect_opts.fd, BAddr = R#connect_opts.ifaddr, BPort = R#connect_opts.port, SockOpts = R#connect_opts.opts, case inet:open(Fd,BAddr,BPort,SockOpts,stream,inet6,?MODULE) of {ok, S} -> case prim_inet:connect(S, Addr, Port, Time) of ok -> {ok,S}; Error -> prim_inet:close(S), Error end; Error -> Error end end. %% %% Listen %% listen(Port, Opts) when Port >= 0, Port =< 16#ffff -> case inet:listen_options([{port,Port} | Opts], inet6) of {error, Reason} -> exit(Reason); {ok, R} -> Fd = R#listen_opts.fd, BAddr = R#listen_opts.ifaddr, BPort = R#listen_opts.port, SockOpts = R#listen_opts.opts, case inet:open(Fd,BAddr,BPort,SockOpts,stream,inet6,?MODULE) of {ok, S} -> case prim_inet:listen(S, R#listen_opts.backlog) of ok -> {ok, S}; Error -> prim_inet:close(S), Error end; Error -> Error end end. %% %% Accept %% accept(L) -> case prim_inet:accept(L) of {ok, S} -> inet_db:register_socket(S, ?MODULE), {ok,S}; Error -> Error end. accept(L,Timeout) -> case prim_inet:accept(L,Timeout) of {ok, S} -> inet_db:register_socket(S, ?MODULE), {ok,S}; Error -> Error end. %% %% Create a port/socket from a file descriptor %% fdopen(Fd, Opts) -> inet:fdopen(Fd, Opts, stream, inet6, ?MODULE). -------------- next part -------------- %% ``The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved via the world wide web at http://www.erlang.org/. %% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. %% %% The Initial Developer of the Original Code is Ericsson Utvecklings AB. %% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings %% AB. All Rights Reserved.'' %% %% $Id$ %% -module(inet6_tcp_dist). %% Handles the connection setup phase with other Erlang nodes. -export([listen/1, accept/1, accept_connection/5, setup/5, close/1, select/1, is_node_name/1]). %% internal exports -export([accept_loop/2,do_accept/6,do_setup/6, getstat/1,tick/1]). -import(error_logger,[error_msg/2]). -include("net_address.hrl"). -define(to_port(Socket, Data), case inet6_tcp:send(Socket, Data) of {error, closed} -> self() ! {tcp_closed, Socket}, {error, closed}; R -> R end). -include("dist.hrl"). -include("dist_util.hrl"). -record(tick, {read = 0, write = 0, tick = 0, ticked = 0 }). %% ------------------------------------------------------------ %% Select this protocol based on node name %% select(Node) => Bool %% ------------------------------------------------------------ select(Node) -> case split_node(atom_to_list(Node), $@, []) of [_, Host] -> case inet:getaddr(Host,inet6) of {ok,_} -> true; _ -> false end; _ -> false end. %% ------------------------------------------------------------ %% Create the listen socket, i.e. the port that this erlang %% node is accessible through. %% ------------------------------------------------------------ listen(Name) -> case inet6_tcp:listen(0, [{active, false}, {packet,2}]) of {ok, Socket} -> TcpAddress = get_tcp_address(Socket), {_,Port} = TcpAddress#net_address.address, {ok, Creation} = erl_epmd:register_node(Name, Port), {ok, {Socket, TcpAddress, Creation}}; Error -> Error end. %% ------------------------------------------------------------ %% Accepts new connection attempts from other Erlang nodes. %% ------------------------------------------------------------ accept(Listen) -> spawn_link(?MODULE, accept_loop, [self(), Listen]). accept_loop(Kernel, Listen) -> process_flag(priority, max), case inet6_tcp:accept(Listen) of {ok, Socket} -> Kernel ! {accept,self(),Socket,inet,tcp}, controller(Kernel, Socket), accept_loop(Kernel, Listen); Error -> exit(Error) end. controller(Kernel, Socket) -> receive {Kernel, controller, Pid} -> flush_controller(Pid, Socket), inet6_tcp:controlling_process(Socket, Pid), flush_controller(Pid, Socket), Pid ! {self(), controller}; {Kernel, unsupported_protocol} -> exit(unsupported_protocol) end. flush_controller(Pid, Socket) -> receive {tcp, Socket, Data} -> Pid ! {tcp, Socket, Data}, flush_controller(Pid, Socket); {tcp_closed, Socket} -> Pid ! {tcp_closed, Socket}, flush_controller(Pid, Socket) after 0 -> ok end. %% ------------------------------------------------------------ %% Accepts a new connection attempt from another Erlang node. %% Performs the handshake with the other side. %% ------------------------------------------------------------ accept_connection(AcceptPid, Socket, MyNode, Allowed, SetupTime) -> spawn_link(?MODULE, do_accept, [self(), AcceptPid, Socket, MyNode, Allowed, SetupTime]). do_accept(Kernel, AcceptPid, Socket, MyNode, Allowed, SetupTime) -> process_flag(priority, max), receive {AcceptPid, controller} -> Timer = dist_util:start_timer(SetupTime), case check_ip(Socket) of true -> HSData = #hs_data{ kernel_pid = Kernel, this_node = MyNode, socket = Socket, timer = Timer, this_flags = ?DFLAG_PUBLISHED bor ?DFLAG_ATOM_CACHE bor ?DFLAG_EXTENDED_REFERENCES bor ?DFLAG_DIST_MONITOR bor ?DFLAG_FUN_TAGS bor ?DFLAG_DIST_MONITOR_NAME, allowed = Allowed, f_send = fun(S,D) -> inet6_tcp:send(S,D) end, f_recv = fun(S,N,T) -> inet6_tcp:recv(S,N,T) end, f_setopts_pre_nodeup = fun(S) -> inet:setopts(S, [{active, false}, {packet, 4}, nodelay()]) end, f_setopts_post_nodeup = fun(S) -> inet:setopts(S, [{active, true}, {deliver, port}, {packet, 4}, nodelay()]) end, f_getll = fun(S) -> inet:getll(S) end, f_address = fun get_remote_id/2, mf_tick = {?MODULE, tick}, mf_getstat = {?MODULE,getstat} }, dist_util:handshake_other_started(HSData); {false,IP} -> error_msg("** Connection attempt from " "disallowed IP ~w ** ~n", [IP]), ?shutdown(no_node) end end. %% we may not always want the nodelay behaviour %% for performance reasons nodelay() -> case application:get_env(kernel, dist_nodelay) of undefined -> {nodelay, true}; {ok, true} -> {nodelay, true}; {ok, false} -> {nodelay, false}; _ -> {nodelay, true} end. %% ------------------------------------------------------------ %% Get remote information about a Socket. %% ------------------------------------------------------------ get_remote_id(Socket, Node) -> {ok, Address} = inet:peername(Socket), [_, Host] = split_node(atom_to_list(Node), $@, []), #net_address { address = Address, host = Host, protocol = tcp, family = inet6 }. %% ------------------------------------------------------------ %% Setup a new connection to another Erlang node. %% Performs the handshake with the other side. %% ------------------------------------------------------------ setup(Node, Type, MyNode, LongOrShortNames,SetupTime) -> spawn_link(?MODULE, do_setup, [self(), Node, Type, MyNode, LongOrShortNames, SetupTime]). do_setup(Kernel, Node, Type, MyNode, LongOrShortNames,SetupTime) -> process_flag(priority, max), ?trace("~p~n",[{inet_tcp_dist,self(),setup,Node}]), [Name, Address] = splitnode(Node, LongOrShortNames), case inet:getaddr(Address, inet6) of {ok, Ip} -> Timer = dist_util:start_timer(SetupTime), case erl_epmd:port_please(Name, Ip) of {port, TcpPort, Version} -> ?trace("port_please(~p) -> version ~p~n", [Node,Version]), dist_util:reset_timer(Timer), case inet6_tcp:connect(Ip, TcpPort, [{active, false}, {packet,2}]) of {ok, Socket} -> PubFlag = if Type == hidden -> 0; true -> ?DFLAG_PUBLISHED end, HSData = #hs_data{ kernel_pid = Kernel, other_node = Node, this_node = MyNode, socket = Socket, timer = Timer, this_flags = PubFlag bor ?DFLAG_ATOM_CACHE bor ?DFLAG_EXTENDED_REFERENCES bor ?DFLAG_DIST_MONITOR bor ?DFLAG_FUN_TAGS bor ?DFLAG_DIST_MONITOR_NAME, other_version = Version, f_send = fun(S,D) -> inet6_tcp:send(S,D) end, f_recv = fun(S,N,T) -> inet6_tcp:recv(S,N,T) end, f_setopts_pre_nodeup = fun(S) -> inet:setopts (S, [{active, false}, {packet, 4}, nodelay()]) end, f_setopts_post_nodeup = fun(S) -> inet:setopts (S, [{active, true}, {deliver, port}, {packet, 4}, nodelay()]) end, f_getll = fun(S) -> inet:getll(S) end, f_address = fun(_,_) -> #net_address { address = {Ip,TcpPort}, host = Address, protocol = tcp, family = inet} end, mf_tick = {?MODULE, tick}, mf_getstat = {?MODULE,getstat} }, dist_util:handshake_we_started(HSData); _ -> %% Other Node may have closed since %% port_please ! ?trace("other node (~p) " "closed since port_please.~n", [Node]), ?shutdown(Node) end; _ -> ?trace("port_please (~p) " "failed.~n", [Node]), ?shutdown(Node) end; Other -> ?trace("inet_getaddr(~p) " "failed (~p).~n", [Node,Other]), ?shutdown(Node) end. %% %% Close a socket. %% close(Socket) -> inet6_tcp:close(Socket). %% If Node is illegal terminate the connection setup!! splitnode(Node, LongOrShortNames) -> case split_node(atom_to_list(Node), $@, []) of [Name|Tail] when Tail /= [] -> Host = lists:append(Tail), case split_node(Host, $., []) of [_] when LongOrShortNames == longnames -> error_msg("** System running to use " "fully qualified " "hostnames **~n" "** Hostname ~s is illegal **~n", [Host]), ?shutdown(Node); L when length(L) > 1, LongOrShortNames == shortnames -> error_msg("** System NOT running to use fully qualified " "hostnames **~n" "** Hostname ~s is illegal **~n", [Host]), ?shutdown(Node); _ -> [Name, Host] end; [_] -> error_msg("** Nodename ~p illegal, no '@' character **~n", [Node]), ?shutdown(Node); _ -> error_msg("** Nodename ~p illegal **~n", [Node]), ?shutdown(Node) end. split_node([Chr|T], Chr, Ack) -> [lists:reverse(Ack)|split_node(T, Chr, [])]; split_node([H|T], Chr, Ack) -> split_node(T, Chr, [H|Ack]); split_node([], _, Ack) -> [lists:reverse(Ack)]. %% ------------------------------------------------------------ %% Fetch local information about a Socket. %% ------------------------------------------------------------ get_tcp_address(Socket) -> {ok, Address} = inet:sockname(Socket), {ok, Host} = inet:gethostname(), #net_address { address = Address, host = Host, protocol = tcp, family = inet6 }. %% ------------------------------------------------------------ %% Do only accept new connection attempts from nodes at our %% own LAN, if the check_ip environment parameter is true. %% ------------------------------------------------------------ check_ip(Socket) -> case application:get_env(check_ip) of {ok, true} -> case get_ifs(Socket) of {ok, IFs, IP} -> check_ip(IFs, IP); _ -> ?shutdown(no_node) end; _ -> true end. get_ifs(Socket) -> case inet:peername(Socket) of {ok, {IP, _}} -> case inet:getif(Socket) of {ok, IFs} -> {ok, IFs, IP}; Error -> Error end; Error -> Error end. check_ip([{OwnIP, _, Netmask}|IFs], PeerIP) -> case {mask(Netmask, PeerIP), mask(Netmask, OwnIP)} of {M, M} -> true; _ -> check_ip(IFs, PeerIP) end; check_ip([], PeerIP) -> {false, PeerIP}. mask({M1,M2,M3,M4,M5,M6,M7,M8}, {IP1,IP2,IP3,IP4,IP5,IP6,IP7,IP8}) -> {M1 band IP1, M2 band IP2, M3 band IP3, M4 band IP4, M5 band IP5, M6 band IP6, M7 band IP7, M8 band IP8 }. is_node_name(Node) when atom(Node) -> case split_node(atom_to_list(Node), $@, []) of [_, Host] -> true; _ -> false end; is_node_name(Node) -> false. tick(Sock) -> ?to_port(Sock,[]). getstat(Socket) -> case inet:getstat(Socket, [recv_cnt, send_cnt, send_pend]) of {ok, Stat} -> split_stat(Stat,0,0,0); Error -> Error end. split_stat([{recv_cnt, R}|Stat], _, W, P) -> split_stat(Stat, R, W, P); split_stat([{send_cnt, W}|Stat], R, _, P) -> split_stat(Stat, R, W, P); split_stat([{send_pend, P}|Stat], R, W, _) -> split_stat(Stat, R, W, P); split_stat([], R, W, P) -> {ok, R, W, P}. -------------- next part -------------- %% ``The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved via the world wide web at http://www.erlang.org/. %% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. %% %% The Initial Developer of the Original Code is Ericsson Utvecklings AB. %% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings %% AB. All Rights Reserved.'' %% %% $Id$ %% -module(inet6_udp). -export([open/1, open/2, close/1]). -export([send/2, send/4, recv/2, recv/3, connect/3]). -export([controlling_process/2]). -export([fdopen/2]). -export([getserv/1, getaddr/1, getaddr/2]). -include("inet_int.hrl"). %% inet_udp port lookup getserv(Port) when integer(Port) -> {ok, Port}; getserv(Name) when atom(Name) -> inet:getservbyname(Name,udp). %% inet_udp address lookup getaddr(Address) -> inet:getaddr(Address, inet6). getaddr(Address,Timer) -> inet:getaddr(Address, inet6, Timer). open(Port) -> open(Port, []). open(Port, Opts) when Port >= 0, Port =< 16#ffff -> case inet:udp_options([{port,Port} | Opts], inet6) of {error, Reason} -> exit(Reason); {ok, R} -> Fd = R#udp_opts.fd, BAddr = R#udp_opts.ifaddr, BPort = R#udp_opts.port, SockOpts = R#udp_opts.opts, inet:open(Fd,BAddr,BPort,SockOpts,dgram,inet,?MODULE) end. send(S, Addr = {A,B,C,D,E,F,G,H},P,Data) when ?ip6(A,B,C,D,E,F,G,H),P>=0,P=<16#ffff -> prim_inet:sendto(S, Addr, P, Data). send(S, Data) -> prim_inet:sendto(S, {0,0,0,0,0,0,0,0}, 0, Data). connect(S, Addr = {A,B,C,D,E,F,G,H}, P) when ?ip6(A,B,C,D,E,F,G,H), P>=0, P=<16#ffff-> prim_inet:connect(S, Addr, P). recv(S,Len) -> prim_inet:recvfrom(S, Len). recv(S,Len,Time) -> prim_inet:recvfrom(S, Len, Time). close(S) -> inet:udp_close(S). %% %% Set controlling process: %% 1) First sync socket into a known state %% 2) Move all messages onto the new owners message queue %% 3) Commit the owner %% 4) Wait for ack of new Owner (since socket does some link and unlink) %% controlling_process(Socket, NewOwner) -> inet:udp_controlling_process(Socket, NewOwner). %% %% Create a port/socket from a file descriptor %% fdopen(Fd, Opts) -> inet:fdopen(Fd, Opts, dgram, inet6, ?MODULE). -------------- next part -------------- A non-text attachment was scrubbed... Name: tony.vcf Type: text/x-vcard Size: 352 bytes Desc: Card for Tony Rogvall URL: From ja@REDACTED Wed Sep 27 16:11:33 2000 From: ja@REDACTED (Juan A. Suárez Romero) Date: Wed, 27 Sep 2000 16:11:33 +0200 Subject: Mobile code in Erlang Message-ID: <00092716125602.00745@aliana.dc.fi.udc.es> Hi, I'm interesting in a module that allow me to write mobile code in Erlang. Specially, I need a function "move_to (Node)" able to move the current process to another node. The function should work like this: .... 4> node (). mynode@REDACTED 5> mobile:move_to ("newnode@REDACTED"). true. 6> node (). newnode@REDACTED .... Somebody knows a module (or a function) like I need? Thanks in advance J.A. ---------- Dept. of Computer Science University of A Corunna (Spain) From etxuwig@REDACTED Wed Sep 27 16:25:14 2000 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 27 Sep 2000 16:25:14 +0200 (MET DST) Subject: Mobile code in Erlang In-Reply-To: <00092716125602.00745@aliana.dc.fi.udc.es> Message-ID: A couple of quick comments: 1. The OTP function most similar to this today is application takeover. IOW, if you model your processes in an OTP application, you can migrate the application to another node. 2. It is your responsibility to make sure that exactly the same code is running on both nodes. In practice, if you use (1), the OTP boot scripts should also be, if not identical, at least well coordinated. 3. Performing takeover on demand using the stock OTP application controller is perhaps not as flexible as you'd want (see erl -man application), but it is possible to write your own distributed part of the application_controller. We've done this at AXD 301, based on an initial prototype by Martin Bj?rklund. This is non-trivial to say the least. If you want to embark on this, I'll be happy to provide some hints, if not working example code. 4. You can write your own progress migration support. Basically, you'll want to start a new process on newnode and instruct it to fetch its state from its mate at mynode; fetching state is easily done through e.g. a gen_server call. 5. Dan Sahlin and Lawrie Brown have led some very interesting research called "Safe Erlang", which would solve several issues with mobile code (http://www.adfa.oz.au/~lpb/research/sserl/). /Uffe On Wed, 27 Sep 2000, Juan A. Su?rez Romero wrote: >Hi, >I'm interesting in a module that allow me to write mobile code in Erlang. >Specially, I need a function "move_to (Node)" able to move the current process >to another node. > >The function should work like this: > >.... >4> node (). >mynode@REDACTED >5> mobile:move_to ("newnode@REDACTED"). >true. >6> node (). >newnode@REDACTED >.... > >Somebody knows a module (or a function) like I need? Thanks in advance > > J.A. > >---------- >Dept. of Computer Science >University of A Corunna (Spain) > > -- Ulf Wiger tfn: +46 8 719 81 95 Network Architecture & Product Strategies mob: +46 70 519 81 95 Ericsson Telecom AB, Datacom Networks and IP Services Varuv?gen 9, ?lvsj?, S-126 25 Stockholm, Sweden From vladdu@REDACTED Wed Sep 27 22:11:09 2000 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Wed, 27 Sep 2000 22:11:09 +0200 Subject: mobile processes Message-ID: The question raised earlier today made me think about the topic, and there is one detail I wonder about: the actual move of a process/application to another node is not a big problem. Not with Erlang, anyway... But how do already running linked clients switch to the new node, unless they expect and can handle this move? In a perfect world, the move would be transparent to the clients... Are there any solutions that I overlooked? regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From stimuli@REDACTED Thu Sep 28 04:03:06 2000 From: stimuli@REDACTED (Jeffrey Straszhiem) Date: Wed, 27 Sep 2000 22:03:06 -0400 Subject: mobile processes In-Reply-To: References: Message-ID: <20000927220306.A1101@bzzt.shadow.net> On Wed, Sep 27, 2000 at 10:11:09PM +0200, Vlad Dumitrescu wrote: > the actual move of a process/application to another node is not a > big problem. Not with Erlang, anyway... But how do already running > linked clients switch to the new node, unless they expect and can > handle this move? In a perfect world, the move would be transparent > to the clients... Are there any solutions that I overlooked? Look at the module `global' (in kernel), particularly the functions `register_name', `re_register_name', and `send'. If you adopt a policy of using these for all acceses to the server, then things should work fine when you move it. -- -- Jeffrey Straszheim | A sufficiently advanced -- Systems Engineer, Programmer | regular expression is -- http://www.shadow.net/~stimuli | indistinguishable from -- stimuli AT shadow DOT net | magic From aba3600@REDACTED Thu Sep 28 04:44:43 2000 From: aba3600@REDACTED (Andy with Recycled Electrons) Date: Wed, 27 Sep 2000 21:44:43 -0500 (CDT) Subject: Fun, fun, Funs? Message-ID: Hi... I'm trying to write a procedure to map a fun down a list... Can anyone tell me how this differs from the book? -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 215: f(Num, Mean) -> (Num - Mean)*(Num - Mean). 216: 217: Sub = fun f/1. 218: % 219: 220: getVariance(List) 221: % 222: % 223: -> 224: sumList( lists:map(Sub, List) ). -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- I get errors: ./poedt.erl:217: syntax error before: Sub ./poedt.erl:224: variable 'Sub' is unbound ./poedt.erl:224: function sumList/1 undefined -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Sincerely, Andy Allen Recycled Electrons email: andy@REDACTED From etxuwig@REDACTED Thu Sep 28 08:01:31 2000 From: etxuwig@REDACTED (Ulf Wiger) Date: Thu, 28 Sep 2000 08:01:31 +0200 (MET DST) Subject: Fun, fun, Funs? In-Reply-To: Message-ID: On Wed, 27 Sep 2000, Andy with Recycled Electrons wrote: >Hi... > >I'm trying to write a procedure to map a fun down a list... > >Can anyone tell me how this differs from the book? > >-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- >215: f(Num, Mean) -> (Num - Mean)*(Num - Mean). >216: >217: Sub = fun f/1. Line 217 is an assignment standing on its own betwen functions. This is not legal. Move this assignment into the getVariance/1 function. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Network Architecture & Product Strategies mob: +46 70 519 81 95 Ericsson Telecom AB, Datacom Networks and IP Services Varuv?gen 9, ?lvsj?, S-126 25 Stockholm, Sweden From tobbe@REDACTED Thu Sep 28 08:14:39 2000 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 28 Sep 2000 08:14:39 +0200 Subject: Fun, fun, Funs? References: Message-ID: A little example, from the Erlang shell: 8:07> erl Erlang (BEAM) emulator version 5.0 [source] Eshell V5.0 (abort with ^G) 1> F=fun(X) -> X*2 end. #Fun 2> lists:map(F, [1,2,3,4]). [2,4,6,8] 3> F2=fun(X,Acc) -> X+Acc end. #Fun 4> lists:foldl(F2, 0, [1,2,3,4]). 10 5> F3=fun(X,Acc) -> {X*2,X+Acc} end. #Fun 6> lists:mapfoldl(F3, 0, [1,2,3,4]). {[2,4,6,8],10} In a file you would have to write something like: double_list(X) when list(X) -> F = fun(X) -> X*2 end, lists:map(F,X). Cheers /Tobbe From tobbe@REDACTED Thu Sep 28 08:22:27 2000 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 28 Sep 2000 08:22:27 +0200 Subject: Fun, fun, Funs? In-Reply-To: Torbjorn Tornkvist's message of "28 Sep 2000 08:14:39 +0200" References: Message-ID: Perhaps I should add that this example will give a compiler warning since the 'X' in '..fun(X)..' will shadow the 'X' in 'double_list(X)...'. Here is an example which don't give you a Warning. double_list(L) when list(L) -> F = fun(X) -> X*2 end, lists:map(F,L). /Tobbe From tony@REDACTED Thu Sep 28 09:30:13 2000 From: tony@REDACTED (Tony Rogvall) Date: Thu, 28 Sep 2000 09:30:13 +0200 Subject: mobile processes References: Message-ID: <39D2F385.7A5D19B7@bluetail.com> Vlad Dumitrescu wrote: > The question raised earlier today made me think about the topic, and > there is one detail I wonder about: the actual move of a > process/application to another node is not a big problem. Not with > Erlang, anyway... But how do already running linked clients switch to > the new node, unless they expect and can handle this move? In a > perfect world, the move would be transparent to the clients... Are > there any solutions that I overlooked? regards,Vlad The problem with relinking to the original node is solvable, but need some system updates. I think that even to move any process (not only gen_servers and the like) is (nearly) solvable. One problem arise when you have stored local information in the process i.e Node = node(), then today the Node variable will contain an atom that is not easy to rewrite. An other problem is when you sent the process id to processes on other nodes. When the original node goes down there is no one on the original node to do message "redirects". I have seen solutions where you can query the network (broadcasts) for new locations and store translations at the senders. For WAN like networks it is not that easy. (If you think in terms of mobile IP, there must exist a Home node to be able to respond to reregistrations of new locations!) Yet an other big problem are the ports, if we assume that the original node is up running and the distribution protocol is updated to handle remote port calls (or messages) then relinking port whould be doable as well. Moving ports is not that easy :-) If all used ports (programs/loadable drivers) where written to support a move then perhaps. In other words. In theory this is totally impossible to do in a generic way, but in practise it depends up to the application. /Tony -------------- next part -------------- A non-text attachment was scrubbed... Name: tony.vcf Type: text/x-vcard Size: 328 bytes Desc: Card for Tony Rogvall URL: From rv@REDACTED Thu Sep 28 11:18:16 2000 From: rv@REDACTED (Robert Virding) Date: Thu, 28 Sep 2000 11:18:16 +0200 Subject: Fun, fun, Funs? In-Reply-To: Your message of "Wed, 27 Sep 2000 21:44:43 CDT." Message-ID: <200009280918.LAA03041@trana.bluetail.com> Andy with Recycled Electrons writes: >Hi... > >I'm trying to write a procedure to map a fun down a list... > >Can anyone tell me how this differs from the book? > >-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- >215: f(Num, Mean) -> (Num - Mean)*(Num - Mean). >216: >217: Sub = fun f/1. >218: % >219: >220: getVariance(List) >221: % >222: % >223: -> >224: sumList( lists:map(Sub, List) ). >-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- >I get errors: >./poedt.erl:217: syntax error before: Sub >./poedt.erl:224: variable 'Sub' is unbound >./poedt.erl:224: function sumList/1 undefined >-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- The problem is that in code modules variables cannot exist outside of functions, you can only define functions. Also the function f takes two arguments so f/1 does not exist. This means you cannot apply it every element of the list as it stands. The best would be to fold the map and sumList into a fold. Robert -- Robert Virding Tel: +46 (0)8 545 55 017 Bluetail AB Email: rv@REDACTED S:t Eriksgatan 44 WWW: http://www.bluetail.com/~rv SE-112 32 Stockholm, SWEDEN "Folk s?ger att jag inte bryr mig om n?gonting, men det skiter jag i". From luc.taesch@REDACTED Thu Sep 28 14:24:55 2000 From: luc.taesch@REDACTED (luc.taesch@REDACTED) Date: Thu, 28 Sep 2000 14:24:55 +0200 Subject: No subject Message-ID: is a .app file automatically loaded when in ./ebin folder ? i start a module with erl -s mof fun arg what about an app ? should i have a module for that to do appli cation:start() ? From luc.taesch@REDACTED Thu Sep 28 14:32:07 2000 From: luc.taesch@REDACTED (luc.taesch@REDACTED) Date: Thu, 28 Sep 2000 14:32:07 +0200 Subject: sorry for the missing subject..:app Message-ID: and the receipt ack the bank default. From dgud@REDACTED Fri Sep 29 10:36:26 2000 From: dgud@REDACTED (Dan Gudmundsson) Date: Fri, 29 Sep 2000 10:36:26 +0200 (MET DST) Subject: 2D and 3D graphics in erlang Message-ID: <14804.21642.242591.141441@gargle.gargle.HOWL> Hi I have started to port sdl and opengl to erlang, the result can be found at http://www.ericsson.se/cslab/~dgud/esdl/ The opengl part is pretty complete everyting in 1.1 except the extension's is implemented. The SDL part needs more work but the basics are working. It currently runs on linux and solaris, if someone could help me with a windows build it would be great. Any patches, additions or feedback are also appreciated. /Dan From kent@REDACTED Fri Sep 29 14:35:44 2000 From: kent@REDACTED (Kent Boortz) Date: 29 Sep 2000 14:35:44 +0200 Subject: R7B Open Source Erlang available for download Message-ID: The final release R7B of the Open Source Erlang is now available for download from "http://www.erlang.org/download.html". A short summary of changes since R6 - The bit syntax, a language addition which can be used to construct binaries and to match binary patterns. - The new CORBA services cosNotification and cosTime. - The new very capable cross reference tool Xref. - The new application Comet which makes it possible to call COM objects from Erlang on the Windows platform. - A new interoperability guide whose purpose is to give the reader an orientation of the different interoperability mechanisms that can be used when integrating a program written in Erlang with a program written in another programming language, from the Erlang programmer's point of view. For more highlights, information and complete ducumentation see "http://www.erlang.org". Thank you all for the feedback given on the beta release. Some of your suggested changes may not have made it into the R7B release. They may be included in the next patch, kent