From vladdu@REDACTED Thu Mar 1 16:06:38 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Thu, 01 Mar 2001 16:06:38 +0100 Subject: More daydreaming Message-ID: Me again :-) It's strange how once the thoughts begin to wander, they aren't easy to stop. I don't think my thoughts are completely weird, and that's why I share them... hope it's okay with you :-) ------ I've been reading about Web services and peer-to-peer networking as a combination that might very well becom the next wave of hype... Now Erlang ?s very good at handling web services (more or less visible ones), and it is transparent to the programs whether there is a central server or a p2p network delivering the services... So it might be a way to get some positive effects from the hype-wave. What do you think? I don't mean riding the wave, as this is risky, but use the wake and go forward... ------- ErlangOS - hmm, I had missed the Erlang processor thing. That would be a great thing too! But having it as a desktop OS would be nice also. With some kind of bridge that will let POSIX compliant apps run as special Erlang processes, preferably. That's a project I'd like to work with for the next years! :-) that's all for now. Regards, Vlad _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. From cahill@REDACTED Thu Mar 1 17:10:36 2001 From: cahill@REDACTED (Adrian John Cahill) Date: Thu, 01 Mar 2001 16:10:36 +0000 Subject: snmp traps and snmp_mgr Message-ID: <3A9E747C.1B343E68@ocean.ucc.ie> Hi , I am trying to receive snmp traps using an erlang application. I have tried using the snmp_mgr:expect( id, any) function, this returns ok, for most of my requests, but when a trap is fired, the following is displayed in my 'erl interpreter' ** exited: {snmp_packet_got_other,{udp, #Port<0.37>, {143,239,159,221}, 1070, [48, 65, 2, 1, 1, 4, 6, 112, 117, 98, 108, 105, 99, 167, 52, 2, 1, 2, 2, 1, 0|...]}} ** Could someone shed some light on this?? Is this the trap, as i can see no correllation between this, and what should have been sent back ?? So is it an error message?? Am i not creating the trap correctly ?. I am creating the trap in a Java program / Agent . Tia Adrian From rahul@REDACTED Thu Mar 1 17:16:34 2001 From: rahul@REDACTED (Rahul Motwani) Date: Thu, 1 Mar 2001 11:16:34 -0500 Subject: Inserting records into tables Message-ID: <000001c0a26b$031370e0$c8e7cf82@blackbird.eecom.gatech.edu> hi I have been trying to insert records into a table, but have been unsuccessful in doing so. I am following the same example of the Company Database that is given in the Mnesia documantation. I follow all the steps. But when i try to insert a new record into the table "employee" ...the transaction aborts with {aborted, {no_exists, TableName}}. Please could you tell me if i need to do anything else, before i go ahead and try to populate the tables. Sincerely Rahul Motwani -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chandrashekhar.Mullaparthi@REDACTED Thu Mar 1 17:22:53 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Thu, 1 Mar 2001 16:22:53 -0000 Subject: snmp traps and snmp_mgr Message-ID: <402DD461F109D411977E0008C791C312039199B7@imp02mbx.one2one.co.uk> This is because snmp_mgr will only receive traps from one agent only. This is the agent you would have specified in snmp_mgr:start - It can be easily extended to receive traps from multiple agents. I did it once and threw it away cos no one in EEI was interested ;) The crash you see is in the function snmp_mgr_misc:packet_loop/7 cheers, Chandru > -----Original Message----- > From: Adrian John Cahill [mailto:cahill@REDACTED] > Sent: 1 March 2001 16:11 > To: erlang-questions@REDACTED > Subject: snmp traps and snmp_mgr > > > > Hi , > I am trying to receive snmp traps using an erlang application. I > have tried using the snmp_mgr:expect( id, any) function, this returns > ok, for most of my requests, but when a trap is fired, the > following is > displayed in my 'erl interpreter' > > ** exited: {snmp_packet_got_other,{udp, > #Port<0.37>, > {143,239,159,221}, > 1070, > [48, > 65, > 2, > 1, > 1, > 4, > 6, > 112, > 117, > 98, > 108, > 105, > 99, > 167, > 52, > 2, > 1, > 2, > 2, > 1, > 0|...]}} ** > > Could someone shed some light on this?? Is this the trap, as > i can see > no correllation between this, and what should have been sent > back ?? So > is it an error message?? > > Am i not creating the trap correctly ?. I am creating the > trap in a Java > program / Agent . > > Tia Adrian > 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@REDACTED Fri Mar 2 11:55:59 2001 From: matthias@REDACTED (matthias@REDACTED) Date: Fri, 2 Mar 2001 11:55:59 +0100 (CET) Subject: cross compiling erlang for the PPC860 Message-ID: <15007.31807.532498.416141@corelatus.com> Hi, Someone (Marc? Nick? something with four letters) emailed me asking about cross compiling erlang for the PPC860. Through a combination of too much coffee and not enough sleep I managed to delete your email, so I apologise to you, and to everyone now getting spammed with my reply. Anyway, here's how I did it: http://www.corelatus.com/~matthias/erlang_on_860.html I'll put a link to it in the FAQ next time I update it. Matthias From Ciaran.Johnston@REDACTED Fri Mar 2 15:40:50 2001 From: Ciaran.Johnston@REDACTED (Ciaran Johnston) Date: Fri, 02 Mar 2001 14:40:50 +0000 Subject: snmp traps and snmp_mgr References: <402DD461F109D411977E0008C791C312039199B7@imp02mbx.one2one.co.uk> Message-ID: <3A9FB0F2.654F6981@eei.ericsson.se> Does this hold for gets and sets also? Ciaran. Chandrashekhar Mullaparthi wrote: > > This is because snmp_mgr will only receive traps from one agent only. This > is the agent you would have specified in snmp_mgr:start - It can be easily > extended to receive traps from multiple agents. I did it once and threw it > away cos no one in EEI was interested ;) > > The crash you see is in the function snmp_mgr_misc:packet_loop/7 > > cheers, > Chandru > > > -----Original Message----- > > From: Adrian John Cahill [mailto:cahill@REDACTED] > > Sent: 1 March 2001 16:11 > > To: erlang-questions@REDACTED > > Subject: snmp traps and snmp_mgr > > > > > > > > Hi , > > I am trying to receive snmp traps using an erlang application. I > > have tried using the snmp_mgr:expect( id, any) function, this returns > > ok, for most of my requests, but when a trap is fired, the > > following is > > displayed in my 'erl interpreter' > > > > ** exited: {snmp_packet_got_other,{udp, > > #Port<0.37>, > > {143,239,159,221}, > > 1070, > > [48, > > 65, > > 2, > > 1, > > 1, > > 4, > > 6, > > 112, > > 117, > > 98, > > 108, > > 105, > > 99, > > 167, > > 52, > > 2, > > 1, > > 2, > > 2, > > 1, > > 0|...]}} ** > > > > Could someone shed some light on this?? Is this the trap, as > > i can see > > no correllation between this, and what should have been sent > > back ?? So > > is it an error message?? > > > > Am i not creating the trap correctly ?. I am creating the > > trap in a Java > > program / Agent . > > > > Tia Adrian > > > > 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 vladdu@REDACTED Fri Mar 2 15:59:15 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Fri, 02 Mar 2001 15:59:15 +0100 Subject: MC68000 port Message-ID: Hi Talking about ports, has anyone tried to move Erlang to MC68000? My hidden thought is about having Erlang on my Palm thingy :-) Just think how cool it would be to have two Pilots talking over the IR! Of course, that would need a lot more work than just compiling the stuff, but it would be interesting to know how difficult it might be to just compile. regards, Vlad _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. From sam@REDACTED Fri Mar 2 17:13:32 2001 From: sam@REDACTED (Samuel Tardieu) Date: Fri, 2 Mar 2001 17:13:32 +0100 Subject: MC68000 port In-Reply-To: ; from vladdu@hotmail.com on Fri, Mar 02, 2001 at 03:59:15PM +0100 References: Message-ID: <2001-03-02-17-13-32+trackit+sam@inf.enst.fr> On 2/03, Vlad Dumitrescu wrote: | My hidden thought is about having Erlang on my Palm thingy :-) Just think | how cool it would be to have two Pilots talking over the IR! I would love to have the BEAM specification (with all the opcodes, ...). I would then volunteer to make a beam interpreter on the Palm (using Forth probably to get a very small overhead compared to C). From vladdu@REDACTED Fri Mar 2 22:20:32 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Fri, 2 Mar 2001 22:20:32 +0100 Subject: MC68000 port References: <2001-03-02-17-13-32+trackit+sam@inf.enst.fr> Message-ID: > | My hidden thought is about having Erlang on my Palm thingy :-) Just think > | how cool it would be to have two Pilots talking over the IR! > > I would love to have the BEAM specification (with all the opcodes, ...). > I would then volunteer to make a beam interpreter on the Palm (using Forth > probably to get a very small overhead compared to C). That's an interesting way of solving the interpreter, but in order to make it really work one has to provide some kind of replacement for things that aren't present in PalmOS, like for example a file system. The code module needs it, if not anything else. /Vlad From vladdu@REDACTED Fri Mar 2 22:33:17 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Fri, 2 Mar 2001 22:33:17 +0100 Subject: C nodes Message-ID: Hi This time I think I have more down-to-earth question. :-) Why can't C or Java nodes be fully equivalent to Erlang nodes? (from the point of view of an Erlang node connecting to them) /Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexis@REDACTED Sat Mar 3 00:18:35 2001 From: alexis@REDACTED (=?iso-8859-1?Q?Alexis_L=EA-Qu=F4c?=) Date: Fri, 2 Mar 2001 15:18:35 -0800 Subject: JInterface exception handling problem Message-ID: <004901c0a36f$1bd7f8d0$2700a8c0@neomeo.com> Hello, I ran into a problem using Jinterface to send a message to an erlang node, and I managed to track it down; I attached a small patch which correct an exception handling problem. In order to avoid others spending hours on the same problem, here's the how and why: I'm using a J-node to send a message using a mailbox to a node called n1@REDACTED The erlang emulator has been started with the flag -sname n1 on the machine called n1@REDACTED Thus the node will be known by erlang as n1@REDACTED This does not look really harmful of a mismatch but it actually is and the syptoms are that only one message is successfully transmitted to the erlang emulator. In OtpNode.getConnection(String node), since there is no initial connection between the two nodes, a new OtpCookedConnection will be created and added to the connection pool (of the OtpNode) with the name n1@REDACTED instead of n1@REDACTED because in AbstractConnection.receiveChallenge(...) overwrites the peer name which will be subsquently inserted into the connection pool. The new name is extracted from the erlang emulator reply. Nice side effect :-) Thus we end up having the 'connections' member of OtpNode have {'n1@REDACTED': ...}. And subsequent calls to mbox.send(n1@REDACTED, ...) will fail because it'll lookup for the full name and not notice that there is already a connection to the node. This is not quite a bug in JInterface, but detecting the problem is particularly difficult because exceptions are black-holed... That's what the patch is for. -- Alexis -------------- next part -------------- A non-text attachment was scrubbed... Name: Exception.diff Type: application/octet-stream Size: 608 bytes Desc: not available URL: From davidg@REDACTED Sat Mar 3 00:52:27 2001 From: davidg@REDACTED (David Gould) Date: Fri, 2 Mar 2001 15:52:27 -0800 Subject: MC68000 port In-Reply-To: ; from Vlad Dumitrescu on Fri, Mar 02, 2001 at 10:20:32PM +0100 References: <2001-03-02-17-13-32+trackit+sam@inf.enst.fr> Message-ID: <20010302155227.A26196@dnai.com> On Fri, Mar 02, 2001 at 10:20:32PM +0100, Vlad Dumitrescu wrote: > > | My hidden thought is about having Erlang on my Palm thingy :-) Just think > > | how cool it would be to have two Pilots talking over the IR! > > > > I would love to have the BEAM specification (with all the opcodes, ...). > > I would then volunteer to make a beam interpreter on the Palm (using Forth > > probably to get a very small overhead compared to C). > > That's an interesting way of solving the interpreter, but in order to make it really work one has to provide some kind of replacement for things that aren't present in PalmOS, like for example a file system. The code module needs it, if not anything else. I think it might be a lot more interesting to port it to Strongarm, then it could run under Linux on the iPaq and similar hardware. Another interesting idea is to use SAE to make something like busybox. Busybox is a single program that can be invoked by different names (links) and provides most of the traditional unix toolkit (ls, grep, tar etc), but is much smaller than the aggregate size of the tools it replaces. This, along with a normal Erlang node to handle networked services would give most of the functionality (except for X) of a unix system, but in Erlang, not C. So it might be missing some features, like stack smashes and rootshells, but I am willing to put up with some deficienies ;-) -dg -- David Gould davidg@REDACTED 510 536 1443 If simplicity worked, the world would be overrun with insects. From jamesh@REDACTED Sat Mar 3 00:59:00 2001 From: jamesh@REDACTED (James Hague) Date: Fri, 2 Mar 2001 17:59:00 -0600 Subject: MC68000 port Message-ID: > I would love to have the BEAM specification (with all the > opcodes, ...). > I would then volunteer to make a beam interpreter on the Palm > (using Forth > probably to get a very small overhead compared to C). I would love to see document describing the BEAM architecture, including a reference for the generic opcode set. I expect it would be fairly easy to write an emulator for a subset of BEAM. Not only would be an interesting project, but it would open the door to writing pico Erlangs for specific needs. Surely Ericsson has a BEAM write-up that could be released? James From tobbe@REDACTED Sat Mar 3 08:35:27 2001 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 03 Mar 2001 08:35:27 +0100 Subject: C nodes In-Reply-To: "Vlad Dumitrescu"'s message of "Fri, 2 Mar 2001 22:33:17 +0100" References: Message-ID: > Why can't C or Java nodes be fully equivalent to Erlang nodes? (from > the point of view of an Erlang node connecting to them) Because, some std.applications relies on that all nodes in nodes/0 behaves as a "distributed Erlang node". Cheers /Tobbe From bjorn@REDACTED Sat Mar 3 08:55:47 2001 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 03 Mar 2001 08:55:47 +0100 Subject: MC68000 port In-Reply-To: James Hague's message of "Fri, 2 Mar 2001 17:59:00 -0600" References: Message-ID: Sorry, I still haven't had any spare time to write any BEAM documentation. And, no, we have no internal documentation that we are keeping secret. According to my plans, I might have some spare time right after the R12 release. :-) However, in the R8 release, there will be an improved and extended beam_lib plus a BEAM disassembler for .beam files. (For a BEAM disassembler for loaded code, try erts_debug:df(Mod) (in R7B). A Mod.dis file will be created.) /Bjorn James Hague writes: > > I would love to have the BEAM specification (with all the > > opcodes, ...). > > I would then volunteer to make a beam interpreter on the Palm > > (using Forth > > probably to get a very small overhead compared to C). > > I would love to see document describing the BEAM architecture, including a > reference for the generic opcode set. I expect it would be fairly easy to > write an emulator for a subset of BEAM. Not only would be an interesting > project, but it would open the door to writing pico Erlangs for specific > needs. Surely Ericsson has a BEAM write-up that could be released? > > James > -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From vladdu@REDACTED Sat Mar 3 11:20:46 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Sat, 3 Mar 2001 11:20:46 +0100 Subject: C nodes References: Message-ID: > > Why can't C or Java nodes be fully equivalent to Erlang nodes? (from > > the point of view of an Erlang node connecting to them) > > Because, some std.applications relies on that all nodes in nodes/0 > behaves as a "distributed Erlang node". Can I interpret this as saying that what would be needed is a sound infrastructure for a C (or something other language) node (warranting that it will behave just like a regular Erlang node)? That might eliminate the need for many ports, since they might be implemented as full nodes... /Vlad From sam@REDACTED Sat Mar 3 11:42:43 2001 From: sam@REDACTED (Samuel Tardieu) Date: Sat, 3 Mar 2001 11:42:43 +0100 Subject: MC68000 port In-Reply-To: ; from vladdu@hotmail.com on Fri, Mar 02, 2001 at 10:20:32PM +0100 References: <2001-03-02-17-13-32+trackit+sam@inf.enst.fr> Message-ID: <2001-03-03-11-42-43+trackit+sam@inf.enst.fr> On 2/03, Vlad Dumitrescu wrote: | That's an interesting way of solving the interpreter, but in order to make | it really work one has to provide some kind of replacement for things that | aren't present in PalmOS, like for example a file system. The code module | needs it, if not anything else. A database on the Palm can be used, this is not a technical difficulty. See what ZBox does for example, a similar method can easily be used. And I'm quite confident to encounter no major difficulty in rewriting the built-in modules. From raimo@REDACTED Sat Mar 3 12:52:32 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Sat, 03 Mar 2001 12:52:32 +0100 Subject: C nodes References: , , Message-ID: <3AA0DB00.D83A4A42@erix.ericsson.se> Vlad Dumitrescu wrote: > > > > Why can't C or Java nodes be fully equivalent to Erlang nodes? (from > > > the point of view of an Erlang node connecting to them) > > > > Because, some std.applications relies on that all nodes in nodes/0 > > behaves as a "distributed Erlang node". > > Can I interpret this as saying that what would be needed is a sound infrastructure for a C (or something other language) node (warranting that it will behave just like a regular Erlang node)? That might eliminate the need for many ports, since they might be implemented as full nodes... > > /Vlad I guess so, but there is quite some things that a node must do to be a "real" erlang node. For a short list right out of the head: rpc, file, global, global_group, dist_ac, application, application_controller. There are probably a lot more. / Raimo Niskanen, Ericsson UAB, Erlang/OTP From etxuwig@REDACTED Sat Mar 3 13:42:41 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Sat, 3 Mar 2001 13:42:41 +0100 (MET) Subject: C nodes In-Reply-To: <3AA0DB00.D83A4A42@erix.ericsson.se> Message-ID: On Sat, 3 Mar 2001, Raimo Niskanen wrote: >I guess so, but there is quite some things that a node must do to be a >"real" erlang node. For a short list right out of the head: rpc, file, >global, global_group, dist_ac, application, application_controller. >There are probably a lot more. Rpc? That would probably not be required. You would only want to use rpc:call(M, F, A) if you know exactly what module is loaded on the other node - most likely that it is the very same module that is loaded in yours. File? Yes, perhaps. Global? global_group? Naah. I think these two need to be rethought anyway. After that, it might not be too impossible to include a C node in the global name space. Dist_ac? Again, you would only use that if you think you can start applications on the other node, and these are in fact the Erlang applications that you know and love. I think what is really needed is a framework for specifying distributed protocols and handling unsupported services. We may want to have this between Erlang nodes as well. In most applications so far, the networks of Erlang nodes have been pretty homogeneous, often with the very same boot script executing on all nodes. I think many will want to depart from that in the future. This is also good from another perspective: it forces us to be more formal about the traffic between nodes, and makes it easier to maintain compatibility across versions, as well as reason about real-time and robustness characteristics. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From aba3600@REDACTED Sun Mar 4 02:37:52 2001 From: aba3600@REDACTED (aba3600@REDACTED) Date: Sat, 3 Mar 2001 19:37:52 -0600 (CST) Subject: Masters Thesis Message-ID: Hi, all My Masters Thesis used Erlang heavily. It was on the subject of a new probablistic data tpye for use in robotics. I had previously (long ago) floated the idea of publishing it to this list. I got many positive responses. I now finally has all of the i's dotted and the t's crossed. It is posted at: http://www.MercuryRobot.com Sincerely, Andy Allen, M.S. Computer Science Engineering andy@REDACTED From vladdu@REDACTED Sun Mar 4 19:20:17 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Sun, 4 Mar 2001 19:20:17 +0100 Subject: C nodes References: Message-ID: > >I guess so, but there is quite some things that a node must do to be a > >"real" erlang node. For a short list right out of the head: rpc, file, > >global, global_group, dist_ac, application, application_controller. > >There are probably a lot more. > I think what is really needed is a framework for specifying > distributed protocols and handling unsupported services. We may want > to have this between Erlang nodes as well. In most applications so > far, the networks of Erlang nodes have been pretty homogeneous, often > with the very same boot script executing on all nodes. I think many > will want to depart from that in the future. I agree with Ulf here. As a matter of fact, as I see things, there are two different issues: the Erlang VM and the network/distribution mechanism. To me, they seem only loosely connected. It should be possible to completely split the two apart and then for example use something else than Erlang to actually run the code. Of course, not with the same elegance and simplicity, but the big benefit would be that ports would be replaced by true nodes and the clumsy communication mechanism with ports would be replaced by TCP/IP (as default). I think that would only add to the elegance of the system. Of course, that would lead to heterogenous networks, with nodes that might only be able to run a single process, or don't have the same modules available, but in a truly distributed world, that should be closer to the reality than not... In conclusion, is it possible (without rewriting the whole system) to separate the Erlang VM from the underlying networking runtime, and use thet runtime as a base for non-Erlang nodes? cheers, Vlad From pugliese@REDACTED Mon Mar 5 09:12:48 2001 From: pugliese@REDACTED (Rosario Pugliese) Date: Mon, 05 Mar 2001 09:12:48 +0100 Subject: PLI 2001: submission deadline is approaching Message-ID: <3AA34A80.D2607D09@dsi.unifi.it> [Apologies for multiple copies] ---------------------------------------------------------------- PLI 2001 Principles, Logics, and Implementations of high-level programming languages (Sponsored by ACM) Firenze, ITALY September 2 - 8, 2001 http://music.dsi.unifi.it/pli01/ The colloquium on Principles, Logics, and Implementations of high- level programming languages is a collection of conferences and workshops aimed at the advancement of high-level programming languages. The events composing PLI will cover a spectrum of topics important to language development and use, including issues such as semantics, design, analysis, implementation, and application. Theoretical issues relevant to language design and programming will be represented. Implementation questions will provide an emphasis on compilation methods, distributed computation and static debugging techniques. There will also be a focus on industrial and educational applications. Conferences: ICFP (September 3-5) Int. Conf. on Functional Programming General chair: Benjamin Pierce (Univ. Pennsylvania) Program chair: Xavier Leroy (INRIA Rocquencourt) PPDP (September 5-7) Int. Conf. on Principles and Practice of Declarative Programming Conference chair: Rocco De Nicola (Univ. Firenze) Program chair: Harald S?ndergaard (Univ. Melbourne) Workshops: ? Multi?language Infrastructure and Interoperability (BABEL) ? ERLANG Workshop ? Fixed Points in Computer Science (FICS) ? HASKELL Workshop ? Quantitative Aspects of Programming Languages (QAPL) ? Rule-Based Programming (RULE) ? Semantics, Applications, and Implementation of Program Generation (SAIG) ? Scheme and Functional Programming (SCHEME) ? Verification and Computational Logic (VCL) Submission deadline for ICFP and PPDP: March 15, 2001 Workshops chair: Betti Venneri (Univ. Firenze) Publicity chair: Rosario Pugliese (Univ. Firenze) Organizing Committee: Gianni Aguzzi (Univ. Firenze, co-chair), Giorgio Ghelli (Univ. Pisa, co-chair), Lorenzo Bettini (Univ. Firenze), Michele Loreti (Univ. Firenze), Dario Colazzo (Univ. Pisa) Contact Information: pli-inf@REDACTED Conference Venue: Auditorium Banca Toscana, Via Panciatichi, 87 (Firenze Nova), Firenze, ITALY From Chandrashekhar.Mullaparthi@REDACTED Mon Mar 5 09:12:26 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Mon, 5 Mar 2001 08:12:26 -0000 Subject: snmp traps and snmp_mgr Message-ID: <402DD461F109D411977E0008C791C312039199C7@imp02mbx.one2one.co.uk> Yes - it does. > -----Original Message----- > From: Ciaran Johnston [mailto:Ciaran.Johnston@REDACTED] > Sent: 2 March 2001 14:41 > To: Chandrashekhar Mullaparthi > Cc: 'Erlang mailing list'; Kenneth Browne (EEI) > Subject: Re: snmp traps and snmp_mgr > > > Does this hold for gets and sets also? > > Ciaran. > > Chandrashekhar Mullaparthi wrote: > > > > This is because snmp_mgr will only receive traps from one > agent only. This > > is the agent you would have specified in snmp_mgr:start - > It can be easily > > extended to receive traps from multiple agents. I did it > once and threw it > > away cos no one in EEI was interested ;) > > > > The crash you see is in the function snmp_mgr_misc:packet_loop/7 > > > > cheers, > > Chandru > > > > > -----Original Message----- > > > From: Adrian John Cahill [mailto:cahill@REDACTED] > > > Sent: 1 March 2001 16:11 > > > To: erlang-questions@REDACTED > > > Subject: snmp traps and snmp_mgr > > > > > > > > > > > > Hi , > > > I am trying to receive snmp traps using an erlang > application. I > > > have tried using the snmp_mgr:expect( id, any) function, > this returns > > > ok, for most of my requests, but when a trap is fired, the > > > following is > > > displayed in my 'erl interpreter' > > > > > > ** exited: {snmp_packet_got_other,{udp, > > > #Port<0.37>, > > > {143,239,159,221}, > > > 1070, > > > [48, > > > 65, > > > 2, > > > 1, > > > 1, > > > 4, > > > 6, > > > 112, > > > 117, > > > 98, > > > 108, > > > 105, > > > 99, > > > 167, > > > 52, > > > 2, > > > 1, > > > 2, > > > 2, > > > 1, > > > 0|...]}} ** > > > > > > Could someone shed some light on this?? Is this the trap, as > > > i can see > > > no correllation between this, and what should have been sent > > > back ?? So > > > is it an error message?? > > > > > > Am i not creating the trap correctly ?. I am creating the > > > trap in a Java > > > program / Agent . > > > > > > Tia Adrian > > > > > > > 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. > 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 mickael.remond@REDACTED Mon Mar 5 10:57:44 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Mon, 5 Mar 2001 10:57:44 +0100 Subject: MC68000 port In-Reply-To: <20010302155227.A26196@dnai.com>; from davidg@dnai.com on Fri, Mar 02, 2001 at 03:52:27PM -0800 References: <2001-03-02-17-13-32+trackit+sam@inf.enst.fr> <20010302155227.A26196@dnai.com> Message-ID: <20010305105744.A2285@idealx.com> David Gould (davidg@REDACTED) wrote: > On Fri, Mar 02, 2001 at 10:20:32PM +0100, Vlad Dumitrescu wrote: > I think it might be a lot more interesting to port it to Strongarm, then > it could run under Linux on the iPaq and similar hardware. We will soon start working on such a port. We are working with Linux on an iPaq computer. If people are interested, they can contact us to share our experience and to work together on the Erlang port. I expect the port to be straightforward from what I understand of the Linux iPaq port. -- Micka?l R?mond From sam@REDACTED Mon Mar 5 11:22:34 2001 From: sam@REDACTED (Samuel Tardieu) Date: Mon, 5 Mar 2001 11:22:34 +0100 Subject: MC68000 port In-Reply-To: <20010305105744.A2285@idealx.com>; from mickael.remond@IDEALX.com on Mon, Mar 05, 2001 at 10:57:44AM +0100 References: <2001-03-02-17-13-32+trackit+sam@inf.enst.fr> <20010302155227.A26196@dnai.com> <20010305105744.A2285@idealx.com> Message-ID: <2001-03-05-11-22-34+trackit+sam@inf.enst.fr> On 5/03, Mickael Remond wrote: | If people are interested, they can contact us to share our experience | and to work together on the Erlang port. A student of mine will start his Master thesis on porting Erlang on a 68300-based eCos-powered embedded system. I think we will get a lot of resources and documents on porting "beam" on embedded systems soon :) From davidg@REDACTED Mon Mar 5 13:44:43 2001 From: davidg@REDACTED (David Gould) Date: Mon, 5 Mar 2001 04:44:43 -0800 Subject: MC68000 port In-Reply-To: <20010305105744.A2285@idealx.com>; from Mickael Remond on Mon, Mar 05, 2001 at 10:57:44AM +0100 References: <2001-03-02-17-13-32+trackit+sam@inf.enst.fr> <20010302155227.A26196@dnai.com> <20010305105744.A2285@idealx.com> Message-ID: <20010305044443.A12324@dnai.com> On Mon, Mar 05, 2001 at 10:57:44AM +0100, Mickael Remond wrote: > David Gould (davidg@REDACTED) wrote: > > On Fri, Mar 02, 2001 at 10:20:32PM +0100, Vlad Dumitrescu wrote: > > I think it might be a lot more interesting to port it to Strongarm, then > > it could run under Linux on the iPaq and similar hardware. > > We will soon start working on such a port. We are working with Linux on an > iPaq computer. > If people are interested, they can contact us to share our experience > and to work together on the Erlang port. Yes, I am quite interested. I have not bought a iPaq yet, because I cannot get a blank one without WinCE in the roms, and I refuse to be counted as a WinCE sale. But, maybe there is some other Linux friendly strongarm pda, or perhaps, maybe I can call in some favors to get one for this project. > I expect the port to be straightforward from what I understand of the > Linux iPaq port. Yes indeed. As far as I know, it is "pretty much Linux". -dg -- David Gould davidg@REDACTED 510 536 1443 If simplicity worked, the world would be overrun with insects. From Sean.Hinde@REDACTED Mon Mar 5 17:25:15 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 5 Mar 2001 16:25:15 -0000 Subject: Erlang Development Environment Message-ID: <402DD461F109D411977E0008C791C312039F5E0A@imp02mbx.one2one.co.uk> Fellow Erlangers, I've read a number of suggestions for a better Erlang Development Environment than emacs.. It certainly seems we are falling behind some other languages in terms of support environment. (OCaml, Clean, Python etc). 1. Does anyone really feel the need for something better/different? 2. Is Ericsson already working on something? 3. What form should it take? 4. How could such a thing be implemented? 5. By who (ducks behind partition immediately :) )? A few random thoughts.. The shell is still really important Drop down menu to connect to the shell on any connected node OTP "Application" file layout aware project tools Nice support for versioning (maybe even forced versioning mode?) of individual files, whole applications, releases and projects(backends to rcs/clearcase/cvs) Switching between different projects (sets of applications/ files in current scope) Nice source code editor - hotlinks on function names to {find all places called from, jump to implementation}. Application/module/function tree type browser for current project scope. Nice support for building initial releases and then also generating upgrade files and relevant startup files etc Application "Wizard". Download and code loading to a bunch of test nodes. Writing this in Erlang is probably dependent on nice possibly native (?) gui support. Various approaches to this seem to be being taken: 1) Use the various gui builder tools (Glade etc) to build the gui and provide a callback mechanism into Erlang (Python does somethng like this I believe) 2) Build as much of the framework as possible in Erlang and provide a bunch of c callbacks which need to be implemented natively to "create the various widgets" and "insert text of a certain colour into this part of the editor display". This is the approcah taken by abiword http:/www.abisource.com . Here they have managed to write a wod procesor where 90% of the code is non platform specific and 10 % implements the native platform specific gui stuff (Windows, Unix, Gnome, BeOS, QNX). GS wouldn't appear to be quite up to this.. It would be a large (!) project but maybe quite a few of the parts are already out there (so to speak). Thoughts anyone? - 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 ak@REDACTED Mon Mar 5 18:00:04 2001 From: ak@REDACTED (Andi Kleen) Date: Mon, 5 Mar 2001 18:00:04 +0100 Subject: Erlang Development Environment In-Reply-To: <402DD461F109D411977E0008C791C312039F5E0A@imp02mbx.one2one.co.uk>; from Sean.Hinde@one2one.co.uk on Mon, Mar 05, 2001 at 04:25:15PM -0000 References: <402DD461F109D411977E0008C791C312039F5E0A@imp02mbx.one2one.co.uk> Message-ID: <20010305180004.A19757@gruyere.muc.suse.de> On Mon, Mar 05, 2001 at 04:25:15PM -0000, Sean Hinde wrote: > I've read a number of suggestions for a better Erlang Development > Environment than emacs.. It certainly seems we are falling behind some other > languages in terms of support environment. (OCaml, Clean, Python etc). Could you describe what you think is wrong with the emacs environment ? > It would be a large (!) project but maybe quite a few of the parts are > already out there (so to speak). As far as I can see they are either already in emacs or could be implemented there without too much work. If you want some inspiration see integrated emacs based development environments for some other languages, like the Franz Lisp emacs interface or the GNU Ada Emacs mode or the JDE Java environment. They are all nicely integrated with cross reference tools, provide easy access to interpreters, integration with debuggers and all kinds of other things. > > Thoughts anyone? I think you're trying to reinvent the wheel ;) > NOTICE AND DISCLAIMER: > This email (including attachments) is confidential. If you have received Interesting. -Andi From kent@REDACTED Mon Mar 5 18:33:17 2001 From: kent@REDACTED (Kent Boortz) Date: 05 Mar 2001 18:33:17 +0100 Subject: The update R7B-2 is released In-Reply-To: Kent Boortz's message of "03 Dec 2000 16:36:45 +0100" Message-ID: This is a bug fix release R7B-2. There is no patch that take R7B-1 up to R7B-2, you download the full source distribution http://www.erlang.org/download/otp_src_R7B-2.readme http://www.erlang.org/download/otp_src_R7B-2.tar.gz Note that there is still a configure bug that has the unfortunate effect that configure fails but it looks like a success. The "make" command will fail instead. The reason of the configure failure was that the SSL library was not found. If you have this problem you will find the line configure: error: No OpenSSL or SSLeay found in the configure output. SSL is not required to build Erlang/OTP, do % ./configure --without-ssl or find out where your SSL files are and do % ./configure --with-ssl=PATH-TO-SSL-TOP-DIR kent From kent@REDACTED Mon Mar 5 18:33:17 2001 From: kent@REDACTED (Kent Boortz) Date: 05 Mar 2001 18:33:17 +0100 Subject: The update R7B-2 is released In-Reply-To: Kent Boortz's message of "03 Dec 2000 16:36:45 +0100" Message-ID: This is a bug fix release R7B-2. There is no patch that take R7B-1 up to R7B-2, you download the full source distribution http://www.erlang.org/download/otp_src_R7B-2.readme http://www.erlang.org/download/otp_src_R7B-2.tar.gz Note that there is still a configure bug that has the unfortunate effect that configure fails but it looks like a success. The "make" command will fail instead. The reason of the configure failure was that the SSL library was not found. If you have this problem you will find the line configure: error: No OpenSSL or SSLeay found in the configure output. SSL is not required to build Erlang/OTP, do % ./configure --without-ssl or find out where your SSL files are and do % ./configure --with-ssl=PATH-TO-SSL-TOP-DIR kent From jamesh@REDACTED Mon Mar 5 18:51:00 2001 From: jamesh@REDACTED (James Hague) Date: Mon, 5 Mar 2001 11:51:00 -0600 Subject: Erlang Development Environment Message-ID: > I've read a number of suggestions for a better Erlang Development > Environment than emacs.. It certainly seems we are falling > behind some other > languages in terms of support environment. (OCaml, Clean, Python etc). > > 1. Does anyone really feel the need for something better/different? I don't feel the need for anything drastically better. I strongly dislike language implementations that depend on emacs, but I've been using Erlang under Windows (with a very simple text editor) and don't have major complaints. I can think of some smaller things: 1. A shell command for starting an external text editor. Or perhaps a way of having a failed compile start up a text editor at a certain line of code. This is easy to do, but it would be nice to have it implemented in a standard way. 2. A shell command for timing specific pieces of code. Something where you can specify a function, parameters, and the number of times to execute that function. In Lisp I'm always doing this: (time (dotimes (i 1000000) (test 0 1 2))) I don't know a simple equivalent in Erlang. 3. I know Erlang is used more under UNIX than Windows, but it would be cool to see the process browser and other graphical apps written with Delphi (for example) so they aren't so dog slow and ugly under Windows :) 4. Use color in the shell window. Have typed commands be a different color than output. See? All minor! Hmmm...broadening this to "Suggestions for Erlang in general," (I know, I know, off topic!) I have a relatively short list: 1. Be able to compile the Windows version under Windows, instead of the wacky cross-compilation method currently used. Ugh. 2. Get stand-along Erlang working under Windows. I would *love* this! Please, please! 3. There are two spots where I find I prefer Lisp to Erlang: a. There's no simple, efficient way to have large, constant data structures. When attempting to translate some code from Peter Norvig's excellent _Paradigms of Artificial Intelligence Programming_ I ran into this a lot. It would be nice to define a global, unmodifiable data structure that could be used by different processes without the entire structure existing in each process, and without copying overhead of ETS. I'm specifically thinking of something like Lisp's defparameter facility. Sometimes there are ways around this, and sometimes not. b. Sometimes you just really need arrays that can be updated in O(N) time. On a global scale, ETS can be used, but on a smaller scale, for some algorithms, there's no speedy alternative. The process table, I guess. Couldn't tuples theortically be reference counted, so they could be copy on write? This is probably much messier than it sounds :) James From Sean.Hinde@REDACTED Mon Mar 5 19:27:50 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 5 Mar 2001 18:27:50 -0000 Subject: Erlang Development Environment Message-ID: <402DD461F109D411977E0008C791C312039F5E0B@imp02mbx.one2one.co.uk> Andi, > On Mon, Mar 05, 2001 at 04:25:15PM -0000, Sean Hinde wrote: > > I've read a number of suggestions for a better Erlang Development > > Environment than emacs.. It certainly seems we are falling > behind some other > > languages in terms of support environment. (OCaml, Clean, > Python etc). > > Could you describe what you think is wrong with the emacs > environment ? It's fine - I use it all the time. It is not everyone's cup of tea though - other people here refuse to go near it and prefer to use vi, or notepad or Joe or whatever If there was a nice dedicated environment which provided integrated (meaning gui) support for some of the things I mentioned then I believe that our Erlang experience would be a more pleasant and productive one. More seriously I am always in favour of providing the best tools to support the people doing the job at the sharp end (which is why we are using Erlang in the first place :-) ). Yes emacs can be made to do many things but when I compare ease of use and accessibility between that and a nice gui clickware environment with online help, automatic function name completion, Hit f1 to get a reminder of the order of parameters for this library function...) there is no real comparison. Some people would continue to use emacs - others (including me, and I suggest the majority of newcomers to the language) would use a dedicated environment if there was one and it was any good. > I think you're trying to reinvent the wheel ;) Absolutely right. There is nothing new here except that Erlang is in the middle not Java, or C++, or Clean, or C#. > > NOTICE AND DISCLAIMER: > > This email (including attachments) is confidential. If you > have received > > Interesting. Bizarre standard corporateware nonsense out of my control, please destroy all e-mails from me before reading them otherwise you will be disobeying the instructions which come after the body of the e-mail eh? - 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 jamesh@REDACTED Mon Mar 5 20:14:57 2001 From: jamesh@REDACTED (James Hague) Date: Mon, 5 Mar 2001 13:14:57 -0600 Subject: Erlang Development Environment Message-ID: > b. Sometimes you just really need arrays that can be updated > in O(N) time. Er, O(1). From vladdu@REDACTED Tue Mar 6 00:11:01 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Tue, 06 Mar 2001 00:11:01 +0100 Subject: Erlang Development Environment Message-ID: >3. I know Erlang is used more under UNIX than Windows, but it would be cool >to see the process browser and other graphical apps written with Delphi >(for >example) so they aren't so dog slow and ugly under Windows :) I didn't want to say anything before I had something that actually runs, but I have begun working on something like this. And it will now work under Linux too, since Kylix is out! :-) /Vlad _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. From cpressey@REDACTED Tue Mar 6 01:26:35 2001 From: cpressey@REDACTED (Chris Pressey) Date: Mon, 05 Mar 2001 18:26:35 -0600 Subject: Erlang Development Environment References: Message-ID: <3AA42EBB.90BCD73F@catseye.mb.ca> James Hague wrote: > 3. I know Erlang is used more under UNIX than Windows, but it would be cool > to see the process browser and other graphical apps written with Delphi (for > example) so they aren't so dog slow and ugly under Windows :) I'd rather the root of this problem be solved; namely, that GS is slow under Windows. Could the performance not be improved if it were implemented directly with Windows API calls (avoiding Tk completely)? > 2. Get stand-along Erlang working under Windows. I would *love* this! > Please, please! I second that emotion. > a. There's no simple, efficient way to have large, constant data structures. OK, but I'd rather not there be some "special method" in Erlang for making large constant data structures, efficient. An optimizer of some sort should see to that, behind the scenes. My opinion on the general topic - not necessarily representative of the typical Erlang programmer, admittedly - is that if some sort of "visually-oriented development environment" is called for, then we might as well shoot for the stars. Create a full-blown graphical syntax for Erlang along the lines of Boerenkool or Lava. Allow for several parallel views of the same source code. It could be viewed "by module", "by process", "by node", "by dependency", or any other conceivable hierarchical breakdown that is applicable to things in Erlang. The hardcore will always use the shell anyway, might as well make it as nice as possible for the GUI users; more than just a specialized text editor. I don't see why it couldn't be done in GS, either. Especially if there was an implementation of GS closer to the operating system. Just my 2 cents :-) _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From vladdu@REDACTED Tue Mar 6 08:17:41 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Tue, 06 Mar 2001 08:17:41 +0100 Subject: Erlang Development Environment Message-ID: >I'd rather the root of this problem be solved; namely, that GS is slow >under Windows. Could the performance not be improved if it were >implemented directly with Windows API calls (avoiding Tk completely)? I've been thinking about that too. I think it would be a very cool thing to push things even further and implement a full-blown window manager and widget toolkit in Erlang! But on the other hand, that might have mostly an academic purpose... I still think that for each purpose one should use the best tool available, and that one shouldn't reinvent the wheel if it isn't needed (unless of course, one feels it will be a better wheel!) Since I believe Delphi is the best tool for building GUIs under Windows and now Linux, then I feel no hesitation! :-) A related issue that I've tried to handle is how this GUI should be baked in an Erlang program. One could interface Erlang with the bowels of Delphi, but I feel that would be defeating it's own purpose. The solution I am trying to implement right now is using a clean client-server (or model-view) separation. This way, one can easily keep a command-line interface, if so wanted. >Create a full-blown graphical syntax for Erlang along the lines of >Boerenkool or Lava. Allow for several >parallel views of the same source code. It could be viewed "by module", >"by process", "by node", "by dependency", or any other conceivable >hierarchical breakdown that is applicable to things in Erlang. That is a great idea. As a matter of fact, a first step might be to implement a SDL-like design tool, which might be then refined with for example code generation and so on. I was quite disappointed that the SDL tools I tried can only generate C or C++ code... >I don't see why it couldn't be done in GS, either. Especially if there >was an implementation of GS closer to the operating system. Of course it can. The question is if it's worth the effort. If someone can spend time on that, I will become one of their greatest fans! :-) regards, Vlad _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. From tobbe@REDACTED Tue Mar 6 08:39:42 2001 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 06 Mar 2001 08:39:42 +0100 Subject: Erlang Development Environment In-Reply-To: "Vlad Dumitrescu"'s message of "Tue, 06 Mar 2001 08:17:41 +0100" References: Message-ID: JFYI: Tony Rogvall has made a coupling between Erlang an GTK. I think the plan is to release it to the OTP team (don't take my word for it though). However, I'm not sure how well GTK works under Windows. Cheers /Tobbe From mickael.remond@REDACTED Tue Mar 6 09:05:58 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Tue, 6 Mar 2001 09:05:58 +0100 Subject: Erlang Development Environment In-Reply-To: ; from tobbe@bluetail.com on Tue, Mar 06, 2001 at 08:39:42AM +0100 References: Message-ID: <20010306090558.A9439@erlang-fr.org> Torbjorn Tornkvist (tobbe@REDACTED) wrote: > > JFYI: Tony Rogvall has made a coupling between Erlang an GTK. > I think the plan is to release it to the OTP team (don't take > my word for it though). However, I'm not sure how well GTK > works under Windows. Hum. That's great ! I hope he will release his code because it would be very useful. GTK is a very powerful toolkit. For the Windows part, I think this should work on Windows: - Because GTK started in the GIMP (Image manipulation tool) project. GIMP has been ported on Windows, so I think the toolkit should work. - Because I have heard that Gnome has been ported on Windows. Gnome is a GTK based desktop, so ... -- Micka?l R?mond http://www.erlang-fr.org/ From matthias@REDACTED Tue Mar 6 09:14:26 2001 From: matthias@REDACTED (matthias@REDACTED) Date: Tue, 6 Mar 2001 09:14:26 +0100 (CET) Subject: Erlang Development Environment In-Reply-To: References: Message-ID: <15012.40034.994254.698901@corelatus.com> > 2. A shell command for timing specific pieces of code. Something where you > can specify a function, parameters, and the number of times to execute that > function. In Lisp I'm always doing this: > > (time (dotimes (i 1000000) (test 0 1 2))) > > I don't know a simple equivalent in Erlang. timer:tc(io, fwrite, ["hello world\n"]). hello world {222,ok} 222 means "222 microseconds of wall time elapsed during execution". 3> timer:tc(timer, sleep, [1000]). {1004227,ok} Matthias From not.for.email@REDACTED Tue Mar 6 10:39:29 2001 From: not.for.email@REDACTED (Gordon Beaton) Date: 6 Mar 2001 09:39:29 GMT Subject: JInterface exception handling problem References: <004901c0a36f$1bd7f8d0$2700a8c0@neomeo.com> Message-ID: <982b8h$q4h$1@news.du.uab.ericsson.se> On 2 Mar 2001 23:18:35 GMT, Alexis L?-Qu?c wrote: > I ran into a problem using Jinterface to send a message to an erlang node, > and I managed to track it down; I attached a small patch which correct an > exception handling problem. In order to avoid others spending hours on the > same problem, here's the how and why: > > I'm using a J-node to send a message using a mailbox to a node called > n1@REDACTED The erlang emulator has been started with the > flag -sname n1 on the machine called n1@REDACTED Thus the node > will be known by erlang as n1@REDACTED This does not look really harmful of a > mismatch but it actually is and the syptoms are that only one message is > successfully transmitted to the erlang emulator. > > In OtpNode.getConnection(String node), since there is no initial connection > between the two nodes, a new OtpCookedConnection will be created and added > to the connection pool (of the OtpNode) with the name n1@REDACTED instead of > n1@REDACTED because in AbstractConnection.receiveChallenge(...) > overwrites the peer name which will be subsquently inserted into the > connection pool. The new name is extracted from the erlang emulator reply. > Nice side effect :-) > > Thus we end up having the 'connections' member of OtpNode have {'n1@REDACTED': > ...}. And subsequent calls to mbox.send(n1@REDACTED, ...) will fail > because it'll lookup for the full name and not notice that there is already > a connection to the node. > > This is not quite a bug in JInterface, but detecting the problem is > particularly difficult because exceptions are black-holed... That's what the > patch is for. Actually there is already a mechanism for notifying the application about this kind of exception, they aren't black-holed. See OtpNodeStatus. However through an unfortunate oversight, OtpNode.registerStatusHandler() was declared private so it was impossible to register the necessary callback object (this is now fixed). So a simpler patch would be to change "private" to "public" in the method declaration. /gordon -- [ do not send me private copies of your followups ] g o r d o n . b e a t o n @ e r i c s s o n . c o m ericsson research stockholm, sweden From rv@REDACTED Tue Mar 6 11:21:10 2001 From: rv@REDACTED (Robert Virding) Date: Tue, 06 Mar 2001 11:21:10 +0100 Subject: Erlang Development Environment In-Reply-To: Your message of "Mon, 05 Mar 2001 16:25:15 GMT." <402DD461F109D411977E0008C791C312039F5E0A@imp02mbx.one2one.co.uk> Message-ID: <200103061021.LAA05671@trana.bluetail.com> Sean Hinde writes: >Fellow Erlangers, > >I've read a number of suggestions for a better Erlang Development >Environment than emacs.. It certainly seems we are falling behind some other >languages in terms of support environment. (OCaml, Clean, Python etc). There used to be a simple but perfectly usable development environment called xerl (I think). It consisted of an editor window and a coupled shell window with some helpful buttons. The editor was textedit-like, but had a reasonable knowledge of Erlang syntax so it could help with indentation. While not as powerful as the emacs environment it was perfect for users who were shy of emacs or running on Windows. Best of all it was written in Erlang so it could have been extended into a full environment with close coupling to the debugger and other graphical system display tools. I don't know why it was dropped. It was pre-gs so it would have had to been ported. Maybe the code still exists somewhere and could be used as a starting point for a new environment. I porbably think, without having given too much thought on the subject, that Gtk is the way to go. If you were doing a "product" for money then I would buy some portable environment. Robert From jamesh@REDACTED Tue Mar 6 15:53:32 2001 From: jamesh@REDACTED (James Hague) Date: Tue, 6 Mar 2001 08:53:32 -0600 Subject: Erlang Development Environment Message-ID: > timer:tc(io, fwrite, ["hello world\n"]). > hello world > {222,ok} Fantastic! I didn't know! Thanks a bunch. James From jamesh@REDACTED Tue Mar 6 15:58:51 2001 From: jamesh@REDACTED (James Hague) Date: Tue, 6 Mar 2001 08:58:51 -0600 Subject: Erlang Development Environment Message-ID: >I'd rather the root of this problem be solved; namely, that GS is slow >under Windows. Could the performance not be improved if it were >implemented directly with Windows API calls (avoiding Tk completely)? Probably, but it would be a huge effort. Delphi is orders of magnitude easier to use than raw Win32 calls. My gut feeling is that there's not much sense in bulking up Erlang with huge graphical modules. Just calling external programs is a nice way of dodging the problem and keeping focused. > > a. There's no simple, efficient way to have large, constant > data structures. > > OK, but I'd rather not there be some "special method" in Erlang for > making large constant data structures, efficient. An > optimizer of some sort should see to that, behind the scenes. I agree. If constant data had it's own non-GCed memory pool, that would be great. But that's a big change to the runtime, I expect. Oh, but it would really open up possibilities, IMO. James From klacke@REDACTED Tue Mar 6 16:08:30 2001 From: klacke@REDACTED (Klacke) Date: Tue, 6 Mar 2001 16:08:30 +0100 Subject: Erlang Development Environment In-Reply-To: ; from jamesh@Volition-inc.com on Tue, Mar 06, 2001 at 08:58:51AM -0600 References: Message-ID: <20010306160830.A16950@bluetail.com> On Tue, Mar 06, 2001 at 08:58:51AM -0600, James Hague wrote: > > > a. There's no simple, efficient way to have large, constant > > data structures. > > > > OK, but I'd rather not there be some "special method" in Erlang for > > making large constant data structures, efficient. An > > optimizer of some sort should see to that, behind the scenes. > > I agree. If constant data had it's own non-GCed memory pool, that would be > great. But that's a big change to the runtime, I expect. Oh, but it would > really open up possibilities, IMO. > This is the reason why I once added the ets tables to the runtime. I wanted to keep very large amounts of data in RAM without exposing that data to the gc. I guess the ets tables are more suited for many, but not so large objects as opposed to few, but very large objects though. /klacke -- Claes Wikstrom -- Caps lock is nowhere and Alteon WebSystems -- everything is under control http://www.bluetail.com/~klacke -- From Erik.Johansson@REDACTED Tue Mar 6 16:19:03 2001 From: Erik.Johansson@REDACTED (Erik.Johansson) Date: Tue, 6 Mar 2001 16:19:03 +0100 Subject: Erlang Development Environment References: Message-ID: <078301c0a650$c7654070$980cee82@it.uu.se> > I agree. If constant data had it's own non-GCed memory pool, that would be > great. But that's a big change to the runtime, I expect. Oh, but it would > really open up possibilities, IMO. Well, the change is not that big, it is a bit problematic with the current GC, but it is doable. In fact, when you compile a function to native code with HiPE all constant data structures are stored in such a memory pool. (This feature might be added to BEAM at some point...) /Erik HiPE -- Comming soon to an OTP implementation near you. Ex: const() -> {a,somewhat,big,"constant"}. loop(0) -> const(); loop(N) -> const(), loop(N-1). test() -> loop(1000). > timer:tc(jt,test,[]). {1557,{a,somewhat,big,"constant"}} > hipe:c(jt,[o2]). > timer:tc(jt,test,[]). {152,{a,somewhat,big,"constant"}} > hipe:compile({jt,const,0},[o2,pp_rtl]). {jt,const,0}() -> ;; Info: [] .DataSegment .DL0: {a,somewhat,big,[99,111,110,115,116,97,110,116]} .CodeSegment L9: r39 <- %l6 add 208 if (r39 lt %l7) then L1 (0.99) else L7 L7: ;; save_frame [%l6+0] <- %o7 %l6 <- %l6 add 4 jsr inc_stack_0 [c] () then L8 L8: ;; restore_frame %o7 <- [%l6+-4] ;; pop_frame %l6 <- %l6 sub 4 goto L1 L1: %l5 <- %l5 sub 1 if lt then L3 (0.01) else L2 L2: v38 <- DL0 v37 <- v38 add 2 goto L5 L5: %o0 <= v37 jmp %o7+8 (%o0) L3: ;; save_frame [%l6+0] <- %o7 %l6 <- %l6 add 4 jsr suspend_0 [c] () then L6 L6: ;; restore_frame %o7 <- [%l6+-4] ;; pop_frame %l6 <- %l6 sub 4 goto L2 From rv@REDACTED Tue Mar 6 18:16:11 2001 From: rv@REDACTED (Robert Virding) Date: Tue, 06 Mar 2001 18:16:11 +0100 Subject: Erlang Development Environment In-Reply-To: Your message of "Tue, 06 Mar 2001 16:19:03 +0100." <078301c0a650$c7654070$980cee82@it.uu.se> Message-ID: <200103061716.SAA08327@trana.bluetail.com> "Erik.Johansson" writes: >> I agree. If constant data had it's own non-GCed memory pool, that would be >> great. But that's a big change to the runtime, I expect. Oh, but it would >> really open up possibilities, IMO. > >Well, the change is not that big, it is a bit problematic with the current GC, but it is doable. >In fact, when you compile a function to native code with HiPE all constant data structures are stored in such a memory pool. (This > feature might be added to BEAM at some point...) How do you garbage collect this memory pool? I presume that the idea is to NOT a structure from the pool into a process heap. In that case how do you know when to clear structures from the pool? Just removing them when the module is purged is not enough as they may still be referenced from process heaps. I am assuming here that you using the seperate process heap model of the BEAM. If you are using a single heap then the problem goes away. Robert From mickael.remond@REDACTED Tue Mar 6 18:33:40 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Tue, 6 Mar 2001 18:33:40 +0100 Subject: Inets performance Message-ID: <20010306183340.B29984@idealx.com> Hello, I am doing some benchmarks comparing Apache and Inets 2.5.3 with ab (Apache benchmark tool). I made all the tests with ab lauching 5000 connections in a row, using 50 simultaneous connections. I found some interesting results: 1. The test client is on the _same_ machine than the Web server: Inets: 240 requests per second (classic Apache/Debian index.html) Apache: 540 requests per second (classic Apache/Debian index.html) 2. The test client is on a _different_ machine than the Web server: Inets: 205 requests per second (classic Apache/Debian index.html) Apache: 182 requests per second (classic Apache/Debian index.html) Hum. This is very interesting... From what I understand, Apache seems to make a better use of the kernel capability for local connections, but Inets performs nearly the same via the network or on the local machine. 3. The test client is on a _different_ machine than the Web server and I am using a bigger html file (60ko): Inets: 9 requests per second Apache: 17 requests per second Apache is doing better than Inets for large file. Do you have any idea of why is there such a difference for large file ? Do you see anything useful to improve Inets performance for large file ? Thank you for your help. -- Micka?l R?mond From etxhste@REDACTED Tue Mar 6 19:57:13 2001 From: etxhste@REDACTED (Hakan Stenholm) Date: Tue, 6 Mar 2001 19:57:13 +0100 (MET) Subject: Erlang Development Environment Message-ID: <200103061857.TAA09415@avc240.etxb.ericsson.se> >>Fellow Erlangers, >> >>I've read a number of suggestions for a better Erlang Development >>Environment than emacs.. It certainly seems we are falling behind some other >>languages in terms of support environment. (OCaml, Clean, Python etc). I don't mind a nicer enviroment, but I feel that a thight integration between dev. enviroment and the erlang language/VM is a bad idea for several reasons: * it should be possible to use erlang with a shell and a texteditor of your choice for portablity reasons. * gui interfaces can be slower (to perfrom certain tasks) than command line * I like the emacs(to edit) + shell(run and compile) + netscape(read doc) combination becouse it works just same for allmost any language: erlang, java, C ... Note: it's a lot of (redundant ?) work to make a system that does what emacs + shell + netscape do well - I suppouse one could do some kind of framework that simply uses these applications (perhaps another texteditor though ?). > >There used to be a simple but perfectly usable development environment >called xerl (I think). It consisted of an editor window and a coupled >shell window with some helpful buttons. The editor was textedit-like, >but had a reasonable knowledge of Erlang syntax so it could help with >indentation. > >While not as powerful as the emacs environment it was perfect for users >who were shy of emacs or running on Windows. I tried to use xerl (not for very long though, emacs + shell was a much nicer combo) when I worked o my master thesis about three years ago and I found xerl to rather horrible (mostly GUI vise): * editor and shell in one window -> reduced vertical space (side by side would use the screen area more efficently) -> bad code overview due to fewer lines visible. * menus implemented by buttons, mouse button must be pressed down for the menue to remain visible, it was easy to accidently select a menu item yielding all kind of fun unexpected effects :) * very non-standard gui look and behaviour * no real benefits compared to useing emacs and a shell Note: this is mostly a complaint about the xerl implementation NOT the basic idea of xerl. > >Best of all it was written in Erlang so it could have been extended >into a full environment with close coupling to the debugger and other >graphical system display tools. > >I don't know why it was dropped. It was pre-gs so it would have had to >been ported. Maybe the code still exists somewhere It's still availible in the comercial R5 OTP version (run erl -x) >and could be used >as a starting point for a new environment. > >I porbably think, without having given too much thought on the subject, >that Gtk is the way to go. If you were doing a "product" for money >then I would buy some portable environment. > > Robert From alexis@REDACTED Tue Mar 6 20:32:46 2001 From: alexis@REDACTED (=?iso-8859-1?Q?Alexis_L=EA-Qu=F4c?=) Date: Tue, 6 Mar 2001 11:32:46 -0800 Subject: JInterface exception handling problem References: <004901c0a36f$1bd7f8d0$2700a8c0@neomeo.com> <982b8h$q4h$1@news.du.uab.ericsson.se> Message-ID: <007101c0a674$39172850$2700a8c0@neomeo.com> Please correct me if I'm wrong, but the exception messages are lost, if they happen in AbstractConnection:recvStatus() since they are rethrown with the generic message: "Cannot connect to peer node" in AbstractConnection:doConnect(). The messages that are thus ignored are "Handshake protocol error", "Peer replied with status... instead of ok" and "Handshake failed - not enough data". Unless I'm missing something obvious, there is no way for the application to get these messages instead of the less descriptive "Cannot connect to peer node". Cheers, Alexis ----- Original Message ----- From: "Gordon Beaton" To: Sent: Tuesday, March 06, 2001 1:39 Subject: Re: JInterface exception handling problem > On 2 Mar 2001 23:18:35 GMT, Alexis L?-Qu?c wrote: > > I ran into a problem using Jinterface to send a message to an erlang node, > > and I managed to track it down; I attached a small patch which correct an > > exception handling problem. In order to avoid others spending hours on the > > same problem, here's the how and why: > > > > I'm using a J-node to send a message using a mailbox to a node called > > n1@REDACTED The erlang emulator has been started with the > > flag -sname n1 on the machine called n1@REDACTED Thus the node > > will be known by erlang as n1@REDACTED This does not look really harmful of a > > mismatch but it actually is and the syptoms are that only one message is > > successfully transmitted to the erlang emulator. > > > > In OtpNode.getConnection(String node), since there is no initial connection > > between the two nodes, a new OtpCookedConnection will be created and added > > to the connection pool (of the OtpNode) with the name n1@REDACTED instead of > > n1@REDACTED because in AbstractConnection.receiveChallenge(...) > > overwrites the peer name which will be subsquently inserted into the > > connection pool. The new name is extracted from the erlang emulator reply. > > Nice side effect :-) > > > > Thus we end up having the 'connections' member of OtpNode have {'n1@REDACTED': > > ...}. And subsequent calls to mbox.send(n1@REDACTED, ...) will fail > > because it'll lookup for the full name and not notice that there is already > > a connection to the node. > > > > This is not quite a bug in JInterface, but detecting the problem is > > particularly difficult because exceptions are black-holed... That's what the > > patch is for. > > Actually there is already a mechanism for notifying the application > about this kind of exception, they aren't black-holed. See > OtpNodeStatus. > > However through an unfortunate oversight, OtpNode.registerStatusHandler() > was declared private so it was impossible to register the necessary > callback object (this is now fixed). So a simpler patch would be to > change "private" to "public" in the method declaration. > > /gordon > > -- > [ do not send me private copies of your followups ] > g o r d o n . b e a t o n @ e r i c s s o n . c o m > ericsson research > stockholm, sweden > From Sean.Hinde@REDACTED Tue Mar 6 20:20:26 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 6 Mar 2001 19:20:26 -0000 Subject: Inets performance Message-ID: <402DD461F109D411977E0008C791C312039F5E13@imp02mbx.one2one.co.uk> > Do you see anything useful to improve Inets performance for > large file ? If you have plenty of memory you could store the file as a binary in ets/mnesia and pull it out with a cgi-script. This works pretty well and is fast. (as I understand it the binary isn't copied - ets just stores a reference). I use an mnesia table keyed on filename holding e.g. #rec{name = "index.html", contents = #Bin}. I also took one of Joe's contribs for embedding erlang code in html and changed it about so it uses mnesia as a store (attached, with slight documentation). You can do things like: lists:map(fun({A,B}) -> ${A},,${B}

end, Var) It isn't perfect as the parser isn't clever enough to handle spaces in the 'wrong' places.. any help appreciated .. It is in service without any problems though :) - 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: esp.erl Type: application/octet-stream Size: 8383 bytes Desc: not available URL: From enano@REDACTED Tue Mar 6 23:34:23 2001 From: enano@REDACTED (Miguel Barreiro Paz) Date: Tue, 6 Mar 2001 23:34:23 +0100 (CET) Subject: Inets performance In-Reply-To: <20010306183340.B29984@idealx.com> Message-ID: Hi, > I made all the tests with ab lauching 5000 connections in a row, using > 50 simultaneous connections. > 1. The test client is on the _same_ machine than the Web server: > Inets: 240 requests per second (classic Apache/Debian index.html) > Apache: 540 requests per second (classic Apache/Debian index.html) > 2. The test client is on a _different_ machine than the Web server: > Inets: 205 requests per second (classic Apache/Debian index.html) > Apache: 182 requests per second (classic Apache/Debian index.html) This is pretty anomalous, but could well be caused by a number of reasons. What is the maximum requests/second you get from apache using ab -c1 or -c2, and what aggregate throughput are you getting? Apache and Inets bottlenecks are very different and they show up under extreme conditions (such as http over the tcp loopback). With a high concurrency level Apache suffers from heavy context switching, while erlang threads are obviously far more lightweight. Under high throughput demands, Inets will suffer badly from its higher cpu overhead compared to Apache (who quickly gets I/O bound before processor is a bottleneck, unless you abuse quite a bit of rewriting rules and such). I suppose Apache on Linux nowadays will serve html files with sendfile(2) directly if it can (ie., unless it has to parse shtml or so), thus avoiding a copy, a userspace buffer, and at least two kernel-userspace switches per write. That is close to as fast as you can get without hardcore kernelHTTPd solutions :) > Hum. This is very interesting... From what I understand, Apache seems > to make a better use of the kernel capability for local connections, but > Inets performs nearly the same via the network or on the local machine. The only special support for local connections is the fast path on the kernel IP stack, which you will use as soon as you send through the loopback. You could certainly tune tcp for such conditions, but AFAIK the tunable tcp timers are global and not settable per-interface on Linux. > Do you have any idea of why is there such a difference for large file ? Sean's suggestion certainly avoids the cost of going through the file server and should speed up things, has anyone measured the difference? In my very limited experience with inets, I have found a bit limiting that it can't serve streams, only finite-length data. And as far as I remember it won't serve anything produced by an erlet until the erlet has finished its output. Regards, Miguel From happi@REDACTED Wed Mar 7 10:04:11 2001 From: happi@REDACTED (Erik Johansson) Date: Wed, 7 Mar 2001 10:04:11 +0100 Subject: Erlang Development Environment References: <200103061716.SAA08327@trana.bluetail.com> Message-ID: <004401c0a6e5$935c5f80$c90b0a0a@student.uu.se> "Robert Virding" wrote: > "Erik.Johansson" writes: > >In fact, when you compile a function to native code with HiPE all constant > >data structures are stored in such a memory pool. > > How do you garbage collect this memory pool? I presume that the idea > is to NOT a structure from the pool into a process heap. In that case > how do you know when to clear structures from the pool? Just removing > them when the module is purged is not enough as they may still be > referenced from process heaps. Yes in ordinary execution the data in the constant pool is not copied to the process heap. When a module, with constant data, is purged the following is done: A flag is set in each process indicating that the next GC should be special. This special GC kopies all live terms from the constant area to the process heap. When all marked processes have done a special GC then the constant pool is freed. (If new processes are created they do not need to do a special GC since they can't get any references to the constnats in question. This assumes that messages are copied.) This scheme is not yet fully implemented in HiPE ;) (There are a few parameters that can be tweeked like: * Copy all data from the constant pool or just data associated with the purged module. * When to do the next GC. * Not copy constant data when doing a send. (This probably cost more than one can gain.) ) > I am assuming here that you using the seperate process heap model of > the BEAM. If you are using a single heap then the problem goes away. Yes, and we plan to experiment with a single heap. /Erik From davidg@REDACTED Wed Mar 7 10:04:15 2001 From: davidg@REDACTED (David Gould) Date: Wed, 7 Mar 2001 01:04:15 -0800 Subject: Erlang Development Environment In-Reply-To: <078301c0a650$c7654070$980cee82@it.uu.se>; from Erik.Johansson on Tue, Mar 06, 2001 at 04:19:03PM +0100 References: <078301c0a650$c7654070$980cee82@it.uu.se> Message-ID: <20010307010415.A8411@dnai.com> On Tue, Mar 06, 2001 at 04:19:03PM +0100, Erik.Johansson wrote: > > Well, the change is not that big, it is a bit problematic with the current GC, but it is doable. > In fact, when you compile a function to native code with HiPE all constant data structures are stored in such a memory pool. (This feature might be added to BEAM at some point...) > > /Erik > HiPE -- Comming soon to an OTP implementation near you. > > Ex: > const() -> > {a,somewhat,big,"constant"}. > loop(0) -> > const(); > loop(N) -> > const(), > loop(N-1). > test() -> > loop(1000). > > > timer:tc(jt,test,[]). > {1557,{a,somewhat,big,"constant"}} > > hipe:c(jt,[o2]). > > timer:tc(jt,test,[]). > {152,{a,somewhat,big,"constant"}} Oooooh Oooh Ooh, I can hardly wait. But, what is happening with the x86 version? I have not seen any updates on the hipe page for a while. -dg -- David Gould davidg@REDACTED 510 536 1443 If simplicity worked, the world would be overrun with insects. From happi@REDACTED Wed Mar 7 10:20:37 2001 From: happi@REDACTED (Erik Johansson) Date: Wed, 7 Mar 2001 10:20:37 +0100 Subject: Erlang Development Environment References: <078301c0a650$c7654070$980cee82@it.uu.se> <20010307010415.A8411@dnai.com> Message-ID: <006301c0a6e7$defaabc0$c90b0a0a@student.uu.se> "David Gould" wrote: > On Tue, Mar 06, 2001 at 04:19:03PM +0100, Erik.Johansson wrote: > > HiPE -- Comming soon to an OTP implementation near you. > Oooooh Oooh Ooh, I can hardly wait. But, what is happening with the x86 > version? I have not seen any updates on the hipe page for a while. No, we are working full time on the system and have no time to update the webpage ;) Current status is (unofficially and approximately): HiPE is closing in on a final BETA version (for UltraSPARC) and will hopefully be released as an *unsupported* addition to OTP R8. (No promises yet.) There will be some important aspects missing in this release such as automatic purging of old native code. We are working on the X86 port in parallel and we hope it will be released this summer. (Possibly with much luck there will be an alpha version ready for R8, but don't bet on it.) /Erik From etxuwig@REDACTED Wed Mar 7 10:30:51 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 7 Mar 2001 10:30:51 +0100 (MET) Subject: Inets performance In-Reply-To: Message-ID: On Tue, 6 Mar 2001, Miguel Barreiro Paz wrote: >Under high throughput demands, Inets >will suffer badly from its higher cpu overhead compared to Apache (who >quickly gets I/O bound before processor is a bottleneck, unless you abuse >quite a bit of rewriting rules and such). Inets is in dire need of optimization. >I suppose Apache on Linux nowadays will serve html files with >sendfile(2) directly if it can (ie., unless it has to parse shtml or >so), thus avoiding a copy, a userspace buffer, and at least two >kernel-userspace switches per write. That is close to as fast as you >can get without hardcore kernelHTTPd solutions :) Inets could at least use a linked-in driver that chunked a file and delivered the chunks directly to a socket. The file.erl module is really somewhat optimized for fairness (to erlang processes not using heavy I/O) and pays extra reductions for each message coming from the driver. If you want to write some application that has really fast file I/O, you can't use file.erl as it works today (as mnesia has found out...) >I my very limited experience with inets, I have found a bit limiting >that it can't serve streams, only finite-length data. And as far as >I remember it won't serve anything produced by an erlet until the >erlet has finished its output. When I wrote my source code viewer (the ccviewer contrib), I implemented such a function. I didn't use Inets, but I'm sure the same thing could be done there. Here's the code: ccv_html_lib:progress(Fmt, Args) mimics io:format/2 and uses the process dictionary to keep track of the socket, and to cache the complete page. When done, the request thread calls maybe_save_progress(). The reason for this was that I use this for operations that can take so long that the Netscape client often times out. In such a case (or if the user closes the window), the complete page is stored an can be fetched later. /Uffe progress(Fmt, Args) -> progress(Fmt, Args, get_socket()). progress(Fmt, Args, Socket) -> Str = io_lib:format(Fmt, Args), to_socket(Socket, Str), store_progress(Str), io:format("~p:" ++ Fmt, [self()|Args]). to_socket(no_socket, _) -> ok; to_socket(Socket, Str) -> case send(Socket, Str) of {error, Reason} -> put(progress_to_socket, closed); _ -> ok end. store_progress(Str) -> Sofar = get_html_progress(), put(html_progress, [Str | Sofar]). get_html_progress() -> case get(html_progress) of undefined -> []; Other -> Other end. maybe_save_progress() -> Title = get_strict(progress_title), User = get_strict(progress_user), Key = get_strict(progress_key), case get_socket() of no_socket -> case get(html_progress) of undefined -> ok; HtmlRev -> Bin = list_to_binary(["

\n", 
                                          lists:reverse(HtmlRev),
                                         "\n
"]), ccv_user:store_page(Key, Title, User, Bin) end; Socket -> ok end. get_strict(Key) -> case get(Key) of undefined -> exit(unexpected); Other -> Other end. -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From davidg@REDACTED Wed Mar 7 10:43:18 2001 From: davidg@REDACTED (David Gould) Date: Wed, 7 Mar 2001 01:43:18 -0800 Subject: Erlang Development Environment In-Reply-To: <006301c0a6e7$defaabc0$c90b0a0a@student.uu.se>; from Erik Johansson on Wed, Mar 07, 2001 at 10:20:37AM +0100 References: <078301c0a650$c7654070$980cee82@it.uu.se> <20010307010415.A8411@dnai.com> <006301c0a6e7$defaabc0$c90b0a0a@student.uu.se> Message-ID: <20010307014318.D8411@dnai.com> On Wed, Mar 07, 2001 at 10:20:37AM +0100, Erik Johansson wrote: > > HiPE is closing in on a final BETA version (for UltraSPARC) and will > hopefully be released as an *unsupported* addition to OTP R8. (No promises > yet.) > hands make light work. Or is it > There will be some important aspects missing in this release such as > automatic > purging of old native code. > We are working on the X86 port in parallel and we hope it will be released > this summer. > (Possibly with much luck there will be an alpha version ready for R8, but > don't bet on it.) I would really like to see _something_ for x86 as early as possible. One of the issues I run into trying to introduce Erlang to the unwashed is "well, it can't be fast enough, especially without a compiler, we need speed, so will have to use Java", ok, the bit about Java was a joke. But to be able to say, I am testing an early alpha of the compiler and "next year when we need to deploy at large scale" it will be 10x faster" could go a long way to getting a chance to use Erlang for some projects. It is not that it really isn't fast enough now, but overcoming "I've never heard of it", "and noone knows it", and "it might be too slow" is almost impossible so it is hard to get a chance to succeed or fail. When I say "_something_", it does not need to work. Nor to support all of otp. Just enough to say, ok, fib() is 10x faster, and regexing through a megabyte of text is 4x faster, or whatever would be great. Thanks -dg -- David Gould davidg@REDACTED 510 536 1443 If simplicity worked, the world would be overrun with insects. From Chandrashekhar.Mullaparthi@REDACTED Wed Mar 7 11:29:05 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Wed, 7 Mar 2001 10:29:05 -0000 Subject: Erlang man pages in Emacs Message-ID: <402DD461F109D411977E0008C791C312039199D4@imp02mbx.one2one.co.uk> Hi all, I use Emacs to read manpages sometimes. Whenever I open a manpage, the Erlang menu disappears - so the only way I can view another manpage is to switch to a buffer which has some erlang code so that the Erlang menu appears again. Is there any way to change the Emacs Erlang mode so that the menu stays even when showing a manpage?? cheers, Chandru 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 Wed Mar 7 12:05:01 2001 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 07 Mar 2001 12:05:01 +0100 Subject: Erlang Development Environment In-Reply-To: Hakan Stenholm's message of "Tue, 6 Mar 2001 19:57:13 +0100 (MET)" References: <200103061857.TAA09415@avc240.etxb.ericsson.se> Message-ID: > I tried to use xerl (not for very long though, emacs + shell was a much nicer > combo) when I worked o my master thesis about three years ago and I found xerl > to rather horrible (mostly GUI vise): I agree. I just want to clarify that the reason for xerl was to let (SUN) textedit "hackers" to use something that at least could do automatic indentation. For example, before xerl, we had students at some courses that wrote Erlang programs where each line started in column 1 or even worse, wrote the whole program in one (wrapped) line... :-) Cheers /Tobbe (Ps. xerl used pxw which was a layer on top of the Athena widget set) From tobbe@REDACTED Wed Mar 7 12:21:50 2001 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 07 Mar 2001 12:21:50 +0100 Subject: Erlang man pages in Emacs In-Reply-To: Chandrashekhar Mullaparthi's message of "Wed, 7 Mar 2001 10:29:05 -0000" References: <402DD461F109D411977E0008C791C312039199D4@imp02mbx.one2one.co.uk> Message-ID: > Is there any way to change the Emacs Erlang mode so that the > menu stays even when showing a manpage?? Perhaps, putting this in your ~/.emacs will be enough: (add-hook 'Man-mode-hook 'erlang-mode) Cheers /Tobbe From luke@REDACTED Wed Mar 7 14:39:08 2001 From: luke@REDACTED (Luke Gorrie) Date: 07 Mar 2001 14:39:08 +0100 Subject: erlang-mode bug Message-ID: Hej, I found a bug in erlang-mode, perhaps an elisp hacker can shed some light? Here's a function to reproduce it: (defun erlang-mode-bug () "Causes a bug in erlang-mode. If you open a list with '[' and then end the line with only whitespace or comments, then there is an error when you try to move sexp-at-a-time within the list. This has side-effects, for example if you try to indent on the second line of: [{ }] Then you'll trigger this error." (interactive) ;; insert: ;; [ ;; ] ;; and leave the point at the start of the second line (insert "[\n") (save-excursion (insert "]")) ;; moving forwards- or backwards- by a sexp triggers a bogus error (backward-sexp)) From Sean.Hinde@REDACTED Wed Mar 7 14:47:46 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Wed, 7 Mar 2001 13:47:46 -0000 Subject: Erlang Development Environment Message-ID: <402DD461F109D411977E0008C791C312039F5E14@imp02mbx.one2one.co.uk> Hakan, > I don't mind a nicer enviroment, but I feel that a thight > integration between > dev. enviroment and the erlang language/VM is a bad idea for > several reasons: > * it should be possible to use erlang with a shell and a > texteditor of your > choice for portablity reasons. > * gui interfaces can be slower (to perfrom certain tasks) > than command line > * I like the emacs(to edit) + shell(run and compile) + > netscape(read doc) > combination becouse it works just same for allmost any > language: erlang, java, C I didn't envisage that any of these things would go away, and Erlang is a pretty good reason to download and learn to drive emacs.. I do think though that at least a dedicated erlang editor with: 1. Function name completion on tab, 2. 'f1' to take you to the detailed doc for that function 3. or even just bring up the possible function headers with the names of the variables (kind of like you get when entering an equation in M$ Excel) - this could even work without access to any docs and for our own functions in our own modules in the current path. 4. Click to jump to the function implementation. 5. .. Take a look at Visual C++ or some of those things and steal (without breaking any software copyright laws of course ;) ) the best and most relevant ideas. would be quite a bit nicer. One even hears rumours that the majority of progammers in at least parts of a certain large Erlang using telecoms supplier don't even use emacs but instead use a wide array of vi, textpad, notepad etc. One quick win could be to at least have searchable documentation. > Note: it's a lot of (redundant ?) work to make a system that > does what emacs + > shell + netscape do well - I suppouse one could do some kind > of framework that > simply uses these applications (perhaps another texteditor though ?). True, much work, and it would only be worth it if we ended up with something much better. An interesting project also.. - 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 etxhste@REDACTED Wed Mar 7 15:15:17 2001 From: etxhste@REDACTED (Hakan Stenholm) Date: Wed, 7 Mar 2001 15:15:17 +0100 (MET) Subject: Erlang Development Environment Message-ID: <200103071415.PAA09480@avc240.etxb.ericsson.se> > From: Sean Hinde > To: "'Hakan Stenholm'" , erlang-questions@REDACTED > Subject: RE: Erlang Development Environment > Date: Wed, 7 Mar 2001 13:47:46 -0000 > MIME-Version: 1.0 > > Hakan, > > > I don't mind a nicer enviroment, but I feel that a thight > > integration between > > dev. enviroment and the erlang language/VM is a bad idea for > > several reasons: > > * it should be possible to use erlang with a shell and a > > texteditor of your > > choice for portablity reasons. > > * gui interfaces can be slower (to perfrom certain tasks) > > than command line > > * I like the emacs(to edit) + shell(run and compile) + > > netscape(read doc) > > combination becouse it works just same for allmost any > > language: erlang, java, C > > I didn't envisage that any of these things would go away, I dont either but I don't like the thought that one could end up with a clumsy sluggish "standard" one must use. > and Erlang is a > pretty good reason to download and learn to drive emacs.. I do think though > that at least a dedicated erlang editor with: > > 1. Function name completion on tab, > 2. 'f1' to take you to the detailed doc for that function > 3. or even just bring up the possible function headers with the names of the > variables (kind of like you get when entering an equation in M$ Excel) - > this could even work without access to any docs and for our own functions in > our own modules in the current path. > 4. Click to jump to the function implementation. > 5. .. Take a look at Visual C++ or some of those things and steal (without > breaking any software copyright laws of course ;) ) the best and most > relevant ideas. nice ideas but I suppouse this will require the creation of a dedicated erlang source text editor ? > > would be quite a bit nicer. One even hears rumours that the majority of > progammers in at least parts of a certain large Erlang using telecoms > supplier don't even use emacs but instead use a wide array of vi, textpad, > notepad etc. :o > > One quick win could be to at least have searchable documentation. It would also be nice if the current hmtl version had a index of functions (like the OTP books) and keywords and not only a list of modules. > > > Note: it's a lot of (redundant ?) work to make a system that > > does what emacs + > > shell + netscape do well - I suppouse one could do some kind > > of framework that > > simply uses these applications (perhaps another texteditor though ?). > > True, much work, and it would only be worth it if we ended up with something > much better. An interesting project also.. > Yes thats what worries me a bit, one doesn't simply get a better user interface by adding graphics ontop of it. So to do this well would require a considerable amount of work, it's more than simply adding some gui code - gui responsiveness should be snappy and the layout (placement of buttons, windows, use of contex menues ...) of the gui should be well thought out. You'll also need to update a tool like this after each (major) OTP release so that documentation is up to date and things that (roughly) do what the erlang emacs mode does works properly. > - 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 etxuwig@REDACTED Wed Mar 7 15:35:52 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 7 Mar 2001 15:35:52 +0100 (MET) Subject: Erlang Development Environment In-Reply-To: <402DD461F109D411977E0008C791C312039F5E14@imp02mbx.one2one.co.uk> Message-ID: On Wed, 7 Mar 2001, Sean Hinde wrote: >I do think though that at least a dedicated erlang editor with: I had a vague ambition to do this, and as a result, posted the lines-1.0 contrib. I didn't get any further than that. (: >1. Function name completion on tab, ...would be nice. >2. 'f1' to take you to the detailed doc for that function We (AXD 301) have that capability for OTP functions (well, modules, at least) via CCviewer. (not for our own code, alas, because the docs are not in an easily parsable format... embarrassing.) >3. or even just bring up the possible function headers with the >names of the variables (kind of like you get when entering an >equation in M$ Excel) - this could even work without access to any >docs and for our own functions in our own modules in the current >path. Yes, nice. >4. Click to jump to the function implementation. We do this through CCviewer, as well as being one click away from listing all known calls to a particular function. If anyone else wants to give CCviewer a spin, I'll gladly help out in porting it to another design environment. It might be some work, but I think it's well worth it. >One even hears rumours that the majority of progammers in at least >parts of a certain large Erlang using telecoms supplier don't even >use emacs but instead use a wide array of vi, textpad, notepad etc. These rumours are totally unfounded, of course. (: /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From mickael.remond@REDACTED Wed Mar 7 15:31:31 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Wed, 7 Mar 2001 15:31:31 +0100 Subject: Erlang Development Environment In-Reply-To: <402DD461F109D411977E0008C791C312039F5E14@imp02mbx.one2one.co.uk>; from Sean.Hinde@one2one.co.uk on Wed, Mar 07, 2001 at 01:47:46PM -0000 References: <402DD461F109D411977E0008C791C312039F5E14@imp02mbx.one2one.co.uk> Message-ID: <20010307153131.A11452@idealx.com> Sean Hinde (Sean.Hinde@REDACTED) wrote: > I didn't envisage that any of these things would go away, and Erlang is a > pretty good reason to download and learn to drive emacs.. I do think though > that at least a dedicated erlang editor with: > > 1. Function name completion on tab, > 2. 'f1' to take you to the detailed doc for that function > 3. or even just bring up the possible function headers with the names of the > variables (kind of like you get when entering an equation in M$ Excel) - > this could even work without access to any docs and for our own functions in > our own modules in the current path. > 4. Click to jump to the function implementation. > 5. .. Take a look at Visual C++ or some of those things and steal (without > breaking any software copyright laws of course ;) ) the best and most > relevant ideas. Here is what I found on Ericsson site: http://www.ericsson.com/SE/rekryt/exjobb400.html It seems that some other people are thinking that such a tool would be valuable. -- Micka?l R?mond From etxmacr@REDACTED Wed Mar 7 15:45:22 2001 From: etxmacr@REDACTED (Mats Cronqvist) Date: Wed, 07 Mar 2001 15:45:22 +0100 Subject: Erlang Development Environment Message-ID: <200103071445.PAA26915@avc386.etxb.ericsson.se> > From: Sean Hinde <...> > 1. Function name completion on tab, > 2. 'f1' to take you to the detailed doc for that function > 3. or even just bring up the possible function headers with the names of the > variables (kind of like you get when entering an equation in M$ Excel) - > this could even work without access to any docs and for our own functions in > our own modules in the current path. > 4. Click to jump to the function implementation. > 5. .. Take a look at Visual C++ or some of those things and steal (without > breaking any software copyright laws of course ;) ) the best and most > relevant ideas. not that i would ever try to pass myself off as an emacs expert, but i believe points 2 & 4 are implemented in emacs/erlang.el 2. bind the 'f1' (or any other key) to erlang-man-function i have this in my .emacs; (setq erlang-root-dir "~/OTP")) (add-hook 'erlang-mode-hook 'my-erlang-mode-hook) (defun my-erlang-mode-hook () (local-set-key "\C-x\?" 'erlang-man-function)) 4. 'meta-.' should run the function erlang-find-tag (you could of course bind a click to this function). it grabs the function name at point and moves point to the function definition (possibly in a different module). you'll have to generate a tags file first, e.g. by running etags (in a unix shell it's "etags *erl") mats From mickael.remond@REDACTED Wed Mar 7 15:55:30 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Wed, 7 Mar 2001 15:55:30 +0100 Subject: Erlang Development Environment In-Reply-To: ; from etxuwig@etxb.ericsson.se on Wed, Mar 07, 2001 at 03:35:52PM +0100 References: <402DD461F109D411977E0008C791C312039F5E14@imp02mbx.one2one.co.uk> Message-ID: <20010307155530.B11452@idealx.com> Ulf Wiger (etxuwig@REDACTED) wrote: > > If anyone else wants to give CCviewer a spin, I'll gladly help out in > porting it to another design environment. It might be some work, but I > think it's well worth it. My main problem is that I never used ClearCase and I do not even know what it looks like. I am using CVS which is a very good Open Source versioning system. I am willing to help you on the road toward CVSviewer, but need help on the original ClearCase specific code. -- Micka?l R?mond From etxuwig@REDACTED Wed Mar 7 16:04:06 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 7 Mar 2001 16:04:06 +0100 (MET) Subject: Erlang Development Environment In-Reply-To: <20010307155530.B11452@idealx.com> Message-ID: On Wed, 7 Mar 2001, Mickael Remond wrote: >Ulf Wiger (etxuwig@REDACTED) wrote: >> >> If anyone else wants to give CCviewer a spin, I'll gladly help out in >> porting it to another design environment. It might be some work, but I >> think it's well worth it. > >My main problem is that I never used ClearCase and I do not even >know what it looks like. I am using CVS which is a very good Open >Source versioning system. It is, no doubt. >I am willing to help you on the road toward CVSviewer, but need help >on the original ClearCase specific code. This is good. I was hoping that someone using CVS would come forward. (: Let's give it a try, then. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From jamesh@REDACTED Wed Mar 7 16:13:01 2001 From: jamesh@REDACTED (James Hague) Date: Wed, 7 Mar 2001 09:13:01 -0600 Subject: Erlang Development Environment Message-ID: > 5. .. Take a look at Visual C++ or some of those things and > steal (without > breaking any software copyright laws of course ;) ) the best and most > relevant ideas. I use the Visual C++ IDE daily and I sheepishly admit that I ignore about 80% of the features it provides :) Even more sheepishly I'll admit that all the Erlang programming I've done for Windows has been with a freeware Notepad replacement :) James From Chandrashekhar.Mullaparthi@REDACTED Wed Mar 7 16:20:17 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Wed, 7 Mar 2001 15:20:17 -0000 Subject: Erlang Development Environment Message-ID: <402DD461F109D411977E0008C791C312039199D7@imp02mbx.one2one.co.uk> We use RCS. I tried to customise CCviewer but gave up very fast :) Can we do a RCSViewer too?! cheers, Chandru > -----Original Message----- > From: Ulf Wiger [mailto:etxuwig@REDACTED] > > > On Wed, 7 Mar 2001, Mickael Remond wrote: > > >Ulf Wiger (etxuwig@REDACTED) wrote: > >> > >I am willing to help you on the road toward CVSviewer, but need help > >on the original ClearCase specific code. > > This is good. I was hoping that someone using CVS would come > forward. (: > > Let's give it a try, then. > > /Uffe 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 etxuwig@REDACTED Wed Mar 7 16:26:20 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 7 Mar 2001 16:26:20 +0100 (MET) Subject: Erlang Development Environment In-Reply-To: <200103071445.PAA26915@avc386.etxb.ericsson.se> Message-ID: On Wed, 7 Mar 2001, Mats Cronqvist wrote: >2. bind the 'f1' (or any other key) to erlang-man-function > i have this in my .emacs; >(setq erlang-root-dir "~/OTP")) >(add-hook 'erlang-mode-hook 'my-erlang-mode-hook) >(defun my-erlang-mode-hook () >(local-set-key "\C-x\?" 'erlang-man-function)) > >4. 'meta-.' should run the function erlang-find-tag (you could of >course bind a click to this function). it grabs the function name at >point and moves point to the function definition (possibly in a >different module). >you'll have to generate a tags file first, e.g. by running etags (in a >unix shell it's "etags *erl") Just a wild idea: I've looked at the TAGS format, and it's simple enough. It could be created as a side-effect as CCviewer builds its source code and hypertext link cache. If some elisp-savvy hacker could modify erlang.el so that it fetches TAGS information via HTTP as needed, perhaps this functionality could be made available without having to explicitly build a TAGS file; and your TAGS information would be able to adapt to what branch of the source code you're looking at. Tell me if I'm smoking something funny. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From etxuwig@REDACTED Wed Mar 7 16:30:13 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 7 Mar 2001 16:30:13 +0100 (MET) Subject: Erlang Development Environment In-Reply-To: <402DD461F109D411977E0008C791C312039199D7@imp02mbx.one2one.co.uk> Message-ID: On Wed, 7 Mar 2001, Chandrashekhar Mullaparthi wrote: >We use RCS. I tried to customise CCviewer but gave up very fast :) >Can we do a RCSViewer too?! Sure, why not! I have nothing else to do. (: Seriously, though, I think the hard part is making it work on any other environment than ClearCase. If we get it to work for CVS, it probably mainly involves restructuring the code specific to the version control system, and writing some document explaining how an adaption is done. /Uffe > >cheers, >Chandru > >> -----Original Message----- >> From: Ulf Wiger [mailto:etxuwig@REDACTED] >> >> >> On Wed, 7 Mar 2001, Mickael Remond wrote: >> >> >Ulf Wiger (etxuwig@REDACTED) wrote: >> >> >> >I am willing to help you on the road toward CVSviewer, but need help >> >on the original ClearCase specific code. >> >> This is good. I was hoping that someone using CVS would come >> forward. (: >> >> Let's give it a try, then. >> >> /Uffe > > > >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. > > -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From Sean.Hinde@REDACTED Wed Mar 7 18:57:55 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Wed, 7 Mar 2001 17:57:55 -0000 Subject: Erlang Development Environment Message-ID: <402DD461F109D411977E0008C791C312039F5E17@imp02mbx.one2one.co.uk> > > 2. 'f1' to take you to the detailed doc for that function >>2. bind the 'f1' (or any other key) to erlang-man-function >> i have this in my .emacs; Thanks for the tip, I'll give it a go: The one I would really like is the option to just see a list of possible parameter names for this function. Invariably this is all I am looking in the docs for anyway - I can't remember the order of the damn parameters (even worse for my own libraries half the time as the documentation is elsewhere (or it is the source :( )). I am certainly not suggesting that we have Visual C++ on acid - but there is some functionality which I believe would really help (especially those people who can't get on with emacs or don't have access). > > 4. Click to jump to the function implementation. > you'll have to generate a tags file first, e.g. by running > etags (in a > unix shell it's "etags *erl") Yes, I am aware of this one. The additional benefit would be that I wouldn't have to generate the new tags file every time I wrote a new function... - 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 cpressey@REDACTED Wed Mar 7 19:53:37 2001 From: cpressey@REDACTED (Chris Pressey) Date: Wed, 07 Mar 2001 12:53:37 -0600 Subject: Speaking of documentation Message-ID: <3AA683B1.59D788DC@catseye.mb.ca> Is there a supported "autodoc" facility for Erlang, where one can write documentation embedded in comments in the code, which is then extracted and processed into 'formal' documentation in HTML (or whatever)? I've noticed some unexplained comment sentinels in various sources, but I've also noticed that the documentation and code are in seperate files for all of the library modules I've looked into so far. Thanks in advance _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From davidg@REDACTED Wed Mar 7 20:41:21 2001 From: davidg@REDACTED (David Gould) Date: Wed, 7 Mar 2001 11:41:21 -0800 Subject: Erlang Development Environment In-Reply-To: ; from Ulf Wiger on Wed, Mar 07, 2001 at 04:26:20PM +0100 References: <200103071445.PAA26915@avc386.etxb.ericsson.se> Message-ID: <20010307114121.A10822@dnai.com> On Wed, Mar 07, 2001 at 04:26:20PM +0100, Ulf Wiger wrote: > On Wed, 7 Mar 2001, Mats Cronqvist wrote: > > >2. bind the 'f1' (or any other key) to erlang-man-function > > i have this in my .emacs; > >(setq erlang-root-dir "~/OTP")) > >(add-hook 'erlang-mode-hook 'my-erlang-mode-hook) > >(defun my-erlang-mode-hook () > >(local-set-key "\C-x\?" 'erlang-man-function)) > > > >4. 'meta-.' should run the function erlang-find-tag (you could of > >course bind a click to this function). it grabs the function name at > >point and moves point to the function definition (possibly in a > >different module). > > >you'll have to generate a tags file first, e.g. by running etags (in a > >unix shell it's "etags *erl") > > > Just a wild idea: I've looked at the TAGS format, and it's simple > enough. It could be created as a side-effect as CCviewer builds > its source code and hypertext link cache. > > If some elisp-savvy hacker could modify erlang.el so that it > fetches TAGS information via HTTP as needed, perhaps this > functionality could be made available without having to explicitly > build a TAGS file; and your TAGS information would be able to adapt > to what branch of the source code you're looking at. > > Tell me if I'm smoking something funny. No, this could work. Of course it would not be particularly useful being so emacs specific. If regular ctags format tags could be made so that vi could use it too, well, that would be useful! ;-) More seriously, vim is pretty configurable (ok, too configurable), and there is already a vim syntax highlighter for Erlang. Is there any interest in a real vim erlang mode? -dg -- David Gould davidg@REDACTED 510 536 1443 If simplicity worked, the world would be overrun with insects. From davidg@REDACTED Wed Mar 7 20:49:01 2001 From: davidg@REDACTED (David Gould) Date: Wed, 7 Mar 2001 11:49:01 -0800 Subject: Erlang Development Environment In-Reply-To: ; from Ulf Wiger on Wed, Mar 07, 2001 at 04:30:13PM +0100 References: <402DD461F109D411977E0008C791C312039199D7@imp02mbx.one2one.co.uk> Message-ID: <20010307114901.B10822@dnai.com> On Wed, Mar 07, 2001 at 04:30:13PM +0100, Ulf Wiger wrote: > On Wed, 7 Mar 2001, Chandrashekhar Mullaparthi wrote: > > >We use RCS. I tried to customise CCviewer but gave up very fast :) > >Can we do a RCSViewer too?! > > Sure, why not! > I have nothing else to do. (: You get lucky here, CVS uses RCS to store its files. So if it can work for RCS, it will also mostly work for CVS. Of course, CVS adds another layer of features, so there might be more capability in CVS mode. Oh, Chandru, why do you use RCS instead of CVS? Just curious. I use RCS alone when I play sysadmin, so if I mess up configuring something, I have a fallback plan, and also to document changes made to a system. But for software development, CVS seems much nicer unless you have only a few files. > Seriously, though, I think the hard part is making it work on any > other environment than ClearCase. If we get it to work for CVS, it > probably mainly involves restructuring the code specific to the > version control system, and writing some document explaining how an > adaption is done. There is also cscope which does some of what people are asking for here, perhaps it could be adapted. -dg -- David Gould davidg@REDACTED 510 536 1443 If simplicity worked, the world would be overrun with insects. From davidg@REDACTED Wed Mar 7 21:29:44 2001 From: davidg@REDACTED (David Gould) Date: Wed, 7 Mar 2001 12:29:44 -0800 Subject: Speaking of documentation In-Reply-To: <3AA683B1.59D788DC@catseye.mb.ca>; from Chris Pressey on Wed, Mar 07, 2001 at 12:53:37PM -0600 References: <3AA683B1.59D788DC@catseye.mb.ca> Message-ID: <20010307122944.C10822@dnai.com> On Wed, Mar 07, 2001 at 12:53:37PM -0600, Chris Pressey wrote: > Is there a supported "autodoc" facility for Erlang, where one can write > documentation embedded in comments in the code, which is then extracted > and processed into 'formal' documentation in HTML (or whatever)? I like the "literate haskell style" in some flavors. Instead of the source text being read as all code and comments specially delimited, the source is all comments and the code is specially delimited. There also seems to be a more formal literate style where the source is really a latex document with the code embedded in its own \begin{code} ... \end{code} blocks. The following is a sample from a CGI module in haskell. This can be read by the compiler and also by latex to product formatted documentation. It also looks fairly easy to implement and seems reasonably readable and maintainable. ------------------------ snippet from CGI.lhs ----------------------- %*************************************************************************** %* * \subsection[CGI-HTTP-Resp]{HTTP Responses} %* * %*************************************************************************** The output of a CGI script is a HTTP response (part of, the server adds additional noise), which is either some MIME content, a redirection to some other location, or an error status. We make CgiOut an instance of the Show class so that we don't have to worry about the exact format of the response that is required by the HTTP definition. I think what we really want is to use an existential type here! data CgiOut = Mime a => Content{content :: a} | .... We are not interested in the content type, we only need to know it is in the Mime class. What is missing is a table of (StatusCode,Reason)-pairs such as (503, "server busy") and (200, "Transaction ok") etc. \begin{code} type StatusCode = Int type Reason = String data Mime a => CgiOut a = Content{mime :: a} | Location{url :: URL} | Status{status :: StatusCode, reason :: Reason} instance Mime a => Show (CgiOut a) where showsPrec _ Content{mime=mime} = showString "Content-type: " . showString (mimeType mime) . showString "\n\n" . shows mime showsPrec _ Location{url=url} = showString "Location: " . showString url . showString "\n\n" showsPrec _ Status{status=status,reason=reason} = showString "Status: " . shows status . showString " " . showString reason . showString "\n\n" \end{code} ---------------------------- end snippet ---------------------------- Just something to think about. -dg -- David Gould davidg@REDACTED 510 536 1443 If simplicity worked, the world would be overrun with insects. From etxuwig@REDACTED Wed Mar 7 23:22:58 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 7 Mar 2001 23:22:58 +0100 (MET) Subject: Erlang Development Environment In-Reply-To: <20010307114121.A10822@dnai.com> Message-ID: On Wed, 7 Mar 2001, David Gould wrote: >> If some elisp-savvy hacker could modify erlang.el so that it >> fetches TAGS information via HTTP as needed, perhaps this >> functionality could be made available without having to explicitly >> build a TAGS file; and your TAGS information would be able to adapt >> to what branch of the source code you're looking at. >> >> Tell me if I'm smoking something funny. > >No, this could work. Of course it would not be particularly useful >being so emacs specific. If regular ctags format tags could be made >so that vi could use it too, well, that would be useful! ;-) We had a couple of people who swore by vi and wouldn't program in anything else. I don't know if any of them are still here... I'd need help with the LISP hacking, though. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From tony@REDACTED Wed Mar 7 23:30:16 2001 From: tony@REDACTED (Tony Rogvall) Date: Wed, 07 Mar 2001 23:30:16 +0100 Subject: Erlang Development Environment References: <20010306090558.A9439@erlang-fr.org> Message-ID: <3AA6B678.F52B3BC5@bluetail.com> Mickael Remond wrote: > Torbjorn Tornkvist (tobbe@REDACTED) wrote: > > > > JFYI: Tony Rogvall has made a coupling between Erlang an GTK. > > I think the plan is to release it to the OTP team (don't take > > my word for it though). However, I'm not sure how well GTK > > works under Windows. > > Hum. That's great ! I hope he will release his code because it would be > very useful. GTK is a very powerful toolkit. > > For the Windows part, I think this should work on Windows: > - Because GTK started in the GIMP (Image manipulation tool) project. > GIMP has been ported on Windows, so I think the toolkit should work. > - Because I have heard that Gnome has been ported on Windows. Gnome is a > GTK based desktop, so ... > > -- > Micka?l R?mond > http://www.erlang-fr.org/ Erlang/GTK do work under windows (some minor stuff with Gtk version is 1.3 under windows while the unix version is based on 1.2.8). Most stuff missing and things that are incomplete today will resolve nicely when Gtk2.0 is released. Then most things are glib objects and I can attach hooks to about everything :-) Yes GTK is nice and I hope to have a pre-release soon (I have also made a glade2erl program and some extensions to glade that will make simple gui stuff just a mouse click away...) See you then :-) /Tony From Chandrashekhar.Mullaparthi@REDACTED Thu Mar 8 11:43:14 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Thu, 8 Mar 2001 10:43:14 -0000 Subject: Erlang Development Environment Message-ID: <402DD461F109D411977E0008C791C312039199DA@imp02mbx.one2one.co.uk> Mostly historical reasons. It started off with just Sean hacking away in the dark ages and suddenly we have so much code under RCS now and none of us have the time to try anything new! Thats why I'm keen to see CCviewer being made generic enough to handle any version control system - even no version control system. cheers, Chandru > -----Original Message----- > From: David Gould [mailto:davidg@REDACTED] > On Wed, Mar 07, 2001 at 04:30:13PM +0100, Ulf Wiger wrote: > > On Wed, 7 Mar 2001, Chandrashekhar Mullaparthi wrote: > > > > >We use RCS. I tried to customise CCviewer but gave up very fast :) > > >Can we do a RCSViewer too?! > > > > Sure, why not! > > I have nothing else to do. (: > > You get lucky here, CVS uses RCS to store its files. So if it can work > for RCS, it will also mostly work for CVS. Of course, CVS adds another > layer of features, so there might be more capability in CVS mode. > > Oh, Chandru, why do you use RCS instead of CVS? Just curious. > I use RCS alone > when I play sysadmin, so if I mess up configuring something, I have a > fallback plan, and also to document changes made to a system. But for > software development, CVS seems much nicer unless you have > only a few files. > 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 Thu Mar 8 13:06:27 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Thu, 8 Mar 2001 12:06:27 -0000 Subject: Erlang Development Environment Message-ID: <402DD461F109D411977E0008C791C312039F5E1B@imp02mbx.one2one.co.uk> And I quite like it's simplicity.. We looked again at clearcase but didn't have a vacancy for the full time clearcase adminstrator.. Maybe it is time to move to RCS though :) > Mostly historical reasons. It started off with just Sean > hacking away in the > dark ages and suddenly we have so much code under RCS now and > none of us > have the time to try anything new! 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 mickael.remond@REDACTED Thu Mar 8 14:31:42 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Thu, 8 Mar 2001 14:31:42 +0100 Subject: Speaking of documentation In-Reply-To: <3AA683B1.59D788DC@catseye.mb.ca>; from cpressey@catseye.mb.ca on Wed, Mar 07, 2001 at 12:53:37PM -0600 References: <3AA683B1.59D788DC@catseye.mb.ca> Message-ID: <20010308143142.A10124@idealx.com> Chris Pressey (cpressey@REDACTED) wrote: > Is there a supported "autodoc" facility for Erlang, where one can write > documentation embedded in comments in the code, which is then extracted > and processed into 'formal' documentation in HTML (or whatever)? > > I've noticed some unexplained comment sentinels in various sources, but > I've also noticed that the documentation and code are in seperate files > for all of the library modules I've looked into so far. We are using a very simple in-house documentation tool that produces Latex documentation of the code. Maybe we should release this tool if you that it could serve as a basis for further improvement. I am also looking seriously at CCviewer: It might be great to integrate such a doc tool with Ulf Wiger's source code browser. I must dig deeper to see if/how this could be feasible. -- Micka?l R?mond From davidg@REDACTED Thu Mar 8 22:14:53 2001 From: davidg@REDACTED (David Gould) Date: Thu, 8 Mar 2001 13:14:53 -0800 Subject: Erlang Development Environment In-Reply-To: <402DD461F109D411977E0008C791C312039F5E1B@imp02mbx.one2one.co.uk>; from Sean Hinde on Thu, Mar 08, 2001 at 12:06:27PM -0000 References: <402DD461F109D411977E0008C791C312039F5E1B@imp02mbx.one2one.co.uk> Message-ID: <20010308131453.A18994@dnai.com> On Thu, Mar 08, 2001 at 12:06:27PM -0000, Sean Hinde wrote: > And I quite like it's simplicity.. We looked again at clearcase but didn't > have a vacancy for the full time clearcase adminstrator.. I have ranted before about clearcase. So I will confine myself to a small word of advice when someone says they want to use it: Run Away! Flee! Save yourself! > Maybe it is time to move to RCS though :) If you meant CVS, I would say yes. This should be pretty easy. Another option is Perforce. It is commercial software, but pretty good for all that and has some really nice features that make it a little more friendly than CVS for some tasks. > > Mostly historical reasons. It started off with just Sean > > hacking away in the > > dark ages and suddenly we have so much code under RCS now and > > none of us > > have the time to try anything new! If you know how to work with RCS, you are 50% of the way to CVS anyway. -dg -- David Gould davidg@REDACTED 510 536 1443 If simplicity worked, the world would be overrun with insects. From Chandrashekhar.Mullaparthi@REDACTED Fri Mar 9 11:42:25 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Fri, 9 Mar 2001 10:42:25 -0000 Subject: New mnesia events Message-ID: <402DD461F109D411977E0008C791C312039199E1@imp02mbx.one2one.co.uk> I think it will be useful if mnesia could issue the following events. {table_created, Table} {table_deleted, Table} {table_available, Table} - This would be like an asynchronous version of mnesia:wait_for_tables(Tables, Timeout). Right now, I have some very big tables and a process which uses them doesn't know when they will be available. But it can't wait forever in mnesia:wait_for_tables - the way to do it now would be to have a timer to periodically check if the required table is available. Would be easier if my process could just subscribe for an event. The first two would be useful in a case where tables are created/deleted dynamically in an application. The way to do it now would be to use mnesia:report_event - but it would be nice to have a standard way of knowing when a table has been created/deleted. The table event {delete, {Tab, Key}, ActivityId} is not issued for each key when a table is deleted - which is sensible - but {table_deleted, Table} would nicely fill the gap. cheers, Chandru 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 dgud@REDACTED Fri Mar 9 12:01:00 2001 From: dgud@REDACTED (Dan Gudmundsson) Date: Fri, 9 Mar 2001 12:01:00 +0100 (MET) Subject: New mnesia events In-Reply-To: <402DD461F109D411977E0008C791C312039199E1@imp02mbx.one2one.co.uk> References: <402DD461F109D411977E0008C791C312039199E1@imp02mbx.one2one.co.uk> Message-ID: <15016.47084.802723.290648@gargle.gargle.HOWL> Sounds nice, if I got the time I'll add it in the R8 release.. /Dan Chandrashekhar Mullaparthi writes: > I think it will be useful if mnesia could issue the following events. > > {table_created, Table} > {table_deleted, Table} > {table_available, Table} - This would be like an asynchronous version of > mnesia:wait_for_tables(Tables, Timeout). Right now, I have some very big > tables and a process which uses them doesn't know when they will be > available. But it can't wait forever in mnesia:wait_for_tables - the way to > do it now would be to have a timer to periodically check if the required > table is available. Would be easier if my process could just subscribe for > an event. > > The first two would be useful in a case where tables are created/deleted > dynamically in an application. The way to do it now would be to use > mnesia:report_event - but it would be nice to have a standard way of knowing > when a table has been created/deleted. > > The table event {delete, {Tab, Key}, ActivityId} is not issued for each key > when a table is deleted - which is sensible - but {table_deleted, Table} > would nicely fill the gap. > > cheers, > Chandru > From Chandrashekhar.Mullaparthi@REDACTED Fri Mar 9 12:08:57 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Fri, 9 Mar 2001 11:08:57 -0000 Subject: New mnesia events Message-ID: <402DD461F109D411977E0008C791C312039199E2@imp02mbx.one2one.co.uk> It's pretty neat - but what if the record definition for schema itself changes.... I need the definition for the schema record to know the name of the table created - Isn't that internal to mnesia?? cheers, Chandru > -----Original Message----- > From: Hakan Mattsson [mailto:hakan@REDACTED] > Sent: 9 March 2001 11:02 > To: Chandrashekhar Mullaparthi > Cc: 'Erlang mailing list' > Subject: Re: New mnesia events > > > On Fri, 9 Mar 2001, Chandrashekhar Mullaparthi wrote: > > Chandrashekhar> I think it will be useful if mnesia could > issue the following events. > Chandrashekhar> > Chandrashekhar> {table_created, Table} > Chandrashekhar> {table_deleted, Table} > > Don't you like mnesia:subscribe({table, schema})? > > Chandrashekhar> {table_available, Table} - This would be like > an asynchronous version of > Chandrashekhar> mnesia:wait_for_tables(Tables, Timeout). > Right now, I have some very big > Chandrashekhar> tables and a process which uses them doesn't > know when they will be > Chandrashekhar> available. But it can't wait forever in > mnesia:wait_for_tables - the way to > Chandrashekhar> do it now would be to have a timer to > periodically check if the required > Chandrashekhar> table is available. Would be easier if my > process could just subscribe for > Chandrashekhar> an event. > Chandrashekhar> > Chandrashekhar> The first two would be useful in a case where > tables are created/deleted > Chandrashekhar> dynamically in an application. The way to do > it now would be to use > Chandrashekhar> mnesia:report_event - but it would be nice to > have a standard way of knowing > Chandrashekhar> when a table has been created/deleted. > > You always have the option of spawning a separate process in order > to perform the monitoring of when tables gets loaded, but my original > idea was to handle thos via the event mechanism. > > Chandrashekhar> The table event {delete, {Tab, Key}, > ActivityId} is not issued for each key > Chandrashekhar> when a table is deleted - which is sensible - > but {table_deleted, Table} > Chandrashekhar> would nicely fill the gap. > > As mentioned above, use the mnesia:subscribe/1 function. > > /H?kan > > --- > H?kan Mattsson > Ericsson > Computer Science Laboratory > http://www.ericsson.se/cslab/~hakan > > > --- CUT --- CUT --- CUT --- CUT --- CUT --- CUT --- CUT --- CUT -- > unix> erl > Erlang (BEAM) emulator version 5.0.2 [threads] > > Eshell V5.0.2 (abort with ^G) > 1> mnesia:start(). > ok > 2> mnesia:subscribe({table, schema}). > {ok,nonode@REDACTED} > 3> mnesia:create_table(a_brand_new_table, []). > {atomic,ok} > 4> flush(). > Shell got {mnesia_table_event,{write,{schema, > a_brand_new_table, > [{name,a_brand_new_table}, > {type,set}, > > {ram_copies,[nonode@REDACTED]}, > {disc_copies,[]}, > {disc_only_copies,[]}, > {load_order,0}, > {access_mode,read_write}, > {index,[]}, > {snmp,[]}, > {local_content,false}, > > {record_name,a_brand_new_table}, > {attributes,[key,val]}, > {user_properties,[]}, > {frag_properties,[]}, > {cookie, > {{984,134919,30740}, > nonode@REDACTED}}, > {version,{{2,0},[]}}]}, > {tid,3,<0.63.0>}}} > Shell got {mnesia_table_event,{write,{schema, > a_brand_new_table, > [{name,a_brand_new_table}, > {type,set}, > > {ram_copies,[nonode@REDACTED]}, > {disc_copies,[]}, > {disc_only_copies,[]}, > {load_order,0}, > {access_mode,read_write}, > {index,[]}, > {snmp,[]}, > {local_content,false}, > > {record_name,a_brand_new_table}, > {attributes,[key,val]}, > {user_properties,[]}, > {frag_properties,[]}, > {cookie, > {{984,134919,30740}, > nonode@REDACTED}}, > {version,{{2,0},[]}}]}, > {tid,3,<0.63.0>}}} > 5> mnesia:delete_table(a_brand_new_table). > {atomic,ok} > 6> flush(). > Shell got {mnesia_table_event,{delete,{schema, > a_brand_new_table, > [{name,a_brand_new_table}, > {type,set}, > > {ram_copies,[nonode@REDACTED]}, > {disc_copies,[]}, > {disc_only_copies,[]}, > {load_order,0}, > {access_mode,read_write}, > {index,[]}, > {snmp,[]}, > {local_content,false}, > > {record_name,a_brand_new_table}, > {attributes,[key,val]}, > {user_properties,[]}, > {frag_properties,[]}, > {cookie, > {{984,135646,22951}, > nonode@REDACTED}}, > {version,{{2,0},[]}}]}, > {tid,4,<0.66.0>}}} > ok > BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded > (v)ersion (k)ill (D)b-tables (d)istribution7> > unix> > 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 Fri Mar 9 12:17:27 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 9 Mar 2001 11:17:27 -0000 Subject: Erlang Development Environment Message-ID: <402DD461F109D411977E0008C791C312039F5E1E@imp02mbx.one2one.co.uk> > > Maybe it is time to move to RCS though :) > > If you meant CVS, I would say yes. This should be pretty easy. Duh. Thanks for the perforce suggestion - 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 Fri Mar 9 12:32:36 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 9 Mar 2001 11:32:36 -0000 Subject: Erlang Development Environment Message-ID: <402DD461F109D411977E0008C791C312039F5E1F@imp02mbx.one2one.co.uk> All, > 3. or even just bring up the possible function headers with > the names of the > variables (kind of like you get when entering an equation in > M$ Excel) - > this could even work without access to any docs and for our > own functions in > our own modules in the current path. OK, Here it is.. code_finder:start(). to start. Hit "Update", wait for a minute or so and then you can search away in all exported functions in your path. e.g. mnesia - greps all functions with mnesia anywhere in the module or function name mnesia: - lists only functions exported from the mnesia module mnesia:dirty - lists all functions exported from mnesia containing the string "dirty" mnesia:dirty/1 - lists all functions exported from mnesia containing the string dirty of arity 1. Hit Return or click Find to search. If anyone finds any bugs or finds the TODO items so annoying they feel inspired to implement them then be my guest - please just let me know. Enjoy! - Sean P.S It would have been somewhat quicker to write if the docs for the Abstract form and its toolset were a little more informative :) 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. -------------- next part -------------- A non-text attachment was scrubbed... Name: code_finder.erl Type: application/octet-stream Size: 11528 bytes Desc: not available URL: From hakan@REDACTED Fri Mar 9 12:02:25 2001 From: hakan@REDACTED (Hakan Mattsson) Date: Fri, 9 Mar 2001 12:02:25 +0100 (MET) Subject: New mnesia events In-Reply-To: <402DD461F109D411977E0008C791C312039199E1@imp02mbx.one2one.co.uk> Message-ID: On Fri, 9 Mar 2001, Chandrashekhar Mullaparthi wrote: Chandrashekhar> I think it will be useful if mnesia could issue the following events. Chandrashekhar> Chandrashekhar> {table_created, Table} Chandrashekhar> {table_deleted, Table} Don't you like mnesia:subscribe({table, schema})? Chandrashekhar> {table_available, Table} - This would be like an asynchronous version of Chandrashekhar> mnesia:wait_for_tables(Tables, Timeout). Right now, I have some very big Chandrashekhar> tables and a process which uses them doesn't know when they will be Chandrashekhar> available. But it can't wait forever in mnesia:wait_for_tables - the way to Chandrashekhar> do it now would be to have a timer to periodically check if the required Chandrashekhar> table is available. Would be easier if my process could just subscribe for Chandrashekhar> an event. Chandrashekhar> Chandrashekhar> The first two would be useful in a case where tables are created/deleted Chandrashekhar> dynamically in an application. The way to do it now would be to use Chandrashekhar> mnesia:report_event - but it would be nice to have a standard way of knowing Chandrashekhar> when a table has been created/deleted. You always have the option of spawning a separate process in order to perform the monitoring of when tables gets loaded, but my original idea was to handle thos via the event mechanism. Chandrashekhar> The table event {delete, {Tab, Key}, ActivityId} is not issued for each key Chandrashekhar> when a table is deleted - which is sensible - but {table_deleted, Table} Chandrashekhar> would nicely fill the gap. As mentioned above, use the mnesia:subscribe/1 function. /H?kan --- H?kan Mattsson Ericsson Computer Science Laboratory http://www.ericsson.se/cslab/~hakan --- CUT --- CUT --- CUT --- CUT --- CUT --- CUT --- CUT --- CUT -- unix> erl Erlang (BEAM) emulator version 5.0.2 [threads] Eshell V5.0.2 (abort with ^G) 1> mnesia:start(). ok 2> mnesia:subscribe({table, schema}). {ok,nonode@REDACTED} 3> mnesia:create_table(a_brand_new_table, []). {atomic,ok} 4> flush(). Shell got {mnesia_table_event,{write,{schema, a_brand_new_table, [{name,a_brand_new_table}, {type,set}, {ram_copies,[nonode@REDACTED]}, {disc_copies,[]}, {disc_only_copies,[]}, {load_order,0}, {access_mode,read_write}, {index,[]}, {snmp,[]}, {local_content,false}, {record_name,a_brand_new_table}, {attributes,[key,val]}, {user_properties,[]}, {frag_properties,[]}, {cookie, {{984,134919,30740}, nonode@REDACTED}}, {version,{{2,0},[]}}]}, {tid,3,<0.63.0>}}} Shell got {mnesia_table_event,{write,{schema, a_brand_new_table, [{name,a_brand_new_table}, {type,set}, {ram_copies,[nonode@REDACTED]}, {disc_copies,[]}, {disc_only_copies,[]}, {load_order,0}, {access_mode,read_write}, {index,[]}, {snmp,[]}, {local_content,false}, {record_name,a_brand_new_table}, {attributes,[key,val]}, {user_properties,[]}, {frag_properties,[]}, {cookie, {{984,134919,30740}, nonode@REDACTED}}, {version,{{2,0},[]}}]}, {tid,3,<0.63.0>}}} 5> mnesia:delete_table(a_brand_new_table). {atomic,ok} 6> flush(). Shell got {mnesia_table_event,{delete,{schema, a_brand_new_table, [{name,a_brand_new_table}, {type,set}, {ram_copies,[nonode@REDACTED]}, {disc_copies,[]}, {disc_only_copies,[]}, {load_order,0}, {access_mode,read_write}, {index,[]}, {snmp,[]}, {local_content,false}, {record_name,a_brand_new_table}, {attributes,[key,val]}, {user_properties,[]}, {frag_properties,[]}, {cookie, {{984,135646,22951}, nonode@REDACTED}}, {version,{{2,0},[]}}]}, {tid,4,<0.66.0>}}} ok BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution7> unix> From Chandrashekhar.Mullaparthi@REDACTED Fri Mar 9 12:48:55 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Fri, 9 Mar 2001 11:48:55 -0000 Subject: Erlang Development Environment Message-ID: <402DD461F109D411977E0008C791C312039199E5@imp02mbx.one2one.co.uk> Good one Sean!! I like it! cheers, > -----Original Message----- > From: Sean Hinde [mailto:Sean.Hinde@REDACTED] > OK, Here it is.. > > code_finder:start(). to start. Hit "Update", wait for a > minute or so and > then you can search away in all exported functions in your path. > > e.g. > > mnesia - greps all functions with mnesia anywhere in the > module or function > name > mnesia: - lists only functions exported from the mnesia module > mnesia:dirty - lists all functions exported from mnesia containing the > string "dirty" > mnesia:dirty/1 - lists all functions exported from mnesia > containing the > string dirty of arity 1. > > Hit Return or click Find to search. > > If anyone finds any bugs or finds the TODO items so annoying they feel > inspired to implement them then be my guest - please just let me know. > > Enjoy! > > - Sean > > P.S It would have been somewhat quicker to write if the docs for the > Abstract form and its toolset were a little more informative :) > 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 Peter.Andersson@REDACTED Fri Mar 9 14:04:40 2001 From: Peter.Andersson@REDACTED (Peter Andersson) Date: Fri, 09 Mar 2001 13:04:40 +0000 Subject: Erlang Development Environment References: <402DD461F109D411977E0008C791C312039199E5@imp02mbx.one2one.co.uk> Message-ID: <3AA8D4E7.82C570FB@eei.ericsson.se> Chandrashekhar Mullaparthi wrote: > > Good one Sean!! I like it! Sucking up to the boss, are we!? :-) Seriously, I also liked it a lot - very useful! Thanks Sean! An improvement would perhaps be the possibility to save the retrieved data (from an update) to file so that you don't have to collect the info from scratch every time you start the program. I suppose using e.g. dets, it would be quite a quick thing to implement? While we're on the subject of easy access to documentation... I've sometimes found it useful to be able to view Erlang man pages from the Erlang shell. I wrote a very simple program the other day that either prints a page to stdout or lets you perform some string searching within a page. If anyone's interested I'll post it. Regards /Peter > > -----Original Message----- > > From: Sean Hinde [mailto:Sean.Hinde@REDACTED] > > OK, Here it is.. > > > > code_finder:start(). to start. Hit "Update", wait for a > > minute or so and > > then you can search away in all exported functions in your path. > > > > e.g. > > > > mnesia - greps all functions with mnesia anywhere in the > > module or function > > name > > mnesia: - lists only functions exported from the mnesia module > > mnesia:dirty - lists all functions exported from mnesia containing the > > string "dirty" > > mnesia:dirty/1 - lists all functions exported from mnesia > > containing the > > string dirty of arity 1. > > > > Hit Return or click Find to search. > > > > If anyone finds any bugs or finds the TODO items so annoying they feel > > inspired to implement them then be my guest - please just let me know. > > > > Enjoy! > > > > - Sean > > > > P.S It would have been somewhat quicker to write if the docs for the > > Abstract form and its toolset were a little more informative :) > > > > 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. -- ?--? ? - ? ?-? ?--? ? ?--? ?--? ? ?- -? -?? ? ?-? ??? ??? --- -? Peter "Peppe" Andersson Ericsson Systems Expertise Ltd, Ireland address: Ericsson Software Campus address: Apartment No 43 (work) Athlone, Co. Westmeath (home) Irishtown Central Athlone, Co. Westmeath fax: +353 902 31304 phone: +353 902 31784 phone(mobile): +353 86 815 3813 email: Peter.Andersson@REDACTED ~ Anthony's Law of Force: "Do not force it, get a larger hammer" ~ ?--? ? - ? ?-? ?--? ? ?--? ?--? ? ?- -? -?? ? ?-? ??? ??? --- -? From srl@REDACTED Fri Mar 9 14:31:51 2001 From: srl@REDACTED (Steve Langstaff) Date: Fri, 9 Mar 2001 13:31:51 -0000 Subject: IC and CORBA_SYSTEM_EXCEPTION Message-ID: <01C0A89D.4D663690.srl@terminus.ericsson.se> Hi All. I'm looking at using IC to generate an Erlang:C interface between 2 nodes in a network... all is going OK apart from one scenario (so far): I've got 1 Erlang genserver providing a generic set of client access functions. I've got 2 'C' servers, one of which implements the full IDL-specified interface and one which implements a subset... For the server that implements the full IDL-specified interface, everything works OK. For the server that implements the subset of the IDL-specified interface, I want the client access function call to be informed if the function is not implemented by the server. As far as I can see, the example C server code does not pass back CORBA_SYSTEM_EXCEPTION back to the client: ... status = ei_receive_encoded(env->_fd, &env->_inbuf, &env->_inbufsz, &msg, &env->_iin); switch(status) { case ERL_SEND: case ERL_REG_SEND : /* do transaction with fd */ whatever_module__switch(NULL,env); switch(env->_major) { case CORBA_NO_EXCEPTION: /* Success */ break; case CORBA_SYSTEM_EXCEPTION: /* System exception */ printf("Request failure, reason : %s\n",(char *) CORBA_exception_value(env)); CORBA_exception_free(env); break; default: /* Should not come here */ CORBA_exception_free(env); break; } /* send outdata */ if (env->_iout > 0) ei_send_encoded(env->_fd,&env->_caller,env->_outbuf,env->_iout); break; ... env->_major is set to CORBA_SYSTEM_EXCEPTION because whatever_module__switch() does not implement the function. env->_iout count appears to be set to 0. Shouldn't there be some kind of ei_send_encoded() call to return an error to the client? NB. I don't want to use a timeout on the client side because a) I don't know the maximum time that valid function calls will take and b) the server has detected an error and should be capable of sending an error response. Ideas? -- Steve L. From Sean.Hinde@REDACTED Fri Mar 9 14:32:43 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 9 Mar 2001 13:32:43 -0000 Subject: Erlang Development Environment Message-ID: <402DD461F109D411977E0008C791C312039F5E22@imp02mbx.one2one.co.uk> Peter, > An improvement > would perhaps be the possibility to save the retrieved data > (from an update) to > file so that you don't have to collect the info from scratch > every time you > start the program. I suppose using e.g. dets, it would be > quite a quick thing to > implement? I agree - it is on the TODO list in the source. The easiest way would be to just save the list of functions as a term to a file. > While we're on the subject of easy access to documentation... > I've sometimes > found it useful to be able to view Erlang man pages from the > Erlang shell. I > wrote a very simple program the other day that either prints > a page to stdout or > lets you perform some string searching within a page. If > anyone's interested > I'll post it. That sounds useful. It would also be easy to add a button to get the man page for the currently selected module in the code_finder (maybe even to jump to the right function - Hm, that'd be neat). - 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 etxuwig@REDACTED Fri Mar 9 14:43:43 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Fri, 9 Mar 2001 14:43:43 +0100 (MET) Subject: Erlang Development Environment In-Reply-To: <3AA8D4E7.82C570FB@eei.ericsson.se> Message-ID: On Fri, 9 Mar 2001, Peter Andersson wrote: >While we're on the subject of easy access to documentation... I've >sometimes found it useful to be able to view Erlang man pages from >the Erlang shell. Perhaps you could fix the man.erl program in the gs examples while you're at it. It seems to have rotted a bit. With the following, it will at least display man pages. Unfortunately, they're not properly formatted. I'll leave that for someone else to play with. /Uffe > diff man.erl /OTP/.../lib/gs-1.3.7/examples/src/man.erl 89c89 < sort(FirstList). --- > sort(check_4_last(FirstList)). 90a91,98 > check_4_last([]) -> []; > check_4_last([H|T]) -> > case catch(get_4_last(reverse(H))) of > [46,116,120,116] -> % ".txt" > [remove_4_last(H)|check_4_last(T)]; > Any -> > check_4_last(T) > end. 91a100,101 > get_4_last([H1,H2,H3,H4|T]) -> > [H4,H3,H2,H1]. 92a103,106 > remove_4_last(Str) -> > reverse(tl(tl(tl(tl(reverse(Str)))))). > > 98c112 < Filename = filename:join(dirManual(), Page), --- > Filename = lists:flatten([dirManual(),Page,".txt"]), /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From Peter.Andersson@REDACTED Fri Mar 9 16:12:59 2001 From: Peter.Andersson@REDACTED (Peter Andersson) Date: Fri, 09 Mar 2001 15:12:59 +0000 Subject: Erlang Development Environment References: <402DD461F109D411977E0008C791C312039F5E22@imp02mbx.one2one.co.uk> Message-ID: <3AA8F2FB.6493187F@eei.ericsson.se> Sean Hinde wrote: > > That sounds useful. It would also be easy to add a button to get the man > page for the currently selected module in the code_finder (maybe even to > jump to the right function - Hm, that'd be neat). > Hi Sean, I like that idea. Then I think the text should be extracted from the man page source files to be searched through and displayed. My little hack "cheats" in the sense that it presents text already processed by "erl -man". I was going to change it to process marked up source instead, but I didn't get to it yet. I also thought I'd change it to actually resemble unix man, but now I feel it'd be more useful to make it into something that could be integrated with your code_finder. It (my hack that is) needs a rewrite rather than an update for this, though. I'll have a look at it next week if you like. Anyway, I'll post the simple man page viewer. Here's the interface: utils:man(Module) utils:manfind(Module, ShRegExp) manfind prompts you with "[N/s/p/q]>", where N means "print N lines following the match", s means "search next" and p means "print previous line". Example: 1> utils:manfind(ets, "*new*"). 89: new(Name, Type) [N/s/p/q]>10 90: 91: Creates a new table and returns a table identifier 92: which can be used in subsequent operations. This table 93: ID can also be sent to other processes so that a table 94: can be shared between processes. It is completely loca- 95: tion transparent and can be sent to processes at other 96: nodes. Accordingly, the table identifier can be used as 97: a location transparent store. Large amounts of data can 98: be distributed to locations where it can be stored. Regards /Peter -------------- next part -------------- %%%---------------------------------------------------------------------- %%% File : utils.erl %%% Author : Peter Andersson %%% Purpose : Print or search through Erlang man page from shell. %%% Created : 9 Mar 2001 %%%---------------------------------------------------------------------- -module(utils). -author('eeipan@REDACTED'). -export([man/1, manfind/2]). -define(MANCMD(Mod), os:cmd("erl -man " ++ Mod)). man(Module) when atom(Module) -> man(atom_to_list(Module)); man(Module) when list(Module) -> Page = ?MANCMD(Module), Lines = format(Page, [[]]), print(Lines). manfind(Module, String) when atom(Module) -> manfind(atom_to_list(Module), String); manfind(Module, String) when list(Module) -> Page = ?MANCMD(Module), Lines = format(Page, [[]]), search(Lines, Lines, String, 1). search([L | Ls], Lines, String, N) -> case regexp:match(L, regexp:sh_to_awk(String)) of {match,_,_} -> print_line(N, Lines), case new_search(N, N, Lines) of true -> search(Ls, Lines, String, N+1); false -> ok end; _ -> search(Ls, Lines, String, N+1) end; search([], _, _, _) -> ok. new_search(1, _, _) -> false; new_search(Cur, N, Lines) -> case io:get_line('[N/s/p/q]>') of "s\n" -> true; "q\n" -> false; "N\n" -> io:format("!!! Specify number of lines !!!~n", []), new_search(Cur, N, Lines); "p\n" -> print_line(Cur-1, Lines), new_search(Cur-1, N, Lines); Len -> Len1 = list_to_integer(string:strip(Len, right, $\n)), print_lines(Cur+1, Len1, Lines), new_search(Cur+Len1, N, Lines) end. format([$_,$\b | Cs], Lines) -> format(Cs, Lines); format([$\n | Cs], [L | Ls]) -> format(Cs, [[] | [L | Ls]]); format([C | Cs], [L | Ls]) -> format(Cs, [[C | L] | Ls]); format([], Lines) -> lists:foldl( fun(L, Ls) -> LR = lists:reverse(L), [LR | Ls] end, [], Lines). print_line(N, Lines) -> [L | _] = get_line(N, Lines), io:format("~w: ", [N]), print([L]). print_lines(Pos, Len, Lines) -> Ls = get_line(Pos, Lines), print_lines1(Len, Pos, Ls). print_lines1(0, M, [L | _]) -> ok; print_lines1(N, M, [L | Ls]) -> io:format("~w: ", [M]), print([L]), print_lines1(N-1, M+1, Ls); print_lines1(_, _, []) -> ok. get_line(1, Ls) -> Ls; get_line(N, [L | Ls]) -> get_line(N-1, Ls); get_line(_, []) -> "\n!!! EOF !!!\n". print([[] | Ls]) -> io:format("~n", []), print(Ls); print([L | Ls]) -> io:format("~s~n", [L]), print(Ls); print([]) -> ok. From Sean.Hinde@REDACTED Fri Mar 9 17:44:27 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 9 Mar 2001 16:44:27 -0000 Subject: Erlang Development Environment Message-ID: <402DD461F109D411977E0008C791C312039F5E26@imp02mbx.one2one.co.uk> Peter, > I was going to > change it to process marked up source instead, but I didn't > get to it yet. I > also thought I'd change it to actually resemble unix man, but > now I feel it'd be > more useful to make it into something that could be > integrated with your > code_finder. It (my hack that is) needs a rewrite rather than > an update for > this, though. I'll have a look at it next week if you like. If you fancy having a go - it looks to be highly non trivial to deal with nroff macros. The much better solution would be to store this stuff as searchable indexed xml - which could be generated from the SGML sources (if we had them :( ). - 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 Peter.Andersson@REDACTED Mon Mar 12 13:29:53 2001 From: Peter.Andersson@REDACTED (Peter Andersson) Date: Mon, 12 Mar 2001 12:29:53 +0000 Subject: Erlang Development Environment References: <402DD461F109D411977E0008C791C312039F5E26@imp02mbx.one2one.co.uk> Message-ID: <3AACC141.FC439B31@eei.ericsson.se> Sean Hinde wrote: > > Peter, > > > I was going to > > change it to process marked up source instead, but I didn't > > get to it yet. I > > also thought I'd change it to actually resemble unix man, but > > now I feel it'd be > > more useful to make it into something that could be > > integrated with your > > code_finder. It (my hack that is) needs a rewrite rather than > > an update for > > this, though. I'll have a look at it next week if you like. > > If you fancy having a go - it looks to be highly non trivial to deal with > nroff macros. The much better solution would be to store this stuff as > searchable indexed xml - which could be generated from the SGML sources (if > we had them :( ). > > - Sean > I just had a look at some nroff/troff reference pages on the web and you're right, writing a processor for the complete specification is probably not, well, feasible! :) Perhaps an idea would be to only handle the subset of nroff being used by the Erlang man pages. Browsing through a few pages, it doesn't seem to be very large (a script could list all commands). Also, it could ignore commands it doesn't understand in the hope that, in the future, it might still be able to produce correct information. (Ok, I guess, if it can assume unknown commands are used for, say, text formatting and indentation. But if e.g. conditional statements are introduced, then it'll be completely screwed!). Maybe the HTML documentation will actually be easier to use as source (to be translated into a search index and plain text)? Comments or ideas anyone? Regards /Peter From nick@REDACTED Mon Mar 12 16:48:00 2001 From: nick@REDACTED (Niclas Eklund) Date: Mon, 12 Mar 2001 16:48:00 +0100 (MET) Subject: Speaking of documentation In-Reply-To: <402DD461F109D411977E0008C791C312039199E5@imp02mbx.one2one.co.uk> Message-ID: Hello! Have anyoune looked att Doxygen? http://www.stack.nl/~dimitri/doxygen/ Distributed under GNU General Public License. Supports C++, Java, IDL (Corba, Microsoft and KDE-DCOP flavors) and C. Would be rather nice to be able to use the same tool for all languages one uses (I cannot, however, come up with a single reason for using any other language than Erlang ;-). I quote Doxygen's homepage: "It can help you in three ways: 1.It can generate an on-line documentation browser (in HTML) and/or an off-line reference manual (in ) from a set of documented source files. There is also support for generating output in RTF (MS-Word), Postscript, hyperlinked PDF, compressed HTML, and Unix man pages. The documentation is extracted directly from the sources, which makes it much easier to keep the documentation consistent with the source code. 2.Doxygen can be configured to extract the code structure from undocumented source files. This can be very useful to quickly find your way in large source distributions. The relations between the various elements are be visualized by means of include dependency graphs, inheritance diagrams, and collaboration diagrams, which are all generated automatically. 3.You can even `abuse' doxygen for creating normal documentation (as I did for this manual). Doxygen is developed under Linux, but is set-up to be highly portable. As a result, it runs on most other UNIX flavors as well. Furthermore, an executable for Windows 9x/NT is also available." /Nick > Chris Pressey (cpressey@REDACTED) wrote: >> Is there a supported "autodoc" facility for Erlang, where one can write >> documentation embedded in comments in the code, which is then extracted >> and processed into 'formal' documentation in HTML (or whatever)? >> >> I've noticed some unexplained comment sentinels in various sources, but >> I've also noticed that the documentation and code are in seperate files >> for all of the library modules I've looked into so far. > >We are using a very simple in-house documentation tool that produces >Latex documentation of the code. > >Maybe we should release this tool if you that it could serve as a basis >for further improvement. > >I am also looking seriously at CCviewer: It might be great to integrate >such a doc tool with Ulf Wiger's source code browser. > >I must dig deeper to see if/how this could be feasible. > >-- >Micka?l R?mond From mickael.remond@REDACTED Mon Mar 12 17:23:23 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Mon, 12 Mar 2001 17:23:23 +0100 Subject: Speaking of documentation In-Reply-To: ; from nick@erix.ericsson.se on Mon, Mar 12, 2001 at 04:48:00PM +0100 References: <402DD461F109D411977E0008C791C312039199E5@imp02mbx.one2one.co.uk> Message-ID: <20010312172323.A942@idealx.com> Niclas Eklund (nick@REDACTED) wrote: > > > Hello! > > Have anyoune looked att Doxygen? > > http://www.stack.nl/~dimitri/doxygen/ We are planning to release our in-house auto-documentation tool tomorrow. For the moment it only produce latex output. We are hoping to add an HTML-hyperlinked result soon. The principle is very simple: You store information into the comments with a specific syntax. The comments are parsed to produce the resulting documentation. Here are the information we are managing by putting comments in our source code: On the module level, we use such comments: %%---------------------------------------------------------------------- %% HEADER xmnesia %% COPYRIGHT IDEALX (C) 2000 %% PURPOSE Implements a hierarchical database %% DESCRIPTION This is the main module for the core of the hierarchical %% database. %%---------------------------------------------------------------------- We are also extracting author, version, and last_modif date from the Erlang module directive (-author, -vsn, and -last_modified). We keep the separation with other information because we want those three specific information to be accessible with the module_info() function. On the function level, we use such standard comments: %%---------------------------------------------------------------------- %% FUNCTION new_element/4 %% PURPOSE Creates a new element in the document. %% ARGUMENTS %% Name -- String() %% DocId -- doc_id() %% Value -- term() %% Attributes -- term() %% RETURN VALUE elt_id() | {error, Reason} %% DESCRIPTION %% Extra comments can be put here, if needed. %% SEE ALSO %% xm_entry:element/4, new_document/1 %%---------------------------------------------------------------------- Maybe in a futur version we will include a way to merge information with the cross reference tool. -- Micka?l R?mond From maurice@REDACTED Tue Mar 13 08:09:57 2001 From: maurice@REDACTED (Maurice Castro) Date: Tue, 13 Mar 2001 18:09:57 +1100 (EST) Subject: Choking on Syntactic Sugar Message-ID: <200103130709.SAA14712@parallel.serc.rmit.edu.au> Hi All, When writing a parser for Erlang we discovered an interesting construction in regexp.erl (line 121 in our somewhat older distribution). reg4([$.|S]) -> {{comp_class,"\n"},S}; reg4("[^" ++ S0) -> case char_class(S0) of {Cc,[$]|S1]} -> {{comp_class,Cc},S1}; {Cc,S} -> throw({error,{unterminated,"["}}) end; It appears as if the ++ append operator has developed a new trick, it can be used to divide a string into 2 parts (just like Prolog). My question is in 3 parts: 1) is this behaviour desirable - note it is pure syntactic sugar for [$[, $^ | S0] 2) is this behaviour intended 3) is it documented Comments welcome. Maurice Castro From raimo@REDACTED Tue Mar 13 10:20:23 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Tue, 13 Mar 2001 10:20:23 +0100 Subject: Choking on Syntactic Sugar References: <200103130709.SAA14712@parallel.serc.rmit.edu.au> Message-ID: <3AADE657.7BF76DA6@erix.ericsson.se> Maurice Castro wrote: > > Hi All, > When writing a parser for Erlang we discovered an interesting > construction in regexp.erl (line 121 in our somewhat older distribution). > > reg4([$.|S]) -> {{comp_class,"\n"},S}; > reg4("[^" ++ S0) -> > case char_class(S0) of > {Cc,[$]|S1]} -> {{comp_class,Cc},S1}; > {Cc,S} -> throw({error,{unterminated,"["}}) > end; > > It appears as if the ++ append operator has developed a new trick, it > can be used to divide a string into 2 parts (just like Prolog). > > My question is in 3 parts: > > 1) is this behaviour desirable > - note it is pure syntactic sugar for [$[, $^ | S0] > 2) is this behaviour intended > 3) is it documented Check out http://www.erlang.se/doc/doc-5.0.2/doc, Link "Erlang Extensions Since 4.4", Section 7.8 "Literal string prefix in patterns" / Raimo Niskanen, Ericsson UAB, Erlang/OTP From klacke@REDACTED Tue Mar 13 10:20:02 2001 From: klacke@REDACTED (Klacke) Date: Tue, 13 Mar 2001 10:20:02 +0100 Subject: Choking on Syntactic Sugar In-Reply-To: <200103130709.SAA14712@parallel.serc.rmit.edu.au>; from maurice@universe.serc.rmit.edu.au on Tue, Mar 13, 2001 at 06:09:57PM +1100 References: <200103130709.SAA14712@parallel.serc.rmit.edu.au> Message-ID: <20010313102002.A20460@bluetail.com> Maurice, On Tue, Mar 13, 2001 at 06:09:57PM +1100, Maurice Castro wrote: > My question is in 3 parts: > > 1) is this behaviour desirable Yes, > - note it is pure syntactic sugar for [$[, $^ | S0] Yes, > 2) is this behaviour intended Yes, > 3) is it documented Yes, in the 4.4 Extensions pdf document at www.erlang.org. > > Comments welcome. > Yeah, if you feel the ++ operator is weird, take a look at the -- operator which is also described in the same doc, it's really weird. Not useless though. -- Claes Wikstrom -- Caps lock is nowhere and Alteon WebSystems -- everything is under control http://www.bluetail.com/~klacke -- From pekka@REDACTED Tue Mar 13 10:35:50 2001 From: pekka@REDACTED (Pekka Hedqvist) Date: Tue, 13 Mar 2001 10:35:50 +0100 Subject: Choking on Syntactic Sugar In-Reply-To: <200103130709.SAA14712@parallel.serc.rmit.edu.au> Message-ID: It is documented: http://www.erlang.org/doc/r7b/doc/extensions/part_frame.html >-----Original Message----- >From: owner-erlang-questions@REDACTED >[mailto:owner-erlang-questions@REDACTED]On Behalf Of Maurice Castro >Sent: Tuesday, March 13, 2001 8:10 AM >To: erlang-questions@REDACTED >Subject: Choking on Syntactic Sugar > > >Hi All, > When writing a parser for Erlang we discovered an interesting >construction in regexp.erl (line 121 in our somewhat older distribution). > >reg4([$.|S]) -> {{comp_class,"\n"},S}; >reg4("[^" ++ S0) -> > case char_class(S0) of > {Cc,[$]|S1]} -> {{comp_class,Cc},S1}; > {Cc,S} -> throw({error,{unterminated,"["}}) > end; > >It appears as if the ++ append operator has developed a new trick, it >can be used to divide a string into 2 parts (just like Prolog). > >My question is in 3 parts: > > 1) is this behaviour desirable > - note it is pure syntactic sugar for [$[, $^ | S0] > 2) is this behaviour intended > 3) is it documented > >Comments welcome. > > Maurice Castro > From etxhste@REDACTED Tue Mar 13 19:17:28 2001 From: etxhste@REDACTED (Hakan Stenholm) Date: Tue, 13 Mar 2001 19:17:28 +0100 (MET) Subject: Choking on Syntactic Sugar Message-ID: <200103131817.TAA15320@avc240.etxb.ericsson.se> >Maurice, > >On Tue, Mar 13, 2001 at 06:09:57PM +1100, Maurice Castro wrote: >> My question is in 3 parts: >> >> 1) is this behaviour desirable > >Yes, > >> - note it is pure syntactic sugar for [$[, $^ | S0] I'm a littel confused here so I would be happy if anyone would care to explain. After reading the documentation I get the impression that ++ is simply a short form of lists:append/2. I guess that this is not the case consdering that only arithmetic expressions that evaluate to constants are allowed in a patterns. So what exactly is a ++: "[^" ++ S0 is the same as [$[, $^ | S0] but what would happen in fun(List1 ++ List2) -> ... is it legal ? we only know what List1 is at run time so there shouldn't be any way to expand it to some constant pattern as in reg4("[^" ++ S0) ? >Yes, > >> 2) is this behaviour intended > >Yes, > >> 3) is it documented > >Yes, in the 4.4 Extensions pdf document at www.erlang.org. > >> >> Comments welcome. >> > > >Yeah, if you feel the ++ operator is weird, take a look at the >-- operator which is also described in the same doc, it's really >weird. Not useless though. > >-- >Claes Wikstrom -- Caps lock is nowhere and >Alteon WebSystems -- everything is under control >http://www.bluetail.com/~klacke From richardc@REDACTED Tue Mar 13 19:29:49 2001 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 13 Mar 2001 19:29:49 +0100 (MET) Subject: Choking on Syntactic Sugar In-Reply-To: <200103131817.TAA15320@avc240.etxb.ericsson.se> Message-ID: On Tue, 13 Mar 2001, Hakan Stenholm wrote: > I'm a littel confused here so I would be happy if anyone would care > to explain. > > After reading the documentation I get the impression that ++ is > simply a short form of lists:append/2. I guess that this is not the > case consdering that only arithmetic expressions that evaluate to > constants are allowed in a patterns. So what exactly is a ++: > > "[^" ++ S0 is the same as [$[, $^ | S0] >From the documentation on Erlang Extensions since 4.4: 7.8 Literal string prefix in patterns This extension was added in Erlang 4.8 (OTP R5A). A new construction is allowed in patterns, namely a literal string as the first operand of the ++ operator. Example: f("prefix" ++ L) -> ... This is syntactic sugar for the equivalent, but harder to read f([$p,$r,$e,$f,$i,$x | L]) -> ... No other non-constant uses of `++' are allowed. > but what would happen in > > fun(List1 ++ List2) -> ... > > is it legal ? we only know what List1 is at run time so there > shouldn't be any way to expand it to some constant pattern as in > reg4("[^" ++ S0) ? Exactly. That's why it's not legal. /Richard Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://www.csd.uu.se/~richardc/ From rv@REDACTED Wed Mar 14 02:53:09 2001 From: rv@REDACTED (Robert Virding) Date: Wed, 14 Mar 2001 02:53:09 +0100 Subject: Choking on Syntactic Sugar In-Reply-To: Your message of "Tue, 13 Mar 2001 10:20:02 +0100." <20010313102002.A20460@bluetail.com> Message-ID: <200103140153.f2E1r9s21681@duva.bluetail.com> Klacke writes: > >Yeah, if you feel the ++ operator is weird, take a look at the >-- operator which is also described in the same doc, it's really >weird. Not useless though. -- is a joke. I had planned to do something with ** and // as well but never got around to it. Any suggestions? :-) Robert From cpressey@REDACTED Wed Mar 14 04:28:57 2001 From: cpressey@REDACTED (Chris Pressey) Date: Tue, 13 Mar 2001 21:28:57 -0600 Subject: Choking on Syntactic Sugar References: <200103140153.f2E1r9s21681@duva.bluetail.com> Message-ID: <3AAEE579.DB990CFC@catseye.mb.ca> Robert Virding wrote: > Klacke writes: > >Yeah, if you feel the ++ operator is weird, take a look at the > >-- operator which is also described in the same doc, it's really > >weird. Not useless though. > -- is a joke. I did laugh the first time I saw it, but I've since found it unexpectedly convenient! :-) > I had planned to do something with ** and // as well but never > got around to it. Any suggestions? :-) ** could do lists:duplicate/2 (perhaps with argument order reversed) akin to Perl's 'x' operator. e.g: io:fwrite("~s", ["-" ** 72]). // could do lists:nth/2 (again, perhaps with reversed arguments) somewhat akin to array-indexing other languages. e.g: [foo,bar,baz] // 2. It might be nice if all of these (++, --, **, //) worked the same on tuples. Also, it would be (IMO) very cool to make <- meaningful outside of a list-comprehension (in a guard and/or expression). X <- [1,2,3] would evaluate to true if X == 1 or X == 2 or X == 3. It would also be great if this could be expanded at compile-time for constant lists (although I realize that might get a little hairy.) _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From kprieb@REDACTED Wed Mar 14 09:27:51 2001 From: kprieb@REDACTED (Kris Prieb) Date: Wed, 14 Mar 2001 03:27:51 -0500 Subject: experience with CASE/diagramming tools in Erlang Message-ID: Hello everyone, Does anyone have experience using CASE/diagramming tools with Erlang? If so, could you share what worked for you and what didn't? Most of the diagramming tools out there seem geared towards object-oriented languages and so are pretty useless for Erlang. That said, it seems that a diagramming tool could be quite useful for diagramming process relationships and Mnesia tables. Anyway I would really like to hear what kind of experiences people have had using such tools with Erlang. Thanks. Kris Prieb From vladdu@REDACTED Wed Mar 14 11:27:56 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Wed, 14 Mar 2001 11:27:56 +0100 Subject: GUIs Message-ID: Hi all! After all the debate about GUIs and IDEs, I looked around to see what options there might be that I had overlooked. And there are quite a few. If this happens to be old news, please don't get angry at me :-) One nice solution to use as an alternative to TclTk (which is a royal pain on Windows) would be for example wxWindows (www.wxwindows.org) which seem to be a good and stable framework for portable GUIs. The next question is how to easily write wrapper Erlang modules around it (or another library). Here I found a cool tool called SWIG (www.swig.org) that can generate wrappers for C/C++ libraries in Tcl, Perl, Python, and a few other more languages - and it is possible to extend it to other languages. I think it would be cool to have proper native GUI with a nice and complete framework. As for SWIG, an Erlang mode would be useful for many other libraries that people may want to interface with Erlang. I don't have time, but I hope someone else does and also likes the idea :-) best regards, Vlad _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. From mickael.remond@REDACTED Wed Mar 14 11:59:24 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Wed, 14 Mar 2001 11:59:24 +0100 Subject: experience with CASE/diagramming tools in Erlang In-Reply-To: ; from kprieb@post.harvard.edu on Wed, Mar 14, 2001 at 03:27:51AM -0500 References: Message-ID: <20010314115924.A511@idealx.com> Kris Prieb (kprieb@REDACTED) wrote: > Hello everyone, > > Does anyone have experience using CASE/diagramming tools with Erlang? If > so, could you share what worked for you and what didn't? Maurice Castro was one of the conferencer of the Erlang User Conference '99. He did present an interesting approach about modelling tool. You should have a look at his article: Toward an Event Modelling Language http://www.erlang.se/euc/99/Event.ps On the case tool, you should look at what was saying Ulf Wiger in 1999, summing up a study conducted on Erlang and Rational Rose integration: http://www.erlang.org/ml-archive/erlang-questions/199903/msg00002.html -- Micka?l R?mond From etxhste@REDACTED Wed Mar 14 12:24:08 2001 From: etxhste@REDACTED (Hakan Stenholm) Date: Wed, 14 Mar 2001 12:24:08 +0100 (MET) Subject: Choking on Syntactic Sugar Message-ID: <200103141124.MAA22256@avc240.etxb.ericsson.se> >From the documentation on Erlang Extensions since 4.4: > > 7.8 Literal string prefix in patterns > > This extension was added in Erlang 4.8 (OTP R5A). > > A new construction is allowed in patterns, namely a literal > string as the first operand of the ++ operator. Example: > > f("prefix" ++ L) -> ... > > This is syntactic sugar for the equivalent, but harder to read > > f([$p,$r,$e,$f,$i,$x | L]) -> ... > > >No other non-constant uses of `++' are allowed. This is not quite true, any non-negative integer (not just 0-255) appears to work just fine and in this case it should be possible to check at compile time. I wrote a littel test program (OTP r7b01) to show this: -module(test). -export([ test/1 ]). %% call test:test(String) to see that pattern match is done properly test("foo" ++ R) -> ok; test([101,101] ++ R) -> ok; % "ee" test([400,400] ++ R) -> ok; %% test([a,b,c] ++ R) -> ok; -> compile error %% test([{1,2,3}] ++ R) -> ok; -> compile error %% test([_,_] ++ R) -> ok; -> compile error %% test([4.0,4.0] ++ R) -> ok; -> compile error %% test([-1,-1] ++ R) -> ok; -> compile error test([999999999999999999999999999999999] ++ R) -> ok; test(_) -> not_ok. Wouldn't it also be reasonable to generalize this by alowing the string argument to be any kind of list of patterns (that might contain varibles and _) that is known at compile time ? Then again we don't gain anything from this (from what I can see) so there is no apprent reason to do this ?! From vladdu@REDACTED Wed Mar 14 12:28:12 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Wed, 14 Mar 2001 12:28:12 +0100 Subject: experience with CASE/diagramming tools in Erlang Message-ID: >Kris Prieb (kprieb@REDACTED) wrote: > > Hello everyone, > > > > Does anyone have experience using CASE/diagramming tools with Erlang? >If > > so, could you share what worked for you and what didn't? Given the almost perfect match between Erlang and SDL, I was quite surprised to find out that there aren't any SDL tools that can generate Erlang... maybe it's because none are so open that 3rd party extensions are allowed... or maybe it's because I just could not find them... Does anyone know more about that? /Vlad _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. From vladdu@REDACTED Wed Mar 14 12:31:48 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Wed, 14 Mar 2001 12:31:48 +0100 Subject: experience with CASE/diagramming tools in Erlang Message-ID: ouch, I should have checked my sources better... sorry. I have only looked att Telelogic's SDL tool's specifications and there is no mention of Erlang there. But Ulf said that it is possible to generate Erlang from it... What is the catch? /Vlad _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. From srl@REDACTED Wed Mar 14 12:42:28 2001 From: srl@REDACTED (Steve Langstaff) Date: Wed, 14 Mar 2001 11:42:28 -0000 Subject: IC and CORBA_SYSTEM_EXCEPTION Message-ID: <01C0AC7B.D9A10FE0.srl@terminus.ericsson.se> Problem solved. I've hacked the example server code to return { corba_system_exception, Reason }. On 09 March 2001 13:32, Steve Langstaff [SMTP:srl@REDACTED] wrote: > For the server that implements the subset of the IDL-specified interface, I > want the client > access function call to be informed if the function is not implemented by > the server. > > As far as I can see, the example C server code does not pass back > CORBA_SYSTEM_EXCEPTION back to the client: ... > env->_major is set to CORBA_SYSTEM_EXCEPTION because > whatever_module__switch() does not implement the function. env->_iout count > appears to be set to 0. > > Shouldn't there be some kind of ei_send_encoded() call to return an error > to the client? From tobbe@REDACTED Wed Mar 14 12:45:10 2001 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 14 Mar 2001 12:45:10 +0100 Subject: experience with CASE/diagramming tools in Erlang In-Reply-To: "Vlad Dumitrescu"'s message of "Wed, 14 Mar 2001 12:28:12 +0100" References: Message-ID: Magnus Fr?berg wrote a SDL-pr to Erlang compiler a number of years ago. There should exist a paper describing it somewhere (perhaps www.ericsson.se/cslab ). The conclusion was basically: "why bother, it is easier to write the code directly in Erlang". Cheers /Tobbe From richardc@REDACTED Wed Mar 14 12:52:25 2001 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 14 Mar 2001 12:52:25 +0100 (MET) Subject: Choking on Syntactic Sugar In-Reply-To: <200103141124.MAA22256@avc240.etxb.ericsson.se> Message-ID: On Wed, 14 Mar 2001, Hakan Stenholm wrote: > > A new construction is allowed in patterns, namely a literal > > string as the first operand of the ++ operator. Example: > > > > f("prefix" ++ L) -> ... > > > > This is syntactic sugar for the equivalent, but harder to read > > > > f([$p,$r,$e,$f,$i,$x | L]) -> ... > > > >No other non-constant uses of `++' are allowed. > > This is not quite true, any non-negative integer (not just 0-255) > appears to work just fine and in this case it should be possible to > check at compile time. > [...] > Wouldn't it also be reasonable to generalize this by alowing the > string argument to be any kind of list of patterns (that might > contain varibles and _) that is known at compile time ? Then again > we don't gain anything from this (from what I can see) so there is > no apprent reason to do this ?! It would certainly be possible. My guess is that `[Int1, Int2,...] ++ Tail' is currently accepted as a special case only because it would be odd if `"abc" ++ Tail' was legal, but `[$a, $b, $c] ++ Tail' was not. Generalising this is simple, and might even be useful in some cases. You could write stuff like: foo(?xx_prefix(X, Y, Z) ++ Tail, ...) -> {X, Y, Z, Tail}. which is clearer than including the tail in the macro call: foo(?xx_pattern(X, Y, Z, Tail), ...) -> {X, Y, Z, Tail}. /Richard Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://www.csd.uu.se/~richardc/ From etxuwig@REDACTED Wed Mar 14 13:18:17 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 14 Mar 2001 13:18:17 +0100 (MET) Subject: experience with CASE/diagramming tools in Erlang In-Reply-To: Message-ID: On 14 Mar 2001, Torbjorn Tornkvist wrote: >Magnus Fr?berg wrote a SDL-pr to Erlang compiler >a number of years ago. There should exist a paper >describing it somewhere (perhaps www.ericsson.se/cslab ). >The conclusion was basically: "why bother, it is easier >to write the code directly in Erlang". > >Cheers /Tobbe Yes... except developing complex systems is not just about getting runnable code. There are some excellent system architects that don't enjoy having to read Erlang in order to understand how a system is implemented (I know one personally, he sits 5 meters away from me, has programmed in a large variety of languages -- but not Erlang -- and has done research on distributed systems at MIT; another sitting 5 meters in the other direction is the chairman of ATM Forum -- also not an Erlang programmer.) In order to discuss architecture with these people, you need some documentation other than the code. How will you write this documentation? They both understand SDL pretty well... Once written, how does the documentation keep up with the implementation? Also, I'd like to say that you can implement complex state machines in Erlang, and automatically extract a graphical model of the FSM from the code, but it just doesn't work like that (try it.) Basically, for excellent Erlang programmers, excellently well written Erlang code needs very little other documentation. But many of our programmers are more average than excellent, and much of our code (even much code written by excellent programmers) is everything but excellently written. Then, you need some good tools for describing your models as well -- something other than MS Word or FrameMaker... I'm not saying that generating Erlang from SDL/SDT is necessarily the answer. I'm just saying that there is a need for something along those lines. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From recycledelectrons@REDACTED Wed Mar 14 13:56:12 2001 From: recycledelectrons@REDACTED (andy allen) Date: Wed, 14 Mar 2001 06:56:12 -0600 Subject: GUIs Message-ID: Two thoughts on IDEs, from deep within the Ericsson trenches: 1. Is there a system available for Erlang that would allow me to start typing a MFA -- module:function(args) -- and have the IDE (text editor) suggest possible completions? In other words, Xemacs goes out and looks up the possible completions based on the madule name and the colon that I typed. As I enter the function name, I can also click on one of the completion options. when I get to the arguments, a list of possible argument lists pops up to help me out. Visual C++ does this in Visual Studio, and it would be VERY usefull with some of the AXD301 programming I do. The only questions are: a) does Xemacs support this? b) if so, how? 2. I am continually debugging "Internal Server Errors" in my AMS pages (a proprietary Ericsson library for dynamic HTML generation in the AXD 301). Wouldn't it be nice to be able to "draw" AMS pages, and have the code generated automatically? It would save many man-months of labor here in EUS/SA/B. Andy Allen andy@REDACTED EUS/SA/BA >From: "Vlad Dumitrescu" >To: erlang-questions@REDACTED >Subject: GUIs >Date: Wed, 14 Mar 2001 11:27:56 +0100 > >Hi all! > >After all the debate about GUIs and IDEs, I looked around to see what >options there might be that I had overlooked. And there are quite a few. If >this happens to be old news, please don't get angry at me :-) > >One nice solution to use as an alternative to TclTk (which is a royal pain >on Windows) would be for example wxWindows (www.wxwindows.org) which seem >to >be a good and stable framework for portable GUIs. > >The next question is how to easily write wrapper Erlang modules around it >(or another library). Here I found a cool tool called SWIG (www.swig.org) >that can generate wrappers for C/C++ libraries in Tcl, Perl, Python, and a >few other more languages - and it is possible to extend it to other >languages. > >I think it would be cool to have proper native GUI with a nice and complete >framework. As for SWIG, an Erlang mode would be useful for many other >libraries that people may want to interface with Erlang. > >I don't have time, but I hope someone else does and also likes the idea :-) > >best regards, >Vlad >_________________________________________________________________________ >Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com From ingela@REDACTED Wed Mar 14 14:25:55 2001 From: ingela@REDACTED (Ingela Anderton) Date: Wed, 14 Mar 2001 14:25:55 +0100 (MET) Subject: GUIs Message-ID: <200103141325.OAA00477@townsend.ericsson.se> [..] >and have the IDE (text editor) suggest possible completions? [..] In the IDE debate lots of people seem to want to have some kind of tab-compleation on function names. Well I just want to say that emacs has a form of tab-compleation that is very useful even if it is not excatly what you described. If you start typing a word and then do M-/ emacs will try to find a compleation for you word in any buffer that you have open. If there is more than one possible compleation you can loop through them by repeating the command. I use it all the time. It would take a rellay advanced IDE before I ever trade away emacs. I think IDE:s many times limits the way I work and causes a lot of unnecessary mouse-clicking. No emacs and a unix-shell is the ideal development environment too me, and of course some version handlig program like cvs or clearcase. -- /m.v.h Ingela //The highway of life is always under construction. // |\ _,,,--,,_ ,) /,`.-'`' -, ;-;;' |,4- ) )-,_ ) /\ '---''(_/--' (_/-' Ericsson Utvecklings AB Phone : +46 8 719 18 13 Open Systems (f.d. Erlang Systems) Cellular/Mobile: +46 70 636 78 68 Torshamnsgatan 39 B Box 1214 http://www.erlang.se S-164 28 KISTA, SWEDEN ingela@REDACTED From klacke@REDACTED Wed Mar 14 14:45:39 2001 From: klacke@REDACTED (Klacke) Date: Wed, 14 Mar 2001 14:45:39 +0100 Subject: GUIs In-Reply-To: <200103141325.OAA00477@townsend.ericsson.se>; from ingela@erlang.ericsson.se on Wed, Mar 14, 2001 at 02:25:55PM +0100 References: <200103141325.OAA00477@townsend.ericsson.se> Message-ID: <20010314144535.E9561@bluetail.com> On Wed, Mar 14, 2001 at 02:25:55PM +0100, Ingela Anderton wrote: > > It would take a rellay advanced IDE before I ever trade away emacs. > I think IDE:s many times limits the way I work and causes a lot of > unnecessary mouse-clicking. No emacs and a unix-shell is the ideal > development environment too me, and of course some version handlig > program like cvs or clearcase. > Well said, to top it off, I'd like to add just one more tool I find useful and that is etags ... I use it all the time. ESC-. jumps to the definition of functions or constants .... etags is best used when integerated in a Makefile, .. here's some snippets from one of our Makefiles .... tags: mktags.beam erl -noshell -s mktags generate $(BASEAPPS) $(ISDAAPPS) \ $(ISDSSLAPPS) mktags.beam: system/mktags.erl erlc system/mktags. you get the idea .... and the mktags.erl file ... %%%---------------------------------------------------------------------- %%% File : mktags.erl %%% Author : Klacke %%% Purpose : %%% Created : 4 Jan 2000 by Klacke %%%---------------------------------------------------------------------- -module(mktags). -author('klacke@REDACTED'). -compile(export_all). generate(Apps) -> Dirs = dirs(Apps), io:format("Dirs = ~p~n", [Dirs]), io:format("mktags: ~p~n", [catch tags:dirs(Dirs)]), init:stop(). dirs(Apps) -> dirs(Apps, []). dirs([A|As], Ack) -> Src=filename:join(["lib", A, "src"]), Incl=filename:join(["lib", A, "include"]), case {file:read_file_info(Src), file:read_file_info(Incl)} of {{error, _}, {error, _}} -> dirs(As, Ack); {{error, _}, _} -> dirs(As, Ack); {{ok, _}, {error, _}} -> dirs(As, [Src|Ack]); {{ok, _}, {ok, _}} -> dirs(As, [Incl,Src|Ack]) end; dirs([], Ack) -> Ack. Someday I'll make an effort and hack erlang support into the real thing which is the 'ctags' program http://darren.hiebert.com/ctags/index.html /klacke -- Claes Wikstrom -- Caps lock is nowhere and Alteon WebSystems -- everything is under control http://www.bluetail.com/~klacke -- From Erik.Johansson@REDACTED Wed Mar 14 15:09:09 2001 From: Erik.Johansson@REDACTED (Erik.Johansson) Date: Wed, 14 Mar 2001 15:09:09 +0100 Subject: GUIs References: <200103141325.OAA00477@townsend.ericsson.se> <20010314144535.E9561@bluetail.com> Message-ID: <01a901c0ac90$57147340$980cee82@it.uu.se> "Klacke" wrote: > Someday I'll make an effort and hack erlang support into the real thing > which is the 'ctags' program http://darren.hiebert.com/ctags/index.html Isn't this done allready? >man ctags "DESCRIPTION The `etags' program is used to create a tag table file, in a format understood by emacs(1); the `ctags' program is used to create a similar table in a format understood by vi(1)similar table used by the Altrasoft OO Browser (This manpage may be innacurate in regards to ootags). . Both forms of the program understand the syntax of C, Objective C, C++, Java, Fortran, Pascal, Cobol, LaTeX, Scheme, Emacs Lisp/Common Lisp, Postscript, Erlang, Prolog and most assembler-like syntaxes." See also http://www.erlang.org/doc/r7b/lib/tools-1.6.1/doc/html/emacs.html#1.12 (Note that there is a bug on the page, where it says: file . -name "*.[he]rl" -print | etags - it should be find . -name "*.[he]rl" -print | etags - ) From cesarini@REDACTED Wed Mar 14 17:44:01 2001 From: cesarini@REDACTED (Francesco Cesarini) Date: Wed, 14 Mar 2001 16:44:01 +0000 Subject: Erlang Efficiency quesitons Message-ID: <3AAF9FD1.44C89F77@terminus.ericsson.se> I was wondering if there is any documentation on how to write efficient Erlang programs based on the virtual machine delivered in with OTP R7? Many odds and ends have been discussed on this list, but I have been unable to find something comprehensive. Here are some examples from one of Bogumil's early beam implementations used in 1995 - 96. Are they still valid today after Bj?rn's rewrite? At the time it was better to group clauses according to the matching which had to be done. For example case X of {a,b,c} -> .. {b,c,A} -> .. {A,B,C} -> ... {a,b} -> ... {A,b} -> .. true -> .. end was more efficient than : case X of {a,b,c} -> .. true -> {a,b} -> ... {A,b} -> .. {b,c,A} -> .. true -> .. {A,B,C} -> ... end (The above apparently also applied to ifs, receives and function clauses). Another example had to do with avoiding the dynamic creation of atoms as there was no GC for them. Is that still the case? I could go on and on with more examples, but i'll leave it to that. Any feedback on where I can find more comprehensive info is welcome. Regards, Francesco -- Francesco Cesarini Erlang/OTP consultant Cellular: INT+44-7776 250381 ECN: 832-707192 http://welcome.to/cesarini.consulting From etxuwig@REDACTED Wed Mar 14 18:10:06 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 14 Mar 2001 18:10:06 +0100 (MET) Subject: Erlang Efficiency quesitons In-Reply-To: <3AAF9FD1.44C89F77@terminus.ericsson.se> Message-ID: On Wed, 14 Mar 2001, Francesco Cesarini wrote: >I was wondering if there is any documentation on how to write efficient >Erlang programs based on the virtual machine delivered in with OTP R7? Why, Francesco, don't you know that we shouldn't worry about making our programs fast?! ;-) To my knowledge, there is no such document. >Many odds and ends have been discussed on this list, but I have been >unable to find something comprehensive. I've attached some old documents that we wrote a while back on performance. I must warn you that we don't stand by some of the recommendations made within anymore. Special warning against foregoing gen_server for hard-coded servers. This is really not a good idea, and not nearly as relevant now as it was then. The overhead of gen_server is pretty insignificant. Other bad advice is using integers instead of atoms. Having said this, there are some good ideas in there as well. (: The compiler nowadays does a pretty good job of optimizing case and function clauses and also removes dead code. This is good news for those of us who are interested in squeezing every drop of performance out of our Erlang programs. I also know that higher-order functions are very efficient now. This also means that old warnings about list comprehensions are no longer quite as valid. All in all, the document helps to demonstrate that any advice on writing fast code, other than selecting efficient algorithms, is something that needs to be updated frequently. Nonetheless, this kind of document is needed. >Another example had to do with avoiding the dynamic creation of >atoms as there was no GC for them. Is that still the case? Yes, this is still true. However, if I recall correctly, BEAM doesn't have a hard limit on the size of the atom table, so you can have quite a few atoms, provided you have enough memory. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB -------------- next part -------------- A non-text attachment was scrubbed... Name: performance.tar.gz Type: application/x-gzip Size: 19493 bytes Desc: performance.tar.gz URL: From cesarini@REDACTED Wed Mar 14 18:38:59 2001 From: cesarini@REDACTED (Francesco Cesarini) Date: Wed, 14 Mar 2001 17:38:59 +0000 Subject: Erlang Efficiency quesitons References: Message-ID: <3AAFACB3.78D22164@terminus.ericsson.se> > Why, Francesco, don't you know that we shouldn't worry about making > our programs fast?! ;-) Search some of my earlier posts on this list and you will find the: First make it work. Then make it beautiful. Then if you really really have to, make it fast (While keeping it beautiful and correct). (And as I say when teaching, in 95% of the cases, your application will be fast enough. For the remaining 5%, you do not have the time to rewrite it... At least it is beautiful :-) > To my knowledge, there is no such document. Let us put one together. Here are some more hints: * Use binaries when shuffling around large amounts of data between processes. * Some one on the list had mentioned that appending binaries results in them being copied, thus avoid it. * In the documentation for the 4.4 extensions I found a note that f(X) when X == #rec{x=1, y=a} -> ... is less efficient than f(#rec{x=1, y=a} = X) -> ... I assume because in A X is bound before the guard test, in B, the pattern match fails as soon as one of the conditions does not match. Back in the good old days, the recommendation was to use guards in Beam, while with the Jam there was no difference... If you have found more through timing or somewhere hidden in the documentation, send them directly to me and I will put together a web page. Regards, Francesco -- Francesco Cesarini Erlang/OTP consultant Cellular: INT+44-7776 250381 ECN: 832-707192 http://welcome.to/cesarini.consulting From kprieb@REDACTED Wed Mar 14 19:01:59 2001 From: kprieb@REDACTED (Kris Prieb) Date: Wed, 14 Mar 2001 13:01:59 -0500 Subject: experience with CASE/diagramming tools in Erlang In-Reply-To: <20010314115924.A511@idealx.com> Message-ID: Thanks! This is very helpful. Kris Prieb > -----Original Message----- > From: Mickael Remond [mailto:mikl@REDACTED]On Behalf Of > Mickael Remond > Sent: Wednesday, March 14, 2001 5:59 AM > To: Kris Prieb > Cc: erlang-questions@REDACTED > Subject: Re: experience with CASE/diagramming tools in Erlang > > > Kris Prieb (kprieb@REDACTED) wrote: > > Hello everyone, > > > > Does anyone have experience using CASE/diagramming tools with > Erlang? If > > so, could you share what worked for you and what didn't? > > > Maurice Castro was one of the conferencer of the Erlang User Conference > '99. He did present an interesting approach about modelling tool. > You should have a look at his article: Toward an Event Modelling > Language > http://www.erlang.se/euc/99/Event.ps > > > On the case tool, you should look at what was saying Ulf Wiger in 1999, > summing up a study conducted on Erlang and Rational Rose integration: > http://www.erlang.org/ml-archive/erlang-questions/199903/msg00002.html > > -- > Micka?l R?mond > > > From luke@REDACTED Wed Mar 14 19:17:14 2001 From: luke@REDACTED (Luke Gorrie) Date: 14 Mar 2001 19:17:14 +0100 Subject: GUIs In-Reply-To: <200103141325.OAA00477@townsend.ericsson.se> References: <200103141325.OAA00477@townsend.ericsson.se> Message-ID: Ingela Anderton writes: > It would take a rellay advanced IDE before I ever trade away emacs. > I think IDE:s many times limits the way I work and causes a lot of > unnecessary mouse-clicking. No emacs and a unix-shell is the ideal > development environment too me, and of course some version handlig > program like cvs or clearcase. I agree heartily. Though I think it would be very nice to extend Emacs with more erlang stuff - e.g. a debugger interface. >From that side of the fence, I've implemented a subset of the erlalng external term format in Emacs Lisp and put in a communication stub, so that you can make calls from emacs to an erlang node using convenient data structures. But, I've never done anything useful with it :-). If someone else wants to, the code is at http://www.bluetail.com/~luke/erlext.el The idea is you write e.g.: (erlext-call "localhost" 4999 (vector 'toggle_breakpoint (buffer-file-name) (what-line))) and then an erlang server listening on that port will receive: {toggle_breakpoint, "/home/luke/test_module.erl", 42} .. etc. Cheers, Luke From jamesh@REDACTED Wed Mar 14 19:44:00 2001 From: jamesh@REDACTED (James Hague) Date: Wed, 14 Mar 2001 12:44:00 -0600 Subject: Erlang Efficiency quesitons Message-ID: > I also know that higher-order functions are very efficient now. This > also means that old warnings about list comprehensions are no longer > quite as valid. Does that only apply to list comprehensions? It seems, from doing some timings, that just writing raw Erlang to process a list is still significantly faster than doing a map or fold, for example. It would be kind of nice to have certain cases of map be handled as parse transformations rather than calling lists:map. Most times I use higher order functions as sort of a shorthand as it is, and not anything fancy. James From etxuwig@REDACTED Wed Mar 14 19:47:55 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 14 Mar 2001 19:47:55 +0100 (MET) Subject: Erlang Efficiency quesitons In-Reply-To: Message-ID: On Wed, 14 Mar 2001, James Hague wrote: >> I also know that higher-order functions are very efficient now. This >> also means that old warnings about list comprehensions are no longer >> quite as valid. > >Does that only apply to list comprehensions? It seems, from doing some >timings, that just writing raw Erlang to process a list is still >significantly faster than doing a map or fold, for example. The significance depends on what your function does with the list elements. Let's say that it's considerably less significantly faster than it used to be. ;-) /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From bjorn@REDACTED Wed Mar 14 20:06:58 2001 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 14 Mar 2001 20:06:58 +0100 Subject: Erlang Efficiency quesitons In-Reply-To: Ulf Wiger's message of "Wed, 14 Mar 2001 19:47:55 +0100 (MET)" References: Message-ID: Ulf Wiger writes: > On Wed, 14 Mar 2001, James Hague wrote: > > >> I also know that higher-order functions are very efficient now. This > >> also means that old warnings about list comprehensions are no longer > >> quite as valid. > > > >Does that only apply to list comprehensions? It seems, from doing some > >timings, that just writing raw Erlang to process a list is still > >significantly faster than doing a map or fold, for example. > > The significance depends on what your function does with the list > elements. Let's say that it's considerably less significantly faster > than it used to be. ;-) I've some benchmarks results: http://www.ericsson.se/cslab/~bjorn/benchmarks/bm_results.html (Read more about on my home page: http://www.ericsson.se/cslab/~bjorn and download the source code for my benchmark suite.) The rightmost column for the benchmark module call_bm shows the relative times for different types of calls for OTP R6. (Times are similar in R7.) The fastet call is a local call. Its cost is 1.00. An external call is slightly slower. Its cost is 1.19. (Externall calls was horrible expensive in the pre-historic Beam R2 - almost 16 times slower than a local call.) The cost to a fun call is 3.13 that of a local call. In previous version of Beam it used to be about 10 times slower than a local call. Applying a fun is slightly slower (because the arguments are passed in a list). The cost is 4.17. Finally, the slowest call of all is apply(M, F, A), whose cost is 7.42. In R8, funs will be slightly faster. List comprehensions will be compiled to local functions, meaning that they will be as fast as an hand-written (recursive) function. A future version of the compiler will probably inline calls to lists:map/2 and friends. /Bjorn > > /Uffe > -- > Ulf Wiger tfn: +46 8 719 81 95 > Senior System Architect mob: +46 70 519 81 95 > Strategic Product & System Management ATM Multiservice Networks > Data Backbone & Optical Services Division Ericsson Telecom AB > -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From alexis@REDACTED Wed Mar 14 20:20:07 2001 From: alexis@REDACTED (Alexis Le-Quoc) Date: Wed, 14 Mar 2001 14:20:07 -0500 Subject: Strategy for logging errors containing binaries? Message-ID: <3AAFC467.B53B3658@neomeocorp.com> I've recently ran into runtime crashes, caused by an exception in a process, whose state contained large binaries (several MBs large). The standard error_logger seems to choke when trying to pretty print the state of the crasher and it eventually ends up with a crash dump. I could put catch clauses wherever needed but this approach seems to contradict the supervisor philosophy of letting the process crash and restart it. Should I think of using a different error_logger? I like the standard one though. Cheers, -- Alexis Le-Quoc Neomeo, Corporation alexis@REDACTED From jamesh@REDACTED Wed Mar 14 20:26:07 2001 From: jamesh@REDACTED (James Hague) Date: Wed, 14 Mar 2001 13:26:07 -0600 Subject: GUIs Message-ID: > > It would take a rellay advanced IDE before I ever trade away emacs. > > I think IDE:s many times limits the way I work and causes a lot of > > unnecessary mouse-clicking. No emacs and a unix-shell is the ideal > > development environment too me, and of course some version handlig > > program like cvs or clearcase. > > I agree heartily. Though I think it would be very nice to extend Emacs > with more erlang stuff - e.g. a debugger interface. I think much of the issue is that some people *love* Emacs, and other people despise it an equivalent amount :) I tend to be greatly turned off by language implementations that are tightly coupled to Emacs, or at least put non-Emacs users at a disadvantage. With Erlang, I'm quite happy writing code with EditPad, a freeware replacement for Notepad, under Windows. Really :) But if I had to use Emacs, I probably never would have tried Erlang in the first place. (Note that I also use Linux, but I still spend more time in Windows.) James From rv@REDACTED Wed Mar 14 23:17:27 2001 From: rv@REDACTED (Robert Virding) Date: Wed, 14 Mar 2001 23:17:27 +0100 Subject: Erlang Efficiency quesitons In-Reply-To: Your message of "Wed, 14 Mar 2001 16:44:01 GMT." <3AAF9FD1.44C89F77@terminus.ericsson.se> Message-ID: <200103142217.f2EMHRs18196@duva.bluetail.com> Francesco Cesarini writes: >At the time it was better to group clauses according to the matching >which had to be done. For example > >case X of > {a,b,c} -> .. > {b,c,A} -> .. > {A,B,C} -> ... > {a,b} -> ... > {A,b} -> .. > true -> .. >end > >was more efficient than : > >case X of > {a,b,c} -> .. > true -> > {a,b} -> ... > {A,b} -> .. > {b,c,A} -> .. > true -> .. > {A,B,C} -> ... >end Today there is no difference with type of grouping. The compiler rearranges clauses after type of match argument anyway. The only rule that would aid speed is to group clauses where there is a variable to match on instead of interspersing them among other clauses. Avoid if possible: case X of {a,b,c} -> .. Sune when ... -> {a,b} -> ... Curt when ... -> .. {b,c,A} -> .. Other when .. -> .. {A,B,C} -> ... end Of course this is often not possible to do but is worth remembering. Robert From rv@REDACTED Wed Mar 14 23:24:45 2001 From: rv@REDACTED (Robert Virding) Date: Wed, 14 Mar 2001 23:24:45 +0100 Subject: Erlang Efficiency quesitons In-Reply-To: Your message of "Wed, 14 Mar 2001 17:38:59 GMT." <3AAFACB3.78D22164@terminus.ericsson.se> Message-ID: <200103142224.f2EMOjs19813@duva.bluetail.com> Francesco Cesarini writes: > >Let us put one together. Here are some more hints: > >* Use binaries when shuffling around large amounts of data between >processes. >* Some one on the list had mentioned that appending binaries results in >them being copied, thus avoid it. >* In the documentation for the 4.4 extensions I found a note that > f(X) when X == #rec{x=1, y=a} -> ... is less efficient than > f(#rec{x=1, y=a} = X) -> ... > >I assume because in A X is bound before the guard test, in B, the >pattern match fails as soon as one of the conditions does not match. >Back in the good old days, the recommendation was to use guards in Beam, >while with the Jam there was no difference... A is inefficient because you build a new record and then do an equals test on the two structures. It is also EXTREMELY unsafe as you get the default values on all unmentioned fields! B just test the type of term and values of the given fields. It is infact more efficient to do: f(#rec{x=X,a=A}=Rec) -> than f(Rec) when record(Rec, rec) -> ... Rec#rec.x Rec#rec.a and it is more efficient to just test for a rec record with the first case than with the second. Robert From thantos@REDACTED Wed Mar 14 23:45:29 2001 From: thantos@REDACTED (Alexander Williams) Date: Wed, 14 Mar 2001 17:45:29 -0500 Subject: Erlang Efficiency quesitons In-Reply-To: <3AAFACB3.78D22164@terminus.ericsson.se>; from cesarini@terminus.ericsson.se on Wed, Mar 14, 2001 at 05:38:59PM +0000 References: <3AAFACB3.78D22164@terminus.ericsson.se> Message-ID: <20010314174529.C9719@telocity.com> On Wed, Mar 14, 2001 at 05:38:59PM +0000, Francesco Cesarini wrote: > * Use binaries when shuffling around large amounts of data between > processes. > * Some one on the list had mentioned that appending binaries results in > them being copied, thus avoid it. You know, I'm wondering why no one's suggested before (and I suppose I'm suggesting now) why the underlying representation of strings hasn't been changed to Binaries instead of Lists (or at least discussion thereof). If the functions in string: were changed, that'd be 80% of the tweaking necessary right there. One can already do pattern-matching on Binaries, so you don't lose much there. >From an efficency PoV, the main drawback would seem to be that Binaries copy when appended, but going to a different programming pattern that involves building lists of Binary-strings and then joining them should be able to get around that problem; Python's strings are "immutable," much as Binaries seem to be, and so share the quality of being copied to create a new entity when +'d, but if one constructs a List of strings, calling string.join() on the List will return a single string without much overhead. Thoughts? -- 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 klacke@REDACTED Thu Mar 15 10:10:16 2001 From: klacke@REDACTED (Klacke) Date: Thu, 15 Mar 2001 10:10:16 +0100 Subject: Erlang Efficiency quesitons In-Reply-To: <20010314174529.C9719@telocity.com>; from thantos@telocity.com on Wed, Mar 14, 2001 at 05:45:29PM -0500 References: <3AAFACB3.78D22164@terminus.ericsson.se> <20010314174529.C9719@telocity.com> Message-ID: <20010315101016.A14051@bluetail.com> On Wed, Mar 14, 2001 at 05:45:29PM -0500, Alexander Williams wrote: > On Wed, Mar 14, 2001 at 05:38:59PM +0000, Francesco Cesarini wrote: > > * Use binaries when shuffling around large amounts of data between > > processes. > > * Some one on the list had mentioned that appending binaries results in > > them being copied, thus avoid it. > > You know, I'm wondering why no one's suggested before (and I suppose > I'm suggesting now) why the underlying representation of strings > hasn't been changed to Binaries instead of Lists (or at least > discussion thereof). If the functions in string: were changed, that'd > be 80% of the tweaking necessary right there. One can already do > pattern-matching on Binaries, so you don't lose much there. > > >From an efficency PoV, the main drawback would seem to be that > Binaries copy when appended, but going to a different programming > pattern that involves building lists of Binary-strings and then > joining them should be able to get around that problem; Python's > strings are "immutable," much as Binaries seem to be, and so share the > quality of being copied to create a new entity when +'d, but if one > constructs a List of strings, calling string.join() on the List will > return a single string without much overhead. > > Thoughts? This was one of the original goals of the bitsyntax as well, i.e. to be able to with ease use Binaries as an efficent replacement for strings. I even once wrote a bstring.erl which was a module with an equivalent interface as string.erl This idea still holds. Possibly some explicit support for string management should be added to the runtime as well. String handling has been (and still is) one of the really weak points of Erlang. At least from a performance point of view, strings as lists (as we have it today) are slow, but very flexible and nice. Right !!. Probably we want both. /klacke -- Claes Wikstrom -- Caps lock is nowhere and Alteon WebSystems -- everything is under control http://www.bluetail.com/~klacke -- From mickael.remond@REDACTED Thu Mar 15 10:36:21 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Thu, 15 Mar 2001 10:36:21 +0100 Subject: Erlang Efficiency quesitons In-Reply-To: <20010315101016.A14051@bluetail.com>; from klacke@bluetail.com on Thu, Mar 15, 2001 at 10:10:16AM +0100 References: <3AAFACB3.78D22164@terminus.ericsson.se> <20010314174529.C9719@telocity.com> <20010315101016.A14051@bluetail.com> Message-ID: <20010315103619.A4715@idealx.com> Klacke (klacke@REDACTED) wrote: > > This was one of the original goals of the bitsyntax as well, i.e. > to be able to with ease use Binaries as an efficent replacement > for strings. I even once wrote a bstring.erl which was a module > with an equivalent interface as string.erl Did you make some performance comparisons ? Would you mind releasing this module ? > String handling has been (and still is) one of the really > weak points of Erlang. At least from a performance point > of view, strings as lists (as we have it today) are slow, but > very flexible and nice. Right !!. Probably we want both. Yes. We want probably both. These days with the rise of XML, efficient string support will become much more critical. -- Micka?l R?mond From klacke@REDACTED Thu Mar 15 12:21:50 2001 From: klacke@REDACTED (Klacke) Date: Thu, 15 Mar 2001 12:21:50 +0100 Subject: Erlang Efficiency quesitons In-Reply-To: <20010315103619.A4715@idealx.com>; from mickael.remond@IDEALX.com on Thu, Mar 15, 2001 at 10:36:21AM +0100 References: <3AAFACB3.78D22164@terminus.ericsson.se> <20010314174529.C9719@telocity.com> <20010315101016.A14051@bluetail.com> <20010315103619.A4715@idealx.com> Message-ID: <20010315122150.B17676@bluetail.com> On Thu, Mar 15, 2001 at 10:36:21AM +0100, Mickael Remond wrote: > Klacke (klacke@REDACTED) wrote: > > > > This was one of the original goals of the bitsyntax as well, i.e. > > to be able to with ease use Binaries as an efficent replacement > > for strings. I even once wrote a bstring.erl which was a module > > with an equivalent interface as string.erl > > Did you make some performance comparisons ? > Would you mind releasing this module ? I'll attach it here, It's written in our original bit syntax and it woun't compile today. > > > String handling has been (and still is) one of the really > > weak points of Erlang. At least from a performance point > > of view, strings as lists (as we have it today) are slow, but > > very flexible and nice. Right !!. Probably we want both. > > Yes. We want probably both. > These days with the rise of XML, efficient string support will become > much more critical. > Yup, /klacke -- Claes Wikstrom -- Caps lock is nowhere and Alteon WebSystems -- everything is under control http://www.bluetail.com/~klacke -- -------------- next part -------------- %%%---------------------------------------------------------------------- %%% File : bstring.erl %%% Author : Claes Wikstrom %%% Purpose : Manipulation of binary strings %%% Created : 2 Oct 1998 by Claes Wikstrom %%%---------------------------------------------------------------------- -module(bstring). -author('klacke@REDACTED'). -compile(export_all). len(S) -> size(S). equal(S, S) -> true; equal(_, _) -> false. concat(S1, S2) -> . %% chr(String, Char) %% rchr(String, Char) %% Return the first/last index of the character in a string. chr(S, C) when binary(S) -> case S of <_:Size/binary, C:8/char |_> -> Size + 1; _ -> 0 end. rchr(S, C) -> rchr(S, C, 1, 0). rchr(, C, I, L) -> %Found one, now find next! rchr(Cs, C, I+1, I); rchr(<_/char|Cs>, C, I, L) -> rchr(Cs, C, I+1, L); rchr(<>, C, I, L) -> L. %% Return ix(B, Pos) -> <_:(Pos-1)/binary, Ch:8/char |_> = B, Ch. %% str(String, SubString) %% rstr(String, SubString) %% index(String, SubString) %% Return the first/last index of the sub-string in a string. %% index/2 is kept for backwards compatibility. str(S, Sub) -> case S of <_:Ix/binary, Sub/binary | _> -> Ix + 1; _ -> 0 end. rstr(S, Sub) -> rstr(S, Sub, 0). rstr(S, Sub, I) -> case S of <_/binary, Sub/binary |T> -> rstr(T, Sub, I+1); _ -> I end. index(S, Sub) -> str(S, Sub). bmember(C, Cs) -> case chr(Cs, C) of 0 -> false; _ -> true end. %% span(String, Chars) -> Length. %% cspan(String, Chars) -> Length. span(S, Cs) -> span(S, Cs, 0). span(, Cs, I) -> case bmember(C, Cs) of true -> span(S, Cs, I+1); false -> I end; span(<>, Cs, I) -> I. cspan(S, Cs) -> cspan(S, Cs, 0). cspan(, Cs, I) -> case bmember(C, Cs) of true -> I; false -> cspan(S, Cs, I+1) end; cspan(<>, Cs, I) -> I. %% substr(String, Start) %% substr(String, Start, Length) %% Extract a sub-string from String. substr(Str, Len) -> <_:(Len-1)/binary | Tail> = Str, Tail. substr(Str, Start, Len) -> <_:(Start-1)/binary, B:Len/binary |_> = Str, B. %% tokens(String, Seperators). %% Return a list of tokens seperated by characters in Seperators. token(S, Seps) -> tokens1(S, Seps, []). tokens1(S, [], Ack) -> Ack; tokens1(S , [Sep|Seps], Ack) -> A2 = tokens2(S, Sep, Ack), tokens1(S, Seps, A2). tokens2(S, Sep, Ack) -> case S of when Sz > 0 -> tokens2(Tail, Sep, [B|Ack]); _ -> Ack end. chars(C, N) -> chars(C, N, <>). chars(C, N, Tail) when N > 0 -> Btail = chars(C, N-1, Tail), ; chars(C, 0, Tail) -> Tail. %%% COPIES %%% copies(_, 0) -> <>; copies(S, Num) -> Btail = copies(S, Num-1), . %%% WORDS %%% words(String) -> words(String, $ ). words(String, Char) -> case String of -> 1 + words(Tail, Char); _ -> 0 end. %%% SUB_WORDS %%% sub_word(String, Index) -> sub_word(String, Index, $ ). sub_word(String, Ix, Char) -> sub_word(String, Ix, Char, 0). sub_word(String, Ix, Char, Sofar) -> case String of when Sofar == Ix -> B; -> sub_word(Tail, Ix, Char, Sofar+1); _ -> <> end. %%% STRIP %%% strip(String) -> strip(String, both). strip(String, left) -> strip_left(String, $ ); strip(String, right) -> strip_right(String, $ ); strip(String, both) -> strip_right(strip_left(String, $ ), $ ). strip(String, right, Char) -> strip_right(String, Char); strip(String, left, Char) -> strip_left(String, Char); strip(String, both, Char) -> strip_right(strip_left(String, Char), Char). strip_left(, C) -> strip_left(Tail, C); strip_left(B, _) -> B. strip_right(, Char) -> strip_right(B, Char); strip_right(B, Char) -> B. %%% LEFT %%% left(String, Len) -> left(String, Len, $ ). left(String, Len, Char) -> Slen = length(String), if Slen > Len -> substr(String, 1, Len); Slen < Len -> l_pad(String, Len-Slen, Char); Slen == Len -> String end. l_pad(String, Num, Char) -> Btail = chars(Char, Num), . %%% RIGHT %%% right(String, Len) -> right(String, Len, $ ). right(String, Len, Char) -> Slen = size(String), if Slen > Len -> substr(String, Slen-Len+1); Slen < Len -> r_pad(String, Len-Slen, Char); Slen == Len -> String end. r_pad(String, Num, Char) -> chars(Char, Num, String). %%% CENTRE %%% centre(String, Len) -> centre(String ,Len, $ ). centre(String, 0, _) -> []; %Strange cases to centre string centre(String, Len, Char) -> Slen = size(String), if Slen > Len -> substr(String, (Slen-Len) div 2 + 1, Len); Slen < Len -> N = (Len-Slen) div 2, r_pad(l_pad(String, Len-(Slen+N), Char), N, Char); Slen == Len -> String end. %%% SUB_STRING %%% sub_string(String, Start) -> substr(String, Start). sub_string(String, Start, Stop) -> substr(String, Start, Stop - Start + 1). %% The Regular Expression Matching Functions. %% %% These have been rewritten. As their interface has changed slightly %% (much to the better) I have moved them to a new module 'regexp' to %% avoid another "interface war" about something which doesn't %% serioulsy affect that many people. This interface is kept for %% backwards compatibility so I don't get shot for that as well. %% %% /Robert Virding re_sh_to_awk(ShellRegExp) -> regexp:sh_to_awk(ShellRegExp). re_parse(RegExp) -> case bregexp:parse(RegExp) of {ok,RE} -> {regexp,RE}; {error,E} -> {error,E} end. re_match(String, RegExp) -> case bregexp:match(String, RegExp) of {match,Start,Len} -> {match,substr(String, Start, Len),Start}; nomatch -> nomatch; {error,E} -> {error,E} end. re_sub(String, RegExp, New) -> case bregexp:sub(String, RegExp, New) of {ok,Res,N} -> {ok,Res}; {error,E} -> {error,E} end. re_gsub(String, RegExp, New) -> case bregexp:gsub(String, RegExp, New) of {ok,Res,N} -> {ok,Res}; {error,E} -> {error,E} end. re_split(String, RegExp) -> bregexp:split(String, RegExp). From etxuwig@REDACTED Thu Mar 15 12:50:11 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Thu, 15 Mar 2001 12:50:11 +0100 (MET) Subject: Erlang Efficiency quesitons In-Reply-To: <20010315122150.B17676@bluetail.com> Message-ID: On Thu, 15 Mar 2001, Klacke wrote: >I'll attach it here, It's written in our original >bit syntax and it woun't compile today. One thing that could be done right now is to provide a BIF which is equivalent to your bstring:chr(Char, Binary) function, i.e. return the position of the first location of Char in Binary (or 0 if Char was not found.) Since the current bit syntax doesn't allow constructs like: chr(S, C) when binary(S) -> case S of <_:Size/binary, C:8/char |_> -> Size + 1; _ -> 0 end. then perhaps the string:str/2 function should also have a BIF equivalent for binaries? and, while we're at it, a binary:reverse(Binary) BIF would also be useful. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From jamesh@REDACTED Thu Mar 15 16:23:46 2001 From: jamesh@REDACTED (James Hague) Date: Thu, 15 Mar 2001 09:23:46 -0600 Subject: Erlang Efficiency quesitons Message-ID: > > These days with the rise of XML, efficient string support > will become > > much more critical. > > > > Yup, Eight bytes per character bugs me as much as anyone, but in all honesty is string processing in Erlang really blindingly slow compared to other languages? For simple filters, Perl walks all over Erlang, but for parsing and such I'm not sure. Even if Erlang is a bit below average in the string processing department, the performance of the rest of the language is better than any interpreted language I have used. Heck, even in toy benchmarks it walks all over some compiled Lisps. And as it stands, Erlang doesn't involve issues about 8 vs 16 bit characters. It would be trivial to justuse binaries instead of strings as it is, I think. I rewrote a custom lexer to use binaries instead of lists, and it ended up much cleaner. James From jamesh@REDACTED Thu Mar 15 16:38:23 2001 From: jamesh@REDACTED (James Hague) Date: Thu, 15 Mar 2001 09:38:23 -0600 Subject: Stand Alone Erlang for Windows. yet again Message-ID: What would it take to get SAE working for Windows? Windows users can't do much to fix it, as the source still must be cross-compiled under Linux. So far queries about this have not been acknowledged by anyone in the know. I don't mean to be a pest :) I use a variety of scripting languages at home and work. Mostly I've used Perl at work, but I actually used Erlang to prototype an algorithm used in a commercial PlayStation 2 game, no joke! (See http://www.summoner.com if you want to see the game.) I have also written a good chunk of a disassembler in Erlang, though I may never finish it. I'm switching from Perl to REBOL for most scripting tasks now, but there are times when working in something high level but much faster--a la Erlang--is wonderful. Anyhow, if I write a script in something odd, I need a clean way of distributing it. REBOL is a snap, because the entire language plus all libraries fit into a 214K executable. Erlang is prohibitively messy, because it requires a full OTP installation. I could trim it down, but is still big. Yes, I'm outside the usual realm of Erlang here! I've been using Erlang as kind of a fast, well-maintained alternative to Prolog. If you look around, there are zero good and free Prologs available. The commercial ones tend to cost $1600 and up--per user--for a commercial license. James From bjorn@REDACTED Thu Mar 15 16:58:20 2001 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 15 Mar 2001 16:58:20 +0100 Subject: Stand Alone Erlang for Windows. yet again In-Reply-To: James Hague's message of "Thu, 15 Mar 2001 09:38:23 -0600" References: Message-ID: SAE is supported in the Beam emulator for Windows in R7B. Just as for Unix, there are no tools included in OTP. There is an example Makefile for Windows in erts/sae/src. R8 might be possible to build on Windows without a Unix system. We are working on it. /Bjorn James Hague writes: > What would it take to get SAE working for Windows? Windows users can't do > much to fix it, as the source still must be cross-compiled under Linux. So > far queries about this have not been acknowledged by anyone in the know. I > don't mean to be a pest :) > > I use a variety of scripting languages at home and work. Mostly I've used > Perl at work, but I actually used Erlang to prototype an algorithm used in a > commercial PlayStation 2 game, no joke! (See http://www.summoner.com if you > want to see the game.) I have also written a good chunk of a disassembler in > Erlang, though I may never finish it. I'm switching from Perl to REBOL for > most scripting tasks now, but there are times when working in something high > level but much faster--a la Erlang--is wonderful. > > Anyhow, if I write a script in something odd, I need a clean way of > distributing it. REBOL is a snap, because the entire language plus all > libraries fit into a 214K executable. Erlang is prohibitively messy, because > it requires a full OTP installation. I could trim it down, but is still > big. > > Yes, I'm outside the usual realm of Erlang here! I've been using Erlang as > kind of a fast, well-maintained alternative to Prolog. If you look around, > there are zero good and free Prologs available. The commercial ones tend to > cost $1600 and up--per user--for a commercial license. > > James > -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From jamesh@REDACTED Thu Mar 15 17:01:41 2001 From: jamesh@REDACTED (James Hague) Date: Thu, 15 Mar 2001 10:01:41 -0600 Subject: Stand Alone Erlang for Windows. yet again Message-ID: > SAE is supported in the Beam emulator for Windows in R7B. > Just as for Unix, > there are no tools included in OTP. There is an example > Makefile for Windows in > erts/sae/src. Wow, I had no idea. I will give it a try! From bparsia@REDACTED Thu Mar 15 18:34:51 2001 From: bparsia@REDACTED (Bijan Parsia) Date: Thu, 15 Mar 2001 12:34:51 -0500 (EST) Subject: Stand Alone Erlang for Windows. yet again In-Reply-To: Message-ID: On Thu, 15 Mar 2001, James Hague wrote: [snip] > Yes, I'm outside the usual realm of Erlang here! I've been using Erlang as > kind of a fast, well-maintained alternative to Prolog. If you look around, > there are zero good and free Prologs available. The commercial ones tend to > cost $1600 and up--per user--for a commercial license. AFAICT, both these claims are false. I.e.,t here are many good and free Prologs available (e.g., SWI-Prolog, http://www.swi.psy.uva.nl/projects/SWI-Prolog/) and many of the commercial one's are reasonably priced. SWI-Prolog is interesting because, among other things like a way fast XML parser (which is written in C and should be easily ported to generate Erlang terms), it's bundled with a portable OO/graphics/GUI library, XPCE. Apparantly, binding XPCE to a symbolic oriented language is pretty easy (there are several Lisp bindings, for example) and it would be neat if some C-ish person made one for Erlang. I find it snappier than the Erlang Tk stuff (on windows, at least) and it's got nice text/layout handling facilities, and emacs clone, drawing program, etc. http://www.swi.psy.uva.nl/projects/xpce/ Cheers, Bijan Parsia. From jamesh@REDACTED Thu Mar 15 19:09:13 2001 From: jamesh@REDACTED (James Hague) Date: Thu, 15 Mar 2001 12:09:13 -0600 Subject: Stand Alone Erlang for Windows. yet again Message-ID: > On Thu, 15 Mar 2001, James Hague wrote: > [snip] > > Yes, I'm outside the usual realm of Erlang here! I've been > using Erlang as > > kind of a fast, well-maintained alternative to Prolog. If > you look around, > > there are zero good and free Prologs available. The > commercial ones tend to > > cost $1600 and up--per user--for a commercial license. > > AFAICT, both these claims are false. I.e.,t here are many > good and free > Prologs available (e.g., SWI-Prolog, > http://www.swi.psy.uva.nl/projects/SWI-Prolog/) and many of the > commercial one's are reasonably priced. Somehow I missed SWI. I will look it at it. Thank you for the pointer! My opinion was formed by going through the Prolog implementation FAQ and looking at the available products. Considering how many implementations are listed there, it is surprising how many are either very expensive or very crusty feeling. That's a personal opinion, of course :) James From cpressey@REDACTED Thu Mar 15 20:17:43 2001 From: cpressey@REDACTED (Chris Pressey) Date: Thu, 15 Mar 2001 13:17:43 -0600 Subject: Erlang Efficiency quesitons References: Message-ID: <3AB11557.B8A24D90@catseye.mb.ca> James Hague wrote: > Eight bytes per character bugs me as much as anyone, but in all honesty is > string processing in Erlang really blindingly slow compared to other > languages? For simple filters, Perl walks all over Erlang, but for parsing > and such I'm not sure. Since Perl is (presumably!) optimized for text-handling, comparing Erlang against it probably isn't a fair or realistic comparison. Compared instead to a language with less emphasis on string-manipulation, for example Visual Basic perhaps, Erlang's string performance seems perfectly adequate. (i.e. VB strings are just as slow, or were the last time I used VB anyway.) > Even if Erlang is a bit below average in the string > processing department, the performance of the rest of the language is better > than any interpreted language I have used. Heck, even in toy benchmarks it > walks all over some compiled Lisps. In my experience, raw speed is not as important as the "perception of timeliness". Erlang might have some points against it speed-wise (I've found it's really easy to accidentally write O(N^2) or slower algorithms,) but it has a huge point for it with regards to how fast it *seems* to go. The lightweight processes and fair dispatching give the impression of smooth, almost continuous operation. Compared to programs written in Perl and even C++ which can seem to run choppily. For many people, choppy operation is more disconcerting than slow operation, all other things being equal (hey, you can always get a faster computer...) > It would be trivial to justuse binaries instead of strings as it is, I > think. I rewrote a custom lexer to use binaries instead of lists, and it > ended up much cleaner. I like some of the ramifications of optimizing strings. For example Erlang programs would compile a bit quicker (unless I'm profoundly mistaken about how the compiler works.) _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From bjorn@REDACTED Thu Mar 15 20:46:11 2001 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 15 Mar 2001 20:46:11 +0100 Subject: Erlang Efficiency quesitons In-Reply-To: Chris Pressey's message of "Thu, 15 Mar 2001 13:17:43 -0600" References: <3AB11557.B8A24D90@catseye.mb.ca> Message-ID: Chris Pressey writes: > I like some of the ramifications of optimizing strings. For example > Erlang programs would compile a bit quicker (unless I'm profoundly > mistaken about how the compiler works.) I doubt that. Strings are not used much inside the compiler. Tuples, records, and lists are. Strings are only used a lot in the parser pass. $ /usr/bin/time erlc +time erl_parse.erl error_if_jam : 0.000 s (5240 k) remove_file : 0.000 s (5240 k) parse_module : 1.430 s (23040 k) transform_module : 0.000 s (23040 k) lint_module : 0.530 s (23040 k) expand_module : 0.210 s (23040 k) v3_core : 0.380 s (23040 k) v3_core_opt : 0.980 s (23040 k) v3_kernel : 1.050 s (23040 k) v3_life : 0.440 s (27040 k) v3_codegen : 0.800 s (27040 k) beam_block : 0.340 s (27040 k) beam_bs : 0.030 s (27040 k) beam_jump : 0.140 s (27040 k) beam_type : 0.090 s (27040 k) beam_flatten : 0.030 s (27040 k) beam_asm : 0.260 s (27040 k) save_binary : 0.000 s (27040 k) real 16.9 user 7.3 sys 1.1 As you can see, the parse_module pass consumes only a relatively small proportion of the compilation time. /Bjorn -- Bj?rn Gustavsson Ericsson Utvecklings AB bjorn@REDACTED ?T2/UAB/F/P BOX 1505 +46 8 727 56 87 125 25 ?lvsj? From jamesh@REDACTED Thu Mar 15 20:47:56 2001 From: jamesh@REDACTED (James Hague) Date: Thu, 15 Mar 2001 13:47:56 -0600 Subject: Erlang Efficiency quesitons Message-ID: > I like some of the ramifications of optimizing strings. For example > Erlang programs would compile a bit quicker (unless I'm profoundly > mistaken about how the compiler works.) Ah, but you can do that with the current system! The lexer reads a file as a binary, then turns it into a list. All that is needed is to have the lexer operate on the binary directly. Pattern matching on binaries is already available, so this can be be done just fine in R7. After the lexing stage, the program is represented as a list of tuples, so you won't get much further benefit from speeding up strings. James From cpressey@REDACTED Thu Mar 15 20:46:30 2001 From: cpressey@REDACTED (Chris Pressey) Date: Thu, 15 Mar 2001 13:46:30 -0600 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) References: Message-ID: <3AB11C16.18323EE7@catseye.mb.ca> James Hague wrote: > I use a variety of scripting languages at home and work. Mostly I've used > Perl at work, but I actually used Erlang to prototype an algorithm used in a > commercial PlayStation 2 game, no joke! (See http://www.summoner.com if you > want to see the game.) OK, this looks like a good place for a segueway :-) I've noticed that one thing many Perl advocates tend to fall back on when defending their language of choice is that it is "fun." I don't, for the record, see "entertainment value" as a very important metric of a language, at least not one in which you wish to get some important work done. (For a toy language explicitly designed to be fun, it's another story.) But to me, Erlang is at least twice as fun as Perl, but I'm certain I have a different sense of fun than most Perl programmers - witnessing games like Perl Golf, I think the Perl definition of fun is closer to "language abuse." That sort of fun almost isn't possible in Erlang, which is the way I like it. But I do want to dispell the myth that because Erlang can do serious work, it can't also be used for fun - maybe in slightly different ways than Perl but that's OK. So I'm thinking about putting together a 'Fun with Erlang' web page to point to fun things people are doing with Erlang. Games written in Erlang like Othello, Minesweeper, and Board would be listed, but so would projects like this PS2 game (if that's all right with you, James). So my question to the list is if anyone knows of any other games or loosely fun-related projects in Erlang. I'm working on a game myself; it's sort of an MUD/MUSE/IF/roguelike thing, so I'd be especially interested in hearing about any online games or other fun stuff that's been attempted in Erlang. Thanks! _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From etxuwig@REDACTED Thu Mar 15 21:09:02 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Thu, 15 Mar 2001 21:09:02 +0100 (MET) Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <3AB11C16.18323EE7@catseye.mb.ca> Message-ID: On Thu, 15 Mar 2001, Chris Pressey wrote: >So my question to the list is if anyone knows of any other games or >loosely fun-related projects in Erlang. I don't know -- would the AXD 301 ATM switch count? I've had great fun here. (: /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From thantos@REDACTED Thu Mar 15 23:46:48 2001 From: thantos@REDACTED (Alexander Williams) Date: Thu, 15 Mar 2001 17:46:48 -0500 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <3AB11C16.18323EE7@catseye.mb.ca>; from cpressey@catseye.mb.ca on Thu, Mar 15, 2001 at 01:46:30PM -0600 References: <3AB11C16.18323EE7@catseye.mb.ca> Message-ID: <20010315174648.B13844@telocity.com> On Thu, Mar 15, 2001 at 01:46:30PM -0600, Chris Pressey wrote: > I'm working on a game myself; it's sort of an MUD/MUSE/IF/roguelike > thing, so I'd be especially interested in hearing about any online games > or other fun stuff that's been attempted in Erlang. Ooooh, now, this is fun: I was just thinking about Erlang-based MU* the other night (and, naturally, that led to my thoughts about Binary Strings vs List Strings; parsing eats up time in MU* design). Theoretically, a MU* implimented in Erlang could have easily distributable/extensible distributed databases; one could literally walk off the edge of one MU* and onto another hosted on another site and hardly know the difference ... except for any local player-mods that might have been made. Strolling from a systemless SocialEM (Erlang MU*) onto a World of Darkness EM wouldn't necessarily give you stats and structure (though the WoD could be coded to stat you as Joe Average; capturing migrating processes would be nicely necessary). The main question that it occured to me to ask would be "How is the best way to allow programming/extending the live system?" The facility for live upgrade of Erlang code gives us a direct hook into fixing things, but one has to impliment security on top of that. Do we go with the LP-like model with directories of files which are then instanced into existance, or something more MUX-like with instances being live at all times but possibly inherited from? Options, options. -- 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 cpressey@REDACTED Fri Mar 16 01:56:45 2001 From: cpressey@REDACTED (Chris Pressey) Date: Thu, 15 Mar 2001 18:56:45 -0600 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yetagain) References: Message-ID: <3AB164CD.7F2A9B83@catseye.mb.ca> Ulf Wiger wrote: > On Thu, 15 Mar 2001, Chris Pressey wrote: > >So my question to the list is if anyone knows of any other games or > >loosely fun-related projects in Erlang. > I don't know -- would the AXD 301 ATM switch count? > I've had great fun here. (: Unfortunately civilization has not yet advanced that far :-) I realize I'm kind of grasping at straws here. It's hard to contribute to a language project which is already pretty darn near ideal. :-) I guess I'm trying to fight the adoption barrier. I think there are good reasons to try to go "outside the realm of Erlang" as James mentioned. Consider uninformed objections like: "It would be a waste of my time to learn an obscure language hardly anyone knows." "Surely if it is used in an ATM switch it must not be suitable for any other environment." "It was developed by a company. Companies don't really understand open source software, so it must be some kind of trick." "It was developed in a research lab. Language researchers don't really understand programming in the field, so it must be an academic plaything." I don't believe in thoughtless advocacy, but I agree that becoming fluent in any language requires investment. So I feel that there might be ways to influence programmer's choice of investment - at least, to lessen their reluctance to invest in Erlang. Address the first objection and the other three become less important. ** You should use Erlang if you can get something out of it. If you can get something out of it, then learning Erlang was worth it and not a waste of time. ** Then it doesn't matter quite as much where it's used, or who made it. If what you want to get out of it is prototyping an algorithm that you will later use in something else entirely, then you still got something out of Erlang. If you use Erlang to teach yourself functional programming, then you still get something out of Erlang. Perhaps "Fun with Erlang" is an abstract and unrealistic way to try to "add value" to the language, I agree. But I'm not sure how else to approach it... the rather ambiguous problem of trying to "jazz up" the perception of Erlang. _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From mickael.remond@REDACTED Fri Mar 16 07:14:07 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Fri, 16 Mar 2001 07:14:07 +0100 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <3AB11C16.18323EE7@catseye.mb.ca>; from cpressey@catseye.mb.ca on Thu, Mar 15, 2001 at 01:46:30PM -0600 References: <3AB11C16.18323EE7@catseye.mb.ca> Message-ID: <20010316071407.A659@erlang-fr.org> Chris Pressey (cpressey@REDACTED) wrote: > > I'm working on a game myself; it's sort of an MUD/MUSE/IF/roguelike > thing, so I'd be especially interested in hearing about any online > games > or other fun stuff that's been attempted in Erlang. I was thinking about a MUD myself since several years. Then I meet Thierry Mallard. He told me about an interesting game project called "Worldforge". I convinced him to look at Erlang and he convinced me to have a look at Worldforge. Now we both think that such an online, massively multiplayer game could be done in Erlang and are exploring such a direction. Thierry Mallard wrote two articles on this topic, and several others are being written. If you need more information, you should have a look at the English Area of the French Erlang-fr site: http://www.erlang-fr.org/en-area/index.html Comments are welcome. -- Micka?l R?mond http://www.erlang-fr.org/ From cpressey@REDACTED Fri Mar 16 08:16:44 2001 From: cpressey@REDACTED (Chris Pressey) Date: Fri, 16 Mar 2001 01:16:44 -0600 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> Message-ID: <3AB1BDDC.C3DCB3D6@catseye.mb.ca> Alexander Williams wrote: > On Thu, Mar 15, 2001 at 01:46:30PM -0600, Chris Pressey wrote: > > I'm working on a game myself; it's sort of an MUD/MUSE/IF/roguelike > > thing, so I'd be especially interested in hearing about any online games > > or other fun stuff that's been attempted in Erlang. > Ooooh, now, this is fun: I was just thinking about Erlang-based MU* > the other night (and, naturally, that led to my thoughts about Binary > Strings vs List Strings; parsing eats up time in MU* design). Indeed... I'm sticking to binaries and atoms whereever possible. > Theoretically, a MU* implimented in Erlang could have easily > distributable/extensible distributed databases; one could literally > walk off the edge of one MU* and onto another hosted on another site > and hardly know the difference ... except for any local player-mods > that might have been made. Strolling from a systemless SocialEM > (Erlang MU*) onto a World of Darkness EM wouldn't necessarily give you > stats and structure (though the WoD could be coded to stat you as Joe > Average; capturing migrating processes would be nicely necessary). Although I had no such lofty plans to start out with, these were some of the strengths for why I picked Erlang to do this in. Servers should be able to treat each other as peers and refer clients to each other, and distributed programming should make that easy, almost trivial. > The main question that it occured to me to ask would be "How is the > best way to allow programming/extending the live system?" The > facility for live upgrade of Erlang code gives us a direct hook into > fixing things, but one has to impliment security on top of that. Indeed, I thought about that a bit too. A mechanism like Perl's taint-checking would be nice. Failing that, probably a little object-manipulation language which is compiled into safe Erlang when entered. > Do > we go with the LP-like model with directories of files which are then > instanced into existance, or something more MUX-like with instances > being live at all times but possibly inherited from? This just being an experiment for me, I'm not really following any particular model with much fidelity. This started out as an experimental roguelike game in Perl, which quickly got too complex to be easily maintainable. I started translating it to Erlang, but found I had a much easier time just rewriting most of it. All objects in my game are records in a monolithic mnesia table (which is currently ram-and-disc, I will probably change that to ram-only with periodic dumps in the future, for speed.) There is a field 'pid' in the record definition. Objects with 'agency' have a pid associated with them. Such objects can be NPC's (internal bots), in which case the process is responsible for their AI. Or they can be human players or external bots, in which case there's a valid value in the 'socket' field too. So the difference between 'live' and 'inert' objects is merely that of an attached process. I'm using a sort of 'object factory' approach where there are no classes; instead, 'exemplars' which are copied and tweaked. Exemplars describe distributions for stats (e.g. strength = 3d6) while instances have concrete values (e.g. strength = 15.) _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From jb@REDACTED Fri Mar 16 09:31:03 2001 From: jb@REDACTED (Johan Bevemyr) Date: Fri, 16 Mar 2001 09:31:03 +0100 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yetagain) In-Reply-To: Your message of "Thu, 15 Mar 2001 18:56:45 -0600" <3AB164CD.7F2A9B83@catseye.mb.ca> References: <3AB164CD.7F2A9B83@catseye.mb.ca> Message-ID: <20010316093103V.jb@bluetail.com> Client certificates cannot be self signed. They must be signed by a CA certificate. That is, a certificate with basic constraint CA:true. To get a CA certificate you can either create a test certificate or you can order one from Verisign (I have not verified that they will sell you one). Another possibility is to allow all client certificates signed by Verisign access to your site. To do this you would not have to generate any client certificates your self, you would only have to configure your server with Verisign's certificate as cacert. Verisign would then issue client certificates using their CA cert. A client certificate is by definition not self signed. The whole idea with client certificates is that the server should be able to verify the certificate. This verification is done by verifying that the certificate is signed by a certificate that we trust. A self signed certificate doesn't say anything about the holder. To sign a certificate you need both the private key and the certificate part. The private key is used to encrypt a checksum of the client certificate. Only the corresponding public CA key can then be used to decrypt the signature. Cheers, Johan ##### I tried on 010315.2 build. These are my steps: ##### /c/ssl/cert 1 ##### genclient ##### and I'm getting ""Error: Both a key and a certificate must be defined ##### before a certificate can be generated" ##### When I first "tftpcert" a Server Certificate, I get these message: ##### /c/ssl/cert 1 ##### tftpcert tftp_ip_address ##### specify a internally signed certificate ##### then, genclient ##### I'm getting "Error: Cannot generate signed certificates using non-CA certificate" ##### Now, does this self-signed client certificate has any association with the server certificate I TFTPed ? ##### I have attached my server certificate below. Please take a look. From thantos@REDACTED Fri Mar 16 09:54:31 2001 From: thantos@REDACTED (Alexander Williams) Date: Fri, 16 Mar 2001 03:54:31 -0500 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <3AB1BDDC.C3DCB3D6@catseye.mb.ca>; from cpressey@catseye.mb.ca on Fri, Mar 16, 2001 at 01:16:44AM -0600 References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> Message-ID: <20010316035431.B15777@telocity.com> On Fri, Mar 16, 2001 at 01:16:44AM -0600, Chris Pressey wrote: > Indeed, I thought about that a bit too. A mechanism like Perl's > taint-checking would be nice. Failing that, probably a little > object-manipulation language which is compiled into safe Erlang when > entered. It seems a bit ... unwieldy ... to plug in a whole separate language when we already have a perfectly wonderful language (Erlang) interpreting the core. I'd probably, given my druthers, throw away the idea of "representations as objects" for the more-Erlang'y "representations as processes," since Erlang lets us have extremely lightweight processes so easily. More, I suspect, below. :) > This started out as an experimental roguelike game in Perl, which Roguelike. In Perl. [instert: making sign of the cross] > All objects in my game are records in a monolithic mnesia table (which > is currently ram-and-disc, I will probably change that to ram-only with > periodic dumps in the future, for speed.) Yeeow. That's scary-big, I must say. (Of course, much of my internal sense of MU* scale has been shaped by sites like LambdaMOO and FurryMUCK, both on the edge of outside size. Once you hit several hundred to a thousand users on simul a night, even throwing text around gets messy.) I probably would have started with the DB itself being ram-only with dumps ... but that leaves aside the issue of how objects themselves get stored/updated. Does one update the mnesia table itself, or is that merely "current state," and the object sources are stored in text files in some kind of file hierarchy? My gut suggests that such an LP-like scheme might be just what the doctor ordered, because it makes hot-swapping code easy. > There is a field 'pid' in the record definition. Objects with 'agency' > have a pid associated with them. Such objects can be NPC's (internal > bots), in which case the process is responsible for their AI. Or they > can be human players or external bots, in which case there's a valid > value in the 'socket' field too. So the difference between 'live' and > 'inert' objects is merely that of an attached process. Hmmmmmm. Wouldn't it be easier to have "controlled objects" simply be associated with a Pid from which they accept messages/method calls, and its only the nature of the Pid that determines whether its player or AI-controlled? A Player Pid would involve a poll for outside input before it sent messages to the Thing, whereas an AI would be just sending them based on perceptions (as relayed back by the Thing) and coded responses. Exempli gratia (a Thing based on an Erlang Process, because its an Erlang ML :)): Thing is considered to be the Pid of the "Thing" process here. Thing accepts several messages from anyone: {see, Sender, Text} -> Something game-environment is seen (usually room Descriptions and such). {hear, Sender, Text} -> Thing hears something. It might be from someone speaking in the room or a creaky floor. Could be anything. {smell, Sender, Text} -> I think you get the idea here. You wouldn't necessarily need to have a message for each sense (in fact, most MU* systems don't even provide the facility to do so, Things can only {hear, Sender, Text}). Pretty much everyone counts on Sender being useful, for various reasons, so message-sending is typically only done through protected functions. Also note that receiving messages you don't know what to do with should be pretty much just silently tossed, maybe with a message to a debugging log if desired. (It doesn't matter if your Robotic Dog doesn't impliment {temperatureSense, Sender, Change}, for example. :)) Likewise, Things can be ordered to do actions (which likely cause Thing to, in turn, send messages to other Pids in its virtual area, informing them to remove Thing from the target's content list, etc.). Command-messages are only accepted from an appropriate Sender (defined when the Thing is created and probably updatable). If its not from Sender, toss it. Useful command-messages might include: {move, Sender, Direction} {say, Sender, Text} {odour, Sender, Text} {reloadCode, Sender} The last one lets you update the beasty on the fly without requiring you to do a module:loop call every time through, making it slightly more efficient and controllable. A Player's Character, then, would only respond to command-messages from the Player's ConnectionProcess Pid or a Wizard's privilidged Pid (and, in turn, would emit status messages to that CP Pid). A bot, on the other hand, would have an AI Pid it listened to and emitted to, but the underlying Thing could be responding to either, invisibly (and, if desired, switchably). (Forgive me if this seems scattered, I'm writing this extemporaneously. :)) > I'm using a sort of 'object factory' approach where there are no > classes; instead, 'exemplars' which are copied and tweaked. Exemplars > describe distributions for stats (e.g. strength = 3d6) while instances > have concrete values (e.g. strength = 15.) Hmmmmm, so you're mimicing a very MUSH/MUX-like system for that. Though you might want to allow for multiple Exemplars for any given Instance and arbitrarily deep chains of Exemplars, to allow for more flexible behaviour. (Ie. an Exemplar that soley contains the statistic system and an Exemplar that contains the physical commands for, say, a certain class of monster, as opposed to another; they share stats and methods to access stats in common but the Basilisk may change anything in its LoS to stone while the Cockatrice requires touching, or something like that.) I've been reading Theirry's articles as referenced earlier about implimenting Worldforge in Erlang. I'll be honest, I dislike the Worldforge project itself because I think its too ambitious and unrealistic, but Thierry has broken down the necessary structures underlying /any/ kind of IP-driven client/server interface very well. These bits of code could very well form the core of a good MU* server (and likely give far better performance than we have seen in the past for MU* servers; soft-realtime is good). -- 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 jb@REDACTED Fri Mar 16 10:01:47 2001 From: jb@REDACTED (Johan Bevemyr) Date: Fri, 16 Mar 2001 10:01:47 +0100 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yetagain) In-Reply-To: Your message of "Fri, 16 Mar 2001 09:31:03 +0100" <20010316093103V.jb@bluetail.com> References: <20010316093103V.jb@bluetail.com> Message-ID: <20010316100147G.jb@bluetail.com> Sorry, mail reader messed up my reply. /JOhan From mickael.remond@REDACTED Fri Mar 16 12:25:03 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Fri, 16 Mar 2001 12:25:03 +0100 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <20010316035431.B15777@telocity.com>; from thantos@telocity.com on Fri, Mar 16, 2001 at 03:54:31AM -0500 References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> Message-ID: <20010316122503.A678@idealx.com> > > Hmmmmmm. Wouldn't it be easier to have "controlled objects" simply be > associated with a Pid from which they accept messages/method calls, > and its only the nature of the Pid that determines whether its player > or AI-controlled? A Player Pid would involve a poll for outside input > before it sent messages to the Thing, whereas an AI would be just > sending them based on perceptions (as relayed back by the Thing) and > coded responses. [snip...] I have read your whole message and I must admit that the "picture" you are proposing is very exciting. We will place it on the Erlang-fr page and translate it in French, if you do not mind. > I've been reading Theirry's articles as referenced earlier about > implimenting Worldforge in Erlang. I'll be honest, I dislike the > Worldforge project itself because I think its too ambitious and > unrealistic, but Thierry has broken down the necessary structures > underlying /any/ kind of IP-driven client/server interface very well. > These bits of code could very well form the core of a good MU* server > (and likely give far better performance than we have seen in the past > for MU* servers; soft-realtime is good). > I agree with you on Worldforge ambition, that is why I was first interested in a MUD like approach, which is much more established. But Thierry Mallard convinced me to have a look at Worldforge. We then come to think that an Erlang approach could make this project feasible. We are both very pragmatic and are interested in first having some code working and then improving it. Your reflexion on the game design by process is very insteresting. Maybe we could start working together on a real working and playable implementation ? -- Micka?l R?mond http://www.erlang-fr.org/ From thantos@REDACTED Fri Mar 16 14:00:40 2001 From: thantos@REDACTED (Alexander Williams) Date: Fri, 16 Mar 2001 08:00:40 -0500 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <20010316122503.A678@idealx.com>; from mickael.remond@erlang-fr.org on Fri, Mar 16, 2001 at 12:25:03PM +0100 References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <20010316122503.A678@idealx.com> Message-ID: <20010316080040.A16507@telocity.com> On Fri, Mar 16, 2001 at 12:25:03PM +0100, Mickael Remond wrote: > I have read your whole message and I must admit that the "picture" you > are proposing is very exciting. > We will place it on the Erlang-fr page and translate it in French, if > you do not mind. By all means, people from all countries should be exposed to the horror of my ideas and imaginings. :) > I agree with you on Worldforge ambition, that is why I was first > interested in a MUD like approach, which is much more established. > But Thierry Mallard convinced me to have a look at Worldforge. We then > come to think that an Erlang approach could make this project feasible. > We are both very pragmatic and are interested in first having some code > working and then improving it. I'd love to see the basic core systems implimented in Erlang and supporting some kind of "MU*-like text-based VR" before I buy into the Worldforge plan; I've been following it for a while (as a good MU*-geek should) and, while they have some good single-scenario systems, I don't think they have the genericity to provide the kind of experience I look for online (not the least reason being that anyone can spell "cow" but I'll be damned if I can draw one). If any approach COULD improve the feasibility, its likely Erlang. > Your reflexion on the game design by process is very insteresting. > Maybe we could start working together on a real working and playable > implementation ? Years of actually thinking about and beating on the problem. I'm probably one of the few folks who've both worked on Coda (a Scheme-based MU* core) and POO (a Python-based system). I'd certainly be interested in helping out wherever I can, even if its purely on design and structure. (One of the main problems I see in such projects most of the time is everyone wants to get in there and beat code without thinking of overall design first; I do not suffer that problem. Probably because I find design more fun than implimentation. :)) -- 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 mickael.remond@REDACTED Fri Mar 16 14:44:44 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Fri, 16 Mar 2001 14:44:44 +0100 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <20010316080040.A16507@telocity.com>; from thantos@telocity.com on Fri, Mar 16, 2001 at 08:00:40AM -0500 References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <20010316122503.A678@idealx.com> <20010316080040.A16507@telocity.com> Message-ID: <20010316144444.G678@idealx.com> Alexander Williams (thantos@REDACTED) wrote: > > Years of actually thinking about and beating on the problem. I'm > probably one of the few folks who've both worked on Coda (a > Scheme-based MU* core) and POO (a Python-based system). I'd certainly > be interested in helping out wherever I can, even if its purely on > design and structure. (One of the main problems I see in such > projects most of the time is everyone wants to get in there and beat > code without thinking of overall design first; I do not suffer that > problem. Probably because I find design more fun than > implimentation. :)) Hey ? You've worked on Poo ? This is precisely the Mud that I enjoyed reading and that gave me the idea to write an Erlang Mud. I really like the Poo implementation. I found it brilliant. The code is extremely compact. Beautiful. I am very eager to implement such a tool in Erlang, using process oriented design... -- Micka?l R?mond From thantos@REDACTED Fri Mar 16 15:20:26 2001 From: thantos@REDACTED (Alexander Williams) Date: Fri, 16 Mar 2001 09:20:26 -0500 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <20010316144444.G678@idealx.com>; from mickael.remond@erlang-fr.org on Fri, Mar 16, 2001 at 02:44:44PM +0100 References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <20010316122503.A678@idealx.com> <20010316080040.A16507@telocity.com> <20010316144444.G678@idealx.com> Message-ID: <20010316092026.A16714@telocity.com> On Fri, Mar 16, 2001 at 02:44:44PM +0100, Mickael Remond wrote: > Hey ? You've worked on Poo ? > This is precisely the Mud that I enjoyed reading and that gave me the > idea to write an Erlang Mud. > I really like the Poo implementation. I found it brilliant. The code is > extremely compact. Beautiful. I hacked on it a bit. Ultimately, I found it personally unsatisfactory, in part because of the way the database itself is managed in POO. Marshalling objects to the store is a great idea in principle, but the ability to turn around and say "dump this whole thing to ASCII" never materialized, and doing online inline modifications of the core server objects was not only possible, but necessary ... but once committed, never came out again in a way that let you examine the server as a whole. One of the things I WOULD like to steal openhandedly from POO is the way in which objects can be referenced not only be a unique ID (which we get for free in Erlang), but the way objects could be referenced in Directory container objects; the "$MajorThing.MinorThing.TargetThing" concept was a brilliant insight. It makes accessing a live-object in a known environment trivial. Coupling this with an LP-like file-based object source store would be an excellent move, I think. Updating objects, then, wouldn't necessarily involve touching them directly unless its to set the Thing's local environment. Modifying code would involve editing the file, compiling it, then sending a "{reloadSource}" message to the poor beleagured thing. Much safer, in the long run, because no object behaviour is changed until the source is at least lexically correct. > I am very eager to implement such a tool in Erlang, using process > oriented design... I think it can be done. One thing I wonder about, however, is whether a running process can be marshalled out to disk and reloaded. If so, we're golden. If not ... well, then we get into questions about how to manage state persistantly. Its far easier to say "dump all child processes of this Pid to disk" than to say "OK, walk this list of Pids and query them for state," especially when you go to reload. -- 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 etxuwig@REDACTED Fri Mar 16 15:30:32 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Fri, 16 Mar 2001 15:30:32 +0100 (MET) Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <20010316092026.A16714@telocity.com> Message-ID: On Fri, 16 Mar 2001, Alexander Williams wrote: >I think it can be done. One thing I wonder about, however, is whether >a running process can be marshalled out to disk and reloaded. If so, >we're golden. This can be done, as long as one doesn't make any assumptions about Pid (it will change), and there's a stable state in which to do this. Take a look at the dispatcher contrib. It packs processes into ETS, re-activating them if something happens. This is done on top of the existing Erlang, and is similar to a mechanism used in AXD301 for handling connection setups (the problem there is that we can't have one process per connection, as there are too many connections.) One could make it more general still by extracting the process dictionary before killing the process instance. You still need to define some programming rules for such a process. If you create an ETS table, you'll be surprised to find it gone when you need it. I once toyed with the idea that you could mirror a process to another erlang node in real-time, e.g. using something like Encore's Reflective Memory technology (http://www.encore.com). Then, you'd have to introduce some 'passive' state for the process replica. I couldn't get a clear mental picture of the repercussions, so I dropped the idea. I imagine really dumping processes to disk would have some similar repercussions. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From bcpierce@REDACTED Fri Mar 16 15:33:31 2001 From: bcpierce@REDACTED (Benjamin C. Pierce) Date: Fri, 16 Mar 2001 09:33:31 EST Subject: TACS 2001 call for papers (deadline April 1) Message-ID: <23064.984753211@saul.cis.upenn.edu> Call For Papers Fourth International Symposium on Theoretical Aspects of Computer Science (TACS 2001) October 29-31, 2001 Tohoku University, Sendai, Japan http://tacs2001.ito.ecei.tohoku.ac.jp/tacs2001/ The TACS Symposium will focus on the theoretical foundations of programming and their applications. The topics of interest include... Theoretical aspects of the design, semantics, analysis, and implementation of programming languages and systems; logics of programs; calculi and models of concurrency and parallel computation; theories of mobile computation and system security; categories and types in computer science; formalisms, methods, and systems for program specification, verification, synthesis, and optimization; constructive, linear, and modal logics in computer science. The scientific program will consist of invited lectures, contributed talks, and demo sessions. A proceedings containing the full papers of the invited and contributed talks will be published by Springer-Verlag as a volume of Lecture Notes in Computer Science. IMPORTANT DATES Submission deadline: April 1, 2001 Notification to authors: June 15, 2001 Deadline for final versions: July 20, 2001 INVITED SPEAKERS Luca Cardelli Microsoft Research Daniel Jackson Massachusetts Institute of Technology Christine Paulin-Mohring Universite Paris Sud & INRIA Andrew Pitts University of Cambridge Jon Riecke Lucent Technologies Kazunori Ueda Waseda University CONFERENCE CHAIR: Takayasu Ito Tohoku University PROGRAM CO-CHAIRS: Naoki Kobayashi Tokyo Institute of Technology kobayasi@REDACTED Benjamin Pierce University of Pennsylvania bcpierce@REDACTED PROGRAM COMMITTEE: Zena Ariola University of Oregon Cedric Fournet Microsoft Research Jacques Garrigue Kyoto University Masami Hagiya University of Tokyo Robert Harper Carnegie Mellon University Masahito Hasegawa Kyoto University Nevin Heintze Lucent Technologies Martin Hofmann Edinburgh University Zhenjiang Hu University of Tokyo Naoki Kobayashi Tokyo Institute of Technology Martin Odersky Ecole Polytechnique Federale de Lausanne Catuscia Palamidessi Pennsylvania State University Benjamin Pierce University of Pennsylvania Francois Pottier INRIA Andre Scedrov University of Pennsylvania Natarajan Shankar SRI International Ian Stark Edinburgh University Makoto Tatsuta Kyoto University SUBMISSION INFORMATION Authors are invited to submit full papers (up to 6000 words, including figures and bibliographies). Papers must be unpublished and not submitted for publication elsewhere. Submissions should be in Postscript or PDF format, on A4 or US letter pages. They must be printable on common printers and viewable with ghostview or acroread. The first page of each submission should include the email address, telephone, and fax numbers of the corresponding author. Accepted papers must be presented at the symposium, and the final manuscript must be prepared in the LNCS format. All submissions should be done electronically through the TACS submission page http://saul.cis.upenn.edu:8086/. From Chandrashekhar.Mullaparthi@REDACTED Fri Mar 16 15:42:48 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Fri, 16 Mar 2001 14:42:48 -0000 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) Message-ID: <402DD461F109D411977E0008C791C31203919A01@imp02mbx.one2one.co.uk> > I think it can be done. One thing I wonder about, however, is whether > a running process can be marshalled out to disk and reloaded. If so, > we're golden. If not ... well, then we get into questions about how > to manage state persistantly. Its far easier to say "dump all child > processes of this Pid to disk" than to say "OK, walk this list of Pids > and query them for state," especially when you go to reload. I dont have a clue what you guys are talking about but it should be pretty easy to store the internal state of a process to disk and then recreate a process with exactly the same state. But you'll need more than a Pid to identify the process on disk. Chandru 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 cpressey@REDACTED Fri Mar 16 20:35:47 2001 From: cpressey@REDACTED (Chris Pressey) Date: Fri, 16 Mar 2001 13:35:47 -0600 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> Message-ID: <3AB26B13.B43E20C2@catseye.mb.ca> Alexander Williams wrote: > On Fri, Mar 16, 2001 at 01:16:44AM -0600, Chris Pressey wrote: > > Indeed, I thought about that a bit too. A mechanism like Perl's > > taint-checking would be nice. Failing that, probably a little > > object-manipulation language which is compiled into safe Erlang when > > entered. > It seems a bit ... unwieldy ... to plug in a whole separate language > when we already have a perfectly wonderful language (Erlang) > interpreting the core. I totally agree. However, I can't think of a way to stop people from writing 'bot code like: apply(unix, cmd, ["rm -rf *"]). And that would be bad! I suppose taking out the unix module entirely might help... I'm not familiar enough with Erlang to know how many other holes are possible, though. > > This started out as an experimental roguelike game in Perl, which > Roguelike. In Perl. [instert: making sign of the cross] :-) If you want to see it (keeping in mind it is totally an unfinished experimental prototype) it can be found at http://www.catseye.mb.ca/games/carpe/corona/ I have no idea if my Erlang project will turn out anything like that, though. Currently my temptation is to have a more hierarchical, abstract world, mainly because it would simplify it greatly if you could just see everything in the current 'room' instead of calculating line-of-sight to determine the set of visible objects. > I probably would have started with the DB itself > being ram-only with dumps ... but that leaves aside the issue of how > objects themselves get stored/updated. Does one update the mnesia > table itself, or is that merely "current state," and the object > sources are stored in text files in some kind of file hierarchy? My > gut suggests that such an LP-like scheme might be just what the doctor > ordered, because it makes hot-swapping code easy. Hot-swapping code is already pretty easy - this is Erlang! :-) My feelings - though I'm a mnesia newbie - is that one big table (in RAM) is going to be the fastest solution - because any partitioning would mean more resource-accesses per data-access. I don't see a lot of reason to add filesystem directories to the mix, as mnesia already has many of the properties that files have but database fields traditionally do not (variable length, complex structures etc.) It would be possible to go to far, though; for example, fight statistics could be stored in another table, as they wouldn't have to be accessed all the time, only on certain specific occassions. > > There is a field 'pid' in the record definition. Objects with 'agency' > > have a pid associated with them. Such objects can be NPC's (internal > > bots), in which case the process is responsible for their AI. Or they > > can be human players or external bots, in which case there's a valid > > value in the 'socket' field too. So the difference between 'live' and > > 'inert' objects is merely that of an attached process. > Hmmmmmm. Wouldn't it be easier to have "controlled objects" simply be > associated with a Pid from which they accept messages/method calls, > and its only the nature of the Pid that determines whether its player > or AI-controlled? That is pretty much the case. Imagine functions player_loop() and npc_loop(). They act very similarly except that player_loop() gets its orders from a socket, and npc_loop() calculates its orders using AI. Sure, they could be the same function, since they share some functionality, but I think it would be a tad more efficient if they were seperate functions (so that NPC's aren't continually checking for their non-existant sockets.) > Thing accepts several messages from anyone: > {see, Sender, Text} -> Something game-environment is seen (usually > room Descriptions and such). > {hear, Sender, Text} -> Thing hears something. It might be from > someone speaking in the room or a creaky floor. Could be anything. > {smell, Sender, Text} -> I think you get the idea here. Yeah, you pretty much read my mind here... each process associated with a 'live' object, be it an AI-controlled NPC or a player, must be able to respond to a standard set of messages like this. > Also note that > receiving messages you don't know what to do with should be pretty > much just silently tossed, maybe with a message to a debugging log if > desired. (It doesn't matter if your Robotic Dog doesn't impliment > {temperatureSense, Sender, Change}, for example. :)) Good observation... no applicable sense means the stimulus is ignored. There are also some 'higher-order sense' that turn out to be useful. For example, being able to see someone else move. {see_move, Sender, NewPosition} or something. > Likewise, Things can be ordered to do actions (which likely cause > Thing to, in turn, send messages to other Pids in its virtual area, > informing them to remove Thing from the target's content list, etc.). I dunno. In my scheme, 'live' objects can be suggested to do actions, but what they actually do is up to them. You could suggest to your dog that it follow you, and if it is loyal it will obey. But if it catches rabies, it's AI might change and it might not be so complicit! > A Player's Character, then, would only respond to command-messages > from the Player's ConnectionProcess Pid or a Wizard's privilidged Pid > (and, in turn, would emit status messages to that CP Pid). A bot, on > the other hand, would have an AI Pid it listened to and emitted to, > but the underlying Thing could be responding to either, invisibly > (and, if desired, switchably). Well, it seems as if you have two processes here (one for the logic, one for the object-state), while I don't see why you need more than one process (which can handle both logic and object-state.) > I've been reading Theirry's articles as referenced earlier about > implimenting Worldforge in Erlang. I'll be honest, I dislike the > Worldforge project itself because I think its too ambitious and > unrealistic, but Thierry has broken down the necessary structures > underlying /any/ kind of IP-driven client/server interface very well. Hmm... yes, I feel similarly. Worldforge seems a bit like a Platonic ideal... then again I had no designs on building a 1,000-user MU* :-) I'm simply not up to that, yet. What I have now is not much more than a chatroom with LoS :-) _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From etxuwig@REDACTED Fri Mar 16 22:48:19 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Fri, 16 Mar 2001 22:48:19 +0100 (MET) Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <3AB26B13.B43E20C2@catseye.mb.ca> Message-ID: On Fri, 16 Mar 2001, Chris Pressey wrote: >Alexander Williams wrote: > >I totally agree. However, I can't think of a way to stop people from >writing 'bot code like: > > apply(unix, cmd, ["rm -rf *"]). For various other reasons, it would be nice if it were possible to trap all calls coming out from a module, but one such reason would be safety. I've had a few ideas: - if code runs in another node, one might want to specialize the RPC behaviour. Then, in fact making RPC a behaviour would be very handy. One could perhaps specify at Erlang boot time via a kernel environment variable which behaviour module to use for rpc. When you think about it, lots more modules in OTP should really be behaviours that could be specialized. - We've played around with different ways of taking care of really hairy upgrade scenarios. One idea that came up (I think OTP is still thinking about whether to cheer or throw eggs at us) was to make it possible via the OTP R7B trace mechanism to reroute a function call to another function (with same arity). For example all calls to mnesia:write/1 could be rerouted to myMnesia:write/2; a corresponding trap for message sending could be to call M:F(Pid, Message) instead of sending the message. Dangerous stuff, but it would be extremely flexible. >My feelings - though I'm a mnesia newbie - is that one big table (in >RAM) is going to be the fastest solution - because any partitioning >would mean more resource-accesses per data-access. I don't see a lot of >reason to add filesystem directories to the mix, as mnesia already has >many of the properties that files have but database fields traditionally >do not (variable length, complex structures etc.) It really depends on just how big your big table is. If it's in the neighbourhood of a million objects, you probably don't want to use mnesia. Performance will be great as soon as you have the data in RAM, but it will take many hours to load it from dets -- days if the file needs repair. I ran into just that problem with CCviewer: a table with 2 million objects took 36 hours to load, so I resorted to a file system database instead. The situation should be much improved in OTP R8, I've been told. >There are also some 'higher-order sense' that turn out to be useful. >For example, being able to see someone else move. {see_move, Sender, >NewPosition} or something. Have you read the thesis on OTP behaviours for simulations? I don't remember the URL, but it was posted on this list recently. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From thantos@REDACTED Sat Mar 17 00:33:46 2001 From: thantos@REDACTED (Alexander Williams) Date: Fri, 16 Mar 2001 18:33:46 -0500 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: ; from etxuwig@etxb.ericsson.se on Fri, Mar 16, 2001 at 03:30:32PM +0100 References: <20010316092026.A16714@telocity.com> Message-ID: <20010316183346.A18068@telocity.com> On Fri, Mar 16, 2001 at 03:30:32PM +0100, Ulf Wiger wrote: > This can be done, as long as one doesn't make any assumptions about > Pid (it will change), and there's a stable state in which to do this. So, we end up needing another unique ID system. (Gensym, come home, all is forgiven!) I'd really like to shy away from the MU*-traditional form of just increasing integers, but ... it is simple and effective, I suppose. > AXD301 for handling connection setups (the problem there is that we > can't have one process per connection, as there are too many > connections.) Right, an advantage that a MU* has, typically only having to deal with 10-20 "real people" at any given time, and on the high-end, 300-400. While MMORPGs often have 10,000+ folks on, I think we'll go a little lighter on expectations. :) > I once toyed with the idea that you could mirror a process to > another erlang node in real-time, e.g. using something like Encore's > Reflective Memory technology (http://www.encore.com). Then, you'd > have to introduce some 'passive' state for the process replica. > I couldn't get a clear mental picture of the repercussions, so I > dropped the idea. I imagine really dumping processes to disk would > have some similar repercussions. Exactly. Its handled in a couple different ways in current MU* environment, sadly, areas I'm less expert than I'd like to be. I recall POO, owing to its Python OOP nature, simply marshalls up the objects with their attached state to disk, and upon restart, loads everything back up before init'ing it (so references from a live object from a yet-to-be-restored don't happen). Unfortunately, that's no so much an option here. I /really/ should take a closer look at how LP does it; LP's objects are written in a C-variant, so they can't really just be "marshalled up," I suppose. One advantage of going an LP-esque route would be the actual Thing sourcecode would be saved externally to the database itself. Hmmmmmm. Maybe it would be enough to impliment a {dump} routine on each Thing which takes the state-tuple its passing to itself on each loop as well as the process dictionary and packages it up along with where its source-file lives, then puts it in the database. You'd need a similar {restore} method that wakes it back up as an instance after being pulled back out of the database, and probably an {initialize} just to get it started back up in the first place. Challenging problem. Thank Hades we have ETS already as a decent databasing system built in. That's 3/4ths of a major MU* design nightmare right there. I do sort of miss Python's Dictionaries, a sort of lightweight hash/array that maps an immutable value to another value, but ... I think we'll deal. -- 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 cpressey@REDACTED Sat Mar 17 01:07:42 2001 From: cpressey@REDACTED (Chris Pressey) Date: Fri, 16 Mar 2001 18:07:42 -0600 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <3AB26B13.B43E20C2@catseye.mb.ca> Message-ID: <3AB2AACE.6E096A0E@catseye.mb.ca> Chris Pressey wrote: > Well, it seems as if you have two processes here (one for the logic, one > for the object-state), while I don't see why you need more than one > process (which can handle both logic and object-state.) Wait, I think I get it now. In Erlang 'tis generally better to have two processes with infinite timeouts (interrupt model) than one process with finite timeouts (polling model.) :-) _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From jb@REDACTED Fri Mar 16 09:31:03 2001 From: jb@REDACTED (Johan Bevemyr) Date: Fri, 16 Mar 2001 09:31:03 +0100 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yetagain) In-Reply-To: Your message of "Thu, 15 Mar 2001 18:56:45 -0600" <3AB164CD.7F2A9B83@catseye.mb.ca> References: <3AB164CD.7F2A9B83@catseye.mb.ca> Message-ID: <20010316093103V.jb@bluetail.com> Client certificates cannot be self signed. They must be signed by a CA certificate. That is, a certificate with basic constraint CA:true. To get a CA certificate you can either create a test certificate or you can order one from Verisign (I have not verified that they will sell you one). Another possibility is to allow all client certificates signed by Verisign access to your site. To do this you would not have to generate any client certificates your self, you would only have to configure your server with Verisign's certificate as cacert. Verisign would then issue client certificates using their CA cert. A client certificate is by definition not self signed. The whole idea with client certificates is that the server should be able to verify the certificate. This verification is done by verifying that the certificate is signed by a certificate that we trust. A self signed certificate doesn't say anything about the holder. To sign a certificate you need both the private key and the certificate part. The private key is used to encrypt a checksum of the client certificate. Only the corresponding public CA key can then be used to decrypt the signature. Cheers, Johan ##### I tried on 010315.2 build. These are my steps: ##### /c/ssl/cert 1 ##### genclient ##### and I'm getting ""Error: Both a key and a certificate must be defined ##### before a certificate can be generated" ##### When I first "tftpcert" a Server Certificate, I get these message: ##### /c/ssl/cert 1 ##### tftpcert tftp_ip_address ##### specify a internally signed certificate ##### then, genclient ##### I'm getting "Error: Cannot generate signed certificates using non-CA certificate" ##### Now, does this self-signed client certificate has any association with the server certificate I TFTPed ? ##### I have attached my server certificate below. Please take a look. From cpressey@REDACTED Fri Mar 16 08:16:44 2001 From: cpressey@REDACTED (Chris Pressey) Date: Fri, 16 Mar 2001 01:16:44 -0600 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> Message-ID: <3AB1BDDC.C3DCB3D6@catseye.mb.ca> Alexander Williams wrote: > On Thu, Mar 15, 2001 at 01:46:30PM -0600, Chris Pressey wrote: > > I'm working on a game myself; it's sort of an MUD/MUSE/IF/roguelike > > thing, so I'd be especially interested in hearing about any online games > > or other fun stuff that's been attempted in Erlang. > Ooooh, now, this is fun: I was just thinking about Erlang-based MU* > the other night (and, naturally, that led to my thoughts about Binary > Strings vs List Strings; parsing eats up time in MU* design). Indeed... I'm sticking to binaries and atoms whereever possible. > Theoretically, a MU* implimented in Erlang could have easily > distributable/extensible distributed databases; one could literally > walk off the edge of one MU* and onto another hosted on another site > and hardly know the difference ... except for any local player-mods > that might have been made. Strolling from a systemless SocialEM > (Erlang MU*) onto a World of Darkness EM wouldn't necessarily give you > stats and structure (though the WoD could be coded to stat you as Joe > Average; capturing migrating processes would be nicely necessary). Although I had no such lofty plans to start out with, these were some of the strengths for why I picked Erlang to do this in. Servers should be able to treat each other as peers and refer clients to each other, and distributed programming should make that easy, almost trivial. > The main question that it occured to me to ask would be "How is the > best way to allow programming/extending the live system?" The > facility for live upgrade of Erlang code gives us a direct hook into > fixing things, but one has to impliment security on top of that. Indeed, I thought about that a bit too. A mechanism like Perl's taint-checking would be nice. Failing that, probably a little object-manipulation language which is compiled into safe Erlang when entered. > Do > we go with the LP-like model with directories of files which are then > instanced into existance, or something more MUX-like with instances > being live at all times but possibly inherited from? This just being an experiment for me, I'm not really following any particular model with much fidelity. This started out as an experimental roguelike game in Perl, which quickly got too complex to be easily maintainable. I started translating it to Erlang, but found I had a much easier time just rewriting most of it. All objects in my game are records in a monolithic mnesia table (which is currently ram-and-disc, I will probably change that to ram-only with periodic dumps in the future, for speed.) There is a field 'pid' in the record definition. Objects with 'agency' have a pid associated with them. Such objects can be NPC's (internal bots), in which case the process is responsible for their AI. Or they can be human players or external bots, in which case there's a valid value in the 'socket' field too. So the difference between 'live' and 'inert' objects is merely that of an attached process. I'm using a sort of 'object factory' approach where there are no classes; instead, 'exemplars' which are copied and tweaked. Exemplars describe distributions for stats (e.g. strength = 3d6) while instances have concrete values (e.g. strength = 15.) _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From mickael.remond@REDACTED Fri Mar 16 07:14:07 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Fri, 16 Mar 2001 07:14:07 +0100 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <3AB11C16.18323EE7@catseye.mb.ca>; from cpressey@catseye.mb.ca on Thu, Mar 15, 2001 at 01:46:30PM -0600 References: <3AB11C16.18323EE7@catseye.mb.ca> Message-ID: <20010316071407.A659@erlang-fr.org> Chris Pressey (cpressey@REDACTED) wrote: > > I'm working on a game myself; it's sort of an MUD/MUSE/IF/roguelike > thing, so I'd be especially interested in hearing about any online > games > or other fun stuff that's been attempted in Erlang. I was thinking about a MUD myself since several years. Then I meet Thierry Mallard. He told me about an interesting game project called "Worldforge". I convinced him to look at Erlang and he convinced me to have a look at Worldforge. Now we both think that such an online, massively multiplayer game could be done in Erlang and are exploring such a direction. Thierry Mallard wrote two articles on this topic, and several others are being written. If you need more information, you should have a look at the English Area of the French Erlang-fr site: http://www.erlang-fr.org/en-area/index.html Comments are welcome. -- Micka?l R?mond http://www.erlang-fr.org/ From thantos@REDACTED Sat Mar 17 04:18:08 2001 From: thantos@REDACTED (Alexander Williams) Date: Fri, 16 Mar 2001 22:18:08 -0500 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <3AB26B13.B43E20C2@catseye.mb.ca>; from cpressey@catseye.mb.ca on Fri, Mar 16, 2001 at 01:35:47PM -0600 References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <3AB26B13.B43E20C2@catseye.mb.ca> Message-ID: <20010316221808.A18593@telocity.com> On Fri, Mar 16, 2001 at 01:35:47PM -0600, Chris Pressey wrote: > I totally agree. However, I can't think of a way to stop people from > writing 'bot code like: > > apply(unix, cmd, ["rm -rf *"]). > > And that would be bad! I suppose taking out the unix module entirely > might help... I'm not familiar enough with Erlang to know how many other > holes are possible, though. I'm not sure if someone has written the equivalent of Python's "bastion" or Java's sandbox, essentially a restricted environment in which only access to listed modules and builtins is allowed. That's really what this project would need to allow scripting in Erlang inside the server. > I have no idea if my Erlang project will turn out anything like that, > though. Currently my temptation is to have a more hierarchical, > abstract world, mainly because it would simplify it greatly if you could > just see everything in the current 'room' instead of calculating > line-of-sight to determine the set of visible objects. Ie. the "MUD" concept in which the universe is broken into groups of "cells" or rooms, and all things within a given cell can freely interact. Its certainly the simplest means of implimenting a universe, and the easiest to explain to an outside observer. > My feelings - though I'm a mnesia newbie - is that one big table (in > RAM) is going to be the fastest solution - because any partitioning > would mean more resource-accesses per data-access. I don't see a lot of > reason to add filesystem directories to the mix, as mnesia already has > many of the properties that files have but database fields traditionally > do not (variable length, complex structures etc.) The main reason to add a filesystem hierarchy to the system is to make it easy to modify things from INSIDE the system, on the fly. Its an intuitive, understandable thing to say "OK, I need to edit /server/things/player/commands.erl to add the ability to hug random people," and then commence said operations, than to say "OK, I need to grab the "commands" field of the "player" record ... now, where is that related to everything else?" Its purely a human-access concern. One could, theoretically, lay a false filesystem hierarchy over the mnesia database itself ... but since filesystems already exist, it seems redundant. As a pleasant addition, the mnesia database ends up holding ONLY the persistant data, not the sourcecode. > That is pretty much the case. Imagine functions player_loop() and > npc_loop(). They act very similarly except that player_loop() gets its > orders from a socket, and npc_loop() calculates its orders using AI. > Sure, they could be the same function, since they share some > functionality, but I think it would be a tad more efficient if they were > seperate functions (so that NPC's aren't continually checking for their > non-existant sockets.) Its all the more efficient to have the Thing/object itself only have a reference to its "master," which could, in turn, be a Pid of one of the above. Thus, you genericise the Thing and allow it to be driven by either mode, improving your code reusability. > There are also some 'higher-order sense' that turn out to be useful. > For example, being able to see someone else move. {see_move, Sender, > NewPosition} or something. Sure; defining the set of messages your Things can respond to is one of the basics of game design. Allowing that kind of extensibility on a Thing by Thing basis is one of the advantages of being able to drive a generic core. :) > I dunno. In my scheme, 'live' objects can be suggested to do actions, > but what they actually do is up to them. You could suggest to your dog > that it follow you, and if it is loyal it will obey. But if it catches > rabies, it's AI might change and it might not be so complicit! Not "suggested" as an in-game issue, but controlled by another process. Like a Teleport Device can force a move on a Thing, if it has sufficient priviliges, or, the way an Administrator on a MU* can @force a Thing to execute actions as if done by the Thing itself. "Suggesting" is an in-game issue and, as such, is constrined by the AI of the game. I'm talking about external forces. > Well, it seems as if you have two processes here (one for the logic, one > for the object-state), while I don't see why you need more than one > process (which can handle both logic and object-state.) Because logic can change. The Thing with state persists. For example, modelling the Dog that can potentially become RabidDog becomes easy once you separate logic and state. As a Dog, it uses a passive AI instance (PetDog) and its stats are all bound on the DogThing. When it goes rabid, Dog is sent a {goRabid} message, it changes its stats appropriately, and switches its control from PetDog to RabidDog, wjich then drives its behaviours. Now, let's say that the Dog is needed to do some custom things that its best if a person drives; we reconnect the behaviour Pid from RabidDog to PlayerConnection where a person is logged in. Voila, it retains its rabid stats but takes orders from a person. When done, swap the PlayerConnection for RabidDog until RD decides its time is up, then it says to {returnToNormal} or just tells the Dog to {die}. Separating state and behaviour lets you do all kinds of fun and perverse things. :) -- 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 thantos@REDACTED Fri Mar 16 14:00:40 2001 From: thantos@REDACTED (Alexander Williams) Date: Fri, 16 Mar 2001 08:00:40 -0500 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <20010316122503.A678@idealx.com>; from mickael.remond@erlang-fr.org on Fri, Mar 16, 2001 at 12:25:03PM +0100 References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <20010316122503.A678@idealx.com> Message-ID: <20010316080040.A16507@telocity.com> On Fri, Mar 16, 2001 at 12:25:03PM +0100, Mickael Remond wrote: > I have read your whole message and I must admit that the "picture" you > are proposing is very exciting. > We will place it on the Erlang-fr page and translate it in French, if > you do not mind. By all means, people from all countries should be exposed to the horror of my ideas and imaginings. :) > I agree with you on Worldforge ambition, that is why I was first > interested in a MUD like approach, which is much more established. > But Thierry Mallard convinced me to have a look at Worldforge. We then > come to think that an Erlang approach could make this project feasible. > We are both very pragmatic and are interested in first having some code > working and then improving it. I'd love to see the basic core systems implimented in Erlang and supporting some kind of "MU*-like text-based VR" before I buy into the Worldforge plan; I've been following it for a while (as a good MU*-geek should) and, while they have some good single-scenario systems, I don't think they have the genericity to provide the kind of experience I look for online (not the least reason being that anyone can spell "cow" but I'll be damned if I can draw one). If any approach COULD improve the feasibility, its likely Erlang. > Your reflexion on the game design by process is very insteresting. > Maybe we could start working together on a real working and playable > implementation ? Years of actually thinking about and beating on the problem. I'm probably one of the few folks who've both worked on Coda (a Scheme-based MU* core) and POO (a Python-based system). I'd certainly be interested in helping out wherever I can, even if its purely on design and structure. (One of the main problems I see in such projects most of the time is everyone wants to get in there and beat code without thinking of overall design first; I do not suffer that problem. Probably because I find design more fun than implimentation. :)) -- 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 vladdu@REDACTED Sat Mar 17 10:06:05 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Sat, 17 Mar 2001 10:06:05 +0100 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) References: <20010316092026.A16714@telocity.com> <20010316183346.A18068@telocity.com> Message-ID: > So, we end up needing another unique ID system. (Gensym, come home, > all is forgiven!) wouldn't references work well here? with today's system dynamic atoms ? la Gensym are not GCed... /Vlad From thantos@REDACTED Sat Mar 17 11:09:17 2001 From: thantos@REDACTED (Alexander Williams) Date: Sat, 17 Mar 2001 05:09:17 -0500 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: ; from vladdu@hotmail.com on Sat, Mar 17, 2001 at 10:06:05AM +0100 References: <20010316092026.A16714@telocity.com> <20010316183346.A18068@telocity.com> Message-ID: <20010317050917.A5494@telocity.com> On Sat, Mar 17, 2001 at 10:06:05AM +0100, Vlad Dumitrescu wrote: > wouldn't references work well here? with today's system dynamic atoms ? la Gensym are not GCed... They might, if we were talking about Erlang-level constructs, but we're not. In reality, we're talking about the mapping-key between Game Level objects and the Erlang Processes that contain the actual code being executed. Pids aren't stable entities, they'll end up changing between one run of the server and the next. Object References really should be unique across multiple nodes, if we want to allow for interlinked servers in the future (or even one MU* distributed over multiple nodes). Now, the hard part of this bit will be managing the linkage of Pid to Persistant ID to the state information restored from the database when bringing it back from the dead ... that'll be the challenge. -- 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 etxuwig@REDACTED Sat Mar 17 11:42:09 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Sat, 17 Mar 2001 11:42:09 +0100 (MET) Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: Message-ID: On Sat, 17 Mar 2001, Vlad Dumitrescu wrote: >> So, we end up needing another unique ID system. (Gensym, come home, >> all is forgiven!) > >wouldn't references work well here? with today's system dynamic >atoms ? la Gensym are not GCed... References should work well as long as they don't have to be persistent. The same goes for pids. You can't dump a pid to disk and expect to reuse it later. As for references, they are not really unique if you keep them long enough (or has that changed in R7?) I tend to prefer to generate a globally unique ID whenever I need a reference. The scheme I prefer is ID = {node(), erlang:now()}. It's fast, and under most realistic circumstances (even persistently) unique with very high probability. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From etxuwig@REDACTED Sat Mar 17 12:04:28 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Sat, 17 Mar 2001 12:04:28 +0100 (MET) Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: Message-ID: On Sat, 17 Mar 2001, Ulf Wiger wrote: >I tend to prefer to generate a globally unique ID whenever I need a >reference. The scheme I prefer is > > ID = {node(), erlang:now()}. > >It's fast, and under most realistic circumstances (even persistently) >unique with very high probability. It's actually also quite easy to produce a nice external ID this way: (mud@REDACTED)2> F=fun() -> N=node(),{MS,S,US} = erlang:now(), atom_to_list(N) ++ "." ++ integer_to_list(MS) ++ "." ++ integer_to_list(S) ++ "." ++ integer_to_list(US) end. #Fun (mud@REDACTED)3> F(). "mud@REDACTED" (mud@REDACTED)4> F(). "mud@REDACTED" (mud@REDACTED)5> /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From thantos@REDACTED Sat Mar 17 15:13:02 2001 From: thantos@REDACTED (Alexander Williams) Date: Sat, 17 Mar 2001 09:13:02 -0500 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: ; from etxuwig@etxb.ericsson.se on Sat, Mar 17, 2001 at 12:04:28PM +0100 References: Message-ID: <20010317091302.A6282@telocity.com> On Sat, Mar 17, 2001 at 12:04:28PM +0100, Ulf Wiger wrote: > (mud@REDACTED)3> F(). > "mud@REDACTED" > (mud@REDACTED)4> F(). > "mud@REDACTED" > (mud@REDACTED)5> I rather like this result, actually. A bit long and cumbersome to type, but that's all the more reason to use the POO-esque dereferencing of objects based on their holding environment for human access. -- 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 cpressey@REDACTED Sat Mar 17 22:10:48 2001 From: cpressey@REDACTED (Chris Pressey) Date: Sat, 17 Mar 2001 15:10:48 -0600 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <3AB26B13.B43E20C2@catseye.mb.ca> <20010316221808.A18593@telocity.com> Message-ID: <3AB3D2D8.630F11F0@catseye.mb.ca> Alexander Williams wrote: > On Fri, Mar 16, 2001 at 03:30:32PM +0100, Ulf Wiger wrote: > > This can be done, as long as one doesn't make any assumptions about > > Pid (it will change), and there's a stable state in which to do this. > So, we end up needing another unique ID system. (Gensym, come home, > all is forgiven!) I'd really like to shy away from the > MU*-traditional form of just increasing integers, but ... it is simple > and effective, I suppose. My prototype currently uses just that, courtesy of mnesia:dirty_update_counter. References would also be sufficient, I would think, considering they are IIRC unique into the billions. Alexander Williams wrote: > > I have no idea if my Erlang project will turn out anything like that, > > though. Currently my temptation is to have a more hierarchical, > > abstract world, mainly because it would simplify it greatly if you could > > just see everything in the current 'room' instead of calculating > > line-of-sight to determine the set of visible objects. > Ie. the "MUD" concept in which the universe is broken into groups of > "cells" or rooms, and all things within a given cell can freely > interact. Its certainly the simplest means of implimenting a > universe, and the easiest to explain to an outside observer. "Because it is there" is also a reason to go around the mountain :-) I got LoS working quite well last night, so I'm going to keep the interface 'roguelike' and resist the temptation to resort to the simpler hierarchical structure of a classical MU*. That does mean I have to handle far more objects, though, as a single large 'room' could be a hundred seperate wall/floor/ceiling blocks! There is correspondingly less emphasis on textual descriptions, though. > The main reason to add a filesystem hierarchy to the system is to make > it easy to modify things from INSIDE the system, on the fly. But I do not understand how working in the filesystem is easier than working in mnesia tables. The main reason I see to go with the filesystem is performance under the current mnesia. If that were not a problem, using mnesia only would be simpler (& maybe faster.) Using the filesystem is more complex for several reasons, e.g. not all filesystems are created equal. > One could, theoretically, lay a false filesystem hierarchy over the > mnesia database itself ... Well, no. The game world is hierarchical, the database records are hierarchical. There is just a hierarchy, not a "false filesystem hierarchy": that step is just outright skipped. I think mnesia+filesystem is a redundant combination too, I just think the redundant part is the filesystem. That doesn't rule out "uniform resource locators" which can look like "item/weapon/sword/katana/magic.erl" - though granted Erlang will probably not parse this quite as quickly as a filesystem would. But once you've referred to it once, you can use it's unique key to refer to it quickly again. Then again it's fairly clear we've got different games in mind. I wasn't at all planning to build or help build "the" Erlang MMUD... I already have a game, I'm just trying to get it out of Perl and into Erlang and experiment with making it multiplayer. If I can provide help, it'll probably be in the form of letting people learn from the mistakes I make in my prototype anyway :-) > > There are also some 'higher-order sense' that turn out to be useful. > > For example, being able to see someone else move. {see_move, Sender, > > NewPosition} or something. > Sure; defining the set of messages your Things can respond to is one > of the basics of game design. Allowing that kind of extensibility on > a Thing by Thing basis is one of the advantages of being able to drive > a generic core. :) Yes. But there's always a tradeoff between generality and performance. If you're saying I should do an inheritance-tree-traversal every time a message comes in, to find out what I should do, I don't agree. That is the most flexible system (and it is easy to write) but it is also one of the least efficient. In the interests of speed, all my 'instances' are merely copies of older 'exemplar' objects, with some things changed; the instance practically never 'defers' or 'delegates' to the exemplar. _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From thantos@REDACTED Sat Mar 17 23:47:17 2001 From: thantos@REDACTED (Alexander Williams) Date: Sat, 17 Mar 2001 17:47:17 -0500 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <3AB3D2D8.630F11F0@catseye.mb.ca>; from cpressey@catseye.mb.ca on Sat, Mar 17, 2001 at 03:10:48PM -0600 References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <3AB26B13.B43E20C2@catseye.mb.ca> <20010316221808.A18593@telocity.com> <3AB3D2D8.630F11F0@catseye.mb.ca> Message-ID: <20010317174717.A7503@telocity.com> On Sat, Mar 17, 2001 at 03:10:48PM -0600, Chris Pressey wrote: > My prototype currently uses just that, courtesy of > mnesia:dirty_update_counter. References would also be sufficient, I > would think, considering they are IIRC unique into the billions. Except, as I think someone else mentioned, the References are only ephermal and not persistant across database loads. For a Roguelike, that's fine, since about the only truly persistant information is stuff about the character and his equipment, all else can be regenn'd at load time. For a MU* universe, that would hurt. A lot. > "Because it is there" is also a reason to go around the mountain :-) I > got LoS working quite well last night, so I'm going to keep the > interface 'roguelike' and resist the temptation to resort to the simpler > hierarchical structure of a classical MU*. Cool. Though ... a Roguelike MU* might be intrresting. I think you'd need to impliment LoH (Line of Hearing) to really handle folks talking to one another, and you'd need a specialized client. Hmmmmm, LoH could probably be implimented as a sort of flooding algorithm. Set the player's site to an Int value, set the neighboring ones to Int-1, recurse until you can't spread anymore. Any square with a val > 0 is in the LoH. Might be slow, I guess. Only have to do it once for every move, though ... as long as you stand still, it doesn't change. > That does mean I have to handle far more objects, though, as a single > large 'room' could be a hundred seperate wall/floor/ceiling blocks! > There is correspondingly less emphasis on textual descriptions, > though. I can see that; you don't have to describe a room if you can see it. On the other hand, you've got more little fiddly bits to manage, along with a far stronger emphasis on autonomous drone beasties, which'll just be huge fun. (If I were implimenting them, I'd probably just impliment a suite of "sensors" and then have the AI /only/ key off that knowledge. You can be a lot more emergent-begaviour-esque that way.) > But I do not understand how working in the filesystem is easier than > working in mnesia tables. The main reason I see to go with the > filesystem is performance under the current mnesia. If that were not a > problem, using mnesia only would be simpler (& maybe faster.) Using the > filesystem is more complex for several reasons, e.g. not all filesystems > are created equal. Well, because its easier to communicate to a human what "/server/player/soul.erl" actually /is/ than to try and find it in a swarm of mnesia tables which may not be necessarily nested. Its purely a user interface issue, really, though there IS a goodly measure of "how can I make this easy for people to update remotely" too. Its very easy for folks to edit code locally with Their Favourite Editor(tm) then use ftp to drop it into the right directory. > That doesn't rule out "uniform resource locators" which can look like > "item/weapon/sword/katana/magic.erl" - though granted Erlang will > probably not parse this quite as quickly as a filesystem would. But > once you've referred to it once, you can use it's unique key to refer to > it quickly again. Probably wouldn't parse it as quickly, no, but it could parse it pretty easily. I wouldn't use a unique key to access that particular /file/ again, in my mind it represents just straightforward, inert sourcecode. Actual live Things would be running instances of said code and, as such, would be tagged with Unique IDs (maybe of the kind Ulffe laid out in the other message), and would need them, because each would be unique. > Then again it's fairly clear we've got different games in mind. I > wasn't at all planning to build or help build "the" Erlang MMUD... I > already have a game, I'm just trying to get it out of Perl and into > Erlang and experiment with making it multiplayer. If I can provide > help, it'll probably be in the form of letting people learn from the > mistakes I make in my prototype anyway :-) [grin] Letting others learn from your mistakes is probably the best help anyone can provide. In a sense, you have a somewhat easier time of making it multiplayer than others. Just set the cookie on your node to the same thing every time, and you can transparently tag another node with a ping, add it to your known nodes, then access it as if it were right next door. > Yes. But there's always a tradeoff between generality and performance. > If you're saying I should do an inheritance-tree-traversal every time a > message comes in, to find out what I should do, I don't agree. That is > the most flexible system (and it is easy to write) but it is also one of > the least efficient. In the interests of speed, all my 'instances' are > merely copies of older 'exemplar' objects, with some things changed; the > instance practically never 'defers' or 'delegates' to the exemplar. Right, in your case, instances probably /won't/ be any deeper than a single level, perhaps two, at any given time. In my case ... I very well have a tree that looks like this: Weapon -> Sword -> \ - Magic Sword -> Excalibur -> Excalibur (jnstance) Magic Weapon -> / The actual Excalibur game-object/Thing might be inheriting 3-deep and possibly with a mix-in (with Magic_Weapon.erl defining an override for the {attack} message or somesuch). Of course, all this inheritance probably takes place at the Erlang module level and not with "real" inheritance, with Magic_Sword.erl doing an -import of Sword.erl and Magic_Weapon.erl ... On the other hand, that brings me to an actual Erlang issue I haven't quite figured out yet. One can't specifically import from a specific file in a specific place in the file hierarchy. It'd be nice to have some way to define a "package" as the top of some file directory than refer to it with an import like: 1> top.dir.dir2.dir3:function(args) ... Unfortunately ... I don't think I can and that's a pretty hefty syntax hack. -- 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 vladdu@REDACTED Sat Mar 17 23:59:09 2001 From: vladdu@REDACTED (Vlad Dumitrescu) Date: Sat, 17 Mar 2001 23:59:09 +0100 Subject: TclTk version surprise Message-ID: Hi all! I am not a regular user of the graphical capabilities of Erlang, because I always thought they were so very crude... I didn't even gave them a lot of attention either... That's why it came to me as a shock today when I realized why it does look so bad: it's Tk 4.2 based! Since the current version is 8.3, and it is supporting native widgets, the looks of the graphics will be much better if we could use the latest! I have tried to use wish83 instead of wish42 (by shamelessly renaming the executable) and it indeed looks much better, but not everything works... I suppose some things have changed... Now my question is whether there are plans to upgrade ETK and GS to Tk8.3? Or maybe some charitable soul might want to help with some pointers? cheers, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From cpressey@REDACTED Sun Mar 18 01:25:13 2001 From: cpressey@REDACTED (Chris Pressey) Date: Sat, 17 Mar 2001 18:25:13 -0600 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <3AB26B13.B43E20C2@catseye.mb.ca> <20010316221808.A18593@telocity.com> <3AB3D2D8.630F11F0@catseye.mb.ca> <20010317174717.A7503@telocity.com> Message-ID: <3AB40069.F9659595@catseye.mb.ca> Alexander Williams wrote: > On Sat, Mar 17, 2001 at 03:10:48PM -0600, Chris Pressey wrote: > > References would also be sufficient, I > > would think, considering they are IIRC unique into the billions. > Except, as I think someone else mentioned, the References are only > ephermal and not persistant across database loads. True. Drat! Only unique within the group of nodes in the current 'session'. If you shut everything down and restart, that restarts the reference counter too. Ulf's external-id function would probably be better in a scenario with both distribution and persistence. > For a Roguelike, > that's fine, since about the only truly persistant information is > stuff about the character and his equipment, all else can be regenn'd > at load time. Most of it, yes. In my model, state for each object - if any - is stored in its database record. Every so often, the process uses that state information to decide what to do, and updates the state in the record if needed. And many creatures don't have very complex lives, so they need little or no stored state. If the state information disappears, the creature will eventually find something else interesting to do, so there's not much to be lost either. > For a MU* universe, that would hurt. A lot. I have to admit I haven't programmed in an actual MU* for years. I was heavily into one called MicroMUSE but that was a long time ago, seven years probably. I seem to remember its objects had registers 'A' through 'Z', and that was pretty much all they had for state information - not including things like the gender of the object or it's position, which are less general-purpose forms of "state". In a MU* setup it is indeed more important that the internal state be saved, but I was using that as the reason to think about how to get all that state into a (e.g.) database record, instead of thinking about keeping the state in the process's local variables, and somehow freezing arbitrary processes to portable representation on disk (which sounds very complicated.) > > "Because it is there" is also a reason to go around the mountain :-) I > > got LoS working quite well last night, so I'm going to keep the > > interface 'roguelike' and resist the temptation to resort to the simpler > > hierarchical structure of a classical MU*. > Cool. Though ... a Roguelike MU* might be intrresting. I'm certainly no expert, but I believe MAngband and Ultima Online are probably the two most popular examples of the genre. UO costs money and MAngband has licensing problems, though. > I think you'd > need to impliment LoH (Line of Hearing) to really handle folks talking > to one another, and you'd need a specialized client. Definately a specialized client, probably in Perl. Without one, you need a great deal of patience and imagination. :-) I considered just sending cursor control sequences down the socket connection (i.e. telnet) but that requires VT100 emulation, of course, and isn't very abstract. Possibly an option for users who don't want to use specialized client software, though. > Hmmmmm, LoH > could probably be implimented as a sort of flooding algorithm. Set > the player's site to an Int value, set the neighboring ones to Int-1, > recurse until you can't spread anymore. Any square with a val > 0 is > in the LoH. Might be slow, I guess. Only have to do it once for > every move, though ... as long as you stand still, it doesn't change. The flood algorithm is just about right to approximate acoustics, but it is fairly slow. It might be good to precompute it and cache it. It would be easier to do this with hearing than sight, as it changes less as things move around. In fact, if creatures don't block line-of-sight, maybe that could be precomputed too, changing only when the scenery (walls &c) change. Doors that open and close frequently still present problems though. > > But I do not understand how working in the filesystem is easier than > > working in mnesia tables. The main reason I see to go with the > > filesystem is performance under the current mnesia. If that were not a > > problem, using mnesia only would be simpler (& maybe faster.) Using the > > filesystem is more complex for several reasons, e.g. not all filesystems > > are created equal. > Well, because its easier to communicate to a human what > "/server/player/soul.erl" actually /is/ than to try and find it in a > swarm of mnesia tables which may not be necessarily nested. Its > purely a user interface issue, really, though there IS a goodly > measure of "how can I make this easy for people to update remotely" > too. Its very easy for folks to edit code locally with Their > Favourite Editor(tm) then use ftp to drop it into the right directory. Ah, OK. I also misunderstood the problem a bit. I'm not proposing that actual Erlang source code in text form be stored in a mnesia database. While I'm sure it's possible, I'm not sure it's recommended. What I'm mainly considering is storing *funs* in the database. It also makes sense to be able to index that fun to its source code somewhere; much more important in a MUSE where everyone's a "programmer". The FTP thing in and of itself is a good reason to use the filesystem to accomodate multiple users using tools they already have. Trying to incorporate an on-line code editor would be complex and probably a bit futile. > > If I can provide > > help, it'll probably be in the form of letting people learn from the > > mistakes I make in my prototype anyway :-) > [grin] Letting others learn from your mistakes is probably the best > help anyone can provide. In a sense, you have a somewhat easier time > of making it multiplayer than others. Just set the cookie on your > node to the same thing every time, and you can transparently tag > another node with a ping, add it to your known nodes, then access it > as if it were right next door. That's so easy it's almost criminal. I wasn't considering clients written in Erlang too, but with that I suppose I could bypass sockets almost completely... and with SAE the client could still be pretty small.. But, I considered the peer-to-peer model for multiplayer games, and I concluded hacked peers open up too much of a loophole for cheating, leading me to stick to a pretty strict client-server model. But the using-Erlang-nodes-as-peers thing might work in other multi-user contexts, like peer-to-peer file-sharing... not that the world needs another peer-to-peer file-sharing protocol, mind you ;-) _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From thantos@REDACTED Sun Mar 18 04:14:12 2001 From: thantos@REDACTED (Alexander Williams) Date: Sat, 17 Mar 2001 22:14:12 -0500 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <3AB40069.F9659595@catseye.mb.ca>; from cpressey@catseye.mb.ca on Sat, Mar 17, 2001 at 06:25:13PM -0600 References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <3AB26B13.B43E20C2@catseye.mb.ca> <20010316221808.A18593@telocity.com> <3AB3D2D8.630F11F0@catseye.mb.ca> <20010317174717.A7503@telocity.com> <3AB40069.F9659595@catseye.mb.ca> Message-ID: <20010317221412.A8113@telocity.com> On Sat, Mar 17, 2001 at 06:25:13PM -0600, Chris Pressey wrote: > Most of it, yes. In my model, state for each object - if any - is > stored in its database record. Every so often, the process uses that > state information to decide what to do, and updates the state in the > record if needed. And many creatures don't have very complex lives, so > they need little or no stored state. If the state information > disappears, the creature will eventually find something else interesting > to do, so there's not much to be lost either. Makes perfect sense, though if you're going to bring beasties back after a game save, you still have to find a unique tag to associate between a Pid and a DatabaseEntry. Mmm, though I suppose in your case, rebuilding straight from the DB would be acceptible. The initialization/restore code would simply walk the DB in some order, and create a controlling Pid for this run, set it up from the data in the DatabaseEntry, and run with it. That's probably not a bad idea for coming back up with a MU* server, in the majority of cases. I wonder about Things which are dependent on other Things being up to work, but ... I suppose if all names are resolved through a NameServer Pid, and you make sure it comes up reasonably first/early, then it can just make things wait until their targets wake up. > I have to admit I haven't programmed in an actual MU* for years. I was > heavily into one called MicroMUSE but that was a long time ago, seven > years probably. I seem to remember its objects had registers 'A' > through 'Z', and that was pretty much all they had for state information > - not including things like the gender of the object or it's position, > which are less general-purpose forms of "state". MUSE evolved into the MUSH/MUX servers of today. The "register" concept got expanded to arbitrarily-named and -lengthed (up to 4k), and are, additionally, able to hold either code or data (mainly because code is just text ... and MUSH/MUX language is very simple scripting, though you can impliment complex things in it if you don't mind the bleeding from the eyes). All in all, its a very nice, simple, straight-forward system overall ... but I really wish I had a more powerful programming language embedded. :) > In a MU* setup it is indeed more important that the internal state be > saved, but I was using that as the reason to think about how to get all > that state into a (e.g.) database record, instead of thinking about > keeping the state in the process's local variables, and somehow freezing > arbitrary processes to portable representation on disk (which sounds > very complicated.) As long as processes can be marshalled and restarted, its golden gravy. I sometimes long for facilities like the old LispM's had of just freezing the whole memory-state to disk for resumption at a late time. That kind of facility would be perfect. :) > I'm certainly no expert, but I believe MAngband and Ultima Online are > probably the two most popular examples of the genre. UO costs money and > MAngband has licensing problems, though. UO doesn't really count; it is pretty much a 3d MUD with pretty flash graphics (like EverCrack). I really /hate/ those interfaces, btw; its impossible to gauge distances without binocular vision, actually targeting things is nearly impossible to do while standing still, much less moving, and let's not even get into the ballance issues. Oi vey! > Definately a specialized client, probably in Perl. Without one, you > need a great deal of patience and imagination. :-) I considered just > sending cursor control sequences down the socket connection (i.e. > telnet) but that requires VT100 emulation, of course, and isn't very > abstract. Possibly an option for users who don't want to use > specialized client software, though. Depends on how you impliment the VT100 controls; with enough abstraction, it can be ... tolerable. Still, probably nowhere NEARLY as useful as a custom client written in Erlang using Erlang-based GUI tools. Despite all the complaints regarding them, they /do/ work. > The flood algorithm is just about right to approximate acoustics, but it > is fairly slow. It might be good to precompute it and cache it. It > would be easier to do this with hearing than sight, as it changes less > as things move around. In fact, if creatures don't block line-of-sight, > maybe that could be precomputed too, changing only when the scenery > (walls &c) change. Doors that open and close frequently still present > problems though. Might be hard to precompute all the areas sound could flow to ... you'd have to run flow for every point on the map, which could be several hundred (at a minimum) sites. Hmmmm, for precomputing LoS, you might as well just precompute for each door state ... but that gets nuts quickly if you can't break regions down cleanly by "this area will never be affected if that door changes state." > The FTP thing in and of itself is a good reason to use the filesystem to > accomodate multiple users using tools they already have. Trying to > incorporate an on-line code editor would be complex and probably a bit > futile. Oh, I've done it in other languages. Its a bit ... ugly ... but it can be done. The trick is replacing for a time the usual command editor with another specialized for editing, then switching it back. > But, I considered the peer-to-peer model for multiplayer games, and I > concluded hacked peers open up too much of a loophole for cheating, > leading me to stick to a pretty strict client-server model. If you're worried about cheating, you might as well just not write a game these days, if it involves ANY code in any form running on a client. Even telnet is susceptible to folks running front-ends which do macro moves, etc. Web-based games get daemon-flooded by bots which play faster with simple logic than any human hopes to. And so on. Cheaters always find a way. If they have to learn Erlang (and BEAM, if you distribute it pre-compiled) to do it, I consider that a net win. :) -- 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 etxuwig@REDACTED Mon Mar 19 11:24:05 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Mon, 19 Mar 2001 11:24:05 +0100 (MET) Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <3AB40069.F9659595@catseye.mb.ca> Message-ID: On Sat, 17 Mar 2001, Chris Pressey wrote: >But, I considered the peer-to-peer model for multiplayer games, and >I concluded hacked peers open up too much of a loophole for >cheating, leading me to stick to a pretty strict client-server >model. I've been thinking part time about how to address such problems. One way would be to hack net_kernel.erl, and rpc.erl, only allowing message passing and rpc calls that you feel are kosher. Hacking net_kernel.erl is no picnic, but here's a place to start: %% %% The spawn/4 BIF ends up here. %% handle_call({spawn,M,F,A,Gleader},{From,Tag},State) when pid(From)-> Pid = (catch spawn(M,F,A)), group_leader(Gleader,Pid), {reply,Pid,State}; %% %% The spawn_link/4 BIF ends up here. %% handle_call({spawn_link,M,F,A,Gleader}, {From,Tag}, State) when pid(From) -> catch spawn(net_kernel,do_spawn_link,[{From,Tag},M,F,A,Gleader]), {noreply,State}; handle_info({From,registered_send,To,Mess},State) -> send(From,To,Mess), {noreply,State}; I spent some time trying to figure out from where these messages came. It seems as if they come from dist.c directly. The interesting thing is that sometimes, the emulator dispatches messages directly, while they sometimes are routed via net_kernel. My understanding is that they come up to net_kernel only when the distributed handshake is not quite done. Then, hacking net_kernel doesn't solve anything. A pity. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From mickael.remond@REDACTED Mon Mar 19 11:45:31 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Mon, 19 Mar 2001 11:45:31 +0100 Subject: Speaking of documentation In-Reply-To: <20010308143142.A10124@idealx.com>; from mickael.remond@idealx.com on Thu, Mar 08, 2001 at 02:31:42PM +0100 References: <3AA683B1.59D788DC@catseye.mb.ca> <20010308143142.A10124@idealx.com> Message-ID: <20010319114531.A7829@idealx.com> Mickael Remond (mickael.remond@REDACTED) wrote: > We are using a very simple in-house documentation tool that produces > Latex documentation of the code. > > Maybe we should release this tool if you that it could serve as a basis > for further improvement. Ok. Here it is: idx-edoc-1.0 http://www.idealx.org/prj/#idx-edoc idx-edoc is a simple automatic documentation generator for Erlang source code. When we will have more time, we will start working on the HTML generation part. -- Micka?l R?mond From Sean.Hinde@REDACTED Mon Mar 19 11:55:38 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 19 Mar 2001 10:55:38 -0000 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) Message-ID: <402DD461F109D411977E0008C791C312039F5E3B@imp02mbx.one2one.co.uk> If you were happy with only rpc you could consider my recent contrib to erlang.org. This provides node to node rpc independently from the normal Erlang distribution mechanisms. You can restrict which functions can be called, and only allow access from people who have a valid shared secret. It may do the job.. - Sean > On Sat, 17 Mar 2001, Chris Pressey wrote: > > >But, I considered the peer-to-peer model for multiplayer games, and > >I concluded hacked peers open up too much of a loophole for > >cheating, leading me to stick to a pretty strict client-server > >model. > > I've been thinking part time about how to address such problems. > > One way would be to hack net_kernel.erl, and rpc.erl, only allowing > message passing and rpc calls that you feel are kosher. > > Hacking net_kernel.erl is no picnic, but here's a place to start: > > %% > %% The spawn/4 BIF ends up here. > %% > handle_call({spawn,M,F,A,Gleader},{From,Tag},State) when pid(From)-> > Pid = (catch spawn(M,F,A)), > group_leader(Gleader,Pid), > {reply,Pid,State}; > > %% > %% The spawn_link/4 BIF ends up here. > %% > handle_call({spawn_link,M,F,A,Gleader}, {From,Tag}, State) > when pid(From) -> > catch spawn(net_kernel,do_spawn_link,[{From,Tag},M,F,A,Gleader]), > {noreply,State}; > > handle_info({From,registered_send,To,Mess},State) -> > send(From,To,Mess), > {noreply,State}; > > > I spent some time trying to figure out from where these messages > came. It seems as if they come from dist.c directly. > > The interesting thing is that sometimes, the emulator dispatches > messages directly, while they sometimes are routed via net_kernel. > My understanding is that they come up to net_kernel only when > the distributed handshake is not quite done. > > Then, hacking net_kernel doesn't solve anything. A pity. > > /Uffe > -- > Ulf Wiger tfn: +46 8 719 81 95 > Senior System Architect mob: +46 70 519 81 95 > Strategic Product & System Management ATM Multiservice Networks > Data Backbone & Optical Services Division Ericsson Telecom AB > 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 cpressey@REDACTED Mon Mar 19 19:53:47 2001 From: cpressey@REDACTED (Chris Pressey) Date: Mon, 19 Mar 2001 12:53:47 -0600 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yetagain) References: Message-ID: <3AB655BB.D3CD504C@catseye.mb.ca> Ulf Wiger wrote: > I've had a few ideas: > - if code runs in another node, one might want to specialize the RPC > behaviour. Then, in fact making RPC a behaviour would be very handy. > One could perhaps specify at Erlang boot time via a kernel > environment variable which behaviour module to use for rpc. > When you think about it, lots more modules in OTP should really > be behaviours that could be specialized. I totally agree. In an ideal world, almost everything would be a behaviour, and it would be just as easy to create a new behaviour as a new module... they're very cool. > - We've played around with different ways of taking care of really > hairy upgrade scenarios. One idea that came up (I think OTP is > still thinking about whether to cheer or throw eggs at us) was > to make it possible via the OTP R7B trace mechanism to reroute > a function call to another function (with same arity). For example > all calls to mnesia:write/1 could be rerouted to myMnesia:write/2; > a corresponding trap for message sending could be to call > M:F(Pid, Message) instead of sending the message. Dangerous stuff, > but it would be extremely flexible. I thought about it over the weekend and I think I'll cheer, and save my eggs for people who decide to abuse it. I like it, it's probably worth the danger. Lying to the computer about what's going on is a long standing tradition, after all... > Have you read the thesis on OTP behaviours for simulations? > I don't remember the URL, but it was posted on this list recently. Yes, I've read most of it now. It's a very good paper so the URL is probably worth posting again. ftp://ftp.csd.uu.se/pub/papers/masters-theses/0178-ekstrom.pdf _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From etxuwig@REDACTED Tue Mar 20 09:58:15 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Tue, 20 Mar 2001 09:58:15 +0100 (MET) Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <402DD461F109D411977E0008C791C312039F5E3B@imp02mbx.one2one.co.uk> Message-ID: On Mon, 19 Mar 2001, Sean Hinde wrote: >If you were happy with only rpc you could consider my recent contrib >to erlang.org. This provides node to node rpc independently from the >normal Erlang distribution mechanisms. You can restrict which >functions can be called, and only allow access from people who have >a valid shared secret. It may do the job.. > >- Sean Yes, then using net_kernel:allow/1 to bar the erlang clients from connecting with distributed Erlang, as a safety measure. Another difficulty with using distributed Erlang in clients, of course, is that it will not go quietly through firewalls. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From Chandrashekhar.Mullaparthi@REDACTED Tue Mar 20 18:13:05 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Tue, 20 Mar 2001 17:13:05 -0000 Subject: Result of catch Message-ID: <402DD461F109D411977E0008C791C31203919A07@imp02mbx.one2one.co.uk> 1> catch 1/0. {'EXIT',{badarith,[{erl_eval,eval_op,3}, {erl_eval,expr,3}, {erl_eval,exprs,4}, {shell,eval_loop,2}]}} 2> 2> A = catch 1/0. ** 2: syntax error before: 'catch' ** 2> I'm a bit surprised by this behaviour. Why can't I store the result of a catch?? If I can match on it in a case statement, why can't I just store the result? tia, Chandru 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 Mar 20 18:28:19 2001 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 20 Mar 2001 18:28:19 +0100 Subject: Result of catch In-Reply-To: Chandrashekhar Mullaparthi's message of "Tue, 20 Mar 2001 17:13:05 -0000" References: <402DD461F109D411977E0008C791C31203919A07@imp02mbx.one2one.co.uk> Message-ID: Try: 1> A = (catch 1/0). {'EXIT',{badarith,[{erl_eval,eval_op,3}, {erl_eval,expr,3}, {erl_eval,exprs,4}, {shell,eval_loop,2}]}} It's a parser thing... /Tobbe From Sean.Hinde@REDACTED Tue Mar 20 18:33:25 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 20 Mar 2001 17:33:25 -0000 Subject: Result of catch Message-ID: <402DD461F109D411977E0008C791C312039F5E44@imp02mbx.one2one.co.uk> I asked this one a few months back. The answer was something to do with order of evaluation. A = (catch 1/0). - Sean > 1> catch 1/0. > {'EXIT',{badarith,[{erl_eval,eval_op,3}, > {erl_eval,expr,3}, > {erl_eval,exprs,4}, > {shell,eval_loop,2}]}} > 2> > 2> A = catch 1/0. > ** 2: syntax error before: 'catch' ** > 2> > > I'm a bit surprised by this behaviour. Why can't I store the > result of a > catch?? If I can match on it in a case statement, why can't I > just store the > result? > > tia, > Chandru > 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 Tue Mar 20 18:48:24 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 20 Mar 2001 17:48:24 -0000 Subject: Compiling Erlang under QNX Message-ID: <402DD461F109D411977E0008C791C312039F5E46@imp02mbx.one2one.co.uk> All, QNX have now released their patch 'B'. This fixes the bug which prevented the erlc shell script from running. The procedure I used to compile R7B-1 under QNX patch B is: edit /etc/hosts and change IP address to be 127.0.0.1 get the latest config.guess and config.sub (I attach recent enough ones) and replace the ones supplied with Erlang. In inet_drv.c there is a problem around SO_ERROR. QNX define this but do not appear to support the functionality.. I just changed it to read #ifndef SO_ERROR1 but it will obviously need something slightly better! The command to configure needs to be CC=qcc ./configure --without-ssl qcc seems to be a wrapper for gcc which lets it find all the libraries etc. Remove line 759 from ops.tab!!!! I cannot explain this at all but it allows the perl script to work without error. Snmp: Somewhere it is hardcoded to use nawk which isn't present. Mnesia_session: IDL_COMPILE_FLAGS doesn't pick up IC_DIR as previous line (IC_DIR := ...) doesn't work (no idea why) Temporarily changed to fix to absolute path and it compiles fine. Runtime_tools: changed ld to qcc in Makefile in lib/runtime_tools/c_src/x86-pc-nto-qnx. gcc and ld don't pick up all the paths for libraries if called directly CosNotification and CosEvent are broken because of filename length. I have done some basic testing with multiple nodes in a single machine. OS_MON doesn't work (or fail gracefully) which is understandable. Mnesia seems to work fine. - 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. -------------- next part -------------- A non-text attachment was scrubbed... Name: config.guess Type: application/octet-stream Size: 42884 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: config.sub Type: application/octet-stream Size: 40615 bytes Desc: not available URL: From cpressey@REDACTED Wed Mar 21 18:56:56 2001 From: cpressey@REDACTED (Chris Pressey) Date: Wed, 21 Mar 2001 11:56:56 -0600 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <3AB26B13.B43E20C2@catseye.mb.ca> <20010316221808.A18593@telocity.com> <3AB3D2D8.630F11F0@catseye.mb.ca> <20010317174717.A7503@telocity.com> Message-ID: <3AB8EB68.727A6848@catseye.mb.ca> Alexander Williams wrote: > On the other hand, that brings me to an actual Erlang issue I haven't > quite figured out yet. One can't specifically import from a specific > file in a specific place in the file hierarchy. It'd be nice to have > some way to define a "package" as the top of some file directory than > refer to it with an import like: > > 1> top.dir.dir2.dir3:function(args) ... > > Unfortunately ... I don't think I can and that's a pretty hefty syntax > hack. "7.7 Module names "Erlang has a flat module structure (i.e. there are not modules within modules). Often, however, we might like to simulate the effect of a hierarchical module structure. This can be done with sets of related modules having the same module prefix. "If, for example, an ISDN handler is implemented using five different and related modules. These module should be given names such as: isdn_init, isdn_partb, isdn_..." -- http://www.erlang.se/doc/programming_rules.shtml _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From richardc@REDACTED Wed Mar 21 19:19:14 2001 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 21 Mar 2001 19:19:14 +0100 (MET) Subject: erlang packages In-Reply-To: <3AB8EB68.727A6848@catseye.mb.ca> Message-ID: I presented a scheme for adding Java-style packages to Erlang at the Erlang User Conference last year; the report is avaliable from: http://www.it.uu.se/research/reports/2000-001/ Feedback appreciated. I hope we will be able to implement this some day. /Richard Carlsson On Wed, 21 Mar 2001, Chris Pressey wrote: > Alexander Williams wrote: > > On the other hand, that brings me to an actual Erlang issue I haven't > > quite figured out yet. One can't specifically import from a specific > > file in a specific place in the file hierarchy. It'd be nice to have > > some way to define a "package" as the top of some file directory than > > refer to it with an import like: > > > > 1> top.dir.dir2.dir3:function(args) ... > > > > Unfortunately ... I don't think I can and that's a pretty hefty syntax > > hack. > > "7.7 Module names > > "Erlang has a flat module structure (i.e. there are not modules within > modules). Often, however, we might like to simulate the effect of a > hierarchical module structure. This can be done with sets of related > modules having the same module prefix. > > "If, for example, an ISDN handler is implemented using five different > and related modules. These module should be given names such as: > isdn_init, isdn_partb, isdn_..." > > -- http://www.erlang.se/doc/programming_rules.shtml > > _chris > > -- > "Ten short days ago all I could look forward to was a dead-end job as a > engineer. Now I have a promising future and make really big Zorkmids." > Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ > Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html > Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://www.csd.uu.se/~richardc/ From thantos@REDACTED Thu Mar 22 00:18:02 2001 From: thantos@REDACTED (Alexander Williams) Date: Wed, 21 Mar 2001 18:18:02 -0500 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <3AB8EB68.727A6848@catseye.mb.ca>; from cpressey@catseye.mb.ca on Wed, Mar 21, 2001 at 11:56:56AM -0600 References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <3AB26B13.B43E20C2@catseye.mb.ca> <20010316221808.A18593@telocity.com> <3AB3D2D8.630F11F0@catseye.mb.ca> <20010317174717.A7503@telocity.com> <3AB8EB68.727A6848@catseye.mb.ca> Message-ID: <20010321181802.B24203@telocity.com> On Wed, Mar 21, 2001 at 11:56:56AM -0600, Chris Pressey wrote: > "If, for example, an ISDN handler is implemented using five different > and related modules. These module should be given names such as: > isdn_init, isdn_partb, isdn_..." > > -- http://www.erlang.se/doc/programming_rules.shtml I'm well aware of this. My problem is it rather, well, "sucks." "Sucks" isn't too strong for this particular bit, I don't think. Maybe I'm a living oddity, but I like tucking files into nice, neat little directory-structures that mimic inheritance and such, so that I know exactly what I'm looking at within any given point. Such hierarchies let multiple people be responsible for different bits, even down to directory permissions (and, in this case, that's a biggie). They are, all in all, just really darn handy. Python does the "right thing" here, I think. You can import a directory containing the proper initialization module filename and it implies the whole structure on down as sub-modules. Accessing deep structures becomes easy. Erlang's module system, especially given the gen_* servers, doesn't have that same kind of innate simplicity. That makes it difficult to pursue things like the MU* project with certain designs that, nevertheless, seem perfect for it. -- 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 cpressey@REDACTED Thu Mar 22 03:07:30 2001 From: cpressey@REDACTED (Chris Pressey) Date: Wed, 21 Mar 2001 20:07:30 -0600 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) References: <3AB11C16.18323EE7@catseye.mb.ca> <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <3AB26B13.B43E20C2@catseye.mb.ca> <20010316221808.A18593@telocity.com> <3AB3D2D8.630F11F0@catseye.mb.ca> <20010317174717.A7503@telocity.com> <3AB8EB68.727A6848@catseye.mb.ca> <20010321181802.B24203@telocity.com> Message-ID: <3AB95E62.79836FA0@catseye.mb.ca> Alexander Williams wrote: > On Wed, Mar 21, 2001 at 11:56:56AM -0600, Chris Pressey wrote: > > "If, for example, an ISDN handler is implemented using five different > > and related modules. These module should be given names such as: > > isdn_init, isdn_partb, isdn_..." > I'm well aware of this. My problem is it rather, well, "sucks." > "Sucks" isn't too strong for this particular bit, I don't think. I don't think it sucks. Nested packages are often a sign of overclassification anyway - then again I'm more familiar with Perl than Python or Java, perhaps that has coloured my viewpoint. Nested packages are handy when you have one abstract package (directory) and several different concrete packages that implement it (subdirectory) - but Erlang has behaviours that should probably be used instead - one behaviour and several packages that implement that behaviour. But I honestly don't mind that it's flat. What I worry about a bit more (although not too much) are namespace clashes. What if someone else wants to release a module named 'foo' while I want to release a module called 'foo'? How does the user that wants to use both of our modules deal with it? Should I prepend every module I name with some unique prefix just to be safe? I'd rather not, as that tends to make source code rather less readable. _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From thantos@REDACTED Thu Mar 22 05:45:21 2001 From: thantos@REDACTED (Alexander Williams) Date: Wed, 21 Mar 2001 23:45:21 -0500 Subject: Fun with Erlang (was Re: Stand Alone Erlang for Windows. yet again) In-Reply-To: <3AB95E62.79836FA0@catseye.mb.ca>; from cpressey@catseye.mb.ca on Wed, Mar 21, 2001 at 08:07:30PM -0600 References: <20010315174648.B13844@telocity.com> <3AB1BDDC.C3DCB3D6@catseye.mb.ca> <20010316035431.B15777@telocity.com> <3AB26B13.B43E20C2@catseye.mb.ca> <20010316221808.A18593@telocity.com> <3AB3D2D8.630F11F0@catseye.mb.ca> <20010317174717.A7503@telocity.com> <3AB8EB68.727A6848@catseye.mb.ca> <20010321181802.B24203@telocity.com> <3AB95E62.79836FA0@catseye.mb.ca> Message-ID: <20010321234521.A24797@telocity.com> On Wed, Mar 21, 2001 at 08:07:30PM -0600, Chris Pressey wrote: > different concrete packages that implement it (subdirectory) - but > Erlang has behaviours that should probably be used instead - one > behaviour and several packages that implement that behaviour. The way I generally structure code, I'd have one behaviour directory with multiple directories beneath for packages, each of which'll require multiple files, as will the overall behaviour glue. If I'm trying the impliment an application on top of all this, that's one more subdirectory over the behaviours. > called 'foo'? How does the user that wants to use both of our modules > deal with it? Should I prepend every module I name with some unique > prefix just to be safe? I'd rather not, as that tends to make source > code rather less readable. To use an example from the MU* concept to illustrate the problem (incidently, I heavily agree with you here): We have a generic sword with the name sword.erl ... And I want to build a custom version that inherits the methods of the first one, so do so ... but call it magic/sword.erl. Makes sense, structurally ... but I can't get to it in a flat access structure. I've read the description of the Java module system that was previously posted and like it a lot, except for the inability to resolve packages with a single import, allowing automatic sub-package imports. -- 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 Thu Mar 22 18:04:05 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Thu, 22 Mar 2001 17:04:05 -0000 Subject: Possible ideas to increase mnesia performance Message-ID: <402DD461F109D411977E0008C791C312039F5E50@imp02mbx.one2one.co.uk> Hi, I stumbled across this paper on work done on PostrgeSQL which has ideas potentially useful for mnesia: http://www.cs.mcgill.ca/~kemme/papers/vldb00.html As I understand it the idea is to use an underlying message passing mechanism which ensures global ordering of asynchronous messages called "Group Communication". This looks to be easily implementable on top of the existing Erlang mechanisms. This is used to propogate committed records to other nodes in one block rather than write by write while maintaining transaction ordering (and some other good stuf to do with locking...etc). It claims to remove the problems of commiting large volumes of complex transactions to many nodes. Maybe of interest? - 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 qtxkleb@REDACTED Fri Mar 23 07:15:49 2001 From: qtxkleb@REDACTED (Bengt Kleberg) Date: Fri, 23 Mar 2001 07:15:49 +0100 (MET) Subject: Possible ideas to increase mnesia performance Message-ID: <200103230615.HAA03551@avc280.etxb.ericsson.se> > From: Sean Hinde ...deleted > As I understand it the idea is to use an underlying message passing > mechanism which ensures global ordering of asynchronous messages called > "Group Communication". This looks to be easily implementable on top of the > existing Erlang mechanisms. See module 'pg' for more info about the existing Erlang mechanism. bengt From joe@REDACTED Fri Mar 23 15:12:09 2001 From: joe@REDACTED (Joe Armstrong) Date: Fri, 23 Mar 2001 15:12:09 +0100 (CET) Subject: ANNOUNCE: escript In-Reply-To: <200103230615.HAA03551@avc280.etxb.ericsson.se> Message-ID: Hello everybody, Robert and I have made a scripting interface to erlang. This is a simple one pass "load and go" Erlang scripting interface - so now you can use Erlang directly as a scripting language and won't need all this "erl -noshell -pa ...." stuff :-) Read all about it on: http://www.bluetail.com/~joe/escript.html Have fun. /Joe -- Joe Armstrong, Alteon WebSystems, tel: +46 8-545 550 00 S:t Eriksgatan 44, IV, fax: +46 8-654 70 71 SE-112 32 Stockholm, Sweden info: www.bluetail.com From qtxkleb@REDACTED Fri Mar 23 15:59:47 2001 From: qtxkleb@REDACTED (Bengt Kleberg) Date: Fri, 23 Mar 2001 15:59:47 +0100 (MET) Subject: escript, flags to script Message-ID: <200103231459.PAA04343@avc280.etxb.ericsson.se> Greetings, How do I get escript to recognise Unix style command line flags? Given my-script (far) below, started like this: ; my-script -a hello I would like an output of: cmd-line-args -a hello but I get: cmd-line-args [] my-script: #!/usr/bin/env escript main(X) -> io:format("cmd-line-args ~p~n",[X]), erlang:halt(). % Bengt Kleberg From luke@REDACTED Fri Mar 23 16:31:33 2001 From: luke@REDACTED (Luke Gorrie) Date: 23 Mar 2001 16:31:33 +0100 Subject: escript, flags to script In-Reply-To: <200103231459.PAA04343@avc280.etxb.ericsson.se> References: <200103231459.PAA04343@avc280.etxb.ericsson.se> Message-ID: Bengt Kleberg writes: > Greetings, > > How do I get escript to recognise Unix style command line flags? The problem is that 'erl' is interpreting the args. A possibly solution would be to put a leading "escape" character on them so that erl never sees anything starting with "-". My quick hack is this. First a new script that escapes the args: #!/bin/sh function escape() { for arg in $*; do echo -n "\\${arg} "; done echo "" } erl -pa /home/luke/src/escript-1.0 -noshell -s escript go $0 $(escape $*) Then the erlang module needs to strip the escape characters: go(X0) -> X = map(fun(I) -> [_EscapeChar | Arg] = atom_to_list(I), Arg end, X0), [_,F|Args] = X, ... etc This works for me: $ cmd-line-args -foo bar -baz cmd-line-args ["-foo","bar","-baz"] From thierry@REDACTED Fri Mar 23 16:43:54 2001 From: thierry@REDACTED (Thierry Mallard) Date: Fri, 23 Mar 2001 16:43:54 +0100 Subject: escript, flags to script In-Reply-To: <200103231459.PAA04343@avc280.etxb.ericsson.se>; from qtxkleb@etxb.ericsson.se on Fri, Mar 23, 2001 at 03:59:47PM +0100 References: <200103231459.PAA04343@avc280.etxb.ericsson.se> Message-ID: <20010323164354.A2283@IDEALX.com> On Fri, Mar 23, 2001 at 03:59:47PM +0100, Bengt Kleberg wrote: > Greetings, > > How do I get escript to recognise Unix style command line flags? > > Given my-script (far) below, started like this: > ; my-script -a hello I think there is a bug in the parsing of the arguments. Not looked at the sources yet, but it seems that if there is a "-" in an argument, [] is passed instead : tsm|~ > ./testing hello world cmd-line-args ["hello","world"] tsm|~ > ./testing hello -a cmd-line-args ["hello"] tsm|~ > ./testing -a world cmd-line-args [] Still have to find out why... -- Thierry Mallard | http://vawis.net GnuPG key on wwwkeys.pgp.net | http://erlang-fr.org (new) key 0xA3D021CB | http://worldforge.org From bengt.tillman@REDACTED Fri Mar 23 17:29:32 2001 From: bengt.tillman@REDACTED (Bengt Tillman) Date: Fri, 23 Mar 2001 17:29:32 +0100 Subject: ANNOUNCE: escript References: Message-ID: <3ABB79EC.2F3E2F71@era.ericsson.se> Joe Armstrong wrote: > > Hello everybody, > > Robert and I have made a scripting interface to erlang. This is a > simple one pass "load and go" Erlang scripting interface - so now you can > use Erlang directly as a scripting language and won't need all this > "erl -noshell -pa ...." stuff :-) > > Read all about it on: > > http://www.bluetail.com/~joe/escript.html > > Have fun. > > /Joe Thank you. I like it very much - and it solved a script-hacking problem I just faced ;-) I had to do one small fix (add -sasl errlog_type error) to get the generated escript script work to my liking: #!/bin/sh erl -sasl errlog_type error -pa /home/epkbeti/cvscheckout/netsimbase/bin/escript-1.0 -noshell -s escript go $0 $* =================================================== Bengt Tillman Ericsson Radio Systems AB Tele: +46 13 284131 Box 1248 FAX: +46 13 212928 S-581 12 Link?ping SWEDEN mailto:bengt.tillman@REDACTED TSS Product info: http://www.lmera.ericsson.se/tss/ From thierry.mallard@REDACTED Fri Mar 23 17:32:26 2001 From: thierry.mallard@REDACTED (Thierry Mallard) Date: Fri, 23 Mar 2001 17:32:26 +0100 Subject: escript, flags to script In-Reply-To: <20010323164354.A2283@IDEALX.com>; from thierry@mallard.com on Fri, Mar 23, 2001 at 04:43:54PM +0100 References: <200103231459.PAA04343@avc280.etxb.ericsson.se> <20010323164354.A2283@IDEALX.com> Message-ID: <20010323173226.A3247@IDEALX.com> On Fri, Mar 23, 2001 at 04:43:54PM +0100, Thierry Mallard wrote: > I think there is a bug in the parsing of the arguments. Not looked at the > sources yet, but it seems that if there is a "-" in an argument, [] is passed > instead [...] > Still have to find out why... Ok, I did some quick work with the help of Mickael Remond. Here is the patch : we now parses the arguments, that are grouped in the shell using " ... " Hope this helps. Best regards, -- Thierry Mallard | http://vawis.net GnuPG key on wwwkeys.pgp.net | http://erlang-fr.org (new) key 0xA3D021CB | http://worldforge.org -------------- next part -------------- diff -urN escript-1.0/escript.erl escript-1.0.1/escript.erl --- escript-1.0/escript.erl Fri Mar 23 14:58:01 2001 +++ escript-1.0.1/escript.erl Fri Mar 23 17:19:10 2001 @@ -12,8 +12,10 @@ -import(lists, [map/2, member/2]). go(X0) -> - X = map(fun(I) -> atom_to_list(I) end, X0), - [_,F|Args] = X, + [X] = map(fun(I) -> atom_to_list(I) end, X0), + T = string:tokens(X, " "), %% We separated into strings + [_|FArgs] = T, %% We drop the program path + [F|Args] = FArgs, %% Separata into script file path and args %% io:format("Escript:~p~n",[X]), {Nerrs, Dict} = parse_file(F), if diff -urN escript-1.0/mk_escript.sh escript-1.0.1/mk_escript.sh --- escript-1.0/mk_escript.sh Fri Mar 23 14:58:01 2001 +++ escript-1.0.1/mk_escript.sh Fri Mar 23 17:25:26 2001 @@ -2,6 +2,6 @@ CWD=`pwd` echo $CWD echo "#!/bin/sh" > escript -echo "erl -pa $CWD -noshell -s escript go \$0 \$*" >> escript +echo "erl -pa $CWD -noshell -s escript go \"\$0 \$*\"" >> escript chmod u+x escript From etxhste@REDACTED Fri Mar 23 17:34:27 2001 From: etxhste@REDACTED (Hakan Stenholm) Date: Fri, 23 Mar 2001 17:34:27 +0100 Subject: Mnemosyne Message-ID: <3ABB7B13.49469E55@etxb.ericsson.se> Acording to http://avweb.etxb.ericsson.se/~etxblau/ErlangCosts.html: "Each mnemosyne query creates a temporary process. In the current Mnemosyne implementation the temporary process can for complex queries grow very very large, and even force the runtime system to start swapping memory to disk. Therefore, don't use Mnemosyne in cases where you easily can hardcode the queries, and if you use Mnemosyne - always check that the execution time and memory consumed for complex queries, and for serches on large tables, is within reasonable limits." this was true in 1997, but is it still true ? - does it still use large amounts of memory (many other things mentioned on this page are no longer relevant) ? From Sean.Hinde@REDACTED Fri Mar 23 17:50:18 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 23 Mar 2001 16:50:18 -0000 Subject: Mnemosyne Message-ID: <402DD461F109D411977E0008C791C312039F5E5E@imp02mbx.one2one.co.uk> I'm not sure about this problem but we have had problems with mnesmosyne queries permanently hanging and causing the system massive load. We have replaced all occurences with match_object etc until it is sorted out. I guess the much rumoured ets:select mechanism is what is required to turn mnemosyne into somethng a little more optimal? In R8? Sean > -----Original Message----- > From: Hakan Stenholm [mailto:etxhste@REDACTED] > Sent: 23 March 2001 16:34 > To: erlang-questions@REDACTED > Subject: Mnemosyne > > > Acording to > http://avweb.etxb.ericsson.se/~etxblau/ErlangCosts.html: > > "Each mnemosyne query creates a temporary process. In the current > Mnemosyne implementation the temporary process > can for complex queries grow very very large, and even force > the runtime > system to start swapping memory to disk. > Therefore, don't use Mnemosyne in cases where you easily can hardcode > the queries, and if you use Mnemosyne - always > check that the execution time and memory consumed for complex queries, > and for serches on large tables, is within reasonable limits." > > this was true in 1997, but is it still true ? - does it still > use large > amounts of memory (many other things mentioned on this > page are no longer relevant) ? > 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 luke@REDACTED Fri Mar 23 16:31:33 2001 From: luke@REDACTED (Luke Gorrie) Date: 23 Mar 2001 16:31:33 +0100 Subject: escript, flags to script In-Reply-To: <200103231459.PAA04343@avc280.etxb.ericsson.se> References: <200103231459.PAA04343@avc280.etxb.ericsson.se> Message-ID: Bengt Kleberg writes: > Greetings, > > How do I get escript to recognise Unix style command line flags? The problem is that 'erl' is interpreting the args. A possibly solution would be to put a leading "escape" character on them so that erl never sees anything starting with "-". My quick hack is this. First a new script that escapes the args: #!/bin/sh function escape() { for arg in $*; do echo -n "\\${arg} "; done echo "" } erl -pa /home/luke/src/escript-1.0 -noshell -s escript go $0 $(escape $*) Then the erlang module needs to strip the escape characters: go(X0) -> X = map(fun(I) -> [_EscapeChar | Arg] = atom_to_list(I), Arg end, X0), [_,F|Args] = X, ... etc This works for me: $ cmd-line-args -foo bar -baz cmd-line-args ["-foo","bar","-baz"] From thierry@REDACTED Fri Mar 23 16:43:54 2001 From: thierry@REDACTED (Thierry Mallard) Date: Fri, 23 Mar 2001 16:43:54 +0100 Subject: escript, flags to script In-Reply-To: <200103231459.PAA04343@avc280.etxb.ericsson.se>; from qtxkleb@etxb.ericsson.se on Fri, Mar 23, 2001 at 03:59:47PM +0100 References: <200103231459.PAA04343@avc280.etxb.ericsson.se> Message-ID: <20010323164354.A2283@IDEALX.com> On Fri, Mar 23, 2001 at 03:59:47PM +0100, Bengt Kleberg wrote: > Greetings, > > How do I get escript to recognise Unix style command line flags? > > Given my-script (far) below, started like this: > ; my-script -a hello I think there is a bug in the parsing of the arguments. Not looked at the sources yet, but it seems that if there is a "-" in an argument, [] is passed instead : tsm|~ > ./testing hello world cmd-line-args ["hello","world"] tsm|~ > ./testing hello -a cmd-line-args ["hello"] tsm|~ > ./testing -a world cmd-line-args [] Still have to find out why... -- Thierry Mallard | http://vawis.net GnuPG key on wwwkeys.pgp.net | http://erlang-fr.org (new) key 0xA3D021CB | http://worldforge.org From qtxkleb@REDACTED Sun Mar 25 10:54:41 2001 From: qtxkleb@REDACTED (Bengt Kleberg) Date: Sun, 25 Mar 2001 10:54:41 +0200 (MET DST) Subject: escript, flags to script Message-ID: <200103250854.KAA25883@avc280.etxb.ericsson.se> > From luke@REDACTED Fri Mar 23 16:31:36 2001 > Bengt Kleberg writes: > > > Greetings, > > > > How do I get escript to recognise Unix style command line flags? > > The problem is that 'erl' is interpreting the args. A possibly > solution would be to put a leading "escape" character on them so that > erl never sees anything starting with "-". ...deleted hack According to the 'erl' manual page it should be possible to stop erl from interpreting arguments by doing this: erl -s module function -- any-args and the use 'init:get_args()' to get 'any-args'. I thnk I know why nobody has suggested this. It does not work. But either it should be fixed, or the man page should be updated... Bengt Kleberg From joe@REDACTED Mon Mar 26 10:22:07 2001 From: joe@REDACTED (Joe Armstrong) Date: Mon, 26 Mar 2001 10:22:07 +0200 (CEST) Subject: escript, flags to script In-Reply-To: <200103250854.KAA25883@avc280.etxb.ericsson.se> Message-ID: > According to the 'erl' manual page it should be possible to stop erl > from interpreting arguments by doing this: > > erl -s module function -- any-args > > and the use 'init:get_args()' to get 'any-args'. > I thnk I know why nobody has suggested this. It does not work. > But either it should be fixed, or the man page should be updated... You're quite right it's very broken :-) *especially* if the any args has one of the "erlang" flags -s, ... etc. /Joe -- Joe Armstrong, Alteon WebSystems, tel: +46 8-545 550 00 S:t Eriksgatan 44, IV, fax: +46 8-654 70 71 SE-112 32 Stockholm, Sweden info: www.bluetail.com From joe@REDACTED Mon Mar 26 10:24:18 2001 From: joe@REDACTED (Joe Armstrong) Date: Mon, 26 Mar 2001 10:24:18 +0200 (CEST) Subject: escript, flags to script In-Reply-To: <200103250854.KAA25883@avc280.etxb.ericsson.se> Message-ID: Re: all comments about escript -- I intend to add on-the-fly compilation and correct command line handling - watch this space :-) /Joe -- Joe Armstrong, Alteon WebSystems, tel: +46 8-545 550 00 S:t Eriksgatan 44, IV, fax: +46 8-654 70 71 SE-112 32 Stockholm, Sweden info: www.bluetail.com From pascal.brisset@REDACTED Mon Mar 26 13:40:51 2001 From: pascal.brisset@REDACTED (Pascal Brisset) Date: Mon, 26 Mar 2001 13:40:51 +0200 (CEST) Subject: regexp module with submatches available Message-ID: <3abf2ab73c107ddf@andira.wanadoo.fr> (added by andira.wanadoo.fr) We have extended the regexp module in OTP R7B-1 with support for submatches (the '\(...\)' syntax in SED regular expressions). This makes it possible to retrieve several components of a match with a single evaluation of a regexp. For example: 1> RE_URL="\\(.+\\)://\\(.+\\)\\(/.+\\)(\\?\\(.*\\)(&\\(.*\\))*)?", 1> gregexp:groups("http://localhost:81/script?arg&arg2&arg3", RE_URL). {match,["http","localhost:81","/script","arg","arg2","arg3"]} gregexp is available from http://www.cellicium.com/erlang/contribs/ -- Pascal Brisset +33141986741 -- --- Cellicium R&D | 73 avenue Carnot | 94230 Cachan | France --- From joe@REDACTED Mon Mar 26 15:18:42 2001 From: joe@REDACTED (Joe Armstrong) Date: Mon, 26 Mar 2001 15:18:42 +0200 (CEST) Subject: ANNOUNCE: escript 2.0 In-Reply-To: Message-ID: Here is an improved version of escript - offering a) Luke's hack (posted earlier) b) Interpreted and *compiled* scripts For slow scripts you might like to compile the module using the -mode(compile). Option. See the examples in factorial1 and factorial2 Download from http://www.bluetail.com/~joe/escript.html /Joe -- Joe Armstrong, Alteon WebSystems, tel: +46 8-545 550 00 S:t Eriksgatan 44, IV, fax: +46 8-654 70 71 SE-112 32 Stockholm, Sweden info: www.bluetail.com From rv@REDACTED Mon Mar 26 15:36:59 2001 From: rv@REDACTED (Robert Virding) Date: Mon, 26 Mar 2001 15:36:59 +0200 Subject: regexp module with submatches available In-Reply-To: Your message of "Mon, 26 Mar 2001 13:40:51 +0200." <3abf2ab73c107ddf@andira.wanadoo.fr> (added by andira.wanadoo.fr) Message-ID: <200103261336.PAA21229@trana.bluetail.com> Pascal Brisset writes: >We have extended the regexp module in OTP R7B-1 with support for >submatches (the '\(...\)' syntax in SED regular expressions). >This makes it possible to retrieve several components of a match with >a single evaluation of a regexp. For example: > >1> RE_URL="\\(.+\\)://\\(.+\\)\\(/.+\\)(\\?\\(.*\\)(&\\(.*\\))*)?", >1> gregexp:groups("http://localhost:81/script?arg&arg2&arg3", RE_URL). >{match,["http","localhost:81","/script","arg","arg2","arg3"]} Something like this is already planned for the next version. It follows the AWK style so it only exists in the substitution functions. You can extract sub-matches with a \1 - \9 syntax in the replacement string. The main question left is whether to change the old sub/gsub functions or to only have it in a new gensub function. Gensub is a new function which allows more control. AWK only has it in gensub. Having a call to just match and extract the groups would probably be useful. The question is whether to return the actual substrings or return a list of start/length pairs like match does today. Comments? Robert From pascal.brisset@REDACTED Mon Mar 26 15:48:03 2001 From: pascal.brisset@REDACTED (Pascal Brisset) Date: Mon, 26 Mar 2001 15:48:03 +0200 Subject: regexp module with submatches available In-Reply-To: <200103261336.PAA21229@trana.bluetail.com> References: <3abf2ab73c107ddf@andira.wanadoo.fr> <200103261336.PAA21229@trana.bluetail.com> Message-ID: <15039.18579.845562.724056@pcg.localdomain> Robert Virding writes: > Having a call to just match and extract the groups would probably be > useful. The question is whether to return the actual substrings or > return a list of start/length pairs like match does today. Actually, gregexp:groups just maps lists:sublist/3 over a list of start/length pairs returned by gregexp:re_apply/3. Why not export re_apply/3 ? I'd rather use it than match/2, which seems to iterate over the whole string to find the first match. -- Pascal Brisset +33(0)141986741 -- -- Cellicium | 73 avenue Carnot | F-94230 Cachan +33(0)685110788 -- gregexp:groups(S, ParsedRegExp) -> case re_apply(S, 1, ParsedRegExp) of {match, _RestPos, _Rest, Groups} -> GetGroup = fun ({Start,Len}) -> lists:sublist(S,Start,Len) end, {match, lists:map(GetGroup, Groups)}; Other -> Other end. From rv@REDACTED Mon Mar 26 17:34:52 2001 From: rv@REDACTED (Robert Virding) Date: Mon, 26 Mar 2001 17:34:52 +0200 Subject: regexp module with submatches available In-Reply-To: Your message of "Mon, 26 Mar 2001 15:48:03 +0200." <15039.18579.845562.724056@pcg.localdomain> Message-ID: <200103261534.RAA21827@trana.bluetail.com> Pascal Brisset writes: >Robert Virding writes: > > Having a call to just match and extract the groups would probably be > > useful. The question is whether to return the actual substrings or > > return a list of start/length pairs like match does today. > >Actually, gregexp:groups just maps lists:sublist/3 over a list of >start/length pairs returned by gregexp:re_apply/3. > >Why not export re_apply/3 ? I'd rather use it than match/2, which >seems to iterate over the whole string to find the first match. Probably will, at the moment I am in a mood to open up some of the library modules, done erl_eval for Joe and probably do shell as well. So there maybe will be a re_apply/3 for those who want to roll-there-own and some highere interfaces for the standard uses. There are also some bug fixes. >From the manual match(String, RegExp) -> MatchRes Finds the first, longest match of the regular expression RegExp in String. This function searches for the longest possible match and returns the first one found if there are several expressions of the same length. first_match(String, RegExp) -> MatchRes Finds the first match of the regular expression RegExp in String. This call is usually faster than match and it is also a useful way to ascertain that a match exists. That minus some uninteresting junk about arguments, return values and errors. :-) Robert From scott@REDACTED Tue Mar 27 00:43:17 2001 From: scott@REDACTED (J Scott Jaderholm) Date: 26 Mar 2001 15:43:17 -0700 Subject: Dynamicly generated websites in Erlang Message-ID: <87u24gi22i.fsf@jaderholm.com> Hi, What options are there for dynamically generating websites in erlang? I'm using INETS webserver right now, but it only serves static pages afaik. I'd like to be able to generate different pages based on 1) a template file and 2) information pulled out of databases (either postgresql or I might look into mnesia, not sure if it's appropriate in this case). I may not need the template feature, but that's what I've used in the past (with IMHO and Common Lisp). I've been told that I could use some of the code in bluetail's ticket tracker, but from a quick look at it I think I'd much rather use other (easier hopefully) options, if there are any. Thanks for reading, and any responses. Sincerely, jsj -- the sky is tired of being blue From mickael.remond@REDACTED Tue Mar 27 07:36:16 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Tue, 27 Mar 2001 07:36:16 +0200 Subject: Dynamicly generated websites in Erlang In-Reply-To: <87u24gi22i.fsf@jaderholm.com>; from scott@jaderholm.com on Mon, Mar 26, 2001 at 03:43:17PM -0700 References: <87u24gi22i.fsf@jaderholm.com> Message-ID: <20010327073616.A2088@erlang-fr.org> J Scott Jaderholm (scott@REDACTED) wrote: > Hi, > > What options are there for dynamically generating websites in erlang? > I'm using INETS webserver right now, but it only serves static pages > afaik. I'd like to be able to generate different pages based on In fact, INETS can also generate dynamic content. You can execute Erlang code in INETS. What you should look for is: mod_esi (Erlang Scripting Interface): http://www.erlang.org/doc/r7b/lib/inets-2.5.3/doc/html/mod_esi.html I wrote a french article on this topic and I could translate it if you are interested. This is a very nice feature to create a web interface to setup the parameter when developping an Erlang server. > I've been told that I could use some of the code in bluetail's > ticket > tracker, but from a quick look at it I think I'd much rather use > other > (easier hopefully) options, if there are any. If I remember correctly, BTT use INETS to serve its dynamic content, and Mnesia as its database. The other alternative is mod_erl (which is preliminary implementation of an Erlang module for the Apache web server). You can get it at: http://www.rfc1149.net/devel/mod_erl.html.en -- Micka?l R?mond http://www.erlang-fr.org/ From jsj@REDACTED Tue Mar 27 08:24:44 2001 From: jsj@REDACTED (J Scott Jaderholm) Date: 26 Mar 2001 23:24:44 -0700 Subject: Dynamicly generated websites in Erlang In-Reply-To: <20010327073616.A2088@erlang-fr.org> (Mickael Remond's message of "Tue, 27 Mar 2001 07:36:16 +0200") References: <87u24gi22i.fsf@jaderholm.com> <20010327073616.A2088@erlang-fr.org> Message-ID: <873dbziv9v.fsf@debian.org> Mickael Remond writes: > J Scott Jaderholm (scott@REDACTED) wrote: > > Hi, > > > > What options are there for dynamically generating websites in erlang? > > I'm using INETS webserver right now, but it only serves static pages > > afaik. I'd like to be able to generate different pages based on > > In fact, INETS can also generate dynamic content. You can execute Erlang > code in INETS. > > What you should look for is: mod_esi (Erlang Scripting Interface): > http://www.erlang.org/doc/r7b/lib/inets-2.5.3/doc/html/mod_esi.html > > I wrote a french article on this topic and I could translate it if you > are interested. I'd definitely like that. I read the Reference Manual but I'm not quite grasping it from that. I copied httpd_example.erl into my server_root, but the docs say to copy the whole examples directory into /var/tmp. I'm not sure why I need to do this, but I did it anyway, and I get this when I run 5> start("/home/lispbliss/erl/inets/server_root/httpd_example.erl"). ** exited: {undef,[{shell_default,start, ["/home/lispbliss/erl/inets/server_root/httpd_example.erl"]}, {shell,local_func,4}, {erl_eval,exprs,4}, {shell,eval_loop,2}]} ** 6> I've searched usenet and the archive of this list and have found *very* little on mod_esi, are there any other documents explaining mod_esi? Sincerely, jsj From tobbe@REDACTED Tue Mar 27 08:57:28 2001 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 27 Mar 2001 08:57:28 +0200 Subject: Dynamicly generated websites in Erlang In-Reply-To: J Scott Jaderholm's message of "26 Mar 2001 15:43:17 -0700" References: <87u24gi22i.fsf@jaderholm.com> Message-ID: > I've been told that I could use some of the code in bluetail's ticket > tracker, but from a quick look at it I think I'd much rather use other > (easier hopefully) options, if there are any. Don't let the amount of code scare you. It is rather easy to get going with INETS. Just copy the example server root directory from the standard Erlang/OTP application, e.g: cp -R /usr/local/usr_lib/erlang/lib/inets-2.5.3/examples/server_root xxx Modify the xxx/conf/httpd.conf file. Especially the directive where you state your Erlang module to be called: ErlScriptAlias /my my Create a file: xxx/inets.config which points out the conf file above: cat > xxx/inets.config [{inets, [{services, [{httpd,"/....../xxx/conf/httpd.conf"}]}]}]. ^D Start Erlang with the switches: -config /...../xxx/inets -s my In your startup code in my.erl, call: application:start(inets) Now when you point a Web browser towards: http://something:aport/my/my/test The function: my:test/2 should be called by INETS, and whatever it returns is sent back to the web browser. Example (my.erl): test(Env,Input) -> InData = httpd:parse_query(Input), io:format("GOT THIS: ~p~n",[InData]), %% Returning this ["", "", " A Test Page ", "", "", "

A TEST

", "", ""]. For creating HTML content, the faqoff/html_lib.erl module in the BTT package can be useful. Good luck ! /Tobbe -- -- Torbj?rn T?rnkvist , tel: +46 8 545 55 023 , fax: +46 8 654 70 71 Alteon Web Systems , St.Eriksgatan 44 , SE-112 34 Stockholm , Sweden Email: ttornkvist@REDACTED , Web: http://www.alteon.com From mickael.remond@REDACTED Tue Mar 27 09:31:21 2001 From: mickael.remond@REDACTED (Mickael Remond) Date: Tue, 27 Mar 2001 09:31:21 +0200 Subject: Dynamicly generated websites in Erlang In-Reply-To: <873dbziv9v.fsf@debian.org>; from jsj@debian.org on Mon, Mar 26, 2001 at 11:24:44PM -0700 References: <87u24gi22i.fsf@jaderholm.com> <20010327073616.A2088@erlang-fr.org> <873dbziv9v.fsf@debian.org> Message-ID: <20010327093121.A2762@erlang-fr.org> J Scott Jaderholm (jsj@REDACTED) wrote: > Mickael Remond writes: > > I wrote a french article on this topic and I could translate it if you > > are interested. > > I'd definitely like that. I read the Reference Manual but I'm not > quite grasping it from that. Ok. I will work on it. -- Micka?l R?mond http://www.erlang-fr.org/ From etxuwig@REDACTED Tue Mar 27 09:52:46 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Tue, 27 Mar 2001 09:52:46 +0200 (MET DST) Subject: Dynamicly generated websites in Erlang In-Reply-To: <87u24gi22i.fsf@jaderholm.com> Message-ID: On 26 Mar 2001, J Scott Jaderholm wrote: >Hi, > >What options are there for dynamically generating websites in >erlang? I'm using INETS webserver right now, but it only serves >static pages afaik. I'd like to be able to generate different pages >based on > >1) a template file and > >2) information pulled out of databases (either postgresql or I might >look into mnesia, not sure if it's appropriate in this case). Personally, I use mnesia in a web server application that I maintain. It works very well for my purposes. If you need to use a different database, you may want to look at the ODBC client, or simply write your own glue code to access the database. If you can read a PowerPoint presentation, you may want to look at http://www.erlang.se/euc/00/xmerl.ppt There is an example of how to put together fairly generic Erlang terms and then convert them to HTML (or e.g. XML) on the way out. (the actual example starts on slide 13.) xmerl-0.15 has conversion functions for most HTML tags, and you can easily put your own conversion layer on top. I've tested it in a prototype where I inserted nice splash headers and images etc without having to change a line of code in the program logic (just in the conversion layer to HTML.) This would give you something a bit similar to templates, I think. No good documentation though. Sorry about that. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From jsj@REDACTED Tue Mar 27 10:22:10 2001 From: jsj@REDACTED (J Scott Jaderholm) Date: 27 Mar 2001 01:22:10 -0700 Subject: Dynamicly generated websites in Erlang In-Reply-To: (Torbjorn Tornkvist's message of "27 Mar 2001 08:57:28 +0200") References: <87u24gi22i.fsf@jaderholm.com> Message-ID: <87n1a7hb9p.fsf@debian.org> Hi Torbjorn, Torbjorn Tornkvist writes: > Especially the directive where you state your Erlang module to be called: > > ErlScriptAlias /my my I create a directory my in my server_root and put my.erl in there. > Start Erlang with the switches: -config /...../xxx/inets -s my I do and get this error {'init terminating in do_boot',{undef,[{my,start,[]},{init,start_it,1},{init,start_em,1}]}} init terminating in do_boot () Btw, is it normal to get like 4-5 PROGRESS REPORTs when startin inets? > In your startup code in my.erl, call: application:start(inets) I'm not sure waht you mean by startup code. > Now when you point a Web browser towards: > > http://something:aport/my/my/test On mod_esi.html#ErlScriptAlias it says to use my:test syntax. Is this just outdated? > For creating HTML content, the faqoff/html_lib.erl > module in the BTT package can be useful. Ahh, thank you, I've looked at that and I'll study it more indepth once I get eli working. Thanks for your valuable response. Sincerely, jsj From tobbe@REDACTED Tue Mar 27 10:34:08 2001 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 27 Mar 2001 10:34:08 +0200 Subject: Dynamicly generated websites in Erlang In-Reply-To: J Scott Jaderholm's message of "27 Mar 2001 01:22:10 -0700" References: <87u24gi22i.fsf@jaderholm.com> <87n1a7hb9p.fsf@debian.org> Message-ID: > > Start Erlang with the switches: -config /...../xxx/inets -s my > > I do and get this error > {'init terminating in do_boot',{undef,[{my,start,[]},{init,start_it,1},{init,start_em,1}]}} > init terminating in do_boot () Try and add the path to your erlang module: erl -config /...../xxx/inets -pa /where/my-code/is -s my > Btw, is it normal to get like 4-5 PROGRESS REPORTs when startin > inets? Yes, especially if you are using the: -boot start_sasl switch. > > In your startup code in my.erl, call: application:start(inets) > > I'm not sure waht you mean by startup code. In my.erl you probably have something like: start() -> spawn(?MODULE, init, []). init() -> application:start(inets), %% more init stuff here... ? loop(). loop() -> %% A receive-loop here.... receive Msg -> io:format("loop got: ~p~n",[Msg]), loop() end. Cheers /Tobbe From etxuwig@REDACTED Tue Mar 27 10:37:03 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Tue, 27 Mar 2001 10:37:03 +0200 (MET DST) Subject: Dynamicly generated websites in Erlang In-Reply-To: <87n1a7hb9p.fsf@debian.org> Message-ID: On 27 Mar 2001, J Scott Jaderholm wrote: > >Hi Torbjorn, > >Torbjorn Tornkvist writes: > >> Start Erlang with the switches: -config /...../xxx/inets -s my > >I do and get this error >{'init terminating in >do_boot',{undef,[{my,start,[]},{init,start_it,1},{init,start_em,1}]}} >init terminating in do_boot () You need to write a function my:start(). The '-s my' flag is basically short for '-s my start', that is, "start a process by calling my:start()". More on that below. >Btw, is it normal to get like 4-5 PROGRESS REPORTs when startin >inets? Yes. When you start your Erlang node with SASL activated (e.g. 'erl -boot start_sasl'), you will get a progress report for every process started using proc_lib.erl. This includes all processes based on OTP behaviours (gen_server, gen_fsm, supervisor, ...) If they really bug you, you can turn them off with the flag '-sasl errlog_type error'. This will only give you the error and crash reports. >> In your startup code in my.erl, call: application:start(inets) > >I'm not sure waht you mean by startup code. my:start() needs to start a process (see 'erl -man init' "The functions are executed sequentially in the ini- tialization process, which then terminates normally and passes control to the user. This means that a -s call which does not terminate will block further pro- cessing; to avoid this, use some variant of spawn in such cases." Of course, this man page also recommends that the -run flag be used instead of the -s flag. In this case, it doesn't matter. I noticed that Tobbe gave you an example of run.erl, so I'll stop here. /Uffe -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From Jouni.Ryno@REDACTED Tue Mar 27 13:45:56 2001 From: Jouni.Ryno@REDACTED (Jouni.Ryno@REDACTED) Date: Tue, 27 Mar 2001 14:45:56 +0300 Subject: TclTk version surprise In-Reply-To: Message from "Vlad Dumitrescu" of "Sat, 17 Mar 2001 23:59:09 +0100." Message-ID: Somehow we have always been better off with using a bit modified ewish, which was part of the distribution about a 4 years ago. Most importantly, we were able to add support for the BLT ! And so we can use whatever Tcl-version we like. And we were able to divide the work with two persons, one writing Erlang, the other making the user experience in Tk. The drawback is of course the shuffling ascii lists around. And in a later versions it turned out, that we are doing completely wrong things in TclTk side, as the data was already there on Tcl-side and the other persons was much faster hacking in Tcl. (the C-driver <-> Erlang telemetry <-> TclTk -user interface is used for a few space experiments as ground support equipment, almost as in the Erlang-book example :-) ) Getting some Gtk/Glade support would be interesting to try ... Jouni Ryn? mailto://Jouni.Ryno@REDACTED/ http://www.geo.fmi.fi/~ryno/ Finnish Meteorological Institute http://www.fmi.fi/ Geophysical Research http://www.geo.fmi.fi/ P.O.BOX 503 Tel (+358)-9-19294656 FIN-00101 Helsinki FAX (+358)-9-19294603 Finland priv-GSM (+358)-50-5302903 "It's just zeros and ones, it cannot be hard" From recycledelectrons@REDACTED Tue Mar 27 18:02:57 2001 From: recycledelectrons@REDACTED (andy allen) Date: Tue, 27 Mar 2001 10:02:57 -0600 Subject: rcp:cast/4 example? Message-ID: Hi, all. I'm looking for advice on a simple example of rpc:cast/4. -=-=- I am trying to get the following code to execute: call_ch_nodes_to_get_data(DataToPassWithCall) -> ?SYS_DBG(int_if, "mlgAmsCpt:call_ch_nodes_to_Get_data(~w)~n", [DataToPassWithCall]), ChNodes = get_ch_nodes(), ?SYS_DBG(int_if, "Found the following nodes: ~w ~n", [ChNodes]), Module = mlgCpt, Function = trace_cast, [ChNode | Rest] = ChNodes, % Temporary hack for one node ?SYS_DBG(int_if, "Will cast to the node ~w, module ~w, function ~w with the parameters ~w ~n", [ChNode, Module, Function, [DataToPassWithCall]]), X = rpc:cast(ChNode, Module, Function, [DataToPassWithCall]), ?SYS_DBG(int_if, "Result of cast: ~w ~n", [X]), nnn. -=-=- SYS_DBG {mlgAmsCpt,680,int_if}, <0.20019.3> 27-Mar-2001 15:13:37.022072: -- mlgAmsCpt:call_ch_nodes_to_Get_data ({{switch_dev_id, 1}, {channel, all}}) ChNodes = get_ch_nodes(), SYS_DBG {mlgAmsCpt,691,int_if}, <0.20019.3> 27-Mar-2001 15:13:37.046248: -- Found the following nodes: ['cp1-19@REDACTED'] SYS_DBG {mlgAmsCpt,697,int_if}, <0.20019.3> 27-Mar-2001 15:13:37.048843: -- Will cast to the node 'cp1-19@REDACTED', module mlgCpt, function trace_call with the parameters [{{switch_dev_id,1},{channel,all}}] SYS_DBG {mlgAmsCpt,701,int_if}, <0.20019.3> 27-Mar-2001 15:13:37.052683: -- Result of cast: true -=-=- To make certain that the function I am casting to works, I can call it with the following line from an Erlang shell: mlgCpt:trace_call({{switch_dev_id, 1}, {channel, all}}). It executes past a "SYS_DBG" statement, then crashes. But when I cast to it, it should at least execute the "SYS_DBG" statement, right? -=-=- For the uninitiated: 1. rpc is a library in the standard Erlang distribution, 2. ?SYS_DBG is a macro that works like a printf. -=-=- Thanks for ANY help you can give me! Andy Allen Ericsson, EUS/SA/BA P.S. Has anyone considered expanding the MAN pages with simple hello-world examples of each library call? _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com From recycledelectrons@REDACTED Tue Mar 27 19:45:33 2001 From: recycledelectrons@REDACTED (andy allen) Date: Tue, 27 Mar 2001 11:45:33 -0600 Subject: rcp:cast/4 example? Message-ID: Thanks for the advice, but no. I want to make a call, without waiting for it to return. The reason I use cast instead of call is effeciency. Each (of cast and call) is a BIF (built in function,) and that all BIFs will block on the local node until it finished. I do not want to block at all. This is a Real Time application, with hundreds of threads running (an AXD301 in NGS4.0). Andy Allen EUS/SA/BA >From: Siri Hansen >To: andy allen >Subject: Re: rcp:cast/4 example? >Date: Tue, 27 Mar 2001 17:34:14 +0100 > >Hi Andy! > >I think you want to do rpc:call/4 instead of rpc:cast/4. cast is >asyncronous! > >/siri > >andy allen wrote: > > > > Hi, all. > > > > I'm looking for advice on a simple example of rpc:cast/4. > > > > -=-=- > > > > I am trying to get the following code to execute: > > > > call_ch_nodes_to_get_data(DataToPassWithCall) -> > > ?SYS_DBG(int_if, "mlgAmsCpt:call_ch_nodes_to_Get_data(~w)~n", > > [DataToPassWithCall]), > > > > ChNodes = get_ch_nodes(), > > ?SYS_DBG(int_if, "Found the following nodes: ~w ~n", [ChNodes]), > > > > Module = mlgCpt, > > Function = trace_cast, > > > > [ChNode | Rest] = ChNodes, % Temporary hack for one node > > ?SYS_DBG(int_if, "Will cast to the node ~w, module ~w, function > > ~w with the parameters ~w ~n", > > [ChNode, Module, Function, [DataToPassWithCall]]), > > > > X = rpc:cast(ChNode, Module, Function, [DataToPassWithCall]), > > ?SYS_DBG(int_if, "Result of cast: ~w ~n", [X]), > > > > nnn. > > > > -=-=- > > > > SYS_DBG {mlgAmsCpt,680,int_if}, <0.20019.3> 27-Mar-2001 15:13:37.022072: > > -- mlgAmsCpt:call_ch_nodes_to_Get_data ({{switch_dev_id, 1}, {channel, > > all}}) > > > > ChNodes = get_ch_nodes(), SYS_DBG {mlgAmsCpt,691,int_if}, <0.20019.3> > > 27-Mar-2001 15:13:37.046248: > > -- Found the following nodes: ['cp1-19@REDACTED'] > > > > SYS_DBG {mlgAmsCpt,697,int_if}, <0.20019.3> 27-Mar-2001 >15:13:37.048843: > > -- Will cast to the node 'cp1-19@REDACTED', module mlgCpt, function >trace_call > > with the parameters [{{switch_dev_id,1},{channel,all}}] > > > > SYS_DBG {mlgAmsCpt,701,int_if}, <0.20019.3> 27-Mar-2001 >15:13:37.052683: > > -- Result of cast: true > > > > -=-=- > > > > To make certain that the function I am casting to works, I can call it >with > > the following line from an Erlang shell: > > > > mlgCpt:trace_call({{switch_dev_id, 1}, {channel, all}}). > > > > It executes past a "SYS_DBG" statement, then crashes. But when I cast to >it, > > it should at least execute the "SYS_DBG" statement, right? > > > > -=-=- > > > > For the uninitiated: > > 1. rpc is a library in the standard Erlang distribution, > > 2. ?SYS_DBG is a macro that works like a printf. > > > > -=-=- > > > > Thanks for ANY help you can give me! > > > > Andy Allen > > Ericsson, EUS/SA/BA > > > > P.S. Has anyone considered expanding the MAN pages with simple >hello-world > > examples of each library call? > > _________________________________________________________________ > > Get your FREE download of MSN Explorer at http://explorer.msn.com _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com From etxuwig@REDACTED Wed Mar 28 10:01:15 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 28 Mar 2001 10:01:15 +0200 (MET DST) Subject: rcp:cast/4 example? In-Reply-To: Message-ID: Two things that might confuse the results: - rpc sets the "group leader" of the process executing the function to the group leader of the process requesting the call. If there is IO, it should appear on the node from where the rpc:cast() originated. - The ?SYS_DBG macro only prints if a debug compiled version of mlgCpt.erl is loaded on the node where the function is executed (i.e. the remote node) AND debug:filter(mlgCpt, Tag) returns true on the same node. Otherwise, no printout will be generated. That is, you have to call debug:on(mlgCpt) on both nodes, and look for the output on the node executing call_ch_nodes_to_get_data/1. Have you tried calling rpc:cast(node(), mlgCpt, trace_call, [...]) from the shell? It should give the same behaviour as calling the function directly from the shell. /Uffe On Tue, 27 Mar 2001, andy allen wrote: >Hi, all. > >I'm looking for advice on a simple example of rpc:cast/4. > >-=-=- > >I am trying to get the following code to execute: > >call_ch_nodes_to_get_data(DataToPassWithCall) -> > ?SYS_DBG(int_if, "mlgAmsCpt:call_ch_nodes_to_Get_data(~w)~n", > [DataToPassWithCall]), > > ChNodes = get_ch_nodes(), > ?SYS_DBG(int_if, "Found the following nodes: ~w ~n", [ChNodes]), > > Module = mlgCpt, > Function = trace_cast, > > [ChNode | Rest] = ChNodes, % Temporary hack for one node > ?SYS_DBG(int_if, "Will cast to the node ~w, module ~w, function > ~w with the parameters ~w ~n", > [ChNode, Module, Function, [DataToPassWithCall]]), > > X = rpc:cast(ChNode, Module, Function, [DataToPassWithCall]), > ?SYS_DBG(int_if, "Result of cast: ~w ~n", [X]), > > nnn. > >-=-=- > >SYS_DBG {mlgAmsCpt,680,int_if}, <0.20019.3> 27-Mar-2001 15:13:37.022072: >-- mlgAmsCpt:call_ch_nodes_to_Get_data ({{switch_dev_id, 1}, {channel, >all}}) > >ChNodes = get_ch_nodes(), SYS_DBG {mlgAmsCpt,691,int_if}, <0.20019.3> >27-Mar-2001 15:13:37.046248: >-- Found the following nodes: ['cp1-19@REDACTED'] > >SYS_DBG {mlgAmsCpt,697,int_if}, <0.20019.3> 27-Mar-2001 15:13:37.048843: >-- Will cast to the node 'cp1-19@REDACTED', module mlgCpt, function trace_call >with the parameters [{{switch_dev_id,1},{channel,all}}] > >SYS_DBG {mlgAmsCpt,701,int_if}, <0.20019.3> 27-Mar-2001 15:13:37.052683: >-- Result of cast: true > >-=-=- > >To make certain that the function I am casting to works, I can call it with >the following line from an Erlang shell: > >mlgCpt:trace_call({{switch_dev_id, 1}, {channel, all}}). > >It executes past a "SYS_DBG" statement, then crashes. But when I cast to it, >it should at least execute the "SYS_DBG" statement, right? > >-=-=- > >For the uninitiated: >1. rpc is a library in the standard Erlang distribution, >2. ?SYS_DBG is a macro that works like a printf. > >-=-=- > >Thanks for ANY help you can give me! > >Andy Allen >Ericsson, EUS/SA/BA > >P.S. Has anyone considered expanding the MAN pages with simple hello-world >examples of each library call? >_________________________________________________________________ >Get your FREE download of MSN Explorer at http://explorer.msn.com > > -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From qtxkleb@REDACTED Wed Mar 28 10:00:53 2001 From: qtxkleb@REDACTED (Bengt Kleberg) Date: Wed, 28 Mar 2001 10:00:53 +0200 (MET DST) Subject: rcp:cast/4 example? Message-ID: <200103280800.KAA19859@avc280.etxb.ericsson.se> > From: "andy allen" ...deleted > I'm looking for advice on a simple example of rpc:cast/4. > ...deleted > > To make certain that the function I am casting to works, I can call it with > the following line from an Erlang shell: > > mlgCpt:trace_call({{switch_dev_id, 1}, {channel, all}}). > > It executes past a "SYS_DBG" statement, then crashes. But when I cast to it, > it should at least execute the "SYS_DBG" statement, right? > > -=-=- > > For the uninitiated: > 1. rpc is a library in the standard Erlang distribution, > 2. ?SYS_DBG is a macro that works like a printf. Greetings, Since you do not explicitly state the result of the cast I am assuming that nothing happens. Please correct me if I am wrong. The most interesting part is this: > 2. ?SYS_DBG is a macro that works like a printf. (may I assume that you mean io:format(), and not printf() :-) Anyway, it seems to be impossible to do io:format() from rpc:cast/call(). The things one wants displayed end up on the calling node, not the node one did the rcp call to. Strange, but true. So, have you tried rpc:call(Node, mlgCpt, trace_call, [Data])? This to make certain that ?SYS_DBG actually displys on the right node. When rpc:call works it would be time to switch to rpc:cast. Bengt Kleberg From Gerald.Biederbeck@REDACTED Wed Mar 28 16:40:49 2001 From: Gerald.Biederbeck@REDACTED (Gerald Biederbeck) Date: Wed, 28 Mar 2001 16:40:49 +0200 Subject: disk_log:blog/2 --- synchronous??? Message-ID: <3AC1F7F1.50D6A4F4@eede.ericsson.se> Hi, I'm trying to write data to (redundant) disks by using the 'disk_log' module. I open it as a 'distributed log', i.e. disk_log:open( [ ..., {notify, true}, {distributed, ['xxx@REDACTED', 'yyy@REDACTED']}, ... ]) On both machines run the disk_log_server process. When using the 'blog/2' function in order to write data, the documentation mentions that this call is synchronous...but I think it isn't!!! If I do a Solaris 'chmod' on a certain LogFile and try to write to this file afterwards, no error is returned....instead my process receives an error_status message as described for the asynchronous feature (which is nice but not desired). Receiving an asynchronous {error_status, ...} is not sufficient for me... Is there a -real- synchronous way to ensure that the 'blog/2' call succeeded? My application must not call 'blog/2' again before it is ensured that writing succeeeded! I tried waiting for theses {error_status, ...} messages but they are only sent if a change in the status occures. If the status remains, let's say, {error_status, ok} no notification is sent and I will wait .... for how long ...forever??? Sorry, I hope someone did understand my problem, maybe there is a quite simple solution to it. Perhaps someone is able to tell me why there is no synchronous functionality within OTP disk_log when talking about distributed logs... Is someone else interested in such a functionality or am I the only one??? Thanx for any comment... Cheers /Gerry From cpressey@REDACTED Wed Mar 28 20:17:37 2001 From: cpressey@REDACTED (Chris Pressey) Date: Wed, 28 Mar 2001 12:17:37 -0600 Subject: Dynamicly generated websites in Erlang References: <87u24gi22i.fsf@jaderholm.com> Message-ID: <3AC22AC1.DE932315@catseye.mb.ca> J Scott Jaderholm wrote: > What options are there for dynamically generating websites in erlang? > I'm using INETS webserver right now, but it only serves static pages > afaik. I'd like to be able to generate different pages based on > 1) a template file [...] > I may not need the template feature, but that's what I've used in the > past (with IMHO and Common Lisp). Assuming you can coerce INETS into doing what you want, you might want to check out Joe Armstrong's EHTML contribution as a solution for your template feature. It allows you to define new HTML tags, and to embed Erlang directly in the template. _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From kent@REDACTED Wed Mar 28 22:23:18 2001 From: kent@REDACTED (Kent Boortz) Date: 28 Mar 2001 22:23:18 +0200 Subject: Dynamicly generated websites in Erlang In-Reply-To: Chris Pressey's message of "Wed, 28 Mar 2001 12:17:37 -0600" References: <87u24gi22i.fsf@jaderholm.com> <3AC22AC1.DE932315@catseye.mb.ca> Message-ID: Chris Pressey writes: > Assuming you can coerce INETS into doing what you want, you might want > to check out Joe Armstrong's EHTML contribution as a solution for your > template feature. It allows you to define new HTML tags, and to embed > Erlang directly in the template. Ehtml is what is used for most parts of www.erlang.org but we don't use it dynamically. We use it together with Unix make and Erlang ermake to generate the pages before we rsync them over from our internal net to www.erlang.org. The erlang code to embed is funs (maybe I haven't read the manual closely enough but I don't think you can use named functions). It is an interesting challenge to express what you want to do using no named functions. I include the current included file with new tag definitions used at www.erlang.org as an example. Maybe a bit ugly but it works and is reasonable easy to change or extend. I like the idea generating pages only when changed, not for every server request, kent fun(Args, Str) -> % Find the relative path to the top directory of the HTML tree RelPath = case lists:keysearch("path_to_top", 1, Args) of {value,{_,""}} -> ""; false -> ""; {value,{_,"/"}} -> "/"; {value,{_,Value}} -> filename:join(filename:split(Value)) ++ "/" end, ["
\"Ericsson\" Open Source Erlang
  Ericsson Utvecklings AB
Search 
 
 
\"Home\"
· Home
· Mirrors
· Download
· Links and Activities
· FAQs + Contact
· Getting started
· Documentation
· Examples
· User Contributions



For comments or questions about this site, contact kent@REDACTED
      "] end fun(_, Str) -> {{Year, Month, Day},{Hour, Minute, Second}} = calendar:universal_time(), Updated = io_lib:format("~4..0w-~2..0w-~2..0w ~2..0w:~2..0w UTC\n",[Year, Month, Day, Hour, Minute]), ["
 
Last updated   ",Updated,"
"] end
fun(_,S) -> ["
\n",S,"
\n"] end
fun(_,Str) -> ["
",Str,"

"] end fun(_, Str) -> Entity = fun($&) -> "&"; ($<) -> "<"; ($>) -> ">"; (C) -> C end, ["

",lists:map(Entity,Str),"
      
"] end
fun(_, Str) -> Entity = fun($&) -> "&"; ($<) -> "<"; ($>) -> ">"; (C) -> C end, ["


", lists:map(Entity,Str), "
"] end
fun(_, Str) -> ["
",Str,"
"] end
fun(_, Str) -> {ok, Bin} = file:read_file(Str), Entity = fun($&) -> "&"; ($<) -> "<"; ($>) -> ">"; (C) -> C end, ["
",lists:map(Entity,binary_to_list(Bin)),"
"] end
fun(_, Str) -> X = "download/" ++ Str, Meg = case file:file_info(X) of {ok, Tup} -> I = element(1, Tup) div (100 * 1024), % 1/10 meg K = element(1, Tup) div 1024, % Kbytes if I == 0 -> "(" ++ integer_to_list(K) ++ " KB)"; true -> case lists:reverse(integer_to_list(I)) of [Last] -> "(0." ++ integer_to_list(I) ++ " MB)"; [Last|T] -> "(" ++ lists:reverse(T) ++ "." ++ [Last] ++ " MB)"; _ -> "" end end; _ -> "Broken link !!! " end, Yes = "yes", ["", Yes, "", "  ", Meg, ""] end fun(_, String) -> X = "download/" ++ String, Meg = case file:file_info(X) of {ok, Tup} -> I = element(1, Tup) div (100 * 1024), % 1/10 meg K = element(1, Tup) div 1024, % Kbytes if I == 0 -> "(" ++ integer_to_list(K) ++ " KB)"; true -> case lists:reverse(integer_to_list(I)) of [Last] -> "(0." ++ integer_to_list(I) ++ " MB)"; [Last|T] -> "(" ++ lists:reverse(T) ++ "." ++ [Last] ++ " MB)"; _ -> "" end end; _ -> "Broken link !!! " end, ["
", "", String, "", "", "  ", Meg] end fun(_, Str) -> ["no"] end fun(_, Str) -> ["soon"] end fun(_, Str) -> [" "] end fun(_, Str) -> {ok,Binary} = file:read_file("MIRRORS"), Chars = binary_to_list(Binary), Lines = string:tokens(Chars, "\n"), Fun = fun(Line, Acc) -> case Line of "URL:" ++ URL -> Url = string:strip(URL), Acc ++ "
  • " ++ Url ++ "\n"; "TXT:" ++ TXT -> Txt = string:strip(TXT), Acc ++ " (" ++ Txt ++ ")\n"; _ -> Acc end end, lists:foldl(Fun, [], Lines) end From cpressey@REDACTED Thu Mar 29 11:17:15 2001 From: cpressey@REDACTED (Chris Pressey) Date: Thu, 29 Mar 2001 03:17:15 -0600 Subject: INETS + virtual hosting = ??? Message-ID: <3AC2FD9B.E6E14038@catseye.mb.ca> Hi all. I'll be in charge of setting up a colocated server soon, one which will be shared by three seperate organizations, each with their own website with light-to-moderate traffic. Each website is accessed from a different domain name by the method known as virtual hosting. I'd like to run Inets as the webserver (& ftp server) on this machine. However I don't know what kind of problems this will cause, as it is clear that Inets does not support virtual hosts in the same way as Apache does, if at all. Our hosts are selected by-IP (http 1.0) not by-name (http 1.1). So this may make the job feasible by some measure (read: kludge), perhaps by starting three copies of Inets on the same port but with different BindAddress settings (??? I may be in over my head here. :-) Also, this will definately involve port 80, which will involve running Inets (and consequently erl) as root. Are there any known problems or caveats regarding this (besides the usual ones that apply to running anything as root?) Thanks in advance. _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html From cpressey@REDACTED Thu Mar 29 11:17:15 2001 From: cpressey@REDACTED (Chris Pressey) Date: Thu, 29 Mar 2001 03:17:15 -0600 Subject: INETS + virtual hosting = ??? Message-ID: <3AC2FD9B.E6E14038@catseye.mb.ca> Hi all. I'll be in charge of setting up a colocated server soon, one which will be shared by three seperate organizations, each with their own website with light-to-moderate traffic. Each website is accessed from a different domain name by the method known as virtual hosting. I'd like to run Inets as the webserver (& ftp server) on this machine. However I don't know what kind of problems this will cause, as it is clear that Inets does not support virtual hosts in the same way as Apache does, if at all. Our hosts are selected by-IP (http 1.0) not by-name (http 1.1). So this may make the job feasible by some measure (read: kludge), perhaps by starting three copies of Inets on the same port but with different BindAddress settings (??? I may be in over my head here. :-) Also, this will definately involve port 80, which will involve running Inets (and consequently erl) as root. Are there any known problems or caveats regarding this (besides the usual ones that apply to running anything as root?) Thanks in advance. _chris -- "Ten short days ago all I could look forward to was a dead-end job as a engineer. Now I have a promising future and make really big Zorkmids." Chris Pressey, Cat's Eye Technologies, http://www.catseye.mb.ca/ Esoteric Topics Mailing List: http://www.catseye.mb.ca/list.html