From chsu79@REDACTED Tue Aug 1 00:28:59 2006 From: chsu79@REDACTED (Christian S) Date: Tue, 1 Aug 2006 00:28:59 +0200 Subject: Simple DB Access In-Reply-To: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> Message-ID: On 7/31/06, Logan, Martin wrote: > > I guess the question would be; who is interested and can dig up these > protocols. The only thing I do know for sure is that this type of tool would > go a long way to making Erlang enterprise integration a reality. Erlang can > be a fantastic middleware platform for corporations. > Well, if one cant get a hold of that, then the second option is to make use of the documented c api libraries, and for that to feel safe i would prefer it to be running as a port or a c node. That would of course come with the cost of lower throughput. Would such a beast appeal to those in need of sql access? -------------- next part -------------- An HTML attachment was scrubbed... URL: From rlenglet@REDACTED Tue Aug 1 05:18:24 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Tue, 1 Aug 2006 12:18:24 +0900 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CE2391.9030102@ericsson.com> References: <44CE2391.9030102@ericsson.com> Message-ID: <200608011218.25460.rlenglet@users.forge.objectweb.org> Mats Cronqvist wrote: [...] > it would be grand if i could write my glue code once, and > have a tool generate a linked-in driver, a port program, a bif > or a c-node from that. this is (i think) the goal of dryverl, > but i'm too dense to figure it out... I prefer letting BIFs out of the scope of Dryverl. I don't think that it is possible to unify *nicely* BIFs, drivers, ports and nodes. Dryverl aims at hiding the differences between drivers, ports and nodes. Those have in common that exchanged data must be (un)marshalled, which is not necessary with BIFs. Dryverl explicitly considers that (un)marshalling occurs. Maybe the Dryverl language could be modified to fit BIFs also, but I am not sure how to do that nicely. A reviewer of the ACM Erlang Workshop pointed me at Haskell's GreenCard, which handles nicely the case when interfacing with C code does not require (un)marshalling, since the Haskell compiler generates C code which can then be finely blended with external C code. This does not fit drivers, ports or nodes, where the C code to integrate is isolated from the emulator and therefore from the Erlang code, but seems to fit BIFs well. However, this is a different goal and design than Dryverl's. Moreover, if one day we have a way to easily write BIFs, with cleanly reified emulator internals, etc., then we would no more need to use drivers. Using linked-in drivers for anything else than what this mechanism was designed for (I/O drivers!) is a perversion, and is currently necessary only because it is difficult to write BIFs. Then the problem boils down to unifying BIFs, ports and nodes. Probably it would be necessary to first develop a nice C API which would mask the differences between mechanisms on the C side. erl_interface is currently not sufficient nor appropriate, since it focuses on (un)marshalling of terms, which does not fit BIFs. -- Romain LENGLET From ivaradi@REDACTED Tue Aug 1 08:06:32 2006 From: ivaradi@REDACTED (=?ISO-8859-1?Q?Istv=E1n_V=E1radi?=) Date: Tue, 1 Aug 2006 08:06:32 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CE20BE.5070102@ericsson.com> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE18F7.1020602@ericsson.com> <44CE1A2A.8040908@comcast.net> <44CE20BE.5070102@ericsson.com> Message-ID: Hi, I have posted the code with some documentation into the User Contributions area of TrapExit (http://forum.trapexit.org/viewtopic.php?t=5906). Any comments/fixes/etc. are welcome. Istvan From mikael.karlsson@REDACTED Tue Aug 1 13:44:45 2006 From: mikael.karlsson@REDACTED (Mikael Karlsson) Date: Tue, 1 Aug 2006 13:44:45 +0200 Subject: Simple DB Access In-Reply-To: References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> Message-ID: <200608011344.46076.mikael.karlsson@creado.com> I beleive there are some open source contributions that provide "direct" access to mysql and postgresql databases for Erlang. It would be nice if they could use the same api, something like jdbc for java etc. If they already not are doing this? How about and "edbc" application? /Mikael Refs: http://support.process-one.net/doc/display/CONTRIBS/Yxa http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/pgsql/ tisdag 01 augusti 2006 00:28 skrev Christian S: > On 7/31/06, Logan, Martin wrote: > > I guess the question would be; who is interested and can dig up these > > protocols. The only thing I do know for sure is that this type of tool > > would go a long way to making Erlang enterprise integration a reality. > > Erlang can be a fantastic middleware platform for corporations. > > Well, if one cant get a hold of that, then the second option is to make use > of the documented c api libraries, and for that to feel safe i would prefer > it to be running as a port or a c node. That would of course come with the > cost of lower throughput. > > Would such a beast appeal to those in need of sql access? From yarivvv@REDACTED Tue Aug 1 14:21:54 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 1 Aug 2006 08:21:54 -0400 Subject: Simple DB Access In-Reply-To: <200608011344.46076.mikael.karlsson@creado.com> References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> <200608011344.46076.mikael.karlsson@creado.com> Message-ID: <17244f480608010521l13351592md2d02ae03e755544@mail.gmail.com> ejabberd actually has the ejabberd_odbc module, which nicely wraps the MySQL, Postgres and ODBC drivers in a single API (with connection pooling too IIRC). The ejabberd code is GPL'd though, so mixing it with non-GPL'd code can be problematic. (The developers may be willing to make a license exception for that module -- I'm waiting to hear back from them.) At any rate, I agree 100%. Erlang should have a generic API for relational database access with adapters for specific databases. Whether it's the ejabberd module or something else is less relevant :) Cheers Yariv On 8/1/06, Mikael Karlsson wrote: > I beleive there are some open source contributions that provide "direct" > access to mysql and postgresql databases for Erlang. > It would be nice if they could use the same api, something like jdbc for java > etc. If they already not are doing this? How about and "edbc" application? > > /Mikael > > Refs: > http://support.process-one.net/doc/display/CONTRIBS/Yxa > http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/pgsql/ > > tisdag 01 augusti 2006 00:28 skrev Christian S: > > On 7/31/06, Logan, Martin wrote: > > > I guess the question would be; who is interested and can dig up these > > > protocols. The only thing I do know for sure is that this type of tool > > > would go a long way to making Erlang enterprise integration a reality. > > > Erlang can be a fantastic middleware platform for corporations. > > > > Well, if one cant get a hold of that, then the second option is to make use > > of the documented c api libraries, and for that to feel safe i would prefer > > it to be running as a port or a c node. That would of course come with the > > cost of lower throughput. > > > > Would such a beast appeal to those in need of sql access? > > From yarivvv@REDACTED Tue Aug 1 14:21:54 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 1 Aug 2006 08:21:54 -0400 Subject: Simple DB Access In-Reply-To: <200608011344.46076.mikael.karlsson@creado.com> References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> <200608011344.46076.mikael.karlsson@creado.com> Message-ID: <17244f480608010521l13351592md2d02ae03e755544@mail.gmail.com> ejabberd actually has the ejabberd_odbc module, which nicely wraps the MySQL, Postgres and ODBC drivers in a single API (with connection pooling too IIRC). The ejabberd code is GPL'd though, so mixing it with non-GPL'd code can be problematic. (The developers may be willing to make a license exception for that module -- I'm waiting to hear back from them.) At any rate, I agree 100%. Erlang should have a generic API for relational database access with adapters for specific databases. Whether it's the ejabberd module or something else is less relevant :) Cheers Yariv On 8/1/06, Mikael Karlsson wrote: > I beleive there are some open source contributions that provide "direct" > access to mysql and postgresql databases for Erlang. > It would be nice if they could use the same api, something like jdbc for java > etc. If they already not are doing this? How about and "edbc" application? > > /Mikael > > Refs: > http://support.process-one.net/doc/display/CONTRIBS/Yxa > http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/pgsql/ > > tisdag 01 augusti 2006 00:28 skrev Christian S: > > On 7/31/06, Logan, Martin wrote: > > > I guess the question would be; who is interested and can dig up these > > > protocols. The only thing I do know for sure is that this type of tool > > > would go a long way to making Erlang enterprise integration a reality. > > > Erlang can be a fantastic middleware platform for corporations. > > > > Well, if one cant get a hold of that, then the second option is to make use > > of the documented c api libraries, and for that to feel safe i would prefer > > it to be running as a port or a c node. That would of course come with the > > cost of lower throughput. > > > > Would such a beast appeal to those in need of sql access? > > From ernie.makris@REDACTED Tue Aug 1 15:04:35 2006 From: ernie.makris@REDACTED (Ernie Makris) Date: Tue, 01 Aug 2006 09:04:35 -0400 Subject: pcre, bifs, drivers and ports In-Reply-To: <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE1FE9.9090104@comcast.net> <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> Message-ID: <44CF5163.7070204@comcast.net> Hi Sean, Is that one of the drawbacks to a bif implementation? Namely, the bif call stops the entire emulator? Even with the SMP version of the emulator? If this is the case, then I can definitely see why a driver based pcre should be preferable for a potentially long running regex computation. Thanks Ernie Sean Hinde wrote: > Hi Ernie, > > On 31 Jul 2006, at 16:21, Ernie Makris wrote: > >> Hi Sean >> >>> >>> If you add this feature by hacking the otp release and adding bifs you >>> would create all the long term issues of having a patched OTP release. >>> >> Thats ok, I already patch my releases in order to fix a linux to_erl >> bug, and to allow the file driver to open /dev/urandom. The only pain is >> verifying the patch on a new release. But I know the code well enough >> that I can do it by hand each time. > > Where I work we already have a quite heavily patched OTP release so I > know well the pain. For me the hassle of yet more patches would almost > certainly outweigh some small speed benefit.. > >>> You would unlikely to get adopters of any open source version you >>> released for much the same reason. >>> >> I would still put it out there, if anyone wanted to use it, they would >> be welcome. > > And I guess if they liked it enough they could add a driver option :-) > >>> OTOH it is not too hard to create a linked in driver that could >>> alternatively be compiled as a port program. That way you give users a >>> choice between speed of a driver (almost the same as a BIF), or fault >>> isolation. >>> >> I agree, but I also wanted to see how easy/difficult it would be to add >> a few new bifs. > > One more thing to think on - assuming that pcre itself is thread safe, > adding it as a driver would make multithreading quite straightforward. > Mats' comment about limiting length of REs does not really cut it IMO. > Blocking the whole emulator during a long regexp calculation rarely > sounds like the right solution for typical Erlang apps. > > But. It would be most fascinating to compare real world > characteristics of: > > 1. BIF pcre > 2. Driver pcre, > 3. BIF pcre in SMT erlang. > > Sean > > > > From ernie.makris@REDACTED Tue Aug 1 15:12:41 2006 From: ernie.makris@REDACTED (Ernie Makris) Date: Tue, 01 Aug 2006 09:12:41 -0400 Subject: pcre, bifs, drivers and ports In-Reply-To: References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE18F7.1020602@ericsson.com> <44CE1A2A.8040908@comcast.net> <44CE20BE.5070102@ericsson.com> Message-ID: <44CF5349.2090302@comcast.net> Hi Istvan, Thanks for posting. Where are the files on the page? Does one have to login to be able to download them? Thanks Ernie Istv?n V?radi wrote: > Hi, > > I have posted the code with some documentation into the User > Contributions area of TrapExit > (http://forum.trapexit.org/viewtopic.php?t=5906). > > Any comments/fixes/etc. are welcome. > > Istvan > From bjorn@REDACTED Tue Aug 1 15:26:34 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 01 Aug 2006 15:26:34 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CF5163.7070204@comcast.net> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE1FE9.9090104@comcast.net> <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> <44CF5163.7070204@comcast.net> Message-ID: Ernie Makris writes: > Hi Sean, > > Is that one of the drawbacks to a bif implementation? Namely, the bif > call stops the entire emulator? Even with the > SMP version of the emulator? No, other scheduler threads can still run, which makes the problem slightly less severe. Only slightly, because the other scheduler threads might also call long-running BIFs. (By default, there are as many scheduler threads as there are CPUs.) /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From ernie.makris@REDACTED Tue Aug 1 15:33:41 2006 From: ernie.makris@REDACTED (Ernie Makris) Date: Tue, 01 Aug 2006 09:33:41 -0400 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CF5349.2090302@comcast.net> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE18F7.1020602@ericsson.com> <44CE1A2A.8040908@comcast.net> <44CE20BE.5070102@ericsson.com> <44CF5349.2090302@comcast.net> Message-ID: <44CF5835.3070704@comcast.net> Hi, Replying to myself, one has to login to see the attachments:) Thanks Ernie Ernie Makris wrote: > Hi Istvan, > > Thanks for posting. Where are the files on the page? Does one have to > login to be able to download them? > > Thanks > Ernie > > Istv?n V?radi wrote: > >> Hi, >> >> I have posted the code with some documentation into the User >> Contributions area of TrapExit >> (http://forum.trapexit.org/viewtopic.php?t=5906). >> >> Any comments/fixes/etc. are welcome. >> >> Istvan >> >> > > From bjorn@REDACTED Tue Aug 1 15:43:13 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 01 Aug 2006 15:43:13 +0200 Subject: list comprehension compilation In-Reply-To: <44CD2896.10908@pandora.be> References: <44CD2896.10908@pandora.be> Message-ID: Thomas Raes writes: > Compiling code that contains list comprehensions with lots of variables > seems to take a long time on my system. > For example, compiling the following code takes more than 4 minutes: > > test() -> > > [[X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18,X19,X20] || > X1 <- [0],X2 <- [0],X3 <- [0],X4 <- [0],X5 <- [0],X6 <- [0],X7 > <- [0],X8 <- [0],X9 <- [0],X10 <- [0], > X11 <- [0],X12 <- [0],X13 <- [0],X14 <- [0],X15 <- [0],X16 <- > [0],X17 <- [0],X18 <- [0],X19 <- [0],X20 <- [0]]. Guess that you are first one to have use so many generators. I have now corrected the performance bug; the correction will be included in R11B-1. > However, when I enter this code at the erl-prompt, it evaluates immediately. The shell does not use the compiler for evaluating expressions. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From sean.hinde@REDACTED Tue Aug 1 15:51:31 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Tue, 1 Aug 2006 14:51:31 +0100 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CF5163.7070204@comcast.net> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE1FE9.9090104@comcast.net> <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> <44CF5163.7070204@comcast.net> Message-ID: <31EDD99A-BE65-4D2E-AFC1-71023165AD54@gmail.com> Hi Ernie, On 1 Aug 2006, at 14:04, Ernie Makris wrote: > Hi Sean, > > Is that one of the drawbacks to a bif implementation? Namely, the bif > call stops the entire emulator? Even with the > SMP version of the emulator? I'm not that familiar with the SMP version of the emulator.. yet.. but I would think that a blocking bif in one member of the SMP thread pool would only block that thread. Then it depends of other stuff like for example I understand that I/O uses one big lock in the current SMP implementaion. That is why I wrote it would be interesting to test :-) > If this is the case, then I can definitely see why a driver based pcre > should be preferable for a potentially long > running regex computation. I agree. Anytime the overhead of the driver call is small compared to the work to be done then there seems little point in trying to optimise away the overhead. Let's see if Mats' work ends up giving some nice results - if he is happy to share. Sean > > Thanks > Ernie > Sean Hinde wrote: >> Hi Ernie, >> >> On 31 Jul 2006, at 16:21, Ernie Makris wrote: >> >>> Hi Sean >>> >>>> >>>> If you add this feature by hacking the otp release and adding >>>> bifs you >>>> would create all the long term issues of having a patched OTP >>>> release. >>>> >>> Thats ok, I already patch my releases in order to fix a linux to_erl >>> bug, and to allow the file driver to open /dev/urandom. The only >>> pain is >>> verifying the patch on a new release. But I know the code well >>> enough >>> that I can do it by hand each time. >> >> Where I work we already have a quite heavily patched OTP release so I >> know well the pain. For me the hassle of yet more patches would >> almost >> certainly outweigh some small speed benefit.. >> >>>> You would unlikely to get adopters of any open source version you >>>> released for much the same reason. >>>> >>> I would still put it out there, if anyone wanted to use it, they >>> would >>> be welcome. >> >> And I guess if they liked it enough they could add a driver >> option :-) >> >>>> OTOH it is not too hard to create a linked in driver that could >>>> alternatively be compiled as a port program. That way you give >>>> users a >>>> choice between speed of a driver (almost the same as a BIF), or >>>> fault >>>> isolation. >>>> >>> I agree, but I also wanted to see how easy/difficult it would be >>> to add >>> a few new bifs. >> >> One more thing to think on - assuming that pcre itself is thread >> safe, >> adding it as a driver would make multithreading quite >> straightforward. >> Mats' comment about limiting length of REs does not really cut it >> IMO. >> Blocking the whole emulator during a long regexp calculation rarely >> sounds like the right solution for typical Erlang apps. >> >> But. It would be most fascinating to compare real world >> characteristics of: >> >> 1. BIF pcre >> 2. Driver pcre, >> 3. BIF pcre in SMT erlang. >> >> Sean >> >> >> >> From mats.cronqvist@REDACTED Tue Aug 1 16:27:03 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Tue, 01 Aug 2006 16:27:03 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <31EDD99A-BE65-4D2E-AFC1-71023165AD54@gmail.com> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE1FE9.9090104@comcast.net> <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> <44CF5163.7070204@comcast.net> <31EDD99A-BE65-4D2E-AFC1-71023165AD54@gmail.com> Message-ID: <44CF64B7.6060605@ericsson.com> Sean Hinde wrote: > Hi Ernie, > > On 1 Aug 2006, at 14:04, Ernie Makris wrote: > [...] >> If this is the case, then I can definitely see why a driver based pcre >> should be preferable for a potentially long >> running regex computation. seems to me that if regexps are allowed to be of unlimited size, and the regexp implementation is unable to yield, a bif is a bad choice. for our immediate problem, it is ok to limit the size of the regexp. > I agree. Anytime the overhead of the driver call is small compared to > the work to be done then there seems little point in trying to optimise > away the overhead. Let's see if Mats' work ends up giving some nice > results - if he is happy to share. wise words from sean. we will try a driver version and compare. happiness is probably beyond us without the aid of prescription medicine, but we will share the results. mats From danie@REDACTED Tue Aug 1 16:42:11 2006 From: danie@REDACTED (Danie Schutte) Date: Tue, 1 Aug 2006 16:42:11 +0200 Subject: Reading password from console Message-ID: <200608011642.11167.danie@erlfinsys.net> Hi all, is there an easy way of reading a password from console with the asterisk display :) Though it was in fread - but was mistaken Thanks -- Erlang Financial Systems (Pty) Ltd Mobile: +27 84 468 3138 Phone : +11 235 6500 ext 6801 Fax : +11 235 6690 From robert.virding@REDACTED Wed Aug 2 01:53:07 2006 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 02 Aug 2006 01:53:07 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CE18F7.1020602@ericsson.com> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE18F7.1020602@ericsson.com> Message-ID: <44CFE963.8080107@telia.com> That's interesting. During the summer I have been working on my Erlog (Prolog in and for Erlang) interpreter. Instead of writing the tokeniser by hand I use leex. Unfortunately you can't write the parser in yacc. Now I intend to make leex fit for human consumption, the generated scanner is fine but I need to clean up the code, and I was thinking that it would not be difficult to add a compiler to regexp to make it faster. either by gernerating a DFA which you interpret or a function which is compiled. I personally don't think that a bif is the way to go. A bif tends to imply something which is part of the language, not just a "normal" library function. This quite apart from the problems of bifs maybe blocking the emulator. A port would be much cleaner. A final point is that grep is not really a good name for the function. It is said to mean "global regular expression print", and you are not printing just trying to find a match. I hope. :-) Robert Mats Cronqvist wrote: > Ernie Makris wrote: > >> Hello Erlangers, >> >> One thing I wanted to start a discussion on is getting pcre style >> regexps in erlang. The question >> I pose to the list is: What would be the best way to integrate the pcre >> library into erlang. >> The possible approaches I've seen so far are: >> - create a linked in driver >> - create a port program >> - create new bifs (I'd really like this) > > > a bif is the way to go, imo. > >> My obvious concerns are: >> - How stable is the C pcre library for long running servers >> - Stability implies: >> - Memory leaks >> - SIGSEGVs >> >> I would love the library calls in erlang to be bifs. Are there any >> external examples, aside from just looking at the source that >> demonstrate how to cleanly add a new bif? > > > two weeks ago me and a colleague implemented two new bifs; re:grep/2 > and re:compile/1. > > documentation is a bit scarce; > > re:compile([RegExp]) -> [RegExpC] > re:grep(Str,[RegExp]) -> [MatchItem] > RegExp = string() > RegExpC = term() > MatchItem = no_match | {int(Beg),int(End),[string(SubMatch)]} | > {error,{string(ErrorStr),int(ErrorChar)}} > > we have not yet observed any problems with stability. > > OTP has indicated that they will not introduce any bif that does not > execute in bound time, or yields. i believe this can be met by limiting > the length of the string and the regexp. > > if there is interest, we can probably make the code available. > > mats > From robert.virding@REDACTED Wed Aug 2 01:54:38 2006 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 02 Aug 2006 01:54:38 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <200607312000.k6VK0tKA087753@snookles.snookles.com> References: <200607312000.k6VK0tKA087753@snookles.snookles.com> Message-ID: <44CFE9BE.9030803@telia.com> If you write it in Erlang then this is not that difficult to do. Robert Scott Lystig Fritchie wrote: >>>>>>"sh" == Sean Hinde writes: > > > sh> Mats' comment about limiting length of REs does > sh> not really cut it IMO. Blocking the whole emulator during a long > sh> regexp calculation rarely sounds like the right solution for > sh> typical Erlang apps. > > One more thing to consider. A *really* useful regexp library (or > any library that deals with strings) would be one that worked on: > > 1. lists of byte values (the traditional Erlang "string") > 2. single binary terms > 3. "I/O lists", an arbitrarily deep list of #1 and/or #2. > (Or #2 alone :-) > > I would guess that that would come at a high cost implementaion, since > most C/C++ regexp packages operate on buffers of contiguous bytes, not > a string of bytes located in perhaps thousands of non-contiguous > places. > > Oops, I forgot one: > > 4. A possibly UNICODE/whatever internationalized "string" thingie > stored in an I/O list. > > As discussed on this list a few weeks ago, there is no agreement on > how to represent such a thing ... in Erlang or most other languages. > > sh> But. It would be most fascinating to compare real world > sh> characteristics of: > sh> 1. BIF pcre 2. Driver pcre, 3. BIF pcre in SMT erlang. > > Yup. > > A linked-in driver can cheat even more if it can get a (internal C) > pointer to the term(s) it's operating on. It's quite easy to create a > new BIF that returns the internal pointer/address of its argument and > return it as an integer.(*) Turning that integer into a pointer, the > driver has full access to the term. Use the power only for good. :-) > > -Scott > > (*) It is a good, simple experiment if you've never tried writing a > BIF before. > From jay@REDACTED Wed Aug 2 03:35:32 2006 From: jay@REDACTED (Jay Nelson) Date: Tue, 01 Aug 2006 18:35:32 -0700 Subject: pcre, bifs, drivers and ports Message-ID: <44D00164.8090609@duomark.com> For an example of a new set of BIFs, see my paper for ICFP 2005 entitled "A Stream Library Using Erlang Binaries". The pdf, briefing and the code are available at http://www.duomark.com/erlang/index.html. jay From bjorn@REDACTED Wed Aug 2 09:51:00 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 02 Aug 2006 09:51:00 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CF64B7.6060605@ericsson.com> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE1FE9.9090104@comcast.net> <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> <44CF5163.7070204@comcast.net> <31EDD99A-BE65-4D2E-AFC1-71023165AD54@gmail.com> <44CF64B7.6060605@ericsson.com> Message-ID: Mats Cronqvist writes: > for our immediate problem, it is ok to limit the size of the regexp. > If you by size means the length of the regexp string, this is a very poor measure of how fast or slow the regexp matching will be. For instance, a long literal string is quite fast to match. An regexp that uses the star (closure) operator, and especially multiple star operators *can* be very slow. It depends on what the rest of the regexp looks like and how clever the regexp engine is. An heuristic that might work would be to disallow regexps with more than one closure operator. Or to only allow more than one star operator if the string is reasonably short. (Note that regexps are quity tricky to parse, as stars can be escaped or within character classes; thus, counting the number of stars in the regexp string is not enough.) /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From andreas@REDACTED Wed Aug 2 10:19:37 2006 From: andreas@REDACTED (andreas) Date: Wed, 02 Aug 2006 09:19:37 +0100 Subject: pcre, bifs, drivers and ports References: Message-ID: <20060802081937.BEBB65A1F0@mail.erlangsystems.com> Thank you for pointing this out. I have fixed so you do not have to be loged in. Regards, Andreas Hillqvist emakris wrote: Hi Istvan, Thanks for posting. Where are the files on the page? Does one have to login to be able to download them? Thanks Ernie (end of quote) _________________________________________________________ Post sent from http://www.trapexit.org From mats.cronqvist@REDACTED Wed Aug 2 11:53:49 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Wed, 02 Aug 2006 11:53:49 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE1FE9.9090104@comcast.net> <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> <44CF5163.7070204@comcast.net> <31EDD99A-BE65-4D2E-AFC1-71023165AD54@gmail.com> <44CF64B7.6060605@ericsson.com> Message-ID: <44D0762D.7020907@ericsson.com> Bjorn Gustavsson wrote: > Mats Cronqvist writes: > >> for our immediate problem, it is ok to limit the size of the regexp. >> > If you by size means the length of the regexp string, this is a very > poor measure of how fast or slow the regexp matching will be. this is true. but as far as i understand (from googling) the time is bounded by k*M*N, where M is the length of the string and N is the length of the regexp. so by limiting M and N you can guarantee that the regexp computation will never take more than so and so many cycles. i'm guessing that even very conservative values of M and N will be large enough to be useful. note that i'm perfectly willing to accept that a driver is a better solution than a bif. i'm just not (yet) convinced by the arguments against the bif solution. mats p.s. why do i even care in the first place? i invented the totally arbitrary benchmark of finding the first word that starts with "con" in Virdings mail of 2 Aug 2006 01:53:06 (first 1,000 bytes). re is the bif, gregexp is erlang code from from jungerl, regexp is from OTP. summary; the bif is ~100 times faster that regexp, and ~20 times faster than gregexp. > [REre] = re:compile(["(con[a-z]+)"]) > timer:tc(re,grep,[Str,[REre]]). {28,[{253,264,["consumption"]}]} > {ok,REgr} = gregexp:parse(".*\\(con[a-z]+\\)"). > timer:tc(gregexp,groups,[Str,REgr]). {768,{match,["consumption"]}} > {ok,REr} = regexp:parse("con[a-z]+"). > timer:tc(regexp,match,[Str,REr]). {3255,{match,254,11}} > timer:tc(string,substr,[Str,254,11]). {13,"consumption"} From mickael.remond@REDACTED Wed Aug 2 14:52:00 2006 From: mickael.remond@REDACTED (Mickael Remond) Date: 02 Aug 2006 14:52:00 +0200 Subject: Simple DB Access Message-ID: <3237375149.23305165@smtp.fusemail.net> Hello, we are planning to double licence the ejabberd odbc module and improve the abstraction mechanism. Christophe Romain, a coworker, has some nice idea on improving the database API. We are working with some other coworkers on something that might be a good basis for an "edbc" layer (erlang counter part for jdbc). If other developers are interested we can set up a common svn repository when I get back from holidays. cheers, -- Mickael Remond http://www.process-one.net/ From yarivvv@REDACTED Wed Aug 2 14:57:31 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 2 Aug 2006 08:57:31 -0400 Subject: Simple DB Access In-Reply-To: <3237375149.23305165@smtp.fusemail.net> References: <3237375149.23305165@smtp.fusemail.net> Message-ID: <17244f480608020557s660c4fa2y779ec4fbfa97a6ff@mail.gmail.com> Hi Mickael, This is great news! I would be very interested in getting svn access to the API. Yariv On 02 Aug 2006 14:52:00 +0200, Mickael Remond wrote: > Hello, > > we are planning to double licence the ejabberd odbc module and improve the abstraction mechanism. > Christophe Romain, a coworker, has some nice idea on improving the database API. We are working with some other coworkers on something that might be a good basis for an "edbc" layer (erlang counter part for jdbc). > > If other developers are interested we can set up a common svn repository when I get back from holidays. > > cheers, > > -- > Mickael Remond > http://www.process-one.net/ > > From luke@REDACTED Wed Aug 2 15:23:40 2006 From: luke@REDACTED (Luke Gorrie) Date: Wed, 02 Aug 2006 15:23:40 +0200 Subject: pcre, bifs, drivers and ports References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE1FE9.9090104@comcast.net> <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> <44CF5163.7070204@comcast.net> <31EDD99A-BE65-4D2E-AFC1-71023165AD54@gmail.com> <44CF64B7.6060605@ericsson.com> Message-ID: Bjorn Gustavsson writes: > For instance, a long literal string is quite fast to match. An regexp > that uses the star (closure) operator, and especially multiple star > operators *can* be very slow. It depends on what the rest of the regexp > looks like and how clever the regexp engine is. Yes. Extreme example: 2> regexp:match("foo", "f**"). Crash dump was written to: erl_crash.dump eheap_alloc: Cannot allocate 1781763260 bytes of memory (of type "heap"). Aborted .. death while trying to find the longest match with zero-or-more nothings. I've often wondered if there's a simple fix for this that doesn't take away the cute simplicity of the regexp matcher. From mats.cronqvist@REDACTED Wed Aug 2 16:07:15 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Wed, 02 Aug 2006 16:07:15 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE1FE9.9090104@comcast.net> <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> <44CF5163.7070204@comcast.net> <31EDD99A-BE65-4D2E-AFC1-71023165AD54@gmail.com> <44CF64B7.6060605@ericsson.com> Message-ID: <44D0B193.3030406@ericsson.com> Luke Gorrie wrote: > Bjorn Gustavsson writes: > >> For instance, a long literal string is quite fast to match. An regexp >> that uses the star (closure) operator, and especially multiple star >> operators *can* be very slow. It depends on what the rest of the regexp >> looks like and how clever the regexp engine is. > > Yes. Extreme example: > > 2> regexp:match("foo", "f**"). > > Crash dump was written to: erl_crash.dump > eheap_alloc: Cannot allocate 1781763260 bytes of memory (of type "heap"). > Aborted > > .. death while trying to find the longest match with zero-or-more nothings. > > I've often wondered if there's a simple fix for this that doesn't take > away the cute simplicity of the regexp matcher. pcre deals with that like this; 1> re:grep("foo",["f**"]). [{error,{"nothing to repeat",2}}] mats From Martin.Logan@REDACTED Wed Aug 2 16:27:43 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Wed, 2 Aug 2006 09:27:43 -0500 Subject: Simple DB Access In-Reply-To: <3237375149.23305165@smtp.fusemail.net> Message-ID: <9CB79C836F98504C81BF082C4291E987792A47@CHITDSEXC02.tds.corp.cendant.org> Is there a place where an interested user can check the progress of the tool? Martin -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Mickael Remond Sent: Wednesday, August 02, 2006 7:52 AM To: yarivvv@REDACTED Cc: mikael.karlsson@REDACTED; chsu79@REDACTED; Logan, Martin; erlang-questions@REDACTED Subject: Re: Simple DB Access Hello, we are planning to double licence the ejabberd odbc module and improve the abstraction mechanism. Christophe Romain, a coworker, has some nice idea on improving the database API. We are working with some other coworkers on something that might be a good basis for an "edbc" layer (erlang counter part for jdbc). If other developers are interested we can set up a common svn repository when I get back from holidays. cheers, -- Mickael Remond http://www.process-one.net/ From christophe.romain@REDACTED Wed Aug 2 17:28:47 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Wed, 2 Aug 2006 17:28:47 +0200 Subject: Simple DB Access In-Reply-To: <9CB79C836F98504C81BF082C4291E987792A47@CHITDSEXC02.tds.corp.cendant.org> References: <9CB79C836F98504C81BF082C4291E987792A47@CHITDSEXC02.tds.corp.cendant.org> Message-ID: > Is there a place where an interested user can check the progress of the > tool? not yet i'll let the list know when something will be online. From walter.blanchard@REDACTED Wed Aug 2 17:33:23 2006 From: walter.blanchard@REDACTED (BLANCHARD Walter ORANGE-FT) Date: Wed, 2 Aug 2006 17:33:23 +0200 Subject: erland editor Message-ID: hi everyone! I'd like to know if there's an editor/ compiler for erlang. I know emacs is here, and that eclipse gets its erlide, but i'm looking for a really dedicated one. Thank you ******************************** Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite. Tout message electronique est susceptible d'alteration. Le Groupe France Telecom decline toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. Si vous n'etes pas destinataire de ce message, merci de le detruire immediatement et d'avertir l'expediteur. ********************************* This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. Messages are susceptible to alteration. France Telecom Group shall not be liable for the message if altered, changed or falsified. If you are not the intended addressee of this message, please cancel it immediately and inform the sender. ******************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From nils.muellner@REDACTED Wed Aug 2 18:52:32 2006 From: nils.muellner@REDACTED (=?ISO-8859-1?Q?Nils_M=FCllner?=) Date: Wed, 02 Aug 2006 18:52:32 +0200 Subject: erland editor In-Reply-To: References: Message-ID: <44D0D850.1020908@heh.uni-oldenburg.de> hi, if you are used to eclipse you might wanna give erlide a try.its a plugin for eclipse with syntax highlighting. afaik no code completion. kind regards nils BLANCHARD Walter ORANGE-FT schrieb: > > hi everyone! > > I'd like to know if there's an editor/ compiler for erlang. I know > emacs is here, and that eclipse > gets its erlide, but i'm looking for a really dedicated one. > > Thank you > > > ******************************** > Ce message et toutes les pieces jointes (ci-apres le "message") sont > confidentiels et etablis a l'intention exclusive de > ses destinataires. > Toute utilisation ou diffusion non autorisee est interdite. > Tout message electronique est susceptible d'alteration. Le Groupe > France Telecom decline toute responsabilite au titre de > ce message s'il a ete altere, deforme ou falsifie. > Si vous n'etes pas destinataire de ce message, merci de le detruire > immediatement et d'avertir l'expediteur. > ********************************* > This message and any attachments (the "message") are confidential and > intended solely for the addressees. Any unauthorised > use or dissemination is prohibited. > Messages are susceptible to alteration. France Telecom Group shall not > be liable for the message if altered, changed or > falsified. > If you are not the intended addressee of this message, please cancel > it immediately and inform the sender. > ******************************** > From ryanobjc@REDACTED Wed Aug 2 20:25:14 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Wed, 2 Aug 2006 11:25:14 -0700 Subject: erland editor In-Reply-To: <44D0D850.1020908@heh.uni-oldenburg.de> References: <44D0D850.1020908@heh.uni-oldenburg.de> Message-ID: <78568af10608021125v672ab658qc9f05f01d1d5de42@mail.gmail.com> Erlang is the dedicated editor. It has good integration. I assume perhaps you want an editor written in Erlang? There is a elisp extension that turns your emacs into an Erlang node. You can write elisp which sends/recieves/interacts with a running Erlang system. I used to use Eclipse, but it is really not good for anything but Java, and after going back to emacs, I love the speed of emacs vs Eclipse. One feels bloated and the other is lean and mean. -ryan On 8/2/06, Nils M?llner wrote: > hi, > if you are used to eclipse you might wanna give erlide a try.its a > plugin for eclipse with syntax highlighting. afaik no code completion. > kind regards > nils > > BLANCHARD Walter ORANGE-FT schrieb: > > > > hi everyone! > > > > I'd like to know if there's an editor/ compiler for erlang. I know > > emacs is here, and that eclipse > > gets its erlide, but i'm looking for a really dedicated one. > > > > Thank you > > > > > > ******************************** > > Ce message et toutes les pieces jointes (ci-apres le "message") sont > > confidentiels et etablis a l'intention exclusive de > > ses destinataires. > > Toute utilisation ou diffusion non autorisee est interdite. > > Tout message electronique est susceptible d'alteration. Le Groupe > > France Telecom decline toute responsabilite au titre de > > ce message s'il a ete altere, deforme ou falsifie. > > Si vous n'etes pas destinataire de ce message, merci de le detruire > > immediatement et d'avertir l'expediteur. > > ********************************* > > This message and any attachments (the "message") are confidential and > > intended solely for the addressees. Any unauthorised > > use or dissemination is prohibited. > > Messages are susceptible to alteration. France Telecom Group shall not > > be liable for the message if altered, changed or > > falsified. > > If you are not the intended addressee of this message, please cancel > > it immediately and inform the sender. > > ******************************** > > > > From vladdu55@REDACTED Wed Aug 2 20:35:08 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 2 Aug 2006 19:35:08 +0100 Subject: erland editor In-Reply-To: <44D0D850.1020908@heh.uni-oldenburg.de> References: <44D0D850.1020908@heh.uni-oldenburg.de> Message-ID: <95be1d3b0608021135g28ec6812m668c11d027698e53@mail.gmail.com> Hi, Erlide has code completions and much more. AFAIK, erlide and emacs are the more complete IDEs. There are modes for vim and I think for SciTe too. What would you require from a "really dedicated editor"? best regards, Vlad On 8/2/06, Nils M?llner wrote: > hi, > if you are used to eclipse you might wanna give erlide a try.its a > plugin for eclipse with syntax highlighting. afaik no code completion. > kind regards > nils > > BLANCHARD Walter ORANGE-FT schrieb: > > > > hi everyone! > > > > I'd like to know if there's an editor/ compiler for erlang. I know > > emacs is here, and that eclipse > > gets its erlide, but i'm looking for a really dedicated one. > > > > Thank you > > From tobbe@REDACTED Wed Aug 2 21:23:59 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Wed, 02 Aug 2006 21:23:59 +0200 Subject: erland editor In-Reply-To: References: Message-ID: BLANCHARD Walter ORANGE-FT wrote: > > hi everyone! > > I'd like to know if there's an editor/ compiler for erlang. I know emacs > is here, and that eclipse > gets its erlide, but i'm looking for a really dedicated one. If you want an editor that is written in Erlang then you have 'ermacs' in jungerl. It works pretty neat together with the Erlang ssh-server (ssh into an Erlang shell, invoke ermacs, edit, compile, etc...). Otherwise, I recommend Emacs + distel (jungerl). --Tobbe > > Thank you > > > ******************************** > Ce message et toutes les pieces jointes (ci-apres le "message") sont > confidentiels et etablis a l'intention exclusive de > ses destinataires. > Toute utilisation ou diffusion non autorisee est interdite. > Tout message electronique est susceptible d'alteration. Le Groupe France > Telecom decline toute responsabilite au titre de > ce message s'il a ete altere, deforme ou falsifie. > Si vous n'etes pas destinataire de ce message, merci de le detruire > immediatement et d'avertir l'expediteur. > ********************************* > This message and any attachments (the "message") are confidential and > intended solely for the addressees. Any unauthorised > use or dissemination is prohibited. > Messages are susceptible to alteration. France Telecom Group shall not > be liable for the message if altered, changed or > falsified. > If you are not the intended addressee of this message, please cancel it > immediately and inform the sender. > ******************************** > From Martin.Logan@REDACTED Wed Aug 2 22:00:59 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Wed, 2 Aug 2006 15:00:59 -0500 Subject: Simple DB Access In-Reply-To: Message-ID: <9CB79C836F98504C81BF082C4291E987792A4E@CHITDSEXC02.tds.corp.cendant.org> -----Original Message----- From: Christophe Romain [mailto:christophe.romain@REDACTED] Sent: Wednesday, August 02, 2006 10:29 AM To: Logan, Martin Cc: yarivvv@REDACTED; mikael.karlsson@REDACTED; Mickael Remond; chsu79@REDACTED; erlang-questions@REDACTED Subject: Re: Simple DB Access > Is there a place where an interested user can check the progress of the > tool? not yet i'll let the list know when something will be online. Yes, please do. Try to make it as brain dead as possible... hmmm that did not come out right, what I mean is the interface should be useable by a monkey! Martin From sean.hinde@REDACTED Wed Aug 2 22:17:43 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Wed, 2 Aug 2006 21:17:43 +0100 Subject: erland editor In-Reply-To: References: Message-ID: On 2 Aug 2006, at 20:23, Torbjorn Tornkvist wrote: > BLANCHARD Walter ORANGE-FT wrote: >> hi everyone! >> I'd like to know if there's an editor/ compiler for erlang. I know >> emacs is here, and that eclipse >> gets its erlide, but i'm looking for a really dedicated one. > > If you want an editor that is written in Erlang then you > have 'ermacs' in jungerl. It works pretty neat together > with the Erlang ssh-server (ssh into an Erlang shell, > invoke ermacs, edit, compile, etc...). > > Otherwise, I recommend Emacs + distel (jungerl). Absolutely agree. I would also recommend distel. It was written by one of the main hackers of the SLIME mode for lisp - widely regarded as the best emacs language mode. One very neat trick is to hot load your newly compiled module into the target test system with a quick Emacs keystroke. It also supports interactive debugging in the target system, code completion etc etc. Almost worth learning how to use Emacs for :-) Sean > > --Tobbe > >> Thank you >> ******************************** >> Ce message et toutes les pieces jointes (ci-apres le "message") >> sont confidentiels et etablis a l'intention exclusive de >> ses destinataires. >> Toute utilisation ou diffusion non autorisee est interdite. >> Tout message electronique est susceptible d'alteration. Le Groupe >> France Telecom decline toute responsabilite au titre de >> ce message s'il a ete altere, deforme ou falsifie. >> Si vous n'etes pas destinataire de ce message, merci de le >> detruire immediatement et d'avertir l'expediteur. >> ********************************* >> This message and any attachments (the "message") are confidential >> and intended solely for the addressees. Any unauthorised >> use or dissemination is prohibited. >> Messages are susceptible to alteration. France Telecom Group shall >> not be liable for the message if altered, changed or >> falsified. >> If you are not the intended addressee of this message, please >> cancel it immediately and inform the sender. >> ******************************** > From chsu79@REDACTED Wed Aug 2 22:41:50 2006 From: chsu79@REDACTED (Christian S) Date: Wed, 2 Aug 2006 22:41:50 +0200 Subject: Simple DB Access In-Reply-To: <200608011344.46076.mikael.karlsson@creado.com> References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> <200608011344.46076.mikael.karlsson@creado.com> Message-ID: On 8/1/06, Mikael Karlsson wrote: > I beleive there are some open source contributions that provide "direct" > access to mysql and postgresql databases for Erlang. > It would be nice if they could use the same api, something like jdbc for java > etc. If they already not are doing this? How about and "edbc" application? > > /Mikael > > Refs: > http://support.process-one.net/doc/display/CONTRIBS/Yxa > http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/pgsql/ > > It is somewhat tricky to coerce them into the same api. I was all set to do it and a number of reasons made me unable to continue the work, small ones like having my computer break, getting a fulltime job, but mostly learning more about mnesia to solve things i only knew how to do in sql previously. Also, I'm lazy. One thing I learned from jdbc is that you will be bound to the database of choice (through things such as vendor specific features and database-side extension functions) even though you have a database agnostic db interface. My conclusion, which seems to be close to other ones later in the thread is that some kind of "edbc" (name as you suggested) application is made, have it provide a few operations (least common denominator) via all the different sql databases it knows of. One might want to implement the sql92 syntax and a unified parametric-name syntax for prepared statements, just to allow for prepared statements with every db. SQL-injections are bad and we dont want people to resort to primitively appending strings together. Such security vulnerability WILL give erlang a bad rep, however innocent it is. That would still allow me, and others interested, to hit the metal on pgsql and use NOTIFY/LISTEN, for example. But simple apps without any specific database requirement other than sql would work with whatever edbc supports. PS A question. Is there any way to have multiple gen_servers under the same name, and same node, and have the first one no busy serve my gen_server:call ? If there is I find very little reason to support connection pooling. I'd rather pool gen_servers that implement the application's operations. From vladdu55@REDACTED Wed Aug 2 23:08:48 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 2 Aug 2006 22:08:48 +0100 Subject: erland editor In-Reply-To: References: Message-ID: <95be1d3b0608021408s7c63affdra0e71d82279aeb70@mail.gmail.com> No IDE war here, I also like emacs very much (and esense is also a very good contribution to it), but... ;-) On 8/2/06, Sean Hinde wrote: > One very neat trick is to hot load your newly compiled module into > the target test system with a quick Emacs keystroke. ... Erlide offers the same trick without any keystroke :-) Of course, erlide is much less mature, but it's catching up. regards, Vlad From Martin.Logan@REDACTED Wed Aug 2 23:46:25 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Wed, 2 Aug 2006 16:46:25 -0500 Subject: Simple DB Access In-Reply-To: Message-ID: <9CB79C836F98504C81BF082C4291E987792A4F@CHITDSEXC02.tds.corp.cendant.org> One thing I learned from jdbc is that you will be bound to the database of choice (through things such as vendor specific features and database-side extension functions) even though you have a database agnostic db interface. My conclusion, which seems to be close to other ones later in the thread is that some kind of "edbc" (name as you suggested) application is made, have it provide a few operations (least common denominator) via all the different sql databases it knows of. One might want to implement the sql92 syntax and a unified parametric-name syntax for prepared statements, just to allow for prepared statements with every db. SQL-injections are bad and we dont want people to resort to primitively appending strings together. Such security vulnerability WILL give erlang a bad rep, however innocent it is. ----------------------------------------------------------- I don't think that we need to innovate here; in fact I think innovation could be risky and I can't imagine it will buy us a lot over what is already out there ala php/pear, ruby, perl, java, etc... It would be really nice if the simplest of the popular interfaces was just copied in erlang. Cheers, Martin From ryanobjc@REDACTED Wed Aug 2 23:51:34 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Wed, 2 Aug 2006 14:51:34 -0700 Subject: Simple DB Access In-Reply-To: References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> <200608011344.46076.mikael.karlsson@creado.com> Message-ID: <78568af10608021451w16b56a51s149433df4cff297@mail.gmail.com> Being a long time developer on Oracle I now don't understand this 'prepare' concept. Every single SQL statement that takes in user input should use bind variables. If this makes you have to prepare statements, then so be it (our oracle API doesnt require prepares, but forces us to use binds). With binds you don't have SQL injection holes. It's as simple as that. Say no to constructed SQL. -ryan On 8/2/06, Christian S wrote: > On 8/1/06, Mikael Karlsson wrote: > > I beleive there are some open source contributions that provide "direct" > > access to mysql and postgresql databases for Erlang. > > It would be nice if they could use the same api, something like jdbc for java > > etc. If they already not are doing this? How about and "edbc" application? > > > > /Mikael > > > > Refs: > > http://support.process-one.net/doc/display/CONTRIBS/Yxa > > http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/pgsql/ > > > > > > It is somewhat tricky to coerce them into the same api. I was all set > to do it and a number of reasons made me unable to continue the work, > small ones like having my computer break, getting a fulltime job, but > mostly learning more about mnesia to solve things i only knew how to > do in sql previously. Also, I'm lazy. > > One thing I learned from jdbc is that you will be bound to the > database of choice > (through things such as vendor specific features and database-side > extension functions) even though you have a database agnostic db > interface. > > My conclusion, which seems to be close to other ones later in the > thread is that some kind of "edbc" (name as you suggested) application > is made, have it provide a few operations (least common denominator) > via all the different sql databases it knows of. One might want to > implement the sql92 syntax and a unified parametric-name syntax for > prepared statements, just to allow for prepared statements with every > db. SQL-injections are bad and we dont want people to resort to > primitively appending strings together. Such security vulnerability > WILL give erlang a bad rep, however innocent it is. > > That would still allow me, and others interested, to hit the metal on > pgsql and use NOTIFY/LISTEN, for example. But simple apps without any > specific database requirement other than sql would work with whatever > edbc supports. > > PS > A question. Is there any way to have multiple gen_servers under the > same name, and same node, and have the first one no busy serve my > gen_server:call ? If there is I find very little reason to support > connection pooling. I'd rather pool gen_servers that implement the > application's operations. > From ok@REDACTED Thu Aug 3 01:07:44 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 3 Aug 2006 11:07:44 +1200 (NZST) Subject: pcre, bifs, drivers and ports Message-ID: <200608022307.k72N7iEg082390@atlas.otago.ac.nz> Mats Cronqvist wrote: but as far as i understand (from googling) the time is bounded by k*M*N, where M is the length of the string and N is the length of the regexp. so by Is this so? Matching a string against a finite state automaton is linear, but I thought turning a regular expression into a finite state automaton is exponential. Certainly the classic RE -> NFA -> FA method is exponential. From mats.cronqvist@REDACTED Thu Aug 3 10:47:05 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Thu, 03 Aug 2006 10:47:05 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <200608022307.k72N7iEg082390@atlas.otago.ac.nz> References: <200608022307.k72N7iEg082390@atlas.otago.ac.nz> Message-ID: <44D1B809.70306@ericsson.com> Richard A. O'Keefe wrote: > Mats Cronqvist wrote: > but as far as i understand (from googling) the time is bounded by k*M*N, > where M is the length of the string and N is the length of the regexp. so by > > Is this so? Matching a string against a finite state automaton > is linear, but I thought turning a regular expression into a finite state > automaton is exponential. Certainly the classic RE -> NFA -> FA method > is exponential. if it's on the internet, it must be true :> http://perl.plover.com/NPC mats From bjorn@REDACTED Thu Aug 3 11:39:14 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 03 Aug 2006 11:39:14 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <44D1B809.70306@ericsson.com> References: <200608022307.k72N7iEg082390@atlas.otago.ac.nz> <44D1B809.70306@ericsson.com> Message-ID: Not all regexps (especially in Perl) can be converted to a FA. In fact, the second paragraph of the web page gives an example of such a regexp. Also, a FA can be difficult/impossible to use if you need to know exactly what part of the string matched, for instance if you need to replace the matched string with something else. Therefore, good regexp libraries use an FA if it's possible, otherwise they fall back other methods (which for some regular expressions can be very slow). So if you could be sure that a given regexp would be converted to a FA, your heuristic would work. /Bjorn Mats Cronqvist writes: > Richard A. O'Keefe wrote: > > Mats Cronqvist wrote: > > but as far as i understand (from googling) the time is > > bounded by k*M*N, where M is the length of the string and N is > > the length of the regexp. so by Is this so? Matching a string > > against a finite state automaton > > is linear, but I thought turning a regular expression into a finite state > > automaton is exponential. Certainly the classic RE -> NFA -> FA method > > is exponential. > > if it's on the internet, it must be true :> > > http://perl.plover.com/NPC > > mats > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From robert.virding@REDACTED Thu Aug 3 13:11:57 2006 From: robert.virding@REDACTED (Robert Virding) Date: Thu, 03 Aug 2006 13:11:57 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <44D0B193.3030406@ericsson.com> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE1FE9.9090104@comcast.net> <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> <44CF5163.7070204@comcast.net> <31EDD99A-BE65-4D2E-AFC1-71023165AD54@gmail.com> <44CF64B7.6060605@ericsson.com> <44D0B193.3030406@ericsson.com> Message-ID: <44D1D9FD.1000106@telia.com> Mats Cronqvist wrote: > Luke Gorrie wrote: >> 2> regexp:match("foo", "f**"). >> >> Crash dump was written to: erl_crash.dump >> eheap_alloc: Cannot allocate 1781763260 bytes of memory (of type >> "heap"). >> Aborted >> >> .. death while trying to find the longest match with zero-or-more >> nothings. >> >> I've often wondered if there's a simple fix for this that doesn't take >> away the cute simplicity of the regexp matcher. > > pcre deals with that like this; > > 1> re:grep("foo",["f**"]). > [{error,{"nothing to repeat",2}}] While the handling of "f**" in regexp is definitely a bug, which I suppose I should fix, it is definitely a legal regular expression. So that pcre will not even allow the regular expression is also a bug, the question is if it is the parsing of the expression or where? If you are as "cautious" as people working with cryptography you would start wondering if this is sign of a deeper malaise. :-) As the great Cato said: I still feel that calling the function grep is misleading. Could someone send a real problem to experiment on? Especially one which the current regexp module is definitely too slow on. Robert From mats.cronqvist@REDACTED Thu Aug 3 15:48:26 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Thu, 03 Aug 2006 15:48:26 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: References: <200608022307.k72N7iEg082390@atlas.otago.ac.nz> <44D1B809.70306@ericsson.com> Message-ID: <44D1FEAA.1000902@ericsson.com> Bjorn Gustavsson wrote: > So if you could be sure that a given regexp would be converted > to a FA, your heuristic would work. i guess backreferences would have to be dropped. otoh, even if time IS exponential in the length of the string to be matched, limiting the length of the string would bound the time. btw, running the "killer regexp" on my 1.6 Mb test string only took 66 ms. 1> timer:tc(re,grep,[LLLStr,["^(?:(\\d+)|::)*$"]]). {66120,[no_match]} not bad, only twice as expensive as length/1 :> 2> timer:tc(erlang,length,[LLLStr]). {31789,1653696} does length/1 block the emu? and what about e.g. md5/1? mats From ernie.makris@REDACTED Thu Aug 3 16:26:22 2006 From: ernie.makris@REDACTED (Ernie Makris) Date: Thu, 03 Aug 2006 10:26:22 -0400 Subject: pcre, bifs, drivers and ports In-Reply-To: <44D1D9FD.1000106@telia.com> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE1FE9.9090104@comcast.net> <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> <44CF5163.7070204@comcast.net> <31EDD99A-BE65-4D2E-AFC1-71023165AD54@gmail.com> <44CF64B7.6060605@ericsson.com> <44D0B193.3030406@ericsson.com> <44D1D9FD.1000106@telia.com> Message-ID: <44D2078E.4080906@comcast.net> Hi Robert, Robert Virding wrote: > > While the handling of "f**" in regexp is definitely a bug, which I > suppose I should fix, it is definitely a legal regular expression. So > that pcre will not even allow the regular expression is also a bug, > the question is if it is the parsing of the expression or where? > > If you are as "cautious" as people working with cryptography you would > start wondering if this is sign of a deeper malaise. :-) > > As the great Cato said: I still feel that calling the function grep is > misleading. > > Could someone send a real problem to experiment on? Especially one > which the current regexp module is definitely too slow on. > The reason I want pcre support, at least for my own personal sandbox, is because of features that the regexp library lacks. Not because of performance. Additionally, if there is a bug in pcre, chances are it will be fixed more soon than a bug in the erlang regex module(aside from just doing the work myself, which is fine I guess). Also the reason I asked about bifs and drivers is to solicit feedback from the list as to what the best way to implement a binding into the pcre library and what the drawbacks were of each implementation. I think this is a good discussion, not sure what everyone else thinks. Especially to show that erl bifs are fairly easy to implement, and the constraints that their implementation should adhere to. Thanks Ernie From ft@REDACTED Thu Aug 3 17:10:50 2006 From: ft@REDACTED (Fredrik Thulin) Date: Thu, 3 Aug 2006 17:10:50 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <44D1D9FD.1000106@telia.com> References: <44D0B193.3030406@ericsson.com> <44D1D9FD.1000106@telia.com> Message-ID: <200608031710.50656.ft@it.su.se> On Thursday 03 August 2006 13:11, Robert Virding wrote: ... > Could someone send a real problem to experiment on? Especially one > which the current regexp module is definitely too slow on. Here is a regexp that the regexp module is definately too slow on ;) : regexp:match("+461234", "^+46(.*)$"). Previously reported in http://www.erlang.org/ml-archive/erlang-questions/200404/msg00105.html /Fredrik From joelr1@REDACTED Thu Aug 3 22:26:39 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 3 Aug 2006 21:26:39 +0100 Subject: Mac Intel Message-ID: <9E7E828B-1857-4B03-87F3-9419125EFE54@gmail.com> Folks, I noticed that R11B0 compiles from source on Mac Intel although dyalizer complains a lot at the end. It does not build from DarwinPorts, though, and fails at the configuration stage. I also noticed that the resulting erl does not have HiPE support. Is this in the pipeline? Is it hard to add/enable? I assume there should be no trouble as this is Intel after all. Thanks, Joel -- http://wagerlabs.com/ From ok@REDACTED Fri Aug 4 02:42:22 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 4 Aug 2006 12:42:22 +1200 (NZST) Subject: pcre, bifs, drivers and ports Message-ID: <200608040042.k740gMpF095379@atlas.otago.ac.nz> Bjorn Gustavsson wrote: Also, a FA can be difficult/impossible to use if you need to know exactly what part of the string matched, for instance if you need to replace the matched string with something else. There's a Master's thesis "Efficient Submatch Addressing for Regular Expressions" by one Laurikari from Finland which explains how to do exactly that (with a slightly modified form of NFA). From joelr1@REDACTED Fri Aug 4 03:41:47 2006 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 4 Aug 2006 02:41:47 +0100 Subject: Mac Intel In-Reply-To: <200608040133.k741XAZT020115@harpo.it.uu.se> References: <200608040133.k741XAZT020115@harpo.it.uu.se> Message-ID: <9875D043-AC13-484B-8E0C-64A0F0995047@gmail.com> On Aug 4, 2006, at 2:33 AM, Mikael Pettersson wrote: > The issue is not x86 but the operating system and C library. > To support HiPE on x86 or amd64 we need to be able to enforce > sigaltstack semantics on all signal handlers. We can do this > with Linux/glibc on x86/amd64 and Solaris/x86 (not yet ported > to Solaris/amd64 due to lack of availability), but we have no > idea how to do this on MacTel. Well... The semantics of sigaltstack should be the same across Mac OSX PPC and Mac OSX Intel, at least I think so. HiPE is supposed in Mac OSX PPC from what I remember. I'm very much trivializing things but I wonder if there's a straightforward way to keep the Mac OSX PPC semantics while plugging in the Intel code generation. If you would be kind enough to guide me I could look into adding HiPE functionality to Mac Intel as I have time to spare. Thanks, Joel -- http://wagerlabs.com/ From robert.virding@REDACTED Fri Aug 4 11:05:39 2006 From: robert.virding@REDACTED (Robert Virding) Date: Fri, 04 Aug 2006 11:05:39 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <200608031710.50656.ft@it.su.se> References: <44D0B193.3030406@ericsson.com> <44D1D9FD.1000106@telia.com> <200608031710.50656.ft@it.su.se> Message-ID: <44D30DE3.8010305@telia.com> Ah, but that's a bug! That doesn't count. :-) Looking at the regexp I think I can guess what is going wrong. Anchoring patterns at the beginning of a line is not as easy as one would think. Leex doesn't handle it. Seriously though, I would like some REAL problems to experiment on. Robert Fredrik Thulin wrote: > On Thursday 03 August 2006 13:11, Robert Virding wrote: > ... > >>Could someone send a real problem to experiment on? Especially one >>which the current regexp module is definitely too slow on. > > > Here is a regexp that the regexp module is definately too slow on ;) : > > regexp:match("+461234", "^+46(.*)$"). > > Previously reported in > > http://www.erlang.org/ml-archive/erlang-questions/200404/msg00105.html > > /Fredrik > From mats.cronqvist@REDACTED Fri Aug 4 11:11:27 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Fri, 04 Aug 2006 11:11:27 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <200608040042.k740gMpF095379@atlas.otago.ac.nz> References: <200608040042.k740gMpF095379@atlas.otago.ac.nz> Message-ID: <44D30F3F.2070109@ericsson.com> Richard A. O'Keefe wrote: > Bjorn Gustavsson wrote: > Also, a FA can be difficult/impossible to use if you need to > know exactly what part of the string matched, for instance if > you need to replace the matched string with something else. > > There's a Master's thesis "Efficient Submatch Addressing for > Regular Expressions" by one Laurikari from Finland which explains > how to do exactly that (with a slightly modified form of NFA). > he has an implementation too; http://laurikari.net/tre/index.html from the manual; "The algorithm uses linear worst-case time in the length of the text being searched, and quadratic worst-case time in the length of the used regular expression. In other words, the time complexity of the algorithm is O(M2N), where M is the length of the regular expression and N is the length of the text." [...] "There is one exception: if back references are used, the matching may take time that grows exponentially with the length of the string. " mats -- Premature optimization is the root of all evil in programming. C. A. R. Hoare From rsaccon@REDACTED Fri Aug 4 11:39:30 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Fri, 4 Aug 2006 06:39:30 -0300 Subject: meaning of results from cpu_sup Message-ID: I would like to mesure the state of the server my app is running, and os_mon gives me a lot of information. But I do not understand the numbers I get for the average CPU load as result of cpu_sup:avg1(), cpu_sup:avg5(), cpu_sup:avg15(). It seems to be non-linear, but what does it mean ? To display them in a graph, i want a percentage. How can I transform those values into a percentage ? There is a description in the documentation, but that confused me even more ... http://www.erlang.se/doc/doc-5.5/lib/os_mon-2.1/doc/html/index.html -- Roberto Saccon From robert.virding@REDACTED Fri Aug 4 12:06:14 2006 From: robert.virding@REDACTED (Robert Virding) Date: Fri, 04 Aug 2006 12:06:14 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <44D2078E.4080906@comcast.net> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE1FE9.9090104@comcast.net> <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> <44CF5163.7070204@comcast.net> <31EDD99A-BE65-4D2E-AFC1-71023165AD54@gmail.com> <44CF64B7.6060605@ericsson.com> <44D0B193.3030406@ericsson.com> <44D1D9FD.1000106@telia.com> <44D2078E.4080906@comcast.net> Message-ID: <44D31C16.8040406@telia.com> Hello Ernie, The best way to go continue is to decide what we would like a regexp package to be able to do. I used the regexps and interfaces (sub, gsub etc) to them from standard AWK which were well defined, stable and allowed you to do most things. Perhaps the POSIX definition is the way to go. If we could then agree (difficult :-)) on a common interface we could have different packages which work in the same way but targeted att different types of uses. This was the idea behind sets/ordsets and dict/orddict. Most features (for example backreferences) are pretty easy to implement when interpreting the regexp or using an NFA but difficult compiled/with a DFA. Actually adding backreferences is to regexp is probably easier then fixing the bug Fredrik Thulin mentioned. And much more fun. :-) Robert Ernie Makris wrote: > Hi Robert, > > Robert Virding wrote: > >>While the handling of "f**" in regexp is definitely a bug, which I >>suppose I should fix, it is definitely a legal regular expression. So >>that pcre will not even allow the regular expression is also a bug, >>the question is if it is the parsing of the expression or where? >> >>If you are as "cautious" as people working with cryptography you would >>start wondering if this is sign of a deeper malaise. :-) >> >>As the great Cato said: I still feel that calling the function grep is >>misleading. >> >>Could someone send a real problem to experiment on? Especially one >>which the current regexp module is definitely too slow on. >> > > The reason I want pcre support, at least for my own personal sandbox, is > because of features that the regexp library lacks. Not because of > performance. Additionally, if there is a bug in pcre, chances are it > will be fixed more soon than a bug in the erlang regex module(aside from > just doing the work myself, which is fine I guess). Also the reason I > asked about bifs and drivers is to solicit feedback from the list as to > what the best way to implement a binding into the pcre library and what > the drawbacks were of each implementation. > > I think this is a good discussion, not sure what everyone else thinks. > Especially to show that erl bifs are fairly easy to implement, and the > constraints that their implementation should adhere to. > > Thanks > Ernie > From mats.cronqvist@REDACTED Fri Aug 4 18:04:46 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Fri, 04 Aug 2006 18:04:46 +0200 Subject: enums anyone? Message-ID: <44D3701E.7040502@ericsson.com> in my quixotic crusade against the use of macros, i've come up against this idiom; -define(TRUE,true). -define(FALSE,false). -define(PREF_SILLY_CONSTANT,silly_constant). -define(PREF_DUMB_CONSTANT, dumb_constant). -define(PREF_ULTRA_LAME,ultra_lame). x() -> receive ?TRUE -> ... ?FALSE -> ... end. as far as i can tell it's to get the compiler to catch typos like "flase" for "false". so perhaps a language addition like this would be useful. -enum(BOOL,[true,false]). x() -> receive #BOOL.true -> ...; #BOOL.false -> ... end. or perhaps x() -> receive #BOOL.X -> ...; X -> exit(bad_message) end. the choice of "#" is probably dumb. the "#BOOL.true" would of course be transformed to 'true' by the compiler. mats -- Premature optimization is the root of all evil in programming. C. A. R. Hoare From sean.hinde@REDACTED Fri Aug 4 19:02:21 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 4 Aug 2006 18:02:21 +0100 Subject: enums anyone? In-Reply-To: <44D3701E.7040502@ericsson.com> References: <44D3701E.7040502@ericsson.com> Message-ID: <3BDF6DEA-A28D-4CD1-9CA2-C99658017C30@gmail.com> > > as far as i can tell it's to get the compiler to catch typos like > "flase" for "false". Spellcheck the atom table :-) Sean From ryanobjc@REDACTED Fri Aug 4 20:25:19 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Fri, 4 Aug 2006 11:25:19 -0700 Subject: enums anyone? In-Reply-To: <3BDF6DEA-A28D-4CD1-9CA2-C99658017C30@gmail.com> References: <44D3701E.7040502@ericsson.com> <3BDF6DEA-A28D-4CD1-9CA2-C99658017C30@gmail.com> Message-ID: <78568af10608041125r5393d459k4cef912ea3468d2e@mail.gmail.com> This brings up an important point. Adding syntax to an existing language is something that needs to be carefully done. The prototypical warning is "you'll become perl" - more of a fairy tale, but we all know how that ends. The next warning is "You'll be Java 1.5". If you were able to only add exactly ONE syntax extension to the base Erlang language what would it be? Would it be Enums? I don't have my personal answer, but I'm sure it would not be that. Not enough bang for your buck. -ryan On 8/4/06, Sean Hinde wrote: > > > > as far as i can tell it's to get the compiler to catch typos like > > "flase" for "false". > > Spellcheck the atom table :-) > > Sean > > > From chsu79@REDACTED Fri Aug 4 22:50:50 2006 From: chsu79@REDACTED (Christian S) Date: Fri, 4 Aug 2006 22:50:50 +0200 Subject: Simple DB Access In-Reply-To: <78568af10608021451w16b56a51s149433df4cff297@mail.gmail.com> References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> <200608011344.46076.mikael.karlsson@creado.com> <78568af10608021451w16b56a51s149433df4cff297@mail.gmail.com> Message-ID: On 8/2/06, Ryan Rawson wrote: > Being a long time developer on Oracle I now don't understand this > 'prepare' concept. Every single SQL statement that takes in user > input should use bind variables. If this makes you have to prepare > statements, then so be it (our oracle API doesnt require prepares, but > forces us to use binds). JDBC, java's sql api, only have the PreparedStatement class if one want to bind rather than construct SQL by string concatenation. I guess binding is a more accurate name for what I meant. Anyway, the postgres protocol, called FE/BE: http://developer.postgresql.org/docs/postgres/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY FE/BE in extended queries will first parse a string and refers to the result as a prepared statement. It can then be reused multiple time using binding. Binding one of these prepared statements yields, what the pg documentation calls, a 'portal'. The portal can then be executed. I'm not exactly sure why this extra step is a good idea, but it is the way it is. > With binds you don't have SQL injection holes. It's as simple as that. > > Say no to constructed SQL. My line exactly. Too bad I havent figured out a way to make it harder to construct strings than using binding. Maybe if this edbc application itself required statements to be registered by a name, and then executed by name. Something like ok = edbc:register_statement(Db, foo, "SELECT foo FROM foobars WHERE foo = "++Bar), case edbc:execute_statement(Db, foo) of PossibleResult -> ... end, And the binding version would be ok = edbc:register_statement(Db, prepared, "SELECT foo FROM foobars WHERE foo = ?foo"), case edbc:execute(Db, foo, [{foo, "bar"}]) of PossibleResult -> end About the syntax for the "to-be-bounds" in statements. They vary from rdbm to rdbm, i used "?foo" other use "?" and refer to them by occuring order number, and then what?. To make it coherent across several databases one wants to parse the sql query to find them, and then produce a string again, a string that the target database's parser will understand. I think, how do other language's sql api deal with it? From ryanobjc@REDACTED Fri Aug 4 23:23:04 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Fri, 4 Aug 2006 14:23:04 -0700 Subject: Simple DB Access In-Reply-To: References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> <200608011344.46076.mikael.karlsson@creado.com> <78568af10608021451w16b56a51s149433df4cff297@mail.gmail.com> Message-ID: <78568af10608041423iec41fc1u9b09081b6d5c606@mail.gmail.com> I dont think you have to make it harder to use adhoc concat SQL, just make it stupidly easy to use binds. Screw the whole 'prepare statement' b.s. - that is why people dont use bind variables, you have to create tons of extra variables and tracking things just to use a bind. Instead, push all that down into the API, and just provide an api like: execSql( string SQLText, bind1value, bind2value, bind3value ) or something. Hash the SQLText in the API so you can see if this was already prepared or not. Now, what is easier to write: execSql( "insert into foo (a,b,c) values(" + escapeForSql( variable1 ) + "," + . ) or execSql( "insert into foo (a,b,c) values (:a,:b,:c)", variable1, variable2, variable3 ) in my mythical pseudo code. The issue isnt that we need to make using hand built sql harder - its hard enough! - but that using binds needs to be as simple as possible. As soon as people see the whole 'prepared statement' they freak out and create injection holes in their website. So forget about register_statement and execute - that is not making it easier to use. Instead just have a singular, like so: -export( exec/2 ) . as: exec( SqlText, ListOfBinds ) . if it is a function that returns values, return a list of tuples (result set). Remember that for like 90% of the database APIs unless you do "magic" the client side will retrieve the entire resultset from the server anyways. Many times I've thought that I could retrieve one row at a time, then my client crashed because it tried to pull down 500,000 rows. You need a special call series for those cases (which are generally special) - optimize the most common case, that would be returning a small to medium # of rows (eg: 1-500 rows). Also, for SQL that returns no rows (update, insert, etc), the # of rows affected is your resultset. Don't provide 2 API calls that the programmer needs to figure out which one to call depending on select or update. That is my API design guide. Having using our own internal API to OCI which behaves like I described more or less (except more like sprintf/scanf in terms of providing binds, ie: pointers) vs JDBC, Hibernate, PostgreSQL C api, i highly prefer our own API, despite the C warts it has. So for the love of all good API design, PLEASE don't make the developer do all the work! -ryan On 8/4/06, Christian S wrote: > On 8/2/06, Ryan Rawson wrote: > > Being a long time developer on Oracle I now don't understand this > > 'prepare' concept. Every single SQL statement that takes in user > > input should use bind variables. If this makes you have to prepare > > statements, then so be it (our oracle API doesnt require prepares, but > > forces us to use binds). > > JDBC, java's sql api, only have the PreparedStatement class if one want to > bind rather than construct SQL by string concatenation. I guess > binding is a more > accurate name for what I meant. Anyway, the postgres protocol, called > FE/BE: http://developer.postgresql.org/docs/postgres/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY > > FE/BE in extended queries will first parse a string and refers to the > result as a prepared statement. It can then be reused multiple time > using binding. Binding one of these prepared statements yields, what > the pg documentation calls, a 'portal'. The portal can then be > executed. I'm not exactly sure why this extra step is a good idea, but > it is the way it is. > > > With binds you don't have SQL injection holes. It's as simple as that. > > > > Say no to constructed SQL. > > My line exactly. Too bad I havent figured out a way to make it harder > to construct strings than using binding. Maybe if this edbc > application itself required statements to be registered by a name, and > then executed by name. Something like > > ok = edbc:register_statement(Db, foo, "SELECT foo FROM foobars WHERE > foo = "++Bar), > case edbc:execute_statement(Db, foo) of > PossibleResult -> ... > end, > > And the binding version would be > ok = edbc:register_statement(Db, prepared, "SELECT foo FROM foobars > WHERE foo = ?foo"), > case edbc:execute(Db, foo, [{foo, "bar"}]) of > PossibleResult -> > end > > About the syntax for the "to-be-bounds" in statements. They vary from > rdbm to rdbm, i used "?foo" other use "?" and refer to them by > occuring order number, and then what?. To make it coherent across > several databases one wants to parse the sql query to find them, and > then produce a string again, a string that the target database's > parser will understand. > I think, how do other language's sql api deal with it? > From chsu79@REDACTED Sat Aug 5 00:20:20 2006 From: chsu79@REDACTED (Christian S) Date: Sat, 5 Aug 2006 00:20:20 +0200 Subject: Simple DB Access In-Reply-To: <78568af10608041423iec41fc1u9b09081b6d5c606@mail.gmail.com> References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> <200608011344.46076.mikael.karlsson@creado.com> <78568af10608021451w16b56a51s149433df4cff297@mail.gmail.com> <78568af10608041423iec41fc1u9b09081b6d5c606@mail.gmail.com> Message-ID: On 8/4/06, Ryan Rawson wrote: > I dont think you have to make it harder to use adhoc concat SQL, just > make it stupidly easy to use binds. Screw the whole 'prepare > statement' b.s. - that is why people dont use bind variables, you have > to create tons of extra variables and tracking things just to use a > bind. Instead, push all that down into the API, and just provide an > api like: > > execSql( string SQLText, bind1value, bind2value, bind3value ) > > or something. Hash the SQLText in the API so you can see if this was > already prepared or not. Since it is easy to use pattern matching to tell if SQLText is an atom one could still allow registering statements, and only then take advantage of statement preparation. If it is a string, one just parse it over again. Erlang doesnt have varargs, but we have list litterals. Is it more fun to do: edbc:execute(Db, "SELECT * FROM foobar WHERE a = ? AND b = ?", ["foo", "bar"]) than edbc:execute(Db, "SELECT * FROM foobar WHERE a = ?a AND b = ?b", [{a, "foo"}, {b, "bar"}]) The later has potential to report better error messages, telling you that "parameter b still unbound" if no {b, Value} was given. Of course, erlang has a tradition of giving vague error messages. :) > Now, what is easier to write: > > execSql( "insert into foo (a,b,c) values(" + escapeForSql( variable1 > ) + "," + . ) Yeah, I get it. :) I think SQLite mainly had an escape-this-string-for-inclusion-as-a-litteral-in-a-statement approach. They do have it for blobs anyway. (Just me braindumping, I investigated that api to get a sense of sql api/protocol diversity.) << Anyone have a SQL92 parser written in erlang/yecc alraedy? :) Not? Know where the bnf for SQL92 can be found? I recall seeing it in a book appendix once.>> Oh yeah. Postgres has a number of non-standard operators for quering map databases. With a SQL92 parser front end one would reject sql statements using them and force those users to "hit the metal" with the postgres driver directly. Good/Bad? > if it is a function that returns values, return a list of tuples > (result set). Remember that for like 90% of the database APIs unless > you do "magic" the client side will retrieve the entire resultset from > the server anyways. Many times I've thought that I could retrieve one > row at a time, then my client crashed because it tried to pull down > 500,000 rows. You need a special call series for those cases (which > are generally special) - optimize the most common case, that would be > returning a small to medium # of rows (eg: 1-500 rows). Good that you bring this up, one ends up wondering how to handle huge query results while making sql apis. How about the simple query returns all as a result, leading to crashes if the result is big enough to exhaust memory, and then a secondary version that can handle some result-set like approach. Is it better to use a lists:fold like approach than returning a result set object for which one have various accessors and operators on? I suspect the first leads to compact code which is easily readable for erlang programmers with good grasp of first class functions, but quite the opposite for newbies with an imperative-programming mindset. > Also, for SQL that returns no rows (update, insert, etc), the # of > rows affected is your resultset. Don't provide 2 API calls that the > programmer needs to figure out which one to call depending on select > or update. Returning different tuples for different statement results is effectively two kinds of calls. But something like the following isnt bad, is it? case edbc:execute(...) of {result, Columns} -> ...; {update, Count) -> ...; . . . end Databases return different amount of information in their results. Postgres is quite rich, afaik it returns column names and column types (coded to numbers), beyond just the resulting rows. For every kind of query it will also tell if you are outside a transaction, inside a transaction, or inside an aborted transaction. One needs to know what every db will present in results. I suspect JDBC have done that job for us? > That is my API design guide. Having using our own internal API to OCI > which behaves like I described more or less (except more like > sprintf/scanf in terms of providing binds, ie: pointers) vs JDBC, > Hibernate, PostgreSQL C api, i highly prefer our own API, despite the > C warts it has. I spent an hour clicking through the OCI docs a few days ago. Seems like plenty information about the C OCI api there in. They're not documenting the wire protocol, are they? How is your in-house lib built, reverse engineering or some NDA deal with Oracle? Have any experience with the OCI lib? Good enough to use as a linked-in-driver? Reentrant to run in a separate thread? > So for the love of all good API design, PLEASE don't make the > developer do all the work! From widjayy@REDACTED Sat Aug 5 00:46:29 2006 From: widjayy@REDACTED (widjayy) Date: Sat, 05 Aug 2006 00:46:29 +0200 Subject: ermacs: does anybody needs a erlang ed? Message-ID: <44D3CE45.20203@neuf.fr> Hi! I wanted to download this great erlang editor, ermacs, but.... nothing. http://sourceforge.net/project/showfiles.php?group_id=73688 jungerl no more supported? Somebody interested in the dev of a great erlang editor? I am :) From chsu79@REDACTED Sat Aug 5 01:02:22 2006 From: chsu79@REDACTED (Christian S) Date: Sat, 5 Aug 2006 01:02:22 +0200 Subject: How do I have multiple gen_servers, behind a single name, all serving requests? Message-ID: Creating connections to databases tend to take some time, most solutions involve having N connections open in a pool that application code check out while operating on the db. As I have found out, database session tend to have a state. For postgres a prepared statement is given a name that is local to that session, hidden from other sessions to postgres. So checking out a connection from a pool, one would have to make sure these exist by preparing them again, each checkout. Maybe not that costly in most real situations, but I thought it could be engineered better: The idea I got was that you have: * one front-end gen_server, * it is registered to the name one like to expose, * it keeps a fifo or stack of anonymous worker gen_servers * to pass on requests any non-busy worker gen_server, quickly going back wating for more requests * and receving info about workers becoming available again. This would distribute requests over several worker gen_servers. Is there anything in OTP which does this already? A gen_server option i missed? pool and overload seem to be concerned with cpu load. I just want to have several gen_servers so each one can have its own connection to the database, to avoid the cost of opening new connections and tap in to the sometimes very good multithreading in rdbms. Pooling application gen_servers rather than database connections is one step up in abstraction. Making it cleaner to write solid gen_servers that implement "business logic" (sorry for the buzzword). I mean, succinctly formulated operations the application needs from the db, such as decrement-N-units-from-account-A-if-the-balance-is-high-enough: bank:withdraw(N, A). Typically gen_servers act as a form of synchronization device, but here the databases go to great length to handle transactions and their collisions well. <> From ryanobjc@REDACTED Sat Aug 5 01:13:37 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Fri, 4 Aug 2006 16:13:37 -0700 Subject: Simple DB Access In-Reply-To: References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> <200608011344.46076.mikael.karlsson@creado.com> <78568af10608021451w16b56a51s149433df4cff297@mail.gmail.com> <78568af10608041423iec41fc1u9b09081b6d5c606@mail.gmail.com> Message-ID: <78568af10608041613x1b5b6441xd551329e7d227417@mail.gmail.com> OCI is very mature and would probably work ok as a linked in driver. Our in-house API just makes OCI calls so you dont have to - OCI is very... baroque to say the least. You don't want to deal with that stuff just to do the basics. No wire-format necessary - you don't want to go down that path, you're asking for a world of hurt. For example, most libraries which implement the oracle 'wire protocol' can't handle things like RAC. As for the atom thing - you can't have a SQL statement as an atom. I dont think a 5000 character atom is really supported well. SQL statements do get that big. Typically a few hundred chars - still not really atom-land. Like I said, just hash the string and use that as a unique key into a table of prepared statements. Or whatever. As for the SQL 92 parser - that is a little unnecessary. Your client library doesn't have to understand SQL. If the statement doesn't begin with 'select' (adjusting for white space) then it doesn't return a resultset generally. Underlying APIs don't always make you understand the difference, and tell you specifically after it executes what kind of statement it was. Don't try to parse the SQL - that is not your job. Your job is to smooth over the C api and make it tasty to erlang developers. Again, re: your talk about resultSet metadata... go for the 80% use case and make it easy. Almost all the time you just want to get your data, you know what order it is in, and just give me the data! now! All the extra meta data stuff is great for writing flexible GUIs which let you do this and that, but most of the queries dont need that. It should be available somehow, but not as part of the main result set - meaning don't return big huge data structures that have all the column names in it, just return the raw data and nothing but the data. As for the returning tags to indicate the kind of result, that sounds good - probably better than my thought :-) Again, re: transactions, never ever ever assume people will only need auto-commit mode. I can't stand that - transactions are THE reason to use a RDBMs. Otherwise just use BDB (which supports transactions btw). Ok, data richness too, but ssssh. On to the topic of large resultsets. The primary interface should return huge amounts of data - if you forgot 'where' and now you returned 10mm rows, an out of memory crash is as good as any. Now, the foldl() interface is in fact the only way large data sets should be supported. The other option is to return slices of the dataset at a time. That seems kind of icky. While its good to make Erlang attractive to non-functional programmers, we must not forget the functional heritage of Erlang _is_ one of its core strengths. If erlang ever introduces a 'for loop' I will get very bent out of shape. -ryan On 8/4/06, Christian S wrote: > On 8/4/06, Ryan Rawson wrote: > > I dont think you have to make it harder to use adhoc concat SQL, just > > make it stupidly easy to use binds. Screw the whole 'prepare > > statement' b.s. - that is why people dont use bind variables, you have > > to create tons of extra variables and tracking things just to use a > > bind. Instead, push all that down into the API, and just provide an > > api like: > > > > execSql( string SQLText, bind1value, bind2value, bind3value ) > > > > or something. Hash the SQLText in the API so you can see if this was > > already prepared or not. > > Since it is easy to use pattern matching to tell if SQLText is an atom one could > still allow registering statements, and only then take advantage of > statement preparation. > If it is a string, one just parse it over again. Erlang doesnt have > varargs, but we have > list litterals. Is it more fun to do: > > edbc:execute(Db, "SELECT * FROM foobar WHERE a = ? AND b = ?", ["foo", "bar"]) > > than > > edbc:execute(Db, "SELECT * FROM foobar WHERE a = ?a AND b = ?b", [{a, > "foo"}, {b, "bar"}]) > > The later has potential to report better error messages, telling you > that "parameter b still unbound" if no {b, Value} was given. Of > course, erlang has a tradition of giving vague error messages. :) > > > Now, what is easier to write: > > > > execSql( "insert into foo (a,b,c) values(" + escapeForSql( variable1 > > ) + "," + . ) > > Yeah, I get it. :) I think SQLite mainly had an > escape-this-string-for-inclusion-as-a-litteral-in-a-statement > approach. They do have it for blobs anyway. (Just me braindumping, I > investigated that api to get a sense of sql api/protocol diversity.) > > << Anyone have a SQL92 parser written in erlang/yecc alraedy? :) Not? > Know where the bnf for SQL92 can be found? I recall seeing it in a > book appendix once.>> > > Oh yeah. Postgres has a number of non-standard operators for quering > map databases. With a SQL92 parser front end one would reject sql > statements using them and force those users to "hit the metal" with > the postgres driver directly. Good/Bad? > > > if it is a function that returns values, return a list of tuples > > (result set). Remember that for like 90% of the database APIs unless > > you do "magic" the client side will retrieve the entire resultset from > > the server anyways. Many times I've thought that I could retrieve one > > row at a time, then my client crashed because it tried to pull down > > 500,000 rows. You need a special call series for those cases (which > > are generally special) - optimize the most common case, that would be > > returning a small to medium # of rows (eg: 1-500 rows). > > Good that you bring this up, one ends up wondering how to handle huge > query results while making sql apis. How about the simple query > returns all as a result, leading to crashes if the result is big > enough to exhaust memory, and then a secondary version that can handle > some result-set like approach. > > Is it better to use a lists:fold like approach than returning a result > set object for which one have various accessors and operators on? I > suspect the first leads to compact code which is easily readable for > erlang programmers with good grasp of first class functions, but quite > the opposite for newbies with an imperative-programming mindset. > > > Also, for SQL that returns no rows (update, insert, etc), the # of > > rows affected is your resultset. Don't provide 2 API calls that the > > programmer needs to figure out which one to call depending on select > > or update. > > Returning different tuples for different statement results is > effectively two kinds of calls. But something like the following isnt > bad, is it? > > case edbc:execute(...) of > {result, Columns} -> > ...; > {update, Count) -> > ...; > . . . > end > > Databases return different amount of information in their results. > Postgres is quite rich, afaik it returns column names and column types > (coded to numbers), beyond just the resulting rows. For every kind of > query it will also tell if you are outside a transaction, inside a > transaction, or inside an aborted transaction. > > One needs to know what every db will present in results. I suspect > JDBC have done that job for us? > > > That is my API design guide. Having using our own internal API to OCI > > which behaves like I described more or less (except more like > > sprintf/scanf in terms of providing binds, ie: pointers) vs JDBC, > > Hibernate, PostgreSQL C api, i highly prefer our own API, despite the > > C warts it has. > > I spent an hour clicking through the OCI docs a few days ago. Seems like plenty > information about the C OCI api there in. > They're not documenting the wire protocol, are they? How is your > in-house lib built, reverse engineering or some NDA deal with Oracle? > Have any experience with the OCI lib? Good enough to use as a > linked-in-driver? Reentrant to run in a separate thread? > > > So for the love of all good API design, PLEASE don't make the > > developer do all the work! > From serge@REDACTED Sat Aug 5 01:47:52 2006 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 04 Aug 2006 19:47:52 -0400 Subject: Simple DB Access In-Reply-To: <78568af10608041613x1b5b6441xd551329e7d227417@mail.gmail.com> References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> <200608011344.46076.mikael.karlsson@creado.com> <78568af10608021451w16b56a51s149433df4cff297@mail.gmail.com> <78568af10608041423iec41fc1u9b09081b6d5c606@mail.gmail.com> <78568af10608041613x1b5b6441xd551329e7d227417@mail.gmail.com> Message-ID: <44D3DCA8.2030406@hq.idt.net> Ryan Rawson wrote: > OCI is very mature and would probably work ok as a linked in driver. > Our in-house API just makes OCI calls so you dont have to - OCI is > very... baroque to say the least. You don't want to deal with that > stuff just to do the basics. No wire-format necessary - you don't > want to go down that path, you're asking for a world of hurt. For > example, most libraries which implement the oracle 'wire protocol' > can't handle things like RAC. I am not sure I'd agree if a linked-in driver option is an overall good choice for the OCI. Things like running a query that doesn't come back due to a change in the query optimization plan on the server, server utilization, etc. are not atypical for Oracle. How cleanly then can you abort that session without causing some sort of memory/resource leak? I don't think OCI offers a good way of dealing with these issues (other than killing a hung thread/process). Yes there was a function added in 9i that attempted to cancel a running query, but it never guaranteed how long it would take (since Oracle would need to perform a rollback), and it was not uncommon to see such canceled queries completely freeze the control for an hour. On the other hand, depending on how critical it is for your service to be up all the time, I admit that the performance win of using link-in drivers for some systems may out-weight the stability factor. Perhaps a choice of link-in driver or port with analogous interface would be the best. Serge From chsu79@REDACTED Sat Aug 5 02:31:50 2006 From: chsu79@REDACTED (Christian S) Date: Sat, 5 Aug 2006 02:31:50 +0200 Subject: Simple DB Access In-Reply-To: <78568af10608041613x1b5b6441xd551329e7d227417@mail.gmail.com> References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> <200608011344.46076.mikael.karlsson@creado.com> <78568af10608021451w16b56a51s149433df4cff297@mail.gmail.com> <78568af10608041423iec41fc1u9b09081b6d5c606@mail.gmail.com> <78568af10608041613x1b5b6441xd551329e7d227417@mail.gmail.com> Message-ID: On 8/5/06, Ryan Rawson wrote: > example, most libraries which implement the oracle 'wire protocol' > can't handle things like RAC. Some kind of redundancy or replication feature? I stay as far away from oracle's price model as possible. :) > As for the atom thing - you can't have a SQL statement as an atom. I > dont think a 5000 character atom is really supported well. SQL > statements do get that big. Typically a few hundred chars - still not > really atom-land. Like I said, just hash the string and use that as a > unique key into a table of prepared statements. Or whatever. I meant an atom that names a statement that has been previously defined. Think "register_statement" from a few mails back. execute(SQLText, Binds) when atom(SQLText) -> execute_registered(SQLText, Binds); execute(SQLText, Binds) -> execute_parse(SQLTEXT, Binds). Since it leaves the possibility of placing all the sql strings at one place in the code, making code a bit more readable: {ok, [Balance]} = execute(balance, [Account]) And still be able to do oneshots: execute("DELETE FROM foo", []) > As for the SQL 92 parser - that is a little unnecessary. I thought it would be nice if one could smooth over that different rdbms use different syntax for parameters to be bound. Imagine if I write my code as edbc:execute("SELECT * FROM foo WHERE id = $1", [Id]) and what keeps it from running on SQL-omatic-3000 is that the proper syntax there is edbc:execute("SELECT * FROM foo WHERE id = @1", [Id]) There are probably cheaper ways to get uniform syntax there. Maybe thinking outside the string could be the solution, I dont feel intelligent enough to evaluate this idea this late: edbc:execute(["SELECT * FROM foo WHERE id = ", param], [Id]) > As for the returning tags to indicate the kind of result, that sounds > good - probably better than my thought :-) I wonder if all rdbms do that though. If one doesnt, it will be impossible to write a fully transparent edbc backend for it. > Again, re: transactions, never ever ever assume people will only need > auto-commit mode. I can't stand that - transactions are THE reason to > use a RDBMs. Otherwise just use BDB (which supports transactions > btw). Ok, data richness too, but ssssh. Yes, and on the topic of that. A mnesia:transaction like interface to transactions is nice, I would think? It hides the dynamic-unwind from API-user's code. From serge@REDACTED Sat Aug 5 02:53:39 2006 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 04 Aug 2006 20:53:39 -0400 Subject: Simple DB Access In-Reply-To: References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> <200608011344.46076.mikael.karlsson@creado.com> <78568af10608021451w16b56a51s149433df4cff297@mail.gmail.com> <78568af10608041423iec41fc1u9b09081b6d5c606@mail.gmail.com> <78568af10608041613x1b5b6441xd551329e7d227417@mail.gmail.com> Message-ID: <44D3EC13.2040307@hq.idt.net> Christian S wrote: > edbc:execute("SELECT * FROM foo WHERE id = $1", [Id]) One comment about a nice feature to have in edbc that I believe is specific to OCI - array DML inserts, where bind variables can contain an array of values. This saves quite a bit on network round trips when inserting hundreds / thousands of records edbc:execute_array( "insert into foo (field1, field2) values (:1, :2)", [ [ 1, 2, 3, 4 ], ["a","b","c","d"] ] ). Serge From nils.muellner@REDACTED Sat Aug 5 02:59:12 2006 From: nils.muellner@REDACTED (=?ISO-8859-15?Q?Nils_M=FCllner?=) Date: Sat, 05 Aug 2006 02:59:12 +0200 Subject: subject for master thesis required Message-ID: <44D3ED60.70400@heh.uni-oldenburg.de> hi, i finished my bsc thesis about distributed computing in functional languages. erlang was one part of it. since erlang sparked my interest in distributed computing most, i want to continue in this field. can somebody please recommend an adequate subject for a master-thesis regarding distributed computing in erlang? i don't have the outline of what is needed/adequate/feasible. so if you have a project to be done in about six months or some interesting field of r&d please email me. i have a mentor at the university, so i just need a subject. kind regards and thanks in advance, nils From chsu79@REDACTED Sat Aug 5 03:13:24 2006 From: chsu79@REDACTED (Christian S) Date: Sat, 5 Aug 2006 03:13:24 +0200 Subject: Simple DB Access In-Reply-To: <44D3EC13.2040307@hq.idt.net> References: <200608011344.46076.mikael.karlsson@creado.com> <78568af10608021451w16b56a51s149433df4cff297@mail.gmail.com> <78568af10608041423iec41fc1u9b09081b6d5c606@mail.gmail.com> <78568af10608041613x1b5b6441xd551329e7d227417@mail.gmail.com> <44D3EC13.2040307@hq.idt.net> Message-ID: On 8/5/06, Serge Aleynikov wrote: > One comment about a nice feature to have in edbc that I believe is > specific to OCI - array DML inserts, where bind variables can contain an > array of values. This saves quite a bit on network round trips when > inserting hundreds / thousands of records Just checking but: Is it truly the network roundtrip that take time? I learned that for postgres it will save time to wrap such imports with a transaction so one doesnt need to lock for every insert. I mean, it is always nice to keep apis clean. From serge@REDACTED Sat Aug 5 03:22:53 2006 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 04 Aug 2006 21:22:53 -0400 Subject: Simple DB Access In-Reply-To: References: <200608011344.46076.mikael.karlsson@creado.com> <78568af10608021451w16b56a51s149433df4cff297@mail.gmail.com> <78568af10608041423iec41fc1u9b09081b6d5c606@mail.gmail.com> <78568af10608041613x1b5b6441xd551329e7d227417@mail.gmail.com> <44D3EC13.2040307@hq.idt.net> Message-ID: <44D3F2ED.5020208@hq.idt.net> Christian S wrote: > On 8/5/06, Serge Aleynikov wrote: >> One comment about a nice feature to have in edbc that I believe is >> specific to OCI - array DML inserts, where bind variables can contain an >> array of values. This saves quite a bit on network round trips when >> inserting hundreds / thousands of records > > Just checking but: Is it truly the network roundtrip that take time? I > learned that for postgres it will save time to wrap such imports with > a transaction so one doesnt need to lock for every insert. I mean, it > is always nice to keep apis clean. > This is taken from "Oracle? Call Interface Programmer's Guide Chapter 5": "The array interface significantly reduces round trips to the database when you are updating or inserting a large volume of data. This reduction can lead to considerable performance gains in a busy client/server environment. For example, consider an application that needs to insert 10 rows into the database. Calling OCIStmtExecute() ten times with single values results in ten network round trips to insert all the data. The same result is possible with a single call to OCIStmtExecute() using an input array, which involves only one network round trip." Serge From ulf@REDACTED Sat Aug 5 12:15:01 2006 From: ulf@REDACTED (Ulf Wiger) Date: Sat, 05 Aug 2006 12:15:01 +0200 Subject: Simple DB Access In-Reply-To: References: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> <200608011344.46076.mikael.karlsson@creado.com> <78568af10608021451w16b56a51s149433df4cff297@mail.gmail.com> <78568af10608041423iec41fc1u9b09081b6d5c606@mail.gmail.com> Message-ID: Den 2006-08-05 00:20:20 skrev Christian S : > << Anyone have a SQL92 parser written in erlang/yecc alraedy? Not? > Know where the bnf for SQL92 can be found? I recall seeing it in a > book appendix once.>> There is one - or two actually. A mapping of SQL to Mnemosyne LCs was done as a MSc thesis project. There was one working implementation of a decent subset of SQL92, and a broken yecc version of the full SQL92 grammar. I've been meaning to package it and let it out into the wild (not that I was personally involved in the project), but haven't had the time. I did do some optimizations of the SQL to Mnemosyne transformation, as it was a bit too inefficient for me to keep my hands off it. (: I wouldn't mind handing it off to someone else, as my plate is a bit full at the moment. Just let me know. BR, Ulf W -- Ulf Wiger From ke.han@REDACTED Sat Aug 5 17:47:14 2006 From: ke.han@REDACTED (ke han) Date: Sat, 5 Aug 2006 23:47:14 +0800 Subject: erland editor In-Reply-To: References: Message-ID: Sounds more like an IDE question than an editor question. But if you just want an editor that is a general purpose modern editor, there are syntax files for VIM, UltraEdit and TextMate (Mac). The IDE (emacs+distel and Erlide have already been covered here. Bottom line on these two is if you already know emac or don't mind the learning curve, is a good choice. Otherwise, erlide is the right direction. have fun, ke han On Aug 2, 2006, at 11:33 PM, BLANCHARD Walter ORANGE-FT wrote: > > hi everyone! > > I'd like to know if there's an editor/ compiler for erlang. I know > emacs is here, and that eclipse > gets its erlide, but i'm looking for a really dedicated one. > > Thank you > > > ******************************** > Ce message et toutes les pieces jointes (ci-apres le "message") > sont confidentiels et etablis a l'intention exclusive de > ses destinataires. > Toute utilisation ou diffusion non autorisee est interdite. > Tout message electronique est susceptible d'alteration. Le Groupe > France Telecom decline toute responsabilite au titre de > ce message s'il a ete altere, deforme ou falsifie. > Si vous n'etes pas destinataire de ce message, merci de le detruire > immediatement et d'avertir l'expediteur. > ********************************* > This message and any attachments (the "message") are confidential > and intended solely for the addressees. Any unauthorised > use or dissemination is prohibited. > Messages are susceptible to alteration. France Telecom Group shall > not be liable for the message if altered, changed or > falsified. > If you are not the intended addressee of this message, please > cancel it immediately and inform the sender. > ******************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From rsaccon@REDACTED Sat Aug 5 21:41:56 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Sat, 5 Aug 2006 16:41:56 -0300 Subject: R11B installation problem on debian Message-ID: I have previously successfully installed Erlang R11B on my Ubuntu machine, now I tried on a debian sarge server and after some minutes of compiling, I got an error. Here what I did: wget http://erlang.org/download/otp_src_R11B-0.tar.gz mkdir /usr/local/erlang cd /usr/local/erlang gunzip -c /home/myuser/otp_src_R11B-0.tar.gz | tar xfp - cd otp_src_R11B-0 LANG=C; export LANG ./configure make ---------------------------------- Compilation output just before error: make[1]: Entering directory `/usr/local/erlang/otp_src_R11B-0/erts' make[2]: Entering directory `/usr/local/erlang/otp_src_R11B-0/erts/start_scripts' sed -e 's;%SYS_VSN%;R11B;' \ -e 's;%ERTS_VSN%;5.5;' \ -e 's;%KERNEL_VSN%;2.11;' \ -e 's;%STDLIB_VSN%;1.14;' \ /usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_clean.rel.src > /usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_clean.rel sed -e 's;%SYS_VSN%;R11B;' \ -e 's;%ERTS_VSN%;5.5;' \ -e 's;%KERNEL_VSN%;2.11;' \ -e 's;%STDLIB_VSN%;1.14;' \ -e 's;%SASL_VSN%;2.1.2;' \ /usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_sasl.rel.src > /usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_sasl.rel sed -e 's;%SYS_VSN%;R11B;' \ -e 's;%ERTS_VSN%;5.5;' \ -e 's;%KERNEL_VSN%;2.11;' \ -e 's;%STDLIB_VSN%;1.14;' \ -e 's;%SASL_VSN%;2.1.2;' \ -e 's;%OS_MON_VSN%;2.1;' \ -e 's;%MNESIA_VSN%;4.3.1;' \ -e 's;%SNMP_VSN%;;' \ -e 's;%INETS_VSN%;4.7.4;' \ /usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_all_example.rel.src > /usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_all_example.rel /usr/bin/install -c -d /usr/local/erlang/otp_src_R11B-0/erts/start_scripts/tmp ( cd /usr/local/erlang/otp_src_R11B-0/erts/start_scripts/tmp && \ erlc -W -I/usr/local/erlang/otp_src_R11B-0/lib/kernel/ebin -I/usr/local/erlang/otp_src_R11B-0/lib/stdlib/ebin -I/usr/local/erlang/otp_src_R11B-0/lib/sasl/ebin -o /usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_clean.script /usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_clean.rel ) stdlib: File not found: "stdlib.app" make[2]: *** [/usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_clean.script] Error 1 make[2]: Leaving directory `/usr/local/erlang/otp_src_R11B-0/erts/start_scripts'make[1]: *** [local_setup] Error 2 make[1]: Leaving directory `/usr/local/erlang/otp_src_R11B-0/erts' make: *** [local_setup] Error 2 debian:/usr/local/erlang/otp_src_R11B-0# -------------------------------------------------------- "stdlib.app" did not get created, but I am not familar yet with the buildsystem and don't know where and why that happend. Anybody knows what I need to do to make it work, or at least where I should start to troubleshoot ? -- Roberto Saccon From luke@REDACTED Sat Aug 5 23:00:39 2006 From: luke@REDACTED (Luke Gorrie) Date: Sat, 05 Aug 2006 23:00:39 +0200 Subject: ermacs: does anybody needs a erlang ed? References: <44D3CE45.20203@neuf.fr> Message-ID: widjayy writes: > I wanted to download this great erlang editor, ermacs, but.... nothing. You will need to check it out from CVS: http://sourceforge.net/cvs/?group_id=73688 From jacobopolavieja@REDACTED Sun Aug 6 16:39:46 2006 From: jacobopolavieja@REDACTED (Jacobo =?ISO-8859-1?Q?Garc=EDa?= de Polavieja Aguilera) Date: Sun, 06 Aug 2006 16:39:46 +0200 Subject: Erlang for desktop applications? Message-ID: <1154875186.9952.7.camel@cerebellum> Hi everybody: I am new to functional programming (just some very little experience with Lisp). I got interested in functional programming because of the performance related to multiproccessors or multicore systems. And I got interested in Erlang over other FP languages because its fame for easy parallelism management and its performance compared to Haskell or others. But, do you see Erlang suitable for developing future (more than 5 years from now) desktop applications? I know it wasn't designed for this, and that there are very important actions like string functions which are slow in Erlang... but then I also ran into EX11 and similar projects which seem like a little light for my future purpose. Could be erlang efficient with desktop related stuff? If not, could you recommend other functional languages that fit best that objective? I'm looking forward to efficiency on future multicore processors and easy concurrency management. Thanks all. From w.a.de.jong@REDACTED Sun Aug 6 21:55:14 2006 From: w.a.de.jong@REDACTED (Willem de Jong) Date: Sun, 6 Aug 2006 21:55:14 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <44D30DE3.8010305@telia.com> References: <44D0B193.3030406@ericsson.com> <44D1D9FD.1000106@telia.com> <200608031710.50656.ft@it.su.se> <44D30DE3.8010305@telia.com> Message-ID: <407d9ef80608061255h1304ae48k621aba7778759e83@mail.gmail.com> Hi, I think regexp is too slow on exactly the kind of pattern that was used in the 'benchmark': patterns that contain a long(ish) literal string, especially if they start with it. Regexp:parse() translates the pattern to a compiled RE that looks like this (for ABC): {concat, concat{A, B}, C}. As long as no match is found, the algorithm tries to match every character against the compiled RE. For every character, it has to traverse the tree down to the A. If the pattern is longer, the tree grows 'deeper' (one additional level with each additional character), and this process takes more time. The solution (I think) is to change the result of regexp:parse to something that looks like this: {concat, A, concat{B, C}}. Then it will find the A much quicker. I wrote a 'post-processing' module that modifies the compiled RE as described. I also changed a few things to the main function that does the matching (re_apply), but I am not sure whether that was really necessary. (If you want I can send you the code). On my PC it is not so easy to measure response-time, but my impression is that this improved the result for the benchmark by a factor 3. Regards, Willem On 8/4/06, Robert Virding wrote: > Ah, but that's a bug! That doesn't count. :-) > > Looking at the regexp I think I can guess what is going wrong. Anchoring > patterns at the beginning of a line is not as easy as one would think. > Leex doesn't handle it. > > Seriously though, I would like some REAL problems to experiment on. > > Robert > > Fredrik Thulin wrote: > > On Thursday 03 August 2006 13:11, Robert Virding wrote: > > ... > > > >>Could someone send a real problem to experiment on? Especially one > >>which the current regexp module is definitely too slow on. > > > > > > Here is a regexp that the regexp module is definately too slow on ;) : > > > > regexp:match("+461234", "^+46(.*)$"). > > > > Previously reported in > > > > http://www.erlang.org/ml-archive/erlang-questions/200404/msg00105.html > > > > /Fredrik > > > > From ryanobjc@REDACTED Sun Aug 6 23:06:53 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Sun, 6 Aug 2006 14:06:53 -0700 Subject: Erlang for desktop applications? In-Reply-To: <1154875186.9952.7.camel@cerebellum> References: <1154875186.9952.7.camel@cerebellum> Message-ID: <78568af10608061406v5b83aed4nc59af0452f4e5dc3@mail.gmail.com> Have a look a F# - OCaml on .NET. Also check out wings3d - a "desktop appliation" written in Erlang. The real problems behind writing a desktop app I think have to do with UI and GUI issues. For example, TK is an ugly UI on any system - and its the widly available default UI. What I really want is Cocoa bindings. Maybe I should write that. -ryan On 8/6/06, Jacobo Garc?a de Polavieja Aguilera wrote: > Hi everybody: > I am new to functional programming (just some very little experience > with Lisp). I got interested in functional programming because of the > performance related to multiproccessors or multicore systems. And I got > interested in Erlang over other FP languages because its fame for easy > parallelism management and its performance compared to Haskell or > others. > But, do you see Erlang suitable for developing future (more than 5 years > from now) desktop applications? I know it wasn't designed for this, and > that there are very important actions like string functions which are > slow in Erlang... but then I also ran into EX11 and similar projects > which seem like a little light for my future purpose. > Could be erlang efficient with desktop related stuff? If not, could you > recommend other functional languages that fit best that objective? > I'm looking forward to efficiency on future multicore processors and > easy concurrency management. > > Thanks all. > > From joelr1@REDACTED Sun Aug 6 23:28:30 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sun, 6 Aug 2006 22:28:30 +0100 Subject: Mac Intel In-Reply-To: <200608062111.k76LBoaw017823@harpo.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> Message-ID: <05395974-50A5-4F78-AEB6-E0F6B961C9BA@gmail.com> On Aug 6, 2006, at 10:11 PM, Mikael Pettersson wrote: > Unless you have the source code for the OSX C library, you basically > have to run 'nm' on the library files to find all versions of > sigaction(), > and then experiment with defining sigaction() as a wrapper around > those > C-library internal sigaction() functions until you find a combination > that works. Disassembling parts of the library may also be necessary. Isn't there HiPE for Mac OSX PPC? I'm almost positive there is. If there's HiPE for Mac OSX then the sigaction bits would have already been taken care of, no? The operating system did not change, the processor architecture did. -- http://wagerlabs.com/ From nm@REDACTED Mon Aug 7 00:53:48 2006 From: nm@REDACTED (Gaspar Chilingarov) Date: Mon, 07 Aug 2006 03:53:48 +0500 Subject: erl_interface weirdness? Message-ID: <44D672FC.60502@web.am> Hi all! I'm making experiments to force vim talk to erlang directly and faced following problem: when I have code ETERM *top, *termp; top = erl_global_whereis(erlang_fd, "zzz", node); termp = erl_format("text"); res = erl_send(erlang_fd, top, termp); the message normally reaches process, registred on erlang node with the global:register_name(zzz, Pid) when I use ETERM *termp; termp = erl_format("text"); res = erl_reg_send(erlang_fd, "zzz", termp); I get success result code in the res, but the message is LOST. Registered process does not receive it at all. It this a bug or it is my misunderstanding ? I'm working with short node names, if it matters. -- Gaspar Chilingarov System Administrator, Network security consulting t +37493 419763 (mob) i 63174784 e nm@REDACTED From cyberhigh@REDACTED Mon Aug 7 01:19:55 2006 From: cyberhigh@REDACTED (CyBerHigh) Date: Sun, 06 Aug 2006 18:19:55 -0500 Subject: Erlang for desktop applications? In-Reply-To: <78568af10608061406v5b83aed4nc59af0452f4e5dc3@mail.gmail.com> References: <1154875186.9952.7.camel@cerebellum> <78568af10608061406v5b83aed4nc59af0452f4e5dc3@mail.gmail.com> Message-ID: <44D6791B.20805@gurusnetwork.org> Cocoa bindings would only be good for mac. I think there needs to be GTK bindings or a new GUI built around erlang. I beleave erlang could be used now for desktops apps, only if there GUI where there. But a few fixes to how it handles strings and floating point numbers would make for an even better enverment to work in. Ryan Rawson wrote: > Have a look a F# - OCaml on .NET. > > Also check out wings3d - a "desktop appliation" written in Erlang. > > The real problems behind writing a desktop app I think have to do with > UI and GUI issues. For example, TK is an ugly UI on any system - and > its the widly available default UI. > > What I really want is Cocoa bindings. Maybe I should write that. > > -ryan > > > On 8/6/06, Jacobo Garc?a de Polavieja Aguilera > wrote: >> Hi everybody: >> I am new to functional programming (just some very little experience >> with Lisp). I got interested in functional programming because of the >> performance related to multiproccessors or multicore systems. And I got >> interested in Erlang over other FP languages because its fame for easy >> parallelism management and its performance compared to Haskell or >> others. >> But, do you see Erlang suitable for developing future (more than 5 years >> from now) desktop applications? I know it wasn't designed for this, and >> that there are very important actions like string functions which are >> slow in Erlang... but then I also ran into EX11 and similar projects >> which seem like a little light for my future purpose. >> Could be erlang efficient with desktop related stuff? If not, could you >> recommend other functional languages that fit best that objective? >> I'm looking forward to efficiency on future multicore processors and >> easy concurrency management. >> >> Thanks all. >> >> > > > > From ok@REDACTED Mon Aug 7 04:09:53 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 7 Aug 2006 14:09:53 +1200 (NZST) Subject: pcre, bifs, drivers and ports Message-ID: <200608070209.k7729rYi116857@atlas.otago.ac.nz> Robert Virding wrote: The best way to go continue is to decide what we would like a regexp package to be able to do. I used the regexps and interfaces (sub, gsub etc) to them from standard AWK which were well defined, stable and allowed you to do most things. Perhaps the POSIX definition is the way to go. HAH! This year I've got my 3rd-year Software Engineering class maintaining Mawk. Amongst other things this has had me reading the Single Unix Specification, 3rd edition (which is pretty close to POSIX) with a microscope. One thing we learn from a close reading is that AWK regular expressions are one thing (they include "|" but not back-references) and POSIX regular expressions are another (or more precisely, two other things: Basic REs contain neither "|" not back-references, Extended REs contain both). A particularly entertaining (if you like pain) read is the Mac OS X manual page for regcomp, which says near the end: There are a number of decisions that IEEE Std 1003.2 ... leaves up to the implementor, either by explicitly saying "undefined" or by virtue of them being forbidden by the RE grammar. There then follow (by my count) 13 such decisions. I particularly like the BUGS section where we are told: The back-reference code is subtle and doubts linger about its correctness... The regexec function is largely insensitive to RE complexity except that back references are massively expensive. ... Due to a mistake in IEEE STd 1003.2 things like "a)b" are legal ... The standard definition of back references is vague ... Since back references turn regexp matching from O(M*N) to NP-hard, maybe it's a good thing that AWK regular expressions don't include them and Erlang shouldn't either. >From the AWK specification, just grepping for 'undefined', we find \0 \00 \000 are all undefined \x is undefined except for a handful of x values; in particular \x is undefined. Matching a string that contains a NUL anywhere is undefined. sub(/regexp/, repl, (x)) is undefined. and implicitly, all of the issues identified in the Mac OS X manual page apply, and DO vary between AWK implementations. (Hey, I've been writing test cases!) Most features (for example backreferences) are pretty easy to implement when interpreting the regexp or using an NFA but difficult compiled/with a DFA. Actually adding backreferences is to regexp is probably easier then fixing the bug Fredrik Thulin mentioned. And much more fun. :-) I am reluctant to suggest anything that might break compatiblity, but when that compatibility is somewhat tenuous to start with, the difference between something that's guaranteed fast (regexps WITHOUT back references) and something that's pretty much guaranteed slow *and* unclear (regexps WITH back references) begins to matter more. I therefore strongly suggest that back references be kept out of Erlang regular expressions. If they really were "pretty easy to implement" there would be more agreement about what they are supposed to do. From ryanobjc@REDACTED Mon Aug 7 05:16:18 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Sun, 6 Aug 2006 20:16:18 -0700 Subject: Erlang for desktop applications? In-Reply-To: <44D6791B.20805@gurusnetwork.org> References: <1154875186.9952.7.camel@cerebellum> <78568af10608061406v5b83aed4nc59af0452f4e5dc3@mail.gmail.com> <44D6791B.20805@gurusnetwork.org> Message-ID: <78568af10608062016t3a8340f8ycb83e32f75bcc5bd@mail.gmail.com> Ironically GTK doesn't really address the realistic needs of a desktop application. Printing? Maybe things are better than the last time I looked at it, but I don't care as much about Linux on the desktop. I heard that wxWindows is not so great for large apps. I don't know why, but I suspect it may have to do with the class structure or something. As for OSX, sounds good to me :-) On 8/6/06, CyBerHigh wrote: > Cocoa bindings would only be good for mac. I think there needs to be > GTK bindings or a new GUI built around erlang. I beleave erlang could > be used now for desktops apps, only if there GUI where there. But a few > fixes to how it handles strings and floating point numbers would make > for an even better enverment to work in. > Ryan Rawson wrote: > > Have a look a F# - OCaml on .NET. > > > > Also check out wings3d - a "desktop appliation" written in Erlang. > > > > The real problems behind writing a desktop app I think have to do with > > UI and GUI issues. For example, TK is an ugly UI on any system - and > > its the widly available default UI. > > > > What I really want is Cocoa bindings. Maybe I should write that. > > > > -ryan > > > > > > On 8/6/06, Jacobo Garc?a de Polavieja Aguilera > > wrote: > >> Hi everybody: > >> I am new to functional programming (just some very little experience > >> with Lisp). I got interested in functional programming because of the > >> performance related to multiproccessors or multicore systems. And I got > >> interested in Erlang over other FP languages because its fame for easy > >> parallelism management and its performance compared to Haskell or > >> others. > >> But, do you see Erlang suitable for developing future (more than 5 years > >> from now) desktop applications? I know it wasn't designed for this, and > >> that there are very important actions like string functions which are > >> slow in Erlang... but then I also ran into EX11 and similar projects > >> which seem like a little light for my future purpose. > >> Could be erlang efficient with desktop related stuff? If not, could you > >> recommend other functional languages that fit best that objective? > >> I'm looking forward to efficiency on future multicore processors and > >> easy concurrency management. > >> > >> Thanks all. > >> > >> > > > > > > > > > > From ok@REDACTED Mon Aug 7 05:43:17 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 7 Aug 2006 15:43:17 +1200 (NZST) Subject: Erlang for desktop applications? Message-ID: <200608070343.k773hHot116313@atlas.otago.ac.nz> Jacobo =?ISO-8859-1?Q?Garc=EDa?= de Polavieja Aguilera asked: But, do you see Erlang suitable for developing future (more than 5 years from now) desktop applications? I know it wasn't designed for this, and that there are very important actions like string functions which are slow in Erlang... ARE they? Have you measured them? We had a lengthy thread not so long ago where I pointed out that there is more than one way to represent a string, and that for many applications the traditional packed-array-of-bytes is a rather bad representation. (For example, for Information Retrieval a list of word numbers may be better.) And it is much easier to experiment with unusual text representations in a language like Erlang than in a language like C++ or Java. A colleague and I are teaching a 4th year "advanced object oriented programming" paper. He and I agree about lots of things, some of which other people in the department don't agree about. One of them is that in 10 years time if you can't write reliable highly concurrent code you will probably be out of business. (Assume Moore's Law keeps going, but with respect to total performance of multicore systems rather than per-core performance, and in 10 years time we'll see kilocore machines on the desk top. They will probably be running some sort of virtual reality sex game.) So last week he spent a lecture on Occam (which to my pleased surprise is still around even though Transputers are dead; KROC is even freely downloadable and installed without any problems). This week I'm going to spend a lecture on Erlang. Let's assume an 18-month doubling time, and let's take 4 cores as the starting point. (I have a copy of "Dual-Core Update to the Intel(R) Itanium(R) 2 Processor Reference Manual, and Sun's Niagara is 8-core, so I'm taking 4 cores as a sort of midpoint.) In five years, we'll expect there to be desktop machines with 32 cores. (Ooh, I just noticed this from InfoWorld back in 2004: NEC developed a cellphone chip, the MP211, with three ARM cores plus a DSP, so that's a four-core chip in your hand. Hmm. There's an "image processor" on the chip as well, according to the NEC web site. What I can't find is a price for these things.) but then I also ran into EX11 and similar projects which seem like a little light for my future purpose. Could be erlang efficient with desktop related stuff? It all depends on what you do on your desktop. Did you see the article someone mentioned recently about decoding some sort of video format in Erlang? If you are doing something like music or video editing on your desktop, perhaps what really matters for performance is the DSP or GP, not the "steering" code. If you are doing information retrieval or data mining, heck, people even do that in Java (although I do *wish* that the NCSA ALG group would spend some time producing usable documentation for their program; I would cheerfully accept something 10 times as slow with a manual just 2 times as big if it had the right stuff in the manual), because if you have good data structures it's probably I/O bandwidth that matters rather than CPU speed. (We have a student looking at information retrieval on a multicore machine, and it's not clear that there's going to be a result other than "I/O concurrency is the right kind".) If not, could you recommend other functional languages that fit best that objective? I'm looking forward to efficiency on future multicore processors and easy concurrency management. There's always ML. As a happy Haskeller, I do find the syntax of SML clunky, and O'CAML even worse. Sadly, O'CAML is one of the fastest systems around. Although Mlton (no typing mistake, it really is m l t o n) is a darned good batch compiler for SML. And although concurrency isn't officially standard in ML, both SML/NJ and Mlton support the CML extensions. The SML Basis Library includes particularly good support for substrings, if string hacking is important in what you do. There are also concurrent versions of Haskell, and Haskell these days is doing some *awesome* things with generic programming (think "type safe programming ON the language IN the language" and "automatic derivation of large chunks of code"). Clean generates pretty darned good code, and a somewhat different version of generic programming, but they've dropped concurrency support, for now at least. Then there's Mercury, which gives you logic programming and (strict) functional programming and constraint programming all in one strictly typed and heavily checked box. (The compiler will even try to figure out whether procedures must always terminate, although the Halting Problem result means that it can't always be sure.) People are using that for desktop stuff. Given Erlang's support for interfaces (CORBA, ASN.1, C, Java, you name it) it's difficult to think of any likely desktop application where Erlang couldn't have _some_ practical use. From dgud@REDACTED Mon Aug 7 10:36:29 2006 From: dgud@REDACTED (Dan Gudmundsson) Date: Mon, 7 Aug 2006 10:36:29 +0200 Subject: deleting records from mnesia In-Reply-To: <3bb44c6e0607191140v28d90e3bye0fec670f4646f25@mail.gmail.com> References: <3bb44c6e0607191140v28d90e3bye0fec670f4646f25@mail.gmail.com> Message-ID: <17622.64397.580772.730816@bifur.du.uab.ericsson.se> The reason is that to maintain equal functionality with the rest of api (a read after a delete will yield []) either mnesia needs copy the entire table to it's local transaction store which probably isn't good if the table is large, or every operation needs to check if the table is deleted and thus it will have a performance penelty on every operation. /Dan bryan rasmussen writes: > > The only change that's required is that > > mnesia_schema:do_clear_table/1 is exported. > > > > Is there any reason that it wasn't exported in the first place? > > Cheers, > Bryan Rasmussen From mikpe@REDACTED Sun Aug 6 11:11:14 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Sun, 6 Aug 2006 11:11:14 +0200 (MEST) Subject: R11B installation problem on debian Message-ID: <200608060911.k769BE0C010646@harpo.it.uu.se> On Sat, 5 Aug 2006 16:41:56 -0300, Roberto Saccon wrote: >I have previously successfully installed Erlang R11B on my Ubuntu >machine, now I tried on a debian sarge server and after some minutes >of compiling, I got an error. ... >erlc -W -I/usr/local/erlang/otp_src_R11B-0/lib/kernel/ebin >-I/usr/local/erlang/otp_src_R11B-0/lib/stdlib/ebin >-I/usr/local/erlang/otp_src_R11B-0/lib/sasl/ebin -o >/usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_clean.script >/usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_clean.rel ) >stdlib: File not found: "stdlib.app" > >make[2]: *** [/usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_clean.script] >Error 1 >make[2]: Leaving directory >`/usr/local/erlang/otp_src_R11B-0/erts/start_scripts'make[1]: *** >[local_setup] Error 2 >make[1]: Leaving directory `/usr/local/erlang/otp_src_R11B-0/erts' >make: *** [local_setup] Error 2 >debian:/usr/local/erlang/otp_src_R11B-0# I suspect that a previous error left lib/stdlib/ incomplete and without a stdlib.app. You should check the make log for earlier errors as well. From mikpe@REDACTED Mon Aug 7 09:10:57 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 7 Aug 2006 09:10:57 +0200 (MEST) Subject: Mac Intel Message-ID: <200608070710.k777Av7g025208@harpo.it.uu.se> On Sun, 6 Aug 2006 22:28:30 +0100, Joel Reymont wrote: > On Aug 6, 2006, at 10:11 PM, Mikael Pettersson wrote: > > > Unless you have the source code for the OSX C library, you basically > > have to run 'nm' on the library files to find all versions of > > sigaction(), > > and then experiment with defining sigaction() as a wrapper around > > those > > C-library internal sigaction() functions until you find a combination > > that works. Disassembling parts of the library may also be necessary. > > Isn't there HiPE for Mac OSX PPC? I'm almost positive there is. Yes, HiPE/ppc32 supports both Linux and OSX. > If > there's HiPE for Mac OSX then the sigaction bits would have already > been taken care of, no? No. Only x86/amd64 needs the sigaltstack semantics; neither SPARC, ppc32, nor ARM needs it. (ARM could use it to free up a register, but the small performance improvement from that would likely be cancelled by higher BIF call costs, and of course more implementation complexity, so I haven't bothered trying that yet.) > The operating system did not change, the > processor architecture did. And that makes a world of difference. x86/amd64 is very very different from run-of-the-mill RISCs due to (a) few registers in the visible instruction set, and (b) that the return stack branch predictor only is effective when call/ret are used. M68K would have similar issues, if it there were any viable modern implementations of it. From mikpe@REDACTED Sun Aug 6 23:11:50 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Sun, 6 Aug 2006 23:11:50 +0200 (MEST) Subject: Mac Intel Message-ID: <200608062111.k76LBoaw017823@harpo.it.uu.se> On Fri, 4 Aug 2006 02:41:47 +0100, Joel Reymont wrote: >On Aug 4, 2006, at 2:33 AM, Mikael Pettersson wrote: > >> The issue is not x86 but the operating system and C library. >> To support HiPE on x86 or amd64 we need to be able to enforce >> sigaltstack semantics on all signal handlers. We can do this >> with Linux/glibc on x86/amd64 and Solaris/x86 (not yet ported >> to Solaris/amd64 due to lack of availability), but we have no >> idea how to do this on MacTel. > >Well... The semantics of sigaltstack should be the same across Mac >OSX PPC and Mac OSX Intel, at least I think so. HiPE is supposed in >Mac OSX PPC from what I remember. I'm very much trivializing things >but I wonder if there's a straightforward way to keep the Mac OSX PPC >semantics while plugging in the Intel code generation. > >If you would be kind enough to guide me I could look into adding HiPE >functionality to Mac Intel as I have time to spare. The key is to "enforce sigaltstack semantics on ALL signal handlers". This includes not only the sigaction() calls we write ourselves in the erts source code, but also any direct or indirect sigaction()s in libraries linked with erts, including the C library itself. For instance, alarms, asynchronous I/O, and profiling (gcc -pg) can all cause new signal handlers to be installed and invoked. The solution I use in HiPE/x86 is to redirect sigaction() and the C library's internal sigaction() function to our own version which adds the SA_ONSTACK flag to enforce sigaltstack semantics, and then invokes the low-level sigaction() system call. The code for this is quite messy and highly dependent on C library internals; see erts/emulator/hipe/hipe_x86_signal.c for details. Unless you have the source code for the OSX C library, you basically have to run 'nm' on the library files to find all versions of sigaction(), and then experiment with defining sigaction() as a wrapper around those C-library internal sigaction() functions until you find a combination that works. Disassembling parts of the library may also be necessary. From jeff@REDACTED Mon Aug 7 00:24:35 2006 From: jeff@REDACTED (Jeff Wood) Date: Sun, 06 Aug 2006 15:24:35 -0700 Subject: Erlang for desktop applications? In-Reply-To: <78568af10608061406v5b83aed4nc59af0452f4e5dc3@mail.gmail.com> References: <1154875186.9952.7.camel@cerebellum> <78568af10608061406v5b83aed4nc59af0452f4e5dc3@mail.gmail.com> Message-ID: <44D66C23.7030801@dark-light.com> Ryan Rawson wrote: > Have a look a F# - OCaml on .NET. > > Also check out wings3d - a "desktop appliation" written in Erlang. > > The real problems behind writing a desktop app I think have to do with > UI and GUI issues. For example, TK is an ugly UI on any system - and > its the widly available default UI. > > What I really want is Cocoa bindings. Maybe I should write that. > > -ryan > > > On 8/6/06, Jacobo Garc?a de Polavieja Aguilera > wrote: > >> Hi everybody: >> I am new to functional programming (just some very little experience >> with Lisp). I got interested in functional programming because of the >> performance related to multiproccessors or multicore systems. And I got >> interested in Erlang over other FP languages because its fame for easy >> parallelism management and its performance compared to Haskell or >> others. >> But, do you see Erlang suitable for developing future (more than 5 years >> from now) desktop applications? I know it wasn't designed for this, and >> that there are very important actions like string functions which are >> slow in Erlang... but then I also ran into EX11 and similar projects >> which seem like a little light for my future purpose. >> Could be erlang efficient with desktop related stuff? If not, could you >> recommend other functional languages that fit best that objective? >> I'm looking forward to efficiency on future multicore processors and >> easy concurrency management. >> >> Thanks all. >> >> Actually, I'd love to see a port of wxWindows for Erlang ... it's slots & signals methodology should work well with Erlangs comms style. jd From drafkind@REDACTED Mon Aug 7 05:43:18 2006 From: drafkind@REDACTED (drafkind@REDACTED) Date: Sun, 6 Aug 2006 23:43:18 -0400 (EDT) Subject: erlang and gis Message-ID: <20060806234318.BTK57028@po1.mail.umd.edu> Hello, I have some questions related to Erlang and GIS: 1 - does MNesia have the ability to use custom indexing schemes (R-trees for spatial queries)? 2 - if using the direct-link (in-process) FFI, does the entire heavyweight Erlang VM process block during native FFI calls? Thanks Dave From ke.han@REDACTED Mon Aug 7 11:09:23 2006 From: ke.han@REDACTED (ke han) Date: Mon, 7 Aug 2006 17:09:23 +0800 Subject: Erlang for desktop applications? In-Reply-To: <1154875186.9952.7.camel@cerebellum> References: <1154875186.9952.7.camel@cerebellum> Message-ID: I think your question isn't so straightforward. Lets ignore erlang's lack of certain UI library wrappers for a moment to think about what a desktop apps' UI will look like in 5 years. As you stated: > But, do you see Erlang suitable for developing future (more than 5 > years > from now) desktop applications? > A "desktop app" in 5 years will most likely fall into one of 2 categories: 1 - Traditional GUI app...highly integrated UI and domain logic for graphics intensive apps (think Photoshop). 2 - 2-tier: View separated from domain logic. Think of just about every next-gen web app being written today (this includes replacements for fairly complex and expressive UIs such as Word and Excel) So, unless you are creating things like Photoshop (I bet we'll see a web service replacement for 80% of its' features in the next 5 years) or Wings3D, think of the "App UI", not the "Desktop UI". There are many variations on a meme for creating App UIs (in browser, Flash, "smart components which talk to servers (local and remote".) If your app fits into this later category, I'd say erlang is a better fit than many languages for the domain part of the app. The View part will be HTML, Javascript, Haxe, Flash, VRML, who knows...this new App UI infrastructure stuff "sits on top of / integrated into" your Desktop GUI, so the App developer is not concerned at this level. Adding erlang wrappers to various GUI libraries (GTK, Win32, Cocoa) is a straightforward matter. "How do you really want to build a new desktop app (regardless of language)?" is the hard part. There has been some talk on the yaws list and some here regarding dynamic Web UIs. This is the general direction app developers are taking and there will exist / do exist methods to make these apps "work like / install like" the desktop apps you are accustomed. regards, ke han On Aug 6, 2006, at 10:39 PM, Jacobo Garc?a de Polavieja Aguilera wrote: > Hi everybody: > I am new to functional programming (just some very little experience > with Lisp). I got interested in functional programming because of the > performance related to multiproccessors or multicore systems. And I > got > interested in Erlang over other FP languages because its fame for easy > parallelism management and its performance compared to Haskell or > others. > But, do you see Erlang suitable for developing future (more than 5 > years > from now) desktop applications? I know it wasn't designed for this, > and > that there are very important actions like string functions which are > slow in Erlang... but then I also ran into EX11 and similar projects > which seem like a little light for my future purpose. > Could be erlang efficient with desktop related stuff? If not, could > you > recommend other functional languages that fit best that objective? > I'm looking forward to efficiency on future multicore processors and > easy concurrency management. > > Thanks all. > From dmitriid@REDACTED Mon Aug 7 12:26:34 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Mon, 7 Aug 2006 13:26:34 +0300 Subject: Erlang for desktop applications? In-Reply-To: <78568af10608070134ya34aeear30997d40e1318deb@mail.gmail.com> References: <1154875186.9952.7.camel@cerebellum> <78568af10608061406v5b83aed4nc59af0452f4e5dc3@mail.gmail.com> <44D6791B.20805@gurusnetwork.org> <78568af10608062016t3a8340f8ycb83e32f75bcc5bd@mail.gmail.com> <78568af10608070134ya34aeear30997d40e1318deb@mail.gmail.com> Message-ID: Depends on what you mean by "desktop services" :) Printing? Qt has it. Graphics? Also there (fast 2-D, SVG and OpenGL). Moreover, the Qt for Java is a proof-of-concept by Trolltech to show that bindings to Qt can by successfully created for other languages, not only for C++ (there is also a pyQt binding for Python). What I'm saying is - Qt is as good a framework to build upon as any. On 8/7/06, Ryan Rawson wrote: > Not interested in java things. I won't even consider it - waste of > time/resources imho. > > I'm familiar with QT, but still it doesnt really address my bottom > line... its just a UI toolkit, it doesnt provide desktop services, > does it? > > -ryan > > On 8/7/06, Dmitrii Dimandt wrote: > > What about Qt? They recently released a proof-of-concept Java binding > > (http://www.trolltech.com/developer/downloads/qt/qtjambi-techpreview). > > And their signal/slot concept could fit into Erlang's messaging model. > > It is cross-platform, too. > > > > On 8/7/06, Ryan Rawson wrote: > > > Ironically GTK doesn't really address the realistic needs of a desktop > > > application. Printing? Maybe things are better than the last time I > > > looked at it, but I don't care as much about Linux on the desktop. > > > > > > I heard that wxWindows is not so great for large apps. I don't know > > > why, but I suspect it may have to do with the class structure or > > > something. > > > > > > As for OSX, sounds good to me :-) > > > > > > From jacobopolavieja@REDACTED Mon Aug 7 13:06:43 2006 From: jacobopolavieja@REDACTED (=?UTF-8?B?SmFjb2JvIEdhcmPDrWEgZGUgUG9sYXZpZWph?=) Date: Mon, 07 Aug 2006 13:06:43 +0200 Subject: Erlang for desktop applications? In-Reply-To: <78568af10608062016t3a8340f8ycb83e32f75bcc5bd@mail.gmail.com> References: <1154875186.9952.7.camel@cerebellum> <78568af10608061406v5b83aed4nc59af0452f4e5dc3@mail.gmail.com> <44D6791B.20805@gurusnetwork.org> <78568af10608062016t3a8340f8ycb83e32f75bcc5bd@mail.gmail.com> Message-ID: <44D71EC3.3010104@gmail.com> Ryan Rawson wrote: > Ironically GTK doesn't really address the realistic needs of a desktop > application. Printing? Maybe things are better than the last time I > looked at it, but I don't care as much about Linux on the desktop. > > I heard that wxWindows is not so great for large apps. I don't know > why, but I suspect it may have to do with the class structure or > something. > > As for OSX, sounds good to me :-) > > On 8/6/06, CyBerHigh wrote: >> Cocoa bindings would only be good for mac. I think there needs to be >> GTK bindings or a new GUI built around erlang. I beleave erlang could >> be used now for desktops apps, only if there GUI where there. But a few >> fixes to how it handles strings and floating point numbers would make >> for an even better enverment to work in. >> Ryan Rawson wrote: >> > Have a look a F# - OCaml on .NET. >> > >> > Also check out wings3d - a "desktop appliation" written in Erlang. >> > >> > The real problems behind writing a desktop app I think have to do with >> > UI and GUI issues. For example, TK is an ugly UI on any system - and >> > its the widly available default UI. >> > >> > What I really want is Cocoa bindings. Maybe I should write that. >> > >> > -ryan >> > >> > >> > On 8/6/06, Jacobo Garc?a de Polavieja Aguilera >> > wrote: >> >> Hi everybody: >> >> I am new to functional programming (just some very little experience >> >> with Lisp). I got interested in functional programming because of the >> >> performance related to multiproccessors or multicore systems. And I >> got >> >> interested in Erlang over other FP languages because its fame for easy >> >> parallelism management and its performance compared to Haskell or >> >> others. >> >> But, do you see Erlang suitable for developing future (more than 5 >> years >> >> from now) desktop applications? I know it wasn't designed for this, >> and >> >> that there are very important actions like string functions which are >> >> slow in Erlang... but then I also ran into EX11 and similar projects >> >> which seem like a little light for my future purpose. >> >> Could be erlang efficient with desktop related stuff? If not, could >> you >> >> recommend other functional languages that fit best that objective? >> >> I'm looking forward to efficiency on future multicore processors and >> >> easy concurrency management. >> >> >> >> Thanks all. >> >> >> >> >> > >> > >> > >> > >> >> > Please don't turn this into a Cocoa VS GTK or OSX VS Linux debate ;-). WxWindows is not suitable for large application because it's a subset of all de backends it supports (GTK, WindowsForms, etc), so it gets complicated to do a big and nice GUI. It's usually pretty limited. What I'm trying to address here is... if there was a nice GUI (whichever) for Erlang... would Erlang be a nice option to develop desktop applications seeing dual and quadcore processors are coming? Even more... would it be suitable to develop its own GUI? Thanks for all the answers. From matthias@REDACTED Mon Aug 7 13:44:53 2006 From: matthias@REDACTED (Matthias Lang) Date: Mon, 7 Aug 2006 13:44:53 +0200 Subject: file:open() with 'compressed' flag silently accepts corrupt files Message-ID: <17623.10165.621231.105961@antilipe.corelatus.se> Bug or a feature? Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] Eshell V5.5 (abort with ^G) 1> {ok, Out} = file:open("/tmp/compressed", [write, compressed]). {ok,<0.34.0>} 2> file:write(Out, "hello world"), file:close(Out). ok 3> {ok, <<_, Corrupt/binary>>} = file:read_file("/tmp/compressed"). {ok,<<31,139,8,0,0,0,0,0,0,3,203,72,205,201,201,87,40,207,47,202,73,...>>} 4> file:write_file("/tmp/corrupt", Corrupt). ok 5> {ok, In} = file:open("/tmp/corrupt", [read, compressed]). {ok,<0.39.0>} 6> file:read(In, 1000). {ok,[139, 8, 0, 0, 0, 0, 0, 0, 3, 203, 72, 205,... I was expecting line 5 to fail, since the file no longer starts with the 'gzip magic'. A bit like what gzip does: >gunzip -c /tmp/corrupt gunzip: /tmp/corrupt: not in gzip format The 'transparently pass file data if the gzip magic isn't present' behaviour is inherited from the zlib code in gzio.c. It looks deliberate. Suggestion: alter the manual page for file:open thusly: compressed Makes it possible to read and write gzip compressed files. Unlike with other types of files, only one of the 'read' and 'write' modes may be specified. Note that the file size obtained with read_file_info/1 will most probably not match the number of bytes that can be read from a compressed file. Opening a file which is not in gzip format will result in the compressed flag being silently ignored. The simplest workaround for my problem is to add my own code to check for gzip magic before calling file:open. An alternative is to use the zlib module. Matthias From rsaccon@REDACTED Mon Aug 7 13:48:49 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Mon, 7 Aug 2006 08:48:49 -0300 Subject: R11B installation problem on debian In-Reply-To: <200608060911.k769BE0C010646@harpo.it.uu.se> References: <200608060911.k769BE0C010646@harpo.it.uu.se> Message-ID: I inspected the logfile for strange things and there were a lot of strange things and then I realized that on my XEN setup, I had only reserved 64 MB of RAM for that domain. After increasing that, it did still not work, then I tried with "./configure --disable-hipe" and finally it worked, but of course I don't want to disable hipe. Is there any known issue with debian sarge ? Any special library required ? On 8/6/06, Mikael Pettersson wrote: > On Sat, 5 Aug 2006 16:41:56 -0300, Roberto Saccon wrote: > >I have previously successfully installed Erlang R11B on my Ubuntu > >machine, now I tried on a debian sarge server and after some minutes > >of compiling, I got an error. > ... > >erlc -W -I/usr/local/erlang/otp_src_R11B-0/lib/kernel/ebin > >-I/usr/local/erlang/otp_src_R11B-0/lib/stdlib/ebin > >-I/usr/local/erlang/otp_src_R11B-0/lib/sasl/ebin -o > >/usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_clean.script > >/usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_clean.rel ) > >stdlib: File not found: "stdlib.app" > > > >make[2]: *** [/usr/local/erlang/otp_src_R11B-0/erts/start_scripts/start_clean.script] > >Error 1 > >make[2]: Leaving directory > >`/usr/local/erlang/otp_src_R11B-0/erts/start_scripts'make[1]: *** > >[local_setup] Error 2 > >make[1]: Leaving directory `/usr/local/erlang/otp_src_R11B-0/erts' > >make: *** [local_setup] Error 2 > >debian:/usr/local/erlang/otp_src_R11B-0# > > I suspect that a previous error left lib/stdlib/ incomplete > and without a stdlib.app. You should check the make log for > earlier errors as well. > -- Roberto Saccon From mikpe@REDACTED Mon Aug 7 14:26:42 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 7 Aug 2006 14:26:42 +0200 (MEST) Subject: R11B installation problem on debian Message-ID: <200608071226.k77CQgmM001334@harpo.it.uu.se> On Mon, 7 Aug 2006 08:48:49 -0300, Roberto Saccon wrote: > I inspected the logfile for strange things and there were a > lot of strange things and then I realized that on my XEN setup, I had > only reserved 64 MB of RAM for that domain. > > After increasing that, it did still not work, then I tried with > "./configure --disable-hipe" and finally it worked, but of course I > don't want to disable hipe. > > Is there any known issue with debian sarge ? Any special library required ? If both HiPE/x86 (or amd64) and threads are enabled, then you need either an NPTL glibc, or a LinuxThreads glibc that has been configured for a 2.3.99 or later kernel. Otherwise LinuxThreads can't use "floating stacks" and then it falls back to using %esp in ways that are fundamentally incompatible with HiPE/x86. The only solution if you have a misconfigured glibc is to disable either hipe or threads. From raimo@REDACTED Mon Aug 7 15:17:28 2006 From: raimo@REDACTED (Raimo Niskanen) Date: 07 Aug 2006 15:17:28 +0200 Subject: Posting policy Message-ID: Hi all! I have changed the posting policy on the mailing lists, so that now you will have to be member to post, and I will not have to wade through some 150 spam messages every morning to find the 3 a week that accidentally posted from another address than the one they subscribed from. Unfortunately beginners that forgot to subscribe will also be affected. A few new lines in http://www.erlang.org/faq.html will hopefully improve on that. -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From james.hague@REDACTED Mon Aug 7 15:27:18 2006 From: james.hague@REDACTED (James Hague) Date: Mon, 7 Aug 2006 08:27:18 -0500 Subject: Erlang for desktop applications? In-Reply-To: <1154875186.9952.7.camel@cerebellum> References: <1154875186.9952.7.camel@cerebellum> Message-ID: Erlang is fine for desktop applications--fantastic, even. Just make good use of the easy concurrency and integrated TCP support to communicate with external processes and make good use of languages with solid GUI libraries. Or, more succinctly, write the GUI portion of an application in Objective C (on the Mac) or C# (under Windows) and transfer data back and forth through a port. 'twould be nice to have solid GUI support in Erlang--wxWindows makes a lot of sense--but you can get along fine without it. Possibly a better option is to run your app as a local webserver and use a browser for the GUI. From ke.han@REDACTED Mon Aug 7 14:14:36 2006 From: ke.han@REDACTED (Jon Hancock) Date: Mon, 7 Aug 2006 20:14:36 +0800 Subject: Erlang for desktop applications? In-Reply-To: <44D71EC3.3010104@gmail.com> References: <1154875186.9952.7.camel@cerebellum> <78568af10608061406v5b83aed4nc59af0452f4e5dc3@mail.gmail.com> <44D6791B.20805@gurusnetwork.org> <78568af10608062016t3a8340f8ycb83e32f75bcc5bd@mail.gmail.com> <44D71EC3.3010104@gmail.com> Message-ID: Yeah, if you want to roll your own wrapper to just about any GUI API, erlang is very straightforward and there are existing libs to give you guidance. Erlang's generic and OTP management (Supervisor/ worker) of processes are both very suitable to mapping directly to typical GUI object and event-driven idioms. As far as scalability goes, the erlang vm scales well and latest publishing's of multi-proc erlang tests look very promising. Good luck, ke han On Aug 7, 2006, at 7:06 PM, Jacobo Garc?a de Polavieja wrote: > > Please don't turn this into a Cocoa VS GTK or OSX VS Linux debate ;-). > WxWindows is not suitable for large application because it's a > subset of all de backends it supports (GTK, WindowsForms, etc), so > it gets complicated to do a big and nice GUI. It's usually pretty > limited. > > What I'm trying to address here is... if there was a nice GUI > (whichever) for Erlang... would Erlang be a nice option to develop > desktop applications seeing dual and quadcore processors are coming? > Even more... would it be suitable to develop its own GUI? > > Thanks for all the answers. From trinder@REDACTED Mon Aug 7 15:23:21 2006 From: trinder@REDACTED (Phil Trinder) Date: Mon, 7 Aug 2006 14:23:21 +0100 (BST) Subject: Fifth ACM SIGPLAN Erlang Workshop Message-ID: <50159.129.215.46.153.1154957001.squirrel@www.macs.hw.ac.uk> It is our pleasure to announce the program for the Fifth ACM SIGPLAN Erlang Workshop which will be held in Portland, Oregon on September 16, 2006. This year the workshop will start with a 90 minute tutorial on "Large Scale Software Engineering with Erlang: Using Advanced Erlang/OTP" by Francesco Cesarini of Erlang Training and Consulting. We believe this will be a good opportunity for people new to Erlang to be introduced to advanced programming techniques and to better appreciate the other presentations. In addition to the tutorial, there are sessions on testing, the Erlang language and applications. You can view the workshop program and register for the workshop by visiting http://www.erlang.se/workshop/2006/ Marc Feeley General Chair Phil Trinder Program Chair ======================================================= Fifth ACM SIGPLAN Erlang Workshop Portland, Oregon, September 16, 2006 Satellite event of ACM SIGPLAN International Conference on Functional Programming, September 18-20, 2006 ======================================================= Erlang is a concurrent, distributed functional programming language aimed at systems with requirements on massive concurrency, soft real time response, fault tolerance, and high availability. It has been available as open source for several years creating a community that actively contributes to its already existing rich set of libraries and applications. Originally created for telecom applications, its usage has spread to other domains including e-commerce, banking, and computer telephony. Erlang programs are today among the largest applications written in any functional programming language. These applications offer new opportunities to evaluate functional programming and functional programming methods on a very large scale and suggest new problems for the research community to solve. This workshop will bring together the open source, academic, and industrial programming communities of Erlang. It will enable participants to familiarize themselves with recent developments on new techniques and tools tailored to Erlang, novel applications, draw lessons from users' experiences and identify research problems and common areas relevant to the practice of Erlang and functional programming. Workshop Program ---------------- 08.30 Registration 08.50 Welcome by the Workshop Chairman Session I: Tutorial 09.00 Large Scale Software Engineering with Erlang: Using Advanced Erlang/OTP Francesco Cesarini 10.30 Break Session II: Testing 11.00 EUnit - a Lightweight Unit Testing Framework for Erlang Richard Carlsson 11.30 Testing Telecoms Software with Quviq QuickCheck Thomas Arts, John Hughes et al 12.00 Model Checking Erlang Programs: The Functional Approach Lars-?ke Fredlund and Clara Benac Earle 12.30 Lunch break Session III: Language 14.30 Concurrency Oriented Programming in Termite Scheme Guillaume Germain 15.00 Dryverl: a Flexible Erlang/C Binding Compiler Romain Lenglet and Shigeru Chiba 15.30 Concurrent Caching Jay Nelson 15.45 Modeling Erlang in the PI-Calculus Chanchal Roy et al 16.30 Break Session IV: Applications 16.30 The Ericsson Integrated Site Framework Joakim Johansson 17.00 Comparing C++ and Erlang for Motorola Telecoms Software Phil Trinder 17.30 From HTTP to HTML - Erlang/OTP Experiences in Web Based Service Applications Lukas Larsson and Michal Slaski 17.45 Evaluation of DBMS for Erlang Emil Hellman 18.00 Final comments from the Program Committee Workshop Chair -------------- Marc Feeley, Universit? de Montr?al, Canada Program Chair ------------- Phil Trinder, Heriot-Watt University, Edinburgh, Scotland Program Committee ----------------- Richard Carlsson, Virtutech, Stockholm, Sweden Francesco Cesarini, Erlang Training & Consulting, London, UK Kevin Hammond, University of St Andrews, Scotland John Hughes, Chalmers University of Technology, G?teborg, Sweden H?kan Millroth, tail-f, Stockholm, Sweden Rex Page, University of Oklahoma, Norman, Oklahoma, USA Kostis Sagonas, Uppsala University, Uppsala, Sweden Simon Thompson, University of Kent, Canterbury, UK Ulf Wiger, Ericsson, Stockholm, Sweden Local Information and Accommodation ----------------------------------- Please see the ICFP web site http://icfp06.cs.uchicago.edu/ Registration Details -------------------- Registration on or before August 18 ACM member $75, Non-member $85, Student $75 Registration after August 18 or on-site ACM member $100, Non-member $110, Student $100 To register, please visit the registration site http://regmaster2.com/conf/icfp2006.html Related Links ------------- ICFP web site http://icfp06.cs.uchicago.edu/ Past ACM SIGPLAN Erlang workshops http://www.erlang.se/workshop Open Source Erlang http://www.erlang.org/ -------------------------------------------------- Phil Trinder School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh, EH14 4AS E-mail: trinder@REDACTED Teleph: +44 (0)131 451 3435 Depart: +44 (0)131 451 3328 Fasmly: +44 (0)131 451 3327 Intrnt: http://www.macs.hw.ac.uk/~trinder From marc.vanwoerkom@REDACTED Mon Aug 7 16:02:38 2006 From: marc.vanwoerkom@REDACTED (Marc van Woerkom) Date: Mon, 07 Aug 2006 16:02:38 +0200 Subject: Erlang for desktop applications? In-Reply-To: <44D71EC3.3010104@gmail.com> References: <1154875186.9952.7.camel@cerebellum> <78568af10608061406v5b83aed4nc59af0452f4e5dc3@mail.gmail.com> <44D6791B.20805@gurusnetwork.org> <78568af10608062016t3a8340f8ycb83e32f75bcc5bd@mail.gmail.com> <44D71EC3.3010104@gmail.com> Message-ID: <44D747FE.6060505@fernuni-hagen.de> > Please don't turn this into a Cocoa VS GTK or OSX VS Linux debate ;-). > WxWindows is not suitable for large application because it's a subset > of all de backends it supports (GTK, WindowsForms, etc), so it gets > complicated to do a big and nice GUI. It's usually pretty limited. > > What I'm trying to address here is... if there was a nice GUI > (whichever) for Erlang... would Erlang be a nice option to develop > desktop applications seeing dual and quadcore processors are coming? This boils down to two options a) creating a GUI well fitting to Erlang (which is distributed, message passing and functional) b) interfacing an existing GUI to Erlang I would like see a) of course. But except that every standard GUI is event driven, which could be mapped to Erlang processes, I have yet to see a nice functional approach to creating a GUI. Haskell with its monads, which is kind of a imperative DSL within Haskell seems to be a bit further ahead conceptually. But even those folks stick to a GTK binding when doing GUIs, if I see it correctly. Developing something like GTK or any other portable GUI toolkit, is a major pain in the behind, and the folks who want to do Erlang usually don't want to take off a few years to develop and maintain such a huge subsystem. But if you like, go for it. :-) Regards, Marc From Martin.Logan@REDACTED Mon Aug 7 17:22:10 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Mon, 7 Aug 2006 10:22:10 -0500 Subject: How do I have multiple gen_servers, behind a single name, all serving requests? In-Reply-To: Message-ID: <9CB79C836F98504C81BF082C4291E987792A74@CHITDSEXC02.tds.corp.cendant.org> For this sort of problem I use an application I call resource_discovery. When a node starts up resource discovery is configured to tell the network including the local node about what resources it has and what resources it is interested in. The nodes that care about what the new node has cache those resources and then respond to the new node with the resources they have that correspond to the resources the newly started node indicated it was interested in. In this way all resource discovery applications have up to date caches of pids for resources that local applications will require. This cache of pids is tracked via links. When a client asks for a resource of a particular type the system hands it a pid to work with. The resource_discovery system by default uses a round robin method to hand out pids in its cache of a given resource type. Cheers, Martin -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Christian S Sent: Friday, August 04, 2006 6:02 PM To: erlang-questions Subject: How do I have multiple gen_servers, behind a single name, all serving requests? Creating connections to databases tend to take some time, most solutions involve having N connections open in a pool that application code check out while operating on the db. As I have found out, database session tend to have a state. For postgres a prepared statement is given a name that is local to that session, hidden from other sessions to postgres. So checking out a connection from a pool, one would have to make sure these exist by preparing them again, each checkout. Maybe not that costly in most real situations, but I thought it could be engineered better: The idea I got was that you have: * one front-end gen_server, * it is registered to the name one like to expose, * it keeps a fifo or stack of anonymous worker gen_servers * to pass on requests any non-busy worker gen_server, quickly going back wating for more requests * and receving info about workers becoming available again. This would distribute requests over several worker gen_servers. Is there anything in OTP which does this already? A gen_server option i missed? pool and overload seem to be concerned with cpu load. I just want to have several gen_servers so each one can have its own connection to the database, to avoid the cost of opening new connections and tap in to the sometimes very good multithreading in rdbms. Pooling application gen_servers rather than database connections is one step up in abstraction. Making it cleaner to write solid gen_servers that implement "business logic" (sorry for the buzzword). I mean, succinctly formulated operations the application needs from the db, such as decrement-N-units-from-account-A-if-the-balance-is-high-enough: bank:withdraw(N, A). Typically gen_servers act as a form of synchronization device, but here the databases go to great length to handle transactions and their collisions well. <> From rsaccon@REDACTED Mon Aug 7 18:10:38 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Mon, 7 Aug 2006 13:10:38 -0300 Subject: R11B installation problem on debian In-Reply-To: <200608071226.k77CQgmM001334@harpo.it.uu.se> References: <200608071226.k77CQgmM001334@harpo.it.uu.se> Message-ID: And again it was XEN causing trouble. It patches the kernel and modifies the NPTL stuff. On 8/7/06, Mikael Pettersson wrote: > On Mon, 7 Aug 2006 08:48:49 -0300, Roberto Saccon wrote: > > I inspected the logfile for strange things and there were a > > lot of strange things and then I realized that on my XEN setup, I had > > only reserved 64 MB of RAM for that domain. > > > > After increasing that, it did still not work, then I tried with > > "./configure --disable-hipe" and finally it worked, but of course I > > don't want to disable hipe. > > > > Is there any known issue with debian sarge ? Any special library required ? > > If both HiPE/x86 (or amd64) and threads are enabled, then you need either > an NPTL glibc, or a LinuxThreads glibc that has been configured for a > 2.3.99 or later kernel. Otherwise LinuxThreads can't use "floating stacks" > and then it falls back to using %esp in ways that are fundamentally > incompatible with HiPE/x86. The only solution if you have a misconfigured > glibc is to disable either hipe or threads. > -- Roberto Saccon From kramer@REDACTED Mon Aug 7 21:14:21 2006 From: kramer@REDACTED (Reto Kramer) Date: Mon, 7 Aug 2006 12:14:21 -0700 Subject: raw file write from non-owning thread Message-ID: I ran into a puzzle writing to a raw file from a process different from the one that opened the file (owns it). Below the first "raw:run" is without the raw option. Everything is fine. When I add the raw option though, the process that opened the file (here the shell) receives a message from the port when the write is performed from another process (see flush). Also note that the writing function (process) w/2 did not run to completion (the "done writing" string is not printed). Can someone help me understand how I can write to a raw file from a process other than the one that opened the file? Thanks, - Reto %% without raw 1> raw:run("test.log"). done writing. <0.34.0> %% with raw 1> raw:run("test.log"). <0.33.0> 2> flush(). Shell got {#Port<0.96>,{data,[3,0,0,0,0,0,0,0,1]}} ok -module(raw). -export([run/1, w/2]). run(Filename) -> {ok,H} = file:open(Filename, [append, binary, raw]), proc_lib:spawn_link(?MODULE, w, [H, <<1>>]). w(H, Bin) -> file:write(H, Bin), io:format("done writing.~n", []). # From james.hague@REDACTED Mon Aug 7 22:46:33 2006 From: james.hague@REDACTED (James Hague) Date: Mon, 7 Aug 2006 15:46:33 -0500 Subject: how to interpret these results ? Message-ID: >erlang is REALLY bad at using stdin/stdout I've wonderered before why this is. Ditto for line-oriented I/O being slow in Erlang. What's the fundamental reason for this? From ulf.wiger@REDACTED Mon Aug 7 23:11:45 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Mon, 7 Aug 2006 23:11:45 +0200 Subject: how to interpret these results ? In-Reply-To: Message-ID: For one thing, Erlang applications traditionally haven't been that dependent on stdin/stdout. They've been embedded systems managing tens of thousand signaling sessions at a time. Optimizing the performance of stdin/stdout hasn't been an important requirement for any (paying) customer. This also means that Erlang can never do a blocking wait on stdin. Non-blocking I/O is much slower than blocking I/O, esp in low-level benchmarks. But soft real-time characteristics is much more important than raw speed in telecoms applications. The SMP version of Erlang may be able to improve things, I think. You can have I/O threads in blocking wait, and won't have to suspend the Erlang processes in order to poll descriptors. Just my half-educated guesses. Someone else may have a better theory. BR, Ulf W > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of James Hague > Sent: den 7 augusti 2006 22:47 > To: Erlang Users' List > Subject: Re: how to interpret these results ? > > >erlang is REALLY bad at using stdin/stdout > > I've wonderered before why this is. Ditto for line-oriented > I/O being slow in Erlang. What's the fundamental reason for this? > From yarivvv@REDACTED Mon Aug 7 23:51:06 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 7 Aug 2006 17:51:06 -0400 Subject: how to interpret these results ? In-Reply-To: References: Message-ID: <17244f480608071451n3c7983bdw3cfa59f13660ae23@mail.gmail.com> Speaking out of near total ignorance when it comes to how the Erlang VM is implemented: can't the Erlang emulator spawn a new OS thread(s) to handle STDIN/STDOUT more efficiently? Using a few OS threads for special purposes and a single OS thread with non-blocking IO for everything else seems like it would give the best of both worlds for a very small cost of a few extra threads. Yariv On 8/7/06, Ulf Wiger (TN/EAB) wrote: > > For one thing, Erlang applications traditionally haven't been that > dependent on stdin/stdout. They've been embedded systems managing tens > of thousand signaling sessions at a time. Optimizing the performance of > stdin/stdout hasn't been an important requirement for any (paying) > customer. > > This also means that Erlang can never do a blocking wait on stdin. > Non-blocking I/O is much slower than blocking I/O, esp in low-level > benchmarks. But soft real-time characteristics is much more important > than raw speed in telecoms applications. > > The SMP version of Erlang may be able to improve things, I think. You > can have I/O threads in blocking wait, and won't have to suspend the > Erlang processes in order to poll descriptors. > > Just my half-educated guesses. Someone else may have a better theory. > > BR, > Ulf W > > > -----Original Message----- > > From: owner-erlang-questions@REDACTED > > [mailto:owner-erlang-questions@REDACTED] On Behalf Of James Hague > > Sent: den 7 augusti 2006 22:47 > > To: Erlang Users' List > > Subject: Re: how to interpret these results ? > > > > >erlang is REALLY bad at using stdin/stdout > > > > I've wonderered before why this is. Ditto for line-oriented > > I/O being slow in Erlang. What's the fundamental reason for this? > > > From bengt.kleberg@REDACTED Tue Aug 8 08:03:34 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 08 Aug 2006 08:03:34 +0200 Subject: an unexpected (to me) difference between lists:map/2 and list comprehension Message-ID: <44D82936.7030600@ericsson.com> greetings, there is a difference between lists:map/2 and list comprehension that can hide errors in the code. the generator part works like a filter, silently dropping unmatched items in the list. it would be nice if this was mentioned in the documentation. from the documentation and examples of list comprehension (http://www.erlang.se/doc/doc-5.5/doc/programming_examples/part_frame.html) i have assumed that the generator part works like the fun head in lists:map/2 (or lists:filter/2, etc). ie the following two pices of code would be equivalent: 1) [A || {A, B, C} <- L]. 2) lists:map( fun({A, B, C}) -> A end, L). however, using the list L = [{a,b,c}, {1,2,3,4}]. i get the following: 1) [a] 2) ** exited: {function_clause,[{erl_eval,'-inside-a-shell-fun-',{{1,2,3,4}}}, {erl_eval,expr,3}]} ** bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From bengt.kleberg@REDACTED Tue Aug 8 08:24:11 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 08 Aug 2006 08:24:11 +0200 Subject: raw file write from non-owning thread In-Reply-To: References: Message-ID: <44D82E0B.3020104@ericsson.com> On 2006-08-07 21:14, Reto Kramer wrote: ...deleted > Can someone help me understand how I can write to a raw file from a > process other than the one that opened the file? it could be impossible. from the documenation: raw The raw option allows faster access to a file, because no Erlang process is needed to handle the file. However, a file opened in this way has the following limitations: * The functions in the io module cannot be used, because they can only talk to an Erlang process. Instead, use the read/2 and write/2 functions. ==> * Only the Erlang process which opened the file can use it. * A remote Erlang file server cannot be used; the computer on which the Erlang node is running must have access to the file system (directly or through NFS). bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From chaitanya.chalasani@REDACTED Tue Aug 8 10:23:15 2006 From: chaitanya.chalasani@REDACTED (Chaitanya Chalasani) Date: Tue, 8 Aug 2006 13:53:15 +0530 Subject: Kernel poll support in erlang for linux 2.6.16(SUSE) Message-ID: <200608081353.15891.chaitanya.chalasani@gmail.com> Hi, I am facing some problem in enabling kernel poll support for erlang under SUSE Linux 10.1 (kernel 2.6.16). The config file says checking for working poll()... ok checking for presens of poll()/select() bug when another thread closes fd... (cached) yes checking for compiler flags for loadable drivers... -g -O2 -I/home/chaitanya/Downloads/otp/otp_src_R11B-0/erts/i686-pc-linux-gnu -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS -fPIC and when i execute chaitanya@REDACTED:..otp/otp_src_R11B-0> erl +K true kernel-poll not supported; "K" parameter ignored Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] Eshell V5.5 (abort with ^G) 1> Why is it so? Is it that my machine doesn't support kernel poll? -- CHAITANYA CHALASANI LINUX USER #410931 From alex.arnon@REDACTED Tue Aug 8 11:37:00 2006 From: alex.arnon@REDACTED (Alex Arnon) Date: Tue, 8 Aug 2006 12:37:00 +0300 Subject: an unexpected (to me) difference between lists:map/2 and list comprehension In-Reply-To: <44D82936.7030600@ericsson.com> References: <44D82936.7030600@ericsson.com> Message-ID: <944da41d0608080237m44e25fbbi1f645f3404660040@mail.gmail.com> Well, in my mind the list comprehension goes through the statements performing a pattern match, performing an "and". This includes the extraction op ("<-"). So that would make sense in that context. The map() function takes a fun, where you'd of course get a function_clause mismatch. On 8/8/06, Bengt Kleberg wrote: > > greetings, > > there is a difference between lists:map/2 and list comprehension that > can hide errors in the code. the generator part works like a filter, > silently dropping unmatched items in the list. it would be nice if this > was mentioned in the documentation. > > > from the documentation and examples of list comprehension > (http://www.erlang.se/doc/doc-5.5/doc/programming_examples/part_frame.html > ) > i have assumed that the generator part works like the fun head in > lists:map/2 (or lists:filter/2, etc). > ie the following two pices of code would be equivalent: > > 1) [A || {A, B, C} <- L]. > 2) lists:map( fun({A, B, C}) -> A end, L). > > however, using the list L = [{a,b,c}, {1,2,3,4}]. > i get the following: > 1) [a] > 2) ** exited: > {function_clause,[{erl_eval,'-inside-a-shell-fun-',{{1,2,3,4}}}, > {erl_eval,expr,3}]} ** > > > bengt > -- > EPO guidelines 1978: "If the contribution to the known art resides > solely in a computer program then the subject matter is not > patentable in whatever manner it may be presented in the claims." > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christophe.romain@REDACTED Tue Aug 8 12:09:31 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Tue, 8 Aug 2006 12:09:31 +0200 Subject: Kernel poll support in erlang for linux 2.6.16(SUSE) In-Reply-To: <200608081353.15891.chaitanya.chalasani@gmail.com> References: <200608081353.15891.chaitanya.chalasani@gmail.com> Message-ID: <94b8c6377ab8a0a1f45e45b74c9b2aad@process-one.net> Kernel poll does not work with R11B if you do not need SMP, you should use R10B From jacobopolavieja@REDACTED Tue Aug 8 12:34:51 2006 From: jacobopolavieja@REDACTED (Jacobo G. Polavieja) Date: Tue, 08 Aug 2006 12:34:51 +0200 Subject: Erlang for desktop applications? In-Reply-To: <200608070343.k773hHot116313@atlas.otago.ac.nz> References: <200608070343.k773hHot116313@atlas.otago.ac.nz> Message-ID: <44D868CB.5060301@gmail.com> Richard A. O'Keefe wrote: > Jacobo =?ISO-8859-1?Q?Garc=EDa?= de Polavieja Aguilera > asked: > > But, do you see Erlang suitable for developing future (more than > 5 years from now) desktop applications? I know it wasn't > designed for this, and that there are very important actions > like string functions which are slow in Erlang... > > ARE they? Have you measured them? > > We had a lengthy thread not so long ago where I pointed out that > there is more than one way to represent a string, and that for > many applications the traditional packed-array-of-bytes is a rather bad > representation. (For example, for Information Retrieval a list of > word numbers may be better.) And it is much easier to experiment with > unusual text representations in a language like Erlang than in a language > like C++ or Java. > > A colleague and I are teaching a 4th year "advanced object oriented > programming" paper. He and I agree about lots of things, some of which > other people in the department don't agree about. One of them is that > in 10 years time if you can't write reliable highly concurrent code you > will probably be out of business. (Assume Moore's Law keeps going, but > with respect to total performance of multicore systems rather than > per-core performance, and in 10 years time we'll see kilocore machines > on the desk top. They will probably be running some sort of virtual > reality sex game.) So last week he spent a lecture on Occam (which to > my pleased surprise is still around even though Transputers are dead; > KROC is even freely downloadable and installed without any problems). > This week I'm going to spend a lecture on Erlang. > > Let's assume an 18-month doubling time, and let's take 4 cores as the > starting point. (I have a copy of "Dual-Core Update to the Intel(R) > Itanium(R) 2 Processor Reference Manual, and Sun's Niagara is 8-core, > so I'm taking 4 cores as a sort of midpoint.) In five years, we'll > expect there to be desktop machines with 32 cores. > > (Ooh, I just noticed this from InfoWorld back in 2004: NEC developed > a cellphone chip, the MP211, with three ARM cores plus a DSP, so that's > a four-core chip in your hand. Hmm. There's an "image processor" on > the chip as well, according to the NEC web site. What I can't find is > a price for these things.) > > but then I also ran into EX11 and similar projects which seem > like a little light for my future purpose. Could be erlang efficient > with desktop related stuff? > > It all depends on what you do on your desktop. Did you see the > article someone mentioned recently about decoding some sort of video > format in Erlang? If you are doing something like music or video > editing on your desktop, perhaps what really matters for performance > is the DSP or GP, not the "steering" code. If you are doing information > retrieval or data mining, heck, people even do that in Java (although > I do *wish* that the NCSA ALG group would spend some time producing > usable documentation for their program; I would cheerfully accept something > 10 times as slow with a manual just 2 times as big if it had the right > stuff in the manual), because if you have good data structures it's > probably I/O bandwidth that matters rather than CPU speed. (We have > a student looking at information retrieval on a multicore machine, and > it's not clear that there's going to be a result other than "I/O > concurrency is the right kind".) > > If not, could you recommend other > functional languages that fit best that objective? I'm looking > forward to efficiency on future multicore processors and easy > concurrency management. > > There's always ML. As a happy Haskeller, I do find the syntax of SML > clunky, and O'CAML even worse. Sadly, O'CAML is one of the fastest > systems around. Although Mlton (no typing mistake, it really is m l > t o n) is a darned good batch compiler for SML. And although concurrency > isn't officially standard in ML, both SML/NJ and Mlton support the CML > extensions. The SML Basis Library includes particularly good support for > substrings, if string hacking is important in what you do. > > There are also concurrent versions of Haskell, and Haskell these days is > doing some *awesome* things with generic programming (think "type safe > programming ON the language IN the language" and "automatic derivation of > large chunks of code"). Clean generates pretty darned good code, and a > somewhat different version of generic programming, but they've dropped > concurrency support, for now at least. > > Then there's Mercury, which gives you logic programming and (strict) > functional programming and constraint programming all in one strictly > typed and heavily checked box. (The compiler will even try to figure out > whether procedures must always terminate, although the Halting Problem > result means that it can't always be sure.) People are using that for > desktop stuff. > > Given Erlang's support for interfaces (CORBA, ASN.1, C, Java, you name > it) it's difficult to think of any likely desktop application where > Erlang couldn't have _some_ practical use. > > Your message was very clarifying, thanks. ARE they? Have you measured them? We had a lengthy thread not so long ago where I pointed out that there is more than one way to represent a string, and that for many applications the traditional packed-array-of-bytes is a rather bad representation. (For example, for Information Retrieval a list of word numbers may be better.) And it is much easier to experiment with unusual text representations in a language like Erlang than in a language like C++ or Java. I just put the slow "fact" based on what is said on the FAQ: http://www.erlang.org/faq/x1088.html#AEN1288 As I said I don't have any programming experience with Erlang so I'm trying to see if it could fit my interest in developing desktop apps. I'll look for that thread you've mentioned :). One of them is that in 10 years time if you can't write reliable highly concurrent code you will probably be out of business. That's my main point of view and what drove me to consider a better language for programming concurrency. I truly believe is going to be like that in the future. So, do you see Erlang is the/one of the most best positioned to take advantage of that future fact? Given Erlang's support for interfaces (CORBA, ASN.1, C, Java, you name it) it's difficult to think of any likely desktop application where Erlang couldn't have _some_ practical use. You said it, "some". But how about being the main or unique language in desktop developing apps? My main fear is that, as I have very little experience, I can't thing of many "actions" taken in desktop apps that are very concurrent or just concurrent. I mean... all I can think about that could benefit from Erlang's concurrency is a mail application (to retrieve mail), P2P application (interconnect users)... which are very "networky" (where Erlang is strong). I just don't now if a chat program, or a web browser, or a file manager, or a document viewer, a game, a multimedia player and all the usual desktop applications need lots of concurrency and can benefit from Erlang or if it would be better to use some thing like C# with the little concurrency it implements. I think I'll have to learn Erlang and finish my PThreads studying, make typical desktop programs with both... and then compare :-|. Ocaml is a candidate too from what I've heard. Thanks for all the patience with the newbie... Cheers. From ulf@REDACTED Tue Aug 8 13:16:52 2006 From: ulf@REDACTED (Ulf Wiger) Date: Tue, 08 Aug 2006 13:16:52 +0200 Subject: an unexpected (to me) difference between lists:map/2 and list comprehension In-Reply-To: <44D82936.7030600@ericsson.com> References: <44D82936.7030600@ericsson.com> Message-ID: Den 2006-08-08 08:03:34 skrev Bengt Kleberg : > greetings, > > there is a difference between lists:map/2 and list comprehension that > can hide errors in the code. the generator part works like a filter, > silently dropping unmatched items in the list. it would be nice if this > was mentioned in the documentation. > > > from the documentation and examples of list comprehension > (http://www.erlang.se/doc/doc-5.5/doc/programming_examples/part_frame.html) > i have assumed that the generator part works like the fun head in > lists:map/2 (or lists:filter/2, etc). > ie the following two pices of code would be equivalent: > > 1) [A || {A, B, C} <- L]. > 2) lists:map( fun({A, B, C}) -> A end, L). You ought to replace 1) with something like this: 1) [begin {A,B,C} = X, A end || X <- L] or 1) [(fun({A,B,C}) -> A end)(X) || X <- L] Just remember that the <- construct is a filter, and the LHS is where some operation is applied to the selection. BR, Ulf W -- Ulf Wiger From erlang@REDACTED Tue Aug 8 15:50:26 2006 From: erlang@REDACTED (Inswitch Solutions) Date: Tue, 8 Aug 2006 10:50:26 -0300 Subject: Mnesia and Oracle Message-ID: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> Hi, I'm already working with Oracle and Mnesia, and I'd like to hear experiences of the Erlang community about these databases. When deciding over Oracle or Mnesia database for an Erlang, or non Erlang, based real-time system which factors are in favour in one over the other (performance...?) ?. thanks, Eduardo Prepaid Expertise - Programmable Switches Powered by Ericsson Licensed Technology Eng. Eduardo Figoli - Development Center - IN Switch Solutions Inc. Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 e-mail: eduardo@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1429 bytes Desc: not available URL: From james.hague@REDACTED Tue Aug 8 16:02:52 2006 From: james.hague@REDACTED (James Hague) Date: Tue, 8 Aug 2006 09:02:52 -0500 Subject: an unexpected (to me) difference between lists:map/2 and list comprehension In-Reply-To: References: <44D82936.7030600@ericsson.com> Message-ID: > Just remember that the <- construct is a filter, > and the LHS is where some operation is applied > to the selection. Except that you can also add filters elsewhere, like: [X || X <- [1,2,3,4], X > 2] (I honestly had no idea that the "<-" worked as a filter until I read this thread.) From Martin.Logan@REDACTED Tue Aug 8 16:38:44 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Tue, 8 Aug 2006 09:38:44 -0500 Subject: Mnesia and Oracle In-Reply-To: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> Message-ID: <9CB79C836F98504C81BF082C4291E987792A85@CHITDSEXC02.tds.corp.cendant.org> My advice is to use mnesia if you can. Joe Armstrong once said something to the effect of there is no fast system only a system that is fast enough. If mnesia is fast enough for you and the data you wish to store is not many gigabytes and you don't have any extraordinary security concerns then go with mnesia. The advantages are many because it understands native erlang. It feels like part of the language and by virtue of this allows you to maintain a greater degree of clarity in your code. I have found mnesia to be very efficient and have used it in large scale gigabyte throughput telecom systems where it performed admirably. Cheers, Martin ________________________________ From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Inswitch Solutions Sent: Tuesday, August 08, 2006 8:50 AM To: erlang-questions@REDACTED Subject: Mnesia and Oracle Hi, I'm already working with Oracle and Mnesia, and I'd like to hear experiences of the Erlang community about these databases. When deciding over Oracle or Mnesia database for an Erlang, or non Erlang, based real-time system which factors are in favour in one over the other (performance...?) ?. thanks, Eduardo Prepaid Expertise - Programmable Switches Powered by Ericsson Licensed Technology Eng. Eduardo Figoli - Development Center - IN Switch Solutions Inc. Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 e-mail: eduardo@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1429 bytes Desc: image001.gif URL: From jacobopolavieja@REDACTED Tue Aug 8 17:48:09 2006 From: jacobopolavieja@REDACTED (Jacobo G. Polavieja) Date: Tue, 08 Aug 2006 17:48:09 +0200 Subject: Erlang for desktop applications? In-Reply-To: References: <1154875186.9952.7.camel@cerebellum> Message-ID: <44D8B239.2010801@gmail.com> ke han wrote: > I think your question isn't so straightforward. > Lets ignore erlang's lack of certain UI library wrappers for a moment to > think about what a desktop apps' UI will look like in 5 years. > As you stated: > >> But, do you see Erlang suitable for developing future (more than 5 years >> from now) desktop applications? >> > > A "desktop app" in 5 years will most likely fall into one of 2 categories: > 1 - Traditional GUI app...highly integrated UI and domain logic for > graphics intensive apps (think Photoshop). > 2 - 2-tier: View separated from domain logic. Think of just about every > next-gen web app being written today (this includes replacements for > fairly complex and expressive UIs such as Word and Excel) > > So, unless you are creating things like Photoshop (I bet we'll see a web > service replacement for 80% of its' features in the next 5 years) or > Wings3D, think of the "App UI", not the "Desktop UI". There are many > variations on a meme for creating App UIs (in browser, Flash, "smart > components which talk to servers (local and remote".) > If your app fits into this later category, I'd say erlang is a better > fit than many languages for the domain part of the app. The View part > will be HTML, Javascript, Haxe, Flash, VRML, who knows...this new App UI > infrastructure stuff "sits on top of / integrated into" your Desktop > GUI, so the App developer is not concerned at this level. > > Adding erlang wrappers to various GUI libraries (GTK, Win32, Cocoa) is a > straightforward matter. "How do you really want to build a new desktop > app (regardless of language)?" is the hard part. > > There has been some talk on the yaws list and some here regarding > dynamic Web UIs. This is the general direction app developers are > taking and there will exist / do exist methods to make these apps "work > like / install like" the desktop apps you are accustomed. > > regards, ke han > > On Aug 6, 2006, at 10:39 PM, Jacobo Garc?a de Polavieja Aguilera wrote: > >> Hi everybody: >> I am new to functional programming (just some very little experience >> with Lisp). I got interested in functional programming because of the >> performance related to multiproccessors or multicore systems. And I got >> interested in Erlang over other FP languages because its fame for easy >> parallelism management and its performance compared to Haskell or >> others. >> But, do you see Erlang suitable for developing future (more than 5 years >> from now) desktop applications? I know it wasn't designed for this, and >> that there are very important actions like string functions which are >> slow in Erlang... but then I also ran into EX11 and similar projects >> which seem like a little light for my future purpose. >> Could be erlang efficient with desktop related stuff? If not, could you >> recommend other functional languages that fit best that objective? >> I'm looking forward to efficiency on future multicore processors and >> easy concurrency management. >> >> Thanks all. >> > > I don't know if I have fully understood all of the things, so sorry if you see I didn't get the complete meaning of some part (sorry... not a native English speaker). Although I agree with you applications will get more "separated" from the UI part, I don't quite see it as a whole server+UI thing, at least as I understand that... Well I really had the (completely hypothetical) idea of making a UI which the same code could be exported to desktop UI (like GTK or whatever), web (with XML11) and console. So, in some way, the implementation would be with the UI code, but that UI would be accessible in the main three ways (desktop, web, and console). For that idea... Mono has lots of things to offer, but I'm pretty much concerned about the performance it can be achieved with Mono when running on multicore architectures and the ease of the coding to get a good performance. Think that when I say desktop apps I refer to a whole bunch of typical apps you can see in a desktop, not just one app I could have in mind right now. Think of filemanagers, games, media players and that sort of apps... And as I've just said to Richard A. O'Keefe, I don't know if Erlang is also strong in those kind of developments (I don't know if any of those apps need a lot of concurrency where Erlang could be superior to C/C++/C#). Sorry if I'm being a little pain in the neck making so many questions... Thanks for everything. Cheers. From chsu79@REDACTED Tue Aug 8 19:07:41 2006 From: chsu79@REDACTED (Christian S) Date: Tue, 8 Aug 2006 19:07:41 +0200 Subject: Erlang for desktop applications? In-Reply-To: <44D8B239.2010801@gmail.com> References: <1154875186.9952.7.camel@cerebellum> <44D8B239.2010801@gmail.com> Message-ID: > Think that when I say desktop apps I refer to a whole bunch of typical > apps you can see in a desktop, not just one app I could have in mind > right now. Think of filemanagers, games, media players and that sort of > apps... And as I've just said to Richard A. O'Keefe, I don't know if > Erlang is also strong in those kind of developments (I don't know if any > of those apps need a lot of concurrency where Erlang could be superior > to C/C++/C#). Don't make the mistake to think that concurrency in Erlang is just good for increasing computational throughput. Processes are also useful in a purely software engineering way: they provide isolation between independant tasks. A modern GUI is typically very concurrent, the user expect to be able to jump between programs or views within programs (think tabbed browsing). Imagine if when firefox hit a site that exposed some bug in the renderer it would not all crash, just that tab, wouldnt it be nice? Browsers whose GUI lock up while a domain name is being resolved feel quite ancient too, dont they? As for media players, sure, erlang might not be the best choice to implement a video decoder (though computers are so scarily fast now i would not be surprised if erlang could achive full framerate). However, during playing I expect to be able to pick a new file to play without stopping the current one, and also interrupt myself from file browsing and adjust the volume then continue browsing for that cool Erlang video. From kramer@REDACTED Tue Aug 8 19:40:00 2006 From: kramer@REDACTED (reto) Date: Tue, 08 Aug 2006 18:40:00 +0100 Subject: raw file write from non-owning thread References: Message-ID: <20060808174000.6CF425A1E5@mail.erlangsystems.com> How on earth could I have missed that bullet point. Thanks for pointing it out. This implies then that in an SMP world, I cannot read (or write) to different parts of a "raw" file from different Erlang processes (e.g. multiple readers). Does anyone know of plans to remove this limitation? Thanks, - Reto PS: Is there a running list of "Erlang make full use of SMP" work items? _________________________________________________________ Post sent from http://www.trapexit.org From erlangx@REDACTED Tue Aug 8 19:51:35 2006 From: erlangx@REDACTED (Michael McDaniel) Date: Tue, 8 Aug 2006 10:51:35 -0700 Subject: Erlang for desktop applications? In-Reply-To: References: <1154875186.9952.7.camel@cerebellum> <44D8B239.2010801@gmail.com> Message-ID: <20060808175135.GC6584@delora.autosys.us> On Tue, Aug 08, 2006 at 07:07:41PM +0200, Christian S wrote: > >Think that when I say desktop apps I refer to a whole bunch of typical > >apps you can see in a desktop, not just one app I could have in mind > >right now. Think of filemanagers, games, media players and that sort of > >apps... And as I've just said to Richard A. O'Keefe, I don't know if > >Erlang is also strong in those kind of developments (I don't know if any > >of those apps need a lot of concurrency where Erlang could be superior > >to C/C++/C#). > > Don't make the mistake to think that concurrency in Erlang is just > good for increasing computational throughput. Processes are also > useful in a purely software engineering way: they provide isolation > between independant tasks. > > A modern GUI is typically very concurrent, the user expect to be able > to jump between programs or views within programs (think tabbed > browsing). Imagine if when firefox hit a site that exposed some bug in > the renderer it would not all crash, just that tab, wouldnt it be > nice? Browsers whose GUI lock up while a domain name is being > resolved feel quite ancient too, dont they? > > As for media players, sure, erlang might not be the best choice to > implement a video decoder (though computers are so scarily fast now i > would not be surprised if erlang could achive full framerate). > However, during playing I expect to be able to pick a new file to play > without stopping the current one, and also interrupt myself from file > browsing and adjust the volume then continue browsing for that cool > Erlang video. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Speaking of decoders, here (http://www.dadgum.com/james/performance.html) is the article that got me started using Erlang shortly after I read it. I was reading up on (of all things) performance and came across 'Erlang'. Further investigation got me hooked. ~Michael From thomasl_erlang@REDACTED Tue Aug 8 20:28:36 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 8 Aug 2006 11:28:36 -0700 (PDT) Subject: Erlang for desktop applications? In-Reply-To: <44D8B239.2010801@gmail.com> Message-ID: <20060808182836.32967.qmail@web38811.mail.mud.yahoo.com> --- "Jacobo G. Polavieja" wrote: > Think of filemanagers, games, media players and that > sort of apps... And as I've just said to Richard A. > O'Keefe, I don't know if Erlang is also strong in > those kind of developments You will definitely be an early adopter if you develop desktop apps in Erlang; as usual, early adoption means things haven't been smoothed by a thousand people before you. Also, being an early adopter, most of the existing desktop developers will be elsewhere. Being a trailblazer is more work. That said, I think general desktop apps still have some way to go. They often irritatingly freeze up when blocking for some resource, and they are often unsophisticated about accessing network resources, for example. Erlang could help. > (I don't know if any of those apps need a lot of > concurrency where Erlang could be superior > to C/C++/C#). Wasn't your initial point that you wanted to exploit multicore systems? When the clock rate is constant, your future speedup is determined by available parallelism, which means you may have to design your system and algorithms for parallel execution. Low amounts of parallelism (e.g., today's apps) means your app will hit the roof pretty soon, and furthermore won't be improved by future processor generations. (This assumes that the number of cores will start to double every N months; I'm not entirely convinced that that will happen for an extended period of time, though.) Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From alex.arnon@REDACTED Tue Aug 8 21:39:32 2006 From: alex.arnon@REDACTED (Alex Arnon) Date: Tue, 8 Aug 2006 22:39:32 +0300 Subject: gen_leader's status. Message-ID: <944da41d0608081239o40b6694el2a67c2c92d2498c7@mail.gmail.com> Hi All, What is gen_leader's current status? Looking through my mailing list archives, it seems that it was considered to be functioning well if not thoroughly tested. Can anyone give me a heads-up on this? gen_leader in fact implements a superset of what I need, so I can actually get by with a somewhat looser scheme using pg2, I think. - I need a group of processes (1 per node) of which only one periodically wakes up and performs cleanup on some mnesia tables. - It is probably not too bad if occasionally (due to node crashes etc.) more than one would wake up, as I believe it should be simple to avoid if nodes are reasonably stable. Cheers, Alex. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.virding@REDACTED Tue Aug 8 23:17:26 2006 From: robert.virding@REDACTED (Robert Virding) Date: Tue, 08 Aug 2006 23:17:26 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <407d9ef80608061255h1304ae48k621aba7778759e83@mail.gmail.com> References: <44D0B193.3030406@ericsson.com> <44D1D9FD.1000106@telia.com> <200608031710.50656.ft@it.su.se> <44D30DE3.8010305@telia.com> <407d9ef80608061255h1304ae48k621aba7778759e83@mail.gmail.com> Message-ID: <44D8FF66.1040500@telia.com> Willem de Jong skrev: > I think regexp is too slow on exactly the kind of pattern that was > used in the 'benchmark': patterns that contain a long(ish) literal > string, especially if they start with it. > > Regexp:parse() translates the pattern to a compiled RE that looks like > this (for ABC): {concat, concat{A, B}, C}. As long as no match is > found, the algorithm tries to match every character against the > compiled RE. For every character, it has to traverse the tree down to > the A. If the pattern is longer, the tree grows 'deeper' (one > additional level with each additional character), and this process > takes more time. This way of parsing the regexp follows the definition: concatenation is left associative. > The solution (I think) is to change the result of regexp:parse to > something that looks like this: {concat, A, concat{B, C}}. Then it > will find the A much quicker. I don't think that transforming it in this way changes the semantics but I have not checked it. Does anyone know? If it doesn't then it should probably be done directly in the parser. > I wrote a 'post-processing' module that modifies the compiled RE as > described. I also changed a few things to the main function that does > the matching (re_apply), but I am not sure whether that was really > necessary. (If you want I can send you the code). > > On my PC it is not so easy to measure response-time, but my impression > is that this improved the result for the benchmark by a factor 3. Please send me the core and I will check it out. I was surprised by the speed-up you mention. If it is of this order then it would be worth the effort. Given it doesn't change the semantics. Robert From yarivvv@REDACTED Tue Aug 8 23:51:54 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 8 Aug 2006 17:51:54 -0400 Subject: Mnesia and Oracle In-Reply-To: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> Message-ID: <17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com> Hi Eduardo, I haven't had production experience with these databases, but there are a couple of things I found by research that are keeping me from using Mnesia exclusively in my application: - Mnesia disc storage, based on dets, has a couple of drawbacks when handling very large (many gigs) datasets: potentially long repair times and memory consumption that grows with data fragmentation. - QLC, the query engine for Mnesia, doesn't currently optimize joins. If your queries involve joining big tables, they can take a long time to execute. The join optimizations are planned for a future R11 OTP release, but there are no plans to change dets AFAIK. Depending on your application, these issues may not be a big problem. For the application I'm building, I'm planning on using both MySQL and Mnesia, where MySQL will be used for storing high-volume data and Mnesia for "live" session data. Hope this helps! Regards, Yariv On 8/8/06, Inswitch Solutions wrote: > > > > Hi, > > I'm already working with Oracle and Mnesia, and I'd like to hear experiences of the Erlang community about these databases. > When deciding over Oracle or Mnesia database for an Erlang, or non Erlang, based real-time system which factors are in favour in one over the other (performance...?) ?. > > > thanks, Eduardo > > > > > > Prepaid Expertise - Programmable Switches > Powered by Ericsson Licensed Technology > Eng. Eduardo Figoli - Development Center - IN Switch Solutions Inc. > Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 > Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 > e-mail: eduardo@REDACTED > > From robert.virding@REDACTED Tue Aug 8 23:57:48 2006 From: robert.virding@REDACTED (Robert Virding) Date: Tue, 08 Aug 2006 23:57:48 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <200608070209.k7729rYi116857@atlas.otago.ac.nz> References: <200608070209.k7729rYi116857@atlas.otago.ac.nz> Message-ID: <44D908DC.9030500@telia.com> Seriously I was joking about about back-references, REs are complex enough as they are. :-) Also they are easy to implement if you don't worry about how other implementations do it. I managed to find a POSIX RE definition which I think is recent, it is from Open Group Base Spec Issue 6 IIE Std 1003.1 2004. Their site contained many versions. Richard, it is as you say AWK REs are Extended REs without the back-references. I don't have the book handy so I don't remember if AWK bracketed expressions had collating symbols, equivalence classes and character class expressions. Regexp doesn't have any of these, nor does it have interval expressions. Though why I didn't add interval expressions I can't remember. I also notice that I was sometimes lax in parsing and allow some undefined constructions, for example the bugs mentioned earlier. Perhaps a better way would be to get rid as many undefined as possible and try to make it subset of the standard. Or, perhaps, try to make it follow another implementation. Apart from that there are some things I would like to add: 1. The missing interval expressions. 2. Accessing sub expressions (but not through back-references) through a new match function and in gsub/sub. This would be useful and probably efficient. I actually had an implementation that did this but lost it in a move. I have copy of the finnish paper and I will see what I can do when I understand what they are doing. 3. A compiler. It is not difficult and I already have one in leex that just needs re-packaging. Just some thoughts. Robert Richard A. O'Keefe skrev: > Robert Virding wrote: > The best way to go continue is to decide what we would like a regexp > package to be able to do. I used the regexps and interfaces (sub, gsub > etc) to them from standard AWK which were well defined, stable and > allowed you to do most things. Perhaps the POSIX definition is the way > to go. > > HAH! > > This year I've got my 3rd-year Software Engineering class maintaining Mawk. > Amongst other things this has had me reading the Single Unix Specification, > 3rd edition (which is pretty close to POSIX) with a microscope. > > One thing we learn from a close reading is that AWK regular expressions > are one thing (they include "|" but not back-references) and POSIX regular > expressions are another (or more precisely, two other things: Basic REs > contain neither "|" not back-references, Extended REs contain both). > A particularly entertaining (if you like pain) read is the Mac OS X manual > page for regcomp, which says near the end: > > There are a number of decisions that IEEE Std 1003.2 ... leaves up to > the implementor, either by explicitly saying "undefined" or by virtue > of them being forbidden by the RE grammar. > > There then follow (by my count) 13 such decisions. > > I particularly like the BUGS section where we are told: > The back-reference code is subtle and doubts linger about its correctness... > The regexec function is largely insensitive to RE complexity except > that back references are massively expensive. ... > Due to a mistake in IEEE STd 1003.2 things like "a)b" are legal ... > The standard definition of back references is vague ... > > Since back references turn regexp matching from O(M*N) to NP-hard, > maybe it's a good thing that AWK regular expressions don't include them > and Erlang shouldn't either. > >>From the AWK specification, just grepping for 'undefined', we find > \0 \00 \000 are all undefined > \x is undefined except for a handful of x values; > in particular \x is undefined. > Matching a string that contains a NUL anywhere is undefined. > sub(/regexp/, repl, (x)) is undefined. > and implicitly, all of the issues identified in the Mac OS X manual > page apply, and DO vary between AWK implementations. (Hey, I've been > writing test cases!) > > Most features (for example backreferences) are pretty easy to implement > when interpreting the regexp or using an NFA but difficult compiled/with > a DFA. Actually adding backreferences is to regexp is probably easier > then fixing the bug Fredrik Thulin mentioned. And much more fun. :-) > > I am reluctant to suggest anything that might break compatiblity, but > when that compatibility is somewhat tenuous to start with, the difference > between something that's guaranteed fast (regexps WITHOUT back > references) and something that's pretty much guaranteed slow *and* unclear > (regexps WITH back references) begins to matter more. > > I therefore strongly suggest that back references be kept out of Erlang > regular expressions. If they really were "pretty easy to implement" > there would be more agreement about what they are supposed to do. From ulf.wiger@REDACTED Wed Aug 9 00:20:55 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Wed, 9 Aug 2006 00:20:55 +0200 Subject: gen_leader's status. In-Reply-To: <944da41d0608081239o40b6694el2a67c2c92d2498c7@mail.gmail.com> Message-ID: There is a new version of gen_leader here: http://www.cs.chalmers.se/~hanssv/leader_election/ (It's not in Jungerl yet - sorry.) It has a new leader election algorithm, which is much better suited to Erlang's semantics. The code has been tested using abstract traces (see the paper) and QuickCheck. The API is still the same. BR, Ulf W ________________________________ From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Alex Arnon Sent: den 8 augusti 2006 21:40 To: erlang-questions@REDACTED Subject: gen_leader's status. Hi All, What is gen_leader's current status? Looking through my mailing list archives, it seems that it was considered to be functioning well if not thoroughly tested. Can anyone give me a heads-up on this? gen_leader in fact implements a superset of what I need, so I can actually get by with a somewhat looser scheme using pg2, I think. - I need a group of processes (1 per node) of which only one periodically wakes up and performs cleanup on some mnesia tables. - It is probably not too bad if occasionally (due to node crashes etc.) more than one would wake up, as I believe it should be simple to avoid if nodes are reasonably stable. Cheers, Alex. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Wed Aug 9 07:48:39 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 09 Aug 2006 07:48:39 +0200 Subject: an unexpected (to me) difference between lists:map/2 and list comprehension In-Reply-To: References: <44D82936.7030600@ericsson.com> Message-ID: <44D97737.1060405@ericsson.com> On 2006-08-08 16:02, James Hague wrote: >> Just remember that the <- construct is a filter, >> and the LHS is where some operation is applied >> to the selection. > > Except that you can also add filters elsewhere, like: > > [X || X <- [1,2,3,4], X > 2] <- is a special filter. the normal filters work with true/false. <- works with match/nomatch. so i still think it should get a special mentioning in the documentaion. > (I honestly had no idea that the "<-" worked as a filter until I read > this thread.) i am happy that somebody else will not have to make the same mistake that i did. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From alex.arnon@REDACTED Wed Aug 9 09:02:50 2006 From: alex.arnon@REDACTED (Alex Arnon) Date: Wed, 9 Aug 2006 10:02:50 +0300 Subject: gen_leader's status. In-Reply-To: References: <944da41d0608081239o40b6694el2a67c2c92d2498c7@mail.gmail.com> Message-ID: <944da41d0608090002u37a601c8uadbcd76785acd3fe@mail.gmail.com> Thanks, I'll look into it! On 8/9/06, Ulf Wiger (TN/EAB) wrote: > > > There is a new version of gen_leader here: > > http://www.cs.chalmers.se/~hanssv/leader_election/ > > (It's not in Jungerl yet - sorry.) > > It has a new leader election algorithm, which is much better suited to > Erlang's semantics. The code has been tested using abstract traces (see the > paper) and QuickCheck. > > The API is still the same. > > BR, > Ulf W > > ------------------------------ > *From:* owner-erlang-questions@REDACTED [mailto: > owner-erlang-questions@REDACTED] *On Behalf Of *Alex Arnon > *Sent:* den 8 augusti 2006 21:40 > *To:* erlang-questions@REDACTED > *Subject:* gen_leader's status. > > Hi All, > > What is gen_leader's current status? Looking through my mailing list > archives, it seems that it was considered to be functioning well if not > thoroughly tested. Can anyone give me a heads-up on this? > gen_leader in fact implements a superset of what I need, so I can actually > get by with a somewhat looser scheme using pg2, I think. > - I need a group of processes (1 per node) of which only one periodically > wakes up and performs cleanup on some mnesia tables. > - It is probably not too bad if occasionally (due to node crashes etc.) > more than one would wake up, as I believe it should be simple to avoid if > nodes are reasonably stable. > > Cheers, > Alex. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mats.cronqvist@REDACTED Wed Aug 9 09:02:49 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Wed, 09 Aug 2006 09:02:49 +0200 Subject: Erlang for desktop applications? In-Reply-To: <1154875186.9952.7.camel@cerebellum> References: <1154875186.9952.7.camel@cerebellum> Message-ID: <44D98899.4030507@ericsson.com> there are three GUI bindings (besides GS) that i know of; wxerlang wxerlang.sourceforge.net erlgtk erlgtk.sourceforge.net gtkNode jungerl.sourceforge.net all of them are (as far as i can tell) beta. however, i personally use both erlgtk and gtkNode daily (on unix, i dont know about windows/mac). mats From joelr1@REDACTED Wed Aug 9 10:48:49 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 9 Aug 2006 09:48:49 +0100 Subject: Mac Intel In-Reply-To: <200608062111.k76LBoaw017823@harpo.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> Message-ID: <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> Mikael, On Aug 6, 2006, at 10:11 PM, Mikael Pettersson wrote: > Unless you have the source code for the OSX C library, you basically > have to run 'nm' on the library files to find all versions of > sigaction(), What is the approach if you _do_ have the source code to the OSX C library? Apple just released the kernel source code. http://lists.apple.com/archives/Darwin-dev/2006/Aug/msg00067.html Thanks, Joel -- http://wagerlabs.com/ From w.a.de.jong@REDACTED Wed Aug 9 19:48:07 2006 From: w.a.de.jong@REDACTED (Willem de Jong) Date: Wed, 9 Aug 2006 19:48:07 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <44D8FF66.1040500@telia.com> References: <44D0B193.3030406@ericsson.com> <44D1D9FD.1000106@telia.com> <200608031710.50656.ft@it.su.se> <44D30DE3.8010305@telia.com> <407d9ef80608061255h1304ae48k621aba7778759e83@mail.gmail.com> <44D8FF66.1040500@telia.com> Message-ID: <407d9ef80608091048u3d468f5n27b84813b95a8c32@mail.gmail.com> Hello Robert, I looked again: for the pattern in the 'benchmark' ('con[a-z]*') it is more than twice as fast. For longer patterns the difference gets bigger; if the literal string is 5 characters long it is about 3 times as fast (disclaimer: on my PC response time is difficult to measure exactly, I had to use a very long string to get meaningful results). I also tried what how long it would take to search for a match when using a finite state machine that was written specifically for the pattern from the benchmark. This was MUCH faster still. It gives me the impression that it should be possible to make further improvements. Regards, Willem On 8/8/06, Robert Virding wrote: > Willem de Jong skrev: > > I think regexp is too slow on exactly the kind of pattern that was > > used in the 'benchmark': patterns that contain a long(ish) literal > > string, especially if they start with it. > > > > Regexp:parse() translates the pattern to a compiled RE that looks like > > this (for ABC): {concat, concat{A, B}, C}. As long as no match is > > found, the algorithm tries to match every character against the > > compiled RE. For every character, it has to traverse the tree down to > > the A. If the pattern is longer, the tree grows 'deeper' (one > > additional level with each additional character), and this process > > takes more time. > > This way of parsing the regexp follows the definition: concatenation is > left associative. > > > The solution (I think) is to change the result of regexp:parse to > > something that looks like this: {concat, A, concat{B, C}}. Then it > > will find the A much quicker. > > I don't think that transforming it in this way changes the semantics but > I have not checked it. Does anyone know? If it doesn't then it should > probably be done directly in the parser. > > > I wrote a 'post-processing' module that modifies the compiled RE as > > described. I also changed a few things to the main function that does > > the matching (re_apply), but I am not sure whether that was really > > necessary. (If you want I can send you the code). > > > > On my PC it is not so easy to measure response-time, but my impression > > is that this improved the result for the benchmark by a factor 3. > > Please send me the core and I will check it out. I was surprised by the > speed-up you mention. If it is of this order then it would be worth the > effort. Given it doesn't change the semantics. > > Robert > I post-processed the RE using the function below. Obviously the parser should do this directly, this is just a hack. ----------------- %% translates {concat, concat{A, B}, C} to %% {concat, A, concat{B, C}} %% First make a list ABC, and then form it into the second form. postProcess(RE) -> reconstruct(deconstruct(RE)). deconstruct({concat, A, B}) -> deconstruct(A) ++ deconstruct(B); deconstruct({Type, A, B}) -> [{Type, deconstruct(A), deconstruct(B)}]; deconstruct(A) -> [A]. reconstruct({Type, A, B}) -> {Type, reconstruct(A), reconstruct(B)}; reconstruct([A, B]) when B /= [] -> {concat, reconstruct(A), reconstruct(B)}; reconstruct([A | Tail]) when Tail /= [] -> {concat, reconstruct(A), reconstruct(Tail)}; reconstruct([A]) -> A; reconstruct(A) -> A. ------------------- It looks like you can use such a re-written RE with the existing match function, and improve speed by a factor of around 1.5 (but I didn't test this extensively). I modified re_apply as well. In its original form, the 'nomatch' result is only found if all other patterns fail. It is sort of a catch-all: re_apply(_RE, _More, _S, _P) -> nomatch. I don't know how the matching algorithm works, but I guess that this is expensive: all other patterns have to be tried first, and this happens a lot. So I changed the re_apply() function as shown below. Note that this may slow down some cases where there are few literal characters in the RE (but only a bit). Both changes together give significant improvements for long literal strings in the RE. (But of course this has to be tested etc...) ------------------------ %% re_apply is the main function. re_apply(S, St, RE) -> re_apply(RE, [], S, St). re_apply(epsilon, More, S, P) -> %This always matches re_apply_more(More, S, P); re_apply({'or',RE1,RE2}, More, S, P) -> re_apply_or(re_apply(RE1, More, S, P), re_apply(RE2, More, S, P)); %% WdJ: %% in stead of making the no-match situation the pattern that %% only matches if all else fails, we look for it. %% if I remember correctly, the main thing I changed to re_apply is adding %% the 4 lines below. re_apply({concat,C,RE2}, More, [C|S], P) -> re_apply(RE2, More, S, P+1); re_apply({concat, C, _}, _More, _, _P) when integer(C) -> nomatch; re_apply({concat,RE1,RE2}, More, S0, P) -> re_apply(RE1, [RE2|More], S0, P); re_apply({kclosure,CE}, More, S, P) -> %% Be careful with the recursion, explicitly do one call before %% looping. re_apply_or(re_apply_more(More, S, P), re_apply(CE, [{kclosure,CE}|More], S, P)); re_apply({pclosure,CE}, More, S, P) -> re_apply(CE, [{kclosure,CE}|More], S, P); re_apply({optional,CE}, More, S, P) -> re_apply_or(re_apply_more(More, S, P), re_apply(CE, More, S, P)); re_apply(bos, More, S, 1) -> re_apply_more(More, S, 1); re_apply(eos, More, [$\n|S], P) -> re_apply_more(More, S, P); re_apply(eos, More, [], P) -> re_apply_more(More, [], P); re_apply({char_class,Cc}, More, [C|S], P) -> case in_char_class(C, Cc) of true -> re_apply_more(More, S, P+1); false -> nomatch end; re_apply({comp_class,Cc}, More, [C|S], P) -> case in_char_class(C, Cc) of true -> nomatch; false -> re_apply_more(More, S, P+1) end; re_apply(C, More, [C|S], P) when integer(C) -> re_apply_more(More, S, P+1); re_apply(_RE, _More, _S, _P) -> nomatch. %% re_apply_more([RegExp], String, Length) -> re_app_res(). %% WdJ: I believe I made a small change here as well. re_apply_more([RE|More], S, P) -> re_apply(RE, More, S, P); re_apply_more([], S, P) -> {match,P,S}. From widjayy@REDACTED Wed Aug 9 21:31:05 2006 From: widjayy@REDACTED (widjayy) Date: Wed, 09 Aug 2006 21:31:05 +0200 Subject: server chat with erlang Message-ID: <44DA37F9.2050100@neuf.fr> hi everyone. I want to make a chat with erlang. That's not a great idea, I know ;) My server will be with erlang, and the client will connect to it through a web page. But I don't which is the best technology (language, method) to connect to erlang. Thank you for your help. From joelr1@REDACTED Wed Aug 9 22:20:24 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 9 Aug 2006 21:20:24 +0100 Subject: server chat with erlang In-Reply-To: <44DA37F9.2050100@neuf.fr> References: <44DA37F9.2050100@neuf.fr> Message-ID: Why bother reinventing the wheel? Use ejabberd, it's written in Erlang. On Aug 9, 2006, at 8:31 PM, widjayy wrote: > hi everyone. > > I want to make a chat with erlang. That's not a great idea, I know ;) > My server will be with erlang, and the client will connect to it > through > a web page. But I don't which is the best technology (language, > method) > to connect to erlang. > > Thank you for your help. -- http://wagerlabs.com/ From joelr1@REDACTED Thu Aug 10 01:47:27 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 00:47:27 +0100 Subject: Mac Intel In-Reply-To: <17626.3004.908596.504480@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> Message-ID: This might turn out to be simple than I thought sigaltstack-wise but I'm getting the following error. My poking around reveals that ERTS_ALC_T_HIPE gets generated from ./ erts/emulator/beam/erl_alloc.types by make_alloc_types (a perl script). I enabled smp, threads and hipe during the configure step but the same error happens if I just enable hipe. In erl_alloc.types the generation of ERTS_ALC_T_HIPE is conditional on +hipe. Does it mean something is not getting defined somewhere during configure? What do I need to enable/disable to generate ERTS_ALC_T_HIPE? Thanks, Joel --- cd erts/emulator && ERL_TOP=/Users/joelr/work/Erlang/otp_src_R11B-0 make generate depend make -f i386-apple-darwin8.7.1/Makefile generate gcc -mdynamic-no-pic -g -O3 -I/Users/joelr/work/Erlang/ otp_src_R11B-0/erts/i386-apple-darwin8.7.1 -no-cpp-precomp - DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes - DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -Ibeam -Isys/unix -Isys/ common -Ii386-apple-darwin8.7.1/opt -Ii386-apple-darwin8.7.1 -Izlib - Ihipe -I../include/internal -I../include/internal/i386-apple- darwin8.7.1 -c hipe/hipe_mkliterals.c -o /Users/joelr/work/Erlang/ otp_src_R11B-0/erts/obj.beam/i386-apple-darwin8.7.1/hipe_mkliterals.o In file included from beam/erl_process.h:39, from beam/beam_load.h:23, from beam/export.h:66, from beam/global.h:29, from hipe/hipe_mkliterals.c:14: hipe/hipe_process.h: In function 'hipe_delete_process': hipe/hipe_process.h:64: error: 'ERTS_ALC_T_HIPE' undeclared (first use in this function) hipe/hipe_process.h:64: error: (Each undeclared identifier is reported only oncehipe/hipe_process.h:64: error: for each function it appears in.) -- http://wagerlabs.com/ From dufflebunk@REDACTED Thu Aug 10 02:35:46 2006 From: dufflebunk@REDACTED (Paul Mahon) Date: Wed, 09 Aug 2006 17:35:46 -0700 Subject: server chat with erlang In-Reply-To: <44DA37F9.2050100@neuf.fr> References: <44DA37F9.2050100@neuf.fr> Message-ID: <1155170146.18693.7.camel@dufflebunk> If you just want something simple, you could write the client with YAWS so you wouldn't need to use anything but Erlang. On Wed, 2006-09-08 at 21:31 +0200, widjayy wrote: > hi everyone. > > I want to make a chat with erlang. That's not a great idea, I know ;) > My server will be with erlang, and the client will connect to it through > a web page. But I don't which is the best technology (language, method) > to connect to erlang. > > Thank you for your help. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From ryanobjc@REDACTED Thu Aug 10 04:04:30 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Wed, 9 Aug 2006 19:04:30 -0700 Subject: server chat with erlang In-Reply-To: <1155170146.18693.7.camel@dufflebunk> References: <44DA37F9.2050100@neuf.fr> <1155170146.18693.7.camel@dufflebunk> Message-ID: <78568af10608091904x78df0ecq5da35591408e81f7@mail.gmail.com> Write yet another irc server. The standard protocol is line oriented, and you can write a single node very easily. The challenge will be to write multiple node chat servers. -ryan On 8/9/06, Paul Mahon wrote: > If you just want something simple, you could write the client with YAWS > so you wouldn't need to use anything but Erlang. > > On Wed, 2006-09-08 at 21:31 +0200, widjayy wrote: > > hi everyone. > > > > I want to make a chat with erlang. That's not a great idea, I know ;) > > My server will be with erlang, and the client will connect to it through > > a web page. But I don't which is the best technology (language, method) > > to connect to erlang. > > > > Thank you for your help. > > > From bsder@REDACTED Thu Aug 10 08:33:16 2006 From: bsder@REDACTED (Andrew Lentvorski) Date: Wed, 09 Aug 2006 23:33:16 -0700 Subject: Erlang for desktop applications? In-Reply-To: <20060808182836.32967.qmail@web38811.mail.mud.yahoo.com> References: <20060808182836.32967.qmail@web38811.mail.mud.yahoo.com> Message-ID: <44DAD32C.6090406@allcaps.org> Thomas Lindgren wrote: > Wasn't your initial point that you wanted to exploit > multicore systems? When the clock rate is constant, > your future speedup is determined by available > parallelism, which means you may have to design your > system and algorithms for parallel execution. As an aside, even something as "primitive" as a Nintendo DS, qualifies as multicore since it has an ARM9 and an ARM7 as well as a graphics chip. Most of the primitive I/O runs on the ARM7 processor which gets used as a slave. The heavy computation goes into the ARM9 and the graphics gets offloaded. The ARM9 and ARM7 even have a hardware FIFO which triggers interrupts so that the ARM9 and ARM7 can pass things back and forth asynchronously. -a From mikpe@REDACTED Wed Aug 9 18:22:20 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 9 Aug 2006 18:22:20 +0200 Subject: Mac Intel In-Reply-To: <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> Message-ID: <17626.3004.908596.504480@alkaid.it.uu.se> Joel Reymont writes: > Mikael, > > On Aug 6, 2006, at 10:11 PM, Mikael Pettersson wrote: > > > Unless you have the source code for the OSX C library, you basically > > have to run 'nm' on the library files to find all versions of > > sigaction(), > > What is the approach if you _do_ have the source code to the OSX C > library? > > Apple just released the kernel source code. Assuming they also release their C library sources, then the answer is obvious: study the code until you understand how signal handling works in the C library, including interaction with alternate signal stacks and threads. Then you'll be in position to either suggest code to safely override sigaction, or to declare this a lost cause (if their C library has insurmountable problems). From valentin@REDACTED Thu Aug 10 09:38:14 2006 From: valentin@REDACTED (Valentin Micic) Date: Thu, 10 Aug 2006 09:38:14 +0200 Subject: Mnesia and Oracle References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com> Message-ID: <003901c6bc4f$f2109890$6401a8c0@moneymaker2> I do not think combining mnesia and MySQL is a good choice, no matter what justification one may put forward. If nothing else, it complicates maintenance, confuses people, and may (potentialy) compromise both products... not to mention a data integrity issues intrinsic to such an implementation. Mnesia's dets tables work reasonably well, even with huge data sets. The problem(s) starts when you start deleting records -- free list grows to the point that (IMHO) takes quite a long time to write it to disk. This becomes more obvious when one uses a lots of fragments. Thus, even if you shut the database regularly, it might corrupt few fragments. My guess: mensia controller does not give enough time to all dets processes (one per fragment) to flush their respective free lists to dist. A question for Erlang/OTP team: how can one prevent this from happening? I'm looking more (and more) to Berkeley DB for storage. Anybody, how does it compare to dets? Valentin. ----- Original Message ----- From: "Yariv Sadan" To: "Inswitch Solutions" Cc: Sent: Tuesday, August 08, 2006 11:51 PM Subject: Re: Mnesia and Oracle > Hi Eduardo, > > I haven't had production experience with these databases, but there > are a couple of things I found by research that are keeping me from > using Mnesia exclusively in my application: > > - Mnesia disc storage, based on dets, has a couple of drawbacks when > handling very large (many gigs) datasets: potentially long repair > times and memory consumption that grows with data fragmentation. > - QLC, the query engine for Mnesia, doesn't currently optimize joins. > If your queries involve joining big tables, they can take a long time > to execute. > > The join optimizations are planned for a future R11 OTP release, but > there are no plans to change dets AFAIK. > > Depending on your application, these issues may not be a big problem. > For the application I'm building, I'm planning on using both MySQL and > Mnesia, where MySQL will be used for storing high-volume data and > Mnesia for "live" session data. > > Hope this helps! > > Regards, > Yariv > > On 8/8/06, Inswitch Solutions wrote: >> >> >> >> Hi, >> >> I'm already working with Oracle and Mnesia, and I'd like to hear >> experiences of the Erlang community about these databases. >> When deciding over Oracle or Mnesia database for an Erlang, or non >> Erlang, based real-time system which factors are in favour in one over >> the other (performance...?) ?. >> >> >> thanks, Eduardo >> >> >> >> >> >> Prepaid Expertise - Programmable Switches >> Powered by Ericsson Licensed Technology >> Eng. Eduardo Figoli - Development Center - IN Switch Solutions >> Inc. >> Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 >> Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 >> e-mail: eduardo@REDACTED >> >> From ryanobjc@REDACTED Thu Aug 10 09:54:55 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Thu, 10 Aug 2006 00:54:55 -0700 Subject: Mnesia and Oracle In-Reply-To: <003901c6bc4f$f2109890$6401a8c0@moneymaker2> References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com> <003901c6bc4f$f2109890$6401a8c0@moneymaker2> Message-ID: <78568af10608100054w4f4e6341g54ebf4f40e5ea2a1@mail.gmail.com> What about my 50 gb data set? What about my 100 gb data set? Ultimately I think a major value is using mnesia as a coherent cache and some SQL backend as a master storage. -ryan On 8/10/06, Valentin Micic wrote: > I do not think combining mnesia and MySQL is a good choice, no matter what > justification one may put forward. If nothing else, it complicates > maintenance, confuses people, and may (potentialy) compromise both > products... not to mention a data integrity issues intrinsic to such an > implementation. > Mnesia's dets tables work reasonably well, even with huge data sets. The > problem(s) starts when you start deleting records -- free list grows to the > point that (IMHO) takes quite a long time to write it to disk. This becomes > more obvious when one uses a lots of fragments. Thus, even if you shut the > database regularly, it might corrupt few fragments. My guess: mensia > controller does not give enough time to all dets processes (one per > fragment) to flush their respective free lists to dist. > > A question for Erlang/OTP team: how can one prevent this from happening? > > I'm looking more (and more) to Berkeley DB for storage. Anybody, how does it > compare to dets? > > Valentin. > > > ----- Original Message ----- > From: "Yariv Sadan" > To: "Inswitch Solutions" > Cc: > Sent: Tuesday, August 08, 2006 11:51 PM > Subject: Re: Mnesia and Oracle > > > > Hi Eduardo, > > > > I haven't had production experience with these databases, but there > > are a couple of things I found by research that are keeping me from > > using Mnesia exclusively in my application: > > > > - Mnesia disc storage, based on dets, has a couple of drawbacks when > > handling very large (many gigs) datasets: potentially long repair > > times and memory consumption that grows with data fragmentation. > > - QLC, the query engine for Mnesia, doesn't currently optimize joins. > > If your queries involve joining big tables, they can take a long time > > to execute. > > > > The join optimizations are planned for a future R11 OTP release, but > > there are no plans to change dets AFAIK. > > > > Depending on your application, these issues may not be a big problem. > > For the application I'm building, I'm planning on using both MySQL and > > Mnesia, where MySQL will be used for storing high-volume data and > > Mnesia for "live" session data. > > > > Hope this helps! > > > > Regards, > > Yariv > > > > On 8/8/06, Inswitch Solutions wrote: > >> > >> > >> > >> Hi, > >> > >> I'm already working with Oracle and Mnesia, and I'd like to hear > >> experiences of the Erlang community about these databases. > >> When deciding over Oracle or Mnesia database for an Erlang, or non > >> Erlang, based real-time system which factors are in favour in one over > >> the other (performance...?) ?. > >> > >> > >> thanks, Eduardo > >> > >> > >> > >> > >> > >> Prepaid Expertise - Programmable Switches > >> Powered by Ericsson Licensed Technology > >> Eng. Eduardo Figoli - Development Center - IN Switch Solutions > >> Inc. > >> Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 > >> Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 > >> e-mail: eduardo@REDACTED > >> > >> > > From valentin@REDACTED Thu Aug 10 10:21:25 2006 From: valentin@REDACTED (Valentin Micic) Date: Thu, 10 Aug 2006 10:21:25 +0200 Subject: Mnesia and Oracle References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com> <003901c6bc4f$f2109890$6401a8c0@moneymaker2> <78568af10608100054w4f4e6341g54ebf4f40e5ea2a1@mail.gmail.com> Message-ID: <004101c6bc55$fae547d0$6401a8c0@moneymaker2> Well, we're using mnesia with dets stroring there-about 80GB data set. IMHO, if you want to develop a cache to front RDBMS, what would mnesia do for you that ETS wouldn't? Other than processing overhead, of course. And my main issue would be data-integrity. V. ----- Original Message ----- From: "Ryan Rawson" To: "Valentin Micic" Cc: "Yariv Sadan" ; "Inswitch Solutions" ; Sent: Thursday, August 10, 2006 9:54 AM Subject: Re: Mnesia and Oracle > What about my 50 gb data set? > > What about my 100 gb data set? > > Ultimately I think a major value is using mnesia as a coherent cache > and some SQL backend as a master storage. > > -ryan > > > On 8/10/06, Valentin Micic wrote: >> I do not think combining mnesia and MySQL is a good choice, no matter >> what >> justification one may put forward. If nothing else, it complicates >> maintenance, confuses people, and may (potentialy) compromise both >> products... not to mention a data integrity issues intrinsic to such an >> implementation. >> Mnesia's dets tables work reasonably well, even with huge data sets. The >> problem(s) starts when you start deleting records -- free list grows to >> the >> point that (IMHO) takes quite a long time to write it to disk. This >> becomes >> more obvious when one uses a lots of fragments. Thus, even if you shut >> the >> database regularly, it might corrupt few fragments. My guess: mensia >> controller does not give enough time to all dets processes (one per >> fragment) to flush their respective free lists to dist. >> >> A question for Erlang/OTP team: how can one prevent this from happening? >> >> I'm looking more (and more) to Berkeley DB for storage. Anybody, how does >> it >> compare to dets? >> >> Valentin. >> >> >> ----- Original Message ----- >> From: "Yariv Sadan" >> To: "Inswitch Solutions" >> Cc: >> Sent: Tuesday, August 08, 2006 11:51 PM >> Subject: Re: Mnesia and Oracle >> >> >> > Hi Eduardo, >> > >> > I haven't had production experience with these databases, but there >> > are a couple of things I found by research that are keeping me from >> > using Mnesia exclusively in my application: >> > >> > - Mnesia disc storage, based on dets, has a couple of drawbacks when >> > handling very large (many gigs) datasets: potentially long repair >> > times and memory consumption that grows with data fragmentation. >> > - QLC, the query engine for Mnesia, doesn't currently optimize joins. >> > If your queries involve joining big tables, they can take a long time >> > to execute. >> > >> > The join optimizations are planned for a future R11 OTP release, but >> > there are no plans to change dets AFAIK. >> > >> > Depending on your application, these issues may not be a big problem. >> > For the application I'm building, I'm planning on using both MySQL and >> > Mnesia, where MySQL will be used for storing high-volume data and >> > Mnesia for "live" session data. >> > >> > Hope this helps! >> > >> > Regards, >> > Yariv >> > >> > On 8/8/06, Inswitch Solutions wrote: >> >> >> >> >> >> >> >> Hi, >> >> >> >> I'm already working with Oracle and Mnesia, and I'd like to hear >> >> experiences of the Erlang community about these databases. >> >> When deciding over Oracle or Mnesia database for an Erlang, or non >> >> Erlang, based real-time system which factors are in favour in one >> >> over >> >> the other (performance...?) ?. >> >> >> >> >> >> thanks, Eduardo >> >> >> >> >> >> >> >> >> >> >> >> Prepaid Expertise - Programmable Switches >> >> Powered by Ericsson Licensed Technology >> >> Eng. Eduardo Figoli - Development Center - IN Switch Solutions >> >> Inc. >> >> Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 >> >> Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 >> >> e-mail: eduardo@REDACTED >> >> >> >> >> >> > From mikpe@REDACTED Thu Aug 10 10:46:29 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 10 Aug 2006 10:46:29 +0200 Subject: Mac Intel In-Reply-To: References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> Message-ID: <17626.62053.183124.147819@alkaid.it.uu.se> Joel Reymont writes: > This might turn out to be simple than I thought sigaltstack-wise but > I'm getting the following error. > > My poking around reveals that ERTS_ALC_T_HIPE gets generated from ./ > erts/emulator/beam/erl_alloc.types by make_alloc_types (a perl > script). I enabled smp, threads and hipe during the configure step > but the same error happens if I just enable hipe. > > In erl_alloc.types the generation of ERTS_ALC_T_HIPE is conditional > on +hipe. Does it mean something is not getting defined somewhere > during configure? > > What do I need to enable/disable to generate ERTS_ALC_T_HIPE? > > Thanks, Joel > > --- > cd erts/emulator && ERL_TOP=/Users/joelr/work/Erlang/otp_src_R11B-0 > make generate depend > make -f i386-apple-darwin8.7.1/Makefile generate > gcc -mdynamic-no-pic -g -O3 -I/Users/joelr/work/Erlang/ > otp_src_R11B-0/erts/i386-apple-darwin8.7.1 -no-cpp-precomp - > DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes - > DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -Ibeam -Isys/unix -Isys/ > common -Ii386-apple-darwin8.7.1/opt -Ii386-apple-darwin8.7.1 -Izlib - > Ihipe -I../include/internal -I../include/internal/i386-apple- > darwin8.7.1 -c hipe/hipe_mkliterals.c -o /Users/joelr/work/Erlang/ > otp_src_R11B-0/erts/obj.beam/i386-apple-darwin8.7.1/hipe_mkliterals.o > In file included from beam/erl_process.h:39, > from beam/beam_load.h:23, > from beam/export.h:66, > from beam/global.h:29, > from hipe/hipe_mkliterals.c:14: > hipe/hipe_process.h: In function 'hipe_delete_process': > hipe/hipe_process.h:64: error: 'ERTS_ALC_T_HIPE' undeclared (first > use in this function) > hipe/hipe_process.h:64: error: (Each undeclared identifier is > reported only oncehipe/hipe_process.h:64: error: for each function it > appears in.) You have an inconsistent build. ERTS_ALC_T_HIPE gets defined if HiPE is enabled, and erl_process.h only includes hipe_process.h if HiPE is enabled. So ERTS_ALC_T_HIPE being undefined there should be impossible. My guess is that you started with a standard build, which didn't auto-enable HiPE, and later did a ./configure --enable-hipe; make build in the same source tree, which apparently failed to regenerate erl_alloc_types.h, leading to the error. 'make clean' has historically not worked well in the Erlang/OTP sources, so your best bet is to do the ./configure --enable-hipe; make thing in a completely fresh source tree. From joelr1@REDACTED Thu Aug 10 10:50:16 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 09:50:16 +0100 Subject: Mac Intel In-Reply-To: <17626.62053.183124.147819@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> Message-ID: On Aug 10, 2006, at 9:46 AM, Mikael Pettersson wrote: > You have an inconsistent build. ERTS_ALC_T_HIPE gets defined if HiPE > is enabled, and erl_process.h only includes hipe_process.h if HiPE is > enabled. So ERTS_ALC_T_HIPE being undefined there should be > impossible. Yes, thanks! I did a make clean, another configure and that solved the problem. I'm fixing up the hipe_x86_bifs.m4 assembler now to match hipe_ppc_bifs.m4 for Darwin. -- http://wagerlabs.com/ From joelr1@REDACTED Thu Aug 10 10:52:29 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 09:52:29 +0100 Subject: Mac Intel In-Reply-To: <17626.62053.183124.147819@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> Message-ID: <75B458EE-992E-4829-8A9B-094A9B1F2925@gmail.com> Mikael, Are the assembler files under hipe/ generated by hand or automaticaly? Could you let me know how to properly regenerate hipe_x86_glue.S after I edit hipe_x86_asm.m4 and hipe_x86_bifs.m4? Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Thu Aug 10 10:58:38 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 09:58:38 +0100 Subject: Mac Intel In-Reply-To: <17626.62053.183124.147819@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> Message-ID: <690FFDEC-3DAE-423C-89B0-267D561FC3D4@gmail.com> Mikael, Please disregard my question as I must still be sleeping. It appears that .S files do not get regenerated and must be edited. Thanks, Joel From joelr1@REDACTED Thu Aug 10 11:25:33 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 10:25:33 +0100 Subject: Mac Intel In-Reply-To: <17626.62053.183124.147819@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> Message-ID: Mikael, My emulator compiles fine after fixing up the assembler (m4-style). I do get a bunch of undefined symbols during linking, though. I think hipe_native_bif.o is not being picked up. It does get compiled into ./ obj.hybrid.beam/i386-apple-darwin8.7.1/hipe_native_bif.o, though. I'm missing the symbols below and a whole bunch of others. I'm investigating but if you have any quick clues please let me know! /usr/bin/ld: Undefined symbols: _nbif_abs_1 _nbif_add_2 _nbif_and_2 _nbif_append_2 _nbif_append_element_2 _nbif_apply _nbif_apply_3 _nbif_atom_to_list_1 _nbif_band_2 _nbif_binary_to_list_1 _nbif_binary_to_list_3 Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Thu Aug 10 11:36:49 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 10:36:49 +0100 Subject: Mac Intel In-Reply-To: <17626.62053.183124.147819@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> Message-ID: <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> Mikael, What is the meaning of ASYM vs. CSYM in hipe_ppc_asm.m4? Sometimes you see GLOBAL(ASYM($1)) and sometimes GLOBAL(CSYM($1)). It's the same thing under Darwin but CSYM seems to add a dot (.) instead of an underscore for others. My linking problems stems from doing GLOBAL($1) instead of GLOBAL(ASYM ($1)) but I'm wondering if underscore only needs to be added for Darwin. Thanks, Joel From mikpe@REDACTED Thu Aug 10 11:41:39 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 10 Aug 2006 11:41:39 +0200 Subject: Mac Intel In-Reply-To: References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> Message-ID: <17626.65363.959140.990682@alkaid.it.uu.se> Joel Reymont writes: > Mikael, > > My emulator compiles fine after fixing up the assembler (m4-style). I > do get a bunch of undefined symbols during linking, though. I think > hipe_native_bif.o is not being picked up. It does get compiled into ./ > obj.hybrid.beam/i386-apple-darwin8.7.1/hipe_native_bif.o, though. > > I'm missing the symbols below and a whole bunch of others. I'm > investigating but if you have any quick clues please let me know! > > /usr/bin/ld: Undefined symbols: > _nbif_abs_1 > _nbif_add_2 > _nbif_and_2 > _nbif_append_2 > _nbif_append_element_2 > _nbif_apply > _nbif_apply_3 > _nbif_atom_to_list_1 > _nbif_band_2 > _nbif_binary_to_list_1 > _nbif_binary_to_list_3 These are standard HiPE wrappers for standard BIFs or primops. They should be listed in the generated erl_bif_list.h file like this BIF_LIST(am_erlang,am_append_element,2,append_element_2,288) from which the hipe_x86_bifs.m4 file will construct an appropriate wrapper in the generated hipe_x86_bifs.S file. Please check that they occur in both erl_bif_list.h and hipe_x86_bifs.S. If they do occur in hipe_x86_bifs.S, then check that they are defined as global symbols in hipe_x86_bifs.o (nm hipe_x86_bifs.o | grep append_element_2). From mazen@REDACTED Thu Aug 10 10:57:46 2006 From: mazen@REDACTED (Mazen) Date: Thu, 10 Aug 2006 09:57:46 +0100 Subject: server chat with erlang References: Message-ID: <20060810085746.643DB5A1E5@mail.erlangsystems.com> Guest wrote: Why bother reinventing the wheel? Use ejabberd, it's written in Erlang. On Aug 9, 2006, at 8:31 PM, widjayy wrote: > hi everyone. > > I want to make a chat with erlang. That's not a great idea, I know ;) > My server will be with erlang, and the client will connect to it > through > a web page. But I don't which is the best technology (language, > method) > to connect to erlang. > > Thank you for your help. -- http://wagerlabs.com/ Post recived from mailinglist (end of quote) There are MANY reasons to reinvent the wheel, the first and foremost one is that you LEARN from it... I dont think its a bad idea at all to write servers in erlang, I think the whole point with erlang (many concurrent processes doing whatever) is the whole point yes? so... I suggest you go create your own small chat first (your own protocol)... where you can connect and recieve commands through telnet or something... later on you take on a familiar protocol. If you really want to be familiar with the latest hype... do your chatclient in Ajax. In that case you would only have to do use Erlang (server side) and XHTML+JavaScript good luck! :) _________________________________________________________ Post sent from http://www.trapexit.org From mikpe@REDACTED Thu Aug 10 11:58:39 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 10 Aug 2006 11:58:39 +0200 Subject: Mac Intel In-Reply-To: <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> Message-ID: <17627.847.643074.853395@alkaid.it.uu.se> Joel Reymont writes: > Mikael, > > What is the meaning of ASYM vs. CSYM in hipe_ppc_asm.m4? > > Sometimes you see GLOBAL(ASYM($1)) and sometimes GLOBAL(CSYM($1)). ASYM is used for symbols defined in our own assembly code. CSYM is used for symbols defined in C code. (Actually there appears to be some slight inconsistency in the PPC code. I suspect that the nbif_*_*_exception symbols should also be ASYM not CSYM. However, this doesn't matter until PPC64 support is fully implemented.) > It's the same thing under Darwin but CSYM seems to add a dot (.) > instead of an underscore for others. That's Linux/PPC64 weirdness borrowed from AIX. C functions actually have two symbols with different prefixes: one referring to a function descriptor object and one referring to the code itself. > My linking problems stems from doing GLOBAL($1) instead of GLOBAL(ASYM > ($1)) but I'm wondering if underscore only needs to be added for Darwin. It should certainly not be added for Linux/x86 or Solaris/x86. From joelr1@REDACTED Thu Aug 10 12:08:02 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 11:08:02 +0100 Subject: Mac Intel In-Reply-To: <17627.847.643074.853395@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> <17627.847.643074.853395@alkaid.it.uu.se> Message-ID: On Aug 10, 2006, at 10:58 AM, Mikael Pettersson wrote: >> My linking problems stems from doing GLOBAL($1) instead of GLOBAL >> (ASYM >> ($1)) but I'm wondering if underscore only needs to be added for >> Darwin. > > It should certainly not be added for Linux/x86 or Solaris/x86. No, I have it conditionally defined, just like for Darwin/PPC. My next question... How do I run the HiPE test harness to make sure my mods are proper? Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Thu Aug 10 13:19:25 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 12:19:25 +0100 Subject: Mac Intel In-Reply-To: <17627.847.643074.853395@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> <17627.847.643074.853395@alkaid.it.uu.se> Message-ID: <86BDD7F4-B74E-43FE-AFCF-1B1809BA978E@gmail.com> Mikael, This is my chunk of code form hipe_x86_bifs.m4. I'm wrapping $1 with ASYM and $2 with CSYM. I'm not well-versed with M4, though, so I'm wondering about "addl ` $'8, %esp" below. Does that need to be wrapped as well? What should it look like? Thanks, Joel -- define(nocons_nofail_primop_interface_1, ` #ifndef HAVE_$1 #`define' HAVE_$1 TEXT .align 4 GLOBAL(ASYM($1)) ASYM($1): /* copy native stack pointer */ NBIF_COPY_NSP(1) /* switch to C stack */ SWITCH_ERLANG_TO_C_QUICK /* make the call on the C stack */ pushl NBIF_ARG(1,0) pushl P call CSYM($2) addl `$'8, %esp /* switch to native stack */ SWITCH_C_TO_ERLANG_QUICK /* return */ NBIF_RET(1) SET_SIZE(ASYM($1)) TYPE_FUNCTION(ASYM($1)) #endif') -- http://wagerlabs.com/ From mikpe@REDACTED Thu Aug 10 13:35:05 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 10 Aug 2006 13:35:05 +0200 Subject: Mac Intel In-Reply-To: References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> <17627.847.643074.853395@alkaid.it.uu.se> Message-ID: <17627.6633.628837.623309@alkaid.it.uu.se> Joel Reymont writes: > > On Aug 10, 2006, at 10:58 AM, Mikael Pettersson wrote: > > >> My linking problems stems from doing GLOBAL($1) instead of GLOBAL > >> (ASYM > >> ($1)) but I'm wondering if underscore only needs to be added for > >> Darwin. > > > > It should certainly not be added for Linux/x86 or Solaris/x86. > > No, I have it conditionally defined, just like for Darwin/PPC. > > My next question... How do I run the HiPE test harness to make sure > my mods are proper? The first step is to verify that the system can bootstrap itself when HiPE is enabled, i.e. that HiPE's runtime support doesn't break BEAM. Do this by making a full build in a freshly unpacked Erlang/OTP source tree to which you've applied whatever patches you need. I assume you're working on the R11B-0 code base? If so, download , unpack the tarball, cd into it, and run ./testsuite.sh . If that works, you can then try ./testsuite.sh --only compiler_tests . From joelr1@REDACTED Thu Aug 10 13:36:13 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 12:36:13 +0100 Subject: Mac Intel In-Reply-To: <17627.847.643074.853395@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> <17627.847.643074.853395@alkaid.it.uu.se> Message-ID: Mikael, I intuitively think that movl `$'$1, %edx /* resumption address */ needs to be movl `$'ASYM($1), %edx /* resumption address */ Is that correct? I suppose that addl `$'8, %esp needs to stay that way since I think you are just trying to generate addl $8, %esp Is that correct? Thanks, Joel -- http://wagerlabs.com/ From mikpe@REDACTED Thu Aug 10 13:46:11 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 10 Aug 2006 13:46:11 +0200 Subject: Mac Intel In-Reply-To: <86BDD7F4-B74E-43FE-AFCF-1B1809BA978E@gmail.com> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> <17627.847.643074.853395@alkaid.it.uu.se> <86BDD7F4-B74E-43FE-AFCF-1B1809BA978E@gmail.com> Message-ID: <17627.7299.205841.646652@alkaid.it.uu.se> Joel Reymont writes: > Mikael, > > This is my chunk of code form hipe_x86_bifs.m4. I'm wrapping $1 with > ASYM and $2 with CSYM. > > I'm not well-versed with M4, though, so I'm wondering about "addl ` > $'8, %esp" below. Does that need to be wrapped as well? What should > it look like? > > Thanks, Joel > > -- > define(nocons_nofail_primop_interface_1, > ` > #ifndef HAVE_$1 > #`define' HAVE_$1 > TEXT > .align 4 > GLOBAL(ASYM($1)) > ASYM($1): > /* copy native stack pointer */ > NBIF_COPY_NSP(1) > > /* switch to C stack */ > SWITCH_ERLANG_TO_C_QUICK > > /* make the call on the C stack */ > pushl NBIF_ARG(1,0) > pushl P > call CSYM($2) > addl `$'8, %esp > > /* switch to native stack */ > SWITCH_C_TO_ERLANG_QUICK > > /* return */ > NBIF_RET(1) > SET_SIZE(ASYM($1)) > TYPE_FUNCTION(ASYM($1)) > #endif') This looks OK. Only the $1 and $2 definitions and references should be wrapped. The "addl `$'8, %esp" is unrelated to the Darwin naming quirks and MUST NOT be altered. From mikpe@REDACTED Thu Aug 10 13:49:39 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 10 Aug 2006 13:49:39 +0200 Subject: Mac Intel In-Reply-To: References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> <17627.847.643074.853395@alkaid.it.uu.se> Message-ID: <17627.7507.913832.343461@alkaid.it.uu.se> Joel Reymont writes: > Mikael, > > I intuitively think that > > movl `$'$1, %edx /* resumption address */ > > needs to be > > movl `$'ASYM($1), %edx /* resumption address */ > > Is that correct? In the expensive_bif_interface macros? Yes, that's correct. I do that on PPC. > I suppose that > > addl `$'8, %esp > > needs to stay that way since I think you are just trying to generate > > addl $8, %esp > > Is that correct? Yes. From chris.double@REDACTED Thu Aug 10 14:01:29 2006 From: chris.double@REDACTED (Chris Double) Date: Fri, 11 Aug 2006 00:01:29 +1200 Subject: Erlang for desktop applications? In-Reply-To: <44DAD32C.6090406@allcaps.org> References: <20060808182836.32967.qmail@web38811.mail.mud.yahoo.com> <44DAD32C.6090406@allcaps.org> Message-ID: On 8/10/06, Andrew Lentvorski wrote: > The ARM9 and ARM7 even have a hardware FIFO which triggers interrupts so > that the ARM9 and ARM7 can pass things back and forth asynchronously. I have a 'tutorial' on programming the DS that covers the FIFO for those interested: http://www.double.co.nz/nintendo_ds/nds_develop7.html With only 4MB of memory I imagine there's not much room for an Erlang port there? Chris. -- http://www.bluishcoder.co.nz From yarivvv@REDACTED Thu Aug 10 14:07:48 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 10 Aug 2006 08:07:48 -0400 Subject: Mnesia and Oracle In-Reply-To: <004101c6bc55$fae547d0$6401a8c0@moneymaker2> References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com> <003901c6bc4f$f2109890$6401a8c0@moneymaker2> <78568af10608100054w4f4e6341g54ebf4f40e5ea2a1@mail.gmail.com> <004101c6bc55$fae547d0$6401a8c0@moneymaker2> Message-ID: <17244f480608100507n78aeea7bk6d4689f8db7bc2e6@mail.gmail.com> Hi, Thanks for the feedback! The reason I intended on using both Mnesia and MySQL is because they would store different kinds of data: MySQL would store long-term, high-volume data and Mnesia would store session data. I think storing session data in Mnesia makes sense because Mnesia makes it easy to replicate this data, which would make the architecture resilient to a front-end server crash (as opposed to storing session data in ETS). IIRC, ejabberd does something similar when using a SQL RDMBS. Could I store session data in MySQL? Yes, and I'm still considering this option, actually. However, the advantage of using Mnesia is I can easily run it on the (Yaws) front-end boxes, which would make session data access much faster. Another problem with dets fragmentation, besides the long time it takes to write it to disk, is the growing memory consumption. This can affect performance if it gets out of hand. AFAIK, the only way to defragment a dets table is to take if offline and reopen it with a forced repair flag, which could take a long time (30 minutes?). Thank Yariv Interesting... maybe I should have explained my reasoning better: On 8/10/06, Valentin Micic wrote: > Well, we're using mnesia with dets stroring there-about 80GB data set. > IMHO, if you want to develop a cache to front RDBMS, what would mnesia do > for you that ETS wouldn't? Other than processing overhead, of course. > And my main issue would be data-integrity. > > V. > > ----- Original Message ----- > From: "Ryan Rawson" > To: "Valentin Micic" > Cc: "Yariv Sadan" ; "Inswitch Solutions" > ; > Sent: Thursday, August 10, 2006 9:54 AM > Subject: Re: Mnesia and Oracle > > > > What about my 50 gb data set? > > > > What about my 100 gb data set? > > > > Ultimately I think a major value is using mnesia as a coherent cache > > and some SQL backend as a master storage. > > > > -ryan > > > > > > On 8/10/06, Valentin Micic wrote: > >> I do not think combining mnesia and MySQL is a good choice, no matter > >> what > >> justification one may put forward. If nothing else, it complicates > >> maintenance, confuses people, and may (potentialy) compromise both > >> products... not to mention a data integrity issues intrinsic to such an > >> implementation. > >> Mnesia's dets tables work reasonably well, even with huge data sets. The > >> problem(s) starts when you start deleting records -- free list grows to > >> the > >> point that (IMHO) takes quite a long time to write it to disk. This > >> becomes > >> more obvious when one uses a lots of fragments. Thus, even if you shut > >> the > >> database regularly, it might corrupt few fragments. My guess: mensia > >> controller does not give enough time to all dets processes (one per > >> fragment) to flush their respective free lists to dist. > >> > >> A question for Erlang/OTP team: how can one prevent this from happening? > >> > >> I'm looking more (and more) to Berkeley DB for storage. Anybody, how does > >> it > >> compare to dets? > >> > >> Valentin. > >> > >> > >> ----- Original Message ----- > >> From: "Yariv Sadan" > >> To: "Inswitch Solutions" > >> Cc: > >> Sent: Tuesday, August 08, 2006 11:51 PM > >> Subject: Re: Mnesia and Oracle > >> > >> > >> > Hi Eduardo, > >> > > >> > I haven't had production experience with these databases, but there > >> > are a couple of things I found by research that are keeping me from > >> > using Mnesia exclusively in my application: > >> > > >> > - Mnesia disc storage, based on dets, has a couple of drawbacks when > >> > handling very large (many gigs) datasets: potentially long repair > >> > times and memory consumption that grows with data fragmentation. > >> > - QLC, the query engine for Mnesia, doesn't currently optimize joins. > >> > If your queries involve joining big tables, they can take a long time > >> > to execute. > >> > > >> > The join optimizations are planned for a future R11 OTP release, but > >> > there are no plans to change dets AFAIK. > >> > > >> > Depending on your application, these issues may not be a big problem. > >> > For the application I'm building, I'm planning on using both MySQL and > >> > Mnesia, where MySQL will be used for storing high-volume data and > >> > Mnesia for "live" session data. > >> > > >> > Hope this helps! > >> > > >> > Regards, > >> > Yariv > >> > > >> > On 8/8/06, Inswitch Solutions wrote: > >> >> > >> >> > >> >> > >> >> Hi, > >> >> > >> >> I'm already working with Oracle and Mnesia, and I'd like to hear > >> >> experiences of the Erlang community about these databases. > >> >> When deciding over Oracle or Mnesia database for an Erlang, or non > >> >> Erlang, based real-time system which factors are in favour in one > >> >> over > >> >> the other (performance...?) ?. > >> >> > >> >> > >> >> thanks, Eduardo > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> Prepaid Expertise - Programmable Switches > >> >> Powered by Ericsson Licensed Technology > >> >> Eng. Eduardo Figoli - Development Center - IN Switch Solutions > >> >> Inc. > >> >> Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 > >> >> Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 > >> >> e-mail: eduardo@REDACTED > >> >> > >> >> > >> > >> > > > > From joelr1@REDACTED Thu Aug 10 14:28:09 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 13:28:09 +0100 Subject: Mac Intel In-Reply-To: <17627.7507.913832.343461@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> <17627.847.643074.853395@alkaid.it.uu.se> <17627.7507.913832.343461@alkaid.it.uu.se> Message-ID: <354CE3DC-D599-466F-AB64-0BD08AAA22DF@gmail.com> I'm stuck on one last bit at the end of hipe_x86_bifs.m4: noproc_primop_interface_0(nbif_handle_fp_exception, erts_restore_fpu) My understanding from reading erts/emulator/sys/unix/sys_float.c is that there's no erts_restore_fpu on Darwin and that a sequence of steps related to pthread and mach is used instead. I think I should change the following bit in sys_float.c to pick up Darwin on Mac Intel: /* Is there no standard identifier for Darwin/MacOSX ? */ #if defined(__ppc__) && defined(__APPLE__) && defined(__MACH__) && ! defined(__DARWIN__) #define __DARWIN__ 1 #endif I would just remove the __ppc__ conditional above and do this in hipe_x86_bifs.m4: ifelse(OPSYS,darwin, ``'', noproc_primop_interface_0(nbif_handle_fp_exception, erts_restore_fpu) )dnl Would it correctly take care of the erts_restore_fpu issue? Thanks, Joel From joelr1@REDACTED Thu Aug 10 14:37:41 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 13:37:41 +0100 Subject: Mac Intel In-Reply-To: <17627.7507.913832.343461@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> <17627.847.643074.853395@alkaid.it.uu.se> <17627.7507.913832.343461@alkaid.it.uu.se> Message-ID: <58CB075D-97A0-413C-80B7-CEF8D8CF815E@gmail.com> I patched hipe_x86_primops.h: #if defined(__APPLE__) && defined(__MACH__) && !defined(__DARWIN__) #define __DARWIN__ 1 #endif #ifndef __DARWIN__ PRIMOP_LIST(am_handle_fp_exception, &nbif_handle_fp_exception) #endif as well as hipe_x86.h: #if defined(__APPLE__) && defined(__MACH__) && !defined(__DARWIN__) #define __DARWIN__ 1 #endif #ifndef __DARWIN__ extern void nbif_handle_fp_exception(void); #endif This seems to have gotten me much further than before. Now, I just have to take care of trapping sigaction :D. -- http://wagerlabs.com From mikpe@REDACTED Thu Aug 10 15:02:10 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 10 Aug 2006 15:02:10 +0200 Subject: Mac Intel In-Reply-To: <354CE3DC-D599-466F-AB64-0BD08AAA22DF@gmail.com> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> <17627.847.643074.853395@alkaid.it.uu.se> <17627.7507.913832.343461@alkaid.it.uu.se> <354CE3DC-D599-466F-AB64-0BD08AAA22DF@gmail.com> Message-ID: <17627.11858.874517.516351@alkaid.it.uu.se> Joel Reymont writes: > I'm stuck on one last bit at the end of hipe_x86_bifs.m4: > > noproc_primop_interface_0(nbif_handle_fp_exception, erts_restore_fpu) > > My understanding from reading erts/emulator/sys/unix/sys_float.c is > that there's no erts_restore_fpu on Darwin and that a sequence of > steps related to pthread and mach is used instead. > > I think I should change the following bit in sys_float.c to pick up > Darwin on Mac Intel: > > /* Is there no standard identifier for Darwin/MacOSX ? */ > #if defined(__ppc__) && defined(__APPLE__) && defined(__MACH__) && ! > defined(__DARWIN__) > #define __DARWIN__ 1 > #endif > > I would just remove the __ppc__ conditional above and do this in > hipe_x86_bifs.m4: > > ifelse(OPSYS,darwin, > ``'', > noproc_primop_interface_0(nbif_handle_fp_exception, erts_restore_fpu) > )dnl > > Would it correctly take care of the erts_restore_fpu issue? These bits require careful attention, and need to be done separately from the HiPE stuff. First extract fpe-test.c from erts/configure.in. For x86 there are two main versions of the code: the Linux one in which we do all the work ourselves, and the Solaris one in which fpsetmask() and the C library handles everything. For PPC there are also two main versions: the Linux one which is similar to the Linux/x86 one, and the Darwin one which has to do really icky things with threads to enable precise fp exceptions + the same hard work we do on Linux. I really can't say where Darwin/x86 fits. You should definitely check if it has a working fpsetmask() a la Solaris, in which case very little code is needed. Otherwise you should check if the Linux/x86 version works, maybe with some tweaks in the signal handler. The Darwin code is quite PPC specific, and hopefully isn't relevant at all. Once fpe-test.c works, you should merge your version of it into erts/configure.in and erts/configure, and your changes into erts/emulator/sys/unix/erl_unix_sys.h and erts/emulator/sys/unix/sys_float.c. This patch set should be tested in a freshly unpacked source tree (no other changes!) configured without HiPE support, by doing a full build. You should also look for the float_SUITE.erl test files (they're there in current development snapshots) and run them in BEAM. First when this works and you know what runtime support is needed on Darwin/x86 is it appropriate to modify HiPE/x86 to match. From valentin@REDACTED Thu Aug 10 15:09:26 2006 From: valentin@REDACTED (Valentin Micic) Date: Thu, 10 Aug 2006 15:09:26 +0200 Subject: Mnesia and Oracle References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com> <003901c6bc4f$f2109890$6401a8c0@moneymaker2> <78568af10608100054w4f4e6341g54ebf4f40e5ea2a1@mail.gmail.com> <004101c6bc55$fae547d0$6401a8c0@moneymaker2> <17244f480608100507n78aeea7bk6d4689f8db7bc2e6@mail.gmail.com> Message-ID: <005201c6bc7e$382248f0$6401a8c0@moneymaker2> So, I guess, it all comes down to what are you trying to do ;-) and I certainly do not know what you mean by session data and a need to replicate it: my experience with mnesia replication, however, is somewhat negative with respect to volatile network environment. IMHO, if your data model is relatively simple, you would be better of doing a custom replication. As far as increased memeory consumption with dets data fragmentation (i.e. imposed by record deletions), you are right: it is stated in a manual that this might be a concern. However, one should also consider a time when this was written -- memory concerns from 10 years ago are certainly not the same today. I would even dare to say that memory is relatively cheap. V. ----- Original Message ----- From: "Yariv Sadan" To: "Valentin Micic" Cc: "Ryan Rawson" ; "Inswitch Solutions" ; Sent: Thursday, August 10, 2006 2:07 PM Subject: Re: Mnesia and Oracle > Hi, > > Thanks for the feedback! The reason I intended on using both Mnesia > and MySQL is because they would store different kinds of data: MySQL > would store long-term, high-volume data and Mnesia would store session > data. I think storing session data in Mnesia makes sense because > Mnesia makes it easy to replicate this data, which would make the > architecture resilient to a front-end server crash (as opposed to > storing session data in ETS). > > IIRC, ejabberd does something similar when using a SQL RDMBS. > > Could I store session data in MySQL? Yes, and I'm still considering > this option, actually. However, the advantage of using Mnesia is I can > easily run it on the (Yaws) front-end boxes, which would make session > data access much faster. > > Another problem with dets fragmentation, besides the long time it > takes to write it to disk, is the growing memory consumption. This can > affect performance if it gets out of hand. AFAIK, the only way to > defragment a dets table is to take if offline and reopen it with a > forced repair flag, which could take a long time (30 minutes?). > > Thank > Yariv > > > > Interesting... maybe I should have explained my reasoning better: > > On 8/10/06, Valentin Micic wrote: >> Well, we're using mnesia with dets stroring there-about 80GB data set. >> IMHO, if you want to develop a cache to front RDBMS, what would mnesia do >> for you that ETS wouldn't? Other than processing overhead, of course. >> And my main issue would be data-integrity. >> >> V. >> >> ----- Original Message ----- >> From: "Ryan Rawson" >> To: "Valentin Micic" >> Cc: "Yariv Sadan" ; "Inswitch Solutions" >> ; >> Sent: Thursday, August 10, 2006 9:54 AM >> Subject: Re: Mnesia and Oracle >> >> >> > What about my 50 gb data set? >> > >> > What about my 100 gb data set? >> > >> > Ultimately I think a major value is using mnesia as a coherent cache >> > and some SQL backend as a master storage. >> > >> > -ryan >> > >> > >> > On 8/10/06, Valentin Micic wrote: >> >> I do not think combining mnesia and MySQL is a good choice, no matter >> >> what >> >> justification one may put forward. If nothing else, it complicates >> >> maintenance, confuses people, and may (potentialy) compromise both >> >> products... not to mention a data integrity issues intrinsic to such >> >> an >> >> implementation. >> >> Mnesia's dets tables work reasonably well, even with huge data sets. >> >> The >> >> problem(s) starts when you start deleting records -- free list grows >> >> to >> >> the >> >> point that (IMHO) takes quite a long time to write it to disk. This >> >> becomes >> >> more obvious when one uses a lots of fragments. Thus, even if you shut >> >> the >> >> database regularly, it might corrupt few fragments. My guess: mensia >> >> controller does not give enough time to all dets processes (one per >> >> fragment) to flush their respective free lists to dist. >> >> >> >> A question for Erlang/OTP team: how can one prevent this from >> >> happening? >> >> >> >> I'm looking more (and more) to Berkeley DB for storage. Anybody, how >> >> does >> >> it >> >> compare to dets? >> >> >> >> Valentin. >> >> >> >> >> >> ----- Original Message ----- >> >> From: "Yariv Sadan" >> >> To: "Inswitch Solutions" >> >> Cc: >> >> Sent: Tuesday, August 08, 2006 11:51 PM >> >> Subject: Re: Mnesia and Oracle >> >> >> >> >> >> > Hi Eduardo, >> >> > >> >> > I haven't had production experience with these databases, but there >> >> > are a couple of things I found by research that are keeping me from >> >> > using Mnesia exclusively in my application: >> >> > >> >> > - Mnesia disc storage, based on dets, has a couple of drawbacks when >> >> > handling very large (many gigs) datasets: potentially long repair >> >> > times and memory consumption that grows with data fragmentation. >> >> > - QLC, the query engine for Mnesia, doesn't currently optimize >> >> > joins. >> >> > If your queries involve joining big tables, they can take a long >> >> > time >> >> > to execute. >> >> > >> >> > The join optimizations are planned for a future R11 OTP release, but >> >> > there are no plans to change dets AFAIK. >> >> > >> >> > Depending on your application, these issues may not be a big >> >> > problem. >> >> > For the application I'm building, I'm planning on using both MySQL >> >> > and >> >> > Mnesia, where MySQL will be used for storing high-volume data and >> >> > Mnesia for "live" session data. >> >> > >> >> > Hope this helps! >> >> > >> >> > Regards, >> >> > Yariv >> >> > >> >> > On 8/8/06, Inswitch Solutions wrote: >> >> >> >> >> >> >> >> >> >> >> >> Hi, >> >> >> >> >> >> I'm already working with Oracle and Mnesia, and I'd like to hear >> >> >> experiences of the Erlang community about these databases. >> >> >> When deciding over Oracle or Mnesia database for an Erlang, or non >> >> >> Erlang, based real-time system which factors are in favour in one >> >> >> over >> >> >> the other (performance...?) ?. >> >> >> >> >> >> >> >> >> thanks, Eduardo >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Prepaid Expertise - Programmable Switches >> >> >> Powered by Ericsson Licensed Technology >> >> >> Eng. Eduardo Figoli - Development Center - IN Switch >> >> >> Solutions >> >> >> Inc. >> >> >> Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: >> >> >> 1305-7686260 >> >> >> Development Center - Montevideo - Uruguay Tel/Fax: >> >> >> 5982-7104457 >> >> >> e-mail: eduardo@REDACTED >> >> >> >> >> >> >> >> >> >> >> > >> >> > From joelr1@REDACTED Thu Aug 10 15:55:33 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 14:55:33 +0100 Subject: Mnesia and Oracle In-Reply-To: <005201c6bc7e$382248f0$6401a8c0@moneymaker2> References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com> <003901c6bc4f$f2109890$6401a8c0@moneymaker2> <78568af10608100054w4f4e6341g54ebf4f40e5ea2a1@mail.gmail.com> <004101c6bc55$fae547d0$6401a8c0@moneymaker2> <17244f480608100507n78aeea7bk6d4689f8db7bc2e6@mail.gmail.com> <005201c6bc7e$382248f0$6401a8c0@moneymaker2> Message-ID: <7BA0F463-8140-4DCD-B163-5747902CBD1C@gmail.com> On Aug 10, 2006, at 2:09 PM, Valentin Micic wrote: > my experience with mnesia replication, however, is somewhat > negative with respect to volatile network environment. Valentin, would you kindly elaborate? Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Thu Aug 10 16:00:35 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 15:00:35 +0100 Subject: Mac Intel In-Reply-To: <17627.11858.874517.516351@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> <17627.847.643074.853395@alkaid.it.uu.se> <17627.7507.913832.343461@alkaid.it.uu.se> <354CE3DC-D599-466F-AB64-0BD08AAA22DF@gmail.com> <17627.11858.874517.516351@alkaid.it.uu.se> Message-ID: Mikael, The way to trap and redirect sigaction on Mac Intel is by using the mach_override library from http://extendamac.sourceforge.net/. It overwrites the beginning of the original function while saving the original bytes. How do you feel about integrating mach_override with HiPE on Mac Intel? Thanks, Joel -- http://wagerlabs.com/ From yarivvv@REDACTED Thu Aug 10 16:12:42 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 10 Aug 2006 10:12:42 -0400 Subject: Mnesia and Oracle In-Reply-To: <005201c6bc7e$382248f0$6401a8c0@moneymaker2> References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com> <003901c6bc4f$f2109890$6401a8c0@moneymaker2> <78568af10608100054w4f4e6341g54ebf4f40e5ea2a1@mail.gmail.com> <004101c6bc55$fae547d0$6401a8c0@moneymaker2> <17244f480608100507n78aeea7bk6d4689f8db7bc2e6@mail.gmail.com> <005201c6bc7e$382248f0$6401a8c0@moneymaker2> Message-ID: <17244f480608100712m30050f64m4b7e6a2d1da1548b@mail.gmail.com> Hi, On 8/10/06, Valentin Micic wrote: > So, I guess, it all comes down to what are you trying to do ;-) and I > certainly do not know what you mean by session data and a need to replicate > it: my experience with mnesia replication, however, is somewhat negative > with respect to volatile network environment. IMHO, if your data model is > relatively simple, you would be better of doing a custom replication. I'm building a webapp with a backend MySQL database. By "session data" I mean the data that is associated for each user by a cookie. Currently, Yaws has an API for storing session data in ETS, but I want to use Mnesia instead so if a web server crashes, the session data isn't lost. I hope this makes sense... :) > > As far as increased memeory consumption with dets data fragmentation (i.e. > imposed by record deletions), you are right: it is stated in a manual that > this might be a concern. However, one should also consider a time when this > was written -- memory concerns from 10 years ago are certainly not the same > today. I would even dare to say that memory is relatively cheap. One problem I have with dets is simply the lack of concrete estimates on the fragmentation cost and repair time in different scenarios. I know that memory is "relatively cheap" and that dets repair time is "shorter than it used to be," but I don't know for certain the degree to which these issues will affect my app and that they won't become a major pain in the ass a few months down the road. Since switching databases -- if the need arises -- would be a huge pain, I prefer to suck it up now and use MySQL just to avoid that risk. Cheers Yariv > > V. > > ----- Original Message ----- > From: "Yariv Sadan" > To: "Valentin Micic" > Cc: "Ryan Rawson" ; "Inswitch Solutions" > ; > Sent: Thursday, August 10, 2006 2:07 PM > Subject: Re: Mnesia and Oracle > > > > Hi, > > > > Thanks for the feedback! The reason I intended on using both Mnesia > > and MySQL is because they would store different kinds of data: MySQL > > would store long-term, high-volume data and Mnesia would store session > > data. I think storing session data in Mnesia makes sense because > > Mnesia makes it easy to replicate this data, which would make the > > architecture resilient to a front-end server crash (as opposed to > > storing session data in ETS). > > > > IIRC, ejabberd does something similar when using a SQL RDMBS. > > > > Could I store session data in MySQL? Yes, and I'm still considering > > this option, actually. However, the advantage of using Mnesia is I can > > easily run it on the (Yaws) front-end boxes, which would make session > > data access much faster. > > > > Another problem with dets fragmentation, besides the long time it > > takes to write it to disk, is the growing memory consumption. This can > > affect performance if it gets out of hand. AFAIK, the only way to > > defragment a dets table is to take if offline and reopen it with a > > forced repair flag, which could take a long time (30 minutes?). > > > > Thank > > Yariv > > > > > > > > Interesting... maybe I should have explained my reasoning better: > > > > On 8/10/06, Valentin Micic wrote: > >> Well, we're using mnesia with dets stroring there-about 80GB data set. > >> IMHO, if you want to develop a cache to front RDBMS, what would mnesia do > >> for you that ETS wouldn't? Other than processing overhead, of course. > >> And my main issue would be data-integrity. > >> > >> V. > >> > >> ----- Original Message ----- > >> From: "Ryan Rawson" > >> To: "Valentin Micic" > >> Cc: "Yariv Sadan" ; "Inswitch Solutions" > >> ; > >> Sent: Thursday, August 10, 2006 9:54 AM > >> Subject: Re: Mnesia and Oracle > >> > >> > >> > What about my 50 gb data set? > >> > > >> > What about my 100 gb data set? > >> > > >> > Ultimately I think a major value is using mnesia as a coherent cache > >> > and some SQL backend as a master storage. > >> > > >> > -ryan > >> > > >> > > >> > On 8/10/06, Valentin Micic wrote: > >> >> I do not think combining mnesia and MySQL is a good choice, no matter > >> >> what > >> >> justification one may put forward. If nothing else, it complicates > >> >> maintenance, confuses people, and may (potentialy) compromise both > >> >> products... not to mention a data integrity issues intrinsic to such > >> >> an > >> >> implementation. > >> >> Mnesia's dets tables work reasonably well, even with huge data sets. > >> >> The > >> >> problem(s) starts when you start deleting records -- free list grows > >> >> to > >> >> the > >> >> point that (IMHO) takes quite a long time to write it to disk. This > >> >> becomes > >> >> more obvious when one uses a lots of fragments. Thus, even if you shut > >> >> the > >> >> database regularly, it might corrupt few fragments. My guess: mensia > >> >> controller does not give enough time to all dets processes (one per > >> >> fragment) to flush their respective free lists to dist. > >> >> > >> >> A question for Erlang/OTP team: how can one prevent this from > >> >> happening? > >> >> > >> >> I'm looking more (and more) to Berkeley DB for storage. Anybody, how > >> >> does > >> >> it > >> >> compare to dets? > >> >> > >> >> Valentin. > >> >> > >> >> > >> >> ----- Original Message ----- > >> >> From: "Yariv Sadan" > >> >> To: "Inswitch Solutions" > >> >> Cc: > >> >> Sent: Tuesday, August 08, 2006 11:51 PM > >> >> Subject: Re: Mnesia and Oracle > >> >> > >> >> > >> >> > Hi Eduardo, > >> >> > > >> >> > I haven't had production experience with these databases, but there > >> >> > are a couple of things I found by research that are keeping me from > >> >> > using Mnesia exclusively in my application: > >> >> > > >> >> > - Mnesia disc storage, based on dets, has a couple of drawbacks when > >> >> > handling very large (many gigs) datasets: potentially long repair > >> >> > times and memory consumption that grows with data fragmentation. > >> >> > - QLC, the query engine for Mnesia, doesn't currently optimize > >> >> > joins. > >> >> > If your queries involve joining big tables, they can take a long > >> >> > time > >> >> > to execute. > >> >> > > >> >> > The join optimizations are planned for a future R11 OTP release, but > >> >> > there are no plans to change dets AFAIK. > >> >> > > >> >> > Depending on your application, these issues may not be a big > >> >> > problem. > >> >> > For the application I'm building, I'm planning on using both MySQL > >> >> > and > >> >> > Mnesia, where MySQL will be used for storing high-volume data and > >> >> > Mnesia for "live" session data. > >> >> > > >> >> > Hope this helps! > >> >> > > >> >> > Regards, > >> >> > Yariv > >> >> > > >> >> > On 8/8/06, Inswitch Solutions wrote: > >> >> >> > >> >> >> > >> >> >> > >> >> >> Hi, > >> >> >> > >> >> >> I'm already working with Oracle and Mnesia, and I'd like to hear > >> >> >> experiences of the Erlang community about these databases. > >> >> >> When deciding over Oracle or Mnesia database for an Erlang, or non > >> >> >> Erlang, based real-time system which factors are in favour in one > >> >> >> over > >> >> >> the other (performance...?) ?. > >> >> >> > >> >> >> > >> >> >> thanks, Eduardo > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> Prepaid Expertise - Programmable Switches > >> >> >> Powered by Ericsson Licensed Technology > >> >> >> Eng. Eduardo Figoli - Development Center - IN Switch > >> >> >> Solutions > >> >> >> Inc. > >> >> >> Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: > >> >> >> 1305-7686260 > >> >> >> Development Center - Montevideo - Uruguay Tel/Fax: > >> >> >> 5982-7104457 > >> >> >> e-mail: eduardo@REDACTED > >> >> >> > >> >> >> > >> >> > >> >> > >> > > >> > >> > > > > From andreas@REDACTED Thu Aug 10 18:51:32 2006 From: andreas@REDACTED (andreas) Date: Thu, 10 Aug 2006 17:51:32 +0100 Subject: How would you like to see Trap Exit bridge to the mailing li References: Message-ID: <20060810165132.2AE765A1E9@mail.erlangsystems.com> Hi. How would you like to see Trap Exit bridge to the mailing list? How do you perceive Trap Exit and how would you like to see Trap Exit evolve? Trap Exit has been running since 18 Jul, that is almost one month. We now ask you for some feedback primarily about the bridge between the forum and the mailing list. We first bridged the mailing list to the forum with one account for each mailing list. This meant that you only had to register at Trap Exit to post on the mailing lists. But as a member of the mailing list the sender was anonymous. We change this after we got response from one of the member in the mailing list. Now the forum is bridge to the mailing list through the users registered e-mail address. To post from the forum to the mailing list, you now have to first register your e-mail address to the mailing lists before you post to the forum. Or else your post is only visible at the forum. >From the mailing list???s point of view the post is almost as a regular post. Which is the best solution for bridging the forum and mailing list together? We at Trap Exit are glad that the mailing list is popular. I myself have received fast and quality answers. It is not our intention to replace the mailing list. We want to be an alternative way to communicate within the Erlang community. From the forum be able to browse and read the discussion you find interesting and post answers without hassle. We, at Trap Exit would appreciate your feedback, positive or negative. Regards, Andreas Hillqvist _________________________________________________________ Post sent from http://www.trapexit.org From widjayy@REDACTED Thu Aug 10 19:39:30 2006 From: widjayy@REDACTED (widjayy) Date: Thu, 10 Aug 2006 19:39:30 +0200 Subject: server chat with erlang In-Reply-To: <20060810085746.643DB5A1E5@mail.erlangsystems.com> References: <20060810085746.643DB5A1E5@mail.erlangsystems.com> Message-ID: <44DB6F52.9020107@neuf.fr> I there were nobody to reinvent the wheel, the informatic would still beon prehistoric age :) So, thank you Mazen. That's exactly what I'm lookion for: Ajax + erlang. I will try it and make it work, for pleasure, and understanding. bye Mazen a ?crit : > Guest wrote: > Why bother reinventing the wheel? > > Use ejabberd, it's written in Erlang. > > On Aug 9, 2006, at 8:31 PM, widjayy wrote: > > >> hi everyone. >> >> I want to make a chat with erlang. That's not a great idea, I know ;) >> My server will be with erlang, and the client will connect to it >> through >> a web page. But I don't which is the best technology (language, >> method) >> to connect to erlang. >> >> Thank you for your help. >> > > -- > http://wagerlabs.com/ > > Post recived from mailinglist > (end of quote) > > > There are MANY reasons to reinvent the wheel, the first and foremost one is that you LEARN from it... > > I dont think its a bad idea at all to write servers in erlang, I think the whole point with erlang (many concurrent processes doing whatever) is the whole point yes? so... I suggest you go create your own small chat first (your own protocol)... where you can connect and recieve commands through telnet or something... later on you take on a familiar protocol. If you really want to be familiar with the latest hype... do your chatclient in Ajax. In that case you would only have to do use Erlang (server side) and XHTML+JavaScript > > good luck! :) > _________________________________________________________ > Post sent from http://www.trapexit.org > > > From valentin@REDACTED Thu Aug 10 23:28:06 2006 From: valentin@REDACTED (Valentin Micic) Date: Thu, 10 Aug 2006 23:28:06 +0200 Subject: Mnesia and Oracle References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com> <003901c6bc4f$f2109890$6401a8c0@moneymaker2> <78568af10608100054w4f4e6341g54ebf4f40e5ea2a1@mail.gmail.com> <004101c6bc55$fae547d0$6401a8c0@moneymaker2> <17244f480608100507n78aeea7bk6d4689f8db7bc2e6@mail.gmail.com> <005201c6bc7e$382248f0$6401a8c0@moneymaker2> <7BA0F463-8140-4DCD-B163-5747902CBD1C@gmail.com> Message-ID: <00bd01c6bcc3$e1d0cd00$6401a8c0@moneymaker2> First of all, I do not want to be flamed here ;-) so, I want to stress out that as much I've tried to get rid of mnesia, I did not found anything better. Yet. Look, despite the fact that more and more money has been invested in the network infrastructure, it seems that networks are less stable than before. It is my experience that deploying distributed mnesia with table replication over such a network, invariantly leads to problems -- mnesia gets partitioned, and, depending on how complex the data model is, it might be quite a difficult job to recover & re-syncronize. Now, as Ulf pointed out once, it is not that other databases have a better solution, it is just that problem is of such a nature that it is very dificult to solve it in a generic way (or one-fits-all kind of way). This is why it was easier for (at least) me to develop specialised journaling system, and have complete control over what happens if and when network lets me down. There. V. ----- Original Message ----- From: "Joel Reymont" To: "Valentin Micic" Cc: "Yariv Sadan" ; "Ryan Rawson" ; "Inswitch Solutions" ; Sent: Thursday, August 10, 2006 3:55 PM Subject: Re: Mnesia and Oracle > > On Aug 10, 2006, at 2:09 PM, Valentin Micic wrote: > >> my experience with mnesia replication, however, is somewhat negative >> with respect to volatile network environment. > > Valentin, would you kindly elaborate? > > Thanks, Joel > > -- > http://wagerlabs.com/ > > > > > > From joelr1@REDACTED Thu Aug 10 23:39:32 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 10 Aug 2006 22:39:32 +0100 Subject: Mnesia and Oracle In-Reply-To: <00bd01c6bcc3$e1d0cd00$6401a8c0@moneymaker2> References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com> <003901c6bc4f$f2109890$6401a8c0@moneymaker2> <78568af10608100054w4f4e6341g54ebf4f40e5ea2a1@mail.gmail.com> <004101c6bc55$fae547d0$6401a8c0@moneymaker2> <17244f480608100507n78aeea7bk6d4689f8db7bc2e6@mail.gmail.com> <005201c6bc7e$382248f0$6401a8c0@moneymaker2> <7BA0F463-8140-4DCD-B163-5747902CBD1C@gmail.com> <00bd01c6bcc3$e1d0cd00$6401a8c0@moneymaker2> Message-ID: <4389BC01-DF8A-4AE9-9C8F-C0AD82B73F54@gmail.com> On Aug 10, 2006, at 10:28 PM, Valentin Micic wrote: > Look, despite the fact that more and more money has been invested > in the network infrastructure, it seems that networks are less > stable than before. It is my experience that deploying distributed > mnesia with table replication over such a network, invariantly > leads to problems -- mnesia gets partitioned, and, depending on how > complex the data model is, it might be quite a difficult job to > recover & re-syncronize. You are talking about a WAN as opposed to a LAN, right? There shouldn't be any replication problems in local gigabit network, for example, am I correct? -- http://wagerlabs.com/ From serge@REDACTED Fri Aug 11 00:48:44 2006 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 10 Aug 2006 18:48:44 -0400 Subject: Mnesia and Oracle In-Reply-To: <00bd01c6bcc3$e1d0cd00$6401a8c0@moneymaker2> References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com> <003901c6bc4f$f2109890$6401a8c0@moneymaker2> <78568af10608100054w4f4e6341g54ebf4f40e5ea2a1@mail.gmail.com> <004101c6bc55$fae547d0$6401a8c0@moneymaker2> <17244f480608100507n78aeea7bk6d4689f8db7bc2e6@mail.gmail.com> <005201c6bc7e$382248f0$6401a8c0@moneymaker2> <7BA0F463-8140-4DCD-B163-5747902CBD1C@gmail.com> <00bd01c6bcc3$e1d0cd00$6401a8c0@moneymaker2> Message-ID: <44DBB7CC.6070300@hq.idt.net> One feature that I truly miss in mnesia is its ability to be able to resynchronize a partitioned database after the network gets merged by using a user-selected behavior. It is nowadays possible to make LANs quite robust, but when a network spans across miles, intermittent issues become more frequent than desired and mnesia resynchronization by a node restart becomes not quite a good of an option. Perhaps someone in the OTP team can shed some light on whether we (the Erlang community) are going to see some functionality of mnesia any time soon that would address this issue. Serge Valentin Micic wrote: > First of all, I do not want to be flamed here ;-) so, I want to stress > out that as much I've tried to get rid of mnesia, I did not found > anything better. Yet. > Look, despite the fact that more and more money has been invested in the > network infrastructure, it seems that networks are less stable than > before. It is my experience that deploying distributed mnesia with table > replication over such a network, invariantly leads to problems -- mnesia > gets partitioned, and, depending on how complex the data model is, it > might be quite a difficult job to recover & re-syncronize. Now, as Ulf > pointed out once, it is not that other databases have a better solution, > it is just that problem is of such a nature that it is very dificult to > solve it in a generic way (or one-fits-all kind of way). This is why it > was easier for (at least) me to develop specialised journaling system, > and have complete control over what happens if and when network lets me > down. There. > > V. > > ----- Original Message ----- From: "Joel Reymont" > To: "Valentin Micic" > Cc: "Yariv Sadan" ; "Ryan Rawson" > ; "Inswitch Solutions" ; > > Sent: Thursday, August 10, 2006 3:55 PM > Subject: Re: Mnesia and Oracle > > >> >> On Aug 10, 2006, at 2:09 PM, Valentin Micic wrote: >> >>> my experience with mnesia replication, however, is somewhat >>> negative with respect to volatile network environment. >> >> Valentin, would you kindly elaborate? >> >> Thanks, Joel >> >> -- >> http://wagerlabs.com/ From valentin@REDACTED Fri Aug 11 01:12:33 2006 From: valentin@REDACTED (Valentin Micic) Date: Fri, 11 Aug 2006 01:12:33 +0200 Subject: Mnesia and Oracle References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com> <003901c6bc4f$f2109890$6401a8c0@moneymaker2> <78568af10608100054w4f4e6341g54ebf4f40e5ea2a1@mail.gmail.com> <004101c6bc55$fae547d0$6401a8c0@moneymaker2> <17244f480608100507n78aeea7bk6d4689f8db7bc2e6@mail.gmail.com> <005201c6bc7e$382248f0$6401a8c0@moneymaker2> <7BA0F463-8140-4DCD-B163-5747902CBD1C@gmail.com> <00bd01c6bcc3$e1d0cd00$6401a8c0@moneymaker2> <4389BC01-DF8A-4AE9-9C8F-C0AD82B73F54@gmail.com> Message-ID: <00d801c6bcd2$7836d010$6401a8c0@moneymaker2> No, IMHO as much as one may anticipate these kind of problems to be WAN related (which is to be expected, and does happen often), they do occur on LAN as well. Say, guys that are responsible for upgrading software on local switch, and one networking company from San FranCISCO does that whenever they feel like it, well these guys, for whatever reason, like to change the settings for the port -- thus, auto_negotiate flag that was set to false, end up being true, what used to be full duplex ends up being half... and as the traffic volume picks up, so do the error/collisions etc. After a while heartbeat message that is send to one node is going to be delayed enough (or rather response to it might be buried under thousands of messages) to render the connection to such a node invalid. When that happens, mnesia get partitioned, eventhough connection to that node may be restored. V. ----- Original Message ----- From: "Joel Reymont" To: "Valentin Micic" Cc: "Yariv Sadan" ; "Ryan Rawson" ; "Inswitch Solutions" ; Sent: Thursday, August 10, 2006 11:39 PM Subject: Re: Mnesia and Oracle > > On Aug 10, 2006, at 10:28 PM, Valentin Micic wrote: > >> Look, despite the fact that more and more money has been invested in the >> network infrastructure, it seems that networks are less stable than >> before. It is my experience that deploying distributed mnesia with table >> replication over such a network, invariantly leads to problems -- mnesia >> gets partitioned, and, depending on how complex the data model is, it >> might be quite a difficult job to recover & re-syncronize. > > You are talking about a WAN as opposed to a LAN, right? > > There shouldn't be any replication problems in local gigabit network, for > example, am I correct? > > -- > http://wagerlabs.com/ > > > > > > From matthias@REDACTED Fri Aug 11 08:33:26 2006 From: matthias@REDACTED (Matthias Lang) Date: Fri, 11 Aug 2006 08:33:26 +0200 Subject: Mnesia and Oracle In-Reply-To: <00d801c6bcd2$7836d010$6401a8c0@moneymaker2> References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com> <003901c6bc4f$f2109890$6401a8c0@moneymaker2> <78568af10608100054w4f4e6341g54ebf4f40e5ea2a1@mail.gmail.com> <004101c6bc55$fae547d0$6401a8c0@moneymaker2> <17244f480608100507n78aeea7bk6d4689f8db7bc2e6@mail.gmail.com> <005201c6bc7e$382248f0$6401a8c0@moneymaker2> <7BA0F463-8140-4DCD-B163-5747902CBD1C@gmail.com> <00bd01c6bcc3$e1d0cd00$6401a8c0@moneymaker2> <4389BC01-DF8A-4AE9-9C8F-C0AD82B73F54@gmail.com> <00d801c6bcd2$7836d010$6401a8c0@moneymaker2> Message-ID: <17628.9398.593784.325189@antilipe.corelatus.se> Valentin Micic writes: > well these guys, for whatever reason, like to change the > settings for the port -- thus, auto_negotiate flag that was set to false, > end up being true, what used to be full duplex ends up being half... and as > the traffic volume picks up, so do the error/collisions etc. The problem you're describing is so pernicious that I can't resist expanding on what's going on, even though it's only tenuously related to Erlang. Consider what happens on one cable in a switched ethernet. Assume the cable goes from a server to a switch: Switch set to Server set to Result ---------------------------------------------------------------------- Autonegotiate Autonegotiate Both ends full duplex, no collisions, perfect. No autoneg. Autonegotiate Both ends half duplex, half duplex Normal collisions. Good. No autoneg. Autonegotiate Switch uses full duplex. full duplex Server uses half duplex. Hilarity ensues. A collision, in spite of the name, is a normal thing that happens on half-duplex ethernets. On a normal switched network, the effect on performance is small and well-behaved. But the third case above is special. It has one end of the wire using "half duplex" rules and the other end using "full duplex" rules. The "full duplex" end neither detects nor attempts to avoid collisions. At the same time, the "half duplex" end *does* detect collisions. Consider what happens during a collision: 1. Switch transmits packet A to server. 2. (overlaps with 1). Server transmits packet B to switch. 3. In the switch's world, there is no collision. No further action taken. 4. In the server's world, there was a collision. Server aborts packet B by sending a 'jam' sequence. Server discards packet A. 5. Server retransmits packet B. Note that packet A was discarded and never retransmitted. So suddenly you have a LAN that loses packets. And the more traffic there is, the more packets it loses. Lost packets wreak absolute havoc on TCP throughput. Matthias From theepan@REDACTED Fri Aug 11 09:39:37 2006 From: theepan@REDACTED (theeepan) Date: Fri, 11 Aug 2006 13:39:37 +0600 Subject: Conditional Macros Message-ID: <000001c6bd19$4c842ac0$9b0a10ac@wavenet.lk> Hi There, Isn't the following treatment of conditional macros applicable? I get 'syntax error' on compilation -behaviour(supervisor). %% call backs needed for supervisor behaviour -export([init/1]). init(State) -> {ok,{{one_for_one, 100, 3600}, [ -ifdef(WITH_SPEC1). Child_spec1, -endif. Child_spec2, Child_spec3, . ] }}. Thanks, Theepan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandrashekhar.mullaparthi@REDACTED Fri Aug 11 10:46:19 2006 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Fri, 11 Aug 2006 09:46:19 +0100 Subject: Mnesia and Oracle In-Reply-To: <00d801c6bcd2$7836d010$6401a8c0@moneymaker2> References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <003901c6bc4f$f2109890$6401a8c0@moneymaker2> <78568af10608100054w4f4e6341g54ebf4f40e5ea2a1@mail.gmail.com> <004101c6bc55$fae547d0$6401a8c0@moneymaker2> <17244f480608100507n78aeea7bk6d4689f8db7bc2e6@mail.gmail.com> <005201c6bc7e$382248f0$6401a8c0@moneymaker2> <7BA0F463-8140-4DCD-B163-5747902CBD1C@gmail.com> <00bd01c6bcc3$e1d0cd00$6401a8c0@moneymaker2> <4389BC01-DF8A-4AE9-9C8F-C0AD82B73F54@gmail.com> <00d801c6bcd2$7836d010$6401a8c0@moneymaker2> Message-ID: On 11/08/06, Valentin Micic wrote: > > No, IMHO as much as one may anticipate these kind of problems to be WAN > related (which is to be expected, and does happen often), they do occur on > LAN as well. I second this. In this day and age, it is still quite difficult to get a 24x7 LAN. We have a ~5GB database using mnesia and everytime someone decides to do "maintenance" on the n/w, without telling anyone else, the Ops team have to spend a couple of hours re-routing query traffic, resyncing mnesia, filing reports...Though this doesn't affect queries, it is still a drain on Ops resource. Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From valentin@REDACTED Fri Aug 11 10:48:48 2006 From: valentin@REDACTED (Valentin Micic) Date: Fri, 11 Aug 2006 10:48:48 +0200 Subject: Mnesia and Oracle References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251><17244f480608081451x3069e2f3k2fa76df74ac616d3@mail.gmail.com><003901c6bc4f$f2109890$6401a8c0@moneymaker2><78568af10608100054w4f4e6341g54ebf4f40e5ea2a1@mail.gmail.com><004101c6bc55$fae547d0$6401a8c0@moneymaker2><17244f480608100507n78aeea7bk6d4689f8db7bc2e6@mail.gmail.com><005201c6bc7e$382248f0$6401a8c0@moneymaker2><7BA0F463-8140-4DCD-B163-5747902CBD1C@gmail.com><00bd01c6bcc3$e1d0cd00$6401a8c0@moneymaker2><4389BC01-DF8A-4AE9-9C8F-C0AD82B73F54@gmail.com><00d801c6bcd2$7836d010$6401a8c0@moneymaker2> <17628.9398.593784.325189@antilipe.corelatus.se> Message-ID: <011101c6bd22$fb232500$6401a8c0@moneymaker2> Thank you, Matthias. There is a lot of greek mithology when it comes to networking in this part of the world (South Africa). We're doiing our best to overcome them, but it's not always easy ;-). V. ----- Original Message ----- From: "Matthias Lang" To: "Valentin Micic" Cc: Sent: Friday, August 11, 2006 8:33 AM Subject: Re: Mnesia and Oracle > Valentin Micic writes: > > > well these guys, for whatever reason, like to change the > > settings for the port -- thus, auto_negotiate flag that was set to > > false, > > end up being true, what used to be full duplex ends up being half... and > > as > > the traffic volume picks up, so do the error/collisions etc. > > The problem you're describing is so pernicious that I can't resist > expanding on what's going on, even though it's only tenuously related > to Erlang. > > Consider what happens on one cable in a switched ethernet. Assume the > cable goes from a server to a switch: > > Switch set to Server set to Result > ---------------------------------------------------------------------- > Autonegotiate Autonegotiate Both ends full duplex, > no collisions, perfect. > > No autoneg. Autonegotiate Both ends half duplex, > half duplex Normal collisions. Good. > > No autoneg. Autonegotiate Switch uses full duplex. > full duplex Server uses half duplex. > Hilarity ensues. > > A collision, in spite of the name, is a normal thing that happens on > half-duplex ethernets. On a normal switched network, the effect on > performance is small and well-behaved. > > But the third case above is special. It has one end of the wire using > "half duplex" rules and the other end using "full duplex" rules. The > "full duplex" end neither detects nor attempts to avoid collisions. At > the same time, the "half duplex" end *does* detect > collisions. Consider what happens during a collision: > > 1. Switch transmits packet A to server. > > 2. (overlaps with 1). Server transmits packet B to switch. > > 3. In the switch's world, there is no collision. No further action taken. > > 4. In the server's world, there was a collision. > Server aborts packet B by sending a 'jam' sequence. > Server discards packet A. > > 5. Server retransmits packet B. > > Note that packet A was discarded and never retransmitted. So suddenly > you have a LAN that loses packets. And the more traffic there is, the > more packets it loses. Lost packets wreak absolute havoc on TCP > throughput. > > Matthias From xpdoka@REDACTED Fri Aug 11 11:07:01 2006 From: xpdoka@REDACTED (Dominic Williams) Date: Fri, 11 Aug 2006 11:07:01 +0200 (CEST) Subject: How would you like to see Trap Exit bridge to the mailing list In-Reply-To: <20060810165132.2AE765A1E9@mail.erlangsystems.com> References: <20060810165132.2AE765A1E9@mail.erlangsystems.com> Message-ID: <20391.83.199.84.229.1155287221.squirrel@www.geekisp.com> Hello, > How would you like to see Trap Exit bridge to the mailing list? I agreed with the poster who complained about the way trapexit posts initially looked on the list, so thanks for changing that. > We want to be an alternative way to communicate within the > Erlang community. From the forum be able to browse and read thediscussion > you find interesting and post answers without hassle. This is already possible at http://news.gmane.org/gmane.comp.lang.erlang.general/ Unlike gmane, and unlike the mailing list archive, Trapexit appears to be displaying harvestable email addresses of people who post to erlang-questions, which I am not happy about. Regards, Dominic Williams http://www.dominicwilliams.net ---- From richardc@REDACTED Fri Aug 11 12:31:42 2006 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 11 Aug 2006 12:31:42 +0200 Subject: Conditional Macros In-Reply-To: <000001c6bd19$4c842ac0$9b0a10ac@wavenet.lk> References: <000001c6bd19$4c842ac0$9b0a10ac@wavenet.lk> Message-ID: <44DC5C8E.4090802@it.uu.se> theeepan wrote: > Isn?t the following treatment of conditional macros applicable? I get > ?syntax error? on compilation > > init(State) -> > {ok,{{one_for_one, 100, 3600}, > [ > -ifdef(WITH_SPEC1). > Child_spec1, > -endif. > Child_spec2, > Child_spec3, > ? > ] > }}. No. Each section that ends with '.' (and is followed by at least one character of whitespace, or end of file, or a comment) is treated separately. So the section that starts with 'init' does not end at the '}}.', but at the 'WITH_SPEC1).', and the next section is 'Child_spec1, -endif.', and so on. Even the preprocessor follows this rule, so your example does not work. You can rewrite your example to something like this: init(State) -> {ok,{{one_for_one, 100, 3600}, specs()}}. specs() -> optional_specs() ++ [Child_spec2, Child_spec3, ? ]. -ifdef(WITH_SPEC1). optional_specs() -> [Child_spec1,...]. -else. optional_specs() -> []. -endif. /Richard From theepan@REDACTED Fri Aug 11 12:47:27 2006 From: theepan@REDACTED (theeepan) Date: Fri, 11 Aug 2006 16:47:27 +0600 Subject: Conditional Macros In-Reply-To: <44DC5C8E.4090802@it.uu.se> Message-ID: <000a01c6bd33$8a529ed0$9b0a10ac@wavenet.lk> Richard: Even the preprocessor follows this rule, so your example does not work. Theepan: The PP runs even before Lexical analysis phase in many passes and I thought PP macros are not presented to the parser? Anyway there are workarounds for this, one is as you mentioned below. Tx&Rx, Theepan. -----Original Message----- From: Richard Carlsson [mailto:richardc@REDACTED] Sent: Friday, August 11, 2006 4:32 PM To: theeepan Cc: erlang-questions@REDACTED Subject: Re: Conditional Macros theeepan wrote: > Isn't the following treatment of conditional macros applicable? I get > 'syntax error' on compilation > > init(State) -> > {ok,{{one_for_one, 100, 3600}, > [ > -ifdef(WITH_SPEC1). > Child_spec1, > -endif. > Child_spec2, > Child_spec3, > . > ] > }}. No. Each section that ends with '.' (and is followed by at least one character of whitespace, or end of file, or a comment) is treated separately. So the section that starts with 'init' does not end at the '}}.', but at the 'WITH_SPEC1).', and the next section is 'Child_spec1, -endif.', and so on. Even the preprocessor follows this rule, so your example does not work. You can rewrite your example to something like this: init(State) -> {ok,{{one_for_one, 100, 3600}, specs()}}. specs() -> optional_specs() ++ [Child_spec2, Child_spec3, . ]. -ifdef(WITH_SPEC1). optional_specs() -> [Child_spec1,...]. -else. optional_specs() -> []. -endif. /Richard From richardc@REDACTED Fri Aug 11 13:22:49 2006 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 11 Aug 2006 13:22:49 +0200 Subject: Conditional Macros In-Reply-To: <000a01c6bd33$8a529ed0$9b0a10ac@wavenet.lk> References: <000a01c6bd33$8a529ed0$9b0a10ac@wavenet.lk> Message-ID: <44DC6889.9070807@it.uu.se> theeepan wrote: > Theepan: The PP runs even before Lexical analysis phase in > many passes and I thought PP macros are not presented to the > parser? And they aren't. But the preprocessor is token based: it reads the input one section at a time, tokenises it, processes pp-directives and expands macros, and finally the modified token sequence is parsed. When you write expressions in the Erlang shell, the same thing happens (but without preprocessor): the scanner keeps reading your input until you write a '.' followed by whitespace, then the shell parses and executes your expression, then it goes back to reading more input. /Richard From joelr1@REDACTED Fri Aug 11 13:57:01 2006 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 11 Aug 2006 12:57:01 +0100 Subject: Quick Poll: Who is on a Mac? Message-ID: Folks, Are you using a Mac or interested in using one? Please reply privately. Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Fri Aug 11 16:19:08 2006 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 11 Aug 2006 15:19:08 +0100 Subject: Commercial Mac IDE Message-ID: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> Over 15 people replied to my "Who's on a Mac" poll so far so I thought I would lay my cards on the table... I want to build and sell a Mac IDE for Erlang. Elegant, powerful, easy to use. Something I would use myself to build other things I have in mind. So please let me know what you think and hold no punches! I would like to finish porting HiPE to Mac Intel this weekend (I have a MacBook Pro) and then tackle the Cocoa bindings. I see a lot of overhead in marshalling data in and out of Erlang but I'm hoping that any recent Mac can take that in stride. No estimated delivery data yet as this will be my second job for a while. I'm very excited about the project, though, and hope to produce something remarkable. Yes, I know about Emacs and the erl prompt, I use them myself. I don't have you old Erlang dogs in the crosshairs so much as the new to Erlang crowd. I don't have just an editor in mind, though, rather a full development environment. Thanks, Joel -- http://wagerlabs.com/ From andreas@REDACTED Fri Aug 11 17:58:50 2006 From: andreas@REDACTED (andreas) Date: Fri, 11 Aug 2006 16:58:50 +0100 Subject: How would you like to see Trap Exit bridge to the mailing li References: Message-ID: <20060811155850.E0EE35A1F3@mail.erlangsystems.com> Hi Dominic Williams and thank you for your feedback. I have now modified the forum at Trap Exit to not display harvestable e-mail addresses. Dominic Williams wrote: Hello, Unlike gmane, and unlike the mailing list archive, Trapexit appears to be displaying harvestable email addresses of people who post to erlang-questions, which I am not happy about. (end of quote) _________________________________________________________ Post sent from http://www.trapexit.org From vladdu55@REDACTED Fri Aug 11 18:36:37 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 11 Aug 2006 17:36:37 +0100 Subject: Commercial Mac IDE In-Reply-To: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> Message-ID: <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> Hi, On 8/11/06, Joel Reymont wrote: > I want to build and sell a Mac IDE for Erlang. Elegant, powerful, > easy to use. Something I would use myself to build other things I > have in mind. So please let me know what you think and hold no punches! This is a large project, and if only for Macs, usefult for not so many... Just a thought: have you looked at Eclipse and Erlide? It works on Macs too! regards, Vlad From simonpeterchappell@REDACTED Fri Aug 11 19:31:10 2006 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Fri, 11 Aug 2006 12:31:10 -0500 Subject: Commercial Mac IDE In-Reply-To: <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> Message-ID: <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> On 8/11/06, Vlad Dumitrescu wrote: > Hi, > > On 8/11/06, Joel Reymont wrote: > > I want to build and sell a Mac IDE for Erlang. Elegant, powerful, > > easy to use. Something I would use myself to build other things I > > have in mind. So please let me know what you think and hold no punches! > > This is a large project, and if only for Macs, usefult for not so many... On the other hand, the Mac community have a strong track record of supporting shareware authors by actually paying for the software. While normally, an outsider might view the Mac community as too small, they generally are capable of supporting quite an amount of shareware authors. Oh and they tend to be fairly fanatically loyal as well. :-) > Just a thought: have you looked at Eclipse and Erlide? It works on Macs too! I've used Eclipse, but I haven't tried Erlide. Personally, I'd gladly consider a dedicated Erlang IDE on the Mac. If it wasn't priced too high, I'd most likely buy it. A decent IDE and good tutorials are the primary things holding most of us beginners that lurk on the list. I know I believe in the principles of Erlang, but I haven't quite written the critical mass of lines of code necessary to really feel like I've "groked" it. Is there any chance that you can write the Erlang version of DrScheme? (An IDE and tutorial all in one. :-) Simon -- www.simonpeter.org From yarivvv@REDACTED Fri Aug 11 20:05:42 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Fri, 11 Aug 2006 14:05:42 -0400 Subject: Commercial Mac IDE In-Reply-To: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> Message-ID: <17244f480608111105r288204bet49a73808608e1abd@mail.gmail.com> On 8/11/06, Joel Reymont wrote: > Over 15 people replied to my "Who's on a Mac" poll so far so I > thought I would lay my cards on the table... > > I want to build and sell a Mac IDE for Erlang. Elegant, powerful, > easy to use. Something I would use myself to build other things I > have in mind. So please let me know what you think and hold no punches! I think that it would be neat but I doubt many people would buy such a product, esp given the availability of Erlide, which is open source and works on Mac. Plus, aren't you already working on a trading system? :) Yariv From anders.nygren@REDACTED Fri Aug 11 20:06:36 2006 From: anders.nygren@REDACTED (Anders Nygren) Date: Fri, 11 Aug 2006 13:06:36 -0500 Subject: Commercial Mac IDE In-Reply-To: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> Message-ID: On 8/11/06, Joel Reymont wrote: > Over 15 people replied to my "Who's on a Mac" poll so far so I > thought I would lay my cards on the table... > > I want to build and sell a Mac IDE for Erlang. Elegant, powerful, > easy to use. Something I would use myself to build other things I > have in mind. So please let me know what you think and hold no punches! > > I would like to finish porting HiPE to Mac Intel this weekend (I have > a MacBook Pro) and then tackle the Cocoa bindings. I see a lot of > overhead in marshalling data in and out of Erlang but I'm hoping that > any recent Mac can take that in stride. > > No estimated delivery data yet as this will be my second job for a > while. I'm very excited about the project, though, and hope to > produce something remarkable. > > Yes, I know about Emacs and the erl prompt, I use them myself. I > don't have you old Erlang dogs in the crosshairs so much as the new > to Erlang crowd. I don't have just an editor in mind, though, rather > a full development environment. > Hi I do not have a Mac, so I do not really know what I am talking about here but would it not be easier to make an Erlang bundle for TextMate instead? (Except that it may not be a business in doing that.) /Anders From ryanobjc@REDACTED Fri Aug 11 20:11:03 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Fri, 11 Aug 2006 11:11:03 -0700 Subject: How would you like to see Trap Exit bridge to the mailing li In-Reply-To: <20060810165132.2AE765A1E9@mail.erlangsystems.com> References: <20060810165132.2AE765A1E9@mail.erlangsystems.com> Message-ID: <78568af10608111111u4578a75ftce4f9a5e47cfa683@mail.gmail.com> The resender should be threading context aware. If every time someone replies from trapexit and it gets a new thread instead of being incorporated in the previous thread (eg: see how mail.app and gmail does things) then my mailbox is being spammed with relevant but not contextually relevant replies. That is my biggest complaint. -ryan On 8/10/06, andreas wrote: > > Hi. > > How would you like to see Trap Exit bridge to the mailing list? How do you perceive Trap Exit and how would you like to see Trap Exit evolve? > > Trap Exit has been running since 18 Jul, that is almost one month. We now ask you for some feedback primarily about the bridge between the forum and the mailing list. > > We first bridged the mailing list to the forum with one account for each mailing list. > This meant that you only had to register at Trap Exit to post on the mailing lists. But as a member of the mailing list the sender was anonymous. We change this after we got response from one of the member in the mailing list. > > Now the forum is bridge to the mailing list through the users registered e-mail address. > To post from the forum to the mailing list, you now have to first register your e-mail address to the mailing lists before you post to the forum. Or else your post is only visible at the forum. > From the mailing list's point of view the post is almost as a regular post. > > Which is the best solution for bridging the forum and mailing list together? > > We at Trap Exit are glad that the mailing list is popular. I myself have received fast and quality answers. It is not our intention to replace the mailing list. We want to be an alternative way to communicate within the Erlang community. From the forum be able to browse and read the discussion you find interesting and post answers without hassle. > > We, at Trap Exit would appreciate your feedback, positive or negative. > > > Regards, > Andreas Hillqvist > _________________________________________________________ > Post sent from http://www.trapexit.org > From ryanobjc@REDACTED Fri Aug 11 20:21:53 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Fri, 11 Aug 2006 11:21:53 -0700 Subject: Mnesia and Oracle In-Reply-To: <011101c6bd22$fb232500$6401a8c0@moneymaker2> References: <00a001c6baf1$cde17f70$4a00a8c0@Inswitch251> <004101c6bc55$fae547d0$6401a8c0@moneymaker2> <17244f480608100507n78aeea7bk6d4689f8db7bc2e6@mail.gmail.com> <005201c6bc7e$382248f0$6401a8c0@moneymaker2> <7BA0F463-8140-4DCD-B163-5747902CBD1C@gmail.com> <00bd01c6bcc3$e1d0cd00$6401a8c0@moneymaker2> <4389BC01-DF8A-4AE9-9C8F-C0AD82B73F54@gmail.com> <00d801c6bcd2$7836d010$6401a8c0@moneymaker2> <17628.9398.593784.325189@antilipe.corelatus.se> <011101c6bd22$fb232500$6401a8c0@moneymaker2> Message-ID: <78568af10608111121p26f9fb42v59a5c6647987214f@mail.gmail.com> I'm going to have to agree with everything everyone says here about non-reliable LANs. The other thing you should be aware is a "LAN" is much much bigger than you might first think. Lets say this is a large company datacenter with like thousands of machines, and dozens of networks with switches and the like. If you have multiple data centers, that .1ms ping link between them - is that LAN or WAN? What happens when the central switch goes down? Packet loss in the modern datacenter is a major problem and happens at depressingly regular intervals. -ryan On 8/11/06, Valentin Micic wrote: > Thank you, Matthias. There is a lot of greek mithology when it comes to > networking in this part of the world (South Africa). > We're doiing our best to overcome them, but it's not always easy ;-). > > V. > > ----- Original Message ----- > From: "Matthias Lang" > To: "Valentin Micic" > Cc: > Sent: Friday, August 11, 2006 8:33 AM > Subject: Re: Mnesia and Oracle > > > > Valentin Micic writes: > > > > > well these guys, for whatever reason, like to change the > > > settings for the port -- thus, auto_negotiate flag that was set to > > > false, > > > end up being true, what used to be full duplex ends up being half... and > > > as > > > the traffic volume picks up, so do the error/collisions etc. > > > > The problem you're describing is so pernicious that I can't resist > > expanding on what's going on, even though it's only tenuously related > > to Erlang. > > > > Consider what happens on one cable in a switched ethernet. Assume the > > cable goes from a server to a switch: > > > > Switch set to Server set to Result > > ---------------------------------------------------------------------- > > Autonegotiate Autonegotiate Both ends full duplex, > > no collisions, perfect. > > > > No autoneg. Autonegotiate Both ends half duplex, > > half duplex Normal collisions. Good. > > > > No autoneg. Autonegotiate Switch uses full duplex. > > full duplex Server uses half duplex. > > Hilarity ensues. > > > > A collision, in spite of the name, is a normal thing that happens on > > half-duplex ethernets. On a normal switched network, the effect on > > performance is small and well-behaved. > > > > But the third case above is special. It has one end of the wire using > > "half duplex" rules and the other end using "full duplex" rules. The > > "full duplex" end neither detects nor attempts to avoid collisions. At > > the same time, the "half duplex" end *does* detect > > collisions. Consider what happens during a collision: > > > > 1. Switch transmits packet A to server. > > > > 2. (overlaps with 1). Server transmits packet B to switch. > > > > 3. In the switch's world, there is no collision. No further action taken. > > > > 4. In the server's world, there was a collision. > > Server aborts packet B by sending a 'jam' sequence. > > Server discards packet A. > > > > 5. Server retransmits packet B. > > > > Note that packet A was discarded and never retransmitted. So suddenly > > you have a LAN that loses packets. And the more traffic there is, the > > more packets it loses. Lost packets wreak absolute havoc on TCP > > throughput. > > > > Matthias > > From vladdu55@REDACTED Fri Aug 11 20:23:47 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 11 Aug 2006 19:23:47 +0100 Subject: Commercial Mac IDE In-Reply-To: <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> Message-ID: <95be1d3b0608111123l45440a26xddcd0670e820fa07@mail.gmail.com> Hi, My point was that it may be worth considering the options first. Having done some work on an IDE framework before, I know there are a lot of tricky details. So riding on the Eclipse wave would cut a lot of corners. If the project is seen as a "learn by doing" thing, then the above doesn't apply. But for a commercial project, time to market is very important. There are a lot of commercial Eclipse-based environments, so it's possible to build upon erlide with extra plugins (comercially licensed). And of course, I wouldn't mind if this would help along Erlide too :-) regards, Vlad On 8/11/06, Simon Chappell wrote: > > This is a large project, and if only for Macs, usefult for not so many... > > On the other hand, the Mac community have a strong track record of > supporting shareware authors by actually paying for the software. > While normally, an outsider might view the Mac community as too small, > they generally are capable of supporting quite an amount of shareware > authors. > > Oh and they tend to be fairly fanatically loyal as well. :-) From bob@REDACTED Fri Aug 11 20:51:04 2006 From: bob@REDACTED (Bob Ippolito) Date: Fri, 11 Aug 2006 11:51:04 -0700 Subject: Commercial Mac IDE In-Reply-To: <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> Message-ID: <6a36e7290608111151v2c6526f8ha92de00eefd0316e@mail.gmail.com> On 8/11/06, Simon Chappell wrote: > On 8/11/06, Vlad Dumitrescu wrote: > > Hi, > > > > On 8/11/06, Joel Reymont wrote: > > > I want to build and sell a Mac IDE for Erlang. Elegant, powerful, > > > easy to use. Something I would use myself to build other things I > > > have in mind. So please let me know what you think and hold no punches! > > > > This is a large project, and if only for Macs, usefult for not so many... > > On the other hand, the Mac community have a strong track record of > supporting shareware authors by actually paying for the software. > While normally, an outsider might view the Mac community as too small, > they generally are capable of supporting quite an amount of shareware > authors. > > Oh and they tend to be fairly fanatically loyal as well. :-) That is absolutely true. Also, Erlang is a really good fit for Mac OS X, since their entire product line is multi-core (except for the lowest end Mac Mini, as of Monday). I'm interested in seeing Cocoa bindings for Erlang. I doubt I'd invest in learning yet another IDE, but I'd probably donate or buy it if it was cheap enough just to support the work (but only if the Cocoa bridge was liberally licensed open source). > > Just a thought: have you looked at Eclipse and Erlide? It works on Macs too! > > I've used Eclipse, but I haven't tried Erlide. > > Personally, I'd gladly consider a dedicated Erlang IDE on the Mac. If > it wasn't priced too high, I'd most likely buy it. > > A decent IDE and good tutorials are the primary things holding most of > us beginners that lurk on the list. I know I believe in the principles > of Erlang, but I haven't quite written the critical mass of lines of > code necessary to really feel like I've "groked" it. I think the first step is to make Erlang easy to install. erlrt and repos goes a long way to making this happen, but the current versions are kinda busted (at least on Mac OS X, especially intel). I've sent some emails to the author letting him know what was broken in erlrt and how to fix it. However, the sources that assemble the erlrt self-installers and the whole of repos don't seem to be available to the public at this time so I was only able to get the fundamental stuff fixed. I'd have done more if the sources were available. We need something where anybody can get erlang+yaws up in 5 minutes without writing any configuration files by hand. It's so close, and hopefully it'll be there soon. -bob From joelr1@REDACTED Fri Aug 11 20:54:35 2006 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 11 Aug 2006 19:54:35 +0100 Subject: Commercial Mac IDE In-Reply-To: <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> Message-ID: Hi Vlad! On Aug 11, 2006, at 5:36 PM, Vlad Dumitrescu wrote: > Just a thought: have you looked at Eclipse and Erlide? It works on > Macs too! I don't like Eclipse or Java and I would like to be able to extend the environment in Erlang. -- http://wagerlabs.com/ From joelr1@REDACTED Fri Aug 11 21:14:52 2006 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 11 Aug 2006 20:14:52 +0100 Subject: Commercial Mac IDE In-Reply-To: <17244f480608111105r288204bet49a73808608e1abd@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <17244f480608111105r288204bet49a73808608e1abd@mail.gmail.com> Message-ID: <153B4462-B802-442D-A0AD-CD6CF07E851B@gmail.com> On Aug 11, 2006, at 7:05 PM, Yariv Sadan wrote: > Plus, aren't you already working on a trading system? :) You are calling my bluff, aren't you? What do you think my trading systems development platform will need and what should it be built upon? Hint: See subject! :-) Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Fri Aug 11 21:17:34 2006 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 11 Aug 2006 20:17:34 +0100 Subject: Commercial Mac IDE In-Reply-To: References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> Message-ID: <6A7AFE67-9155-4D42-939D-8A5E6EAE4490@gmail.com> On Aug 11, 2006, at 7:06 PM, Anders Nygren wrote: > I do not have a Mac, so I do not really know what I am talking > about here > but would it not be easier to make an Erlang bundle for TextMate > instead? What I have in mind is sort of like TextMate but extended in Erlang and with a debugger, etc. -- http://wagerlabs.com/ From simonpeterchappell@REDACTED Fri Aug 11 21:23:56 2006 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Fri, 11 Aug 2006 14:23:56 -0500 Subject: Commercial Mac IDE In-Reply-To: References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> Message-ID: <8ed733900608111223y184a638cn7ea9ebdd4d01243a@mail.gmail.com> On 8/11/06, Joel Reymont wrote: > Hi Vlad! > > On Aug 11, 2006, at 5:36 PM, Vlad Dumitrescu wrote: > > > Just a thought: have you looked at Eclipse and Erlide? It works on > > Macs too! > > I don't like Eclipse or Java and I would like to be able to extend > the environment in Erlang. Agreed. I like Java well enough (it's the day job that pays the bills), but there's nothing quite like using an environment designed for your language from the ground up. That's why eclipse is so popular with Java folks; it works well with Java. Other languages? Less of an obvious fit. Simon -- www.simonpeter.org From richardc@REDACTED Fri Aug 11 21:24:38 2006 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 11 Aug 2006 21:24:38 +0200 Subject: Commercial Mac IDE In-Reply-To: <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> Message-ID: <44DCD976.9090708@it.uu.se> Simon Chappell wrote: > On the other hand, the Mac community have a strong track record of > supporting shareware authors by actually paying for the software. > While normally, an outsider might view the Mac community as too small, > they generally are capable of supporting quite an amount of shareware > authors. > > Oh and they tend to be fairly fanatically loyal as well. :-) By sheer coincidence: http://www.penny-arcade.com/comic/2006/08/11 :-) /Richard From joelr1@REDACTED Fri Aug 11 21:28:06 2006 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 11 Aug 2006 20:28:06 +0100 Subject: Commercial Mac IDE In-Reply-To: <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> Message-ID: <246596AB-A98A-4B30-91EE-16DAD7D4713F@gmail.com> On Aug 11, 2006, at 6:31 PM, Simon Chappell wrote: > Personally, I'd gladly consider a dedicated Erlang IDE on the Mac. If > it wasn't priced too high, I'd most likely buy it. What's a good price range from your prospective? > Is there any chance that you can write the Erlang version of DrScheme? > (An IDE and tutorial all in one. :-) This is sort of what I have in mind, an environment extensible in Erlang. I haven't thought about the tutorials, though :-). -- http://wagerlabs.com/ From joelr1@REDACTED Fri Aug 11 21:35:17 2006 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 11 Aug 2006 20:35:17 +0100 Subject: Commercial Mac IDE In-Reply-To: <95be1d3b0608111123l45440a26xddcd0670e820fa07@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> <95be1d3b0608111123l45440a26xddcd0670e820fa07@mail.gmail.com> Message-ID: <24C04070-1AFE-48B9-9715-0F455A0CDB57@gmail.com> On Aug 11, 2006, at 7:23 PM, Vlad Dumitrescu wrote: > My point was that it may be worth considering the options first. > Having done some work on an IDE framework before, I know there are a > lot of tricky details. So riding on the Eclipse wave would cut a lot > of corners. My main beef, if you will, is the large size of Eclipse and associated baggage. I tried using it for Java development before and found it slow and bloated. Plus, I don't want to code in Java to extend my Erlang environment. I would also like to take advantage of all the APIs that Apple and Cocoa have to offer, including the ones coming out in Leopard. Ultimately, I'm planning to offer a trading systems development platform and it would need a coding environment. I might as well build the environment first and then extend it further. Thanks, Joel -- http://wagerlabs.com/ From yarivvv@REDACTED Fri Aug 11 21:44:33 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Fri, 11 Aug 2006 15:44:33 -0400 Subject: Commercial Mac IDE In-Reply-To: References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> Message-ID: <17244f480608111244g7ac0d8f9u61232fccf00f3308@mail.gmail.com> > > I don't like Eclipse or Java and I would like to be able to extend > the environment in Erlang. > Isn't a big part or Erlide written in Erlang? Maybe you can use the Erlide backend and write a Cocoa frontend for it. I think it would be great to have a native Erlang IDE for Mac, and if you have the time do build one (and I don't think it would be a trivial project) than go for it! Yariv From simonpeterchappell@REDACTED Fri Aug 11 22:11:53 2006 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Fri, 11 Aug 2006 15:11:53 -0500 Subject: Commercial Mac IDE In-Reply-To: <17244f480608111244g7ac0d8f9u61232fccf00f3308@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <17244f480608111244g7ac0d8f9u61232fccf00f3308@mail.gmail.com> Message-ID: <8ed733900608111311p34b43cf5h17852432cb666362@mail.gmail.com> On 8/11/06, Yariv Sadan wrote: !snip! > I think it would be great to have a native Erlang IDE for Mac, and if > you have the time do build one (and I don't think it would be a > trivial project) than go for it! And I for one, will be an alpha/beta tester and then a customer. I might even start on that tutorial if folks will help steer me right when my OO-worldview intrudes. Simon -- www.simonpeter.org From vladdu55@REDACTED Fri Aug 11 22:58:18 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 11 Aug 2006 21:58:18 +0100 Subject: Commercial Mac IDE In-Reply-To: <24C04070-1AFE-48B9-9715-0F455A0CDB57@gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> <95be1d3b0608111123l45440a26xddcd0670e820fa07@mail.gmail.com> <24C04070-1AFE-48B9-9715-0F455A0CDB57@gmail.com> Message-ID: <95be1d3b0608111358i5fbbe6e6k97bc757e34556bf@mail.gmail.com> On 8/11/06, Joel Reymont wrote: > > On Aug 11, 2006, at 7:23 PM, Vlad Dumitrescu wrote: > > > My point was that it may be worth considering the options first. > > Having done some work on an IDE framework before, I know there are a > > lot of tricky details. So riding on the Eclipse wave would cut a lot > > of corners. > > My main beef, if you will, is the large size of Eclipse and > associated baggage. I tried using it for Java development before and > found it slow and bloated. This is partly true. The latest Eclipse is much faster and slicker than previous versions (that's why I say "partly"). The Eclipse runtime is 33M, so not overly huge with today's standards (just as large as OTP). Of course, if you want the whole SDK (for developing erlide, not just using it), it becomes 100M... My plan from the beginning was to write a generic Java framework for Eclipse and have all specific code done in Erlang. In practice it wasn't that easy, I had to choose between getting something done fast(ish) or maybe never being able to deliver anything at all. I still would like to return to the former solution. As it is now, all UI stuff is Java, but most of the core functionality is in Erlang. > Plus, I don't want to code in Java to extend my Erlang environment. This, of course, nobody can argue with :-) > I would also like to take advantage of all the APIs that Apple and > Cocoa have to offer, including the ones coming out in Leopard. > Ultimately, I'm planning to offer a trading systems development > platform and it would need a coding environment. I might as well > build the environment first and then extend it further. I think it could be a nice app, yes, but I hope I will be forgiven if I still prefer a multi-platform IDE :-) Maybe we others will still benefit somehow (if your GUI framework will have parts that aren't Mac specific! Good luck! Vlad From dgou@REDACTED Sat Aug 12 00:49:43 2006 From: dgou@REDACTED (Douglas Philips) Date: Fri, 11 Aug 2006 18:49:43 -0400 Subject: Commercial Mac IDE In-Reply-To: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> Message-ID: <77EDE444-F1D4-4560-98BF-E827E16EE2DA@mac.com> On 2006 Aug 11, at 10:19 AM, Joel Reymont indited: > Over 15 people replied to my "Who's on a Mac" poll so far so I > thought I would lay my cards on the table... > > I want to build and sell a Mac IDE for Erlang. Elegant, powerful, > easy to use. Something I would use myself to build other things I > have in mind. So please let me know what you think and hold no > punches! Well, despite the fact that I am a dyed in the keyboard Mac user, I am forced to use hideous Microsoft machines at work, and so I really don't want to get stuck having to switch my brain back and forth between different IDEs. I agree with the previous messages, Eclipse means too much accomodation of Java. Plus, while I would pay for a nice IDE, I doubt my employer would (We already have Visual Stupor for Windows and Eclipse for everything else). Big beaucracy cannot be reasoned with. :-( Anyways, that's my buck two fitty, --Doug From yarivvv@REDACTED Sat Aug 12 03:07:01 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Fri, 11 Aug 2006 21:07:01 -0400 Subject: Commercial Mac IDE In-Reply-To: <95be1d3b0608111358i5fbbe6e6k97bc757e34556bf@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> <95be1d3b0608111123l45440a26xddcd0670e820fa07@mail.gmail.com> <24C04070-1AFE-48B9-9715-0F455A0CDB57@gmail.com> <95be1d3b0608111358i5fbbe6e6k97bc757e34556bf@mail.gmail.com> Message-ID: <17244f480608111807w7d986256m2c0dcc3b1822aa90@mail.gmail.com> Hi, > > This is partly true. The latest Eclipse is much faster and slicker > than previous versions (that's why I say "partly"). The Eclipse > runtime is 33M, so not overly huge with today's standards (just as > large as OTP). Of course, if you want the whole SDK (for developing > erlide, not just using it), it becomes 100M... IMO, it doesn't matter how big the download is. I mostly care about speed and features. Eclipse used to be horribly slow on my G5, but on my new Intel MacBook it's surprisingly snappy. I have been using Erlide on the MacBook and it has been overall a positive experience. > > > As it is now, all UI stuff is Java, but most of the core functionality > is in Erlang. Maybe the Erlang code can be reused for the Cocoa IDE? > I think it could be a nice app, yes, but I hope I will be forgiven if > I still prefer a multi-platform IDE :-) Maybe we others will still > benefit somehow (if your GUI framework will have parts that aren't Mac > specific! On this topic, Joel, have you looked at possibly maintaining interoperability with GNUStep for the benefit of Unix/Linux users? Also, are there any specific features missing for Erlide that you want to implement in the Cocoa IDE? Best, Yariv From joelr1@REDACTED Sat Aug 12 03:29:13 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 12 Aug 2006 02:29:13 +0100 Subject: Commercial Mac IDE In-Reply-To: <17244f480608111807w7d986256m2c0dcc3b1822aa90@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> <95be1d3b0608111123l45440a26xddcd0670e820fa07@mail.gmail.com> <24C04070-1AFE-48B9-9715-0F455A0CDB57@gmail.com> <95be1d3b0608111358i5fbbe6e6k97bc757e34556bf@mail.gmail.com> <17244f480608111807w7d986256m2c0dcc3b1822aa90@mail.gmail.com> Message-ID: <499EAA23-03EA-4B90-9C3D-CC46C88CF57E@gmail.com> On Aug 12, 2006, at 2:07 AM, Yariv Sadan wrote: > Maybe the Erlang [Erlide] code can be reused for the Cocoa IDE? It's up to Vlad. > On this topic, Joel, have you looked at possibly maintaining > interoperability with GNUStep for the benefit of Unix/Linux users? Nope. I'm positively looking for _less_ work, not more. > Also, are there any specific features missing for Erlide that you want > to implement in the Cocoa IDE? I haven't looked at Erlide yet. My first task is to take care of HiPE on Mac Intel. I'm almost done as HiPE now bootstraps itself and compiles the erl code. I then need to implement the "precise floating point exception" code and then proceed to the Cocoa bindings. I'll look at Erlide once I start on the editor. Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Sat Aug 12 03:31:53 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 12 Aug 2006 02:31:53 +0100 Subject: Mac Intel In-Reply-To: <17627.6633.628837.623309@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> <17627.847.643074.853395@alkaid.it.uu.se> <17627.6633.628837.623309@alkaid.it.uu.se> Message-ID: <60716B11-17C7-4AB6-AE82-3D71D92DDB2E@gmail.com> On Aug 10, 2006, at 12:35 PM, Mikael Pettersson wrote: > I assume you're working on the R11B-0 code base? If so, download > , > unpack the tarball, cd into it, and run ./testsuite.sh your OTP directory>. > If that works, you can then try ./testsuite.sh --only > compiler_tests . I get a bunch of errors like this: *** In trivial_tests: trivial_01_new@REDACTED and trivial_01_old differ!!! *** In trivial_tests: trivial_02_new@REDACTED and trivial_02_old differ!!! *** In trivial_tests: trivial_03_new@REDACTED and trivial_03_old differ!!! What do they mean? Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Sat Aug 12 03:50:41 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 12 Aug 2006 02:50:41 +0100 Subject: Mac Intel In-Reply-To: <17627.6633.628837.623309@alkaid.it.uu.se> References: <200608062111.k76LBoaw017823@harpo.it.uu.se> <4B7AF015-6A03-4B58-999C-08EBD505C5B7@gmail.com> <17626.3004.908596.504480@alkaid.it.uu.se> <17626.62053.183124.147819@alkaid.it.uu.se> <6DF2B7E9-2AF3-4AEF-98C7-B249D76D9AF6@gmail.com> <17627.847.643074.853395@alkaid.it.uu.se> <17627.6633.628837.623309@alkaid.it.uu.se> Message-ID: <34DA968D-11D2-4A7E-BC36-BEF4C6368D5E@gmail.com> HiPE is sort of done but I'm using the open source mach_override code and I still need to take care of the precise floating-point exception code. Then again, FPE has nothing to do with HiPE. Test results below, both general and compiler. How do I interpret these results? Which ones have to do with FPE? On Aug 10, 2006, at 12:35 PM, Mikael Pettersson wrote: > I assume you're working on the R11B-0 code base? If so, download > , > unpack the tarball, cd into it, and run ./testsuite.sh your OTP directory>. 1> EXITED with reason {function_clause, [{gb_trees,get_1,[{rtl_reg,21,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 *** In trivial_tests: trivial_13_new@REDACTED and trivial_13_old differ!!! < {{{emu_result,42},{native_result,42}},{{emu_compile, {ok,trivial_13}},{native_compile,{'EXIT',{{hipe,806,{function_clause, [{gb_trees,get_1,[{rtl_reg,21,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]}},[{hipe,finalize_fun,2},{hipe,'-finalize/5-lc $^1/1-0-',2},{hipe,finalize,5},{hipe,compile_finish,3},{hipe,'- run_compiler_1/3-fun-0-',4}]}}}}} 1> EXITED with reason {function_clause, [{gb_trees,get_1,[{rtl_reg,21,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 *** In basic_tests: simpl_fl_new@REDACTED and simpl_fl_old differ!!! < {{{emu_result,{8.04758,-6.02300e+23}},{native_result, {8.04758,-6.02300e+23}}},{{emu_compile,{ok,simpl_fl}},{native_compile, {'EXIT',{{hipe,806,{function_clause,[{gb_trees,get_1,[{rtl_reg, 21,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]}}, [{hipe,finalize_fun,2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,'- finalize/5-lc$^1/1-0-',2},{hipe,finalize,5},{hipe,compile_finish,3}, {hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} 1> EXITED with reason {function_clause, [{gb_trees,get_1,[{rtl_reg,21,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 *** In basic_tests: simpl_se_new@REDACTED and simpl_se_old differ!!! < {{{emu_result,{rec,foo,[a,b,c],42,{a,b},42.0000}},{native_result, {rec,foo,[a,b,c],42,{a,b},42.0000}}},{{emu_compile,{ok,simpl_se}}, {native_compile,{'EXIT',{{hipe,806,{function_clause,[{gb_trees,get_1, [{rtl_reg,21,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]}}, [{hipe,finalize_fun,2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,'- finalize/5-lc$^1/1-0-',2},{hipe,finalize,5},{hipe,compile_finish,3}, {hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} 1> EXITED with reason {function_clause, [{gb_trees,get_1,[{rtl_reg,16,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 *** In basic_tests: catch_fp_bdarith_new@REDACTED and catch_fp_bdarith_old differ!!! < {{{emu_result,ok},{native_result,ok}},{{emu_compile, {ok,catch_fp_bdarith}},{native_compile,{'EXIT',{{hipe,806, {function_clause,[{gb_trees,get_1,[{rtl_reg,16,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]}},[{hipe,finalize_fun,2},{hipe,'-finalize/5-lc $^1/1-0-',2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,finalize,5}, {hipe,compile_finish,3},{hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} 1> EXITED with reason {function_clause, [{gb_trees,get_1,[{rtl_reg,38,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 *** In basic_tests: catch_fp_conv_new@REDACTED and catch_fp_conv_old differ!!! < {{{emu_result,ok},{native_result,ok}},{{emu_compile, {ok,catch_fp_conv}},{native_compile,{'EXIT',{{hipe,806, {function_clause,[{gb_trees,get_1,[{rtl_reg,38,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]}},[{hipe,finalize_fun,2},{hipe,'-finalize/5-lc $^1/1-0-',2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,finalize,5}, {hipe,compile_finish,3},{hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} 1> EXITED with reason {function_clause, [{gb_trees,get_1,[{rtl_reg,28,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 *** In basic_tests: test07_new@REDACTED and test07_old differ!!! < {{{emu_result,ok},{native_result,ok}},{{emu_compile,{ok,test07}}, {native_compile,{'EXIT',{{hipe,806,{function_clause,[{gb_trees,get_1, [{rtl_reg,28,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]}}, [{hipe,finalize_fun,2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,'- finalize/5-lc$^1/1-0-',2},{hipe,finalize,5},{hipe,compile_finish,3}, {hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} 1> EXITED with reason {function_clause, [{gb_trees,get_1,[{rtl_reg,17,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 *** In basic_tests: fp_beam_bug_new@REDACTED and fp_beam_bug_old differ!!! < {{{emu_result,{ok,ok}},{native_result,{ok,ok}}},{{emu_compile, {ok,fp_beam_bug}},{native_compile,{'EXIT',{{hipe,806,{function_clause, [{gb_trees,get_1,[{rtl_reg,17,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]}},[{hipe,finalize_fun,2},{hipe,'-finalize/5-lc $^1/1-0-',2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,finalize,5}, {hipe,compile_finish,3},{hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} 1> EXITED with reason {function_clause, [{gb_trees,get_1,[{rtl_reg,17,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 *** In basic_tests: fp_beam_bug_new@REDACTED and fp_beam_bug_old differ!!! < {{{emu_result,{ok,ok}},{native_result,{ok,ok}}},{{emu_compile, {ok,fp_beam_bug}},{native_compile,{'EXIT',{{hipe,806,{function_clause, [{gb_trees,get_1,[{rtl_reg,17,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]}},[{hipe,finalize_fun,2},{hipe,'-finalize/5-lc $^1/1-0-',2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,finalize,5}, {hipe,compile_finish,3},{hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} 1> EXITED with reason {function_clause, [{gb_trees,get_1,[{rtl_reg,37,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 *** In basic_tests: fp_ebb_new@REDACTED and fp_ebb_old differ!!! < {{{emu_result,ok},{native_result,ok}},{{emu_compile,{ok,fp_ebb}}, {native_compile,{'EXIT',{{hipe,806,{function_clause,[{gb_trees,get_1, [{rtl_reg,37,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]}}, [{hipe,finalize_fun,2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,'- finalize/5-lc$^1/1-0-',2},{hipe,finalize,5},{hipe,compile_finish,3}, {hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} 1> EXITED with reason {function_clause, [{gb_trees,get_1,[{rtl_reg,20,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 *** In basic_tests: merged_catches_new@REDACTED and merged_catches_old differ!!! < {{{emu_result,ok},{native_result,ok}},{{emu_compile, {ok,merged_catches}},{native_compile,{'EXIT',{{hipe,806, {function_clause,[{gb_trees,get_1,[{rtl_reg,20,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]}},[{hipe,finalize_fun,2},{hipe,'-finalize/5-lc $^1/1-0-',2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,finalize,5}, {hipe,compile_finish,3},{hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} 1> EXITED with reason {function_clause, [{gb_trees,get_1,[{rtl_reg,109,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 *** In process_tests: proc_test1_new@REDACTED and proc_test1_old differ!!! < {{{emu_result,{'Elapsed/expected',ok}},{native_result,{'Elapsed/ expected',ok}}},{{emu_compile,{ok,proc_test1}},{native_compile, {'EXIT',{{hipe,806,{function_clause,[{gb_trees,get_1,[{rtl_reg, 109,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]}}, [{hipe,finalize_fun,2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,'- finalize/5-lc$^1/1-0-',2},{hipe,finalize,5},{hipe,compile_finish,3}, {hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} EXITED with reason {function_clause,[{gb_trees,get_1, [{rtl_reg,50,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]} @hipe:806 *** In bench_tests: barnes_new@REDACTED and barnes_old differ!!! < {{{emu_result,{1.00000,true,true}},{native_result, {1.00000,true,true}}},{{emu_compile,{ok,barnes}},{native_compile, {'EXIT',{{hipe,806,{function_clause,[{gb_trees,get_1,[{rtl_reg, 50,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]}}, [{hipe,finalize_fun,2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,'- finalize/5-lc$^1/1-0-',2},{hipe,finalize,5},{hipe,compile_finish,3}, {hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} EXITED with reason {function_clause,[{gb_trees,get_1, [{rtl_reg,61,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]} @hipe:806 *** In bench_tests: barnes2_new@REDACTED and barnes2_old differ!!! < {{{emu_result,{1.00000,true,true}},{native_result, {1.00000,true,true}}},{{emu_compile,{ok,barnes2}},{native_compile, {'EXIT',{{hipe,806,{function_clause,[{gb_trees,get_1,[{rtl_reg, 61,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]}}, [{hipe,finalize_fun,2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,'- finalize/5-lc$^1/1-0-',2},{hipe,finalize,5},{hipe,compile_finish,3}, {hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} EXITED with reason {function_clause,[{gb_trees,get_1, [{rtl_reg,62,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]} @hipe:806 *** In bench_tests: estone_new@REDACTED and estone_old differ!!! < {{{emu_result,ok},{native_result,ok}},{{emu_compile,{ok,estone}}, {native_compile,{'EXIT',{{hipe,806,{function_clause,[{gb_trees,get_1, [{rtl_reg,62,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]}}, [{hipe,finalize_fun,2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,'- finalize/5-lc$^1/1-0-',2},{hipe,finalize,5},{hipe,compile_finish,3}, {hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} EXITED with reason {function_clause,[{gb_trees,get_1, [{rtl_reg,34,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]} @hipe:806 *** In bench_tests: float_bm_new@REDACTED and float_bm_old differ!!! < {{{emu_result,ok},{native_result,ok}},{{emu_compile,{ok,float_bm}}, {native_compile,{'EXIT',{{hipe,806,{function_clause,[{gb_trees,get_1, [{rtl_reg,34,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]}}, [{hipe,finalize_fun,2},{hipe,'-finalize/5-lc$^1/1-0-',2}, {hipe,finalize,5},{hipe,compile_finish,3},{hipe,'-run_compiler_1/3- fun-0-',4}]}}}}} EXITED with reason {function_clause,[{gb_trees,get_1, [{rtl_reg,28,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]} @hipe:806 *** In bench_tests: pseudoknot_new@REDACTED and pseudoknot_old differ!!! < {{{emu_result,33.7976},{native_result,33.7976}},{{emu_compile, {ok,pseudoknot}},{native_compile,{'EXIT',{{hipe,806,{function_clause, [{gb_trees,get_1,[{rtl_reg,28,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]}},[{hipe,finalize_fun,2},{hipe,'-finalize/5-lc $^1/1-0-',2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,finalize,5}, {hipe,compile_finish,3},{hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} 1> EXITED with reason {function_clause, [{gb_trees,get_1,[{rtl_reg,51,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 *** In memory_tests: ring3_new@REDACTED and ring3_old differ!!! < {{{emu_result,ok},{native_result,ok}},{{emu_compile,{ok,ring3}}, {native_compile,{'EXIT',{{hipe,806,{function_clause,[{gb_trees,get_1, [{rtl_reg,51,false},nil]},{hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3},{hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4},{hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2},{hipe_main,rtl_ssa,2}]}}, [{hipe,finalize_fun,2},{hipe,'-finalize/5-lc$^1/1-0-',2},{hipe,'- finalize/5-lc$^1/1-0-',2},{hipe,finalize,5},{hipe,compile_finish,3}, {hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} > If that works, you can then try ./testsuite.sh --only > compiler_tests . 1> Compiling esmb ... EXITED with reason {function_clause,[{gb_trees,get_1,[{rtl_reg,27,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 compiler_tests/esmb differ!!! 1> Compiling wings_ask ... EXITED with reason {function_clause,[{gb_trees,get_1,[{rtl_reg,47,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]} @hipe:806 compiler_tests/wings differ!!! -- http://wagerlabs.com/ From ryanobjc@REDACTED Sat Aug 12 09:11:56 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Sat, 12 Aug 2006 00:11:56 -0700 Subject: Commercial Mac IDE In-Reply-To: <95be1d3b0608111123l45440a26xddcd0670e820fa07@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> <95be1d3b0608111123l45440a26xddcd0670e820fa07@mail.gmail.com> Message-ID: <78568af10608120011q614587eaw74e9170cdc83a6ce@mail.gmail.com> Eclipse is not really a great environment to develop plug-ins for. Lots of verbose structure (well it _IS_ Java after all), and lack of documentation for many core/fast changing features. For example I wrote an Eclipse plugin to handle classpath derived from a custom build dependency system. Well it turns out Eclipse doesn't handle dynamic classpaths well, and there certainly isn't any documentation on how to do anything more advanced than add static strings to a class path (useless) or handle dynamicism. The eclipse plugin development classpath dependency has the same problems and it handles them just as poorly. Also Eclipse is teh slow. Emacs feels like a speed demon. I would never use any IDE based on Eclipse again for non-Java languages. On 8/11/06, Vlad Dumitrescu wrote: > Hi, > > My point was that it may be worth considering the options first. > Having done some work on an IDE framework before, I know there are a > lot of tricky details. So riding on the Eclipse wave would cut a lot > of corners. > > If the project is seen as a "learn by doing" thing, then the above > doesn't apply. But for a commercial project, time to market is very > important. There are a lot of commercial Eclipse-based environments, > so it's possible to build upon erlide with extra plugins (comercially > licensed). > > And of course, I wouldn't mind if this would help along Erlide too :-) > > regards, > Vlad > > On 8/11/06, Simon Chappell wrote: > > > This is a large project, and if only for Macs, usefult for not so many... > > > > On the other hand, the Mac community have a strong track record of > > supporting shareware authors by actually paying for the software. > > While normally, an outsider might view the Mac community as too small, > > they generally are capable of supporting quite an amount of shareware > > authors. > > > > Oh and they tend to be fairly fanatically loyal as well. :-) > From ryanobjc@REDACTED Sat Aug 12 09:16:04 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Sat, 12 Aug 2006 00:16:04 -0700 Subject: Commercial Mac IDE In-Reply-To: <499EAA23-03EA-4B90-9C3D-CC46C88CF57E@gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> <95be1d3b0608111123l45440a26xddcd0670e820fa07@mail.gmail.com> <24C04070-1AFE-48B9-9715-0F455A0CDB57@gmail.com> <95be1d3b0608111358i5fbbe6e6k97bc757e34556bf@mail.gmail.com> <17244f480608111807w7d986256m2c0dcc3b1822aa90@mail.gmail.com> <499EAA23-03EA-4B90-9C3D-CC46C88CF57E@gmail.com> Message-ID: <78568af10608120016l67bdf1f5id75ed62b46c27918@mail.gmail.com> Ah yes, I totally forgot. If you are developing for OS X - why not extend Xcode?! You just missed WWDC so your timing is very very early, since you will want good access to the xcode kids, but I guess mailing lists would work almost as well. Why drag in the baggage of Eclipse, or force people to cry Lisp over Emacs, and why not go for the primary method to develop Cocoa applications in OSX? I've used Xcode and it is pretty nifty and keen. I'm sure apple would be pleased to learn about something like this. Also Cocoa is hands down one of the best UI dev kits. Prior to .NET I would say without a doubt it is _the_ best, but now that I hear the borland dude did .NET maybe there is a competitor now. -ryan On 8/11/06, Joel Reymont wrote: > > On Aug 12, 2006, at 2:07 AM, Yariv Sadan wrote: > > > Maybe the Erlang [Erlide] code can be reused for the Cocoa IDE? > > It's up to Vlad. > > > On this topic, Joel, have you looked at possibly maintaining > > interoperability with GNUStep for the benefit of Unix/Linux users? > > Nope. I'm positively looking for _less_ work, not more. > > > Also, are there any specific features missing for Erlide that you want > > to implement in the Cocoa IDE? > > I haven't looked at Erlide yet. My first task is to take care of HiPE > on Mac Intel. I'm almost done as HiPE now bootstraps itself and > compiles the erl code. I then need to implement the "precise floating > point exception" code and then proceed to the Cocoa bindings. I'll > look at Erlide once I start on the editor. > > Thanks, Joel > > -- > http://wagerlabs.com/ > > > > From vladdu55@REDACTED Sat Aug 12 10:27:16 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Sat, 12 Aug 2006 09:27:16 +0100 Subject: Commercial Mac IDE In-Reply-To: <499EAA23-03EA-4B90-9C3D-CC46C88CF57E@gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> <95be1d3b0608111123l45440a26xddcd0670e820fa07@mail.gmail.com> <24C04070-1AFE-48B9-9715-0F455A0CDB57@gmail.com> <95be1d3b0608111358i5fbbe6e6k97bc757e34556bf@mail.gmail.com> <17244f480608111807w7d986256m2c0dcc3b1822aa90@mail.gmail.com> <499EAA23-03EA-4B90-9C3D-CC46C88CF57E@gmail.com> Message-ID: <95be1d3b0608120127w48980abes9c8fe488babefe0@mail.gmail.com> On 8/12/06, Joel Reymont wrote: > On Aug 12, 2006, at 2:07 AM, Yariv Sadan wrote: > > Maybe the Erlang [Erlide] code can be reused for the Cocoa IDE? > It's up to Vlad. Of course the erlide code can be reused - the Eclipse license is meant to allow commercial use of open-source code. And I'm here to answer if there are any questions. Regarding the other opinions about Eclipse, I confess I'm not utterly thrilled about it either, but it is what's doing the best job so far. Yes, there are still quirks and bugs and so, but having all that momentum behind it means they will probably get fixed faster than if there was a single developer doing all the work. Yes, it is Java and thus not C, but I can't say I notice any difference on my machine. regards, Vlad From mikpe@REDACTED Sat Aug 12 12:16:04 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Sat, 12 Aug 2006 12:16:04 +0200 (MEST) Subject: Mac Intel Message-ID: <200608121016.k7CAG4GO017451@harpo.it.uu.se> On Sat, 12 Aug 2006 02:31:53 +0100, Joel Reymont wrote: >On Aug 10, 2006, at 12:35 PM, Mikael Pettersson wrote: > >> I assume you're working on the R11B-0 code base? If so, download >> , >> unpack the tarball, cd into it, and run ./testsuite.sh > your OTP directory>. >> If that works, you can then try ./testsuite.sh --only >> compiler_tests . > >I get a bunch of errors like this: > >*** In trivial_tests: trivial_01_new@REDACTED and trivial_01_old >differ!!! >*** In trivial_tests: trivial_02_new@REDACTED and trivial_02_old >differ!!! >*** In trivial_tests: trivial_03_new@REDACTED and trivial_03_old >differ!!! > >What do they mean? Most likely that the compiler failed. The details can be found in the /tmp/hipe_test_log.${USER}* file(s). From mikpe@REDACTED Sat Aug 12 12:16:58 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Sat, 12 Aug 2006 12:16:58 +0200 (MEST) Subject: Mac Intel Message-ID: <200608121016.k7CAGwkf017483@harpo.it.uu.se> On Sat, 12 Aug 2006 02:50:41 +0100, Joel Reymont wrote: >HiPE is sort of done but I'm using the open source mach_override code >and I still need to take care of the precise floating-point exception >code. Then again, FPE has nothing to do with HiPE. Oh yes it does. Unless you disable floating-point code generation by passing no_inline_fp to the HiPE compiler, HiPE will generate code that relies on the floating-point exception mechanisms in the runtime system. This is the case on x86, amd64, ppc32, and sparc32; on arm floating-point is usually emulated by software so I enforce no_inline_fp on arm. >Test results below, both general and compiler. How do I interpret >these results? Which ones have to do with FPE? > >On Aug 10, 2006, at 12:35 PM, Mikael Pettersson wrote: > >> I assume you're working on the R11B-0 code base? If so, download >> , >> unpack the tarball, cd into it, and run ./testsuite.sh > your OTP directory>. > >1> EXITED with reason {function_clause, >[{gb_trees,get_1,[{rtl_reg,21,false},nil]}, >{hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, >{hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, >{hipe_rtl_ssa,convert,1},{hipe_main,rtl_ssa_convert,2}, >{hipe_main,rtl_ssa,2}]} @hipe:806 >*** In trivial_tests: trivial_13_new@REDACTED and trivial_13_old >differ!!! All of the failures appear to be similar to this one. The compiler breaks in RTL before the code gets to the backend. This is not expected and indicates that something is very broken. This test case (trivial_13) does perform floating-point operations (a / and a round) so the compiler must generate code for that, but no floating-point exceptions should occur while it's doing this. Is this message from the /tmp/hipe_test_log.${USER} file? Sometimes you can get a better stack trace when compiling interactively. 'cd' into tests/trivial_tests/ and start Erlang. Then type 'c(trivial_13,[native]).' or 'hipe:c(trivial_13).'. Do things work better with 'no_inline_fp'? From joelr1@REDACTED Sat Aug 12 12:37:06 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 12 Aug 2006 11:37:06 +0100 Subject: Mac Intel In-Reply-To: <200608121016.k7CAGwkf017483@harpo.it.uu.se> References: <200608121016.k7CAGwkf017483@harpo.it.uu.se> Message-ID: On Aug 12, 2006, at 11:16 AM, Mikael Pettersson wrote: > Is this message from the /tmp/hipe_test_log.${USER} file? Yes > Sometimes you can get a better stack trace when compiling > interactively. 'cd' into tests/trivial_tests/ and start Erlang. > Then type 'c(trivial_13,[native]).' or 'hipe:c(trivial_13).'. I get the same type of error. See below. > Do things work better with 'no_inline_fp'? Much better, yes. 4> c(trivial_13,[native, {hipe, no_inline_fp}]). {ok,trivial_13} The trace with inline_fp: =ERROR REPORT==== 12-Aug-2006::11:33:53 === Error in process <0.36.0> with exit value: {{hipe,806, {function_clause,[{gb_trees,get_1,[{rtl_reg,21,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3},{hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4},{hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1},{... ./trivial_13.erl:none: internal error in native_compile; crash reason: {{hipe,806, {function_clause,[{gb_trees, get_1, [{rtl_reg,21,false},nil]}, {hipe_rtl_ssa,updateStatementUses,3}, {hipe_rtl_ssa,renameVars,3}, {hipe_rtl_ssa,rename,4}, {hipe_rtl_ssa,childrenRename,4}, {hipe_rtl_ssa,convert,1}, {hipe_main,rtl_ssa_convert,2}, {hipe_main,rtl_ssa,2}]}}, [{hipe,finalize_fun,2}, {hipe,'-finalize/5-lc$^1/1-0-',2}, {hipe,'-finalize/5-lc$^1/1-0-',2}, {hipe,finalize,5}, {hipe,compile_finish,3}, {hipe,'-run_compiler_1/3-fun-0-',4}]} error -- http://wagerlabs.com/ From joelr1@REDACTED Sat Aug 12 12:44:32 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 12 Aug 2006 11:44:32 +0100 Subject: Mac Intel In-Reply-To: <200608121016.k7CAGwkf017483@harpo.it.uu.se> References: <200608121016.k7CAGwkf017483@harpo.it.uu.se> Message-ID: <562B09EA-43BA-488E-B9F7-FBF8F7C7053E@gmail.com> trivial tests pass with no_inline_fp so I thought I would run the compiler tests. Output below... ./test.sh /usr/local/bin/erl "[no_inline_fp]" "" ------------------------------------------------------------------------ --- Running compiler_tests/test.sh --- ------------------------------------------------------------------------ Recompile: ctest Recompile: esmb Recompile: esmb_app Recompile: esmb_client Recompile: esmb_rpc Recompile: esmb_sup Recompile: iconv Recompile: md4 Recompile: wings_ask Recompile: wings_auv_matrix Recompile: wings_e3d__tga Recompile: wings_e3d__tif Recompile: wings_e3d_image Recompile: wings_e3d_q Recompile: wings_e3d_vec Recompile: wings_extrude_edge Recompile: wings_pick Testing esmb.erl: Eshell V5.5 (abort with ^G) 1> Compiling esmb ...sh: line 1: 26085 Done echo ctest:start\ (esmb,[no_inline_fp],\'esmb_new@REDACTED\'\). halt\(\). 26086 Illegal instruction | /usr/local/bin/erl -pa . 0a1,8 > {{result,[{ok,esmb}, > {ok,esmb_app}, > {ok,esmb_client}, > {ok,esmb_rpc}, > {ok,esmb_sup}, > {ok,iconv}, > {ok,md4}]}, > {ok,esmb}} compiler_tests/esmb differ!!! 0a1,8 > {{result,[{ok,esmb}, > {ok,esmb_app}, > {ok,esmb_client}, > {ok,esmb_rpc}, > {ok,esmb_sup}, > {ok,iconv}, > {ok,md4}]}, > {ok,esmb}} Testing wings.erl: Eshell V5.5 (abort with ^G) 1> Compiling wings_ask ... done in 15.29 secs (161188 bytes ++ 729 words) Compiling wings_auv_matrix ... done in 4.41 secs (38028 bytes ++ 38 words) Compiling wings_e3d__tga ... done in 2.15 secs (19864 bytes ++ 165 words) Compiling wings_e3d__tif ... done in 8.72 secs (71220 bytes ++ 669 words) Compiling wings_e3d_image ... done in 2.84 secs (29692 bytes ++ 156 words) Compiling wings_e3d_q ... done in 1.23 secs (11040 bytes ++ 74 words) Compiling wings_e3d_vec ... done in 2.76 secs (21172 bytes ++ 16 words) Compiling wings_extrude_edge ... done in 1.80 secs (23384 bytes ++ 187 words) Compiling wings_pick ... done in 2.97 secs (35984 bytes ++ 251 words) ok 2> Files wings_new@REDACTED and wings_old are identical Testing hc.erl: Eshell V5.5 (abort with ^G) 1> %%======================== Compiling stdlib ======================== ok 2> 1,8c1,41 < {{result,{'EXIT',{badarg,[{erlang,'++',[false,"/lib/stdlib/ebin/ stdlib.app"]},< {hc,files,1}, < {hc,test,1}, < {hc,test,0}, < {ctest,start,3}, < {erl_eval,do_apply,5}, < {shell,exprs,6}, < {shell,eval_loop,3}]}}}, --- > {{result,[{ok,"hipe"}, > {ok,"hipe"}, > {ok,"stdlib"}, > {ok,"compiler"}, > {ok,"kernel"}, > {ok,"dialyzer"}, > {ok,"tools"}, > {ok,"appmon"}, > {ok,"asn1"}, > {ok,"cosEvent"}, > {ok,"cosEventDomain"}, > {ok,"cosFileTransfer"}, > {ok,"cosNotification"}, > {ok,"cosProperty"}, > {ok,"cosTime"}, > {ok,"cosTransactions"}, > {ok,"debugger"}, > {ok,"edoc"}, > {ok,"et"}, > {ok,"gs"}, > {ok,"ic"}, > {ok,"inets"}, > {ok,"megaco"}, > {ok,"mnemosyne"}, > {ok,"mnesia"}, > {ok,"mnesia_session"}, > {ok,"observer"}, > {ok,"orber"}, > {ok,"os_mon"}, > {ok,"parsetools"}, > {ok,"pman"}, > {ok,"runtime_tools"}, > {ok,"sasl"}, > {ok,"snmp"}, > {ok,"ssh"}, > {ok,"ssl"}, > {ok,"syntax_tools"}, > {ok,"toolbar"}, > {ok,"tv"}, > {ok,"webtool"}, > {ok,"xmerl"}]}, compiler_tests/hc differ!!! 1,8c1,41 < {{result,{'EXIT',{badarg,[{erlang,'++',[false,"/lib/stdlib/ebin/ stdlib.app"]},< {hc,files,1}, < {hc,test,1}, < {hc,test,0}, < {ctest,start,3}, < {erl_eval,do_apply,5}, < {shell,exprs,6}, < {shell,eval_loop,3}]}}}, --- > {{result,[{ok,"hipe"}, > {ok,"hipe"}, > {ok,"stdlib"}, > {ok,"compiler"}, > {ok,"kernel"}, > {ok,"dialyzer"}, > {ok,"tools"}, > {ok,"appmon"}, > {ok,"asn1"}, > {ok,"cosEvent"}, > {ok,"cosEventDomain"}, > {ok,"cosFileTransfer"}, > {ok,"cosNotification"}, > {ok,"cosProperty"}, > {ok,"cosTime"}, > {ok,"cosTransactions"}, > {ok,"debugger"}, > {ok,"edoc"}, > {ok,"et"}, > {ok,"gs"}, > {ok,"ic"}, > {ok,"inets"}, > {ok,"megaco"}, > {ok,"mnemosyne"}, > {ok,"mnesia"}, > {ok,"mnesia_session"}, > {ok,"observer"}, > {ok,"orber"}, > {ok,"os_mon"}, > {ok,"parsetools"}, > {ok,"pman"}, > {ok,"runtime_tools"}, > {ok,"sasl"}, > {ok,"snmp"}, > {ok,"ssh"}, > {ok,"ssl"}, > {ok,"syntax_tools"}, > {ok,"toolbar"}, > {ok,"tv"}, > {ok,"webtool"}, > {ok,"xmerl"}]}, -- http://wagerlabs.com/ From erlangist@REDACTED Sat Aug 12 12:46:48 2006 From: erlangist@REDACTED (lang er) Date: Sat, 12 Aug 2006 18:46:48 +0800 Subject: Video Streaming Server Message-ID: <230465c00608120346u7fe36ad2q4223aaa4a5d7d132@mail.gmail.com> Hi! I'm a newbie to Erlang and I'm from China. So sorry for my poor English. I'm evaluating to reimplement our video streaming server in Erlang(which is implemented in C++ now).Basically, it relays real-time video stream from video encoding devices to many concurrent users. The reasons I choose Erlang are: 1. Reliability: I think no other languages can beat Erlang in this area.Our video streaming server is part of a surveillance management system, so reliability is critical 2. Clusting: Servers may be distributed in very large surveillance network, and will server many front video devices(for example, 10000 DVR,DVS in a large city). 3. Mass Concurrent ability: Many users will connect to server and watch real-time video stream. 4. Portability: Server may be installed on Windows(small network) or Linux(middle scale) or Unix(large scale, whole city). 5. Productivity. Functional declarative languages are more productive than imperative languages (such as C++)? But I have some questions: 1. We need connect to many different kinds of video devices, some of these device vendors provide communication protocols to us, and we can implement them in native Erlang code. But some vendors only provide SDK(no source code), so should we use linked-in Port Drivers? And If SDK use native OS thread, are there any problems?If there are, How can we get out of these problems? or What is the best way to use these SDKs in Erlang? 2. Video streaming need long connection, I know Yaws can server mass short connections, and jabber protocol also doesn't need long connection.So are there any good examples to study ,or any documents,articles? Any suggestion is welcome.Thank you! Best Regards! erlangist From joelr1@REDACTED Sat Aug 12 13:00:59 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 12 Aug 2006 12:00:59 +0100 Subject: Mac Intel In-Reply-To: <200608121016.k7CAGwkf017483@harpo.it.uu.se> References: <200608121016.k7CAGwkf017483@harpo.it.uu.se> Message-ID: <2ADA603F-64A3-4F4C-B15D-C9A7124AD772@gmail.com> All this means that I need to implement floating-point exceptions, right? Is there anything else that seems to be horribly broken? core, native, bench, loader, memory, process tests pass, all with no_inline_fp. big tests fail, unable to allocate region. Here are the errors from running basic tests with no_inline_fp: ./test.sh /usr/local/bin/erl "[no_inline_fp]" "" ------------------------------------------------------------------------ --- Running basic_tests/test.sh --- ------------------------------------------------------------------------ Testing bif01.erl: Eshell V5.5 (abort with ^G) 1> ok 2> ------------------------------------------------------------------------ Testing exception01.erl: Eshell V5.5 (abort with ^G) 1> Catching bad_guy(pe_badarith, e_badmatch) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarith,e_badmatch]) =ERROR REPORT==== 12-Aug-2006::11:44:48 === Error in process <0.36.0> with exit value: {{badmatch,b}, [{exception01,bad_guy,2}]} Catching bad_guy(pe_badarg, e_badmatch) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarg,e_badmatch]) =ERROR REPORT==== 12-Aug-2006::11:44:48 === Error in process <0.37.0> with exit value: {{badmatch,b}, [{exception01,bad_guy,2}]} Catching bad_guy(pe_badarith, x) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarith,x]) =ERROR REPORT==== 12-Aug-2006::11:44:48 === Error in process <0.38.0> with exit value: {function_clause, [{exception01,bad_guy,[pe_badarith,x]}]} Catching bad_guy(pe_badarg, x) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarg,x]) =ERROR REPORT==== 12-Aug-2006::11:44:48 === Error in process <0.39.0> with exit value: {function_clause, [{exception01,bad_guy,[pe_badarg,x]}]} Catching bad_guy(pe_badarith, e_case) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarith,e_case]) =ERROR REPORT==== 12-Aug-2006::11:44:48 === Error in process <0.40.0> with exit value: {{case_clause,xxx}, [{exception01,bad_guy,2}]} Catching bad_guy(pe_badarg, e_case) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarg,e_case]) =ERROR REPORT==== 12-Aug-2006::11:44:48 === Error in process <0.41.0> with exit value: {{case_clause,xxx}, [{exception01,bad_guy,2}]} Catching bad_guy(pe_badarith, e_if) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarith,e_if]) =ERROR REPORT==== 12-Aug-2006::11:44:48 === Error in process <0.42.0> with exit value: {if_clause, [{exception01,bad_guy,2}]} Catching bad_guy(pe_badarg, e_if) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarg,e_if]) =ERROR REPORT==== 12-Aug-2006::11:44:48 === Error in process <0.43.0> with exit value: {if_clause, [{exception01,bad_guy,2}]} Catching bad_guy(pe_badarith, e_badmatch) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarith,e_badmatch]) =ERROR REPORT==== 12-Aug-2006::11:44:49 === Error in process <0.45.0> with exit value: {{badmatch,b},[]} Catching bad_guy(pe_badarg, e_badmatch) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarg,e_badmatch]) =ERROR REPORT==== 12-Aug-2006::11:44:49 === Error in process <0.46.0> with exit value: {{badmatch,b},[]} Catching bad_guy(pe_badarith, x) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarith,x]) =ERROR REPORT==== 12-Aug-2006::11:44:49 === Error in process <0.47.0> with exit value: {function_clause,[]} Catching bad_guy(pe_badarg, x) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarg,x]) =ERROR REPORT==== 12-Aug-2006::11:44:49 === Error in process <0.48.0> with exit value: {function_clause,[]} Catching bad_guy(pe_badarith, e_case) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarith,e_case]) =ERROR REPORT==== 12-Aug-2006::11:44:49 === Error in process <0.49.0> with exit value: {{case_clause,xxx},[]} Catching bad_guy(pe_badarg, e_case) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarg,e_case]) =ERROR REPORT==== 12-Aug-2006::11:44:49 === Error in process <0.50.0> with exit value: {{case_clause,xxx},[]} Catching bad_guy(pe_badarith, e_if) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarith,e_if]) =ERROR REPORT==== 12-Aug-2006::11:44:49 === Error in process <0.51.0> with exit value: {if_clause,[]} Catching bad_guy(pe_badarg, e_if) Trapping exits from spawn_link(exception01, bad_guy, [pe_badarg,e_if]) =ERROR REPORT==== 12-Aug-2006::11:44:49 === Error in process <0.52.0> with exit value: {if_clause,[]} ok Testing comp_tmout.erl: Eshell V5.5 (abort with ^G) 1> ./comp_tmout.erl:none: internal error in native_compile; crash reason: timed_out =ERROR REPORT==== 12-Aug-2006::11:46:21 === Error: [hipe:691]: ERROR: Compilation timed out. ./comp_tmout.erl:none: internal error in native_compile; crash reason: timed_out =ERROR REPORT==== 12-Aug-2006::11:46:21 === Error: [hipe:691]: ERROR: Compilation timed out. ok 2> From joelr1@REDACTED Sat Aug 12 13:16:07 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 12 Aug 2006 12:16:07 +0100 Subject: Mac Intel In-Reply-To: <200608121016.k7CAGwkf017483@harpo.it.uu.se> References: <200608121016.k7CAGwkf017483@harpo.it.uu.se> Message-ID: Something trivial like this does raise SIGFPE: #include #include static void handler(int sig) { _Exit(sig); } int main(int argc, char *argv[]) { signal(SIGFPE, handler); return argc / (argc - 1); } This program does _not_ raise SIGFPE at all! #include #include #include #include #include static void fpe_sig_action(int sig, siginfo_t *si, void *puc) { printf("We are here!\n"); _Exit(sig); } double a = 3.23e133; double b = 3.57e257; double res; int main(int argc, char *argv[]) { struct sigaction act; memset(&act, 0, sizeof act); act.sa_sigaction = fpe_sig_action; act.sa_flags = SA_SIGINFO; sigaction(SIGFPE, &act, NULL); return a * b; } From yarivvv@REDACTED Sat Aug 12 14:57:07 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Sat, 12 Aug 2006 08:57:07 -0400 Subject: Commercial Mac IDE In-Reply-To: <78568af10608120016l67bdf1f5id75ed62b46c27918@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> <95be1d3b0608111123l45440a26xddcd0670e820fa07@mail.gmail.com> <24C04070-1AFE-48B9-9715-0F455A0CDB57@gmail.com> <95be1d3b0608111358i5fbbe6e6k97bc757e34556bf@mail.gmail.com> <17244f480608111807w7d986256m2c0dcc3b1822aa90@mail.gmail.com> <499EAA23-03EA-4B90-9C3D-CC46C88CF57E@gmail.com> <78568af10608120016l67bdf1f5id75ed62b46c27918@mail.gmail.com> Message-ID: <17244f480608120557g3663b359y50b64179df3a06da@mail.gmail.com> On 8/12/06, Ryan Rawson wrote: > Ah yes, I totally forgot. > > If you are developing for OS X - why not extend Xcode?! You just > missed WWDC so your timing is very very early, since you will want > good access to the xcode kids, but I guess mailing lists would work > almost as well. > > Why drag in the baggage of Eclipse, or force people to cry Lisp over > Emacs, and why not go for the primary method to develop Cocoa > applications in OSX? I've used Xcode and it is pretty nifty and keen. > I'm sure apple would be pleased to learn about something like this. AFAIK, as opposed to Eclipse, Xcode is closed source, and there's no straightforward way of developing plugins for it short of basic language definition files for syntax highlighting. Am I missing something? Did this change in Xcode 3.0? Yariv From onlyopensource@REDACTED Sat Aug 12 15:13:02 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Sat, 12 Aug 2006 18:43:02 +0530 Subject: mapReduce vs erlang Message-ID: Hello I was reading about mapReduce at http://en.wikipedia.org/wiki/MapReduce and it seemed to have many capabilities similar to erlang. In addition since it is implemented in C++, the data processing capabilities seem to be quite impressive. Now that Nutch project has an implementation of mapReduce, what areas Erlang would be able to make a difference ? -- oo@@oo From onlyopensource@REDACTED Sat Aug 12 15:16:29 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Sat, 12 Aug 2006 18:46:29 +0530 Subject: how to represent multi-structure chain relationships Message-ID: Hello What is the recommended approach to represent multi-structure chain relationships in erlang ? eg. CertEnvelope --> CertChain --> Cert Attribute(s) In C, one would use a pEnv->pChain->pAttrib and work with the fields. How does one do it in Erlang ? Thanks in advance. -- oo@@oo From david.nospam.hopwood@REDACTED Sat Aug 12 15:37:12 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Sat, 12 Aug 2006 14:37:12 +0100 Subject: Video Streaming Server In-Reply-To: <230465c00608120346u7fe36ad2q4223aaa4a5d7d132@mail.gmail.com> References: <230465c00608120346u7fe36ad2q4223aaa4a5d7d132@mail.gmail.com> Message-ID: <44DDD988.8020103@blueyonder.co.uk> lang er wrote: > 1. We need connect to many different kinds of video devices, some of > these device vendors provide communication protocols to us, and we can > implement them in native Erlang code. But some vendors only provide > SDK(no source code), so should we use linked-in Port Drivers? And If > SDK use native OS thread, are there any problems?If there are, How can > we get out of these problems? or What is the best way to use these > SDKs in Erlang? I would suggest to use each vendor's SDK in a separate process running a C program, and communicate with these processes over local sockets. The C program can translate the video to a vendor-neutral protocol. This avoids any potential conflicts over threads or other resources within a process, which you might not be able to solve without source code. It also means that any instability in a vendor's code can be worked around; if its process crashes then you can restart it, and you can also restart it periodically to avoid potential memory leaks. I don't know whether the inability to use shared memory to communicate with the Erlang program would result in performance problems; probably not if the video streams are coming over a network to start with. -- David Hopwood From richardc@REDACTED Sat Aug 12 16:14:13 2006 From: richardc@REDACTED (Richard Carlsson) Date: Sat, 12 Aug 2006 16:14:13 +0200 Subject: Experimental new layout style for EDoc. Message-ID: <44DDE235.2000002@it.uu.se> Folks, I've been doing some changes to the layout in EDoc and I am now looking for some feedback of the constructive kind. (In particular, if you are a stylesheet guru you are most welcome to improve on my newbie attempts at layout.) I'm also interested in hearing about browser compatibility problems that need fixing. Here is an example of the new layout: http://user.it.uu.se/~richardc/edoc/doc/ (The colour scheme is based on the erlang.org site.) If I don't hear anything from anybody, the new version will probably look a lot like the example, so here is your chance to speak up. Of course, if you like it and just want to say so, I'd like to hear that as well. /Richard -- "Having users is like optimization: the wise course is to delay it." -- Paul Graham From erlangist@REDACTED Sat Aug 12 20:04:24 2006 From: erlangist@REDACTED (lang er) Date: Sun, 13 Aug 2006 02:04:24 +0800 Subject: Video Streaming Server In-Reply-To: <44DDD988.8020103@blueyonder.co.uk> References: <230465c00608120346u7fe36ad2q4223aaa4a5d7d132@mail.gmail.com> <44DDD988.8020103@blueyonder.co.uk> Message-ID: <230465c00608121103t2af699k97a96183be01e69@mail.gmail.com> Thank you for your suggestion. Do you mean a C program reads video stream from device and transfer data to Erlang server using local socket, then Erlang server streams video data to client? In surveillance system, QoS( network delay especially) is very import, I think your solution may introduce some additional network delay . Normally, 200-500 ms is acceptable, I will write a prototype to test it. I wonder if this is the standard way Erlang program use external SDK. I have read some posts in this list, and got a impression that Erlang is used in telecommunication device systems and hardware controller programs. Don't they need interact with SDK(dynamic linked library)? Best Regards! James ? 06-8-12?David Hopwood ??? > lang er wrote: > > 1. We need connect to many different kinds of video devices, some of > > these device vendors provide communication protocols to us, and we can > > implement them in native Erlang code. But some vendors only provide > > SDK(no source code), so should we use linked-in Port Drivers? And If > > SDK use native OS thread, are there any problems?If there are, How can > > we get out of these problems? or What is the best way to use these > > SDKs in Erlang? > > I would suggest to use each vendor's SDK in a separate process running > a C program, and communicate with these processes over local sockets. > The C program can translate the video to a vendor-neutral protocol. This > avoids any potential conflicts over threads or other resources within a > process, which you might not be able to solve without source code. It > also means that any instability in a vendor's code can be worked around; > if its process crashes then you can restart it, and you can also restart > it periodically to avoid potential memory leaks. > > I don't know whether the inability to use shared memory to communicate > with the Erlang program would result in performance problems; probably > not if the video streams are coming over a network to start with. > > -- > David Hopwood > > > From erlangist@REDACTED Sat Aug 12 20:36:17 2006 From: erlangist@REDACTED (lang er) Date: Sun, 13 Aug 2006 02:36:17 +0800 Subject: Video Streaming Server In-Reply-To: <44DDD988.8020103@blueyonder.co.uk> References: <230465c00608120346u7fe36ad2q4223aaa4a5d7d132@mail.gmail.com> <44DDD988.8020103@blueyonder.co.uk> Message-ID: <230465c00608121136t4bf35dacl5ca5594e9c9523a9@mail.gmail.com> Thank you for your suggestion. Do you mean a C program reads video stream from device and transfer data to Erlang server using local socket, then Erlang server streams video data to client? Our server will connect to many devices(if user watch many different cameras installed on many different devices).By this way, C program also need to deal with many concurrent problems. It supposed these problems should be done in Erlang side, and there will be little benefit to reimplement streaming server in Erlang. Another problem, In surveillance system, QoS( network delay especially) is very import, I think your solution may introduce some additional network delay. I wonder if this is the standard way Erlang program use external SDK. I have read some posts in this list, and got a impression that Erlang is used in telecommunication device systems and hardware controller programs. Don't they need interact with SDK(dynamic linked library)? Best Regards! James ? 06-8-12?David Hopwood ??? > lang er wrote: > > 1. We need connect to many different kinds of video devices, some of > > these device vendors provide communication protocols to us, and we can > > implement them in native Erlang code. But some vendors only provide > > SDK(no source code), so should we use linked-in Port Drivers? And If > > SDK use native OS thread, are there any problems?If there are, How can > > we get out of these problems? or What is the best way to use these > > SDKs in Erlang? > > I would suggest to use each vendor's SDK in a separate process running > a C program, and communicate with these processes over local sockets. > The C program can translate the video to a vendor-neutral protocol. This > avoids any potential conflicts over threads or other resources within a > process, which you might not be able to solve without source code. It > also means that any instability in a vendor's code can be worked around; > if its process crashes then you can restart it, and you can also restart > it periodically to avoid potential memory leaks. > > I don't know whether the inability to use shared memory to communicate > with the Erlang program would result in performance problems; probably > not if the video streams are coming over a network to start with. > > -- > David Hopwood > > > From goertzen@REDACTED Sat Aug 12 23:21:09 2006 From: goertzen@REDACTED (Daniel Goertzen) Date: Sat, 12 Aug 2006 16:21:09 -0500 Subject: Video Streaming Server In-Reply-To: <230465c00608121103t2af699k97a96183be01e69@mail.gmail.com> References: <230465c00608120346u7fe36ad2q4223aaa4a5d7d132@mail.gmail.com> <44DDD988.8020103@blueyonder.co.uk> <230465c00608121103t2af699k97a96183be01e69@mail.gmail.com> Message-ID: <44DE4645.2030108@ertw.com> Hi James. A linked-in port driver would be the most efficient way to move data into your Erlang node, however such a driver is harder to write and will bring down the entire Erlang node if it crashes. A standard port (or C socket server as David suggests) will incur some overhead because data has to travel through a pipe or socket to reach your Erlang node, however it will be easier to write and will not bring down the whole node if it crashes. The standard port mechanism really is a nice way to interface with C programs, and I think you overestimate the performance impact that the extra socket/pipe io will incur. But the only way to know for sure is to try it out. :) See http://www.erlang.org/download/erlang-book-part1.pdf page 134 for an explanation of ports. Cheers, Dan. lang er wrote: > Thank you for your suggestion. > > Do you mean a C program reads video stream from device and transfer > data to Erlang server using local socket, then Erlang server streams > video data to client? > > In surveillance system, QoS( network delay especially) is very import, > I think your solution may introduce some additional network delay . > Normally, 200-500 ms is acceptable, I will write a prototype to test > it. > > I wonder if this is the standard way Erlang program use external SDK. > I have read some posts in this list, and got a impression that Erlang > is used in telecommunication device systems and hardware controller > programs. Don't they need interact with SDK(dynamic linked library)? > > Best Regards! > James > > > ? 06-8-12?David Hopwood ??? >> lang er wrote: >> > 1. We need connect to many different kinds of video devices, some of >> > these device vendors provide communication protocols to us, and we can >> > implement them in native Erlang code. But some vendors only provide >> > SDK(no source code), so should we use linked-in Port Drivers? And If >> > SDK use native OS thread, are there any problems?If there are, How can >> > we get out of these problems? or What is the best way to use these >> > SDKs in Erlang? >> >> I would suggest to use each vendor's SDK in a separate process running >> a C program, and communicate with these processes over local sockets. >> The C program can translate the video to a vendor-neutral protocol. This >> avoids any potential conflicts over threads or other resources within a >> process, which you might not be able to solve without source code. It >> also means that any instability in a vendor's code can be worked around; >> if its process crashes then you can restart it, and you can also restart >> it periodically to avoid potential memory leaks. >> >> I don't know whether the inability to use shared memory to communicate >> with the Erlang program would result in performance problems; probably >> not if the video streams are coming over a network to start with. >> >> -- >> David Hopwood >> >> >> > > From mikpe@REDACTED Sat Aug 12 23:23:20 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Sat, 12 Aug 2006 23:23:20 +0200 (MEST) Subject: Mac Intel Message-ID: <200608122123.k7CLNKJL024754@harpo.it.uu.se> On Sat, 12 Aug 2006 12:16:07 +0100, Mikael Pettersson wrote: >Something trivial like this does raise SIGFPE: > >#include >#include > >static void handler(int sig) >{ > _Exit(sig); >} > >int main(int argc, char *argv[]) { > signal(SIGFPE, handler); > return argc / (argc - 1); >} > >This program does _not_ raise SIGFPE at all! > >#include >#include >#include >#include >#include > >static void fpe_sig_action(int sig, siginfo_t *si, void *puc) >{ > printf("We are here!\n"); > _Exit(sig); >} > >double a = 3.23e133; >double b = 3.57e257; >double res; > >int main(int argc, char *argv[]) { > struct sigaction act; > memset(&act, 0, sizeof act); > act.sa_sigaction = fpe_sig_action; > act.sa_flags = SA_SIGINFO; > sigaction(SIGFPE, &act, NULL); > return a * b; >} The first program performs an integer division by zero whose failure cannot be masked. The second program performs a floating-point multiply whose overflow by default is masked in most environments. The two programs are completely unrelated, apart from the fact that SIGFPE can report both integer and floating-point errors. The fpe-test.c code embedded in erts/configure.in shows how to enable and catch floating-point exceptions for a number of CPU/OS combinations. From mikpe@REDACTED Sat Aug 12 23:24:00 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Sat, 12 Aug 2006 23:24:00 +0200 (MEST) Subject: Mac Intel Message-ID: <200608122124.k7CLO04W024771@harpo.it.uu.se> On Sat, 12 Aug 2006 12:00:59 +0100, Joel Reymont wrote: >All this means that I need to implement floating-point exceptions, >right? You really should, yes. >Is there anything else that seems to be horribly broken? Nothing as far as I can see. >core, native, bench, loader, memory, process tests pass, all with >no_inline_fp. > >big tests fail, unable to allocate region. "region"? Assuming it's Erlang being unable to allocate more memory, you should run the same test case (big_binary) in BEAM to determine if the problem is HiPE-related or not. (Just c(big_binary) followed by big_binary:test() in the Erlang shell.) >Here are the errors from running basic tests with no_inline_fp: > > >./test.sh /usr/local/bin/erl "[no_inline_fp]" "" >------------------------------------------------------------------------ >--- Running basic_tests/test.sh --- >------------------------------------------------------------------------ > >Testing bif01.erl: >Eshell V5.5 (abort with ^G) >1> ok >2> >------------------------------------------------------------------------ > >Testing exception01.erl: >Eshell V5.5 (abort with ^G) >1> Catching bad_guy(pe_badarith, e_badmatch) >Trapping exits from spawn_link(exception01, bad_guy, >[pe_badarith,e_badmatch]) > >=ERROR REPORT==== 12-Aug-2006::11:44:48 === >Error in process <0.36.0> with exit value: {{badmatch,b}, etc etc These aren't actual errors. The test suite is checking that exceptions etc and timeouts work, and while doing this the system prints some error messages. Unless the test suite reports them as failed there's nothing to worry about. From joelr1@REDACTED Sat Aug 12 23:54:34 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 12 Aug 2006 22:54:34 +0100 Subject: Mac Intel In-Reply-To: <200608122124.k7CLO04W024771@harpo.it.uu.se> References: <200608122124.k7CLO04W024771@harpo.it.uu.se> Message-ID: On Aug 12, 2006, at 10:24 PM, Mikael Pettersson wrote: > "region"? Assuming it's Erlang being unable to allocate more > memory, you should run the same test case (big_binary) in BEAM > to determine if the problem is HiPE-related or not. > > (Just c(big_binary) followed by big_binary:test() in the Erlang > shell.) Same result as with HiPE. Trace below. I have 2Gb of physical memory. Any tips? --- Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] Eshell V5.5 (abort with ^G) 1> c(big_binary). {ok,big_binary} 2> big_binary:test(). beam(28985,0xa000cf60) malloc: *** vm_allocate(size=1074790400) failed (error code=3) beam(28985,0xa000cf60) malloc: *** error: can't allocate region beam(28985,0xa000cf60) malloc: *** set a breakpoint in szone_error to debug beam (28985,0xa000cf60) malloc: *** vm_allocate(size=1074790400) failed (error code=3) beam(28985,0xa000cf60) malloc: *** error: can't allocate region beam (28985,0xa000cf60) malloc: *** set a breakpoint in szone_error to debug beam(28985,0xa000cf60) malloc: *** vm_allocate(size=1073745920) failed (error code=3) beam (28985,0xa000cf60) malloc: *** error: can't allocate region beam(28985,0xa000cf60) malloc: *** set a breakpoint in szone_error to debug beam(28985,0xa000cf60) malloc: *** vm_allocate(size=1073745920) failed (error code=3) beam(28985,0xa000cf60) malloc: *** error: can't allocate region beam(28985,0xa000cf60) malloc: *** set a breakpoint in szone_error to debug Crash dump was written to: erl_crash.dump temp_alloc: Cannot reallocate 1073741824 bytes of memory (of type "estack"). Abort trap -- http://wagerlabs.com/ From bob@REDACTED Sun Aug 13 00:51:33 2006 From: bob@REDACTED (Bob Ippolito) Date: Sat, 12 Aug 2006 15:51:33 -0700 Subject: Mac Intel In-Reply-To: References: <200608122124.k7CLO04W024771@harpo.it.uu.se> Message-ID: <6a36e7290608121551n1c7d30ebq237653708224a000@mail.gmail.com> On 8/12/06, Joel Reymont wrote: > > On Aug 12, 2006, at 10:24 PM, Mikael Pettersson wrote: > > > "region"? Assuming it's Erlang being unable to allocate more > > memory, you should run the same test case (big_binary) in BEAM > > to determine if the problem is HiPE-related or not. > > > > (Just c(big_binary) followed by big_binary:test() in the Erlang > > shell.) > > Same result as with HiPE. Trace below. I have 2Gb of physical memory. > Any tips? > > --- > > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] > > Eshell V5.5 (abort with ^G) > 1> c(big_binary). > {ok,big_binary} > 2> big_binary:test(). > beam(28985,0xa000cf60) malloc: *** vm_allocate(size=1074790400) > failed (error code=3) > beam(28985,0xa000cf60) malloc: *** error: can't allocate region > This error means that there's not enough space left in the VM to acquire that much RAM. You should get the same error on PPC unless they've done something to work around it. One common cause of this is attempting to use the realloc() call in hopes of shrinking a large allocation. That does not ever happen on Mac OS X. realloc(ptr, N) where N is <= size currently allocated is always a no-op (no other VM does this "optimization" to my knowledge). If you download the libc source from Apple and look at the implementation it's pretty clear that this is the case. I'm not familiar with the Erlang internals, but I've seen this problem occur in Python in extension code that allocates a large buffer (e.g. for non-blocking IO), reads into it, and then realloc's it to a smaller size expecting the unused part to be reclaimed. The socket extension can cause this if used in certain patterns: http://python.org/sf/1092502 -bob From joelr1@REDACTED Sun Aug 13 01:02:19 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sun, 13 Aug 2006 00:02:19 +0100 Subject: Mac Intel In-Reply-To: <200608122123.k7CLNKJL024754@harpo.it.uu.se> References: <200608122123.k7CLNKJL024754@harpo.it.uu.se> Message-ID: On Aug 12, 2006, at 10:23 PM, Mikael Pettersson wrote: > The fpe-test.c code embedded in erts/configure.in shows how > to enable and catch floating-point exceptions for a number of > CPU/OS combinations. This is obvious in retrospect but it was a pain in the rear and took me a day to find out. The Intel Core Duo processors have SSE2 and these also need to be unmasked for floating-point exceptions to be trapped. Simply unmasking x87 is not enough. I'll fix this up, rebuild HiPE and re-run all the tests. If everything goes well then I'll generate the patches. -- http://wagerlabs.com/ From joelr1@REDACTED Sun Aug 13 01:07:09 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sun, 13 Aug 2006 00:07:09 +0100 Subject: Mac Intel In-Reply-To: <200608122123.k7CLNKJL024754@harpo.it.uu.se> References: <200608122123.k7CLNKJL024754@harpo.it.uu.se> Message-ID: <8424DB20-1D7A-429E-B07F-3A43084A297E@gmail.com> On Aug 12, 2006, at 10:23 PM, Mikael Pettersson wrote: > The fpe-test.c code embedded in erts/configure.in shows how > to enable and catch floating-point exceptions for a number of > CPU/OS combinations. Now that I figured this out, I should fix both the test and the implementation in sys/unix/sys_float.c, correct? Also, what is the purpose of the test code in configure? I assume it sets a flag but the code in sys_float.c seems to duplicate the test code. Thanks, Joel -- http://wagerlabs.com/ From david.nospam.hopwood@REDACTED Sun Aug 13 03:46:49 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Sun, 13 Aug 2006 02:46:49 +0100 Subject: Video Streaming Server In-Reply-To: <230465c00608121103t2af699k97a96183be01e69@mail.gmail.com> References: <230465c00608120346u7fe36ad2q4223aaa4a5d7d132@mail.gmail.com> <44DDD988.8020103@blueyonder.co.uk> <230465c00608121103t2af699k97a96183be01e69@mail.gmail.com> Message-ID: <44DE8489.9070402@blueyonder.co.uk> lang er wrote: > Thank you for your suggestion. > > Do you mean a C program reads video stream from device and transfer > data to Erlang server using local socket, then Erlang server streams > video data to client? Yes, that's what I was suggesting. > In surveillance system, QoS( network delay especially) is very important, > I think your solution may introduce some additional network delay . > Normally, 200-500 ms is acceptable, I will write a prototype to test > it. I would be surprised if the delay was as much as 200 ms. Presumably, the vendor SDK must be able to decode each frame fast enough to keep up with the frame rate, and a local socket connection will not add that much extra latency. > I wonder if this is the standard way Erlang program use external SDK. > I have read some posts in this list, and got a impression that Erlang > is used in telecommunication device systems and hardware controller > programs. Don't they need interact with SDK(dynamic linked library)? It is possible to use a linked-in driver, but that means running code for which you don't have source in the same process as the Erlang emulator. There can be incompatibilities with signals, memory management, threading, etc., and because bugs in the vendor code can crash the whole emulator, you may lose some of the reliability advantages of using Erlang. -- David Hopwood From vladdu55@REDACTED Sun Aug 13 11:33:51 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Sun, 13 Aug 2006 10:33:51 +0100 Subject: Commercial Mac IDE In-Reply-To: <24C04070-1AFE-48B9-9715-0F455A0CDB57@gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <8ed733900608111031s26024c8q95abbaf8902fc023@mail.gmail.com> <95be1d3b0608111123l45440a26xddcd0670e820fa07@mail.gmail.com> <24C04070-1AFE-48B9-9715-0F455A0CDB57@gmail.com> Message-ID: <95be1d3b0608130233g5b057275xdc3bdb45f5679a26@mail.gmail.com> Hi Joel, On 8/11/06, Joel Reymont wrote: > I would also like to take advantage of all the APIs that Apple and > Cocoa have to offer, including the ones coming out in Leopard. I just wonder (because I'm not at home with the latest Mac developments), what are these APIs that you want to use - I mean, what do they offer besides what other platforms do? I suppose a link to the relevant docs will be enough, in case you have it available, I don't want to abuse your free time. best regards, Vlad From mikpe@REDACTED Sun Aug 13 12:43:40 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Sun, 13 Aug 2006 12:43:40 +0200 (MEST) Subject: Mac Intel Message-ID: <200608131043.k7DAhepq003236@harpo.it.uu.se> On Sun, 13 Aug 2006 00:02:19 +0100, Joel Reymont wrote: >On Aug 12, 2006, at 10:23 PM, Mikael Pettersson wrote: > >> The fpe-test.c code embedded in erts/configure.in shows how >> to enable and catch floating-point exceptions for a number of >> CPU/OS combinations. > >This is obvious in retrospect but it was a pain in the rear and took >me a day to find out. The Intel Core Duo processors have SSE2 and >these also need to be unmasked for floating-point exceptions to be >trapped. Simply unmasking x87 is not enough. Traditionally 32-bit x86 only used the x87 by default, since SSE2 is a newish addition. Your comment indicates that Apple went directly to the modern world (SSE2) when they started doing x86. Not a problem: just make the existing SSE2 code unconditional and not restricted to 64-bit builds. From mikpe@REDACTED Sun Aug 13 12:43:11 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Sun, 13 Aug 2006 12:43:11 +0200 (MEST) Subject: Mac Intel Message-ID: <200608131043.k7DAhBhS003211@harpo.it.uu.se> On Sat, 12 Aug 2006 15:51:33 -0700, Bob Ippolito wrote: >On 8/12/06, Joel Reymont wrote: >> >> On Aug 12, 2006, at 10:24 PM, Mikael Pettersson wrote: >> >> > "region"? Assuming it's Erlang being unable to allocate more >> > memory, you should run the same test case (big_binary) in BEAM >> > to determine if the problem is HiPE-related or not. >> > >> > (Just c(big_binary) followed by big_binary:test() in the Erlang >> > shell.) >> >> Same result as with HiPE. Trace below. I have 2Gb of physical memory. >> Any tips? >> >> --- >> >> Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] >> >> Eshell V5.5 (abort with ^G) >> 1> c(big_binary). >> {ok,big_binary} >> 2> big_binary:test(). >> beam(28985,0xa000cf60) malloc: *** vm_allocate(size=1074790400) >> failed (error code=3) >> beam(28985,0xa000cf60) malloc: *** error: can't allocate region >> > >This error means that there's not enough space left in the VM to >acquire that much RAM. You should get the same error on PPC unless >they've done something to work around it. > >One common cause of this is attempting to use the realloc() call in >hopes of shrinking a large allocation. That does not ever happen on >Mac OS X. realloc(ptr, N) where N is <= size currently allocated is >always a no-op (no other VM does this "optimization" to my knowledge). >If you download the libc source from Apple and look at the >implementation it's pretty clear that this is the case. What's strange is that we've been running this test on a lowly ppc32 with 256MB ram and OSX 10.3.9 for ages, and it's never failed on us. So it looks like something unique either to OSX 10.4 or the x86 version of OSX. In any case, it's not a HiPE error and should be reported to erlang-bugs. From mikpe@REDACTED Sun Aug 13 12:44:11 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Sun, 13 Aug 2006 12:44:11 +0200 (MEST) Subject: Mac Intel Message-ID: <200608131044.k7DAiB0U003255@harpo.it.uu.se> On Sun, 13 Aug 2006 00:07:09 +0100, Joel Reymont wrote: >On Aug 12, 2006, at 10:23 PM, Mikael Pettersson wrote: > >> The fpe-test.c code embedded in erts/configure.in shows how >> to enable and catch floating-point exceptions for a number of >> CPU/OS combinations. > >Now that I figured this out, I should fix both the test and the >implementation in sys/unix/sys_float.c, correct? Yes. >Also, what is the purpose of the test code in configure? I assume it >sets a flag but the code in sys_float.c seems to duplicate the test >code. The test code is there to tell the system at build-time whether it can rely on fp exceptions or not. The sys_float.c code is the real implementation (only enabled if the test succeeded) which also has to deal with integration in the Erlang runtime system and a few other issues. So they're similar but different. From joelr1@REDACTED Sun Aug 13 14:35:19 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sun, 13 Aug 2006 13:35:19 +0100 Subject: Mac Intel In-Reply-To: <200608131043.k7DAhBhS003211@harpo.it.uu.se> References: <200608131043.k7DAhBhS003211@harpo.it.uu.se> Message-ID: I just noticed a compilation error. memsup.c is part of os_mon so I doubt it has anything to do with the allocation issue. make -f i386-apple-darwin8.7.1/Makefile TYPE=opt gcc -c -o ../priv/obj/i386-apple-darwin8.7.1/memsup.o -g -O2 -I/Users/ joelr/work/erlang/otp_src_R11B-0/erts/i386-apple-darwin8.7.1 -no-cpp- precomp -DHAVE_CONFIG_H memsup.c memsup.c: In function 'get_basic_mem': memsup.c:230: error: 'shiftleft' undeclared (first use in this function) memsup.c:230: error: (Each undeclared identifier is reported only once memsup.c:230: error: for each function it appears in.) make[4]: *** [../priv/obj/i386-apple-darwin8.7.1/memsup.o] Error 1 make[3]: *** [opt] Error 2 On Aug 13, 2006, at 11:43 AM, Mikael Pettersson wrote: > What's strange is that we've been running this test on > a lowly ppc32 with 256MB ram and OSX 10.3.9 for ages, and > it's never failed on us. So it looks like something unique > either to OSX 10.4 or the x86 version of OSX. In any case, > it's not a HiPE error and should be reported to erlang-bugs. -- http://wagerlabs.com/ From yarivvv@REDACTED Sun Aug 13 14:42:51 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Sun, 13 Aug 2006 08:42:51 -0400 Subject: just got reditted... or something Message-ID: <17244f480608130542v13ddc34dl7504b009df285095@mail.gmail.com> Hi, Remember my blog posting from about a month ago comparing Erlang + Yaws vs Ruby on Rails (https://yarivsblog.com/articles/2006/07/11/erlang-yaws-vs-ruby-on-rails)? Well, somebody submitted it to reddit.com and yesterday it made the front page of reddit as well as the del.icio.us popular list (http://del.icio.us/popular/)! Due to the exposure, my blog has been getting thousands of hits the past couple of days. WOOT! :) When I submitted the posting to digg way back when it wasn't a big hit, so it's amusing to see it come back to life. For more of my Erlang ramblings, check out https://yarivsblog.com/articles/tag/erlang. Cheers, Yariv From joelr1@REDACTED Sun Aug 13 15:03:22 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sun, 13 Aug 2006 14:03:22 +0100 Subject: Mac Intel In-Reply-To: <200608131044.k7DAixVx003278@harpo.it.uu.se> References: <200608131044.k7DAixVx003278@harpo.it.uu.se> Message-ID: This is probably a silly question but what is this saying? I can run the tests by hand: 2> hipe:c(bif01). {ok,bif01} 3> bif01:test(). {true,false,ok} 4> c(bif01). {ok,bif01} 5> bif01:test(). {true,false,ok} ------------------------------------------------------------------------ --- Running basic_tests/test.sh --- ------------------------------------------------------------------------ Testing bif01.erl: Eshell V5.5 (abort with ^G) 1> ** 1: syntax error before: ',' ** 1> *** In basic_tests: bif01_new@REDACTED and bif01_old differ!!! 0a1 > {{{emu_result,{true,false,ok}},{native_result,{true,false,ok}}}, {{emu_compile,{ok,bif01}},{native_compile,{ok,bif01}}}} \ No newline at end of file From joelr1@REDACTED Sun Aug 13 15:13:22 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sun, 13 Aug 2006 14:13:22 +0100 Subject: Mac Intel In-Reply-To: References: <200608131044.k7DAixVx003278@harpo.it.uu.se> Message-ID: This is embarrassing, so never mind :-) I was trying to run ./test.sh /usr/local/bin/erl "" "" whereas it should have been "[]" "". On Aug 13, 2006, at 2:03 PM, Joel Reymont wrote: > This is probably a silly question but what is this saying? > > ---------------------------------------------------------------------- > -- > --- Running basic_tests/ > test.sh --- > ---------------------------------------------------------------------- > -- > > Testing bif01.erl: > Eshell V5.5 (abort with ^G) > 1> ** 1: syntax error before: ',' ** > 1> > *** In basic_tests: bif01_new@REDACTED and bif01_old differ!!! > 0a1 > > {{{emu_result,{true,false,ok}},{native_result,{true,false,ok}}}, > {{emu_compile,{ok,bif01}},{native_compile,{ok,bif01}}}} > \ No newline at end of file > > -- http://wagerlabs.com/ From jefcrane@REDACTED Sun Aug 13 22:29:23 2006 From: jefcrane@REDACTED (Jeff Crane) Date: Sun, 13 Aug 2006 13:29:23 -0700 (PDT) Subject: Bad value on output port 'tcp_inet' In-Reply-To: <000001c6bd19$4c842ac0$9b0a10ac@wavenet.lk> Message-ID: <20060813202923.61550.qmail@web31602.mail.mud.yahoo.com> I know this must come up a lot, but I have no idea how I am messing this client up. I connect to a remote scheme listener, but I cant seem to read back the responses. Although the scheme listener catches it, I am getting {error,einval} (from the listener? from the program? from the socket?) and cannot read anything. The listener is a simple echo server. -module(benign_client). %% methods include -export([start/2,test1/2]). %% usage %% benign_client:test("127.0.0.1",41) start(Host,Port) -> spawn(fun() -> test1(Host,Port) end). %% send a single message to the server wait for %% a reply and close the socket test1(Host,Port) -> case gen_tcp:connect(Host, Port, [binary,{packet, 0}]) of {ok, Socket} -> %% let me know about the socket io:format("Socket=~p~n",[Socket]), %% send a string with newline gen_tcp:send(Socket,io:format("hello joe~n")), %% read reply do_recv(Socket), %% I'm done. gen_tcp:close(Socket); Any -> io:format("Error = ~p~n",[Any]), error end. do_recv(Socket) -> case gen_tcp:recv(Socket, 0) of {ok, B} -> io:format("reply tuple:~p~n",[B]); X -> io:format("reply atom:~p~n",[X]) end. %% wait_reply(X) -> %% receive %% X -> %% {value, X} %% after 100000 -> %% timeout %% end. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From matthias@REDACTED Sun Aug 13 22:42:35 2006 From: matthias@REDACTED (Matthias Lang) Date: Sun, 13 Aug 2006 22:42:35 +0200 Subject: Bad value on output port 'tcp_inet' In-Reply-To: <20060813202923.61550.qmail@web31602.mail.mud.yahoo.com> References: <000001c6bd19$4c842ac0$9b0a10ac@wavenet.lk> <20060813202923.61550.qmail@web31602.mail.mud.yahoo.com> Message-ID: <17631.36539.306933.224758@antilipe.corelatus.se> Jeff Crane writes: > gen_tcp:send(Socket,io:format("hello joe~n")), The second argument to gen_tcp:send is supposed to be a list or a binary or an iolist. The return value of io:format is not a list, a binary or an iolist. Maybe you intended to use io_lib:fwrite(). Matthias From joelr1@REDACTED Sun Aug 13 23:45:09 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sun, 13 Aug 2006 22:45:09 +0100 Subject: Mac Intel In-Reply-To: <200608131044.k7DAixVx003278@harpo.it.uu.se> References: <200608131044.k7DAixVx003278@harpo.it.uu.se> Message-ID: <282DC688-8F27-4FE1-868B-A7BDE56359CA@gmail.com> Well, I'm a bit stuck at the moment. The FPU state on Mac OSX Intel has the following fields in it: fp_control_t fpu_fcw; /* x87 FPU control word */ fp_status_t fpu_fsw; /* x87 FPU status word */ uint8_t fpu_ftw; /* x87 FPU tag word */ uint8_t fpu_rsrv1; /* reserved */ uint16_t fpu_fop; /* x87 FPU Opcode */ uint32_t fpu_ip; /* x87 FPU Instruction Pointer offset */ uint16_t fpu_cs; /* x87 FPU Instruction Pointer Selector */ uint16_t fpu_rsrv2; /* reserved */ uint32_t fpu_dp; /* x87 FPU Instruction Operand(Data) Pointer offset */ uint16_t fpu_ds; /* x87 FPU Instruction Operand(Data) Pointer Selector */ uint16_t fpu_rsrv3; /* reserved */ uint32_t fpu_mxcsr; /* MXCSR Register state */ uint32_t fpu_mxcsrmask; /* MXCSR mask */ In fpe_sig_action I'm clearing the state like this: *((unsigned short *)&mc->fs.fpu_fsw) &= ~0xFF; The overflow exception is clearly a SSE2 one since I had to unmask SSE2 exceptions to catch it. My test code never exits so clearly the "SSE2 exceptions leave the pointer at the failed instruction" issue. It also seems that fpu_ip would correspond to mc->gregs[REG_RIP] on Linux. The check "if (mc->fs.fpu_mxcsr & 0x000F) {" passes so I need to skip the SSE2 instruction. Problem is that both fpu_fop and fpu_ip are 0 in the exception handler. I'll see what I can do with assembler. Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Mon Aug 14 02:10:36 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 14 Aug 2006 01:10:36 +0100 Subject: Mac Intel In-Reply-To: <200608131044.k7DAixVx003278@harpo.it.uu.se> References: <200608131044.k7DAixVx003278@harpo.it.uu.se> Message-ID: <9B86E696-9E18-4785-9606-B2D21F5D6593@gmail.com> I thought I would throw together a small program that makes me scratch my head. According to everything I read, FPU state should contain the address of the last floating-point instruction among other things. The instruction pointer (IP) is consistently 0 in the code below, though. Anyone with a Linux box willing to try this? #include typedef struct { unsigned short __control; unsigned short __reserved1; unsigned short __status; unsigned short __reserved2; unsigned int __private3; unsigned int __ip; unsigned short __cs; unsigned short __private5; unsigned int __opaddr; unsigned int __private7; } __fpustate_t; static double x = 0.0; int main(int argc, const char **argv) { __fpustate_t fpu; x = 353.345 * 23423.34; printf("result = %G\n", x); __asm__ __volatile__("fnstenv %0" : "=m"(fpu)); printf("status = %x\n", fpu.__status); printf("control = %x\n", fpu.__control); printf("ip = %x\n", fpu.__ip); printf("cs = %x\n", fpu.__cs); printf("op = %x\n", fpu.__opaddr); } -- http://wagerlabs.com/ From joelr1@REDACTED Mon Aug 14 03:02:36 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 14 Aug 2006 02:02:36 +0100 Subject: Mac Intel In-Reply-To: References: <200608131044.k7DAixVx003278@harpo.it.uu.se> <9B86E696-9E18-4785-9606-B2D21F5D6593@gmail.com> Message-ID: Thanks Chris! I figured out what happened after I sent the message. Apple's gcc optimized everything away and so no floating-point operations were performed. I changed the FPE test code to have char *a = "3.23e133"; char *b = "3.57e257"; double res; void do_fmul(void) { res = atof(a) * atof(b); } and automagically everything worked and I got the IP and everything else. I'm wondering, though, do I deal with just the IP or do I add CS to it as well? On Aug 14, 2006, at 1:43 AM, Chris Double wrote: > On Ubuntu 6.06 on a Pentium 4: > > result = 8.27652E+06 > status = 0 > control = 37f > ip = b7dfb567 > cs = 73 > op = bfb0bd34 > > Chris. -- http://wagerlabs.com/ From joelr1@REDACTED Mon Aug 14 03:38:16 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 14 Aug 2006 02:38:16 +0100 Subject: Mac Intel In-Reply-To: <200608131044.k7DAixVx003278@harpo.it.uu.se> References: <200608131044.k7DAixVx003278@harpo.it.uu.se> Message-ID: <63B8E6A4-8A9D-4A06-A528-89D6D59F24E3@gmail.com> Here are my latest and greatest results from the FPE test program: fpu ip = 1d9c fpu cs = 27 fpu opcode = 55d skip_sse2_insn: unexpected code at 0x1d9c: DD Abort trap fpu opcode is given to me, described as "x87 FPU Opcode". Do I combine IP and CS for an absolute address that skip_sse2_insn can work with and if so how? Is the fpu opcode above of any use to skip_sse2_insn? It doesn't seem to be a valid opcode. Thanks, Joel From joelr1@REDACTED Mon Aug 14 04:17:01 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 14 Aug 2006 03:17:01 +0100 Subject: Mac Intel In-Reply-To: References: <200608131044.k7DAixVx003278@harpo.it.uu.se> <9B86E696-9E18-4785-9606-B2D21F5D6593@gmail.com> Message-ID: <33A387A0-45A3-42D6-AB89-EEFA440C09B5@gmail.com> One last thing... The 0xdd opcode corresponds to fstpl (0xddd8). The FPU IP seems to be pointing to fstpl below, in the dump of do_fmul. I don't understand, though, why mc->fs.fpu_mxcsr & 0x000F is true since fstpl is not a SSE2 instruction. I'm gonna revisit this tomorrow but so far I see that 1) the test program is looping, repeatedly firing exceptions, 2) MXCSR has bits in it set, 3) the IP is not a SSE2 instruction and 4) I clear the FPU state with *((unsigned short *)&mc->fs.fpu_fsw) &= ~0xFF; before exiting the SIGFPE handler. -- void do_fmul(void) { res = atof(a) * atof(b); } Dump of assembler code for function do_fmul: 0x00001d6d : push %ebp 0x00001d6e : mov %esp,%ebp 0x00001d70 : push %ebx 0x00001d71 : sub $0x24,%esp 0x00001d74 : call 0x1ffc <__i686.get_pc_thunk.bx> 0x00001d79 : lea 663(%ebx),%eax 0x00001d7f : mov (%eax),%eax 0x00001d81 : mov %eax,(%esp) 0x00001d84 : call 0x302c 0x00001d89 : fstpl -24(%ebp) 0x00001d8c : lea 667(%ebx),%eax 0x00001d92 : mov (%eax),%eax 0x00001d94 : mov %eax,(%esp) 0x00001d97 : call 0x302c 0x00001d9c : fstpl -16(%ebp) 0x00001d9f : movsd -24(%ebp),%xmm0 0x00001da4 : mulsd -16(%ebp),%xmm0 0x00001da9 : lea 4755(%ebx),%eax 0x00001daf : mov (%eax),%eax 0x00001db1 : movsd %xmm0,(%eax) 0x00001db5 : add $0x24,%esp 0x00001db8 : pop %ebx 0x00001db9 : pop %ebp 0x00001dba : ret End of assembler dump. -- http://wagerlabs.com/ From ok@REDACTED Mon Aug 14 05:15:37 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 14 Aug 2006 15:15:37 +1200 (NZST) Subject: Experimental new layout style for EDoc. Message-ID: <200608140315.k7E3Fb8i172565@atlas.otago.ac.nz> Richard Carlsson wrote: I've been doing some changes to the layout in EDoc and I am now looking for some feedback of the constructive kind. I'm looking at that page in an oldish copy of Netscape, and the thing that strikes me is that about 20% of the window area is dedicated to a list of Modules, which hold no interest to me while I'm looking at the overview page. It's not just that 20% of the area is used this way, the problem is that this is the 20% that it's easiest to scan back to with the eyes and find with the mouse. I am *NOT* saying that this list is useless. On the contrary, when it's wanted, it is wanted a lot. But it *isn't* wanted *all the time*. And it certainly isn't wanted at all by anyone who doesn't yet know what the modules are: why would I be interested in clicking on edoc_parser when I don't *yet* have any reason to believe that there's anything I need to read there? If it's simpler to stick with _some_ navigation bar, it might be useful to have the main section headings for a page there unless/until someone selects a 'modules' view. There is a readability issue. When I look at the page in Mozilla (SPARC/Solaris), the top bar of the main frame is Teal blue, and the word "overview" is a more typical blue, but not really different enough to be easily readable. I'm also interested in hearing about browser compatibility problems that need fixing. I like using Amaya. Unfortunately, Amaya doesn't do frames, Non-frames support is good. From bengt.kleberg@REDACTED Mon Aug 14 07:45:12 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 14 Aug 2006 07:45:12 +0200 Subject: how to represent multi-structure chain relationships In-Reply-To: References: Message-ID: <44E00DE8.5000204@ericsson.com> On 2006-08-12 15:16, Only OpenSource wrote: > Hello > > What is the recommended approach to represent multi-structure chain > relationships in erlang ? > > eg. > CertEnvelope --> CertChain --> Cert Attribute(s) > > In C, one would use a pEnv->pChain->pAttrib and work with the fields. > How does one do it in Erlang ? one way of doing it would be records: -record( cert_chain, { cert_attribute }. -record( cert_envelope, { cert_chain }. you can access the attribute like this: attribute( #cert_envelope(cert_chain=Chain} ) -> attribute( Chain ); attribute( #cert_chain(cert_attribute=Attribute} -> Attribute. and add it like this: attribute_add( #cert_envelope{cert_chain=Chain}=Envelope, Attribute ) -> Envelope#cert_envelope{cert_chain=attribute_add( Chain, Attribute )}; attribute_add( #cert_chain{}=Chain, Attribute ) -> Chain#cert_chain(cert_attribute=Attribute}. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From bengt.kleberg@REDACTED Mon Aug 14 07:50:58 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 14 Aug 2006 07:50:58 +0200 Subject: mapReduce vs erlang In-Reply-To: References: Message-ID: <44E00F42.4040800@ericsson.com> On 2006-08-12 15:13, Only OpenSource wrote: ...deleted > Now that Nutch project has an implementation of mapReduce, > what areas Erlang would be able to make a difference ? > i am having problems understanding your question. it might be only me. but what does it mean? is it: ''what areas of Erlang are different to mapReduce (as implemented by the Nutch project '' bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From Ludovic.Tant@REDACTED Mon Aug 14 08:38:23 2006 From: Ludovic.Tant@REDACTED (Tant Ludovic) Date: Mon, 14 Aug 2006 08:38:23 +0200 Subject: unsubscribe Message-ID: <218D5F31460C4A448097E49A9DC3AD05635324@srv-grp-s07.dev.atos.fr> Ludovic Tant BU TUM - Atos Worldline ludovic.tant@REDACTED Tel.: + 33.(0)3 20 60 82 09 - Fax: +33.(0)3 20 60 83 02 ZI A Rue de la Pointe 59113 SECLIN www.atosworldline.com Atos Worldline is an Atos Origin company: www.atosorigin.com - - - - - - - - - - - - - - - - - - Ce message est strictement confidentiel. Son int?grit? n'est pas assur?e sur Internet. Le contenu de ce message ne peut engager la responsabilit? du groupe Atos Origin. Si vous n'?tes pas destinataire du message, merci d'en avertir imm?diatement l'exp?diteur et de le d?truire. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'exp?diteur ne donne aucune garantie ? cet ?gard et sa responsabilit? ne saurait ?tre recherch?e pour tout dommage r?sultant d'un virus transmis. This e-mail is privileged and may contain confidential information intended only for the person(s) named above. If you receive this e-mail in error, please notify the sender immediately by telephone or return e-mail. Although the sender endeavours to maintain a computer virus free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. -----Message d'origine----- De?: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] De la part de Mikael Pettersson Envoy??: dimanche 13 ao?t 2006 12:44 ??: joelr1@REDACTED; mikpe@REDACTED Cc?: erlang-questions@REDACTED Objet?: Re: Mac Intel On Sun, 13 Aug 2006 00:02:19 +0100, Joel Reymont wrote: >On Aug 12, 2006, at 10:23 PM, Mikael Pettersson wrote: > >> The fpe-test.c code embedded in erts/configure.in shows how >> to enable and catch floating-point exceptions for a number of >> CPU/OS combinations. > >This is obvious in retrospect but it was a pain in the rear and took >me a day to find out. The Intel Core Duo processors have SSE2 and >these also need to be unmasked for floating-point exceptions to be >trapped. Simply unmasking x87 is not enough. Traditionally 32-bit x86 only used the x87 by default, since SSE2 is a newish addition. Your comment indicates that Apple went directly to the modern world (SSE2) when they started doing x86. Not a problem: just make the existing SSE2 code unconditional and not restricted to 64-bit builds. From bjorn@REDACTED Mon Aug 14 09:21:54 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 14 Aug 2006 09:21:54 +0200 Subject: Mac Intel In-Reply-To: <6a36e7290608121551n1c7d30ebq237653708224a000@mail.gmail.com> References: <200608122124.k7CLO04W024771@harpo.it.uu.se> <6a36e7290608121551n1c7d30ebq237653708224a000@mail.gmail.com> Message-ID: "Bob Ippolito" writes: > One common cause of this is attempting to use the realloc() call in > hopes of shrinking a large allocation. That does not ever happen on > Mac OS X. realloc(ptr, N) where N is <= size currently allocated is > always a no-op (no other VM does this "optimization" to my knowledge). > If you download the libc source from Apple and look at the > implementation it's pretty clear that this is the case. > Thanks! That is useful to know. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bjorn@REDACTED Mon Aug 14 09:23:06 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 14 Aug 2006 09:23:06 +0200 Subject: Mac Intel In-Reply-To: References: <200608131043.k7DAhBhS003211@harpo.it.uu.se> Message-ID: That bug will be corrected in R11B-1. /Bjorn Joel Reymont writes: > I just noticed a compilation error. memsup.c is part of os_mon so I > doubt it has anything to do with the allocation issue. > > make -f i386-apple-darwin8.7.1/Makefile TYPE=opt > gcc -c -o ../priv/obj/i386-apple-darwin8.7.1/memsup.o -g -O2 -I/Users/ > joelr/work/erlang/otp_src_R11B-0/erts/i386-apple-darwin8.7.1 -no-cpp- > precomp -DHAVE_CONFIG_H memsup.c > memsup.c: In function 'get_basic_mem': > memsup.c:230: error: 'shiftleft' undeclared (first use in this function) > memsup.c:230: error: (Each undeclared identifier is reported only once > memsup.c:230: error: for each function it appears in.) > make[4]: *** [../priv/obj/i386-apple-darwin8.7.1/memsup.o] Error 1 > make[3]: *** [opt] Error 2 > > On Aug 13, 2006, at 11:43 AM, Mikael Pettersson wrote: > > > What's strange is that we've been running this test on > > a lowly ppc32 with 256MB ram and OSX 10.3.9 for ages, and > > it's never failed on us. So it looks like something unique > > either to OSX 10.4 or the x86 version of OSX. In any case, > > it's not a HiPE error and should be reported to erlang-bugs. > > > -- > http://wagerlabs.com/ > > > > > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From mats.cronqvist@REDACTED Mon Aug 14 10:55:21 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 14 Aug 2006 10:55:21 +0200 Subject: Commercial Mac IDE In-Reply-To: <17244f480608111244g7ac0d8f9u61232fccf00f3308@mail.gmail.com> References: <0D3FC4EF-6BF8-49FF-A978-1E8B92407C43@gmail.com> <95be1d3b0608110936x132800dbsbaae655f6c490d91@mail.gmail.com> <17244f480608111244g7ac0d8f9u61232fccf00f3308@mail.gmail.com> Message-ID: <44E03A79.1050305@ericsson.com> Yariv Sadan wrote: > Isn't a big part or Erlide written in Erlang? Maybe you can use the > Erlide backend and write a Cocoa frontend for it. i would take a look at the distel backend. it has a pretty good debugger interface, among other things. mats From serge@REDACTED Mon Aug 14 13:42:30 2006 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 14 Aug 2006 07:42:30 -0400 Subject: Experimental new layout style for EDoc. In-Reply-To: <44DDE235.2000002@it.uu.se> References: <44DDE235.2000002@it.uu.se> Message-ID: <44E061A6.5090405@hq.idt.net> Richard, I'd like to make a suggestion to apply the patch I sent you in Oct 2006 that creates a menu link to the overview page as the first menu entry on the left panel. Regards, Serge Richard Carlsson wrote: > Folks, > I've been doing some changes to the layout in EDoc > and I am now looking for some feedback of the constructive > kind. (In particular, if you are a stylesheet guru you are > most welcome to improve on my newbie attempts at layout.) > I'm also interested in hearing about browser compatibility > problems that need fixing. > > Here is an example of the new layout: > > http://user.it.uu.se/~richardc/edoc/doc/ > > (The colour scheme is based on the erlang.org site.) > > If I don't hear anything from anybody, the new version > will probably look a lot like the example, so here is > your chance to speak up. Of course, if you like it and > just want to say so, I'd like to hear that as well. > > /Richard > From richardc@REDACTED Mon Aug 14 14:05:46 2006 From: richardc@REDACTED (Richard Carlsson) Date: Mon, 14 Aug 2006 14:05:46 +0200 Subject: Experimental new layout style for EDoc. In-Reply-To: <44E061A6.5090405@hq.idt.net> References: <44DDE235.2000002@it.uu.se> <44E061A6.5090405@hq.idt.net> Message-ID: <44E0671A.7070803@it.uu.se> Serge Aleynikov wrote: > I'd like to make a suggestion to apply the patch I sent you in > Oct 2005 that creates a menu link to the overview page as the > first menu entry on the left panel. I did, sort of, but I thought the link should belong to the navigation bar, and not to the list-of-modules frame. /Richard From serge@REDACTED Mon Aug 14 14:32:38 2006 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 14 Aug 2006 08:32:38 -0400 Subject: Experimental new layout style for EDoc. In-Reply-To: <44E0671A.7070803@it.uu.se> References: <44DDE235.2000002@it.uu.se> <44E061A6.5090405@hq.idt.net> <44E0671A.7070803@it.uu.se> Message-ID: <44E06D66.3060309@hq.idt.net> Ok. Then I'd like to throw in this suggestion. Currently EDOC only allows to include *one* custom documentation file "overview.edoc" whose content is not derived from the application modules. It would be nice to be able to provide a list of such files that may include: - User Guide - Configuration Guide - API etc. In this case the left-side menu frame could be broken into the following parts (somewhat similarly to how Erlang/OTP documentation is organized): - Top level section with links to the "overview" and other supplementary documents - Module menu - Package list/menu (if packages are defined) Regards, Serge P.S. IMHO, having the overview link on the left side is a bit more convenient, as it doesn't require the user to scroll the right panel all the way to the top/bottom in order to see that link. Richard Carlsson wrote: > Serge Aleynikov wrote: >> I'd like to make a suggestion to apply the patch I sent you in >> Oct 2005 that creates a menu link to the overview page as the >> first menu entry on the left panel. > > I did, sort of, but I thought the link should belong to the > navigation bar, and not to the list-of-modules frame. > > /Richard > > From joelr1@REDACTED Mon Aug 14 15:19:26 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 14 Aug 2006 14:19:26 +0100 Subject: HiPE and SIGFPE Message-ID: <902700A0-634F-45A0-9D57-D268062A37FB@gmail.com> Mikael, On Aug 12, 2006, at 11:16 AM, Mikael Pettersson wrote: > Unless you disable floating-point code generation > by passing no_inline_fp to the HiPE compiler, HiPE will generate > code that relies on the floating-point exception mechanisms in the > runtime system. How does HiPE reply on floating-point exceptions? Does this introduce a significant advantage of some sort? I have been looking at the code in sys_float.c for several days now and all it seems to do is recover from the exception. It also seems to signal the FP exception to the current process, is that right? Is this the only purpose of handling SIGFPE? Thanks, Joel -- http://wagerlabs.com/ From luna@REDACTED Mon Aug 14 15:23:43 2006 From: luna@REDACTED (Daniel Luna) Date: Mon, 14 Aug 2006 15:23:43 +0200 (CEST) Subject: Mac Intel In-Reply-To: <200608131043.k7DAhepq003236@harpo.it.uu.se> References: <200608131043.k7DAhepq003236@harpo.it.uu.se> Message-ID: On Sun, 13 Aug 2006, Mikael Pettersson wrote: > On Sun, 13 Aug 2006 00:02:19 +0100, Joel Reymont wrote: >> On Aug 12, 2006, at 10:23 PM, Mikael Pettersson wrote: >>> The fpe-test.c code embedded in erts/configure.in shows how >>> to enable and catch floating-point exceptions for a number of >>> CPU/OS combinations. >> >> This is obvious in retrospect but it was a pain in the rear and took >> me a day to find out. The Intel Core Duo processors have SSE2 and >> these also need to be unmasked for floating-point exceptions to be >> trapped. Simply unmasking x87 is not enough. > > Traditionally 32-bit x86 only used the x87 by default, since > SSE2 is a newish addition. Your comment indicates that Apple > went directly to the modern world (SSE2) when they started > doing x86. Not a problem: just make the existing SSE2 code > unconditional and not restricted to 64-bit builds. Hello Joel, and the rest of the list. I thought I should expand on Mikaels answer. If I remember correctly there is no SSE2 support for 32-bit x86, yet. I had some plans to backport the 64 bit version, but it never happened, and when I look in hipe.erl I see that my old comment is still in there. Line 1391-1392: x86 -> [x87 | Common]; %% XXX: Temporary until x86 has sse2 In theory it is rather simple to get sse2 for the 32-bit x86 though: 1. The code to generate sse2 is already in the 32-bit x86 backend. (This can probably be used out-of-the-box for Intel Mac) 2. One needs to change the exception stack handling, which is kind of easy, except that the gcc-headers didn't have the SSE2 fields when I looked at it the last time. Either one hard codes the offsets by hand, or hopes that gcc have changed the header stuff. Easy, but I was lazy. (This has a lot to do with exception stack handling, and I have no idea how it looks like for the Intel Mac) 3. Change skip_sse2_insn in erts/emulator/sys/unix/sys_float.c to handle 32 bit instructions instead of 64 bit instructions. In particular, the meanings of 0x40 and 0x41 have changed, and maybe some other instruction codes that I don't remember right now. (Easy, but needs to be done with care.) 4. The tricky part! Find some way to detect (at runtime, or at least load time) that the machine doesn't handle SSE2 and fallback to BEAM. Easy, but probably more expensive than the potential gain. The downside of backwards compatibility. If core dumps are ok for an old machine, this step can be skipped. (A no-issue for the Mac Intel) 5. Replace "[x87 | Common]" with "Common" in hipe.erl. That should be it! Joel: I hope that helped. How about fixing sse2 for Linux x86 while you are at it? /Luna -- Daniel Luna | Top reasons that I have a beard: luna@REDACTED | a) Laziness. http://www.update.uu.se/~luna/ | b) I can. Don't look at my homepage (it stinks).| c) I can get away with it. From joelr1@REDACTED Mon Aug 14 15:59:01 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 14 Aug 2006 14:59:01 +0100 Subject: Mac Intel In-Reply-To: References: <200608131043.k7DAhepq003236@harpo.it.uu.se> Message-ID: <2F1AF4F3-DE70-4EC3-8D4E-44D2A4D35B01@gmail.com> On Aug 14, 2006, at 2:23 PM, Daniel Luna wrote: > Line 1391-1392: > x86 -> > [x87 | Common]; %% XXX: Temporary until x86 has sse2 I will look at this a little later, once I can recover from SSE2 exceptions. > 2. One needs to change the exception stack handling, which is kind > of easy, except that the gcc-headers didn't have the SSE2 fields > when I looked at it the last time. Either one hard codes the > offsets by hand, or hopes that gcc have changed the header stuff. > Easy, but I was lazy. (This has a lot to do with exception stack > handling, and I have no idea how it looks like for the Intel Mac) Can you elaborate on this? What headers do you need and what do you need from the headers? > 3. Change skip_sse2_insn in erts/emulator/sys/unix/sys_float.c to > handle 32 bit instructions instead of 64 bit instructions. In > particular, the meanings of 0x40 and 0x41 have changed, and maybe > some other instruction codes that I don't remember right now. I'm finding this very hard to deal with, as you can see tfrom my prior messages. Basically, the SSE2 exception is triggered by the fpe- test program (with proper SSE2 unmasking). The FPU instruction pointer is 0, though, so there's nothing to skip over. If I modify the fpe-test program to use atof when multiplying then the FPU IP is non-zero but the instruction pointed to does not seem to be a SSE2 instruction (fstpl). I'm currently reading the Intel manuals to see how to recover from SSE exceptions. Where can I find more information on the "must skip over SSE2 instructions on x86-64" issue. > 4. The tricky part! Find some way to detect (at runtime, or at > least load time) that the machine doesn't handle SSE2 and fallback > to BEAM. Easy, but probably more expensive than the potential gain. This is possible, actually, and described in the Intel manuals. I'm not concerned with this, though, as it's handled for 64-bit Linux systems and Apple Intel hardware has SSE2. > Joel: I hope that helped. Yes, thanks. I didn't know I had to edit hipe.erl as well. Overall, this has turned out to be a full-blown hacking session and although I learn fast I would appreciate more fast feedback from you guys. Just like your email that I'm replying to ;-). My current outstanding questions: Why trap floating-point exceptions? How did you determined that SSE2 instructions need to be skipped on x86-64? Is this written somewhere? > How about fixing sse2 for Linux x86 while you are at it? I don't have Linux installed on the MacBook and I'm chomping at the bit to finish HiPE and move on to other things like Cocoa bindings, commercial Mac IDE and my trading software ;-). I'll see what I can do as the difference does not seem to be significant. The machine context structure is different (mc->gregs [REG_RIP] vs mc->fs.fpu_ip) but all the information is there. Thanks, Joel -- http://wagerlabs.com/ From Martin.Logan@REDACTED Mon Aug 14 16:49:55 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Mon, 14 Aug 2006 09:49:55 -0500 Subject: Bad value on output port 'tcp_inet' In-Reply-To: <20060813202923.61550.qmail@web31602.mail.mud.yahoo.com> Message-ID: <9CB79C836F98504C81BF082C4291E987792ABB@CHITDSEXC02.tds.corp.cendant.org> You are using io:format to send the atom 'ok' over the wire. io:format writes to stdout. The docs for gen_tcp:send/2 indicate that it accepts the following payload type Packet = [char()] | binary(). Atom is not among them. Try just firing off a string and see if it fixes your problem. Cheers, Martin -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Jeff Crane Sent: Sunday, August 13, 2006 3:29 PM To: erlang-questions@REDACTED Subject: Bad value on output port 'tcp_inet' I know this must come up a lot, but I have no idea how I am messing this client up. I connect to a remote scheme listener, but I cant seem to read back the responses. Although the scheme listener catches it, I am getting {error,einval} (from the listener? from the program? from the socket?) and cannot read anything. The listener is a simple echo server. -module(benign_client). %% methods include -export([start/2,test1/2]). %% usage %% benign_client:test("127.0.0.1",41) start(Host,Port) -> spawn(fun() -> test1(Host,Port) end). %% send a single message to the server wait for %% a reply and close the socket test1(Host,Port) -> case gen_tcp:connect(Host, Port, [binary,{packet, 0}]) of {ok, Socket} -> %% let me know about the socket io:format("Socket=~p~n",[Socket]), %% send a string with newline gen_tcp:send(Socket,io:format("hello joe~n")), %% read reply do_recv(Socket), %% I'm done. gen_tcp:close(Socket); Any -> io:format("Error = ~p~n",[Any]), error end. do_recv(Socket) -> case gen_tcp:recv(Socket, 0) of {ok, B} -> io:format("reply tuple:~p~n",[B]); X -> io:format("reply atom:~p~n",[X]) end. %% wait_reply(X) -> %% receive %% X -> %% {value, X} %% after 100000 -> %% timeout %% end. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From joe.armstrong@REDACTED Mon Aug 14 17:04:28 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Mon, 14 Aug 2006 17:04:28 +0200 Subject: Trap Exit (was Re: is there /dev/null process in Erlang ?) In-Reply-To: <20060721131952.87619.qmail@web38812.mail.mud.yahoo.com> Message-ID: Re: documentation. Status: I am working on a system to replace (I hope) the old SGML documentation. The steps involved are: 1) Convert all sgml documentation to wiki format 2) Write server to render wiki text, allowing - user annotations - versioning - author modifications - multiple output formats (HTML, PDF, ...) 3) Run internally for a while to see if it works 4) Deploy on a public server I'm almost at point 3) All of this is subject to one horrendous constraint. a) *I don't want to break the existing documentation* There are thousands of SGML files to be converted - representing dozens possible hundreds of man-years of work. I want to make the change ONCE and get it right - this is why we do not wish to release the documentation sources - I want to discourage multiple mutations of documentation sources. b) I want a pure erlang-tool chain to process the documentation The existing tool chain involves an SGL parser LaTeX etc. and is difficult to install and maintain. /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of > Thomas Lindgren > Sent: den 21 juli 2006 15:20 > To: erlang-questions@REDACTED > Subject: RE: Trap Exit (was Re: is there /dev/null process in > Erlang ?) > > > > --- "Ulf Wiger (TN/EAB)" > wrote: > > > Joe is working on a erlang-docs-to-wiki project, but it won't be > > mediawiki. It will of course be something much better. ;-) > > Kudos to him, though I honestly wouldn't mind using a > solution that is globally available Right Now :-) And which > is also hosted, and maintained, indefinitely of course. > > My sources (Jocke, that is, one of the original > authors) tell me that the pre-publication format of the > Erlang docs should be fairly straightforward to translate, by > the way. If these sources were made available, Ericsson could > reap the rewards of busy open sourcers working for free. Nice, huh? > > Best, > Thomas > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection > around http://mail.yahoo.com > From joe.armstrong@REDACTED Mon Aug 14 17:04:28 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Mon, 14 Aug 2006 17:04:28 +0200 Subject: Erlang for desktop applications? In-Reply-To: <1154875186.9952.7.camel@cerebellum> Message-ID: Taking a *deep* breath - refreshed after three weeks on holiday *without* a computer! Yes, Erlang could be very good for desktop applications. I the last dozen years, give of take a decade or so, I have implemented several GUI interfaces - non of which were very good. At a certain point in time I always gave up - when I hit an almost impassable barrier that meant I would have to entirely re-write *everything* to make the next step. The approach I liked best was ex11 - this is "suspended" rather than abandoned - ex11 is fine as far as it goes, but the next step involves typography, font rendering etc. I'd like *correct* (or at least beautiful) kerning of the text in menus, nice anti-aliased fonts, alpha blending etc. Basically a merge of the ex11 code with erlguten - this is <>. Having played with just about every free software package for GUIs that I can lay my hands on I'd say that almost all of them suck. The problem is deep. It has to do with the architecture of the GUI systems and how they are layered. Virtually *all* GUIs systems are designed to be used by sequential programming languages, now GUIs are in their nature "parallel" - so there is a semantic mismatch between the GUI architecture and the programming language. To fix this the notion of a callback is used - callbacks are used to provide the illusion of concurrency. With real concurrency the traditional callback view of the world is not needed. The Erlang view is this: Each window is represented by a process To modify a window I sent it a message When things happen in a window I get sent messages The tradition GUI (GTK, wxwindows, etc.) is Each window is represented by an object To modify a window I call a functions When things happen in a window callbacks occur These two ways of thinking about the world are fundamentally different and incompatible. In the Erlang view we have true concurrency, in the tradition GUI view we have the illusion of concurrency provided by callbacks - superficially these are equivalent but because the traditional GUI uses a sequential top-loop and dispatcher the two are very different. One consequence of the sequential call-back approach is that embedded sub-widgets with behaviour become painfully difficult to write. You can just suspend filling in a form here, to go and do something else there... Now the problem with providing an interface to gtk, tk etc (and yes I, know these exist) is that you have to learn and use the gtk, tk etc. programming model in Erlang. If you make a 1:1 correspondence between Erlang and GTK, then you are forced to use the GTK programming model in Erlang - so now you have to program using some weird half-baked programming style involving callbacks that sucketh greatly. Indeed GUI callback programming is so difficult that mere mortals find this impossibly difficult - witness the GUI builders that try to do the job for you. The need for the GUI builders arises from the horrendous mess of callback structures that has to be setup in order to program the simplest of tasks. The complexity of GUI programming is a direct consequence of using a sequential programming language for solving a concurrent problem. Taking another deep breath ...... Now I've got that off my chest ... Next problem: GUI software is not nicely layered - the reason ex11 was *easy* to write was that the layers were clear. The X11 protocol nicely separates the primitives from the libraries Xlib. To implement a decent Erlang GUI I need *only* the low level operations - I don't need buttons, controls, etc. Just the ability to create windows and draw persistent bitmaps in the window - *nothing else* (well a bit more actually). Implementing a graphic system on top of GDK might make a lot of sense, but not GTK (for the reasons above) - BUT GDK and GTK appear to be horribly intertwined. Next problem: Cross-platform???? This I believe is the biggest mistake I've every made regarding GUIs - just believing that cross platform GUIs are possible at all. They truth is cross platform GUIs just do not look good - period end of story. Sure I can make a TK thing run on windows and Linux but it just does not look as good as a native application. Interestingly the only cross platform apps that seems half acceptable are things like Photoshop, openoffice, Smalltalk etc. These do not seem to use native widget sets, but are acceptable anyway since they have outstanding functionality. So I forgive Photoshop, running on windows, for not having native windows GUI controls since the program itself is outstanding. Conclusion: using native widgets only and forget cross platform. I reality "desktop applications" means window applications. Unfortunately, I do most of my development in a Linux environment - the flavour here is irrelevant, today it's ubuntu, yesterday is was red-hat, tomorrow debian, who cares - the point is that it is *not* windows - and I dislike developing in windows BUT and here's the kicker - if I develop an application 98% of my potential users will be running windows. That's why developers (like me) love the idea of "cross platform" - then I can develop on Linux, and deploy on windows. This my friends is an illusion. Once day I must "bite the bullet" and implement a low-level interface from Erlang to the windows API - this is a must for windows desktop applications. /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of > Jacobo Garc?a de Polavieja Aguilera > Sent: den 6 augusti 2006 16:40 > To: erlang-questions@REDACTED > Subject: Erlang for desktop applications? > > Hi everybody: > I am new to functional programming (just some very little > experience with Lisp). I got interested in functional > programming because of the performance related to > multiproccessors or multicore systems. And I got interested > in Erlang over other FP languages because its fame for easy > parallelism management and its performance compared to > Haskell or others. > But, do you see Erlang suitable for developing future (more > than 5 years from now) desktop applications? I know it wasn't > designed for this, and that there are very important actions > like string functions which are slow in Erlang... but then I > also ran into EX11 and similar projects which seem like a > little light for my future purpose. > Could be erlang efficient with desktop related stuff? If not, > could you recommend other functional languages that fit best > that objective? > I'm looking forward to efficiency on future multicore > processors and easy concurrency management. > > Thanks all. > > From joe.armstrong@REDACTED Mon Aug 14 17:04:29 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Mon, 14 Aug 2006 17:04:29 +0200 Subject: server chat with erlang In-Reply-To: <78568af10608091904x78df0ecq5da35591408e81f7@mail.gmail.com> Message-ID: The challenge is to elimiate the servers, making the clients collectivly behaving as a server. /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Ryan Rawson > Sent: den 10 augusti 2006 04:05 > To: Paul Mahon > Cc: widjayy; erlang-questions@REDACTED > Subject: Re: server chat with erlang > > Write yet another irc server. The standard protocol is line > oriented, and you can write a single node very easily. The > challenge will be to write multiple node chat servers. > > -ryan > > > On 8/9/06, Paul Mahon wrote: > > If you just want something simple, you could write the client with > > YAWS so you wouldn't need to use anything but Erlang. > > > > On Wed, 2006-09-08 at 21:31 +0200, widjayy wrote: > > > hi everyone. > > > > > > I want to make a chat with erlang. That's not a great > idea, I know > > > ;) My server will be with erlang, and the client will > connect to it > > > through a web page. But I don't which is the best technology > > > (language, method) to connect to erlang. > > > > > > Thank you for your help. > > > > > > > From joelr1@REDACTED Mon Aug 14 17:33:01 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 14 Aug 2006 16:33:01 +0100 Subject: server chat with erlang In-Reply-To: References: Message-ID: <8E4C3E4B-1F0D-4466-9C0D-2B8625BC947A@gmail.com> I don't think you can completely eliminate the server. You need one for clients to discover each other, keep track of chat rooms, etc. Once clients connect they can proceed to communicate directly. On Aug 14, 2006, at 4:04 PM, Joe Armstrong ((TN/EAB)) wrote: > The challenge is to elimiate the servers, making the clients > collectivly behaving as a server. > > /Joe -- http://wagerlabs.com/ From joelr1@REDACTED Mon Aug 14 17:43:55 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 14 Aug 2006 16:43:55 +0100 Subject: Mac Intel In-Reply-To: References: <200608131043.k7DAhepq003236@harpo.it.uu.se> Message-ID: On Aug 14, 2006, at 2:23 PM, Daniel Luna wrote: > 4. The tricky part! Find some way to detect (at runtime, or at > least load time) that the machine doesn't handle SSE2 and fallback > to BEAM. Easy, but probably more expensive than the potential gain. > The downside of backwards compatibility. If core dumps are ok for > an old machine, this step can be skipped. (A no-issue for the Mac > Intel) According to Intel's manuals: SSE, SSE2 AND SSE3 SYSTEM PROGRAMMING 12.1.2 Checking for SSE/SSE2/SSE3 Extension Support If the processor attempts to execute an unsupported SSE/SSE2/SSE3 instruction, the processor will generate an invalid-opcode exception (#UD). Before an operating system or executive attempts to use SSE/SSE2/SSE3 extensions, it should check that support is present on the processor. To make this check, execute CPUID with an argument of 1 in the EAX register. Make sure: CPUID.1:EDX.SSE[bit 25] = 1 CPUID.1:EDX.SSE2[bit 26] = 1 CPUID.1:ECX.SSE3[bit 0] = 1 -- http://wagerlabs.com/ From matthew@REDACTED Mon Aug 14 17:45:54 2006 From: matthew@REDACTED (Matthew Sackman) Date: Mon, 14 Aug 2006 16:45:54 +0100 Subject: Bad value on output port 'tcp_inet' In-Reply-To: <9CB79C836F98504C81BF082C4291E987792ABB@CHITDSEXC02.tds.corp.cendant.org> References: <20060813202923.61550.qmail@web31602.mail.mud.yahoo.com> <9CB79C836F98504C81BF082C4291E987792ABB@CHITDSEXC02.tds.corp.cendant.org> Message-ID: <20060814154554.GD16150@wellquite.org> On Mon, Aug 14, 2006 at 09:49:55AM -0500, Logan, Martin wrote: > You are using io:format to send the atom 'ok' over the wire. io:format > writes to stdout. The docs for gen_tcp:send/2 indicate that it accepts > the following payload type Packet = [char()] | binary(). Atom is not > among them. Try just firing off a string and see if it fixes your > problem. The documentation is wrong though: gen_tcp:send/2 will actually accept any arbitrary combination of lists, chars and binaries. Which leads me on to ask (apologies for thread hijacking): when constructing binaries, is a new binary actually created or is it just pointer manipulation. The reason for asking is that this: Binary1 = get_a_binary_somehow(...), Binary2 = get_a_binary_somehow(...), gen_tcp:send(Sock, <>), seems to be slower than this: Binary1 = get_a_binary_somehow(...), Binary2 = get_a_binary_somehow(...), gen_tcp:send(Sock, [Binary1, Binary2]), Is this likely? What actually happens in the binary construction? Cheers, Matthew -- Matthew Sackman BOFH excuse #400: We are Microsoft. What you are experiencing is not a problem; it is an undocumented feature. From david.nospam.hopwood@REDACTED Mon Aug 14 17:56:25 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Mon, 14 Aug 2006 16:56:25 +0100 Subject: Mac Intel In-Reply-To: <63B8E6A4-8A9D-4A06-A528-89D6D59F24E3@gmail.com> References: <200608131044.k7DAixVx003278@harpo.it.uu.se> <63B8E6A4-8A9D-4A06-A528-89D6D59F24E3@gmail.com> Message-ID: <44E09D29.4090701@blueyonder.co.uk> Joel Reymont wrote: > Here are my latest and greatest results from the FPE test program: > > fpu ip = 1d9c > fpu cs = 27 > fpu opcode = 55d > skip_sse2_insn: unexpected code at 0x1d9c: DD > Abort trap > > fpu opcode is given to me, described as "x87 FPU Opcode". > > Do I combine IP and CS for an absolute address that skip_sse2_insn can > work with and if so how? Use something like the _farpeek* functions from (I don't actually know whether those implementations are correct or will work with current gcc, but they don't look too far out. It would be safer to add an %fs clobber constraint to the asm, though -- see the gcc docs or Google for how to do that.) -- David Hopwood From joelr1@REDACTED Mon Aug 14 18:31:34 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 14 Aug 2006 17:31:34 +0100 Subject: Mac Intel In-Reply-To: <44E09D29.4090701@blueyonder.co.uk> References: <200608131044.k7DAixVx003278@harpo.it.uu.se> <63B8E6A4-8A9D-4A06-A528-89D6D59F24E3@gmail.com> <44E09D29.4090701@blueyonder.co.uk> Message-ID: <99BBC962-46B8-4A58-A530-F26450B62EBA@gmail.com> The part that baffles me is this: double a = 3.23e133; double b = 3.57e257; double res; void do_fmul(void) { res = a * b; } Running the above results in the following output. Note that FPU instruction pointer is 0. The SSE2 exception reported is overflow. mxcsr & 0x000F = 8 fpu ip = 0 fpu cs = 0 fpu opcode = 0 Now if a and b are set using atof("3.23e133") and atof("3.57e257") then I get this: mxcsr & 0x000F = 8 fpu ip = 1ec1 fpu cs = 27 fpu opcode = 518 I can't figure this out. Of course it does not solve the issue of advancing over SSE2 instructions either. From david.nospam.hopwood@REDACTED Mon Aug 14 18:51:25 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Mon, 14 Aug 2006 17:51:25 +0100 Subject: Mac Intel In-Reply-To: <99BBC962-46B8-4A58-A530-F26450B62EBA@gmail.com> References: <200608131044.k7DAixVx003278@harpo.it.uu.se> <63B8E6A4-8A9D-4A06-A528-89D6D59F24E3@gmail.com> <44E09D29.4090701@blueyonder.co.uk> <99BBC962-46B8-4A58-A530-F26450B62EBA@gmail.com> Message-ID: <44E0AA0D.4060904@blueyonder.co.uk> Joel Reymont wrote: > The part that baffles me is this: > > double a = 3.23e133; > double b = 3.57e257; > double res; > > void do_fmul(void) > { > res = a * b; > } > > Running the above results in the following output. Note that FPU > instruction pointer is 0. The SSE2 exception reported is overflow. > > mxcsr & 0x000F = 8 > fpu ip = 0 > fpu cs = 0 > fpu opcode = 0 > > Now if a and b are set using atof("3.23e133") and atof("3.57e257") then > I get this: > > mxcsr & 0x000F = 8 > fpu ip = 1ec1 > fpu cs = 27 > fpu opcode = 518 > > I can't figure this out. Of course it does not solve the issue of > advancing over SSE2 instructions either. Just a guess: maybe in the first case, gcc is doing the multiplication at compile-time, seeing that it causes an SSE2 exception, and generating code that only causes the exception. (Why is that a useful optimization? I don't know. Not doing constant folding for expressions that cause an exception would be more sensible.) If there are ways to generate an SSE2 exception that don't set the ip, cs, and opcode fields, then these fields are inherently unreliable for the purpose they're being used for here (to skip over whatever caused the exception). This could be classed as a gcc bug, I suppose, but that doesn't really help you. Sorry. -- David Hopwood From rpettit@REDACTED Mon Aug 14 20:09:58 2006 From: rpettit@REDACTED (Rick Pettit) Date: Mon, 14 Aug 2006 13:09:58 -0500 Subject: server chat with erlang In-Reply-To: <8E4C3E4B-1F0D-4466-9C0D-2B8625BC947A@gmail.com> References: <8E4C3E4B-1F0D-4466-9C0D-2B8625BC947A@gmail.com> Message-ID: <20060814180958.GD17573@vailsys.com> On Mon, Aug 14, 2006 at 04:33:01PM +0100, Joel Reymont wrote: > I don't think you can completely eliminate the server. You need one > for clients to discover each other, keep track of chat rooms, etc. > Once clients connect they can proceed to communicate directly. Can't clients use pg2 groups or something like them to avoid having a separate server to play role of lookup service? -Rick > On Aug 14, 2006, at 4:04 PM, Joe Armstrong ((TN/EAB)) wrote: > > >The challenge is to elimiate the servers, making the clients > >collectivly behaving as a server. > > > >/Joe > > -- > http://wagerlabs.com/ > > > > > From dot@REDACTED Mon Aug 14 20:23:15 2006 From: dot@REDACTED (Tony Finch) Date: Mon, 14 Aug 2006 19:23:15 +0100 Subject: server chat with erlang In-Reply-To: <8E4C3E4B-1F0D-4466-9C0D-2B8625BC947A@gmail.com> References: <8E4C3E4B-1F0D-4466-9C0D-2B8625BC947A@gmail.com> Message-ID: On Mon, 14 Aug 2006, Joel Reymont wrote: > On Aug 14, 2006, at 4:04 PM, Joe Armstrong ((TN/EAB)) wrote: > > > The challenge is to elimiate the servers, making the clients > > collectivly behaving as a server. > > I don't think you can completely eliminate the server. You need one for > clients to discover each other, keep track of chat rooms, etc. Once clients > connect they can proceed to communicate directly. Also you need servers for finding out information about a user when they are offline (e.g. their vcard, their custom offline presence message "on leave, back in september") and for storing messages that were sent to you when you were offline. A client-server model is also much more managable, e.g. if you are providing a company IM service, and it makes firewalls much less of a problem. The main reason that SIP is a horrific abortion is that it tries to be peer-to-peer and had client-server bolted on when they realised p2p wouldn't give them all the bells and whistles. Tony. -- f.a.n.finch http://dotat.at/ FISHER: WEST OR NORTHWEST 4 OR 5 BECOMING VARIABLE 3 OR 4. FAIR. MODERATE OR GOOD. From joelr1@REDACTED Mon Aug 14 20:58:48 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 14 Aug 2006 19:58:48 +0100 Subject: server chat with erlang In-Reply-To: <20060814180958.GD17573@vailsys.com> References: <8E4C3E4B-1F0D-4466-9C0D-2B8625BC947A@gmail.com> <20060814180958.GD17573@vailsys.com> Message-ID: <3F1C8CA0-EE69-4324-9895-8A69FE997C94@gmail.com> On Aug 14, 2006, at 7:09 PM, Rick Pettit wrote: > Can't clients use pg2 groups or something like them to avoid having a > separate server to play role of lookup service? My understanding is that this will only work once the nodes are connected and you need a lookup service to connect the nodes in the first place. -- http://wagerlabs.com/ From richardc@REDACTED Mon Aug 14 21:24:48 2006 From: richardc@REDACTED (Richard Carlsson) Date: Mon, 14 Aug 2006 21:24:48 +0200 Subject: server chat with erlang In-Reply-To: <3F1C8CA0-EE69-4324-9895-8A69FE997C94@gmail.com> References: <8E4C3E4B-1F0D-4466-9C0D-2B8625BC947A@gmail.com> <20060814180958.GD17573@vailsys.com> <3F1C8CA0-EE69-4324-9895-8A69FE997C94@gmail.com> Message-ID: <44E0CE00.2060902@it.uu.se> Joel Reymont wrote: > > On Aug 14, 2006, at 7:09 PM, Rick Pettit wrote: > >> Can't clients use pg2 groups or something like them to avoid having a >> separate server to play role of lookup service? > > My understanding is that this will only work once the nodes are > connected and you need a lookup service to connect the nodes in the > first place. Yup. In the course I used to teach (distributed programming), I had this as the standard assignment for a 5-week course: 1. Write a simple name server in Erlang. 2. Write a fault tolerant group library in Erlang, then implement a chat client with a gs-based GUI, that uses the group library as a back end and the name server for discovery. The specs are still available online (in Swedish, though): http://www.it.uu.se/edu/course/homepage/distrprogmet/ht04/uppgift-1.shtml http://www.it.uu.se/edu/course/homepage/distrprogmet/ht04/uppgift-2.shtml For an almost-useless translation, try using Systran Swedish-to-English on those URLs: http://www.systransoft.com/index.html /Richard From joelr1@REDACTED Mon Aug 14 23:34:36 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 14 Aug 2006 22:34:36 +0100 Subject: Venture capitalists revisit networking firms Message-ID: <9F8A0211-C586-466C-AC4E-BCB3BC36F16C@gmail.com> http://tinyurl.com/hphau From joelr1@REDACTED Tue Aug 15 02:47:37 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 01:47:37 +0100 Subject: Mac Intel In-Reply-To: <44E0AA0D.4060904@blueyonder.co.uk> References: <200608131044.k7DAixVx003278@harpo.it.uu.se> <63B8E6A4-8A9D-4A06-A528-89D6D59F24E3@gmail.com> <44E09D29.4090701@blueyonder.co.uk> <99BBC962-46B8-4A58-A530-F26450B62EBA@gmail.com> <44E0AA0D.4060904@blueyonder.co.uk> Message-ID: <0D8F7D1C-BEDA-4B11-B89A-953A22580224@gmail.com> On Aug 14, 2006, at 5:51 PM, David Hopwood wrote: > If there are ways to generate an SSE2 exception that don't set the > ip, cs, and opcode fields, then these fields are inherently unreliable > for the purpose they're being used for here (to skip over whatever > caused the exception). Mea culpa! Mea maxima culpa! /Sounds of flogging/ I'm an idiot but at least I know more about assembler and the IA32 architecture than I new last week :-). Anyway, the instruction pointer on Mac Intel resides in mc->ss.eip and it's being properly set. My test program outputs: eip = 1e0c, cs = 27 gdb dissassemble of do_fmul (res = a * b) shows: 0x00001e0c : mulsd %xmm1,%xmm0 so everything is fair and square. Now, I just have to update the code that skips over SSE2 instructions and I'll be good! -- http://wagerlabs.com/ From ok@REDACTED Tue Aug 15 02:50:37 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 15 Aug 2006 12:50:37 +1200 (NZST) Subject: Erlang for desktop applications? Message-ID: <200608150050.k7F0obCL182880@atlas.otago.ac.nz> "Jacobo G. Polavieja" wrote: That's my main point of view and what drove me to consider a better language for programming concurrency. I truly believe is going to be like that in the future. So, do you see Erlang is the/one of the most best positioned to take advantage of that future fact? People have been designing concurrent languages for years. Burroughs Algol, back in the 60s, had coroutines and concurrent processes (and even ran on true multiprocessor hardware in the 70s). Simula 67, famed for introducing Object-Oriented Programming, was also important for offering (simulated) concurrency. We've had Concurrent Pascal, Concurrent C, C++ originally came with a Simula-inspired threads package, Ada, Occam, you name it. Of the many ways to look at these languages, one of them seems to me to be the most useful for our present topic: - is the language "business as usual PLUS threads" (like Java) - or is it designed from the ground up to support correct concurrent programming? This is not quite the same question as "is thread support integrated into the language" (as it is in Ada) or "is thread support pretty much a bolt- on-the-side library" (as it arguably is in Java, and if you don't believe me, browse around in java.util.concurrent some time -- I'm sure tentacled monstrosities from the outer darkness were involved somewhere there). The question is rather "was the language so designed that it is easy for a compiler or other tool to PROVE that a wide range of concurrency problems simply cannot occur?" Concurrent Pascal and Occam (up to Occam 2.1, which was the last Occam I really understood) have rather strong limitations, precisely to make it easier to reason about concurrent programs and make it obvious that many problems (notably one thread trampling on another's data, but there are others) couldn't possibly exist in a program. While Java looks to have concurrency support built in, it is fatally easy for two threads to trample on the same data, and it is fatally easy to _think_ you are protected from this when you aren't. In contrast, in Ada it's really quite hard to get yourself into that kind of trouble, and if you stick to the "safe" features of the language, I don't think you can. C# and the whole .NET framework falls into the same "mostly business as usual" bucket as Java. Make no mistake. People have developed useful concurrent applications using Java and C# and will continue to do so. (Especially if they are savvy enough to use verification tools like ESC/Java2.) BUT "mostly business as usual" language make it easy for people to keep on thinking and programming sequentially. This makes it harder for them to exploit multicore machines and easier to make mistakes. many "actions" taken in desktop apps that are very concurrent or just concurrent. I mean... all I can think about that could benefit from Erlang's concurrency is a mail application (to retrieve mail), P2P application (interconnect users)... which are very "networky" (where Erlang is strong). I'm not really sure what a "desktop app" is. I suppose it includes - e-mail - word processor - spread-sheet - data base - web browser - drawing/diagramming tool - photo display, capture, and edit - music playing, recording, and editing - video playing, recording, and editing - games - virtual pets - telephone and fax Concurrency can be found in surprising places. For example, consider searching for a word or phrase in a word processor. Chop the document up into N pieces and have each of N processors look in its piece. Only really useful for large documents. But change your perspective: what if a document isn't something nailed to a particular machine? Think about SubEthaEdit, for example. Collaborative document editing over the web. That's a desktop application right now. Data base? The epitome of concurrency. Photo rendering and editing? Lots of this is embarrassingly parallel. Games? Thread per player, at least. If it's in a forest, think of simulating the motion of each tree at the same time (not all trees are the same). Think of route planning. All sorts of stuff. I've got an application right now, document clustering, where I could *easily* exploit 16 processors if I had them. I just don't now if a chat program, or a web browser, or a file manager, or a document viewer, a game, a multimedia player and all the usual desktop applications need lots of concurrency and can benefit from Erlang or if it would be better to use some thing like C# with the little concurrency it implements. I think I'll have to learn Erlang and finish my PThreads studying, make typical desktop programs with both... and then compare :-|. Ocaml is a candidate too from what I've heard. Ah, there's your mistake. TYPICAL desktop programs already exist! We already have more word processors than the market really wants. What we need are NOVEL desktop programs; ones that do useful and interesting things that don't have saturated markets, and that exploit the new machines to do things that nobody ever thought of before. If I could think of such things, I wouldn't be scraping a slender living as a University lecturer. OK, here's an idea, but I don't think it's a good enough idea to make money. Think about someone writing the Great New Zealand Novel on their computer. They have a local copy of the Wikipedia (we do have such a copy here, as part of our information retrieval work) and everything from Project Gutenberg (I don't have that, but I could if I wanted to). While they type, the computer is "mentally" chopping their novel up into "topical" pieces and adding links to relevant stuff in the Wikipedia and Project Gutenberg. (We have a masters student who we hope will work on adding Wikipedia links; this is stuff that can be done *now*.) The thing here is that the actual text editing doesn't need much computing power. What we _really_ need here is fault isolation. The information gleaning stuff is *helpful* to the author but not essential; the one absolutely crucial thing is that if the helpful stuff crashes, it MUST NOT take the main stuff with it. Oh, so here's another thing that's happening at the same time. The changes are being backed up over the local (wire or wireless) net to one or more other machines in a P2P sort of way, while the work being done on those machines is similarly being backed up to this machine. Again, this is *today's* technology. (I warned you I wasn't much good at thinking up novel stuff.) Look for opportunities concurrency and you will find them. Look for opportunities for fault isolation and you will find them. From joelr1@REDACTED Tue Aug 15 03:24:31 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 02:24:31 +0100 Subject: Mac Intel In-Reply-To: References: <200608131043.k7DAhepq003236@harpo.it.uu.se> Message-ID: <81DEA9C0-65E6-402C-A4BE-FF208A4EA8F6@gmail.com> Daniel and Mikael, Could you please give me some insight into skip_sse2_insn? I'm bombing out on MULSD which has the opcode of F2 0F 59 /r. In the code below what's the significance of "if( (opcode & 0xF0) == 0x40 )"? It does not seem to apply to me as my opcode at that point is 0x0F but I still need to move forward to 0x59. opcode = *pc++; switch( opcode ) { case 0x66: case 0xF2: case 0xF3: opcode = *pc++; } if( (opcode & 0xF0) == 0x40 ) opcode = *pc++; do { switch( opcode ) { case 0x0F: opcode = *pc++; switch( opcode ) { case 0x2A: /* cvtpi2ps,cvtsi2sd,cvtsi2ss /r */ case 0x2C: /* cvttpd2pi,cvttps2pi,cvttsd2si,cvtss2si /r */ case 0x2D: /* cvtpd2pi,cvtps2pi,cvtsd2si,cvtss2si /r */ case 0x2E: /* ucomisd,ucomiss /r */ case 0x2F: /* comisd,comiss /r */ case 0x51: /* sqrtpd,sqrtps,sqrtsd,sqrtss /r */ case 0x58: /* addpd,addps,addsd,addss /r */ case 0x59: /* mulpd,mulps,mulsd,mulss /r */ Thanks, Joel From yarivvv@REDACTED Tue Aug 15 04:01:39 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 14 Aug 2006 22:01:39 -0400 Subject: announcing Smerl: Simple Erlang Metaprogramming library Message-ID: <17244f480608141901g27f17da2ke2ebc3236f58cb1f@mail.gmail.com> Hi, Digging through Ulf Wiger's rdbms_codegen.erl module in Jungerl, I discovered Erlang's wonderful capabilities for runtime code generation and manipulation. As great as these capabilities are, I think they are far from obvious to the non-expert programmer. That's why I created Smerl, simple library for (runtime) Erlang metaprogramming. To read more about Smerl and to download it, visit my blog: https://yarivsblog.com/articles/2006/08/14/smerl-simple-metaprogramming-for-erlang. Here's a direct download link: https://yarivsblog.com/files/smerl.erl Here's a quick example of how to use Smerl: test_smerl() -> C1 = smerl:new(foo). {ok, C2} = smerl:add_func(C1, "bar() -> 1 + 1."). smerl:compile(C2), foo:bar(). % returns 2 Smerl also lets you work with abstract Erlang forms. The 3rd line of the above example can be rewritten as {ok,C2} = smerl:add_func(C1, {function,1,bar,0, [{clause,1,[],[], [{op,1,'+',{integer,1,1},{integer,1,1}}]}]). Smerl allows you to both create new module in runtime and to manipulate existing modules by adding and removing functions. If you have any comments, problems or suggestions, please let me know! Best regards, Yariv From joelr1@REDACTED Tue Aug 15 04:08:30 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 03:08:30 +0100 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <44E0AA0D.4060904@blueyonder.co.uk> References: <200608131044.k7DAixVx003278@harpo.it.uu.se> <63B8E6A4-8A9D-4A06-A528-89D6D59F24E3@gmail.com> <44E09D29.4090701@blueyonder.co.uk> <99BBC962-46B8-4A58-A530-F26450B62EBA@gmail.com> <44E0AA0D.4060904@blueyonder.co.uk> Message-ID: <26EA0C99-A3AC-4467-8442-1C6118E5AFDA@gmail.com> What do I do now? The only test that fails is esmb in compiler_tests. ./testsuite.sh /usr/local ======================================================================== There was an old /tmp/hipe_test_res.joelr... removing There was an old /tmp/hipe_test_log.joelr... removing Testing /usr/local Compiler options: [o2] The log will be left in /tmp/hipe_test_log.joelr ERL_COMPILER_OPTIONS=[nowarn_shadow_vars] Recompile: test PASSED HiPE testsuite for: /usr/local on junior.local ======================================================================== This appears to fail in esmb, log further down... ./testsuite.sh --only compiler_tests /usr/local ======================================================================== There was an old /tmp/hipe_test_log.joelr... removing Testing /usr/local Compiler options: [o2] * Only running: compiler_tests The log will be left in /tmp/hipe_test_log.joelr ERL_COMPILER_OPTIONS=[nowarn_shadow_vars] Recompile: test ------------------------------------------------------------------------ compiler_tests/esmb differ!!! ------------------------------------------------------------------------ ***FAILED testsuite for: /usr/local on junior.local see /tmp/hipe_test_res.joelr-06.08.15-03:05:55 for more details. ======================================================================== cat /tmp/hipe_test_res.joelr-06.08.15-03:05:55 compiler_tests/esmb differ!!! From yarivvv@REDACTED Tue Aug 15 04:09:35 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 14 Aug 2006 22:09:35 -0400 Subject: announcing Smerl: Simple Erlang Metaprogramming library In-Reply-To: <17244f480608141901g27f17da2ke2ebc3236f58cb1f@mail.gmail.com> References: <17244f480608141901g27f17da2ke2ebc3236f58cb1f@mail.gmail.com> Message-ID: <17244f480608141909qc01c7cfy853f503181f8bd8c@mail.gmail.com> Wow, this is awesome -- I messed up the title. It's actually Smerl: Simple Metaprogramming for Erlang :) On 8/14/06, Yariv Sadan wrote: > Hi, > > Digging through Ulf Wiger's rdbms_codegen.erl module in Jungerl, I > discovered Erlang's wonderful capabilities for runtime code generation > and manipulation. As great as these capabilities are, I think they are > far from obvious to the non-expert programmer. That's why I created > Smerl, simple library for (runtime) Erlang metaprogramming. > > To read more about Smerl and to download it, visit my blog: > https://yarivsblog.com/articles/2006/08/14/smerl-simple-metaprogramming-for-erlang. > > Here's a direct download link: > https://yarivsblog.com/files/smerl.erl > > Here's a quick example of how to use Smerl: > > test_smerl() -> > C1 = smerl:new(foo). > {ok, C2} = smerl:add_func(C1, "bar() -> 1 + 1."). > smerl:compile(C2), > foo:bar(). % returns 2 > > Smerl also lets you work with abstract Erlang forms. The 3rd line of > the above example can be rewritten as > > {ok,C2} = smerl:add_func(C1, {function,1,bar,0, > [{clause,1,[],[], > [{op,1,'+',{integer,1,1},{integer,1,1}}]}]). > > Smerl allows you to both create new module in runtime and to > manipulate existing modules by adding and removing functions. > > If you have any comments, problems or suggestions, please let me know! > > Best regards, > Yariv > From joelr1@REDACTED Tue Aug 15 04:27:08 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 03:27:08 +0100 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <26EA0C99-A3AC-4467-8442-1C6118E5AFDA@gmail.com> References: <200608131044.k7DAixVx003278@harpo.it.uu.se> <63B8E6A4-8A9D-4A06-A528-89D6D59F24E3@gmail.com> <44E09D29.4090701@blueyonder.co.uk> <99BBC962-46B8-4A58-A530-F26450B62EBA@gmail.com> <44E0AA0D.4060904@blueyonder.co.uk> <26EA0C99-A3AC-4467-8442-1C6118E5AFDA@gmail.com> Message-ID: <6A771BEB-7EF9-4FC7-A113-D4448E09F979@gmail.com> Here's the problem with the esmb test: 4> esmb:test(). Compiling esmb with opts [core,o2] ...Illegal instruction How do I go about debugging this? Thanks, Joel From yarivvv@REDACTED Tue Aug 15 05:18:02 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 14 Aug 2006 23:18:02 -0400 Subject: announcing Smerl: Simple Erlang Metaprogramming library In-Reply-To: <17244f480608141901g27f17da2ke2ebc3236f58cb1f@mail.gmail.com> References: <17244f480608141901g27f17da2ke2ebc3236f58cb1f@mail.gmail.com> Message-ID: <17244f480608142018vda573dcq8fc5639945b5afb8@mail.gmail.com> FYI, I just added a function called has_func for querying whether a module has a given function. Enjoy Yariv On 8/14/06, Yariv Sadan wrote: > Hi, > > Digging through Ulf Wiger's rdbms_codegen.erl module in Jungerl, I > discovered Erlang's wonderful capabilities for runtime code generation > and manipulation. As great as these capabilities are, I think they are > far from obvious to the non-expert programmer. That's why I created > Smerl, simple library for (runtime) Erlang metaprogramming. > > To read more about Smerl and to download it, visit my blog: > https://yarivsblog.com/articles/2006/08/14/smerl-simple-metaprogramming-for-erlang. > > Here's a direct download link: > https://yarivsblog.com/files/smerl.erl > > Here's a quick example of how to use Smerl: > > test_smerl() -> > C1 = smerl:new(foo). > {ok, C2} = smerl:add_func(C1, "bar() -> 1 + 1."). > smerl:compile(C2), > foo:bar(). % returns 2 > > Smerl also lets you work with abstract Erlang forms. The 3rd line of > the above example can be rewritten as > > {ok,C2} = smerl:add_func(C1, {function,1,bar,0, > [{clause,1,[],[], > [{op,1,'+',{integer,1,1},{integer,1,1}}]}]). > > Smerl allows you to both create new module in runtime and to > manipulate existing modules by adding and removing functions. > > If you have any comments, problems or suggestions, please let me know! > > Best regards, > Yariv > From ryanobjc@REDACTED Tue Aug 15 06:15:23 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Mon, 14 Aug 2006 21:15:23 -0700 Subject: announcing Smerl: Simple Erlang Metaprogramming library In-Reply-To: <17244f480608142018vda573dcq8fc5639945b5afb8@mail.gmail.com> References: <17244f480608141901g27f17da2ke2ebc3236f58cb1f@mail.gmail.com> <17244f480608142018vda573dcq8fc5639945b5afb8@mail.gmail.com> Message-ID: <78568af10608142115j678c4afdr7068d57413a8dc3b@mail.gmail.com> is there a svn interface for the jungerl code? -ryan On 8/14/06, Yariv Sadan wrote: > FYI, I just added a function called has_func for querying whether a > module has a given function. > > Enjoy > > Yariv > > On 8/14/06, Yariv Sadan wrote: > > Hi, > > > > Digging through Ulf Wiger's rdbms_codegen.erl module in Jungerl, I > > discovered Erlang's wonderful capabilities for runtime code generation > > and manipulation. As great as these capabilities are, I think they are > > far from obvious to the non-expert programmer. That's why I created > > Smerl, simple library for (runtime) Erlang metaprogramming. > > > > To read more about Smerl and to download it, visit my blog: > > https://yarivsblog.com/articles/2006/08/14/smerl-simple-metaprogramming-for-erlang. > > > > Here's a direct download link: > > https://yarivsblog.com/files/smerl.erl > > > > Here's a quick example of how to use Smerl: > > > > test_smerl() -> > > C1 = smerl:new(foo). > > {ok, C2} = smerl:add_func(C1, "bar() -> 1 + 1."). > > smerl:compile(C2), > > foo:bar(). % returns 2 > > > > Smerl also lets you work with abstract Erlang forms. The 3rd line of > > the above example can be rewritten as > > > > {ok,C2} = smerl:add_func(C1, {function,1,bar,0, > > [{clause,1,[],[], > > [{op,1,'+',{integer,1,1},{integer,1,1}}]}]). > > > > Smerl allows you to both create new module in runtime and to > > manipulate existing modules by adding and removing functions. > > > > If you have any comments, problems or suggestions, please let me know! > > > > Best regards, > > Yariv > > > From yarivvv@REDACTED Tue Aug 15 06:25:57 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 15 Aug 2006 00:25:57 -0400 Subject: announcing Smerl: Simple Erlang Metaprogramming library In-Reply-To: <78568af10608142115j678c4afdr7068d57413a8dc3b@mail.gmail.com> References: <17244f480608141901g27f17da2ke2ebc3236f58cb1f@mail.gmail.com> <17244f480608142018vda573dcq8fc5639945b5afb8@mail.gmail.com> <78568af10608142115j678c4afdr7068d57413a8dc3b@mail.gmail.com> Message-ID: <17244f480608142125tb57682aw12228f60c7faf7be@mail.gmail.com> You mean the original rdbms_codegen module? You can see it here: http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/rdbms/src/rdbms_codegen.erl?revision=1.1&view=markup On 8/15/06, Ryan Rawson wrote: > is there a svn interface for the jungerl code? > > -ryan > > > On 8/14/06, Yariv Sadan wrote: > > FYI, I just added a function called has_func for querying whether a > > module has a given function. > > > > Enjoy > > > > Yariv > > > > On 8/14/06, Yariv Sadan wrote: > > > Hi, > > > > > > Digging through Ulf Wiger's rdbms_codegen.erl module in Jungerl, I > > > discovered Erlang's wonderful capabilities for runtime code generation > > > and manipulation. As great as these capabilities are, I think they are > > > far from obvious to the non-expert programmer. That's why I created > > > Smerl, simple library for (runtime) Erlang metaprogramming. > > > > > > To read more about Smerl and to download it, visit my blog: > > > https://yarivsblog.com/articles/2006/08/14/smerl-simple-metaprogramming-for-erlang. > > > > > > Here's a direct download link: > > > https://yarivsblog.com/files/smerl.erl > > > > > > Here's a quick example of how to use Smerl: > > > > > > test_smerl() -> > > > C1 = smerl:new(foo). > > > {ok, C2} = smerl:add_func(C1, "bar() -> 1 + 1."). > > > smerl:compile(C2), > > > foo:bar(). % returns 2 > > > > > > Smerl also lets you work with abstract Erlang forms. The 3rd line of > > > the above example can be rewritten as > > > > > > {ok,C2} = smerl:add_func(C1, {function,1,bar,0, > > > [{clause,1,[],[], > > > [{op,1,'+',{integer,1,1},{integer,1,1}}]}]). > > > > > > Smerl allows you to both create new module in runtime and to > > > manipulate existing modules by adding and removing functions. > > > > > > If you have any comments, problems or suggestions, please let me know! > > > > > > Best regards, > > > Yariv > > > > > > From mikpe@REDACTED Tue Aug 15 08:50:11 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 15 Aug 2006 08:50:11 +0200 (MEST) Subject: HiPE and SIGFPE Message-ID: <200608150650.k7F6oBJB010291@harpo.it.uu.se> On Mon, 14 Aug 2006 14:19:26 +0100, Joel Reymont wrote: >> Unless you disable floating-point code generation >> by passing no_inline_fp to the HiPE compiler, HiPE will generate >> code that relies on the floating-point exception mechanisms in the >> runtime system. > >How does HiPE reply on floating-point exceptions? Does this introduce >a significant advantage of some sort? FP values in Erlang must always be finite, that is, infinities and not-a-numbers are not allowed. To implement this BEAM includes a runtime check at the end of each FP operation, to signal badarith in case of FP errors. Several years ago BEAM started to optimise FP operations more seriously. One of the optimisations was to group FP operations into blocks, which allowed intermediate results to remain untagged without having to be stored in newly allocated FP terms (boxed). FP exceptions enables a further optimisation in these blocks. When an FP exception occurs, a flag is set to record this fact. If the flag is set at the end of a block of FP operations, we know that some intermediate operation failed, and we signal badarith. The optimisation is that we don't have to perform a finiteness check after each operation, since the hardware does that for us. So far this is about BEAM. The relationship to HiPE is that since all major platforms supported by HiPE also support FP exceptions, we make that a requirement on those platforms rather than an option. The no_inline_fp HiPE compiler option avoids this requirement, at the expense of disabling _all_ FP optimisations. >I have been looking at the code in sys_float.c for several days now >and all it seems to do is recover from the exception. It also seems >to signal the FP exception to the current process, is that right? Is >this the only purpose of handling SIGFPE? Yes. The exception handler sets the flag that will be inspected at the end of the current FP block, and then does whatever is necessary to resume the application. That's all. From mikpe@REDACTED Tue Aug 15 08:49:41 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 15 Aug 2006 08:49:41 +0200 (MEST) Subject: Mac Intel Message-ID: <200608150649.k7F6nfrP010279@harpo.it.uu.se> On Mon, 14 Aug 2006 15:23:43 +0200 (CEST), Daniel Luna wrote: >In theory it is rather simple to get sse2 for the 32-bit x86 though: > >1. The code to generate sse2 is already in the 32-bit x86 backend. (This >can probably be used out-of-the-box for Intel Mac) > >2. One needs to change the exception stack handling, which is kind of >easy, except that the gcc-headers didn't have the SSE2 fields when I >looked at it the last time. Either one hard codes the offsets by hand, or >hopes that gcc have changed the header stuff. Easy, but I was lazy. (This >has a lot to do with exception stack handling, and I have no idea how it >looks like for the Intel Mac) > >3. Change skip_sse2_insn in erts/emulator/sys/unix/sys_float.c to handle >32 bit instructions instead of 64 bit instructions. In particular, the >meanings of 0x40 and 0x41 have changed, and maybe some other instruction >codes that I don't remember right now. (Easy, but needs to be done with >care.) > >4. The tricky part! Find some way to detect (at runtime, or at least load >time) that the machine doesn't handle SSE2 and fallback to BEAM. Easy, but >probably more expensive than the potential gain. The downside of backwards >compatibility. If core dumps are ok for an old machine, this step can be >skipped. (A no-issue for the Mac Intel) > >5. Replace "[x87 | Common]" with "Common" in hipe.erl. > >That should be it! > >Joel: I hope that helped. How about fixing sse2 for Linux x86 while you >are at it? I don't think this approach is either necessary or very desirable. First, HiPE and BEAM are largely independent with regard to how they perform floating-point computations. For instance, HiPE can use x87 while BEAM is using SSE2. The only requirement is that the runtime system's fp exception code is capable of handling both instruction sets. (And it is on x86-64.) So HiPE needn't switch to using SSE2 just because the C compiler used to compile BEAM did so. Second, since SSE2 isn't universally available on x86-32, switching to it on x86-32 would require runtime tests or compile-time options, either of which would complicate the system. Third, the main performance gain comes from inlining fp operations at all (and having working fp exceptions). For the small fp blocks typically seen in Erlang code, the incremental gain going from x87 to SSE2 would be small to negligible. So in my opinion only item (3) in Daniel's list needs to be done. /Mikael From mikpe@REDACTED Tue Aug 15 08:50:41 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 15 Aug 2006 08:50:41 +0200 (MEST) Subject: Mac Intel Message-ID: <200608150650.k7F6ofqE010303@harpo.it.uu.se> On Mon, 14 Aug 2006 03:17:01 +0100, Joel Reymont wrote: >One last thing... > >The 0xdd opcode corresponds to fstpl (0xddd8). The FPU IP seems to be >pointing to fstpl below, in the dump of do_fmul. I don't understand, >though, why mc->fs.fpu_mxcsr & 0x000F is true since fstpl is not a >SSE2 instruction. > >I'm gonna revisit this tomorrow but so far I see that 1) the test >program is looping, repeatedly firing exceptions, 2) MXCSR has bits >in it set, 3) the IP is not a SSE2 instruction and 4) I clear the FPU >state with *((unsigned short *)&mc->fs.fpu_fsw) &= ~0xFF; before >exiting the SIGFPE handler. > >-- > >void do_fmul(void) >{ > res = atof(a) * atof(b); >} > >Dump of assembler code for function do_fmul: >0x00001d6d : push %ebp >0x00001d6e : mov %esp,%ebp >0x00001d70 : push %ebx >0x00001d71 : sub $0x24,%esp >0x00001d74 : call 0x1ffc <__i686.get_pc_thunk.bx> >0x00001d79 : lea 663(%ebx),%eax >0x00001d7f : mov (%eax),%eax >0x00001d81 : mov %eax,(%esp) >0x00001d84 : call 0x302c >0x00001d89 : fstpl -24(%ebp) >0x00001d8c : lea 667(%ebx),%eax >0x00001d92 : mov (%eax),%eax >0x00001d94 : mov %eax,(%esp) >0x00001d97 : call 0x302c >0x00001d9c : fstpl -16(%ebp) >0x00001d9f : movsd -24(%ebp),%xmm0 >0x00001da4 : mulsd -16(%ebp),%xmm0 >0x00001da9 : lea 4755(%ebx),%eax >0x00001daf : mov (%eax),%eax >0x00001db1 : movsd %xmm0,(%eax) >0x00001db5 : add $0x24,%esp >0x00001db8 : pop %ebx >0x00001db9 : pop %ebp >0x00001dba : ret I strongly suspect that you're looking at the wrong parts of the ucontext/mcontext/whatever that gets passed to the SIGFPE handler. In particular, what you want to look at is the application's current EIP, not some FP IP embedded in the FP state. (And the FP IP is x87-only, it's unrelated to SSE2.) There should be a group of 8 or 16 general-purpose (integer) registers somewhere in the context structure, together with some flags and the EIP. Note: the code above shows that Apple hasn't converted completely to SSE2. Clearly atof() returns its value on top of the x87 stack, then the code moves that value via memory to the SSE2 registers before performing an SSE2 multiply. I suspect that their calling conventions stipulate x87 usage for binary compatibility, while the compiler has been configured to generate code for a modern SSE2-capable CPU by default. From joe.armstrong@REDACTED Tue Aug 15 09:28:55 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Tue, 15 Aug 2006 09:28:55 +0200 Subject: server chat with erlang In-Reply-To: <8E4C3E4B-1F0D-4466-9C0D-2B8625BC947A@gmail.com> Message-ID: Yes - actually a hybrid architecture is probably best - pure P2P is difficult - a fast central server can help a lot. Imagine a 3-tire architecture a - servers (say 3 of these) b - super nodes c - clients a) keeps an updated list of all known super-nodes clients can query servers for a list of all known super nodes b) super nodes - are on-lien for a long time and accept incoming connections c) nodes are behind firewalls Suppose we have an irc group called #erlang A client wishes to join #erlang 1) it fetches the list of supernodes from the server suppose this is IP1, IP2, IP3 2) it finds out which of these machines IP1, .. IPn is "responsible" for the #erlang group How, we compuer the "closest# machine Compute K1 = md5(IP1) mod 2^32 K2 = md5(IP2) mod 2^32 etc. Imagine these as points in a circle mod^32. Compute J = md5(#erlang) mod 2^32 This also lies on this circle. Now find the closest point. Compute abs(Ki - J) = Di forall i in 1..n The value of i which minimises Di is the required machine with Ip address IPi call the closest machine M 3) Client sends a "join #erlang" message to M M will now either: - create a new process to represent #erlang - of connect the incoming client to a #erlang group From now on M is the master machine for #erlang Failures M fails. All clients notice this and try to re-connect Optimisations cache the server lists etc. Notes Partitioning might occur - if a new super node joins at a point near to a super node for some group, then existing group members an new member might arrive at different super nodes. To avoid this the super nodes should periodically check that they are in-fact the responsible node for the groups that they think they are controlling. > -----Original Message----- > From: Joel Reymont [mailto:joelr1@REDACTED] > Sent: den 14 augusti 2006 17:33 > To: Joe Armstrong (TN/EAB) > Cc: Erlang Questions > Subject: Re: server chat with erlang > > I don't think you can completely eliminate the server. You > need one for clients to discover each other, keep track of > chat rooms, etc. > Once clients connect they can proceed to communicate directly. > > On Aug 14, 2006, at 4:04 PM, Joe Armstrong ((TN/EAB)) wrote: > > > The challenge is to elimiate the servers, making the clients > > collectivly behaving as a server. > > > > /Joe > > -- > http://wagerlabs.com/ > > > > > > From tobez@REDACTED Tue Aug 15 09:43:47 2006 From: tobez@REDACTED (Anton Berezin) Date: Tue, 15 Aug 2006 09:43:47 +0200 Subject: HiPE and SIGFPE In-Reply-To: <200608150650.k7F6oBJB010291@harpo.it.uu.se> References: <200608150650.k7F6oBJB010291@harpo.it.uu.se> Message-ID: <20060815074347.GA36676@heechee.tobez.org> On Tue, Aug 15, 2006 at 08:50:11AM +0200, Mikael Pettersson wrote: > >I have been looking at the code in sys_float.c for several days now > >and all it seems to do is recover from the exception. It also seems > >to signal the FP exception to the current process, is that right? Is > >this the only purpose of handling SIGFPE? > > Yes. The exception handler sets the flag that will be inspected at > the end of the current FP block, and then does whatever is necessary > to resume the application. That's all. On a related note, there seems to be something wrong with FP exception handling code on amd64 (I am using FreeBSD port of Erlang, r11b0). Basically, 1/0. just hangs eating 100% CPU. It produces an exception, as expected, on i386. Is there more information you might want to debug the problem? \Anton. -- We're going for 'working' here. 'clean' is for people with skills... -- Flemming Jacobsen From heinrich@REDACTED Tue Aug 15 09:57:45 2006 From: heinrich@REDACTED (Heinrich Venter) Date: Tue, 15 Aug 2006 09:57:45 +0200 Subject: Forced erl_crash.dump Message-ID: Hi all Is there a way to force a running node to write a erl_crash.dump without actually killing the node? I am trying to figuire out what processes are running in a live node. Any suggestions how best to do this? Thanks -]-[einrich From mikpe@REDACTED Tue Aug 15 10:05:48 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 15 Aug 2006 10:05:48 +0200 (MEST) Subject: Mac Intel Message-ID: <200608150805.k7F85mcn011660@harpo.it.uu.se> On Tue, 15 Aug 2006 02:24:31 +0100, Joel Reymont wrote: > Could you please give me some insight into skip_sse2_insn? > > I'm bombing out on MULSD which has the opcode of F2 0F 59 /r. > > In the code below what's the significance of "if( (opcode & 0xF0) == > 0x40 )"? It does not seem to apply to me as my opcode at that point > is 0x0F but I still need to move forward to 0x59. > > opcode = *pc++; > switch( opcode ) { > case 0x66: case 0xF2: case 0xF3: > opcode = *pc++; > } > if( (opcode & 0xF0) == 0x40 ) > opcode = *pc++; It recognises and skips the x86-64 REX prefix. All you need to do is to bracket those two lines with #ifdef __x86_64__ ... #endif. From bjorn@REDACTED Tue Aug 15 10:06:57 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 15 Aug 2006 10:06:57 +0200 Subject: Forced erl_crash.dump In-Reply-To: References: Message-ID: No. Writing of a crash dump is destructive, so it can only be done when the emulator is going to terminate. /Bjorn "Heinrich Venter" writes: > Hi all > > Is there a way to force a running node to write a erl_crash.dump without > actually killing the node? > I am trying to figuire out what processes are running in a live node. > Any suggestions how best to do this? > > Thanks > > -]-[einrich > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From mikpe@REDACTED Tue Aug 15 10:12:06 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 15 Aug 2006 10:12:06 +0200 (MEST) Subject: Victory? (was Re: Mac Intel) Message-ID: <200608150812.k7F8C6fm011788@harpo.it.uu.se> On Tue, 15 Aug 2006 03:27:08 +0100, Joel Reymont wrote: > Here's the problem with the esmb test: > > 4> esmb:test(). > Compiling esmb with opts [core,o2] ...Illegal instruction > > How do I go about debugging this? Run erlang under gdb. Starting the beam runtime system under gdb is a PITA (needs several environment variables and command line options normally set by the erl wrapper). An alternative is to use "gdb --pid " to attach to beam after it has started. Finally, you could hack in a SIGILL signal handler and have it print EIP and the surrounding object code. From mikpe@REDACTED Tue Aug 15 10:17:20 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 15 Aug 2006 10:17:20 +0200 (MEST) Subject: HiPE and SIGFPE Message-ID: <200608150817.k7F8HKsq011903@harpo.it.uu.se> On Tue, 15 Aug 2006 09:43:47 +0200, Anton Berezin wrote: > On a related note, there seems to be something wrong with FP exception > handling code on amd64 (I am using FreeBSD port of Erlang, r11b0). > Basically, > > 1/0. > > just hangs eating 100% CPU. It produces an exception, as expected, on i386. > > Is there more information you might want to debug the problem? The FP exception handling code has not been ported to *BSD. In particular, the SIGFPE handler will default to a naive and apparently inadequate version. That it works on i386 is just luck. Switch to Linux or Solaris, or find someone willing & capable to do the port. From hans.bolinder@REDACTED Tue Aug 15 10:21:32 2006 From: hans.bolinder@REDACTED (Hans Bolinder) Date: Tue, 15 Aug 2006 10:21:32 +0200 Subject: dets with Mnesia question In-Reply-To: <17244f480607200620m5e82c3dftaa1da6dd3b477fb6@mail.gmail.com> References: <17244f480607200620m5e82c3dftaa1da6dd3b477fb6@mail.gmail.com> Message-ID: <17633.33804.853420.402304@gargle.gargle.HOWL> > My question is, would it be possible to shorten the repair time by > modifing the dets startup procedure such that Mnesia could "inform" it > of exactly which records need to be cleaned up and what their real > values should be? If the VM crashes the space management information (kept in RAM only) is lost. To recreate it a scan of the whole file is required. Best regards, Hans Bolinder, Erlang/OTP From thomasl_erlang@REDACTED Tue Aug 15 10:22:34 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 15 Aug 2006 01:22:34 -0700 (PDT) Subject: Forced erl_crash.dump In-Reply-To: Message-ID: <20060815082234.57459.qmail@web38815.mail.mud.yahoo.com> --- Heinrich Venter wrote: > I am trying to figuire out what processes are > running in a live node. > Any suggestions how best to do this? Try erlang:processes/0 and/or erlang:process_info/{1,2}. (Depending on what you need to know.) E.g., [ erlang:process_info(PID) || PID <- erlang:processes() ] Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From thomasl_erlang@REDACTED Tue Aug 15 10:37:37 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 15 Aug 2006 01:37:37 -0700 (PDT) Subject: HiPE and SIGFPE In-Reply-To: <200608150650.k7F6oBJB010291@harpo.it.uu.se> Message-ID: <20060815083737.72226.qmail@web38806.mail.mud.yahoo.com> --- Mikael Pettersson wrote: > FP values in Erlang must always be finite, that is, > infinities > and not-a-numbers are not allowed. To implement this > BEAM includes > a runtime check at the end of each FP operation, to > signal badarith > in case of FP errors. As an aside, I'm not at all convinced that this was the right design choice for Erlang FP. Implementation aside, this choice also makes it "challenging" to provide IEEE 754 compliance, something which is occasionally required. Supersize the irony since the underlying hardware as a rule already does (or close enough). Thanks for the interesting discussion on the ins and outs of fp, by the way. Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From mats.cronqvist@REDACTED Tue Aug 15 12:02:16 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Tue, 15 Aug 2006 12:02:16 +0200 Subject: Forced erl_crash.dump In-Reply-To: References: Message-ID: <44E19BA8.50008@ericsson.com> Heinrich Venter wrote: > Hi all > > Is there a way to force a running node to write a erl_crash.dump without > actually killing the node? > I am trying to figuire out what processes are running in a live node. > Any suggestions how best to do this? assuming by "running" you mean which processes are using reductions, and that you're working in the shell, this should work; define some trivial funs; PI = fun(P,T)-> try element(2,process_info(P,T)) catch _:_ -> [] end end. I = fun()-> [{P,PI(P,reductions)} || P <- processes()] end. F = fun(G,[_X,_X|T],O) -> G(G,T,O); (G,[{P,R1},{P,R2}|T],O) -> G(G,T,[{R2-R1,P,PI(P,initial_call),PI(P,registered_name)}|O]);(_,[],O) -> lists:sublist(lists:reverse(lists:sort(O)),20); (G,[_|T],O) -> G(G,T,O) end. GO = fun(T) -> X=I(), timer:sleep(T), F(F,lists:merge(X,I()),[]) end. run GO(1000). [{1450,<0.216.0>,{proc_lib,init_p,5},cpu_sup}, {1072,<0.60.0>,{net_kernel,spawn_func,6},prfTarg}, {238,<0.61.0>,{erlang,apply,2},[]}, {56,<0.577.0>,{inet_tcp_dist,do_accept,6},[]}, {50,<0.47.0>,{inet_tcp_dist,do_accept,6},[]}, {20,<0.22.0>,{proc_lib,init_p,5},net_kernel}, {13,<0.214.0>,{proc_lib,init_p,5},memsup}, {6,<0.24.0>,{net_kernel,ticker,2},[]}] the arg of GO/1 is the tick in ms. output is a list of {RedsLastTick,Pid,InitialCall,RegisteredName}. if your system has many thousands of processes, don't try this:> mats From joelr1@REDACTED Tue Aug 15 12:15:05 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 11:15:05 +0100 Subject: HiPE and SIGFPE In-Reply-To: <20060815074347.GA36676@heechee.tobez.org> References: <200608150650.k7F6oBJB010291@harpo.it.uu.se> <20060815074347.GA36676@heechee.tobez.org> Message-ID: <7FE96453-C97C-4C0A-9196-7887ADFA9E91@gmail.com> I saw this happening when the SSE2 instruction wasn't being skipped. The exception flags are cleared and the FPU evaluates the same instruction again. I don't have Linux/AMD64 to fix this. On Aug 15, 2006, at 8:43 AM, Anton Berezin wrote: > On a related note, there seems to be something wrong with FP exception > handling code on amd64 (I am using FreeBSD port of Erlang, r11b0). > Basically, > > 1/0. > > just hangs eating 100% CPU. It produces an exception, as expected, > on i386. > > Is there more information you might want to debug the problem? > > \Anton. -- http://wagerlabs.com/ From joelr1@REDACTED Tue Aug 15 12:19:46 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 11:19:46 +0100 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <200608150812.k7F8C6fm011788@harpo.it.uu.se> References: <200608150812.k7F8C6fm011788@harpo.it.uu.se> Message-ID: Does this tell you anything? I'm digging further. Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/ operand. 0x000a4702 in hipe_bifs_get_hrvtime_0 (A__p=0x12dbc94) at hipe/ hipe_bif1.c:893 893 f.fd = get_hrvtime(); -- http://wagerlabs.com/ From joelr1@REDACTED Tue Aug 15 12:30:26 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 11:30:26 +0100 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <200608150812.k7F8C6fm011788@harpo.it.uu.se> References: <200608150812.k7F8C6fm011788@harpo.it.uu.se> Message-ID: It's crashing on this apparently. 0x000a4702 : movapd %xmm0,-56(%ebp) According to the movapd description: 66 0F 28 /r MOVAPD xmm1, xmm2/m128 Move packed double-precision floating-point values from xmm2/m128 to xmm1. 66 0F 29 /r MOVAPD xmm2/m128, xmm1 Move packed double-precision floating-point values from xmm1 to xmm2/ m128. So unless I'm mistaken, movapd shouldn't have been used with -56(% ebp), correct? Is there something wrong with HiPE code generation? --- Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/ operand. 0x000a4702 in hipe_bifs_get_hrvtime_0 (A__p=0x12dbc94) at hipe/ hipe_bif1.c:893 893 f.fd = get_hrvtime(); (gdb) disas Dump of assembler code for function hipe_bifs_get_hrvtime_0: 0x000a46b8 : push %ebp 0x000a46b9 : mov %esp,%ebp 0x000a46bb : push %ebx 0x000a46bc : sub $0x44,%esp 0x000a46bf : mov 8(%ebp),%ebx 0x000a46c2 : movl $0x0,12(%esp) 0x000a46ca : movl $0x0,8(%esp) 0x000a46d2 : movl $0x0,4(%esp) 0x000a46da : lea -12(%ebp),%eax 0x000a46dd : mov %eax,(%esp) 0x000a46e0 : call 0x45669 0x000a46e5 : movd -12(%ebp),%xmm1 0x000a46ea : pxor %xmm0,%xmm0 0x000a46ee : punpckldq %xmm1,%xmm0 0x000a46f2 : punpckldq 903040,%xmm0 0x000a46fa : subpd 903056,%xmm0 0x000a4702 : movapd %xmm0,-56(%ebp) -- http://wagerlabs.com/ From mats.cronqvist@REDACTED Tue Aug 15 12:34:59 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Tue, 15 Aug 2006 12:34:59 +0200 Subject: Erlang for desktop applications? In-Reply-To: References: Message-ID: <44E1A353.2090300@ericsson.com> Joe Armstrong (TN/EAB) wrote: [...] > Now the problem with providing an interface to gtk, tk etc (and yes I, know these exist) > is that you have to learn and use the gtk, tk etc. programming model in Erlang. not really. > If you make a 1:1 correspondence between Erlang and GTK, then you are forced to use the GTK > programming model in Erlang - so now you have to program using some weird half-baked > programming style involving callbacks that sucketh greatly. but you don't have to "make a 1:1 correspondence". gtkNode (with which i'm most familiar) exposes less than half of the GTK API, and no callbacks whatsoever. on the erlang side, everything's done through message passing. not that there's not a great deal of suckiness, like you say caused mainly by the C-iness of (in this case) GTK. > Indeed GUI callback programming is so difficult that mere mortals find this > impossibly difficult - witness the GUI builders that try to do the job for you. > The need for the GUI builders arises from the horrendous mess of callback structures > that has to be setup in order to program the simplest of tasks. a GUI builder is a must regardless of the callback structure. a fancy GUI is a very complicated thing (no matter what programming model you're using), and so you need a powerful tool to design one. > The complexity of GUI programming is a direct consequence of using a sequential programming > language for solving a concurrent problem. GUI programming is pretty complicated, because GUIs are complicated. concurrency is not really the main problem (how often do you really want to press two buttons at the same time?). as i see it, the complexity is caused by two things; solving ANY complicated problem in C/C++ will typically generate suckiness C/C++ is particularly bad at event-driven programming. > Cross-platform???? > This I believe is the biggest mistake I've every made regarding GUIs - just believing > that cross platform GUIs are possible at all. > They truth is cross platform GUIs just do not look good - period end of story. well... the desktop apps i use on my wife's windozer are thunderbird, firefox and the gimp. all cross-platform (GTK). and they DO look good. and of course, using a browser (or something like the konfabulator) as the gui is cross-platform. mats From mikpe@REDACTED Tue Aug 15 13:20:20 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 15 Aug 2006 13:20:20 +0200 (MEST) Subject: Victory? (was Re: Mac Intel) Message-ID: <200608151120.k7FBKK8C015607@harpo.it.uu.se> On Tue, 15 Aug 2006 11:30:26 +0100, Joel Reymont wrote: > It's crashing on this apparently. > > 0x000a4702 : movapd %xmm0,-56(%ebp) > > According to the movapd description: > > 66 0F 28 /r MOVAPD xmm1, xmm2/m128 > Move packed double-precision floating-point values from xmm2/m128 to > xmm1. > > 66 0F 29 /r MOVAPD xmm2/m128, xmm1 > Move packed double-precision floating-point values from xmm1 to xmm2/ > m128. > > So unless I'm mistaken, movapd shouldn't have been used with -56(% > ebp), correct? Incorrect. xmm2/m128 means xmm register or 128-bit memory location. These instructions move values between registers or between registers and memory. > Is there something wrong with HiPE code generation? This is in the runtime system, compiled from C and assembly code. > Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/ > operand. > 0x000a4702 in hipe_bifs_get_hrvtime_0 (A__p=0x12dbc94) at hipe/ > hipe_bif1.c:893 > 893 f.fd = get_hrvtime(); > (gdb) disas > Dump of assembler code for function hipe_bifs_get_hrvtime_0: > 0x000a46b8 : push %ebp > 0x000a46b9 : mov %esp,%ebp > 0x000a46bb : push %ebx > 0x000a46bc : sub $0x44,%esp > 0x000a46bf : mov 8(%ebp),%ebx > 0x000a46c2 : movl $0x0,12(%esp) > 0x000a46ca : movl $0x0,8(%esp) > 0x000a46d2 : movl $0x0,4(%esp) > 0x000a46da : lea -12(%ebp),%eax > 0x000a46dd : mov %eax,(%esp) > 0x000a46e0 : call 0x45669 > > 0x000a46e5 : movd -12(%ebp),%xmm1 > 0x000a46ea : pxor %xmm0,%xmm0 > 0x000a46ee : punpckldq %xmm1,%xmm0 > 0x000a46f2 : punpckldq 903040,%xmm0 > 0x000a46fa : subpd 903056,%xmm0 > 0x000a4702 : movapd %xmm0,-56(%ebp) However, modapd will fail with a general protection fault if the memory operand isn't 16-byte aligned. Here's my theory: since this is x86-32, and x86-32 hasn't supported SSE2 until now, we haven't even attempted to make the C runtime stack 16-byte aligned. On x86-64 we do this in hipe_amd64_glue.S. The BIF wrappers in hipe_amd64_bifs.m4 haven't had to care because on x86-64 we pass all BIF parameters in registers, so calling a BIF doesn't affect the C stack's alignment. On x86-32 things are more difficult. It does not suffice to 16-byte align the C stack in hipe_x86_glue.S, because the BIF wrappers will push varying number of parameters on it, causing it to become misaligned. It's difficult to know in advance if a BIF will require 16-byte alignment or not, so we need a general solution. One solution could be to change every BIF wrapper to start by adjusting ESP so that the final ESP after pushing the parameters is 16-byte aligned. This would however add one instruction to most BIF wrappers. Another solution is to change hipe_x86_glue.S to create an aligned C stack frame with a suitably large parameter area preallocated at the bottom of the frame. Then the BIF wrappers can be rewritten to MOVE the parameters to the bottom of the frame instead of PUSHing the parameters, and to omit the ESP adjustment to POP the parameters after the call. This approach also has the advantage of allowing more instruction-level parallelism, is a recommended practice in AMD's optimisation manual. All in all I think this is the best solution. For now, just hack hipe_bifs_get_hrvtime_0 to return make_small(0) instead of calling get_hrvtime(). From ulf.wiger@REDACTED Tue Aug 15 13:23:10 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Tue, 15 Aug 2006 13:23:10 +0200 Subject: dets with Mnesia question In-Reply-To: <17633.33804.853420.402304@gargle.gargle.HOWL> Message-ID: Perhaps one could implement an 'audit' mode where dets writes space management info to a disk_log file per dets file. /Ulf W > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Hans Bolinder > Sent: den 15 augusti 2006 10:22 > To: erlang-questions@REDACTED > Subject: Re: dets with Mnesia question > > > My question is, would it be possible to shorten the repair time by > > modifing the dets startup procedure such that Mnesia could > "inform" it > > of exactly which records need to be cleaned up and what their real > > values should be? > > If the VM crashes the space management information (kept in > RAM only) is lost. To recreate it a scan of the whole file is > required. > > Best regards, > > Hans Bolinder, Erlang/OTP > From joelr1@REDACTED Tue Aug 15 13:28:58 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 12:28:58 +0100 Subject: Victory? (was Re: Mac Intel) In-Reply-To: References: <200608150812.k7F8C6fm011788@harpo.it.uu.se> Message-ID: <892E8FF4-3885-4DB4-AE3D-8454AB46924C@gmail.com> On a second thought, this has nothing to do with HiPE code generation. I think it's either a bug in gcc (unlikely?) or an alignment/operand size problem. On Aug 15, 2006, at 11:30 AM, Joel Reymont wrote: > It's crashing on this apparently. > > 0x000a4702 : movapd %xmm0,-56(%ebp) The code below has a number of things that need to be investigated such as FLOAT_SIZE_OBJECT, make_float and PUT_DOUBLE. Full disassembler dump of hipe_bifs_get_hrvtime_0 is at the end. The bug is clearly in this block of code and my hunch is that it somehow corresponds to PUT_DOUBLE. What do you think? 0x000a46e0 : call 0x45669 0x000a46e5 : movd -12(%ebp),%xmm1 0x000a46ea : pxor %xmm0,%xmm0 0x000a46ee : punpckldq %xmm1,%xmm0 0x000a46f2 : punpckldq 903040,%xmm0 0x000a46fa : subpd 903056,%xmm0 0x000a4702 : movapd %xmm0,-56(%ebp) 0x000a4707 : movapd %xmm0,%xmm2 0x000a470b : movhpd %xmm0,-56(%ebp) 0x000a4710 : addpd -56(%ebp),%xmm2 0x000a4715 : movapd %xmm2,-56(%ebp) 0x000a471a : fldl -56(%ebp) 0x000a471d : fstpl -32(%ebp) hipe_bif1.c: BIF_RETTYPE hipe_bifs_get_hrvtime_0(BIF_ALIST_0) { Eterm *hp; Eterm res; FloatDef f; if( !hrvtime_is_started() ) { start_hrvtime(); if( !hrvtime_is_started() ) BIF_ERROR(BIF_P, BADARG); } f.fd = get_hrvtime(); hp = HAlloc(BIF_P, FLOAT_SIZE_OBJECT); res = make_float(hp); PUT_DOUBLE(f, hp); BIF_RET(res); } erl_term.h: /* Float definition for byte and word access */ typedef double ieee754_8; typedef union float_def { ieee754_8 fd; byte fb[sizeof(ieee754_8)]; Uint16 fs[sizeof(ieee754_8) / sizeof(Uint16)]; Uint32 fw[sizeof(ieee754_8) / sizeof(Uint32)]; #ifdef ARCH_64 Uint fdw; #endif } FloatDef; #ifdef ARCH_64 #define GET_DOUBLE(x, f) (f).fdw = *(float_val(x)+1) #define PUT_DOUBLE(f, x) *(x) = HEADER_FLONUM, \ *((x)+1) = (f).fdw #define GET_DOUBLE_DATA(p, f) (f).fdw = *((Uint *) (p)) #define PUT_DOUBLE_DATA(f,p) *((Uint *) (p)) = (f).fdw #else #define GET_DOUBLE(x, f) (f).fw[0] = *(float_val(x)+1), \ (f).fw[1] = *(float_val(x)+2) #define PUT_DOUBLE(f, x) *(x) = HEADER_FLONUM, \ *((x)+1) = (f).fw[0], \ *((x)+2) = (f).fw[1] #define GET_DOUBLE_DATA(p, f) (f).fw[0] = *((Uint *) (p)),\ (f).fw[1] = *(((Uint *) (p))+1) #define PUT_DOUBLE_DATA(f,p) *((Uint *) (p)) = (f).fw[0],\ *(((Uint *) (p))+1) = (f).fw[1] #endif #define DOUBLE_DATA_WORDS (sizeof(ieee754_8)/sizeof(Eterm)) #define FLOAT_SIZE_OBJECT (DOUBLE_DATA_WORDS+1) Full disassembler dump of hipe_bifs_get_hrvtime_0: Dump of assembler code for function hipe_bifs_get_hrvtime_0: 0x000a46b8 : push %ebp 0x000a46b9 : mov %esp,%ebp 0x000a46bb : push %ebx 0x000a46bc : sub $0x44,%esp 0x000a46bf : mov 8(%ebp),%ebx 0x000a46c2 : movl $0x0,12(%esp) 0x000a46ca : movl $0x0,8(%esp) 0x000a46d2 : movl $0x0,4(%esp) 0x000a46da : lea -12(%ebp),%eax 0x000a46dd : mov %eax,(%esp) 0x000a46e0 : call 0x45669 0x000a46e5 : movd -12(%ebp),%xmm1 0x000a46ea : pxor %xmm0,%xmm0 0x000a46ee : punpckldq %xmm1,%xmm0 0x000a46f2 : punpckldq 903040,%xmm0 0x000a46fa : subpd 903056,%xmm0 0x000a4702 : movapd %xmm0,-56(%ebp) 0x000a4707 : movapd %xmm0,%xmm2 0x000a470b : movhpd %xmm0,-56(%ebp) 0x000a4710 : addpd -56(%ebp),%xmm2 0x000a4715 : movapd %xmm2,-56(%ebp) 0x000a471a : fldl -56(%ebp) 0x000a471d : fstpl -32(%ebp) 0x000a4720 : mov (%ebx),%edx 0x000a4722 : mov 4(%ebx),%eax 0x000a4725 : sub %edx,%eax 0x000a4727 : sar $0x2,%eax 0x000a472a : cmp $0x3,%eax 0x000a472d : jbe 0xa4751 0x000a472f : lea 12(%edx),%eax 0x000a4732 : mov %eax,(%ebx) 0x000a4734 : mov %edx,%eax 0x000a4736 : movl $0x98,(%eax) 0x000a473c : mov -32(%ebp),%edx 0x000a473f : mov %edx,4(%eax) 0x000a4742 : mov -28(%ebp),%edx 0x000a4745 : mov %edx,8(%eax) 0x000a4748 : add $0x2,%eax 0x000a474b : add $0x44,%esp 0x000a474e : pop %ebx 0x000a474f : pop %ebp 0x000a4750 : ret 0x000a4751 : movl $0x3,4(%esp) 0x000a4759 : mov %ebx,(%esp) 0x000a475c : call 0x2ce3a 0x000a4761 : movl $0x98,(%eax) 0x000a4767 : mov -32(%ebp),%edx 0x000a476a : mov %edx,4(%eax) 0x000a476d : mov -28(%ebp),%edx 0x000a4770 : mov %edx,8(%eax) 0x000a4773 : add $0x2,%eax 0x000a4776 : add $0x44,%esp 0x000a4779 : pop %ebx 0x000a477a : pop %ebp 0x000a477b : ret End of assembler dump. -- http://wagerlabs.com/ From joelr1@REDACTED Tue Aug 15 13:40:52 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 12:40:52 +0100 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <200608151120.k7FBKK8C015607@harpo.it.uu.se> References: <200608151120.k7FBKK8C015607@harpo.it.uu.se> Message-ID: <7D7129C8-C225-4A56-870D-573475A20553@gmail.com> With the make_small(0) hack applied to hipe_bifs_get_hrvtime_0 things work. What's next? Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] Eshell V5.5 (abort with ^G) 1> esmb:test(). Compiling esmb with opts [core,o2] ... done in 0.00 secs (1832 bytes + + 225 words) Compiling esmb_app with opts [core,o2] ... done in 0.00 secs (228 bytes ++ 0 words) Compiling esmb_client with opts [core,o2] ... done in 0.00 secs (18104 bytes ++ 763 words) Compiling esmb_rpc with opts [core,o2] ... done in 0.00 secs (57432 bytes ++ 3525 words) Compiling esmb_sup with opts [core,o2] ... done in 0.00 secs (240 bytes ++ 49 words) Compiling iconv with opts [core,o2] ... done in 0.00 secs (6108 bytes ++ 197 words) Compiling md4 with opts [core,o2] ... done in 0.00 secs (2516 bytes + + 84 words) [{ok,esmb}, {ok,esmb_app}, {ok,esmb_client}, {ok,esmb_rpc}, {ok,esmb_sup}, {ok,iconv}, {ok,md4}] 2> halt(). ./testsuite.sh --only compiler_tests /usr/local ======================================================================== There was an old /tmp/hipe_test_res.joelr... removing There was an old /tmp/hipe_test_log.joelr... removing Testing /usr/local Compiler options: [o2] * Only running: compiler_tests The log will be left in /tmp/hipe_test_log.joelr ERL_COMPILER_OPTIONS=[nowarn_shadow_vars] Recompile: test PASSED HiPE testsuite for: /usr/local on junior.local ======================================================================== -- http://wagerlabs.com/ From joelr1@REDACTED Tue Aug 15 13:58:44 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 12:58:44 +0100 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <200608151120.k7FBKK8C015607@harpo.it.uu.se> References: <200608151120.k7FBKK8C015607@harpo.it.uu.se> Message-ID: Mikael, On Aug 15, 2006, at 12:20 PM, Mikael Pettersson wrote: > Another solution is to change hipe_x86_glue.S to create an aligned > C stack frame with a > suitably large parameter area preallocated at the bottom of the frame. How would you determine the size of the parameter area? Also, when do you think you guys will get to this? I hear the HiPE team is undefunded these days, thus my asking. Personally, I'm placing a large bet on Erlang and its floating-point performance. I would like to use Erlang to build some sort of a trading appliance. I found this foray into HiPE and assembler encouraging so I'll continue learning and poking around. I might tackle the stack alignment eventually, if you don't get to it. Thanks for all your help, I wouldn't have done it without you! Joel -- http://wagerlabs.com/ From rrerlang@REDACTED Tue Aug 15 14:05:57 2006 From: rrerlang@REDACTED (Robert Raschke) Date: Tue, 15 Aug 2006 13:05:57 +0100 Subject: Erlang for desktop applications? In-Reply-To: <44E1A353.2090300@ericsson.com> Message-ID: Mats wrote: > GUI programming is pretty complicated, because GUIs are complicated. > concurrency is not really the main problem (how often do you really want to > press two buttons at the same time?). I agree that writing a GUI is hard. But, in my experience dealing with the user input side of things is actually quite easy. The hard part (for me) comes when other events need to get reflected in the GUI. This is where you end up having real concurrency (or alternatively you write a cheap GUI that has update buttons :-). You need to be able to sensibly reflect the users actions, while at the same time show changes in any underlying models (a noddy example is a filebrowser, it needs to show the current state of the folders, not the one that was current when you first opened it). Conceptually, MVC tries to address some of this. And if you view the MVC components as parallel entities, the model works quite neatly. But if you are stuck in a sequential model (even one that can use threads), then changes to your Model need to be explicitly serialised, someone needs to make decisions on when to update the View, and so on. I have so far not come across any nice support in any environment (even Smalltalk) that would allow the writing of MVC components as parallel, communicating entities. My guess is that at some stage in the design of all of these, someone decided to sacrifice elegance and ease of use to the god of efficiency. I'll stop ranting here. Robby From mikpe@REDACTED Tue Aug 15 14:08:21 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 15 Aug 2006 14:08:21 +0200 (MEST) Subject: Victory? (was Re: Mac Intel) Message-ID: <200608151208.k7FC8LxG016775@harpo.it.uu.se> On Tue, 15 Aug 2006 12:40:52 +0100, Joel Reymont wrote: > With the make_small(0) hack applied to hipe_bifs_get_hrvtime_0 things > work. What's next? Send your patches for to me or hipe@REDACTED for review, regression testing on Linux and Solaris, and possible integration into the standard system. Expect the patches to change a bit if we (i.e., I) want to handle certain issues in a different way. From mikpe@REDACTED Tue Aug 15 14:15:31 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 15 Aug 2006 14:15:31 +0200 (MEST) Subject: Victory? (was Re: Mac Intel) Message-ID: <200608151215.k7FCFVQC017091@harpo.it.uu.se> On Tue, 15 Aug 2006 12:58:44 +0100, Joel Reymont wrote: > On Aug 15, 2006, at 12:20 PM, Mikael Pettersson wrote: > > > Another solution is to change hipe_x86_glue.S to create an aligned > > C stack frame with a > > suitably large parameter area preallocated at the bottom of the frame. > > How would you determine the size of the parameter area? Based on the largest number of parameter to a BIF, which we find via the arity information in hipe_x86_bifs.m4. I think 5 is the largest arity we need to handle. > Also, when do you think you guys will get to this? I hear the HiPE > team is undefunded these days, thus my asking. As soons as the patches land in our mailboxes. Doing a review, regression testing, and cleanup of the things we can test isn't that much work. > I might > tackle the stack alignment eventually, if you don't get to it. I'll handle that bit. From joelr1@REDACTED Tue Aug 15 14:22:14 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 13:22:14 +0100 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <200608151215.k7FCFVQC017091@harpo.it.uu.se> References: <200608151215.k7FCFVQC017091@harpo.it.uu.se> Message-ID: <816F7D36-8307-4187-8EA9-73C833FF9FF3@gmail.com> When do you think this will happen? On Aug 15, 2006, at 1:15 PM, Mikael Pettersson wrote: >> I might tackle the stack alignment eventually, if you don't get to >> it. > > I'll handle that bit. -- http://wagerlabs.com/ From joelr1@REDACTED Tue Aug 15 14:27:52 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 13:27:52 +0100 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <200608151208.k7FC8LxG016775@harpo.it.uu.se> References: <200608151208.k7FC8LxG016775@harpo.it.uu.se> Message-ID: <0282D68F-D69F-43A5-8E1E-44ED69747DE4@gmail.com> On Aug 15, 2006, at 1:08 PM, Mikael Pettersson wrote: > Send your patches for to me or hipe@REDACTED for review, > regression testing on Linux and Solaris, and possible > integration into the standard system. The stickler is that trapping sigaction on Mac requires patching of the code in memory and I'm using the open source mach_override library for it. I haven't seen Erlang/OTP using other open source libraries so far and I wonder how you guys are going to handle it. Thanks, Joel -- http://wagerlabs.com/ From yarivvv@REDACTED Tue Aug 15 14:39:08 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 15 Aug 2006 08:39:08 -0400 Subject: dets with Mnesia question In-Reply-To: References: <17633.33804.853420.402304@gargle.gargle.HOWL> Message-ID: <17244f480608150539p5e62a695v4a6e89335c0b3758@mail.gmail.com> Hi, I like this idea. I was also thinking maybe it would be possible to use Mnesia's transaction capabilities to get the freelist consistency "for free." Here's a possible solution: 1) Make dets freelist management "pluggable" (otherwise, use Smerl to hack it in runtime :) ) 2) When used with Mnesia, each dets table would have an associated disc_copies table for persisting the freelist. 3) Each dets write operation would involve a trasaction across the dets table and the freelist table. Advantage: the freelist would be kept in RAM for performance, and it will also always have a consistent representation on disc. The safe synchronization comes for free by reusing Mnesia's transaction capabilities. Fear: Mnesia's disc_copy tables are not suitable for storing the Freelist. Fear2: Possible slow performance What do you think? Best Yariv On 8/15/06, Ulf Wiger (TN/EAB) wrote: > > Perhaps one could implement an 'audit' mode where dets > writes space management info to a disk_log file per > dets file. > > /Ulf W > > > -----Original Message----- > > From: owner-erlang-questions@REDACTED > > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Hans Bolinder > > Sent: den 15 augusti 2006 10:22 > > To: erlang-questions@REDACTED > > Subject: Re: dets with Mnesia question > > > > > My question is, would it be possible to shorten the repair time by > > > modifing the dets startup procedure such that Mnesia could > > "inform" it > > > of exactly which records need to be cleaned up and what their real > > > values should be? > > > > If the VM crashes the space management information (kept in > > RAM only) is lost. To recreate it a scan of the whole file is > > required. > > > > Best regards, > > > > Hans Bolinder, Erlang/OTP > > > From mikpe@REDACTED Tue Aug 15 14:43:05 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 15 Aug 2006 14:43:05 +0200 (MEST) Subject: Victory? (was Re: Mac Intel) Message-ID: <200608151243.k7FCh5iI017788@harpo.it.uu.se> On Tue, 15 Aug 2006 13:22:14 +0100, Joel Reymont wrote: > When do you think this will happen? > > On Aug 15, 2006, at 1:15 PM, Mikael Pettersson wrote: > > >> I might tackle the stack alignment eventually, if you don't get to > >> it. > > > > I'll handle that bit. This week, in a day or two. From mikpe@REDACTED Tue Aug 15 14:46:18 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 15 Aug 2006 14:46:18 +0200 (MEST) Subject: Victory? (was Re: Mac Intel) Message-ID: <200608151246.k7FCkI0B017853@harpo.it.uu.se> On Tue, 15 Aug 2006 13:27:52 +0100, Joel Reymont wrote: > > Send your patches for to me or hipe@REDACTED for review, > > regression testing on Linux and Solaris, and possible > > integration into the standard system. > > The stickler is that trapping sigaction on Mac requires patching of > the code in memory and I'm using the open source mach_override > library for it. I haven't seen Erlang/OTP using other open source > libraries so far and I wonder how you guys are going to handle it. Write shell code to test its presence and put that in erts/configure.in. Make the success of that test a precondition to enabling HiPE on OSX/x86. If a new file is needed for OSX/x86 in erts/emulator/hipe/, modify erts/emulator/Makefile.in accordingly. From joelr1@REDACTED Tue Aug 15 14:49:30 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 13:49:30 +0100 Subject: Erlang for desktop applications? In-Reply-To: References: Message-ID: <0CE46194-8E8D-420D-A59D-C028E6C3CFAF@gmail.com> Have you looked at CoreData on the Mac? http://developer.apple.com/macosx/coredata.html On Aug 15, 2006, at 1:05 PM, Robert Raschke wrote: > I have so far not come across any nice support in any environment > (even Smalltalk) that would allow the writing of MVC components as > parallel, communicating entities. My guess is that at some stage in > the design of all of these, someone decided to sacrifice elegance and > ease of use to the god of efficiency. I'll stop ranting here. > > Robby > -- http://wagerlabs.com/ From hans.bolinder@REDACTED Tue Aug 15 16:21:36 2006 From: hans.bolinder@REDACTED (Hans Bolinder) Date: Tue, 15 Aug 2006 16:21:36 +0200 Subject: Mnesia and Oracle Message-ID: <17633.55408.797859.425784@gargle.gargle.HOWL> > Mnesia's dets tables work reasonably well, even with huge data sets. The > problem(s) starts when you start deleting records -- free list grows to the > point that (IMHO) takes quite a long time to write it to disk. This becomes > more obvious when one uses a lots of fragments. Thus, even if you shut the > database regularly, it might corrupt few fragments. My guess: mensia > controller does not give enough time to all dets processes (one per > fragment) to flush their respective free lists to dist. --text follows this line-- Could you please describe the symptoms a little bit more and, if possible, how to reproduce what could be a bug in Dets. How do you delete objects (delete_object, match_delete, select_delete)? What are the error message(s) you get when the problems start? Best regards, Hans Bolinder, Erlang/OTP From erlangX@REDACTED Tue Aug 15 16:49:12 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Tue, 15 Aug 2006 07:49:12 -0700 Subject: Forced erl_crash.dump In-Reply-To: References: Message-ID: <20060815144912.GP6584@delora.autosys.us> On Tue, Aug 15, 2006 at 09:57:45AM +0200, Heinrich Venter wrote: > Hi all > > Is there a way to force a running node to write a erl_crash.dump without > actually killing the node? > I am trying to figuire out what processes are running in a live node. > Any suggestions how best to do this? > > Thanks > > -]-[einrich ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ etop provides information on processes. From the local server, to watch a node on the local server, I use something like ... erl -sname etop -hidden -s etop -s erlang halt -output text -lines 23 -interval 17 -node 'node_name@REDACTED' -setcookie secret_cookie ~Michael From yarivvv@REDACTED Tue Aug 15 17:10:54 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 15 Aug 2006 11:10:54 -0400 Subject: announcing Smerl: Simple Erlang Metaprogramming library In-Reply-To: <17244f480608141901g27f17da2ke2ebc3236f58cb1f@mail.gmail.com> References: <17244f480608141901g27f17da2ke2ebc3236f58cb1f@mail.gmail.com> Message-ID: <17244f480608150810x12f83783g16cc2ea3fd98549c@mail.gmail.com> FYI, I just added a function, smerl:for_file for creating a new module from an Erlang source file. This should help working with scripts rather than compiled modules. Cheers Yariv On 8/14/06, Yariv Sadan wrote: > Hi, > > Digging through Ulf Wiger's rdbms_codegen.erl module in Jungerl, I > discovered Erlang's wonderful capabilities for runtime code generation > and manipulation. As great as these capabilities are, I think they are > far from obvious to the non-expert programmer. That's why I created > Smerl, simple library for (runtime) Erlang metaprogramming. > > To read more about Smerl and to download it, visit my blog: > https://yarivsblog.com/articles/2006/08/14/smerl-simple-metaprogramming-for-erlang. > > Here's a direct download link: > https://yarivsblog.com/files/smerl.erl > > Here's a quick example of how to use Smerl: > > test_smerl() -> > C1 = smerl:new(foo). > {ok, C2} = smerl:add_func(C1, "bar() -> 1 + 1."). > smerl:compile(C2), > foo:bar(). % returns 2 > > Smerl also lets you work with abstract Erlang forms. The 3rd line of > the above example can be rewritten as > > {ok,C2} = smerl:add_func(C1, {function,1,bar,0, > [{clause,1,[],[], > [{op,1,'+',{integer,1,1},{integer,1,1}}]}]). > > Smerl allows you to both create new module in runtime and to > manipulate existing modules by adding and removing functions. > > If you have any comments, problems or suggestions, please let me know! > > Best regards, > Yariv > From yarivvv@REDACTED Tue Aug 15 17:55:05 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 15 Aug 2006 11:55:05 -0400 Subject: announcing Smerl: Simple Erlang Metaprogramming library In-Reply-To: <17244f480608141901g27f17da2ke2ebc3236f58cb1f@mail.gmail.com> References: <17244f480608141901g27f17da2ke2ebc3236f58cb1f@mail.gmail.com> Message-ID: <17244f480608150855i5a91c60me0a94793e0667370@mail.gmail.com> Sorry, I just noticed I posted https links. Please visit http://yarivsblog.com/articles/2006/08/14/smerl-simple-metaprogramming-for-erlang for the blog entry and http://yarivsblog.com/files/smerl.erl for the direct download. Thanks, Yariv On 8/14/06, Yariv Sadan wrote: > Hi, > > Digging through Ulf Wiger's rdbms_codegen.erl module in Jungerl, I > discovered Erlang's wonderful capabilities for runtime code generation > and manipulation. As great as these capabilities are, I think they are > far from obvious to the non-expert programmer. That's why I created > Smerl, simple library for (runtime) Erlang metaprogramming. > > To read more about Smerl and to download it, visit my blog: > https://yarivsblog.com/articles/2006/08/14/smerl-simple-metaprogramming-for-erlang. > > Here's a direct download link: > https://yarivsblog.com/files/smerl.erl > > Here's a quick example of how to use Smerl: > > test_smerl() -> > C1 = smerl:new(foo). > {ok, C2} = smerl:add_func(C1, "bar() -> 1 + 1."). > smerl:compile(C2), > foo:bar(). % returns 2 > > Smerl also lets you work with abstract Erlang forms. The 3rd line of > the above example can be rewritten as > > {ok,C2} = smerl:add_func(C1, {function,1,bar,0, > [{clause,1,[],[], > [{op,1,'+',{integer,1,1},{integer,1,1}}]}]). > > Smerl allows you to both create new module in runtime and to > manipulate existing modules by adding and removing functions. > > If you have any comments, problems or suggestions, please let me know! > > Best regards, > Yariv > From bob@REDACTED Tue Aug 15 19:00:26 2006 From: bob@REDACTED (Bob Ippolito) Date: Tue, 15 Aug 2006 10:00:26 -0700 Subject: Victory? (was Re: Mac Intel) In-Reply-To: References: <200608150812.k7F8C6fm011788@harpo.it.uu.se> Message-ID: <6a36e7290608151000n59c5a528t20e2b58828b05047@mail.gmail.com> On 8/15/06, Joel Reymont wrote: > Does this tell you anything? I'm digging further. > > Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/ > operand. > 0x000a4702 in hipe_bifs_get_hrvtime_0 (A__p=0x12dbc94) at hipe/ > hipe_bif1.c:893 > 893 f.fd = get_hrvtime(); This is almost definitely a stack alignment issue. The ABI on Mac OS X IA32 requires a vector aligned stack (16 bytes at function call points). No other platforms require this, so HiPE probably doesn't ensure it in the code it generates. EXC_BAD_INSTRUCTION happens when you use an instruction that requires aligned operands but don't provide them aligned. -bob From fritchie@REDACTED Tue Aug 15 22:17:21 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Tue, 15 Aug 2006 15:17:21 -0500 Subject: gen_leader's status. In-Reply-To: Message of "Tue, 08 Aug 2006 22:39:32 +0300." <944da41d0608081239o40b6694el2a67c2c92d2498c7@mail.gmail.com> Message-ID: <200608152017.k7FKHLg6039603@snookles.snookles.com> >>>>> "aa" == Alex Arnon writes: aa> - I need a group of processes (1 per node) of which only aa> one periodically wakes up and performs cleanup on some mnesia aa> tables. aa> - It is probably not too bad if occasionally (due to node aa> crashes etc.) more than one would wake up, as I believe it should aa> be simple to avoid if nodes are reasonably stable. Alex: I've done the same thing for almost exactly the same reason: avoid running Mnesia clean-up stuff on more than 1 node. The clean-up functions are reasonable enough so that if more than 1 node runs them at the same time, it's an inconvenient use of CPU cycles, but no harm is done. The top-level supervisor has (yet another) worker process that takes care of this task. It periodically polls using global:whereis_name/1, and if the well-known name ('highlander')(*) isn't registered, it tries using global:register_name/2. If it succeeds, then subsequent gen_server calls to its query function will return true. The gen_server init/1 callback uses timer:send_interval/2 to send a {try_to_register} tuple periodically to the local highlander server. Whenever a call to the_one_p predicate will use global:whereis_name/1, just in case something evil/weird/unpredictable happened since global:register_name/2 was called. Again, if 'global' doesn't do the right thing 100% of the time, no harm done.(**) -Scott (*) "There can be only one!" -- http://www.imdb.com/title/tt0091203/ (**) I don't know exactly what 'global' does in cases of network partition, but I guess that it will register the global name on each side of the partition. (?) -record(state, { name, % Global name to register timerref, % For cancelling timer the_one = no % Am I the one? }). handle_call({the_one_p, Name}, _From, State) when State#state.the_one == yes, Name == State#state.name -> Me = self(), case global:whereis_name(State#state.name) of Me -> {reply, true, State}; _ -> %% Oh oh, someone did something dastardly like calling %% global:unregister_name/1. We aren't The One any longer, %% Give up. {stop, lost_master_role, false, State} end; handle_call({the_one_p, _Name}, _From, State) -> %% All other cases: no, we aren't The One. {reply, false, State}; ... handle_info({try_to_register}, State) when State#state.the_one == yes -> Me = self(), case global:whereis_name(State#state.name) of Me -> {noreply, State}; _ -> %% Someone has done something very, very bad. Give up. {stop, lost_master_role, State} end; handle_info({try_to_register}, State) when State#state.the_one == no -> case global:register_name(State#state.name, self()) of yes -> {noreply, State#state{the_one = yes}}; no -> {noreply, State} end; ... From kramer@REDACTED Wed Aug 16 00:12:35 2006 From: kramer@REDACTED (Reto Kramer) Date: Tue, 15 Aug 2006 15:12:35 -0700 Subject: Port driver communication witout copy of binaries In-Reply-To: References: <200603281833.46399.rlenglet@users.forge.objectweb.org> Message-ID: Raimo, I wish I could replicate your outputv result. Perhaps you could help me spot my mistake. The example I've added further down (iovec.erl, iovec_driver.c and build_iovec) is run on OS X 10.4.7 using R11. gcc is 3.3. The port is opened as binary as it should. $ ./build_iovec Erlang (BEAM) emulator version 5.5 [source] [async-threads:32] [hipe] Eshell V5.5 (abort with ^G) 1>ev->vsize 2 ev-size (total bytes size) 8 ev->binv[0] = null ev->iov[0]->iov_len = 0 ev->binv[1]->orig_size = 8 ev->iov[1]->iov_len = 8 ev->iov[1]->iov_base[0] = 1 ev->iov[1]->iov_base[1] = 2 ev->iov[1]->iov_base[2] = 3 ev->iov[1]->iov_base[3] = 4 ev->iov[1]->iov_base[4] = 5 ev->iov[1]->iov_base[5] = 6 ev->iov[1]->iov_base[6] = 7 ev->iov[1]->iov_base[7] = 8 ^C In iovec.erl, the following iolist is sent: encode() -> [1,<<2,3,4>>,5,6|<<7,8>>]. It's really as if I used "output" (instead of "outputv") in that the iolist seems to be flattened before handed to the driver (and hence, copied, which I wanted to avoid by way of using outputv). The 2nd puzzle is that the first iov entry is always length 0. This is so, even if I pass (encode) just a single binary. Any sharp eyed comment on iovec_driver.c would be much appreciated. - Reto PS: the async aspect is irrelevant here, I just left it in there since this is a trimmed version of a larger driver that is async. ------------------------------------------------------------------------ ----- ** iovec_driver.c ** #include #include "erl_driver.h" typedef struct { ErlDrvPort port; } example_data; typedef struct { int res; } example_async_data; typedef void ASYNC_INVOKE(void*); void async_iovectest(void* async_data) { example_async_data* the_data = (example_async_data*)async_data; } static ErlDrvData example_drv_start(ErlDrvPort port, char *buff) { example_data* d = (example_data*)driver_alloc(sizeof(example_data)); d->port = port; return (ErlDrvData)d; } static void example_drv_stop(ErlDrvData handle) { driver_free((char*)handle); } static void example_drv_outputv(ErlDrvData handle, ErlIOVec *ev) { example_data* d = (example_data*)handle; example_async_data* the_async_data = driver_alloc(sizeof (example_async_data)); ASYNC_INVOKE* fun; printf("\n\r"); printf("ev->vsize %i\n\r", ev->vsize); printf("ev-size (total bytes size) %i\n\r", ev->size); int i; for (i = 0; i < (ev->vsize); i++) { SysIOVec b = ev->iov[i]; ErlDrvBinary* binv = ev->binv[i]; if (binv == NULL) { printf("ev->binv[%i] = null\n\r", i); } else { printf("ev->binv[%i]->orig_size = %ld\n\r", i, binv->orig_size); } printf("ev->iov[%i]->iov_len = %i\n\r", i, b.iov_len); int j; for (j=0; j < b.iov_len; j++) { printf("ev->iov[%i]->iov_base[%i] = %i\n\r", i, j, b.iov_base [j]); } } fun = &async_iovectest; } static void example_ready_async(ErlDrvData handle, ErlDrvThreadData async_data) { example_data* d = (example_data*)handle; example_async_data* the_async_data = (example_async_data*)async_data; ErlDrvTermData spec[] = { ERL_DRV_PORT, driver_mk_port(d->port), ERL_DRV_ATOM, driver_mk_atom("ok"), ERL_DRV_TUPLE, 2 }; driver_output_term(d->port, spec, sizeof(spec) / sizeof(spec[0])); driver_free(the_async_data); } ErlDrvEntry example_driver_entry = { NULL, /* F_PTR init, N/A */ example_drv_start, /* L_PTR start, called when port is opened */ example_drv_stop, /* F_PTR stop, called when port is closed */ NULL, /* F_PTR output, called when erlang has sent */ NULL, /* F_PTR ready_input, called when input descriptor ready */ NULL, /* F_PTR ready_output, called when output descriptor ready */ "iovec_drv", /* char *driver_name, the argument to open_port */ NULL, /* finish */ NULL, /* handle */ NULL, /* control */ NULL, /* timeout */ example_drv_outputv, /* outputv */ example_ready_async, NULL, /* flush */ NULL, /* call */ NULL /* event */ }; DRIVER_INIT(example_drv) /* must match name in driver_entry */ { return &example_driver_entry; } ------------------------------------------------------------------------ ----- ** iovec.erl ** -module(iovec). -export([start/1, init/1, test/0]). -define(DRIVER, iovec_drv). test() -> ok = start(?DRIVER), timer:sleep(100), % HACK: give process some time to start and load .so Port = init(?DRIVER), test(Port). start(SharedLib) -> case erl_ddll:load_driver(".", SharedLib) of ok -> ok; {error, already_loaded} -> ok; Error -> exit({error, could_not_load_driver, Error}) end. init(SharedLib) -> Port = open_port({spawn, SharedLib}, [binary]), Port. test(Port) -> true = port_command(Port, encode()), receive {Port, ok} -> io:format("ok!~n", []); {'EXIT', Port, Reason} -> io:format("~p ~n", [Reason]), exit(port_terminated) end. encode() -> [1,<<2,3,4>>,5,6|<<7,8>>]. ------------------------------------------------------------------------ ----- ** build_iovec ** cc -no-cpp-precomp -fPIC -fno-common -bundle -flat_namespace - undefined suppress -I/usr/local/lib/erlang/usr/include -o iovec_drv.so complex.c iovec_driver.c && erlc +debug_info iovec.erl && erl +A 32 -s iovec test Thanks, - Reto On Mar 28, 2006, at 3:42 AM, Raimo Niskanen wrote: > What you really want to do can not be done (as far as I know) > but you might get it done with some tricks... > > To avoid copying your driver must implement the > ->outputv() entry point and you must send it I/O lists > being lists of binaries (might even be an improper list, > that is a binary in the tail). You will have to map > your tuples into that. > > If you send [1,<<2,3,4>>,5,6|<<7,8>>] to the driver, > void (*outputv)(ErlDrvData drv_data, ErlIOVec *ev) will get: > > ev->iov[0].iov_len = 1; > ev->iov[0].iov_base -> {1}; > ev->binv[0] = NULL; > ev->iov[1].iov_len = 3; > ev->iov[1].iov_base -> ev->binv[1]->orig_bytes; > ev->binv[1]->orig_size = 3; > ev->binv[1]->orig_bytes = {2,3,4}; > ev->iov[2].iov_len = 2; > ev->iov[2].iov_base -> {5,6}; > ev->binv[2] = NULL; > ev->iov[3].iov_len = 2; > ev->iov[3].iov_base -> ev->binv[3]->orig_bytes; > ev->binv[3]->orig_size = 2; > ev->binv[3]->orig_bytes = {7,8}; > > approximately, excuse my syntax :-) > > Binaries will be binaries and intermediate bytes > will be loose vectors. If your driver wants to > hang on to the data, it will have to use the > reference count in the binary to avoid premature freeing. > > To send data back without copying your driver will > have to use driver_outputv() and it arrives to erlang as > a header list of integers followed by a list of > binaries. Conversion to tuple format will have to > be done in erlang. > > Keep on dreaming... > > > > Have a look at efile_drv.c in the sources... > > > > rlenglet@REDACTED (Romain Lenglet) writes: > >> Hi, >> >> >> I have the following need: I want to wrap C functions in Erlang. >> Those functions get big binaries as input parameters, and return >> big binaries, among other kinds of data. >> For efficiency, I would like to avoid to copy those binaries >> around when communicating. Therefore, I am forced to implement a >> C port driver, since this is the only available mechanism that >> does not create a separate system process (and hence does not >> require inter-process data copy when communicating). >> >> If I needed only to send one binary in every message, that would >> be OK, e.g.: >> >> % in Erlang: >> Binary = <<...>>, >> port_command(Port, Binary), >> >> // in the C port implem: >> void myoutput(ErlDrvData drv_data, char *buf, int len) { >> ... >> } >> >> I guess that the Binary is not copied, and its data in the Erlang >> heap is directly pointed by the *buf argument. >> By the way, is that true??? Sending binaries that way is what is >> done in prim_inet for sending IP data, so I guess that no copy >> is done here. >> >> >> However, I want to send and receive more complex data, which must >> be manipulated by the driver, typically a tuple of simple terms >> and binaries (which may be large), e.g. the tuple: >> Tuple = {ContextHandle, QopReq, Message} >> %% ContextHandle = small binary() >> %% QopReq = integer() | atom() >> %% Message = large binary() >> >> Such a tuple cannot be passed to port_command(Port, Tuple), since >> it is not an IO list. And if I encode it into a binary, by >> calling encode(Tuple), I guess that the binaries in the tuple >> will get copied in the process (can anybody confirm this?). >> >> >> I have the same problem in the Driver -> Erlang direction, e.g. >> to send the tuple: >> Tuple = {MajorStatus, MinorStatus, ConfState, QopState, >> OutputMessage} >> %% MajorStatus = integer() >> %% MinorStatus = integer() >> %% ConfState = bool() >> %% QopState = integer() >> %% OutputMessage = large binary() >> I hope that using the driver_output_term() C function and the >> ErlDrvTermData construction technique, the binary data in the >> tuple above will not be copied. Can anybody confirm this? >> >> >> >> Is there any clean solution to my problem? Or am I doomed to >> write my own BIFs and use my custom erts? Or to send data in >> multiple messages, in sequence? >> >> I dream of a way to extend the BIFs list at runtime, by loading >> native libraries dynamically... >> >> -- >> Romain LENGLET > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB From joelr1@REDACTED Wed Aug 16 00:56:29 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 15 Aug 2006 23:56:29 +0100 Subject: Drivers and passing C structures Message-ID: <613D5170-AC44-4C12-9270-DABA062346D2@gmail.com> Folks, Do you have any examples of passing C structures to and from a driver? Thanks, Joel -- http://wagerlabs.com/ From fritchie@REDACTED Wed Aug 16 02:30:36 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Tue, 15 Aug 2006 19:30:36 -0500 Subject: Bad value on output port 'tcp_inet' In-Reply-To: Message of "Mon, 14 Aug 2006 16:45:54 BST." <20060814154554.GD16150@wellquite.org> Message-ID: <200608160030.k7G0UadU070521@snookles.snookles.com> >>>>> "ms" == Matthew Sackman writes: ms> The documentation is wrong though: gen_tcp:send/2 will actually ms> accept any arbitrary combination of lists, chars and ms> binaries. The 'inets' driver for dealing with sockets uses the same data structure as the 'file' module uses. See http://www.snookles.com/erlang-docs/R10B-9/lib/kernel-2.10.12/doc/html/index.html MODULE file [...] DATA TYPES iodata() = iolist() | binary() iolist() = [char() | binary() | iolist()] Anyone using the name "I/O list" (including me) really means iodata() above, despite the fact that a single binary term is, by definition, not a list. ms> gen_tcp:send(Sock, <>), ... will create new binary *and* copy the data from Binary1 and Binary2 into it. Then the inets driver will use write(2) or send(2) or equivalent to copy that data again (into kernel space). ms> gen_tcp:send(Sock, [Binary1, Binary2]), ... will allocate two cons cells, link 'em together, and stuff pointers to Binary1 and Binary2 into the appropriate cells. The 'inets' driver, may (at its discretion(*)) create a "struct iovec" then call writev(2) or equivalent to copy the data only once (into kernel space). -Scott (*) IIRC, 'inets' tries pretty hard to use "struct iovec" whenever possible. Alas, most OSes limit the size of an iovec, which can be annoying when it's so easy for Erlang to create an I/O list that may be hundreds of terms long (and/or deep). So, should inets re-copy some buffers to fit inside the constrained iovec array, or should it call writev(2) multiple times? {shrug} An exercise left for the reader. From ulf.wiger@REDACTED Wed Aug 16 07:48:51 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Wed, 16 Aug 2006 07:48:51 +0200 Subject: gen_leader's status. In-Reply-To: <200608152017.k7FKHLg6039603@snookles.snookles.com> Message-ID: Scott Lystig Fritchie wrote: > > (**) I don't know exactly what 'global' does in cases of > network partition, but I guess that it will register the > global name on each side of the partition. (?) First of all global will most likely remove any registration where the pid is from the node(s) that were lost during the network partition. The application may detect the nodedown too, and register another pid with global. When nodes reconnect, global has a default conflict resolution method that is pretty draconic: whenever two pids are found to be registered with the same global name, global picks one pid at random and performs exit(P, kill) on it. When registering a name, one may select another conflict resolution method, using global:register_name(Name, Pid, Method) The methods provided by global are - {global, random_exit_name} which is the default - {global, random_notify_name} - {global, notify_all_name} Notes: - Global performs no check to see whether Method actucally succeeded, or whether it is even a callable function - Global simply does catch Method(Name, Pid1, Pid2) which in the default case means catch {global, random_exit_name}(Name, P1, P2) When providing your own method, it would be more stylish to use a fun, I think. BR, Ulf W From ok@REDACTED Wed Aug 16 08:09:54 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 16 Aug 2006 18:09:54 +1200 (NZST) Subject: Patently I'm confused Message-ID: <200608160609.k7G69sNY195910@atlas.otago.ac.nz> I've just been reading, or rather, trying to read, a patent. It's Software structure for telecommujnication switching systems Larsson, Odling, Rosberg, & Karlson of Ericsson, filed in 1994 and can be found at http://www.freepatentsonline.com/5388258.html Apparently when it was originally filed it came with some of the Erlang manuals as attachments, which is how I happened to stumble across it. As near as I can figure out, they are claiming anything even remotely similar to Erlang/OTP, but that can't be right, surely. Does anyone know what the heck that patent is about, and to what degree Erlang/OTP is affected by it? From ulf.wiger@REDACTED Wed Aug 16 08:43:01 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Wed, 16 Aug 2006 08:43:01 +0200 Subject: Patently I'm confused In-Reply-To: <200608160609.k7G69sNY195910@atlas.otago.ac.nz> Message-ID: According to Joe, one is supposed to read the claims until one finds one that doesn't match. Here, it is claim 1: "...system which includes a feature module and a management module within an application layer and a data base within a basic operation system layer..." Erlang/OTP doesn't include a feature module, but most importantly, doesn't include a database within a basic operation system layer. In claim 2, hardware is called for. Erlang/OTP doesn't include hardware. BR, Ulf W > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of > Richard A. O'Keefe > Sent: den 16 augusti 2006 08:10 > To: erlang-questions@REDACTED > Subject: Patently I'm confused > > I've just been reading, or rather, trying to read, a patent. > It's > Software structure for telecommujnication switching systems > Larsson, Odling, Rosberg, & Karlson of Ericsson, > filed in 1994 > and can be found at > http://www.freepatentsonline.com/5388258.html > > Apparently when it was originally filed it came with some of > the Erlang manuals as attachments, which is how I happened to > stumble across it. > > As near as I can figure out, they are claiming anything even > remotely similar to Erlang/OTP, but that can't be right, surely. > > Does anyone know what the heck that patent is about, and to > what degree Erlang/OTP is affected by it? > > From klacke@REDACTED Wed Aug 16 10:27:32 2006 From: klacke@REDACTED (Claes Wikstrom) Date: Wed, 16 Aug 2006 10:27:32 +0200 Subject: Patently I'm confused In-Reply-To: <200608160609.k7G69sNY195910@atlas.otago.ac.nz> References: <200608160609.k7G69sNY195910@atlas.otago.ac.nz> Message-ID: <44E2D6F4.2020702@hyber.org> Richard A. O'Keefe wrote: > As near as I can figure out, they are claiming anything even remotely > similar to Erlang/OTP, but that can't be right, surely. > > Does anyone know what the heck that patent is about, and to what degree > Erlang/OTP is affected by it? > If I recall correctly, when erlang went opensource, /// renounced all rights to any patents part of the OTP release. This included two of my mnesia related patents (no links) /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control cellphone: +46 70 2097763 From raimo@REDACTED Wed Aug 16 11:06:06 2006 From: raimo@REDACTED (Raimo Niskanen) Date: 16 Aug 2006 11:06:06 +0200 Subject: Port driver communication witout copy of binaries References: , , Message-ID: Ah! After spending some time in gdb I can inform you that it is not a bug, nor your mistake, it is a feature :-) Since your two binaries are so-called heap binaries, that is (roughly) binaries smaller than 64 bytes, they are regarded as list data too. That is because they have no off-heap reference counted data storage that can be utilised for driver outputv. If you make any binary larger than 64 bytes it should behave as you expected. And, the first vector entry is intenionally left empty for the driver to use if it wants to add header data, avoiding to copy the whole ErlIOvec structure to make room for a header vector entry. Notes: There is a possibility that this 64 byte limit may change in any OTP release, since it is an optimisation parameter. In general, when using the driver outputv interface, one can not assume it is possible to maintain structure information from the erlang I/O-list down to the ErlIOvec data. Both are just serial data on different forms and the byte order is the only thing absolutely certain. Some assumptions are safer than others, though: * Small data may be concatenated into a common binary. * A binary that is kept is kept as it is. So the driver->outputv() code must be prepared to get data on different forms. The ErlIOvec format is an optimization to avoid copying and the VM uses it at its own conveniance. kramer@REDACTED (Reto Kramer) writes: > Raimo, > > I wish I could replicate your outputv result. Perhaps you could help > me spot my mistake. The example I've added further down (iovec.erl, > iovec_driver.c and build_iovec) is run on OS X 10.4.7 using R11. gcc > is 3.3. The port is opened as binary as it should. > > $ ./build_iovec > Erlang (BEAM) emulator version 5.5 [source] [async-threads:32] [hipe] > > Eshell V5.5 (abort with ^G) > 1>ev->vsize 2 > ev-size (total bytes size) 8 > ev->binv[0] = null > ev->iov[0]->iov_len = 0 > ev->binv[1]->orig_size = 8 > ev->iov[1]->iov_len = 8 > ev->iov[1]->iov_base[0] = 1 > ev->iov[1]->iov_base[1] = 2 > ev->iov[1]->iov_base[2] = 3 > ev->iov[1]->iov_base[3] = 4 > ev->iov[1]->iov_base[4] = 5 > ev->iov[1]->iov_base[5] = 6 > ev->iov[1]->iov_base[6] = 7 > ev->iov[1]->iov_base[7] = 8 > > ^C > > In iovec.erl, the following iolist is sent: > encode() -> > [1,<<2,3,4>>,5,6|<<7,8>>]. > > It's really as if I used "output" (instead of "outputv") in that the > iolist seems to be flattened before handed to the driver (and hence, > copied, which I wanted to avoid by way of using outputv). > > The 2nd puzzle is that the first iov entry is always length 0. This > is so, even if I pass (encode) just a single binary. > > Any sharp eyed comment on iovec_driver.c would be much appreciated. > > - Reto > PS: the async aspect is irrelevant here, I just left it in there > since this is a trimmed version of a larger driver that is async. > > ------------------------------------------------------------------------ > ----- > ** iovec_driver.c ** > > #include > #include "erl_driver.h" > > typedef struct { > ErlDrvPort port; > } example_data; > > typedef struct { > int res; > } example_async_data; > > typedef void ASYNC_INVOKE(void*); > > void async_iovectest(void* async_data) { > example_async_data* the_data = (example_async_data*)async_data; > } > > static ErlDrvData example_drv_start(ErlDrvPort port, char *buff) { > example_data* d = (example_data*)driver_alloc(sizeof(example_data)); > d->port = port; > return (ErlDrvData)d; > } > > static void example_drv_stop(ErlDrvData handle) { > driver_free((char*)handle); > } > > static void example_drv_outputv(ErlDrvData handle, ErlIOVec *ev) { > example_data* d = (example_data*)handle; > example_async_data* the_async_data = driver_alloc(sizeof > (example_async_data)); > ASYNC_INVOKE* fun; > printf("\n\r"); > printf("ev->vsize %i\n\r", ev->vsize); > printf("ev-size (total bytes size) %i\n\r", ev->size); > int i; > for (i = 0; i < (ev->vsize); i++) { > SysIOVec b = ev->iov[i]; > ErlDrvBinary* binv = ev->binv[i]; > if (binv == NULL) { > printf("ev->binv[%i] = null\n\r", i); > } else { > printf("ev->binv[%i]->orig_size = %ld\n\r", i, binv->orig_size); > } > printf("ev->iov[%i]->iov_len = %i\n\r", i, b.iov_len); > int j; > for (j=0; j < b.iov_len; j++) { > printf("ev->iov[%i]->iov_base[%i] = %i\n\r", i, j, b.iov_base > [j]); > } > } > fun = &async_iovectest; > } > > static void example_ready_async(ErlDrvData handle, ErlDrvThreadData > async_data) > { > example_data* d = (example_data*)handle; > example_async_data* the_async_data = (example_async_data*)async_data; > ErlDrvTermData spec[] = { > ERL_DRV_PORT, driver_mk_port(d->port), > ERL_DRV_ATOM, driver_mk_atom("ok"), > ERL_DRV_TUPLE, 2 }; > driver_output_term(d->port, spec, sizeof(spec) / sizeof(spec[0])); > driver_free(the_async_data); > } > > ErlDrvEntry example_driver_entry = { > NULL, /* F_PTR init, N/A */ > example_drv_start, /* L_PTR start, called when port is opened */ > example_drv_stop, /* F_PTR stop, called when port is closed */ > NULL, /* F_PTR output, called when erlang has sent */ > NULL, /* F_PTR ready_input, called when input descriptor ready */ > NULL, /* F_PTR ready_output, called when output descriptor ready */ > "iovec_drv", /* char *driver_name, the argument to open_port */ > NULL, /* finish */ > NULL, /* handle */ > NULL, /* control */ > NULL, /* timeout */ > example_drv_outputv, /* outputv */ > example_ready_async, > NULL, /* flush */ > NULL, /* call */ > NULL /* event */ > }; > DRIVER_INIT(example_drv) /* must match name in driver_entry */ { > return &example_driver_entry; > } > > ------------------------------------------------------------------------ > ----- > ** iovec.erl ** > -module(iovec). > > -export([start/1, init/1, test/0]). > > -define(DRIVER, iovec_drv). > > test() -> > ok = start(?DRIVER), > timer:sleep(100), % HACK: give process some time to start and > load .so > Port = init(?DRIVER), > test(Port). > > start(SharedLib) -> > case erl_ddll:load_driver(".", SharedLib) of > ok -> ok; > {error, already_loaded} -> ok; > Error -> exit({error, could_not_load_driver, Error}) > end. > > init(SharedLib) -> > Port = open_port({spawn, SharedLib}, [binary]), > Port. > > test(Port) -> > true = port_command(Port, encode()), > receive > {Port, ok} -> > io:format("ok!~n", []); > {'EXIT', Port, Reason} -> > io:format("~p ~n", [Reason]), > exit(port_terminated) > end. > > encode() -> > [1,<<2,3,4>>,5,6|<<7,8>>]. > > ------------------------------------------------------------------------ > ----- > ** build_iovec ** > cc -no-cpp-precomp -fPIC -fno-common -bundle -flat_namespace - > undefined suppress -I/usr/local/lib/erlang/usr/include -o > iovec_drv.so complex.c iovec_driver.c && erlc +debug_info iovec.erl > && erl +A 32 -s iovec test > > Thanks, > - Reto > > > On Mar 28, 2006, at 3:42 AM, Raimo Niskanen wrote: > > > What you really want to do can not be done (as far as I know) > > but you might get it done with some tricks... > > > > To avoid copying your driver must implement the > > ->outputv() entry point and you must send it I/O lists > > being lists of binaries (might even be an improper list, > > that is a binary in the tail). You will have to map > > your tuples into that. > > > > If you send [1,<<2,3,4>>,5,6|<<7,8>>] to the driver, > > void (*outputv)(ErlDrvData drv_data, ErlIOVec *ev) will get: > > > > ev->iov[0].iov_len = 1; > > ev->iov[0].iov_base -> {1}; > > ev->binv[0] = NULL; > > ev->iov[1].iov_len = 3; > > ev->iov[1].iov_base -> ev->binv[1]->orig_bytes; > > ev->binv[1]->orig_size = 3; > > ev->binv[1]->orig_bytes = {2,3,4}; > > ev->iov[2].iov_len = 2; > > ev->iov[2].iov_base -> {5,6}; > > ev->binv[2] = NULL; > > ev->iov[3].iov_len = 2; > > ev->iov[3].iov_base -> ev->binv[3]->orig_bytes; > > ev->binv[3]->orig_size = 2; > > ev->binv[3]->orig_bytes = {7,8}; > > > > approximately, excuse my syntax :-) > > > > Binaries will be binaries and intermediate bytes > > will be loose vectors. If your driver wants to > > hang on to the data, it will have to use the > > reference count in the binary to avoid premature freeing. > > > > To send data back without copying your driver will > > have to use driver_outputv() and it arrives to erlang as > > a header list of integers followed by a list of > > binaries. Conversion to tuple format will have to > > be done in erlang. > > > > Keep on dreaming... > > > > > > > > Have a look at efile_drv.c in the sources... > > > > > > > > rlenglet@REDACTED (Romain Lenglet) writes: > > > >> Hi, > >> > >> > >> I have the following need: I want to wrap C functions in Erlang. > >> Those functions get big binaries as input parameters, and return > >> big binaries, among other kinds of data. > >> For efficiency, I would like to avoid to copy those binaries > >> around when communicating. Therefore, I am forced to implement a > >> C port driver, since this is the only available mechanism that > >> does not create a separate system process (and hence does not > >> require inter-process data copy when communicating). > >> > >> If I needed only to send one binary in every message, that would > >> be OK, e.g.: > >> > >> % in Erlang: > >> Binary = <<...>>, > >> port_command(Port, Binary), > >> > >> // in the C port implem: > >> void myoutput(ErlDrvData drv_data, char *buf, int len) { > >> ... > >> } > >> > >> I guess that the Binary is not copied, and its data in the Erlang > >> heap is directly pointed by the *buf argument. > >> By the way, is that true??? Sending binaries that way is what is > >> done in prim_inet for sending IP data, so I guess that no copy > >> is done here. > >> > >> > >> However, I want to send and receive more complex data, which must > >> be manipulated by the driver, typically a tuple of simple terms > >> and binaries (which may be large), e.g. the tuple: > >> Tuple = {ContextHandle, QopReq, Message} > >> %% ContextHandle = small binary() > >> %% QopReq = integer() | atom() > >> %% Message = large binary() > >> > >> Such a tuple cannot be passed to port_command(Port, Tuple), since > >> it is not an IO list. And if I encode it into a binary, by > >> calling encode(Tuple), I guess that the binaries in the tuple > >> will get copied in the process (can anybody confirm this?). > >> > >> > >> I have the same problem in the Driver -> Erlang direction, e.g. > >> to send the tuple: > >> Tuple = {MajorStatus, MinorStatus, ConfState, QopState, > >> OutputMessage} > >> %% MajorStatus = integer() > >> %% MinorStatus = integer() > >> %% ConfState = bool() > >> %% QopState = integer() > >> %% OutputMessage = large binary() > >> I hope that using the driver_output_term() C function and the > >> ErlDrvTermData construction technique, the binary data in the > >> tuple above will not be copied. Can anybody confirm this? > >> > >> > >> > >> Is there any clean solution to my problem? Or am I doomed to > >> write my own BIFs and use my custom erts? Or to send data in > >> multiple messages, in sequence? > >> > >> I dream of a way to extend the BIFs list at runtime, by loading > >> native libraries dynamically... > >> > >> -- > >> Romain LENGLET > > > > -- > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From mbj@REDACTED Wed Aug 16 12:09:57 2006 From: mbj@REDACTED (Martin Bjorklund) Date: Wed, 16 Aug 2006 12:09:57 +0200 (CEST) Subject: compiler bug Message-ID: <20060816.120957.64613311.mbj@tail-f.com> I found this compiler bug, in R10B-10 and R11B-0. nassa otp_src_R11B-0> bin/erlc ~/src/w.erl Function -w/0-fun-2-/1 refers to undefined label 11 /home/mbj/src/w.erl:none: internal error in beam_clean; crash reason: {{case_clause,{'EXIT',{undefined_label,11}}}, [{compile,'-select_passes/2-anonymous-2-',2}, {compile,'-internal_comp/4-anonymous-1-',2}, {compile,fold_comp,3}, {compile,internal_comp,4}, {compile,internal,3}]} And the file: -module(w). -export([w/0]). w() -> G = fun() -> ok end, try fun() -> ok end after fun({A, B}) -> A + B end end. /martin From samuelrivas@REDACTED Wed Aug 16 13:42:54 2006 From: samuelrivas@REDACTED (Samuel Rivas) Date: Wed, 16 Aug 2006 13:42:54 +0200 Subject: Video Streaming Server In-Reply-To: <230465c00608121136t4bf35dacl5ca5594e9c9523a9@mail.gmail.com> References: <230465c00608120346u7fe36ad2q4223aaa4a5d7d132@mail.gmail.com> <44DDD988.8020103@blueyonder.co.uk> <230465c00608121136t4bf35dacl5ca5594e9c9523a9@mail.gmail.com> Message-ID: <20060816114254.GA1003@nodo2.lambdastream.com> lang er wrote: > Do you mean a C program reads video stream from device and transfer > data to Erlang server using local socket, then Erlang server streams > video data to client? > > Our server will connect to many devices(if user watch many different > cameras installed on many different devices).By this way, C program > also need to deal with many concurrent problems. It supposed these > problems should be done in Erlang side, and there will be little > benefit to reimplement streaming server in Erlang. We have a system that does similar things: http://www.lambdastream.com/lambda/products/boxcoder For the video sources that can not be properly handled in erlang, it uses a port process, normally written in C. There is no concurrency in the C side since each source is handled by a different process. > Another problem, In surveillance system, QoS( network delay > especially) is very import, I think your solution may introduce some > additional network delay. Well, a local socket (or using standard input/outuput of the port process) should not introduce a significant delay. I shall suggest to write a small prototype to check if it meet your requirements: Simply write a C program that reads video from one of your sources and outputs it to the standard output. Then write an erlang program that opens this program as port (with the stream option), reads the output data, and sends it to a socket. You will have the complete trip device --> SDK port --> erlang --> network. > I wonder if this is the standard way Erlang program use external SDK. > I have read some posts in this list, and got a impression that Erlang > is used in telecommunication device systems and hardware controller > programs. Don't they need interact with SDK(dynamic linked library)? If the system meets the performance requirements, having all external code running in separated processes is the safest solution. Otherwise you may need linked drivers, but they are much more dangerous. Regards -- Samuel From thinus-list@REDACTED Wed Aug 16 16:27:54 2006 From: thinus-list@REDACTED (Thinus Pollard) Date: Wed, 16 Aug 2006 16:27:54 +0200 Subject: Port drivers vs Ports Message-ID: <200608161627.55003.thinus-list@erlfinsys.net> Hi there A Port runs in its own OS process, right? So you can stream data from one process to the other. A Port Driver attaches itself to the erlang runtime system. After a few test I found that while the code inside the port driver is executing, the erlang runtime system is hanging, waiting for the port driver to return. It makes sense to me at least, please correct me if I'm wrong. This would imply that I can't stream data from the port driver to erlang, since it is the same os process and while the port driver is streaming, the erlang part of the process can't accept the data, since it's blocked. Correct? When I do a driver_output(port, &result, length_of_res), do the data get copied or does the erl_driver pass the result back in by reference? Also, If I want to output back to erlang more than once during a call, does the messages (driver_output) get queued so that my erlang process can pick them up after the port driver has returned, or is it possible that they can get lost if I send to many messages? Last Question: Which of the two communication methods are preferred / gives the best performance, erl_interface or communicating via character lists/arrays. I need a port/port driver for connecting to a database. Thanks in advance Thinus From kramer@REDACTED Wed Aug 16 17:45:02 2006 From: kramer@REDACTED (Reto Kramer) Date: Wed, 16 Aug 2006 08:45:02 -0700 Subject: Port driver communication witout copy of binaries In-Reply-To: References: Message-ID: <38F94A5D-26E7-44B2-834E-6DFBA3AF677C@acm.org> > After spending some time in gdb I can inform you that it is not > a bug, nor your mistake, it is a feature :-) And it's free! > Since your two binaries are so-called heap binaries, that is > (roughly) binaries smaller than 64 bytes, they are regarded > as list data too. That is because they have no off-heap reference > counted data storage that can be utilised for driver outputv. > > If you make any binary larger than 64 bytes it should behave > as you expected. Indeed it does - thank you! > And, the first vector entry is intenionally left empty for > the driver to use if it wants to add header data, avoiding > to copy the whole ErlIOvec structure to make room for > a header vector entry. Ah, that's another great feature, now that I understand it. > So the driver->outputv() code must be prepared to get data > on different forms. The ErlIOvec format is an optimization > to avoid copying and the VM uses it at its own conveniance. Now that with your help, I understand it, can printf the behavior I'll happily go back to just passing it all to writev :-). - Reto > > > > kramer@REDACTED (Reto Kramer) writes: > >> Raimo, >> >> I wish I could replicate your outputv result. Perhaps you could help >> me spot my mistake. The example I've added further down (iovec.erl, >> iovec_driver.c and build_iovec) is run on OS X 10.4.7 using R11. gcc >> is 3.3. The port is opened as binary as it should. >> >> $ ./build_iovec >> Erlang (BEAM) emulator version 5.5 [source] [async-threads:32] [hipe] >> >> Eshell V5.5 (abort with ^G) >> 1>ev->vsize 2 >> ev-size (total bytes size) 8 >> ev->binv[0] = null >> ev->iov[0]->iov_len = 0 >> ev->binv[1]->orig_size = 8 >> ev->iov[1]->iov_len = 8 >> ev->iov[1]->iov_base[0] = 1 >> ev->iov[1]->iov_base[1] = 2 >> ev->iov[1]->iov_base[2] = 3 >> ev->iov[1]->iov_base[3] = 4 >> ev->iov[1]->iov_base[4] = 5 >> ev->iov[1]->iov_base[5] = 6 >> ev->iov[1]->iov_base[6] = 7 >> ev->iov[1]->iov_base[7] = 8 >> >> ^C >> >> In iovec.erl, the following iolist is sent: >> encode() -> >> [1,<<2,3,4>>,5,6|<<7,8>>]. >> >> It's really as if I used "output" (instead of "outputv") in that the >> iolist seems to be flattened before handed to the driver (and hence, >> copied, which I wanted to avoid by way of using outputv). >> >> The 2nd puzzle is that the first iov entry is always length 0. This >> is so, even if I pass (encode) just a single binary. >> >> Any sharp eyed comment on iovec_driver.c would be much appreciated. >> >> - Reto >> PS: the async aspect is irrelevant here, I just left it in there >> since this is a trimmed version of a larger driver that is async. >> >> --------------------------------------------------------------------- >> --- >> ----- >> ** iovec_driver.c ** >> >> #include >> #include "erl_driver.h" >> >> typedef struct { >> ErlDrvPort port; >> } example_data; >> >> typedef struct { >> int res; >> } example_async_data; >> >> typedef void ASYNC_INVOKE(void*); >> >> void async_iovectest(void* async_data) { >> example_async_data* the_data = (example_async_data*)async_data; >> } >> >> static ErlDrvData example_drv_start(ErlDrvPort port, char *buff) { >> example_data* d = (example_data*)driver_alloc(sizeof >> (example_data)); >> d->port = port; >> return (ErlDrvData)d; >> } >> >> static void example_drv_stop(ErlDrvData handle) { >> driver_free((char*)handle); >> } >> >> static void example_drv_outputv(ErlDrvData handle, ErlIOVec *ev) { >> example_data* d = (example_data*)handle; >> example_async_data* the_async_data = driver_alloc(sizeof >> (example_async_data)); >> ASYNC_INVOKE* fun; >> printf("\n\r"); >> printf("ev->vsize %i\n\r", ev->vsize); >> printf("ev-size (total bytes size) %i\n\r", ev->size); >> int i; >> for (i = 0; i < (ev->vsize); i++) { >> SysIOVec b = ev->iov[i]; >> ErlDrvBinary* binv = ev->binv[i]; >> if (binv == NULL) { >> printf("ev->binv[%i] = null\n\r", i); >> } else { >> printf("ev->binv[%i]->orig_size = %ld\n\r", i, binv- >> >orig_size); >> } >> printf("ev->iov[%i]->iov_len = %i\n\r", i, b.iov_len); >> int j; >> for (j=0; j < b.iov_len; j++) { >> printf("ev->iov[%i]->iov_base[%i] = %i\n\r", i, j, b.iov_base >> [j]); >> } >> } >> fun = &async_iovectest; >> } >> >> static void example_ready_async(ErlDrvData handle, ErlDrvThreadData >> async_data) >> { >> example_data* d = (example_data*)handle; >> example_async_data* the_async_data = (example_async_data*) >> async_data; >> ErlDrvTermData spec[] = { >> ERL_DRV_PORT, driver_mk_port(d->port), >> ERL_DRV_ATOM, driver_mk_atom("ok"), >> ERL_DRV_TUPLE, 2 }; >> driver_output_term(d->port, spec, sizeof(spec) / sizeof(spec[0])); >> driver_free(the_async_data); >> } >> >> ErlDrvEntry example_driver_entry = { >> NULL, /* F_PTR init, N/A */ >> example_drv_start, /* L_PTR start, called when port is opened */ >> example_drv_stop, /* F_PTR stop, called when port is closed */ >> NULL, /* F_PTR output, called when erlang has sent */ >> NULL, /* F_PTR ready_input, called when input descriptor ready */ >> NULL, /* F_PTR ready_output, called when output descriptor >> ready */ >> "iovec_drv", /* char *driver_name, the argument to open_port */ >> NULL, /* finish */ >> NULL, /* handle */ >> NULL, /* control */ >> NULL, /* timeout */ >> example_drv_outputv, /* outputv */ >> example_ready_async, >> NULL, /* flush */ >> NULL, /* call */ >> NULL /* event */ >> }; >> DRIVER_INIT(example_drv) /* must match name in driver_entry */ { >> return &example_driver_entry; >> } >> >> --------------------------------------------------------------------- >> --- >> ----- >> ** iovec.erl ** >> -module(iovec). >> >> -export([start/1, init/1, test/0]). >> >> -define(DRIVER, iovec_drv). >> >> test() -> >> ok = start(?DRIVER), >> timer:sleep(100), % HACK: give process some time to start and >> load .so >> Port = init(?DRIVER), >> test(Port). >> >> start(SharedLib) -> >> case erl_ddll:load_driver(".", SharedLib) of >> ok -> ok; >> {error, already_loaded} -> ok; >> Error -> exit({error, could_not_load_driver, Error}) >> end. >> >> init(SharedLib) -> >> Port = open_port({spawn, SharedLib}, [binary]), >> Port. >> >> test(Port) -> >> true = port_command(Port, encode()), >> receive >> {Port, ok} -> >> io:format("ok!~n", []); >> {'EXIT', Port, Reason} -> >> io:format("~p ~n", [Reason]), >> exit(port_terminated) >> end. >> >> encode() -> >> [1,<<2,3,4>>,5,6|<<7,8>>]. >> >> --------------------------------------------------------------------- >> --- >> ----- >> ** build_iovec ** >> cc -no-cpp-precomp -fPIC -fno-common -bundle -flat_namespace - >> undefined suppress -I/usr/local/lib/erlang/usr/include -o >> iovec_drv.so complex.c iovec_driver.c && erlc +debug_info iovec.erl >> && erl +A 32 -s iovec test >> >> Thanks, >> - Reto >> >> >> On Mar 28, 2006, at 3:42 AM, Raimo Niskanen wrote: >> >>> What you really want to do can not be done (as far as I know) >>> but you might get it done with some tricks... >>> >>> To avoid copying your driver must implement the >>> ->outputv() entry point and you must send it I/O lists >>> being lists of binaries (might even be an improper list, >>> that is a binary in the tail). You will have to map >>> your tuples into that. >>> >>> If you send [1,<<2,3,4>>,5,6|<<7,8>>] to the driver, >>> void (*outputv)(ErlDrvData drv_data, ErlIOVec *ev) will get: >>> >>> ev->iov[0].iov_len = 1; >>> ev->iov[0].iov_base -> {1}; >>> ev->binv[0] = NULL; >>> ev->iov[1].iov_len = 3; >>> ev->iov[1].iov_base -> ev->binv[1]->orig_bytes; >>> ev->binv[1]->orig_size = 3; >>> ev->binv[1]->orig_bytes = {2,3,4}; >>> ev->iov[2].iov_len = 2; >>> ev->iov[2].iov_base -> {5,6}; >>> ev->binv[2] = NULL; >>> ev->iov[3].iov_len = 2; >>> ev->iov[3].iov_base -> ev->binv[3]->orig_bytes; >>> ev->binv[3]->orig_size = 2; >>> ev->binv[3]->orig_bytes = {7,8}; >>> >>> approximately, excuse my syntax :-) >>> >>> Binaries will be binaries and intermediate bytes >>> will be loose vectors. If your driver wants to >>> hang on to the data, it will have to use the >>> reference count in the binary to avoid premature freeing. >>> >>> To send data back without copying your driver will >>> have to use driver_outputv() and it arrives to erlang as >>> a header list of integers followed by a list of >>> binaries. Conversion to tuple format will have to >>> be done in erlang. >>> >>> Keep on dreaming... >>> >>> >>> >>> Have a look at efile_drv.c in the sources... >>> >>> >>> >>> rlenglet@REDACTED (Romain Lenglet) writes: >>> >>>> Hi, >>>> >>>> >>>> I have the following need: I want to wrap C functions in Erlang. >>>> Those functions get big binaries as input parameters, and return >>>> big binaries, among other kinds of data. >>>> For efficiency, I would like to avoid to copy those binaries >>>> around when communicating. Therefore, I am forced to implement a >>>> C port driver, since this is the only available mechanism that >>>> does not create a separate system process (and hence does not >>>> require inter-process data copy when communicating). >>>> >>>> If I needed only to send one binary in every message, that would >>>> be OK, e.g.: >>>> >>>> % in Erlang: >>>> Binary = <<...>>, >>>> port_command(Port, Binary), >>>> >>>> // in the C port implem: >>>> void myoutput(ErlDrvData drv_data, char *buf, int len) { >>>> ... >>>> } >>>> >>>> I guess that the Binary is not copied, and its data in the Erlang >>>> heap is directly pointed by the *buf argument. >>>> By the way, is that true??? Sending binaries that way is what is >>>> done in prim_inet for sending IP data, so I guess that no copy >>>> is done here. >>>> >>>> >>>> However, I want to send and receive more complex data, which must >>>> be manipulated by the driver, typically a tuple of simple terms >>>> and binaries (which may be large), e.g. the tuple: >>>> Tuple = {ContextHandle, QopReq, Message} >>>> %% ContextHandle = small binary() >>>> %% QopReq = integer() | atom() >>>> %% Message = large binary() >>>> >>>> Such a tuple cannot be passed to port_command(Port, Tuple), since >>>> it is not an IO list. And if I encode it into a binary, by >>>> calling encode(Tuple), I guess that the binaries in the tuple >>>> will get copied in the process (can anybody confirm this?). >>>> >>>> >>>> I have the same problem in the Driver -> Erlang direction, e.g. >>>> to send the tuple: >>>> Tuple = {MajorStatus, MinorStatus, ConfState, QopState, >>>> OutputMessage} >>>> %% MajorStatus = integer() >>>> %% MinorStatus = integer() >>>> %% ConfState = bool() >>>> %% QopState = integer() >>>> %% OutputMessage = large binary() >>>> I hope that using the driver_output_term() C function and the >>>> ErlDrvTermData construction technique, the binary data in the >>>> tuple above will not be copied. Can anybody confirm this? >>>> >>>> >>>> >>>> Is there any clean solution to my problem? Or am I doomed to >>>> write my own BIFs and use my custom erts? Or to send data in >>>> multiple messages, in sequence? >>>> >>>> I dream of a way to extend the BIFs list at runtime, by loading >>>> native libraries dynamically... >>>> >>>> -- >>>> Romain LENGLET >>> >>> -- >>> >>> / Raimo Niskanen, Erlang/OTP, Ericsson AB >> > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB From mikpe@REDACTED Wed Aug 16 17:58:24 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 16 Aug 2006 17:58:24 +0200 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <200608151243.k7FCh5iI017788@harpo.it.uu.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> Message-ID: <17635.16544.567307.112086@alkaid.it.uu.se> Mikael Pettersson writes: > On Tue, 15 Aug 2006 13:22:14 +0100, Joel Reymont wrote: > > When do you think this will happen? > > > > On Aug 15, 2006, at 1:15 PM, Mikael Pettersson wrote: > > > > >> I might tackle the stack alignment eventually, if you don't get to > > >> it. > > > > > > I'll handle that bit. > > This week, in a day or two. Completed. Download the following URLs: http://www.it.uu.se/research/group/hipe/snapshots/otp-0804.tar.gz http://www.it.uu.se/research/group/hipe/snapshots/tests-0804.tar.gz http://www.it.uu.se/research/group/hipe/snapshots/patch-otp-0804-1-x86-aligned-c-stack otp-0804 is a current snapshot from the branch that will become R11B-1 fairly soon, tests-0804 is the corresponding snapshot of the HiPE test suite, and patch-otp-0804-1-x86-aligned-c-stack is the patch to make the runtime system maintain a 16-byte aligned C stack on x86-32. After unpacking otp-0804 and applying the patch above, you should update your R11B-0 patches to apply to this code base. Do it in separate steps for separate issues, something like: - support for OSX/x86-32 floating-point exceptions - changes to handle OSX/x86-32 assembly syntax - changes for sigaction() override on OSX/x86-32 - anything else This should result in a set of patches to be applied in a specific order. Then make them publicly available and we'll start reviewing them. Why not do this against R11B-0? There are already enough changes to the runtime system that patches against R11B-0 don't automatically apply to or work in the current snapshots. Since R11B-1 isn't very far away, it seems more appropriate to develop for that; you can always backport the changes to R11B-0 if necessary. From alex.arnon@REDACTED Wed Aug 16 17:59:40 2006 From: alex.arnon@REDACTED (Alex Arnon) Date: Wed, 16 Aug 2006 18:59:40 +0300 Subject: gen_leader's status. In-Reply-To: References: <200608152017.k7FKHLg6039603@snookles.snookles.com> Message-ID: <944da41d0608160859x74fd478en3cfa56731d30fa69@mail.gmail.com> Thanks, guys. I didn't even consider using global... it will actually suit me even better! On 8/16/06, Ulf Wiger (TN/EAB) wrote: > > Scott Lystig Fritchie wrote: > > > > (**) I don't know exactly what 'global' does in cases of > > network partition, but I guess that it will register the > > global name on each side of the partition. (?) > > First of all global will most likely remove any registration > where the pid is from the node(s) that were lost during > the network partition. The application may detect the > nodedown too, and register another pid with global. > > When nodes reconnect, global has a default conflict > resolution method that is pretty draconic: whenever > two pids are found to be registered with the same > global name, global picks one pid at random and performs > exit(P, kill) on it. > > When registering a name, one may select another conflict > resolution method, using > > global:register_name(Name, Pid, Method) > > The methods provided by global are > - {global, random_exit_name} which is the default > - {global, random_notify_name} > - {global, notify_all_name} > > Notes: > > - Global performs no check to see whether Method > actucally succeeded, or whether it is even a > callable function > - Global simply does catch Method(Name, Pid1, Pid2) > which in the default case means > catch {global, random_exit_name}(Name, P1, P2) > When providing your own method, it would be > more stylish to use a fun, I think. > > BR, > Ulf W > -------------- next part -------------- An HTML attachment was scrubbed... URL: From darrinth@REDACTED Wed Aug 16 19:04:03 2006 From: darrinth@REDACTED (Darrin Thompson) Date: Wed, 16 Aug 2006 13:04:03 -0400 Subject: Overhead of mnesia:transaction Message-ID: What is the overhead of executing a function in mnesia:transaction but not actually invoking any mnesia functions? -- Darrin From erlangist@REDACTED Wed Aug 16 19:41:27 2006 From: erlangist@REDACTED (lang er) Date: Thu, 17 Aug 2006 01:41:27 +0800 Subject: Video Streaming Server In-Reply-To: <20060816114254.GA1003@nodo2.lambdastream.com> References: <230465c00608120346u7fe36ad2q4223aaa4a5d7d132@mail.gmail.com> <44DDD988.8020103@blueyonder.co.uk> <230465c00608121136t4bf35dacl5ca5594e9c9523a9@mail.gmail.com> <20060816114254.GA1003@nodo2.lambdastream.com> Message-ID: <230465c00608161041g3211f038x5bc77b6f880e2bad@mail.gmail.com> Thank you all very much. A working solution give me much confidence. Regards James 2006/8/16, Samuel Rivas : > > lang er wrote: > > Do you mean a C program reads video stream from device and transfer > > data to Erlang server using local socket, then Erlang server streams > > video data to client? > > > > Our server will connect to many devices(if user watch many different > > cameras installed on many different devices).By this way, C program > > also need to deal with many concurrent problems. It supposed these > > problems should be done in Erlang side, and there will be little > > benefit to reimplement streaming server in Erlang. > > We have a system that does similar things: > > http://www.lambdastream.com/lambda/products/boxcoder > > For the video sources that can not be properly handled in erlang, it > uses a port process, normally written in C. There is no concurrency in > the C side since each source is handled by a different process. > > > Another problem, In surveillance system, QoS( network delay > > especially) is very import, I think your solution may introduce some > > additional network delay. > > Well, a local socket (or using standard input/outuput of the port > process) should not introduce a significant delay. I shall suggest to > write a small prototype to check if it meet your requirements: > > Simply write a C program that reads video from one of your sources and > outputs it to the standard output. Then write an erlang program that > opens this program as port (with the stream option), reads the output > data, and sends it to a socket. You will have the complete trip > device --> SDK port --> erlang --> network. > > > I wonder if this is the standard way Erlang program use external SDK. > > I have read some posts in this list, and got a impression that Erlang > > is used in telecommunication device systems and hardware controller > > programs. Don't they need interact with SDK(dynamic linked library)? > > If the system meets the performance requirements, having all external > code running in separated processes is the safest solution. Otherwise you > may need linked drivers, but they are much more dangerous. > > Regards > -- > Samuel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drehman31@REDACTED Wed Aug 16 21:02:41 2006 From: drehman31@REDACTED (=?ISO-8859-1?Q?D=E1rio_Abdulrehman?=) Date: Wed, 16 Aug 2006 20:02:41 +0100 Subject: new to erlang: need ideas for server software Message-ID: <6aeedf580608161202s46993dcbub38b9bfccfa0ae6@mail.gmail.com> Erlang is well suited for writing scalable server software and I am currently looking for interesting server software projects that can be done. >From what I am aware of, this is some ground that has been already covered: - VOD Video On Demand http://vodka.lfcia.org/ - Instant Messaging (ejabberd) - Joel Reymont is working on trading software Suggestions and ideas welcome! -------------- next part -------------- An HTML attachment was scrubbed... URL: From darrinth@REDACTED Wed Aug 16 23:33:45 2006 From: darrinth@REDACTED (Darrin Thompson) Date: Wed, 16 Aug 2006 17:33:45 -0400 Subject: new to erlang: need ideas for server software In-Reply-To: <6aeedf580608161202s46993dcbub38b9bfccfa0ae6@mail.gmail.com> References: <6aeedf580608161202s46993dcbub38b9bfccfa0ae6@mail.gmail.com> Message-ID: On 8/16/06, D?rio Abdulrehman wrote: > Erlang is well suited for writing scalable server software and I am > currently looking for interesting server software projects that can be done. > > From what I am aware of, this is some ground that has been already covered: > - VOD Video On Demand http://vodka.lfcia.org/ > - Instant Messaging (ejabberd) > - Joel Reymont is working on trading software > A cometd implementation: http://cometd.com/ -- Darrin From cyberlync@REDACTED Wed Aug 16 23:52:37 2006 From: cyberlync@REDACTED (Eric Merritt) Date: Wed, 16 Aug 2006 14:52:37 -0700 Subject: Migrating the Erlang Cookbook to Trapexit Message-ID: What do you guys think of migrating the Erlang cookbook at http://schemecookbook.org/Erlang/WebHome http://pleac.sourceforge.net/pleac_erlang/index.html To the trap exit wiki. There is a reasonable amount of decent stuff out that that doesn't get updated or viewed much due to its obscure location. I would be willing to do a lot of it, but I wanted to get some consensus from the community. From tty@REDACTED Thu Aug 17 01:11:19 2006 From: tty@REDACTED (tty@REDACTED) Date: Wed, 16 Aug 2006 19:11:19 -0400 Subject: new to erlang: need ideas for server software Message-ID: Radiosity based tracer. With all the patches that need processing scalling would be wonderful. t -------- Original Message -------- From: "Darrin Thompson" Apparently from: owner-erlang-questions@REDACTED To: "D?rio Abdulrehman" Cc: erlang-questions@REDACTED Subject: Re: new to erlang: need ideas for server software Date: Wed, 16 Aug 2006 17:33:45 -0400 > On 8/16/06, D?rio Abdulrehman wrote: > > Erlang is well suited for writing scalable server software and I am > > currently looking for interesting server software projects that can be done. > > > > From what I am aware of, this is some ground that has been already covered: > > - VOD Video On Demand http://vodka.lfcia.org/ > > - Instant Messaging (ejabberd) > > - Joel Reymont is working on trading software > > > > A cometd implementation: > > http://cometd.com/ > > -- > Darrin From tty@REDACTED Thu Aug 17 03:12:11 2006 From: tty@REDACTED (tty@REDACTED) Date: Wed, 16 Aug 2006 21:12:11 -0400 Subject: Migrating the Erlang Cookbook to Trapexit Message-ID: I think this is a good idea. Regards t -------- Original Message -------- From: "Eric Merritt" Apparently from: owner-erlang-questions@REDACTED To: erlang-questions@REDACTED Subject: Migrating the Erlang Cookbook to Trapexit Date: Wed, 16 Aug 2006 14:52:37 -0700 > What do you guys think of migrating the Erlang cookbook at > > http://schemecookbook.org/Erlang/WebHome > http://pleac.sourceforge.net/pleac_erlang/index.html > > To the trap exit wiki. There is a reasonable amount of decent stuff > out that that doesn't get updated or viewed much due to its obscure > location. I would be willing to do a lot of it, but I wanted to get > some consensus from the community. From rlenglet@REDACTED Thu Aug 17 03:54:43 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Thu, 17 Aug 2006 10:54:43 +0900 Subject: Port drivers vs Ports In-Reply-To: <200608161627.55003.thinus-list@erlfinsys.net> References: <200608161627.55003.thinus-list@erlfinsys.net> Message-ID: <200608171054.43404.rlenglet@users.forge.objectweb.org> Thinus Pollard wrote: > A Port runs in its own OS process, right? So you can stream > data from one process to the other. > > A Port Driver attaches itself to the erlang runtime system. > After a few test I found that while the code inside the port > driver is executing, the erlang runtime system is hanging, > waiting for the port driver to return. It makes sense to me at > least, please correct me if I'm wrong. > > This would imply that I can't stream data from the port driver > to erlang, since it is the same os process and while the port > driver is streaming, the erlang part of the process can't > accept the data, since it's blocked. Correct? Yes, since there is only one thread for a whole Erlang node (in versions < R11B), when that thread executes a driver function it cannot schedule processes. If you need to execute in parallel, use asynchronous tasks in your driver (cf. function driver_async), and setup the VM to start several driver threads to execute those asynchronous tasks (+A option of the erl command). Or, you can also use the SMP version of the emulator. In that case, several threads are used in the VM to schedule the processes and execute driver functions. When a thread is executing a driver function, the other threads can still schedule the processes. But anyway, if your driver functions take some time to execute or are blocking, you *should* use asynchronous tasks. > When I do a driver_output(port, &result, length_of_res), do > the data get copied or does the erl_driver pass the result > back in by reference? If your result term contains binaries, as created by calling alloc_binary, the binaries are passed by reference, AFAIK. The other terms are copied. > Also, If I want to output back to erlang more than once during > a call, does the messages (driver_output) get queued so that > my erlang process can pick them up after the port driver has > returned, or is it possible that they can get lost if I send > to many messages? >From what I have understood from the code, they are normal messages. Therefore, they get queued. > Last Question: Which of the two communication methods are > preferred / gives the best performance, erl_interface or > communicating via character lists/arrays. It depends. Using driver_output et al. you can encode/decode only a limited set of term types. For instance, you cannot encode/decode pids or refs. Or, you can use erl_interface on top of driver_output et al. But that gets tricky. That is what is done in Dryverl. Those details are hidden to you. Dryverl solves your port driver programming needs. And it will make the coffee in soft real time in a future release. ;-) > I need a port/port driver for connecting to a database. -- Romain LENGLET From rsaccon@REDACTED Thu Aug 17 04:31:31 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Wed, 16 Aug 2006 23:31:31 -0300 Subject: new to erlang: need ideas for server software In-Reply-To: References: <6aeedf580608161202s46993dcbub38b9bfccfa0ae6@mail.gmail.com> Message-ID: oh, this is exactly what I am working on right now. > A cometd implementation: > > http://cometd.com/ -- Roberto Saccon From yarivvv@REDACTED Thu Aug 17 05:14:15 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 16 Aug 2006 23:14:15 -0400 Subject: new to erlang: need ideas for server software In-Reply-To: <6aeedf580608161202s46993dcbub38b9bfccfa0ae6@mail.gmail.com> References: <6aeedf580608161202s46993dcbub38b9bfccfa0ae6@mail.gmail.com> Message-ID: <17244f480608162014w4f2b280br7a0797ec2570427b@mail.gmail.com> An AJAX/Comet-based online chess game. Yariv On 8/16/06, D?rio Abdulrehman wrote: > Erlang is well suited for writing scalable server software and I am > currently looking for interesting server software projects that can be done. > > From what I am aware of, this is some ground that has been already covered: > - VOD Video On Demand http://vodka.lfcia.org/ > - Instant Messaging (ejabberd) > - Joel Reymont is working on trading software > > Suggestions and ideas welcome! > From darrinth@REDACTED Thu Aug 17 05:24:35 2006 From: darrinth@REDACTED (Darrin Thompson) Date: Wed, 16 Aug 2006 23:24:35 -0400 Subject: new to erlang: need ideas for server software In-Reply-To: References: <6aeedf580608161202s46993dcbub38b9bfccfa0ae6@mail.gmail.com> Message-ID: On 8/16/06, Roberto Saccon wrote: > oh, this is exactly what I am working on right now. > I'm doing some web based chat with yaws, dojo 0.3, suffering, and endurance. Is your work in public somewhere? -- Darrin From rsaccon@REDACTED Thu Aug 17 05:40:13 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Thu, 17 Aug 2006 00:40:13 -0300 Subject: new to erlang: need ideas for server software In-Reply-To: References: <6aeedf580608161202s46993dcbub38b9bfccfa0ae6@mail.gmail.com> Message-ID: Not yet, but it will be as soon as it is out of early experimental phase. On 8/17/06, Darrin Thompson wrote: > On 8/16/06, Roberto Saccon wrote: > > oh, this is exactly what I am working on right now. > > > > I'm doing some web based chat with yaws, dojo 0.3, suffering, and > endurance. Is your work in public somewhere? > > -- > Darrin > -- Roberto Saccon From yarivvv@REDACTED Thu Aug 17 06:05:47 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 17 Aug 2006 00:05:47 -0400 Subject: closing the loop on Erlang metaprogramming with Smerl Message-ID: <17244f480608162105m6d1af516j2ff497fb24153d77@mail.gmail.com> Hi, It just struck me today that Smerl let you add functions to and remove functions from modules, but it didn't let you modify existing functions! I fixed this situation by adding two new functions: smerl:get_func, which gets the abstract form of a functions, and smerl:replace_func, which does a smerl:remove_func followed by a smerl:add_func. Here are the links again: direct download: http://yarivsblog.com/files/smerl.erl blog posting: http://yarivsblog.com/articles/2006/08/14/smerl-simple-metaprogramming-for-erlang follow up: http://yarivsblog.com/articles/2006/08/16/closing-the-loop-on-erlang-metaprogramming-with-smerl I think this pretty much concludes the development of Smerl. I want to keep Smerl simple, so any additional metaprogramming features would belong in higher-level libraries. If you have any thoughts, problems or suggestions, please let me know! Thanks Yariv From sanjaya@REDACTED Thu Aug 17 08:28:48 2006 From: sanjaya@REDACTED (Sanjaya Vitharana) Date: Thu, 17 Aug 2006 11:58:48 +0530 Subject: erlang release ??? Message-ID: <078d01c6c1c6$6903a610$9a0a10ac@wavenet.lk> Hi erl -version gives the version number. "init:script_id()" & "ls /usr/local/lib/erlang/releases/" gives more info about release. But seems it gives "R10B" instead of "R10B-8". So how to find the exact release number of elang???. i.e R10B-8, R10B-9 ... etc thanks Sanjaya Vitharana -------------- next part -------------- An HTML attachment was scrubbed... URL: From ft@REDACTED Thu Aug 17 09:00:56 2006 From: ft@REDACTED (Fredrik Thulin) Date: Thu, 17 Aug 2006 09:00:56 +0200 Subject: new to erlang: need ideas for server software In-Reply-To: <6aeedf580608161202s46993dcbub38b9bfccfa0ae6@mail.gmail.com> References: <6aeedf580608161202s46993dcbub38b9bfccfa0ae6@mail.gmail.com> Message-ID: <200608170900.57008.ft@it.su.se> On Wednesday 16 August 2006 21:02, D?rio Abdulrehman wrote: > Erlang is well suited for writing scalable server software and I am > currently looking for interesting server software projects that can > be done. ... > Suggestions and ideas welcome! Not sure if you would count it as server software, but I've heard questions about the availability of an RTP implementation in Erlang from several people. Most notably on the YXA mailing list (YXA is SIP software I'm working on), but also on this list. /Fredrik From bjorn@REDACTED Thu Aug 17 09:22:34 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 17 Aug 2006 09:22:34 +0200 Subject: erlang release ??? In-Reply-To: <078d01c6c1c6$6903a610$9a0a10ac@wavenet.lk> References: <078d01c6c1c6$6903a610$9a0a10ac@wavenet.lk> Message-ID: It is currently not possible. /Bjorn "Sanjaya Vitharana" writes: > Hi > > erl -version gives the version number. > "init:script_id()" & "ls /usr/local/lib/erlang/releases/" gives more info about release. But seems it gives "R10B" instead of "R10B-8". > > So how to find the exact release number of elang???. i.e R10B-8, R10B-9 ... etc > > thanks > > Sanjaya Vitharana -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From joe.armstrong@REDACTED Thu Aug 17 09:35:44 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Thu, 17 Aug 2006 09:35:44 +0200 Subject: new to erlang: need ideas for server software In-Reply-To: Message-ID: Interesting - can somebody answer the following: cometd looks to be a ideal application for Erlang. I have written this try of application *many times* Now I have some questions about cometd. - Is this an "interesting" application - ie if implemented in an efficient manner will anybody be interested and use the implementation? - Just how high performance is desirable? How many message/sec should a single server handle? How many simultaneously open connections should a single server handle? Also How frozen is the protocol? A really large server would benefit from an addition message in the protocol set, for example: * redirect (client - server message) * hand-over (server - server message) redirect can move a connection to a new server, the server send redirect to the client with a new server IP. The client closes the connection and connects to the new server. hand-over is used between server to negotiate a redirection before it occurs.'' This can be used for: - load balancing (a busy server can redirect connections to a unloaded server) - taking a server out of service, without interrupting the service - scaling the capacity of the server. /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Roberto Saccon > Sent: den 17 augusti 2006 04:32 > To: erlang-questions@REDACTED > Subject: Re: new to erlang: need ideas for server software > > oh, this is exactly what I am working on right now. > > > A cometd implementation: > > > > http://cometd.com/ > > -- > Roberto Saccon > From hakan@REDACTED Thu Aug 17 10:45:33 2006 From: hakan@REDACTED (Hakan Mattsson) Date: Thu, 17 Aug 2006 10:45:33 +0200 (CEST) Subject: Overhead of mnesia:transaction In-Reply-To: References: Message-ID: On Wed, 16 Aug 2006, Darrin Thompson wrote: DT> What is the overhead of executing a function in DT> mnesia:transaction but not actually invoking any DT> mnesia functions? The most significant overhead is the management of the temporary transaction store. First the transaction coordinator (your process) sends a message to the transaction manager which among other things creates an ets table and replies to the coordinator. In the end of the transaction the procedure is almost repeated when the store is deleted. So the overhead is roughly 4 messages plus creation and deletion of an ets table. /H?kan From bjorn@REDACTED Thu Aug 17 11:07:38 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 17 Aug 2006 11:07:38 +0200 Subject: compiler bug In-Reply-To: <20060816.120957.64613311.mbj@tail-f.com> References: <20060816.120957.64613311.mbj@tail-f.com> Message-ID: Thanks! I have added the code to the test suite for the compiler, but I will probably not have time to correct the bug for the R11B-1 release. /Bjorn Martin Bjorklund writes: > I found this compiler bug, in R10B-10 and R11B-0. > > nassa otp_src_R11B-0> bin/erlc ~/src/w.erl > Function -w/0-fun-2-/1 refers to undefined label 11 > /home/mbj/src/w.erl:none: internal error in beam_clean; > crash reason: {{case_clause,{'EXIT',{undefined_label,11}}}, > [{compile,'-select_passes/2-anonymous-2-',2}, > {compile,'-internal_comp/4-anonymous-1-',2}, > {compile,fold_comp,3}, > {compile,internal_comp,4}, > {compile,internal,3}]} > > > And the file: > > -module(w). > -export([w/0]). > > w() -> > G = fun() -> ok end, > try > fun() -> ok end > after > fun({A, B}) -> A + B end > end. > > > /martin > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From chris.double@REDACTED Thu Aug 17 11:30:25 2006 From: chris.double@REDACTED (Chris Double) Date: Thu, 17 Aug 2006 21:30:25 +1200 Subject: new to erlang: need ideas for server software In-Reply-To: References: Message-ID: On 8/17/06, Joe Armstrong (TN/EAB) wrote: > > cometd looks to be a ideal application for Erlang. There is a mailing list for discussion of cometd implementations: http://groups.google.com/group/cometd-dev And users: http://groups.google.com/group/cometd-users I've also written similar stuff. My current incarnation allows lightweight processes on the browser using CPS transformed javascript. An erlang style messaging system is built on top of that allowing browser processes to send and receive messages to each other and to the server. So a browser process can send a message to a suitably registered server process. A server process can also send a message to a browser process, or broadcast to all browser processes. This uses a comet style connection - either XMLHttpRequest polling or iframes. This made it trivial to write a chat application. I just keep track of all browser processes on the server as the browser connections. When a chat message is sent the browser process sends the message to a process on the server and it broadcasts it to a processes on all clients. Browser processes look like: function alerter() { while(true) { var msg = receive->(); document.getElementById("messages").value += (msg + "\n") } } register_process("p1", spawn(alerter)); The ->() syntax is a yielding function call. It transforms via CPS at load time in the browser into javascript which calls a function that blocks waiting for a message. On receipt of the message it calls the continuation which is the resumption after the ->() call. That message can come from a server process or from another browser (which is routed via the server). It works quite well. More here: http://www.bluishcoder.co.nz/2006/08/factor-web-framework.html Although currently the back end is written in Factor I do plan to do an Erlang back end as the javascript side will be constant across implementations. The message sending code is just JSON encoded objects. Chris. -- http://www.bluishcoder.co.nz From Micic_V@REDACTED Thu Aug 17 11:46:07 2006 From: Micic_V@REDACTED (Valentin Micic [ MTN - Innovation Centre ]) Date: Thu, 17 Aug 2006 11:46:07 +0200 Subject: erlang release ??? Message-ID: <54461D0825E5E44188349F4D8F3518A803D09F29@MTNMAIL.mtn.co.za> Is there a way of mapping erlang emulator version, as reported during the run-time to a particular release? For example, ERTS 5.3 in indicates R9C, whereas 5.3.6.3 indicates R9C-2 (or I got it completely wrong?). V. -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Bjorn Gustavsson Sent: Thursday, 17 August 2006 9:23 AM To: erlang-questions@REDACTED Subject: Re: erlang release ??? It is currently not possible. /Bjorn "Sanjaya Vitharana" writes: > Hi > > erl -version gives the version number. > "init:script_id()" & "ls /usr/local/lib/erlang/releases/" gives more info about release. But seems it gives "R10B" instead of "R10B-8". > > So how to find the exact release number of elang???. i.e R10B-8, R10B-9 ... etc > > thanks > > Sanjaya Vitharana -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/disclaimer From bjorn@REDACTED Thu Aug 17 12:30:16 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 17 Aug 2006 12:30:16 +0200 Subject: erlang release ??? In-Reply-To: <54461D0825E5E44188349F4D8F3518A803D09F29@MTNMAIL.mtn.co.za> References: <54461D0825E5E44188349F4D8F3518A803D09F29@MTNMAIL.mtn.co.za> Message-ID: Only by maintaining your own map, for instance: vsn_to_release("5.3.6.3") -> "R9C-2"; ... /Bjorn "Valentin Micic [ MTN - Innovation Centre ]" writes: > Is there a way of mapping erlang emulator version, as reported during the run-time to a particular release? For example, ERTS 5.3 in indicates R9C, whereas 5.3.6.3 indicates R9C-2 (or I got it completely wrong?). > > V. > > -----Original Message----- > From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Bjorn Gustavsson > Sent: Thursday, 17 August 2006 9:23 AM > To: erlang-questions@REDACTED > Subject: Re: erlang release ??? > > It is currently not possible. > > /Bjorn > > "Sanjaya Vitharana" writes: > > > Hi > > > > erl -version gives the version number. > > "init:script_id()" & "ls /usr/local/lib/erlang/releases/" gives more info about release. But seems it gives "R10B" instead of "R10B-8". > > > > So how to find the exact release number of elang???. i.e R10B-8, R10B-9 ... etc > > > > thanks > > > > Sanjaya Vitharana > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > > > NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/disclaimer > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From joelr1@REDACTED Thu Aug 17 13:58:14 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 17 Aug 2006 12:58:14 +0100 Subject: Parsers for C written in Erlang Message-ID: Folks, Has anyone written C-grammar parsers in Erlang? I'm thinking of how I would approach the Cocoa bridge in Erlang. There are to basic approaches: parsing the Objective-C header files to wrap the classes and using the runtime type inspection. I already completed most of a Cocoa bridge for Allegro Common Lisp and I used the runtime discovery approach. The biggest problem that I faced is the huge number of unpublished methods and structures that must be imported. This is a non-issue when parsing header files, for obvious reasons. I have never written parsers before so it will probably take me a while if I go the parsing route. This seems like the rightful approach, though. What do you think? Thanks, Joel P.S. The grammar is described here: http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ Articles/chapter_951_section_1.html -- http://wagerlabs.com/ From mikpe@REDACTED Thu Aug 17 14:01:08 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 17 Aug 2006 14:01:08 +0200 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <17635.16544.567307.112086@alkaid.it.uu.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> Message-ID: <17636.23172.37608.399423@alkaid.it.uu.se> Mikael Pettersson writes: > Mikael Pettersson writes: > > On Tue, 15 Aug 2006 13:22:14 +0100, Joel Reymont wrote: > > > When do you think this will happen? > > > > > > On Aug 15, 2006, at 1:15 PM, Mikael Pettersson wrote: > > > > > > >> I might tackle the stack alignment eventually, if you don't get to > > > >> it. > > > > > > > > I'll handle that bit. > > > > This week, in a day or two. > > Completed. Download the following URLs: > http://www.it.uu.se/research/group/hipe/snapshots/otp-0804.tar.gz > http://www.it.uu.se/research/group/hipe/snapshots/tests-0804.tar.gz > http://www.it.uu.se/research/group/hipe/snapshots/patch-otp-0804-1-x86-aligned-c-stack > > otp-0804 is a current snapshot from the branch that will become R11B-1 > fairly soon, tests-0804 is the corresponding snapshot of the HiPE test > suite, and patch-otp-0804-1-x86-aligned-c-stack is the patch to make > the runtime system maintain a 16-byte aligned C stack on x86-32. I've now uploaded two more patches: http://www.it.uu.se/research/group/hipe/snapshots/patch-otp-0804-2-amd64-sse2-handler-fix http://www.it.uu.se/research/group/hipe/snapshots/patch-otp-0804-x86-sse2-exceptions-wip-1 The second patch updates the FP exception feature test code and the actual implementation to support exceptions from SSE2 FP instructions on x86-32. It is known to work on Linux (build Erlang with "-O2 -msse2 -mfpmath=sse" as CFLAGS). The patch is not final (indicated by the absence of a patch number and the "-wip" (work-in-progress) suffix), but the only thing missing is a safety check to see if the CPU has SSE2 or not before SSE2 FP exceptions are enabled. The first patch fixes a latent bug in the existing x86-64 SSE2 FP exception handling that I found while preparing the x86-32 SSE2 support. The bug could cause SSE2 exception handling to be invoked when an x87 exception had occurred, which would result in an abort() from skip_sse2_insn(). The error would never occur on normal x86-64 systems, but it is easy to trigger on systems that use SSE2 for computations and x87 for parameter passing, like OSX/x86-32. From ola.a.andersson@REDACTED Thu Aug 17 14:01:55 2006 From: ola.a.andersson@REDACTED (Ola Andersson A (AS/EAB)) Date: Thu, 17 Aug 2006 14:01:55 +0200 Subject: Patently I'm confused In-Reply-To: <44E2D6F4.2020702@hyber.org> Message-ID: <148408C0A2D44A41AB295D74E183997501A6F560@esealmw105.eemea.ericsson.se> This brings back some nice memories! It looks to me as this patent more or less sums up the findings of the ACS/Dunder research project. ACS/Dunder was one of the milestones in Erlangs early history. The roots of OTP can be found in the BOS (Basic OS) that was developed for ACS/Dunder. Another nice thing that came out of this project was ASU (Application Support System). That is something I really miss in OTP. I suppose that the generic behaviours and the message passing may have been partly inspired by ASU, but I don't know that any of it actually found its way into OTP. It may have been that ASU was developed locally at EBC? I used ASU + BOS in the Mobility Server I project, the first commercial product developed in Erlang. Later in Mobility Server II we used ASU + OTP. The protocol layers used only OTP, but for the application layers ASU proved invaluable. It contained wonderful things like the generic feature agent with the interpose point mechanism. (There are probably technical descriptions available somewhere out there...) Great stuff. I would definitely use it for application development if it wasn't for the legal aspects. Does anyone know who actually owns the rights? It may have been part of the deal when Ericsson sold the Mobility Server to Ascom a few years ago, but I'm not sure. /OLA. > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Claes Wikstrom > Sent: den 16 augusti 2006 10:28 > To: Richard A. O'Keefe > Cc: erlang-questions@REDACTED > Subject: Re: Patently I'm confused > > Richard A. O'Keefe wrote: > > > As near as I can figure out, they are claiming anything > even remotely > > similar to Erlang/OTP, but that can't be right, surely. > > > > Does anyone know what the heck that patent is about, and to what > > degree Erlang/OTP is affected by it? > > > > If I recall correctly, when erlang went opensource, /// > renounced all rights to any patents part of the OTP release. > This included two of my mnesia related patents (no links) > > /klacke > > -- > Claes Wikstrom -- Caps lock is nowhere and > http://www.hyber.org -- everything is under control > cellphone: +46 70 2097763 > From ft@REDACTED Thu Aug 17 14:26:42 2006 From: ft@REDACTED (Fredrik Thulin) Date: Thu, 17 Aug 2006 14:26:42 +0200 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <17636.23172.37608.399423@alkaid.it.uu.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> Message-ID: <200608171426.42775.ft@it.su.se> On Thursday 17 August 2006 14:01, Mikael Pettersson wrote: ... > suffix), but the only thing missing is a safety check to see if the > CPU has SSE2 or not before SSE2 FP exceptions are enabled. Hi Is that going to be a build-time or run-time check? At Stockholm university, we regularly build Erlang on one computer, and then use the resulting binaries on many. Distributions with binary pre-compiled packages like Debian would also be concerned I guess. /Fredrik From mikpe@REDACTED Thu Aug 17 14:39:24 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 17 Aug 2006 14:39:24 +0200 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <200608171426.42775.ft@it.su.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <200608171426.42775.ft@it.su.se> Message-ID: <17636.25468.112644.410123@alkaid.it.uu.se> Fredrik Thulin writes: > On Thursday 17 August 2006 14:01, Mikael Pettersson wrote: > ... > > suffix), but the only thing missing is a safety check to see if the > > CPU has SSE2 or not before SSE2 FP exceptions are enabled. > > Hi > > Is that going to be a build-time or run-time check? At Stockholm > university, we regularly build Erlang on one computer, and then use the > resulting binaries on many. Distributions with binary pre-compiled > packages like Debian would also be concerned I guess. It will be a run-time check on x86-32. Binaries will still run on older non-SSE2 processors. The only new requirement is that the build environment must have an assembler that recognises the stmxcsr and ldmxcsr instructions. (If it doesn't, then the test in erts/configure will fail, FP exceptions will be disabled, and HiPE won't work for FP code unless you compile with no_inline_fp.) From mats.cronqvist@REDACTED Thu Aug 17 14:54:28 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Thu, 17 Aug 2006 14:54:28 +0200 Subject: Parsers for C written in Erlang In-Reply-To: References: Message-ID: <44E46704.2080605@ericsson.com> Joel Reymont wrote: > I'm thinking of how I would approach the Cocoa bridge in Erlang. There > are to basic approaches: parsing the Objective-C header files to wrap > the classes and using the runtime type inspection. this is The Right Thing (tm), methinks. i do it for gtkNode. alas, i cheat and use h2def.py (from www.pygtk.org). i don't know if that'll work for objective-C, though. mats From goertzen@REDACTED Thu Aug 17 15:11:57 2006 From: goertzen@REDACTED (Daniel Goertzen) Date: Thu, 17 Aug 2006 08:11:57 -0500 Subject: qt4 bindings? Message-ID: <44E46B1D.1000006@ertw.com> I've been exploring the possibility of creating erlang qt4 (http://www.trolltech.com/products/qt) bindings, so before I get too far I thought I'd ask if anyone else has thought about this or done any work. Cheers, Dan. From yarivvv@REDACTED Thu Aug 17 15:32:31 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 17 Aug 2006 09:32:31 -0400 Subject: Erlang article #1 on programming.reddit.com Message-ID: <17244f480608170632l757b64bbhf77839e6ba49969d@mail.gmail.com> Hi, I think there's definitely a growing interest in the developer community about Erlang. Yesterday, I wrote an article, "Why Erlang Is A Great Language for Concurrent Programming", and now it's the #1 link on programming.reddit.com :) http://yarivsblog.com/articles/2006/08/16/why-erlang-is-a-great-language-for-concurrent-programming http://yarivsblog.com/articles/2006/08/17/1-on-programming-reddit-com This is also the second time my article about Erlang has reached the front page of reddit.com. Together, these articles have been getting many thousands of hits. I've been getting a lot of great feedback from non-Erlangers who want to learn more about it. You can check out some of the comments on my blog. Could it be that the community at large is starting to "see the light"? Time will tell :) Best, Yariv From yarivvv@REDACTED Thu Aug 17 15:32:31 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 17 Aug 2006 09:32:31 -0400 Subject: Erlang article #1 on programming.reddit.com Message-ID: <17244f480608170632l757b64bbhf77839e6ba49969d@mail.gmail.com> Hi, I think there's definitely a growing interest in the developer community about Erlang. Yesterday, I wrote an article, "Why Erlang Is A Great Language for Concurrent Programming", and now it's the #1 link on programming.reddit.com :) http://yarivsblog.com/articles/2006/08/16/why-erlang-is-a-great-language-for-concurrent-programming http://yarivsblog.com/articles/2006/08/17/1-on-programming-reddit-com This is also the second time my article about Erlang has reached the front page of reddit.com. Together, these articles have been getting many thousands of hits. I've been getting a lot of great feedback from non-Erlangers who want to learn more about it. You can check out some of the comments on my blog. Could it be that the community at large is starting to "see the light"? Time will tell :) Best, Yariv From Martin.Logan@REDACTED Thu Aug 17 16:29:17 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Thu, 17 Aug 2006 09:29:17 -0500 Subject: Tutorials Message-ID: <9CB79C836F98504C81BF082C4291E987792AE4@CHITDSEXC02.tds.corp.cendant.org> All, I would like to collect and format all the existing tutorials for erlang/otp. I would like anyone that has written a tutorial about anything to please forward it to me or the list. I am going to endeavor to format them, perhaps copy the style of the erlang docs, but I am not positive, and then make them available. I will credit the authors of course. I think it would be helpful for new people coming to the language to have a nice compendium of tutorials. You can forward me the tutorials in any form and I will do the work to get them all formatted nicely and then email the collection, as a pdf, back out as well as make it available on the web. Cheers, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsu79@REDACTED Thu Aug 17 16:49:41 2006 From: chsu79@REDACTED (Christian S) Date: Thu, 17 Aug 2006 16:49:41 +0200 Subject: qt4 bindings? In-Reply-To: <44E46B1D.1000006@ertw.com> References: <44E46B1D.1000006@ertw.com> Message-ID: My suggestion is to do it in style with gtkNode. A separate port program. On 8/17/06, Daniel Goertzen wrote: > I've been exploring the possibility of creating erlang qt4 > (http://www.trolltech.com/products/qt) bindings, so before I get too far > I thought I'd ask if anyone else has thought about this or done any work. > > Cheers, > Dan. > From mats.cronqvist@REDACTED Thu Aug 17 16:58:04 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Thu, 17 Aug 2006 16:58:04 +0200 Subject: qt4 bindings? In-Reply-To: References: <44E46B1D.1000006@ertw.com> Message-ID: <44E483FC.6070809@ericsson.com> Christian S wrote: > My suggestion is to do it in style with gtkNode. A separate port program. a fine suggestion. however, i guess i have to point out that gtkNode is a C-node, and not a port program. erlgtk is a port program GTK binding. mats From joelr1@REDACTED Thu Aug 17 17:38:45 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 17 Aug 2006 16:38:45 +0100 Subject: qt4 bindings? In-Reply-To: <44E483FC.6070809@ericsson.com> References: <44E46B1D.1000006@ertw.com> <44E483FC.6070809@ericsson.com> Message-ID: <2FD85315-7B95-40D1-B9E9-A6FD1CB221A0@gmail.com> On Aug 17, 2006, at 3:58 PM, Mats Cronqvist wrote: > a fine suggestion. however, i guess i have to point out that > gtkNode is a C-node, and not a port program. Doesn't the C-node approach incur the overhead of sending stuff over the network? Is the assumption that the overhead is not significant enough? -- http://wagerlabs.com/ From mats.cronqvist@REDACTED Thu Aug 17 17:42:37 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Thu, 17 Aug 2006 17:42:37 +0200 Subject: qt4 bindings? In-Reply-To: <2FD85315-7B95-40D1-B9E9-A6FD1CB221A0@gmail.com> References: <44E46B1D.1000006@ertw.com> <44E483FC.6070809@ericsson.com> <2FD85315-7B95-40D1-B9E9-A6FD1CB221A0@gmail.com> Message-ID: <44E48E6D.30704@ericsson.com> Joel Reymont wrote: > > On Aug 17, 2006, at 3:58 PM, Mats Cronqvist wrote: > >> a fine suggestion. however, i guess i have to point out that gtkNode >> is a C-node, and not a port program. > > Doesn't the C-node approach incur the overhead of sending stuff over the > network? Is the assumption that the overhead is not significant enough? i would guess there's additional overhead. i would further guess it's insignificant. it makes it a whole lot *easier* to send stuff over the network, though. mats From abailly@REDACTED Thu Aug 17 17:58:01 2006 From: abailly@REDACTED (Arnaud Bailly) Date: Thu, 17 Aug 2006 17:58:01 +0200 Subject: newbie questions Message-ID: <87bqqjuzg6.fsf@oqube.com> Hi to all erlangers, I am newcomer on this list and wishes to quickly introduce myself before asking some questions. Impatient readers can skip part I. I) Background I have been aware of erlang's existence for several years (since the beginning of my PhD in fact) but never took time to really learn it and make something useful. My interest for erlang is motivated by; - an "theoretical" interest for 1) functional programming languages, 2) distributed software development, 3) software reliability improvement - the will to walk different paths, beyond and over the current duality (at least in part of information systems engineering) Java vs. Microsoft. I have been doing intensive coding in Java for the last 8 years and always felt embarassed by some aspects of the language. This has grown to frustration when I started to work in IS context for various reasons mainly related to the unnecessary repetitive aspect of most computer engineering tasks taking place in such a context and the difficulty to promote different ways of thinking. Now that I have settled myself as an independent contractor, I want to take some time to try other ways and build a serious alternative offer around non standard solutions providing improved reliability and shorter development time. So I started a small project aimed at comparing various solutions for implementing a basic web application with an eye towards automated model based code generation, test cases generation and eventually trying to use "serious" verification tools like model-checkers. II) Questions Some questions about erlang that I did found answer for in the docs (not that I searched very deeply): 1. is there any testing framework equivalent to junit in erlang world (may be erlangers dont test, but I don't think so :-) ) ? I am also thinking about associated tools like code coverage measurements or test cases generators... 2. in the same line of thought, is there something equivalent to maven or ant ? Is emake that kind of tool ? 3. I read here and there that erlang's support of string is inefficient and does not handle international character sets (eg. UTF-8 encoding). This may be (or not) an issue for web based development. Is this true ? Thanks a lot and my apologies for being somewhat verbose (java coder bad manners :-) ) -- OQube < software engineering \ g?nie logiciel > Arnaud Bailly, Dr. \web> http://www.oqube.com From joelr1@REDACTED Thu Aug 17 17:58:15 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 17 Aug 2006 16:58:15 +0100 Subject: qt4 bindings? In-Reply-To: <44E48E6D.30704@ericsson.com> References: <44E46B1D.1000006@ertw.com> <44E483FC.6070809@ericsson.com> <2FD85315-7B95-40D1-B9E9-A6FD1CB221A0@gmail.com> <44E48E6D.30704@ericsson.com> Message-ID: <536FC36A-C96F-4740-8330-5DC04D1ACC45@gmail.com> Well, I can just see matrices, arrays and structures flying back and forth :-). On Aug 17, 2006, at 4:42 PM, Mats Cronqvist wrote: > i would guess there's additional overhead. i would further guess > it's insignificant. > it makes it a whole lot *easier* to send stuff over the network, > though. > > mats -- http://wagerlabs.com/ From alexander.harju@REDACTED Thu Aug 17 18:31:44 2006 From: alexander.harju@REDACTED (Alexander Harju) Date: Thu, 17 Aug 2006 18:31:44 +0200 Subject: Problem with trap_exit Message-ID: <44E499F0.7090706@mobilearts.com> Hi all. I'm having some problem trying to trap an exit in a gen_fsm. I've made this small example of the problem attached to this mail. It's a gen_server (test_server.erl) that starts a gen_fsm (test_fsm.erl) using gen_fsm:start_link(...) When I by purpose crash the server I expect that the handle_info-function in the state-machine to handle the {'EXIT', ...}-signal since I've turned on trap_exit. Instead the terminte is called with the reason for the crash. Why is the signal not traped? Thanks, // Alex The server: -module(test_server). -behaviour(gen_server). -export([start/0, send/1, crash/0, stop/0]). -export([init/1, handle_call/3, handle_cast/2, terminate/2, handle_info/3]). -define(debug(S,A,F), io:format("** ~p - ~p [~p] "++S++"\n", [?MODULE, F, ?LINE | A])). start() -> gen_server:start({local, ?MODULE}, ?MODULE, [], []). send(Msg) -> gen_server:call(?MODULE, {send, Msg}). crash() -> gen_server:call(?MODULE, crash). stop() -> gen_server:cast(?MODULE, stop). init([]) -> {ok, Pid} = test_fsm:start_link(), ?debug("Server: ~p and fsm: ~p started...", [self(), Pid], init), {ok, []}. handle_call({send, Msg}, _From, State) -> ?debug("Sending msg: ~p to the fsm", [Msg], handle_call), test_fsm:send(Msg), {reply, ok, State}; handle_call(crash, _From, State) -> ?debug("Server will crash...", [], handle_call), Reply = a + b, {reply, Reply, State}; handle_call(Msg, _From, State) -> ?debug("Received unkown call: ~p", [Msg], handle_call), {stop, normal, State}. handle_cast(stop, State) -> {stop, normal, State}. handle_info(Info, _From, State) -> ?debug("Received info: ~p", [Info], handle_info), {stop, normal, State}. terminate(Reason, _State) -> ?debug("Terminating with reason: ~p", [Reason], terminate), ok. and the state-machine: -module(test_fsm). -behavior(gen_fsm). -export([start_link/0, stop/0, send/1]). -export([init/1, state/2, handle_info/3, handle_event/3, terminate/3]). -define(debug(S,A,F), io:format("** ~p - ~p [~p] "++S++"\n", [?MODULE, F, ?LINE | A])). start_link() -> gen_fsm:start_link({local, ?MODULE}, ?MODULE, [], []). stop() -> gen_fsm:send_all_state_event(?MODULE, stop). send(Msg) -> gen_fsm:send_event(?MODULE, Msg). init([]) -> process_flag(trap_exit, true), {ok, state, []}. state(Msg, State) -> ?debug("Message received: ~p", [Msg], state), {next_state, state, State}. handle_info(Info, StateN, StateD) -> ?debug("Received info: ~p in state: ~p, ~p", [Info, StateN, StateD], handle_info), {next_state, StateN, StateD}. handle_event(stop, _StateN, StateD) -> ?debug("Stopping fsm...", [], first), {stop, normal, StateD}. terminate(Reason, StateN, StateD) -> ?debug("Terminating in state: ~p, ~p with reason: ~p", [StateN, StateD, Reason], terminate), ok. From ryanobjc@REDACTED Thu Aug 17 18:53:07 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Thu, 17 Aug 2006 09:53:07 -0700 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <17244f480608170632l757b64bbhf77839e6ba49969d@mail.gmail.com> References: <17244f480608170632l757b64bbhf77839e6ba49969d@mail.gmail.com> Message-ID: <78568af10608170953j4ed24f7cja4f2357bf0eee8ff@mail.gmail.com> I think people are looking for a silver bullet, and that is what is driving Erlang interest. I beg of all of you - no for loops. No looping of any kind! -ryan > Could it be that the community at large is starting to "see the light"? > > Time will tell :) > > Best, > Yariv > From ryanobjc@REDACTED Thu Aug 17 19:01:11 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Thu, 17 Aug 2006 10:01:11 -0700 Subject: Parsers for C written in Erlang In-Reply-To: <44E46704.2080605@ericsson.com> References: <44E46704.2080605@ericsson.com> Message-ID: <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> I can't really say about CL, but Objective C has excellent run time discovery. Additionally all data members of a class are private, so there is no way or reason to allow access to them. Only the messages matter, these are all run-time discoverable. In fact, why bother with run-time type inspection? Just send a message to an object and be prepared to handle the exception... -ryan On 8/17/06, Mats Cronqvist wrote: > Joel Reymont wrote: > > I'm thinking of how I would approach the Cocoa bridge in Erlang. There > > are to basic approaches: parsing the Objective-C header files to wrap > > the classes and using the runtime type inspection. > > this is The Right Thing (tm), methinks. i do it for gtkNode. alas, i cheat > and use h2def.py (from www.pygtk.org). i don't know if that'll work for > objective-C, though. > > mats > From rsaccon@REDACTED Thu Aug 17 19:02:11 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Thu, 17 Aug 2006 14:02:11 -0300 Subject: new to erlang: need ideas for server software In-Reply-To: References: Message-ID: at my approach to cometd and primarly as erlang learnig exercise, and inspired by Chris Double's Push server code I just ported the Python reference implementation to Erlang, but it's not finished yet. Joe, I can't answer your questions (but I am also interested in the answer). Your thoughts about additional messages in the protocol set are very interesting, are you going to post them on the cometd maillist ? If not, I am going post there a link to this discussion, because the protocol is not yet frozen at all, AFAIK. On 8/17/06, Joe Armstrong (TN/EAB) wrote: > > Interesting - can somebody answer the following: > > cometd looks to be a ideal application for Erlang. I have written this > try of application *many times* > > > > Now I have some questions about cometd. > > - Is this an "interesting" application - ie if implemented in an > efficient manner will > anybody be interested and use the implementation? > > - Just how high performance is desirable? > > How many message/sec should a single server handle? > How many simultaneously open connections should a single server > handle? > > Also > How frozen is the protocol? > > A really large server would benefit from an addition message in the > protocol set, > for example: > > * redirect (client - server message) > * hand-over (server - server message) > > redirect can move a connection to a new server, the server send > redirect to the client > with a new server IP. The client closes the connection and connects to > the new server. > > hand-over is used between server to negotiate a redirection before it > occurs.'' > > This can be used for: > > - load balancing (a busy server can redirect connections to a > unloaded server) > - taking a server out of service, without interrupting the service > - scaling the capacity of the server. > > > /Joe > > > > -----Original Message----- > > From: owner-erlang-questions@REDACTED > > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Roberto Saccon > > Sent: den 17 augusti 2006 04:32 > > To: erlang-questions@REDACTED > > Subject: Re: new to erlang: need ideas for server software > > > > oh, this is exactly what I am working on right now. > > > > > A cometd implementation: > > > > > > http://cometd.com/ > > > > -- > > Roberto Saccon > > > -- Roberto Saccon From joelr1@REDACTED Thu Aug 17 19:13:45 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 17 Aug 2006 18:13:45 +0100 Subject: Objective-C and runtime type inspection In-Reply-To: <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> References: <44E46704.2080605@ericsson.com> <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> Message-ID: <46D42A97-3F2F-4BD6-8C52-0B75083D62E7@gmail.com> On Aug 17, 2006, at 6:01 PM, Ryan Rawson wrote: > In fact, why bother with run-time type inspection? Just send a > message to an object and be prepared to handle the exception... To perform translations of structures and the like, I suppose. -- http://wagerlabs.com/ From ryanobjc@REDACTED Thu Aug 17 19:15:38 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Thu, 17 Aug 2006 10:15:38 -0700 Subject: Objective-C and runtime type inspection In-Reply-To: <46D42A97-3F2F-4BD6-8C52-0B75083D62E7@gmail.com> References: <44E46704.2080605@ericsson.com> <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> <46D42A97-3F2F-4BD6-8C52-0B75083D62E7@gmail.com> Message-ID: <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> what structures? There _are_ no structures to inspect... All you have is an opaque object reference that you can then send messages to. Objective C is more like smalltalk than C++/Java/etc. You cannot mess with the fields of an object. They are 100% opaque (technically they are C structs, but you are asking for trouble to inspect them). Also, why doesn't your email thread up with the other message? -ryan On 8/17/06, Joel Reymont wrote: > > On Aug 17, 2006, at 6:01 PM, Ryan Rawson wrote: > > > In fact, why bother with run-time type inspection? Just send a > > message to an object and be prepared to handle the exception... > > To perform translations of structures and the like, I suppose. > > -- > http://wagerlabs.com/ > > > > > > From mickael.remond@REDACTED Thu Aug 17 19:24:00 2006 From: mickael.remond@REDACTED (Mickael Remond) Date: 17 Aug 2006 19:24:00 +0200 Subject: newbie questions Message-ID: <3238687445.3283848@smtp.fusemail.net> Hello, regarding testing, you should have a look at eunit. A new reworked version (by Richard Carlsson) is available from: http://svn.process-one.net/contribs/trunk/ Please note that this version is still in development. Cheers, -- Mickael Remond http://www.process-one.net/ From Martin.Logan@REDACTED Thu Aug 17 19:28:38 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Thu, 17 Aug 2006 12:28:38 -0500 Subject: Tutorials In-Reply-To: <9CB79C836F98504C81BF082C4291E987792AE4@CHITDSEXC02.tds.corp.cendant.org> Message-ID: <9CB79C836F98504C81BF082C4291E987792AEB@CHITDSEXC02.tds.corp.cendant.org> I have gotten a few responses with some good ideas. I think that this can be a community effort and still get done quickly and completely. Here are the steps I think would be best for getting this accomplished - fast 1. Send to the list, this thread, any and all links to tutorials that exist 2. When the posting slows down I will extract a list of links from the thread and someone from trap exit or the erlang wiki can take the time to put them on the website. 3. Start a new thread on suggestions, and hopefully examples, for the layout and structure of the tutorials - I like the format from trap exit and I also like the erlang docs site. 4. Use the wiki to allow people to sign up for tutorials to format - I will volunteer right now to do many of them. 5. Post the final copies on erlang websites all over the net, but have a versioned master copy somewhere for easy updating. Thoughts, comments...? Cheers, Martin ________________________________ From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Logan, Martin Sent: Thursday, August 17, 2006 9:29 AM To: erlang-questions@REDACTED Subject: Tutorials All, I would like to collect and format all the existing tutorials for erlang/otp. I would like anyone that has written a tutorial about anything to please forward it to me or the list. I am going to endeavor to format them, perhaps copy the style of the erlang docs, but I am not positive, and then make them available. I will credit the authors of course. I think it would be helpful for new people coming to the language to have a nice compendium of tutorials. You can forward me the tutorials in any form and I will do the work to get them all formatted nicely and then email the collection, as a pdf, back out as well as make it available on the web. Cheers, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Thu Aug 17 19:35:10 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 17 Aug 2006 18:35:10 +0100 Subject: Objective-C and runtime type inspection In-Reply-To: <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> References: <44E46704.2080605@ericsson.com> <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> <46D42A97-3F2F-4BD6-8C52-0B75083D62E7@gmail.com> <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> Message-ID: On Aug 17, 2006, at 6:15 PM, Ryan Rawson wrote: > what structures? There _are_ no structures to inspect... All you have > is an opaque object reference that you can then send messages to. What I mean is that you can use RTTI to find the signature of the function, including the argument types. For structures you get the field types. See the NSRange structure in the example signature below. c24@REDACTED:4o^@8@REDACTED^{_NSRange=II}16o^@20 You can, technically, represent the function arguments as a tuple and just give all elements of a tuple to objc_msgSend but you will crash and burn if you pass some integer where a pointer is expected. An exception won't be forthcoming. > Objective C is more like smalltalk than C++/Java/etc. You cannot mess > with the fields of an object. They are 100% opaque (technically they > are C structs, but you are asking for trouble to inspect them). The object fields are not opaque, instance variables are available for inspection. > Also, why doesn't your email thread up with the other message? Works for me. I did change the subject to match the contents, though. Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Thu Aug 17 19:42:31 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 17 Aug 2006 18:42:31 +0100 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <78568af10608170953j4ed24f7cja4f2357bf0eee8ff@mail.gmail.com> References: <17244f480608170632l757b64bbhf77839e6ba49969d@mail.gmail.com> <78568af10608170953j4ed24f7cja4f2357bf0eee8ff@mail.gmail.com> Message-ID: <7381AEC0-59BD-47FC-9345-8AAE1B83C457@gmail.com> On Aug 17, 2006, at 5:53 PM, Ryan Rawson wrote: > I beg of all of you - no for loops. No looping of any kind! What's wrong with looping? -- http://wagerlabs.com/ From yarivvv@REDACTED Thu Aug 17 20:06:48 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 17 Aug 2006 14:06:48 -0400 Subject: Parsers for C written in Erlang In-Reply-To: <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> References: <44E46704.2080605@ericsson.com> <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> Message-ID: <17244f480608171106o9322e25q9a20193d91ad8b8a@mail.gmail.com> On 8/17/06, Ryan Rawson wrote: > I can't really say about CL, but Objective C has excellent run time > discovery. Additionally all data members of a class are private, so > there is no way or reason to allow access to them. Only the messages > matter, these are all run-time discoverable. If all the messages are run-time discoverable, and there is enough metadata about them, you could probably use Smerl to create their Erlang equivalents in runtime. What do you think? Yariv From hokan.stenholm@REDACTED Thu Aug 17 20:29:30 2006 From: hokan.stenholm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Stenholm?=) Date: Thu, 17 Aug 2006 20:29:30 +0200 Subject: newbie questions In-Reply-To: <87bqqjuzg6.fsf@oqube.com> References: <87bqqjuzg6.fsf@oqube.com> Message-ID: <44E4B58A.9010904@bredband.net> Arnaud Bailly wrote: >Hi to all erlangers, >I am newcomer on this list and wishes to quickly introduce myself >before asking some questions. Impatient readers can skip part I. > >I) Background > >I have been aware of erlang's existence >for several years (since the beginning of my PhD in fact) but never >took time to really learn it and make something useful. My interest >for erlang is motivated by; > - an "theoretical" interest for 1) functional programming languages, > 2) distributed software development, 3) software reliability > improvement > - the will to walk different paths, beyond and over the current > duality (at least in part of information systems engineering) Java > vs. Microsoft. I have been doing intensive coding in Java for the > last 8 years and always felt embarassed by some aspects of the > language. This has grown to frustration when I started to work in IS > context for various reasons mainly related to the unnecessary repetitive aspect > of most computer engineering tasks taking place in such a context and > the difficulty to promote different ways of thinking. > >Now that I have settled myself as an independent contractor, I want to >take some time to try other ways and build a serious alternative offer >around non standard solutions providing improved reliability and >shorter development time. So I started a small project aimed at >comparing various solutions for implementing a basic web application >with an eye towards automated model based code generation, test cases >generation and eventually trying to use "serious" verification tools >like model-checkers. > >II) Questions > >Some questions about erlang that I did found answer for in the docs >(not that I searched very deeply): > 1. is there any testing framework equivalent to junit in erlang world > (may be erlangers dont test, but I don't think so :-) ) ? I am also > thinking about associated tools like code coverage measurements or > test cases generators... > > besides eunit which has already been mentioned, there is also a number OTP tools (http://www.erlang.org/doc/doc-5.5/lib/tools-2.5/doc/html/index.html) like eprof, xref and dialyzer (http://www.erlang.org/doc/doc-5.5/lib/dialyzer-1.4.1/doc/html/index.html) that can be used to profile and check code in various ways. > 2. in the same line of thought, is there something equivalent to > maven or ant ? Is emake that kind of tool ? > > I'm not particular familiar with ant or maven, but you seam to ask about build tools ? I can't say that I've ever heard of any Erlang specific make tools - your best choice is probably to choose one you like and let it call the erlc command (with appropriate flags). note: erlang files are complied indepently and don't require linking, so compile times are usualy short - changing a widly used include file (.hrl) when using make may, on the other hand lead to recompliation of a lot of (.erl) files. > 3. I read here and there that erlang's support of string is > inefficient and does not handle international character sets > (eg. UTF-8 encoding). This may be (or not) an issue for web based > development. Is this true ? > > There has been a fairly long discussion about this on the mailing list recently, search for 'Strings' on the http://forum.trapexit.org/ forum or at http://www.erlang.org/ml-archive/erlang-questions/ Erlang strings are encode as latin-1, although the string data type (a list of integers), is flexible enough to handle most encodings - there will be some issues with things like case conversion, string comparision (if unicode is used) and getting any readable output in the shell, if a non-latin-1 encoding is used. > > >Thanks a lot and my apologies for being somewhat verbose (java coder >bad manners :-) ) > > > From ryanobjc@REDACTED Thu Aug 17 20:30:19 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Thu, 17 Aug 2006 11:30:19 -0700 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <7381AEC0-59BD-47FC-9345-8AAE1B83C457@gmail.com> References: <17244f480608170632l757b64bbhf77839e6ba49969d@mail.gmail.com> <78568af10608170953j4ed24f7cja4f2357bf0eee8ff@mail.gmail.com> <7381AEC0-59BD-47FC-9345-8AAE1B83C457@gmail.com> Message-ID: <78568af10608171130q2da9768dqce61203bb1376729@mail.gmail.com> Surely you jest? You'd have to break Erlang to insert loops. First off you'd have variables that need to be changed. That substantiably breaks Erlang imho. If you want to loop, you probably want to map or fold. If you need to loop you might want to use gen_server instead, or at the last resort use a tail recursive call. On 8/17/06, Joel Reymont wrote: > > On Aug 17, 2006, at 5:53 PM, Ryan Rawson wrote: > > > I beg of all of you - no for loops. No looping of any kind! > > What's wrong with looping? > > -- > http://wagerlabs.com/ > > > > > > From bob@REDACTED Thu Aug 17 20:37:08 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 17 Aug 2006 11:37:08 -0700 Subject: Objective-C and runtime type inspection In-Reply-To: <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> References: <44E46704.2080605@ericsson.com> <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> <46D42A97-3F2F-4BD6-8C52-0B75083D62E7@gmail.com> <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> Message-ID: <6a36e7290608171137v5456349esf1fcca06e0ff59fe@mail.gmail.com> Have you used Objective-C lately Ryan? There are plenty of structures various other non-object data types used in common method calls. Joel definitely knows at least something about what he's talking about. NSPoint, NSError**, etc. However for the majority of cases, you can determine the arity and argument types of an Objective-C selector from the runtime. You'll still likely have problems with varargs and paired arguments, e.g. +[NSArray arrayWithObjects:...] and +[NSArray arrayWithObjects:count:]. In PyObjC we do use a header parser, but only to provide metadata for special cases. -bob On 8/17/06, Ryan Rawson wrote: > what structures? There _are_ no structures to inspect... All you have > is an opaque object reference that you can then send messages to. > > Objective C is more like smalltalk than C++/Java/etc. You cannot mess > with the fields of an object. They are 100% opaque (technically they > are C structs, but you are asking for trouble to inspect them). > > Also, why doesn't your email thread up with the other message? > > -ryan > > On 8/17/06, Joel Reymont wrote: > > > > On Aug 17, 2006, at 6:01 PM, Ryan Rawson wrote: > > > > > In fact, why bother with run-time type inspection? Just send a > > > message to an object and be prepared to handle the exception... > > > > To perform translations of structures and the like, I suppose. > > > > -- > > http://wagerlabs.com/ > > > > > > > > > > > > > From simonpeterchappell@REDACTED Thu Aug 17 20:46:20 2006 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Thu, 17 Aug 2006 13:46:20 -0500 Subject: Tutorials In-Reply-To: <9CB79C836F98504C81BF082C4291E987792AEB@CHITDSEXC02.tds.corp.cendant.org> References: <9CB79C836F98504C81BF082C4291E987792AE4@CHITDSEXC02.tds.corp.cendant.org> <9CB79C836F98504C81BF082C4291E987792AEB@CHITDSEXC02.tds.corp.cendant.org> Message-ID: <8ed733900608171146p366f4560l273aa14cfb7086af@mail.gmail.com> On 8/17/06, Logan, Martin wrote: > > > > I have gotten a few responses with some good ideas. I think that this can > be a community effort and still get done quickly and completely. Here are > the steps I think would be best for getting this accomplished ? fast > > > Send to the list, this thread, any and all links to tutorials that exist > When the posting slows down I will extract a list of links from the thread > and someone from trap exit or the erlang wiki can take the time to put them > on the website. > Start a new thread on suggestions, and hopefully examples, for the layout > and structure of the tutorials ? I like the format from trap exit and I also > like the erlang docs site. > Use the wiki to allow people to sign up for tutorials to format - I will > volunteer right now to do many of them. > Post the final copies on erlang websites all over the net, but have a > versioned master copy somewhere for easy updating. > > > > Thoughts, comments...? > > > > Cheers, > > Martin > > > ________________________________ > > > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of > Logan, Martin > Sent: Thursday, August 17, 2006 9:29 AM > To: erlang-questions@REDACTED > Subject: Tutorials > > > > > All, I would like to collect and format all the existing tutorials for > erlang/otp. I would like anyone that has written a tutorial about anything > to please forward it to me or the list. I am going to endeavor to format > them, perhaps copy the style of the erlang docs, but I am not positive, and > then make them available. I will credit the authors of course. I think it > would be helpful for new people coming to the language to have a nice > compendium of tutorials. You can forward me the tutorials in any form and I > will do the work to get them all formatted nicely and then email the > collection, as a pdf, back out as well as make it available on the web. > > > > Cheers, > > Martin > Here's what I know about: Introductions http://defmacro.org/ramblings/concurrency.html Tutorials http://www.sics.se/~joe/tutorials/robust_server/robust_server.html http://www.sics.se/~joe/tutorials/web_server/web_server.html http://www.sics.se/~joe/tutorials/client_server/client_server.html http://www.sics.se/~joe/tutorials/wiki/wiki.html http://www.kazmier.com/computer/port-howto/ A bunch of Yariv's blog entries: http://yarivsblog.com/ Simon -- www.simonpeter.org From rpettit@REDACTED Thu Aug 17 20:50:26 2006 From: rpettit@REDACTED (Rick Pettit) Date: Thu, 17 Aug 2006 13:50:26 -0500 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <78568af10608171130q2da9768dqce61203bb1376729@mail.gmail.com> References: <17244f480608170632l757b64bbhf77839e6ba49969d@mail.gmail.com> <78568af10608170953j4ed24f7cja4f2357bf0eee8ff@mail.gmail.com> <7381AEC0-59BD-47FC-9345-8AAE1B83C457@gmail.com> <78568af10608171130q2da9768dqce61203bb1376729@mail.gmail.com> Message-ID: <20060817185026.GD22130@vailsys.com> On Thu, Aug 17, 2006 at 11:30:19AM -0700, Ryan Rawson wrote: > Surely you jest? > > You'd have to break Erlang to insert loops. First off you'd have > variables that need to be changed. That substantiably breaks Erlang > imho. Not sure I understand you here. I have recently been using Joe Armstrong's robust TCP server, for example, and in that there is the notion of a "controller" loop for synchronizing operations among multiple socket handlers. For "simple servers" (i.e. those not requiring a behaviour like gen_server) I see tail-recursive server loop constructs all the time. Single assignment isn't a problem considering each new iteration through the loop allows for new local variable bindings, etc. > If you want to loop, you probably want to map or fold. If you need to > loop you might want to use gen_server instead, or at the last resort > use a tail recursive call. What do you think goes on behind the scenes in a map, fold, or even gen_server? You might be surprised to find that there is a server loop in a gen_server (it is what passes the state to gen_server callbacks, and it is what the gen_server callbacks return the state to). Perhaps I misunderstand you. -Rick > On 8/17/06, Joel Reymont wrote: > > > >On Aug 17, 2006, at 5:53 PM, Ryan Rawson wrote: > > > >> I beg of all of you - no for loops. No looping of any kind! > > > >What's wrong with looping? > > > >-- > >http://wagerlabs.com/ > > > > > > > > > > > > From joelr1@REDACTED Thu Aug 17 21:01:13 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 17 Aug 2006 20:01:13 +0100 Subject: Objective-C and runtime type inspection In-Reply-To: <6a36e7290608171137v5456349esf1fcca06e0ff59fe@mail.gmail.com> References: <44E46704.2080605@ericsson.com> <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> <46D42A97-3F2F-4BD6-8C52-0B75083D62E7@gmail.com> <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> <6a36e7290608171137v5456349esf1fcca06e0ff59fe@mail.gmail.com> Message-ID: <6ABF2844-6D80-44B6-A970-1C3BBB2E9DCD@gmail.com> On Aug 17, 2006, at 7:37 PM, Bob Ippolito wrote: > You'll still likely have problems with varargs and paired > arguments, e.g. > +[NSArray arrayWithObjects:...] I don't remember off hand how this case is handled but all functions have a definite type signature. Maybe the varargs go in as an array or something. I'll need to inspect NSArray. > and +[NSArray arrayWithObjects:count:]. This is an easy case because the selector (method name represented as a string) is exactly "arrayWithObjects:count:". I didn't think of it this way but I can try going totally dynamic. I could do RTTI the first time a selector is invoked and cache the info in a dict, gb_tree or ets table. The whole point of importing or parsing headers is to generate functions whereas Erlang, just like Objective-C, works by message- passing. Thanks, Joel -- http://wagerlabs.com/ From bob@REDACTED Thu Aug 17 21:14:50 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 17 Aug 2006 12:14:50 -0700 Subject: Objective-C and runtime type inspection In-Reply-To: <6ABF2844-6D80-44B6-A970-1C3BBB2E9DCD@gmail.com> References: <44E46704.2080605@ericsson.com> <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> <46D42A97-3F2F-4BD6-8C52-0B75083D62E7@gmail.com> <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> <6a36e7290608171137v5456349esf1fcca06e0ff59fe@mail.gmail.com> <6ABF2844-6D80-44B6-A970-1C3BBB2E9DCD@gmail.com> Message-ID: <6a36e7290608171214w2b62ad44s2c69a2ab423e2e5c@mail.gmail.com> On 8/17/06, Joel Reymont wrote: > > On Aug 17, 2006, at 7:37 PM, Bob Ippolito wrote: > > > You'll still likely have problems with varargs and paired > > arguments, e.g. > > +[NSArray arrayWithObjects:...] > > I don't remember off hand how this case is handled but all functions > have a definite type signature. Maybe the varargs go in as an array > or something. I'll need to inspect NSArray. PyObjC is by far the easiest way to poke at this stuff... $ python Python 2.4.3 (#1, Apr 7 2006, 10:54:33) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from Foundation import NSArray >>> NSArray.arrayWithObjects_.signature '@12@REDACTED:4@REDACTED' varargs is not covered by type encodings, it looks like a single object. You simply can't know that it's supposed to be nil terminated varargs. > > and +[NSArray arrayWithObjects:count:]. > > This is an easy case because the selector (method name represented as > a string) is exactly "arrayWithObjects:count:". >>> NSArray.arrayWithObjects_count_.signature '@16@REDACTED:4^@8I12' Well, all you know its that it's an id pointer and an integer, not that it's supposed to be an array of id plus exactly the length of that array. > I didn't think of it this way but I can try going totally dynamic. I > could do RTTI the first time a selector is invoked and cache the info > in a dict, gb_tree or ets table. That's sort-of what we do in PyObjC. We do it for a whole class at a time, but same idea. > The whole point of importing or parsing headers is to generate > functions whereas Erlang, just like Objective-C, works by message- > passing. Probably better off with just using atoms to represent selectors instead of generating a million functions. Maybe something like: msg(Self, Selector, [Args]) -> ... Which is basically the same as objc_msgSend except using a list instead of varargs. I really do hope you choose to make the objc binding open source, because if you don't someone else is going to have to duplicate the work eventually. -bob From joelr1@REDACTED Thu Aug 17 21:31:18 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 17 Aug 2006 20:31:18 +0100 Subject: Objective-C and runtime type inspection In-Reply-To: <6a36e7290608171214w2b62ad44s2c69a2ab423e2e5c@mail.gmail.com> References: <44E46704.2080605@ericsson.com> <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> <46D42A97-3F2F-4BD6-8C52-0B75083D62E7@gmail.com> <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> <6a36e7290608171137v5456349esf1fcca06e0ff59fe@mail.gmail.com> <6ABF2844-6D80-44B6-A970-1C3BBB2E9DCD@gmail.com> <6a36e7290608171214w2b62ad44s2c69a2ab423e2e5c@mail.gmail.com> Message-ID: <64418ADD-0003-4E36-AE84-06DA3D5851A6@gmail.com> On Aug 17, 2006, at 8:14 PM, Bob Ippolito wrote: > varargs is not covered by type encodings, it looks like a single > object. You simply can't know that it's supposed to be nil terminated > varargs. Pain in the rear, yes. So long as one can build a varags list by hand in C (I think you can) it would still be manageable, though. You would just give objc_msgSend the object, the selector and then the varargs list built from the arguments list. > Well, all you know its that it's an id pointer and an integer, not > that it's supposed to be an array of id plus exactly the length of > that array. I guess it would be up to the programmer to make sure that proper arguments are given. I figure I can pass structures as binaries and pointers as ints. > Probably better off with just using atoms to represent selectors > instead of generating a million functions. Maybe something like: > > msg(Self, Selector, [Args]) -> ... > > Which is basically the same as objc_msgSend except using a list > instead of varargs. Yes, that's exactly what I'm thinking about. I also want to make the Obj-C runtime a driver as opposed to a C-node. I don't want the networking overhead but I'm easily swayed. > I really do hope you choose to make the objc binding open source, > because if you don't someone else is going to have to duplicate the > work eventually. Yes, I'll release them under the Erlang license. With everyone reviewing the code and trying out it will go much faster. -- http://wagerlabs.com/ From Martin.Logan@REDACTED Thu Aug 17 21:36:43 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Thu, 17 Aug 2006 14:36:43 -0500 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <78568af10608171130q2da9768dqce61203bb1376729@mail.gmail.com> Message-ID: <9CB79C836F98504C81BF082C4291E987792AED@CHITDSEXC02.tds.corp.cendant.org> You are scaring me, who is talking of adding loops. I will stop using Erlang if I see a for loop :-) No more single assignment? That would make Erlang rather messy. Plus function clauses and recursion + loops inside function clauses themselves will greatly increase the cognative load imposed upon anyone trying to understand Erlang code. One of the greatest things about Erlang is that after a few months of coding it you can dive into the kernel, read code, and understand what you are reading - try doing that with Java, damn, try doing that with any OO/procedural language. Martin -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Ryan Rawson Sent: Thursday, August 17, 2006 1:30 PM To: Joel Reymont Cc: Yariv Sadan; erlangquestions Subject: Re: Erlang article #1 on programming.reddit.com Surely you jest? You'd have to break Erlang to insert loops. First off you'd have variables that need to be changed. That substantiably breaks Erlang imho. If you want to loop, you probably want to map or fold. If you need to loop you might want to use gen_server instead, or at the last resort use a tail recursive call. On 8/17/06, Joel Reymont wrote: > > On Aug 17, 2006, at 5:53 PM, Ryan Rawson wrote: > > > I beg of all of you - no for loops. No looping of any kind! > > What's wrong with looping? > > -- > http://wagerlabs.com/ > > > > > > From bob@REDACTED Thu Aug 17 21:38:59 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 17 Aug 2006 12:38:59 -0700 Subject: Objective-C and runtime type inspection In-Reply-To: <64418ADD-0003-4E36-AE84-06DA3D5851A6@gmail.com> References: <44E46704.2080605@ericsson.com> <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> <46D42A97-3F2F-4BD6-8C52-0B75083D62E7@gmail.com> <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> <6a36e7290608171137v5456349esf1fcca06e0ff59fe@mail.gmail.com> <6ABF2844-6D80-44B6-A970-1C3BBB2E9DCD@gmail.com> <6a36e7290608171214w2b62ad44s2c69a2ab423e2e5c@mail.gmail.com> <64418ADD-0003-4E36-AE84-06DA3D5851A6@gmail.com> Message-ID: <6a36e7290608171238i5700095uf754d2645fccfaae@mail.gmail.com> On 8/17/06, Joel Reymont wrote: > > On Aug 17, 2006, at 8:14 PM, Bob Ippolito wrote: > > > varargs is not covered by type encodings, it looks like a single > > object. You simply can't know that it's supposed to be nil terminated > > varargs. > > Pain in the rear, yes. So long as one can build a varags list by hand > in C (I think you can) it would still be manageable, though. You > would just give objc_msgSend the object, the selector and then the > varargs list built from the arguments list. We use libffi for that. The version in the PyObjC repository is patched to work on Mac OS X Intel (I don't think the official one supports that yet). > > Well, all you know its that it's an id pointer and an integer, not > > that it's supposed to be an array of id plus exactly the length of > > that array. > > I guess it would be up to the programmer to make sure that proper > arguments are given. I figure I can pass structures as binaries and > pointers as ints. What about a pointer to a structure, output structures, input/output structures? > > Probably better off with just using atoms to represent selectors > > instead of generating a million functions. Maybe something like: > > > > msg(Self, Selector, [Args]) -> ... > > > > Which is basically the same as objc_msgSend except using a list > > instead of varargs. > > Yes, that's exactly what I'm thinking about. I also want to make the > Obj-C runtime a driver as opposed to a C-node. I don't want the > networking overhead but I'm easily swayed. The networking overhead is going to be irrelevant for the most part. None of the messages in a typical Cocoa app are big unless they're creating NSBitmapImageRep from memory or something. I'd make it a C-node personally. > > I really do hope you choose to make the objc binding open source, > > because if you don't someone else is going to have to duplicate the > > work eventually. > > Yes, I'll release them under the Erlang license. With everyone > reviewing the code and trying out it will go much faster. Excellent. -bob From Martin.Logan@REDACTED Thu Aug 17 21:43:34 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Thu, 17 Aug 2006 14:43:34 -0500 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <20060817185026.GD22130@vailsys.com> Message-ID: <9CB79C836F98504C81BF082C4291E987792AEE@CHITDSEXC02.tds.corp.cendant.org> Rick, you are correct but technically the process loops in Erlang are implemented via tail recursion. I think this is where the misunderstanding came about. Procedural looping structures such as "for", "while", "do while", and "foreach" are the sorts of looping constructs that would severely damage Erlang as a language, IMHO. Cheers, Martin -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Rick Pettit Sent: Thursday, August 17, 2006 1:50 PM To: Ryan Rawson Cc: Joel Reymont; Yariv Sadan; erlangquestions Subject: Re: Erlang article #1 on programming.reddit.com On Thu, Aug 17, 2006 at 11:30:19AM -0700, Ryan Rawson wrote: > Surely you jest? > > You'd have to break Erlang to insert loops. First off you'd have > variables that need to be changed. That substantiably breaks Erlang > imho. Not sure I understand you here. I have recently been using Joe Armstrong's robust TCP server, for example, and in that there is the notion of a "controller" loop for synchronizing operations among multiple socket handlers. For "simple servers" (i.e. those not requiring a behaviour like gen_server) I see tail-recursive server loop constructs all the time. Single assignment isn't a problem considering each new iteration through the loop allows for new local variable bindings, etc. > If you want to loop, you probably want to map or fold. If you need to > loop you might want to use gen_server instead, or at the last resort > use a tail recursive call. What do you think goes on behind the scenes in a map, fold, or even gen_server? You might be surprised to find that there is a server loop in a gen_server (it is what passes the state to gen_server callbacks, and it is what the gen_server callbacks return the state to). Perhaps I misunderstand you. -Rick > On 8/17/06, Joel Reymont wrote: > > > >On Aug 17, 2006, at 5:53 PM, Ryan Rawson wrote: > > > >> I beg of all of you - no for loops. No looping of any kind! > > > >What's wrong with looping? > > > >-- > >http://wagerlabs.com/ > > > > > > > > > > > > From joelr1@REDACTED Thu Aug 17 21:50:56 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 17 Aug 2006 20:50:56 +0100 Subject: Objective-C and runtime type inspection In-Reply-To: <6a36e7290608171238i5700095uf754d2645fccfaae@mail.gmail.com> References: <44E46704.2080605@ericsson.com> <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> <46D42A97-3F2F-4BD6-8C52-0B75083D62E7@gmail.com> <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> <6a36e7290608171137v5456349esf1fcca06e0ff59fe@mail.gmail.com> <6ABF2844-6D80-44B6-A970-1C3BBB2E9DCD@gmail.com> <6a36e7290608171214w2b62ad44s2c69a2ab423e2e5c@mail.gmail.com> <64418ADD-0003-4E36-AE84-06DA3D5851A6@gmail.com> <6a36e7290608171238i5700095uf754d2645fccfaae@mail.gmail.com> Message-ID: <6079EBA4-2742-4A8B-99F2-2C49E3707330@gmail.com> On Aug 17, 2006, at 8:38 PM, Bob Ippolito wrote: > We use libffi for that. The version in the PyObjC repository is > patched to work on Mac OS X Intel (I don't think the official one > supports that yet). I'll take a look when I get to this. > What about a pointer to a structure, output structures, input/ > output structures? Don't know yet. Output and input/output structures are a chunk of memory, a binary. There's of course no way in Erlang to know the size of the chunk before making it. I'm open to suggestions. > The networking overhead is going to be irrelevant for the most part. > None of the messages in a typical Cocoa app are big unless they're > creating NSBitmapImageRep from memory or something. I'd make it a > C-node personally. Ok, I'll go with that. It can be made a driver later on, if needed. Question, though... How do you make this work as a bundled app? Run erlang like Wings3D does and then fork off the c-node? Thanks, Joel -- http://wagerlabs.com/ From rpettit@REDACTED Thu Aug 17 22:06:14 2006 From: rpettit@REDACTED (Rick Pettit) Date: Thu, 17 Aug 2006 15:06:14 -0500 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <9CB79C836F98504C81BF082C4291E987792AEE@CHITDSEXC02.tds.corp.cendant.org> References: <20060817185026.GD22130@vailsys.com> <9CB79C836F98504C81BF082C4291E987792AEE@CHITDSEXC02.tds.corp.cendant.org> Message-ID: <20060817200614.GA1637@vailsys.com> On Thu, Aug 17, 2006 at 02:43:34PM -0500, Logan, Martin wrote: > Rick, you are correct but technically the process loops in Erlang are > implemented via tail recursion. Then I am technically correct as well (I mentioned tail-recursion below, though it should come as no surprise what happens if you "loop forever" using non-tail recursive calls :-) > I think this is where the misunderstanding came about. Procedural looping > structures such as "for", "while", "do while", and "foreach" are the sorts of > looping constructs that would severely damage Erlang as a language, IMHO. Procedural looping constructs in a non-procedural language doesn't make much sense, which is why I'm not worried about someone trying to add them. -Rick > Cheers, > Martin > > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Rick Pettit > Sent: Thursday, August 17, 2006 1:50 PM > To: Ryan Rawson > Cc: Joel Reymont; Yariv Sadan; erlangquestions > Subject: Re: Erlang article #1 on programming.reddit.com > > On Thu, Aug 17, 2006 at 11:30:19AM -0700, Ryan Rawson wrote: > > Surely you jest? > > > > You'd have to break Erlang to insert loops. First off you'd have > > variables that need to be changed. That substantiably breaks Erlang > > imho. > > Not sure I understand you here. I have recently been using Joe > Armstrong's > robust TCP server, for example, and in that there is the notion of a > "controller" loop for synchronizing operations among multiple socket > handlers. > > For "simple servers" (i.e. those not requiring a behaviour like > gen_server) > I see tail-recursive server loop constructs all the time. > > Single assignment isn't a problem considering each new iteration through > the > loop allows for new local variable bindings, etc. > > > If you want to loop, you probably want to map or fold. If you need to > > loop you might want to use gen_server instead, or at the last resort > > use a tail recursive call. > > What do you think goes on behind the scenes in a map, fold, or even > gen_server? > > You might be surprised to find that there is a server loop in a > gen_server > (it is what passes the state to gen_server callbacks, and it is what the > gen_server callbacks return the state to). > > Perhaps I misunderstand you. > > -Rick > > > On 8/17/06, Joel Reymont wrote: > > > > > >On Aug 17, 2006, at 5:53 PM, Ryan Rawson wrote: > > > > > >> I beg of all of you - no for loops. No looping of any kind! > > > > > >What's wrong with looping? > > > > > >-- > > >http://wagerlabs.com/ > > > > > > > > > > > > > > > > > > From bob@REDACTED Thu Aug 17 22:08:30 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 17 Aug 2006 13:08:30 -0700 Subject: Objective-C and runtime type inspection In-Reply-To: <6079EBA4-2742-4A8B-99F2-2C49E3707330@gmail.com> References: <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> <46D42A97-3F2F-4BD6-8C52-0B75083D62E7@gmail.com> <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> <6a36e7290608171137v5456349esf1fcca06e0ff59fe@mail.gmail.com> <6ABF2844-6D80-44B6-A970-1C3BBB2E9DCD@gmail.com> <6a36e7290608171214w2b62ad44s2c69a2ab423e2e5c@mail.gmail.com> <64418ADD-0003-4E36-AE84-06DA3D5851A6@gmail.com> <6a36e7290608171238i5700095uf754d2645fccfaae@mail.gmail.com> <6079EBA4-2742-4A8B-99F2-2C49E3707330@gmail.com> Message-ID: <6a36e7290608171308o7766cb3aw2415cde6880a0a7a@mail.gmail.com> On 8/17/06, Joel Reymont wrote: > > On Aug 17, 2006, at 8:38 PM, Bob Ippolito wrote: > > > We use libffi for that. The version in the PyObjC repository is > > patched to work on Mac OS X Intel (I don't think the official one > > supports that yet). > > I'll take a look when I get to this. > > > What about a pointer to a structure, output structures, input/ > > output structures? > > Don't know yet. Output and input/output structures are a chunk of > memory, a binary. There's of course no way in Erlang to know the size > of the chunk before making it. > > I'm open to suggestions. What we do in PyObjC is use the RTTI to determine the size of the chunk to allocate, and return a tuple of (rval, output1, ...). > > The networking overhead is going to be irrelevant for the most part. > > None of the messages in a typical Cocoa app are big unless they're > > creating NSBitmapImageRep from memory or something. I'd make it a > > C-node personally. > > Ok, I'll go with that. It can be made a driver later on, if needed. > Question, though... > > How do you make this work as a bundled app? Run erlang like Wings3D > does and then fork off the c-node? That's a little stumbling block. Perhaps it's possible to structure the c-node such that it's the primary executable and it launches the erlang runtime and tells it which pid to talk to. LaunchServices wants the application bundle's executable to be the one that talks to WindowServer. It's possible to launch Erlang first via LaunchServices, but then you end up with a bit of funny business with the way the application launches (e.g. it may be allowed to launch more than once) or with the dock (two dock icons or some such). On the other hand there's probably more fundamental problems to doing it with a driver, because you need to really do a lot of messaging from the main thread, and also the Erlang runtime really shouldn't be doing much in the main thread because that's going to be controlled by the NSRunLoop. I think it would be very difficult to write a driver that works correctly and doesn't screw up Erlang, but a c-node shouldn't have those sorts of issues. -bob From cyberlync@REDACTED Thu Aug 17 22:11:39 2006 From: cyberlync@REDACTED (Eric Merritt) Date: Thu, 17 Aug 2006 13:11:39 -0700 Subject: Attaching a shell to a running node. Message-ID: In the release handling how to on trap exit there is a sentance that caught my attention. "There are tricks for starting an embedded system and being able to attach a shell to a node, but that's another tutorial." So my question is, how do you attach a shell to a node? Thanks, Eric From headspin@REDACTED Thu Aug 17 22:15:42 2006 From: headspin@REDACTED (dda) Date: Thu, 17 Aug 2006 22:15:42 +0200 Subject: newbie questions In-Reply-To: <87bqqjuzg6.fsf@oqube.com> References: <87bqqjuzg6.fsf@oqube.com> Message-ID: Arnaud, I am working on a multibyte string implementation for Erlang in my free time. It handles utf-8/-16 and a bunch of other encodings, but the code is incomplete and needs more work. But preliminary tests did bring satisfactory results. See http://sungnyemun.org/wordpress/?p=238 for more details [and other entries tagged as mb]. Mixed-encodings tables produced with mb: http://sungnyemun.org/wordpress/wp-content/KanjiTest.html http://sungnyemun.org/wordpress/wp-content/Test_EncodingTable.html -- dda On 8/17/06, Arnaud Bailly wrote: > 3. I read here and there that erlang's support of string is > inefficient and does not handle international character sets > (eg. UTF-8 encoding). This may be (or not) an issue for web based > development. Is this true ? From joelr1@REDACTED Thu Aug 17 22:23:50 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 17 Aug 2006 21:23:50 +0100 Subject: Objective-C and runtime type inspection In-Reply-To: <6a36e7290608171308o7766cb3aw2415cde6880a0a7a@mail.gmail.com> References: <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> <46D42A97-3F2F-4BD6-8C52-0B75083D62E7@gmail.com> <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> <6a36e7290608171137v5456349esf1fcca06e0ff59fe@mail.gmail.com> <6ABF2844-6D80-44B6-A970-1C3BBB2E9DCD@gmail.com> <6a36e7290608171214w2b62ad44s2c69a2ab423e2e5c@mail.gmail.com> <64418ADD-0003-4E36-AE84-06DA3D5851A6@gmail.com> <6a36e7290608171238i5700095uf754d2645fccfaae@mail.gmail.com> <6079EBA4-2742-4A8B-99F2-2C49E3707330@gmail.com> <6a36e7290608171308o7766cb3aw2415cde6880a0a7a@mail.gmail.com> Message-ID: <231B2A41-E5C2-4AF2-83BE-23CEEFAC1A18@gmail.com> On Aug 17, 2006, at 9:08 PM, Bob Ippolito wrote: > What we do in PyObjC is use the RTTI to determine the size of the > chunk to allocate, and return a tuple of (rval, output1, ...). What if you have an _in_ structure that you need to pre-populate? There's no way to get the size of that structure from Erlang unless there's a way to ask the c-node to give you the size of that structure somehow. Maybe a message that returns the size of each argument for a given selector? -- http://wagerlabs.com/ From bob@REDACTED Thu Aug 17 22:29:09 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 17 Aug 2006 13:29:09 -0700 Subject: Objective-C and runtime type inspection In-Reply-To: <231B2A41-E5C2-4AF2-83BE-23CEEFAC1A18@gmail.com> References: <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> <6a36e7290608171137v5456349esf1fcca06e0ff59fe@mail.gmail.com> <6ABF2844-6D80-44B6-A970-1C3BBB2E9DCD@gmail.com> <6a36e7290608171214w2b62ad44s2c69a2ab423e2e5c@mail.gmail.com> <64418ADD-0003-4E36-AE84-06DA3D5851A6@gmail.com> <6a36e7290608171238i5700095uf754d2645fccfaae@mail.gmail.com> <6079EBA4-2742-4A8B-99F2-2C49E3707330@gmail.com> <6a36e7290608171308o7766cb3aw2415cde6880a0a7a@mail.gmail.com> <231B2A41-E5C2-4AF2-83BE-23CEEFAC1A18@gmail.com> Message-ID: <6a36e7290608171329w64665fa8j215136d08fbe1c7d@mail.gmail.com> On 8/17/06, Joel Reymont wrote: > > On Aug 17, 2006, at 9:08 PM, Bob Ippolito wrote: > > > What we do in PyObjC is use the RTTI to determine the size of the > > chunk to allocate, and return a tuple of (rval, output1, ...). > > What if you have an _in_ structure that you need to pre-populate? You said that would be a binary. > There's no way to get the size of that structure from Erlang unless > there's a way to ask the c-node to give you the size of that > structure somehow. > > Maybe a message that returns the size of each argument for a given > selector? Makes sense. -bob From serge@REDACTED Thu Aug 17 22:32:06 2006 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 17 Aug 2006 16:32:06 -0400 Subject: Attaching a shell to a running node. In-Reply-To: References: Message-ID: <44E4D246.2050700@hq.idt.net> In the embedded mode you need to start the node using "run_erl" command, and use "to_erl" to attach to the node's console. See: http://www.erlang.org/doc/doc-5.5/erts-5.5/doc/html/index.html This is a preferred way for running embedded systems in production. Another benefit here is that all console activity gets logged in this mode, and run_erl takes care of file rotations. If you don't need to access the node's console, but just need to run a shell on a remote node, you can start a non-embedded node and use the -remsh option: $ erl -sname b -remsh a@REDACTED Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.5 (abort with ^G) (a@REDACTED)1> Serge Aleynikov R&D Telecom, MIS, IDT Corp Tel: +1 (973) 438-3436 Fax: +1 (973) 438-1464 Eric Merritt wrote: > In the release handling how to on trap exit there is a sentance that > caught my attention. > > "There are tricks for starting an embedded system and being able to > attach a shell to a node, but that's another tutorial." > > So my question is, how do you attach a shell to a node? > > Thanks, > Eric > -- From rpettit@REDACTED Thu Aug 17 22:49:34 2006 From: rpettit@REDACTED (Rick Pettit) Date: Thu, 17 Aug 2006 15:49:34 -0500 Subject: Attaching a shell to a running node. In-Reply-To: <44E4D246.2050700@hq.idt.net> References: <44E4D246.2050700@hq.idt.net> Message-ID: <20060817204934.GE1637@vailsys.com> On Thu, Aug 17, 2006 at 04:32:06PM -0400, Serge Aleynikov wrote: > In the embedded mode you need to start the node using "run_erl" command, > and use "to_erl" to attach to the node's console. > > See: > http://www.erlang.org/doc/doc-5.5/erts-5.5/doc/html/index.html > > This is a preferred way for running embedded systems in production. > Another benefit here is that all console activity gets logged in this > mode, and run_erl takes care of file rotations. > > If you don't need to access the node's console, but just need to run a > shell on a remote node, you can start a non-embedded node and use the > -remsh option: > > $ erl -sname b -remsh a@REDACTED > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] > [kernel-poll:false] > > Eshell V5.5 (abort with ^G) > (a@REDACTED)1> Another option is to use non-embedded node and make decision to remote into another node after startup (i.e. without having used -remsh) by using CTL-G and doing: rpettit>erl -name n1 -setcookie foo Erlang (BEAM) emulator version 5.3 [source] Eshell V5.3 (abort with ^G) (n1@REDACTED)1> net_adm:ping('n2@REDACTED'). pong (n1@REDACTED)2> % I hit CTL-G here User switch command --> r 'n2@REDACTED' --> j 1 {} 2 {shell,start,[]} 3* {'n2@REDACTED',shell,start,[]} --> c 3 Eshell V5.3 (abort with ^G) (n2@REDACTED)1> % on remote node, about to switch back (n2@REDACTED)1> % I hit CTL-G here User switch command --> c 2 % I hit enter twice here (to get prompt to print) (n1@REDACTED)2> q(). ok You can start multiple remote shells and juggle sessions that way (just make sure you pay attention to what node you are on before running arbitrary commands :-) -Rick > Serge Aleynikov > R&D Telecom, MIS, IDT Corp > Tel: +1 (973) 438-3436 > Fax: +1 (973) 438-1464 > > > Eric Merritt wrote: > >In the release handling how to on trap exit there is a sentance that > >caught my attention. > > > >"There are tricks for starting an embedded system and being able to > >attach a shell to a node, but that's another tutorial." > > > >So my question is, how do you attach a shell to a node? > > > >Thanks, > >Eric > > > > > -- > From erlangX@REDACTED Thu Aug 17 22:59:46 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Thu, 17 Aug 2006 13:59:46 -0700 Subject: Attaching a shell to a running node. In-Reply-To: References: Message-ID: <20060817205946.GR6584@delora.autosys.us> See modules docs for erl. Both windows are on same machine 'delora' $ erl -sname del now open another window, and ... $ erl -sname delo -remsh del@REDACTED attaches this shell to node del@REDACTED ~Michael On Thu, Aug 17, 2006 at 01:11:39PM -0700, Eric Merritt wrote: > In the release handling how to on trap exit there is a sentance that > caught my attention. > > "There are tricks for starting an embedded system and being able to > attach a shell to a node, but that's another tutorial." > > So my question is, how do you attach a shell to a node? > > Thanks, > Eric -- Michael McDaniel Portland, Oregon, USA http://autosys.us +1 503 283 5284 From bob@REDACTED Thu Aug 17 23:12:17 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 17 Aug 2006 14:12:17 -0700 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <9CB79C836F98504C81BF082C4291E987792AEE@CHITDSEXC02.tds.corp.cendant.org> References: <20060817185026.GD22130@vailsys.com> <9CB79C836F98504C81BF082C4291E987792AEE@CHITDSEXC02.tds.corp.cendant.org> Message-ID: <6a36e7290608171412r59b48b9av1d149c7d46f5a3b0@mail.gmail.com> Which is exactly why there's a lists:foreach/2, right? :P Sending messages has side-effects, there's a place for foreach. -bob On 8/17/06, Logan, Martin wrote: > Rick, you are correct but technically the process loops in Erlang are > implemented via tail recursion. I think this is where the > misunderstanding came about. Procedural looping structures such as > "for", "while", "do while", and "foreach" are the sorts of looping > constructs that would severely damage Erlang as a language, IMHO. > > Cheers, > Martin > > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Rick Pettit > Sent: Thursday, August 17, 2006 1:50 PM > To: Ryan Rawson > Cc: Joel Reymont; Yariv Sadan; erlangquestions > Subject: Re: Erlang article #1 on programming.reddit.com > > On Thu, Aug 17, 2006 at 11:30:19AM -0700, Ryan Rawson wrote: > > Surely you jest? > > > > You'd have to break Erlang to insert loops. First off you'd have > > variables that need to be changed. That substantiably breaks Erlang > > imho. > > Not sure I understand you here. I have recently been using Joe > Armstrong's > robust TCP server, for example, and in that there is the notion of a > "controller" loop for synchronizing operations among multiple socket > handlers. > > For "simple servers" (i.e. those not requiring a behaviour like > gen_server) > I see tail-recursive server loop constructs all the time. > > Single assignment isn't a problem considering each new iteration through > the > loop allows for new local variable bindings, etc. > > > If you want to loop, you probably want to map or fold. If you need to > > loop you might want to use gen_server instead, or at the last resort > > use a tail recursive call. > > What do you think goes on behind the scenes in a map, fold, or even > gen_server? > > You might be surprised to find that there is a server loop in a > gen_server > (it is what passes the state to gen_server callbacks, and it is what the > gen_server callbacks return the state to). > > Perhaps I misunderstand you. > > -Rick > > > On 8/17/06, Joel Reymont wrote: > > > > > >On Aug 17, 2006, at 5:53 PM, Ryan Rawson wrote: > > > > > >> I beg of all of you - no for loops. No looping of any kind! > > > > > >What's wrong with looping? > > > > > >-- > > >http://wagerlabs.com/ > > > > > > > > > > > > > > > > > > > From anders.nygren@REDACTED Thu Aug 17 23:13:20 2006 From: anders.nygren@REDACTED (Anders Nygren) Date: Thu, 17 Aug 2006 16:13:20 -0500 Subject: edoc and -compile(export_all) Message-ID: HI I just noticed that edoc does not recognize -compile(export_all) So if a module has -compile(export_all) then edoc will just generate an empty page, I assume because there are no export statements. /Anders From yarivvv@REDACTED Thu Aug 17 23:30:01 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 17 Aug 2006 17:30:01 -0400 Subject: closing the loop on Erlang metaprogramming with Smerl In-Reply-To: <17244f480608162105m6d1af516j2ff497fb24153d77@mail.gmail.com> References: <17244f480608162105m6d1af516j2ff497fb24153d77@mail.gmail.com> Message-ID: <17244f480608171430g1199193r35b3abd9174570d3@mail.gmail.com> > I think this pretty much concludes the development of Smerl. I want to > keep Smerl simple, so any additional metaprogramming features would > belong in higher-level libraries. > Boy, was I wrong! Old way: C1 = smerl:new(foo), {ok, C2} = smerl:add_func(foo, "bar() -> 1+1."), smerl:compile(C2), foo:bar(). % returns 2 New way: A = 7, C1 = smerl:new(foo), {ok, C2} = smerl:add_func(foo, bar, fun() -> 3 + A end), smerl:compile(C2), foo:bar(). %% returns 10 Yup, Smerl now supports fun expressions -- even closures! http://yarivsblog.com/articles/2006/08/17/smerl-attains-erlang-metaprogramming-nirvana Cheers, Yariv From yarivvv@REDACTED Thu Aug 17 23:33:02 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 17 Aug 2006 17:33:02 -0400 Subject: closing the loop on Erlang metaprogramming with Smerl In-Reply-To: <17244f480608171430g1199193r35b3abd9174570d3@mail.gmail.com> References: <17244f480608162105m6d1af516j2ff497fb24153d77@mail.gmail.com> <17244f480608171430g1199193r35b3abd9174570d3@mail.gmail.com> Message-ID: <17244f480608171433p6e511fbdl822e2a7830bbe7df@mail.gmail.com> > {ok, C2} = smerl:add_func(foo, bar, fun() -> 3 + A end), Sorry -- example bug. This is the right line: {ok, C2} = smerl:add_func(C1, bar, fun() -> 3 + A end), From Martin.Logan@REDACTED Thu Aug 17 23:39:09 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Thu, 17 Aug 2006 16:39:09 -0500 Subject: Attaching a shell to a running node. In-Reply-To: <20060817204934.GE1637@vailsys.com> Message-ID: <9CB79C836F98504C81BF082C4291E987792AF3@CHITDSEXC02.tds.corp.cendant.org> You can start multiple remote shells and juggle sessions that way (just make sure you pay attention to what node you are on before running arbitrary commands :-) -Rick One in particular to watch out for is doing q() when in a remote shell session. This will not stop your local shell but, as I found out the hard way on a production node, will bring down the remote node :-O Martin From serge@REDACTED Fri Aug 18 00:14:57 2006 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 17 Aug 2006 18:14:57 -0400 Subject: Attaching a shell to a running node. In-Reply-To: <9CB79C836F98504C81BF082C4291E987792AF3@CHITDSEXC02.tds.corp.cendant.org> References: <9CB79C836F98504C81BF082C4291E987792AF3@CHITDSEXC02.tds.corp.cendant.org> Message-ID: <44E4EA61.4070002@hq.idt.net> Yes, pressing Ctrl-C in the remote shell is indeed a frequently overseen issue that I am sure has bitten every Erlang developer at some point. I suggest starting erl with +Bi option in production. This inhibits accidental Ctrl-C. -- Serge Aleynikov R&D Telecom, MIS, IDT Corp Tel: +1 (973) 438-3436 Fax: +1 (973) 438-1464 Logan, Martin wrote: > You can start multiple remote shells and juggle sessions that way (just > make > sure you pay attention to what node you are on before running arbitrary > commands :-) > > -Rick > > One in particular to watch out for is doing q() when in a remote shell > session. This will not stop your local shell but, as I found out the > hard way on a production node, will bring down the remote node :-O > > Martin > From darrinth@REDACTED Fri Aug 18 00:56:46 2006 From: darrinth@REDACTED (Darrin Thompson) Date: Thu, 17 Aug 2006 18:56:46 -0400 Subject: Tutorials In-Reply-To: <9CB79C836F98504C81BF082C4291E987792AEB@CHITDSEXC02.tds.corp.cendant.org> References: <9CB79C836F98504C81BF082C4291E987792AE4@CHITDSEXC02.tds.corp.cendant.org> <9CB79C836F98504C81BF082C4291E987792AEB@CHITDSEXC02.tds.corp.cendant.org> Message-ID: On 8/17/06, Logan, Martin wrote: > Send to the list, this thread, any and all links to tutorials that exist One of the best ever IMO: http://www.kazmier.com/computer/port-howto/ -- Darrin From ryanobjc@REDACTED Fri Aug 18 01:09:27 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Thu, 17 Aug 2006 16:09:27 -0700 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <20060817200614.GA1637@vailsys.com> References: <20060817185026.GD22130@vailsys.com> <9CB79C836F98504C81BF082C4291E987792AEE@CHITDSEXC02.tds.corp.cendant.org> <20060817200614.GA1637@vailsys.com> Message-ID: <78568af10608171609q7a617a1bwad22b7d1d1b8720e@mail.gmail.com> > > I think this is where the misunderstanding came about. Procedural looping > > structures such as "for", "while", "do while", and "foreach" are the sorts of > > looping constructs that would severely damage Erlang as a language, IMHO. > > Procedural looping constructs in a non-procedural language doesn't make much > sense, which is why I'm not worried about someone trying to add them. While you and I may agree that this doesn't make sense - the first thing a developer does is try to make their new environment as familiar and comfortable to them as possible. So many developers are seriously hung up on iteration as _THE_ way to do 90% of programming tasks. Someone will propose adding a for loop to Erlang, and the trick is not to give in to the temptation. Obviously just 1 person complaining won't make a difference, but now imagine 50% of the erlang-questions list constantly brings this up in every single message. This is a realistic future IMHO as Erlang continues to improve in popularity. Besides which, as everyone knows, Erlang isn't pure functional - what is with the comma syntax? Some sort of sequenced instructions.... :-) -ryan From bfulg@REDACTED Fri Aug 18 01:21:53 2006 From: bfulg@REDACTED (Brent Fulgham) Date: Thu, 17 Aug 2006 16:21:53 -0700 (PDT) Subject: Migrating the Erlang Cookbook to Trapexit In-Reply-To: Message-ID: <20060817232153.23156.qmail@web81213.mail.mud.yahoo.com> All I ask is that you let me keep the ability to update my pages! :-) -Brent ----- Original Message ---- From: tty@REDACTED To: cyberlync@REDACTED Cc: erlang-questions@REDACTED Sent: Wednesday, August 16, 2006 6:12:11 PM Subject: Re: Migrating the Erlang Cookbook to Trapexit I think this is a good idea. Regards t -------- Original Message -------- From: "Eric Merritt" Apparently from: owner-erlang-questions@REDACTED To: erlang-questions@REDACTED Subject: Migrating the Erlang Cookbook to Trapexit Date: Wed, 16 Aug 2006 14:52:37 -0700 > What do you guys think of migrating the Erlang cookbook at > > http://schemecookbook.org/Erlang/WebHome > http://pleac.sourceforge.net/pleac_erlang/index.html > > To the trap exit wiki. There is a reasonable amount of decent stuff > out that that doesn't get updated or viewed much due to its obscure > location. I would be willing to do a lot of it, but I wanted to get > some consensus from the community. From ok@REDACTED Fri Aug 18 01:46:16 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 18 Aug 2006 11:46:16 +1200 (NZST) Subject: Erlang article #1 on programming.reddit.com Message-ID: <200608172346.k7HNkGDF211700@atlas.otago.ac.nz> "Ryan Rawson" wrote: You'd have to break Erlang to insert loops. Wrong. First off you'd have variables that need to be changed. Wrong. If you want to loop, you probably want to map or fold. Right. If you need to loop you might want to use gen_server instead, Not for processing a data structure you wouldn't/ or at the last resort use a tail recursive call. Why would that be the LAST resort? Friends, we had a thread about looping not so very long ago. By the end of it, there was a concrete proposal for a construct looking like (let p1 = i1 then s1, ..., pk = ik then sk for generators-and-filters in final-result ) As a trivial example, let's compute the mean of the positive elements of a list: (let N = 0 then N+1, S = 0 then S+X for X <- List, X > 0 in S/N ) It's pretty much what you get if you hybridise Scheme DO loops with list comprehension, and it's as pure as anyone could wish for. Of course there is room for disagreement about whether it is useful enough to add to the language, but let there be no nonsense about it "breaking" Erlang. From ryanobjc@REDACTED Fri Aug 18 02:11:13 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Thu, 17 Aug 2006 17:11:13 -0700 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <200608172346.k7HNkGDF211700@atlas.otago.ac.nz> References: <200608172346.k7HNkGDF211700@atlas.otago.ac.nz> Message-ID: <78568af10608171711w51c39b34w82c1c9079394ef89@mail.gmail.com> Thats more of a list comprehension than a loop now is it? -ryan On 8/17/06, Richard A. O'Keefe wrote: > "Ryan Rawson" wrote: > You'd have to break Erlang to insert loops. > > Wrong. > > First off you'd have variables that need to be changed. > > Wrong. > > If you want to loop, you probably want to map or fold. > > Right. > > If you need to loop you might want to use gen_server instead, > > Not for processing a data structure you wouldn't/ > > or at the last resort use a tail recursive call. > > Why would that be the LAST resort? > > Friends, we had a thread about looping not so very long ago. > By the end of it, there was a concrete proposal for a construct looking > like > > (let p1 = i1 then s1, ..., pk = ik then sk > for generators-and-filters > in final-result > ) > > As a trivial example, let's compute the mean of the positive elements > of a list: > > (let N = 0 then N+1, S = 0 then S+X > for X <- List, X > 0 > in S/N > ) > > It's pretty much what you get if you hybridise Scheme DO loops with > list comprehension, and it's as pure as anyone could wish for. > > Of course there is room for disagreement about whether it is useful > enough to add to the language, but let there be no nonsense about > it "breaking" Erlang. > > From ok@REDACTED Fri Aug 18 04:16:20 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 18 Aug 2006 14:16:20 +1200 (NZST) Subject: Erlang article #1 on programming.reddit.com Message-ID: <200608180216.k7I2GKMe209281@atlas.otago.ac.nz> I mentioned the (let N = 0 then N+1, S = 0 then S+X for X <- List, X > 0 in S/N ) construct that had been designed recently in this mailing list. "Ryan Rawson" wrote: That's more of a list comprehension than a loop now is it? It's as loopy a for loop as ever there was. List comprehensions make lists. This kind of loop *may* make a list, but needn't. [ E(X) || X <- L, G(X) ] can be expressed in this form as (let R = [] then [E(X)|R] for X <- L, G(X) in reverse(R) ) You can think of this as a multi-result fold + map + filter. In other words, you can think of it as a for loop. If you think a 'for' loop must have something to do with counting, reflect that a compiler might recognise X <- lists:seq(1, N) and do something special with it (if you promise faithfully not to change the semantics of seq/2 next time you reload the lists module, of course...). From yarivvv@REDACTED Fri Aug 18 04:28:40 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 17 Aug 2006 22:28:40 -0400 Subject: closing the loop on Erlang metaprogramming with Smerl In-Reply-To: <17244f480608171430g1199193r35b3abd9174570d3@mail.gmail.com> References: <17244f480608162105m6d1af516j2ff497fb24153d77@mail.gmail.com> <17244f480608171430g1199193r35b3abd9174570d3@mail.gmail.com> Message-ID: <17244f480608171928h2a4f93c5ja76ea54c9cd43e9e@mail.gmail.com> > New way: > > A = 7, > C1 = smerl:new(foo), > {ok, C2} = smerl:add_func(foo, bar, fun() -> 3 + A end), > smerl:compile(C2), > foo:bar(). %% returns 10 > > Yup, Smerl now supports fun expressions -- even closures! Ugh, looks like I suffered a big setback -- erlang:fun_info behaves differently in the shell and in compiled modules. I guess fun expressions may not be part of Smerl after all... Yariv From yarivvv@REDACTED Fri Aug 18 06:21:40 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Fri, 18 Aug 2006 00:21:40 -0400 Subject: fun expressions and abstract forms Message-ID: <17244f480608172121y5803c251y96d852af64a9d405@mail.gmail.com> Hi, Earlier today, I thought I made a breakthrough for Smerl when I discovered that erlang:fun_info gives you the abstract form of fun expressions as well as their closure environment values. I even added APIs for adding functions using fun expressions: C = smerl:new(foo), smerl:add_func(C, bar, fun() -> 1+1 end), smerl:compile(C), foo:bar(). % return 2 Why did I get excited? Because this API would let Smerl users avoid writing code snippets or having to know the abstract format. I actually got everything to work, including embedding closure variables in the generated functions. Silly me, I only tested it in the Erlang shell, where everything worked perfectly. Later today, I wrote similar code in a compiled module, and lo and behold, erlang:fun_info stopped giving me any useful information -- ie abstract representation -- for fun expressions. This totally broke the fun expression usage in Smerl. My question is, is there any way of getting the abstract format for a fun expression in a compiled module? (I tried erl_parse:abstract, but it doesn't seem to handle fun expressions, just basic values.) Any help is appreciated, Thanks, Yariv From yarivvv@REDACTED Fri Aug 18 06:23:22 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Fri, 18 Aug 2006 00:23:22 -0400 Subject: fun expressions and abstract forms In-Reply-To: <17244f480608172121y5803c251y96d852af64a9d405@mail.gmail.com> References: <17244f480608172121y5803c251y96d852af64a9d405@mail.gmail.com> Message-ID: <17244f480608172123k59facccct8fde7da132dd2c12@mail.gmail.com> > C = smerl:new(foo), > smerl:add_func(C, bar, fun() -> 1+1 end), > smerl:compile(C), > foo:bar(). % return 2 > fix: {ok, C1} = smerl:add_func(C, bar, fun() -> 1+1 end), smerl:compile(C1) Yariv From darrinth@REDACTED Fri Aug 18 08:06:18 2006 From: darrinth@REDACTED (Darrin Thompson) Date: Fri, 18 Aug 2006 02:06:18 -0400 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <200608180216.k7I2GKMe209281@atlas.otago.ac.nz> References: <200608180216.k7I2GKMe209281@atlas.otago.ac.nz> Message-ID: On 8/17/06, Richard A. O'Keefe wrote: > I mentioned the > (let N = 0 then N+1, S = 0 then S+X > for X <- List, X > 0 > in S/N > ) > construct that had been designed recently in this mailing list. So now the n00bs all complain that they can't understand how the loops work. ;-) Maybe we could worry this problem when we are _actually_ taking over the world. Meanwhile, I'm happy to see that people are taking Erlang seriously. My experience with Reddit is that a high ranking front page link == 6000 readers. Wonderful! To deal effectively with an influx of interest we need to tactfully deal with Erlang's shortcomings early in the tutorial path. Strings, unicode, and weak metaprogramming compared to lisp (smerl notwithstanding...), all need to be addressed. If one of those is a dealbreaker, Joe N00b needs to know earlier than later. -- Darrin From s.devrieze@REDACTED Thu Aug 17 19:25:10 2006 From: s.devrieze@REDACTED (sander) Date: Thu, 17 Aug 2006 18:25:10 +0100 Subject: new to erlang: need ideas for server software References: Message-ID: <20060817172510.24CBD5A1F8@mail.erlangsystems.com> * J-EAI (it already exists, but it can use help I think, it's based on ejabberd: http://process-one.net/en/projects/j-eai/ ) * An IRC server that can integrate with ejabberd to map with MUC rooms and to allow ejabberd users to login to ejabberd with an IRC client. * A mail system that works out-of-the-box and is easy to setup (I hate it to setup 9 different programs just to get a mail server, especially if it is very different to configure when you can't run a default system). It would be cool if it integrates with ejabberd and so implements imail: http://users.telenet.be/s.devrieze/imail/imail.pdf Of course it should have modules for IMAP(S), POP3(S), SMTP, dspam integration, spamassassin integration, clamav integration,... * Does there already exist an FTP server in Erlang? :-) * A proxy server. * A streaming media server. * A print server (compatible with CUPS). This could be very cool. A company then can setup a print server cluster, each machine in the cluster has at least 1 printer connected to it, when a node is broken (machine broken, printer broken, or out of ink) your print task will be automatically moved to another node B-) * A remote backup system to which people can upload files which are afterwards stored on all nodes (or you can have a configurable number of nodes that need to have a disk copy). * A file system that uses Erlang (ok, this is no server, but it still would be cool to have on a server B-) ) * LDAP server * NFS server _________________________________________________________ Post sent from http://www.trapexit.org From s.devrieze@REDACTED Thu Aug 17 19:26:28 2006 From: s.devrieze@REDACTED (sander) Date: Thu, 17 Aug 2006 18:26:28 +0100 Subject: Migrating the Erlang Cookbook to Trapexit References: Message-ID: <20060817172628.DD6085A1F2@mail.erlangsystems.com> Why not even: 1) installing Drupal or any other CMS on erlang.org 2) Move content of trapexit, Erlang Cookbook,.. to erlang.org _________________________________________________________ Post sent from http://www.trapexit.org From mogorman@REDACTED Thu Aug 17 21:40:18 2006 From: mogorman@REDACTED (Matthew O'Gorman) Date: Thu, 17 Aug 2006 14:40:18 -0500 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <20060817185026.GD22130@vailsys.com> References: <17244f480608170632l757b64bbhf77839e6ba49969d@mail.gmail.com> <78568af10608170953j4ed24f7cja4f2357bf0eee8ff@mail.gmail.com> <7381AEC0-59BD-47FC-9345-8AAE1B83C457@gmail.com> <78568af10608171130q2da9768dqce61203bb1376729@mail.gmail.com> <20060817185026.GD22130@vailsys.com> Message-ID: I think ryan was suggesting don't change erlang to suit the throng of people coming to it. mog On 8/17/06, Rick Pettit wrote: > On Thu, Aug 17, 2006 at 11:30:19AM -0700, Ryan Rawson wrote: > > Surely you jest? > > > > You'd have to break Erlang to insert loops. First off you'd have > > variables that need to be changed. That substantiably breaks Erlang > > imho. > > Not sure I understand you here. I have recently been using Joe Armstrong's > robust TCP server, for example, and in that there is the notion of a > "controller" loop for synchronizing operations among multiple socket handlers. > > For "simple servers" (i.e. those not requiring a behaviour like gen_server) > I see tail-recursive server loop constructs all the time. > > Single assignment isn't a problem considering each new iteration through the > loop allows for new local variable bindings, etc. > > > If you want to loop, you probably want to map or fold. If you need to > > loop you might want to use gen_server instead, or at the last resort > > use a tail recursive call. > > What do you think goes on behind the scenes in a map, fold, or even gen_server? > > You might be surprised to find that there is a server loop in a gen_server > (it is what passes the state to gen_server callbacks, and it is what the > gen_server callbacks return the state to). > > Perhaps I misunderstand you. > > -Rick > > > On 8/17/06, Joel Reymont wrote: > > > > > >On Aug 17, 2006, at 5:53 PM, Ryan Rawson wrote: > > > > > >> I beg of all of you - no for loops. No looping of any kind! > > > > > >What's wrong with looping? > > > > > >-- > > >http://wagerlabs.com/ > > > > > > > > > > > > > > > > > > > From jeff@REDACTED Thu Aug 17 22:17:24 2006 From: jeff@REDACTED (Jeff Wood) Date: Thu, 17 Aug 2006 13:17:24 -0700 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <20060817185026.GD22130@vailsys.com> References: <17244f480608170632l757b64bbhf77839e6ba49969d@mail.gmail.com> <78568af10608170953j4ed24f7cja4f2357bf0eee8ff@mail.gmail.com> <7381AEC0-59BD-47FC-9345-8AAE1B83C457@gmail.com> <78568af10608171130q2da9768dqce61203bb1376729@mail.gmail.com> <20060817185026.GD22130@vailsys.com> Message-ID: <44E4CED4.6020106@dark-light.com> Rick Pettit wrote: > On Thu, Aug 17, 2006 at 11:30:19AM -0700, Ryan Rawson wrote: > >> Surely you jest? >> >> You'd have to break Erlang to insert loops. First off you'd have >> variables that need to be changed. That substantiably breaks Erlang >> imho. >> > > Not sure I understand you here. I have recently been using Joe Armstrong's > robust TCP server, for example, and in that there is the notion of a > "controller" loop for synchronizing operations among multiple socket handlers. > > For "simple servers" (i.e. those not requiring a behaviour like gen_server) > I see tail-recursive server loop constructs all the time. > > Single assignment isn't a problem considering each new iteration through the > loop allows for new local variable bindings, etc. > > >> If you want to loop, you probably want to map or fold. If you need to >> loop you might want to use gen_server instead, or at the last resort >> use a tail recursive call. >> > > What do you think goes on behind the scenes in a map, fold, or even gen_server? > > You might be surprised to find that there is a server loop in a gen_server > (it is what passes the state to gen_server callbacks, and it is what the > gen_server callbacks return the state to). > > Perhaps I misunderstand you. > > -Rick > > >> On 8/17/06, Joel Reymont wrote: >> >>> On Aug 17, 2006, at 5:53 PM, Ryan Rawson wrote: >>> >>> >>>> I beg of all of you - no for loops. No looping of any kind! >>>> >>> What's wrong with looping? >>> >>> -- >>> http://wagerlabs.com/ >>> >>> >>> >>> >>> >>> >>> You answered your own question ... RECURSION is NOT a LOOP! where people say "loop it by calling myself" ... is simply recursing... it's not really a loop. a loop of the infinite or finite varieties are a different beast all together. #pseudo code infinite: while( x == 3 ): do stuff finite: for x = 1 to 3: do stuff for those to work you'd have to have variables, not symbols like erlang has... x would have to be able to change values. ... tail call optimization is simply a compiler/run-time trick to deal with computers not being able to handle deep stacks. nothing more... when you have a purely(?) functional language like erlang you have to have it since your "looping" is based on recursion ... imagine how many stack frames you'd have sitting on your system if you had a gen_server running for months and/or years ... anyways ... I like it as it is ... and for-loops/etc would definately be a "bad thing" for erlang. jd From ulf@REDACTED Fri Aug 18 09:21:34 2006 From: ulf@REDACTED (Ulf Wiger) Date: Fri, 18 Aug 2006 09:21:34 +0200 (CEST) Subject: erlang release ??? In-Reply-To: References: <54461D0825E5E44188349F4D8F3518A803D09F29@MTNMAIL.mtn.co.za> Message-ID: <1259.85.224.128.225.1155885694.squirrel@webmail.wiger.net> > Only by maintaining your own map, for instance: > > vsn_to_release("5.3.6.3") -> "R9C-2"; > ... > > /Bjorn The most intuitive way to address this question (I think), would be to update the version string in the boot script: =PROGRESS REPORT==== 18-Aug-2006::09:15:00 === application: sasl started_at: nonode@REDACTED release_handler:which_releases(). [{"OTP APN 181 01","R10B",[],permanent}] Of course, commercial customers also have a tendency to selectively apply patch packages, which makes it even more difficult to tell exactly which version is running. There should perhaps also be a script allowing the maintainer to log which patches or diffs have been applied, and a corresponding release_handler function to list them. BR, Ulf W > "Valentin Micic [ MTN - Innovation Centre ]" writes: > >> Is there a way of mapping erlang emulator version, as reported during >> the run-time to a particular release? For example, ERTS 5.3 in indicates >> R9C, whereas 5.3.6.3 indicates R9C-2 (or I got it completely wrong?). >> >> V. >> >> -----Original Message----- >> From: owner-erlang-questions@REDACTED >> [mailto:owner-erlang-questions@REDACTED] On Behalf Of Bjorn Gustavsson >> Sent: Thursday, 17 August 2006 9:23 AM >> To: erlang-questions@REDACTED >> Subject: Re: erlang release ??? >> >> It is currently not possible. >> >> /Bjorn >> >> "Sanjaya Vitharana" writes: >> >> > Hi >> > >> > erl -version gives the version number. >> > "init:script_id()" & "ls /usr/local/lib/erlang/releases/" gives more >> info about release. But seems it gives "R10B" instead of "R10B-8". >> > >> > So how to find the exact release number of elang???. i.e R10B-8, >> R10B-9 ... etc >> > >> > thanks >> > >> > Sanjaya Vitharana >> >> -- >> Bj?rn Gustavsson, Erlang/OTP, Ericsson AB >> >> >> NOTE: This e-mail message is subject to the MTN Group disclaimer see >> http://www.mtn.co.za/disclaimer >> > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > From bjorn@REDACTED Fri Aug 18 09:27:37 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 18 Aug 2006 09:27:37 +0200 Subject: newbie questions In-Reply-To: <87bqqjuzg6.fsf@oqube.com> References: <87bqqjuzg6.fsf@oqube.com> Message-ID: Arnaud Bailly writes: > 3. I read here and there that erlang's support of string is > inefficient and does not handle international character sets > (eg. UTF-8 encoding). This may be (or not) an issue for web based > development. Is this true ? > String handling is not inherently inefficient. What the FAQ points out is that string operations *can* be inefficient if you use the '++' operator in loops. There are several easy ways to avoid that inefficiency. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bengt.kleberg@REDACTED Fri Aug 18 09:44:21 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Fri, 18 Aug 2006 09:44:21 +0200 Subject: newbie questions In-Reply-To: <87bqqjuzg6.fsf@oqube.com> References: <87bqqjuzg6.fsf@oqube.com> Message-ID: <44E56FD5.7070806@ericsson.com> On 2006-08-17 17:58, Arnaud Bailly wrote: ...deleted > 2. in the same line of thought, is there something equivalent to > maven or ant ? Is emake that kind of tool ? there is a standard erlang module called ''make''. it uses Emakefiles. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From chsu79@REDACTED Fri Aug 18 09:44:45 2006 From: chsu79@REDACTED (Christian S) Date: Fri, 18 Aug 2006 09:44:45 +0200 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <44E4CED4.6020106@dark-light.com> References: <17244f480608170632l757b64bbhf77839e6ba49969d@mail.gmail.com> <78568af10608170953j4ed24f7cja4f2357bf0eee8ff@mail.gmail.com> <7381AEC0-59BD-47FC-9345-8AAE1B83C457@gmail.com> <78568af10608171130q2da9768dqce61203bb1376729@mail.gmail.com> <20060817185026.GD22130@vailsys.com> <44E4CED4.6020106@dark-light.com> Message-ID: I'm in the camp that doesnt limit the meaning of "loop" to only be imperative code with destructive assignment. I think a recursive function is as much of a loop as anything else. I forget who, but havent someone clever in the ways of computer science proved that imperative and recursive code are equal in computability? It is the effect of having the same code being used repeatedly that is the important thing. My not so humble opinion though. I guess this thread only exists because people have slightly different definitions of "loop", and like others I feel that I have no immediate need or desire to change my idea of what "loop" means. So far I havent seen any "noob" ask to have erlang turn into a more imperative language. If they would do so, one can just point them to the existing languages in that category. From klacke@REDACTED Fri Aug 18 09:54:44 2006 From: klacke@REDACTED (Claes Wikstrom) Date: Fri, 18 Aug 2006 09:54:44 +0200 Subject: Attaching a shell to a running node. In-Reply-To: <44E4D246.2050700@hq.idt.net> References: <44E4D246.2050700@hq.idt.net> Message-ID: <44E57244.9010707@hyber.org> Serge Aleynikov wrote: > In the embedded mode you need to start the node using "run_erl" command, > and use "to_erl" to attach to the node's console. > > See: > http://www.erlang.org/doc/doc-5.5/erts-5.5/doc/html/index.html yet another alternative is to use the erlang builtin ssh server and you can then just ssh login to the node. /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control cellphone: +46 70 2097763 From ulf@REDACTED Fri Aug 18 09:56:42 2006 From: ulf@REDACTED (Ulf Wiger) Date: Fri, 18 Aug 2006 09:56:42 +0200 (CEST) Subject: qt4 bindings? In-Reply-To: <536FC36A-C96F-4740-8330-5DC04D1ACC45@gmail.com> References: <44E46B1D.1000006@ertw.com> <44E483FC.6070809@ericsson.com> <2FD85315-7B95-40D1-B9E9-A6FD1CB221A0@gmail.com> <44E48E6D.30704@ericsson.com> <536FC36A-C96F-4740-8330-5DC04D1ACC45@gmail.com> Message-ID: <2069.85.224.128.225.1155887802.squirrel@webmail.wiger.net> My impression from past benchmarks is that message passing over TCP loopback is pretty well optimized - little more than a memcopy. BR, Ulf W > Well, I can just see matrices, arrays and structures flying back and > forth :-). > > On Aug 17, 2006, at 4:42 PM, Mats Cronqvist wrote: > >> i would guess there's additional overhead. i would further guess >> it's insignificant. >> it makes it a whole lot *easier* to send stuff over the network, >> though. >> >> mats > > -- > http://wagerlabs.com/ > > > > > > From ulf@REDACTED Fri Aug 18 10:01:55 2006 From: ulf@REDACTED (Ulf Wiger) Date: Fri, 18 Aug 2006 10:01:55 +0200 (CEST) Subject: Problem with trap_exit In-Reply-To: <44E499F0.7090706@mobilearts.com> References: <44E499F0.7090706@mobilearts.com> Message-ID: <2196.85.224.128.225.1155888115.squirrel@webmail.wiger.net> > Hi all. > I'm having some problem trying to trap an exit in a gen_fsm. > I've made this small example of the problem attached to this mail. It's > a gen_server (test_server.erl) that starts a gen_fsm (test_fsm.erl) > using gen_fsm:start_link(...) > When I by purpose crash the server I expect that the > handle_info-function in the state-machine to handle the {'EXIT', > ...}-signal since I've turned on trap_exit. > Instead the terminte is called with the reason for the crash. > Why is the signal not traped? > Thanks, > // Alex It _is_ trapped - otherwise, terminate() wouldn't be called. Most likely, the main loop in gen_fsm is trapping the exit, which it does if the 'EXIT' message comes from the parent process. The thinking is that the parent process is most likely a supervisor, and the gen_fsm process a worker process. It then makes sure that it's not 'orphaned'. If you test your program from the shell, try unlinking the gen_fsm process, then killing the shell process (call exit(foo) at the shell prompt), and then link to the fsm process from the new shell process. BR, Ulf W From chsu79@REDACTED Fri Aug 18 10:12:57 2006 From: chsu79@REDACTED (Christian S) Date: Fri, 18 Aug 2006 10:12:57 +0200 Subject: new to erlang: need ideas for server software In-Reply-To: <20060817172510.24CBD5A1F8@mail.erlangsystems.com> References: <20060817172510.24CBD5A1F8@mail.erlangsystems.com> Message-ID: jungerl.sf.net lists the subprojects - ftpd -eldap -enfs. No idea what state they're in. About the other things, some of them are not much of an accomplishment if they dont do something better than what is already available. Media streaming for example. Yaws could stream media data over http just fine today (ok, perhaps not end user complete). Shoutcast has been doing streaming for... a long time. But isnt the interesting problem how you save bandwidth, build a p2p solution for streaming more network-efficiently? Anyway, my idea for a cool thing to have is a virtual private network based on tuntap and some clever routing between subnets in the VPN (relaying traffic between participants if lower latency), fallback on secondary interfaces (such as bringing up isdn if main connection is down), of course encryption of traffic. Plus a local dns and dhcp that can provide names and ips across the vpn. On 8/17/06, sander wrote: > > > * J-EAI (it already exists, but it can use help I think, it's based on ejabberd: http://process-one.net/en/projects/j-eai/ ) > * An IRC server that can integrate with ejabberd to map with MUC rooms and to allow ejabberd users to login to ejabberd with an IRC client. > * A mail system that works out-of-the-box and is easy to setup (I hate it to setup 9 different programs just to get a mail server, especially if it is very different to configure when you can't run a default system). It would be cool if it integrates with ejabberd and so implements imail: http://users.telenet.be/s.devrieze/imail/imail.pdf Of course it should have modules for IMAP(S), POP3(S), SMTP, dspam integration, spamassassin integration, clamav integration,... > * Does there already exist an FTP server in Erlang? :-) > * A proxy server. > * A streaming media server. > * A print server (compatible with CUPS). This could be very cool. A company then can setup a print server cluster, each machine in the cluster has at least 1 printer connected to it, when a node is broken (machine broken, printer broken, or out of ink) your print task will be automatically moved to another node B-) > * A remote backup system to which people can upload files which are afterwards stored on all nodes (or you can have a configurable number of nodes that need to have a disk copy). > * A file system that uses Erlang (ok, this is no server, but it still would be cool to have on a server B-) ) > * LDAP server > * NFS server > > _________________________________________________________ > Post sent from http://www.trapexit.org > From mats.cronqvist@REDACTED Fri Aug 18 10:16:31 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Fri, 18 Aug 2006 10:16:31 +0200 Subject: Objective-C and runtime type inspection In-Reply-To: <6a36e7290608171308o7766cb3aw2415cde6880a0a7a@mail.gmail.com> References: <78568af10608171001i17626ae9l77bf2529239d7c4a@mail.gmail.com> <46D42A97-3F2F-4BD6-8C52-0B75083D62E7@gmail.com> <78568af10608171015i52e2d826qa5ee27c76752067a@mail.gmail.com> <6a36e7290608171137v5456349esf1fcca06e0ff59fe@mail.gmail.com> <6ABF2844-6D80-44B6-A970-1C3BBB2E9DCD@gmail.com> <6a36e7290608171214w2b62ad44s2c69a2ab423e2e5c@mail.gmail.com> <64418ADD-0003-4E36-AE84-06DA3D5851A6@gmail.com> <6a36e7290608171238i5700095uf754d2645fccfaae@mail.gmail.com> <6079EBA4-2742-4A8B-99F2-2C49E3707330@gmail.com> <6a36e7290608171308o7766cb3aw2415cde6880a0a7a@mail.gmail.com> Message-ID: <44E5775F.4090209@ericsson.com> Bob Ippolito wrote: > On 8/17/06, Joel Reymont wrote: >> >> On Aug 17, 2006, at 8:38 PM, Bob Ippolito wrote: >> >> > The networking overhead is going to be irrelevant for the most part. >> > None of the messages in a typical Cocoa app are big unless they're >> > creating NSBitmapImageRep from memory or something. I'd make it a >> > C-node personally. >> >> Ok, I'll go with that. It can be made a driver later on, if needed. >> Question, though... >>[...] > On the other hand there's probably more fundamental problems to doing > it with a driver, because you need to really do a lot of messaging > from the main thread, and also the Erlang runtime really shouldn't be > doing much in the main thread because that's going to be controlled by > the NSRunLoop. I think it would be very difficult to write a driver > that works correctly and doesn't screw up Erlang, but a c-node > shouldn't have those sorts of issues. joel, were you seriously considering running your own event loop in a vm thread? if you can pull that off you'll have my eternal admiration. or something. otoh, implementing a c-node on top of the gtk main loop was dead easy. my reasoning for choosing a c-node over a port program was that the potential gain of using pipes instead of erlang distribution is small, since the app is likely to spend only a small fraction of it's cpu time in message passing. e.g. if the app spends 10% of it's time in the TCP stack, and pipes are infinitely fast, you'd still only gain 10% overall. plus i don't think the difference between the loopback and pipes are that big. of course, i dislike pipes on general principles, because distribution is what erlang is all about :> in gtkNode the messages from the erlang node is a list of {command,Args} tuples (so you can send a few big messages rather than many small ones). mats From francesco@REDACTED Fri Aug 18 10:52:36 2006 From: francesco@REDACTED (francesco) Date: Fri, 18 Aug 2006 09:52:36 +0100 Subject: Migrating the Erlang Cookbook to Trapexit References: Message-ID: <20060818085236.45B965A1F8@mail.erlangsystems.com> Hi Eric, great idea! That is exactly the usage of the media wiki we had in mind when we added it to trap exit. Let us know if you need any assistance or support with it. Francesco -- -- http://www.erlang-consulting.com _________________________________________________________ Post sent from http://www.trapexit.org From bob@REDACTED Fri Aug 18 11:00:55 2006 From: bob@REDACTED (Bob Ippolito) Date: Fri, 18 Aug 2006 02:00:55 -0700 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: References: <17244f480608170632l757b64bbhf77839e6ba49969d@mail.gmail.com> <78568af10608170953j4ed24f7cja4f2357bf0eee8ff@mail.gmail.com> <7381AEC0-59BD-47FC-9345-8AAE1B83C457@gmail.com> <78568af10608171130q2da9768dqce61203bb1376729@mail.gmail.com> <20060817185026.GD22130@vailsys.com> <44E4CED4.6020106@dark-light.com> Message-ID: <6a36e7290608180200l62ba5a6by99fd41e787857e9a@mail.gmail.com> On 8/18/06, Christian S wrote: > I'm in the camp that doesnt limit the meaning of "loop" to only be > imperative code with destructive assignment. I think a recursive > function is as much of a loop as anything else. I forget who, but > havent someone clever in the ways of computer science proved that > imperative and recursive code are equal in computability? > > It is the effect of having the same code being used repeatedly that is > the important thing. My not so humble opinion though. > > I guess this thread only exists because people have slightly different > definitions of "loop", and like others I feel that I have no immediate > need or desire to change my idea of what "loop" means. > > So far I havent seen any "noob" ask to have erlang turn into a more > imperative language. If they would do so, one can just point them to > the existing languages in that category. I would certainly agree with that sentiment. I definitely wouldn't say that Erlang doesn't have "for loops", but that Erlang's syntax for them is tail recursion or a list comprehension (or something that reduces to that such as a lists:map or a lists:foldl, etc.). -bob From mikpe@REDACTED Fri Aug 18 11:05:26 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Fri, 18 Aug 2006 11:05:26 +0200 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <17636.23172.37608.399423@alkaid.it.uu.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> Message-ID: <17637.33494.353017.151134@alkaid.it.uu.se> Mikael Pettersson writes: > http://www.it.uu.se/research/group/hipe/snapshots/patch-otp-0804-x86-sse2-exceptions-wip-1 > > The second patch updates the FP exception feature test code and the actual > implementation to support exceptions from SSE2 FP instructions on x86-32. > It is known to work on Linux (build Erlang with "-O2 -msse2 -mfpmath=sse" > as CFLAGS). The patch is not final (indicated by the absence of a patch number > and the "-wip" (work-in-progress) suffix), but the only thing missing is a safety > check to see if the CPU has SSE2 or not before SSE2 FP exceptions are enabled. I've now replaced this patch with the final version which includes the SSE2 safety check: http://www.it.uu.se/research/group/hipe/snapshots/patch-otp-0804-4-x86-sse2-exceptions We're now eagerly awaiting your OSX patches ... From richardc@REDACTED Fri Aug 18 11:06:24 2006 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 18 Aug 2006 11:06:24 +0200 Subject: edoc and -compile(export_all) In-Reply-To: References: Message-ID: <44E58310.5090606@it.uu.se> Anders Nygren wrote: > HI I just noticed that edoc does not recognize > -compile(export_all) So if a module has -compile(export_all) > then edoc will just generate an empty page, I assume because > there are no export statements. It is a design decision. Note that -compile(export_all) is not part of the language, but is rather a compiler pragma. Syntactically, it's just another "wild" attribute on the form -foo(bar) - it has no special meaning in the language itself, only to the Beam compiler. Also, sometimes people forget an export_all declaration in their code, so even if edoc would recognize such pragmas, I don't think it should obey them by default, but only if some option was turned on. I generally feel that using export_all instead of listing your exports in production code (i.e., excluding debugging purposes) promotes sloppy programming, but in some special cases it might be a reasonable thing to do. If you (anyone) feel that you really do need (honestly) such an option, then speak up now or forever hold your peace. /Richard From joelr1@REDACTED Fri Aug 18 11:26:45 2006 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 18 Aug 2006 10:26:45 +0100 Subject: Victory? (was Re: Mac Intel) In-Reply-To: <17637.33494.353017.151134@alkaid.it.uu.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> Message-ID: Mikael, On Aug 18, 2006, at 10:05 AM, Mikael Pettersson wrote: > I've now replaced this patch with the final version which includes > the SSE2 safety check: > http://www.it.uu.se/research/group/hipe/snapshots/patch-otp-0804-4- > x86-sse2-exceptions > > We're now eagerly awaiting your OSX patches ... I'll put everything together over the weekend. Thanks, Joel From Dietmar.Schaefer@REDACTED Fri Aug 18 12:02:15 2006 From: Dietmar.Schaefer@REDACTED (Dietmar.Schaefer@REDACTED) Date: Fri, 18 Aug 2006 12:02:15 +0200 Subject: I have to tell you the truth Message-ID: Hi, you erlang wizards ! I just followed a few links and suddenly found the article Erlang Style Concurrency on http://defmacro.org/ramblings/concurrency.htm I found that DFS Deutsche Flugsicherung - was referenced as to use erlang in air traffic controll software. I need to tell you the truth, that erlang is no longer in use in DFS. But I really would like to know WHICH air traffic company IS using elang. regards Dietmar DFS Deutsche Flugsicherung GmbH Center Langen Am DFS-Campus 1 D - 63225 Langen Tel.: +49-(0)6103-707-0 Internet: http://www.dfs.de Public-Key der DFS: http://www.dfs.de/dfs/public_key.asc -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Fri Aug 18 12:47:21 2006 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 18 Aug 2006 11:47:21 +0100 Subject: I have to tell you the truth In-Reply-To: References: Message-ID: <67F2A3F6-2202-4692-BE3C-7004F4DDB118@gmail.com> On Aug 18, 2006, at 11:02 AM, Dietmar.Schaefer@REDACTED wrote: > I need to tell you the truth, that erlang is no longer in use in DFS. Was there a problem with it? -- http://wagerlabs.com/ From yarivvv@REDACTED Fri Aug 18 13:58:05 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Fri, 18 Aug 2006 07:58:05 -0400 Subject: Tutorials In-Reply-To: <9CB79C836F98504C81BF082C4291E987792AE4@CHITDSEXC02.tds.corp.cendant.org> References: <9CB79C836F98504C81BF082C4291E987792AE4@CHITDSEXC02.tds.corp.cendant.org> Message-ID: <17244f480608180458n49941579jec92d4f532143ca5@mail.gmail.com> Hi, I wrote a tutorial last night on how to use Smerl to generate getters and setters for all record fields in a given source files to avoid the built in record access syntax. http://yarivsblog.com/articles/2006/08/18/smerl-demo-easy-function-based-record-access-in-erlang Old way: Name = Person#person.name, P1 = Person#person{name = "Bob"} Smerl way: Name = person:name(Person), P1 = person:name(Person, "Bob") :) Yariv On 8/17/06, Logan, Martin wrote: > > > > > All, I would like to collect and format all the existing tutorials for > erlang/otp. I would like anyone that has written a tutorial about anything > to please forward it to me or the list. I am going to endeavor to format > them, perhaps copy the style of the erlang docs, but I am not positive, and > then make them available. I will credit the authors of course. I think it > would be helpful for new people coming to the language to have a nice > compendium of tutorials. You can forward me the tutorials in any form and I > will do the work to get them all formatted nicely and then email the > collection, as a pdf, back out as well as make it available on the web. > > > > Cheers, > > Martin From bengt.kleberg@REDACTED Fri Aug 18 14:31:48 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Fri, 18 Aug 2006 14:31:48 +0200 Subject: Tutorials In-Reply-To: <17244f480608180458n49941579jec92d4f532143ca5@mail.gmail.com> References: <9CB79C836F98504C81BF082C4291E987792AE4@CHITDSEXC02.tds.corp.cendant.org> <17244f480608180458n49941579jec92d4f532143ca5@mail.gmail.com> Message-ID: <44E5B334.3050402@ericsson.com> On 2006-08-18 13:58, Yariv Sadan wrote: > Hi, > > I wrote a tutorial last night on how to use Smerl to generate getters > and setters for all record fields in a given source files to avoid the > built in record access syntax. could i use smerl to write the functions in question? (preferably to stdout) bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From alexander.harju@REDACTED Fri Aug 18 15:18:24 2006 From: alexander.harju@REDACTED (Alexander Harju) Date: Fri, 18 Aug 2006 15:18:24 +0200 Subject: Problem with trap_exit In-Reply-To: <2196.85.224.128.225.1155888115.squirrel@webmail.wiger.net> References: <44E499F0.7090706@mobilearts.com> <2196.85.224.128.225.1155888115.squirrel@webmail.wiger.net> Message-ID: <44E5BE20.5010900@mobilearts.com> Yeah, that make sense. If you have a supervisor you really don't want children to be able to trap exit. It would end up with pretty interesting restarts. It must be considered to be a weak design if you let a linked child-process ignore a crash of the parent anyway. I wasn't actually planing to use this structure at all but I noticed it when working on test-tool and I couldn't find anything about it the documentation. Find a way of go around it tho. Either start the child without link and then link it and trap exit or use a monitor of the parent and receive the {'DOWN',...}-message. Thanks for the response. // Alex Ulf Wiger wrote: >>Hi all. >>I'm having some problem trying to trap an exit in a gen_fsm. >>I've made this small example of the problem attached to this mail. It's >>a gen_server (test_server.erl) that starts a gen_fsm (test_fsm.erl) >>using gen_fsm:start_link(...) >>When I by purpose crash the server I expect that the >>handle_info-function in the state-machine to handle the {'EXIT', >>...}-signal since I've turned on trap_exit. >>Instead the terminte is called with the reason for the crash. >>Why is the signal not traped? >>Thanks, >>// Alex >> >> > >It _is_ trapped - otherwise, terminate() wouldn't be called. >Most likely, the main loop in gen_fsm is trapping the exit, >which it does if the 'EXIT' message comes from the parent >process. The thinking is that the parent process is most >likely a supervisor, and the gen_fsm process a worker process. >It then makes sure that it's not 'orphaned'. > >If you test your program from the shell, try unlinking the >gen_fsm process, then killing the shell process (call >exit(foo) at the shell prompt), and then link to the fsm >process from the new shell process. > >BR, >Ulf W > > > > > From yarivvv@REDACTED Fri Aug 18 15:49:52 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Fri, 18 Aug 2006 09:49:52 -0400 Subject: Tutorials In-Reply-To: <44E5B334.3050402@ericsson.com> References: <9CB79C836F98504C81BF082C4291E987792AE4@CHITDSEXC02.tds.corp.cendant.org> <17244f480608180458n49941579jec92d4f532143ca5@mail.gmail.com> <44E5B334.3050402@ericsson.com> Message-ID: <17244f480608180649i5ae99161k9c1afa10f927e45d@mail.gmail.com> > could i use smerl to write the functions in question? (preferably to stdout) Yes, smerl has a function, get_func, which returns the abstract form for a funcname/arity combination. The you can print it out with io:format("~p", [Form]). I just added 3 functions: smerl:get_forms reutrns the forms for a module, smerl:get_exports returns the exports for a module, and smerl:get_module, whic returns the module's name. You can get the latest version at http://yarivsblog.com/files/smerl.erl Yariv From tty@REDACTED Fri Aug 18 16:08:08 2006 From: tty@REDACTED (tty@REDACTED) Date: Fri, 18 Aug 2006 10:08:08 -0400 Subject: Erlang article #1 on programming.reddit.com Message-ID: -------- Original Message -------- From: "Christian S" Apparently from: owner-erlang-questions@REDACTED To: erlangquestions Subject: Re: Erlang article #1 on programming.reddit.com Date: Fri, 18 Aug 2006 09:44:45 +0200 > I'm in the camp that doesnt limit the meaning of "loop" to only be > imperative code with destructive assignment. I think a recursive > function is as much of a loop as anything else. I forget who, but > havent someone clever in the ways of computer science proved that > imperative and recursive code are equal in computability? I believe a proof can be found in "Foundations of Computer Science" by Aho and Ullman. At the very least a systematic transformation is decribed in the book from loops to recursion and back. It has been a long time since I read it. Regards t From erlangist@REDACTED Fri Aug 18 16:19:17 2006 From: erlangist@REDACTED (lang er) Date: Fri, 18 Aug 2006 22:19:17 +0800 Subject: Tutorials In-Reply-To: <44E5B334.3050402@ericsson.com> References: <9CB79C836F98504C81BF082C4291E987792AE4@CHITDSEXC02.tds.corp.cendant.org> <17244f480608180458n49941579jec92d4f532143ca5@mail.gmail.com> <44E5B334.3050402@ericsson.com> Message-ID: <230465c00608180719s2cfcae0fh82a77762f48ccc0a@mail.gmail.com> Here're my three blog posts about Erlang Abstract Form written in chinese: 1. Exploring Erlang Abstract Form--Retrieve Abstract Form from beam file http://agileprogrammer.blogspot.com/2006/08/erlang-abstract-form.html 2. Exploring Erlang Abstract Form--Module declaration and Form http://agileprogrammer.blogspot.com/2006/08/erlang-abstract-form-moduleform.html 3. Exploring Erlang Abstract Form--Create and modify module on the fly http://agileprogrammer.blogspot.com/2006/08/erlang-abstract-form-module.html 2006/8/18, Bengt Kleberg : > On 2006-08-18 13:58, Yariv Sadan wrote: > > Hi, > > > > I wrote a tutorial last night on how to use Smerl to generate getters > > and setters for all record fields in a given source files to avoid the > > built in record access syntax. > > could i use smerl to write the functions in question? (preferably to stdout) > > > bengt > -- > EPO guidelines 1978: "If the contribution to the known art resides > solely in a computer program then the subject matter is not > patentable in whatever manner it may be presented in the claims." > From Martin.Logan@REDACTED Fri Aug 18 16:27:52 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Fri, 18 Aug 2006 09:27:52 -0500 Subject: Tutorials (The list so far) In-Reply-To: <44E5B334.3050402@ericsson.com> Message-ID: <9CB79C836F98504C81BF082C4291E987792AF6@CHITDSEXC02.tds.corp.cendant.org> This is the list so far. http://www.sics.se/~joe/tutorials/robust_server/robust_server.html http://www.sics.se/~joe/tutorials/web_server/web_server.html http://www.sics.se/~joe/tutorials/client_server/client_server.html http://www.sics.se/~joe/tutorials/wiki/wiki.html http://www.kazmier.com/computer/port-howto/ http://yarivsblog.com/articles/2006/08/18/smerl-demo-easy-function-based -record-access-in-erlang http://www.erlang.org/faq/quick_start.html http://www.erlang.org/doc/doc-5.5/doc/getting_started/part_frame.html http://www.erlang.org/course/course.html From erlangX@REDACTED Fri Aug 18 16:49:36 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Fri, 18 Aug 2006 07:49:36 -0700 Subject: edoc and -compile(export_all) In-Reply-To: <44E58310.5090606@it.uu.se> References: <44E58310.5090606@it.uu.se> Message-ID: <20060818144935.GV6584@delora.autosys.us> On Fri, Aug 18, 2006 at 11:06:24AM +0200, Richard Carlsson wrote: > Anders Nygren wrote: > >HI I just noticed that edoc does not recognize > >-compile(export_all) So if a module has -compile(export_all) > >then edoc will just generate an empty page, I assume because > >there are no export statements. > > It is a design decision. Note that -compile(export_all) is not > part of the language, but is rather a compiler pragma. > Syntactically, it's just another "wild" attribute on the form > -foo(bar) - it has no special meaning in the language itself, > only to the Beam compiler. Also, sometimes people forget an > export_all declaration in their code, so even if edoc would > recognize such pragmas, I don't think it should obey them > by default, but only if some option was turned on. > > I generally feel that using export_all instead of listing your > exports in production code (i.e., excluding debugging purposes) > promotes sloppy programming, but in some special cases it might > be a reasonable thing to do. If you (anyone) feel that you really > do need (honestly) such an option, then speak up now or forever > hold your peace. > > /Richard > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I would like to see edoc recognize -compile(export_all) when using a (your choice) option. There are times when I would like to make my docs for *all* funs. Enabling the special case using an option would be useful to me. That way I can make my "internal docs" that I then remove from the public doc package I deliver. I also like that edoc reminds me when I forget to drop the export_all so I like the default case of empty page. ~Michael From richardc@REDACTED Fri Aug 18 17:23:17 2006 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 18 Aug 2006 17:23:17 +0200 Subject: edoc and -compile(export_all) In-Reply-To: <20060818144935.GV6584@delora.autosys.us> References: <44E58310.5090606@it.uu.se> <20060818144935.GV6584@delora.autosys.us> Message-ID: <44E5DB65.8030008@it.uu.se> Michael McDaniel wrote: > I would like to see edoc recognize -compile(export_all) when using > a (your choice) option. > > There are times when I would like to make my docs for *all* funs. > Enabling the special case using an option would be useful to me. > That way I can make my "internal docs" that I then remove from the > public doc package I deliver. Note that there already is an option for generating 'private' documentation (i.e., that also lists non-exported functions). The option in question here would cause functions in modules that contain -compile(export_all) to be shown exactly as if they were listed in proper -export([...]) declarations, even in the public documentation. > I also like that edoc reminds me when I forget to drop the export_all > so I like the default case of empty page. If you just use export_all to tweak the behaviour of edoc, then try using the 'private' option instead. /Richard From erlangX@REDACTED Fri Aug 18 17:27:15 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Fri, 18 Aug 2006 08:27:15 -0700 Subject: edoc and -compile(export_all) In-Reply-To: <44E5DB65.8030008@it.uu.se> References: <44E58310.5090606@it.uu.se> <20060818144935.GV6584@delora.autosys.us> <44E5DB65.8030008@it.uu.se> Message-ID: <20060818152715.GW6584@delora.autosys.us> On Fri, Aug 18, 2006 at 05:23:17PM +0200, Richard Carlsson wrote: > Michael McDaniel wrote: > > I would like to see edoc recognize -compile(export_all) when using > > a (your choice) option. > > > > There are times when I would like to make my docs for *all* funs. > > Enabling the special case using an option would be useful to me. > > That way I can make my "internal docs" that I then remove from the > > public doc package I deliver. > > Note that there already is an option for generating 'private' > documentation (i.e., that also lists non-exported functions). > > The option in question here would cause functions in modules > that contain -compile(export_all) to be shown exactly as if > they were listed in proper -export([...]) declarations, even > in the public documentation. > > > I also like that edoc reminds me when I forget to drop the export_all > > so I like the default case of empty page. > > If you just use export_all to tweak the behaviour of edoc, > then try using the 'private' option instead. > > /Richard > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Thanks, Richard. Looks like my comments/desires are all addressed with the current edoc. It may be apparent from my previous comments that I have not used edoc heavily (though have used it some). ~M From ke.han@REDACTED Fri Aug 18 17:39:36 2006 From: ke.han@REDACTED (ke han) Date: Fri, 18 Aug 2006 23:39:36 +0800 Subject: Tutorials (The list so far) In-Reply-To: <9CB79C836F98504C81BF082C4291E987792AF6@CHITDSEXC02.tds.corp.cendant.org> References: <9CB79C836F98504C81BF082C4291E987792AF6@CHITDSEXC02.tds.corp.cendant.org> Message-ID: <333FBA1E-4263-4A4B-86F6-476DD5BE761D@redstarling.com> I assume you mean you are collecting howtos in addition to the collection already from trapexit? ke han On Aug 18, 2006, at 10:27 PM, Logan, Martin wrote: > > This is the list so far. > > http://www.sics.se/~joe/tutorials/robust_server/robust_server.html > > http://www.sics.se/~joe/tutorials/web_server/web_server.html > > http://www.sics.se/~joe/tutorials/client_server/client_server.html > > http://www.sics.se/~joe/tutorials/wiki/wiki.html > > http://www.kazmier.com/computer/port-howto/ > > http://yarivsblog.com/articles/2006/08/18/smerl-demo-easy-function- > based > -record-access-in-erlang > > http://www.erlang.org/faq/quick_start.html > > http://www.erlang.org/doc/doc-5.5/doc/getting_started/part_frame.html > > http://www.erlang.org/course/course.html > > > From Martin.Logan@REDACTED Fri Aug 18 18:59:03 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Fri, 18 Aug 2006 11:59:03 -0500 Subject: Tutorials (The list so far) In-Reply-To: <333FBA1E-4263-4A4B-86F6-476DD5BE761D@redstarling.com> Message-ID: <9CB79C836F98504C81BF082C4291E987792AF8@CHITDSEXC02.tds.corp.cendant.org> That is what I had intended - but now I am thinking why be inconsistent? My next "what we have so far" list will include the howto's -----Original Message----- From: ke han [mailto:ke.han@REDACTED] Sent: Friday, August 18, 2006 10:40 AM To: Logan, Martin Cc: erlang-questions@REDACTED Subject: Re: Tutorials (The list so far) I assume you mean you are collecting howtos in addition to the collection already from trapexit? ke han On Aug 18, 2006, at 10:27 PM, Logan, Martin wrote: > > This is the list so far. > > http://www.sics.se/~joe/tutorials/robust_server/robust_server.html > > http://www.sics.se/~joe/tutorials/web_server/web_server.html > > http://www.sics.se/~joe/tutorials/client_server/client_server.html > > http://www.sics.se/~joe/tutorials/wiki/wiki.html > > http://www.kazmier.com/computer/port-howto/ > > http://yarivsblog.com/articles/2006/08/18/smerl-demo-easy-function- > based > -record-access-in-erlang > > http://www.erlang.org/faq/quick_start.html > > http://www.erlang.org/doc/doc-5.5/doc/getting_started/part_frame.html > > http://www.erlang.org/course/course.html > > > From roger.larsson@REDACTED Fri Aug 18 20:24:41 2006 From: roger.larsson@REDACTED (Roger Larsson) Date: Fri, 18 Aug 2006 20:24:41 +0200 Subject: qt4 bindings? In-Reply-To: <44E46B1D.1000006@ertw.com> References: <44E46B1D.1000006@ertw.com> Message-ID: <200608182024.41583.roger.larsson@norran.net> On Thursday 17 August 2006 15:11, you wrote: > I've been exploring the possibility of creating erlang qt4 > (http://www.trolltech.com/products/qt) bindings, so before I get too far > I thought I'd ask if anyone else has thought about this or done any work. > I have been THINKING about it for a very long time. It should be a perfect fit! It might be interesting to look at how it has been implemented for Python. http://www.riverbankcomputing.co.uk/pyqt/ Trolltech also has java bindings for qt4. /RogerL From erlangist@REDACTED Sat Aug 19 12:40:37 2006 From: erlangist@REDACTED (lang er) Date: Sat, 19 Aug 2006 18:40:37 +0800 Subject: qt4 bindings? In-Reply-To: <2069.85.224.128.225.1155887802.squirrel@webmail.wiger.net> References: <44E46B1D.1000006@ertw.com> <44E483FC.6070809@ericsson.com> <2FD85315-7B95-40D1-B9E9-A6FD1CB221A0@gmail.com> <44E48E6D.30704@ericsson.com> <536FC36A-C96F-4740-8330-5DC04D1ACC45@gmail.com> <2069.85.224.128.225.1155887802.squirrel@webmail.wiger.net> Message-ID: <230465c00608190340k4ed39590t8076537a0c6b73c6@mail.gmail.com> Are there any url for these benchmarks? 2006/8/18, Ulf Wiger : > > My impression from past benchmarks is that message passing over TCP > loopback is pretty well optimized - little more than a memcopy. > > BR, > Ulf W > > > > Well, I can just see matrices, arrays and structures flying back and > > forth :-). > > > > On Aug 17, 2006, at 4:42 PM, Mats Cronqvist wrote: > > > >> i would guess there's additional overhead. i would further guess > >> it's insignificant. > >> it makes it a whole lot *easier* to send stuff over the network, > >> though. > >> > >> mats > > > > -- > > http://wagerlabs.com/ > > > > > > > > > > > > > > > From yarivvv@REDACTED Sat Aug 19 15:00:39 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Sat, 19 Aug 2006 09:00:39 -0400 Subject: Smerl breakthough: metacurrying Message-ID: <17244f480608190600o4c3e07d1p30be72690d453110@mail.gmail.com> Hi, I added a new capability to Smerl, allowing you to curry parameters for function forms in runtime, finally freeing us from having to know the Erlang abstract form! Quick example: C1 = smerl:new(foo), {ok, C2} = smerl:add_func(C1, "add(A,B) -> A+B."). {ok, C3} = smerl:curry_add(C1, add, 2, 5), {ok, C4} = smerl:curry_add(C3, add, 2, [3,2]), smerl:compile(C4), 7 = smerl:add(6,1), 8 = smerl:add(3), 5 = smerl:add(). Get the latest verion of smerl at http://yarivsblog.com/files/smerl.erl The full story is here http://yarivsblog.com/articles/2006/08/19/erlang-metaprogramming-breakthrough-metacurrying Enjoy! Yariv From ulf@REDACTED Sat Aug 19 15:02:10 2006 From: ulf@REDACTED (Ulf Wiger) Date: Sat, 19 Aug 2006 15:02:10 +0200 (CEST) Subject: qt4 bindings? In-Reply-To: <230465c00608190340k4ed39590t8076537a0c6b73c6@mail.gmail.com> References: <44E46B1D.1000006@ertw.com> <44E483FC.6070809@ericsson.com> <2FD85315-7B95-40D1-B9E9-A6FD1CB221A0@gmail.com> <44E48E6D.30704@ericsson.com> <536FC36A-C96F-4740-8330-5DC04D1ACC45@gmail.com> <2069.85.224.128.225.1155887802.squirrel@webmail.wiger.net> <230465c00608190340k4ed39590t8076537a0c6b73c6@mail.gmail.com> Message-ID: <41120.81.233.251.65.1155992530.squirrel@webmail.wiger.net> > Are there any url for these benchmarks? > > 2006/8/18, Ulf Wiger : >> >> My impression from past benchmarks is that message passing over TCP >> loopback is pretty well optimized - little more than a memcopy. >> >> BR, >> Ulf W No, they were from an Ericsson-internal project benchmarking distributed erlang using VIA. The results were a bit flawed due to the fact that we couldn't find a VIA-enabled ethernet card for our boxes. It turned out that distr erlang over TCP loopback was about as fast as over VIA loopback. The explanation given was that TCP loopback is difficult to beat, as it only checks a few headers and then basically does a memcopy. VIA without hardware support couldn't do much better. BR, Ulf W From david.nospam.hopwood@REDACTED Sat Aug 19 18:10:37 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Sat, 19 Aug 2006 17:10:37 +0100 Subject: Smerl breakthough: metacurrying In-Reply-To: <17244f480608190600o4c3e07d1p30be72690d453110@mail.gmail.com> References: <17244f480608190600o4c3e07d1p30be72690d453110@mail.gmail.com> Message-ID: <44E737FD.4060407@blueyonder.co.uk> Yariv Sadan wrote: > Hi, > > I added a new capability to Smerl, allowing you to curry parameters > for function forms in runtime, finally freeing us from having to know > the Erlang abstract form! > [...] > http://yarivsblog.com/articles/2006/08/19/erlang-metaprogramming-breakthrough-metacurrying This functionality is similar to Lisp's quasiquoting. It is generalized by quasipatterns in E: (That page unfortunately assumes a lot of context that might be opaque to people not familiar with E, but hopefully the main ideas will come through.) Quasipatterns are more general because, as well as being able to make substitutions (what you call metacurrying), they also allow pattern matching on programs without having to know the abstract form. For example: /** * What's the derivative of expr with respect to var? I.e. what's * "d(expr)/d(var)"? */ def deriv(expr, var) :any { switch (expr) { # ** means "to the power" match e`$var ** @exp` ? (isConst(exp)) { e`$exp * $var ** ($exp - 1)` } match e`@a + @b` { e`${deriv(a, var)} + ${deriv(b, var)}` } ... # other differentiable expressions } } Also, quasipatterns are designed to be able to process multiple languages, and even mixtures of languages, while still being able to express simple cases simply. -- David Hopwood From joelr1@REDACTED Sat Aug 19 18:19:49 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 19 Aug 2006 17:19:49 +0100 Subject: ERL_NO_PORT Message-ID: <8E8CA67A-E1F3-489F-9674-1C240D78D404@gmail.com> Folks, I'm trying to launch a node from a C program and connect to it using erl_connect which is returning -3. My understanding is that this is ERL_NO_PORT. I do have epmd running. I launch erl -noinput -sname foo@REDACTED -setcookie foobarbaz I then connect like this erl_init(NULL, 0); erl_connect_init(1, "foobarbaz", 0); int fd = erl_connect("foo@REDACTED"); Any clues? Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Sat Aug 19 18:23:36 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 19 Aug 2006 17:23:36 +0100 Subject: ERL_NO_PORT In-Reply-To: <8E8CA67A-E1F3-489F-9674-1C240D78D404@gmail.com> References: <8E8CA67A-E1F3-489F-9674-1C240D78D404@gmail.com> Message-ID: Apparently, I need to sleep for a second or two after launching the node. This gives it time to startup. On Aug 19, 2006, at 5:19 PM, Joel Reymont wrote: > Folks, > > I'm trying to launch a node from a C program and connect to it > using erl_connect which is returning -3. My understanding is that > this is ERL_NO_PORT. I do have epmd running. > > I launch erl -noinput -sname foo@REDACTED -setcookie foobarbaz > > I then connect like this > > erl_init(NULL, 0); > erl_connect_init(1, "foobarbaz", 0); > > int fd = erl_connect("foo@REDACTED"); -- http://wagerlabs.com/ From joelr1@REDACTED Sat Aug 19 19:29:54 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 19 Aug 2006 18:29:54 +0100 Subject: Spawning erl from a C program In-Reply-To: References: <8E8CA67A-E1F3-489F-9674-1C240D78D404@gmail.com> Message-ID: It turns out to be harder than I thought. I can connect to erl only if I launch it from the command line. I always get -3 from erl_connect when I spawn erl from my C program. For some reason I cannot connect to the spawned node from another node either, although net_adm:ping/1 returns 'pong'. This is the spawned node: 6060 ?? S 0:00.14 /usr/local/lib/erlang/erts-5.5/bin/beam -- - root /usr/local/lib/erlang -progname erl -- -home /Users/joelr -sname cocoanode@REDACTED -noshell -noinput -setcookie foobarbaz -noshell - noinput I then do this: erl -setcookie foobarbaz -sname x@REDACTED Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] Eshell V5.5 (abort with ^G) (x@REDACTED)1> User switch command --> r 'cocoanode@REDACTED' --> j 1 {shell,start,[init]} 2* {cocoanode@REDACTED,shell,start,[]} --> c 2 *** ERROR: Shell process terminated! (^G to start new job) *** and the result is clearly not what I'm expecting! I can ping the node, though: User switch command --> j 1 {shell,start,[init]} --> c 1 (x@REDACTED)2> net_adm:ping('cocoanode@REDACTED'). pang Any clues? Thanks, Joel -- http://wagerlabs.com/ From vladdu55@REDACTED Sat Aug 19 21:44:33 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Sat, 19 Aug 2006 20:44:33 +0100 Subject: Smerl breakthough: metacurrying In-Reply-To: <44E737FD.4060407@blueyonder.co.uk> References: <17244f480608190600o4c3e07d1p30be72690d453110@mail.gmail.com> <44E737FD.4060407@blueyonder.co.uk> Message-ID: <95be1d3b0608191244u7ae5940eq4d30f257d2e2a3ee@mail.gmail.com> Hi, On 8/19/06, David Hopwood wrote: > This functionality is similar to Lisp's quasiquoting. It is generalized > by quasipatterns in E: > Since this is now in the open: I have an Erlang implementation of this kind of quasipatterns in the working (quite early stage). More precisely, it will be an extension of the language with meta-operators. best regards, Vlad From matthew@REDACTED Sun Aug 20 13:10:55 2006 From: matthew@REDACTED (Matthew Sackman) Date: Sun, 20 Aug 2006 12:10:55 +0100 Subject: OTP Performance Message-ID: <20060820111055.GA21775@wellquite.org> Hi, Whilst I think I'm very familiar with the documentation or erlang.org, this has probably been raised for, so feel free to point me in the direction of the answers... Exhibit 1: -module(test). -export([flood/1, flood/2, send/1, receiver/0]). flood(Count) -> Target = spawn_link(test, receiver, []), Start = now(), flood(Count, Target), End = now(), io:format("~w~n", [timer:now_diff(End, Start)]), Target ! stop, ok. flood(0, _Target) -> ok; flood(N, Target) -> send(Target), flood(N-1, Target). send(Target) -> Target ! ok. receiver() -> receive stop -> exit(normal); _Else -> receiver() end. and I get about 3.5 seconds for 10,000,000 messages. Exhibit 2: -module(test). -behavior(gen_server). -export([start_link/0, init/1, handle_cast/2, terminate/2]). -export([flood/1, flood/2, send/1]). flood(Count) -> {ok, Target} = start_link(), Start = now(), flood(Count, Target), End = now(), io:format("~w~n", [timer:now_diff(End, Start)]), gen_server:cast(Target, stop), ok. flood(0, _Target) -> ok; flood(N, Target) -> send(Target), flood(N-1, Target). send(Target) -> gen_server:cast(Target, ok). start_link() -> gen_server:start_link(test, {}, []). init({}) -> {ok, {}}. handle_cast(stop, State) -> {stop, normal, State}; handle_cast(_Any, State) -> {noreply, State}. terminate(normal, _State) -> ok; terminate(Code, State) -> io:format("Terminating ~w ~w~n", [Code, State]). And it's now about 17 seconds for 10,000,000 messages. Now, I know that gen_servers invokes functions via the Implicit Apply mechanism (eg Mod:handle_cast), and that is expensive. So in many ways, these results aren't surprising. So my question is, what does this mean for applications that need to achieve a very high throughput of messages a second? 1) Is there a body of applications where OTP has been avoided because it hurts performance? 2) Are there other solutions that allow you to use OTP and maintain high message throughput? For example, is it generally considered to have a dozen or so processes that each do a little, and chain messages between them, or have much fewer processes that each do a more sizeable chunk of the work and thus reduce messaging costs? 3) Does Erlang implement copy on write for communication? If so, does that mean that batching messages can be a win? E.g. rather than sending the items of a list, send the list itself - does this actually reduce the work done by Erlang (I realise this is a different matter from the OTP-related questions)? Many thanks, Matthew -- Matthew Sackman BOFH excuse #135: You put the disk in upside down. From yarivvv@REDACTED Mon Aug 21 04:59:30 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Sun, 20 Aug 2006 22:59:30 -0400 Subject: Smerl breakthough: metacurrying In-Reply-To: <44E737FD.4060407@blueyonder.co.uk> References: <17244f480608190600o4c3e07d1p30be72690d453110@mail.gmail.com> <44E737FD.4060407@blueyonder.co.uk> Message-ID: <17244f480608201959y54c632faua51da6d65581322b@mail.gmail.com> Fascinating stuff, David. Thanks for the link. I only know Lisp on a basic level and although I know Lisp has great metaprogramming capabilities I didn't know about this specific feature. I guess I have some homework to do :) Best, Yariv On 8/19/06, David Hopwood wrote: > Yariv Sadan wrote: > > Hi, > > > > I added a new capability to Smerl, allowing you to curry parameters > > for function forms in runtime, finally freeing us from having to know > > the Erlang abstract form! > > > [...] > > http://yarivsblog.com/articles/2006/08/19/erlang-metaprogramming-breakthrough-metacurrying > > This functionality is similar to Lisp's quasiquoting. It is generalized > by quasipatterns in E: > > > (That page unfortunately assumes a lot of context that might be opaque > to people not familiar with E, but hopefully the main ideas will come > through.) > > Quasipatterns are more general because, as well as being able to make > substitutions (what you call metacurrying), they also allow pattern > matching on programs without having to know the abstract form. For > example: > > /** > * What's the derivative of expr with respect to var? I.e. what's > * "d(expr)/d(var)"? > */ > def deriv(expr, var) :any { > switch (expr) { > # ** means "to the power" > match e`$var ** @exp` ? (isConst(exp)) { > e`$exp * $var ** ($exp - 1)` > } > match e`@a + @b` { > e`${deriv(a, var)} + ${deriv(b, var)}` > } > ... # other differentiable expressions > } > } > > Also, quasipatterns are designed to be able to process multiple languages, > and even mixtures of languages, while still being able to express simple > cases simply. > > -- > David Hopwood > > > > From yarivvv@REDACTED Mon Aug 21 05:03:27 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Sun, 20 Aug 2006 23:03:27 -0400 Subject: new Smerl home Message-ID: <17244f480608202003s29edf61co6052635660fe4e4b@mail.gmail.com> Hi, Smerl has grown from a one day hack job to a pretty useful library, so I decided to turn it into a "real" project, hosted on code.google.com. Smerl's new home is now http://code.google.com/p/smerl/. I will probably write about new capabilities in my blog, but "official" releases will come from this location. If anybody wants to contribute to Smerl, you can show me your patches, and if they are good I'll grant you committer access to the svn repository. Best regards, Yariv From joe.armstrong@REDACTED Mon Aug 21 10:18:10 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Mon, 21 Aug 2006 10:18:10 +0200 Subject: Tutorials In-Reply-To: <9CB79C836F98504C81BF082C4291E987792AEB@CHITDSEXC02.tds.corp.cendant.org> Message-ID: Martin, I don't like the idea of you editing my tutorials - but I do like the idea of you defining and maintaining the guidelines and tools for producing tutorials. If you edit my tutorials you could introduce errors, and use formatting that I think detracts from the text, and I just don't want this to happen. I'm sorry, but I just do not want other people editing my texts and republishing them. I do not like the model "anybody can edit this text" but I do like the model "only authors can edit the text" and anybody can comment. << the system I and Uff are making will be exactly like this - only authors can edit text, non-authors will be able to add questions to the text (these will be formatted as a single non-obtrusive question mark in the text flow) - when you mouse hover over the question mark you will get see the question - anybody can answer, the answer will go into the hover box) >> If you provide a standard and tell people "follow this standard" then I will happily comply - *if I like the standard* The original trap-exit site how to's which used the gentoo document dtd's were a great step in the right direction. IMHO - is is critical that the documentation format is fixed, frozen and well-defined - so that tools can be written to automatically digest and reprocess the inputs. Vanilla HTML etc is just not good enough. I think the only possible alternative is properly validated XML (we could have used SGML, but maintaining the tool chains is becoming bothersome) with an appropriate DTD. The next point concerns the stability of the site - the next time we move the documentation we want to move to a URL that stays fixed for a long time - previous attempts to do this have always failed. To solve both these problems I would like to suggest the following: 1. We store the tutorials as static content (ie no mysql, php, yaws ... in the background :) with no wiki's etc to allow editing (you could point to an off-site wiki for discussions etc) 2. We have a single master site and a number of mirrors for the entire site - so we need volunteers for mirrors, and a volunteer for the master site 3. We use the gentoo documentation tool chain http://www.gentoo.org/proj/en/gdp/doc/doc-tipsntricks.xml In addition we need a website and some administration around all of this - so I guess a version (-1) is just a simple list of pointers to tutorials. Here are some tutorials I have written http://www.sics.se/~joe/tutorials/robust_server/robust_server.html http://www.sics.se/~joe/tutorials/web_server/web_server.html http://www.sics.se/~joe/tutorials/client_server/client_server.html http://www.sics.se/~joe/tutorials/wiki/wiki.html http://www.erlang.org/faq/parsing.html http://www.erlang.org/examples/examples-2.0.html http://www.erlang.org/examples/win95demo/win95demo.html Now I will happily convert these to the gentoo format (If this is what we decide to do) And I will happily allow you to reference these. But I do not wish you to reformat these in any way without my explicit permission. /Joe ________________________________ From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Logan, Martin Sent: den 17 augusti 2006 19:29 To: erlang-questions@REDACTED Subject: RE: Tutorials I have gotten a few responses with some good ideas. I think that this can be a community effort and still get done quickly and completely. Here are the steps I think would be best for getting this accomplished - fast 1. Send to the list, this thread, any and all links to tutorials that exist 2. When the posting slows down I will extract a list of links from the thread and someone from trap exit or the erlang wiki can take the time to put them on the website. 3. Start a new thread on suggestions, and hopefully examples, for the layout and structure of the tutorials - I like the format from trap exit and I also like the erlang docs site. 4. Use the wiki to allow people to sign up for tutorials to format - I will volunteer right now to do many of them. 5. Post the final copies on erlang websites all over the net, but have a versioned master copy somewhere for easy updating. Thoughts, comments...? Cheers, Martin ________________________________ From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Logan, Martin Sent: Thursday, August 17, 2006 9:29 AM To: erlang-questions@REDACTED Subject: Tutorials All, I would like to collect and format all the existing tutorials for erlang/otp. I would like anyone that has written a tutorial about anything to please forward it to me or the list. I am going to endeavor to format them, perhaps copy the style of the erlang docs, but I am not positive, and then make them available. I will credit the authors of course. I think it would be helpful for new people coming to the language to have a nice compendium of tutorials. You can forward me the tutorials in any form and I will do the work to get them all formatted nicely and then email the collection, as a pdf, back out as well as make it available on the web. Cheers, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe.armstrong@REDACTED Mon Aug 21 10:28:43 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Mon, 21 Aug 2006 10:28:43 +0200 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <9CB79C836F98504C81BF082C4291E987792AED@CHITDSEXC02.tds.corp.cendant.org> Message-ID: You can't write many programs without loops, I use 'em all the time: Most programs look like this: loop(State) -> receive {From, Q} -> {Reply, State1} = F(Q, State), From ! {self(), Reply}, loop(State1) end. In often define: for(Max, Max, F) -> [F(Max)]; for(I, Max, F) -> [F(I)|F(I+1,Max,F]. The word "loop" in the context of a function programming language is usually taken to mean - "a tail recursive function" - basically I call any function that can recurse forever without consuming stack a loop. /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Logan, Martin > Sent: den 17 augusti 2006 21:37 > To: Ryan Rawson; Joel Reymont > Cc: Yariv Sadan; erlangquestions > Subject: RE: Erlang article #1 on programming.reddit.com > > You are scaring me, who is talking of adding loops. I will > stop using Erlang if I see a for loop :-) No more single > assignment? That would make Erlang rather messy. Plus > function clauses and recursion + loops inside function > clauses themselves will greatly increase the cognative load > imposed upon anyone trying to understand Erlang code. One of > the greatest things about Erlang is that after a few months > of coding it you can dive into the kernel, read code, and > understand what you are reading > - try doing that with Java, damn, try doing that with any > OO/procedural language. > > Martin > > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Ryan Rawson > Sent: Thursday, August 17, 2006 1:30 PM > To: Joel Reymont > Cc: Yariv Sadan; erlangquestions > Subject: Re: Erlang article #1 on programming.reddit.com > > Surely you jest? > > You'd have to break Erlang to insert loops. First off you'd > have variables that need to be changed. That substantiably > breaks Erlang imho. > > If you want to loop, you probably want to map or fold. If > you need to loop you might want to use gen_server instead, or > at the last resort use a tail recursive call. > > > > On 8/17/06, Joel Reymont wrote: > > > > On Aug 17, 2006, at 5:53 PM, Ryan Rawson wrote: > > > > > I beg of all of you - no for loops. No looping of any kind! > > > > What's wrong with looping? > > > > -- > > http://wagerlabs.com/ > > > > > > > > > > > > > From dmitriid@REDACTED Mon Aug 21 11:04:52 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Mon, 21 Aug 2006 12:04:52 +0300 Subject: Tutorials In-Reply-To: <9CB79C836F98504C81BF082C4291E987792AE4@CHITDSEXC02.tds.corp.cendant.org> References: <9CB79C836F98504C81BF082C4291E987792AE4@CHITDSEXC02.tds.corp.cendant.org> Message-ID: There is also http://www.cbel.com/erlang_programming_language/ You can find all sorts of links there (I also added that site to wiki ) On 8/17/06, Logan, Martin wrote: > > All, I would like to collect and format all the existing tutorials for > erlang/otp. I would like anyone that has written a tutorial about anything > to please forward it to me or the list. I am going to endeavor to format > them, perhaps copy the style of the erlang docs, but I am not positive, and > then make them available. I will credit the authors of course. I think it > would be helpful for new people coming to the language to have a nice > compendium of tutorials. You can forward me the tutorials in any form and I > will do the work to get them all formatted nicely and then email the > collection, as a pdf, back out as well as make it available on the web. > > > > Cheers, > > Martin > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe.armstrong@REDACTED Mon Aug 21 11:05:23 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Mon, 21 Aug 2006 11:05:23 +0200 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <20060817200614.GA1637@vailsys.com> Message-ID: No really :-) - loops are implemented by applying the good old "last call optimisation" This is as old as the hills - in compiling a function based language you compile a function call as follows: 1) push the address of the next instruction to be executed after the function call onto the stack. 2) transfer control to the start of the new function When a function returns it executes a RET instruction, this expects a return address on the top of the stack. It pops the stack and jumps to this address. Now suppose the next instruction to be executed is a RET instruction all this does is pop the return address stack and jump to the popped address. In this case we can omit the code that pushes a return address and jumps into the code and replace it with a simple jump into the code since the function itself will return to the correct place when it executes a RET instruction. Now I don't know exactly who pointed this out, I might have been Knuth but I am unsure five minutes Googling did not turn up the answer. << anybody know this ???? - a change to show your erudition, or Googling skills [[ apparently Google is writing nasty letters to dictionaries who use the word Googling as a verb - so go on {{ meta - disclaimer, not my Employers point of view (had the say that) "sue me" }} ]] >> :-> >> This was certainly well-know (or at least I knew it :-) way before the term tail-recursion was mentioned. As regards loops in FPL - only the very pure disallow loops in their languages. There is a language based on category theory (I forget the name, << another chance to show your erudition >>) which allowed loops but only if it could be proven at compile time that the loops terminate. So loops indexed by a integer that was decremented by one at each step and terminated at zero, and which were started off at a large positive integer were possibly ok - otherwise you're in trouble. Amazingly it was said to be possible to write non-trivial programs in this language, but nobody said it was easy, just possible. /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Rick Pettit > Sent: den 17 augusti 2006 22:06 > To: Logan, Martin > Cc: Ryan Rawson; Joel Reymont; Yariv Sadan; erlangquestions > Subject: Re: Erlang article #1 on programming.reddit.com > > On Thu, Aug 17, 2006 at 02:43:34PM -0500, Logan, Martin wrote: > > Rick, you are correct but technically the process loops in > Erlang are > > implemented via tail recursion. > > Then I am technically correct as well (I mentioned > tail-recursion below, though it should come as no surprise > what happens if you "loop forever" using non-tail recursive calls :-) > > > I think this is where the misunderstanding came about. Procedural > > looping structures such as "for", "while", "do while", and > "foreach" > > are the sorts of looping constructs that would severely > damage Erlang as a language, IMHO. > > Procedural looping constructs in a non-procedural language > doesn't make much sense, which is why I'm not worried about > someone trying to add them. > > -Rick > > > Cheers, > > Martin > > > > -----Original Message----- > > From: owner-erlang-questions@REDACTED > > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Rick Pettit > > Sent: Thursday, August 17, 2006 1:50 PM > > To: Ryan Rawson > > Cc: Joel Reymont; Yariv Sadan; erlangquestions > > Subject: Re: Erlang article #1 on programming.reddit.com > > > > On Thu, Aug 17, 2006 at 11:30:19AM -0700, Ryan Rawson wrote: > > > Surely you jest? > > > > > > You'd have to break Erlang to insert loops. First off you'd have > > > variables that need to be changed. That substantiably > breaks Erlang > > > imho. > > > > Not sure I understand you here. I have recently been using Joe > > Armstrong's robust TCP server, for example, and in that > there is the > > notion of a "controller" loop for synchronizing operations among > > multiple socket handlers. > > > > For "simple servers" (i.e. those not requiring a behaviour like > > gen_server) > > I see tail-recursive server loop constructs all the time. > > > > Single assignment isn't a problem considering each new iteration > > through the loop allows for new local variable bindings, etc. > > > > > If you want to loop, you probably want to map or fold. > If you need > > > to loop you might want to use gen_server instead, or at the last > > > resort use a tail recursive call. > > > > What do you think goes on behind the scenes in a map, fold, or even > > gen_server? > > > > You might be surprised to find that there is a server loop in a > > gen_server (it is what passes the state to gen_server > callbacks, and > > it is what the gen_server callbacks return the state to). > > > > Perhaps I misunderstand you. > > > > -Rick > > > > > On 8/17/06, Joel Reymont wrote: > > > > > > > >On Aug 17, 2006, at 5:53 PM, Ryan Rawson wrote: > > > > > > > >> I beg of all of you - no for loops. No looping of any kind! > > > > > > > >What's wrong with looping? > > > > > > > >-- > > > >http://wagerlabs.com/ > > > > > > > > > > > > > > > > > > > > > > > > > From joe.armstrong@REDACTED Mon Aug 21 11:50:44 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Mon, 21 Aug 2006 11:50:44 +0200 Subject: OTP Performance In-Reply-To: <20060820111055.GA21775@wellquite.org> Message-ID: Hi Matthew, I'll try and answer your questions: Before I answer I have some comments on your program. Neither of the measurements mean anything. If you use cast in this way you need some proof that you won't overflow the message buffers. If the producer is faster than the consumer then your program will eventually crash. By casting 10M message you probably are just filling the message queue, so what you have measured is the time to fill a queue, you should really send a stop message. ie say flood(0, Target) -> Target ! stop. Then the stop time is the time when the receiver receives the stop message. Try this and report back :-) Now the questions: 1) I don't know the answer. I don't know if does hurt performance - a system is more than just a loop with a cast in it. Now I guess there are two kinds of apps - ones that *need* things like replicated data bases (for fault tolerance) code change on-the-fly (because the site can never go down) etc. By the time you have added all the other stuff you need (supervisor strategies, replicated data bases on different nodes) then the performance difference might not be as great as you think they are going to be. For small projects without complex requirements for fault-tolerance then a non-OTP solution might be faster. The answer is "measure and see" The test of a good design is a modular structure that will allow you to run with and without OTP, so that you can make such measurements. As far as I am aware all the big commercial projects (ie with turnovers over 100 M$) use OTP and the performance is adequate. I wrote some comments in http://www.erlang.org/ml-archive/erlang-questions/200605/msg00375.html Which I'll quote here > The OTP behaviours are not magic bullets, they are just libraries of > erlang code for performing repetitious tasks in a consistent manner. > The main benefit of using (say) gen_servers is organisational - if you > have a large team of programmers (say a few hundred) and they are all writing > client-servers, then it might be a good idea if they all go about this > the same way. > The OTP libraries were written to the standardise the way servers, etc.- > were written, this was so that one programmer in a large organisation could > understand the code of another programmer in the same organisation. > There are, of course, no such benefits in a small one-person project. > Writing a client-server in Erlang is really easy. You need to understand > send receive and spawn. Making it fault tolerant is easy (you need to > understand spawn_link, links, and exit signals). > You can have 95% of all the fun by understanding how to roll-your own > client-servers using spawn, send, receive etc. > gen_server provides one commonly used architectural pattern, in a > context where it is suitable for large programmer teams. 2) You have to measure. Personally I use lot's of processes, each doing very little, I use binaries for large "string" data. Using lots of processes will pay back on the multi-core CPUs so it's the kind of future proof way of doing things. 3) Yes - mostly. Binaries can end up on a shared heap, and indeed a shared heap might be used internally. But you're not supposed to worry about this. You should write your program without thinking about whether things get copied or not. Then measure. Then if you program is too slow ask this group why. If you want to send an entire list then I imagine sending them item by item would be far slower than just sending the list. Anyway the code would be far shorter. Pid ! L vs Pid ! start, foreach(fun(I) -> Pid ! I end, L), Pid ! stop and some weird code at the receiver to receive the list This would be a total mess, the list either gets send in the wrong order since we want to build it tail-first or need reversing Note that list processing is very efficient and highly optimised. /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of > Matthew Sackman > Sent: den 20 augusti 2006 13:11 > To: erlang-questions@REDACTED > Subject: OTP Performance > > Hi, > > Whilst I think I'm very familiar with the documentation or > erlang.org, this has probably been raised for, so feel free > to point me in the direction of the answers... > > Exhibit 1: > -module(test). > > -export([flood/1, flood/2, send/1, receiver/0]). > > flood(Count) -> > Target = spawn_link(test, receiver, []), > Start = now(), > flood(Count, Target), > End = now(), > io:format("~w~n", [timer:now_diff(End, Start)]), > Target ! stop, > ok. > > flood(0, _Target) -> > ok; > > flood(N, Target) -> > send(Target), > flood(N-1, Target). > > send(Target) -> > Target ! ok. > > receiver() -> > receive > stop -> > exit(normal); > _Else -> > receiver() > end. > > and I get about 3.5 seconds for 10,000,000 messages. > Exhibit 2: > -module(test). > > -behavior(gen_server). > > -export([start_link/0, init/1, handle_cast/2, terminate/2]). > -export([flood/1, flood/2, send/1]). > > flood(Count) -> > {ok, Target} = start_link(), > Start = now(), > flood(Count, Target), > End = now(), > io:format("~w~n", [timer:now_diff(End, Start)]), > gen_server:cast(Target, stop), > ok. > > flood(0, _Target) -> > ok; > > flood(N, Target) -> > send(Target), > flood(N-1, Target). > > send(Target) -> > gen_server:cast(Target, ok). > > start_link() -> > gen_server:start_link(test, {}, []). > > init({}) -> > {ok, {}}. > > handle_cast(stop, State) -> > {stop, normal, State}; > handle_cast(_Any, State) -> > {noreply, State}. > > terminate(normal, _State) -> > ok; > terminate(Code, State) -> > io:format("Terminating ~w ~w~n", [Code, State]). > > And it's now about 17 seconds for 10,000,000 messages. Now, I > know that gen_servers invokes functions via the Implicit > Apply mechanism (eg Mod:handle_cast), and that is expensive. > So in many ways, these results aren't surprising. > > So my question is, what does this mean for applications that > need to achieve a very high throughput of messages a second? > > 1) Is there a body of applications where OTP has been avoided > because it hurts performance? > > 2) Are there other solutions that allow you to use OTP and > maintain high message throughput? For example, is it > generally considered to have a dozen or so processes that > each do a little, and chain messages between them, or have > much fewer processes that each do a more sizeable chunk of > the work and thus reduce messaging costs? > > 3) Does Erlang implement copy on write for communication? If > so, does that mean that batching messages can be a win? E.g. > rather than sending the items of a list, send the list itself > - does this actually reduce the work done by Erlang (I > realise this is a different matter from the OTP-related questions)? > > Many thanks, > > Matthew > -- > Matthew Sackman > > BOFH excuse #135: > You put the disk in upside down. > From thomasl_erlang@REDACTED Mon Aug 21 12:24:36 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Mon, 21 Aug 2006 03:24:36 -0700 (PDT) Subject: Erlang article #1 on programming.reddit.com In-Reply-To: Message-ID: <20060821102436.41312.qmail@web38809.mail.mud.yahoo.com> --- "Joe Armstrong (TN/EAB)" wrote: > In this case we can omit the code that pushes a > return address and jumps > into the code > and replace it with a simple jump into the code > since the function > itself will return > to the correct place when it executes a RET > instruction. > > Now I don't know exactly who pointed this out, I > might have been Knuth > but I am unsure > five minutes Googling did not turn up the answer. It could be Guy L. Steele, Debunking the "Expensive Procedure Call" Myth, AI Memo 443, MIT, 1977. (Subtitled "Lambda: the Ultimate Goto") Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From joe.armstrong@REDACTED Mon Aug 21 12:48:41 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Mon, 21 Aug 2006 12:48:41 +0200 Subject: Erlang article #1 on programming.reddit.com In-Reply-To: <20060821102436.41312.qmail@web38809.mail.mud.yahoo.com> Message-ID: I'm usure - but I feel that this was known well before this, in the golden Knuthian days /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of > Thomas Lindgren > Sent: den 21 augusti 2006 12:25 > To: erlang-questions@REDACTED > Subject: RE: Erlang article #1 on programming.reddit.com > > > > --- "Joe Armstrong (TN/EAB)" > wrote: > > > In this case we can omit the code that pushes a return address and > > jumps into the code and replace it with a simple jump into the code > > since the function itself will return to the correct place when it > > executes a RET instruction. > > > > Now I don't know exactly who pointed this out, I might have > been Knuth > > but I am unsure five minutes Googling did not turn up the answer. > > It could be Guy L. Steele, Debunking the "Expensive Procedure > Call" Myth, AI Memo 443, MIT, 1977. > (Subtitled "Lambda: the Ultimate Goto") > > Best, > Thomas > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection > around http://mail.yahoo.com > From matthew@REDACTED Mon Aug 21 12:52:42 2006 From: matthew@REDACTED (Matthew Sackman) Date: Mon, 21 Aug 2006 11:52:42 +0100 Subject: OTP Performance In-Reply-To: References: <20060820111055.GA21775@wellquite.org> Message-ID: <20060821105242.GB14207@wellquite.org> Hi Joe, Many thanks for your comments. On Mon, Aug 21, 2006 at 11:50:44AM +0200, Joe Armstrong (TN/EAB) wrote: > If you use cast in this way you need some proof that you won't overflow > the message buffers. > > If the producer is faster than the consumer then your program will > eventually crash. > > By casting 10M message you probably are just filling the message queue, > so > what you have measured is the time to fill a queue, Well yes, but if in both cases I don't start the receiver then they should both take exactly the same time to send right? I've looked at the code for gen_server:cast and it seems to, in the general case, end up doing a erlang:send/2. So if in both cases it's just measuring the time to fill a queue then why does the OTP version (with the receiver/gen_server not started) take 35 seconds to send 10M messages and the non-OTP version, sending to a dead Pid, take 0.5 seconds? > you should really > send a stop message. ie say flood(0, Target) -> Target ! stop. > Then the stop time is the time when the receiver receives the stop > message. > Try this and report back :-) Ok, I made the change, the performance is the same. And I have no idea why sending the stop message before taking the second time measurement would somehow make the receiver receive and process the stop message before the sender completes the sending. Are there some semantics attached to 'stop' atoms that I'm unaware of? I'm probably just confused - lack of sleep and all that... Surely the OTP version will always take much longer because of the use of implicit apply? If I did something like: flood(0, Target) -> Target ! {stop, self()}, receive End -> End end; flood(N, Target) -> send(Target), flood(N-1, Target). send(Target) -> Target ! ok. receiver() -> receive {stop, From} -> From ! now(), exit(normal); _Else -> receiver() end. Then it forces the stop to be synchronous. But I'm still getting 3.5 seconds for the non-OTP version. If I make a similar change to the OTP version then I still get 17 seconds. Many thanks for the rest of your comments - they all make sense to me. :-) Matthew -- Matthew Sackman BOFH excuse #336: the xy axis in the trackball is coordinated with the summer solstice From thomasl_erlang@REDACTED Mon Aug 21 14:42:43 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Mon, 21 Aug 2006 05:42:43 -0700 (PDT) Subject: Erlang article #1 on programming.reddit.com In-Reply-To: Message-ID: <20060821124243.65856.qmail@web38812.mail.mud.yahoo.com> --- "Joe Armstrong (TN/EAB)" wrote: > > I'm usure - but I feel that this was known well > before this, > in the golden Knuthian days I think it's reasonable to say that, if so, the technique was, at the very least, not widely known. (The related topic of continuations _is_ earlier than that, though: see John Reynolds' history, for example. But that was used "in the other direction", for the mathematical description of imperative control.) Steele mentions some prior attempts at the similar sort of recursion-elimination in the "Debunking" report, but Steele and Sussman can be credited with popularizing the concept (while inventing Scheme), and quite possibly with actually getting the implementation right too. (E.g., your description of what to do sounds much like Steele's, except he uses PDP assembly language.) Clinger's paper on proper tail recursion (PLDI'98) has as its earliest tail-recursion reference Sussman and Steele's Scheme report from 1975. That Scheme report describes, among other things, how recursive programs can execute in constant space by looking at Lisp-level examples, but not the low-level implementation. Steele and Sussman wrote a cluster of papers on Scheme and its compilation. These papers are, as far as I can tell, where our understanding of tail-recursion elimination in programming languages came from. Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From Martin.Logan@REDACTED Mon Aug 21 16:20:34 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Mon, 21 Aug 2006 09:20:34 -0500 Subject: The Current List of Erlang Tutorials Message-ID: <9CB79C836F98504C81BF082C4291E987792AFC@CHITDSEXC02.tds.corp.cendant.org> Here is the current list of tutorials. Does anyone have more to add? 1. http://npt.cc.rsu.ru/user/wanderer/ODP/Erlang_tutorial.html 2. http://www.sics.se/~joe/tutorials/robust_server/robust_server.html 3. http://www.sics.se/~joe/tutorials/web_server/web_server.html 4. http://www.sics.se/~joe/tutorials/client_server/client_server.html 5. http://www.sics.se/~joe/tutorials/wiki/wiki.html 6. http://www.kazmier.com/computer/port-howto/ 7. http://yarivsblog.com/articles/2006/08/18/smerl-demo-easy-function-based -record-access-in-erlang 8. http://www.erlang.org/faq/quick_start.html 9. http://www.erlang.org/doc/doc-5.5/doc/getting_started/part_frame.html 10. http://www.erlang.org/course/course.html 11. http://www.erlang.org/download/erlang-book-part1.pdf 12. http://www.castro.aus.net/~maurice/serc/erlbk/ >From trap exit -------------- 13. A fast web server demonstrating some undocumented Erlang features 14. Adding my own BIF 15. Building Non Blocking Erlang apps 16. Cascading Behaviours 17. Distributing a Mnesia schema 18. Erlmerge - The install tool 19. Gettext - An internationalization package. 20. How to setup an RSS feed with Yaws 21. How to setup your own Web server with Yaws 22. How to talk LDAP from Erlang 23. How to write HowTo's 24. How to write an RSS aggregator 25. Lookup MX Records In DNS 26. ODBC with Erlang R10B-4 and MySQL 27. OTP Release Handling Tutorial 28. SNMP Quick Start 29. Writing an Erlang Port using OTP Principles --------------------------------------------------------------- Other resources for those interested in getting started with erlang http://wadler.blogspot.com/2005/06/service-architectures.html http://www.erlang.se/doc/programming_rules.shtml http://www.erlang.org/doc/doc-5.5/doc/efficiency_guide/part_frame.html http://www.matt-mcdonnell.com/code/code_erl/erl_course/erl_course.html http://www.matt-mcdonnell.com/code/code_erl/erl_life/erl_life.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Logan@REDACTED Mon Aug 21 17:24:42 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Mon, 21 Aug 2006 10:24:42 -0500 Subject: The Current List of Erlang Tutorials In-Reply-To: <9CB79C836F98504C81BF082C4291E987792AFC@CHITDSEXC02.tds.corp.cendant.org> Message-ID: <9CB79C836F98504C81BF082C4291E987792AFF@CHITDSEXC02.tds.corp.cendant.org> Here is the current list of tutorials. Does anyone have more to add? 1. http://npt.cc.rsu.ru/user/wanderer/ODP/Erlang_tutorial.html 2. http://www.sics.se/~joe/tutorials/robust_server/robust_server.html 3. http://www.sics.se/~joe/tutorials/web_server/web_server.html 4. http://www.sics.se/~joe/tutorials/client_server/client_server.html 5. http://www.sics.se/~joe/tutorials/wiki/wiki.html 6. http://www.kazmier.com/computer/port-howto/ 7. http://yarivsblog.com/articles/2006/08/18/smerl-demo-easy-function-based -record-access-in-erlang 8. http://www.erlang.org/faq/quick_start.html 9. http://www.erlang.org/doc/doc-5.5/doc/getting_started/part_frame.html 10. http://www.erlang.org/course/course.html 11. http://www.erlang.org/download/erlang-book-part1.pdf 12. http://www.castro.aus.net/~maurice/serc/erlbk/ >From trap exit -------------- 13. A fast web server demonstrating some undocumented Erlang features 14. Adding my own BIF 15. Building Non Blocking Erlang apps 16. Cascading Behaviours 17. Distributing a Mnesia schema 18. Erlmerge - The install tool 19. Gettext - An internationalization package. 20. How to setup an RSS feed with Yaws 21. How to setup your own Web server with Yaws 22. How to talk LDAP from Erlang 23. How to write HowTo's 24. How to write an RSS aggregator 25. Lookup MX Records In DNS 26. ODBC with Erlang R10B-4 and MySQL 27. OTP Release Handling Tutorial 28. SNMP Quick Start 29. Writing an Erlang Port using OTP Principles Tutorials in Languages other than English -------------------------------------------------- Chinese: 1. Exploring Erlang Abstract Form--Retrieve Abstract Form from beam file http://agileprogrammer.blogspot.com/2006/08/erlang-abstract-form.html 2. Exploring Erlang Abstract Form--Module declaration and Form http://agileprogrammer.blogspot.com/2006/08/erlang-abstract-form-modulef orm.html 3. Exploring Erlang Abstract Form--Create and modify module on the fly http://agileprogrammer.blogspot.com/2006/08/erlang-abstract-form-module. html --------------------------------------------------------------- Other resources for those interested in getting started with erlang http://wadler.blogspot.com/2005/06/service-architectures.html http://www.erlang.se/doc/programming_rules.shtml http://www.erlang.org/doc/doc-5.5/doc/efficiency_guide/part_frame.html http://www.matt-mcdonnell.com/code/code_erl/erl_course/erl_course.html http://www.matt-mcdonnell.com/code/code_erl/erl_life/erl_life.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.vanwoerkom@REDACTED Mon Aug 21 20:51:37 2006 From: marc.vanwoerkom@REDACTED (Marc van Woerkom) Date: Mon, 21 Aug 2006 20:51:37 +0200 Subject: Yaws/Erlang podcast Message-ID: <44EA00B9.6050409@fernuni-hagen.de> http://bsdtalk.blogspot.com/2006/08/bsdtalk062-interview-with-yaws.html Thanks to Claes and Will! Marc From headspin@REDACTED Mon Aug 21 21:08:53 2006 From: headspin@REDACTED (dda) Date: Mon, 21 Aug 2006 21:08:53 +0200 Subject: edoc question Message-ID: I have a module with a main .erl file and some header .hrl files. I added nice edoc tags, but I can't find a way to make edoc include all the hard work I put in documenting the code in the header files; the help in the .erl file shows up, not the rest... What am I missing? -- Didier From fritchie@REDACTED Mon Aug 21 21:19:06 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Mon, 21 Aug 2006 14:19:06 -0500 Subject: OTP Performance In-Reply-To: Message of "Mon, 21 Aug 2006 11:52:42 BST." <20060821105242.GB14207@wellquite.org> Message-ID: <200608211919.k7LJJ64a090895@snookles.snookles.com> >>>>> "ms" == Matthew Sackman writes: ms> So if in both cases ms> it's just measuring the time to fill a queue then why does the OTP ms> version (with the receiver/gen_server not started) take 35 seconds ms> to send 10M messages and the non-OTP version, sending to a dead ms> Pid, take 0.5 seconds? Perhaps some fraction is due to the bit about "sending to a dead Pid". There's all sorts of message passing overhead the VM can avoid if there is no live recipient. -Scott From joelr1@REDACTED Mon Aug 21 21:34:35 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 21 Aug 2006 20:34:35 +0100 Subject: Movidis: A 16x core 600Mhz low-power MIPS machine Message-ID: <57C87071-E3DD-4D0C-8611-C57BE7BFECEC@gmail.com> Courtesy of Duncan Couts at the Haskell mailing list. Ideal for Erlang? --- http://www.movidis.com/products/rev_spec.asp A 16x core 600Mhz low-power MIPS machine pre-installed with Debian. With the new smp-capable ghc, such a box might be rather good for some Haskell server application. It's a similar price to Sun's 4x core (with 4 threads per core) 1Ghz low power sparc machines (which run Linux or Solaris). -- http://wagerlabs.com/ From ulf.wiger@REDACTED Mon Aug 21 21:56:25 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Mon, 21 Aug 2006 21:56:25 +0200 Subject: Movidis: A 16x core 600Mhz low-power MIPS machine In-Reply-To: <57C87071-E3DD-4D0C-8611-C57BE7BFECEC@gmail.com> Message-ID: About $3000, I take it. BR, Ulf W > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Joel Reymont > Sent: den 21 augusti 2006 21:35 > To: Erlang Questions > Subject: Movidis: A 16x core 600Mhz low-power MIPS machine > > Courtesy of Duncan Couts at the Haskell mailing list. Ideal > for Erlang? > > --- > > http://www.movidis.com/products/rev_spec.asp > > A 16x core 600Mhz low-power MIPS machine pre-installed with Debian. > > With the new smp-capable ghc, such a box might be rather good > for some Haskell server application. > > It's a similar price to Sun's 4x core (with 4 threads per > core) 1Ghz low power sparc machines (which run Linux or Solaris). > > -- > http://wagerlabs.com/ > > > > > > From mfs@REDACTED Mon Aug 21 22:07:03 2006 From: mfs@REDACTED (Mark Scandariato) Date: Mon, 21 Aug 2006 16:07:03 -0400 (EDT) Subject: Movidis: A 16x core 600Mhz low-power MIPS machine Message-ID: <6098071.1156190823677.JavaMail.root@mswamui-valley.atl.sa.earthlink.net> The bare-board is about $1995. -----Original Message----- >From: "Ulf Wiger (TN/EAB)" >Sent: Aug 21, 2006 3:56 PM >To: Joel Reymont , Erlang Questions >Subject: RE: Movidis: A 16x core 600Mhz low-power MIPS machine > > >About $3000, I take it. > >BR, >Ulf W > >> -----Original Message----- >> From: owner-erlang-questions@REDACTED >> [mailto:owner-erlang-questions@REDACTED] On Behalf Of Joel Reymont >> Sent: den 21 augusti 2006 21:35 >> To: Erlang Questions >> Subject: Movidis: A 16x core 600Mhz low-power MIPS machine >> >> Courtesy of Duncan Couts at the Haskell mailing list. Ideal >> for Erlang? >> >> --- >> >> http://www.movidis.com/products/rev_spec.asp >> >> A 16x core 600Mhz low-power MIPS machine pre-installed with Debian. >> >> With the new smp-capable ghc, such a box might be rather good >> for some Haskell server application. >> >> It's a similar price to Sun's 4x core (with 4 threads per >> core) 1Ghz low power sparc machines (which run Linux or Solaris). >> >> -- >> http://wagerlabs.com/ >> >> >> >> >> >> From ok@REDACTED Tue Aug 22 00:42:56 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 22 Aug 2006 10:42:56 +1200 (NZST) Subject: Erlang article #1 on programming.reddit.com Message-ID: <200608212242.k7LMgu1M239448@atlas.otago.ac.nz> Jeff Wood wrote: You answered your own question ... RECURSION is NOT a LOOP! Oh yes it is. This is like saying "that's not a computer, it's a data processor". Read a good book about functional programming language implementation, and then recite the mantra function = label call = goto recursion = loop until it sinks in. From erlang5a@REDACTED Tue Aug 22 01:21:04 2006 From: erlang5a@REDACTED (Erlang 5A) Date: Mon, 21 Aug 2006 19:21:04 -0400 Subject: Possibly off-topic: Erlang-related job posting Message-ID: <6e89d5580608211621od0532a1n63730739692a7ee0@mail.gmail.com> Despite a fair amount of looking, we weren't able to find a better place to post an erlang-related job. We realize this is slightly off-topic, and request that all responses to this message happen off of the list. We have no desire or intention to inject commercial messages into this discussion channel, but would like to reach out to the community in the only way possible. Please respond via email to: erlang5a.gmail.com Thank you. ----- Role: We are looking for a result-oriented, proactive, and creative individual to join our software development team. This individual will play an active role in all aspects of software development, including functional walkthroughs, technical designs, and implementations to release. Additionally, this individual must also be able to work with our customers directly and efficiently to implement, maintain, and support the product. Responsibilities: * Participate in the design and implementation process * Maintain and extend the existing code-base * Develop data migration and synchronization tools * Debug, troubleshoot, and act as a technical liaison for customer installations * Create and write technical design specifications * Program to technical design specifications in multiple languages * Document and submit appropriate code reviews * Production systems support Requirements: * BS or MS in Computer Science, or equivalent experience * Expert-level knowledge of C programming, Unix internals, and TCP/IP * Programming experience in interpreted languages (Python, Ruby, etc) * Programming experience with Erlang, Lisp, Haskell, or OCaml * Release management experience utilizing CVS, darcs, svn, etc. * Basic database design, implementation, and usage (Postgres, MySQL, Oracle) * Experience with XML, REST/AJAX, and current web frameworks (Rails/Django) * Solid shell scripting * Systems management and performance tuning * Excellent oral and written communication skills * Must be a proactive, intelligent, motivated individual, with the ability to work in groups or individually. From david.nospam.hopwood@REDACTED Tue Aug 22 02:06:41 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Tue, 22 Aug 2006 01:06:41 +0100 Subject: History of tail-call optimization In-Reply-To: <20060821102436.41312.qmail@web38809.mail.mud.yahoo.com> References: <20060821102436.41312.qmail@web38809.mail.mud.yahoo.com> Message-ID: <44EA4A91.20507@blueyonder.co.uk> Thomas Lindgren wrote: > "Joe Armstrong (TN/EAB)" wrote: > >>In this case we can omit the code that pushes a return address and >>jumps into the code and replace it with a simple jump into the code >>since the function itself will return to the correct place when it >>executes a RET instruction. >> >>Now I don't know exactly who pointed this out, I might have been Knuth >>but I am unsure five minutes Googling did not turn up the answer. >From R5RS: # Proper tail recursion was one of the central ideas in Steele and Sussman's # original version of Scheme. Their first Scheme interpreter implemented both # functions and actors. Control flow was expressed using actors, which differed # from functions in that they passed their results on to another actor instead # of returning to a caller. In the terminology of this section, each actor # finished with a tail call to another actor. # # Steele and Sussman later observed that in their interpreter the code for # dealing with actors was identical to that for functions [... because they only implemented a sequential subset of actors ...] # and thus there was no need to include both in the language. The "actors" referred to here are from Carl Hewitt and Henry Baker's Actors model. In fact their paper "Actors and Continuous Functionals" has an example of a tail-recursive 'factorial' implementation in which they make the point that only a constant amount of "working store" is needed. (This is the earliest Actors paper I know of that is on-line, but there were several others predating 1977.) The assembly language-level hack of replacing JSR+RET with JMP was probably known earlier, and special cases of it had been used in the implementation of Forth interpreters by Charles Moore. However, Steele was certainly responsible for popularizing it as an automatic optimization for higher-level languages: > It could be Guy L. Steele, Debunking the "Expensive Procedure Call" Myth, > AI Memo 443, MIT, 1977. (Subtitled "Lambda: the Ultimate Goto") which is well worth reading. The following paragraph, which I have generalized slightly, could have been applied to *numerous* programming constructs in the years since the paper was written: # In other words, we are now so afraid of [perceived-to-be-expensive construct] # that, rather than fix our compilers, we wish to teach programmers complex # techniques for using [lower-level, more error-prone construct] to circumvent # the shortcomings of our compilers! Such a desire is completely outrageous. # Not only does it violate the philosophical principles of clarity in language # design and programming style we have slowly been forced to accept, but it is # demonstrably ridiculous, because while the complete generality of these # [optimization] techniques has perhaps not been implemented in a compiler, a # good part of it has, and has worked for [some time]. Such is the ludicrous # position we have come to. -- David Hopwood From ke.han@REDACTED Tue Aug 22 03:22:30 2006 From: ke.han@REDACTED (ke han) Date: Tue, 22 Aug 2006 09:22:30 +0800 Subject: Movidis: A 16x core 600Mhz low-power MIPS machine In-Reply-To: <57C87071-E3DD-4D0C-8611-C57BE7BFECEC@gmail.com> References: <57C87071-E3DD-4D0C-8611-C57BE7BFECEC@gmail.com> Message-ID: Are there any corp sponsored folks on this list that can get one of these to test out erlang? Note this chip also has integrated encryption (as does the Sun Niagra chip). I am launching an online product in a few months and have looked at the Sun T2000 as well suited platform. I have tried to get Sun to be reasonable about giving me a discount on one of these new boxes (they really cost about $13,000 once you add on little features such as RAM and SAS hard drives ;-)...Sun is doing well these days and has gone back to their old arrogant behavior I've seen from the first dot com days. They are simply a tough company to partner with if you don't have blank checks to pass around. I would welcome some competition with this new 16 way chip!!! One thing I notice about the specs on this Movidis server...the motherboard only has 4 memory slots !!! Seriously, 8 should be an obvious requirement for something like this. Havng 4, makes you immediate step up to 2GB modules which are still on the front end of the price curve. ke han On Aug 22, 2006, at 3:34 AM, Joel Reymont wrote: > Courtesy of Duncan Couts at the Haskell mailing list. Ideal for > Erlang? > > --- > > http://www.movidis.com/products/rev_spec.asp > > A 16x core 600Mhz low-power MIPS machine pre-installed with Debian. > > With the new smp-capable ghc, such a box might be rather good for some > Haskell server application. > > It's a similar price to Sun's 4x core (with 4 threads per core) > 1Ghz low > power sparc machines (which run Linux or Solaris). > > -- > http://wagerlabs.com/ > > > > > From rsaccon@REDACTED Tue Aug 22 05:59:33 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Tue, 22 Aug 2006 00:59:33 -0300 Subject: Movidis: A 16x core 600Mhz low-power MIPS machine In-Reply-To: References: <57C87071-E3DD-4D0C-8611-C57BE7BFECEC@gmail.com> Message-ID: this is the chip inside: http://www.cavium.com/OCTEON_CN38XX_CN36XX.html i asked the the company whether they know a webhosting company where I can lease this machine and whether they tested Erlang on it, here what they replied. -----------------snip--------------------- Thank you for contacting Movidis regarding our Revolution x16 Server. As we have just announced our product this past week, there are not yet any datacenters or webhosting companies where you could lease a Revolution x16 Server, but the product is priced very attractively, starting at only $2995.00, that you may be able to procure one. There is nothing different about the debian kernel compared to the original aside from the hardware specific references. To the best of my knowledge, Erlang R11B is not yet running on a Revolution x16 Server. Thank you for your interest in Movidis, and I hope we can help you in the future with your requirements. -----------------snip--------------------- regards -- Roberto Saccon From matthias@REDACTED Tue Aug 22 08:51:05 2006 From: matthias@REDACTED (Matthias Lang) Date: Tue, 22 Aug 2006 08:51:05 +0200 Subject: Movidis: A 16x core 600Mhz low-power MIPS machine In-Reply-To: References: <57C87071-E3DD-4D0C-8611-C57BE7BFECEC@gmail.com> Message-ID: <17642.43353.101671.523678@antilipe.corelatus.se> Roberto Saccon writes: > this is the chip inside: http://www.cavium.com/OCTEON_CN38XX_CN36XX.html > > i asked the the company whether they know a webhosting company where > I can lease this machine and whether they tested Erlang on it, here > what they replied. FWIW, Corelatus runs live traffic on Erlang on MIPS-32 (Au1000). All I did was cross compile the open source release. Given a working linux toolchain, I would expect someone competent and experienced to have Erlang cross compiled and working within a day. I haven't even attempted to get HiPE to work on MIPS. That's a bigger job. Matthias From lennart.ohman@REDACTED Tue Aug 22 09:40:20 2006 From: lennart.ohman@REDACTED (Lennart Ohman) Date: Tue, 22 Aug 2006 09:40:20 +0200 Subject: Possibly off-topic: Erlang-related job posting In-Reply-To: <6e89d5580608211621od0532a1n63730739692a7ee0@mail.gmail.com> Message-ID: <000001c6c5be$38537710$0200a8c0@st.se> I believe a speak for a majority of the community when I say that if this list gets cluttered down with open (Erlang) positions, it will be considered a pleasant problem :-) However I believe you forgot to mention the geographical location? Best Regards Lennart ------------------------------------------------------------- Lennart Ohman office : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 67 35 Sehlstedtsgatan 6 fax : +46-8-667 82 30 SE-115 28, STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > -----Original Message----- > From: owner-erlang-questions@REDACTED [mailto:owner-erlang- > questions@REDACTED] On Behalf Of Erlang 5A > Sent: Tuesday, August 22, 2006 1:21 AM > To: erlang-questions@REDACTED > Subject: Possibly off-topic: Erlang-related job posting > > Despite a fair amount of looking, we weren't able to find a better > place to post an erlang-related job. We realize this is slightly > off-topic, and request that all responses to this message happen off > of the list. We have no desire or intention to inject commercial > messages into this discussion channel, but would like to reach out to > the community in the only way possible. > > Please respond via email to: erlang5a.gmail.com > > Thank you. > > ----- > > > Role: > We are looking for a result-oriented, proactive, and creative > individual to join our software development team. This individual will > play an active role in all aspects of software development, including > functional walkthroughs, technical designs, and implementations to > release. Additionally, this individual must also be able to work with > our customers directly and efficiently to implement, maintain, and > support the product. > > Responsibilities: > * Participate in the design and implementation process > * Maintain and extend the existing code-base > * Develop data migration and synchronization tools > * Debug, troubleshoot, and act as a technical liaison for customer > installations > * Create and write technical design specifications > * Program to technical design specifications in multiple languages > * Document and submit appropriate code reviews > * Production systems support > > Requirements: > * BS or MS in Computer Science, or equivalent experience > * Expert-level knowledge of C programming, Unix internals, and TCP/IP > * Programming experience in interpreted languages (Python, Ruby, etc) > * Programming experience with Erlang, Lisp, Haskell, or OCaml > * Release management experience utilizing CVS, darcs, svn, etc. > * Basic database design, implementation, and usage (Postgres, MySQL, > Oracle) > * Experience with XML, REST/AJAX, and current web frameworks > (Rails/Django) > * Solid shell scripting > * Systems management and performance tuning > * Excellent oral and written communication skills > * Must be a proactive, intelligent, motivated individual, with the > ability to work in groups or individually. From tobbe@REDACTED Tue Aug 22 10:03:48 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Tue, 22 Aug 2006 10:03:48 +0200 Subject: Movidis: A 16x core 600Mhz low-power MIPS machine In-Reply-To: <17642.43353.101671.523678@antilipe.corelatus.se> References: <57C87071-E3DD-4D0C-8611-C57BE7BFECEC@gmail.com> <17642.43353.101671.523678@antilipe.corelatus.se> Message-ID: A bit off topic: It would be nice with a little Trapexit Howto on how to cross compile Erlang. Perhaps you (Matthias :-) could do this based on your description: http://www.corelatus.com/~matthias/erlang_on_860.html and Brian Zhou's: http://www.erlang.org/ml-archive/erlang-questions/200507/msg00014.html BTW: Has anyone tried to run Yaws on the NSLU2 box? Is it an ok solution for a small home-site? Cheers, Tobbe Matthias Lang wrote: > Roberto Saccon writes: > > this is the chip inside: http://www.cavium.com/OCTEON_CN38XX_CN36XX.html > > > > i asked the the company whether they know a webhosting company where > > I can lease this machine and whether they tested Erlang on it, here > > what they replied. > > FWIW, Corelatus runs live traffic on Erlang on MIPS-32 (Au1000). All I > did was cross compile the open source release. > > Given a working linux toolchain, I would expect someone competent and > experienced to have Erlang cross compiled and working within a day. > > I haven't even attempted to get HiPE to work on MIPS. That's a bigger > job. > > Matthias > From richardc@REDACTED Tue Aug 22 10:17:25 2006 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 22 Aug 2006 10:17:25 +0200 Subject: edoc question In-Reply-To: References: Message-ID: <44EABD95.1070509@it.uu.se> dda wrote: > I have a module with a main .erl file and some header .hrl files. I > added nice edoc tags, but I can't find a way to make edoc include all > the hard work I put in documenting the code in the header files; the > help in the .erl file shows up, not the rest... Comments in header files are not automatically available to edoc. There are several reasons for this: first, it would cause duplication of the documentation (in each module that includes the header); second, the place where the -include(...) directive occurs is not necessarily where the information from the header file should be "inserted"; and third, it would require that you told edoc the exact include-path to be used for compilation of the module, so it could find the header files (which are not always in the same directory as the source file). There is however an experimental, as yet undocumented tag, @headerfile "foo.hrl" that you can try out. It explicitly includes tags from a header file at the place where the tag occurs. It will probably be made an official tag, so I think it's fairly safe to start using. /Richard From headspin@REDACTED Tue Aug 22 13:47:41 2006 From: headspin@REDACTED (dda) Date: Tue, 22 Aug 2006 13:47:41 +0200 Subject: edoc question In-Reply-To: <44EABD95.1070509@it.uu.se> References: <44EABD95.1070509@it.uu.se> Message-ID: Richard, Thank you for the info. I heard yesterday about the @headerfile tag, but this brought its own problems: 20> edoc:file("src/mb.erl"). src/test.hrl: warning: documentation before function definitions is ignored by @headerfile src/encodings.hrl: warning: documentation before function definitions is ignored by @headerfile [...] ok I put the %% @headerfile "test.hrl" [...] right after the -include("...hrl") directives. Doesn't seem to work. The edoc tags I put in the .hrl files were the same as in .erl files [@spec, @doc, @see etc], and someone mentioned the set of allowed tags in .hrl may be more restricted. Any thoughts? -- Didier On 8/22/06, Richard Carlsson wrote: > dda wrote: > > I have a module with a main .erl file and some header .hrl files. I > > added nice edoc tags, but I can't find a way to make edoc include all > > the hard work I put in documenting the code in the header files; the > > help in the .erl file shows up, not the rest... > > Comments in header files are not automatically available to edoc. > There are several reasons for this: first, it would cause > duplication of the documentation (in each module that includes > the header); second, the place where the -include(...) directive > occurs is not necessarily where the information from the header > file should be "inserted"; and third, it would require that you > told edoc the exact include-path to be used for compilation of > the module, so it could find the header files (which are not > always in the same directory as the source file). > > There is however an experimental, as yet undocumented tag, > @headerfile "foo.hrl" that you can try out. It explicitly > includes tags from a header file at the place where the tag > occurs. It will probably be made an official tag, so I think > it's fairly safe to start using. > > /Richard From richardc@REDACTED Tue Aug 22 14:35:20 2006 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 22 Aug 2006 14:35:20 +0200 Subject: edoc question In-Reply-To: References: <44EABD95.1070509@it.uu.se> Message-ID: <44EAFA08.5020607@it.uu.se> dda wrote: > Thank you for the info. I heard yesterday about the @headerfile tag, > but this brought its own problems: > > 20> edoc:file("src/mb.erl"). > src/test.hrl: warning: documentation before function definitions is > ignored by @headerfile > src/encodings.hrl: warning: documentation before function definitions > is ignored by @headerfile > [...] > ok > > I put the > %% @headerfile "test.hrl" > [...] > right after the -include("...hrl") directives. Doesn't seem to work. > The edoc tags I put in the .hrl files were the same as in .erl files > [@spec, @doc, @see etc], and someone mentioned the set of allowed tags > in .hrl may be more restricted. Any thoughts? Did you put function definitions in the header file? /Richard From headspin@REDACTED Tue Aug 22 14:58:53 2006 From: headspin@REDACTED (dda) Date: Tue, 22 Aug 2006 14:58:53 +0200 Subject: edoc question In-Reply-To: <44EAFA08.5020607@it.uu.se> References: <44EABD95.1070509@it.uu.se> <44EAFA08.5020607@it.uu.se> Message-ID: No. All -export() are in the .erl file. -- Didier On 8/22/06, Richard Carlsson wrote: > Did you put function definitions in the header file? > > /Richard From yarivvv@REDACTED Tue Aug 22 15:39:08 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 22 Aug 2006 09:39:08 -0400 Subject: static variables? Message-ID: <17244f480608220639p21a91c04s2f042b8bdf481cbd@mail.gmail.com> Hi, Strangely, I find myself at a crossroads where I would like to have static (i.e. per-module) variables. Yes -- I know -- this would be a gross violation of the shared-nothing principle -- but then I would be just as happy if all static variables were "final" so there's no way that two processes would trample on the same data. The situation is actually pretty simple: I have a 'person' module that corresponds to a database table. This module has a (static) list of fields. I would like to be able to access this static list from the module's functions without having to reconstruct it inside the function every time by calling a function such as fields() -> ["name", "age"]. Here's basically what I want to have: -module(person). -compile(export_all). fields = ["name", "age"]. get_fields() -> fields. Is there any way to do this in Erlang??? (I looked at the process dictionary, but it is per process, not per module). Thanks, Yariv From tobbe@REDACTED Tue Aug 22 16:03:42 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Tue, 22 Aug 2006 16:03:42 +0200 Subject: static variables? In-Reply-To: <17244f480608220639p21a91c04s2f042b8bdf481cbd@mail.gmail.com> References: <17244f480608220639p21a91c04s2f042b8bdf481cbd@mail.gmail.com> Message-ID: I should probably not show you this but... -------------------------------------------- # cat test.erl -module(test). -export([test/0]). -fields(["a","b"]). test() -> test. # erl Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] Eshell V5.5 (abort with ^G) 1> element(2, lists:keysearch(fields, 1, test:module_info(attributes))). {fields,["a","b"]} --Tobbe Yariv Sadan wrote: > Hi, > > Strangely, I find myself at a crossroads where I would like to have > static (i.e. per-module) variables. Yes -- I know -- this would be a > gross violation of the shared-nothing principle -- but then I would be > just as happy if all static variables were "final" so there's no way > that two processes would trample on the same data. > > The situation is actually pretty simple: I have a 'person' module that > corresponds to a database table. This module has a (static) list of > fields. I would like to be able to access this static list from the > module's functions without having to reconstruct it inside the > function every time by calling a function such as > > fields() -> > ["name", "age"]. > > Here's basically what I want to have: > > -module(person). > -compile(export_all). > > fields = ["name", "age"]. > > get_fields() -> > fields. > > Is there any way to do this in Erlang??? > > (I looked at the process dictionary, but it is per process, not per > module). > > Thanks, > Yariv > From chsu79@REDACTED Tue Aug 22 16:05:55 2006 From: chsu79@REDACTED (Christian S) Date: Tue, 22 Aug 2006 16:05:55 +0200 Subject: static variables? In-Reply-To: <17244f480608220639p21a91c04s2f042b8bdf481cbd@mail.gmail.com> References: <17244f480608220639p21a91c04s2f042b8bdf481cbd@mail.gmail.com> Message-ID: I think this is an optimization better solved by having a garbage collector that allow you to have uncollected "litterals" areas, so your fields() function doesnt have to create the list on the garbage collected heap each time. Rather just refer to the list in a litterals area. I know someone told me hipe was nibbling on this prospect but i dont remember what status it had. Basically, are you not making code less readable by applying micro optimizations? From ulf.wiger@REDACTED Tue Aug 22 16:06:19 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Tue, 22 Aug 2006 16:06:19 +0200 Subject: static variables? In-Reply-To: <17244f480608220639p21a91c04s2f042b8bdf481cbd@mail.gmail.com> Message-ID: You can do this with parameterized modules. http://www.erlang.se/workshop/2003/paper/p29-carlsson.pdf I believe the implementation in OTP R10 and R11 pretty much follows the proposal. BR, Ulf W > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Yariv Sadan > Sent: den 22 augusti 2006 15:39 > To: erlangquestions > Subject: static variables? > > Hi, > > Strangely, I find myself at a crossroads where I would like > to have static (i.e. per-module) variables. Yes -- I know -- > this would be a gross violation of the shared-nothing > principle -- but then I would be just as happy if all static > variables were "final" so there's no way that two processes > would trample on the same data. > > The situation is actually pretty simple: I have a 'person' > module that corresponds to a database table. This module has > a (static) list of fields. I would like to be able to access > this static list from the module's functions without having > to reconstruct it inside the function every time by calling a > function such as > > fields() -> > ["name", "age"]. > > Here's basically what I want to have: > > -module(person). > -compile(export_all). > > fields = ["name", "age"]. > > get_fields() -> > fields. > > Is there any way to do this in Erlang??? > > (I looked at the process dictionary, but it is per process, > not per module). > > Thanks, > Yariv > From vladdu55@REDACTED Tue Aug 22 16:15:00 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 22 Aug 2006 15:15:00 +0100 Subject: static variables? In-Reply-To: <17244f480608220639p21a91c04s2f042b8bdf481cbd@mail.gmail.com> References: <17244f480608220639p21a91c04s2f042b8bdf481cbd@mail.gmail.com> Message-ID: <95be1d3b0608220715h17d2867akbd3d3b91602ae473@mail.gmail.com> Hi, You can try to use the "abstract/parametrised module" functionality. I'm not sure if that's still available in R11, but read http://www.erlang.se/workshop/2003/paper/p29-carlsson.pdf#search=%22erlang%20abstract%20module%22 for details. regards, Vlad On 8/22/06, Yariv Sadan wrote: > Hi, > > Strangely, I find myself at a crossroads where I would like to have > static (i.e. per-module) variables. Yes -- I know -- this would be a > gross violation of the shared-nothing principle -- but then I would be > just as happy if all static variables were "final" so there's no way > that two processes would trample on the same data. > > The situation is actually pretty simple: I have a 'person' module that > corresponds to a database table. This module has a (static) list of > fields. I would like to be able to access this static list from the > module's functions without having to reconstruct it inside the > function every time by calling a function such as > > fields() -> > ["name", "age"]. > > Here's basically what I want to have: > > -module(person). > -compile(export_all). > > fields = ["name", "age"]. > > get_fields() -> > fields. > > Is there any way to do this in Erlang??? > > (I looked at the process dictionary, but it is per process, not per module). > > Thanks, > Yariv > From richardc@REDACTED Tue Aug 22 16:16:02 2006 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 22 Aug 2006 16:16:02 +0200 Subject: static variables? In-Reply-To: <17244f480608220639p21a91c04s2f042b8bdf481cbd@mail.gmail.com> References: <17244f480608220639p21a91c04s2f042b8bdf481cbd@mail.gmail.com> Message-ID: <44EB11A2.2030709@it.uu.se> Yariv Sadan wrote: > Strangely, I find myself at a crossroads where I would like to have > static (i.e. per-module) variables. Yes -- I know -- this would be a > gross violation of the shared-nothing principle -- but then I would be > just as happy if all static variables were "final" so there's no way > that two processes would trample on the same data. So, what you really are saying is that you want per-module constants? That is certainly no violation of anything, and can easily be expressed as nullary functions, as in your example. > Here's basically what I want to have: > > -module(person). > -compile(export_all). > > fields = ["name", "age"]. > > get_fields() -> > fields. I interpret your question as "is there a way of defining a constant complex value such as a list, without wasting time on rebuilding the structure each time it is accessed?". Well, ideally, the compiler should construct this constant and place it in memory once and for all, so that each access to the fields() function just returns a pointer to that memory. Sadly, the Beam compiler is not doing this yet, because of memory management implementation issues. If you HiPE-compile your program, however, you will get this effect. (And even the Beam compiler does some optimizations when it comes to constructing constant strings.) My advice would be: don't worry too much about the efficiency, but for starters consider using a list of atoms instead of a list of strings. It is easy to convert atoms to strings when necessary, and comparing atoms for equivalence is much cheaper. For example: fields() -> [name, age]. This has quite low cost. If you need much larger constant structures (hundreds of bytes) that are accessed often, then start considering passing them around in a separate variable, or in a field of a state record that you pass around. /Richard From yarivvv@REDACTED Tue Aug 22 16:32:32 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 22 Aug 2006 10:32:32 -0400 Subject: static variables? In-Reply-To: <44EB11A2.2030709@it.uu.se> References: <17244f480608220639p21a91c04s2f042b8bdf481cbd@mail.gmail.com> <44EB11A2.2030709@it.uu.se> Message-ID: <17244f480608220732k1938d9f6h83467c42c6a24f02@mail.gmail.com> First, thanks for everybody's answers. They have been very useful. Parameterized modules look very promising. I may very well use them. > > I interpret your question as "is there a way of defining a > constant complex value such as a list, without wasting time > on rebuilding the structure each time it is accessed?". Yes, that's what I meant :) > > Well, ideally, the compiler should construct this constant and > place it in memory once and for all, so that each access to > the fields() function just returns a pointer to that memory. > Sadly, the Beam compiler is not doing this yet, because of > memory management implementation issues. If you HiPE-compile > your program, however, you will get this effect. (And even > the Beam compiler does some optimizations when it comes to > constructing constant strings.) Thanks for the tip. I have no objections to solving the problem by turning on the hipe option :) > > My advice would be: don't worry too much about the efficiency, > but for starters consider using a list of atoms instead of a > list of strings. It is easy to convert atoms to strings when > necessary, and comparing atoms for equivalence is much cheaper. > For example: > > fields() -> > [name, age]. > > This has quite low cost. If you need much larger constant > structures (hundreds of bytes) that are accessed often, then > start considering passing them around in a separate variable, > or in a field of a state record that you pass around. > Although I don't mind passing variables around in general, this isn't really an option for me at the moment. I will stick to atoms, though. Thanks. I know the example I showed was very basic, but I was actually looking for a generic way of avoiding potentially very inefficient code. If my example had a thousand fields, the repeated construction cost of the list would have started seriously slowing things down (assuming the compiler didn't optimize it). Thanks again. I will probably go with parameterized modules, or just rely on hipe. Best, Yariv From yarivvv@REDACTED Tue Aug 22 17:03:25 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 22 Aug 2006 11:03:25 -0400 Subject: static variables? In-Reply-To: References: <17244f480608220639p21a91c04s2f042b8bdf481cbd@mail.gmail.com> Message-ID: <17244f480608220803h2e6c10c6qe48eef80e8adfff9@mail.gmail.com> Nice... :) I'll be well behaved and pretend I didn't see it ;) Yariv On 8/22/06, Torbjorn Tornkvist wrote: > > I should probably not show you this but... > -------------------------------------------- > # cat test.erl > -module(test). > -export([test/0]). > > -fields(["a","b"]). > > > test() -> test. > > # erl > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] > Eshell V5.5 (abort with ^G) > 1> element(2, lists:keysearch(fields, 1, test:module_info(attributes))). > {fields,["a","b"]} > > > --Tobbe > > > > > Yariv Sadan wrote: > > Hi, > > > > Strangely, I find myself at a crossroads where I would like to have > > static (i.e. per-module) variables. Yes -- I know -- this would be a > > gross violation of the shared-nothing principle -- but then I would be > > just as happy if all static variables were "final" so there's no way > > that two processes would trample on the same data. > > > > The situation is actually pretty simple: I have a 'person' module that > > corresponds to a database table. This module has a (static) list of > > fields. I would like to be able to access this static list from the > > module's functions without having to reconstruct it inside the > > function every time by calling a function such as > > > > fields() -> > > ["name", "age"]. > > > > Here's basically what I want to have: > > > > -module(person). > > -compile(export_all). > > > > fields = ["name", "age"]. > > > > get_fields() -> > > fields. > > > > Is there any way to do this in Erlang??? > > > > (I looked at the process dictionary, but it is per process, not per > > module). > > > > Thanks, > > Yariv > > > > From erlangist@REDACTED Tue Aug 22 18:22:29 2006 From: erlangist@REDACTED (lang er) Date: Wed, 23 Aug 2006 00:22:29 +0800 Subject: trap_exit cannot trap signal when exit/1 doesn't called explicitly Message-ID: <230465c00608220922h27b11745p3859a453cdab69d2@mail.gmail.com> I run the example link_demo(page 103) in Erlang book: -module(link_demo). %% %% Include files %% %% %% Exported Functions %% -export([start/0,demo/0,demonstrate_normal/0, demonstrate_exit/1, demonstrate_error/0,demonstrate_message/1]). %% %% API Functions %% start() -> register(demo, spawn(link_demo, demo, [])). demo() -> process_flag(trap_exit, true), demo1(). demo1() -> receive {'EXIT', From, normal} -> io:format("Demo process received normal exit from ~w~n", [From]), demo1(); {'EXIT', From, Reason} -> io:format("Demo process received exit signal ~w from ~w~n", [Reason, From]), demo1(); finished_demo -> io:format("Demo finished ~n", []); Other -> io:format("Demo process message ~w~n", [Other]), demo1() end. %% %% Local Functions %% demonstrate_normal() -> link(whereis(demo)). demonstrate_exit(What) -> link(whereis(demo)), exit(What). demonstrate_message(What) -> demo ! What. demonstrate_error()-> link(whereis(demo)), 1 = 2. ----------- After start(), I call demonstrate_normal(), demo process should trap the exit(normal) signal, but it doesn't, and if I call demonstrate_exit(normal) , demo do trap the exit(normal). The only difference between theses two situations is the exiting process call exit/1 explicitly. Must I call exit before existing ? My environment: MacBook(Intel) Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] Eshell V5.5 (abort with ^G) 1> Thanks! Best Regards James -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Logan@REDACTED Tue Aug 22 18:42:22 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Tue, 22 Aug 2006 11:42:22 -0500 Subject: Format for our tutorials Message-ID: <9CB79C836F98504C81BF082C4291E987792B09@CHITDSEXC02.tds.corp.cendant.org> 1. Send to the list, this thread, any and all links to tutorials that exist - COMPLETE 2. When the posting slows down I will extract a list of links from the thread and someone from trap exit or the erlang wiki can take the time to put them on the website. - COMPLETE ----------------------------------------- 3. Start a new thread on suggestions, and hopefully examples, for the layout and structure of the tutorials - I like the format from trap exit and I also like the erlang docs site. 4. Use the wiki to allow people to sign up for tutorials to format - I will volunteer right now to do many of them. 5. Post the final copies on erlang websites all over the net, but have a versioned master copy somewhere for easy updating. Below is a complete list of erlang tutorials available on the web today. The list now numbers 32 in English and 35 in total. These tutorials should be compiled and formatted uniformly. I like the gentoo format as advocated by Joe Armstrong as well as the folks at Trap Exit. Does anyone have any other suggestions? ----------------------------------------------------------------- 1. http://npt.cc.rsu.ru/user/wanderer/ODP/Erlang_tutorial.html 2. http://www.sics.se/~joe/tutorials/robust_server/robust_server.html 3. http://www.sics.se/~joe/tutorials/web_server/web_server.html 4. http://www.sics.se/~joe/tutorials/client_server/client_server.html 5. http://www.sics.se/~joe/tutorials/wiki/wiki.html 6. http://www.kazmier.com/computer/port-howto/ 7. http://yarivsblog.com/articles/2006/08/18/smerl-demo-easy-function-based -record-access-in-erlang 8. http://www.erlang.org/faq/quick_start.html 9. http://www.erlang.org/doc/doc-5.5/doc/getting_started/part_frame.html 10. http://www.erlang.org/course/course.html 11. http://www.erlang.org/download/erlang-book-part1.pdf 12. http://www.castro.aus.net/~maurice/serc/erlbk/ 13. http://www.erlang.org/faq/parsing.html 14. http://www.erlang.org/examples/examples-2.0.html 15. http://www.erlang.org/examples/win95demo/win95demo.html >From trap exit -------------- 16. A fast web server demonstrating some undocumented Erlang features 17. Adding my own BIF 18. Building Non Blocking Erlang apps 19. Cascading Behaviours 20. Distributing a Mnesia schema 21. Erlmerge - The install tool 22. Gettext - An internationalization package. 23. How to setup an RSS feed with Yaws 24. How to setup your own Web server with Yaws 25. How to talk LDAP from Erlang 26. How to write HowTo's 27. How to write an RSS aggregator 28. Lookup MX Records In DNS 29. ODBC with Erlang R10B-4 and MySQL 30. OTP Release Handling Tutorial 31. SNMP Quick Start 32. Writing an Erlang Port using OTP Principles Tutorials in Languages other than English -------------------------------------------------- Chinese: 1. Exploring Erlang Abstract Form--Retrieve Abstract Form from beam file http://agileprogrammer.blogspot.com/2006/08/erlang-abstract-form.html 2. Exploring Erlang Abstract Form--Module declaration and Form http://agileprogrammer.blogspot.com/2006/08/erlang-abstract-form-modulef orm.html 3. Exploring Erlang Abstract Form--Create and modify module on the fly http://agileprogrammer.blogspot.com/2006/08/erlang-abstract-form-module. html --------------------------------------------------------------- Other resources for those interested in getting started with erlang http://wadler.blogspot.com/2005/06/service-architectures.html http://www.erlang.se/doc/programming_rules.shtml http://www.erlang.org/doc/doc-5.5/doc/efficiency_guide/part_frame.html http://www.matt-mcdonnell.com/code/code_erl/erl_course/erl_course.html http://www.matt-mcdonnell.com/code/code_erl/erl_life/erl_life.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangist@REDACTED Tue Aug 22 19:37:29 2006 From: erlangist@REDACTED (lang er) Date: Wed, 23 Aug 2006 01:37:29 +0800 Subject: trap_exit cannot trap signal when exit/1 doesn't called explicitly In-Reply-To: <230465c00608220922h27b11745p3859a453cdab69d2@mail.gmail.com> References: <230465c00608220922h27b11745p3859a453cdab69d2@mail.gmail.com> Message-ID: <230465c00608221037h4ab9358cie8540fd10453cfee@mail.gmail.com> I write another small module, It works well, so what's wrong with link_demo? -module(dd). -export([test/0,test1/0]). test() -> process_flag(trap_exit, true), link(spawn(dd, test1, [])), t(). test1() -> ok. t() -> receive Any -> io:format("~w~n",[Any]) end. > Thanks! > Best Regards > James > -------------- next part -------------- An HTML attachment was scrubbed... URL: From james.hague@REDACTED Tue Aug 22 19:53:19 2006 From: james.hague@REDACTED (James Hague) Date: Tue, 22 Aug 2006 12:53:19 -0500 Subject: static variables? In-Reply-To: References: <17244f480608220639p21a91c04s2f042b8bdf481cbd@mail.gmail.com> Message-ID: On 8/22/06, Ulf Wiger (TN/EAB) wrote: > > You can do this with parameterized modules. I had entirely forgotten about parameterized modules. I didn't ask the original question, but this is something I've wanted on several occasions. I've also kicked around the idea of "parameterized processes," but I can see that being messy. James From yarivvv@REDACTED Tue Aug 22 21:01:27 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 22 Aug 2006 15:01:27 -0400 Subject: Smerl breakthough: metacurrying In-Reply-To: <44E737FD.4060407@blueyonder.co.uk> References: <17244f480608190600o4c3e07d1p30be72690d453110@mail.gmail.com> <44E737FD.4060407@blueyonder.co.uk> Message-ID: <17244f480608221201j4e788ce4qe75f12b6a6c52be6@mail.gmail.com> > This functionality is similar to Lisp's quasiquoting. It is generalized > by quasipatterns in E: > > > (That page unfortunately assumes a lot of context that might be opaque > to people not familiar with E, but hopefully the main ideas will come > through.) > > Quasipatterns are more general because, as well as being able to make > substitutions (what you call metacurrying), they also allow pattern > matching on programs without having to know the abstract form. Hi, I added to Smerl a function called embed_params/2. It's more general than metacurrying because it can substitute any parameter with a variable in the body of a function, but it also requires more work from the user because the names of the parameters must be provided as well as their values. Example: M1 = smerl:new(foo), {ok, M2} = smerl:add_func(M1, "bar(A,B,C) -> A+B*2+C*3."), {ok, F1} = smerl:get_func(M1, bar, 3), F2 = smerl:embed_params(F1, [{'A', 3}, {'C', 5}]), {ok, M3} = smerl:add_func(M2, F2), smerl:compile(M3), foo:bar(2) = 22. This may not be as powerful as quasiquoting, but I have found it useful in my current project. (I could also add some helper functions to reduce the LOC in this example.) Best, Yariv From joelr1@REDACTED Wed Aug 23 00:34:28 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 22 Aug 2006 23:34:28 +0100 Subject: Finally: Mac Intel patches In-Reply-To: <17637.33494.353017.151134@alkaid.it.uu.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> Message-ID: <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> Apply to http://www.it.uu.se/research/group/hipe/snapshots/ otp-0804.tar.gz with Mikael's patches. Sorry it took me so long but I didn't use version control when porting HiPE earlier. All tests pass! Apply as follows: cd otp-0804 && patch -p1 < patch-otp-0804-darwin-x86 ./testsuite.sh /usr/local ======================================================================== Testing /usr/local Compiler options: [o2] The log will be left in /tmp/hipe_test_log.joelr ERL_COMPILER_OPTIONS=[nowarn_shadow_vars] Recompile: test PASSED HiPE testsuite for: /usr/local on junior.local ======================================================================== ./testsuite.sh --only compiler_tests /usr/local ======================================================================== There was an old /tmp/hipe_test_log.joelr... removing Testing /usr/local Compiler options: [o2] * Only running: compiler_tests The log will be left in /tmp/hipe_test_log.joelr ERL_COMPILER_OPTIONS=[nowarn_shadow_vars] Recompile: test PASSED HiPE testsuite for: /usr/local on junior.local ======================================================================== -- http://wagerlabs.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: patch-otp-0804-darwin-x86 Type: application/octet-stream Size: 26951 bytes Desc: not available URL: -------------- next part -------------- From pupeno@REDACTED Wed Aug 23 01:29:23 2006 From: pupeno@REDACTED (Pupeno) Date: Tue, 22 Aug 2006 23:29:23 +0000 Subject: Load Message-ID: <200608222329.26130.pupeno@pupeno.com> In the Erlang Tools (toolbar:start()), in the application monitor, there's a bar showing the load. Where is that load coming from ? how is it calcuclted ? -- Pupeno (http://pupeno.com) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: not available URL: From yarivvv@REDACTED Wed Aug 23 03:55:32 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 22 Aug 2006 21:55:32 -0400 Subject: Erlang module extension with Smerl Message-ID: <17244f480608221855m4ca891a7t1f921f49b9e39c22@mail.gmail.com> Hello, I just added a module extension mechanism for Erlang into Smerl. You can get your hands on it at http://code.google.com/p/smerl/. (Direct link: http://smerl.googlecode.com/svn/trunk/smerl.erl). Here's a quick example: P1 = smerl:new(parent), {ok, P2} = smerl:add_func(P1, "add(A, B) -> A+B."), %% 'false' indicates to not export the function {ok, P3} = smerl:add_func(P2, "subtract(A, B) -> A-B.", false), {ok, P4} = smerl:add_func(P3, "multiply(A,B) -> A*B."), smerl:compile(P4), C1 = smerl:new(child), {ok, C2} = smerl:add_func(C1, "multiply(A,B) -> throw(not_allowed)."), C3 = smerl:extend(P4, C2), smerl:compile(C3), 8 = parent:add(3,5), {'EXIT', {undef, _}} = begin catch parent:subtract(4,3) end, 6 = parent:multiply(3, 2), 11 = child:add(2,9), not_allowed = begin catch child:multiply(5,3) end, {'EXIT', {undef, _}} = begin catch child:subtract(4,2) end. The full story is here http://yarivsblog.com/articles/2006/08/22/new-module-extension-in-erlang-with-smerl Best, Yariv From rsaccon@REDACTED Wed Aug 23 05:46:37 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Wed, 23 Aug 2006 00:46:37 -0300 Subject: Erlang for desktop applications? In-Reply-To: <0CE46194-8E8D-420D-A59D-C028E6C3CFAF@gmail.com> References: <0CE46194-8E8D-420D-A59D-C028E6C3CFAF@gmail.com> Message-ID: One OS-halfway-independant-way to build desktop applications is to create Firefox extensions which use XUL (this are just XML documents and CSS stylesheets) for GUI and XPCOM bindings for programming language integration. XPCOM bindings exist currently for Javascript and Python. A good Example for such in-browser XUL apps is upcoming http://allpeers.com a P2P and Bittorrent client which has its core code written in C++ and packaged as XPCOM. Another interesting fact about such firefox extensions is that they can integrate with webites (any website: the Firebug extension, specific websites: Greasemonkey). No I am wondering whether anybody has spent thoughts on using XUL as GUI toolkit for Erlang, to create Erlang powered firefox extensions. What is necesssary to make that happen ? - Erlang XPCOM Bindings (need to find out what exactly that means) - A smart way to package a minimal Erlang Runtime environment into a frefox extension (*.xpi file) far all the different plattforms Did I miss something ? regards -- Roberto Saccon From rsaccon@REDACTED Wed Aug 23 06:47:20 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Wed, 23 Aug 2006 01:47:20 -0300 Subject: Erlang for desktop applications? In-Reply-To: References: <0CE46194-8E8D-420D-A59D-C028E6C3CFAF@gmail.com> Message-ID: A few minutes of further research revealed that I missed an important thing: XUL bindings for Erlang (and they need to go into mozilla trunk, which is very unrealistic for the not-so-far future) see link below for an example of Python XUL bindings (which will be available for Firefox 3): http://weblogs.mozillazine.org/roadmap/archives/008865.html Possible workaround: Use Javascript for GUI stuff and go from there via Erlang XPCOM bindings. On 8/23/06, Roberto Saccon wrote: > One OS-halfway-independant-way to build desktop applications is to > create Firefox extensions which use XUL (this are just XML documents > and CSS stylesheets) for GUI and XPCOM bindings for programming > language integration. XPCOM bindings exist currently for Javascript > and Python. A good Example for such in-browser XUL apps is upcoming > http://allpeers.com a P2P and Bittorrent client which has its core > code written in C++ and packaged as XPCOM. Another interesting fact > about such firefox extensions is that they can integrate with webites > (any website: the Firebug extension, specific websites: Greasemonkey). > > No I am wondering whether anybody has spent thoughts on using XUL as > GUI toolkit for Erlang, to create Erlang powered firefox extensions. > What is necesssary to make that happen ? > > - Erlang XPCOM Bindings (need to find out what exactly that means) > - A smart way to package a minimal Erlang Runtime environment into a > frefox extension (*.xpi file) far all the different plattforms > > Did I miss something ? > > regards > -- > Roberto Saccon > -- Roberto Saccon From jay@REDACTED Wed Aug 23 07:36:56 2006 From: jay@REDACTED (Jay Nelson) Date: Tue, 22 Aug 2006 22:36:56 -0700 Subject: Format for our tutorials Message-ID: <44EBE978.1040102@duomark.com> I have a tutorial at http://www.duomark.com/erlang/ called the Web Proxy Server. It is an OTP version of Joe's server. I concur with Joe in that I prefer to retain control of my own tutorials, but am willing to reformat to the group standard and have mirror copies on other websites. jay From mikael.karlsson@REDACTED Wed Aug 23 08:09:35 2006 From: mikael.karlsson@REDACTED (Mikael Karlsson) Date: Wed, 23 Aug 2006 08:09:35 +0200 Subject: Erlang for desktop applications? In-Reply-To: References: Message-ID: <200608230809.35905.mikael.karlsson@creado.com> One way to go with XUL is not to use XPCOM but to load your XUL-application from the webbserver and to handle events in a AJAX fashion (using the JSON support on Yaws maybe :-). This means you do not have to install anything on your client side, except Firefox. I think start times for such applications are OK, if they are not too complex and considering that Firefox is already up and running. If you still wan't to build XPCOM bindings one way to go could be to use Erlangs Corba support, since the interfaces to XPCOM is specified in XPIDL, a Corba style interface, and since there are some bridges: http://www.cmiss.org/ReleaseCenter/xpcorba http://xpcom2corba.sunsite.dk/ Generally I think you could do some really nice applications using Firefox XUL and a (Yaws) server. The RDF support that comes with Firefox and XUL is also something really interesting. See the RDF tutorial on: http://www.xulplanet.com/ for instance. Regards Mikael Wed 23 August 2006 06:47 Roberto Saccon wrote: > A few minutes of further research revealed that I missed an important > thing: > > XUL bindings for Erlang (and they need to go into mozilla trunk, which > is very unrealistic for the not-so-far future) > > see link below for an example of Python XUL bindings (which will be > available for Firefox 3): > > http://weblogs.mozillazine.org/roadmap/archives/008865.html > > Possible workaround: Use Javascript for GUI stuff and go from there > via Erlang XPCOM bindings. > From surindar.shanthi@REDACTED Wed Aug 23 07:53:26 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Wed, 23 Aug 2006 11:23:26 +0530 Subject: Editing text in graphics Message-ID: <42ea5fb60608222253l369d9a36r6171376460f3a969@mail.gmail.com> Dear all, I want to develop an interface (using graphics) in Erlang such that the user can provide input via that. Please guide me. -- Thanks in advance, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Wed Aug 23 08:32:34 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 23 Aug 2006 08:32:34 +0200 Subject: Editing text in graphics In-Reply-To: <42ea5fb60608222253l369d9a36r6171376460f3a969@mail.gmail.com> References: <42ea5fb60608222253l369d9a36r6171376460f3a969@mail.gmail.com> Message-ID: <44EBF682.5030402@ericsson.com> On 2006-08-23 07:53, Surindar Sivanesan wrote: > Dear all, > > I want to develop an interface (using graphics) in Erlang such that the > user can provide input via that. in the standard erlang release you have gs: http://www.erlang.se/doc/doc-5.5/lib/gs-1.5.5/doc/html/index.html there is a users guide, but you can look at create(), with the option 'entry'. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From joe.armstrong@REDACTED Wed Aug 23 08:34:10 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Wed, 23 Aug 2006 08:34:10 +0200 Subject: Blogging away In-Reply-To: <200608230809.35905.mikael.karlsson@creado.com> Message-ID: Yariv's blog http://yarivsblog.com/ with his frequent Erlang postings has inspired me. I think he needs a little competition :-) So I've started writing ... In this blog I'll try to tell you some of the things that are happening in the Erlang world. A lot of stuff is happening behind the scenes, I'll try to tell you about some of this. The first post is: http://armstrongonsoftware.blogspot.com/2006/08/making-money-from-erlang .html Cheers /Joe From bengt.kleberg@REDACTED Wed Aug 23 09:03:59 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 23 Aug 2006 09:03:59 +0200 Subject: trap_exit cannot trap signal when exit/1 doesn't called explicitly In-Reply-To: <230465c00608220922h27b11745p3859a453cdab69d2@mail.gmail.com> References: <230465c00608220922h27b11745p3859a453cdab69d2@mail.gmail.com> Message-ID: <44EBFDDF.7000701@ericsson.com> On 2006-08-22 18:22, lang er wrote: ...deleted > > demonstrate_normal() -> > link(whereis(demo)). > > demonstrate_exit(What) -> > link(whereis(demo)), > exit(What). ...deleted > ----------- > After start(), I call demonstrate_normal(), demo process should trap > the exit(normal) signal, but it doesn't, > and if I call demonstrate_exit(normal) , demo do trap the exit(normal). > > The only difference between theses two situations is the exiting process > call exit/1 explicitly. > > Must I call exit before existing ? ''existing''? do you mean exiting :-) you did not exit. the shell is linked to the demo process when you call demonstrate_normal(). but the shell never exits, so there is nothing to trap for demo. in demonstrate_exit() you do exit, and demo gets something. (the shell is restarted after the exit). bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From joe.armstrong@REDACTED Wed Aug 23 09:05:14 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Wed, 23 Aug 2006 09:05:14 +0200 Subject: trap_exit cannot trap signal when exit/1 doesn't called explicitly In-Reply-To: <230465c00608220922h27b11745p3859a453cdab69d2@mail.gmail.com> Message-ID: Very good question! Why the program in the book works and why your program does not, depends upon the behaviour of the Erlang shell. The Erlang shell used when the book was written and the Erlang shell in the current Erlang distribution work differently - this difference invalidates the example in the book. When the book was written the Erlang shell evaluated each new command in a fresh process. Today the shell appears to evaluate all commands in a single evaluator process and only restart the evaluator if it fails. When you evaluate link_demo:demonstrate_normal() in the shell it merely creates a link to the demo process and do nothing else so there is no exit. In the old Erlang shell (the one used when we wrote the book) link_demo:demonstrate_normal() was evaluated within a process (ie we spawn one process per shell command) - this process did two things, it first evaluated the link(whereis(demo)) command linking itself to demo then it died - that is where the exit comes from. To emulate the old behaviour you can try this: > link_demo:start() Then > spawn(fun() -> link_demo:demonstrate_normal() end) In this case you *will* get the behaviour you expect. /Joe ________________________________ From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of lang er Sent: den 22 augusti 2006 18:22 To: erlang-questions@REDACTED Subject: trap_exit cannot trap signal when exit/1 doesn't called explicitly I run the example link_demo(page 103) in Erlang book: -module(link_demo). %% %% Include files %% %% %% Exported Functions %% -export([start/0,demo/0,demonstrate_normal/0, demonstrate_exit/1, demonstrate_error/0,demonstrate_message/1]). %% %% API Functions %% start() -> register(demo, spawn(link_demo, demo, [])). demo() -> process_flag(trap_exit, true), demo1(). demo1() -> receive {'EXIT', From, normal} -> io:format("Demo process received normal exit from ~w~n", [From]), demo1(); {'EXIT', From, Reason} -> io:format("Demo process received exit signal ~w from ~w~n", [Reason, From]), demo1(); finished_demo -> io:format("Demo finished ~n", []); Other -> io:format("Demo process message ~w~n", [Other]), demo1() end. %% %% Local Functions %% demonstrate_normal() -> link(whereis(demo)). demonstrate_exit(What) -> link(whereis(demo)), exit(What). demonstrate_message(What) -> demo ! What. demonstrate_error()-> link(whereis(demo)), 1 = 2. ----------- After start(), I call demonstrate_normal(), demo process should trap the exit(normal) signal, but it doesn't, and if I call demonstrate_exit(normal) , demo do trap the exit(normal). The only difference between theses two situations is the exiting process call exit/1 explicitly. Must I call exit before existing ? My environment: MacBook(Intel) Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] Eshell V5.5 (abort with ^G) 1> Thanks! Best Regards James -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangist@REDACTED Wed Aug 23 09:33:12 2006 From: erlangist@REDACTED (lang er) Date: Wed, 23 Aug 2006 15:33:12 +0800 Subject: trap_exit cannot trap signal when exit/1 doesn't called explicitly In-Reply-To: References: <230465c00608220922h27b11745p3859a453cdab69d2@mail.gmail.com> Message-ID: <230465c00608230033y681f5164u4da3f79214f32379@mail.gmail.com> Thank your detailed explanation. You do explain this old shell behavior in the book. Best Regards! James 2006/8/23, Joe Armstrong (TN/EAB) : > > Very good question! > > Why the program in the book works and why your program does not, depends > upon the behaviour > of the Erlang shell. > > The Erlang shell used when the book was written and the Erlang shell in > the current Erlang distribution > work differently - this difference invalidates the example in the book. > > When the book was written the Erlang shell evaluated each new command in a > fresh > process. Today the shell appears to evaluate all commands in a single > evaluator process > and only restart the evaluator if it fails. > > When you evaluate > > link_demo:demonstrate_normal() > > in the shell it merely creates a link to the demo process and do nothing > else > so there is no exit. > > In the old Erlang shell (the one used when we wrote the book) > link_demo:demonstrate_normal() > was evaluated within a process (ie we spawn one process per shell command) > - this process > did two things, it first evaluated the link(whereis(demo)) command linking > itself to demo > then it died - that is where the exit comes from. > > To emulate the old behaviour you can try this: > > > link_demo:start() > > Then > > > spawn(fun() -> link_demo:demonstrate_normal() end) > > In this case you *will* get the behaviour you expect. > > /Joe > > > ------------------------------ > *From:* owner-erlang-questions@REDACTED [mailto: > owner-erlang-questions@REDACTED] *On Behalf Of *lang er > *Sent:* den 22 augusti 2006 18:22 > *To:* erlang-questions@REDACTED > *Subject:* trap_exit cannot trap signal when exit/1 doesn't called > explicitly > > I run the example link_demo(page 103) in Erlang book: > > > -module(link_demo). > > %% > %% Include files > %% > > %% > %% Exported Functions > %% > -export([start/0,demo/0,demonstrate_normal/0, > demonstrate_exit/1, > demonstrate_error/0,demonstrate_message/1]). > > %% > %% API Functions > %% > > start() -> > register(demo, spawn(link_demo, demo, [])). > > demo() -> > process_flag(trap_exit, true), > demo1(). > > demo1() -> > receive > {'EXIT', From, normal} -> > io:format("Demo process received normal exit from ~w~n", > [From]), > demo1(); > {'EXIT', From, Reason} -> > io:format("Demo process received exit signal ~w from ~w~n", > [Reason, From]), > demo1(); > finished_demo -> > io:format("Demo finished ~n", []); > Other -> > io:format("Demo process message ~w~n", [Other]), > demo1() > end. > > > %% > %% Local Functions > %% > > demonstrate_normal() -> > link(whereis(demo)). > > demonstrate_exit(What) -> > link(whereis(demo)), > exit(What). > demonstrate_message(What) -> > demo ! What. > demonstrate_error()-> > link(whereis(demo)), > 1 = 2. > > ----------- > After start(), I call demonstrate_normal(), demo process should trap the > exit(normal) signal, but it doesn't, > and if I call demonstrate_exit(normal) , demo do trap the exit(normal). > > The only difference between theses two situations is the exiting process > call exit/1 explicitly. > > Must I call exit before existing ? > > My environment: MacBook(Intel) > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] > > Eshell V5.5 (abort with ^G) > 1> > > Thanks! > Best Regards > James > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangist@REDACTED Wed Aug 23 10:00:02 2006 From: erlangist@REDACTED (lang er) Date: Wed, 23 Aug 2006 16:00:02 +0800 Subject: Format for our tutorials In-Reply-To: <44EBE978.1040102@duomark.com> References: <44EBE978.1040102@duomark.com> Message-ID: <230465c00608230100s4b5bb043p95dfe40d6bc3be2d@mail.gmail.com> Your paper A Stream Library Using Erlang Binaries seems very useful in writing a video server, Thanks. I just wonder how many good papers/articles/projects cannot be googled easily.Maybe we need a central document repository? BR! James 2006/8/23, Jay Nelson : > > I have a tutorial at http://www.duomark.com/erlang/ called the Web > Proxy Server. > It is an OTP version of Joe's server. > > I concur with Joe in that I prefer to retain control of my own tutorials, > but am willing to reformat to the group standard and have mirror copies > on other websites. > > jay > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Wed Aug 23 10:01:10 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 23 Aug 2006 09:01:10 +0100 Subject: Smerl breakthough: metacurrying In-Reply-To: <17244f480608221201j4e788ce4qe75f12b6a6c52be6@mail.gmail.com> References: <17244f480608190600o4c3e07d1p30be72690d453110@mail.gmail.com> <44E737FD.4060407@blueyonder.co.uk> <17244f480608221201j4e788ce4qe75f12b6a6c52be6@mail.gmail.com> Message-ID: <95be1d3b0608230101y694dd1d4yecd0bf791d761f2c@mail.gmail.com> On 8/22/06, Yariv Sadan wrote: > This may not be as powerful as quasiquoting, but I have found it > useful in my current project. Hi, Just an observation: smerl is targeting dynamic (run-time) handling of code, while quasiquoting is a way to do most of the work at compile-time. (The latter could of course use smerl to do the work) regards, Vlad From S.J.Thompson@REDACTED Wed Aug 23 10:06:56 2006 From: S.J.Thompson@REDACTED (S.J.Thompson) Date: Wed, 23 Aug 2006 09:06:56 +0100 (BST) Subject: Blogging away In-Reply-To: References: Message-ID: Joe - that's great; thanks. Would you be able to make an RSS feed available? That makes it easier to read via an RSS readers? Kind regards, Simon On Wed, 23 Aug 2006, Joe Armstrong (TN/EAB) wrote: > > Yariv's blog http://yarivsblog.com/ with his frequent Erlang postings > has inspired me. > > I think he needs a little competition :-) > > So I've started writing ... > > In this blog I'll try to tell you some of the things that are happening > in the Erlang world. A lot of stuff is happening behind the scenes, I'll > try > to tell you about some of this. > > The first post is: > > http://armstrongonsoftware.blogspot.com/2006/08/making-money-from-erlang > .html > > Cheers > > /Joe > > > From garazdawi@REDACTED Wed Aug 23 10:47:25 2006 From: garazdawi@REDACTED (garazdawi) Date: Wed, 23 Aug 2006 09:47:25 +0100 Subject: Evaluating Internet Applications written in Erlang References: Message-ID: <20060823084725.E4BCA5A1F4@mail.erlangsystems.com> Hi! I've just completed my bachelor thesis project. It is about creating good web components in Erlang and how to determine what a good web component is. It also contains information about web development in Erlang and discusses some of the history of web development in Erlang. If you want to have a look at it you can find it here: http://erlang-consulting.com/aboutus/erlangarticles.html If you have any question or general ponderings about the article don't hesitate to email me or reply here. A more complete paper on our experiences of web development with Erlang has been accepted at the Erlang workshop in Portland and will be presented the 16th of September. Lukas Larsson Erlang Training & Consulting Ltd. _________________________________________________________ Post sent from http://www.trapexit.org From chris.double@REDACTED Wed Aug 23 11:18:15 2006 From: chris.double@REDACTED (Chris Double) Date: Wed, 23 Aug 2006 21:18:15 +1200 Subject: Blogging away In-Reply-To: References: Message-ID: On 8/23/06, S.J.Thompson wrote: > Joe - that's great; thanks. Would you be able to make an RSS feed > available? That makes it easier to read via an RSS readers? There's an atom feed: http://beta.blogger.com/feeds/5246027334551923738/posts/full Chris. -- http://www.bluishcoder.co.nz From tobbe@REDACTED Wed Aug 23 11:27:12 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Wed, 23 Aug 2006 11:27:12 +0200 Subject: Blogging away In-Reply-To: References: Message-ID: S.J.Thompson wrote: > > Joe - that's great; thanks. Would you be able to make an RSS feed > available? That makes it easier to read via an RSS readers? You'll find that at Planet erlang. --Tobbe > > > Kind regards, > > Simon > > > > > On Wed, 23 Aug 2006, Joe Armstrong (TN/EAB) wrote: > >> Yariv's blog http://yarivsblog.com/ with his frequent Erlang postings >> has inspired me. >> >> I think he needs a little competition :-) >> >> So I've started writing ... >> >> In this blog I'll try to tell you some of the things that are happening >> in the Erlang world. A lot of stuff is happening behind the scenes, I'll >> try >> to tell you about some of this. >> >> The first post is: >> >> http://armstrongonsoftware.blogspot.com/2006/08/making-money-from-erlang >> .html >> >> Cheers >> >> /Joe >> >> >> > From joelr1@REDACTED Wed Aug 23 12:07:41 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 23 Aug 2006 11:07:41 +0100 Subject: Blogging away In-Reply-To: References: Message-ID: <2E81A482-95D7-4A8E-AB60-9ACBFFAC9F08@gmail.com> The Erlang blogosphere is growing! I also write about Erlang below. -- http://wagerlabs.com/ From joelr1@REDACTED Wed Aug 23 10:58:56 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 23 Aug 2006 09:58:56 +0100 Subject: Finally: Mac Intel patches In-Reply-To: <20060823065514.GB4165@memphis> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <20060823065514.GB4165@memphis> Message-ID: On Aug 23, 2006, at 7:55 AM, Mickael Remond wrote: > Congratulations ! > > I have just changed my old PowerPC Mac to an Intel one so I will havfe > the opportunity to test it and give you feedback. I conveniently forgot to mention a key thing. You need to grab mach_override.{c,h} from http://extendamac.sourceforge.net/ and drop these into erts/emulator/hipe/. These are needed to patch up the running erlang binary, nothing will work otherwise. I hardcoded erts/emulator/Makefile.in to add mach_override.o to x86 OBJS. It should of course be conditional. I did not add detection of the above files in the hipe directory either. That should be a precondition of enabling HiPE on Mac Intel. Thanks, Joel -- http://wagerlabs.com/ From yarivvv@REDACTED Wed Aug 23 13:20:03 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 23 Aug 2006 07:20:03 -0400 Subject: Smerl breakthough: metacurrying In-Reply-To: <95be1d3b0608230101y694dd1d4yecd0bf791d761f2c@mail.gmail.com> References: <17244f480608190600o4c3e07d1p30be72690d453110@mail.gmail.com> <44E737FD.4060407@blueyonder.co.uk> <17244f480608221201j4e788ce4qe75f12b6a6c52be6@mail.gmail.com> <95be1d3b0608230101y694dd1d4yecd0bf791d761f2c@mail.gmail.com> Message-ID: <17244f480608230420m46a9ef2ft2be5711cd2a523fc@mail.gmail.com> Yes... What we need now is a new Smerl-powered Erlang compiler and a couple of non-breaking language extensions and we're on our way ;) Yariv On 8/23/06, Vlad Dumitrescu wrote: > On 8/22/06, Yariv Sadan wrote: > > This may not be as powerful as quasiquoting, but I have found it > > useful in my current project. > > Hi, > Just an observation: smerl is targeting dynamic (run-time) handling of > code, while quasiquoting is a way to do most of the work at > compile-time. (The latter could of course use smerl to do the work) > > regards, > Vlad > From serge@REDACTED Wed Aug 23 13:28:02 2006 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 23 Aug 2006 07:28:02 -0400 Subject: Format for our tutorials In-Reply-To: <44EBE978.1040102@duomark.com> References: <44EBE978.1040102@duomark.com> Message-ID: <44EC3BC2.6060609@hq.idt.net> It would also be nice to display the author information in all HowTo tutorials imported to http://wiki.trapexit.org/index.php/Category:HowTo from the old trapexit.org site. This information is embedded in the XML files, but not currently displayed in the HTML pages. Jay Nelson wrote: > I have a tutorial at http://www.duomark.com/erlang/ called the Web > Proxy Server. > It is an OTP version of Joe's server. > > I concur with Joe in that I prefer to retain control of my own tutorials, > but am willing to reformat to the group standard and have mirror copies > on other websites. > > jay > > From vladdu55@REDACTED Wed Aug 23 13:25:47 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 23 Aug 2006 12:25:47 +0100 Subject: Smerl breakthough: metacurrying In-Reply-To: <17244f480608230420m46a9ef2ft2be5711cd2a523fc@mail.gmail.com> References: <17244f480608190600o4c3e07d1p30be72690d453110@mail.gmail.com> <44E737FD.4060407@blueyonder.co.uk> <17244f480608221201j4e788ce4qe75f12b6a6c52be6@mail.gmail.com> <95be1d3b0608230101y694dd1d4yecd0bf791d761f2c@mail.gmail.com> <17244f480608230420m46a9ef2ft2be5711cd2a523fc@mail.gmail.com> Message-ID: <95be1d3b0608230425v9bd4390t73b182a66ee5acd1@mail.gmail.com> On 8/23/06, Yariv Sadan wrote: > Yes... What we need now is a new Smerl-powered Erlang compiler and a > couple of non-breaking language extensions and we're on our way ;) Actually, it's the parser that would do all the work, transforming the new stuff into regular Erlang abstract syntax. regards, Vlad From yarivvv@REDACTED Wed Aug 23 14:26:14 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 23 Aug 2006 08:26:14 -0400 Subject: Smerl breakthough: metacurrying In-Reply-To: <95be1d3b0608230425v9bd4390t73b182a66ee5acd1@mail.gmail.com> References: <17244f480608190600o4c3e07d1p30be72690d453110@mail.gmail.com> <44E737FD.4060407@blueyonder.co.uk> <17244f480608221201j4e788ce4qe75f12b6a6c52be6@mail.gmail.com> <95be1d3b0608230101y694dd1d4yecd0bf791d761f2c@mail.gmail.com> <17244f480608230420m46a9ef2ft2be5711cd2a523fc@mail.gmail.com> <95be1d3b0608230425v9bd4390t73b182a66ee5acd1@mail.gmail.com> Message-ID: <17244f480608230526g6f68b3d8gcd40e9fc3e224e9d@mail.gmail.com> > Actually, it's the parser that would do all the work, transforming the > new stuff into regular Erlang abstract syntax. > If your language extensions are compatible with the current Erlang syntax, you can use smerl:for_file to get the intermediary abstract forms, change them (there's a tiny bit of parsing here), then generate the final abstract forms. However, if your language is not syntactically compatible with Erlang, you do need a new parser. Regards, Yariv From jay@REDACTED Wed Aug 23 14:57:48 2006 From: jay@REDACTED (Jay Nelson) Date: Wed, 23 Aug 2006 05:57:48 -0700 Subject: Metaprogramming Message-ID: <44EC50CC.8030405@duomark.com> When I first saw the smerl post my thinking went like this: - Normal programs execute and return a value - When I program, I generate source code and run the compiler - smerl is just doing normal programming This is a step up from executing, but it is programming. Then I looked on wikipedia and they call Generative Programming a metaprogramming technique, so a for loop that spits out source code is metaprogramming. I guess it is a question of what your background is in making a determination like that. I progressed through programming languages in the following order: 1) Basic 2) APL 3) RPG 4) Prolog 5) Lisp / Flavors (Symbolics) / Common Lisp Object System (CLOS) 6) C then C++ 7) Perl 8) erlang 9) C# I guess I learned some SNOBOL between 5 & 6 and REFAL around the same time. 5 was a progression of 3 different eras. I can't recall ever hearing the term 'quasi-quote' or 'quasi-expression'. Macros and backquotes were just part of the Lisp language. When I got to C is when I got confused. It seemed like the language wasn't finished. Here's what happened when I first start using it: Me: "What is all this malloc / free nonsense? I've never had to do this before." Coworker (CW): "What do you mean? All languages require memory management." Me: "I haven't done this in 15 years of programming. Ever." Me: "Ok, show me how to figure out what is wrong." CW: "Fire up the debugger." Me: "Good, I know what that is... Hmm, what's the value of this thing all in caps?" CW: "It can't tell you, that's a macro. It's not part of the program." Me: "?? How can that be a macro if it never executes? It sounds like an editor expansion that somehow escaped from from its environment." Me: "Ok, let me create a new variable and evaluate the expression it represents." CW: "You can't create a new variable silly." Me: "?? Ok, step into the function. Wait, I see... the incoming arg is wrong. Let's step back and change it." CW: "No can do." Me: "?? Ok, mentally I'll assume it is changed and... oh I see the problem. Let's change this function and continue!" CW: "What planet did you come from? This is just a debugger!" Me: "Isn't a debugger the thing you use to write code? You type it in to the listener and you modify it in the debugger. When you're done you dump it in an editor using the pretty printer. How do you guys write code?" And that was 15 years ago. Now it is possible to use Visual programming tools... although you still can't program in the debugger. To me metaprogramming is writing code that dynamically changes the rules of the language. Writing source code and calling the compiler isn't even generative programming because it feels like using a tool chain to script a series of things a human does at the keyboard. Generating code (typically attributes, like when receiving a new XML stream with new attributes) that was not there when the compiler first ran is standard fare for a dynamic, runtime language. Although I've not yet seen one code example in a commercial environment with XML where the implementation has to be recompiled to accept the new attributes. Why? Because they use static languages and adding a new atom or string is runtime wizardry equated with automatic programming. If you want to see how metaprogramming really works, read "Art of the MetaObject Protocol" by Gregor Kiczales and Jim de Rivieres. This book is as eye opening as reading a first book on how neutron stars become black holes. It will either blow your mind or prevent you from having fun writing normal programs again. Every programmer should read this book. [For those without the time, the book explains how OO is implemented in Lisp using StandardObject, StandardClass and StandardMethod and then shows how you can subclass those instances to **change the behavior of the object system** for example using a different implementation for storing a class or changing the semantics of inheritance or invoking a method.] On further reflection, the metaprogramming in the book is modifying the object-oriented system not Lisp itself. At some point all things bottom out or else there are no assumptions the system makes. The reason Lisp was so great was because data and code were one (in the greatest zen sense) so that you could manipulate code with the same ease as data. You didn't need to use a different language or API and then call a compiler and some other arcane incantations. Just some ramblings. Not to detract from smerl which may prove to be a useful tool for erlang. Judging from wikipedia I am definitely in the minority on the classification of metaprogramming. It's just that erlang is structured with a VM and internal representations and weak text-substitution macros, so this area of research has rather limited potential IMHO. jay From yarivvv@REDACTED Wed Aug 23 16:00:57 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 23 Aug 2006 10:00:57 -0400 Subject: Metaprogramming In-Reply-To: <44EC50CC.8030405@duomark.com> References: <44EC50CC.8030405@duomark.com> Message-ID: <17244f480608230700r43c91032p8b09e58a21f19cd9@mail.gmail.com> hi Jay, Thanks for sharing your interesting thoughts about metaprogramming with Erlang. When I first created Smerl, I knew I was just scratching the surface of what one could do with the ability for manipulating Erlang modules on the fly, and I was waiting to see what ideas other people will come up with. I have actually been using Smerl quite a lot, and over time I have discovered I needed some higher level features from Smerl that go beyond adding and removing functions to modules: metacurrying, parameter embedding and module extensions. To implement these features, Smerl performs deep surgery inside a function's abstract form. Is that "real" metaprogramming? Side note: when I created Smerl, I didn't mean to suggest necessarily that Smerl *does* metaprogramming, but rather that Smerl facilitates metaprogramming. At least with the basic Smerl features, the programmer does the actual metaprogramming. The techniques that Smerl use (or at least some of them) have been done before, at least in Ulf Wiger's rdbms_codegen.erl module. Smerl just makes such metaprogramming wizardry easier to accomplish. What is metaprogramming? According to wikipedia: "Metaprogramming is the writing of programs that write or manipulate other programs (or themselves) as their data or that do part of the work that is otherwise done at compile time during runtime. In many cases, this allows programmers to get more done in the same amount of time as they would take to write all the code manually. The language in which the metaprogram is written is called the metalanguage. The language of the programs that are manipulated is called the object-language. The capacity of a programming language to be its own meta-language is called reflexivity." By this definition, Erlang is a reflexive language, because it allows the programmer to write programs that write or manipulate other programs. Smerl doesn't add this capability to Erlang -- it only exposes it and makes it easier to use. > To me metaprogramming is writing code that dynamically changes the rules > of the language. Using Smerl in my project, I am certainly using Erlang very differently. I'm creating a lot of metafunctions (skeletons for functions that are to be metacurried in runtime) and abstract modules to be used as parents for modules that are to be generated in runtime. Does that mean Smerl changes the rules of the language? I guess it all depends on your definition. I think it does :) Best, Yariv On 8/23/06, Jay Nelson wrote: > When I first saw the smerl post my thinking went like this: > > - Normal programs execute and return a value > - When I program, I generate source code and run the compiler > - smerl is just doing normal programming > > This is a step up from executing, but it is programming. > > Then I looked on wikipedia and they call Generative Programming a > metaprogramming technique, so a for loop that spits out source code is > metaprogramming. I guess it is a question of what your background is in > making a determination like that. > > I progressed through programming languages in the following order: > > 1) Basic > 2) APL > 3) RPG > 4) Prolog > 5) Lisp / Flavors (Symbolics) / Common Lisp Object System (CLOS) > 6) C then C++ > 7) Perl > 8) erlang > 9) C# > > I guess I learned some SNOBOL between 5 & 6 and REFAL around the same > time. 5 was a progression of 3 different eras. > > I can't recall ever hearing the term 'quasi-quote' or > 'quasi-expression'. Macros and backquotes were just part of the Lisp > language. > > When I got to C is when I got confused. It seemed like the language > wasn't finished. Here's what happened when I first start using it: > > Me: "What is all this malloc / free nonsense? I've never had to do this > before." > Coworker (CW): "What do you mean? All languages require memory management." > Me: "I haven't done this in 15 years of programming. Ever." > > Me: "Ok, show me how to figure out what is wrong." > CW: "Fire up the debugger." > Me: "Good, I know what that is... Hmm, what's the value of this thing > all in caps?" > CW: "It can't tell you, that's a macro. It's not part of the program." > Me: "?? How can that be a macro if it never executes? It sounds like > an editor expansion that somehow escaped from from its environment." > Me: "Ok, let me create a new variable and evaluate the expression it > represents." > CW: "You can't create a new variable silly." > Me: "?? Ok, step into the function. Wait, I see... the incoming arg is > wrong. Let's step back and change it." > CW: "No can do." > Me: "?? Ok, mentally I'll assume it is changed and... oh I see the > problem. Let's change this function and continue!" > CW: "What planet did you come from? This is just a debugger!" > Me: "Isn't a debugger the thing you use to write code? You type it in > to the listener and you modify it in the debugger. When you're done you > dump it in an editor using the pretty printer. How do you guys write code?" > > And that was 15 years ago. Now it is possible to use Visual programming > tools... although you still can't program in the debugger. > > > To me metaprogramming is writing code that dynamically changes the rules > of the language. Writing source code and calling the compiler isn't > even generative programming because it feels like using a tool chain to > script a series of things a human does at the keyboard. Generating code > (typically attributes, like when receiving a new XML stream with new > attributes) that was not there when the compiler first ran is standard > fare for a dynamic, runtime language. Although I've not yet seen one > code example in a commercial environment with XML where the > implementation has to be recompiled to accept the new attributes. Why? > Because they use static languages and adding a new atom or string is > runtime wizardry equated with automatic programming. > > If you want to see how metaprogramming really works, read "Art of the > MetaObject Protocol" by Gregor Kiczales and Jim de Rivieres. This book > is as eye opening as reading a first book on how neutron stars become > black holes. It will either blow your mind or prevent you from having > fun writing normal programs again. Every programmer should read this book. > > [For those without the time, the book explains how OO is implemented in > Lisp using StandardObject, StandardClass and StandardMethod and then > shows how you can subclass those instances to **change the behavior of > the object system** for example using a different implementation for > storing a class or changing the semantics of inheritance or invoking a > method.] > > On further reflection, the metaprogramming in the book is modifying the > object-oriented system not Lisp itself. At some point all things bottom > out or else there are no assumptions the system makes. The reason Lisp > was so great was because data and code were one (in the greatest zen > sense) so that you could manipulate code with the same ease as data. > You didn't need to use a different language or API and then call a > compiler and some other arcane incantations. > > > Just some ramblings. Not to detract from smerl which may prove to be a > useful tool for erlang. Judging from wikipedia I am definitely in the > minority on the classification of metaprogramming. > > It's just that erlang is structured with a VM and internal > representations and weak text-substitution macros, so this area of > research has rather limited potential IMHO. > > jay > > From yarivvv@REDACTED Wed Aug 23 16:40:51 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 23 Aug 2006 10:40:51 -0400 Subject: Blogging away In-Reply-To: References: <200608230809.35905.mikael.karlsson@creado.com> Message-ID: <17244f480608230740p2165e80dtc02d4086a20dc49e@mail.gmail.com> Joe, This is great! I'm honored that my blog has inspired you to start blogging. It's the best accomplishment of my blog so far :) On this note, I should say that Joel Reymont's http://wagerlabs.com blog about Erlang has both increased my interest in Erlang before I started coding in Erlang a few months ago, as well as inspired me to blog about it. Best regards, Yariv On 8/23/06, Joe Armstrong (TN/EAB) wrote: > > Yariv's blog http://yarivsblog.com/ with his frequent Erlang postings > has inspired me. > > I think he needs a little competition :-) > > So I've started writing ... > > In this blog I'll try to tell you some of the things that are happening > in the Erlang world. A lot of stuff is happening behind the scenes, I'll > try > to tell you about some of this. > > The first post is: > > http://armstrongonsoftware.blogspot.com/2006/08/making-money-from-erlang > .html > > Cheers > > /Joe > > > From surindar.shanthi@REDACTED Wed Aug 23 17:08:39 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Wed, 23 Aug 2006 20:38:39 +0530 Subject: Editing text in graphics In-Reply-To: <44EBF682.5030402@ericsson.com> References: <42ea5fb60608222253l369d9a36r6171376460f3a969@mail.gmail.com> <44EBF682.5030402@ericsson.com> Message-ID: <42ea5fb60608230808n19ff262ao1649efd18319cd91@mail.gmail.com> Dear Bengt, Thanks for your reply. I have gone through the link. But it is not providing the detailed description about the graphics( Ex: The options part are not specified in detail). Is there any other source available to learn graphics in detail? Kindly help me regarding this. Thanks, S.Surindar On 8/23/06, Bengt Kleberg wrote: > > On 2006-08-23 07:53, Surindar Sivanesan wrote: > > Dear all, > > > > I want to develop an interface (using graphics) in Erlang such that the > > user can provide input via that. > > in the standard erlang release you have gs: > http://www.erlang.se/doc/doc-5.5/lib/gs-1.5.5/doc/html/index.html > > there is a users guide, but you can look at create(), with the option > 'entry'. > > > bengt > -- > EPO guidelines 1978: "If the contribution to the known art resides > solely in a computer program then the subject matter is not > patentable in whatever manner it may be presented in the claims." > -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikpe@REDACTED Wed Aug 23 18:42:52 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 23 Aug 2006 18:42:52 +0200 Subject: Finally: Mac Intel patches In-Reply-To: <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> Message-ID: <17644.34188.847643.91260@alkaid.it.uu.se> Joel Reymont writes: > Apply to http://www.it.uu.se/research/group/hipe/snapshots/ > otp-0804.tar.gz with Mikael's patches. Sorry it took me so long but I > didn't use version control when porting HiPE earlier. > > All tests pass! Apply as follows: > > cd otp-0804 && patch -p1 < patch-otp-0804-darwin-x86 I've reviewed your changes and they look mostly OK. I've changed some things (see commentary below) and split the patch into three logical groups. Download them from the URL above as: patch-otp-0804-5-darwin-x86-fp-exceptions patch-otp-0804-6-darwin-x86-asm-fixes patch-otp-0804-7-darwin-x86-sigaction You need all four earlier patches too, including patch-otp-0804-3-freebsd-fixes which you appear to not have applied. This works on Linux/x86 and Solaris/x86. Let me know if they still work for you or if I broke anything. Comments about your SSE2 exception handling changes: >diff -rN -u old-otp-0804-1/erts/configure new-otp-0804/erts/configure >--- old-otp-0804-1/erts/configure 2006-08-22 23:25:17.000000000 +0100 >+++ new-otp-0804/erts/configure 2006-08-22 23:25:22.000000000 +0100 >@@ -6881,7 +6881,7 @@ > __asm__ __volatile__("ldmxcsr %0" : : "m"(mxcsr)); > } > >-#if defined(__x86_64__) >+#if defined(__x86_64__) || defined(__DARWIN__) > static inline int cpu_has_sse2(void) { return 1; } > #else /* !__x86_64__ */ > /* I don't think there's any guarantee that Darwin only runs on SSE2-capable x86-32 processors, so omitting the test seems dangerous. The runtime test should work on all x86 processors, so I'm going to let Darwin on x86-32 test at runtime. >+#elif defined(__DARWIN__) && defined(__i386__) >+ mcontext_t mc = uc->uc_mcontext; >+ i386_float_state_t fpstate = mc->fs; >+ fpstate.fpu_mxcsr = 0x1F80; >+ *((unsigned short *)&fpstate.fpu_fsw) &= ~0xFF; > #elif defined(__DARWIN__) > mcontext_t mc = uc->uc_mcontext; > mc->ss.srr0 += 4; You're copying the float state into fpstate and updating the copy without flushing the changes back to the original. This cannot be right. fpstate should be a pointer to mc->fs. What is the concrete type of the fpu_fsw field? I really don't want to update it via a pointer cast like this. >diff -rN -u old-otp-0804-1/erts/emulator/sys/unix/sys_float.c new-otp-0804/erts/emulator/sys/unix/sys_float.c >--- old-otp-0804-1/erts/emulator/sys/unix/sys_float.c 2006-08-22 23:25:17.000000000 +0100 >+++ new-otp-0804/erts/emulator/sys/unix/sys_float.c 2006-08-22 23:25:23.000000000 +0100 >@@ -481,6 +491,13 @@ > regs[PT_NIP] += 4; > regs[PT_FPSCR] = 0x80|0x40|0x10; /* VE, OE, ZE; not UE or XE */ > #endif >+#elif defined(__DARWIN__) && defined(__i386__) >+ mcontext_t mc = uc->uc_mcontext; >+ if (mc->fs.fpu_mxcsr & 0x000F) { >+ mc->fs.fpu_mxcsr &= ~(0x003F|0x0680); >+ skip_sse2_insn(mc); >+ } >+ *((unsigned short *)&mc->fs.fpu_fsw) &= ~0xFF; > #elif defined(__DARWIN__) > mcontext_t mc = uc->uc_mcontext; > mc->ss.srr0 += 4; The mxcsr mask should be 0x000D. Comments about your HiPE/x86 changes (apart from sigaction/mach_override): > map_start = mmap(map_hint, map_bytes, > PROT_EXEC|PROT_READ|PROT_WRITE, >- MAP_PRIVATE|MAP_ANONYMOUS >+ MAP_PRIVATE >+#ifndef __DARWIN__ >+ |MAP_ANONYMOUS >+#else >+ |MAP_ANON >+#endif > #ifdef __x86_64__ > |MAP_32BIT > #endif This was fixed recently in a cleaner way by patch-otp-0804-3-freebsd-fixes. >diff -rN -u old-otp-0804-1/erts/emulator/hipe/hipe_x86_asm.m4 new-otp-0804/erts/emulator/hipe/hipe_x86_asm.m4 >--- old-otp-0804-1/erts/emulator/hipe/hipe_x86_asm.m4 2006-08-22 23:25:17.000000000 +0100 >+++ new-otp-0804/erts/emulator/hipe/hipe_x86_asm.m4 2006-08-22 23:25:23.000000000 +0100 >@@ -17,6 +17,28 @@ > `#define LEAF_WORDS 'LEAF_WORDS > > /* >+ * Workarounds for Darwin. >+ */ >+ifelse(OPSYS,darwin,`` >+/* Darwin */ >+#define TEXT .text >+#define JOIN(X,Y) X##Y >+#define CSYM(NAME) JOIN(_,NAME) >+#define ASYM(NAME) CSYM(NAME) >+#define GLOBAL(NAME) .globl NAME >+#define SET_SIZE(NAME) /*empty*/ >+#define TYPE_FUNCTION(NAME) /*empty*/ >+'',`` >+/* Not Darwin */ >+#define TEXT .section ".text" >+#define CSYM(NAME) NAME >+#define ASYM(NAME) NAME >+#define GLOBAL(NAME) .globl NAME >+#define SET_SIZE(NAME) .size NAME,.-NAME >+#define TYPE_FUNCTION(NAME) .type NAME,@REDACTED >+'')dnl >+ >+/* > * Reserved registers. > */ > `#define P %ebp' The current x86 assembly code uses .global not .globl. The hipe_x86_bifs.m4 and hipe_x86_glue.S changes look good. Comments about your HiPE/x86 sigaction/mach_override changes: >diff -rN -u old-otp-0804-1/erts/emulator/Makefile.in new-otp-0804/erts/emulator/Makefile.in >--- old-otp-0804-1/erts/emulator/Makefile.in 2006-08-22 23:25:17.000000000 +0100 >+++ new-otp-0804/erts/emulator/Makefile.in 2006-08-22 23:25:23.000000000 +0100 >@@ -705,7 +705,7 @@ > $(OBJDIR)/erl_mtrace_sys_wrap.o > > HIPE_ultrasparc_OBJS=$(OBJDIR)/hipe_sparc.o $(OBJDIR)/hipe_sparc_glue.o $(OBJDIR)/hipe_sparc_bifs.o $(OBJDIR)/hipe_sparc_stack.o >-HIPE_x86_OBJS=$(OBJDIR)/hipe_x86.o $(OBJDIR)/hipe_x86_glue.o $(OBJDIR)/hipe_x86_bifs.o $(OBJDIR)/hipe_x86_signal.o $(OBJDIR)/hipe_x86_stack.o >+HIPE_x86_OBJS=$(OBJDIR)/hipe_x86.o $(OBJDIR)/hipe_x86_glue.o $(OBJDIR)/hipe_x86_bifs.o $(OBJDIR)/hipe_x86_signal.o $(OBJDIR)/hipe_x86_stack.o $(OBJDIR)/mach_override.o > HIPE_amd64_OBJS=$(OBJDIR)/hipe_amd64.o $(OBJDIR)/hipe_amd64_glue.o $(OBJDIR)/hipe_amd64_bifs.o $(OBJDIR)/hipe_x86_signal.o $(OBJDIR)/hipe_x86_stack.o > HIPE_ppc_OBJS=$(OBJDIR)/hipe_ppc.o $(OBJDIR)/hipe_ppc_glue.o $(OBJDIR)/hipe_ppc_bifs.o $(OBJDIR)/hipe_ppc_stack.o > HIPE_ppc64_OBJS=$(HIPE_ppc_OBJS) Adding mach_override.o needs to be conditional on OPSYS=darwin. I introduced an auxiliary make variable to express that. >diff -rN -u old-otp-0804-1/erts/emulator/hipe/hipe_x86_signal.c new-otp-0804/erts/emulator/hipe/hipe_x86_signal.c ... >+#ifdef __DARWIN__ >+ >+static int (*__next_sigaction)(int, const struct sigaction*, struct sigaction*); >+static int (*__orig_sigaction)(int, const struct sigaction*, struct sigaction*); >+#define init_done() (__next_sigaction != 0) >+/*#define INIT() do_init();*/ >+#define _NSIG NSIG >+#define INIT() do { if( !init_done() ) do_init(); } while(0) __orig_sigaction is unused. I removed it. >+#ifdef __DARWIN__ >+ >+#include "mach_override.h" >+#include >+ The reason you use mach_override.h is that the dlfcn functionality doesn't appear to work on Darwin as it does on Solaris or Linux. You don't use dlsym() etc, so why include dlfcn.h? I rearranged the hipe_x86_signal.c changes to make them smaller. /Mikael From ryanobjc@REDACTED Wed Aug 23 19:43:54 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Wed, 23 Aug 2006 10:43:54 -0700 Subject: Metaprogramming In-Reply-To: <17244f480608230700r43c91032p8b09e58a21f19cd9@mail.gmail.com> References: <44EC50CC.8030405@duomark.com> <17244f480608230700r43c91032p8b09e58a21f19cd9@mail.gmail.com> Message-ID: <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> Meta functions? like as in scheme: (define (lambda (x y) (lambda (x) (* x y) ) ) ) ? I think Erlang has a very weak meta programming ability. You can't define your "meta functions" in the language - they are strings. An excellent blog article: http://www.cabochon.com/~stevey/blog-rants/digging-into-ruby-symbols.html Talks about the same thing in Ruby - Ruby has limited metaprogramming abilities, mostly turning text strings into functions. Steve (the author) talks about why this is less than desirable and how and why a fuller metaprogramming model is preferable. -ryan On 8/23/06, Yariv Sadan wrote: > hi Jay, > > Thanks for sharing your interesting thoughts about metaprogramming > with Erlang. When I first created Smerl, I knew I was just scratching > the surface of what one could do with the ability for manipulating > Erlang modules on the fly, and I was waiting to see what ideas other > people will come up with. > > I have actually been using Smerl quite a lot, and over time I have > discovered I needed some higher level features from Smerl that go > beyond adding and removing functions to modules: metacurrying, > parameter embedding and module extensions. To implement these > features, Smerl performs deep surgery inside a function's abstract > form. Is that "real" metaprogramming? > > Side note: when I created Smerl, I didn't mean to suggest necessarily > that Smerl *does* metaprogramming, but rather that Smerl facilitates > metaprogramming. At least with the basic Smerl features, the > programmer does the actual metaprogramming. > > The techniques that Smerl use (or at least some of them) have been > done before, at least in Ulf Wiger's rdbms_codegen.erl module. Smerl > just makes such metaprogramming wizardry easier to accomplish. > > What is metaprogramming? According to wikipedia: > > "Metaprogramming is the writing of programs that write or manipulate > other programs (or themselves) as their data or that do part of the > work that is otherwise done at compile time during runtime. In many > cases, this allows programmers to get more done in the same amount of > time as they would take to write all the code manually. > > The language in which the metaprogram is written is called the > metalanguage. The language of the programs that are manipulated is > called the object-language. The capacity of a programming language to > be its own meta-language is called reflexivity." > > > By this definition, Erlang is a reflexive language, because it allows > the programmer to write programs that write or manipulate other > programs. Smerl doesn't add this capability to Erlang -- it only > exposes it and makes it easier to use. > > > To me metaprogramming is writing code that dynamically changes the rules > > of the language. > > Using Smerl in my project, I am certainly using Erlang very > differently. I'm creating a lot of metafunctions (skeletons for > functions that are to be metacurried in runtime) and abstract modules > to be used as parents for modules that are to be generated in runtime. > Does that mean Smerl changes the rules of the language? I guess it all > depends on your definition. > > I think it does :) > > Best, > Yariv > > > On 8/23/06, Jay Nelson wrote: > > When I first saw the smerl post my thinking went like this: > > > > - Normal programs execute and return a value > > - When I program, I generate source code and run the compiler > > - smerl is just doing normal programming > > > > This is a step up from executing, but it is programming. > > > > Then I looked on wikipedia and they call Generative Programming a > > metaprogramming technique, so a for loop that spits out source code is > > metaprogramming. I guess it is a question of what your background is in > > making a determination like that. > > > > I progressed through programming languages in the following order: > > > > 1) Basic > > 2) APL > > 3) RPG > > 4) Prolog > > 5) Lisp / Flavors (Symbolics) / Common Lisp Object System (CLOS) > > 6) C then C++ > > 7) Perl > > 8) erlang > > 9) C# > > > > I guess I learned some SNOBOL between 5 & 6 and REFAL around the same > > time. 5 was a progression of 3 different eras. > > > > I can't recall ever hearing the term 'quasi-quote' or > > 'quasi-expression'. Macros and backquotes were just part of the Lisp > > language. > > > > When I got to C is when I got confused. It seemed like the language > > wasn't finished. Here's what happened when I first start using it: > > > > Me: "What is all this malloc / free nonsense? I've never had to do this > > before." > > Coworker (CW): "What do you mean? All languages require memory management." > > Me: "I haven't done this in 15 years of programming. Ever." > > > > Me: "Ok, show me how to figure out what is wrong." > > CW: "Fire up the debugger." > > Me: "Good, I know what that is... Hmm, what's the value of this thing > > all in caps?" > > CW: "It can't tell you, that's a macro. It's not part of the program." > > Me: "?? How can that be a macro if it never executes? It sounds like > > an editor expansion that somehow escaped from from its environment." > > Me: "Ok, let me create a new variable and evaluate the expression it > > represents." > > CW: "You can't create a new variable silly." > > Me: "?? Ok, step into the function. Wait, I see... the incoming arg is > > wrong. Let's step back and change it." > > CW: "No can do." > > Me: "?? Ok, mentally I'll assume it is changed and... oh I see the > > problem. Let's change this function and continue!" > > CW: "What planet did you come from? This is just a debugger!" > > Me: "Isn't a debugger the thing you use to write code? You type it in > > to the listener and you modify it in the debugger. When you're done you > > dump it in an editor using the pretty printer. How do you guys write code?" > > > > And that was 15 years ago. Now it is possible to use Visual programming > > tools... although you still can't program in the debugger. > > > > > > To me metaprogramming is writing code that dynamically changes the rules > > of the language. Writing source code and calling the compiler isn't > > even generative programming because it feels like using a tool chain to > > script a series of things a human does at the keyboard. Generating code > > (typically attributes, like when receiving a new XML stream with new > > attributes) that was not there when the compiler first ran is standard > > fare for a dynamic, runtime language. Although I've not yet seen one > > code example in a commercial environment with XML where the > > implementation has to be recompiled to accept the new attributes. Why? > > Because they use static languages and adding a new atom or string is > > runtime wizardry equated with automatic programming. > > > > If you want to see how metaprogramming really works, read "Art of the > > MetaObject Protocol" by Gregor Kiczales and Jim de Rivieres. This book > > is as eye opening as reading a first book on how neutron stars become > > black holes. It will either blow your mind or prevent you from having > > fun writing normal programs again. Every programmer should read this book. > > > > [For those without the time, the book explains how OO is implemented in > > Lisp using StandardObject, StandardClass and StandardMethod and then > > shows how you can subclass those instances to **change the behavior of > > the object system** for example using a different implementation for > > storing a class or changing the semantics of inheritance or invoking a > > method.] > > > > On further reflection, the metaprogramming in the book is modifying the > > object-oriented system not Lisp itself. At some point all things bottom > > out or else there are no assumptions the system makes. The reason Lisp > > was so great was because data and code were one (in the greatest zen > > sense) so that you could manipulate code with the same ease as data. > > You didn't need to use a different language or API and then call a > > compiler and some other arcane incantations. > > > > > > Just some ramblings. Not to detract from smerl which may prove to be a > > useful tool for erlang. Judging from wikipedia I am definitely in the > > minority on the classification of metaprogramming. > > > > It's just that erlang is structured with a VM and internal > > representations and weak text-substitution macros, so this area of > > research has rather limited potential IMHO. > > > > jay > > > > > From yarivvv@REDACTED Wed Aug 23 20:03:14 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 23 Aug 2006 14:03:14 -0400 Subject: Metaprogramming In-Reply-To: <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> References: <44EC50CC.8030405@duomark.com> <17244f480608230700r43c91032p8b09e58a21f19cd9@mail.gmail.com> <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> Message-ID: <17244f480608231103y20dcdcd8h739d844e25d766f2@mail.gmail.com> With Smerl, you have 3 options: 1) strings 2) abstract forms 3) metafunctions (smerl-style) You can read more about item #3 here: http://yarivsblog.com/articles/2006/08/19/erlang-metaprogramming-breakthrough-metacurrying http://yarivsblog.com/articles/2006/08/22/new-smerl-capability-embedding-arbitrary-values-in-place-of-function-parameters > > An excellent blog article: > http://www.cabochon.com/~stevey/blog-rants/digging-into-ruby-symbols.html > > Talks about the same thing in Ruby - Ruby has limited metaprogramming > abilities, mostly turning text strings into functions. Steve (the > author) talks about why this is less than desirable and how and why a > fuller metaprogramming model is preferable. Thanks for the link. I read the whole thing, and it made me feel good knowing that Erlang (with Smerl) has much better metaprogramming capabilities than Ruby :) Also, keep in mind that Smerl is only a couple of weeks old. It's just getting started ;) Best, Yariv From thomasl_erlang@REDACTED Wed Aug 23 20:22:30 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 23 Aug 2006 11:22:30 -0700 (PDT) Subject: Metaprogramming In-Reply-To: <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> Message-ID: <20060823182230.87528.qmail@web38805.mail.mud.yahoo.com> --- Ryan Rawson wrote: > Meta functions? like as in scheme: > > (define (lambda (x y) > (lambda (x) > (* x y) ) ) ) > > ? > > I think Erlang has a very weak meta programming > ability. You can't > define your "meta functions" in the language - they > are strings. Erlang (or rather, the Erlang/OTP implementation) has a well-defined format for parse trees and the compiler can invoke 'parse transforms' on these which examine and rewrite the functions and forms quite flexibly. This in itself takes you pretty far. There is a compiler, a code loader and an interpreter too to take your generated program and execute it. Erlang doesn't go as far as Lisp, which also has full macros, an easier correspondence between program and data, more sophisticated operations on syntax trees, etc etc. But if Lisp gets five stars, then Erlang (and a number of similar languages) would get three, maybe four stars in my book. (Prolog is a bit better than Erlang on this scale, because Prolog programs and data correspond better*, but still not quite as good as Lisp.) So it pains me to hear "very weak metaprogramming". I think "very weak metaprogramming" is understating the case greatly. "Very weak" is something like C, where there is essentially no standard support for it. Best, Thomas * for the technically curious, such a correspondence avoids or mitigates the "double encoding problem" which is a practical metaprogramming difficulty. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From joelr1@REDACTED Wed Aug 23 20:46:32 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 23 Aug 2006 19:46:32 +0100 Subject: Finally: Mac Intel patches In-Reply-To: <17644.34188.847643.91260@alkaid.it.uu.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <17644.34188.847643.91260@alkaid.it.uu.se> Message-ID: <2D281B0E-E8D8-4BB3-9EFD-C55737CE8B49@gmail.com> Hi Mikael! Thank you for your comments. See my response below. On Aug 23, 2006, at 5:42 PM, Mikael Pettersson wrote: > I don't think there's any guarantee that Darwin only runs on > SSE2-capable x86-32 processors, so omitting the test seems dangerous. > The runtime test should work on all x86 processors, so I'm going to > let Darwin on x86-32 test at runtime. Fair enough. >> +#elif defined(__DARWIN__) && defined(__i386__) >> + mcontext_t mc = uc->uc_mcontext; >> + i386_float_state_t fpstate = mc->fs; >> + fpstate.fpu_mxcsr = 0x1F80; >> + *((unsigned short *)&fpstate.fpu_fsw) &= ~0xFF; >> #elif defined(__DARWIN__) >> mcontext_t mc = uc->uc_mcontext; >> mc->ss.srr0 += 4; > > You're copying the float state into fpstate and updating the copy > without flushing the changes back to the original. This cannot be > right. fpstate should be a pointer to mc->fs. I'm updating the structure and the changes are flushed back by the kernel when the signal handler terminates. > What is the concrete type of the fpu_fsw field? I really don't > want to update it via a pointer cast like this. Here's the full structure (well, almost): /* For legacy reasons we need to leave the hw_state as char bytes */ struct i386_float_state { int fpu_reserved[2]; fp_control_t fpu_fcw; /* x87 FPU control word */ fp_status_t fpu_fsw; /* x87 FPU status word */ uint8_t fpu_ftw; /* x87 FPU tag word */ uint8_t fpu_rsrv1; /* reserved */ uint16_t fpu_fop; /* x87 FPU Opcode */ uint32_t fpu_ip; /* x87 FPU Instruction Pointer offset */ uint16_t fpu_cs; /* x87 FPU Instruction Pointer Selector */ uint16_t fpu_rsrv2; /* reserved */ uint32_t fpu_dp; /* x87 FPU Instruction Operand(Data) Pointer offset */ uint16_t fpu_ds; /* x87 FPU Instruction Operand(Data) Pointer Selector */ uint16_t fpu_rsrv3; /* reserved */ uint32_t fpu_mxcsr; /* MXCSR Register state */ uint32_t fpu_mxcsrmask; /* MXCSR mask */ fpu_sw has type of fp_status_t which is a union. /* * Status word. */ typedef struct fp_status { unsigned short invalid :1, denorm :1, zdiv :1, ovrfl :1, undfl :1, precis :1, stkflt :1, errsumm :1, c0 :1, c1 :1, c2 :1, tos :3, c3 :1, busy :1; } fp_status_t; > The current x86 assembly code uses .global not .globl. Apple's assembler uses .globl. Don't ask me! > Adding mach_override.o needs to be conditional on OPSYS=darwin. > I introduced an auxiliary make variable to express that. Thanks! > You don't use dlsym() etc, so why include dlfcn.h? An oversight. > I rearranged the hipe_x86_signal.c changes to make them smaller. Thanks again. I'll apply your patches and will let you know. -- http://wagerlabs.com/ From vladdu55@REDACTED Wed Aug 23 21:59:20 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 23 Aug 2006 20:59:20 +0100 Subject: Metaprogramming In-Reply-To: <20060823182230.87528.qmail@web38805.mail.mud.yahoo.com> References: <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> <20060823182230.87528.qmail@web38805.mail.mud.yahoo.com> Message-ID: <95be1d3b0608231259o43609412k988ea02b68bda50a@mail.gmail.com> Hi, What I have in store (or more precisely, in a truck on the way to the store :-) is to add functionality similar to Lisp's backquote (or more precisely to E's quasipatterns, because one can use any language for which ione has a scanner and a parser). My reason for this is to make handling of source code easier (becaue we do a lot of that in Erlide), but it could be used to implement lisp-style macros as well. It looks pretty good so far, but it's quite tricky. Especially handling pattern matching, where I think it might be needed to extend PM syntax too... regards, Vlad From ryanobjc@REDACTED Wed Aug 23 22:59:14 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Wed, 23 Aug 2006 13:59:14 -0700 Subject: Editing text in graphics In-Reply-To: <42ea5fb60608230808n19ff262ao1649efd18319cd91@mail.gmail.com> References: <42ea5fb60608222253l369d9a36r6171376460f3a969@mail.gmail.com> <44EBF682.5030402@ericsson.com> <42ea5fb60608230808n19ff262ao1649efd18319cd91@mail.gmail.com> Message-ID: <78568af10608231359r6deaaa5iee69b26b0be9120c@mail.gmail.com> If you want to learn graphics, I would suggest "Interactive Computer Graphics" as per: http://www.amazon.com/gp/product/020138597X/ Good book, the older editions are highly acclaimed. -ryan On 8/23/06, Surindar Sivanesan wrote: > > Dear Bengt, > Thanks for your reply. > I have gone through the link. > But it is not providing the detailed description about the graphics( Ex: The > options part are not specified in detail). > Is there any other source available to learn graphics in detail? > Kindly help me regarding this. > > Thanks, > S.Surindar > > > On 8/23/06, Bengt Kleberg wrote: > > On 2006-08-23 07:53, Surindar Sivanesan wrote: > > > Dear all, > > > > > > I want to develop an interface (using graphics) in Erlang such that the > > > user can provide input via that. > > > > in the standard erlang release you have gs: > > > http://www.erlang.se/doc/doc-5.5/lib/gs-1.5.5/doc/html/index.html > > > > there is a users guide, but you can look at create(), with the option > > 'entry'. > > > > > > bengt > > -- > > EPO guidelines 1978: "If the contribution to the known art resides > > solely in a computer program then the subject matter is not > > patentable in whatever manner it may be presented in the claims." > > > > > > -- > with regards, > S.Surindar From robert.virding@REDACTED Wed Aug 23 23:43:07 2006 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 23 Aug 2006 23:43:07 +0200 Subject: Metaprogramming In-Reply-To: <95be1d3b0608231259o43609412k988ea02b68bda50a@mail.gmail.com> References: <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> <20060823182230.87528.qmail@web38805.mail.mud.yahoo.com> <95be1d3b0608231259o43609412k988ea02b68bda50a@mail.gmail.com> Message-ID: <44ECCBEB.1040009@telia.com> Being a lisp programmer I must say that I have never before heard the term "quasi-programming". Back-quote yes, but quasi-programming no. Now the back-quote macro (it is a macro in lisp) is a wonderful thing in lisp, but for erlang it would not give you very much, as it stands. It gives you two things: 1. It allows you to write down a literal pattern for what you want to build and only mark what is to be evaluated. 2. It allows you to splice in lists into your pattern with ,@REDACTED Now the first one you already have in erlang, you build a term by writing it down, the compiler generates the the build primitives for you. The second doesn't give you much in Erlang where the list isn't the base of all code. And as someone already mentioned parse-transform allow you to do any compile-time meta programming you can think of. What could be useful is a parse-transform which allows to define lisp like macros and use them. This would give users the ability to define macros without having to do a complete parse-transform, which is not difficult but a bit tedious to get right. The current macros are actually a bit of a joke I added when people wanted to have named constants. Especially doing it at token level. I had a bit of fun and added the rest as well. The only thing I really missed was allowing macros with the same name and different number of arguments like functions. What you could do if you did it in a parse-transform is work at the form level as is done in lisp. This would be more powerful and then you would need the back-quote nacro. Robert P.S. Maybe I'll have a go after Erlog and regexps. Vlad Dumitrescu wrote: > Hi, > > What I have in store (or more precisely, in a truck on the way to the > store :-) is to add functionality similar to Lisp's backquote (or more > precisely to E's quasipatterns, because one can use any language for > which ione has a scanner and a parser). > > My reason for this is to make handling of source code easier (becaue > we do a lot of that in Erlide), but it could be used to implement > lisp-style macros as well. > > It looks pretty good so far, but it's quite tricky. Especially > handling pattern matching, where I think it might be needed to extend > PM syntax too... > > regards, > Vlad > From david.nospam.hopwood@REDACTED Thu Aug 24 00:58:32 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Wed, 23 Aug 2006 23:58:32 +0100 Subject: Metaprogramming In-Reply-To: <95be1d3b0608231259o43609412k988ea02b68bda50a@mail.gmail.com> References: <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> <20060823182230.87528.qmail@web38805.mail.mud.yahoo.com> <95be1d3b0608231259o43609412k988ea02b68bda50a@mail.gmail.com> Message-ID: <44ECDD98.20503@blueyonder.co.uk> Vlad Dumitrescu wrote: > Hi, > > What I have in store (or more precisely, in a truck on the way to the > store :-) is to add functionality similar to Lisp's backquote (or more > precisely to E's quasipatterns, because one can use any language for > which one has a scanner and a parser). > > My reason for this is to make handling of source code easier (becaue > we do a lot of that in Erlide), but it could be used to implement > lisp-style macros as well. > > It looks pretty good so far, but it's quite tricky. Especially > handling pattern matching, where I think it might be needed to extend > PM syntax too... Do you have any design notes or examples of what this might look like? Will it be possible to write a quasipattern anywhere that a pattern can currently occur in Erlang? -- David Hopwood From ok@REDACTED Thu Aug 24 03:14:53 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 24 Aug 2006 13:14:53 +1200 (NZST) Subject: Metaprogramming Message-ID: <200608240114.k7O1ErmW258416@atlas.otago.ac.nz> "Ryan Rawson" wrote: Meta functions? like as in scheme: (define (lambda (x y) (lambda (x) (* x y) ) ) ) Actually, that's not syntactically correct; there's an identifier missing. Presumably it was meant to be (define multiplier (lambda (y) (lambda (x) (* x y)))) so that (multiplier 3) returns a multiply-by-3 function. That's not *META* functions, it's just plain old "HIGHER-ORDER" functions. And Erlang has them. multiplier(Y) -> fun (X) -> X*Y end. I think Erlang has a very weak meta programming ability. You can't define your "meta functions" in the language - they are strings. Under your (rather unusual) definition of meta programming, WRONG. By the way, the ability to take a string and turn it into executable code at run time was there in SNOBOL 4 running on things like OS/360 back in the days when mainframes ruled the earth. From ok@REDACTED Thu Aug 24 03:26:56 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 24 Aug 2006 13:26:56 +1200 (NZST) Subject: Metaprogramming Message-ID: <200608240126.k7O1Quva256488@atlas.otago.ac.nz> Robert Virding wrote: Being a lisp programmer I must say that I have never before heard the term "quasi-programming". Back-quote yes, but quasi-programming no. I think someone has got confused with where "quasi" attaches. What Common Lisp calls backquote is called quasiquote in Scheme. Common Lisp says that `x ,x and ,@ are legal input forms, but leaves undefined what they read as. So you *can* rely on what will happen to them IF treated as Lisp code, but you can*not* rely on what they'll look like if read as data, which pretty much stuffs up any attempt to do your own processing. In contrast, Scheme explicitly defines that `x => (quasiquote X) ,x => (unquote X) ,@REDACTED => (unquote-splicing X) where the obvious rules derive X from x, so you *can* write portable Scheme code that reads Scheme code as data and knows what to expect. (This is odd, because Scheme is not otherwise known for portability.) Now the back-quote macro (it is a macro in lisp) In fact Common Lisp has *two* kinds of macros: macros that are expanded by the evaluator (= compiler and/or interpreter) and macros that are expanded by the reader. Backquote (quasiquote) is the second kind, which creates certain problems for name capture. 1. It allows you to write down a literal pattern for what you want to build and only mark what is to be evaluated. 2. It allows you to splice in lists into your pattern with ,@REDACTED Backquote is pretty much the *perfect* tool for creating XML. I note that a similar feature has been bolted onto C in 'C (tick-C), and that there's a Java preprocessor offering a similar feature for constructing Java source code, as part of annotation-driven code generation (the annotation part of this is now standard, albeit with different syntax, in Java 1.5; as far as I know, which isn't very far, the code generation part isn't). From jay@REDACTED Thu Aug 24 04:33:52 2006 From: jay@REDACTED (Jay Nelson) Date: Wed, 23 Aug 2006 19:33:52 -0700 Subject: Niagara 2 to have 64 threads Message-ID: <44ED1010.2030209@duomark.com> http://news.com.com/Suns+Niagara+2+doubles+down+with+twice+the+threads/2100-1006_3-6108880.html?tag=nefd.lede From rvg@REDACTED Thu Aug 24 06:14:28 2006 From: rvg@REDACTED (Rudolph van Graan) Date: Thu, 24 Aug 2006 06:14:28 +0200 Subject: Modern Languages vs the Ancient... (Was Metaprogramming) In-Reply-To: <200608240114.k7O1ErmW258416@atlas.otago.ac.nz> References: <200608240114.k7O1ErmW258416@atlas.otago.ac.nz> Message-ID: <3492743D-11F0-4788-A257-661855230AA9@patternmatched.com> Hi Guys, This whole topic interest me greatly. Unfortunately I've not been part of the Lisp generation ;) - my only experience in Lisp stems from the fact that I had to make emacs work for me. To date Lisp is the greatest mystery ever. I've managed to salvage one good book which someone else threw away, written in 1982 "Lisp" by Winston and Horn. What amazes me is the type of problems solved in the late seventies. From the TOC: Chapter 18: Lisp in Lisp (Building an interpreter) 24: Symbolic pattern matching 26: Rule based expert systems and forward chaining 30: Procedure writing programs etc What worries me is that the "old" languages managed to do things that are nearly impossible or very difficult (in my opinion) to do in modern languages. How come the Javas and C#'s etc lost these abilities and be called modern? I've noticed a VERY disturbing pattern emerging lately in the java world (Unfortunately I do a lot of Java consulting with one leg in the very muddy Websphere world), it is as though people have now started to discover that you can "reconfigure" your code outside your code. So essentially you write these little XML files describing the behaviour of something. They might look like this (Taken from http:// static.springframework.org/spring-webflow/docs/1.0-rc3/reference/flow- definition.html#flow-xml the very popular spring framework for J2EE) : ... (This describes the flow of a web page submitting into something). The problem here is that the XML is *external* and independent to the code that actually do something. The issue for me is that the code behind this is coupled to the behaviour in such a way as to make it inseparable. (Above you might have a web form containing 3 fields, the "submit" must understand about these 3 fields). So in order to change the flow, you will have to create code that understands the flow... Hence the flow is coupled, *tightly*, to the code behind the flow. Now the XML is not compiled or verified except in structure and so you cannot find problems until you actually test or deploy. In the past the names above would have been classes or instances and the compiler might pick things up as wrong. Now they have lost this important ability. It looks to me as though they have now managed to invent a (bad) scripting language sitting above Java essentially imitating what we had in ASP/JSP/VB ten years ago, but far worse because XML is not a language but a data structure... Back to my original point - what kind of abilities did we lose going from Lisp/Smalltalk into the VB's/Delphi's/C++ into Java/C# etc that are now being reinvented in a bad way in the new "languages"? Rudolph From dmitriid@REDACTED Thu Aug 24 09:06:49 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Thu, 24 Aug 2006 10:06:49 +0300 Subject: Blogging away In-Reply-To: <17244f480608230740p2165e80dtc02d4086a20dc49e@mail.gmail.com> References: <200608230809.35905.mikael.karlsson@creado.com> <17244f480608230740p2165e80dtc02d4086a20dc49e@mail.gmail.com> Message-ID: On 8/23/06, Yariv Sadan wrote: > Joe, > > This is great! I'm honored that my blog has inspired you to start > blogging. It's the best accomplishment of my blog so far :) > > On this note, I should say that Joel Reymont's http://wagerlabs.com > blog about Erlang has both increased my interest in Erlang before I > started coding in Erlang a few months ago, as well as inspired me to > blog about it. > Actually, that post began a several-months-long Erlang-related frenzy in one of Russia's biggest online programming communities, www.rsdn.ru. It has now subsided somewhat, but Erlang still appears there in different discussions :) So, blog away guys. You may be considered Erlang's first evangelists. Hopefully, others will follow :) > Best regards, > Yariv > > On 8/23/06, Joe Armstrong (TN/EAB) wrote: > > > > Yariv's blog http://yarivsblog.com/ with his frequent Erlang postings > > has inspired me. > > > > I think he needs a little competition :-) > > > > So I've started writing ... > > > > In this blog I'll try to tell you some of the things that are happening > > in the Erlang world. A lot of stuff is happening behind the scenes, I'll > > try > > to tell you about some of this. > > > > The first post is: > > > > http://armstrongonsoftware.blogspot.com/2006/08/making-money-from-erlang > > .html > > > > Cheers > > > > /Joe > > > > > > > From ulf@REDACTED Thu Aug 24 09:15:55 2006 From: ulf@REDACTED (Ulf Wiger) Date: Thu, 24 Aug 2006 09:15:55 +0200 Subject: Modern Languages vs the Ancient... (Was Metaprogramming) In-Reply-To: <3492743D-11F0-4788-A257-661855230AA9@patternmatched.com> References: <200608240114.k7O1ErmW258416@atlas.otago.ac.nz> <3492743D-11F0-4788-A257-661855230AA9@patternmatched.com> Message-ID: Den 2006-08-24 06:14:28 skrev Rudolph van Graan : > It looks to me as though they have now managed to invent a (bad) > scripting language sitting above Java essentially imitating what we had > in ASP/JSP/VB ten years ago, but far worse because XML is not a language > but a data structure... Indeed. This is also easy to sell to management et al, since it's XML... Now, when you venture into using XML as a "programming language", you will run head-on into the horribly sad state of XML script debugging, which, presumably noone bothered to develop tools for before jumping into product development. If you're going to write scripts in XML, here's a suggestion: Map the erlang abstract form into XML 1-to-1. Then you will have Distributed XML, highly concurrent, and with good fault tolerance. You can also write an error reporting gen_event handler that spits out crash reports in XML format too. You will certainly be rewarded with the kingdom and half a horse, and your scripting language will become more popular than Erlang ever was. (: Ulf W -- Ulf Wiger From mikpe@REDACTED Thu Aug 24 09:27:14 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 24 Aug 2006 09:27:14 +0200 Subject: Finally: Mac Intel patches In-Reply-To: <2D281B0E-E8D8-4BB3-9EFD-C55737CE8B49@gmail.com> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <17644.34188.847643.91260@alkaid.it.uu.se> <2D281B0E-E8D8-4BB3-9EFD-C55737CE8B49@gmail.com> Message-ID: <17645.21714.775824.691381@alkaid.it.uu.se> Joel Reymont writes: > >> +#elif defined(__DARWIN__) && defined(__i386__) > >> + mcontext_t mc = uc->uc_mcontext; > >> + i386_float_state_t fpstate = mc->fs; > >> + fpstate.fpu_mxcsr = 0x1F80; > >> + *((unsigned short *)&fpstate.fpu_fsw) &= ~0xFF; > >> #elif defined(__DARWIN__) > >> mcontext_t mc = uc->uc_mcontext; > >> mc->ss.srr0 += 4; > > > > You're copying the float state into fpstate and updating the copy > > without flushing the changes back to the original. This cannot be > > right. fpstate should be a pointer to mc->fs. > > I'm updating the structure and the changes are flushed back by the > kernel when the signal handler terminates. No. You're only reading *uc and *mc, never writing them. Your assignments to fpstate are to a local variable unrelated to the memory area (*uc and *mc) written and read by the kernel. You change to the signal handler in sys_float.c is different and correct, it's only erts/configure.in that has this problem. > > What is the concrete type of the fpu_fsw field? I really don't > > want to update it via a pointer cast like this. ... > fpu_sw has type of fp_status_t which is a union. > > /* > * Status word. > */ > > typedef struct fp_status { > unsigned short invalid :1, > denorm :1, > zdiv :1, > ovrfl :1, > undfl :1, > precis :1, > stkflt :1, > errsumm :1, > c0 :1, > c1 :1, > c2 :1, > tos :3, > c3 :1, > busy :1; > } fp_status_t; Yuck, that's horrible. I'll keep the pointer cast. > > The current x86 assembly code uses .global not .globl. > > Apple's assembler uses .globl. Don't ask me! Your patch changed .global to .globl on both Darwin and non-Darwin. From joe.armstrong@REDACTED Thu Aug 24 09:30:02 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Thu, 24 Aug 2006 09:30:02 +0200 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: Message-ID: Hi Guys, I have been asked to hold a talk at a Smalltalk conference So I have to convince a conference room full of Smalltalkers to become Erlangtalkers. As part of the lecture I have promised to hold a "5 second Erlang course" I need help and suggestions in preparing this course. My first attempt was "To make a fault-tolerant system you need two computers because if you only have one and it crashes you're sunk so you'd better use Erlang cos all other languages suck." Which I can just about say in 5 seconds. So now comes the challenge. Can you suggest alternative/better course material. I'd like you to send me your course suggestions, in both the 5 and 10 second category. < the 10 second category is wide open > A prize will be awarded at the next Erlang conference to the winner The judges for this competition are - Joe Armstrong - Hans Nilsson - Ulf Wiger The judges decision will be arrived at by a undefined voting procedure, and is final. /Joe From joe.armstrong@REDACTED Thu Aug 24 09:40:43 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Thu, 24 Aug 2006 09:40:43 +0200 Subject: Modern Languages vs the Ancient... (Was Metaprogramming) In-Reply-To: Message-ID: The other day I found an old withered parchment, it had been written long ago in a faded blue ink, it was difficulty to read, but with a little difficulty I just managed Here what I manged to read ... << ... virtual XML is an Erlang term that can be mapped 1:1 onto XML. On input convert XML to VXML - internally use VXML. On output: If a novice programmer walks by and wants to see what you're doing transform VXML to XML. If a master programmer walks by show them the VXML. If a project manager walks by smile, tell them the project will take another 3 months, if pressed show them the vxml and say "there's still a lot of work to be done ..." three month later show them the xml >> /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Ulf Wiger > Sent: den 24 augusti 2006 09:16 > To: Rudolph van Graan; Erlang-Questions Mailing List > Subject: Re: Modern Languages vs the Ancient... (Was Metaprogramming) > > Den 2006-08-24 06:14:28 skrev Rudolph van Graan > : > > > It looks to me as though they have now managed to invent a (bad) > > scripting language sitting above Java essentially imitating what we > > had in ASP/JSP/VB ten years ago, but far worse because XML is not a > > language but a data structure... > > Indeed. This is also easy to sell to management et al, since > it's XML... > Now, when you venture into using XML as a "programming > language", you will run head-on into the horribly sad state > of XML script debugging, which, presumably noone bothered to > develop tools for before jumping into product development. > > If you're going to write scripts in XML, here's a suggestion: > > Map the erlang abstract form into XML 1-to-1. Then you will > have Distributed XML, highly concurrent, and with good fault > tolerance. > You can also write an error reporting gen_event handler that > spits out crash reports in XML format too. You will certainly > be rewarded with the kingdom and half a horse, and your > scripting language will become more popular than Erlang ever was. (: > > Ulf W > -- > Ulf Wiger > From joelr1@REDACTED Thu Aug 24 09:44:25 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 24 Aug 2006 08:44:25 +0100 Subject: Finally: Mac Intel patches In-Reply-To: <17645.21714.775824.691381@alkaid.it.uu.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <17644.34188.847643.91260@alkaid.it.uu.se> <2D281B0E-E8D8-4BB3-9EFD-C55737CE8B49@gmail.com> <17645.21714.775824.691381@alkaid.it.uu.se> Message-ID: On Aug 24, 2006, at 8:27 AM, Mikael Pettersson wrote: > You change to the signal handler in sys_float.c is different and > correct, it's only erts/configure.in that has this problem. Mea culpa! > Your patch changed .global to .globl on both Darwin and non-Darwin. Mea maxima culpa! -- http://wagerlabs.com/ From mickael.remond@REDACTED Thu Aug 24 09:45:16 2006 From: mickael.remond@REDACTED (Mickael Remond) Date: Thu, 24 Aug 2006 09:45:16 +0200 Subject: Blogging away In-Reply-To: References: Message-ID: <20060824074516.GA4179@memphis> Hello, * S.J.Thompson [2006-08-23 09:06:56 +0100]: > Joe - that's great; thanks. Would you be able to make an RSS feed > available? That makes it easier to read via an RSS readers? Please, note that if you are interested in the Erlang blogosphere in general, PlanetErlang is doing a good jood promoting a unified view of what is being written. The PlanetErlang is available from: http://www.planeterlang.org/ Do not hesitate to send me blogs URL that I might have been missing. Cheers, -- Micka?l R?mond http://www.process-one.net/ From rasmussen.bryan@REDACTED Thu Aug 24 09:48:31 2006 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Thu, 24 Aug 2006 09:48:31 +0200 Subject: Xml messaging in erlang question Message-ID: <3bb44c6e0608240048na6bec63j63575e895889a772@mail.gmail.com> hi List, The following question will basically be academic, I want to get an idea of how people would use Erlang with the following scenario, the actual application will not be using Erlang (decisions made long ago by others) Basically one has messages sent via SOAP over HTTP, these messages can hold two variations of the same format, one the international version the other localized. The localized version disallows some structures found in the international version making for a potentially smaller message, basically the localized version would be best processed using something that reads the whole XML structure into memory and allows one to work with XPath etc. to get out pertinent data. The international version is potentially quite big and should thus be streamed. I'm considering streaming and then cutting out the parts that are not important. To determine whether an instance should be streamed we will look at the size of the instance before choosing processing method. I expect more of localized version, and would at any rate want to privilege localized version in processing, allowing localized messages to go quicker through the system. Obviously each type of message needs to have various things done to it, validation of messages, branching due to validation problems, information from messages added to database if valid, transformations of messages for display if needed and so forth. Something like an XML Pipeline. At a high architectural level what ways would people want to use Erlang to solve this? From rasmussen.bryan@REDACTED Thu Aug 24 09:53:06 2006 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Thu, 24 Aug 2006 09:53:06 +0200 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: References: Message-ID: <3bb44c6e0608240053v1bfba452g539dac73e339224e@mail.gmail.com> A fault-tolerant system must work across at least two computers, because a system on a single computer can crash. The more computers the higher stability, as witness the internet. Erlang is a language suited to building fault tolerant systems. From joe.armstrong@REDACTED Thu Aug 24 09:56:52 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Thu, 24 Aug 2006 09:56:52 +0200 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: <3bb44c6e0608240053v1bfba452g539dac73e339224e@mail.gmail.com> Message-ID: Please state the time in your entries Was that in the 5 or ten second category - I guess five 'cos it took me 7 seconds to say /Joe > -----Original Message----- > From: bryan rasmussen [mailto:rasmussen.bryan@REDACTED] > Sent: den 24 augusti 2006 09:53 > To: Joe Armstrong (TN/EAB) > Cc: erlang-questions@REDACTED > Subject: Re: Learn Erlang in 5 seconds - competition - win a prize > > A fault-tolerant system must work across at least two > computers, because a system on a single computer can crash. > The more computers the higher stability, as witness the > internet. Erlang is a language suited to building fault > tolerant systems. > From rasmussen.bryan@REDACTED Thu Aug 24 10:01:49 2006 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Thu, 24 Aug 2006 10:01:49 +0200 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: References: <3bb44c6e0608240053v1bfba452g539dac73e339224e@mail.gmail.com> Message-ID: <3bb44c6e0608240101n56f9b033m2020069b35f260c0@mail.gmail.com> Sorry, I thought we were all trying for 5 seconds. With some hedging. Try again: A fault-tolerant system must span at least two computers, because a single computer can crash. More computers equals higher stability, witness the internet. Erlang is a language for building such systems On 8/24/06, Joe Armstrong (TN/EAB) wrote: > > Please state the time in your entries > > > Was that in the 5 or ten second category - I guess five 'cos it took me > 7 seconds to say > > /Joe > > > > > -----Original Message----- > > From: bryan rasmussen [mailto:rasmussen.bryan@REDACTED] > > Sent: den 24 augusti 2006 09:53 > > To: Joe Armstrong (TN/EAB) > > Cc: erlang-questions@REDACTED > > Subject: Re: Learn Erlang in 5 seconds - competition - win a prize > > > > A fault-tolerant system must work across at least two > > computers, because a system on a single computer can crash. > > The more computers the higher stability, as witness the > > internet. Erlang is a language suited to building fault > > tolerant systems. > > > From joe.armstrong@REDACTED Thu Aug 24 10:08:11 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Thu, 24 Aug 2006 10:08:11 +0200 Subject: Xml messaging in erlang question In-Reply-To: <3bb44c6e0608240048na6bec63j63575e895889a772@mail.gmail.com> Message-ID: My take on this: On input convert to VXML ... a 1:1 representation of the SOAP / whatever formats Either use a generic parser - or a specialised parser (preferred) if the format is static and well known. Internally work with VXML (the Erlang representation) never, never, never ever store XML in a data base, only VXML if mnesia, or term_to_binary(VXML) if something else. You haven't really said what small and big messages are. Large messages means to me "cannot hold them in RAM" if your messages are 10's or even hundred of KBs you still be able to hold thousands of them in a couple of GBytes of memory. Do not do any size optimisations yet (you might have to do them later - but get the code right *first* then *measure*) - if you think you might have to optimise for size then plan your data structures accordingly. On output convert VXML back to XML (if required) The golden rule Keep to VXML as much as possible. At a guess 90% + of your application CPU time will be spent converting XML to VXML so try to do this ONCE /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of bryan > rasmussen > Sent: den 24 augusti 2006 09:49 > To: erlang-questions@REDACTED > Subject: Xml messaging in erlang question > > hi List, > > > The following question will basically be academic, I want to > get an idea of how people would use Erlang with the following > scenario, the actual application will not be using Erlang > (decisions made long ago by others) > > Basically one has messages sent via SOAP over HTTP, these > messages can hold two variations of the same format, one the > international version the other localized. > > The localized version disallows some structures found in the > international version making for a potentially smaller > message, basically the localized version would be best > processed using something that reads the whole XML structure > into memory and allows one to work with XPath etc. to get out > pertinent data. > > The international version is potentially quite big and should > thus be streamed. > > I'm considering streaming and then cutting out the parts that > are not important. > > To determine whether an instance should be streamed we will > look at the size of the instance before choosing processing method. > > I expect more of localized version, and would at any rate > want to privilege localized version in processing, allowing > localized messages to go quicker through the system. > > Obviously each type of message needs to have various things > done to it, validation of messages, branching due to > validation problems, information from messages added to > database if valid, transformations of messages for display if > needed and so forth. Something like an XML Pipeline. > > At a high architectural level what ways would people want to > use Erlang to solve this? > From thomasl_erlang@REDACTED Thu Aug 24 10:18:28 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 24 Aug 2006 01:18:28 -0700 (PDT) Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: Message-ID: <20060824081828.40577.qmail@web38810.mail.mud.yahoo.com> --- "Joe Armstrong (TN/EAB)" wrote: > > Hi Guys, > > I have been asked to hold a talk at a Smalltalk > conference > > So I have to convince a conference room full of > Smalltalkers to become > Erlangtalkers. > > As part of the lecture I have promised to hold a "5 > second Erlang > course" "Concurrency, distribution, fault-tolerance. Choose any three." 3.9 seconds, so you have 1 second for questions :-) Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From joelr1@REDACTED Thu Aug 24 10:24:17 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 24 Aug 2006 09:24:17 +0100 Subject: Finally: Mac Intel patches In-Reply-To: <17644.34188.847643.91260@alkaid.it.uu.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <17644.34188.847643.91260@alkaid.it.uu.se> Message-ID: <9CB61FB4-5B05-43F3-8B7D-72CC5AF3BEF6@gmail.com> On Aug 23, 2006, at 5:42 PM, Mikael Pettersson wrote: > Let me know if they still work for you or if I broke anything. Yes, unfortunately: /usr/bin/ld: Undefined symbols: _erts_restore_fpu collect2: ld returned 1 exit status -- http://wagerlabs.com/ From bengt.kleberg@REDACTED Thu Aug 24 10:28:41 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 24 Aug 2006 10:28:41 +0200 Subject: Editing text in graphics In-Reply-To: <42ea5fb60608230808n19ff262ao1649efd18319cd91@mail.gmail.com> References: <42ea5fb60608222253l369d9a36r6171376460f3a969@mail.gmail.com> <44EBF682.5030402@ericsson.com> <42ea5fb60608230808n19ff262ao1649efd18319cd91@mail.gmail.com> Message-ID: <44ED6339.2030607@ericsson.com> On 2006-08-23 17:08, Surindar Sivanesan wrote: > Dear Bengt, Thanks for your reply. I have gone through the link. But > it is not providing the detailed description about the graphics( Ex: > The options part are not specified in detail). Is there any other > source available to learn graphics in detail? did you look at users guide i mentioned? it is available from http://www.erlang.se/doc/doc-5.5/lib/gs-1.5.5/doc/html/index.html (upper left corner) bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From alex.arnon@REDACTED Thu Aug 24 10:41:55 2006 From: alex.arnon@REDACTED (Alex Arnon) Date: Thu, 24 Aug 2006 11:41:55 +0300 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: <20060824081828.40577.qmail@web38810.mail.mud.yahoo.com> References: <20060824081828.40577.qmail@web38810.mail.mud.yahoo.com> Message-ID: <944da41d0608240141w4f376cd7uab626f595db01667@mail.gmail.com> On 8/24/06, Thomas Lindgren wrote: > > > > --- "Joe Armstrong (TN/EAB)" > wrote: > > > > > Hi Guys, > > > > I have been asked to hold a talk at a Smalltalk > > conference > > > > So I have to convince a conference room full of > > Smalltalkers to become > > Erlangtalkers. > > > > As part of the lecture I have promised to hold a "5 > > second Erlang > > course" > > "Concurrency, distribution, fault-tolerance. Choose > any three." 3.9 seconds, so you have 1 second for > questions :-) > > Best, > Thomas > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > I think we have a winner :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikpe@REDACTED Thu Aug 24 10:51:58 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 24 Aug 2006 10:51:58 +0200 Subject: Finally: Mac Intel patches In-Reply-To: <9CB61FB4-5B05-43F3-8B7D-72CC5AF3BEF6@gmail.com> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <17644.34188.847643.91260@alkaid.it.uu.se> <9CB61FB4-5B05-43F3-8B7D-72CC5AF3BEF6@gmail.com> Message-ID: <17645.26798.710857.60955@alkaid.it.uu.se> Joel Reymont writes: > > On Aug 23, 2006, at 5:42 PM, Mikael Pettersson wrote: > > > Let me know if they still work for you or if I broke anything. > > Yes, unfortunately: > > /usr/bin/ld: Undefined symbols: > _erts_restore_fpu > collect2: ld returned 1 exit status Looks like a naming confusion ('_' prefix vs none) somewhere. First run 'nm' on sys_float.o: Is erts_restore_fpu defined there? And if so, is the name prefixed by '_' or not. If it isn't defined there then that's the problem because lots of places in the runtime system (not just HiPE) reference it. If it is defined but without the '_' prefix, then there's some discrepancy in naming conventions. Are the other functions in sys_float.o named in the same way, without '_' prefixes? Which .o file contains the reference to _erts_restore_fpu? I don't see how this could be caused by my modifications of your Darwin patches. I suspect that you had some other change in your system that you missed when preparing your Darwin patches. You did the build in a freshly unpacked otp-0804.tar.gz plus the series of 7 patches I hope? From gordonguthrie@REDACTED Thu Aug 24 10:59:22 2006 From: gordonguthrie@REDACTED (Gordon Guthrie) Date: Thu, 24 Aug 2006 09:59:22 +0100 (BST) Subject: 5 second Erlang Submission Message-ID: <47404.194.72.110.12.1156409962.squirrel@backawinner.gg> Erlang was designed by people who build products. All other languages were designed by people who build languages. Do you build products? If it is over 5 secs lose the last sentence... From vladdu55@REDACTED Thu Aug 24 10:55:33 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 24 Aug 2006 09:55:33 +0100 Subject: Metaprogramming In-Reply-To: <44ECDD98.20503@blueyonder.co.uk> References: <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> <20060823182230.87528.qmail@web38805.mail.mud.yahoo.com> <95be1d3b0608231259o43609412k988ea02b68bda50a@mail.gmail.com> <44ECDD98.20503@blueyonder.co.uk> Message-ID: <95be1d3b0608240155v170d256p7268ad47b89f95ec@mail.gmail.com> On 8/23/06, David Hopwood wrote: > Do you have any design notes or examples of what this might look like? > Will it be possible to write a quasipattern anywhere that a pattern > can currently occur in Erlang? Yes, I'd like it to be possible. My implementation is what Richard described above as Lisp's backquote - when the module is parsed, the new stuff is converted to Erlang terms and from then on it's just regular code. Provisional syntax is: <| ... |> encloses code and its value is simply the parse tree @Var is a "unquote" application, replacing the variable value in the code @@Var is a "splicing-unquote" application, where Var must be a list and its content is spliced in the containing list (possibly even tuple) <|name| ... |> will use module "name" to retrieve lexical scanner and parser, thus allowing even <|xml| @Header @Content @Footer |> which looks like a yaws file inside out :-) Fields = [id, name, age], <|sql| SELECT @@Fields FROM @Table |> <| fun(X) -> X + 1. |> is shorthand for <|erl| ... |> and also opens for using small domain specific languages instead of handling the corresponding Erlang terms. The advantage is that code that handles parse trees becomes less dependent on the parser used (i.e. if I change the way the parse tree looks like, there will be less cases where code using it will have to be adjusted). Of course, one would still need to know how the underlying data looks like, but hopefully it will be easier to write and read it. More examples: * compare Func = <| bar(X) when is_integer(X) -> true; bar(_) -> false. |>, with Func = {function,13,bar,1, [{clause,13,[{var,13,'X'}], [[{call,13,{atom,13,is_integer},[{var,13,'X'}]}]], [{atom,14,true}]}, {clause,15,[{var,15,'_'}], [], [{atom,16,false}]}]} * extracting data from a parse tree (warning: function definitions are tricky!) FuncTree = smerl:get_function(Mod, Fun), <| @FunctionName(@@Arguments) -> @@Body. |> = FuncTree, ... would expand to something like {function, 3, FunctionName, _, [{clause, 3, Arguments, _, Body}]} [[ the above is wrong, as it assumes there's one single clause, but it's just an example ]] * as a more advanced use, I can think of something like -macro([repeat/2]). repeat(N, Fun, Args) -> Expr = <| @Fun(@N, @@Args) |>, repeat_1(N, Expr, <| |>). repeat_1(0, Expr, Result) -> Result; repeat_1(N, Expr, Result) -> Expr ++ Result. The macro would be evaluated at parse/compile time and calling repeat(4, AFun, [2,x]) would give AFun(4, 2, x), AFun(3, 2, x), AFun(2, 2, x), AFun(1, 2, x) So now you could add 'for' loops! :-) There's along way to go yet, and it still remains to see if it would become an academic feature or if it will be used in real applications. My plan is to have it as an add-on to Erlide (but of course also useful by itself) and use it as a separate language (source files will have an extension of "mrl" instead). I had in mind to have this (more or less) ready for the User Conference and submit it there. best regards, Vlad From rlenglet@REDACTED Thu Aug 24 11:23:50 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Thu, 24 Aug 2006 18:23:50 +0900 Subject: My contribution to the 5 seconds Erlang presentation Message-ID: <200608241823.51113.rlenglet@users.forge.objectweb.org> Erlang satisfies any dining philosophers! Faultless distributed service. Five stars! Just 5 seconds. -- Romain LENGLET From Jouni.Ryno@REDACTED Thu Aug 24 11:44:04 2006 From: Jouni.Ryno@REDACTED (Jouni =?ISO-8859-1?Q?Ryn=F6?=) Date: Thu, 24 Aug 2006 12:44:04 +0300 Subject: My contribution to the 5 seconds Erlang presentation In-Reply-To: <200608241823.51113.rlenglet@users.forge.objectweb.org> References: <200608241823.51113.rlenglet@users.forge.objectweb.org> Message-ID: <1156412644.12132.34.camel@adic> "Failure IS an option, you can succeed in the same thing simultaneously somewhere else" After saying that, one needs at least 50 seconds to explain what it means ... -- Jouni Ryn? mailto://Jouni.Ryno@REDACTED/ http://www.geo.fmi.fi/~ryno/ Finnish Meteorological Institute http://www.fmi.fi/ Space 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 rasmussen.bryan@REDACTED Thu Aug 24 11:46:16 2006 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Thu, 24 Aug 2006 11:46:16 +0200 Subject: My contribution to the 5 seconds Erlang presentation In-Reply-To: <200608241823.51113.rlenglet@users.forge.objectweb.org> References: <200608241823.51113.rlenglet@users.forge.objectweb.org> Message-ID: <3bb44c6e0608240246n1437670l893df818e0c94f0f@mail.gmail.com> Hmm, does it satisfy all dining philosophers though? http://www.erights.org//e/satan/index.html Cheers, Bryan Rasmussen On 8/24/06, Romain Lenglet wrote: > Erlang satisfies any dining philosophers! > Faultless distributed service. Five stars! > > Just 5 seconds. > > -- > Romain LENGLET > From rlenglet@REDACTED Thu Aug 24 12:03:00 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Thu, 24 Aug 2006 19:03:00 +0900 Subject: My contribution to the 5 seconds Erlang presentation In-Reply-To: <3bb44c6e0608240246n1437670l893df818e0c94f0f@mail.gmail.com> References: <200608241823.51113.rlenglet@users.forge.objectweb.org> <3bb44c6e0608240246n1437670l893df818e0c94f0f@mail.gmail.com> Message-ID: <200608241903.00523.rlenglet@users.forge.objectweb.org> bryan rasmussen wrote: > Hmm, does it satisfy all dining philosophers though? > > http://www.erights.org//e/satan/index.html > > Romain Lenglet wrote: > > Erlang satisfies any dining philosophers! > > Faultless distributed service. Five stars! Satan would not be allowed to enter such a classy restaurant. He's wearing sneakers. (If an "Erlang fortune" file exists, I am applying for inclusion into it with this dumb email. Thanks.) -- Romain LENGLET From Bruce@REDACTED Thu Aug 24 12:11:38 2006 From: Bruce@REDACTED (Bruce Fitzsimons) Date: Thu, 24 Aug 2006 22:11:38 +1200 Subject: Learn Erlang in 5 seconds In-Reply-To: References: Message-ID: <44ED7B5A.5030906@Fitzsimons.org> 5s: How would you program if processes were limitless, IPC was trivial, and you only coded for success cases? 10s: First you bend your mind to Erlang, then you bend Erlang to fit your problem. Your problem stays in its domain, and you model it with concurrent processes, message passing, and supervision trees. From joe.armstrong@REDACTED Thu Aug 24 12:23:31 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Thu, 24 Aug 2006 12:23:31 +0200 Subject: Learn Erlang in 5 seconds In-Reply-To: <44ED7B5A.5030906@Fitzsimons.org> Message-ID: I could do the 10s vs in 6s - so you can add 4 secs to this :-) /Joe > -----Original Message----- > From: Bruce Fitzsimons [mailto:Bruce@REDACTED] > Sent: den 24 augusti 2006 12:12 > To: Joe Armstrong (TN/EAB); erlang-questions@REDACTED > Subject: Re: Learn Erlang in 5 seconds > > 5s: How would you program if processes were limitless, IPC > was trivial, and you only coded for success cases? > 10s: First you bend your mind to Erlang, then you bend Erlang > to fit your problem. Your problem stays in its domain, and > you model it with concurrent processes, message passing, and > supervision trees. > > From valentin@REDACTED Thu Aug 24 12:13:56 2006 From: valentin@REDACTED (Valentin Micic) Date: Thu, 24 Aug 2006 12:13:56 +0200 Subject: Learn Erlang in 5 seconds - competition - win a prize References: Message-ID: <006301c6c766$06ed1470$6401a8c0@moneymaker2> "To make a fault-tolerant system you need an alternative... Erlang!" About 4 seconds, including dramatic pause. V. From simonpeterchappell@REDACTED Thu Aug 24 12:44:09 2006 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Thu, 24 Aug 2006 05:44:09 -0500 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: References: Message-ID: <8ed733900608240344i735cad1nc0805efea764aa17@mail.gmail.com> For the 5 second category: Erlang: When five nines is an unacceptable amount of downtime. Simon -- www.simonpeter.org From yarivvv@REDACTED Thu Aug 24 12:59:02 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 24 Aug 2006 06:59:02 -0400 Subject: 5 second submission Message-ID: <17244f480608240359l14fe828cm5ea96f2f99ee1698@mail.gmail.com> "Erlang is the language that keeps you in the game when your competition uses Erlang" -Yariv From joelr1@REDACTED Thu Aug 24 13:23:29 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 24 Aug 2006 12:23:29 +0100 Subject: Finally: Mac Intel patches In-Reply-To: <17645.26798.710857.60955@alkaid.it.uu.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <17644.34188.847643.91260@alkaid.it.uu.se> <9CB61FB4-5B05-43F3-8B7D-72CC5AF3BEF6@gmail.com> <17645.26798.710857.60955@alkaid.it.uu.se> Message-ID: On Aug 24, 2006, at 9:51 AM, Mikael Pettersson wrote: > First run 'nm' on sys_float.o: Is erts_restore_fpu defined there? > And if so, is the name prefixed by '_' or not. > > If it isn't defined there then that's the problem because lots > of places in the runtime system (not just HiPE) reference it. nm ./obj/i386-apple-darwin8.7.1/opt/hybrid/sys_float.o U ___error 00000000 T _erts_sys_init_float 0000001c T _erts_thread_init_float U _finite 000001a6 T _matherr 00000010 C _saved_program_buf U _sprintf U _strtod 00000088 T _sys_chars_to_double 00000021 T _sys_double_to_chars U _sys_sigset It's being excluded by your define mods, I believe. -- http://wagerlabs.com/ From rasmussen.bryan@REDACTED Thu Aug 24 13:45:23 2006 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Thu, 24 Aug 2006 13:45:23 +0200 Subject: 5 second submission In-Reply-To: <17244f480608240359l14fe828cm5ea96f2f99ee1698@mail.gmail.com> References: <17244f480608240359l14fe828cm5ea96f2f99ee1698@mail.gmail.com> Message-ID: <3bb44c6e0608240445j7237a373lba96a0f9bafefeae@mail.gmail.com> I think some of these are starting to sound like the kind of thing you want to tell managers, not a bunch of smalltalk programmers. Cheers, Bryan Rasmussen On 8/24/06, Yariv Sadan wrote: > "Erlang is the language that keeps you in the game when your > competition uses Erlang" > > -Yariv > From ewan_higgs@REDACTED Thu Aug 24 13:53:41 2006 From: ewan_higgs@REDACTED (Ewan Higgs) Date: Thu, 24 Aug 2006 12:53:41 +0100 (BST) Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: Message-ID: <20060824115341.96379.qmail@web27004.mail.ukl.yahoo.com> Armstrong Corrolary on Greenspun's 10th Rule of Programming: All sufficiently complicated distributed systems contain ad hoc, informally-specified, bug-ridden, slow implementation of half of Erlang -and if they don't they are probably severely misdesigned. ___________________________________________________________ Copy addresses and emails from any email account to Yahoo! Mail - quick, easy and free. http://uk.docs.yahoo.com/trueswitch2.html From marc.vanwoerkom@REDACTED Thu Aug 24 14:01:50 2006 From: marc.vanwoerkom@REDACTED (Marc van Woerkom) Date: Thu, 24 Aug 2006 14:01:50 +0200 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: References: Message-ID: <44ED952E.3050106@fernuni-hagen.de> > I have been asked to hold a talk at a Smalltalk conference > > That happens. Here is a nice example: Side note: When I approached the FreeBSD booth, my first question was, "So, what's FreeBSD doing here at LinuxWorld?" Without losing a beat, the FreeBSD guy responded, "Actually, in an alternate universe, I'm attending BSDWorld and there's one Linux booth. However, my transporter malfunctioned 'cause it was running Linux, and so here I am." Best nerd one-liner I've heard at the show. http://www.securityfocus.com/columnists/413 > So I have to convince a conference room full of Smalltalkers to become > "To make a fault-tolerant system you need two computers because if you > only have one and it > crashes you're sunk so you'd better use Erlang cos all other languages > suck." > > Which I can just about say in 5 seconds. > > So now comes the challenge. > > Can you suggest alternative/better course material. > 10s: In the above sense: http://en.wikipedia.org/wiki/Image:STMirrorMirror.jpg Welcome to the mirror universe! No OOP. No UML. Easy concurrency. Easy distribution. Erlang. 5s: Objects 3.0: Lightweight processes + easy distribution = Erlang Regards, Marc From yarivvv@REDACTED Thu Aug 24 14:09:24 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 24 Aug 2006 08:09:24 -0400 Subject: 5 second submission In-Reply-To: <3bb44c6e0608240445j7237a373lba96a0f9bafefeae@mail.gmail.com> References: <17244f480608240359l14fe828cm5ea96f2f99ee1698@mail.gmail.com> <3bb44c6e0608240445j7237a373lba96a0f9bafefeae@mail.gmail.com> Message-ID: <17244f480608240509i7c9b83aew45d72de0b6b36189@mail.gmail.com> good call. i'll take another shot: "Erlang is dynamic, functional, concurrent, practical, and not too good to be true." Y On 8/24/06, bryan rasmussen wrote: > I think some of these are starting to sound like the kind of thing you > want to tell managers, not a bunch of smalltalk programmers. > > Cheers, > Bryan Rasmussen > On 8/24/06, Yariv Sadan wrote: > > "Erlang is the language that keeps you in the game when your > > competition uses Erlang" > > > > -Yariv > > > From dmitriid@REDACTED Thu Aug 24 14:14:43 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Thu, 24 Aug 2006 15:14:43 +0300 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: <20060824115341.96379.qmail@web27004.mail.ukl.yahoo.com> References: <20060824115341.96379.qmail@web27004.mail.ukl.yahoo.com> Message-ID: Nice one! :)) On 8/24/06, Ewan Higgs wrote: > Armstrong Corrolary on Greenspun's 10th Rule of > Programming: All sufficiently complicated distributed > systems contain ad hoc, informally-specified, > bug-ridden, slow implementation of half of Erlang -and > if they don't they are probably severely misdesigned. > > > > ___________________________________________________________ > Copy addresses and emails from any email account to Yahoo! Mail - quick, easy and free. http://uk.docs.yahoo.com/trueswitch2.html > From weides@REDACTED Thu Aug 24 13:55:07 2006 From: weides@REDACTED (Nebmo) Date: Thu, 24 Aug 2006 12:55:07 +0100 Subject: Timer:tc References: Message-ID: <20060824115507.AD6085A1F5@mail.erlangsystems.com> What is the difference between: 1: {Time,_} = timer:tc(mod,fun,[arg]), 2: T1 = erlang:now(), mod:fun(arg), T2 = erlang:now(), Time = timer:now_diff(T2, T1), When using them in a benchmark, timer:tc gives a number 12 times larger than erlang:now() does. (I'm mixing hipe-code and beam-code) _________________________________________________________ Post sent from http://www.trapexit.org From serge@REDACTED Thu Aug 24 14:45:22 2006 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 24 Aug 2006 08:45:22 -0400 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: References: Message-ID: <44ED9F62.4030208@hq.idt.net> 5s: "In the next 10 seconds you'll find out how to solve tough concurrent problems at 1/10th of an effort and not to spent the rest of your life debugging their consequences." 10s: "What if you were to write a system that was OS-agnostic, would easily scale to 100,000s of processes, would run on a cluster of machines, would offer nine nines of uptime, and would have to be built in a week? ... Sounds impossible with Smalltalk? ... Add Erlang to your arsenal and see for yourself!" Serge Joe Armstrong (TN/EAB) wrote: > > Hi Guys, > > I have been asked to hold a talk at a Smalltalk conference > > So I have to convince a conference room full of Smalltalkers to become > Erlangtalkers. > > As part of the lecture I have promised to hold a "5 second Erlang > course" > > I need help and suggestions in preparing this course. > > My first attempt was > > "To make a fault-tolerant system you need two computers because if you > only have one and it > crashes you're sunk so you'd better use Erlang cos all other languages > suck." > > Which I can just about say in 5 seconds. > > So now comes the challenge. > > Can you suggest alternative/better course material. > > I'd like you to send me your course suggestions, in both the 5 and 10 > second category. > > < the 10 second category is wide open > > > A prize will be awarded at the next Erlang conference to the winner > > The judges for this competition are > > - Joe Armstrong > - Hans Nilsson > - Ulf Wiger > > The judges decision will be arrived at by a undefined voting procedure, > and is final. > > /Joe > > From dmitriid@REDACTED Thu Aug 24 14:52:18 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Thu, 24 Aug 2006 15:52:18 +0300 Subject: Modern Languages vs the Ancient... (Was Metaprogramming) In-Reply-To: <3492743D-11F0-4788-A257-661855230AA9@patternmatched.com> References: <200608240114.k7O1ErmW258416@atlas.otago.ac.nz> <3492743D-11F0-4788-A257-661855230AA9@patternmatched.com> Message-ID: I've reposted your message on Russian rsdn.ru . One of the questions to this post is: which problems, exactly, are unsolvable, or hard to solve with modern languages? Not specific Lisp hacks, but a list of real-life problems would be nice. :) On 8/24/06, Rudolph van Graan wrote: > Hi Guys, > > This whole topic interest me greatly. Unfortunately I've not been > part of the Lisp generation ;) - my only experience in Lisp stems > from the fact that I had to make emacs work for me. To date Lisp is > the greatest mystery ever. I've managed to salvage one good book > which someone else threw away, written in 1982 "Lisp" by Winston and > Horn. What amazes me is the type of problems solved in the late > seventies. From the TOC: > > Chapter 18: Lisp in Lisp (Building an interpreter) > 24: Symbolic pattern matching > 26: Rule based expert systems and forward chaining > 30: Procedure writing programs > > etc > > What worries me is that the "old" languages managed to do things that > are nearly impossible or very difficult (in my opinion) to do in > modern languages. How come the Javas and C#'s etc lost these > abilities and be called modern? ... > Back to my original point - what kind of abilities did we lose going > from Lisp/Smalltalk into the VB's/Delphi's/C++ into Java/C# etc that > are now being reinvented in a bad way in the new "languages"? > > > Rudolph > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rasmussen.bryan@REDACTED Thu Aug 24 15:02:19 2006 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Thu, 24 Aug 2006 15:02:19 +0200 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: <44ED9F62.4030208@hq.idt.net> References: <44ED9F62.4030208@hq.idt.net> Message-ID: <3bb44c6e0608240602n5fcfff14ke4ffbe96f7f80af1@mail.gmail.com> On 8/24/06, Serge Aleynikov wrote: > 5s: > "In the next 10 seconds you'll find out how to solve tough concurrent > problems at 1/10th of an effort and not to spent the rest of your life > debugging their consequences." > Shouldn't that be: "You'll find out how to solve tough concurrent problems, at 1/10th of an effort and not to spent the rest of your life debugging their consequences, in the next 10 seconds:" or something... otherwise the next ten seconds will include part of the first five seconds and there will be a system crash. Luckily the presentation will be fault tolerant because Ulf will be giving a presentation to a Common Lisp community concurrently. Cheers, Bryan Rasmussen From weides@REDACTED Thu Aug 24 14:50:39 2006 From: weides@REDACTED (Nebmo) Date: Thu, 24 Aug 2006 13:50:39 +0100 Subject: Timer:tc References: Message-ID: <20060824125039.7C4175A1F5@mail.erlangsystems.com> Nevermind, i found it myself. Timer:tc uses erlang:now() but calls the function with apply() which is bad performancewise. _________________________________________________________ Post sent from http://www.trapexit.org From james.hague@REDACTED Thu Aug 24 15:19:38 2006 From: james.hague@REDACTED (James Hague) Date: Thu, 24 Aug 2006 08:19:38 -0500 Subject: Modern Languages vs the Ancient... (Was Metaprogramming) In-Reply-To: <3492743D-11F0-4788-A257-661855230AA9@patternmatched.com> References: <200608240114.k7O1ErmW258416@atlas.otago.ac.nz> <3492743D-11F0-4788-A257-661855230AA9@patternmatched.com> Message-ID: On 8/23/06, Rudolph van Graan wrote: > >What worries me is that the "old" languages managed to do things that >are nearly impossible or very difficult (in my opinion) to do in >modern languages. How come the Javas and C#'s etc lost these >abilities and be called modern? C#, especially, feels like a throwback to 1990 or so. That is, if C# first showed up in 1990, it would have been pretty slick compared to C++ and the OOP side of Turbo Pascal. But C# and Java aren't worth worrying about, IMO. The interesting stuff is happening in the scripting language world, especially with Python and Ruby. Those languages are a lot closer to Lisp (see http://www.norvig.com/python-lisp.html). James From oscar-erl@REDACTED Thu Aug 24 15:34:09 2006 From: oscar-erl@REDACTED (Oscar =?ISO-8859-1?Q?Hellstr=F6m?=) Date: Thu, 24 Aug 2006 14:34:09 +0100 Subject: Experiences with Multithreaded drivers Message-ID: <1156426450.9400.142.camel@battlestar.oscarh.net> Hi all, I have been writing about multi threaded drivers before and want to share my experience. I have been part of developing a system where a linked in C driver has been used to make blocking calls, potentially blocking a very long time. One Erlang process (A) could lock a resource, and another Erlang process (B) would be blocked if it tried to lock the same resource, until it is released by the first proccess (A). When this was executed in the main thread, the whole beam would be blocked and we had a pretty clear deadlock situation. So, what first happened was that we made sure that two processes could not make a blocking call at the same time. Fair enough, but if the resource was locked from the beginning (by any external process), even A:s call would be blocked, but there would be no deadlock. However, blocking the beam emulator for an unknown amount of time wasn't acceptable, so we looked into an asynchronous driver. By using driver_async we could make the blocking call go into an OS thread and the beam would still be running. However, the deadlock would still occur if the unlocking call would be queued after the blocked call in the same thread. By using a Key in driver_async, it is possible to assure that all calls with the same keys goes through the same thread, but it does not seem possible to make sure that two different keys get different OS threads (from the Erlang thread pool), even if there is enough threads in the pool (+A). Due to this, the deadlock could still occur with a huge thread pool and Keys in the driver_async call. Also, the round-robbing way of the Erlang thread pool could be expected to choose a non-busy thread if such exists, but that does not seem to happen. I would however not trust this behaviour to keep away from the deadlock since any other driver (e.g. io) could potentially be using any amount of threads... So, by still synchronising in Erlang, so that two (possibly) blocking calls could not be done at the same time it was possible to make blocking calls, only blocking the process calling the port in the beam emulator. When the blocking call returns however, data need to be passed back to Erlang (sent to the port owner). First we tried to just use driver_output in the thread, but the emulator didn't seem to happy about that. Sometimes it seemed to cause a crash (segfault), and sometimes the messages were lost. I would guess that there is some data structures expecting all driver_output to be executed by the main thread, am I right? So, by using ready_async (driver_entry) (this is called by the main thread) we _seem_ to have created a more stable way of sending data back. To be able to use more than one thread at the same time (all requests to this resource are not of locking nature) we decided to spawn a thread (plain pthread) every time a port was opened, forcing all calls to go through that (every port has it's own thread that no one else can touch). However, when we used driver_output in this thread, we were forced to hit the keyboard for the message to arrive, and a large enough message would crash the emulator (i'm guessing same reason as above). I guess the way of returning from this (non-thread pool) thread is to signal the main thread using driver_select and get the data through a shared data structure. We never tried the latter part, but rewrote it as a port driver instead, spawning a new port for every "thread", which seems to work very well. While this experience (read fight with OS threads/erl_driver) have increased the love for Erlang processes and message passing it is still frustrating not to be able to link in multi threaded drivers without trying to trick the beam emulator. Regards -- ?Oscar Hellstr?m, oscar@REDACTED web: personal.oscarh.net jid: oscar@REDACTED From matthew@REDACTED Thu Aug 24 15:43:21 2006 From: matthew@REDACTED (Matthew Sackman) Date: Thu, 24 Aug 2006 14:43:21 +0100 Subject: Timer:tc In-Reply-To: <20060824115507.AD6085A1F5@mail.erlangsystems.com> References: <20060824115507.AD6085A1F5@mail.erlangsystems.com> Message-ID: <20060824134321.GB3586@wellquite.org> On Thu, Aug 24, 2006 at 12:55:07PM +0100, Nebmo wrote: > What is the difference between: > > 1: > {Time,_} = timer:tc(mod,fun,[arg]), > > 2: > T1 = erlang:now(), > mod:fun(arg), > T2 = erlang:now(), > Time = timer:now_diff(T2, T1), locate timer.erl /usr/lib/erlang/lib/stdlib-1.14/src/timer.erl ... tc(M, F, A) -> Before = erlang:now(), Val = (catch apply(M, F, A)), After = erlang:now(), {now_diff(After, Before), Val}. It'll be many times slower because of the apply. http://www.erlang.org/doc/doc-5.5/doc/efficiency_guide/functions.html Matthew -- Matthew Sackman BOFH excuse #438: sticky bit has come loose From mikpe@REDACTED Thu Aug 24 15:53:20 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 24 Aug 2006 15:53:20 +0200 Subject: Finally: Mac Intel patches In-Reply-To: References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <17644.34188.847643.91260@alkaid.it.uu.se> <9CB61FB4-5B05-43F3-8B7D-72CC5AF3BEF6@gmail.com> <17645.26798.710857.60955@alkaid.it.uu.se> Message-ID: <17645.44880.568467.205972@alkaid.it.uu.se> Joel Reymont writes: > > On Aug 24, 2006, at 9:51 AM, Mikael Pettersson wrote: > > > First run 'nm' on sys_float.o: Is erts_restore_fpu defined there? > > And if so, is the name prefixed by '_' or not. > > > > If it isn't defined there then that's the problem because lots > > of places in the runtime system (not just HiPE) reference it. > > nm ./obj/i386-apple-darwin8.7.1/opt/hybrid/sys_float.o > U ___error > 00000000 T _erts_sys_init_float > 0000001c T _erts_thread_init_float > U _finite > 000001a6 T _matherr > 00000010 C _saved_program_buf > U _sprintf > U _strtod > 00000088 T _sys_chars_to_double > 00000021 T _sys_double_to_chars > U _sys_sigset It looks like NO_FPE_SIGNALS are being set, which would happen if erts/configure failed to determine that they're working. (I changed the Darwin/x86 part of erts/configure and it's entirely possible that it got broken.) What does `fgrep NO_FPE_SIGNALS erts/*/config.h' return? If you run `./configure --enable-hipe 2>&1 | tee foo' and then `fgrep floating foo', what does it say in the check for unreliable floating point exceptions: reliable or not? From niall@REDACTED Thu Aug 24 15:53:10 2006 From: niall@REDACTED (Niall Dalton) Date: Thu, 24 Aug 2006 14:53:10 +0100 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: <3bb44c6e0608240602n5fcfff14ke4ffbe96f7f80af1@mail.gmail.com> References: <44ED9F62.4030208@hq.idt.net> <3bb44c6e0608240602n5fcfff14ke4ffbe96f7f80af1@mail.gmail.com> Message-ID: <44EDAF46.9090200@xrnd.com> The 5 second pitch for Smalltalkers: "Erlang is Smalltalk as Alan Kay wanted it" Some ammunition for a talk useful to back this up.. - Smalltalkers often subscribe to the view that OO programming is about the exchange of messages between objects. So message oriented programming gives a starting point. - For single assignment, Kay himself advocated it: "Though [it] came from many motivations, two were central. ... [T]he small scale one was to find a more flexible version of assignment, and then to try to eliminate it altogether." Alan Kay History of Smalltalk (1993) "Doing encapsulation right is a commitment not just to abstraction of state, but to eliminate state oriented metaphors from programming." Alan Kay, Early History of Smalltalk And its quite fashionable really as advocated by Bloch and Beck: Favor immutability. Joshua Bloch, Effective Java (2001) Use value objects when possible. Kent Beck, Test Driven Development (2001) - Re: Last call optimizations. "Object-Oriented Programming in languages that don?t require tail-call optimizations makes no sense." Matthias Felleisen - Re Concurrency: "I can't understand why objects [of O-O languages] are not concurrent in the first place." Usually attributed to Robin Milner as cited in a Matsuoka paper ('93 I believe). and apparently Kay himself early on described his early conception of objects as being "little computers" that would communicate with each other via messages. Given the cross-fertilization with Hewitt's work on the Actor model I think its easy to claim he himself assumed massive concurrency as a good model. Cheers, Niall From yarivvv@REDACTED Thu Aug 24 16:05:27 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 24 Aug 2006 10:05:27 -0400 Subject: Metaprogramming In-Reply-To: <95be1d3b0608240155v170d256p7268ad47b89f95ec@mail.gmail.com> References: <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> <20060823182230.87528.qmail@web38805.mail.mud.yahoo.com> <95be1d3b0608231259o43609412k988ea02b68bda50a@mail.gmail.com> <44ECDD98.20503@blueyonder.co.uk> <95be1d3b0608240155v170d256p7268ad47b89f95ec@mail.gmail.com> Message-ID: <17244f480608240705ld43884by252c6ae9c01f3e99@mail.gmail.com> > > Fields = [id, name, age], > <|sql| SELECT @@Fields FROM @Table |> > FYI, There's a (less slick but pure Erlang) runtime way of doing something similar with smerl: -module(db). -compile(export_all). meta_select(Fields, Table) -> "SELECT " ++ cocat(Fields) ++ " FROM " ++ atom_to_list(Table). main() -> M1 = smerl:for_module(db), {ok, M2} = smerl:curry_add(M1, db, meta_select, 2, [[name, age], person], people), {ok, M3} = smerl:curry_add(M2, db, meta_select, 2, [[color, num_edges], shape], shapes), smerl:compile(M3), db:people(), %% returns "SELECT name, age FROM person" db:shapes(). %% returns "SELECT color, num_edges FROM shape" Cheers, Yariv From joelr1@REDACTED Thu Aug 24 16:15:42 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 24 Aug 2006 15:15:42 +0100 Subject: Finally: Mac Intel patches In-Reply-To: <17645.44880.568467.205972@alkaid.it.uu.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <17644.34188.847643.91260@alkaid.it.uu.se> <9CB61FB4-5B05-43F3-8B7D-72CC5AF3BEF6@gmail.com> <17645.26798.710857.60955@alkaid.it.uu.se> <17645.44880.568467.205972@alkaid.it.uu.se> Message-ID: On Aug 24, 2006, at 2:53 PM, Mikael Pettersson wrote: > What does `fgrep NO_FPE_SIGNALS erts/*/config.h' return? fgrep NO_FPE_SIGNALS erts/*/config.h #define NO_FPE_SIGNALS 1 > If you run `./configure --enable-hipe 2>&1 | tee foo' and > then `fgrep floating foo', what does it say in the check > for unreliable floating point exceptions: reliable or not? fgrep floating foo checking for unreliable floating point execptions... unreliable; testing in software instead -- http://wagerlabs.com/ From mikpe@REDACTED Thu Aug 24 16:23:39 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 24 Aug 2006 16:23:39 +0200 Subject: Finally: Mac Intel patches In-Reply-To: References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <17644.34188.847643.91260@alkaid.it.uu.se> <9CB61FB4-5B05-43F3-8B7D-72CC5AF3BEF6@gmail.com> <17645.26798.710857.60955@alkaid.it.uu.se> <17645.44880.568467.205972@alkaid.it.uu.se> Message-ID: <17645.46699.343452.865776@alkaid.it.uu.se> Joel Reymont writes: > > On Aug 24, 2006, at 2:53 PM, Mikael Pettersson wrote: > > > What does `fgrep NO_FPE_SIGNALS erts/*/config.h' return? > > fgrep NO_FPE_SIGNALS erts/*/config.h > > #define NO_FPE_SIGNALS 1 > > > If you run `./configure --enable-hipe 2>&1 | tee foo' and > > then `fgrep floating foo', what does it say in the check > > for unreliable floating point exceptions: reliable or not? > > fgrep floating foo > checking for unreliable floating point execptions... unreliable; > testing in software instead I see. Mea culpa. I've extracted fpe-test.c from erts/configure and put it in the HiPE snapshot directory. You should download it and try to compile and run it. How does it fail? With a compile-time error or a runtime failure? From vladdu55@REDACTED Thu Aug 24 16:33:43 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 24 Aug 2006 15:33:43 +0100 Subject: Metaprogramming In-Reply-To: <17244f480608240705ld43884by252c6ae9c01f3e99@mail.gmail.com> References: <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> <20060823182230.87528.qmail@web38805.mail.mud.yahoo.com> <95be1d3b0608231259o43609412k988ea02b68bda50a@mail.gmail.com> <44ECDD98.20503@blueyonder.co.uk> <95be1d3b0608240155v170d256p7268ad47b89f95ec@mail.gmail.com> <17244f480608240705ld43884by252c6ae9c01f3e99@mail.gmail.com> Message-ID: <95be1d3b0608240733v7104176bld9626e836fbc7f0a@mail.gmail.com> On 8/24/06, Yariv Sadan wrote: > > > > Fields = [id, name, age], > > <|sql| SELECT @@Fields FROM @Table |> > > > > FYI, > > There's a (less slick but pure Erlang) runtime way of doing something > similar with smerl: yes, of course, but which version is more readable? :-) regards, Vlad From joelr1@REDACTED Thu Aug 24 16:37:05 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 24 Aug 2006 15:37:05 +0100 Subject: Finally: Mac Intel patches In-Reply-To: <17645.46699.343452.865776@alkaid.it.uu.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <17644.34188.847643.91260@alkaid.it.uu.se> <9CB61FB4-5B05-43F3-8B7D-72CC5AF3BEF6@gmail.com> <17645.26798.710857.60955@alkaid.it.uu.se> <17645.44880.568467.205972@alkaid.it.uu.se> <17645.46699.343452.865776@alkaid.it.uu.se> Message-ID: <36520619-CE41-4F34-BE98-46E2CB80C8BC@gmail.com> On Aug 24, 2006, at 3:23 PM, Mikael Pettersson wrote: > I see. Mea culpa. I've extracted fpe-test.c from erts/configure > and put it in the HiPE snapshot directory. You should download it > and try to compile and run it. How does it fail? With a compile-time > error or a runtime failure? The easiest way out of this is to assume DARWIN + i386 will always have SSE2 ;-). gcc fpe-test.c -o foo fpe-test.c: In function 'cpuid_edx': fpe-test.c:70: error: PIC register 'bx' clobbered in 'asm' fpe-test.c: In function 'cpuid_eax': fpe-test.c:60: error: PIC register 'bx' clobbered in 'asm' -- http://wagerlabs.com/ From yarivvv@REDACTED Thu Aug 24 16:45:21 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 24 Aug 2006 10:45:21 -0400 Subject: Metaprogramming In-Reply-To: <95be1d3b0608240733v7104176bld9626e836fbc7f0a@mail.gmail.com> References: <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> <20060823182230.87528.qmail@web38805.mail.mud.yahoo.com> <95be1d3b0608231259o43609412k988ea02b68bda50a@mail.gmail.com> <44ECDD98.20503@blueyonder.co.uk> <95be1d3b0608240155v170d256p7268ad47b89f95ec@mail.gmail.com> <17244f480608240705ld43884by252c6ae9c01f3e99@mail.gmail.com> <95be1d3b0608240733v7104176bld9626e836fbc7f0a@mail.gmail.com> Message-ID: <17244f480608240745h49972095lb0e49e5453d41ac9@mail.gmail.com> The DSEL is obviously nicer :) At the very least, I just wanted to show that a DSEL designer could use Smerl to implement some of the underlying manipulations without dealing with low level details :) Best Yariv > > yes, of course, but which version is more readable? > > :-) > > regards, > Vlad > From Martin.Logan@REDACTED Thu Aug 24 16:53:05 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Thu, 24 Aug 2006 09:53:05 -0500 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: <20060824115341.96379.qmail@web27004.mail.ukl.yahoo.com> Message-ID: <9CB79C836F98504C81BF082C4291E987792B13@CHITDSEXC02.tds.corp.cendant.org> I vote for this one. But s/half/quarter/. -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Ewan Higgs Sent: Thursday, August 24, 2006 6:54 AM To: Joe Armstrong (TN/EAB); erlang-questions@REDACTED Subject: Re: Learn Erlang in 5 seconds - competition - win a prize Armstrong Corrolary on Greenspun's 10th Rule of Programming: All sufficiently complicated distributed systems contain ad hoc, informally-specified, bug-ridden, slow implementation of half of Erlang -and if they don't they are probably severely misdesigned. ___________________________________________________________ Copy addresses and emails from any email account to Yahoo! Mail - quick, easy and free. http://uk.docs.yahoo.com/trueswitch2.html From joelr1@REDACTED Thu Aug 24 16:54:59 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 24 Aug 2006 15:54:59 +0100 Subject: Help with bit pattern Message-ID: <96657538-7C56-4CC4-9D06-8BD3DB52A6B3@gmail.com> Folks, What's the proper way to say this? <> = X. I'm getting ** 1: illegal bit size ** Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Thu Aug 24 17:03:19 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 24 Aug 2006 16:03:19 +0100 Subject: Help with bit pattern In-Reply-To: <96657538-7C56-4CC4-9D06-8BD3DB52A6B3@gmail.com> References: <96657538-7C56-4CC4-9D06-8BD3DB52A6B3@gmail.com> Message-ID: Actually, there's a bug in my padding calculation. And padding in bits is what I'm trying to calculate. On Aug 24, 2006, at 3:54 PM, Joel Reymont wrote: > Folks, > > What's the proper way to say this? > > < signed, Ymax:NBits/signed, _:((NBits1 * 4) rem 8), FrameRate:16/ > little, FrameCount:16/little, _/binary>> = X. > > I'm getting ** 1: illegal bit size ** -- http://wagerlabs.com/ From bob@REDACTED Thu Aug 24 18:19:03 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 24 Aug 2006 09:19:03 -0700 Subject: Finally: Mac Intel patches In-Reply-To: <36520619-CE41-4F34-BE98-46E2CB80C8BC@gmail.com> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <17644.34188.847643.91260@alkaid.it.uu.se> <9CB61FB4-5B05-43F3-8B7D-72CC5AF3BEF6@gmail.com> <17645.26798.710857.60955@alkaid.it.uu.se> <17645.44880.568467.205972@alkaid.it.uu.se> <17645.46699.343452.865776@alkaid.it.uu.se> <36520619-CE41-4F34-BE98-46E2CB80C8BC@gmail.com> Message-ID: <6a36e7290608240919j68c4b1dfhbadbf992e386f3d6@mail.gmail.com> On 8/24/06, Joel Reymont wrote: > > On Aug 24, 2006, at 3:23 PM, Mikael Pettersson wrote: > > > I see. Mea culpa. I've extracted fpe-test.c from erts/configure > > and put it in the HiPE snapshot directory. You should download it > > and try to compile and run it. How does it fail? With a compile-time > > error or a runtime failure? > > The easiest way out of this is to assume DARWIN + i386 will always > have SSE2 ;-). Well, Apple has never and will never sell an x86 machine without SSE2, so that's a rather safe bet. I don't think supporting pure Darwin is really very interesting, especially on old hardware. -bob From erlangX@REDACTED Thu Aug 24 18:21:27 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Thu, 24 Aug 2006 09:21:27 -0700 Subject: Blogging away In-Reply-To: References: Message-ID: <20060824162127.GB5756@delora.autosys.us> Using BottomFeeder (http://www.cincomsmalltalk.com/BottomFeeder/) on Linux, I get ... "Unable to process feed or query - http://planeterlang.org/rss20.xml" AND "Unable to process feed or query - http://planeterlang.org/rss10.xml" I have successfully been using BottomFeeder for a few years. QUESTIONS: Is anyone else having problems with planeterlang RSS feed (what reader) ? Is anyone else having success with planeterlang RSS feed (what reader) ? Am I using the wrong URL (what should I use) ? Any other suggestions ? thanks, ~Michael On Wed, Aug 23, 2006 at 11:27:12AM +0200, Torbjorn Tornkvist wrote: > S.J.Thompson wrote: > > > > Joe - that's great; thanks. Would you be able to make an RSS feed > > available? That makes it easier to read via an RSS readers? > > You'll find that at Planet erlang. > > > --Tobbe > > > > > > > > Kind regards, > > > > Simon > > > > > > > > > > On Wed, 23 Aug 2006, Joe Armstrong (TN/EAB) wrote: > > > >> Yariv's blog http://yarivsblog.com/ with his frequent Erlang postings > >> has inspired me. > >> > >> I think he needs a little competition :-) > >> > >> So I've started writing ... > >> > >> In this blog I'll try to tell you some of the things that are happening > >> in the Erlang world. A lot of stuff is happening behind the scenes, I'll > >> try > >> to tell you about some of this. > >> > >> The first post is: > >> > >> http://armstrongonsoftware.blogspot.com/2006/08/making-money-from-erlang > >> .html > >> > >> Cheers > >> > >> /Joe > >> > >> > >> > > > -- Michael McDaniel Portland, Oregon, USA http://autosys.us +1 503 283 5284 From s.devrieze@REDACTED Thu Aug 24 18:38:18 2006 From: s.devrieze@REDACTED (sander) Date: Thu, 24 Aug 2006 17:38:18 +0100 Subject: The Current List of Erlang Tutorials References: Message-ID: <20060824163818.C84B35A1F5@mail.erlangsystems.com> Look at http://ejabberd.jabber.ru/erlang _________________________________________________________ Post sent from http://www.trapexit.org From marthin@REDACTED Thu Aug 24 18:41:33 2006 From: marthin@REDACTED (Marthin Laubscher) Date: Thu, 24 Aug 2006 18:41:33 +0200 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: Message-ID: <004901c6c79c$2d7f4960$4800a8c0@studioa> I enter this for the 5 second course (provided you don't speak too fast): When there is more than one parallel concept in the problem or solution, Erlang will be your saviour. It reacts predictably yet is closest thing to executing native thought. Marthin > -----Original Message----- > From: owner-erlang-questions@REDACTED [mailto:owner-erlang- > questions@REDACTED] On Behalf Of Joe Armstrong (TN/EAB) > Sent: 24 August 2006 09:57 > To: bryan rasmussen > Cc: erlang-questions@REDACTED > Subject: RE: Learn Erlang in 5 seconds - competition - win a prize > > > Please state the time in your entries > > > Was that in the 5 or ten second category - I guess five 'cos it took me > 7 seconds to say > > /Joe > > > > > -----Original Message----- > > From: bryan rasmussen [mailto:rasmussen.bryan@REDACTED] > > Sent: den 24 augusti 2006 09:53 > > To: Joe Armstrong (TN/EAB) > > Cc: erlang-questions@REDACTED > > Subject: Re: Learn Erlang in 5 seconds - competition - win a prize > > > > A fault-tolerant system must work across at least two > > computers, because a system on a single computer can crash. > > The more computers the higher stability, as witness the > > internet. Erlang is a language suited to building fault > > tolerant systems. > > From per.gustafsson@REDACTED Thu Aug 24 19:27:47 2006 From: per.gustafsson@REDACTED (Per Gustafsson) Date: Thu, 24 Aug 2006 19:27:47 +0200 Subject: Help with bit pattern In-Reply-To: References: <96657538-7C56-4CC4-9D06-8BD3DB52A6B3@gmail.com> Message-ID: <44EDE193.6070009@it.uu.se> It is not possible to use arithemetic expressions inside binary patterns. You have to rewrite it like this: <> = X, Pad = (NBits1 * 4) rem 8), %% or however Pad should be calculated <> = X. This restriction might however disappear in the future. Joel Reymont wrote: > Actually, there's a bug in my padding calculation. And padding in bits > is what I'm trying to calculate. > > On Aug 24, 2006, at 3:54 PM, Joel Reymont wrote: > >> Folks, >> >> What's the proper way to say this? >> >> <> Ymax:NBits/signed, _:((NBits1 * 4) rem 8), FrameRate:16/ little, >> FrameCount:16/little, _/binary>> = X. >> >> I'm getting ** 1: illegal bit size ** > > > -- > http://wagerlabs.com/ > > > > > From bob@REDACTED Thu Aug 24 19:47:44 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 24 Aug 2006 10:47:44 -0700 Subject: Help with bit pattern In-Reply-To: <96657538-7C56-4CC4-9D06-8BD3DB52A6B3@gmail.com> References: <96657538-7C56-4CC4-9D06-8BD3DB52A6B3@gmail.com> Message-ID: <6a36e7290608241047r27b33f19k403515262f007a6d@mail.gmail.com> On 8/24/06, Joel Reymont wrote: > Folks, > > What's the proper way to say this? > > < Ymax:NBits/signed, _:((NBits1 * 4) rem 8), FrameRate:16/little, > FrameCount:16/little, _/binary>> = X. I see you're reading a SWF header... The padding size should be (8 - ((5 + NBits1 * 4) rem 8)). I don't think that bit syntax is going to work directly anyway because IIRC SWF files store bits in MSB first order(!) for variable bit length fields. -bob From joelr1@REDACTED Thu Aug 24 20:03:33 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 24 Aug 2006 19:03:33 +0100 Subject: Help with bit pattern In-Reply-To: <6a36e7290608241047r27b33f19k403515262f007a6d@mail.gmail.com> References: <96657538-7C56-4CC4-9D06-8BD3DB52A6B3@gmail.com> <6a36e7290608241047r27b33f19k403515262f007a6d@mail.gmail.com> Message-ID: On Aug 24, 2006, at 6:47 PM, Bob Ippolito wrote: > I see you're reading a SWF header... The padding size should be (8 - > ((5 + NBits1 * 4) rem 8)). I don't think that bit syntax is going to > work directly anyway because IIRC SWF files store bits in MSB first > order(!) for variable bit length fields. Thanks Bob! I resolved it in two steps, calculating the padding size first. -- http://wagerlabs.com/ From micke@REDACTED Thu Aug 24 20:18:09 2006 From: micke@REDACTED (Michael Fogeborg) Date: Thu, 24 Aug 2006 20:18:09 +0200 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: <9CB79C836F98504C81BF082C4291E987792B13@CHITDSEXC02.tds.corp.cendant.org> References: <9CB79C836F98504C81BF082C4291E987792B13@CHITDSEXC02.tds.corp.cendant.org> Message-ID: Can't help falling "outside the box" (seeing a picture, instead of words), but - how about modified version of "Game Of Life" where: - the first life-form is programmed using erlang(-principles) - the second not... Then watch all non-erlang life-forms die away while you (concurrently) tell the audience what is going on. On Thu, 24 Aug 2006 16:53:05 +0200, Logan, Martin wrote: > I vote for this one. But s/half/quarter/. > > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Ewan Higgs > Sent: Thursday, August 24, 2006 6:54 AM > To: Joe Armstrong (TN/EAB); erlang-questions@REDACTED > Subject: Re: Learn Erlang in 5 seconds - competition - win a prize > > Armstrong Corrolary on Greenspun's 10th Rule of > Programming: All sufficiently complicated distributed > systems contain ad hoc, informally-specified, > bug-ridden, slow implementation of half of Erlang -and > if they don't they are probably severely misdesigned. > > > > ___________________________________________________________ > Copy addresses and emails from any email account to Yahoo! Mail - quick, > easy and free. http://uk.docs.yahoo.com/trueswitch2.html > > > -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From joelr1@REDACTED Thu Aug 24 20:38:57 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 24 Aug 2006 19:38:57 +0100 Subject: The Current List of Erlang Tutorials In-Reply-To: <20060824163818.C84B35A1F5@mail.erlangsystems.com> References: <20060824163818.C84B35A1F5@mail.erlangsystems.com> Message-ID: I'm not sure if this qualifies as a tutorial but I penned this a year ago: http://www.devmaster.net/articles/mmo-scalable-server/ -- http://wagerlabs.com/ From bob@REDACTED Thu Aug 24 21:18:18 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 24 Aug 2006 12:18:18 -0700 Subject: Help with bit pattern In-Reply-To: References: <96657538-7C56-4CC4-9D06-8BD3DB52A6B3@gmail.com> <6a36e7290608241047r27b33f19k403515262f007a6d@mail.gmail.com> Message-ID: <6a36e7290608241218v6aadc0e3ic576c1a533876ed4@mail.gmail.com> On 8/24/06, Joel Reymont wrote: > > On Aug 24, 2006, at 6:47 PM, Bob Ippolito wrote: > > > I see you're reading a SWF header... The padding size should be (8 - > > ((5 + NBits1 * 4) rem 8)). I don't think that bit syntax is going to > > work directly anyway because IIRC SWF files store bits in MSB first > > order(!) for variable bit length fields. > > Thanks Bob! I resolved it in two steps, calculating the padding size > first. On a bit of a tangent, I started a library a little while ago for dealing with the SWF format. My use cases are all generating SWFs, but I'd be happy to accept contributions for reading SWFs. It's rather simple right now, because all of my complicated SWF operations are still done with Python code. http://code.google.com/p/eswf/ -bob From david.nospam.hopwood@REDACTED Thu Aug 24 21:18:43 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Thu, 24 Aug 2006 20:18:43 +0100 Subject: Metaprogramming In-Reply-To: <17244f480608240705ld43884by252c6ae9c01f3e99@mail.gmail.com> References: <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> <20060823182230.87528.qmail@web38805.mail.mud.yahoo.com> <95be1d3b0608231259o43609412k988ea02b68bda50a@mail.gmail.com> <44ECDD98.20503@blueyonder.co.uk> <95be1d3b0608240155v170d256p7268ad47b89f95ec@mail.gmail.com> <17244f480608240705ld43884by252c6ae9c01f3e99@mail.gmail.com> Message-ID: <44EDFB93.40207@blueyonder.co.uk> Yariv Sadan wrote: >> >> Fields = [id, name, age], >> <|sql| SELECT @@Fields FROM @Table |> > > FYI, > > There's a (less slick but pure Erlang) runtime way of doing something > similar with smerl: > > -module(db). > -compile(export_all). > > meta_select(Fields, Table) -> > "SELECT " ++ cocat(Fields) ++ " FROM " ++ atom_to_list(Table). But unlike Vlad's version, that's vulnerable to SQL injection attacks. -- David Hopwood From w.a.de.jong@REDACTED Thu Aug 24 21:20:31 2006 From: w.a.de.jong@REDACTED (Willem de Jong) Date: Thu, 24 Aug 2006 21:20:31 +0200 Subject: Xml messaging in erlang question In-Reply-To: References: <3bb44c6e0608240048na6bec63j63575e895889a772@mail.gmail.com> Message-ID: <407d9ef80608241220s2923f5eejb23e9ac99aa6bff1@mail.gmail.com> You would need 1. an http server module that accepts the HTTP post in chunks, and passes it on to the XML parser in chunks. 2. an XML parser that can work on chunks of data 3. the XML parser should probably be a SAX parser: one that generates events as it parses the XML document 4. the module that processes the SAX events should be able to discard the bits that you don't need. Like Joe says, it is not 100% clear whether you need 1 and 2 to avoid holding the XML document in memory while processing it. Looking at what is available: ad 1) It is not clear to me whether YAWS and/or Inets can deliver the post data in chunks. ad 2) I believe that Xmerl can work on chunks of data (using the 'continuation' function to get the next chunk) ad 3) xmerl and erlsom both offer a SAX API ad 4) erlsom could probably be used to discard the events that you don't need. You would have to write an XSD for the XML document (maybe it already exists). If you define the elements that you dont want as 'any' element, and you set the 'processContents' attribute to 'skip', then erlsom will discard these elements. Note that the additional benefit is that the XML document will be transformed to a structure of Erlang records (following the types as defined in the XSD). This is convenient for processing, and it takes much less space than a DOM representation. This is of course just a shameless attempt to draw some attention for erlsom (www.sourceforge.org/projects/erlsom), a nice tool that I have been writing that deserves some attention... Regards, Willem From mikpe@REDACTED Thu Aug 24 21:49:33 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 24 Aug 2006 21:49:33 +0200 (MEST) Subject: Finally: Mac Intel patches Message-ID: <200608241949.k7OJnX3v003537@harpo.it.uu.se> On Thu, 24 Aug 2006 09:19:03 -0700, Bob Ippolito wrote: >> > I see. Mea culpa. I've extracted fpe-test.c from erts/configure >> > and put it in the HiPE snapshot directory. You should download it >> > and try to compile and run it. How does it fail? With a compile-time >> > error or a runtime failure? >> >> The easiest way out of this is to assume DARWIN + i386 will always >> have SSE2 ;-). > >Well, Apple has never and will never sell an x86 machine without SSE2, >so that's a rather safe bet. I don't think supporting pure Darwin is >really very interesting, especially on old hardware. I've only seen the "bx is clobbered" error with gcc -fPIC before, so I assume Darwin does that by default? I'm appending a patch to make Darwin/x86 imply having SSE2, just like on x86-64 and in Joel's original patches. This should fix the failed FP exceptions test and the resulting linkage error. Let us know if it works so I can push the final Darwin changes into the HiPE/OTP sources. The patch is also available in the HiPE snapshot directory as `patch-otp-0804-8-darwin-x86-sse2-unconditional'. /Mikael --- otp-0804/erts/configure.in.~1~ 2006-08-24 21:03:23.000000000 +0200 +++ otp-0804/erts/configure.in 2006-08-24 21:06:47.000000000 +0200 @@ -1512,7 +1512,7 @@ static void unmask_sse2(void) __asm__ __volatile__("ldmxcsr %0" : : "m"(mxcsr)); } -#if defined(__x86_64__) +#if defined(__x86_64__) || defined(__DARWIN__) static inline int cpu_has_sse2(void) { return 1; } #else /* !__x86_64__ */ /* --- otp-0804/erts/configure.~1~ 2006-08-24 21:03:23.000000000 +0200 +++ otp-0804/erts/configure 2006-08-24 21:06:25.000000000 +0200 @@ -6881,7 +6881,7 @@ static void unmask_sse2(void) __asm__ __volatile__("ldmxcsr %0" : : "m"(mxcsr)); } -#if defined(__x86_64__) +#if defined(__x86_64__) || defined(__DARWIN__) static inline int cpu_has_sse2(void) { return 1; } #else /* !__x86_64__ */ /* --- otp-0804/erts/emulator/sys/unix/sys_float.c.~1~ 2006-08-24 21:03:23.000000000 +0200 +++ otp-0804/erts/emulator/sys/unix/sys_float.c 2006-08-24 21:11:31.000000000 +0200 @@ -109,7 +109,7 @@ static void unmask_sse2(void) __asm__ __volatile__("ldmxcsr %0" : : "m"(mxcsr)); } -#if defined(__x86_64__) +#if defined(__x86_64__) || defined(__DARWIN__) static inline int cpu_has_sse2(void) { return 1; } #else /* !__x86_64__ */ /* From me@REDACTED Thu Aug 24 21:53:12 2006 From: me@REDACTED (KatolaZ) Date: Thu, 24 Aug 2006 21:53:12 +0200 Subject: Learn Erlang in 5 seconds - competition - win a prize Message-ID: <20060824195312.GN4231@katolaz.homeunix.net> On Thu, Aug 24, 2006 at 09:30:02AM +0200, Joe Armstrong (TN/EAB) wrote: > > As part of the lecture I have promised to hold a "5 second Erlang > course" > > I need help and suggestions in preparing this course. > My proposal is a 5-seconds recursive definition of Erlang/OTP: _E_rlang is _R_oughly a _L_anguage for _A_musing _N_etworked _G_ames and _/_ or _O_rdinary _T_wisted _P_rogramming HND Enzo -- [ Enzo Nicosia aka KatolaZ --- GLUG Catania -- Freaknet Medialab ] [ me [at] katolaz.homeunix.net -- http://katolaz.homeunix.net -- ] [ GNU/Linux User:#325780/ICQ UIN: #258332181/GPG key ID 0B5F062F ] [ Fingerprint: 8E59 D6AA 445E FDB4 A153 3D5A 5F20 B3AE 0B5F 062F ] From yarivvv@REDACTED Thu Aug 24 21:59:09 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 24 Aug 2006 15:59:09 -0400 Subject: Metaprogramming In-Reply-To: <44EDFB93.40207@blueyonder.co.uk> References: <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> <20060823182230.87528.qmail@web38805.mail.mud.yahoo.com> <95be1d3b0608231259o43609412k988ea02b68bda50a@mail.gmail.com> <44ECDD98.20503@blueyonder.co.uk> <95be1d3b0608240155v170d256p7268ad47b89f95ec@mail.gmail.com> <17244f480608240705ld43884by252c6ae9c01f3e99@mail.gmail.com> <44EDFB93.40207@blueyonder.co.uk> Message-ID: <17244f480608241259l30a9043cv5afc33fd855032fb@mail.gmail.com> > > But unlike Vlad's version, that's vulnerable to SQL injection attacks. This particular statement actually isn't vulnerable because it's entirely generated by the programmer. In a "real" example, though, you should be careful to escape all your strings :) Best, Yariv From joelr1@REDACTED Thu Aug 24 22:03:42 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 24 Aug 2006 21:03:42 +0100 Subject: Finally: Mac Intel patches In-Reply-To: <200608241949.k7OJnX3v003537@harpo.it.uu.se> References: <200608241949.k7OJnX3v003537@harpo.it.uu.se> Message-ID: On Aug 24, 2006, at 8:49 PM, Mikael Pettersson wrote: > I've only seen the "bx is clobbered" error with gcc -fPIC before, > so I assume Darwin does that by default? I think HiPE is compiled with -mdynamic-no-pic on my machine. Also, I still get errors: gcc -mdynamic-no-pic -g -O2 -I/Users/joelr/temp/otp-0804/erts/i386- apple-darwin8.7.1 -no-cpp-precomp -DHYBRID -DHAVE_CONFIG_H -Wall - Wstrict-prototypes -Wmissing-prototypes -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -Ibeam -Isys/unix -Isys/common -Ii386-apple-darwin8.7.1/ opt/hybrid -Ii386-apple-darwin8.7.1 -Izlib -Ihipe -I../include/ internal -I../include/internal/i386-apple-darwin8.7.1 -c sys/unix/ sys_float.c -o obj/i386-apple-darwin8.7.1/opt/hybrid/sys_float.o sys/unix/sys_float.c: In function 'skip_sse2_insn': sys/unix/sys_float.c:337: error: request for member 'ss' in something not a structure or union sys/unix/sys_float.c:431: error: request for member 'ss' in something not a structure or union sys/unix/sys_float.c: In function 'fpe_sig_action': sys/unix/sys_float.c:490: warning: passing argument 1 of 'skip_sse2_insn' from incompatible pointer type make[3]: *** [obj/i386-apple-darwin8.7.1/opt/hybrid/sys_float.o] Error 1 make[2]: *** [opt] Error 2 make[1]: *** [hybrid] Error 2 make: *** [emulator] Error 2 -- http://wagerlabs.com/ From bob@REDACTED Thu Aug 24 22:06:44 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 24 Aug 2006 13:06:44 -0700 Subject: The Current List of Erlang Tutorials In-Reply-To: References: <20060824163818.C84B35A1F5@mail.erlangsystems.com> Message-ID: <6a36e7290608241306y8c0e9d1kc8fd524f33db454a@mail.gmail.com> On 8/24/06, Joel Reymont wrote: > I'm not sure if this qualifies as a tutorial but I penned this a year > ago: > > http://www.devmaster.net/articles/mmo-scalable-server/ It looks like all of the OpenPoker links in that article are busted: http://wagerlabs.com/w/openpoker -bob From joelr1@REDACTED Thu Aug 24 22:08:41 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 24 Aug 2006 21:08:41 +0100 Subject: The Current List of Erlang Tutorials In-Reply-To: <6a36e7290608241306y8c0e9d1kc8fd524f33db454a@mail.gmail.com> References: <20060824163818.C84B35A1F5@mail.erlangsystems.com> <6a36e7290608241306y8c0e9d1kc8fd524f33db454a@mail.gmail.com> Message-ID: <10189817-FC18-4BDF-8DFF-D4167E48EA42@gmail.com> Yes, I really should set up redirects. Thanks for pointing it out! On Aug 24, 2006, at 9:06 PM, Bob Ippolito wrote: > On 8/24/06, Joel Reymont wrote: >> I'm not sure if this qualifies as a tutorial but I penned this a year >> ago: >> >> http://www.devmaster.net/articles/mmo-scalable-server/ > > It looks like all of the OpenPoker links in that article are busted: > http://wagerlabs.com/w/openpoker > > -bob -- http://wagerlabs.com/ From ulf@REDACTED Thu Aug 24 22:19:50 2006 From: ulf@REDACTED (Ulf Wiger) Date: Thu, 24 Aug 2006 22:19:50 +0200 Subject: Help with bit pattern In-Reply-To: <6a36e7290608241047r27b33f19k403515262f007a6d@mail.gmail.com> References: <96657538-7C56-4CC4-9D06-8BD3DB52A6B3@gmail.com> <6a36e7290608241047r27b33f19k403515262f007a6d@mail.gmail.com> Message-ID: Den 2006-08-24 19:47:44 skrev Bob Ippolito : > > I see you're reading a SWF header... The padding size should be (8 - > ((5 + NBits1 * 4) rem 8)). I don't think that bit syntax is going to > work directly anyway because IIRC SWF files store bits in MSB first > order(!) for variable bit length fields. You can specify endianness in bit syntax patterns. Or did you mean something else? From the reference manual, on the Endianness type specifier: "Endianness = big | little | native Native-endian means that the endian will be resolved at load time to be either big-endian or little-endian, depending on what is native for the CPU that the Erlang machine is run on. The default is big." BR, Ulf W -- Ulf Wiger From vances@REDACTED Thu Aug 24 23:06:57 2006 From: vances@REDACTED (Vance Shipley) Date: Thu, 24 Aug 2006 17:06:57 -0400 Subject: Blogging away In-Reply-To: <20060824162127.GB5756@delora.autosys.us> References: <20060824162127.GB5756@delora.autosys.us> Message-ID: <20060824210657.GB59571@frogman.motivity.ca> On Thu, Aug 24, 2006 at 09:21:27AM -0700, Michael McDaniel wrote: } } Is anyone else having success with planeterlang RSS feed (what reader) ? Works for me. I'm using: Nokia S60 3rd Edition Feeds Client v3.0 (0529) -Vance From david.nospam.hopwood@REDACTED Thu Aug 24 23:09:21 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Thu, 24 Aug 2006 22:09:21 +0100 Subject: Metaprogramming In-Reply-To: <17244f480608241259l30a9043cv5afc33fd855032fb@mail.gmail.com> References: <78568af10608231043t1d5d2c77t99dea5fbb261d898@mail.gmail.com> <20060823182230.87528.qmail@web38805.mail.mud.yahoo.com> <95be1d3b0608231259o43609412k988ea02b68bda50a@mail.gmail.com> <44ECDD98.20503@blueyonder.co.uk> <95be1d3b0608240155v170d256p7268ad47b89f95ec@mail.gmail.com> <17244f480608240705ld43884by252c6ae9c01f3e99@mail.gmail.com> <44EDFB93.40207@blueyonder.co.uk> <17244f480608241259l30a9043cv5afc33fd855032fb@mail.gmail.com> Message-ID: <44EE1581.2000703@blueyonder.co.uk> Yariv Sadan wrote: >> >> But unlike Vlad's version, that's vulnerable to SQL injection attacks. > > This particular statement actually isn't vulnerable because it's > entirely generated by the programmer. In a "real" example, though, you > should be careful to escape all your strings :) The fact that "not real" examples tend to handwave away the need for escaping, is one reason why injection vulnerabilities are so common. -- David Hopwood From tobbe@REDACTED Thu Aug 24 23:37:21 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Thu, 24 Aug 2006 23:37:21 +0200 Subject: Blogging away In-Reply-To: <20060824210657.GB59571@frogman.motivity.ca> References: <20060824162127.GB5756@delora.autosys.us> <20060824210657.GB59571@frogman.motivity.ca> Message-ID: Vance Shipley wrote: > On Thu, Aug 24, 2006 at 09:21:27AM -0700, Michael McDaniel wrote: > } > } Is anyone else having success with planeterlang RSS feed (what reader) ? > > Works for me. I'm using: > > Nokia S60 3rd Edition Feeds Client v3.0 (0529) > > > -Vance > And works excellent in Thunderbird !! --Tobbe From Martin.Logan@REDACTED Thu Aug 24 23:59:39 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Thu, 24 Aug 2006 16:59:39 -0500 Subject: Learn Erlang in 5 seconds In-Reply-To: <44ED7B5A.5030906@Fitzsimons.org> Message-ID: <9CB79C836F98504C81BF082C4291E987792B1A@CHITDSEXC02.tds.corp.cendant.org> -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Bruce Fitzsimons Sent: Thursday, August 24, 2006 5:12 AM To: Joe Armstrong (TN/EAB); erlang-questions@REDACTED Subject: Re: Learn Erlang in 5 seconds 5s: How would you program if processes were limitless, IPC was trivial, and you only coded for success cases? That is brilliant. 10s: First you bend your mind to Erlang, then you bend Erlang to fit your problem. Your problem stays in its domain, and you model it with concurrent processes, message passing, and supervision trees. From mikpe@REDACTED Fri Aug 25 00:13:55 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Fri, 25 Aug 2006 00:13:55 +0200 (MEST) Subject: Finally: Mac Intel patches Message-ID: <200608242213.k7OMDttw006935@harpo.it.uu.se> On Thu, 24 Aug 2006 21:03:42 +0100, Joel Reymont wrote: >> I've only seen the "bx is clobbered" error with gcc -fPIC before, >> so I assume Darwin does that by default? > >I think HiPE is compiled with -mdynamic-no-pic on my machine. Also, I >still get errors: > >gcc -mdynamic-no-pic -g -O2 -I/Users/joelr/temp/otp-0804/erts/i386- >apple-darwin8.7.1 -no-cpp-precomp -DHYBRID -DHAVE_CONFIG_H -Wall - >Wstrict-prototypes -Wmissing-prototypes -DUSE_THREADS -D_THREAD_SAFE >-D_REENTRANT -Ibeam -Isys/unix -Isys/common -Ii386-apple-darwin8.7.1/ >opt/hybrid -Ii386-apple-darwin8.7.1 -Izlib -Ihipe -I../include/ >internal -I../include/internal/i386-apple-darwin8.7.1 -c sys/unix/ >sys_float.c -o obj/i386-apple-darwin8.7.1/opt/hybrid/sys_float.o >sys/unix/sys_float.c: In function 'skip_sse2_insn': >sys/unix/sys_float.c:337: error: request for member 'ss' in something >not a structure or union >sys/unix/sys_float.c:431: error: request for member 'ss' in something >not a structure or union >sys/unix/sys_float.c: In function 'fpe_sig_action': >sys/unix/sys_float.c:490: warning: passing argument 1 of >'skip_sse2_insn' from incompatible pointer type >make[3]: *** [obj/i386-apple-darwin8.7.1/opt/hybrid/sys_float.o] Error 1 >make[2]: *** [opt] Error 2 >make[1]: *** [hybrid] Error 2 >make: *** [emulator] Error 2 My fault again. While trying to clean up sys_float.c I missed that mcontext_t is a pointer on Darwin, where it is a struct on Linux, so the 'mcontext_t*' formal parameter to skip_sse2_insn() was wrong for Darwin. The patch below (patch-otp-0804-9-darwin-x86-sys_float-fix) should fix this. --- otp-0804/erts/emulator/sys/unix/sys_float.c.~1~ 2006-08-24 23:09:18.000000000 +0200 +++ otp-0804/erts/emulator/sys/unix/sys_float.c 2006-08-24 23:48:44.000000000 +0200 @@ -326,13 +326,16 @@ static void unmask_fpe(void) #if defined(__linux__) && defined(__x86_64__) #define mc_pc(mc) ((mc)->gregs[REG_RIP]) +typedef mcontext_t *erts_mcontext_ptr_t; #elif defined(__linux__) && defined(__i386__) #define mc_pc(mc) ((mc)->gregs[REG_EIP]) +typedef mcontext_t *erts_mcontext_ptr_t; #elif defined(__DARWIN__) && defined(__i386__) #define mc_pc(mc) ((mc)->ss.eip) +typedef mcontext_t erts_mcontext_ptr_t; #endif -static void skip_sse2_insn(mcontext_t *mc) +static void skip_sse2_insn(erts_mcontext_ptr_t mc) { unsigned char *pc0 = (unsigned char*)mc_pc(mc); unsigned char *pc = pc0; From bob@REDACTED Fri Aug 25 00:30:22 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 24 Aug 2006 15:30:22 -0700 Subject: Help with bit pattern In-Reply-To: References: <96657538-7C56-4CC4-9D06-8BD3DB52A6B3@gmail.com> <6a36e7290608241047r27b33f19k403515262f007a6d@mail.gmail.com> Message-ID: <6a36e7290608241530t429b37dcn93677f6de9562ef@mail.gmail.com> On 8/24/06, Ulf Wiger wrote: > Den 2006-08-24 19:47:44 skrev Bob Ippolito : > > > > > I see you're reading a SWF header... The padding size should be (8 - > > ((5 + NBits1 * 4) rem 8)). I don't think that bit syntax is going to > > work directly anyway because IIRC SWF files store bits in MSB first > > order(!) for variable bit length fields. > > You can specify endianness in bit syntax patterns. Or did you mean > something else? > > From the reference manual, on the Endianness type specifier: > > "Endianness = big | little | native > Native-endian means that the endian will be resolved at load time to be > either big-endian or little-endian, depending on what is native for the > CPU that the Erlang machine is run on. The default is big." You're right, I was thinking of a different part of the SWF format that's rather nuts: <> = Data, <> = <>. There's also a float encoding in the SWF format that looks like this: <> = <>, <>. (I wish I was kidding) -bob From tty@REDACTED Fri Aug 25 03:41:55 2006 From: tty@REDACTED (tty@REDACTED) Date: Thu, 24 Aug 2006 21:41:55 -0400 Subject: Erlang shuffle Message-ID: Found myself needing a fair random shuffle function. Hopefully this is useful to someone else. Its O(n log n), i.e. not as fast as Fisher-Yates shuffle, assuming lists:keysort is O(n). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% shuffle(List1) -> List2 %% Takes a list and randomly shuffles it. Relies on random:uniform %% shuffle(List) -> %% Determine the log n portion then randomize the list. randomize(round(math:log(length(List)) + 0.5), List). randomize(1, List) -> randomize(List); randomize(T, List) -> lists:foldl(fun(_E, Acc) -> randomize(Acc) end, randomize(List), lists:seq(1, (T - 1))). randomize(List) -> D = lists:map(fun(A) -> {random:uniform(), A} end, List), {_, D1} = lists:unzip(lists:keysort(1, D)), D1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Regards t From ok@REDACTED Fri Aug 25 03:47:57 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 25 Aug 2006 13:47:57 +1200 (NZST) Subject: Learn Erlang in 5 seconds - competition - win a prize Message-ID: <200608250147.k7P1lv4M267127@atlas.otago.ac.nz> "Joe Armstrong \(TN/EAB\)" wrote: (1) I have been asked to hold a talk at a Smalltalk conference (2) As part of the lecture I have promised to hold a "5 second Erlang course" (3) < the 10 second category is wide open > Since these are Smalltalk people, start with what you *agree* about: Like Smalltalk, Erlang is an open dynamic language with a Lisp heritage. Smalltalk makes data structure design easy; Erlang was invented to make massively concurrent distributed process design easy. Erlang processes have identity, state, and behaviour, and interact by sending messages; if you know the history of Smalltalk this is deja vu all over again except that Erlang prevents many concurrency problems by having read-only data, so that classes would be less useful. That should be about 10 seconds. From jay@REDACTED Fri Aug 25 04:05:59 2006 From: jay@REDACTED (Jay Nelson) Date: Thu, 24 Aug 2006 19:05:59 -0700 Subject: Lisp-Python vs. Erlang (was MLvtA, was Meta) Message-ID: <44EE5B07.30605@duomark.com> James Hague wrote: > But C# and Java aren't worth worrying about, IMO. The interesting > stuff is happening in the scripting language world, especially with > Python and Ruby. Those languages are a lot closer to Lisp > (see http://www.norvig.com/python-lisp.html). Here's my conversion of the Lisp / Python example Norvig gave: ------------------------------------------------- -module(norvig). -export([generate/1, generate_tree/1]). % Constructions... grammar(s) -> [np, vp]; grammar(np) -> [art, n]; grammar(vp) -> [v, np]; % Elements... grammar(art) -> {"the", "a"}; grammar(n) -> {"man", "ball", "woman", "table"}; grammar(v) -> {"hit", "took", "saw", "liked"}; % Unknown. grammar(_) -> none. generate(Phrase) when is_atom(Phrase) -> case grammar(Phrase) of none -> [Phrase]; Words when is_tuple(Words) -> ChoiceNum = random:uniform(size(Words)), element(ChoiceNum, Words); Construct -> generate(Construct) end; generate(Phrase) -> [generate(Word) || Word <- Phrase]. generate_tree(Phrase) when is_atom(Phrase) -> case grammar(Phrase) of none -> [Phrase]; Words when is_tuple(Words) -> ChoiceNum = random:uniform(size(Words)), {Phrase, element(ChoiceNum, Words)}; Construct -> [Phrase, generate_tree(Construct)] end; generate_tree(Phrase) -> [generate_tree(Word) || Word <- Phrase]. --------------------------------------------------- I deliberately left it similar to his so that people unfamiliar with lisp can see the correspondence, but I don't like the repetition of the generate functions. I would prefer to use a vlad-macro or an annotate function to collapse the 2nd and 3rd branches of the case statement so that there is a single generate function in source code with two variants. [This is an example of when a real macro is more readable than a support function, because the two branches are different in different ways, so the annotate function would have to have two branches or there would have to be two annotate functions, whereas a single macro could handle both cases. As an exercise to the reader, try writing the annotate approach and you'll see the slight awkwardness.] I think it reads clearer than lisp or python for the following reasons: 1) Prolog-like patterns map to the problem domain as a grammar function rather than the artificial list/hash map structure. Also the compiler can optimize it more easily so clarity plus speed. 2) The list comprehension is just a succinct joy. 3) The use of tuples and lists differentiates intent better. 4) I prefer the case ... of ... end style over (cond ( ) ...) now. Syntactically there is not much difference but erlang suggests using similar (and more readable) patterns in each branch of the case. If I had a month or two to burn I would go through the exercise of porting Norvig's AI code to erlang. There's no reason why it wouldn't all work -- and possibly discover some new parallel approaches in the process. I think erlang is a perfectly suited to many problems that lisp was. jay From ok@REDACTED Fri Aug 25 04:19:48 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 25 Aug 2006 14:19:48 +1200 (NZST) Subject: Learn Erlang in 5 seconds - competition - win a prize Message-ID: <200608250219.k7P2JmdB267595@atlas.otago.ac.nz> Serge Aleynikov wrote: "What if you were to write a system that was OS-agnostic, would easily scale to 100,000s of processes, would run on a cluster of machines, would offer nine nines of uptime, and would have to be built in a week? ... Sounds impossible with Smalltalk? ... Add Erlang to your arsenal and see for yourself!" Actually, no, it DOESN'T sound impossible with Smalltalk. Erlang is available for Windows, Solaris, Linux, MacOS X, and some others. Squeak Smalltalk is available for Windows, Solaris, Linux, MacOS X, and some others. So "OS-agnostic" is easy. Scale to 100,000s of processes? Well, it took me 0.6 seconds to create 10,000 processes on a 1GHz PowerMac. That gave me courage to try forking 200,000 processes, and that just took 9.3 seconds. Mind you, they didn't _do_ anything much... For IPC, Squeak has semaphores (inherited from ST-80) and message queues. Run on a cluster of machines? Squeak has serialised streams (SmartRefStream), so sending graphs of objects from one machine to another is dead simple, and it certainly has cross-platform support for sockets. In fact, when you open a file browser, the root is *under* the root of your local file system; FTP is just there. Squeak has its own web browser and mail user agent and web server (in fact more than one). It *is* being used to develop distributed stuff. Built in a week? Depends on how much of OTP would need reinventing, but there doesn't seem to be any reason why it couldn't be done; the IDE in Squeak is really rather pleasant (and there's the refactoring browser). Someone already skilled in Smalltalk would likely take far less time to finish such a system in Squeak than in Erlang. Nine nines of uptime? That's 3 MILLISECONDS of downtime in a year, no? Sorry, for something built in a week I just don't believe it. I believe it a little bit more for Erlang than I do for Smalltalk, just like I have a little bit more belief in mermaids than in vampires. It is *never* a good idea to insult your audience. As Anatol Rapoport (sp?) pointed out in a great book once, in any kind of real-world debate it's a good move to start by explaining why your rival is RIGHT about so many things and is reasonably concerned about so many issues. If you tell a Smalltalk audience that they can't develop distributed concurrent systems in Smalltalk they will write you down as an arrogant idiot who knows nothing about Smalltalk, and won't hear anything else you say no matter how good it is. If you tell them that Smalltalk is great and that Erlang is great too and part of this is their common heritage, they will start listening. If you praise Smalltalk development environments and say that Erlang has learned from Smalltalk (ErlIde + unit testing framework) and has more things to learn from Smalltalk (refactoring browser) they will start to get warm fuzzy feelings about you (this guy has taken the trouble to learn something about us, he's worth listening to). You should certainly admit that while Erlang has a GUI kit (in fact more than one), it's not a strength of the language, and that connecting a Smalltalk GUI with an Erlang system might be a good way to proceed. (Alas, _each_ Smalltalk has its _own_ incompatible GUI kit; Squeak even manages to have two of them.) THEN you can say that while Smalltalk has always HAD concurrency it has never been a PRIMARY focus of the language, while Erlang has had concurrency has its primary focus from day 1. Some of the differences between Smalltalk and Erlang, like syntax, are just accidents of history. Other differences (objects -vs- immutable data) are due to this fundamental difference of emphasis. From erlangist@REDACTED Fri Aug 25 05:52:26 2006 From: erlangist@REDACTED (lang er) Date: Fri, 25 Aug 2006 11:52:26 +0800 Subject: Erlang Scheduler Message-ID: <230465c00608242052y45eb3588v2968d4d2b93d46c1@mail.gmail.com> Hi! Are there any documents describing Erlang Scheduler's internal? I googled Erlang Scheduler and only get one post in this list by Ulf Wiger (http://www.erlang.org/ml-archive/erlang-questions/200104/msg00072.html). I have one question. In a C program, if I want to do some work may be blocked, I can start an OS thread .So other thread(main thread) will continue its work. In Erlang(not smp), If one process is doing some blocking work, Will the whole Erlang emulator be blocked? For example, if I use blocking socket, or do some CPU-intensive computing , can Erlang preempt such process? How to deal with this situation? Thanks ! James -------------- next part -------------- An HTML attachment was scrubbed... URL: From fritchie@REDACTED Fri Aug 25 07:19:48 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Fri, 25 Aug 2006 00:19:48 -0500 Subject: Jinterface and CLDC? Message-ID: <200608250519.k7P5JmLo087375@snookles.snookles.com> Ok, this is a newbie-kind of question, but according to "glimpse" and "grep" of my erlang-questions archive, the topic of CLDC has never been mentioned. CLDC, according to http://java.sun.com/products/cldc/, stands for "Connected Limited Device Configuration (CLDC); JSR 30, JSR 139", which appears to be a variation (?) of Java ME. A coworker asked if anyone has ever successfully used Jinterface with a CLDC Java mobile phone handset. Despite the large variety of wacky ways I've interfaced Erlang apps with The Outside World, I confess that I've never used Jinterface. So, has anyone out there used Jinterface on a Java ME/Micro Edition "CDC" or "CLDC" platform? -Scott From bengt.kleberg@REDACTED Fri Aug 25 08:24:04 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Fri, 25 Aug 2006 08:24:04 +0200 Subject: Erlang Scheduler In-Reply-To: <230465c00608242052y45eb3588v2968d4d2b93d46c1@mail.gmail.com> References: <230465c00608242052y45eb3588v2968d4d2b93d46c1@mail.gmail.com> Message-ID: <44EE9784.2050407@ericsson.com> On 2006-08-25 05:52, lang er wrote: ...deleted > In Erlang(not smp), If one process is doing some blocking work, Will > the whole Erlang emulator be blocked? No. > For example, if I use blocking socket, or do some CPU-intensive > computing , can Erlang preempt such process? How to deal with this > situation? the emulator uses poll/select to avoid blocking. moreover, as a special case for file io there are extra threads in the emulator. see ''erl +A''. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From Dietmar.Schaefer@REDACTED Fri Aug 25 08:23:55 2006 From: Dietmar.Schaefer@REDACTED (Dietmar.Schaefer@REDACTED) Date: Fri, 25 Aug 2006 08:23:55 +0200 Subject: Smalltalk <-> erlang Message-ID: I just got a deja vu ! When I dicovered Smalltalk about 20 years ago I found it the most advanced (oo) programming environment and language. When I discovered erlang about 3 years ago I found it the most advanced fault tolerant (etc.) programming environment and language. My idea was to combine the best of both worlds -> write GUI stuff in Smalltalk ; write the rest (server ) in erlang. Dietmar DFS Deutsche Flugsicherung GmbH Center Langen Am DFS-Campus 1 D - 63225 Langen Tel.: +49-(0)6103-707-0 Internet: http://www.dfs.de Public-Key der DFS: http://www.dfs.de/dfs/public_key.asc -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitriid@REDACTED Fri Aug 25 08:40:33 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Fri, 25 Aug 2006 09:40:33 +0300 Subject: Blogging away In-Reply-To: <20060824162127.GB5756@delora.autosys.us> References: <20060824162127.GB5756@delora.autosys.us> Message-ID: Works ok in JetBrains Omea RSS Reader On 8/24/06, Michael McDaniel wrote: > > Using BottomFeeder (http://www.cincomsmalltalk.com/BottomFeeder/) > on Linux, I get ... > > "Unable to process feed or query - http://planeterlang.org/rss20.xml" > AND > "Unable to process feed or query - http://planeterlang.org/rss10.xml" > > I have successfully been using BottomFeeder for a few years. > > > QUESTIONS: > > Is anyone else having problems with planeterlang RSS feed (what reader) ? > Is anyone else having success with planeterlang RSS feed (what reader) ? > Am I using the wrong URL (what should I use) ? > Any other suggestions ? > > > thanks, > > ~Michael > > > On Wed, Aug 23, 2006 at 11:27:12AM +0200, Torbjorn Tornkvist wrote: > > S.J.Thompson wrote: > > > > > > Joe - that's great; thanks. Would you be able to make an RSS feed > > > available? That makes it easier to read via an RSS readers? > > > > You'll find that at Planet erlang. > > > > > > --Tobbe > > > > > > > > > > > > > Kind regards, > > > > > > Simon > > > > > > > > > > > > > > > On Wed, 23 Aug 2006, Joe Armstrong (TN/EAB) wrote: > > > > > >> Yariv's blog http://yarivsblog.com/ with his frequent Erlang > postings > > >> has inspired me. > > >> > > >> I think he needs a little competition :-) > > >> > > >> So I've started writing ... > > >> > > >> In this blog I'll try to tell you some of the things that are > happening > > >> in the Erlang world. A lot of stuff is happening behind the scenes, > I'll > > >> try > > >> to tell you about some of this. > > >> > > >> The first post is: > > >> > > >> > http://armstrongonsoftware.blogspot.com/2006/08/making-money-from-erlang > > >> .html > > >> > > >> Cheers > > >> > > >> /Joe > > >> > > >> > > >> > > > > > > > -- > Michael McDaniel > Portland, Oregon, USA > http://autosys.us > +1 503 283 5284 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From akopa@REDACTED Fri Aug 25 09:52:12 2006 From: akopa@REDACTED (Matthew D Swank) Date: Fri, 25 Aug 2006 02:52:12 -0500 Subject: Smerl breakthough: metacurrying In-Reply-To: <95be1d3b0608230101y694dd1d4yecd0bf791d761f2c@mail.gmail.com> References: <17244f480608190600o4c3e07d1p30be72690d453110@mail.gmail.com> <44E737FD.4060407@blueyonder.co.uk> <17244f480608221201j4e788ce4qe75f12b6a6c52be6@mail.gmail.com> <95be1d3b0608230101y694dd1d4yecd0bf791d761f2c@mail.gmail.com> Message-ID: <44EEAC2C.7030104@charter.net> Vlad Dumitrescu wrote: > On 8/22/06, Yariv Sadan wrote: >> This may not be as powerful as quasiquoting, but I have found it >> useful in my current project. > > Hi, > Just an observation: smerl is targeting dynamic (run-time) handling of > code, while quasiquoting is a way to do most of the work at > compile-time. (The latter could of course use smerl to do the work) > > regards, > Vlad > Is your erlang quasiquoting work available to the general public? Matt -- "You do not really understand something unless you can explain it to your grandmother." ? Albert Einstein. From tobbe@REDACTED Fri Aug 25 09:55:36 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Fri, 25 Aug 2006 09:55:36 +0200 Subject: Erlang shuffle In-Reply-To: References: Message-ID: Nice! I suggest you add it to the Cookbook at trapexit.org. Cheers, Tobbe tty@REDACTED wrote: > Found myself needing a fair random shuffle function. Hopefully this is useful to someone else. Its O(n log n), i.e. not as fast as Fisher-Yates shuffle, assuming lists:keysort is O(n). > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > %% > %% shuffle(List1) -> List2 > %% Takes a list and randomly shuffles it. Relies on random:uniform > %% > shuffle(List) -> > %% Determine the log n portion then randomize the list. > randomize(round(math:log(length(List)) + 0.5), List). > > randomize(1, List) -> > randomize(List); > randomize(T, List) -> > lists:foldl(fun(_E, Acc) -> > randomize(Acc) > end, randomize(List), lists:seq(1, (T - 1))). > > randomize(List) -> > D = lists:map(fun(A) -> > {random:uniform(), A} > end, List), > > {_, D1} = lists:unzip(lists:keysort(1, D)), > D1. > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > Regards > > t > From rasmussen.bryan@REDACTED Fri Aug 25 09:59:46 2006 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Fri, 25 Aug 2006 09:59:46 +0200 Subject: Xml messaging in erlang question In-Reply-To: <407d9ef80608241220s2923f5eejb23e9ac99aa6bff1@mail.gmail.com> References: <3bb44c6e0608240048na6bec63j63575e895889a772@mail.gmail.com> <407d9ef80608241220s2923f5eejb23e9ac99aa6bff1@mail.gmail.com> Message-ID: <3bb44c6e0608250059x6faba43byef3fd6baaaa617a@mail.gmail.com> Hmm, I essentially just got told by someone with more power than me that performance of this application supposed to be handling millions of business messages is not a concern. I feel relieved. Cheers, Bryan Rasmussen On 8/24/06, Willem de Jong wrote: > You would need > 1. an http server module that accepts the HTTP post in chunks, and passes it on > to the XML parser in chunks. > > 2. an XML parser that can work on chunks of data > > 3. the XML parser should probably be a SAX parser: one that generates > events as it parses the XML document > > 4. the module that processes the SAX events should be able to discard the > bits that you don't need. > > Like Joe says, it is not 100% clear whether you need 1 and 2 to avoid holding > the XML document in memory while processing it. > > Looking at what is available: > ad 1) > It is not clear to me whether YAWS and/or Inets can deliver the post > data in chunks. > > ad 2) > I believe that Xmerl can work on chunks of data (using the > 'continuation' function > to get the next chunk) > > ad 3) > xmerl and erlsom both offer a SAX API > > ad 4) > erlsom could probably be used to discard the events that you don't need. > > You would have to write an XSD for the XML document (maybe it already exists). > If you define the elements that you dont want as 'any' element, and you set > the 'processContents' attribute to 'skip', then erlsom will discard > these elements. > > Note that the additional benefit is that the XML document will be transformed to > a structure of Erlang records (following the types as defined in the > XSD). This is > convenient for processing, and it takes much less space than a DOM > representation. > > This is of course just a shameless attempt to draw some attention for erlsom > (www.sourceforge.org/projects/erlsom), a nice tool that I have been writing > that deserves some attention... > > Regards, > Willem > From rlenglet@REDACTED Fri Aug 25 10:10:30 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Fri, 25 Aug 2006 17:10:30 +0900 Subject: Blogging away In-Reply-To: References: <20060824162127.GB5756@delora.autosys.us> Message-ID: <200608251710.30525.rlenglet@users.forge.objectweb.org> OK in KDE's Akregator, too. Dmitrii Dimandt wrote: > Works ok in JetBrains Omea RSS Reader > > On 8/24/06, Michael McDaniel wrote: > > Using BottomFeeder > > (http://www.cincomsmalltalk.com/BottomFeeder/) on Linux, I > > get ... > > > > "Unable to process feed or query - > > http://planeterlang.org/rss20.xml" AND > > "Unable to process feed or query - > > http://planeterlang.org/rss10.xml" > > > > I have successfully been using BottomFeeder for a few years. > > > > > > QUESTIONS: > > > > Is anyone else having problems with planeterlang RSS feed > > (what reader) ? Is anyone else having success with > > planeterlang RSS feed (what reader) ? Am I using the wrong > > URL (what should I use) ? > > Any other suggestions ? > > > > > > thanks, > > > > ~Michael > > > > On Wed, Aug 23, 2006 at 11:27:12AM +0200, Torbjorn Tornkvist wrote: > > > S.J.Thompson wrote: > > > > Joe - that's great; thanks. Would you be able to make an > > > > RSS feed available? That makes it easier to read via an > > > > RSS readers? > > > > > > You'll find that at Planet erlang. > > > > > > > > > --Tobbe > > > > > > > Kind regards, > > > > > > > > Simon > > > > > > > > On Wed, 23 Aug 2006, Joe Armstrong (TN/EAB) wrote: > > > >> Yariv's blog http://yarivsblog.com/ with his frequent > > > >> Erlang > > > > postings > > > > > >> has inspired me. > > > >> > > > >> I think he needs a little competition :-) > > > >> > > > >> So I've started writing ... > > > >> > > > >> In this blog I'll try to tell you some of the things > > > >> that are > > > > happening > > > > > >> in the Erlang world. A lot of stuff is happening behind > > > >> the scenes, > > > > I'll > > > > > >> try > > > >> to tell you about some of this. > > > >> > > > >> The first post is: > > > > http://armstrongonsoftware.blogspot.com/2006/08/making-money > >-from-erlang > > > > > >> .html > > > >> > > > >> Cheers > > > >> > > > >> /Joe > > > > -- > > Michael McDaniel > > Portland, Oregon, USA > > http://autosys.us > > +1 503 283 5284 -- Romain LENGLET From joelr1@REDACTED Fri Aug 25 10:18:20 2006 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 25 Aug 2006 09:18:20 +0100 Subject: Finally: Mac Intel patches In-Reply-To: <200608242213.k7OMDttw006935@harpo.it.uu.se> References: <200608242213.k7OMDttw006935@harpo.it.uu.se> Message-ID: <16B6273B-73D7-4DA5-864D-FF3967ADEE01@gmail.com> It works now! ./testsuite.sh /usr/local ======================================================================== There was an old /tmp/hipe_test_log.joelr... removing Testing /usr/local Compiler options: [o2] The log will be left in /tmp/hipe_test_log.joelr ERL_COMPILER_OPTIONS=[nowarn_shadow_vars] Recompile: test PASSED HiPE testsuite for: /usr/local on junior.local ======================================================================== ./testsuite.sh --only compiler_tests /usr/local ======================================================================== There was an old /tmp/hipe_test_log.joelr... removing Testing /usr/local Compiler options: [o2] * Only running: compiler_tests The log will be left in /tmp/hipe_test_log.joelr ERL_COMPILER_OPTIONS=[nowarn_shadow_vars] Recompile: test PASSED HiPE testsuite for: /usr/local on junior.local ======================================================================== -- http://wagerlabs.com/ From gordonguthrie@REDACTED Fri Aug 25 10:25:30 2006 From: gordonguthrie@REDACTED (Gordon Guthrie) Date: Fri, 25 Aug 2006 09:25:30 +0100 (BST) Subject: 5 second submission In-Reply-To: <3bb44c6e0608240445j7237a373lba96a0f9bafefeae@mail.gmail.com> References: <17244f480608240359l14fe828cm5ea96f2f99ee1698@mail.gmail.com> <3bb44c6e0608240445j7237a373lba96a0f9bafefeae@mail.gmail.com> Message-ID: <21529.194.72.110.12.1156494330.squirrel@backawinner.gg> Bryan Rasmussen said: > I think some of these are starting to sound like the kind of thing you > want to tell managers, not a bunch of smalltalk programmers. I am a manager! Gordon From bjorn@REDACTED Fri Aug 25 11:33:41 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 25 Aug 2006 11:33:41 +0200 Subject: Experiences with Multithreaded drivers In-Reply-To: <1156426450.9400.142.camel@battlestar.oscarh.net> References: <1156426450.9400.142.camel@battlestar.oscarh.net> Message-ID: Oscar Hellstr?m writes: > I would guess that there is some data structures > expecting all driver_output to be executed by the main thread, am I > right? Correct. Future versions of the SMP emulator will probably have new driver APIs to make multi-threaded drivers much easier to write. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From sean.hinde@REDACTED Fri Aug 25 12:28:16 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 25 Aug 2006 11:28:16 +0100 Subject: Lisp-Python vs. Erlang (was MLvtA, was Meta) In-Reply-To: <44EE5B07.30605@duomark.com> References: <44EE5B07.30605@duomark.com> Message-ID: This is fun! Here is my Erlang translation of the GPS from Norvig, following the lisp code as closely as possible. I found it quite kludgy to write in erlang. I ended up using a deprecated function from lists.erl, and there were some features of lisp like named parameters and extension parameters that seemed quite nice - although perhaps not so much until Luke forcefully pointed out the benefits :-) Heavy higher order function programming certainly seems less elegant in Erlang than lisp or any of the modern statically typed functional languages. Sean -module(gps). -export([gps/3]). -record(op, { action, preconds = [], add_list = [], del_list = [] }). gps(State, Goals, Ops) -> put(state, State), put(ops, Ops), lists:all(fun achieve/1, Goals). achieve(Goal) -> State = get(state), Ops = get(ops), lists:member(Goal, State) orelse lists:any(fun apply_op/1, find_all(Goal, Ops, fun appropriate_p/2)). appropriate_p(Op, Goal) -> lists:member(Goal, Op#op.add_list). apply_op(Op) -> case lists:all(fun achieve/1, Op#op.preconds) of true -> io:format("Executing ~p~n",[Op#op.action]), put(state, get(state) -- Op#op.del_list), put(state, merge(get(state), Op#op.add_list)), true; false -> false end. merge(L1, L2) -> lists:merge(lists:sort(L1), lists:sort(L2)). find_all(Goal, Ops, Pred) -> lists:filter(Pred, [Goal], Ops). On 25 Aug 2006, at 03:05, Jay Nelson wrote: > James Hague wrote: > > > But C# and Java aren't worth worrying about, IMO. The interesting > > stuff is happening in the scripting language world, especially with > > Python and Ruby. Those languages are a lot closer to Lisp > > (see http://www.norvig.com/python-lisp.html). > > > Here's my conversion of the Lisp / Python example Norvig gave: > > ------------------------------------------------- > > -module(norvig). > > -export([generate/1, generate_tree/1]). > > % Constructions... > grammar(s) -> [np, vp]; > grammar(np) -> [art, n]; > grammar(vp) -> [v, np]; > > % Elements... > grammar(art) -> {"the", "a"}; > grammar(n) -> {"man", "ball", "woman", "table"}; > grammar(v) -> {"hit", "took", "saw", "liked"}; > > % Unknown. > grammar(_) -> none. > > > > generate(Phrase) when is_atom(Phrase) -> > case grammar(Phrase) of > none -> > [Phrase]; > Words when is_tuple(Words) -> > ChoiceNum = random:uniform(size(Words)), > element(ChoiceNum, Words); > Construct -> > generate(Construct) > end; > > generate(Phrase) -> > [generate(Word) || Word <- Phrase]. > > > > generate_tree(Phrase) when is_atom(Phrase) -> > case grammar(Phrase) of > none -> > [Phrase]; > Words when is_tuple(Words) -> > ChoiceNum = random:uniform(size(Words)), > {Phrase, element(ChoiceNum, Words)}; > Construct -> > [Phrase, generate_tree(Construct)] > end; > > generate_tree(Phrase) -> > [generate_tree(Word) || Word <- Phrase]. > > --------------------------------------------------- > > > I deliberately left it similar to his so that people unfamiliar with > lisp can see the correspondence, but I don't like the repetition > of the generate functions. I would prefer to use a vlad-macro > or an annotate function to collapse the 2nd and 3rd branches > of the case statement so that there is a single generate function > in source code with two variants. > > [This is an example of when a real macro is more readable than a > support function, because the two branches are different in > different ways, so the annotate function would have to have > two branches or there would have to be two annotate functions, > whereas a single macro could handle both cases. As an exercise > to the reader, try writing the annotate approach and you'll see > the slight awkwardness.] > > > I think it reads clearer than lisp or python for the following > reasons: > > 1) Prolog-like patterns map to the problem domain as a grammar > function > rather than the artificial list/hash map structure. Also the > compiler > can optimize it more easily so clarity plus speed. > > 2) The list comprehension is just a succinct joy. > > 3) The use of tuples and lists differentiates intent better. > > 4) I prefer the case ... of ... end style over (cond ( ) ...) now. > Syntactically there is not much difference but erlang > suggests using similar (and more readable) patterns > in each branch of the case. > > > If I had a month or two to burn I would go through the exercise > of porting Norvig's AI code to erlang. There's no reason why > it wouldn't all work -- and possibly discover some new parallel > approaches in the process. I think erlang is a perfectly suited > to many problems that lisp was. > > > jay From vladdu55@REDACTED Fri Aug 25 12:42:22 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 25 Aug 2006 11:42:22 +0100 Subject: Smerl breakthough: metacurrying In-Reply-To: <44EEAC2C.7030104@charter.net> References: <17244f480608190600o4c3e07d1p30be72690d453110@mail.gmail.com> <44E737FD.4060407@blueyonder.co.uk> <17244f480608221201j4e788ce4qe75f12b6a6c52be6@mail.gmail.com> <95be1d3b0608230101y694dd1d4yecd0bf791d761f2c@mail.gmail.com> <44EEAC2C.7030104@charter.net> Message-ID: <95be1d3b0608250342xd69ac02gfdc20c56c47400dc@mail.gmail.com> Hi, On 8/25/06, Matthew D Swank wrote: > Is your erlang quasiquoting work available to the general public? Not yet, because it's still in early infancy. I hope that in a week or so it will be good enough to show something that works in a controlled environment (i.e. don't use it to control a nuclear plant! ;-) regards, Vlad From thomasl_erlang@REDACTED Fri Aug 25 12:56:27 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 25 Aug 2006 03:56:27 -0700 (PDT) Subject: Metaprogramming In-Reply-To: <95be1d3b0608240155v170d256p7268ad47b89f95ec@mail.gmail.com> Message-ID: <20060825105627.31890.qmail@web38814.mail.mud.yahoo.com> --- Vlad Dumitrescu wrote: > On 8/23/06, David Hopwood > wrote: > > Do you have any design notes or examples of what > this might look like? > > > Will it be possible to write a quasipattern > anywhere that a pattern > > can currently occur in Erlang? > > Yes, I'd like it to be possible. My implementation > is what Richard > described above as Lisp's backquote - when the > module is parsed, the > new stuff is converted to Erlang terms and from then > on it's just > regular code. > > Provisional syntax is: > <| ... |> encloses code and its value is simply > the parse tree > @Var is a "unquote" application, replacing the > variable value in the code > @@Var is a "splicing-unquote" application, where > Var must be a list > and its content is spliced in the containing list > (possibly even > tuple) > > <|name| ... |> will use module "name" to retrieve > lexical scanner > and parser, thus allowing even Seems like a nice notation. I once experimented with something similar for just Erlang, and ran up against the problem that one often wants to work with syntactic program fragments too. So, you will have to invoke the erlang parser at various 'non-standard' points ("parse a clause", etc). (This indicates another advantage with Lisp, of course :-) Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From bengt.kleberg@REDACTED Fri Aug 25 13:04:23 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Fri, 25 Aug 2006 13:04:23 +0200 Subject: Lisp-Python vs. Erlang (was MLvtA, was Meta) In-Reply-To: References: <44EE5B07.30605@duomark.com> Message-ID: <44EED937.6020306@ericsson.com> On 2006-08-25 12:28, Sean Hinde wrote: > This is fun! > > Here is my Erlang translation of the GPS from Norvig, following the lisp > code as closely as possible. > > I found it quite kludgy to write in erlang. I ended up using a > deprecated function from lists.erl, and there were some features of lisp ...deleted > find_all(Goal, Ops, Pred) -> > lists:filter(Pred, [Goal], Ops). what does filter/3 do? bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From sean.hinde@REDACTED Fri Aug 25 13:31:28 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 25 Aug 2006 12:31:28 +0100 Subject: Lisp-Python vs. Erlang (was MLvtA, was Meta) In-Reply-To: <44EED937.6020306@ericsson.com> References: <44EE5B07.30605@duomark.com> <44EED937.6020306@ericsson.com> Message-ID: <70BD21C3-D659-4444-A86E-9ABFC288999E@gmail.com> On 25 Aug 2006, at 12:04, Bengt Kleberg wrote: > On 2006-08-25 12:28, Sean Hinde wrote: >> This is fun! >> Here is my Erlang translation of the GPS from Norvig, following >> the lisp code as closely as possible. >> I found it quite kludgy to write in erlang. I ended up using a >> deprecated function from lists.erl, and there were some features >> of lisp > ...deleted >> find_all(Goal, Ops, Pred) -> >> lists:filter(Pred, [Goal], Ops). > > what does filter/3 do? filter(Pred, Eas, List) -> [ E || E <- List, apply(Pred, [E|Eas]) ]. It applies the fun to a list which has the extra parameter as the tail of the list. At some point I intended to try to re-write it without using that.. but real work intrudes. Excercise for someone? Sean From vladdu55@REDACTED Fri Aug 25 14:10:33 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 25 Aug 2006 13:10:33 +0100 Subject: Metaprogramming In-Reply-To: <20060825105627.31890.qmail@web38814.mail.mud.yahoo.com> References: <95be1d3b0608240155v170d256p7268ad47b89f95ec@mail.gmail.com> <20060825105627.31890.qmail@web38814.mail.mud.yahoo.com> Message-ID: <95be1d3b0608250510q6b4b6cfeh64445a06d1992089@mail.gmail.com> On 8/25/06, Thomas Lindgren wrote: > Seems like a nice notation. I once experimented with > something similar for just Erlang, and ran up against > the problem that one often wants to work with > syntactic program fragments too. So, you will have to > invoke the erlang parser at various 'non-standard' > points ("parse a clause", etc). That's exactly my problem at the moment. :-) It takes a while to cover all possible cases so that one at least gets a reasonable error message... regards, Vlad From bjorn@REDACTED Fri Aug 25 14:12:59 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 25 Aug 2006 14:12:59 +0200 Subject: Lisp-Python vs. Erlang (was MLvtA, was Meta) In-Reply-To: References: <44EE5B07.30605@duomark.com> Message-ID: I find it convenient to import functions from the lists module, rather than writing "lists:" before every call. I learned that practice from Robert Virding. /Bjorn Sean Hinde writes: > This is fun! > > Here is my Erlang translation of the GPS from Norvig, following the > lisp code as closely as possible. > > I found it quite kludgy to write in erlang. I ended up using a > deprecated function from lists.erl, and there were some features of > lisp like named parameters and extension parameters that seemed quite > nice - although perhaps not so much until Luke forcefully pointed out > the benefits :-) > > Heavy higher order function programming certainly seems less elegant > in Erlang than lisp or any of the modern statically typed functional > languages. > > Sean > > -module(gps). > > -export([gps/3]). > > -record(op, > { > action, > preconds = [], > add_list = [], > del_list = [] > }). > > gps(State, Goals, Ops) -> > put(state, State), > put(ops, Ops), > lists:all(fun achieve/1, Goals). > > achieve(Goal) -> > State = get(state), > Ops = get(ops), > lists:member(Goal, State) orelse > lists:any(fun apply_op/1, find_all(Goal, Ops, fun > appropriate_p/2)). > > appropriate_p(Op, Goal) -> > lists:member(Goal, Op#op.add_list). > > apply_op(Op) -> > case lists:all(fun achieve/1, Op#op.preconds) of > true -> > io:format("Executing ~p~n",[Op#op.action]), > put(state, get(state) -- Op#op.del_list), > put(state, merge(get(state), Op#op.add_list)), > true; > false -> > false > end. > > merge(L1, L2) -> > lists:merge(lists:sort(L1), lists:sort(L2)). > > find_all(Goal, Ops, Pred) -> > lists:filter(Pred, [Goal], Ops). > > > > On 25 Aug 2006, at 03:05, Jay Nelson wrote: > > > James Hague wrote: > > > > > But C# and Java aren't worth worrying about, IMO. The interesting > > > stuff is happening in the scripting language world, especially with > > > Python and Ruby. Those languages are a lot closer to Lisp > > > (see http://www.norvig.com/python-lisp.html). > > > > > > Here's my conversion of the Lisp / Python example Norvig gave: > > > > ------------------------------------------------- > > > > -module(norvig). > > > > -export([generate/1, generate_tree/1]). > > > > % Constructions... > > grammar(s) -> [np, vp]; > > grammar(np) -> [art, n]; > > grammar(vp) -> [v, np]; > > > > % Elements... > > grammar(art) -> {"the", "a"}; > > grammar(n) -> {"man", "ball", "woman", "table"}; > > grammar(v) -> {"hit", "took", "saw", "liked"}; > > > > % Unknown. > > grammar(_) -> none. > > > > > > > > generate(Phrase) when is_atom(Phrase) -> > > case grammar(Phrase) of > > none -> > > [Phrase]; > > Words when is_tuple(Words) -> > > ChoiceNum = random:uniform(size(Words)), > > element(ChoiceNum, Words); > > Construct -> > > generate(Construct) > > end; > > > > generate(Phrase) -> > > [generate(Word) || Word <- Phrase]. > > > > > > > > generate_tree(Phrase) when is_atom(Phrase) -> > > case grammar(Phrase) of > > none -> > > [Phrase]; > > Words when is_tuple(Words) -> > > ChoiceNum = random:uniform(size(Words)), > > {Phrase, element(ChoiceNum, Words)}; > > Construct -> > > [Phrase, generate_tree(Construct)] > > end; > > > > generate_tree(Phrase) -> > > [generate_tree(Word) || Word <- Phrase]. > > > > --------------------------------------------------- > > > > > > I deliberately left it similar to his so that people unfamiliar with > > lisp can see the correspondence, but I don't like the repetition > > of the generate functions. I would prefer to use a vlad-macro > > or an annotate function to collapse the 2nd and 3rd branches > > of the case statement so that there is a single generate function > > in source code with two variants. > > > > [This is an example of when a real macro is more readable than a > > support function, because the two branches are different in > > different ways, so the annotate function would have to have > > two branches or there would have to be two annotate functions, > > whereas a single macro could handle both cases. As an exercise > > to the reader, try writing the annotate approach and you'll see > > the slight awkwardness.] > > > > > > I think it reads clearer than lisp or python for the following > > reasons: > > > > 1) Prolog-like patterns map to the problem domain as a grammar > > function > > rather than the artificial list/hash map structure. Also the > > compiler > > can optimize it more easily so clarity plus speed. > > > > 2) The list comprehension is just a succinct joy. > > > > 3) The use of tuples and lists differentiates intent better. > > > > 4) I prefer the case ... of ... end style over (cond ( ) ...) now. > > Syntactically there is not much difference but erlang > > suggests using similar (and more readable) patterns > > in each branch of the case. > > > > > > If I had a month or two to burn I would go through the exercise > > of porting Norvig's AI code to erlang. There's no reason why > > it wouldn't all work -- and possibly discover some new parallel > > approaches in the process. I think erlang is a perfectly suited > > to many problems that lisp was. > > > > > > jay > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From ulf.wiger@REDACTED Fri Aug 25 14:22:49 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Fri, 25 Aug 2006 14:22:49 +0200 Subject: Lisp-Python vs. Erlang (was MLvtA, was Meta) In-Reply-To: Message-ID: Not having though it through much, wouldn't ordsets be a better starting point than unordered lists? Ordsets are defined as being ordered lists, so it should be perfectly ok to use the odd lists library function on them. BR, Ulf W > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Sean Hinde > Sent: den 25 augusti 2006 12:28 > To: Jay Nelson > Cc: erlang-questions@REDACTED > Subject: Re: Lisp-Python vs. Erlang (was MLvtA, was Meta) > > This is fun! > > Here is my Erlang translation of the GPS from Norvig, > following the lisp code as closely as possible. > > I found it quite kludgy to write in erlang. I ended up using > a deprecated function from lists.erl, and there were some > features of lisp like named parameters and extension > parameters that seemed quite nice - although perhaps not so > much until Luke forcefully pointed out the benefits :-) > > Heavy higher order function programming certainly seems less > elegant in Erlang than lisp or any of the modern statically > typed functional languages. > > Sean > > -module(gps). > > -export([gps/3]). > > -record(op, > { > action, > preconds = [], > add_list = [], > del_list = [] > }). > > gps(State, Goals, Ops) -> > put(state, State), > put(ops, Ops), > lists:all(fun achieve/1, Goals). > > achieve(Goal) -> > State = get(state), > Ops = get(ops), > lists:member(Goal, State) orelse > lists:any(fun apply_op/1, find_all(Goal, Ops, fun > appropriate_p/2)). > > appropriate_p(Op, Goal) -> > lists:member(Goal, Op#op.add_list). > > apply_op(Op) -> > case lists:all(fun achieve/1, Op#op.preconds) of > true -> > io:format("Executing ~p~n",[Op#op.action]), > put(state, get(state) -- Op#op.del_list), > put(state, merge(get(state), Op#op.add_list)), > true; > false -> > false > end. > > merge(L1, L2) -> > lists:merge(lists:sort(L1), lists:sort(L2)). > > find_all(Goal, Ops, Pred) -> > lists:filter(Pred, [Goal], Ops). > > > > On 25 Aug 2006, at 03:05, Jay Nelson wrote: > > > James Hague wrote: > > > > > But C# and Java aren't worth worrying about, IMO. The interesting > > > stuff is happening in the scripting language world, > especially with > > > Python and Ruby. Those languages are a lot closer to Lisp (see > > > http://www.norvig.com/python-lisp.html). > > > > > > Here's my conversion of the Lisp / Python example Norvig gave: > > > > ------------------------------------------------- > > > > -module(norvig). > > > > -export([generate/1, generate_tree/1]). > > > > % Constructions... > > grammar(s) -> [np, vp]; > > grammar(np) -> [art, n]; > > grammar(vp) -> [v, np]; > > > > % Elements... > > grammar(art) -> {"the", "a"}; > > grammar(n) -> {"man", "ball", "woman", "table"}; > > grammar(v) -> {"hit", "took", "saw", "liked"}; > > > > % Unknown. > > grammar(_) -> none. > > > > > > > > generate(Phrase) when is_atom(Phrase) -> > > case grammar(Phrase) of > > none -> > > [Phrase]; > > Words when is_tuple(Words) -> > > ChoiceNum = random:uniform(size(Words)), > > element(ChoiceNum, Words); > > Construct -> > > generate(Construct) > > end; > > > > generate(Phrase) -> > > [generate(Word) || Word <- Phrase]. > > > > > > > > generate_tree(Phrase) when is_atom(Phrase) -> > > case grammar(Phrase) of > > none -> > > [Phrase]; > > Words when is_tuple(Words) -> > > ChoiceNum = random:uniform(size(Words)), > > {Phrase, element(ChoiceNum, Words)}; > > Construct -> > > [Phrase, generate_tree(Construct)] > > end; > > > > generate_tree(Phrase) -> > > [generate_tree(Word) || Word <- Phrase]. > > > > --------------------------------------------------- > > > > > > I deliberately left it similar to his so that people > unfamiliar with > > lisp can see the correspondence, but I don't like the repetition of > > the generate functions. I would prefer to use a vlad-macro or an > > annotate function to collapse the 2nd and 3rd branches of the case > > statement so that there is a single generate function in > source code > > with two variants. > > > > [This is an example of when a real macro is more readable than a > > support function, because the two branches are different in > different > > ways, so the annotate function would have to have two branches or > > there would have to be two annotate functions, whereas a > single macro > > could handle both cases. As an exercise to the reader, try writing > > the annotate approach and you'll see the slight awkwardness.] > > > > > > I think it reads clearer than lisp or python for the following > > reasons: > > > > 1) Prolog-like patterns map to the problem domain as a grammar > > function > > rather than the artificial list/hash map structure. Also the > > compiler > > can optimize it more easily so clarity plus speed. > > > > 2) The list comprehension is just a succinct joy. > > > > 3) The use of tuples and lists differentiates intent better. > > > > 4) I prefer the case ... of ... end style over (cond ( ) ...) now. > > Syntactically there is not much difference but erlang > > suggests using similar (and more readable) patterns > > in each branch of the case. > > > > > > If I had a month or two to burn I would go through the exercise of > > porting Norvig's AI code to erlang. There's no reason why > it wouldn't > > all work -- and possibly discover some new parallel > approaches in the > > process. I think erlang is a perfectly suited to many > problems that > > lisp was. > > > > > > jay > > From claus.reinke@REDACTED Fri Aug 25 12:40:33 2006 From: claus.reinke@REDACTED (Claus Reinke) Date: Fri, 25 Aug 2006 11:40:33 +0100 Subject: Erlang for Smalltalkers (was: Learn Erlang in 5 seconds - competition - win a prize) References: Message-ID: > I have been asked to hold a talk at a Smalltalk conference well, you've been challenging them for some time now (object- vs concurrency-oriented programming) <:-)> > So I have to convince a conference room full of Smalltalkers to > become Erlangtalkers. if there's a room full of hackers, you might be able to use that to your advantage: describe the salient features of Erlang/OTP. then challenge them to add an "Erlang/OTP" class to their favourite Smalltalk system (Squeak?). what are the fundamental issues they will run into and need to take care of? how does Erlang solve these? I'm not a Smalltalker myself, but I doubt that the usual "Erlang is the better language" approach is going to be fruitful in that kind of community. You do *not* have to convince them to become Erlangers, nor would I rate your chances highly if you tried. You ought to be able to convince them that Erlang represents certain ideas whose time has come, tackling issues that Smalltalks may not have addressed yet (check carefully before making such claims!-), but will have to address sooner rather than later, too. In other words, accept that they'll keep doing things the Smalltalk way, but convince them that there are problems they need to take care of, and that Erlang represents one coherent and well-tested set of solutions. What might work is to look at what current Smalltalks do well, check what Erlang does better, and then to highlight the differences in terms of areas that Smalltalkers may not have focussed on yet (multithreading/distribution/fault-tolerance?). You'll probably find lots of things that Erlang does not do as well as Smalltalk (guis/ reflection/ease of tool-building?). Be honest about those, too.. just as Erlang has limitations that make some tasks more difficult than in Smalltalk (reflection/meta-programming, for instance), so Smalltalk has limitations that make some tasks more difficult than in Erlang. Working out what these limitations are, and why they are important, would give you something more welcome than the usual sales talk for a not-invented-here language: a well-informed talk for a well-informed audience, addressing real issues and offering intelligent appropaches to their solution. > As part of the lecture I have promised to hold a "5 second Erlang > course" I thought Erlang was soft realtime, why the artifical hard time limit?-) The gold-standard for conciseness there might not be the feature bulletpoint slide, nor the 5-second sales pitch, but the Lisp-in-Lisp or Smalltalk-in-Smalltalk executable definitions. Can you give an Erlang-in-Erlang implementation on a single page of code? > "To make a fault-tolerant system you need two computers because if you > only have one and it crashes you're sunk so you'd better use Erlang cos > all other languages suck." you might as well not attend, then. perhaps they'll give you some credit for bravado, but none for trying to understand their way of doing things. by all means, highlight Erlang's successes in that area, but be careful to understand Smalltalk's as well. eg., some decades ago, there was a famous cover page depicting a Smalltalk system as a ship going to see while parts of it were under (re-)construction (pre-dating Erlang's hot code replacement). if you leave out the "cos all other languages suck" part, you have a point, but I'd phrase it differently, presenting Erlang's ideas and contributions as a natural extension and generalisation of Smalltalk's ideas and contributions (to the multi-processing/distributed case, with implicit and hardware fault tolerance, and with large teams of programmers when needed). you need to figure out what they do already have, where Erlang offers advantages, and where inherent Smalltalk features might get in the way of exploiting these advantages (eg. is message passing in a typical Smalltalk system these days loosely coupled and suited for distribution, or tightly coupled imperative, update-everywhere, sequential?). compare with this (from "The Early History Of Smalltalk", 1993 by Alan Kay): In computer terms, Smalltalk is a recursion on the notion of computer itself. Instead of dividing "computer stuff" into things each less strong than the whole--like data structures, procedures, and functions which are the usual paraphernalia of programming languages--each Smalltalk object is a recursion on the entire possibilities of the computer. Thus its semantics are a bit like having thousands and thousands of computer all hooked together by a very fast network. Questions of concrete representation can thus be postponed almost indefinitely because we are mainly concerned that the computers behave appropriately, and are interested in particular strategies only if the results are off or come back too slowly. http://www.smalltalk.org/smalltalk/TheEarlyHistoryOfSmalltalk_Introduction.html I have the feeling that this gives an almost ideal starting point: taking the ideas as given, what happens if we insert some harsh reality: - what if this recursion is not idealised, but real, with thousands and thousands of *concurrently operating* processes, possibly on many real computers, or on a single computer with multiple cores, or both? - what if the network isn't "very fast"? - what if some results do not come back at all? - what if some of those computers fail or have to be rebooted? - what if debugging a running system is a fine idea, but you simply can't afford to stop the world while you're doing it? (enter Erlang) In other words, present Erlang as a natural next step in thinking about some of the same ideas from which Smalltalk emerged. Don't try to turn Smalltalkers into Erlangers, but do try to make Smalltalkers think about the issues Erlang addresses. Ideally, convince them to "borrow" what is best about Erlang, instead of adopting conventional threads (again, check carefully what they've got). Mix with your usual spiel on objects vs processes, perhaps tie the loop back to Smalltalk's roots in Simula's process libs.. just one partially informed outsider's view.. good luck, claus ps. I'd certainly like to see a video of this. I'm trying to imagine Alan Kay and Joe Armstrong in the same room, in violent agreement about how everybody else never seems to get it!-) From pupeno@REDACTED Fri Aug 25 15:18:40 2006 From: pupeno@REDACTED (Pupeno) Date: Fri, 25 Aug 2006 13:18:40 +0000 Subject: xmlrpc in erlang Message-ID: <200608251318.40141.pupeno@pupeno.com> Hello, What library do you recommend for doing XMLRPC in Erlang ? Client and server ? I have found two: - One inside jungerl. - And one in http://erlang.stacken.kth.se/user.html#xmlrpc-1.13 Are there any others ? Any hints about which one to take ? What I don't like of the first one is that it comes bundled with lots of things I am not interested in and the second one seems just a tarbal thrown there with no particular repository to refer to. Thanks. -- Pupeno (http://pupeno.com) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From james.hague@REDACTED Fri Aug 25 15:24:11 2006 From: james.hague@REDACTED (James Hague) Date: Fri, 25 Aug 2006 08:24:11 -0500 Subject: Lisp-Python vs. Erlang (was MLvtA, was Meta) In-Reply-To: <44EE5B07.30605@duomark.com> References: <44EE5B07.30605@duomark.com> Message-ID: On 8/24/06, Jay Nelson wrote: > > I think it reads clearer than lisp or python for the following reasons: > > 1) Prolog-like patterns map to the problem domain as a grammar function > rather than the artificial list/hash map structure. Also the compiler > can optimize it more easily so clarity plus speed. > > 3) The use of tuples and lists differentiates intent better. These two are huge, IMO. As much as I appreciate the power of Lisp and Scheme, once I started using a language with pattern matching I lost my taste for Lisp. The programs in Norvig's _Paradigm's of AI Programming_, which are some of the most interesting and powerful programs in any textbook, are quite unaesthetic, as least to my eye. Maybe Larry Wall said it best: "I think in particular of Lisp, which is the most beautiful language in the world, and every program in lisp is real ugly." James From sean.hinde@REDACTED Fri Aug 25 15:31:17 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 25 Aug 2006 14:31:17 +0100 Subject: Lisp-Python vs. Erlang (was MLvtA, was Meta) In-Reply-To: References: Message-ID: The "join with sort every time" was simply a convenient and simple way to move past that point and into the meat of the problem. Here is a test function: test() -> State = [son_at_home, car_needs_battery, have_money, have_phone_book], Goals = [son_at_school], Ops = [#op{action = drive_son_to_school, preconds = [son_at_home, car_works], add_list = [son_at_school], del_list = [son_at_home]}, #op{action = shop_installs_battery, preconds = [car_needs_battery, shop_knows_problem, shop_has_money], add_list = [car_works]}, #op{action = tell_shop_problem, preconds = [in_communication_with_shop], add_list = [shop_knows_problem]}, #op{action = telephone_shop, preconds = [know_phone_number], add_list = [in_communication_with_shop]}, #op{action = look_up_number, preconds = [have_phone_book], add_list = [know_phone_number]}, #op{action = give_shop_money, preconds = [have_money], add_list = [shop_has_money], del_list = [have_money]} ], gps(State, Goals, Ops). One small challenge could be to make a version using lists:filter/2 instead of the deprecated lists:filter/3 Sean On 25 Aug 2006, at 13:22, Ulf Wiger ((TN/EAB)) wrote: > > Not having though it through much, wouldn't > ordsets be a better starting point than > unordered lists? > > Ordsets are defined as being ordered lists, so it > should be perfectly ok to use the odd lists library > function on them. > > BR, > Ulf W > >> -----Original Message----- >> From: owner-erlang-questions@REDACTED >> [mailto:owner-erlang-questions@REDACTED] On Behalf Of Sean Hinde >> Sent: den 25 augusti 2006 12:28 >> To: Jay Nelson >> Cc: erlang-questions@REDACTED >> Subject: Re: Lisp-Python vs. Erlang (was MLvtA, was Meta) >> >> This is fun! >> >> Here is my Erlang translation of the GPS from Norvig, >> following the lisp code as closely as possible. >> >> I found it quite kludgy to write in erlang. I ended up using >> a deprecated function from lists.erl, and there were some >> features of lisp like named parameters and extension >> parameters that seemed quite nice - although perhaps not so >> much until Luke forcefully pointed out the benefits :-) >> >> Heavy higher order function programming certainly seems less >> elegant in Erlang than lisp or any of the modern statically >> typed functional languages. >> >> Sean >> >> -module(gps). >> >> -export([gps/3]). >> >> -record(op, >> { >> action, >> preconds = [], >> add_list = [], >> del_list = [] >> }). >> >> gps(State, Goals, Ops) -> >> put(state, State), >> put(ops, Ops), >> lists:all(fun achieve/1, Goals). >> >> achieve(Goal) -> >> State = get(state), >> Ops = get(ops), >> lists:member(Goal, State) orelse >> lists:any(fun apply_op/1, find_all(Goal, Ops, fun >> appropriate_p/2)). >> >> appropriate_p(Op, Goal) -> >> lists:member(Goal, Op#op.add_list). >> >> apply_op(Op) -> >> case lists:all(fun achieve/1, Op#op.preconds) of >> true -> >> io:format("Executing ~p~n",[Op#op.action]), >> put(state, get(state) -- Op#op.del_list), >> put(state, merge(get(state), Op#op.add_list)), >> true; >> false -> >> false >> end. >> >> merge(L1, L2) -> >> lists:merge(lists:sort(L1), lists:sort(L2)). >> >> find_all(Goal, Ops, Pred) -> >> lists:filter(Pred, [Goal], Ops). >> >> >> >> On 25 Aug 2006, at 03:05, Jay Nelson wrote: >> >>> James Hague wrote: >>> >>>> But C# and Java aren't worth worrying about, IMO. The interesting >>>> stuff is happening in the scripting language world, >> especially with >>>> Python and Ruby. Those languages are a lot closer to Lisp (see >>>> http://www.norvig.com/python-lisp.html). >>> >>> >>> Here's my conversion of the Lisp / Python example Norvig gave: >>> >>> ------------------------------------------------- >>> >>> -module(norvig). >>> >>> -export([generate/1, generate_tree/1]). >>> >>> % Constructions... >>> grammar(s) -> [np, vp]; >>> grammar(np) -> [art, n]; >>> grammar(vp) -> [v, np]; >>> >>> % Elements... >>> grammar(art) -> {"the", "a"}; >>> grammar(n) -> {"man", "ball", "woman", "table"}; >>> grammar(v) -> {"hit", "took", "saw", "liked"}; >>> >>> % Unknown. >>> grammar(_) -> none. >>> >>> >>> >>> generate(Phrase) when is_atom(Phrase) -> >>> case grammar(Phrase) of >>> none -> >>> [Phrase]; >>> Words when is_tuple(Words) -> >>> ChoiceNum = random:uniform(size(Words)), >>> element(ChoiceNum, Words); >>> Construct -> >>> generate(Construct) >>> end; >>> >>> generate(Phrase) -> >>> [generate(Word) || Word <- Phrase]. >>> >>> >>> >>> generate_tree(Phrase) when is_atom(Phrase) -> >>> case grammar(Phrase) of >>> none -> >>> [Phrase]; >>> Words when is_tuple(Words) -> >>> ChoiceNum = random:uniform(size(Words)), >>> {Phrase, element(ChoiceNum, Words)}; >>> Construct -> >>> [Phrase, generate_tree(Construct)] >>> end; >>> >>> generate_tree(Phrase) -> >>> [generate_tree(Word) || Word <- Phrase]. >>> >>> --------------------------------------------------- >>> >>> >>> I deliberately left it similar to his so that people >> unfamiliar with >>> lisp can see the correspondence, but I don't like the repetition of >>> the generate functions. I would prefer to use a vlad-macro or an >>> annotate function to collapse the 2nd and 3rd branches of the case >>> statement so that there is a single generate function in >> source code >>> with two variants. >>> >>> [This is an example of when a real macro is more readable than a >>> support function, because the two branches are different in >> different >>> ways, so the annotate function would have to have two branches or >>> there would have to be two annotate functions, whereas a >> single macro >>> could handle both cases. As an exercise to the reader, try writing >>> the annotate approach and you'll see the slight awkwardness.] >>> >>> >>> I think it reads clearer than lisp or python for the following >>> reasons: >>> >>> 1) Prolog-like patterns map to the problem domain as a grammar >>> function >>> rather than the artificial list/hash map structure. Also the >>> compiler >>> can optimize it more easily so clarity plus speed. >>> >>> 2) The list comprehension is just a succinct joy. >>> >>> 3) The use of tuples and lists differentiates intent better. >>> >>> 4) I prefer the case ... of ... end style over (cond ( ) ...) now. >>> Syntactically there is not much difference but erlang >>> suggests using similar (and more readable) patterns >>> in each branch of the case. >>> >>> >>> If I had a month or two to burn I would go through the exercise of >>> porting Norvig's AI code to erlang. There's no reason why >> it wouldn't >>> all work -- and possibly discover some new parallel >> approaches in the >>> process. I think erlang is a perfectly suited to many >> problems that >>> lisp was. >>> >>> >>> jay >> >> From erlangX@REDACTED Fri Aug 25 15:40:17 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Fri, 25 Aug 2006 06:40:17 -0700 Subject: Blogging away In-Reply-To: <200608251710.30525.rlenglet@users.forge.objectweb.org> References: <20060824162127.GB5756@delora.autosys.us> <200608251710.30525.rlenglet@users.forge.objectweb.org> Message-ID: <20060825134017.GG5756@delora.autosys.us> Thank you everyone who responded. I have sent in bug report for BottomFeeder. ~M On Fri, Aug 25, 2006 at 05:10:30PM +0900, Romain Lenglet wrote: > OK in KDE's Akregator, too. > > Dmitrii Dimandt wrote: > > Works ok in JetBrains Omea RSS Reader > > > > On 8/24/06, Michael McDaniel wrote: > > > Using BottomFeeder > > > (http://www.cincomsmalltalk.com/BottomFeeder/) on Linux, I > > > get ... > > > > > > "Unable to process feed or query - > > > http://planeterlang.org/rss20.xml" AND > > > "Unable to process feed or query - > > > http://planeterlang.org/rss10.xml" > > > > > > I have successfully been using BottomFeeder for a few years. > > > > > > > > > QUESTIONS: > > > > > > Is anyone else having problems with planeterlang RSS feed > > > (what reader) ? Is anyone else having success with > > > planeterlang RSS feed (what reader) ? Am I using the wrong > > > URL (what should I use) ? > > > Any other suggestions ? > > > > > > > > > thanks, > > > > > > ~Michael > > > > > > On Wed, Aug 23, 2006 at 11:27:12AM +0200, Torbjorn Tornkvist > wrote: > > > > S.J.Thompson wrote: > > > > > Joe - that's great; thanks. Would you be able to make an > > > > > RSS feed available? That makes it easier to read via an > > > > > RSS readers? > > > > > > > > You'll find that at Planet erlang. > > > > > > > > > > > > --Tobbe > > > > > > > > > Kind regards, > > > > > > > > > > Simon > > > > > > > > > > On Wed, 23 Aug 2006, Joe Armstrong (TN/EAB) wrote: > > > > >> Yariv's blog http://yarivsblog.com/ with his frequent > > > > >> Erlang > > > > > > postings > > > > > > > >> has inspired me. > > > > >> > > > > >> I think he needs a little competition :-) > > > > >> > > > > >> So I've started writing ... > > > > >> > > > > >> In this blog I'll try to tell you some of the things > > > > >> that are > > > > > > happening > > > > > > > >> in the Erlang world. A lot of stuff is happening behind > > > > >> the scenes, > > > > > > I'll > > > > > > > >> try > > > > >> to tell you about some of this. > > > > >> > > > > >> The first post is: > > > > > > http://armstrongonsoftware.blogspot.com/2006/08/making-money > > >-from-erlang > > > > > > > >> .html > > > > >> > > > > >> Cheers > > > > >> > > > > >> /Joe > > > > > > -- > > > Michael McDaniel > > > Portland, Oregon, USA > > > http://autosys.us > > > +1 503 283 5284 > > -- > Romain LENGLET -- Michael McDaniel Portland, Oregon, USA http://autosys.us +1 503 283 5284 From tobbe@REDACTED Fri Aug 25 15:55:19 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Fri, 25 Aug 2006 15:55:19 +0200 Subject: xmlrpc in erlang In-Reply-To: <200608251318.40141.pupeno@pupeno.com> References: <200608251318.40141.pupeno@pupeno.com> Message-ID: Pupeno wrote: > Hello, > What library do you recommend for doing XMLRPC in Erlang ? Client and server ? > I have found two: > - One inside jungerl. > - And one in http://erlang.stacken.kth.se/user.html#xmlrpc-1.13 > Are there any others ? Any hints about which one to take ? > What I don't like of the first one is that it comes bundled with lots of > things I am not interested in and the second one seems just a tarbal thrown > there with no particular repository to refer to. > Thanks. The jungerl one is the one to use. It is excellent, and heavily used in production! --Tobbe From serge@REDACTED Fri Aug 25 16:53:41 2006 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 25 Aug 2006 10:53:41 -0400 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: <200608250219.k7P2JmdB267595@atlas.otago.ac.nz> References: <200608250219.k7P2JmdB267595@atlas.otago.ac.nz> Message-ID: <44EF0EF5.30304@hq.idt.net> Richard A. O'Keefe wrote: > Serge Aleynikov wrote: > "What if you were to write a system that was OS-agnostic, would easily > scale to 100,000s of processes, would run on a cluster of machines, > would offer nine nines of uptime, and would have to be built in a week? > ... Sounds impossible with Smalltalk? ... Add Erlang to your arsenal > and see for yourself!" > > Actually, no, it DOESN'T sound impossible with Smalltalk. [...] Every language certainly has merits, otherwise why would it be designed in the first place? An important distinction of Erlang aside from built-in concurrency support is that its OTP framework allows to build systems/products rather than collections of stand-along applications. What do I mean by that? Recovery from faults, health monitoring, centralized error reporting, SNMP support with ease of agent extensibility, release handling with automatic system upgrades, application and release versioning, systemic use of design patterns or templates that allow development teams to use the same coding style, and preserve structure of applications therefore simplifying support of derived products. Can you do this in other languages? Certainly, if you tackle these problems individually! Yet /IMHO/ the designers of most languages only take it to the point of providing developers with a compiler, a VM (if required by the language), debugging tools, perhaps some IDE, some basic libraries, and leave it up to the developer to use this in order to develop products. So the next step that happens is that many developers use these tools to put together some useful components in a non-systemic manner. This makes it expensive for companies to use such a language and libraries for building products, because they have to incur the cost of assembling pieces together, ensure there exists adequate support for each 3rd party component, and deal with coding style and other differences. All of this makes products expensive to develop and maintain. Frankly, if Erlang didn't come with the OTP, I don't think we would use it in our work. > Nine nines of uptime? That's 3 MILLISECONDS of downtime in a year, no? (86400 s/day * 365 days) * 10^-9 =~= 0.032 s > Sorry, for something built in a week I just don't believe it. I believe > it a little bit more for Erlang than I do for Smalltalk, just like I have > a little bit more belief in mermaids than in vampires. If we are using the same terms, availability is: MTBF A = ----------- MTBF + MTTR Where: MTBF - Mean time between failure MTTR - Mean time to repair Combined availability of N parallel components would be: Ac = 1 - (1 - Ai)^N Let's assume that we have a distributed redundant system composed of three server nodes running on separate hosts. Using the formula above, each node must provide 0.999 of uptime, or roughly 9 hours of downtime per year. I also don't believe in mermaids and vampires, but having deployed such systems built with Erlang/OTP in a production telecom network, these numbers don't sound unreasonable. Well, I should've probably noted something about hardware abstraction. Building reliable systems that rely on unreliable networks is quite a big challenge on its own, and Erlang/OTP doesn't help in this area without additional effort needed to solidify the network architecture, and implement algorithms that deal with detection and recovery from network partitioning. However, given a reliable network putting together a proof-of-concept simple redundant application with the traits above within a week is certainly not a unreasonable task for a developer with a good knowledge of the OTP and building distributed applications. > It is *never* a good idea to insult your audience. [...] > If you tell a Smalltalk audience that they can't develop distributed > concurrent systems in Smalltalk they will write you down as an arrogant > idiot who knows nothing about Smalltalk, and won't hear anything else you > say no matter how good it is. Granted that for the word 'impossible' may sound offensive to someone, the "Sounds impossible with Smalltalk?" sentence can be taken out safely, shortening the 10s phrase, while still preserving the urge to explore Erlang. ;-) Regards, Serge From garry@REDACTED Fri Aug 25 17:07:30 2006 From: garry@REDACTED (Garry Hodgson) Date: Fri, 25 Aug 2006 11:07:30 -0400 (EDT) Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: References: Message-ID: <2006082511071156518450@k2.sage.att.com> "Joe Armstrong (TN/EAB)" wrote: > I'd like you to send me your course suggestions, in both the 5 and 10 > second category. Today's software requires concurrency, from multicore processors to massively parallel distributed systems. Concurrency is hard, but most languages make it harder than it needs to be. Erlang makes it easy. clocks in around 9 seconds. ---- Garry Hodgson, Senior Software Geek, AT&T CSO Can't you hear my lambs a callin'? Oh good shepherd won't you feed my sheep? From Martin.Logan@REDACTED Fri Aug 25 18:35:37 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Fri, 25 Aug 2006 11:35:37 -0500 Subject: Format for our tutorials In-Reply-To: <44EC3BC2.6060609@hq.idt.net> Message-ID: <9CB79C836F98504C81BF082C4291E987792B23@CHITDSEXC02.tds.corp.cendant.org> It would also be nice to display the author information in all HowTo tutorials imported to http://wiki.trapexit.org/index.php/Category:HowTo from the old trapexit.org site. This information is embedded in the XML files, but not currently displayed in the HTML pages. -------------------------------------- I had the same thought. We need to give credit where credit is due and it should be part of the documentation format. The folks at trap exit agree as well. It seems that most people do not want their tutorials rewritten by other people. I understand that. I think that people would probably be likely to submit their tutorials to a formal review and edtiting process but averse to an informal "anyone can edit my work for any reason" sort of thing. So, since we don't have a formal process and such a thing seems unrealistic currently it looks like we will have to rely on people taking the time to format and submit their own tutorials to the main repository (trap exit?), where they will be posted with the authors name in large bold blinking font at the top :-) As far as format is concerned it looks like the trap exit format is the most popular, and I for one think that trap exit ought to be the main repository for all of these tutorials for a couple of reasons; 1. they are stable and funded i.e they are not going away. 2. They are popular and accepted within our community. I have communicated with the folks at trap exit are more than happy to be the host for all of our tutorials. They have also agreed to allow mirroring of the tutorials portion of the site. Does anyone have a problem with trap exit being the main site for all erlang tutorials with anyone wanting to mirror being free to do so? Cheers, Martin From jarober@REDACTED Fri Aug 25 17:20:10 2006 From: jarober@REDACTED (James Robertson) Date: Fri, 25 Aug 2006 15:20:10 +0000 (UTC) Subject: Blogging away References: <20060824162127.GB5756@delora.autosys.us> <200608251710.30525.rlenglet@users.forge.objectweb.org> <20060825134017.GG5756@delora.autosys.us> Message-ID: Michael McDaniel autosys.us> writes: > > Thank you everyone who responded. I have sent in bug report for > BottomFeeder. > There's a bug fix posted in the dev stream updates now. From nm@REDACTED Fri Aug 25 19:28:11 2006 From: nm@REDACTED (Gaspar Chilingarov) Date: Fri, 25 Aug 2006 22:28:11 +0500 Subject: xmlrpc in erlang In-Reply-To: <200608251318.40141.pupeno@pupeno.com> References: <200608251318.40141.pupeno@pupeno.com> Message-ID: <44EF332B.2070802@web.am> Pupeno wrote: > Hello, > What library do you recommend for doing XMLRPC in Erlang ? Client and server ? > I have found two: > - One inside jungerl. > - And one in http://erlang.stacken.kth.se/user.html#xmlrpc-1.13 > Are there any others ? Any hints about which one to take ? > What I don't like of the first one is that it comes bundled with lots of > things I am not interested in and the second one seems just a tarbal thrown > there with no particular repository to refer to. > Thanks. You can also look on using yaws with xmlrpc - yaws_xmlrpc handler - which allows you dispatch xmlrpc calls using yaws and it's excellent features. -- Gaspar Chilingarov System Administrator, Network security consulting t +37493 419763 (mob) i 63174784 e nm@REDACTED From joelr1@REDACTED Fri Aug 25 21:38:57 2006 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 25 Aug 2006 20:38:57 +0100 Subject: Finally: Mac Intel patches In-Reply-To: <230465c00608251230k37ac5e0cv67a72ad5d9a5cd43@mail.gmail.com> References: <200608242213.k7OMDttw006935@harpo.it.uu.se> <16B6273B-73D7-4DA5-864D-FF3967ADEE01@gmail.com> <230465c00608251230k37ac5e0cv67a72ad5d9a5cd43@mail.gmail.com> Message-ID: <279FC12D-7EE5-4374-B767-CDF9AC002BE6@gmail.com> On Aug 25, 2006, at 8:30 PM, lang er wrote: > and at the end there'are many warnings about Unknown functions: > > Dialyzer will now build auxiliary information needed for subsequent > analyses... > A PLT for following libs will be built: > [compiler,gs,hipe,kernel,mnesia,stdlib,syntax_tools] [...] > Proceeding with analysis... done (passed successfully) > make[2]: Nothing to be done for `opt'. > === Leaving application dialyzer I usually ignore the dialyzer warnings. > Of course, all tests failed: Did you do make install after dialyzer finished? Did you run tests with ./testsuite.sh /opt/local ? -- http://wagerlabs.com/ From erlangist@REDACTED Fri Aug 25 21:59:01 2006 From: erlangist@REDACTED (lang er) Date: Sat, 26 Aug 2006 03:59:01 +0800 Subject: Finally: Mac Intel patches In-Reply-To: <279FC12D-7EE5-4374-B767-CDF9AC002BE6@gmail.com> References: <200608242213.k7OMDttw006935@harpo.it.uu.se> <16B6273B-73D7-4DA5-864D-FF3967ADEE01@gmail.com> <230465c00608251230k37ac5e0cv67a72ad5d9a5cd43@mail.gmail.com> <279FC12D-7EE5-4374-B767-CDF9AC002BE6@gmail.com> Message-ID: <230465c00608251259m1ac773e5q4884474b4a643194@mail.gmail.com> make install [...] : which erl /opt/local/bin/erl [...] : erl -smp Erlang (BEAM) emulator version 5.5 [source] [smp:2] [async-threads:0] Eshell V5.5 (abort with ^G) 1> ======================================================================== no hipe hint. and ./testsuite.sh /opt/local ======================================================================== There was an old /tmp/hipe_test_res.... removing There was an old /tmp/hipe_test_log.... removing Testing /opt/local Compiler options: [o2] The log will be left in /tmp/hipe_test_log ERL_COMPILER_OPTIONS=[nowarn_shadow_vars] Recompile: test *** In trivial_tests: trivial_01_new@REDACTED and trivial_01_old differ!!! *** In trivial_tests: trivial_02_new@REDACTED and trivial_02_old differ!!! *** In trivial_tests: trivial_03_new@REDACTED and trivial_03_old differ!!! *** In trivial_tests: trivial_04_new@REDACTED and trivial_04_old differ!!! *** In trivial_tests: trivial_05_new@REDACTED and trivial_05_old differ!!! in log file 1> EXITED with reason {executing_on_an_unsupported_architecture,undefined} @hipe:1419 *** In trivial_tests: trivial_01_new@REDACTED and trivial_01_old differ!!! < {{{emu_result,true},{native_result,true}},{{emu_compile,{ok,trivial_01}},{native_compile,{'EXIT',{{hipe,1419,{executing_on_an_unsupported_architecture,undefined}},[{hipe,o1_opts,0},{hipe,opt_expansions,0},{hipe,expand_options,1},{hipe,pre_init,1},{hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} 1> EXITED with reason {executing_on_an_unsupported_architecture,undefined} @hipe:1419 *** In trivial_tests: trivial_02_new@REDACTED and trivial_02_old differ!!! < {{{emu_result,42},{native_result,42}},{{emu_compile,{ok,trivial_02}},{native_compile,{'EXIT',{{hipe,1419,{executing_on_an_unsupported_architecture,undefined}},[{hipe,o1_opts,0},{hipe,opt_expansions,0},{hipe,expand_options,1},{hipe,pre_init,1},{hipe,'-run_compiler_1/3-fun-0-',4}]}}}}} 1> EXITED with reason {executing_on_an_unsupported_architecture,undefined} @hipe:1419 *** In trivial_tests: trivial_03_new@REDACTED and trivial_03_old differ!!! ------------------------------------------------------------------------------------------------ ./testsuite.sh --only compiler_tests /opt/local ------------------------------------------------------------------------------------------------ in log file: compiler_tests/esmb differ!!! compiler_tests/wings differ!!! < {{result,{'EXIT',{undef,[{hipe_bifs,constants_size,[]}, compiler_tests/hc differ!!! < {{result,{'EXIT',{undef,[{hipe_bifs,constants_size,[]}, BR! james 2006/8/26, Joel Reymont : > > On Aug 25, 2006, at 8:30 PM, lang er wrote: > > > and at the end there'are many warnings about Unknown functions: > > > > Dialyzer will now build auxiliary information needed for subsequent > > analyses... > > A PLT for following libs will be built: > > [compiler,gs,hipe,kernel,mnesia,stdlib,syntax_tools] > [...] > > Proceeding with analysis... done (passed successfully) > > make[2]: Nothing to be done for `opt'. > > === Leaving application dialyzer > > I usually ignore the dialyzer warnings. > > > Of course, all tests failed: > > Did you do make install after dialyzer finished? > > Did you run tests with ./testsuite.sh /opt/local ? > > -- > http://wagerlabs.com/ > > > > > > From joelr1@REDACTED Fri Aug 25 22:33:56 2006 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 25 Aug 2006 21:33:56 +0100 Subject: Finally: Mac Intel patches In-Reply-To: <230465c00608251259m1ac773e5q4884474b4a643194@mail.gmail.com> References: <200608242213.k7OMDttw006935@harpo.it.uu.se> <16B6273B-73D7-4DA5-864D-FF3967ADEE01@gmail.com> <230465c00608251230k37ac5e0cv67a72ad5d9a5cd43@mail.gmail.com> <279FC12D-7EE5-4374-B767-CDF9AC002BE6@gmail.com> <230465c00608251259m1ac773e5q4884474b4a643194@mail.gmail.com> Message-ID: <9B643AA8-CBED-4407-9251-CC98E3793891@gmail.com> You are not building HiPE. Use --enable-hipe, possibly with the SMP support flag. I'm not sure if smp support is detected automatically and enabled. Anyone knows? -- http://wagerlabs.com From erlangist@REDACTED Fri Aug 25 22:40:11 2006 From: erlangist@REDACTED (lang er) Date: Sat, 26 Aug 2006 04:40:11 +0800 Subject: Finally: Mac Intel patches In-Reply-To: <9B643AA8-CBED-4407-9251-CC98E3793891@gmail.com> References: <200608242213.k7OMDttw006935@harpo.it.uu.se> <16B6273B-73D7-4DA5-864D-FF3967ADEE01@gmail.com> <230465c00608251230k37ac5e0cv67a72ad5d9a5cd43@mail.gmail.com> <279FC12D-7EE5-4374-B767-CDF9AC002BE6@gmail.com> <230465c00608251259m1ac773e5q4884474b4a643194@mail.gmail.com> <9B643AA8-CBED-4407-9251-CC98E3793891@gmail.com> Message-ID: <230465c00608251340w10045d65q18ee9bbd6f1a9fdb@mail.gmail.com> I will rebuid , but in readme: --enable-smp-support See the next section. --disable-smp-support See the next section. readme: --disable-hipe Disable HiPE (High-Performance Erlang). HiPE will automatically be enabled on supported platforms. It says HiPE will automatically be enabled on supported platforms. and below: For platforms that are known by us to support the SMP emulator, the SMP emulator will be built automatically. Use "erl -smp" to start it. See the release notes for a list of the platforms. To force building of an SMP emulator, use "./configure --enable-smp-support". For more details about this, see the release notes. BR! James 2006/8/26, Joel Reymont : > You are not building HiPE. Use --enable-hipe, possibly with the SMP > support flag. > > I'm not sure if smp support is detected automatically and enabled. > Anyone knows? > > -- > http://wagerlabs.com > From erlangist@REDACTED Fri Aug 25 22:45:48 2006 From: erlangist@REDACTED (lang er) Date: Sat, 26 Aug 2006 04:45:48 +0800 Subject: Finally: Mac Intel patches In-Reply-To: <230465c00608251340w10045d65q18ee9bbd6f1a9fdb@mail.gmail.com> References: <200608242213.k7OMDttw006935@harpo.it.uu.se> <16B6273B-73D7-4DA5-864D-FF3967ADEE01@gmail.com> <230465c00608251230k37ac5e0cv67a72ad5d9a5cd43@mail.gmail.com> <279FC12D-7EE5-4374-B767-CDF9AC002BE6@gmail.com> <230465c00608251259m1ac773e5q4884474b4a643194@mail.gmail.com> <9B643AA8-CBED-4407-9251-CC98E3793891@gmail.com> <230465c00608251340w10045d65q18ee9bbd6f1a9fdb@mail.gmail.com> Message-ID: <230465c00608251345k3609fec3x7ace4844d2c295ca@mail.gmail.com> configure/readme should be corrected. 2006/8/26, lang er : > I will rebuid , but in readme: > > --enable-smp-support See the next section. > > --disable-smp-support See the next section. > > readme: > --disable-hipe Disable HiPE (High-Performance Erlang). > HiPE will automatically be enabled on > supported platforms. > It says HiPE will automatically be enabled on supported platforms. > > > and below: > > > For platforms that are known by us to support the SMP emulator, the > SMP emulator will be built automatically. Use "erl -smp" to start it. > See the release notes for a list of the platforms. > > To force building of an SMP emulator, use "./configure --enable-smp-support". > For more details about this, see the release notes. > > > BR! > James > 2006/8/26, Joel Reymont : > > You are not building HiPE. Use --enable-hipe, possibly with the SMP > > support flag. > > > > I'm not sure if smp support is detected automatically and enabled. > > Anyone knows? > > > > -- > > http://wagerlabs.com > > > From erlangist@REDACTED Fri Aug 25 23:36:46 2006 From: erlangist@REDACTED (lang er) Date: Sat, 26 Aug 2006 05:36:46 +0800 Subject: Finally: Mac Intel patches In-Reply-To: <230465c00608251345k3609fec3x7ace4844d2c295ca@mail.gmail.com> References: <200608242213.k7OMDttw006935@harpo.it.uu.se> <16B6273B-73D7-4DA5-864D-FF3967ADEE01@gmail.com> <230465c00608251230k37ac5e0cv67a72ad5d9a5cd43@mail.gmail.com> <279FC12D-7EE5-4374-B767-CDF9AC002BE6@gmail.com> <230465c00608251259m1ac773e5q4884474b4a643194@mail.gmail.com> <9B643AA8-CBED-4407-9251-CC98E3793891@gmail.com> <230465c00608251340w10045d65q18ee9bbd6f1a9fdb@mail.gmail.com> <230465c00608251345k3609fec3x7ace4844d2c295ca@mail.gmail.com> Message-ID: <230465c00608251436s615f9dd0x46031f6078b3bd79@mail.gmail.com> Now It works, Thank you very much! ------------------------------------------------------------------------------------------------------------------------ erl -smp Erlang (BEAM) emulator version 5.5 [source] [smp:2] [async-threads:0] [hipe] ------------------------------------------------------------------------------------------------------------------------ ======================================================================== ./testsuite.sh /opt/local ======================================================================== There was an old /tmp/hipe_test_log... removing Testing /opt/local Compiler options: [o2] The log will be left in /tmp/hipe_test_log ERL_COMPILER_OPTIONS=[nowarn_shadow_vars] Recompile: test PASSED HiPE testsuite for: /opt/local ======================================================================== ./testsuite.sh --only compiler_tests /opt/local ======================================================================== There was an old /tmp/hipe_test_log.... removing Testing /opt/local Compiler options: [o2] * Only running: compiler_tests The log will be left in /tmp/hipe_test_log ERL_COMPILER_OPTIONS=[nowarn_shadow_vars] Recompile: test PASSED HiPE testsuite for: /opt/local From jefcrane@REDACTED Sat Aug 26 00:31:25 2006 From: jefcrane@REDACTED (Jeff Crane) Date: Fri, 25 Aug 2006 15:31:25 -0700 (PDT) Subject: How to implement multiple sockets per client? Message-ID: <20060825223125.19554.qmail@web31613.mail.mud.yahoo.com> I want to have a client connect to my barebones server on 2 sockets. How are you supposed to ensure that a second connection is from the same client? Is there a way to spawn 2 sockets from an accept? Do I have to listen then initiate to do this correctly? The 2 sockets would be one for reading (input messages from client) and one for sending (output messages to client). __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From mikpe@REDACTED Sat Aug 26 02:27:40 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Sat, 26 Aug 2006 02:27:40 +0200 (MEST) Subject: Finally: Mac Intel patches Message-ID: <200608260027.k7Q0Rexb007341@harpo.it.uu.se> On Fri, 25 Aug 2006 09:18:20 +0100, Joel Reymont wrote: >It works now! Good. The final set of Darwin/x86 patches have been committed to the HiPE/OTP source repository, and they are likely to be included in the upcoming R11B-1 release. From pupeno@REDACTED Sat Aug 26 02:50:24 2006 From: pupeno@REDACTED (Pupeno) Date: Sat, 26 Aug 2006 00:50:24 +0000 Subject: How to implement multiple sockets per client? In-Reply-To: <20060825223125.19554.qmail@web31613.mail.mud.yahoo.com> References: <20060825223125.19554.qmail@web31613.mail.mud.yahoo.com> Message-ID: <200608260050.24381.pupeno@pupeno.com> On Friday 25 August 2006 22:31, Jeff Crane wrote: > I want to have a client connect to my barebones server > on 2 sockets. How are you supposed to ensure that a > second connection is from the same client? You can check for the IP. > Is there a way to spawn 2 sockets from an accept? Now, you listen and accept incoming connections. On accept launch a new thread and you can accept as many connections (creating as many sockets) as you want. You'll have to limit it to two of course. I'd code this as two gen_servers, one the launcher, listening for incoming connections and keeping track of who connected and how many times and then another to handle the connection itself (hint: there's a function to reassign the ownership of the socket to a new process). > Do I have to listen then initiate to do this > correctly? Have you coded a simple server first ? I'd recommend to star there. > The 2 sockets would be one for reading (input messages > from client) and one for sending (output messages to client). You can do reading and witting on the same socket, on the same connection. It has been that way for what ? 20 years ? 30 years ? -- Pupeno (http://pupeno.com) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From david.nospam.hopwood@REDACTED Sat Aug 26 05:10:54 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Sat, 26 Aug 2006 04:10:54 +0100 Subject: Learn Erlang in 5 seconds - competition - win a prize In-Reply-To: <2006082511071156518450@k2.sage.att.com> References: <2006082511071156518450@k2.sage.att.com> Message-ID: <44EFBBBE.1010206@blueyonder.co.uk> Garry Hodgson wrote: > "Joe Armstrong (TN/EAB)" wrote: > >> I'd like you to send me your course suggestions, in both the 5 and 10 >>second category. "Anything that can be said in less than 10 seconds (including this), is an oversimplification." Sorry to be the one to pour the cold water, Joe, but I think this 5 or 10-second sound-bite thing is a bad idea. > Today's software requires concurrency, from multicore processors > to massively parallel distributed systems. Concurrency is hard, > but most languages make it harder than it needs to be. > Erlang makes it easy. Plenty of today's software does not require concurrency (at the programming language level). The second sentence is fine, but it doesn't say anything about Erlang. Erlang does not make concurrency *easy*. Programming in general is not easy -- even quite trivial programs often have errors. It is not clear that making concurrency easy is a primary goal, regardless of its possibility. "Reliable but difficult" would trump "unreliable and easy". (I could have made similar kinds of criticisms of most any of the suggestions so far.) ---- Programmers are pedantic, skeptical people -- or else they wouldn't be good programmers. They/we have a tendency to pick apart anything that is said, often concentrating on the bits that are wrong, or wrong in some situations. Therefore, don't oversimplify when speaking to programmers. It is possible to do more damage to Erlang's reputation in 10 seconds than it is possible to do good. You may argue that the rest of the talk would be spent explaining the sound-bite(s) -- but why put so much emphasis on something that may cause a bad impression, then potentially have to spend considerable effort fixing that impression? When explaining technical concepts to an audience most of whom are unfamiliar with them, IMHO a slower, incremental approach is preferable. This does not mean that short, pithy "slogans" cannot be effective, as mnemonics for an argument. A slogan does not attempt to accurately convey the argument by itself -- it only has to be sufficient to stand for the argument *for someone who already understands it*, acting as a reinforcement to their memory. Here are two examples: "In the future we shall know more." (Lee Smolin on quantum gravity) "Well-typed programs do not go wrong." (Robin Milner on type theory) In each case, you wouldn't attempt to explain the associated argument to an unfamiliar audience by first stating the slogan. First make the argument, including any caveats, and *then* associate it with the slogan. -- David Hopwood From david.nospam.hopwood@REDACTED Sat Aug 26 05:23:07 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Sat, 26 Aug 2006 04:23:07 +0100 Subject: How to implement multiple sockets per client? In-Reply-To: <200608260050.24381.pupeno@pupeno.com> References: <20060825223125.19554.qmail@web31613.mail.mud.yahoo.com> <200608260050.24381.pupeno@pupeno.com> Message-ID: <44EFBE9B.8070303@blueyonder.co.uk> Pupeno wrote: > On Friday 25 August 2006 22:31, Jeff Crane wrote: > >>I want to have a client connect to my barebones server >>on 2 sockets. How are you supposed to ensure that a >>second connection is from the same client? > > You can check for the IP. I think what was meant is a logical client. For example, it should be possible to distinguish two logical connections (two pairs of TCP/IP connections) from the same IP. This is necessary to handle clients connecting from behind a NAT, at least. If this is the requirement, have the client include the same random cookie in both TCP connections, or, have one connection refer to the client IP *and* port of the other. -- David Hopwood From jefcrane@REDACTED Sat Aug 26 05:31:40 2006 From: jefcrane@REDACTED (Jeff Crane) Date: Fri, 25 Aug 2006 20:31:40 -0700 (PDT) Subject: How to implement multiple sockets per client? In-Reply-To: <200608260050.24381.pupeno@pupeno.com> Message-ID: <20060826033140.35255.qmail@web31604.mail.mud.yahoo.com> I have a simple single connection server, no problem. I would think that there would be quite an advantage to dual sockets beyond the restriction of protocols. More efficient reading/writing over time, failover in the case of a socket collapse due to unexpected IO behavior in development. I'm not sure how the timeline of which languages had a library that provided a bidirectional non-blocking network socket applies. Just because there exists a paradigm, it doesnt naturally follow that it's been implemented in erlang by default. The question is how one might do dual (input/output) sockets in in erlang per client. The answer seems to be, use 1 socket (and verify the client via protocol...IP is unreliable) or clone the socket on accept. My traffic IN to my server is > 1/1000 my traffic OUT...and my traffic OUT is lots of data as fast as possible (machine state updates). Is there such a thing as a pure input/output socket in erlang? I was under the impression that "receive" was basically a select() so I figured dual socket was the way to go. --- Pupeno wrote: > On Friday 25 August 2006 22:31, Jeff Crane wrote: > > I want to have a client connect to my barebones > server > > on 2 sockets. How are you supposed to ensure that > a > > second connection is from the same client? > > You can check for the IP. > > > Is there a way to spawn 2 sockets from an accept? > > Now, you listen and accept incoming connections. On > accept launch a new thread > and you can accept as many connections (creating as > many sockets) as you > want. You'll have to limit it to two of course. I'd > code this as two > gen_servers, one the launcher, listening for > incoming connections and keeping > track of who connected and how many times and then > another to handle the > connection itself (hint: there's a function to > reassign the ownership of the > socket to a new process). > > > Do I have to listen then initiate to do this > > correctly? > > Have you coded a simple server first ? I'd recommend > to star there. > > > The 2 sockets would be one for reading (input > messages > > from client) and one for sending (output messages > to client). > > You can do reading and witting on the same socket, > on the same connection. It > has been that way for what ? 20 years ? 30 years ? > > -- > Pupeno (http://pupeno.com) > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From tty@REDACTED Sat Aug 26 06:01:36 2006 From: tty@REDACTED (tty@REDACTED) Date: Sat, 26 Aug 2006 00:01:36 -0400 Subject: How to implement multiple sockets per client? Message-ID: -------- Original Message -------- From: Jeff Crane Apparently from: owner-erlang-questions@REDACTED To: erlang-questions@REDACTED Subject: How to implement multiple sockets per client? Date: Fri, 25 Aug 2006 15:31:25 -0700 (PDT) > Is there a way to spawn 2 sockets from an accept? > Do I have to listen then initiate to do this > correctly? You basically do the accept. This gives you 1 socket. Then in the next line you initiate a gen_tcp:connect back to your client. This gives you your 2nd socket. In effect you make your client a server as well. Usually after the accept you wait for your client to send some data, typically the client port for a callback. Oracle does something similar. However as Pupeno indicated a single socket can be use for bi-directional data. To be honest I'm not even sure how to set a socket for only uni-directional data (in Erlang). Furthur more if you insist on doing this, sit down and have a good chat with your network admin first. The client port callback mechanism complicates firewall rules or more correctly open way more ports then needed. Its one reason we dislike allowing open access to Oracle. t From tty@REDACTED Sat Aug 26 06:31:24 2006 From: tty@REDACTED (tty@REDACTED) Date: Sat, 26 Aug 2006 00:31:24 -0400 Subject: How to implement multiple sockets per client? Message-ID: Hmm....to address your question of socket failover you can rely on the OS, in particular Unix/Linux/BSD and its Stream Control Transmission Protocol (SCTP). See http://www.sctp.org/. This might also address your large outbound traffic needs. t -------- Original Message -------- From: Jeff Crane Apparently from: owner-erlang-questions@REDACTED To: erlang-questions@REDACTED Subject: Re: How to implement multiple sockets per client? Date: Fri, 25 Aug 2006 20:31:40 -0700 (PDT) > I have a simple single connection server, no problem. > > I would think that there would be quite an advantage > to dual sockets beyond the restriction of protocols. > More efficient reading/writing over time, failover in > the case of a socket collapse due to unexpected IO > behavior in development. > > I'm not sure how the timeline of which languages had a > library that provided a bidirectional non-blocking > network socket applies. Just because there exists a > paradigm, it doesnt naturally follow that it's been > implemented in erlang by default. The question is how > one might do dual (input/output) sockets in in erlang > per client. The answer seems to be, use 1 socket (and > verify the client via protocol...IP is unreliable) or > clone the socket on accept. > > My traffic IN to my server is > 1/1000 my traffic > OUT...and my traffic OUT is lots of data as fast as > possible (machine state updates). Is there such a > thing as a pure input/output socket in erlang? I was > under the impression that "receive" was basically a > select() so I figured dual socket was the way to go. > > --- Pupeno wrote: > > > On Friday 25 August 2006 22:31, Jeff Crane wrote: > > > I want to have a client connect to my barebones > > server > > > on 2 sockets. How are you supposed to ensure that > > a > > > second connection is from the same client? > > > > You can check for the IP. > > > > > Is there a way to spawn 2 sockets from an accept? > > > > Now, you listen and accept incoming connections. On > > accept launch a new thread > > and you can accept as many connections (creating as > > many sockets) as you > > want. You'll have to limit it to two of course. I'd > > code this as two > > gen_servers, one the launcher, listening for > > incoming connections and keeping > > track of who connected and how many times and then > > another to handle the > > connection itself (hint: there's a function to > > reassign the ownership of the > > socket to a new process). > > > > > Do I have to listen then initiate to do this > > > correctly? > > > > Have you coded a simple server first ? I'd recommend > > to star there. > > > > > The 2 sockets would be one for reading (input > > messages > > > from client) and one for sending (output messages > > to client). > > > > You can do reading and witting on the same socket, > > on the same connection. It > > has been that way for what ? 20 years ? 30 years ? > > > > -- > > Pupeno (http://pupeno.com) > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com From rlenglet@REDACTED Sat Aug 26 13:24:34 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Sat, 26 Aug 2006 20:24:34 +0900 Subject: Format for our tutorials In-Reply-To: <9CB79C836F98504C81BF082C4291E987792B23@CHITDSEXC02.tds.corp.cendant.org> References: <9CB79C836F98504C81BF082C4291E987792B23@CHITDSEXC02.tds.corp.cendant.org> Message-ID: <200608262024.34657.rlenglet@users.forge.objectweb.org> Logan, Martin wrote: > It would also be nice to display the author information in all > HowTo tutorials imported to > http://wiki.trapexit.org/index.php/Category:HowTo from the old > trapexit.org site. This information is embedded in the XML > files, but not currently displayed in the HTML pages. In addition, don't forget to make the license information clear. If the author(s) publish something under a specific license (GPL, EPL, BSD, etc.), this license information must be made explicit. By the way, I remark that almost NO code snippet on TrapExit is published under a Free Software license. As a consequence, almost NO code from this web site is practically reusable. I have notably found lacking a license: - all code in the "User Contributions" section, except Ulf Wiger's "ct_expand" transformation module, - Joe Armstrong's "Example Erlang Programs". Please, authors, distribute your code and documentation under a Free Software license, and make it explicit. Otherwise, reusing such code is a copyright violation, wether the author desires it or not. If you don't desire that, choose a license and make it explicit, for every piece of code. Thanks! -- Romain LENGLET From thomas.raes@REDACTED Sat Aug 26 17:08:03 2006 From: thomas.raes@REDACTED (Thomas Raes) Date: Sat, 26 Aug 2006 17:08:03 +0200 Subject: reference comparision Message-ID: <44F063D3.6010903@pandora.be> Hello, Does comparing references create network traffic to the nodes where the references were created? If so, has anybody an idea how this can be avoided in order to reduce communication overhead between nodes? Best regards, Thomas From joelr1@REDACTED Sat Aug 26 17:29:02 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 26 Aug 2006 16:29:02 +0100 Subject: erl_interface and buffer overruns Message-ID: <1706524C-EF6E-49BA-8C9A-79739D3A0711@gmail.com> I'm looking at the example in http://www.erlang.se/doc/doc-5.4/doc/ tutorial/cnode_s.c BUFSIZE is arbitrarily set to 1000. Doesn't this make the code prone to buffer overruns? How do you avoid them in this case? Thanks, Joel -- http://wagerlabs.com/ From bob@REDACTED Sat Aug 26 19:10:02 2006 From: bob@REDACTED (Bob Ippolito) Date: Sat, 26 Aug 2006 10:10:02 -0700 Subject: How to implement multiple sockets per client? In-Reply-To: <20060826033140.35255.qmail@web31604.mail.mud.yahoo.com> References: <200608260050.24381.pupeno@pupeno.com> <20060826033140.35255.qmail@web31604.mail.mud.yahoo.com> Message-ID: <6a36e7290608261010n744ccdcbm37af4adb4da88290@mail.gmail.com> On 8/25/06, Jeff Crane wrote: > I have a simple single connection server, no problem. > > I would think that there would be quite an advantage > to dual sockets beyond the restriction of protocols. > More efficient reading/writing over time, failover in > the case of a socket collapse due to unexpected IO > behavior in development. Why do you think using two TCP sockets between the same two machines is going to be more efficient or help with failover? That doesn't really make any sense. -bob From taj.khattra@REDACTED Sat Aug 26 19:10:16 2006 From: taj.khattra@REDACTED (Taj Khattra) Date: Sat, 26 Aug 2006 10:10:16 -0700 Subject: erl_interface and buffer overruns In-Reply-To: <1706524C-EF6E-49BA-8C9A-79739D3A0711@gmail.com> References: <1706524C-EF6E-49BA-8C9A-79739D3A0711@gmail.com> Message-ID: <57a21f730608261010m5b713375m83920bee33711866@mail.gmail.com> On 8/26/06, Joel Reymont wrote: > BUFSIZE is arbitrarily set to 1000. Doesn't this make the code prone > to buffer overruns? nope. see http://www.erlang.se/doc/doc-5.5/lib/erl_interface-3.5.5/doc/html/erl_connect.html#erl_receive_msg/4 if the buffer is too small, erl_receive_msg returns ERL_ERROR and sets erl_errno to EMSGSIZE From bob@REDACTED Sat Aug 26 19:19:28 2006 From: bob@REDACTED (Bob Ippolito) Date: Sat, 26 Aug 2006 10:19:28 -0700 Subject: erl_interface and buffer overruns In-Reply-To: <1706524C-EF6E-49BA-8C9A-79739D3A0711@gmail.com> References: <1706524C-EF6E-49BA-8C9A-79739D3A0711@gmail.com> Message-ID: <6a36e7290608261019i211741ebx4b1a2e43f5dac1a8@mail.gmail.com> On 8/26/06, Joel Reymont wrote: > I'm looking at the example in http://www.erlang.se/doc/doc-5.4/doc/ > tutorial/cnode_s.c > > BUFSIZE is arbitrarily set to 1000. Doesn't this make the code prone > to buffer overruns? > > How do you avoid them in this case? Looks like erl_errno will be set to EMSGSIZE error if the buffer is too small to contain the message. It doesn't say if you can retry or not, but I imagine the right thing to do is increase the bufsize and try again. -bob From david.nospam.hopwood@REDACTED Sat Aug 26 19:20:44 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Sat, 26 Aug 2006 18:20:44 +0100 Subject: How to implement multiple sockets per client? In-Reply-To: References: Message-ID: <44F082EC.2070002@blueyonder.co.uk> tty@REDACTED wrote: > -------- Original Message -------- > From: Jeff Crane > Apparently from: owner-erlang-questions@REDACTED > To: erlang-questions@REDACTED > Subject: How to implement multiple sockets per client? > Date: Fri, 25 Aug 2006 15:31:25 -0700 (PDT) > >>Is there a way to spawn 2 sockets from an accept? >>Do I have to listen then initiate to do this >>correctly? > > You basically do the accept. This gives you 1 socket. Then in > the next line you initiate a gen_tcp:connect back to your client. > This gives you your 2nd socket. In effect you make your client a > server as well. This interacts quite badly with firewalls, which will usually block the reverse connection. You did mention this, but I think you understated the problem -- remember that "personal" firewalls on each machine also need to be considered, and no single network admin has control over these, even if the protocol were only to be used in a single network. -- David Hopwood From james.hague@REDACTED Sat Aug 26 19:43:53 2006 From: james.hague@REDACTED (James Hague) Date: Sat, 26 Aug 2006 12:43:53 -0500 Subject: suggested library additions: lists:revmap/2, lists:revmap/3 Message-ID: Like map, but returns a list in reverse order. An optional third parameter is appened to the end of the returned list: revmap(F, L) -> revmap(F, L, []). revmap(F, [H|T], Acc) -> revmap(F, T, [F(H)|Acc]); revmap(_, [], Acc) -> Acc. I've found this useful in my code, and I was surprised that it's not in the standard library. From joelr1@REDACTED Sat Aug 26 20:02:42 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 26 Aug 2006 19:02:42 +0100 Subject: erl_interface and buffer overruns In-Reply-To: <57a21f730608261010m5b713375m83920bee33711866@mail.gmail.com> References: <1706524C-EF6E-49BA-8C9A-79739D3A0711@gmail.com> <57a21f730608261010m5b713375m83920bee33711866@mail.gmail.com> Message-ID: <7B49A791-CF3E-4A97-8755-64ABE7BCA466@gmail.com> On Aug 26, 2006, at 6:10 PM, Taj Khattra wrote: > if the buffer is too small, erl_receive_msg returns ERL_ERROR and sets > erl_errno to EMSGSIZE What is not clear is whether you can retry receiving the message if the buffer is too small or the message is lost on error. Any idea? -- http://wagerlabs.com/ From joelr1@REDACTED Sat Aug 26 23:02:52 2006 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 26 Aug 2006 22:02:52 +0100 Subject: Cocoa Bindings Message-ID: <44456132-EB2A-41DA-8D2B-1913BABB956D@gmail.com> The more I think about the idea of Cocoa Bindings for Erlang the more it does not make sense to me. I got my Cocoa app to connect to the Erlang VM and recognize when data is available to be read. This is very simple, actually. The main issue is all the heavy-duty marshalling that needs to be done for every Cocoa/ObjC call. Not only do you need to extract data from Erlang terms but also build NSInvocation objects to execute the call and allocate memory to grab the results. With other languages you can just pass pointers around but, obviously, you cannot do this over sockets. Then there's the matter of executing calls like [[[NSFileHandle alloc] initWithFileDescriptor:fd closeOnDealloc:YES] autorelease] where you need to compose a bunch of functions and run each on the results of the previous one. Yes, you can send something like this to the C node [{'NSFileHandle', alloc}, ['initWithFileDescriptor:', Fd, {'closeOnDealloc', 'YES'}]] but I wonder what is the point? The GUI can be built with much ease in XCode and only domain-specific and optimized messages can be sent between the Cocoa node and the Erlang. This gets one the best of both worlds, in my opinion. What do you think? Thanks, Joel -- http://wagerlabs.com/ From pupeno@REDACTED Sun Aug 27 00:07:32 2006 From: pupeno@REDACTED (Pupeno) Date: Sat, 26 Aug 2006 22:07:32 +0000 Subject: [ANN][Article] Erlang, the language for network programming - Issue 1: pattern matching Message-ID: <200608262207.35396.pupeno@pupeno.com> Hello, I have started writing a series of articles in which I show why Erlang is good for network programming. I have published the first one "Erlang, the language for network programming - Issue 1: pattern matching" which is about pattern matching (the articles are targeted at non-erlangers, non-functional-programmers). The URL is: http://pupeno.com/blog-en/erlang-the-language-for-network-programming-issue-1-pattern-matching/ Enjoy! -- Pupeno (http://pupeno.com) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From pupeno@REDACTED Sun Aug 27 00:38:07 2006 From: pupeno@REDACTED (Pupeno) Date: Sat, 26 Aug 2006 22:38:07 +0000 Subject: [ANN][Article] Erlang, the language for network programming - Issue 1: pattern matching In-Reply-To: <200608262207.35396.pupeno@pupeno.com> References: <200608262207.35396.pupeno@pupeno.com> Message-ID: <200608262238.08114.pupeno@pupeno.com> By the way, if someone wants to vote it: reddit: http://programming.reddit.com/goto?id=f797 digg: http://digg.com/programming/Erlang_the_language_for_network_programming_Issue_1_pattern_matching Thanks. On Saturday 26 August 2006 22:07, Pupeno wrote: > Hello, > I have started writing a series of articles in which I show why Erlang is > good for network programming. I have published the first one "Erlang, the > language for network programming - Issue 1: pattern matching" which is > about pattern matching (the articles are targeted at non-erlangers, > non-functional-programmers). > The URL is: > http://pupeno.com/blog-en/erlang-the-language-for-network-programming-issue >-1-pattern-matching/ Enjoy! -- Pupeno (http://pupeno.com) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From jacobopolavieja@REDACTED Sun Aug 27 01:33:02 2006 From: jacobopolavieja@REDACTED (Jacobo G. Polavieja) Date: Sun, 27 Aug 2006 01:33:02 +0200 Subject: [ANN][Article] Erlang, the language for network programming - Issue 1: pattern matching In-Reply-To: <200608262207.35396.pupeno@pupeno.com> References: <200608262207.35396.pupeno@pupeno.com> Message-ID: <44F0DA2E.3040000@gmail.com> Pupeno wrote: > Hello, > I have started writing a series of articles in which I show why Erlang is good > for network programming. I have published the first one "Erlang, the language > for network programming - Issue 1: pattern matching" which is about pattern > matching (the articles are targeted at non-erlangers, > non-functional-programmers). > The URL is: > http://pupeno.com/blog-en/erlang-the-language-for-network-programming-issue-1-pattern-matching/ > Enjoy! I've just read it and, as a non Erlang (just yet! till I finish my exams!), I have to say... THANKS. Pretty clarifying article for newcomers like me. I haven't started learning Erlang, but at least this so detailed explanations makes one feel anxious to know more about it. I'll be following if you continue writing. I haven't vote the article though, just because I don't have an account in none of the sites. Also, have you thought on adding your blog to planet erlang? Thanks for the effort, and good luck with future articles. Cheers! P.D: Also pleased to know there's some Spanish coder round here :). From jacobopolavieja@REDACTED Sun Aug 27 01:38:35 2006 From: jacobopolavieja@REDACTED (Jacobo G. Polavieja) Date: Sun, 27 Aug 2006 01:38:35 +0200 Subject: [ANN][Article] Erlang, the language for network programming - Issue 1: pattern matching In-Reply-To: <200608262207.35396.pupeno@pupeno.com> References: <200608262207.35396.pupeno@pupeno.com> Message-ID: <44F0DB7B.1070904@gmail.com> Sorry, just saw you're Argentinian, so we'll leave it as "pleased to have a Spanish speaking coder round here" :). Again, thanks for the article. Keep on! From taj.khattra@REDACTED Sun Aug 27 01:51:24 2006 From: taj.khattra@REDACTED (Taj Khattra) Date: Sat, 26 Aug 2006 16:51:24 -0700 Subject: erl_interface and buffer overruns In-Reply-To: <7B49A791-CF3E-4A97-8755-64ABE7BCA466@gmail.com> References: <1706524C-EF6E-49BA-8C9A-79739D3A0711@gmail.com> <57a21f730608261010m5b713375m83920bee33711866@mail.gmail.com> <7B49A791-CF3E-4A97-8755-64ABE7BCA466@gmail.com> Message-ID: <57a21f730608261651o3ad2ef8as6cfb775bc9e845de@mail.gmail.com> On 8/26/06, Joel Reymont wrote: > What is not clear is whether you can retry receiving the message if > the buffer is too small or the message is lost on error. Any idea? hmm... from reading the code i don't think erl_receive_msg() can return EMSGSIZE since it passes in a resizable ei_x_buff to the lower level ei_do_recv_msg() function. if the user supplied buffer is too small, it will only contain a truncated copy of the received data, but the ErlMessage parameter will contain the complete decoded message. erl_xreceive_msg() will grow the user supplied buffer if necessary, in addition to decoding it. in any case, i think erl_interface was deprecated a few releases ago? you probably want to use ei_receive_msg() or ei_xreceive_msg(). the former returns EMSGSIZE if the buffer is too small and discards the message; the latter grows the buffer if necessary. http://www.erlang.se/doc/doc-5.5/lib/erl_interface-3.5.5/doc/html/ei_connect.html#ei_receive_msg/3 From vladdu55@REDACTED Sun Aug 27 14:58:33 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Sun, 27 Aug 2006 13:58:33 +0100 Subject: Cocoa Bindings In-Reply-To: <44456132-EB2A-41DA-8D2B-1913BABB956D@gmail.com> References: <44456132-EB2A-41DA-8D2B-1913BABB956D@gmail.com> Message-ID: <95be1d3b0608270558h7bb64f83hb0b7a1f34a57b8b4@mail.gmail.com> On 8/26/06, Joel Reymont wrote: > The GUI can be built with much ease > in XCode and only domain-specific and optimized messages can be sent > between the Cocoa node and the Erlang. This gets one the best of both > worlds, in my opinion. MHO is that this is the best way to build a specific application's GUI. It is when trying to implement a framework when the tricky parts begin to make themselves felt. Let the Erlang part be just the "business layer" and keep the interface clean. best regards, Vlad From goertzen@REDACTED Sun Aug 27 15:48:48 2006 From: goertzen@REDACTED (Daniel Goertzen) Date: Sun, 27 Aug 2006 08:48:48 -0500 Subject: Cocoa Bindings In-Reply-To: <44456132-EB2A-41DA-8D2B-1913BABB956D@gmail.com> References: <44456132-EB2A-41DA-8D2B-1913BABB956D@gmail.com> Message-ID: <44F1A2C0.4090303@ertw.com> I recently came to same conclusion while exploring qt4 bindings for erlang. Sure, I could make bindings to cover much of the simple stuff, but the corner cases got out of control very quickly. What was I really trying to accomplish? Gui programming with qt4 in c++ is actually pretty slick, so why fight it. Cheers, Dan. Joel Reymont wrote: > The more I think about the idea of Cocoa Bindings for Erlang the more > it does not make sense to me. I got my Cocoa app to connect to the > Erlang VM and recognize when data is available to be read. This is > very simple, actually. > > The main issue is all the heavy-duty marshalling that needs to be done > for every Cocoa/ObjC call. Not only do you need to extract data from > Erlang terms but also build NSInvocation objects to execute the call > and allocate memory to grab the results. > > With other languages you can just pass pointers around but, obviously, > you cannot do this over sockets. Then there's the matter of executing > calls like > > [[[NSFileHandle alloc] initWithFileDescriptor:fd closeOnDealloc:YES] > autorelease] > > where you need to compose a bunch of functions and run each on the > results of the previous one. Yes, you can send something like this to > the C node > > [{'NSFileHandle', alloc}, ['initWithFileDescriptor:', Fd, > {'closeOnDealloc', 'YES'}]] > > but I wonder what is the point? The GUI can be built with much ease in > XCode and only domain-specific and optimized messages can be sent > between the Cocoa node and the Erlang. This gets one the best of both > worlds, in my opinion. > > What do you think? > > Thanks, Joel > > -- > http://wagerlabs.com/ > > > > > > From vladdu55@REDACTED Sun Aug 27 16:43:13 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Sun, 27 Aug 2006 15:43:13 +0100 Subject: Cocoa Bindings In-Reply-To: <44456132-EB2A-41DA-8D2B-1913BABB956D@gmail.com> References: <44456132-EB2A-41DA-8D2B-1913BABB956D@gmail.com> Message-ID: <95be1d3b0608270743t5c2fee21h99bdd95637d71943@mail.gmail.com> Oh, and an important observation regarding this is that if the GUI is a different layer, then in the future you could reimplement it as a "full Erlang gui" when that will be available or as a "Yaws on rails" (or whatever its name) app! regards, Vlad From lennart.ohman@REDACTED Sun Aug 27 17:07:19 2006 From: lennart.ohman@REDACTED (Lennart Ohman) Date: Sun, 27 Aug 2006 17:07:19 +0200 Subject: reference comparision In-Reply-To: <44F063D3.6010903@pandora.be> Message-ID: <000601c6c9ea$7e13e0c0$0200a8c0@st.se> Hi, the answer is no. Pids, references and alike has a local unique component and a "node-pointer". The "node-pointer" tells a node (having received for instance a reference from another node) on which node this reference really exists. So any node can compare two references and instantly conclude if they are equal or not. I do however not know how greater or less comparisons will work out. That is if the order will be done on node name (meaning that two references will always be sorted the same way regardless on which node the comparison is made), or if comparison will be made on the "node-pointer" which may very well be a numerically different number on two different nodes (having received the references from a third node). One can on the other hand discus the relevance of doing > and < comparisons on a reference... Best Regards, Lennart ------------------------------------------------------------- Lennart Ohman office : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 67 35 Sehlstedtsgatan 6 fax : +46-8-667 82 30 SE-115 28, STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > -----Original Message----- > From: owner-erlang-questions@REDACTED [mailto:owner-erlang- > questions@REDACTED] On Behalf Of Thomas Raes > Sent: Saturday, August 26, 2006 5:08 PM > To: erlang-questions@REDACTED > Subject: reference comparision > > Hello, > > Does comparing references create network traffic to the nodes where the > references were created? > If so, has anybody an idea how this can be avoided in order to reduce > communication overhead between nodes? > > Best regards, > > Thomas From jacobopolavieja@REDACTED Sun Aug 27 17:32:18 2006 From: jacobopolavieja@REDACTED (Jacobo G. Polavieja) Date: Sun, 27 Aug 2006 17:32:18 +0200 Subject: Erlang downsides? Message-ID: <44F1BB02.3080101@gmail.com> Hi all! As a future (as soon as possible) Erlang starter, I've been reading a lot on Erlang's benefits: concurrency, fault tolerant, hot code swapping, distribution, highly-available, and even fun (isn't it Yariv ;)). What I'm interested now is in knowing those areas where Erlang is weaker than other languages, cases where other languages are better/more efficient/more suitable tan Erlang. I'd like to separate these into two categories: 1. Where Erlang is not "naturally suited" for that For example, I've read ejabberd uses C in some parts, not because it was hard or impossible to program that in Erlang, but because C is pretty more powerful than Erlang in such tasks. 2. Where Erlang has no "technical downside" but hasn't been used in that area for whatever reason. A example of this (as I've understood from Yariv's blog) would be web applications. They are mostly written using Ruby On Rails, PHP, ASP, Java... but it seems to be an area where Erlang could fit also very well and even better than the stablished frameworks. Also if anyone is kind enough to address possible solutions of any of the "problems" it will result in a very productive list, I think, to enhance Erlang applications. Any concept, links, doc... is greatly appreciated. Cheers! - Cobo - From jacobopolavieja@REDACTED Sun Aug 27 17:38:50 2006 From: jacobopolavieja@REDACTED (Jacobo G. Polavieja) Date: Sun, 27 Aug 2006 17:38:50 +0200 Subject: [ANN][Article] Erlang, the language for network programming - Issue 1: pattern matching In-Reply-To: <200608270022.16924.pupeno@pupeno.com> References: <200608262207.35396.pupeno@pupeno.com> <44F0DA2E.3040000@gmail.com> <200608270022.16924.pupeno@pupeno.com> Message-ID: <44F1BC8A.9010105@gmail.com> Pupeno wrote: > On Saturday 26 August 2006 23:33, you wrote: >> just yet! till I finish my >> exams! > > BTW, good luck with your exams! and have a nice time learning Erlang. Thanks! I surely need that good luck :). About the IRC channel... It could be a good idea to have one in Spainsh, though I'm afraid we'll be the only two people there. but, who knows, it could very pretty useful in some near future. I don't know if there's an official or not so official Erlang channel. If you want we could create erlang-es on Freenode. I know some people I think could help with that. From jefcrane@REDACTED Sun Aug 27 20:12:20 2006 From: jefcrane@REDACTED (Jeff Crane) Date: Sun, 27 Aug 2006 11:12:20 -0700 (PDT) Subject: Why does Pid = Spawn/3 give a badmatch? Message-ID: <20060827181220.33537.qmail@web31603.mail.mud.yahoo.com> ... userConnPid = spawn(?MODULE, userConnHandler, [Conn]), ... userConnHandler(Conn) -> receive go_ahead -> inet:setopts(Conn, [{active, true}]); _ -> io:format("tcp_server:debug: userConnHandler did not receive go_ahead~n") end, io:format("tcp_server:debug: userConnHandler exited cleanly:~p~n",[self()]). When I get to the spawn/3 I get: ** exited: {{badmatch,<0.144.0>}, [{tcp_server,receive_loop,3}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** =ERROR REPORT==== 27-Aug-2006::11:10:46 === Error in process <0.136.0> with exit value: {{badmatch,<0.144.0>},[{tcp_se rver,receive_loop,3},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} I dont understand what's badmatching __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From taavi@REDACTED Sun Aug 27 20:27:08 2006 From: taavi@REDACTED (Taavi Talvik) Date: Sun, 27 Aug 2006 21:27:08 +0300 Subject: Why does Pid = Spawn/3 give a badmatch? In-Reply-To: <20060827181220.33537.qmail@web31603.mail.mud.yahoo.com> References: <20060827181220.33537.qmail@web31603.mail.mud.yahoo.com> Message-ID: On Aug 27, 2006, at 9:12 PM, Jeff Crane wrote: > ... > userConnPid = spawn(?MODULE, userConnHandler, > [Conn]), > ... userConnPid is atom Variables start with capital letter or _ best regards, taavi From s.devrieze@REDACTED Mon Aug 28 00:03:01 2006 From: s.devrieze@REDACTED (sander) Date: Sun, 27 Aug 2006 23:03:01 +0100 Subject: [ANN][Article] Erlang, the language for network programming References: Message-ID: <20060827220301.889515A1FE@mail.erlangsystems.com> Guest wrote: Pupeno wrote: > On Saturday 26 August 2006 23:33, you wrote: >> just yet! till I finish my >> exams! > > BTW, good luck with your exams! and have a nice time learning Erlang. Thanks! I surely need that good luck :). About the IRC channel... It could be a good idea to have one in Spainsh, though I'm afraid we'll be the only two people there. but, who knows, it could very pretty useful in some near future. I don't know if there's an official or not so official Erlang channel. If you want we could create erlang-es on Freenode. I know some people I think could help with that. Post recived from mailinglist (end of quote) Why an IRC channel? Just use the Multi-User Chat component of an ejabberd deployment and so take advantage of Erlang code 8) And if you really can't drop your obsolete IRC client for a Jabber client with full MUC support (Psi is one of these clients that only supports the old protocol and not the new, more powerfull, but compatible Multi-User Chat protocol), you always can write some module for ejabberd for IRC client support. So that you can connect to ejabberd and the Multi-User Chat channels on it, with any IRC client. :-) _________________________________________________________ Post sent from http://www.trapexit.org From pupeno@REDACTED Mon Aug 28 02:01:54 2006 From: pupeno@REDACTED (Pupeno) Date: Mon, 28 Aug 2006 00:01:54 +0000 Subject: [ANN][Article] Erlang, the language for network programming In-Reply-To: <20060827220301.889515A1FE@mail.erlangsystems.com> References: <20060827220301.889515A1FE@mail.erlangsystems.com> Message-ID: <200608280001.57668.pupeno@pupeno.com> On Sunday 27 August 2006 22:03, sander wrote: > Why an IRC channel? Just use the Multi-User Chat component of an ejabberd > deployment and so take advantage of Erlang code ?8) > > And if you really can't drop your obsolete IRC client for a Jabber client > with full MUC support (Psi is one of these clients that only supports the > old protocol and not the new, more powerfull, but compatible Multi-User > Chat protocol), you always can write some module for ejabberd for IRC > client support. So that you can connect to ejabberd and the Multi-User Chat > channels on it, with any IRC client. I totally agree! Not even for Erlang but for anything else. I proposed an #erlang_es channel to be a counterpart of #erlang. Your proposal could be applied to #erlang itself and I am with it. -- Pupeno (http://pupeno.com) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From ok@REDACTED Mon Aug 28 03:51:52 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 28 Aug 2006 13:51:52 +1200 (NZST) Subject: Learn Erlang in 5 seconds - competition - win a prize Message-ID: <200608280151.k7S1pq74267640@atlas.otago.ac.nz> I think Serge Aleynikov misunderstood where I am coming from. I wrote: > Actually, no, it DOESN'T sound impossible with Smalltalk. I then provided illustrative detail about why it wouldn't even be particularly hard in the modern Smalltalk I know best. Every language certainly has merits, otherwise why would it be designed in the first place? The point is not that Smalltalk has SOME merits, but that a decent modern Smalltalk has many of the RIGHT merits to be not altogether unreasonable for this kind of application. The central weakness in Smalltalk is the absence of any kind of encapsulation between processes. Of course, Smalltalk processes don't *have* to trample on each other's data structures to get work done, it's just that it's extremely difficult to be sure that they don't do this accidentally. Good discipline and tools could help. More importantly, there is no obvious reason why you couldn't have a Smalltalk system where everything was exactly the way it is now EXCEPT that processes DIDN'T have write access to each other's data. (In fact, if I ever get my Smalltalk compiler finished, that's exactly how I intend to do it.) If you took Smalltalk, encapsulated process's data from each other, and added !, you'd have something that would basically BE Erlang with funny syntax minus pattern matching plus mutable private data (and with the process dictionary, Erlang already has a form of mutable private data) plus classes. I suggest that while cheap processes are very nice to have, it's process ENCAPSULATION which matters most for Erlang, because that makes processes easy to THINK about and makes a whole lot of nasty concurrency bugs impossible. Process encapsulation also happens to be the thing that makes Erlang distribution pleasant, because once you can't muck around with another process's data you stop caring so much which machine it keeps those data on. An important distinction of Erlang aside from built-in concurrency support is that its OTP framework allows to build systems/products rather than collections of stand-alone applications. Yes, agreed. But a modern Smalltalk is also more than just a language; a modern Smalltalk *also* has a framework, and thanks to the Web, that framework includes support for TCP/IP, HTTP, FTP, XML, hot loading, &c. To be sure, Squeak doesn't have ASN.1 support, but there was a time when Erlang didn't either, and it wouldn't be particularly hard to add it. As for application and release versioning, it took years and years of arguing and experimentation, but eventually something very like that did go in. The really really fundamental difference between Erlang and (present) Smalltalk is that Erlang processes have idiot-proof encapsulated data and Smalltalk processes don't. > Nine nines of uptime? That's 3 MILLISECONDS of downtime in a year, no? (86400 s/day * 365 days) * 10^-9 =~= 0.032 s Sorry, slipped a decimal point there. 31.6 milliseconds. I wrote vvvvvvvvvvvvvvvvvvvvvvvvvvvvv > Sorry, for something built in a week I just don't believe it. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If we are using the same terms, availability is [snipped because irrelevant] I also don't believe in mermaids and vampires, but having deployed such systems built with Erlang/OTP in a production telecom network, these numbers don't sound unreasonable. I also can easily believe that a system with that level of reliability (assuming, which I'm not altogether happy about assuming, that failures are independent; common causes tend to produce common failures) can be built with Erlang/OTP. What I *can't* swallow is that a nontrivial system can be built to that level of reliability in *any* language in just one week. For a non-trivial system, it's going to take you at least a week just to understand the requirements. It's also going to take a fair while to run adequate tests. However, given a reliable network putting together a proof-of-concept vvvvvvvvvvvvvvvv simple redundant application with the traits above within a week is ^^^^^^^^^^^^^^^^ certainly not a unreasonable task for a developer with a good knowledge of the OTP and building distributed applications. But that isn't the kind of application we were talking about, far from it. Heck, I could put together a proof-of-concept simple redundant application with the traits above in a week using Oz/Mozart (once I've spent the necessary couple of weeks reading the Mozart reference manuals; it's already taken me a week to not quite finish the tutorials). I wouldn't dream of suggesting that that said anything significant about the usefulness of Oz/Mozart for a full-blown system. From james.hague@REDACTED Mon Aug 28 05:37:25 2006 From: james.hague@REDACTED (James Hague) Date: Sun, 27 Aug 2006 22:37:25 -0500 Subject: Erlang downsides? In-Reply-To: <44F1BB02.3080101@gmail.com> References: <44F1BB02.3080101@gmail.com> Message-ID: > 1. Where Erlang is not "naturally suited" for that > For example, I've read ejabberd uses C in some parts, not because it was > hard or impossible to program that in Erlang, but because C is pretty > more powerful than Erlang in such tasks. Weak points in the current Erlang implementation/libraries: * Algorithms that involve destructively updating arrays. You can mimic this with a hash (in the guise of an ets table), but it's not pretty. * Unicode strings. * Regular expression matching (there's a module, but watch Perl beat it by a factor of 100). From erlangist@REDACTED Mon Aug 28 05:52:26 2006 From: erlangist@REDACTED (lang er) Date: Mon, 28 Aug 2006 11:52:26 +0800 Subject: Timer:tc In-Reply-To: <20060824134321.GB3586@wellquite.org> References: <20060824115507.AD6085A1F5@mail.erlangsystems.com> <20060824134321.GB3586@wellquite.org> Message-ID: <230465c00608272052w2ca2189dh557ed95214034e07@mail.gmail.com> So why: Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] Eshell V5.5 (abort with ^G) 1> timer:tc(count_chars,file, ["gc.txt"]). {1173,116} 2> timer:tc(count_chars,file, ["gc.txt"]). {375,116} 3> T1 = erlang:now(), 3> count_chars:file("gc.txt"), 3> T2 = erlang:now(), 3> Time = timer:now_diff(T2, T1). 464 4> count_chars module is one of examples on Erlang.org 2006/8/24, Matthew Sackman : > > On Thu, Aug 24, 2006 at 12:55:07PM +0100, Nebmo wrote: > > What is the difference between: > > > > 1: > > {Time,_} = timer:tc(mod,fun,[arg]), > > > > 2: > > T1 = erlang:now(), > > mod:fun(arg), > > T2 = erlang:now(), > > Time = timer:now_diff(T2, T1), > > locate timer.erl > /usr/lib/erlang/lib/stdlib-1.14/src/timer.erl > ... > tc(M, F, A) -> > Before = erlang:now(), > Val = (catch apply(M, F, A)), > After = erlang:now(), > {now_diff(After, Before), Val}. > > It'll be many times slower because of the apply. > http://www.erlang.org/doc/doc-5.5/doc/efficiency_guide/functions.html > > Matthew > -- > Matthew Sackman > > BOFH excuse #438: > sticky bit has come loose > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.wiger@REDACTED Mon Aug 28 08:53:27 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Mon, 28 Aug 2006 08:53:27 +0200 Subject: reference comparision In-Reply-To: <000601c6c9ea$7e13e0c0$0200a8c0@st.se> Message-ID: Lennart Ohman wrote: > One can on the other hand discus the relevance of doing > and > < comparisons on a reference... If references couldn't be ordered, you couldn't use them as keys in orddicts, for example. And if there weren't a consistent global ordering, you couldn't exchange such orddicts between nodes. That would violate the principle of least astonishment. (: BR, Ulf W From lennart.ohman@REDACTED Mon Aug 28 09:12:21 2006 From: lennart.ohman@REDACTED (Lennart Ohman) Date: Mon, 28 Aug 2006 09:12:21 +0200 Subject: reference comparision In-Reply-To: Message-ID: <000001c6ca71$4e6efe90$0200a8c0@st.se> That is true, did not think of that useage... /Lennart ------------------------------------------------------------- Lennart Ohman office : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 67 35 Sehlstedtsgatan 6 fax : +46-8-667 82 30 SE-115 28, STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > -----Original Message----- > From: Ulf Wiger (TN/EAB) [mailto:ulf.wiger@REDACTED] > Sent: Monday, August 28, 2006 8:53 AM > To: Lennart Ohman; erlang-questions@REDACTED > Subject: RE: reference comparision > > > Lennart Ohman wrote: > > > One can on the other hand discus the relevance of doing > and > > < comparisons on a reference... > > If references couldn't be ordered, you couldn't use them as > keys in orddicts, for example. And if there weren't a > consistent global ordering, you couldn't exchange such orddicts > between nodes. That would violate the principle of least > astonishment. (: > > BR, > Ulf W From nm@REDACTED Mon Aug 28 09:48:27 2006 From: nm@REDACTED (Gaspar Chilingarov) Date: Mon, 28 Aug 2006 12:48:27 +0500 Subject: Yaws HTTPS/SSL connection problems (ssl_server crash) Message-ID: <44F29FCB.9070108@web.am> Hi folks! After putting our system (using Yaws with SSL as backend) to production I've discovered that our client have rather broken winproxy which somehow breaks SSL connections -- when using SSL-enabled site it results in a following message. At the same time connection without proxy from the same computer works seamless. It occurs only when using IE. =ERROR REPORT==== 24-Aug-2006::15:18:49 === ** Generic server ssl_server terminating ** Last message in was {'EXIT',#Port<0.221>,epipe} ** When Server state == {st,#Port<0.221>, 594, false, [{5,<0.140.0>,[]}], [{5,<0.12048.0>,{<0.12048.0>,#Ref<0.0.0.83310>}}, {5,<0.12047.0>,{<0.12047.0>,#Ref<0.0.0.83307>}}, {5,<0.12046.0>,{<0.12046.0>,#Ref<0.0.0.83300>}}, {5,<0.12045.0>,{<0.12045.0>,#Ref<0.0.0.83296>}}, {5,<0.12043.0>,{<0.12043.0>,#Ref<0.0.0.83210>}}], 59674, 4, "OpenSSL 0.9.7e-p1 25 Oct 2004", "OpenSSL 0.9.7e-p1 25 Oct 2004", "DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA:EDH-RSA-DES-CBC3-SHA:EDH-DSS-DES-CBC3- SHA:DES-CBC3-SHA:DES-CBC3-MD5:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:AES128-SHA:RC2-CBC-MD5:DHE-DSS-RC4-SHA:RC4-SHA:RC4-MD5:RC4-MD5:RC4-64-MD5:EXP1024-DHE-DSS-DES-CBC-SHA:EXP1024-DES-CBC-SHA:EXP1024-RC2-CBC-MD5:EDH-RSA-DES-CBC-SHA:EDH-DSS-DES-CBC-SHA:DES-CBC-SHA:DES-CBC-MD5:EXP1024-DHE-DSS-RC4-SHA:EXP1024-RC4-SHA:EXP1024-RC4-MD5:EXP-EDH-RSA-DES-CBC-SHA: EXP-EDH-DSS-DES-CBC-SHA:EXP-DES-CBC-SHA:EXP-RC2-CBC-MD5:EXP-RC2-CBC-MD5:EXP-RC4-MD5:EXP-RC4-MD5"} ** Reason for termination == ** epipe Any thoughts how to fight this - or (at least how to restart ssl_server)? Thanks in advance -- Gaspar Chilingarov System Administrator, Network security consulting t +37493 419763 (mob) i 63174784 e nm@REDACTED From dmitriid@REDACTED Mon Aug 28 09:50:02 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Mon, 28 Aug 2006 10:50:02 +0300 Subject: Erlang for web-developers Message-ID: I couldn't leave a reply to Yariv's postbecause of some error I kept on receiving, so I decided to respond here. I think that besides "erlang-telecom-erlang-telecom" web developers should also be told this: - Mnesia is a nice database for small amounts of data - 4-8 GB, not more :))) (am I correct on this estimate?) - Quite a lot of things can be parallelized in web development. Most notably, logging and post-process actions: -- Once you do an action you can spawn a separate logging process and return to the user immediately -- Once you accept all data (most notably, image files), you can spawn separate processes to do whatever with the data at hand (scale, crop, rotate, move to a different folder etc. etc.) and return to the user immediately Many web developers don't even understand that this, indeed, is possible. I think that in order to sell Erlang to web developers, we need to focus exactly on the things that can be "branched off". Because telecom stuff is interesting, but it also is scary. What else can we lure web developers with? -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew@REDACTED Mon Aug 28 10:05:45 2006 From: matthew@REDACTED (Matthew Sackman) Date: Mon, 28 Aug 2006 09:05:45 +0100 Subject: Timer:tc In-Reply-To: <230465c00608272052w2ca2189dh557ed95214034e07@mail.gmail.com> References: <20060824115507.AD6085A1F5@mail.erlangsystems.com> <20060824134321.GB3586@wellquite.org> <230465c00608272052w2ca2189dh557ed95214034e07@mail.gmail.com> Message-ID: <20060828080545.GI26088@wellquite.org> On Mon, Aug 28, 2006 at 11:52:26AM +0800, lang er wrote: > So why: > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] > > Eshell V5.5 (abort with ^G) > 1> timer:tc(count_chars,file, ["gc.txt"]). > {1173,116} File has to be fetched from harddisc, so will cost time. > 2> timer:tc(count_chars,file, ["gc.txt"]). > {375,116} Now file is cached in RAM by OS so access is much faster. > 3> T1 = erlang:now(), > 3> count_chars:file("gc.txt"), > 3> T2 = erlang:now(), > 3> Time = timer:now_diff(T2, T1). > 464 Oh. Unknown - someone who knows Erlang much better than I will have to answer that. OTOH, 464 isn't much higher than 375 - these are microseconds. My guess is that it's experimental variance - how repeatable are these numbers? Do it 10 times both methods, both orderings and average. For most functions, the cost of the function itself will be much greater than the cost of the function invocation so the expense of the apply in :tc/3 won't feature for any function that does any "real" work(!) Matthew -- Matthew Sackman BOFH excuse #259: Someone's tie is caught in the printer, and if anything else gets printed, he'll be in it too. From mats.cronqvist@REDACTED Mon Aug 28 10:21:30 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 28 Aug 2006 10:21:30 +0200 Subject: Timer:tc In-Reply-To: <20060828080545.GI26088@wellquite.org> References: <20060824115507.AD6085A1F5@mail.erlangsystems.com> <20060824134321.GB3586@wellquite.org> <230465c00608272052w2ca2189dh557ed95214034e07@mail.gmail.com> <20060828080545.GI26088@wellquite.org> Message-ID: <44F2A78A.8040206@ericsson.com> Matthew Sackman wrote: > On Mon, Aug 28, 2006 at 11:52:26AM +0800, lang er wrote: >> So why: >> 2> timer:tc(count_chars,file, ["gc.txt"]). >> {375,116} > > Now file is cached in RAM by OS so access is much faster. > >> 3> T1 = erlang:now(), >> 3> count_chars:file("gc.txt"), >> 3> T2 = erlang:now(), >> 3> Time = timer:now_diff(T2, T1). >> 464 > 2 is compiled, 3 is run in the evaluator. btw, the erlang:apply in timer:tc is insignificant compared to 400 microseconds. mats From ulf.wiger@REDACTED Mon Aug 28 10:36:43 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Mon, 28 Aug 2006 10:36:43 +0200 Subject: Timer:tc In-Reply-To: <20060828080545.GI26088@wellquite.org> Message-ID: I usually write a benchmark loop allowing me to measure over enough iterations to bring the times into at least hundreds of milliseconds or seconds. Then I repeat several times and take the lowest value (least amount of interference). Then (of course), I divide the time by the number of iterations. I also usually repeat the procedure with an empty loop, and calculate the difference. It's reasonable to spawn a new process for each iteration, to make sure that the measurement doesn't start with lots of garbage on the heap. BR, Ulf W > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of > Matthew Sackman > Sent: den 28 augusti 2006 10:06 > To: erlang-questions@REDACTED > Subject: Re: Timer:tc > > On Mon, Aug 28, 2006 at 11:52:26AM +0800, lang er wrote: > > So why: > > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] > > > > Eshell V5.5 (abort with ^G) > > 1> timer:tc(count_chars,file, ["gc.txt"]). > > {1173,116} > > File has to be fetched from harddisc, so will cost time. > > > 2> timer:tc(count_chars,file, ["gc.txt"]). > > {375,116} > > Now file is cached in RAM by OS so access is much faster. > > > 3> T1 = erlang:now(), > > 3> count_chars:file("gc.txt"), > > 3> T2 = erlang:now(), > > 3> Time = timer:now_diff(T2, T1). > > 464 > > Oh. Unknown - someone who knows Erlang much better than I > will have to answer that. OTOH, 464 isn't much higher than > 375 - these are microseconds. My guess is that it's > experimental variance - how repeatable are these numbers? Do > it 10 times both methods, both orderings and average. For > most functions, the cost of the function itself will be much > greater than the cost of the function invocation so the > expense of the apply in :tc/3 won't feature for any function > that does any "real" work(!) > > Matthew > -- > Matthew Sackman > > BOFH excuse #259: > Someone's tie is caught in the printer, and if anything else > gets printed, he'll be in it too. > From juhani@REDACTED Mon Aug 28 11:15:23 2006 From: juhani@REDACTED (Juhani Rankimies) Date: Mon, 28 Aug 2006 02:15:23 -0700 Subject: Erlang for web-developers Message-ID: <20060828021523.3d0f1a0d95efa21718d57d97bd95181c.3a43bd530f.wbe@email.secureserver.net> Is anyone implementing bayeux (http://svn.xantus.org/shortbus/trunk/bayeux/protocol.txt)? Or something similiar? I think web developers would find that quite interesting. I do. > -------- Original Message -------- > Subject: Erlang for web-developers > From: "Dmitrii Dimandt" > Date: Mon, August 28, 2006 10:50 am > To: "Erlang-Questions Mailing List" > > I couldn't leave a reply to Yariv's post because of some error I kept on receiving, so I decided to respond here. > > I think that besides "erlang-telecom-erlang-telecom" web developers should also be told this: > > - Mnesia is a nice database for small amounts of data - 4-8 GB, not more :))) (am I correct on this estimate?) > > - Quite a lot of things can be parallelized in web development. Most notably, logging and post-process actions: > > -- Once you do an action you can spawn a separate logging process and return to the user immediately > -- Once you accept all data (most notably, image files), you can spawn separate processes to do whatever with the data at hand (scale, crop, rotate, move to a different folder etc. etc.) and return to the user immediately > > Many web developers don't even understand that this, indeed, is possible. > > I think that in order to sell Erlang to web developers, we need to focus exactly on the things that can be "branched off". Because telecom stuff is interesting, but it also is scary. What else can we lure web developers with? > From erlangist@REDACTED Mon Aug 28 11:32:48 2006 From: erlangist@REDACTED (lang er) Date: Mon, 28 Aug 2006 17:32:48 +0800 Subject: Timer:tc In-Reply-To: References: <20060828080545.GI26088@wellquite.org> Message-ID: <230465c00608280232v6d723197u47b50efd4c1aac73@mail.gmail.com> 2006/8/28, Ulf Wiger (TN/EAB) : > > > I usually write a benchmark loop allowing me to measure over enough > iterations to bring the times into at least hundreds of milliseconds or > seconds. Then I repeat several times and take the lowest value (least > amount of interference). Then (of course), I divide the time by the > number of iterations. > > I also usually repeat the procedure with an empty loop, and calculate > the difference. > > It's reasonable to spawn a new process for each iteration, to make sure > that the measurement doesn't start with lots of garbage on the heap. > > BR, > Ulf W > > > -----Original Message----- > > From: owner-erlang-questions@REDACTED > > [mailto:owner-erlang-questions@REDACTED] On Behalf Of > > Matthew Sackman > > Sent: den 28 augusti 2006 10:06 > > To: erlang-questions@REDACTED > > Subject: Re: Timer:tc > > > > On Mon, Aug 28, 2006 at 11:52:26AM +0800, lang er wrote: > > > So why: > > > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] > > > > > > Eshell V5.5 (abort with ^G) > > > 1> timer:tc(count_chars,file, ["gc.txt"]). > > > {1173,116} > > > > File has to be fetched from harddisc, so will cost time. > > > > > 2> timer:tc(count_chars,file, ["gc.txt"]). > > > {375,116} > > > > Now file is cached in RAM by OS so access is much faster. > > > > > 3> T1 = erlang:now(), > > > 3> count_chars:file("gc.txt"), > > > 3> T2 = erlang:now(), > > > 3> Time = timer:now_diff(T2, T1). > > > 464 > > > > Oh. Unknown - someone who knows Erlang much better than I > > will have to answer that. OTOH, 464 isn't much higher than > > 375 - these are microseconds. My guess is that it's > > experimental variance - how repeatable are these numbers? Do > > it 10 times both methods, both orderings and average. For > > most functions, the cost of the function itself will be much > > greater than the cost of the function invocation so the > > expense of the apply in :tc/3 won't feature for any function > > that does any "real" work(!) > > > > Matthew > > -- > > Matthew Sackman > > > > BOFH excuse #259: > > Someone's tie is caught in the printer, and if anything else > > gets printed, he'll be in it too. > > > Yes, certainly I should do like this. Are there any facility like ruby's bm? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn@REDACTED Mon Aug 28 11:50:08 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 28 Aug 2006 11:50:08 +0200 Subject: reference comparision In-Reply-To: <000601c6c9ea$7e13e0c0$0200a8c0@st.se> References: <000601c6c9ea$7e13e0c0$0200a8c0@st.se> Message-ID: "Lennart Ohman" writes: > I do however not know how greater or less comparisons will work > out. That is if the order will be done on node name (meaning > that two references will always be sorted the same way regardless > on which node the comparison is made), or if comparison will be > made on the "node-pointer" which may very well be a numerically > different number on two different nodes (having received the > references from a third node). The comparision is made on the node names, not their internal index. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From ConiKost@REDACTED Mon Aug 28 12:27:11 2006 From: ConiKost@REDACTED (Conrad Kostecki) Date: Mon, 28 Aug 2006 12:27:11 +0200 Subject: Can't compile erlang-11.2.0 Message-ID: <000c01c6ca8c$85d72720$0200a8c0@N620c> Hello! I am using Gentoo Linux 2006.0. But I just can't compile erlang 11.2.0. I get this Error: hybrid.beam/i586-pc-linux-gnu/hipe_bif2.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/hipe_debug.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/hipe_gc.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/hipe_mode_switch.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/hipe_native_bif.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/hipe_stack.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/hipe_x86.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/hipe_x86_glue.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/hipe_x86_bifs.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/hipe_x86_signal.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/hipe_x86_stack.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/efile_drv.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/ddll_drv.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/inet_drv.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/zlib_drv.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/ram_file_drv.o /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/ttsl_drv.o -ldl -lm -lncurses -L../lib/internal/i586-pc-linux-gnu /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj/i586-pc-linux-gnu/libz.a -lethread -lpthread -lerts_internal_r /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i586-pc-linux-gnu/hipe_x86_bifs.o: In function `nbif_handle_fp_exception': i586-pc-linux-gnu/hybrid/hipe_x86_bifs.S:(.text+0x7): undefined reference to `erts_restore_fpu' collect2: ld gab 1 als Ende-Status zur?ck make[3]: *** [/var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/bin/i586-pc-linux-gnu/beam.hybrid] Fehler 1 make[3]: Leaving directory `/var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/emulator' make[2]: *** [hybrid] Fehler 2 make[2]: Leaving directory `/var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/emulator' make[1]: *** [hybrid] Fehler 2 make[1]: Leaving directory `/var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts' make: *** [emulator] Fehler 2 !!! ERROR: dev-lang/erlang-11.2.0 failed. Call stack: ebuild.sh, line 1543: Called dyn_compile ebuild.sh, line 938: Called src_compile erlang-11.2.0.ebuild, line 53: Called die !!! (no error message) !!! If you need support, post the topmost build error, and the call stack if relevant. Conrad -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.raes@REDACTED Mon Aug 28 12:18:15 2006 From: thomas.raes@REDACTED (Thomas Raes) Date: Mon, 28 Aug 2006 12:18:15 +0200 Subject: reference comparision In-Reply-To: <000601c6c9ea$7e13e0c0$0200a8c0@st.se> References: <000601c6c9ea$7e13e0c0$0200a8c0@st.se> Message-ID: <44F2C2E7.1020508@pandora.be> Thanks, I used references to represent cluster-wide unique datastructures. The only operation I used them for was checking equality. However, when I used lots of them (> 100 000), the performance decreased. This only happened when I used multiple nodes. The problem disappeared after I changed the references into {node(),now()}-datastructures. It seems that checking references for equality is slower than checking the equality of {node(),now()} -datastructures. I thought that this might be due to network overhead but maybe the problem lies somewhere else. Best regards, Thomas Lennart Ohman wrote: > Hi, the answer is no. > > Pids, references and alike has a local unique component and > a "node-pointer". The "node-pointer" tells a node (having > received for instance a reference from another node) on which node > this reference really exists. So any node can compare two references > and instantly conclude if they are equal or not. > I do however not know how greater or less comparisons will work > out. That is if the order will be done on node name (meaning > that two references will always be sorted the same way regardless > on which node the comparison is made), or if comparison will be > made on the "node-pointer" which may very well be a numerically > different number on two different nodes (having received the > references from a third node). > One can on the other hand discus the relevance of doing > and < > comparisons on a reference... > > Best Regards, > Lennart > > > ------------------------------------------------------------- > Lennart Ohman office : +46-8-587 623 27 > Sjoland & Thyselius Telecom AB cellular: +46-70-552 67 35 > Sehlstedtsgatan 6 fax : +46-8-667 82 30 > SE-115 28, STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > >> -----Original Message----- >> From: owner-erlang-questions@REDACTED [mailto:owner-erlang- >> questions@REDACTED] On Behalf Of Thomas Raes >> Sent: Saturday, August 26, 2006 5:08 PM >> To: erlang-questions@REDACTED >> Subject: reference comparision >> >> Hello, >> >> Does comparing references create network traffic to the nodes where the >> references were created? >> If so, has anybody an idea how this can be avoided in order to reduce >> communication overhead between nodes? >> >> Best regards, >> >> Thomas >> > > > > > > From mikpe@REDACTED Mon Aug 28 12:58:40 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 28 Aug 2006 12:58:40 +0200 (MEST) Subject: Can't compile erlang-11.2.0 Message-ID: <200608281058.k7SAwenP000579@harpo.it.uu.se> On Mon, 28 Aug 2006 12:27:11 +0200, Conrad Kostecki wrote: > Hello! > I am using Gentoo Linux 2006.0. > > But I just can't compile erlang 11.2.0. The number "11.2.0" means nothing in the Erlang world. > I get this Error: > ... > /var/tmp/portage/erlang-11.2.0/work/otp_src_R11B-0/erts/obj.hybrid.beam/i= > 586-pc-linux-gnu/hipe_x86_bifs.o: In function = > `nbif_handle_fp_exception': > i586-pc-linux-gnu/hybrid/hipe_x86_bifs.S:(.text+0x7): undefined = > reference to `erts_restore_fpu' > collect2: ld gab 1 als Ende-Status zur=FCck erts/configure failed to detect working floating-point exceptions on your machine, and without them, HiPE/x86 won't link. You can: a) debug erts/configure (the embedded fpe-test.c program), figure out why it doesn't work, and repair it, or b) ignore the FP problem and ./configure --disable-hipe. Your choice, but clearly a) is preferred. /Mikael From rsaccon@REDACTED Mon Aug 28 13:26:13 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Mon, 28 Aug 2006 08:26:13 -0300 Subject: Erlang for web-developers In-Reply-To: <20060828021523.3d0f1a0d95efa21718d57d97bd95181c.3a43bd530f.wbe@email.secureserver.net> References: <20060828021523.3d0f1a0d95efa21718d57d97bd95181c.3a43bd530f.wbe@email.secureserver.net> Message-ID: yes, me. I am trying to implement flash as preferred transport type (if flashplayer is installed). In that case it will also be possible to stream audio/video in sync with the COMET messages. It's currently part of a web app I am working on, but later I will extract the generic parts and release them as open source. regards -- Roberto Saccon From joe.armstrong@REDACTED Mon Aug 28 14:38:29 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Mon, 28 Aug 2006 14:38:29 +0200 Subject: Smalltalk <-> erlang In-Reply-To: Message-ID: Absolutly. Is it possible to rip out the squeak graphical backend and bolt it onto Erlang? Then reimplement the low-levels of the GUI in Erlang? I had a brief look at Squeak and this looked possible :-) /Joe ________________________________ From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Dietmar.Schaefer@REDACTED Sent: den 25 augusti 2006 08:24 To: erlang-questions@REDACTED Subject: Smalltalk <-> erlang I just got a deja vu ! When I dicovered Smalltalk about 20 years ago I found it the most advanced (oo) programming environment and language. When I discovered erlang about 3 years ago I found it the most advanced fault tolerant (etc.) programming environment and language. My idea was to combine the best of both worlds -> write GUI stuff in Smalltalk ; write the rest (server ) in erlang. Dietmar DFS Deutsche Flugsicherung GmbH Center Langen Am DFS-Campus 1 D - 63225 Langen Tel.: +49-(0)6103-707-0 Internet: http://www.dfs.de Public-Key der DFS: http://www.dfs.de/dfs/public_key.asc -------------- next part -------------- An HTML attachment was scrubbed... URL: From yarivvv@REDACTED Mon Aug 28 14:47:17 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 28 Aug 2006 08:47:17 -0400 Subject: Erlang for web-developers In-Reply-To: References: Message-ID: <17244f480608280547q1e387daas49ff939eba247d28@mail.gmail.com> Hi Dmitri, On 8/28/06, Dmitrii Dimandt wrote: > I couldn't leave a reply to Yariv's post because of some error I kept on > receiving, so I decided to respond here. Thanks for the response. Apparently Rails has reached its scalability limits once my blog has reached a few thousand visitors, and now it experiences intermittent errors that I'm at a loss to fix. Very annoying. Sometimes even sudoing as root and killing all the OS processes that Lighttpd spawns for handling the fastcgi requests and then restarting Lighttpd doesn't help, and the only recourse is to physically reboot the server. I didn't want to write about it in my blog because I didn't want people to think I'm taking cheap shots at Rails, but after my experience with typo, I'd be crazy to use Rails to rather than Yaws to build a real app :) > > I think that besides "erlang-telecom-erlang-telecom" web developers should > also be told this: Yes, there are many things they should be told about Erlang, on many of which I'm far from an expert (hint: I woulnd't mind getting some help ;) ). I try to keep each article relatively short so people can consume Erlang knowledge in bite-sized portions without being overwhelmed. > > - Mnesia is a nice database for small amounts of data - 4-8 GB, not more > :))) (am I correct on this estimate?) I think Mnesia could also be a killer app for a distributed webapp session store. I just haven't used it like that yet. > > - Quite a lot of things can be parallelized in web development. Most > notably, logging and post-process actions: Good point. > > -- Once you do an action you can spawn a separate logging process and return > to the user immediately Somebody has also mentioned on the erlyaws list you can keep a process for each user to get the effect of a continuation, only much more elegantly. I haven't tried it, though. > -- Once you accept all data (most notably, image files), you can spawn > separate processes to do whatever with the data at hand (scale, crop, > rotate, move to a different folder etc. etc.) and return to the user > immediately Again, good point. > > Many web developers don't even understand that this, indeed, is possible. > > I think that in order to sell Erlang to web developers, we need to focus > exactly on the things that can be "branched off". Because telecom stuff is > interesting, but it also is scary. What else can we lure web developers > with? > Thanks for the feedback. You've given me more good answers I can give to people who ask me "Why use Erlang? After all, I don't need to use concurrency in my webapp." Thanks, Yariv From joelr1@REDACTED Mon Aug 28 15:41:27 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 28 Aug 2006 14:41:27 +0100 Subject: Erlang for web-developers In-Reply-To: <17244f480608280547q1e387daas49ff939eba247d28@mail.gmail.com> References: <17244f480608280547q1e387daas49ff939eba247d28@mail.gmail.com> Message-ID: <7BBE861D-CF73-4F6B-856E-B42FBFB71ED7@gmail.com> On Aug 28, 2006, at 1:47 PM, Yariv Sadan wrote: > Thanks for the response. Apparently Rails has reached its scalability > limits once my blog has reached a few thousand visitors, and now it > experiences intermittent errors that I'm at a loss to fix. Very > annoying. Make sure it's not your hosting provider. I get reddit people too from time to time and my blog used to suck when I was with Dreamhost. I moved to Planet Argon and my site is much better now. I do run Typo. Many people are running Typo and getting thousands of hits. Of course they don't try to handle all their load on a single box. -- http://wagerlabs.com/ From yarivvv@REDACTED Mon Aug 28 16:47:38 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 28 Aug 2006 10:47:38 -0400 Subject: multiple patterns per clause? Message-ID: <17244f480608280747r4aaa36f9wcb72b33dd10fc95d@mail.gmail.com> Hi, Is it possible to have a single clause match multiple patterns in Erlang? Specifically, I want to test if a list has a number of different prefixes, all of which would lead to the same expression. This is what I want to write (pseudo code): L = "foo", case L of [$f|_]; [$x|_] ; [$a, $b, $c | _] -> ok; _ -> error end I know the above is illegal, so what's the easiest way of doing something similar in Erlang? Thanks in advance, Yariv From bengt.kleberg@REDACTED Mon Aug 28 17:02:02 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 28 Aug 2006 17:02:02 +0200 Subject: multiple patterns per clause? In-Reply-To: <17244f480608280747r4aaa36f9wcb72b33dd10fc95d@mail.gmail.com> References: <17244f480608280747r4aaa36f9wcb72b33dd10fc95d@mail.gmail.com> Message-ID: <44F3056A.40905@ericsson.com> On 2006-08-28 16:47, Yariv Sadan wrote: > Hi, > > Is it possible to have a single clause match multiple patterns in Erlang? no. use functions for that. > Specifically, I want to test if a list has a number of different > prefixes, all of which would lead to the same expression. which would be: case is_prefix_i_want( L ) of true -> ok; false -> error end is_prefix_i_want([$f|_] ) -> true; is_prefix_i_want([$x|_] ) -> true; is_prefix_i_want([$a, $b, $c|_] ) -> true; is_prefix_i_want( _ ) -> false. this was an attempt to match your (pseudo)code. in this particular case it would have been better to use: prefix_i_want( L ) prefix_i_want([$f|_] ) -> ok; prefix_i_want([$x|_] ) -> ok; prefix_i_want([$a, $b, $c|_] ) -> ok; prefix_i_want(_ ) -> error. but i guess that is not really what you want :-) bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From richardc@REDACTED Mon Aug 28 17:18:37 2006 From: richardc@REDACTED (Richard Carlsson) Date: Mon, 28 Aug 2006 17:18:37 +0200 Subject: multiple patterns per clause? In-Reply-To: <17244f480608280747r4aaa36f9wcb72b33dd10fc95d@mail.gmail.com> References: <17244f480608280747r4aaa36f9wcb72b33dd10fc95d@mail.gmail.com> Message-ID: <44F3094D.3070303@it.uu.se> Yariv Sadan wrote: > Is it possible to have a single clause match multiple patterns in Erlang? Short answer: no. > Specifically, I want to test if a list has a number of different > prefixes, all of which would lead to the same expression. > [...] > I know the above is illegal, so what's the easiest way of doing > something similar in Erlang? case L of [$f|_] -> handle(L); [$x|_] -> handle(L); [$a, $b, $c | _] -> handle(L); _ -> ... end. handle(L) -> ... The calls will basically be goto:s. It's not terribly verbose, and in some cases it can even makes the code more readable. A tip: if you have many variables to pass on, try this: H = fun () -> handle(L, X, Y, Z, P, Q, R, S, T) end, case L of [$f|_] -> H(); [$x|_] -> H(); [$a, $b, $c | _] -> H(); _ -> ... end. /Richard From alex.arnon@REDACTED Mon Aug 28 17:31:48 2006 From: alex.arnon@REDACTED (Alex Arnon) Date: Mon, 28 Aug 2006 18:31:48 +0300 Subject: Erlang for web-developers In-Reply-To: <7BBE861D-CF73-4F6B-856E-B42FBFB71ED7@gmail.com> References: <17244f480608280547q1e387daas49ff939eba247d28@mail.gmail.com> <7BBE861D-CF73-4F6B-856E-B42FBFB71ED7@gmail.com> Message-ID: <944da41d0608280831j3d1db906we0b7d68cd97da678@mail.gmail.com> On 8/28/06, Joel Reymont wrote: > > > On Aug 28, 2006, at 1:47 PM, Yariv Sadan wrote: > > > Thanks for the response. Apparently Rails has reached its scalability > > limits once my blog has reached a few thousand visitors, and now it > > experiences intermittent errors that I'm at a loss to fix. Very > > annoying. > > Make sure it's not your hosting provider. I get reddit people too > from time to time and my blog used to suck when I was with Dreamhost. > I moved to Planet Argon and my site is much better now. I do run Typo. > > Many people are running Typo and getting thousands of hits. Of course > they don't try to handle all their load on a single box. > > -- > http://wagerlabs.com/ I understand that quite a few high-volume sites use Rails - Penny Arcade, for example. So checking the host or configuration would make sense, particularly if you get -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsu79@REDACTED Mon Aug 28 17:39:29 2006 From: chsu79@REDACTED (Christian S) Date: Mon, 28 Aug 2006 17:39:29 +0200 Subject: multiple patterns per clause? In-Reply-To: <44F3056A.40905@ericsson.com> References: <17244f480608280747r4aaa36f9wcb72b33dd10fc95d@mail.gmail.com> <44F3056A.40905@ericsson.com> Message-ID: My take: One way to code it would be to duplicate the code: f("foo" ++ X) -> things, to, do; f("bar" ++ X) -> things, to, do; f("baz" ++ X) -> other_things, to_maybe, do_later; But as code duplication is bad: Instead you refactor out to a function the parts that would be duplicated if you would be insane like the above example. f_things(X) -> things, to, do; f("foo" ++ X) -> f_things(X); f("bar" ++ X) -> f_things(X); f("baz" ++ X) -> other_things, to_maybe, do_later; It has some annoying repetition to type, but hopefully that redundancy makes the code easier to read. > > Specifically, I want to test if a list has a number of different > > prefixes, all of which would lead to the same expression. From david.nospam.hopwood@REDACTED Mon Aug 28 17:50:49 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Mon, 28 Aug 2006 16:50:49 +0100 Subject: multiple patterns per clause? In-Reply-To: <17244f480608280747r4aaa36f9wcb72b33dd10fc95d@mail.gmail.com> References: <17244f480608280747r4aaa36f9wcb72b33dd10fc95d@mail.gmail.com> Message-ID: <44F310D9.3000203@blueyonder.co.uk> Yariv Sadan wrote: > Hi, > > Is it possible to have a single clause match multiple patterns in Erlang? > > Specifically, I want to test if a list has a number of different > prefixes, all of which would lead to the same expression. > > This is what I want to write (pseudo code): > > L = "foo", > case L of > [$f|_]; > [$x|_] ; > [$a, $b, $c | _] -> > ok; > _ -> > error > end What would this construct mean, if the body expression refers to a variable that is bound in some of the alternative patterns but not all of them? -- David Hopwood From wfragg@REDACTED Mon Aug 28 18:14:55 2006 From: wfragg@REDACTED (Ivan Dubrov) Date: Mon, 28 Aug 2006 23:14:55 +0700 Subject: Two questions about xmerl_xpath (variable references) Message-ID: <44F3167F.20900@gmail.com> Hi, Does xmerl_xpath support the variable references? I can parse them (for example xmerl_xpath_parse:parse(xmerl_xpath_scan:tokens("not($x!=\"foo\")")). ), but seems like the matcher does not support them. And the second question, why xmerl_xpath does not export "match" function separately? I think, it could be helpful to parse XPath expression once and apply it several times. -- WBR, Ivan S. Dubrov From ke.han@REDACTED Mon Aug 28 20:15:51 2006 From: ke.han@REDACTED (ke han) Date: Tue, 29 Aug 2006 02:15:51 +0800 Subject: Erlang for web-developers In-Reply-To: <7BBE861D-CF73-4F6B-856E-B42FBFB71ED7@gmail.com> References: <17244f480608280547q1e387daas49ff939eba247d28@mail.gmail.com> <7BBE861D-CF73-4F6B-856E-B42FBFB71ED7@gmail.com> Message-ID: <8662D679-CD9C-489A-9259-7E5C2F94E561@redstarling.com> On Aug 28, 2006, at 9:41 PM, Joel Reymont wrote: > > On Aug 28, 2006, at 1:47 PM, Yariv Sadan wrote: > >> Thanks for the response. Apparently Rails has reached its scalability >> limits once my blog has reached a few thousand visitors, and now it >> experiences intermittent errors that I'm at a loss to fix. Very >> annoying. > > Make sure it's not your hosting provider. I get reddit people too > from time to time and my blog used to suck when I was with > Dreamhost. I moved to Planet Argon and my site is much better now. > I do run Typo. > > Many people are running Typo and getting thousands of hits. Of > course they don't try to handle all their load on a single box. exactly the point....without lots of carefully managed and well configured components, an app built on something like Rails won't be reliable when you get spiked. The recommended approaches to scaling with rails do work, but there are _lots_ of parts to install and configure just so. Companies like textdrive and the soon to be released railsbase are obviously hoping to cash in on solving this problem. Within the next year or so, you should be able to host your Rails app on a grid like hosting system and draw from a well configured and managed "mega-host". FYI, it looks as though the textdrive (maybe railsbase) folks will be running this new grid on Niagra servers. I have no special inside knowledge, I just try to keep up with what info is available...but I"m pretty sure on all this speculation. So if your app fits into the well defined sweetspot of what Rails does well, you will be able to publish your app and pay for resource usage like any other well managed utility instead of owning and managing your own server cluster. But if you want an app that doesn't fit into the Rails sweet spot or if you need it today or if you need to mitigate lower operations costs than these new utility like hosting services might provide....well your back to square one ;-). I spent about 2 months working with Rails this year. I'm back to redoing the app in erlang. ke han > > -- > http://wagerlabs.com/ > > > > > From joelr1@REDACTED Mon Aug 28 20:32:41 2006 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 28 Aug 2006 19:32:41 +0100 Subject: Erlang for web-developers In-Reply-To: <8662D679-CD9C-489A-9259-7E5C2F94E561@redstarling.com> References: <17244f480608280547q1e387daas49ff939eba247d28@mail.gmail.com> <7BBE861D-CF73-4F6B-856E-B42FBFB71ED7@gmail.com> <8662D679-CD9C-489A-9259-7E5C2F94E561@redstarling.com> Message-ID: <83767C50-4F6E-4259-A9F5-F68FD9A1B1D9@gmail.com> On Aug 28, 2006, at 7:15 PM, ke han wrote: > I spent about 2 months working with Rails this year. I'm back to > redoing the app in erlang. What was the trouble with Rails? We are using Rails where I contract since I could not convince the powers that be to use Erlang. It seems to be working so far. Thanks, Joel -- http://wagerlabs.com/ From yarivvv@REDACTED Mon Aug 28 22:44:24 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 28 Aug 2006 16:44:24 -0400 Subject: Erlang for web-developers In-Reply-To: <83767C50-4F6E-4259-A9F5-F68FD9A1B1D9@gmail.com> References: <17244f480608280547q1e387daas49ff939eba247d28@mail.gmail.com> <7BBE861D-CF73-4F6B-856E-B42FBFB71ED7@gmail.com> <8662D679-CD9C-489A-9259-7E5C2F94E561@redstarling.com> <83767C50-4F6E-4259-A9F5-F68FD9A1B1D9@gmail.com> Message-ID: <17244f480608281344o6d9b8874p7fe1f41720bbba1b@mail.gmail.com> Joel, There's an interesting 4-article series about the difficulties of scaling a high volume Rails app here: http://poocs.net/articles/2006/03/13/the-adventures-of-scaling-stage-1. It would be interesting for you to read. >From these articles, it sounds like scaling Rails is quite hard, and when you reach certain bottlenecks, it's hard to diagnose where they are. On my blog, I'm occasionally having issues sometimes when users can't submit comments. When I try to restart lighttpd, I get runaway Ruby processes that don't shut down. Even "sudo killall -kill ruby" doesn't work. The only option is to do "su" and then "kill -kill PID" for each Ruby process. Sometimes doing this and then restarting Lighttpd works, but sometimes my only choice is to restart the server. This might be something specific to my environment (I have a virtual server). I can't say conclusively whether this is a problem with Rails or if I messed up the setup somehow. I have a recent version of Rails and Typo. Best, Yariv > > What was the trouble with Rails? We are using Rails where I contract > since I could not convince the powers that be to use Erlang. It seems > to be working so far. > > Thanks, Joel > > -- > http://wagerlabs.com/ > > > > > > From yarivvv@REDACTED Mon Aug 28 22:47:12 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Mon, 28 Aug 2006 16:47:12 -0400 Subject: multiple patterns per clause? In-Reply-To: <44F310D9.3000203@blueyonder.co.uk> References: <17244f480608280747r4aaa36f9wcb72b33dd10fc95d@mail.gmail.com> <44F310D9.3000203@blueyonder.co.uk> Message-ID: <17244f480608281347w16a70b4dgfd40e77fe4a7f8b9@mail.gmail.com> > > What would this construct mean, if the body expression refers to a variable > that is bound in some of the alternative patterns but not all of them? > This case would indeed create an ambiguity. I suppose the compiler would have to enforce that the same variables are bound in all patterns somehow... Yariv From erlangist@REDACTED Tue Aug 29 00:20:55 2006 From: erlangist@REDACTED (lang er) Date: Tue, 29 Aug 2006 06:20:55 +0800 Subject: Why do OS not support erlang's lightweight process? Message-ID: <230465c00608281520m3b38c5efy20375f1f52ba3240@mail.gmail.com> If OS support erlang's lightweight process in kernel, many programming languages could have erlang's concurrent capability.I think it is not impossible. BR! James -------------- next part -------------- An HTML attachment was scrubbed... URL: From ke.han@REDACTED Tue Aug 29 04:29:26 2006 From: ke.han@REDACTED (ke han) Date: Tue, 29 Aug 2006 10:29:26 +0800 Subject: Why do OS not support erlang's lightweight process? In-Reply-To: <230465c00608281520m3b38c5efy20375f1f52ba3240@mail.gmail.com> References: <230465c00608281520m3b38c5efy20375f1f52ba3240@mail.gmail.com> Message-ID: <33CA3092-9E31-4749-AC8C-3F89E2F4CB80@redstarling.com> James, I'm pretty sure Inferno http://www.vitanuova.com/index.html have lightweight OS processes/threads. It is probably possible to have a linux kernel written to support processes which take up much fewer resource, are quicker to allocate, context switch...but you would probably break so much stuff used by other traditional *nix apps that you would end up with a special purpose OS which runs nothing well except your apps meant for these lightweight processes. I'm no kernel expert so I'll stop my speculation here ;-). ok, I can't resist...another fantasy option would be to build up new alternate kernel level process/thread objects which have the characteristics you want and "simply" have the OS scheduler be much smarter to handle both heavy and lightweight processes. But I seem to notice that experiments with developing "complex" schedulers haven't done so well. I did study inferno two years ago when I was on my overreaching journey to find "better ways to build software". This journey led me to study scala and erlang as well. erlang was the only thing that was mature enough and could coexist well enough with existing *nix apps. In another year, with the advent of cheap and easy to manage virtual OSes running on a resource aplenty $5000 server, one probably could much more seriously look at building apps with inferno as the app itself would just sit in inferno running as its own vm running happily alongside other *nix vms. I think a erlang OS has been worked on by some gurus on this very list...perhaps they can expand on this topic? ke han On Aug 29, 2006, at 6:20 AM, lang er wrote: > If OS support erlang's lightweight process in kernel, many > programming languages could have erlang's concurrent capability.I > think it is not impossible. > > BR! > James From jay@REDACTED Tue Aug 29 04:54:16 2006 From: jay@REDACTED (Jay Nelson) Date: Mon, 28 Aug 2006 19:54:16 -0700 Subject: Dynamic languages are the future Message-ID: <44F3AC58.9040306@duomark.com> http://www.eweek.com/article2/0,1895,2009010,00.asp A four page article which claims the next generation of programming will be with "dynamic languages" like Ruby, Python, Perl, .NET and others. Some quotes: ----------------- The appeal of dynamic languages is clear: As systems continue to grow more complex, developers seek simpler ways to get their work done. ... And simpler code tends to attract developers. "I think that dynamic languages are really the next big thing," said John Lam, a principal consultant and partner at Toronto-based ObjectSharp Consulting. ---------------- Meanwhile, Sun also is making changes to the JVM, so, in the future, it can bring over new languages, Hamilton said. Gilad Bracha, a computational theologist at Sun, said the company is broadening its support for dynamic languages not only to satisfy user demand but also to help broaden the overall community of developers who use the Java platform. Bracha noted that Sun currently offers support for some dynamic languages on the Java platform, including Jython, Kawa, Groovy and ECMA?Script. "We're solidly committed" to providing enhanced support for dynamic languages by adding a bytecode called invokedynamic and adding hot-swapping support, Bracha said. Hot swapping is the ability to modify code on the fly. Both efforts are part of Java Specification Request 292, the goal of which is to allow scripting languages to be implemented natively on the JVM, Bracha said. ------------------- Meanwhile, Anders Hejlsberg, a Microsoft software architect in Redmond, Wash., and father of C#, said the days are numbered for imperative programming, which instructs the computer to make room for more declarative programming, which describes what something is like rather than how to create it. This style of programming is especially effective in helping developers take advantage of multicore CPUs, Hejlsberg said. ... Although dynamic languages have momentum, Hejlsberg said they lack scale. "Dynamic typing only scales so far," he said. "When you get into really big projects, it's problematic." --------------------- For his part, Lam said it's too early to know how dynamic languages will scale. "We just don't have enough experience in building large systems on these things," he said. Cedric Beust, an engineer at Google, in Mountain View, Calif., said, "Dynamic languages suffer from some inherent limitations that make them inadequate for 'large software.' So I definitely see them as gaining momentum, but they will never displace 'enterprise' languages such as Java, C# or C++. Some of their features are slowly percolating into enterprise languages, though, which is a good thing." Sridhar Iyengar, an IBM distinguished engineer, in Durham, N.C., offered more questions regarding large-scale deployment of applications built with dynamic languages. "One of the challenges of dynamic languages is how do you test it, how do you debug it and how do you make sure that your application is secure," Iyengar said. "All of this is tough to do with static languages. It's incredibly harder in dynamic languages." ------------------- From andres-lists@REDACTED Tue Aug 29 04:55:39 2006 From: andres-lists@REDACTED (=?ISO-8859-1?Q?Andr=E9s_Valenciano?=) Date: Mon, 28 Aug 2006 20:55:39 -0600 Subject: Erlang for web-developers In-Reply-To: References: Message-ID: <44F3ACAB.8090804@brainplugins.com> Dmitrii Dimandt wrote: > I think that in order to sell Erlang to web developers, we need to focus > exactly on the things that can be "branched off". Because telecom stuff > is interesting, but it also is scary. What else can we lure web > developers with? I am new guy in this Erlang block after years of Java, some Python and a year of Ruby ( and others before those 3). I am very interested in Erlang for web development but at this point some things are missing for me, those are the more "trivial" things like PDF generation, charts, all these other features that some web applications needs that are not as interesting as all the Erlang strengths but some times needed. For example, I am in the starting process for a new project (in my day job), a web project, that has a SMS related service and I was really excited about it because I thought I could use Erlang there but then this other guy with Cold Fusion experience wants to use that product for the project, which gives the web server, the not-so-interesting things like PDF, Flash, etc and an SMPP implementation all in the same package. Is that one a lost battle in my case? -Andr?s From jay@REDACTED Tue Aug 29 05:02:04 2006 From: jay@REDACTED (Jay Nelson) Date: Mon, 28 Aug 2006 20:02:04 -0700 Subject: Why do OS not support erlang's lightweight process? Message-ID: <44F3AE2C.9040104@duomark.com> The strength of erlang is not just that you can make lots of little processes. It is the combination of this with the following things: 1) Fully isolated processes which are linked and signal failure 2) Failure is a fundamental assumption at all times 3) A simplified message passing scheme 4) Non-mutable "variables" 5) Pattern-based functions (makes messaging much clearer and easier) 6) Hot code loading as a fundamental function of the language Of course, all of the above work both on the same local CPU or on remote processors. If you add processes to the OS without the means to code and manage processes clearly, you will make a bigger mess out of the existing programs because the languages are not inherently defined to support many processes. If you add 1-6 and remote processes, you are back to erlang, so why bother? It is difficult to extract the essence of one substance and inject it in another substance with the goal of improving the deficient substance. You end up with an incomplete artificial substitute. jay From andres-lists@REDACTED Tue Aug 29 05:03:04 2006 From: andres-lists@REDACTED (=?ISO-8859-1?Q?Andr=E9s_Valenciano?=) Date: Mon, 28 Aug 2006 21:03:04 -0600 Subject: Erlang SMPP vs ColdFusion SMPP implementation Message-ID: <44F3AE68.4070804@brainplugins.com> Hi, I was asking in an Adobe forum about how to scale their SMPP implementation in Cold Fusion and some one post an answer about it telling me that "network latency & the SMPP server are more likely to be a bottleneck than the cf SMS gateway". Does anyone could give me some information about it and/or share some experiences about those two factors as the most possible problems? Thanks! -Andr?s From tty@REDACTED Tue Aug 29 05:21:56 2006 From: tty@REDACTED (tty@REDACTED) Date: Mon, 28 Aug 2006 23:21:56 -0400 Subject: Why do OS not support erlang's lightweight process? Message-ID: Another possibility is OSE by Enea (http://www.enea.com/templates/Extension____258.aspx). The Ericsson guys may have more to say about it [1]. I only heard it in passing and never used it. t [1] Rumour being it originated from Ericsson. To be taken with large grain of salt. Definately Ericsson is listed as an early adopter (1988). -------- Original Message -------- From: ke han Apparently from: owner-erlang-questions@REDACTED To: lang er Cc: "Erlang Users' List" Subject: Re: Why do OS not support erlang's lightweight process? Date: Tue, 29 Aug 2006 10:29:26 +0800 > James, > I'm pretty sure Inferno http://www.vitanuova.com/index.html have > lightweight OS processes/threads. > It is probably possible to have a linux kernel written to support > processes which take up much fewer resource, are quicker to allocate, > context switch...but you would probably break so much stuff used by > other traditional *nix apps that you would end up with a special > purpose OS which runs nothing well except your apps meant for these > lightweight processes. I'm no kernel expert so I'll stop my > speculation here ;-). > ok, I can't resist...another fantasy option would be to build up new > alternate kernel level process/thread objects which have the > characteristics you want and "simply" have the OS scheduler be much > smarter to handle both heavy and lightweight processes. But I seem > to notice that experiments with developing "complex" schedulers > haven't done so well. > > I did study inferno two years ago when I was on my overreaching > journey to find "better ways to build software". This journey led me > to study scala and erlang as well. erlang was the only thing that > was mature enough and could coexist well enough with existing *nix apps. > In another year, with the advent of cheap and easy to manage virtual > OSes running on a resource aplenty $5000 server, one probably could > much more seriously look at building apps with inferno as the app > itself would just sit in inferno running as its own vm running > happily alongside other *nix vms. > > I think a erlang OS has been worked on by some gurus on this very > list...perhaps they can expand on this topic? > > ke han > > On Aug 29, 2006, at 6:20 AM, lang er wrote: > > > If OS support erlang's lightweight process in kernel, many > > programming languages could have erlang's concurrent capability.I > > think it is not impossible. > > > > BR! > > James From rlenglet@REDACTED Tue Aug 29 05:39:50 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Tue, 29 Aug 2006 12:39:50 +0900 Subject: Why do OS not support erlang's lightweight process? In-Reply-To: <230465c00608281520m3b38c5efy20375f1f52ba3240@mail.gmail.com> References: <230465c00608281520m3b38c5efy20375f1f52ba3240@mail.gmail.com> Message-ID: <200608291239.50851.rlenglet@users.forge.objectweb.org> lang er wrote: > If OS support erlang's lightweight process in kernel, many > programming languages could have erlang's concurrent > capability.I think it is not impossible. I think that this is one of the purposes of microkernels? Take a look at L4, the Hurd, etc. -- Romain LENGLET From rsaccon@REDACTED Tue Aug 29 05:45:16 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Tue, 29 Aug 2006 00:45:16 -0300 Subject: Erlang for web-developers In-Reply-To: <44F3ACAB.8090804@brainplugins.com> References: <44F3ACAB.8090804@brainplugins.com> Message-ID: For PDF you could use http://pdflib.de, wich is commercial, but worth its price and ships with C source code, so you could build a port-driver (never done that myself, I am also new to Erlang), and for RPC with flash you could use Yarivs haxe remoting module. On 8/28/06, Andr?s Valenciano wrote: > Dmitrii Dimandt wrote: > > I think that in order to sell Erlang to web developers, we need to focus > > exactly on the things that can be "branched off". Because telecom stuff > > is interesting, but it also is scary. What else can we lure web > > developers with? > > I am new guy in this Erlang block after years of Java, some Python and a > year of Ruby ( and others before those 3). > > I am very interested in Erlang for web development but at this point > some things are missing for me, those are the more "trivial" things like > PDF generation, charts, all these other features that some web > applications needs that are not as interesting as all the Erlang > strengths but some times needed. > > For example, I am in the starting process for a new project (in my day > job), a web project, that has a SMS related service and I was really > excited about it because I thought I could use Erlang there but then > this other guy with Cold Fusion experience wants to use that product for > the project, which gives the web server, the not-so-interesting things > like PDF, Flash, etc and an SMPP implementation all in the same package. > > Is that one a lost battle in my case? > > > -Andr?s > > > > -- Roberto Saccon From erlangist@REDACTED Tue Aug 29 05:54:25 2006 From: erlangist@REDACTED (lang er) Date: Tue, 29 Aug 2006 11:54:25 +0800 Subject: Why do OS not support erlang's lightweight process? In-Reply-To: <44F3AE2C.9040104@duomark.com> References: <44F3AE2C.9040104@duomark.com> Message-ID: <230465c00608282054y6aebbb8bq64caa50634acb1ae@mail.gmail.com> Joe's thesis talks about what problems should be solved in programming language , what should be in libraries, but doesn't discuss what maybe presented in OS.(I haven't finished reading, so maybe I'm wrong) But in erlang book page 125, he did discuss some special type of operating system structure ( the switch server and telephony application processes)(sadly, no second part ). I mean not just about processes' quantity, but about os processes involved in building robust application, for example Fully isolated processes which are linked and signal failure as you point out. I think your 4 and 5 are special for erlang as a programming language, other items in your list are not so much programming language features. BR! James 2006/8/29, Jay Nelson : > > The strength of erlang is not just that you can make lots of little > processes. It is the combination of this with the following things: > > 1) Fully isolated processes which are linked and signal failure > 2) Failure is a fundamental assumption at all times > 3) A simplified message passing scheme > 4) Non-mutable "variables" > 5) Pattern-based functions (makes messaging much clearer and easier) > 6) Hot code loading as a fundamental function of the language > > Of course, all of the above work both on the same local CPU or on remote > processors. > > If you add processes to the OS without the means to code and manage > processes clearly, you will make a bigger mess out of the existing > programs because the languages are not inherently defined to support > many processes. > > If you add 1-6 and remote processes, you are back to erlang, so why > bother? > > It is difficult to extract the essence of one substance and inject it in > another substance with the goal of improving the deficient substance. > You end up with an incomplete artificial substitute. > > jay > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ke.han@REDACTED Tue Aug 29 06:05:51 2006 From: ke.han@REDACTED (ke han) Date: Tue, 29 Aug 2006 12:05:51 +0800 Subject: Erlang for web-developers In-Reply-To: <44F3ACAB.8090804@brainplugins.com> References: <44F3ACAB.8090804@brainplugins.com> Message-ID: <6765E41A-8E35-45B1-8140-432E36A90B6C@redstarling.com> On Aug 29, 2006, at 10:55 AM, Andr?s Valenciano wrote: > Dmitrii Dimandt wrote: >> I think that in order to sell Erlang to web developers, we need to >> focus >> exactly on the things that can be "branched off". Because telecom >> stuff >> is interesting, but it also is scary. What else can we lure web >> developers with? > > I am new guy in this Erlang block after years of Java, some Python > and a > year of Ruby ( and others before those 3). > > I am very interested in Erlang for web development but at this point > some things are missing for me, those are the more "trivial" things > like > PDF generation, charts, all these other features that some web > applications needs that are not as interesting as all the Erlang > strengths but some times needed. This does add to the erlang sales pitch problem. I think the best way to approach this issue is to think of erlang as your central command and control center. You can spawn an external process to handle non-erlang tools like full text search, image manipulation, SMS gateway, etc... You can do this cheap and easy by just spawning an external process (think of the CGI paradigm) or have the extrenal process connect back to an erlang socket server and keep the external resource alive (think FCGI). Once you see how easy it is to create ad-hoc erlang socket servers to wrapper external tools, I think your fears of not having feature X as a native erlang lib will dissipate. The sales pitch for this structure is to say you can choose best of breed for any feature you might encounter as opposed to being stuck with the "Cold Fusion choice or much harder choice" for feature X. I am taking this approach for my full text search needs by using lucene (Java). I get the best of both tools with very little trouble for using multiple technologies. I am also using the erlang custom socket server approach for a custom C++ server which needs to handle authentication and authorization. My C++ deamon is a fast single threaded socket relay server which could get its auth info via a call to MySQL which would be a shared data source along with the erlang web app. Although relying on a central db is a nice tried and true method for shared auth info, it means that my simple C++ deamon must add threaded handlers for making the MySQL calls...if not, my fast socket relay will bottleneck all the existing packets for existing connections while it handles auth for each new connection. My solution is to let the C++ deamon connect to a custom auth server running in the same erlang vm as my yaws web app. This gives me much faster access to the auth info than making a SQL query and its a fast enough solution that I don't need to introduce threading in my C++ deamon. The reason for elaborating on this example is to show that any IT solution which gets complex enough should make best of breed choices. There exists a "one language must have it all" approach which makes many decision makers feel comfortable. I think this "comfort" is overstated and limits your horizon when adding unforeseen new features. ke han > > For example, I am in the starting process for a new project (in my day > job), a web project, that has a SMS related service and I was really > excited about it because I thought I could use Erlang there but then > this other guy with Cold Fusion experience wants to use that > product for > the project, which gives the web server, the not-so-interesting things > like PDF, Flash, etc and an SMPP implementation all in the same > package. > > Is that one a lost battle in my case? > > > -Andr?s > > > From jay@REDACTED Tue Aug 29 07:35:07 2006 From: jay@REDACTED (Jay Nelson) Date: Mon, 28 Aug 2006 22:35:07 -0700 Subject: Dynamic languages are the future In-Reply-To: <44F3AF6C.1030003@einfo.com> References: <44F3AC58.9040306@duomark.com> <44F3AF6C.1030003@einfo.com> Message-ID: <44F3D20B.7020104@duomark.com> Byron Hale wrote: > Depends on what you mean by "dynamic," I suppose. Just quoting the article. > If you mean run-time binding, then it is the wave of the past. To be > specific, Lisp had run-time binding and was superseded by Scheme > because run-time binding is a horrible flaw in a scientific language. > Scheme was superseded by typed functional languages. Hmm, my recollection was building commercial apps in Common Lisp and CLOS, not Scheme. I have yet to meet any language as powerful and would take it back -- well, I think I like what erlang has to offer better, but only because I've already done Lisp and my needs are different now. Lisp gave you the power to do whatever you needed to do. You could avoid the power or you could use it. The language didn't try to protect you from making mistakes, it just gave you the choice to use the power. It was not a horrible flaw that enabled that approach. I think you'll find that the XP (extreme programming) trend and test first development will cause less reliance on statically typed languages. There are already rumblings that the straitjacket makes it difficult to itch behind your ear. > > Charitably speaking, there seem to be only a few places where run-time > binding might be desirable. Remember: Shoe salesmen sell what they have. And people who wear wing tips don't realize they pinch your toes. Let me try just one: XML. Have you ever seen a piece of commercial code using XML to deliver domain-specific data which doesn't require recompiling if a new attribute is added to the XML stream? The promise of XML was to dynamically define the content using a DTD, but everyone is using static languages so they don't do things dynamically. They end up putting the attribute names in the code because they have to map to a semantic implementation. > > As for scripting languages, what major system has ever successfully > been held together by band-aids and bubblegum? Well, actually just about every commercial system I've worked on had its share of band-aids and bubblegum and not due to the scripting language, but rather due to evolving requirements for a code base that had too much inertia. The scripting language was generally used to clean up the holes because it was easier. Scripting offers quick solutions to small headaches. But I would not use a scripting language to deploy something that needs to scale or needs to be reliable. Erlang is dynamic and right now it is the only language I would use for scale and reliability. > > Byron Hale From mike@REDACTED Tue Aug 29 08:56:35 2006 From: mike@REDACTED (Michael Williams) Date: 29 Aug 2006 06:56:35 GMT Subject: 5 second Erlang Submission References: <47404.194.72.110.12.1156409962.squirrel@backawinner.gg> Message-ID: In article <47404.194.72.110.12.1156409962.squirrel@REDACTED>, gordonguthrie@REDACTED (Gordon Guthrie) writes: |> Erlang was designed by people who build products. All other languages were |> designed by people who build languages. Do you build products? |> |> If it is over 5 secs lose the last sentence... C was designed at Bell Labs, and it first use was in ESS#4 telephony switches and in UNIX. C is an execllent language for its purpose, Erlang is good for it's purpose. I think you could make table: Algol: Language designers Pascal: Teaching Lisp: Language desigers Ada: Language designers C: Product designers Simula: People want to simulate things (also object orienters) CLU: The mother of true object orientation Erlang: Product designers C++: Religious object orientation Haskel: Language designer Mercury: ? ML: Language designers Probably I've got a lot wrong here :-) /m From richardc@REDACTED Tue Aug 29 10:24:03 2006 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 29 Aug 2006 10:24:03 +0200 Subject: 5 second Erlang Submission In-Reply-To: References: <47404.194.72.110.12.1156409962.squirrel@backawinner.gg> Message-ID: <44F3F9A3.9040402@it.uu.se> Michael Williams wrote: > Lisp: Language desigers Hackers at MIT, rather. It started as a blackboard notation, and then someone actually wrote an interpreter for it. The rest of the development was pure hacker pragmaticism. This was in 1958, when "language designer" was an unknown concept - Fortran was invented around 1954. (Well, I suppose that Backus could be considered the Original Language Designer - the CS equivalent of Original Sin...) > C: Product designers Well, operating system designers, who got tired of rewriting a lot of assembler code each time they wanted to port the Space Travel game to new hardware. > C++: Religious object orientation I really don't think C++ was ever about religion. It was always about getting the power of abstraction found in Simula, while retaining the speed, portability, and down-to-the-hardware features of C, and never making the program slower than C because of language features that you don't actually use. The consequence of this (extremely pragmatic) philosophy was that C++ got an enormous amount of users (and that the C we know today is not the C of 1978, when Stroustrup began working on "C with classes"). However, the road to hell is paved with good intentions... /Richard From raimo+erlang-questions@REDACTED Tue Aug 29 10:31:26 2006 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Tue, 29 Aug 2006 10:31:26 +0200 Subject: multiple patterns per clause? In-Reply-To: <17244f480608280747r4aaa36f9wcb72b33dd10fc95d@mail.gmail.com> References: <17244f480608280747r4aaa36f9wcb72b33dd10fc95d@mail.gmail.com> Message-ID: <20060829083126.GA8710@erix.ericsson.se> You could group the clauses a bit: case L of [L1|_] when L1 =:= $f; L1 =:= $x -> ok; "abc"++_ -> ok _ -> error end On Mon, Aug 28, 2006 at 10:47:38AM -0400, Yariv Sadan wrote: > Hi, > > Is it possible to have a single clause match multiple patterns in Erlang? > > Specifically, I want to test if a list has a number of different > prefixes, all of which would lead to the same expression. > > This is what I want to write (pseudo code): > > L = "foo", > case L of > [$f|_]; > [$x|_] ; > [$a, $b, $c | _] -> > ok; > _ -> > error > end > > I know the above is illegal, so what's the easiest way of doing > something similar in Erlang? > > Thanks in advance, > Yariv -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From bertil.karlsson@REDACTED Tue Aug 29 10:50:02 2006 From: bertil.karlsson@REDACTED (Bertil Karlsson) Date: Tue, 29 Aug 2006 10:50:02 +0200 Subject: Two questions about xmerl_xpath (variable references) In-Reply-To: <44F3167F.20900@gmail.com> References: <44F3167F.20900@gmail.com> Message-ID: <44F3FFBA.60304@ericsson.com> Hi, Ivan Dubrov wrote: > Hi, > > Does xmerl_xpath support the variable references? I can parse them > (for example > xmerl_xpath_parse:parse(xmerl_xpath_scan:tokens("not($x!=\"foo\")")). > ), but seems like the matcher does not support them. There is no support for variable references. /Bertil From ulf.wiger@REDACTED Tue Aug 29 11:05:14 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Tue, 29 Aug 2006 11:05:14 +0200 Subject: Why do OS not support erlang's lightweight process? In-Reply-To: Message-ID: Ke Han wrote: > > [1] Rumour being [OSE] originated from Ericsson. To be taken > with large grain of salt. Definately Ericsson is listed as an > early adopter (1988). You can go easy on the salt. OSE was definitely heavily inspired by EriOS, which was Ericsson's alternative to the CHILL committe effort. EriOS was based on EriPascal - Pascal extended with concurrency. EriPascal in its turn grew out of the experiences from PLEX development at Ericsson. One of the people involved in EriOS was Bjarne D?cker... Ericsson didn't invent OSE, but it is no coincidence that OSE and Erlang are similar in many ways. BR, Ulf W From gordonguthrie@REDACTED Tue Aug 29 11:28:19 2006 From: gordonguthrie@REDACTED (Gordon Guthrie) Date: Tue, 29 Aug 2006 10:28:19 +0100 (BST) Subject: 5 second Erlang Submission In-Reply-To: References: <47404.194.72.110.12.1156409962.squirrel@backawinner.gg> Message-ID: <22252.194.72.110.12.1156843699.squirrel@backawinner.gg> > gordonguthrie@REDACTED (Gordon Guthrie) writes: > |> Erlang was designed by people who build products. All other languages > were > |> designed by people who build languages. Do you build products? > > C was designed at Bell Labs, and it first use was in ESS#4 > telephony switches and in UNIX. C is an execllent language for its > purpose, Erlang is good for it's purpose. I think you could make > table: > > Algol: Language designers > Pascal: Teaching > Lisp: Language desigers > Ada: Language designers > C: Product designers > Simula: People want to simulate things (also object orienters) > CLU: The mother of true object orientation > Erlang: Product designers > C++: Religious object orientation > Haskel: Language designer > Mercury: ? > ML: Language designers > > Probably I've got a lot wrong here :-) Allow me to rephrase: All other languages ride in the imperpial triumphal chariot wearing purple, whilst Erlang is the slave behind them whispering "Respice post te! Programmem te memento!" (Look behind you! You are but a programme). Gordon Cue jokes about C-sar and C++sar, Lisp will be the Emperor Claudius, etc, etc... From damir@REDACTED Tue Aug 29 11:56:56 2006 From: damir@REDACTED (Damir Horvat) Date: Tue, 29 Aug 2006 11:56:56 +0200 Subject: ibrowse install Message-ID: <20060829095656.GA2247@semp.x-si.org> Hi! Probably a dumb question, but anyway: I'd like to have ibrowse HTTP client installed. The package includes README, but no word about how can one install the package. Cheers, Damir From tobbe@REDACTED Tue Aug 29 11:58:50 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Tue, 29 Aug 2006 11:58:50 +0200 Subject: The Erlang Test Server Message-ID: Hi folks, I've been trying to understand the Erlang Test Server without really succeeding... See: http://www.erlang.org/project/test_server/ Has anyone else used it ? I have started a forum thread here: http://forum.trapexit.org/viewtopic.php?p=20572#20572 where those who are interested in this can discuss it. It is also possible to discuss it on the #erlang channel at irc.freenode.net where I'm lurking as etnt nowadays. But now it is time for lunch! Cheers, Tobbe From hakan@REDACTED Tue Aug 29 11:59:35 2006 From: hakan@REDACTED (Hakan Mattsson) Date: Tue, 29 Aug 2006 11:59:35 +0200 (CEST) Subject: Why do OS not support erlang's lightweight process? In-Reply-To: <230465c00608281520m3b38c5efy20375f1f52ba3240@mail.gmail.com> References: <230465c00608281520m3b38c5efy20375f1f52ba3240@mail.gmail.com> Message-ID: On Tue, 29 Aug 2006, lang er wrote: le> If OS support erlang's lightweight process in kernel, many programming le> languages could have erlang's concurrent capability.I think it is not le> impossible. Didn't Tony put the Erlang VM in the Linux Kernel some years ago? What was the experiences from that project? /H?kan From bengt.kleberg@REDACTED Tue Aug 29 12:31:50 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 29 Aug 2006 12:31:50 +0200 Subject: ibrowse install In-Reply-To: <20060829095656.GA2247@semp.x-si.org> References: <20060829095656.GA2247@semp.x-si.org> Message-ID: <44F41796.7090705@ericsson.com> On 2006-08-29 11:56, Damir Horvat wrote: > I'd like to have ibrowse HTTP client installed. The package includes > README, but no word about how can one install the package. if you use erlrt (http://erlrt.process-one.net/?page=index) to install erlang software i think ibrowse is included by default. if you use erlmerge () to install erlang software you can do: erlmerge install ibrowse if you do it manually you can put it in $ROOTDIR/lib/ibrowse-x.y.z to get it automagically or in ''anyplace'' and start with: erl -pa bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From chandrashekhar.mullaparthi@REDACTED Tue Aug 29 12:39:44 2006 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Tue, 29 Aug 2006 11:39:44 +0100 Subject: ibrowse install In-Reply-To: <20060829095656.GA2247@semp.x-si.org> References: <20060829095656.GA2247@semp.x-si.org> Message-ID: Hi Damir, On 29/08/06, Damir Horvat wrote: > > Hi! > > Probably a dumb question, but anyway: > > I'd like to have ibrowse HTTP client installed. The package includes > README, but no word about how can one install the package. There is no installation to be done. ibrowse doesn't use any mnesia tables and it can be used without any entries in the config files either. Just make sure the code is in your path. cheers Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From andres-lists@REDACTED Tue Aug 29 14:44:02 2006 From: andres-lists@REDACTED (=?ISO-8859-1?Q?Andr=E9s_Valenciano?=) Date: Tue, 29 Aug 2006 06:44:02 -0600 Subject: Erlang for web-developers In-Reply-To: <6765E41A-8E35-45B1-8140-432E36A90B6C@redstarling.com> References: <44F3ACAB.8090804@brainplugins.com> <6765E41A-8E35-45B1-8140-432E36A90B6C@redstarling.com> Message-ID: <44F43692.4090901@brainplugins.com> ke han wrote: > This does add to the erlang sales pitch problem. Yes it is a problem, some times when others have used only one tool for everything for years and before that another tool for everything...they are difficult people to talk to or persuade to change from their comfort zone about development. Most of the things I heard were the same that were thrown to the Rails guys: pool of people to work with the "technology", "enterprise standard" for web apps, blah blah blah (well, not one thing about scalability in this case :) ) > I think the best way to approach this issue is to think of erlang as > your central command and control center. You can spawn an external > process to handle non-erlang tools like full text search, image > manipulation, SMS gateway, etc... You can do this cheap and easy by > just spawning an external process (think of the CGI paradigm) or have > the extrenal process connect back to an erlang socket server and keep > the external resource alive (think FCGI). Once you see how easy it is > to create ad-hoc erlang socket servers to wrapper external tools, I > think your fears of not having feature X as a native erlang lib will > dissipate. Maybe one thing to do, could be use an Erlang community web site answering these question, giving examples of how to integrate Erlang with other tools, just like yours. Thanks for the answers to my post. -Andr?s From damir@REDACTED Tue Aug 29 15:27:52 2006 From: damir@REDACTED (Damir Horvat) Date: Tue, 29 Aug 2006 15:27:52 +0200 Subject: ibrowse install In-Reply-To: <44F41796.7090705@ericsson.com> References: <20060829095656.GA2247@semp.x-si.org> <44F41796.7090705@ericsson.com> Message-ID: <20060829132752.GB3785@semp.x-si.org> On Tue, Aug 29, 2006 at 12:31:50PM +0200, Bengt Kleberg wrote: > if you use erlrt (http://erlrt.process-one.net/?page=index) to install > erlang software i think ibrowse is included by default. > > if you use erlmerge () to install erlang software you can do: > erlmerge install ibrowse > > if you do it manually you can put it in $ROOTDIR/lib/ibrowse-x.y.z to > get it automagically > or in ''anyplace'' and start with: erl -pa I've got it, thank you. Damir From dot@REDACTED Tue Aug 29 15:47:38 2006 From: dot@REDACTED (Tony Finch) Date: Tue, 29 Aug 2006 14:47:38 +0100 Subject: Why do OS not support erlang's lightweight process? In-Reply-To: <230465c00608281520m3b38c5efy20375f1f52ba3240@mail.gmail.com> References: <230465c00608281520m3b38c5efy20375f1f52ba3240@mail.gmail.com> Message-ID: On Tue, 29 Aug 2006, lang er wrote: > If OS support erlang's lightweight process in kernel, many programming > languages could have erlang's concurrent capability.I think it is not > impossible. The reason that Erlang processes are lightweight is that they do not require a context switch from userland -> kernel -> userland in order to schedule the next thread. Erlang can rely on the properties of the language, specifically no shared mutable data, in order to isolate processes from each other. The kernel must use the CPU's virtual memory support to do this, because it cannot make assumptions about the languages used to write userland processes, and switching pages tables is expensive. There have been some experiments with single-address-space operating systems, which should in principle be able to context switch faster (they only need to change the page table access rights, not the virtual -> real address mapping) but current CPUs are not optimised for this kind of design, so it isn't an advantage in practice. It also requires a 64 bit address space to be practical. Tony. -- f.a.n.finch http://dotat.at/ FISHER: WEST OR NORTHWEST 4 OR 5 BECOMING VARIABLE 3 OR 4. FAIR. MODERATE OR GOOD. From joe.armstrong@REDACTED Tue Aug 29 16:12:08 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Tue, 29 Aug 2006 16:12:08 +0200 Subject: new blog entry In-Reply-To: <44F43692.4090901@brainplugins.com> Message-ID: http://armstrongonsoftware.blogspot.com/2006/08/concurrency-is-easy.html /Joe From thomasl_erlang@REDACTED Tue Aug 29 16:13:54 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 29 Aug 2006 07:13:54 -0700 (PDT) Subject: Erlang for web-developers In-Reply-To: <44F43692.4090901@brainplugins.com> Message-ID: <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> --- Andr?s Valenciano wrote: > ke han wrote: > > This does add to the erlang sales pitch problem. > > Yes it is a problem, some times when others have > used only one tool for > everything for years and before that another tool > for everything...they > are difficult people to talk to or persuade to > change from their comfort > zone about development. > > Most of the things I heard were the same that were > thrown to the Rails > guys: pool of people to work with the "technology", > "enterprise > standard" for web apps, blah blah blah (well, not > one thing about > scalability in this case :) ) Most developers and managers play "follow the leader" and get upset if there are several ones :-) But those guys are basically the prize of the winner, and there is little point in trying to convince them at this stage. Instead, I think what is needed is a community of technical pioneers, who overcome real problems and codify them into software solutions. This is attractive to people who are having problems and are willing to try something new. In this specific case, an "OTP for web developers", perhaps? Basically, these pioneers will be the core of the snowball at the top of the hill, and the followers will be the big outer layer at the bottom. Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From anders.nygren@REDACTED Tue Aug 29 16:40:29 2006 From: anders.nygren@REDACTED (Anders Nygren) Date: Tue, 29 Aug 2006 09:40:29 -0500 Subject: Erlang SMPP vs ColdFusion SMPP implementation In-Reply-To: <44F3AE68.4070804@brainplugins.com> References: <44F3AE68.4070804@brainplugins.com> Message-ID: On 8/28/06, Andr?s Valenciano wrote: > Hi, > > I was asking in an Adobe forum about how to scale their SMPP > implementation in Cold Fusion and some one post an answer about it > telling me that "network latency & the SMPP server are more likely to be > a bottleneck than the cf SMS gateway". > > Does anyone could give me some information about it and/or share some > experiences about those two factors as the most possible problems? > > Thanks! > > -Andr?s > > Andres I dont have any experience with ColdFusions SMPP implementation but I have experience with oserl, (the erlang SMPP implementation). In SMPP You can send several requests to the SMSC without waiting for a responce for the previous requests. The operators normally do not like it when an ESME sends a flod of requests so they impose some limits on what You are allowed to do, the most common are 1, windowing, i.e. You may only have N outstanding requests that have not received a response 2, rate limit, i.e. You may only send N requests per second (In SMPP 5.0, there is a new congestion control mechanism, but I do not think that there are that many operators that support SMPP 5.0 yet.) I few minutes googling on coldfusion and smpp I found this http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00001671.htm Just let me know if You have any more questions on SMPP or oserl. /Anders From yarivvv@REDACTED Tue Aug 29 16:46:04 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 29 Aug 2006 10:46:04 -0400 Subject: Introducing ErlyDB: The Erlang Twist on Database Abstraction Message-ID: <17244f480608290746x35d378d0i894001f785797837@mail.gmail.com> Hi, I created a nice little database abstraction layer generator called ErlyDB. It's designed to bridge the sematic gap when interacting with SQL databases with minimal overhead. Here's the official announcement, with a tutorial: http://yarivsblog.com/articles/2006/08/29/introducing-erlydb-the-erlang-twist-on-database-abstraction ErlyDB is in alpha version. It only works with MySQL and it hasn't been thoroughly tested. Please give it a test drive and let me know if you run into any problems. I'll be adding many features to ErlyDB in the near future. Enjoy! Cheers, Yariv From ke.han@REDACTED Tue Aug 29 16:48:13 2006 From: ke.han@REDACTED (ke han) Date: Tue, 29 Aug 2006 22:48:13 +0800 Subject: 5 second Erlang Submission In-Reply-To: <22252.194.72.110.12.1156843699.squirrel@backawinner.gg> References: <47404.194.72.110.12.1156409962.squirrel@backawinner.gg> <22252.194.72.110.12.1156843699.squirrel@backawinner.gg> Message-ID: 3 seconds... " 'Selective receive' _is_ the unit test !!!" ke han On Aug 29, 2006, at 5:28 PM, Gordon Guthrie wrote: >> gordonguthrie@REDACTED (Gordon Guthrie) writes: >> |> Erlang was designed by people who build products. All other >> languages >> were >> |> designed by people who build languages. Do you build products? >> >> C was designed at Bell Labs, and it first use was in ESS#4 >> telephony switches and in UNIX. C is an execllent language for its >> purpose, Erlang is good for it's purpose. I think you could make >> table: >> >> Algol: Language designers >> Pascal: Teaching >> Lisp: Language desigers >> Ada: Language designers >> C: Product designers >> Simula: People want to simulate things (also object orienters) >> CLU: The mother of true object orientation >> Erlang: Product designers >> C++: Religious object orientation >> Haskel: Language designer >> Mercury: ? >> ML: Language designers >> >> Probably I've got a lot wrong here :-) > > Allow me to rephrase: > > All other languages ride in the imperpial triumphal chariot wearing > purple, whilst Erlang is the slave behind them whispering "Respice > post > te! Programmem te memento!" > > (Look behind you! You are but a programme). > > Gordon > > Cue jokes about C-sar and C++sar, Lisp will be the Emperor > Claudius, etc, > etc... From dmitriid@REDACTED Tue Aug 29 17:25:40 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Tue, 29 Aug 2006 18:25:40 +0300 Subject: Erlang Book - again Message-ID: What are the chances of "Concurrent Programming in Erlang" book becoming available online in its entirety? Why I'm asking this is that the book is clearly out of print (see Amazon hereand here). The only available books are available at ridiculous prices . Practical Common Lisp has been online forever, it seems. And the publisher gave the author perennial rights to publish the book on the web. Moreover, Paul Graham's "On Lisp" is now also available for download . May be Prentice Hall could be forced into giving the rights to the book back to its authors? And may be the authors could be persuaded to create an online copy of it? :) Or, better still, may be the authors could be persuaded to write a new book :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitriid@REDACTED Tue Aug 29 17:27:39 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Tue, 29 Aug 2006 18:27:39 +0300 Subject: Erlang Book - again In-Reply-To: References: Message-ID: Sorry, the book is available in the UK, but the question remains. On 8/29/06, Dmitrii Dimandt wrote: > > What are the chances of "Concurrent Programming in Erlang" book becoming > available online in its entirety? > > Why I'm asking this is that the book is clearly out of print (see Amazon > hereand > here). > The only available books are available at ridiculous prices > . > > Practical Common Lisp has been online > forever, it seems. And the publisher gave the author perennial rights to > publish the book on the web. > Moreover, Paul Graham's "On Lisp" is now also available for download > . > > May be Prentice Hall could be forced into giving the rights to the book > back to its authors? And may be the authors could be persuaded to create an > online copy of it? :) > > Or, better still, may be the authors could be persuaded to write a new > book :) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ke.han@REDACTED Tue Aug 29 17:28:35 2006 From: ke.han@REDACTED (ke han) Date: Tue, 29 Aug 2006 23:28:35 +0800 Subject: Erlang for web-developers In-Reply-To: <44F43692.4090901@brainplugins.com> References: <44F3ACAB.8090804@brainplugins.com> <6765E41A-8E35-45B1-8140-432E36A90B6C@redstarling.com> <44F43692.4090901@brainplugins.com> Message-ID: <12AD29E4-D07A-4465-88E0-C2C28ECC8D52@redstarling.com> On Aug 29, 2006, at 8:44 PM, Andr?s Valenciano wrote: > ke han wrote: >> This does add to the erlang sales pitch problem. > > Yes it is a problem, some times when others have used only one tool > for > everything for years and before that another tool for > everything...they > are difficult people to talk to or persuade to change from their > comfort > zone about development. > > Most of the things I heard were the same that were thrown to the Rails > guys: pool of people to work with the "technology", "enterprise > standard" for web apps, blah blah blah (well, not one thing about > scalability in this case :) ) yes, rails is much of the time a "pay later" solution. Frankly, its not because rails does anything particularly wrong. It does many things spot on. There are two negatives with Ruby on Rails...if you allow me to grossly oversimplify: 1 - lack of tools for ruby development. You need a Smalltalk like environ to truly understand and explore RoR code. Rails heavily uses "meta-programming". Ruby mixins are a core of this technique. Its great if you allow the magic to just work for you on things that are well documented. But what happens when you need to push on the limits of "convention over configuration"? ansrwer: you need to _know_ what your model, view and controllers are actually inheriting at run time. Along with the obvious lack of a good debugger, Ruby is missing the exploratory tools necessary to understand what Rails does to your code. 2 - concurrency. Rails is a "shared nothing" architecture. This is absolutely not the same thing as when we say erlang is a "shared nothing" language. An erlang app shares an enormous amount. The overall effect of an app well coded in erlang can be very efficient and scalable. This is possibly my one and only true criticism of the Rails developers. They are PANSIES!!!! You heard me.... a solid app framework consists of three major things to support the app developer: a - declarative programming interface b - metadata. This stuff in its many forms allows the above declarative interfaces to do their magic. c - concurrency and resource management. A good app framework should bury all issues of concurrency and resource management so that an app programmer can write seemingly single threaded code and have the app framework worry about what happens when you go from 1 test user to 10,000 concurrent real users. I have written many scalable app frameworks in Smalltalk and Java that get all three of the above correct. Rails completely sidesteps the third issue by calling their architecture "shared nothing". This is pansy, weak minded, schoolgirl programming at its worst!!! ;-) I realize Ruby doesn't have a great threading model. But its not much more anemic than a Smalltalk one...and I can tell you that you absolutely can make it scale in a single VM!!! By deferring this important issue to high-level HTTP requests which share nothing, you lose out on a lot. > > >> I think the best way to approach this issue is to think of erlang as >> your central command and control center. You can spawn an external >> process to handle non-erlang tools like full text search, image >> manipulation, SMS gateway, etc... You can do this cheap and easy by >> just spawning an external process (think of the CGI paradigm) or have >> the extrenal process connect back to an erlang socket server and keep >> the external resource alive (think FCGI). Once you see how easy >> it is >> to create ad-hoc erlang socket servers to wrapper external tools, I >> think your fears of not having feature X as a native erlang lib will >> dissipate. > > Maybe one thing to do, could be use an Erlang community web site > answering these question, giving examples of how to integrate Erlang > with other tools, just like yours. I will follow the lead taken by so many others and publish a tutorial or two in the next two months. I can tell you though that my way of doing things is directly derived from existing tutorials.. I may be able to provide yet another concrete example, but some the erlang gurus have already published great examples of how to solve these problems. See Martin Logan's recent thread on tutorial organization. ke han > > Thanks for the answers to my post. > > -Andr?s From joe.armstrong@REDACTED Tue Aug 29 17:40:25 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Tue, 29 Aug 2006 17:40:25 +0200 Subject: Erlang Book - again In-Reply-To: Message-ID: I don't think PH could be forced to do this - persuaded perhaps - forced no. I'll write and ask them. The book is however sadly out of date. For those who are interested I have started writing a new book. It has proved to be difficult to find a publisher so I will be using a print on demand service to print the book. I hope you'll all buy it. If you want any particular material covering send me a mail. /Joe ________________________________ From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Dmitrii Dimandt Sent: den 29 augusti 2006 17:26 To: Erlang-Questions Mailing List Subject: Erlang Book - again What are the chances of "Concurrent Programming in Erlang" book becoming available online in its entirety? Why I'm asking this is that the book is clearly out of print (see Amazon here and here ). The only available books are available at ridiculous prices . Practical Common Lisp has been online forever, it seems. And the publisher gave the author perennial rights to publish the book on the web. Moreover, Paul Graham's "On Lisp" is now also available for download . May be Prentice Hall could be forced into giving the rights to the book back to its authors? And may be the authors could be persuaded to create an online copy of it? :) Or, better still, may be the authors could be persuaded to write a new book :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitriid@REDACTED Tue Aug 29 17:59:45 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Tue, 29 Aug 2006 18:59:45 +0300 Subject: Erlang for web-developers In-Reply-To: <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> Message-ID: Well, to add this to the mix: Erlang is actually not suited very well for anything, but, well, telecom applications :) Despite Yaws, it cannot be used as a web-development tool right out of the box (Unicode, indexed search anyone) Despite C- and Java- bindings, Erlang cannot be used for desktop applications, because, well, you'll have to implement _a lot_ of stuff from ground up in Java or C/C++ just to make things communicate with Erlang As a control box? Yes, definitely. As a ready-togo solution? Probably, not. And there are both advantages and disadvantages to that, as there always are, but I think, that if Erlang community could focus on the disadvantages... Man, this could be the next killer-language :) (Ruby is slowly filling the void, and C# 3.0 is around the corner, and there is that curious little fellow by the name of Nemerle...) On 8/29/06, Thomas Lindgren wrote: > > > > --- Andr?s Valenciano > wrote: > > > ke han wrote: > > > This does add to the erlang sales pitch problem. > > > > Yes it is a problem, some times when others have > > used only one tool for > > everything for years and before that another tool > > for everything...they > > are difficult people to talk to or persuade to > > change from their comfort > > zone about development. > > > > Most of the things I heard were the same that were > > thrown to the Rails > > guys: pool of people to work with the "technology", > > "enterprise > > standard" for web apps, blah blah blah (well, not > > one thing about > > scalability in this case :) ) > > Most developers and managers play "follow the leader" > and get upset if there are several ones :-) But those > guys are basically the prize of the winner, and there > is little point in trying to convince them at this > stage. > > Instead, I think what is needed is a community of > technical pioneers, who overcome real problems and > codify them into software solutions. This is > attractive to people who are having problems and are > willing to try something new. In this specific case, > an "OTP for web developers", perhaps? > > Basically, these pioneers will be the core of the > snowball at the top of the hill, and the followers > will be the big outer layer at the bottom. > > Best, > Thomas > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.nospam.hopwood@REDACTED Tue Aug 29 18:01:46 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Tue, 29 Aug 2006 17:01:46 +0100 Subject: Dynamic languages are the future In-Reply-To: <44F3AC58.9040306@duomark.com> References: <44F3AC58.9040306@duomark.com> Message-ID: <44F464EA.2080606@blueyonder.co.uk> Jay Nelson wrote: > http://www.eweek.com/article2/0,1895,2009010,00.asp > > A four page article which claims the next generation of programming will > be with "dynamic languages" like Ruby, Python, Perl, .NET and others. Maybe the "next generation", but not the generation after that. My impression is that there are few purely dynamically typed languages being designed any more. Type inference has won the argument. It will just take a while for this to filter through to the mainstream, as it always does. Mind you, the definition of "dynamic" that this article uses is so fuzzy that it could include almost any language. (.NET CLR is statically typed. Of course you can still implement "dynamic" languages on it inefficiently.) -- David Hopwood From jefcrane@REDACTED Tue Aug 29 18:22:37 2006 From: jefcrane@REDACTED (Jeff Crane) Date: Tue, 29 Aug 2006 09:22:37 -0700 (PDT) Subject: What is a Supervisor REALLY doing? In-Reply-To: <22252.194.72.110.12.1156843699.squirrel@backawinner.gg> Message-ID: <20060829162237.59373.qmail@web31605.mail.mud.yahoo.com> I have no book and have taken no class. I'm in southern california and have been fiddling with erlang for a month. I understand the PURPOSE of a supervisor. To monitor child(?) process states. This is the only implementation of Supervisor behaviour I can find (it's near the bottom). http://www.matt-mcdonnell.com/code/code_erl/erl_course/erl_course.html Is this ms.erl an accurate representation of a Supervisor implementation? I can't find any documentation for an erlang supervisor. The examples I can find on the web: http://wiki.trapexit.org/index.php/A_fast_web_server_demonstrating_some_undocumented_Erlang_features#Supervisor_and_Application_implementation (and with some digging, some others that are very similar to this example). >From an erlang beginner's perspective this is a completely uncomprehensible mechanism. For example: http://www.erlang.org/doc/doc-5.4.12/doc/design_principles/sup_princ.html -module(ch_sup). -behaviour(supervisor). %% Why can't a I find the actual implementation of this behaviour, defined line by line so I understand what's going on? -export([start_link/0]). -export([init/1]). start_link() -> %% Where, when, why would I call this? All I know is that it starts the supervisor...I think supervisor:start_link(ch_sup, []). %% Where did start_link/2 come from? init(_Args) -> %% How and when is this called? {ok, {{one_for_one, 1, 60}, %% I have no idea what's returning this or what the values are for [{ch3, {ch3, start_link, []}, permanent, brutal_kill, worker, [ch3]}]}}. %% I cannot understand what is going on here When I have my own program, where I start(). receiveLoop([]) -> Pid = spawn child, add_Pid_to_list(Pid,[]), receiveLoop. child -> do stuff, child(). I can't understand how to add a supervisor without a solid understanding of how they work. This is one of many problems I have had trying to learn erlang. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From joelr1@REDACTED Tue Aug 29 18:29:12 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 17:29:12 +0100 Subject: Erlang Book - again In-Reply-To: References: Message-ID: <3B65D1E1-62B5-4624-84D5-708B2310DD00@gmail.com> Joe, I hope you will find this example encouraging: http://www.ffconsultancy.com/products/ocaml_for_scientists/ I recently bought this book (yes, for ~ EUR 130) since there's no decent alternative. On Aug 29, 2006, at 4:40 PM, Joe Armstrong ((TN/EAB)) wrote: > For those who are interested I have started writing a new book. > > It has proved to be difficult to find a publisher so I will be using a > print on demand service to print the book. -- http://wagerlabs.com/ From david.nospam.hopwood@REDACTED Tue Aug 29 18:35:01 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Tue, 29 Aug 2006 17:35:01 +0100 Subject: 5 second Erlang Submission In-Reply-To: References: <47404.194.72.110.12.1156409962.squirrel@backawinner.gg> Message-ID: <44F46CB5.6040009@blueyonder.co.uk> Michael Williams wrote: > In article <47404.194.72.110.12.1156409962.squirrel@REDACTED>, > gordonguthrie@REDACTED (Gordon Guthrie) writes: > |> Erlang was designed by people who build products. All other languages were > |> designed by people who build languages. Do you build products? > |> > |> If it is over 5 secs lose the last sentence... > > C was designed at Bell Labs, and it first use was in ESS#4 > telephony switches and in UNIX. C is an excellent language for its > purpose, [...] I would dispute that. The system programming domain that C is supposedly intended for requires extremely high reliability even in the presence of software errors. Many of the design decisions in C (in particular the prevalence of undefined behaviour resulting from common programming mistakes) run directly counter to that. I actually quite like C; it's at least a consistent exemplar of the "worse is better" design philosophy. But I don't consider it to be an "excellent" language for any purpose. -- David Hopwood From simonpeterchappell@REDACTED Tue Aug 29 18:43:33 2006 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Tue, 29 Aug 2006 11:43:33 -0500 Subject: Erlang Book - again In-Reply-To: References: Message-ID: <8ed733900608290943g4e79a0c5k6072b050998bc13b@mail.gmail.com> On 8/29/06, Joe Armstrong (TN/EAB) wrote: > > I don't think PH could be forced to do this - persuaded perhaps - forced no. > > I'll write and ask them. Always worth a try. :-) > The book is however sadly out of date. > > For those who are interested I have started writing a new book. Woo hoo! Christmas is coming early this year. > It has proved to be difficult to find a publisher so I will be using a print > on demand service to print the book. Please let us know how this works for you. Have you decided which one yet? I've heard good things about lulu.com, but I've never tried it. > I hope you'll all buy it. If you want any particular material covering send > me a mail. A few starters: * Remember us command-line folks. Almost every example or tutorial that I've seen has assumed that you were already at an "erl" prompt. Fine, but some of us like to run our code from the command-line like God intended. :-) * A chapter or two (or appendix) on transitioning from procedural languages would be wonderful. I'm completely sold on the idea of Erlang, but I keep getting hung up on the differences. For Erlang to make a dent in the mainstream, you've gotta help us poor procedural types make the leap to functional and concurrent programming. Loops especially. Ok, I *know* that loops = tail-recursion, but give us some solid steps on how to change our Java loops to tail-recursion. * How to extend our installation of Erlang with goodies from the Jungeral et al. What is the Erlang way to add libraries? In the Java world we add it to the CLASSPATH. How do you do it? * How do I test? I'm a big time user of JUnit in the Java world. How do I do that in Erlang-space? * Building and packaging. How? With what? What is the Erlang equivalent of Ant? Make? "Ent"? * Examples of the stuff that people really do: file handling, socket handling, working with *spit* XML *spit*. How's that for a start? :-) Simon -- www.simonpeter.org From fritchie@REDACTED Tue Aug 29 18:59:25 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Tue, 29 Aug 2006 11:59:25 -0500 Subject: Mnesia and partitioning big tables: Doc, it hurts when... Message-ID: <200608291659.k7TGxPlZ011285@snookles.snookles.com> Howdy. I don't know if any of you have tried partitioning a big Mnesia table. Oh, say, one with 800K entries in it. "Doctor, it hurts when I do [this]." The runtime appears to be O(N^2).(*) I interrupted the process when I noticed: * The output of mnesia:info/0 would arrive on my remote shell at a rate of approx. 1 *line* every 15-20 seconds. * I noticed that it hadn't finished when I returned from supper. This seems to be a symptom of a larger problem. It seems like any transaction that involves a large number of write/delete operations also behaves in O(N^2) manner. Looking at mnesia_frag.erl, it uses the same mechanism as other write & delete operations. The culprit appears to be the temporary ETS table 'mnesia_trans_store', used to store current transaction state. It's a 'bag' table, and all (?) write & delete operations use the same key, 'op', for storage in that ETS table. Sequential insertion of items with the same key into a 'bag' table looks like the cause of the pain.(***) Is there any reason why 'mnesia_trans_store' is a 'bag'? Aside from being a convenient (but slow) way to store the write & delete & other ops? -Scott (*) Erlang R10B-9 on an Linux/Opteron platform, HiPE not used for my app or for Mnesia(**). The table has not yet been fragmented. mnesia:change_table_frag(Tab, {activate, []}) is fast. mnesia:change_table_frag(Tab, {add_frag, [node()]}) is not. (**) Is anyone running a HiPE-compiled Mnesia application? I haven't tried, yet. (***) I have an excerpt of 'fprof' output from adding a fragment to an 800K entry table that already had 25 fragments; each fragment had approx. 25K entries. Distribution isn't even, so a few fragments have about 50K entries.) %% Analysis results: { analysis_options, [{callers, true}, {sort, acc}, {totals, true}, {details, true}]}. % CNT ACC OWN [{ totals, 3686037,367339.496,343509.022}]. %%% {[{{mnesia_schema,schema_transaction,1}, 1,349798.387, 0.000}, {{shell,eval_loop,3}, 2,17538.776, 0.000}, {{disk_log,monitor_request,2}, 2, 2406.145, 0.000}, {{mnesia_schema,do_insert_schema_ops,2}, 326, 1139.758, 0.000}, {{dets,req,2}, 2, 849.061, 0.000}, {{mnesia_dumper,insert,8}, 16542, 212.873, 0.000}, {{mnesia_index,del_ixes,4}, 1110, 105.762, 0.000}, {{mnesia_index,add_index2,6}, 913, 96.456, 0.000}, {{mnesia_lib,db_get,3}, 609, 82.711, 0.000}, {{mnesia_tm,commit_write,6}, 195, 81.309, 0.000}, {{ets,lookup_element,3}, 690, 80.703, 0.000}, {{ets,lookup,2}, 354, 75.630, 0.000}, {{ets,insert,2}, 359, 74.180, 0.000}, {{mnesia_tm,prepare_snmp,3}, 522, 72.567, 0.000}, {{mnesia_lib,db_get,2}, 815, 64.079, 0.000}, {{mnesia_schema,prepare_op,3}, 439, 60.331, 0.000}, {{mnesia_schema,prepare_ops,6}, 434, 59.457, 0.000}, {{mnesia_lib,val,1}, 539, 57.751, 0.000}, {{mnesia_index,delete_index2,3}, 643, 51.354, 0.000}, {{mnesia_tm,do_update_op,3}, 361, 50.525, 0.000}, {{mnesia_frag_hash,key_to_frag_number,2}, 484, 49.866, 0.000}, {{mnesia_index,db_put,2}, 255, 44.327, 0.000}, {{ets,match_delete,2}, 273, 44.318, 0.000}, {{disk_log_server,get_log_pids,1}, 212, 44.299, 0.000}, {{mnesia_frag,do_split,5}, 575, 38.952, 0.000}, {{disk_log,notify,2}, 274, 37.963, 0.000}, {{mnesia_tm,val,1}, 339, 37.882, 0.000}, {{mnesia_dumper,disc_insert,8}, 291, 32.388, 0.000}, {{mnesia_frag,key_to_n,2}, 286, 27.702, 0.000}, {{erlang,phash,2}, 221, 27.694, 0.000}, {{mnesia_tm,do_snmp,2}, 74, 25.488, 0.000}, {{erlang,'++',2}, 98, 24.193, 0.000}, {{ets,select_delete,2}, 136, 22.095, 0.000}, {{mnesia_index,add_index,5}, 84, 21.879, 0.000}, {{mnesia_frag,key_pos,1}, 101, 20.113, 0.000}, {{mnesia_dumper,insert_ops,6}, 251, 19.165, 0.000}, {{mnesia_lib,db_put,3}, 97, 19.094, 0.000}, {{mnesia_tm,commit_delete,6}, 220, 19.020, 0.000}, {{math,pow,2}, 220, 16.810, 0.000}, {{mnesia_index,db_match_erase,2}, 381, 12.915, 0.000}, {{disk_log,alog,2}, 241, 12.784, 0.000}, {{erlang,term_to_binary,1}, 101, 12.571, 0.000}, {{mnesia_schema,val,1}, 184, 11.679, 0.000}, {{gen,wait_resp_mon,3}, 17, 9.381, 0.000}, {{mnesia_dumper,insert_op,5}, 156, 6.492, 0.000}, {{mnesia_dumper,open_files,4}, 124, 6.461, 0.000}, {{mnesia_log,append,2}, 156, 6.404, 0.000}, {{ets,delete,2}, 42, 6.379, 0.000}, {{mnesia_lib,db_erase,3}, 68, 6.350, 0.000}, {{mnesia_index,delete_index,3}, 50, 6.304, 0.000}, {{ets,match_object,2}, 49, 0.049, 0.000}, {{mnesia_locker,receive_wlocks,4}, 4, 0.005, 0.000}, {{prim_file,drv_get_response,1}, 4, 0.004, 0.000}, {{mnesia_tm,rec,2}, 1, 0.004, 0.000}, {{mnesia_schema,schema_coordinator,3}, 1, 0.004, 0.000}, {{filename,join1,4}, 3, 0.003, 0.000}, {{shell,used_records,3}, 1, 0.001, 0.000}, {{shell,prep_check,1}, 1, 0.001, 0.000}, {{mnesia_schema,rec2list,3}, 1, 0.001, 0.000}, {{mnesia_schema,list2cs,1}, 1, 0.001, 0.000}, {{mnesia_schema,do_set_schema,2}, 1, 0.001, 0.000}, {{mnesia_schema,'-change_table_frag/2-fun-0-',2}, 1, 0.001, 0.000}, {{lists,reverse,1}, 1, 0.001, 0.000}, {{lists,foldl,3}, 1, 0.001, 0.000}, {{ets,match,2}, 1, 0.001, 0.000}, {{erl_eval,'-merge_bindings/2-fun-0-',2}, 1, 0.001, 0.000}, {{dict,get_slot,2}, 1, 0.001, 0.000}, {{fprof,just_call,2}, 1, 0.000, 0.000}], { suspend, 30943,373628.863, 0.000}, % [ ]}. .... {[{{mnesia_schema,do_insert_schema_ops,2}, 50004,324510.758,324480.804}, {{mnesia_index,db_put,2}, 75003, 264.027, 226.191}, {{mnesia_lib,db_put,3}, 25001, 131.409, 125.020}, {{mnesia_lib,set,2}, 109, 9.958, 9.957}, {{mnesia_locker,get_wlocks_on_nodes,5}, 4, 0.004, 0.004}, {{mnesia_schema,insert_cstruct,3}, 3, 0.003, 0.003}, {{mnesia_locker,wlock,3}, 3, 0.003, 0.003}, {{mnesia_tm,multi_commit,4}, 1, 0.001, 0.001}, {{mnesia_recover,note_outcome,1}, 1, 0.001, 0.001}, {{mnesia_recover,note_decision,2}, 1, 0.001, 0.001}], { {ets,insert,2}, 150130,324916.165,324841.985}, % [{suspend, 359, 74.180, 0.000}]}. From joelr1@REDACTED Tue Aug 29 19:02:36 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 18:02:36 +0100 Subject: Erlang does have problems In-Reply-To: References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> Message-ID: On Aug 29, 2006, at 4:59 PM, Dmitrii Dimandt wrote: > And there are both advantages and disadvantages to that, as there > always > are, but I think, that if Erlang community could focus on the > disadvantages... Man, this could be the next killer-language :) > (Ruby is > slowly filling the void, and C# 3.0 is around the corner, and there > is that > curious little fellow by the name of Nemerle...) Why not Ruby on the Erlang VM? Even the "flagship" Erlang apps have their problems. ejabberd uses tons of memory because strings are being passed around as lists despite being received as binaries from the socket. This is a problem on 32-bit systems as it limits the number of users you can host and it's a bigger problem on 64-bit systems as words are LARGER. The ejabberd developers came up with a fix, they are loading expat (C parser) as a driver. They are still using a port per message or per connection (don't remember exactly) and blow through the number of ports normally configured. Yes, you can up the number of ports but a better solution would be to stop using strings and create a shared pool of XML parser ports. Some high-profile messaging startups are using ejabberd now, although they don't advertise it. They are also considering dropping ejabberd and either going with a commercial implementation or writing their own stuff. I know because I keep in touch with them. Despite the Ericsson AXD 301 advocacy there are no high-profile Erlang deployments that I know about. There should be and we should all know! That is if we want Erlang to become mainstream. On the other hand, why bother? -- http://wagerlabs.com/ From dunceor@REDACTED Tue Aug 29 19:05:45 2006 From: dunceor@REDACTED (Dunceor) Date: Tue, 29 Aug 2006 19:05:45 +0200 Subject: Erlang Book - again In-Reply-To: References: Message-ID: <5d84cb30608291005u4bb7a81ai66127643c539ad74@mail.gmail.com> I remember taking a class at Uppsala university, the teacher there had tons of those books on his room because Ericsson gave them a whole bunch. The first class where I actually didn't have to buy the litterature =) I agree also with Joe Armstrong that the book is pretty much out-of-date even though it's good to learn the basics. I work at Sony-Ericsson and I saw that there is a bounch at work, I'll see if I can get my hands on a few of them. Joe: I would be interested in buying the book unless it's a outrageous price (~ >100$). Best Regards, Karl On 8/29/06, Dmitrii Dimandt wrote: > > Sorry, the book is available in the UK, > but the question remains. > > > On 8/29/06, Dmitrii Dimandt wrote: > > > > What are the chances of "Concurrent Programming in Erlang" book becoming > > available online in its entirety? > > > > Why I'm asking this is that the book is clearly out of print (see Amazon > > hereand here > > > > ). > > The only available books are available at ridiculous prices > > . > > > > Practical Common Lisp has been online > > forever, it seems. And the publisher gave the author perennial rights to > > publish the book on the web. > > Moreover, Paul Graham's "On Lisp" is now also available for download > > . > > > > May be Prentice Hall could be forced into giving the rights to the book > > back to its authors? And may be the authors could be persuaded to create an > > online copy of it? :) > > > > Or, better still, may be the authors could be persuaded to write a new > > book :) > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yarivvv@REDACTED Tue Aug 29 19:16:55 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 29 Aug 2006 13:16:55 -0400 Subject: Erlang for web-developers In-Reply-To: References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> Message-ID: <17244f480608291016t3570ea02pb709a9c8528edc05@mail.gmail.com> In a couple of months your opinion will be drastically different ;) Yariv On 8/29/06, Dmitrii Dimandt wrote: > Well, to add this to the mix: > > Erlang is actually not suited very well for anything, but, well, telecom > applications :) > > Despite Yaws, it cannot be used as a web-development tool right out of the > box (Unicode, indexed search anyone) > Despite C- and Java- bindings, Erlang cannot be used for desktop > applications, because, well, you'll have to implement _a lot_ of stuff from > ground up in Java or C/C++ just to make things communicate with Erlang > > As a control box? Yes, definitely. As a ready-togo solution? Probably, not. > > And there are both advantages and disadvantages to that, as there always > are, but I think, that if Erlang community could focus on the > disadvantages... Man, this could be the next killer-language :) (Ruby is > slowly filling the void, and C# 3.0 is around the corner, and there is that > curious little fellow by the name of Nemerle...) > > > On 8/29/06, Thomas Lindgren < thomasl_erlang@REDACTED> wrote: > > > > > > --- Andr?s Valenciano < andres-lists@REDACTED> > > wrote: > > > > > ke han wrote: > > > > This does add to the erlang sales pitch problem. > > > > > > Yes it is a problem, some times when others have > > > used only one tool for > > > everything for years and before that another tool > > > for everything...they > > > are difficult people to talk to or persuade to > > > change from their comfort > > > zone about development. > > > > > > Most of the things I heard were the same that were > > > thrown to the Rails > > > guys: pool of people to work with the "technology", > > > "enterprise > > > standard" for web apps, blah blah blah (well, not > > > one thing about > > > scalability in this case :) ) > > > > Most developers and managers play "follow the leader" > > and get upset if there are several ones :-) But those > > guys are basically the prize of the winner, and there > > is little point in trying to convince them at this > > stage. > > > > Instead, I think what is needed is a community of > > technical pioneers, who overcome real problems and > > codify them into software solutions. This is > > attractive to people who are having problems and are > > willing to try something new. In this specific case, > > an "OTP for web developers", perhaps? > > > > Basically, these pioneers will be the core of the > > snowball at the top of the hill, and the followers > > will be the big outer layer at the bottom. > > > > Best, > > Thomas > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > > > From dunceor@REDACTED Tue Aug 29 19:21:31 2006 From: dunceor@REDACTED (Dunceor) Date: Tue, 29 Aug 2006 19:21:31 +0200 Subject: Why do OS not support erlang's lightweight process? In-Reply-To: References: Message-ID: <5d84cb30608291021l5e7c6129t9ada60278635af6e@mail.gmail.com> On 8/29/06, Ulf Wiger (TN/EAB) wrote: > > Ke Han wrote: > > > > > [1] Rumour being [OSE] originated from Ericsson. To be taken > > with large grain of salt. Definately Ericsson is listed as an > > early adopter (1988). > > You can go easy on the salt. OSE was definitely heavily inspired > by EriOS, which was Ericsson's alternative to the CHILL committe > effort. EriOS was based on EriPascal - Pascal extended with > concurrency. EriPascal in its turn grew out of the experiences > from PLEX development at Ericsson. One of the people involved in > EriOS was Bjarne D?cker... > > Ericsson didn't invent OSE, but it is no coincidence that OSE > and Erlang are similar in many ways. > > BR, > Ulf W > OSE was invented by Bengt Eliasson who was (and are, at least last summer) a consultant from Ericsson so understandable that it has a lot of inspiration from Ericssons old OS'es. // Karl -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Tue Aug 29 19:27:00 2006 From: serge@REDACTED (Serge Aleynikov) Date: Tue, 29 Aug 2006 13:27:00 -0400 Subject: os_mon memsup reporting memory consumption Message-ID: <44F478E4.4050905@hq.idt.net> We had a few high memory watermark alarms in a production system running Linux reported by OS_MON whereas it seemed like the memory utilization on the server wasn't bad. I looked at the implementation of the memsup.erl module in OS_MON, and I believe the calculation of allocated memory has a flow. Memsup's code (sited at the end) reveals that allocated memory doesn't take in consideration cached memory. Since cached memory can be quickly freed by the Linux memory manager if additional memory is needed by applications, it looks to me that it should be: Allocated = MemFree + Cached or even: Allocated = MemFree + Buffers + Cached This would be consistent with what "free" is showing on the "-/+ buffers/cache" line: drp@REDACTED: ~$ uname -a Linux drpdb02.corp.idt.net 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005 i686 i686 i386 GNU/Linux drp@REDACTED: ~$ free total used free shared buffers cached Mem: 4150324 3416788 733536 0 282412 2621788 -/+ buffers/cache: 512588 3637736 Swap: 2048248 0 2048248 drp@REDACTED: ~$ head -4 /proc/meminfo MemTotal: 4150324 kB MemFree: 733536 kB Buffers: 282412 kB Cached: 2621788 kB %------------------------- %% @spec get_memory_usage_linux() -> {Allocated, Total} %------------------------- get_memory_usage_linux() -> Res = os:cmd("cat /proc/meminfo"), case get_memory_usage_linux(Res, undef, undef) of {MemTotal, MemFree} -> {MemTotal-MemFree, MemTotal}; error -> timer:sleep(1000), get_memory_usage_linux() end. get_memory_usage_linux(_Str, Tot, Free) when is_integer(Tot), is_integer(Free) -> {Tot, Free}; get_memory_usage_linux("MemTotal:"++T, _Tot0, Free0) -> {ok, [N], Rest} = io_lib:fread("~d", T), Tot = N*1024, get_memory_usage_linux(skip_to_eol(Rest), Tot, Free0); get_memory_usage_linux("MemFree:"++T, Tot0, _Free0) -> {ok, [N], Rest} = io_lib:fread("~d", T), Free = N*1024, get_memory_usage_linux(skip_to_eol(Rest), Tot0, Free); get_memory_usage_linux("", _Tot0, _Free0) -> error; get_memory_usage_linux(Str, Tot0, Free0) -> get_memory_usage_linux(skip_to_eol(Str), Tot0, Free0). %------------------------- Regards, Serge -- Serge Aleynikov R&D Telecom, MIS, IDT Corp Tel: +1 (973) 438-3436 Fax: +1 (973) 438-1464 From camster@REDACTED Tue Aug 29 20:05:11 2006 From: camster@REDACTED (Richard Cameron) Date: Tue, 29 Aug 2006 19:05:11 +0100 Subject: Erlang Book - again In-Reply-To: References: Message-ID: <19037072-DD48-415D-A282-A51F91D780C6@citeulike.org> On 29 Aug 2006, at 16:40, Joe Armstrong ((TN/EAB)) wrote: > For those who are interested I have started writing a new book. > > It has proved to be difficult to find a publisher so I will be > using a print on demand service to print the book. Has anyone pitched the idea of an Erlang book to O'Reilly recently? Of all the publishers I can think of, they seem to be the ones who continually dredge popular opinion to try to predict what the Next Big Thing(tm) is going to be. Whereas our beloved British government utilises focus groups and cappuccinos to decide future legislation, O'Reilly seem to trawl through blog posts and social bookmarking sites just to get down with the kids and see what they're "digging". They've even gone to the bother of setting up things like this . I've noticed there's been a glut of Erlang stories in the last few weeks, especially on . It seems that anything to do with concurrency or Erlang becomes an instant hit. While this is obviously a great thing for the evangelical erlangers, all the articles (out of necessity - you can't fit a textbook in a blog post) are very "big picture". There's lots of very sensible advocacy of how one ought to think about concurrency both mentally and in code, lots of analogies with the real world, and it's obviously pulling in the crowds. The trouble is that there's no way of saying "If you liked the ideas in the article then buy the book and see how it *actually* works." What seems to be an especially acute problem for us at the moment in our office is coverage of OTP. We find that it's pretty much trivial to get someone to pick up Erlang syntax and write code to spawn processes and send messages. Where everything tends to break down is when I try explaining what OTP even *is*. I really want a text which explains the ideas behind, say, gen_servers and shows why you'd even want to use something as abstruse as them in the first place. The C++ brigade have that incredibly dry and dense "Design Patterns" text which they squabble over when they're trying to put a name to part of a UML diagram (a little like trying to name the constellations). While I'm not proposing that anyone writes anything like that for Erlang, I would like something which gives an idea of how you go about designing software by drawing little boxes on a piece of paper representing processes, and a whole bunch of arrows scribbled on top representing messages. There are certain motifs which crop up again and again - basically the standard OTP behaviours - and it would be nice if there were a text which explained what these patterns are, and how you can go about implementing them (or getting them for free from the standard behaviours). I first learnt Erlang by reading up on all the ideas and realising that it was a rather strange (or, at least, different) way of programming to anything I'd done before and that it was probably quite powerful (although I didn't realise how powerful at the time). I then forgot about it for five years until I actually had a project which needed it. The first code I wrote in anger was a collection of horrible ad-hoc message passing protocols which re-implement a lot of stuff found in OTP. I didn't know about gen_server:reply/2, for example, and I still have the Heath Robinson code I wrote to try to reinvent the wheel running in my production system. I'm too scared to touch it at the moment, but I expect it'll eventually end up on the chopping block to be replaced with a much simpler and neater OTP implementation at some point. Staring out, it felt like someone had handed me a very powerful but dangerous power-tool (Erlang), but not quite explained how to use it properly. As a result, I tore off writing software like a cowboy builder who had bought a bunch of tools off his mate in the pub and then decided to go into business building patios. What I wished I had at the time was a text explaining roughly how one ought to go about things sensibly, and in non-cowboy fashion. I eventually got that by going on one of Francesco's training courses. I'm glad I did, but only because there was no other realistic way of obtaining that information. Paradoxically, since then I've found myself using progressively less and less of the standard OTP behaviours and more and more "pure Erlang" using sys and proc_lib. I couldn't have understood any of this if I hadn't picked up OTP on the way, and that's the big thing which is missing from any Erlang book (unless you happen to read French). Richard. From chandrashekhar.mullaparthi@REDACTED Tue Aug 29 20:11:27 2006 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Tue, 29 Aug 2006 19:11:27 +0100 Subject: What is a Supervisor REALLY doing? In-Reply-To: <20060829162237.59373.qmail@web31605.mail.mud.yahoo.com> References: <22252.194.72.110.12.1156843699.squirrel@backawinner.gg> <20060829162237.59373.qmail@web31605.mail.mud.yahoo.com> Message-ID: Hi Jeff, On 29/08/06, Jeff Crane wrote: > > I have no book and have taken no class. I'm in > southern california and have been fiddling with erlang > for a month. I understand the PURPOSE of a supervisor. > To monitor child(?) process states. It is not just to monitor. It is it monitor and restart processes as specified. This is the only implementation of Supervisor > behaviour I can find (it's near the bottom). > > http://www.matt-mcdonnell.com/code/code_erl/erl_course/erl_course.html > > Is this ms.erl an accurate representation of a > Supervisor implementation? Have you seen supervisor.erl in the stdlib application which comes with Erlang/OTP? I can't find any documentation for an erlang > supervisor. The examples I can find on the web: http://www.erlang.org/doc/doc-5.5/lib/stdlib-1.14/doc/html/supervisor.html >From an erlang beginner's perspective this is a > completely uncomprehensible mechanism. For example: > > http://www.erlang.org/doc/doc-5.4.12/doc/design_principles/sup_princ.html > > -module(ch_sup). > -behaviour(supervisor). %% Why can't a I find the > actual implementation of this behaviour, defined line > by line so I understand what's going on? > > -export([start_link/0]). > -export([init/1]). > > start_link() -> %% Where, when, why would I call this? This is called by the supervisor module. Basically, if you want a process to be supervised, you write a child specification. From the documentation, it looks like this: child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules} Id = term() StartFunc = {M,F,A} M = F = atom() A = [term()] Restart = permanent | transient | temporary Shutdown = brutal_kill | int()>=0 | infinity Type = worker | supervisor Modules = [Module] | dynamic Module = atom() I can't understand how to add a supervisor without a > solid understanding of how they work. This is one of > many problems I have had trying to learn erlang. Have a read through the documentation and I'm sure it'll answer a lot of your questions. All OTP behaviours are part of the stdlib application. cheers Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangist@REDACTED Tue Aug 29 20:34:31 2006 From: erlangist@REDACTED (lang er) Date: Wed, 30 Aug 2006 02:34:31 +0800 Subject: Erlang does have problems In-Reply-To: References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> Message-ID: <230465c00608291134p1a34168fg2328ec27bdf3c348@mail.gmail.com> Would be these system reimplemented in Erlang or other languages if they have dropped ejabberd? What's the status of Jabber.org ? Is this string-binary problem a language problem or ejabberd implementation issue? BR! james 2006/8/30, Joel Reymont : > > > On Aug 29, 2006, at 4:59 PM, Dmitrii Dimandt wrote: > > > And there are both advantages and disadvantages to that, as there > > always > > are, but I think, that if Erlang community could focus on the > > disadvantages... Man, this could be the next killer-language :) > > (Ruby is > > slowly filling the void, and C# 3.0 is around the corner, and there > > is that > > curious little fellow by the name of Nemerle...) > > Why not Ruby on the Erlang VM? > > Even the "flagship" Erlang apps have their problems. ejabberd uses > tons of memory because strings are being passed around as lists > despite being received as binaries from the socket. This is a problem > on 32-bit systems as it limits the number of users you can host and > it's a bigger problem on 64-bit systems as words are LARGER. > > The ejabberd developers came up with a fix, they are loading expat (C > parser) as a driver. They are still using a port per message or per > connection (don't remember exactly) and blow through the number of > ports normally configured. Yes, you can up the number of ports but a > better solution would be to stop using strings and create a shared > pool of XML parser ports. > > Some high-profile messaging startups are using ejabberd now, although > they don't advertise it. They are also considering dropping ejabberd > and either going with a commercial implementation or writing their > own stuff. I know because I keep in touch with them. > > Despite the Ericsson AXD 301 advocacy there are no high-profile > Erlang deployments that I know about. There should be and we should > all know! That is if we want Erlang to become mainstream. On the > other hand, why bother? > > -- > http://wagerlabs.com/ > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Tue Aug 29 20:44:57 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 19:44:57 +0100 Subject: Erlang does have problems In-Reply-To: <230465c00608291134p1a34168fg2328ec27bdf3c348@mail.gmail.com> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <230465c00608291134p1a34168fg2328ec27bdf3c348@mail.gmail.com> Message-ID: <543853A7-5461-4A66-AE1F-563A72CD070C@gmail.com> On Aug 29, 2006, at 7:34 PM, lang er wrote: > Would be these system reimplemented in Erlang or other languages if > they have dropped ejabberd? Other languages. > What's the status of Jabber.org? What do you mean? > Is this string-binary problem a language problem or ejabberd > implementation issue? Both Erlang choosing to represent strings as lists of 4 or 8-byte integers and ejabberd using strings to represent XML messages flowing through the system. Joel -- http://wagerlabs.com/ From simonpeterchappell@REDACTED Tue Aug 29 20:48:59 2006 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Tue, 29 Aug 2006 13:48:59 -0500 Subject: Erlang Book - again In-Reply-To: <19037072-DD48-415D-A282-A51F91D780C6@citeulike.org> References: <19037072-DD48-415D-A282-A51F91D780C6@citeulike.org> Message-ID: <8ed733900608291148l4af1c01ete5799681aa213f4c@mail.gmail.com> On 8/29/06, Richard Cameron wrote: > > On 29 Aug 2006, at 16:40, Joe Armstrong ((TN/EAB)) wrote: > > > For those who are interested I have started writing a new book. > > > > It has proved to be difficult to find a publisher so I will be > > using a print on demand service to print the book. > > Has anyone pitched the idea of an Erlang book to O'Reilly recently? > Of all the publishers I can think of, they seem to be the ones who > continually dredge popular opinion to try to predict what the Next > Big Thing(tm) is going to be. Whereas our beloved British government > utilises focus groups and cappuccinos to decide future legislation, > O'Reilly seem to trawl through blog posts and social bookmarking > sites just to get down with the kids and see what they're "digging". > They've even gone to the bother of setting up things like this > . Actually, I had gotten the impression that Apress was the forward looking publisher these days. I'm not always as impressed with O'Reilly as I used to be. Simon -- www.simonpeter.org From james.hague@REDACTED Tue Aug 29 20:52:23 2006 From: james.hague@REDACTED (James Hague) Date: Tue, 29 Aug 2006 13:52:23 -0500 Subject: Dynamic languages are the future In-Reply-To: <44F464EA.2080606@blueyonder.co.uk> References: <44F3AC58.9040306@duomark.com> <44F464EA.2080606@blueyonder.co.uk> Message-ID: On 8/29/06, David Hopwood wrote: > > Maybe the "next generation", but not the generation after that. My impression > is that there are few purely dynamically typed languages being designed any > more. Type inference has won the argument. It will just take a while for this > to filter through to the mainstream, as it always does. I disagree. Type inference simply prevents you from having to manually specify many types. Indeed, the Erlang compiler already does this where it can. It doesn't magically solve problems like coming up with a static type system that can handle dynamically reloading modules in live system (without full recompilation) and messages between processes. From drehman31@REDACTED Tue Aug 29 21:03:18 2006 From: drehman31@REDACTED (=?ISO-8859-1?Q?D=E1rio_Abdulrehman?=) Date: Tue, 29 Aug 2006 20:03:18 +0100 Subject: Erlang Book - again In-Reply-To: <6aeedf580608291201l269a589dw88f28fa30ccceec3@mail.gmail.com> References: <19037072-DD48-415D-A282-A51F91D780C6@citeulike.org> <6aeedf580608291201l269a589dw88f28fa30ccceec3@mail.gmail.com> Message-ID: <6aeedf580608291203i314ba76bxe418b4fef9faf80d@mail.gmail.com> I am learning Erlang from the book by Micka?l R?mond "Programmation Erlang". Unfortunately it is written in french so it is not accessible to a wider range of people. So far, it is a good read. -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangist@REDACTED Tue Aug 29 21:06:44 2006 From: erlangist@REDACTED (lang er) Date: Wed, 30 Aug 2006 03:06:44 +0800 Subject: Erlang does have problems In-Reply-To: <543853A7-5461-4A66-AE1F-563A72CD070C@gmail.com> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <230465c00608291134p1a34168fg2328ec27bdf3c348@mail.gmail.com> <543853A7-5461-4A66-AE1F-563A72CD070C@gmail.com> Message-ID: <230465c00608291206y7ce78063o5df69d4005bba812@mail.gmail.com> Thanks. Because I'm evaluating building our new server in Erlang.So I'm very concerned about these problems. > On Aug 29, 2006, at 7:34 PM, lang er wrote: > > > Would be these system reimplemented in Erlang or other languages if > > they have dropped ejabberd? > > Other languages. Are there any other problems,or mainly because string memory usage? > What's the status of Jabber.org? > > What do you mean? >From ejabberd: Jabber.org, the public Jabber server of the Jabber Software Foundation(JSF) migrated from jabberd 1.4 CVS to ejabberd 1.0.0on February 26, 2006 I think jabber.org has many registered users and very busy traffic , maybe the status of jabber.org can provide more informations about these problems. > Is this string-binary problem a language problem or ejabberd > > implementation issue? > > Both Erlang choosing to represent strings as lists of 4 or 8-byte > integers and ejabberd using strings to represent XML messages flowing > through the system. > > > Oh! So if a 64-bit machine is used..... But I guess it is not very difficult to fix this issue in future release(if the core team does think it is a problem), despite need add some complexities to compiler / VM. Best Regards! james -------------- next part -------------- An HTML attachment was scrubbed... URL: From yarivvv@REDACTED Tue Aug 29 21:12:04 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 29 Aug 2006 15:12:04 -0400 Subject: Erlang does have problems In-Reply-To: References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> Message-ID: <17244f480608291212w3dd67c26hcedbae7b74a3d53c@mail.gmail.com> > > Even the "flagship" Erlang apps have their problems. ejabberd uses > tons of memory because strings are being passed around as lists > despite being received as binaries from the socket. This is a problem > on 32-bit systems as it limits the number of users you can host and > it's a bigger problem on 64-bit systems as words are LARGER. If this is really THE problem for Erlang systems, I think Erlang should be extended with a native String type. It would have similar functions to lists, but be more efficient. It really doesn't sound like such an insurmountable issue to me, but maybe I'm understimating what it would take. > > Some high-profile messaging startups are using ejabberd now, although > they don't advertise it. They are also considering dropping ejabberd > and either going with a commercial implementation or writing their > own stuff. I know because I keep in touch with them. I know that Meebo, jabber.org, and Gizmo project all use Ejabberd and as far as I know they are happy with it. These are all very big deployments. > > Despite the Ericsson AXD 301 advocacy there are no high-profile > Erlang deployments that I know about. There should be and we should > all know! That is if we want Erlang to become mainstream. On the > other hand, why bother? Erlang doesn't have to become mainstream. It just has to make OUR lives easier. That's my take on it, anyway :) Best, Yariv From joelr1@REDACTED Tue Aug 29 21:14:31 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 20:14:31 +0100 Subject: Erlang does have problems In-Reply-To: <230465c00608291206y7ce78063o5df69d4005bba812@mail.gmail.com> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <230465c00608291134p1a34168fg2328ec27bdf3c348@mail.gmail.com> <543853A7-5461-4A66-AE1F-563A72CD070C@gmail.com> <230465c00608291206y7ce78063o5df69d4005bba812@mail.gmail.com> Message-ID: On Aug 29, 2006, at 8:06 PM, lang er wrote: > But I guess it is not very difficult to fix this issue in future > release(if > the core team does think it is a problem), despite need add some > complexities to compiler / VM. Use binaries. ejabberd already does this in some places, just not everywhere. -- http://wagerlabs.com/ From joelr1@REDACTED Tue Aug 29 21:16:02 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 20:16:02 +0100 Subject: Erlang does have problems In-Reply-To: <17244f480608291212w3dd67c26hcedbae7b74a3d53c@mail.gmail.com> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <17244f480608291212w3dd67c26hcedbae7b74a3d53c@mail.gmail.com> Message-ID: <0D8DBC59-D2BE-4CF0-BC0E-A826A9250A89@gmail.com> On Aug 29, 2006, at 8:12 PM, Yariv Sadan wrote: > If this is really THE problem for Erlang systems, I think Erlang > should be extended with a native String type. It would have similar > functions to lists, but be more efficient. Just use binaries (tm). > I know that Meebo, jabber.org, and Gizmo project all use Ejabberd and > as far as I know they are happy with it. Ask again, I can't point fingers ;-). -- http://wagerlabs.com/ From joelr1@REDACTED Tue Aug 29 21:21:44 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 20:21:44 +0100 Subject: erlmerge vs erlrt Message-ID: <3E92141B-8372-42B6-8CAB-AB5E193F4A2C@gmail.com> I'm late to the party. Which one should I use to deploy my apps? Thanks, Joel -- http://wagerlabs.com/ From david.nospam.hopwood@REDACTED Tue Aug 29 21:36:23 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Tue, 29 Aug 2006 20:36:23 +0100 Subject: Dynamic languages are the future In-Reply-To: References: <44F3AC58.9040306@duomark.com> <44F464EA.2080606@blueyonder.co.uk> Message-ID: <44F49737.6060904@blueyonder.co.uk> James Hague wrote: > On 8/29/06, David Hopwood wrote: > >> Maybe the "next generation", but not the generation after that. My >> impression is that there are few purely dynamically typed languages being >> designed any more. Type inference has won the argument. It will just take >> a while for this to filter through to the mainstream, as it always does. > > I disagree. Type inference simply prevents you from having to > manually specify many types. Indeed, the Erlang compiler already does > this where it can. It doesn't magically solve problems like coming up > with a static type system that can handle dynamically reloading > modules in live system (without full recompilation) and messages > between processes. These problems are in principle already solved for statically typed languages. Some of them are only solved in research papers (e.g. typing of first-class messages in ), others in real languages (e.g. open distribution in Alice ML or Acute), but there are no fundamental obstacles to doing *any* of these "dynamic" things in a language with static type inference. -- David Hopwood From serge@REDACTED Tue Aug 29 21:41:53 2006 From: serge@REDACTED (Serge Aleynikov) Date: Tue, 29 Aug 2006 15:41:53 -0400 Subject: os_mon memsup reporting memory consumption In-Reply-To: <44F478E4.4050905@hq.idt.net> References: <44F478E4.4050905@hq.idt.net> Message-ID: <44F49881.3010805@hq.idt.net> Sorry, there was an obvious typo in the post below. > Allocated = MemFree + Cached > > or even: > > Allocated = MemFree + Buffers + Cached should have been: Allocated = MemTotal - (MemFree + Cached) or even: Allocated = MemTotal - (MemFree + Buffers + Cached) Serge Aleynikov wrote: > We had a few high memory watermark alarms in a production system running > Linux reported by OS_MON whereas it seemed like the memory utilization > on the server wasn't bad. I looked at the implementation of the > memsup.erl module in OS_MON, and I believe the calculation of allocated > memory has a flow. > > Memsup's code (sited at the end) reveals that allocated memory doesn't > take in consideration cached memory. Since cached memory can be quickly > freed by the Linux memory manager if additional memory is needed by > applications, it looks to me that it should be: > > Allocated = MemFree + Cached > > or even: > > Allocated = MemFree + Buffers + Cached > > This would be consistent with what "free" is showing on the "-/+ > buffers/cache" line: > > drp@REDACTED: ~$ uname -a > Linux drpdb02.corp.idt.net 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST > 2005 i686 i686 i386 GNU/Linux > > drp@REDACTED: ~$ free > total used free shared buffers cached > Mem: 4150324 3416788 733536 0 282412 2621788 > -/+ buffers/cache: 512588 3637736 > Swap: 2048248 0 2048248 > > drp@REDACTED: ~$ head -4 /proc/meminfo > MemTotal: 4150324 kB > MemFree: 733536 kB > Buffers: 282412 kB > Cached: 2621788 kB > > > > %------------------------- > %% @spec get_memory_usage_linux() -> {Allocated, Total} > %------------------------- > get_memory_usage_linux() -> > Res = os:cmd("cat /proc/meminfo"), > case get_memory_usage_linux(Res, undef, undef) of > {MemTotal, MemFree} -> > {MemTotal-MemFree, MemTotal}; > error -> > timer:sleep(1000), > get_memory_usage_linux() > end. > > get_memory_usage_linux(_Str, Tot, Free) when is_integer(Tot), > is_integer(Free) -> > {Tot, Free}; > get_memory_usage_linux("MemTotal:"++T, _Tot0, Free0) -> > {ok, [N], Rest} = io_lib:fread("~d", T), > Tot = N*1024, > get_memory_usage_linux(skip_to_eol(Rest), Tot, Free0); > get_memory_usage_linux("MemFree:"++T, Tot0, _Free0) -> > {ok, [N], Rest} = io_lib:fread("~d", T), > Free = N*1024, > get_memory_usage_linux(skip_to_eol(Rest), Tot0, Free); > get_memory_usage_linux("", _Tot0, _Free0) -> > error; > get_memory_usage_linux(Str, Tot0, Free0) -> > get_memory_usage_linux(skip_to_eol(Str), Tot0, Free0). > %------------------------- > > Regards, > > Serge > -- Serge Aleynikov R&D Telecom, MIS, IDT Corp Tel: +1 (973) 438-3436 Fax: +1 (973) 438-1464 From yarivvv@REDACTED Tue Aug 29 21:52:26 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 29 Aug 2006 15:52:26 -0400 Subject: Erlang does have problems In-Reply-To: <543853A7-5461-4A66-AE1F-563A72CD070C@gmail.com> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <230465c00608291134p1a34168fg2328ec27bdf3c348@mail.gmail.com> <543853A7-5461-4A66-AE1F-563A72CD070C@gmail.com> Message-ID: <17244f480608291252w4a8dac0kb5020b3a5bd16811@mail.gmail.com> On 8/29/06, Joel Reymont wrote: > > On Aug 29, 2006, at 7:34 PM, lang er wrote: > > > Would be these system reimplemented in Erlang or other languages if > > they have dropped ejabberd? > > Other languages. Other languages have problems, too :) No language is perfect. The strings issue seems rather small in the grand scheme of things. There's a finite number of functions in the lists module, and they can all be implemented on top of native buffers. In the meantime, I'll add binaries support to ErlyDB :) Yariv From yarivvv@REDACTED Tue Aug 29 21:54:10 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 29 Aug 2006 15:54:10 -0400 Subject: Dynamic languages are the future In-Reply-To: References: <44F3AC58.9040306@duomark.com> <44F464EA.2080606@blueyonder.co.uk> Message-ID: <17244f480608291254i5da2d4bdp5906a5ef79b0f3f1@mail.gmail.com> On 8/29/06, James Hague wrote: > On 8/29/06, David Hopwood wrote: > > > > Maybe the "next generation", but not the generation after that. My impression > > is that there are few purely dynamically typed languages being designed any > > more. Type inference has won the argument. It will just take a while for this > > to filter through to the mainstream, as it always does. > > I disagree. Type inference simply prevents you from having to > manually specify many types. Indeed, the Erlang compiler already does > this where it can. It doesn't magically solve problems like coming up > with a static type system that can handle dynamically reloading > modules in live system (without full recompilation) and messages > between processes. > +1 If static typing were added to Erlang, (type inference included) Smerl and ErlyDB would be toast :) Yariv From joelr1@REDACTED Tue Aug 29 21:54:24 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 20:54:24 +0100 Subject: erlrt + yaws = error? Message-ID: <27E29057-DFBD-4907-B114-0FAD66735AB0@gmail.com> sudo ./start.sh Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] Erlang/OTP R11B-0 darwin-x86 stripped runtime environment Eshell V5.5 (abort with ^G) 1> yaws:start(). sh: line 1: exec: setuid_drv: not found Has anyone seen this? How do you work around? Thanks, Joel -- http://wagerlabs.com/ From yarivvv@REDACTED Tue Aug 29 22:25:04 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 29 Aug 2006 16:25:04 -0400 Subject: multiple patterns per clause? In-Reply-To: <20060829083126.GA8710@erix.ericsson.se> References: <17244f480608280747r4aaa36f9wcb72b33dd10fc95d@mail.gmail.com> <20060829083126.GA8710@erix.ericsson.se> Message-ID: <17244f480608291325k2414e7ddte7e5152068115f81@mail.gmail.com> Good point. Thanks! On 8/29/06, Raimo Niskanen wrote: > You could group the clauses a bit: > > case L of > [L1|_] when L1 =:= $f; L1 =:= $x -> > ok; > "abc"++_ -> > ok > _ -> > error > end > > On Mon, Aug 28, 2006 at 10:47:38AM -0400, Yariv Sadan wrote: > > Hi, > > > > Is it possible to have a single clause match multiple patterns in Erlang? > > > > Specifically, I want to test if a list has a number of different > > prefixes, all of which would lead to the same expression. > > > > This is what I want to write (pseudo code): > > > > L = "foo", > > case L of > > [$f|_]; > > [$x|_] ; > > [$a, $b, $c | _] -> > > ok; > > _ -> > > error > > end > > > > I know the above is illegal, so what's the easiest way of doing > > something similar in Erlang? > > > > Thanks in advance, > > Yariv > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > From mickael.remond@REDACTED Tue Aug 29 22:26:11 2006 From: mickael.remond@REDACTED (Mickael Remond) Date: Tue, 29 Aug 2006 22:26:11 +0200 Subject: Motorbikes does have problems (was Erlang does have problems) In-Reply-To: References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> Message-ID: <20060829202611.GA4002@memphis> Hello Guys, You know what ? I have heard that motorbikeis are difficult to drive. I even happen to know a Nobel Prize that cannot manage to drive his brand new motorbike. He his now seriously thinking about buy a Lincoln town car with driver. And I was about to forgot: hammers are not perfect. I did not manage to cut my chimney wood with them. Now a little quizz, what have motorbikes, cars, hammers, saw, Erlang, ejabberd, you name it, have in common ? Yes, right they are "tools". Tools have in common: - To fill a properly defined need, - To need know-how to make them usefull. Let's know discuss a thing that I know very well: ejabberd. I work for a company that develops ejabberd, employs the main ejabberd developers and have tens of customers running ejabberd. * Joel Reymont [2006-08-29 18:02:36 +0100]: > Even the "flagship" Erlang apps have their problems. ejabberd uses > tons of memory because strings are being passed around as lists > despite being received as binaries from the socket. This is a problem > on 32-bit systems as it limits the number of users you can host and > it's a bigger problem on 64-bit systems as words are LARGER. > > The ejabberd developers came up with a fix, they are loading expat (C > parser) as a driver. They are still using a port per message or per > connection (don't remember exactly) and blow through the number of > ports normally configured. Yes, you can up the number of ports but a > better solution would be to stop using strings and create a shared > pool of XML parser ports. Expat use is not at all related to a memory problem. It is related to effiency. The XMPP protocol rely on a stream parser. Expat is probably the most ancien, stable and efficient stream parser around. This is the reason why it is used in ejabberd. > Some high-profile messaging startups are using ejabberd now, although > they don't advertise it. They are also considering dropping ejabberd > and either going with a commercial implementation or writing their > own stuff. I know because I keep in touch with them. This sentence seems very definitive, but believe me, we probably are in contact with all the big ejabberd users. We are helping them making ejabberd working very well for them. We have tens of customers relying on ejabberd for strategic services: this means that if ejabberd is down they loose money. ejabberd has been deployed on sites with more than 135 000 simultaneously connected users. Some customers are switching from commercial implementation to ejabberd. We are working on architectural changes to support 500 000 simultaneous users. Believe me, from experience, I know that using a commercial software will not solve automagically the problem. ejabberd is a wonderfull tool. At this level, commercial software are also tool and you have to put the time and effort to make your solution work as well. However, ejabberd and Erlang work very well when the user consider them as a tool and not as a product. Running a service with this amount of users if _HARD_. Read my lips. _Very hard_. You cannot take a software out of the box deploy it and connects millions of users. Never. This happens in big hardware vendors commercials, but not in real life. You have to know the context of your deploiement. You have to know your tool very well. You have to change it, improve it, optimize it. This is what we are doing every days and our deployements are working extremely well. Reaching this level of knowledge and intimacy with your tool is a lot of work, but Erlang is very rewarding in this aspect. If you take it as a tool and are ready to doubt and question your approach and implementation it can do wonders. It happens sometimes however, that some of our contacts: - absolutly wants to deal with a product, where obviously their business model is based on differenciation. How could a product make them different ? - does not have the knowledge to operate the tool. - does not have the budget to have someone to help them operate the tool. This happens sometimes with startup. They put the money into hiring people, but cannot then justify to need other external know-how. > Despite the Ericsson AXD 301 advocacy there are no high-profile > Erlang deployments that I know about. There should be and we should > all know! That is if we want Erlang to become mainstream. On the > other hand, why bother? There are. I know many of them. I have not work of all of them but I have also learn about them year after year in the Erlang community. But as it is often explained in the Erlang community, companies having a strategic advantage with Erlang does not necessarily want it to be largely known and adopted. Erlang developers generally wants Erlang to have the bare minimum of growth to progress, but do not care about it being largely known or even largely used. Erlang is a competive advantage and as such you should forget what I have explained you previously in this mail. Please, Joel, do me a favor. Do not thow away a tool each time someone has trouble using it. Cheers, -- Micka?l R?mond http://www.process-one.net/ From tobbe@REDACTED Tue Aug 29 22:54:23 2006 From: tobbe@REDACTED (tobbe) Date: Tue, 29 Aug 2006 21:54:23 +0100 Subject: Erlang does have problems References: Message-ID: <20060829205423.A7A345A1F9@mail.erlangsystems.com> Quote: Despite the Ericsson AXD 301 advocacy there are no high-profile Erlang deployments that I know about. There should be and we should all know! That is if we want Erlang to become mainstream. On the other hand, why bother? (end of quote) What are you talking about ? I've been working with the Nortel SSL-accelerator (market no.1) and the Nortel SSL-VPN (market no.2) for many years. I'm now working with a 24-7 system that handles lots of customers and mucho dinero, all around the clock. All these systems are written in Erlang. And I know of other high-profile systems also written in Erlang. So what are you talking about, I mean really ? If you want to know, then go and read up on the Erlang proceedings that exist from the EUC and ACm Sigplan workshops. --Tobbe _________________________________________________________ Post sent from http://www.trapexit.org From tobbe@REDACTED Tue Aug 29 22:57:30 2006 From: tobbe@REDACTED (tobbe) Date: Tue, 29 Aug 2006 21:57:30 +0100 Subject: erlmerge vs erlrt References: Message-ID: <20060829205730.A4C6C5A1F4@mail.erlangsystems.com> erlmerge is dead it seems, go for erlrt --Tobbe _________________________________________________________ Post sent from http://www.trapexit.org From tobbe@REDACTED Tue Aug 29 23:02:06 2006 From: tobbe@REDACTED (tobbe) Date: Tue, 29 Aug 2006 22:02:06 +0100 Subject: erlrt + yaws = error? References: Message-ID: <20060829210206.7AB255A1FC@mail.erlangsystems.com> Are you running on Windoze or Linux (or what) ? If on linux, then I recommend installing the fd_server app from jungerl. and configure it in your yaws.conf file. --Tobbe _________________________________________________________ Post sent from http://www.trapexit.org From joelr1@REDACTED Tue Aug 29 23:02:17 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 22:02:17 +0100 Subject: Motorbikes does have problems (was Erlang does have problems) In-Reply-To: <20060829202611.GA4002@memphis> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <20060829202611.GA4002@memphis> Message-ID: <95825361-4A63-4938-BFB6-5C9050F25B0A@gmail.com> On Aug 29, 2006, at 9:26 PM, Mickael Remond wrote: > Expat use is not at all related to a memory problem. It is related to > effiency. The XMPP protocol rely on a stream parser. Expat is probably > the most ancien, stable and efficient stream parser around. This is > the > reason why it is used in ejabberd. I fully agree with you. I just got an idea to build on top of ejabberd and yaws. I'm also hipe-d by my recent porting experience :-). I might tackle a shared pool of expat drivers since I believe this is what's needed. Memory use can be easily improved by giving binaries to the expat driver since it takes them. This is not being done last time I looked, not everywhere. > Please, Joel, do me a favor. Do not thow away a tool each time someone > has trouble using it. Oh, I don't give up on Erlang. It's great for network programming so whenever I get to network programming I immediately think Erlang! It saddens me when someone else gives up on it but I always try to help and make sure people understand their options. Personally, I'm embarking on a new venture involving yaws and likely ejabberd. -- http://wagerlabs.com/ From klacke@REDACTED Tue Aug 29 23:09:35 2006 From: klacke@REDACTED (Claes Wikstom) Date: Tue, 29 Aug 2006 23:09:35 +0200 Subject: erlrt + yaws = error? In-Reply-To: <27E29057-DFBD-4907-B114-0FAD66735AB0@gmail.com> References: <27E29057-DFBD-4907-B114-0FAD66735AB0@gmail.com> Message-ID: <44F4AD0F.1020504@hyber.org> Joel Reymont wrote: > sudo ./start.sh > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] > > Erlang/OTP R11B-0 darwin-x86 stripped runtime environment > Eshell V5.5 (abort with ^G) > 1> yaws:start(). > sh: line 1: exec: setuid_drv: not found > > Has anyone seen this? How do you work around? > Two things, 1. You may have a broken yaws installation. 2. Yaws is started as application:start(yaws). /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control cellphone: +46 70 2097763 From bob@REDACTED Tue Aug 29 23:19:43 2006 From: bob@REDACTED (Bob Ippolito) Date: Tue, 29 Aug 2006 14:19:43 -0700 Subject: erlrt + yaws = error? In-Reply-To: <27E29057-DFBD-4907-B114-0FAD66735AB0@gmail.com> References: <27E29057-DFBD-4907-B114-0FAD66735AB0@gmail.com> Message-ID: <6a36e7290608291419i7c607a67p102fe8af0b0b7ce1@mail.gmail.com> On 8/29/06, Joel Reymont wrote: > sudo ./start.sh > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] > > Erlang/OTP R11B-0 darwin-x86 stripped runtime environment > Eshell V5.5 (abort with ^G) > 1> yaws:start(). > sh: line 1: exec: setuid_drv: not found > > Has anyone seen this? How do you work around? REPOS does not support Darwin/x86, and yaws is in REPOS. The sources to build REPOS packages are not available to my knowledge, you ought to just use a regular Erlang installation for now. -bob From joelr1@REDACTED Tue Aug 29 23:26:53 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 22:26:53 +0100 Subject: erlrt + yaws = error? In-Reply-To: <6a36e7290608291419i7c607a67p102fe8af0b0b7ce1@mail.gmail.com> References: <27E29057-DFBD-4907-B114-0FAD66735AB0@gmail.com> <6a36e7290608291419i7c607a67p102fe8af0b0b7ce1@mail.gmail.com> Message-ID: <21B1BC0E-43CC-4F30-8789-BB6BA6009B73@gmail.com> On Aug 29, 2006, at 10:19 PM, Bob Ippolito wrote: > REPOS does not support Darwin/x86, This seems rather arbitrary. Mickael, can I help? -- http://wagerlabs.com/ From joelr1@REDACTED Tue Aug 29 23:33:57 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 22:33:57 +0100 Subject: Erlang does have problems In-Reply-To: <20060829205423.A7A345A1F9@mail.erlangsystems.com> References: <20060829205423.A7A345A1F9@mail.erlangsystems.com> Message-ID: <2FB595B5-8C4B-43AC-A4A8-8995F68DF63F@gmail.com> On Aug 29, 2006, at 9:54 PM, tobbe wrote: > If you want to know, then go and read up on the Erlang proceedings > that exist from the EUC and ACm Sigplan workshops. I guess your definition of high-profile may vary. Can you name high- profile Rails deployments? I'm sure people can, even if they don't attend the Sigplan workshops. Anyway, I'm fine with keeping Erlang to myself and let everyone else read the proceedings. -- http://wagerlabs.com/ From mickael.remond@REDACTED Tue Aug 29 23:32:44 2006 From: mickael.remond@REDACTED (Mickael Remond) Date: Tue, 29 Aug 2006 23:32:44 +0200 Subject: Introducing ErlyDB: The Erlang Twist on Database Abstraction In-Reply-To: <17244f480608290746x35d378d0i894001f785797837@mail.gmail.com> References: <17244f480608290746x35d378d0i894001f785797837@mail.gmail.com> Message-ID: <20060829213244.GA5973@memphis> Hello Yariv, * Yariv Sadan [2006-08-29 10:46:04 -0400]: > Hi, > > I created a nice little database abstraction layer generator called > ErlyDB. It's designed to bridge the sematic gap when interacting with > SQL databases with minimal overhead. > > Here's the official announcement, with a tutorial: > > http://yarivsblog.com/articles/2006/08/29/introducing-erlydb-the-erlang-twist-on-database-abstraction I feel that you have taken the good approach. This looks promising. Very Erlangish and very buzz oriented :-) -- Micka?l R?mond http://www.process-one.net/ From taavi@REDACTED Tue Aug 29 23:36:18 2006 From: taavi@REDACTED (Taavi Talvik) Date: Wed, 30 Aug 2006 00:36:18 +0300 Subject: Motorbikes does have problems (was Erlang does have problems) In-Reply-To: <95825361-4A63-4938-BFB6-5C9050F25B0A@gmail.com> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <20060829202611.GA4002@memphis> <95825361-4A63-4938-BFB6-5C9050F25B0A@gmail.com> Message-ID: On Aug 30, 2006, at 12:02 AM, Joel Reymont wrote: > > On Aug 29, 2006, at 9:26 PM, Mickael Remond wrote: > >> Expat use is not at all related to a memory problem. It is related to >> effiency. The XMPP protocol rely on a stream parser. Expat is probably >> the most ancien, stable and efficient stream parser around. This is >> the >> reason why it is used in ejabberd. > > I fully agree with you. I just got an idea to build on top of ejabberd > and yaws. I'm also hipe-d by my recent porting experience :-). I might > tackle a shared pool of expat drivers since I believe this is what's > needed. Memory use can be easily improved by giving binaries to the > expat driver since it takes them. This is not being done last time I > looked, not everywhere. erlsom is quite promising. XML is thought as really generic solution for all possible problems with generic parsers to handle it. Principle of universal effectiveness: More generic tool is - less efficient. More specialized tool is - more efficient. best regards, taavi From yarivvv@REDACTED Tue Aug 29 23:36:41 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 29 Aug 2006 17:36:41 -0400 Subject: Introducing ErlyDB: The Erlang Twist on Database Abstraction In-Reply-To: <20060829213244.GA5973@memphis> References: <17244f480608290746x35d378d0i894001f785797837@mail.gmail.com> <20060829213244.GA5973@memphis> Message-ID: <17244f480608291436j2755dcb2g4846ef8571b8d957@mail.gmail.com> Thanks! In a few months, there will be few doubters that Erlang is the ultimate language for all kind of backends -- web, telcom, IM, whatever. ErlyDB is just the start :) Thank you for creating such a great language -- you know who you are :) Best, Yariv > I feel that you have taken the good approach. This looks promising. Very > Erlangish and very buzz oriented :-) > > -- > Micka?l R?mond > http://www.process-one.net/ > From bob@REDACTED Tue Aug 29 23:40:11 2006 From: bob@REDACTED (Bob Ippolito) Date: Tue, 29 Aug 2006 14:40:11 -0700 Subject: erlrt + yaws = error? In-Reply-To: <21B1BC0E-43CC-4F30-8789-BB6BA6009B73@gmail.com> References: <27E29057-DFBD-4907-B114-0FAD66735AB0@gmail.com> <6a36e7290608291419i7c607a67p102fe8af0b0b7ce1@mail.gmail.com> <21B1BC0E-43CC-4F30-8789-BB6BA6009B73@gmail.com> Message-ID: <6a36e7290608291440q60d3bba1t950f3962197a0a1f@mail.gmail.com> On 8/29/06, Joel Reymont wrote: > > On Aug 29, 2006, at 10:19 PM, Bob Ippolito wrote: > > > REPOS does not support Darwin/x86, > > This seems rather arbitrary. Mickael, can I help? > It is rather arbitrary... Even if REPOS did support Darwin/x86, erlrt's build script strips all symbols from all executables. If there was a Darwin/x86 setuid_drv with REPOS' yaws you still wouldn't be able to use it with erlrt unless you patch the build script to not strip or to use strip -S and recompile. I sent some patches a few weeks ago, but I don't think anything has happened. The source version of erlrt also doesn't seem to include the scripts to generate the bootstrap shell script. FYI, if you configure yaws embedded, you'll skip any code path that depends on setuid_drv, and it will work with erlrt as-is... Given the two or three days I wasted trying to get that stuff to work, I can't recommend bothering just yet until these issues get resolved. -bob From joelr1@REDACTED Tue Aug 29 23:42:21 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 22:42:21 +0100 Subject: Motorbikes does have problems (was Erlang does have problems) In-Reply-To: References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <20060829202611.GA4002@memphis> <95825361-4A63-4938-BFB6-5C9050F25B0A@gmail.com> Message-ID: <621348E7-C579-4AF9-8D7E-00A382A3234C@gmail.com> On Aug 29, 2006, at 10:36 PM, Taavi Talvik wrote: > erlsom is quite promising. > > XML is thought as really generic solution for all possible problems > with > generic parsers to handle it. Erlsom schema for RSS, anyone? -- http://wagerlabs.com/ From joelr1@REDACTED Tue Aug 29 23:44:18 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 22:44:18 +0100 Subject: erlrt + yaws = error? In-Reply-To: <6a36e7290608291440q60d3bba1t950f3962197a0a1f@mail.gmail.com> References: <27E29057-DFBD-4907-B114-0FAD66735AB0@gmail.com> <6a36e7290608291419i7c607a67p102fe8af0b0b7ce1@mail.gmail.com> <21B1BC0E-43CC-4F30-8789-BB6BA6009B73@gmail.com> <6a36e7290608291440q60d3bba1t950f3962197a0a1f@mail.gmail.com> Message-ID: On Aug 29, 2006, at 10:40 PM, Bob Ippolito wrote: > FYI, if you configure yaws embedded, you'll skip any code path that > depends on setuid_drv, and it will work with erlrt as-is... Given the > two or three days I wasted trying to get that stuff to work, I can't > recommend bothering just yet until these issues get resolved. Well, I need yaws, pgsql, ejabberd and probably a few other things. I never bothered with jungerl (too cumbersome?) and I have high hopes for erlrt. In the meantime, back to manual configuration I go. -- http://wagerlabs.com/ From joelr1@REDACTED Tue Aug 29 23:46:15 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 22:46:15 +0100 Subject: Screen scraping Message-ID: <1F5AC999-33E9-4ACC-AE63-D1CA00D3E11B@gmail.com> Does anyone have tools for screen scraping with Erlang? It's a combination of HTTP client with parsing and regexp-ing through HTML. Ruby has nice tools for this like hpricot and scrAPI and they parse HTML into a structure and let you query for elements based on their class, id, name, etc. Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Tue Aug 29 23:52:26 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 29 Aug 2006 22:52:26 +0100 Subject: erlrt + yaws = error? In-Reply-To: <20060829210206.7AB255A1FC@mail.erlangsystems.com> References: <20060829210206.7AB255A1FC@mail.erlangsystems.com> Message-ID: <9623D6B4-D211-4AE0-ADB2-EBEFAEAEE385@gmail.com> On Aug 29, 2006, at 10:02 PM, tobbe wrote: > > Are you running on Windoze or Linux (or what) ? > > If on linux, then I recommend installing the fd_server app > from jungerl. and configure it in your yaws.conf file. I'm running Mac OSX/Intel. Why would I bother with fd_server? Thanks, Joel -- http://wagerlabs.com/ From lennart.ohman@REDACTED Wed Aug 30 00:19:41 2006 From: lennart.ohman@REDACTED (Lennart Ohman) Date: Wed, 30 Aug 2006 00:19:41 +0200 Subject: What is a Supervisor REALLY doing? In-Reply-To: Message-ID: <001901c6cbb9$393e2480$0200a8c0@st.se> Hi! > I have no book and have taken no class. I'm in > southern california and have been fiddling with erlang > for a month. I understand the PURPOSE of a supervisor. > To monitor child(?) process states. > > > It is not just to monitor. It is it monitor and restart processes as > specified. I like to add that to start with, one of the important things with the supervisor and the hierarchy of processes you can build is that you get a deterministic start-up of your system. Meaning that a supervisor does not begin to start its next-in-line child (according to the order of the children in the "children specification") until the previous one is finished with its "init-phase". (Being finished with the init-phase means that the init-function of the child has returned. Note that supervisors start their children in its init-phase). Best Regards, Lennart ------------------------------------------------------------- Lennart Ohman office : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 67 35 Sehlstedtsgatan 6 fax : +46-8-667 82 30 SE-115 28, STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > -----Original Message----- > From: owner-erlang-questions@REDACTED [mailto:owner-erlang- > questions@REDACTED] On Behalf Of Chandru > Sent: Tuesday, August 29, 2006 8:11 PM > To: Jeff Crane > Cc: erlang-questions@REDACTED > Subject: Re: What is a Supervisor REALLY doing? > > Hi Jeff, > > > On 29/08/06, Jeff Crane wrote: > > I have no book and have taken no class. I'm in > southern california and have been fiddling with erlang > for a month. I understand the PURPOSE of a supervisor. > To monitor child(?) process states. > > > It is not just to monitor. It is it monitor and restart processes as > specified. > > > > This is the only implementation of Supervisor > behaviour I can find (it's near the bottom). > > http://www.matt- > mcdonnell.com/code/code_erl/erl_course/erl_course.html > > Is this ms.erl an accurate representation of a > Supervisor implementation? > > > Have you seen supervisor.erl in the stdlib application which comes with > Erlang/OTP? > > > > I can't find any documentation for an erlang > supervisor. The examples I can find on the web: > > > http://www.erlang.org/doc/doc-5.5/lib/stdlib-1.14/doc/html/supervisor.html > > > > From an erlang beginner's perspective this is a > completely uncomprehensible mechanism. For example: > > http://www.erlang.org/doc/doc- > 5.4.12/doc/design_principles/sup_princ.html > > -module(ch_sup). > -behaviour(supervisor). %% Why can't a I find the > actual implementation of this behaviour, defined line > by line so I understand what's going on? > > -export([start_link/0]). > -export([init/1]). > > start_link() -> %% Where, when, why would I call this? > > > This is called by the supervisor module. Basically, if you want a > process to be supervised, you write a child specification. From the > documentation, it looks like this: > > > child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules} > > Id = term() > StartFunc = {M,F,A} > M = F = atom() > A = [term()] > Restart = permanent | transient | temporary > Shutdown = brutal_kill | int()>=0 | infinity > Type = worker | supervisor > Modules = [Module] | dynamic > > Module = atom() > > > > I can't understand how to add a supervisor without a > solid understanding of how they work. This is one of > many problems I have had trying to learn erlang. > > > Have a read through the documentation and I'm sure it'll answer a lot of > your questions. All OTP behaviours are part of the stdlib application. > > cheers > Chandru > > From robert.virding@REDACTED Wed Aug 30 00:36:49 2006 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 30 Aug 2006 00:36:49 +0200 Subject: Just testing Message-ID: <44F4C181.40607@telia.com> I apologise for the inconvenience. From ryanobjc@REDACTED Wed Aug 30 02:25:19 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Tue, 29 Aug 2006 17:25:19 -0700 Subject: Introducing ErlyDB: The Erlang Twist on Database Abstraction In-Reply-To: <17244f480608291436j2755dcb2g4846ef8571b8d957@mail.gmail.com> References: <17244f480608290746x35d378d0i894001f785797837@mail.gmail.com> <20060829213244.GA5973@memphis> <17244f480608291436j2755dcb2g4846ef8571b8d957@mail.gmail.com> Message-ID: <78568af10608291725r791d93fcj1fc1c7cabebc6c2@mail.gmail.com> When are transactions going to be added? What is your plan for transactions? -ryan On 8/29/06, Yariv Sadan wrote: > Thanks! > > In a few months, there will be few doubters that Erlang is the > ultimate language for all kind of backends -- web, telcom, IM, > whatever. ErlyDB is just the start :) > > Thank you for creating such a great language -- you know who you are :) > > Best, > Yariv > > > I feel that you have taken the good approach. This looks promising. Very > > Erlangish and very buzz oriented :-) > > > > -- > > Micka?l R?mond > > http://www.process-one.net/ > > > From joelr1@REDACTED Wed Aug 30 02:36:35 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 01:36:35 +0100 Subject: Erlang on Solaris x86 Message-ID: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> Folks, Is anyone running Erlang on Solaris x86? I'm looking to sign up for a TextDrive container to run Yaws, ejabberd and PostgreSQL. I know that under Linux I would need kernel poll. Do I need anything extra for Solaris x86? Thanks, Joel [1] http://www.textdrive.com/hosting/container From chris.double@REDACTED Wed Aug 30 02:59:02 2006 From: chris.double@REDACTED (Chris Double) Date: Wed, 30 Aug 2006 12:59:02 +1200 Subject: Screen scraping In-Reply-To: <1F5AC999-33E9-4ACC-AE63-D1CA00D3E11B@gmail.com> References: <1F5AC999-33E9-4ACC-AE63-D1CA00D3E11B@gmail.com> Message-ID: On 8/30/06, Joel Reymont wrote: > Does anyone have tools for screen scraping with Erlang? I've done screen scraping with Erlang but I don't use anything sophisticated. I have a function that, given a tag, returns the contents between those tags,and another that returns an array of child tags nested within another tag. Using that I access tabular data fairly easily (for my purposes) and then use string search for attributes etc. I'd be interested in anything out there that is more sophisticated. One advantage of simple string searches is it handles bad HTML a bit easier. Chris. -- http://www.bluishcoder.co.nz From yarivvv@REDACTED Wed Aug 30 03:21:03 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 29 Aug 2006 21:21:03 -0400 Subject: Introducing ErlyDB: The Erlang Twist on Database Abstraction In-Reply-To: <78568af10608291725r791d93fcj1fc1c7cabebc6c2@mail.gmail.com> References: <17244f480608290746x35d378d0i894001f785797837@mail.gmail.com> <20060829213244.GA5973@memphis> <17244f480608291436j2755dcb2g4846ef8571b8d957@mail.gmail.com> <78568af10608291725r791d93fcj1fc1c7cabebc6c2@mail.gmail.com> Message-ID: <17244f480608291821q265558bbu3b7f54424747ad10@mail.gmail.com> If we're luck -- tomorrow. Otherwise, next week. I'm moving to a new apartment on thursday so I'll be derailed from erlydb development for a short while. I will promise one thing: transaction handling in ErlyDB will be *very* nice :) Yariv On 8/29/06, Ryan Rawson wrote: > When are transactions going to be added? What is your plan for transactions? > > -ryan > > On 8/29/06, Yariv Sadan wrote: > > Thanks! > > > > In a few months, there will be few doubters that Erlang is the > > ultimate language for all kind of backends -- web, telcom, IM, > > whatever. ErlyDB is just the start :) > > > > Thank you for creating such a great language -- you know who you are :) > > > > Best, > > Yariv > > > > > I feel that you have taken the good approach. This looks promising. Very > > > Erlangish and very buzz oriented :-) > > > > > > -- > > > Micka?l R?mond > > > http://www.process-one.net/ > > > > > > From hal@REDACTED Wed Aug 30 05:09:47 2006 From: hal@REDACTED (Hal Snyder) Date: Tue, 29 Aug 2006 22:09:47 -0500 Subject: Erlang on Solaris x86 In-Reply-To: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> References: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> Message-ID: <91974EEB-9C32-433D-A374-BD2BA5F51407@vailsys.com> What do you mean by "extra"? We run a Erlang on a network of a hundred or so x86 Solaris servers, mostly Solaris 9. On Aug 29, 2006, at 7:36 PM, Joel Reymont wrote: > Folks, > > Is anyone running Erlang on Solaris x86? I'm looking to sign up for > a TextDrive container to run Yaws, ejabberd and PostgreSQL. I know > that under Linux I would need kernel poll. Do I need anything extra > for Solaris x86? > > Thanks, Joel > > [1] http://www.textdrive.com/hosting/container > > > From ke.han@REDACTED Wed Aug 30 05:24:36 2006 From: ke.han@REDACTED (ke han) Date: Wed, 30 Aug 2006 11:24:36 +0800 Subject: Screen scraping In-Reply-To: <1F5AC999-33E9-4ACC-AE63-D1CA00D3E11B@gmail.com> References: <1F5AC999-33E9-4ACC-AE63-D1CA00D3E11B@gmail.com> Message-ID: <3CCC08A4-9254-48C9-8F6A-FBB3691C9A18@redstarling.com> Joel, How about jungerl's www_tools ?? Here is a snippet of its example code to show you how easy it is to tokenize an HTML stream or file and harvest element of interest: %%******************************** file(File) -> Toks = html_tokenise:file2toks(File), analyse(Toks). analyse(Toks) -> Hrefs = [H || {tagStart, "a", L} <- Toks, {"href", H} <- L], Images1 = [S || {tagStart, "img", L} <- Toks, {"src", S} <- L], Images2 = [S || {tagStart, "body", L} <- Toks, {"background", S} <- L], {remove_duplicates(Hrefs), remove_duplicates(Images1++Images2)}. %%******************************** ke han On Aug 30, 2006, at 5:46 AM, Joel Reymont wrote: > Does anyone have tools for screen scraping with Erlang? > > It's a combination of HTTP client with parsing and regexp-ing > through HTML. Ruby has nice tools for this like hpricot and scrAPI > and they parse HTML into a structure and let you query for elements > based on their class, id, name, etc. > > Thanks, Joel > > -- > http://wagerlabs.com/ > > > > > From xlcr@REDACTED Wed Aug 30 07:40:43 2006 From: xlcr@REDACTED (Nick Linker) Date: Wed, 30 Aug 2006 12:40:43 +0700 Subject: Dynamic languages are the future In-Reply-To: <44F3D20B.7020104@duomark.com> References: <44F3AC58.9040306@duomark.com> <44F3AF6C.1030003@einfo.com> <44F3D20B.7020104@duomark.com> Message-ID: <44F524DB.10405@mail.ru> Jay Nelson wrote: > Hmm, my recollection was building commercial apps in Common Lisp and > CLOS, not Scheme. I have yet to meet any language as powerful and > would take it back -- well, I think I like what erlang has to offer > better, but only because I've already done Lisp and my needs are > different now. > > Lisp gave you the power to do whatever you needed to do. You could > avoid the power or you could use it. The language didn't try to > protect you from making mistakes, it just gave you the choice to use > the power. It was not a horrible flaw that enabled that approach. I wonder why Erlang is not Lisp? I mean why inventors of Erlang chose to create its own language instead of creating just ERTS-specific library for LISP (or at least Scheme)? Parentheses? :-) Best regards, Nick. From ke.han@REDACTED Wed Aug 30 08:00:27 2006 From: ke.han@REDACTED (ke han) Date: Wed, 30 Aug 2006 14:00:27 +0800 Subject: Erlang on Solaris x86 In-Reply-To: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> References: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> Message-ID: Joel, I tested erlang (10B-something), did not install yaws or ejabberd, on Solaris x86 briefly and it works. Nothing thorough enough to know if its clear for production. My testing was done with Solaris 10 as a VMware guest. BTW, I TextDrive might sell you containers on their Niagra servers as well as what they currently advertise for their Opteron ones. I sent a few rounds of email with one of their sales people on this. My only problem was I can get more horsepower from my own dedicated server than with the current pricing on the TextDrive containers (there are obviously other benefits to their container solution than raw horsepower of your own dedicated server but I was worried about their cost structure as my app needed more resource). I think TextDrive has a winning strategy...lets hope guys like me can find it affordable ;-)... ke han On Aug 30, 2006, at 8:36 AM, Joel Reymont wrote: > Folks, > > Is anyone running Erlang on Solaris x86? I'm looking to sign up for > a TextDrive container to run Yaws, ejabberd and PostgreSQL. I know > that under Linux I would need kernel poll. Do I need anything extra > for Solaris x86? > > Thanks, Joel > > [1] http://www.textdrive.com/hosting/container > > > From dmitriid@REDACTED Wed Aug 30 08:24:49 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Wed, 30 Aug 2006 09:24:49 +0300 Subject: Erlang for web-developers In-Reply-To: <17244f480608291016t3570ea02pb709a9c8528edc05@mail.gmail.com> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <17244f480608291016t3570ea02pb709a9c8528edc05@mail.gmail.com> Message-ID: :)) I've already triple-wow'ed in your blog :)) I guess, more wow's are on the way :)) On 8/29/06, Yariv Sadan wrote: > > In a couple of months your opinion will be drastically different ;) > > Yariv > > On 8/29/06, Dmitrii Dimandt wrote: > > Well, to add this to the mix: > > > > Erlang is actually not suited very well for anything, but, well, telecom > > applications :) > > > > Despite Yaws, it cannot be used as a web-development tool right out of > the > > box (Unicode, indexed search anyone) > > Despite C- and Java- bindings, Erlang cannot be used for desktop > > applications, because, well, you'll have to implement _a lot_ of stuff > from > > ground up in Java or C/C++ just to make things communicate with Erlang > > > > As a control box? Yes, definitely. As a ready-togo solution? Probably, > not. > > > > And there are both advantages and disadvantages to that, as there always > > are, but I think, that if Erlang community could focus on the > > disadvantages... Man, this could be the next killer-language :) (Ruby is > > slowly filling the void, and C# 3.0 is around the corner, and there is > that > > curious little fellow by the name of Nemerle...) > > > > > > On 8/29/06, Thomas Lindgren < thomasl_erlang@REDACTED> wrote: > > > > > > > > > --- Andr?s Valenciano < andres-lists@REDACTED> > > > wrote: > > > > > > > ke han wrote: > > > > > This does add to the erlang sales pitch problem. > > > > > > > > Yes it is a problem, some times when others have > > > > used only one tool for > > > > everything for years and before that another tool > > > > for everything...they > > > > are difficult people to talk to or persuade to > > > > change from their comfort > > > > zone about development. > > > > > > > > Most of the things I heard were the same that were > > > > thrown to the Rails > > > > guys: pool of people to work with the "technology", > > > > "enterprise > > > > standard" for web apps, blah blah blah (well, not > > > > one thing about > > > > scalability in this case :) ) > > > > > > Most developers and managers play "follow the leader" > > > and get upset if there are several ones :-) But those > > > guys are basically the prize of the winner, and there > > > is little point in trying to convince them at this > > > stage. > > > > > > Instead, I think what is needed is a community of > > > technical pioneers, who overcome real problems and > > > codify them into software solutions. This is > > > attractive to people who are having problems and are > > > willing to try something new. In this specific case, > > > an "OTP for web developers", perhaps? > > > > > > Basically, these pioneers will be the core of the > > > snowball at the top of the hill, and the followers > > > will be the big outer layer at the bottom. > > > > > > Best, > > > Thomas > > > > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Tired of spam? Yahoo! Mail has the best spam protection around > > > http://mail.yahoo.com > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitriid@REDACTED Wed Aug 30 08:32:32 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Wed, 30 Aug 2006 09:32:32 +0300 Subject: Erlang Book - again In-Reply-To: References: Message-ID: On 8/29/06, Joe Armstrong (TN/EAB) wrote: > > I don't think PH could be forced to do this - persuaded perhaps - forced > no. > Well, that's what I meant. More or less :) I'll write and ask them. > > The book is however sadly out of date. > It still could be a good read, I think. For those who are interested I have started writing a new book. > It has proved to be difficult to find a publisher so I will be using a print > on demand service to print the book. > > I hope you'll all buy it. If you want any particular material covering > send me a mail. > Yes. Considering the fact that I'm already eyeing the old book on Amazon UK, I'll definitely by the new one! /Joe > > > > > > > > ------------------------------ > *From:* owner-erlang-questions@REDACTED [mailto: > owner-erlang-questions@REDACTED] *On Behalf Of *Dmitrii Dimandt > *Sent:* den 29 augusti 2006 17:26 > *To:* Erlang-Questions Mailing List > *Subject:* Erlang Book - again > > What are the chances of "Concurrent Programming in Erlang" book becoming > available online in its entirety? > > Why I'm asking this is that the book is clearly out of print (see Amazon > hereand > here). > The only available books are available at ridiculous prices > . > > Practical Common Lisp has been online > forever, it seems. And the publisher gave the author perennial rights to > publish the book on the web. > Moreover, Paul Graham's "On Lisp" is now also available for download > . > > May be Prentice Hall could be forced into giving the rights to the book > back to its authors? And may be the authors could be persuaded to create an > online copy of it? :) > > Or, better still, may be the authors could be persuaded to write a new > book :) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe.armstrong@REDACTED Wed Aug 30 08:57:01 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Wed, 30 Aug 2006 08:57:01 +0200 Subject: Motorbikes does have problems (was Erlang does have problems) In-Reply-To: <20060829202611.GA4002@memphis> Message-ID: Hi Michael, You're right my Royal Enfield Bullet is an absolute bugger to start. << if you're good you can have a try when you come to the Erlang conferense >> It also half crippled Mike Williams (one of the Erlang fathers) who thought he would demonstrate how to kick start a 550 cc single cylinder machine, he used to ride a matchless so he thought he knew what he was doing ... It took about a year to be able to start it. Here's the correct technique: 1) fuel on 2) full choke 3) Depress valve lifter and kick slowly six times (to fill the carburettor with gas) 5) Depress valve lifter 6) Move kick start to just beyond top dead centre 7) Release valve lifter 8) Depress kick start by about 15% until you feel some resistance 9) Twist gas control by about 20% 10) Put one foot on kick start, other on ground 11) Hold *both* handle bars, while, maintaining 9) 12) Throw yourself into air 13) Land on kick start, with the "kick from hell" making sure that you "follow through" ie the final resting position of the kick start is when it bumps into the foot rest If you do all of the exactly right - then it will start on the fist kick. Now this technique took about a year to learn. By comparison installing and starting PHP, Apache and Mysql is really easy. And yaws is much easier /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Mickael Remond > Sent: den 29 augusti 2006 22:26 > To: Joel Reymont > Cc: Dmitrii Dimandt; Thomas Lindgren; Erlang-Questions Mailing List > Subject: Motorbikes does have problems (was Erlang does have problems) > > Hello Guys, > > You know what ? > I have heard that motorbikeis are difficult to drive. I even > happen to know a Nobel Prize that cannot manage to drive his > brand new motorbike. > He his now seriously thinking about buy a Lincoln town car > with driver. > From klacke@REDACTED Wed Aug 30 09:19:40 2006 From: klacke@REDACTED (Claes Wikstrom) Date: Wed, 30 Aug 2006 09:19:40 +0200 Subject: Screen scraping In-Reply-To: References: <1F5AC999-33E9-4ACC-AE63-D1CA00D3E11B@gmail.com> Message-ID: <44F53C0C.1020208@hyber.org> Chris Double wrote: > On 8/30/06, Joel Reymont wrote: >> Does anyone have tools for screen scraping with Erlang? > There is a decent and forgiving HTML parser in the Yaws source tree written by Johan bevemyr. I'd start with that. /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control cellphone: +46 70 2097763 From ke.han@REDACTED Tue Aug 29 16:45:35 2006 From: ke.han@REDACTED (Jon Hancock) Date: Tue, 29 Aug 2006 22:45:35 +0800 Subject: 5 second Erlang Submission In-Reply-To: <22252.194.72.110.12.1156843699.squirrel@backawinner.gg> References: <47404.194.72.110.12.1156409962.squirrel@backawinner.gg> <22252.194.72.110.12.1156843699.squirrel@backawinner.gg> Message-ID: <622AABCC-E837-4F5D-B5F8-3EDFB686A5FF@mac.com> 3 seconds... " 'Selective receive' is the unit test !!!" ke han On Aug 29, 2006, at 5:28 PM, Gordon Guthrie wrote: >> gordonguthrie@REDACTED (Gordon Guthrie) writes: >> |> Erlang was designed by people who build products. All other >> languages >> were >> |> designed by people who build languages. Do you build products? >> >> C was designed at Bell Labs, and it first use was in ESS#4 >> telephony switches and in UNIX. C is an execllent language for its >> purpose, Erlang is good for it's purpose. I think you could make >> table: >> >> Algol: Language designers >> Pascal: Teaching >> Lisp: Language desigers >> Ada: Language designers >> C: Product designers >> Simula: People want to simulate things (also object orienters) >> CLU: The mother of true object orientation >> Erlang: Product designers >> C++: Religious object orientation >> Haskel: Language designer >> Mercury: ? >> ML: Language designers >> >> Probably I've got a lot wrong here :-) > > Allow me to rephrase: > > All other languages ride in the imperpial triumphal chariot wearing > purple, whilst Erlang is the slave behind them whispering "Respice > post > te! Programmem te memento!" > > (Look behind you! You are but a programme). > > Gordon > > Cue jokes about C-sar and C++sar, Lisp will be the Emperor > Claudius, etc, > etc... From john456ar@REDACTED Wed Aug 30 09:01:28 2006 From: john456ar@REDACTED (john Arman) Date: Wed, 30 Aug 2006 00:01:28 -0700 (PDT) Subject: Leaky bucket algorithm Message-ID: <20060830070128.24783.qmail@web58614.mail.re3.yahoo.com> Hi all , how to apply Leaky bucket algorithm for congesstion control ?? I want to apply this for reading online log files.. Regards, John Arman --------------------------------- Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small Business. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitriid@REDACTED Wed Aug 30 10:12:29 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Wed, 30 Aug 2006 11:12:29 +0300 Subject: Erlang does have problems In-Reply-To: <0D8DBC59-D2BE-4CF0-BC0E-A826A9250A89@gmail.com> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <17244f480608291212w3dd67c26hcedbae7b74a3d53c@mail.gmail.com> <0D8DBC59-D2BE-4CF0-BC0E-A826A9250A89@gmail.com> Message-ID: On 8/29/06, Joel Reymont wrote: > > > On Aug 29, 2006, at 8:12 PM, Yariv Sadan wrote: > > > If this is really THE problem for Erlang systems, I think Erlang > > should be extended with a native String type. It would have similar > > functions to lists, but be more efficient. > > Just use binaries (tm). This could be problematic for the developer who is not very well versed in the fine arts of strings, binaries, conversions, encodings, etc etc etc :) Especially for us, poor folks from non-English-speaking countries ;) -------------- next part -------------- An HTML attachment was scrubbed... URL: From richardc@REDACTED Wed Aug 30 10:17:06 2006 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 30 Aug 2006 10:17:06 +0200 Subject: Dynamic languages are the future In-Reply-To: <44F524DB.10405@mail.ru> References: <44F3AC58.9040306@duomark.com> <44F3AF6C.1030003@einfo.com> <44F3D20B.7020104@duomark.com> <44F524DB.10405@mail.ru> Message-ID: <44F54982.8030406@it.uu.se> Nick Linker wrote: > I wonder why Erlang is not Lisp? I mean why inventors of Erlang chose > to create its own language instead of creating just ERTS-specific > library for LISP (or at least Scheme)? Here are some reasons why Lisp might not be a perfect match to the problem they wanted to solve: - no built-in concurrency - destructive updates abound (in Scheme, too) - no pattern matching And if you're going to fix those things, you might as well use a syntax that feels more comfortable to you. In particular, pattern matching makes function definitions and selective receives much more readable, which I assume was an important goal for the kind of industrial applications that Erlang was created for. In most respects, Erlang _is_ a concurrent, nondestructive Lisp with a Prolog-inspired syntax that focuses on pattern matching and rules. /Richard From avindev@REDACTED Wed Aug 30 10:22:28 2006 From: avindev@REDACTED (Arbow) Date: Wed, 30 Aug 2006 16:22:28 +0800 Subject: Error reported when using pmap Message-ID: Hi All: I am new in Erlang, and try the pmap at http://www.erlang.org/ml-archive/erlang-questions/200606/msg00187.html: In file test.erl: -module(test). -export([pmap/2]). pmap(F, L) -> S = self(), Pids = list:map( fun(I) -> spawn( fun() -> do_f(S, F, I) end) end, L), gather(Pids). gather([H|T]) -> receive {H, Ret} -> [Ret|gather(T)] end; gather([]) -> []. do_f(Parent, F, I) -> io:format("Receive item ~w~n", [I]), Parent ! {self(), (catch F(I))}. In file testmain.erl: -module(testmain). -export([test3/0]). test3() -> MyList = [1,2,3,4,5,6,7,8,9,10], lists:map(fun(I) -> I*2 end, MyList). when I execute " testmain:test3(). ", I get errors: =ERROR REPORT==== 30-Aug-2006::16:21:51 === Error in process <0.36.0> on node 'Erlide_2960df@REDACTED' with exit value: {undef,[{testmain,test3,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} ** exited: {undef,[{testmain,test3,[]}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** Anyone could help me? Thanks. Best regards. Arbow -------------- next part -------------- An HTML attachment was scrubbed... URL: From christophe.romain@REDACTED Wed Aug 30 10:24:48 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Wed, 30 Aug 2006 10:24:48 +0200 Subject: erlrt + yaws = error? In-Reply-To: <6a36e7290608291440q60d3bba1t950f3962197a0a1f@mail.gmail.com> References: <27E29057-DFBD-4907-B114-0FAD66735AB0@gmail.com> <6a36e7290608291419i7c607a67p102fe8af0b0b7ce1@mail.gmail.com> <21B1BC0E-43CC-4F30-8789-BB6BA6009B73@gmail.com> <6a36e7290608291440q60d3bba1t950f3962197a0a1f@mail.gmail.com> Message-ID: yaws is not completely integrated into erlrt by now. we are actually using erlrt + yaws "as this" in embedded mode. > I sent some patches a few weeks ago, but I don't think anything has > happened. work is in progress and almost done. upgrading REPOS and adding erlrt packages was time consuming, REPOS and erlrt are actually merged to make CEAN. a web site is actually tested and will be online soon. the site will provide binary archives of all know erlang contribs, including otp, and will show a coverage matrix to know exactly what is working and what needs compilation time. package installation will be as simple as with erlrt, with better dependency handling. > Given the two or three days I wasted trying to get that stuff to work, > I can't > recommend bothering just yet until these issues get resolved. ertrt was just a proof of concept thing and an experimental packaging system. please wait few weeks for CEAN to be online. From bjorn@REDACTED Wed Aug 30 10:30:15 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 30 Aug 2006 10:30:15 +0200 Subject: 5 second Erlang Submission In-Reply-To: <44F46CB5.6040009@blueyonder.co.uk> References: <47404.194.72.110.12.1156409962.squirrel@backawinner.gg> <44F46CB5.6040009@blueyonder.co.uk> Message-ID: David Hopwood writes: > > I actually quite like C; it's at least a consistent exemplar of the > "worse is better" design philosophy. But I don't consider it to be an > "excellent" language for any purpose. It is excellent for writing virtual machines. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From tobbe@REDACTED Wed Aug 30 10:34:48 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Wed, 30 Aug 2006 10:34:48 +0200 Subject: Erlang does have problems In-Reply-To: <2FB595B5-8C4B-43AC-A4A8-8995F68DF63F@gmail.com> References: <20060829205423.A7A345A1F9@mail.erlangsystems.com> <2FB595B5-8C4B-43AC-A4A8-8995F68DF63F@gmail.com> Message-ID: Joel Reymont wrote: > > On Aug 29, 2006, at 9:54 PM, tobbe wrote: > >> If you want to know, then go and read up on the Erlang proceedings >> that exist from the EUC and ACm Sigplan workshops. > > I guess your definition of high-profile may vary. Can you name > high-profile Rails deployments? I'm sure people can, even if they don't > attend the Sigplan workshops. Anyway, I'm fine with keeping Erlang to > myself and let everyone else read the proceedings. Do there really exist any Rails deployments that plays in the same ball park as the AXD 301 ? That would surprise me! --Tobbe > > -- > http://wagerlabs.com/ > > > > > > From joelr1@REDACTED Wed Aug 30 10:46:14 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 09:46:14 +0100 Subject: Erlang on Solaris x86 In-Reply-To: References: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> Message-ID: On Aug 30, 2006, at 7:00 AM, ke han wrote: > BTW, I TextDrive might sell you containers on their Niagra servers > as well as what they currently advertise for their Opteron ones. I > sent a few rounds of email with one of their sales people on this. Is there a particular advantage to the Niagara servers with Erlang? Is this tried and true or just hypothetical? > My only problem was I can get more horsepower from my own dedicated > server than with the current pricing on the TextDrive containers How did you figure this out? I looked at serverbeach.com and for 250/ mo you get a bare server. Do you mean that it starts to become expensive as you scale up? I'm also trying to find a contact at Amazon to get on the EC2 beta. For 70/mo per virtual server that would be ideal! Anyone with contacts? > (there are obviously other benefits to their container solution > than raw horsepower of your own dedicated server What are the advantages that you see? > but I was worried about their cost structure as my app needed more > resource). You mean 250 + 250 + 250? They do seem to take care of load-balancing for you, I think, if you have multiple containers. Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Wed Aug 30 10:47:58 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 09:47:58 +0100 Subject: Dynamic languages are the future In-Reply-To: <44F524DB.10405@mail.ru> References: <44F3AC58.9040306@duomark.com> <44F3AF6C.1030003@einfo.com> <44F3D20B.7020104@duomark.com> <44F524DB.10405@mail.ru> Message-ID: On Aug 30, 2006, at 6:40 AM, Nick Linker wrote: > I wonder why Erlang is not Lisp? I mean why inventors of Erlang > chose to create its own language instead of creating just ERTS- > specific library for LISP (or at least Scheme)? > > Parentheses? :-) You don't have the process abstraction built into the language so Erlang cannot be recreated as Lisp, IMO. People are trying to do Erlang-like libraries for Lisp (MU-PROC) but they are still based on top of system threads which eliminates all the advantages, IMO. -- http://wagerlabs.com/ From bengt.kleberg@REDACTED Wed Aug 30 10:52:47 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 30 Aug 2006 10:52:47 +0200 Subject: Error reported when using pmap In-Reply-To: References: Message-ID: <44F551DF.4030405@ericsson.com> On 2006-08-30 10:22, Arbow wrote: ...deleted > In file testmain.erl: > -module(testmain). > -export([test3/0]). > > test3() -> > MyList = [1,2,3,4,5,6,7,8,9,10], > lists:map(fun(I) -> I*2 end, MyList). > > when I execute " testmain:test3(). ", I get errors: > > =ERROR REPORT==== 30-Aug-2006::16:21:51 === > Error in process <0.36.0> on node 'Erlide_2960df@REDACTED' with exit > value: > {undef,[{testmain,test3,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > ** exited: {undef,[{testmain,test3,[]}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > Anyone could help me? Thanks. this might narrow the search field a little: 1> c(testmain). {ok,testmain} 2> l(testmain). =ERROR REPORT==== 30-Aug-2006::10:46:24 === beam/beam_load.c(1097): Error loading module testmain: use of opcode 125; this emulator supports only up to 115 {error,badfile} =ERROR REPORT==== 30-Aug-2006::10:46:24 === Loading of /home/eleberg/testmain.beam failed: badfile ie, the problem seems to be unrelated to pmap and erlc. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From yerl@REDACTED Wed Aug 30 10:55:43 2006 From: yerl@REDACTED (yerl@REDACTED) Date: Wed, 30 Aug 2006 10:55:43 +0200 Subject: Screen scraping Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: www_tools-1.0.patch.gz Type: application/x-gzip Size: 1970 bytes Desc: not available URL: From joelr1@REDACTED Wed Aug 30 11:03:56 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 10:03:56 +0100 Subject: pgsql Message-ID: <812D4B2A-3E03-4536-AFF9-E172F648AAE2@gmail.com> Is anyone actively using the pgsql code from jungerl? What is your experience? Thanks, Joel -- http://wagerlabs.com/ From bjorn@REDACTED Wed Aug 30 11:05:14 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 30 Aug 2006 11:05:14 +0200 Subject: Error reported when using pmap In-Reply-To: <44F551DF.4030405@ericsson.com> References: <44F551DF.4030405@ericsson.com> Message-ID: Doing the same steps as you in either R10B or R11B works fine for me. I can only reproduce the problem if I compile the module with R11B and then try to load the compiled module in R10B. /Bjorn Bengt Kleberg writes: > > 1> c(testmain). > {ok,testmain} > > 2> l(testmain). > > =ERROR REPORT==== 30-Aug-2006::10:46:24 === > beam/beam_load.c(1097): Error loading module testmain: > use of opcode 125; this emulator supports only up to 115 > > {error,badfile} > =ERROR REPORT==== 30-Aug-2006::10:46:24 === > Loading of /home/eleberg/testmain.beam failed: badfile > > > ie, the problem seems to be unrelated to pmap and erlc. > > > bengt > -- > EPO guidelines 1978: "If the contribution to the known art resides > solely in a computer program then the subject matter is not > patentable in whatever manner it may be presented in the claims." > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From joelr1@REDACTED Wed Aug 30 11:06:45 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 10:06:45 +0100 Subject: Erlang does have problems In-Reply-To: References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <17244f480608291212w3dd67c26hcedbae7b74a3d53c@mail.gmail.com> <0D8DBC59-D2BE-4CF0-BC0E-A826A9250A89@gmail.com> Message-ID: On Aug 30, 2006, at 9:12 AM, Dmitrii Dimandt wrote: > This could be problematic for the developer who is not very well > versed in > the fine arts of strings, binaries, conversions, encodings, etc etc > etc :) > Especially for us, poor folks from non-English-speaking countries ;) True. Non-English-speaking countries are not my target audience so I did not even think about Unicode and encodings. My bad :-(. -- http://wagerlabs.com/ From ke.han@REDACTED Wed Aug 30 11:08:52 2006 From: ke.han@REDACTED (ke han) Date: Wed, 30 Aug 2006 17:08:52 +0800 Subject: Erlang Book - again In-Reply-To: References: Message-ID: <35490793-480B-4707-827E-7F018CC0EF2A@redstarling.com> On Aug 29, 2006, at 11:40 PM, Joe Armstrong ((TN/EAB)) wrote: > > > For those who are interested I have started writing a new book. > > I'm sure many of us will buy copies... As there are no shortage of opinions on what could go into such a book, I'll add my wish list / opinions on scope and style ;-) 1 - "beta books", as done with Pragmatic Programmer is fantastic!!! You buy the book while its being written, there are online forums for feedback and errata...The customer can go online and regenerate a PDF at any time from the latest work in progress...the PDFs contain a footnote on each page showing the customer name as to hopefully avoid "sharing" of the e-book. The latest Prag Pogrammer book Agile Programming in Rails is very well written; structure and content. Have you talked to Prag Prog about publishing? 2 - don't confuse the reader (or thicken the book) with too many alternative options and outdated programming style. Go with current best practice only...this goes for things like which functions in OTP are best, using the latest exception handling and not bothering to explain how it used to work, using plain_fsm instead of (or at least in addition to) gen_server or gen_fsm (I feel erlang looses lots of adopters when they go from reading the initial old erlang book which shows the simplicity of writing interacting processes and then this new erlanger starts to write gen_server and gen_fsm modules which have an implementation style which does does not map closely to what they just learned.. 3 - will the book try to cover telecom example apps or web 2.0 app examples? or both? maybe if its both, it should be a 2 or 3 book series instead one monster book. book 1: erlang, book 2: OTP, book 3: "erlang best practices" or "erlang by example". some of these thoughts are in response to a contents list you published a few months ago. I won't dig it up and critic it as I'm sure its evolved since then. But I do remember feeling that less than half the contents appealed to me. This isn't too much of a problem as I have bought many tech books simply for one chapter of interest. thanks, ke han > > /Joe > > > > > > > > From: owner-erlang-questions@REDACTED [mailto:owner-erlang- > questions@REDACTED] On Behalf Of Dmitrii Dimandt > Sent: den 29 augusti 2006 17:26 > To: Erlang-Questions Mailing List > Subject: Erlang Book - again > > What are the chances of "Concurrent Programming in Erlang" book > becoming available online in its entirety? > > Why I'm asking this is that the book is clearly out of print (see > Amazon here and here). The only available books are available at > ridiculous prices. > > Practical Common Lisp has been online forever, it seems. And the > publisher gave the author perennial rights to publish the book on > the web. > Moreover, Paul Graham's "On Lisp" is now also available for download. > > May be Prentice Hall could be forced into giving the rights to the > book back to its authors? And may be the authors could be persuaded > to create an online copy of it? :) > > Or, better still, may be the authors could be persuaded to write a > new book :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe.armstrong@REDACTED Wed Aug 30 11:36:46 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Wed, 30 Aug 2006 11:36:46 +0200 Subject: The Erlang mailing list In-Reply-To: Message-ID: Once upon a time we started an Erlang mailing list. We used majordomo - we said "Let's put everything into one group" - if the traffic gets too much we can split the group. Then we split the groups. To sign up you have to go to www.erlang.org then click on FAQs + mailing lists then you can read the old archives, or sign up so you get sent the mails or so that you can post to the list. This list seems to be exploding - as does traffic to the Erlang blogs. Recently there have been large numbers of posts to this list on porting problems and beginners questions. I think it is time to migrate to a forum and make a finer sub-division of the lists. The best alternative seems to be http://forum.trapexit.org/ The distribution of traffic at trapexit is very skew For example, there is a group Installing Erlang (at trap exit) with 3 posts but erlang-questions has 5318 posts - which get cross posted from this list. Seems to me, like it would be a good idea to register with and post to trap-exit, otherwise this group will disintegrate with the volume of traffic. /Joe From bengt.kleberg@REDACTED Wed Aug 30 11:39:05 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 30 Aug 2006 11:39:05 +0200 Subject: Error reported when using pmap In-Reply-To: References: <44F551DF.4030405@ericsson.com> Message-ID: <44F55CB9.1050006@ericsson.com> On 2006-08-30 11:05, Bjorn Gustavsson wrote: > Doing the same steps as you in either R10B or R11B works fine for me. > > I can only reproduce the problem if I compile the module with R11B and > then try to load the compiled module in R10B. you are correct. i had different erlang versions when compiling vs loading. with the same version there was no problem with testmain. the original error is not possible to reproduce. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From chsu79@REDACTED Wed Aug 30 11:59:37 2006 From: chsu79@REDACTED (Christian S) Date: Wed, 30 Aug 2006 11:59:37 +0200 Subject: pgsql In-Reply-To: <812D4B2A-3E03-4536-AFF9-E172F648AAE2@gmail.com> References: <812D4B2A-3E03-4536-AFF9-E172F648AAE2@gmail.com> Message-ID: Ditto on this. I wrote it and I would love to see more reports on problems and workarounds applied to it in your applications. The only project im aware that use it is ejabberd, and tsunami used some internals from it. On 8/30/06, Joel Reymont wrote: > Is anyone actively using the pgsql code from jungerl? > > What is your experience? > > Thanks, Joel > > -- > http://wagerlabs.com/ From ke.han@REDACTED Wed Aug 30 12:12:42 2006 From: ke.han@REDACTED (ke han) Date: Wed, 30 Aug 2006 18:12:42 +0800 Subject: Erlang on Solaris x86 In-Reply-To: References: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> Message-ID: <375AC5C7-2566-4803-A1CC-62F59ECF861B@redstarling.com> On Aug 30, 2006, at 4:46 PM, Joel Reymont wrote: > > On Aug 30, 2006, at 7:00 AM, ke han wrote: > >> BTW, I TextDrive might sell you containers on their Niagra servers >> as well as what they currently advertise for their Opteron ones. >> I sent a few rounds of email with one of their sales people on this. > > Is there a particular advantage to the Niagara servers with Erlang? > Is this tried and true or just hypothetical? Others have posted their testing results with the Niagra chip and erlang R11. The results I've seen so far look _very_ good. I don't rank high enough to get a demo machine from Sun ;-) Although I haven't used it and haven't heard of anyone using it with erlang, the Niagra has an on core encryption accelerator. See this blog post on how it works http://blogs.sun.com/enigma/ (under heading: Two Cryptographic Solution). You can't get this with an Opteron. > >> My only problem was I can get more horsepower from my own >> dedicated server than with the current pricing on the TextDrive >> containers > > How did you figure this out? I looked at serverbeach.com and for > 250/mo you get a bare server. Do you mean that it starts to become > expensive as you scale up? I am using a hosting provider m5hosting.com. They leverage a 5-start facility in San Diego and provide excellent support and good pricing. Although large hosting companied like serverbeach or aplus have good support technicians, they also have more lesser knowledgeable support folk. You usually have to go through the first tier before you get to a person that can help you fix a real problem. m5hosting is small and _only_ has top support techs, so you cut through a layer when you have a problem. FWIW, another (Linux only) hosting company I like for quality and knowledge is rimuhosting. Yeah, I've tried lots of hosting options over the last few years!! I rent a server from m5hosting I'm using for development which costs $105/month. Its only for dev as it doesn't have RAID 1 or redundant power. But I think you can get these added and still be less than $250/month. Get in touch with sales@REDACTED and tell them Jon Hancock referred you ;-) > > I'm also trying to find a contact at Amazon to get on the EC2 beta. > For 70/mo per virtual server that would be ideal! Anyone with > contacts? WOW!!!..I'd like to hear more on this. > >> (there are obviously other benefits to their container solution >> than raw horsepower of your own dedicated server > > What are the advantages that you see? Solaris Containers (or Zones) are very useful for what you may otherwise use virtual machines or change root jails to manage. If you can do everything on Solaris, Zones are powerful. That being said, I still have slightly negative feelings about tying myself to Sun. They are not a good company to have as your partner unless you are consistently paying top dollar. Even then they don't quite drop the arrogance...nowhere near as bad as Oracle though ;-) , but I shy away from companies with these histories. I spent some time these last few months trying to see if I wanted to use Solaris on Niagra. I ended up deciding that if the Niagra scales to what I may eventually need, then when I have that large a user base, I can switch to it and not have to worry about asking for any favors from my regional Sun sales rep ;-). As for scaling "up" or "out", the latest info I have is that using power hunger servers is going to start costing you much more. Data Centers have to pass this cost along to the customer and the amortized cost of buying wattage efficient servers will pay off well over the next year as energy prices go up. This means paying more up front costs for the next gen processors and the more power efficient SAS drives. >> but I was worried about their cost structure as my app needed more >> resource). > > You mean 250 + 250 + 250? They do seem to take care of load- > balancing for you, I think, if you have multiple containers. The very nice thing about what TextDrive is offering for their Opteron Solaris Containers is that you get the entire fault-tolerant infrastructure with it. Your renting a container, not a virtual machine on a particular server. Its a powerful approach whose time has come and I think we're going to see lots more of this from TextDrive and others. I didn't push their sales rep to see what kind of discounts would be available as I scaled up. Please keep me posted on these experiences...as I still haven't finalized my production decisions. ke han > > Thanks, Joel > > -- > http://wagerlabs.com/ > > > > > From mats.cronqvist@REDACTED Wed Aug 30 12:13:24 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Wed, 30 Aug 2006 12:13:24 +0200 Subject: Dynamic languages are the future In-Reply-To: <44F54982.8030406@it.uu.se> References: <44F3AC58.9040306@duomark.com> <44F3AF6C.1030003@einfo.com> <44F3D20B.7020104@duomark.com> <44F524DB.10405@mail.ru> <44F54982.8030406@it.uu.se> Message-ID: <44F564C4.10407@ericsson.com> Richard Carlsson wrote: > Erlang _is_ a concurrent, nondestructive Lisp with > a Prolog-inspired syntax that focuses on pattern matching and rules. i nominate this to joe's "erlang in 5 seconds" competition. mats From joelr1@REDACTED Wed Aug 30 12:17:36 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 11:17:36 +0100 Subject: The Erlang mailing list In-Reply-To: References: Message-ID: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> On Aug 30, 2006, at 10:36 AM, Joe Armstrong ((TN/EAB)) wrote: > > I think it is time to migrate to a forum and make a finer sub- > division > of > the lists. The OCaml lists are split into a junior and senior lists, of course you can have a finer subdivision. May I suggest a series of groups at http://groups.google.com? There's already http://groups.google.com/group/think_erlang that I started a while ago. Google provides web acesss, RSS and email distribution of the posts which I find extremely convenient. The interface is also the best I have seen, better than Yahoo Groups. Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Wed Aug 30 12:20:18 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 11:20:18 +0100 Subject: Erlang on Solaris x86 In-Reply-To: <375AC5C7-2566-4803-A1CC-62F59ECF861B@redstarling.com> References: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> <375AC5C7-2566-4803-A1CC-62F59ECF861B@redstarling.com> Message-ID: <548EF9A3-DFA3-46FF-B64E-17BCC4238419@gmail.com> On Aug 30, 2006, at 11:12 AM, ke han wrote: >> I'm also trying to find a contact at Amazon to get on the EC2 >> beta. For 70/mo per virtual server that would be ideal! Anyone >> with contacts? > > WOW!!!..I'd like to hear more on this. http://wagerlabs.com/articles/2006/08/24/amazon-elastic-compute-cloud From joelr1@REDACTED Wed Aug 30 12:23:04 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 11:23:04 +0100 Subject: Erlang on Solaris x86 In-Reply-To: <375AC5C7-2566-4803-A1CC-62F59ECF861B@redstarling.com> References: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> <375AC5C7-2566-4803-A1CC-62F59ECF861B@redstarling.com> Message-ID: <5F959F21-39E0-4243-AD0E-83DD3A8BF001@gmail.com> On Aug 30, 2006, at 11:12 AM, ke han wrote: > Others have posted their testing results with the Niagra chip and > erlang R11. The results I've seen so far look _very_ good. I must have missed the posts. Where are they? > The very nice thing about what TextDrive is offering for their > Opteron Solaris Containers is that you get the entire fault- > tolerant infrastructure with it. Your renting a container, not a > virtual machine on a particular server. I'm not sure I understand the difference between a container and a VM. What is the fault-tolerant infrastructure and how do you get it at TextDrive? -- http://wagerlabs.com/ From fbg111@REDACTED Wed Aug 30 12:23:31 2006 From: fbg111@REDACTED (fbg111) Date: Wed, 30 Aug 2006 03:23:31 -0700 (PDT) Subject: Erlang for web-developers In-Reply-To: <44F3ACAB.8090804@brainplugins.com> References: <44F3ACAB.8090804@brainplugins.com> Message-ID: <6056153.post@talk.nabble.com> Andr?s Valenciano wrote: > >> For example, I am in the starting process for a new project (in my day >> job), a web project, that has a SMS related service and I was really >> excited about it because I thought I could use Erlang there but then >> this other guy with Cold Fusion experience wants to use that product for >> the project, which gives the web server, the not-so-interesting things >> like PDF, Flash, etc and an SMPP implementation all in the same package. >> Is that one a lost battle in my case? > Don't forget to emphasize that Erlang is not only free and open source, but heavily tested and mature, perhaps moreso than Cold Fusion. Two *huge* benefits over Cold Fusion or anything else proprietary. Do a little research and find out how much the CF license costs. -- View this message in context: http://www.nabble.com/Erlang-for-web-developers-tf2175872.html#a6056153 Sent from the Erlang Questions forum at Nabble.com. From fbg111@REDACTED Wed Aug 30 12:40:33 2006 From: fbg111@REDACTED (fbg111) Date: Wed, 30 Aug 2006 03:40:33 -0700 (PDT) Subject: Erlang on Solaris x86 In-Reply-To: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> References: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> Message-ID: <6056379.post@talk.nabble.com> Joel Reymont wrote: > > Is anyone running Erlang on Solaris x86? I'm not but have been looking for a vps to host the same software stack on. Here's another I found: http://www.gridzones.com/gridzones_hosting.php Byron -- View this message in context: http://www.nabble.com/Erlang-on-Solaris-x86-tf2187264.html#a6056379 Sent from the Erlang Questions forum at Nabble.com. From fbg111@REDACTED Wed Aug 30 13:06:31 2006 From: fbg111@REDACTED (fbg111) Date: Wed, 30 Aug 2006 04:06:31 -0700 (PDT) Subject: Noob - Getting Started Infinte Loop? Message-ID: <6056733.post@talk.nabble.com> Hi all, I'm an Erlang noob working through the getting started material at erlang.org, and I have a question about a problem that's occuring with my code. If this isn't the appropriate place for this question, my apologies for wasting the bandwidth, please point me in the right direction. Otherwise, running the function listlen([1,2,...n]) crashes the Erlang emulator in WinXP. However, I can't see the difference b/t my code and the example code: http://erlang.org/doc/doc-5.5/doc/getting_started/seq_prog.html#2.5 Example code: > The following example shows how we find the length of a list: > > -module(tut4). > -export([list_length/1]). > > list_length([]) -> > 0; > list_length([First | Rest]) -> > 1 + list_length(Rest). > > Compile (file tut4.erl) and test: > 29> c(tut4). > {ok,tut4} > 30> tut4:list_length([1,2,3,4,5,6,7]). > 7 > My code: > -module(tut). > -export([double/1,fac/1,mult/2,convert/1,conv/2,listlen/1]). > > double(X) -> 2 * X. > fac(0) -> 1; > fac(N) -> N * fac(N-1). > mult(X,Y) -> X*Y. > conv(M,toInch) -> M/2.54; > conv(N,toCentimeter) -> N*2.54. > convert({M,centimeters}) -> {M/2.54,inches}; > convert({M,inches}) -> {M*2.54,centimeters}. > listlen([]) -> 0; > listlen([First|TheRest]) -> 1 + listlen([TheRest]). > And the result of running my code: > Erlang (BEAM) emulator version 5.5 [async-threads:0] > > Eshell V5.5 (abort with ^G) > 1> c(tut). > ./tut.erl:13: Warning: variable 'First' is unused > {ok,tut} > 2> tut:listlen([]). > 0 > 3> tut:listlen([1,2]). > > Crash dump was written to: erl_crash.dump > eheap_alloc: Cannot allocate 583848200 bytes of memory (of type "heap"). > > Abnormal termination > Windows Task Manager confirms the process werl is trying to use 581MB of RAM. Before I tried to run this, Task Manager showed 821MB RAM in use, out of 1GB. Is this a problem with my code, or with my memory useage? Any suggestions about what I'm doing wrong? Thanks, Byron -- View this message in context: http://www.nabble.com/Noob---Getting-Started-Infinte-Loop--tf2189189.html#a6056733 Sent from the Erlang Questions forum at Nabble.com. From joelr1@REDACTED Wed Aug 30 13:20:16 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 12:20:16 +0100 Subject: pgsql In-Reply-To: References: <812D4B2A-3E03-4536-AFF9-E172F648AAE2@gmail.com> Message-ID: <563A5C13-10A7-4335-9FFA-FEC35C80A0C6@gmail.com> On Aug 30, 2006, at 10:59 AM, Christian S wrote: > Ditto on this. I wrote it and I would love to see more reports on > problems and workarounds applied to it in your applications. The only > project im aware that use it is ejabberd, and tsunami used some > internals from it. Well, ejabberd is enough of a validation :-). I would like to use PostgreSQL instead (or together with) Mnesia since I think I could leverage both Erlang and Rails. Particularly, I know that PGSQL scales well and Rails is a breeze to write system administration and reporting tools in. -- http://wagerlabs.com/ From per.gustafsson@REDACTED Wed Aug 30 13:22:29 2006 From: per.gustafsson@REDACTED (Per Gustafsson) Date: Wed, 30 Aug 2006 13:22:29 +0200 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <6056733.post@talk.nabble.com> References: <6056733.post@talk.nabble.com> Message-ID: <44F574F5.4060309@it.uu.se> fbg111 wrote: > Hi all, I'm an Erlang noob working through the getting started material at > erlang.org, and I have a question about a problem that's occuring with my > code. If this isn't the appropriate place for this question, my apologies > for wasting the bandwidth, please point me in the right direction. > Otherwise, running the function listlen([1,2,...n]) crashes the Erlang > emulator in WinXP. However, I can't see the difference b/t my code and the > example code: > > http://erlang.org/doc/doc-5.5/doc/getting_started/seq_prog.html#2.5 Example > code: > > > >>The following example shows how we find the length of a list: >> >>-module(tut4). >>-export([list_length/1]). >> >>list_length([]) -> >> 0; >>list_length([First | Rest]) -> >> 1 + list_length(Rest). >> >>Compile (file tut4.erl) and test: >>29> c(tut4). >>{ok,tut4} >>30> tut4:list_length([1,2,3,4,5,6,7]). >>7 >> > > > My code: > > > >>-module(tut). >>-export([double/1,fac/1,mult/2,convert/1,conv/2,listlen/1]). >> >>double(X) -> 2 * X. >>fac(0) -> 1; >>fac(N) -> N * fac(N-1). >>mult(X,Y) -> X*Y. >>conv(M,toInch) -> M/2.54; >>conv(N,toCentimeter) -> N*2.54. >>convert({M,centimeters}) -> {M/2.54,inches}; >>convert({M,inches}) -> {M*2.54,centimeters}. >>listlen([]) -> 0; >>listlen([First|TheRest]) -> 1 + listlen([TheRest]). >> listlen should be defined as: listlen([]) -> 0; listlen([First|TheRest]) -> 1 + listlen(TheRest). because in your definition the recursive call is always made with a list consisting of one element ([TheRest]) because of this your function does not terminate and it runs out of memory. Per From joelr1@REDACTED Wed Aug 30 13:25:16 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 12:25:16 +0100 Subject: jungerl error while building ssh Message-ID: <1638B265-8FEE-460F-926B-263F2FC4316A@gmail.com> I'm on Mac OSX. Has anyone seen this? Thanks, Joel -- gcc -g -O2 -DHAVE_CONFIG_H -I/usr/local/lib/erlang/usr/include - I../../../support -c -o loop_drv.o loop_drv.c loop_drv.c: In function 'free_buffer': loop_drv.c:742: error: 'struct erl_drv_binary' has no member named 'refc' loop_drv.c: In function 'http_hash_lookup': loop_drv.c:1181: warning: pointer targets in passing argument 2 of 'strncmp' differ in signedness loop_drv.c: In function 'http_init': loop_drv.c:1199: warning: pointer targets in assignment differ in signedness loop_drv.c: In function 'http_message': loop_drv.c:1615: warning: pointer targets in passing argument 1 of 'http_hash_lookup' differ in signedness loop_drv.c:1758: warning: pointer targets in passing argument 1 of 'http_hash_lookup' differ in signedness loop_drv.c: In function 'inet_fill_stat': loop_drv.c:2720: warning: incompatible implicit declaration of built- in function 'fabs' make[3]: *** [loop_drv.o] Error 1 make[2]: *** [all] Error 1 make[1]: *** [ssh] Error 2 make: *** [all] Error 2 junior:~/work/erlang/jungerl joelr$ find . -name loop_drv.c ./lib/ssh/c_src/loop_drv.c -- http://wagerlabs.com/ From Lennart.Ohman@REDACTED Wed Aug 30 13:22:55 2006 From: Lennart.Ohman@REDACTED (=?iso-8859-1?Q?Lennart_=D6hman?=) Date: Wed, 30 Aug 2006 13:22:55 +0200 Subject: SV: Noob - Getting Started Infinte Loop? References: <6056733.post@talk.nabble.com> Message-ID: Hi, you have encapsulated TheRest in a list. Meaning that you will recursively call listlen/1 with a list of one element (the list of all remaining elements except the first one from the first call to listlen/1). Then that call will end up at the second clause, where the recursive call will be made on: listlen([[]]) which in its turn will end up on the second clause causing a recursive call to listlen([[]]), and so on, until you run out of stack. Best Regards, Lennart > listlen([]) -> 0; > listlen([First|TheRest]) -> 1 + listlen([TheRest]). ^^^^^^^^^ ------------------------------------------------------------- Lennart Ohman phone : +46-8-587 623 27 Sj?land & Thyselius Telecom AB cellular: +46-70-552 6735 Sehlstedtsgatan 6 fax : +46-8-667 8230 SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED ________________________________ Fr?n: owner-erlang-questions@REDACTED genom fbg111 Skickat: on 2006-08-30 13:06 Till: erlang-questions@REDACTED ?mne: Noob - Getting Started Infinte Loop? Hi all, I'm an Erlang noob working through the getting started material at erlang.org, and I have a question about a problem that's occuring with my code. If this isn't the appropriate place for this question, my apologies for wasting the bandwidth, please point me in the right direction. Otherwise, running the function listlen([1,2,...n]) crashes the Erlang emulator in WinXP. However, I can't see the difference b/t my code and the example code: http://erlang.org/doc/doc-5.5/doc/getting_started/seq_prog.html#2.5 Example code: > The following example shows how we find the length of a list: > > -module(tut4). > -export([list_length/1]). > > list_length([]) -> > 0; > list_length([First | Rest]) -> > 1 + list_length(Rest). > > Compile (file tut4.erl) and test: > 29> c(tut4). > {ok,tut4} > 30> tut4:list_length([1,2,3,4,5,6,7]). > 7 > My code: > -module(tut). > -export([double/1,fac/1,mult/2,convert/1,conv/2,listlen/1]). > > double(X) -> 2 * X. > fac(0) -> 1; > fac(N) -> N * fac(N-1). > mult(X,Y) -> X*Y. > conv(M,toInch) -> M/2.54; > conv(N,toCentimeter) -> N*2.54. > convert({M,centimeters}) -> {M/2.54,inches}; > convert({M,inches}) -> {M*2.54,centimeters}. > listlen([]) -> 0; > listlen([First|TheRest]) -> 1 + listlen([TheRest]). > And the result of running my code: > Erlang (BEAM) emulator version 5.5 [async-threads:0] > > Eshell V5.5 (abort with ^G) > 1> c(tut). > ./tut.erl:13: Warning: variable 'First' is unused > {ok,tut} > 2> tut:listlen([]). > 0 > 3> tut:listlen([1,2]). > > Crash dump was written to: erl_crash.dump > eheap_alloc: Cannot allocate 583848200 bytes of memory (of type "heap"). > > Abnormal termination > Windows Task Manager confirms the process werl is trying to use 581MB of RAM. Before I tried to run this, Task Manager showed 821MB RAM in use, out of 1GB. Is this a problem with my code, or with my memory useage? Any suggestions about what I'm doing wrong? Thanks, Byron -- View this message in context: http://www.nabble.com/Noob---Getting-Started-Infinte-Loop--tf2189189.html#a6056733 Sent from the Erlang Questions forum at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From info@REDACTED Wed Aug 30 12:07:15 2006 From: info@REDACTED (Alfons Mittelmeyer) Date: Wed, 30 Aug 2006 10:07:15 +0000 (UTC) Subject: LAPD protocol implementation available References: <20050102024233.GP42962@frogman.motivity.ca> Message-ID: Vance Shipley motivity.ca> writes: > > Folks, > > In a project last year I found I needed a LAPD protocol implementation > which provided an API to the Unacknowledged Information (UI) frame > service. I wasn't able to find an existing implementation which exposed > the UI service to the user. So to complete the project I implemented > my own version of the Link Access Procedures on the D-channel (LAPD) as > documented in ITU-T Q.921. I did this to create an emulation environment > for GSM Abis interfaces. This was work done simply in order to have a > testing environment for another commercial product we developed. > > I am making this Erlang application available under a BSD opensource > license. I'm not sure how likely it is that anyone will have a use for > this but I might as well share. If nothing else the design documented > in the User Guide might might be interesting for those building such > communicating state machine applications. > > -Vance > > http://www.motivity.ca/lapd/index.html > http://www.motivity.ca/lapd-1.1.tar.gz > > Dear Vance, I am interested in your implementation of the LAPD protocol, but the URLs http://www.motivity.ca/lapd/index.html http://www.motivity.ca/lapd-1.1.tar.gz don't exist anymore. Can you offer an alternate internet address where your implementation may be found? best regards - Alfons From chsu79@REDACTED Wed Aug 30 13:38:44 2006 From: chsu79@REDACTED (Christian S) Date: Wed, 30 Aug 2006 13:38:44 +0200 Subject: pgsql In-Reply-To: <563A5C13-10A7-4335-9FFA-FEC35C80A0C6@gmail.com> References: <812D4B2A-3E03-4536-AFF9-E172F648AAE2@gmail.com> <563A5C13-10A7-4335-9FFA-FEC35C80A0C6@gmail.com> Message-ID: On 8/30/06, Joel Reymont wrote: > Well, ejabberd is enough of a validation :-). >From what I could see pgsql backend was an optional setting. I dont have any experience running ejabberd. Perhaps someone could contribute how useful the pgsql backend is in it? > I would like to use PostgreSQL instead (or together with) Mnesia > since I think I could leverage both Erlang and Rails. Particularly, I > know that PGSQL scales well and Rails is a breeze to write system > administration and reporting tools in. I think SQL databases make for practical decoupled interface-points between different systems, your situation being an example. An erlang system can feed a database, a python script can extract data for mailing out reports, a proprietary C++ system can extract its data and communicate with some old internal proprietary system, php can make webpage listings and so on. All have their center around the database. Idea while writing: Make it easier to access mnesia from Ruby/(insert favourite language)? So mnesia can be the center of attention. There is already a mnesia_session for foreign language access. The idea is still wet, no research done yet. :) From rlenglet@REDACTED Wed Aug 30 13:41:35 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Wed, 30 Aug 2006 20:41:35 +0900 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <6056733.post@talk.nabble.com> References: <6056733.post@talk.nabble.com> Message-ID: <200608302041.36366.rlenglet@users.forge.objectweb.org> fbg111 wrote: > > listlen([First|TheRest]) -> 1 + listlen([TheRest]). You are creating a (non-empty) list at every step. Therefore your code recurses infinitely. This code should be: listlen([First|TheRest]) -> 1 + listlen(TheRest). TheRest (the tail of the list) is already a list. -- Romain LENGLET From vladdu55@REDACTED Wed Aug 30 13:42:49 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 30 Aug 2006 13:42:49 +0200 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <6056733.post@talk.nabble.com> References: <6056733.post@talk.nabble.com> Message-ID: <95be1d3b0608300442r6dedc41aj5682fbfb91abda9f@mail.gmail.com> Hi and welcome! On 8/30/06, fbg111 wrote: > However, I can't see the difference b/t my code and the > example code: > > list_length([]) -> 0; > > list_length([First | Rest]) -> 1 + list_length(Rest). > > listlen([]) -> 0; > > listlen([First|TheRest]) -> 1 + listlen([TheRest]). The difference is that the last line in your code should read listlen([First|TheRest]) -> 1 + listlen(TheRest). i.e. TheRest and not [TheRest] as argument. What happens is that listlen gets called with following arguments: [1, 2, 3] [[2,3]] [[]] [[]] [[]] [[]] ..... so it's an endless recusrion that finally kills the VM best regards, Vlad From xlcr@REDACTED Wed Aug 30 13:40:26 2006 From: xlcr@REDACTED (Nick Linker) Date: Wed, 30 Aug 2006 18:40:26 +0700 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <6056733.post@talk.nabble.com> References: <6056733.post@talk.nabble.com> Message-ID: <44F5792A.2010108@mail.ru> fbg111 wrote: Should be listlen([First|TheRest]) -> 1 + listlen(TheRest). Previous variant builds infinitely nested list. Best regards, Nick. From goryachev@REDACTED Wed Aug 30 14:13:41 2006 From: goryachev@REDACTED (Igor Goryachev) Date: Wed, 30 Aug 2006 16:13:41 +0400 Subject: setting up distributed environment Message-ID: <87r6yyto96.fsf@yandex-team.ru> Hello everyone. I am going to setup erlangish application. My purpose is to make it fault-tolerant by replicating it's mnesia over several nodes. Still I have some doubts concerned with setting master nodes. I will have two machines for the first time (lets consider 'app@REDACTED' and 'app@REDACTED'). Am I right I am going to make 'app@REDACTED' master node of 'app@REDACTED' and vice versa. Any thoughts? Well, and what about when number of nodes more that two? Thank you veru much for the attention. -- Igor Goryachev Yandex development team. From cyberdanx@REDACTED Wed Aug 30 14:13:38 2006 From: cyberdanx@REDACTED (Chris Campbell) Date: Wed, 30 Aug 2006 13:13:38 +0100 Subject: Erlang Book - again In-Reply-To: References: Message-ID: On 29/08/06, Joe Armstrong (TN/EAB) wrote: > I hope you'll all buy it. If you want any particular material covering send > me a mail. I'd like to see stuff on the OTP. Erlang as a language is fairly easy to learn, but learning to use the OTP properly takes a lot longer. Also, please make the examples interesting! If I spend good money on another book that spends ages on how cool it is to be able to write the factorial function in N lines I think I'll scream ;) Chris From kg9020@REDACTED Wed Aug 30 14:29:34 2006 From: kg9020@REDACTED (k vin) Date: Wed, 30 Aug 2006 07:29:34 -0500 Subject: this is a test Message-ID: <96fd17a20608300529g54cbc68bq9575f81d854387a6@mail.gmail.com> this is a test -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.double@REDACTED Wed Aug 30 14:41:28 2006 From: chris.double@REDACTED (Chris Double) Date: Thu, 31 Aug 2006 00:41:28 +1200 Subject: Erlang on Solaris x86 In-Reply-To: <375AC5C7-2566-4803-A1CC-62F59ECF861B@redstarling.com> References: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> <375AC5C7-2566-4803-A1CC-62F59ECF861B@redstarling.com> Message-ID: On 8/30/06, ke han wrote: > I am using a hosting provider m5hosting.com. I'm also another happy customer of m5hosting. I use a dedicated server and run VMware server on it. I run multiple OS's on one dedicated server using this setup including Minix and Ubuntu Linux and it runs quite nicely. Chris. -- http://www.bluishcoder.co.nz From dmitriid@REDACTED Wed Aug 30 14:42:52 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Wed, 30 Aug 2006 15:42:52 +0300 Subject: Erlang Book - again In-Reply-To: References: Message-ID: On 8/30/06, Chris Campbell wrote: > > On 29/08/06, Joe Armstrong (TN/EAB) wrote: > > > I hope you'll all buy it. If you want any particular material covering > send > > me a mail. > > I'd like to see stuff on the OTP. Erlang as a language is fairly easy > to learn, but learning to use the OTP properly takes a lot longer. > Also, please make the examples interesting! If I spend good money on > another book that spends ages on how cool it is to be able to write > the factorial function in N lines I think I'll scream ;) Indeed :) Quicksort example in the docs is way better (though more mind-twisting for those not comfortable with list comprehensions) -------------- next part -------------- An HTML attachment was scrubbed... URL: From damir@REDACTED Wed Aug 30 14:55:32 2006 From: damir@REDACTED (Damir Horvat) Date: Wed, 30 Aug 2006 14:55:32 +0200 Subject: Mnesia dB size limits Message-ID: <20060830125532.GA14925@semp.x-si.org> Hi! I'm planing 50-70 Mbytes stored in mnesia database. I hope this is still considered "sane" size? What are the upper limits where system can still be called "production quality" in terms of dB speed? Another question. Reading Joe's Robust server (bank server example), I found this interesting: ... [E] -> B = E#account.balance, {ok, B} end ... Why not skip B and send {ok, E#account.balance} in the fist place? Thanks, Damir. From serge@REDACTED Wed Aug 30 15:30:20 2006 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 30 Aug 2006 09:30:20 -0400 Subject: setting up distributed environment In-Reply-To: <87r6yyto96.fsf@yandex-team.ru> References: <87r6yyto96.fsf@yandex-team.ru> Message-ID: <44F592EC.9080404@hq.idt.net> It's a bit unclear what do you mean by a 'master' node. Mnesia doesn't have a notion of a master or slave. Any node that has a replicated table can have local writes to that table that will be propagated to other replicas. The level of control that mnesia gives you is what nodes host disk/ram copies of a table. In your application you could have two nodes running on two separate hosts with tables created using 'disc_copies' option. The mnesia application would need to be started with the 'extra_db_nodes' option containing these two nodes ['app@REDACTED', 'app@REDACTED']. The remaining nodes could have mnesia started with the same 'extra_db_nodes' option, and have these tables replicated as ram_copies if needed. This option would be applicable if you needed to provide quick local access to tables by some other node 'x@REDACTED'. You should be concerned with the fact that the more nodes you have a table replicated to, the longer each transactional write to such a table will take, and also the more sensitive your overall solution will be to intermittent network outages. Regards, Serge Igor Goryachev wrote: > Hello everyone. > > I am going to setup erlangish application. My purpose is to make it > fault-tolerant by replicating it's mnesia over several nodes. Still I > have some doubts concerned with setting master nodes. > > I will have two machines for the first time (lets consider 'app@REDACTED' > and 'app@REDACTED'). Am I right I am going to make 'app@REDACTED' master node > of 'app@REDACTED' and vice versa. Any thoughts? Well, and what about when > number of nodes more that two? > > Thank you veru much for the attention. From joelr1@REDACTED Wed Aug 30 15:47:10 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 14:47:10 +0100 Subject: ejabberd + yaws Message-ID: <3FCBB39C-E3F8-4630-9E91-0DE5AD4FD7C6@gmail.com> Has anyone tried merging the yaws and ejabberd installations? Is there an easy recipe for this? I would like to run both and take advantage of the expat driver built into ejabberd to do XML processing for Yaws. Thanks, Joel -- http://wagerlabs.com/ From rich@REDACTED Wed Aug 30 15:57:44 2006 From: rich@REDACTED (Richard Kilmer) Date: Wed, 30 Aug 2006 09:57:44 -0400 Subject: Dynamic languages are the future In-Reply-To: References: <44F3AC58.9040306@duomark.com> <44F3AF6C.1030003@einfo.com> <44F3D20B.7020104@duomark.com> <44F524DB.10405@mail.ru> Message-ID: On Aug 30, 2006, at 4:47 AM, Joel Reymont wrote: > > On Aug 30, 2006, at 6:40 AM, Nick Linker wrote: > >> I wonder why Erlang is not Lisp? I mean why inventors of Erlang >> chose to create its own language instead of creating just ERTS- >> specific library for LISP (or at least Scheme)? >> >> Parentheses? :-) > > You don't have the process abstraction built into the language so > Erlang cannot be recreated as Lisp, IMO. People are trying to do > Erlang-like libraries for Lisp (MU-PROC) but they are still based > on top of system threads which eliminates all the advantages, IMO. Yep, and this article from January is a good presentation of the issues with theads: http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-1.html They speak positively of Erlang in there, although they imply that people will not switch. Of course, in the Ruby community we felt that people would never switch from languages like Java to Ruby...but then came Rails and switch they are! I think people underestimate the power of frameworks geared toward solving specific issues as a draw for others outside a language community. I am just learning Erlang and am very much enjoying it so far. > > -- > http://wagerlabs.com/ > > > > > From bjorn@REDACTED Wed Aug 30 15:55:44 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 30 Aug 2006 15:55:44 +0200 Subject: Erlang/OTP R11B-1 has been released Message-ID: Bug fix release : otp_src_R11B-1 Build date : 2006-08-29 This is bug fix release 1 for the R11B release. You can download the full source distribution from http://www.erlang.org/download/otp_src_R11B-1.tar.gz http://www.erlang.org/download/otp_src_R11B-1.readme Note: To unpack the TAR archive you need a GNU TAR compatible program. For instance, on MacOS X before 10.3 you must use the 'gnutar' command; you can't use the 'tar' command or StuffIt to unpack the sources. For installation instructions please read the README that is part of the distribution. The Windows binary distribution can be downloaded from http://www.erlang.org/download/otp_win32_R11B-1.exe On-line documentation can be found at http://www.erlang.org/doc.html. You can also download the complete HTML documentation or the Unix manual files http://www.erlang.org/download/otp_doc_html_R11B-1.tar.gz http://www.erlang.org/download/otp_doc_man_R11B-1.tar.gz We also want to thank those that sent us patches, suggestions and bug reports, The OTP Team -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From simonpeterchappell@REDACTED Wed Aug 30 16:01:15 2006 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Wed, 30 Aug 2006 09:01:15 -0500 Subject: The Erlang mailing list In-Reply-To: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> References: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> Message-ID: <8ed733900608300701n7f366a03yf0c6eea4bf868344@mail.gmail.com> On 8/30/06, Joel Reymont wrote: > > On Aug 30, 2006, at 10:36 AM, Joe Armstrong ((TN/EAB)) wrote: > > > > > I think it is time to migrate to a forum and make a finer sub- > > division > > of > > the lists. > > The OCaml lists are split into a junior and senior lists, of course > you can have a finer subdivision. That's not a bad idea. I would be happy to be active on the junior list and lurk on the senior list to keep up with Joe's wisdom. > May I suggest a series of groups at http://groups.google.com? Personally, I like the Yahoo groups. I'm a moderator on the JUnit group and it seems to function pretty well. That said, I'm sure that Google groups are comparable. > There's already http://groups.google.com/group/think_erlang that I > started a while ago. The group appears to be invitation only. That might slow down membership. > Google provides web acesss, RSS and email distribution of the posts > which I find extremely convenient. The interface is also the best I > have seen, better than Yahoo Groups. I'm willing to give it a try. Simon -- www.simonpeter.org From anders.nygren@REDACTED Wed Aug 30 16:08:08 2006 From: anders.nygren@REDACTED (Anders Nygren) Date: Wed, 30 Aug 2006 09:08:08 -0500 Subject: Screen scraping In-Reply-To: <44F53C0C.1020208@hyber.org> References: <1F5AC999-33E9-4ACC-AE63-D1CA00D3E11B@gmail.com> <44F53C0C.1020208@hyber.org> Message-ID: On 8/30/06, Claes Wikstrom wrote: > Chris Double wrote: > > On 8/30/06, Joel Reymont wrote: > >> Does anyone have tools for screen scraping with Erlang? > > > > There is a decent and forgiving HTML parser in the Yaws source tree > written by Johan bevemyr. I'd start with that. > I tried to use it once and I found it to not be so forgiving on broken real-world(tm) html. If it doesn't find the end tags it expects it chokes. /Anders From Martin.Logan@REDACTED Wed Aug 30 16:12:25 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Wed, 30 Aug 2006 09:12:25 -0500 Subject: Mnesia dB size limits In-Reply-To: <20060830125532.GA14925@semp.x-si.org> Message-ID: <9CB79C836F98504C81BF082C4291E987792B3D@CHITDSEXC02.tds.corp.cendant.org> I have stored gigabytes in mnesia and not had a problem. We had a production telephony call detail record collection system that had in excess of 500mb cached in mnesia and performed well. Perhaps one of the other people that still works with that project can give figures for throughput? Cheers, Martin -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Damir Horvat Sent: Wednesday, August 30, 2006 7:56 AM To: erlang-questions@REDACTED Subject: Mnesia dB size limits Hi! I'm planing 50-70 Mbytes stored in mnesia database. I hope this is still considered "sane" size? What are the upper limits where system can still be called "production quality" in terms of dB speed? Another question. Reading Joe's Robust server (bank server example), I found this interesting: ... [E] -> B = E#account.balance, {ok, B} end ... Why not skip B and send {ok, E#account.balance} in the fist place? Thanks, Damir. From ke.han@REDACTED Wed Aug 30 16:18:38 2006 From: ke.han@REDACTED (ke han) Date: Wed, 30 Aug 2006 22:18:38 +0800 Subject: Dynamic languages are the future In-Reply-To: <44F564C4.10407@ericsson.com> References: <44F3AC58.9040306@duomark.com> <44F3AF6C.1030003@einfo.com> <44F3D20B.7020104@duomark.com> <44F524DB.10405@mail.ru> <44F54982.8030406@it.uu.se> <44F564C4.10407@ericsson.com> Message-ID: <46EBF46D-0372-4975-87BB-3684141FE26B@redstarling.com> On Aug 30, 2006, at 6:13 PM, Mats Cronqvist wrote: > Richard Carlsson wrote: >> Erlang _is_ a concurrent, nondestructive Lisp with >> a Prolog-inspired syntax that focuses on pattern matching and rules. > > i nominate this to joe's "erlang in 5 seconds" competition. yes, well said Richard!! This may work since I think there was mention that the target audience was Smalltalk-ers? But, I am absolutely amazed at how many "20-something" programmers I've interviewed in the last two years that gave me a blank stare when you ask them if the've tried Prolog or Lisp. That is, they haven't just not tried it, they've never heard of it. To add further insult to this statement, these candidates all had master's degrees in CS from China's most prestigious schools... oops ;-) ke han > > mats From Martin.Logan@REDACTED Wed Aug 30 16:21:23 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Wed, 30 Aug 2006 09:21:23 -0500 Subject: Introducing ErlyDB: The Erlang Twist on Database Abstraction In-Reply-To: <17244f480608290746x35d378d0i894001f785797837@mail.gmail.com> Message-ID: <9CB79C836F98504C81BF082C4291E987792B3E@CHITDSEXC02.tds.corp.cendant.org> Erlydb looks great. This is just what erlang needs. Nice work so far. Cheers, Martin -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Yariv Sadan Sent: Tuesday, August 29, 2006 9:46 AM To: Erlang-Questions Mailing List Subject: Introducing ErlyDB: The Erlang Twist on Database Abstraction Hi, I created a nice little database abstraction layer generator called ErlyDB. It's designed to bridge the sematic gap when interacting with SQL databases with minimal overhead. Here's the official announcement, with a tutorial: http://yarivsblog.com/articles/2006/08/29/introducing-erlydb-the-erlang- twist-on-database-abstraction ErlyDB is in alpha version. It only works with MySQL and it hasn't been thoroughly tested. Please give it a test drive and let me know if you run into any problems. I'll be adding many features to ErlyDB in the near future. Enjoy! Cheers, Yariv From ke.han@REDACTED Wed Aug 30 16:32:05 2006 From: ke.han@REDACTED (ke han) Date: Wed, 30 Aug 2006 22:32:05 +0800 Subject: The Erlang mailing list In-Reply-To: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> References: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> Message-ID: <8057725C-DFA9-46C3-A498-B7567B37E5B9@redstarling.com> I agree with Joe's intent... I think the biggest two requirement to fullfil which I don't see on trapexit are: 1 - RSS feeds (including for non-registered users; lurkers) 2 - forum content must get indexed by google et al.. without these two features its hard to migrate from maillists. ke han On Aug 30, 2006, at 6:17 PM, Joel Reymont wrote: > > On Aug 30, 2006, at 10:36 AM, Joe Armstrong ((TN/EAB)) wrote: > >> >> I think it is time to migrate to a forum and make a finer sub- >> division >> of >> the lists. > > The OCaml lists are split into a junior and senior lists, of course > you can have a finer subdivision. > > May I suggest a series of groups at http://groups.google.com? > > There's already http://groups.google.com/group/think_erlang that I > started a while ago. > > Google provides web acesss, RSS and email distribution of the posts > which I find extremely convenient. The interface is also the best I > have seen, better than Yahoo Groups. > > Thanks, Joel > > -- > http://wagerlabs.com/ > > > > > From ke.han@REDACTED Wed Aug 30 16:39:17 2006 From: ke.han@REDACTED (ke han) Date: Wed, 30 Aug 2006 22:39:17 +0800 Subject: Mnesia dB size limits In-Reply-To: <20060830125532.GA14925@semp.x-si.org> References: <20060830125532.GA14925@semp.x-si.org> Message-ID: <53E1B038-246C-40C0-8285-B60E12B5FEA3@redstarling.com> On Aug 30, 2006, at 8:55 PM, Damir Horvat wrote: > Hi! > > I'm planing 50-70 Mbytes stored in mnesia database. I hope > this is still considered "sane" size? What are the upper limits where > system can still be called "production quality" in terms of dB speed? I've built 2 production apps with yaws+mnesia. My db sizes are in the 500MB to 1GB range with no issues. I've heard others say that 2-4 GB is reasonable without resorting to tricks...and that the theoretical limit is very high if you can master the tricks. ke han > > Another question. Reading Joe's Robust server (bank server example), I > found this interesting: > > ... > [E] -> > B = E#account.balance, > {ok, B} > end > ... > > Why not skip B and send {ok, E#account.balance} in the fist place? > > Thanks, Damir. From goryachev@REDACTED Wed Aug 30 16:43:44 2006 From: goryachev@REDACTED (Igor Goryachev) Date: Wed, 30 Aug 2006 18:43:44 +0400 Subject: ejabberd + yaws In-Reply-To: <3FCBB39C-E3F8-4630-9E91-0DE5AD4FD7C6@gmail.com> (Joel Reymont's message of "Wed, 30 Aug 2006 14:47:10 +0100") References: <3FCBB39C-E3F8-4630-9E91-0DE5AD4FD7C6@gmail.com> Message-ID: <87ac5mthb3.fsf@yandex-team.ru> Joel Reymont writes: > Has anyone tried merging the yaws and ejabberd installations? Is > there an easy recipe for this? This merge seems to be done in J-EAI Project of P-1 (http://www.process-one.net/en/projects/j-eai/). Please, correct me, if I am wrong. -- Igor Goryachev Yandex development team. From mikpe@REDACTED Wed Aug 30 16:49:44 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 30 Aug 2006 16:49:44 +0200 Subject: Erlang/OTP R11B-1 has been released In-Reply-To: References: Message-ID: <17653.42376.606501.470993@alkaid.it.uu.se> Bjorn Gustavsson writes: > Bug fix release : otp_src_R11B-1 > Build date : 2006-08-29 > > This is bug fix release 1 for the R11B release. > You can download the full source distribution from > > http://www.erlang.org/download/otp_src_R11B-1.tar.gz > http://www.erlang.org/download/otp_src_R11B-1.readme Intel Mac users may be interested in knowing that R11B-1 includes support for FP exceptions and HiPE on Darwin/x86-32. Those updates came very late so they missed being described in the readme. /Mikael From goryachev@REDACTED Wed Aug 30 16:50:44 2006 From: goryachev@REDACTED (Igor Goryachev) Date: Wed, 30 Aug 2006 18:50:44 +0400 Subject: setting up distributed environment In-Reply-To: <44F592EC.9080404@hq.idt.net> (Serge Aleynikov's message of "Wed, 30 Aug 2006 09:30:20 -0400") References: <87r6yyto96.fsf@yandex-team.ru> <44F592EC.9080404@hq.idt.net> Message-ID: <8764gatgzf.fsf@yandex-team.ru> Serge Aleynikov writes: > It's a bit unclear what do you mean by a 'master' node. Mnesia > doesn't have a notion of a master or slave. Any node that has a I mean 'mnesia:set_master_nodes/1'. > In your application you could have two nodes running on two separate > hosts with tables created using 'disc_copies' option. The mnesia > application would need to be started with the 'extra_db_nodes' option Will 'mnesia:add_table_copy/3' make the deal? Should I run each node with 'extra_db_nodes' option all the time? -- Igor Goryachev Yandex development team. From philar@REDACTED Wed Aug 30 17:10:50 2006 From: philar@REDACTED (Philip Robinson) Date: Thu, 31 Aug 2006 01:10:50 +1000 Subject: Mnesia dB size limits In-Reply-To: <20060830125532.GA14925@semp.x-si.org> Message-ID: Damir asks: >What are the upper limits where system can still be called >"production quality" in terms of dB speed? I was once writing a program that needed to retrieve events within a date/time range from an mnesia table, and found that it did not seem to be hitting the index. It would scan the entire 1-million-plus records every query... dead slow. When I wanted to retrieve a specific event there was no noticable delay, but most of my queries were for a date/time range. I think the mnesia issues being mentioned on this list were to do with database recovery across nodes after a node failure...? >[E] -> > B = E#account.balance, > {ok, B} > end >... > >Why not skip B and send {ok, E#account.balance} in the fist place? When I see code like that in my programs it is because there used to be something like "io:format("~w~n", [B])," between the two lines. Out of habit I always assign to a temporary value to ensure that what is printed out is exactly what is used later (in case of typos). Cheers, Philip From chsu79@REDACTED Wed Aug 30 17:13:14 2006 From: chsu79@REDACTED (Christian S) Date: Wed, 30 Aug 2006 17:13:14 +0200 Subject: The Erlang mailing list In-Reply-To: <8057725C-DFA9-46C3-A498-B7567B37E5B9@redstarling.com> References: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> <8057725C-DFA9-46C3-A498-B7567B37E5B9@redstarling.com> Message-ID: I created a few google groups with these names: erlang-databases erlang-network erlang-otp erlang-web erlang-misc They're available with urls in style of http://groups.google.com/group/erlang-databases You can vote with your feet if you think this initiative is a good idea. I will gladly pass over ownership and/or moderation to anyone who the majority accepts. From bob@REDACTED Wed Aug 30 17:25:27 2006 From: bob@REDACTED (Bob Ippolito) Date: Wed, 30 Aug 2006 08:25:27 -0700 Subject: Erlang does have problems In-Reply-To: References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <17244f480608291212w3dd67c26hcedbae7b74a3d53c@mail.gmail.com> <0D8DBC59-D2BE-4CF0-BC0E-A826A9250A89@gmail.com> Message-ID: <6a36e7290608300825r1386ddb3jeff8f2cd6d5bbbb@mail.gmail.com> On 8/30/06, Dmitrii Dimandt wrote: > > On 8/29/06, Joel Reymont wrote: > > > > On Aug 29, 2006, at 8:12 PM, Yariv Sadan wrote: > > > > > If this is really THE problem for Erlang systems, I think Erlang > > > should be extended with a native String type. It would have similar > > > functions to lists, but be more efficient. > > > > Just use binaries (tm). > > > This could be problematic for the developer who is not very well versed in > the fine arts of strings, binaries, conversions, encodings, etc etc etc :) > Especially for us, poor folks from non-English-speaking countries ;) > > How is it less of a problem with lists? There still isn't any support for text encodings in what ships with Erlang (that I've been able to find, anyway). -bob From erlangX@REDACTED Wed Aug 30 17:32:33 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Wed, 30 Aug 2006 08:32:33 -0700 Subject: Motorbikes does have problems (was Erlang does have problems) In-Reply-To: References: <20060829202611.GA4002@memphis> Message-ID: <20060830153233.GD22945@delora.autosys.us> Starting technique quite reminds me of my old British Small Arms Victor 441cc thumper. No longer have it, gave it to a friend for his birthday some time ago. I witnessed similar starting experiences with people who thought it should be easy to start (won at least one bet, too!). Easy once you understand ... Looking forward to your new book, Joe! ~Michael On Wed, Aug 30, 2006 at 08:57:01AM +0200, Joe Armstrong (TN/EAB) wrote: > > Hi Michael, > > You're right my Royal Enfield Bullet is an absolute bugger to start. > > << if you're good you can have a try when you come to the Erlang > conferense >> > > It also half crippled Mike Williams (one of the Erlang fathers) > who thought he would demonstrate how to kick start a 550 cc single > cylinder > machine, he used to ride a matchless so he thought he knew what he was > doing ... > > It took about a year to be able to start it. > > Here's the correct technique: > > 1) fuel on > 2) full choke > 3) Depress valve lifter and kick slowly six times > (to fill the carburettor with gas) > 5) Depress valve lifter > 6) Move kick start to just beyond top dead centre > 7) Release valve lifter > 8) Depress kick start by about 15% until you feel > some resistance > 9) Twist gas control by about 20% > 10) Put one foot on kick start, other on ground > 11) Hold *both* handle bars, while, maintaining 9) > 12) Throw yourself into air > 13) Land on kick start, with the "kick from hell" > making sure that you "follow through" ie the final resting > position of the kick start is when it bumps > into the foot rest > > If you do all of the exactly right - then it will start on the fist > kick. > > Now this technique took about a year to learn. > > By comparison installing and starting PHP, Apache and Mysql is really > easy. > > And yaws is much easier > > /Joe > > > > -----Original Message----- > > From: owner-erlang-questions@REDACTED > > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Mickael Remond > > Sent: den 29 augusti 2006 22:26 > > To: Joel Reymont > > Cc: Dmitrii Dimandt; Thomas Lindgren; Erlang-Questions Mailing List > > Subject: Motorbikes does have problems (was Erlang does have problems) > > > > Hello Guys, > > > > You know what ? > > I have heard that motorbikeis are difficult to drive. I even > > happen to know a Nobel Prize that cannot manage to drive his > > brand new motorbike. > > He his now seriously thinking about buy a Lincoln town car > > with driver. > > > From ke.han@REDACTED Wed Aug 30 17:35:32 2006 From: ke.han@REDACTED (ke han) Date: Wed, 30 Aug 2006 23:35:32 +0800 Subject: Erlang downsides? In-Reply-To: References: <44F1BB02.3080101@gmail.com> Message-ID: On Aug 28, 2006, at 11:37 AM, James Hague wrote: >> 1. Where Erlang is not "naturally suited" for that >> For example, I've read ejabberd uses C in some parts, not because >> it was >> hard or impossible to program that in Erlang, but because C is pretty >> more powerful than Erlang in such tasks. Ruby uses C extensively. Its a seamlessly integrated forethought to the language design ;-) (well, I assume its a forethought...we're on the wrong maillist to verify that) > > Weak points in the current Erlang implementation/libraries: > > * Algorithms that involve destructively updating arrays. You can > mimic this with a hash (in the guise of an ets table), but it's not > pretty. > * Unicode strings. it seems mostly that Best Practices for strings in general and Unicode are not well documented. There are good ways to solve the issues though. > * Regular expression matching (there's a module, but watch Perl beat > it by a factor of 100). What language doesn't perl beat at regex? ke han From lukas@REDACTED Wed Aug 30 17:38:35 2006 From: lukas@REDACTED (garazdawi) Date: Wed, 30 Aug 2006 16:38:35 +0100 Subject: The Erlang mailing list References: Message-ID: <20060830153835.A6F4B5A1FD@mail.erlangsystems.com> > I agree with Joe's intent... > I think the biggest two requirement to fullfil which I don't see on > trapexit are: > 1 - RSS feeds (including for non-registered users; lurkers) > 2 - forum content must get indexed by google et al.. > > without these two features its hard to migrate from maillists. > > ke han You can already access the trapexit forum through rss, more information about that is available here: http://forum.trapexit.org/viewtopic.php?t=5859 Trapexit has been submitted to the google crawler for indexing, so it will hopefully be indexed within the next couple of weeks. Lukas Larsson Admin at Trapexit.org -- There are 10 kinds of people, those who speak binary and those who don't. _________________________________________________________ Post sent from http://www.trapexit.org From erlangX@REDACTED Wed Aug 30 17:54:05 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Wed, 30 Aug 2006 08:54:05 -0700 Subject: Error reported when using pmap In-Reply-To: References: Message-ID: <20060830155405.GF22945@delora.autosys.us> $ uname -a Linux delora 2.6.15-23-386 #1 PREEMPT Tue May 23 13:49:40 UTC 2006 i686 GNU/Linux $ cat testmain.erl -module(testmain). -export([test3/0]). test3() -> MyList = [1,2,3,4,5,6,7,8,9,10], lists:map(fun(I) -> I*2 end, MyList). $ erl -sname del Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] Eshell V5.5 (abort with ^G) (del@REDACTED)1> c(testmain). {ok,testmain} (del@REDACTED)2> testmain:test3(). [2,4,6,8,10,12,14,16,18,20] (del@REDACTED)3> l(testmain). {module,testmain} (del@REDACTED)4> ~M On Wed, Aug 30, 2006 at 04:22:28PM +0800, Arbow wrote: > Hi All: > I am new in Erlang, and try the pmap at http://www.erlang.org/ml-archive/ > erlang-questions/200606/msg00187.html: > > In file test.erl: > -module(test). > -export([pmap/2]). > > pmap(F, L) -> > S = self(), > Pids = list:map( > fun(I) -> > spawn( > fun() -> > do_f(S, F, I) > end) > end, L), > gather(Pids). > > gather([H|T]) -> > receive > {H, Ret} -> [Ret|gather(T)] > end; > gather([]) -> > []. > > do_f(Parent, F, I) -> > io:format("Receive item ~w~n", [I]), > Parent ! {self(), (catch F(I))}. > > In file testmain.erl: > -module(testmain). > -export([test3/0]). > > test3() -> > MyList = [1,2,3,4,5,6,7,8,9,10], > lists:map(fun(I) -> I*2 end, MyList). > > when I execute " testmain:test3(). ", I get errors: > > =ERROR REPORT==== 30-Aug-2006::16:21:51 === > Error in process <0.36.0> on node 'Erlide_2960df@REDACTED' with exit value: > {undef,[{testmain,test3,[]},{erl_eval,do_apply,5},{shell,exprs,6}, > {shell,eval_loop,3}]} > > ** exited: {undef,[{testmain,test3,[]}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > Anyone could help me? Thanks. > > Best regards. > Arbow -- Michael McDaniel Portland, Oregon, USA http://autosys.us +1 503 283 5284 From erlangX@REDACTED Wed Aug 30 17:58:51 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Wed, 30 Aug 2006 08:58:51 -0700 Subject: The Erlang mailing list In-Reply-To: References: Message-ID: <20060830155851.GG22945@delora.autosys.us> I like this suggestion, Joe, for going to trapexit. Regarding suggestions about google or yahoo, I tend to stay away from any group/list on the 'mega systems' and would probably migrate offlist if one ('mega system') were chosen as the erlang venue. ~M On Wed, Aug 30, 2006 at 11:36:46AM +0200, Joe Armstrong (TN/EAB) wrote: > > Once upon a time we started an Erlang mailing list. > > We used majordomo - we said "Let's put everything into one group" - > if the traffic gets too much we can split the group. > > Then we split the groups. > > To sign up you have to go to www.erlang.org then click on FAQs + > mailing lists > then you can read the old archives, or sign up so you get sent the mails > or > so that you can post to the list. > > This list seems to be exploding - as does traffic to the Erlang blogs. > > Recently there have been large numbers of posts to this list on porting > problems > and beginners questions. > > I think it is time to migrate to a forum and make a finer sub-division > of > the lists. > > The best alternative seems to be http://forum.trapexit.org/ > > The distribution of traffic at trapexit is very skew > > For example, there is a group Installing Erlang (at trap exit) with 3 > posts > but erlang-questions has 5318 posts - which get cross posted from > this list. > > Seems to me, like it would be a good idea to register with and post to > trap-exit, otherwise this group will disintegrate with the volume of > traffic. > > /Joe > -- Michael McDaniel Portland, Oregon, USA http://autosys.us +1 503 283 5284 From headspin@REDACTED Wed Aug 30 18:05:33 2006 From: headspin@REDACTED (dda) Date: Wed, 30 Aug 2006 18:05:33 +0200 Subject: The Erlang mailing list In-Reply-To: References: Message-ID: The Ruby-Talk list has daily the weekly traffic of this list, if not more, and they're nowhere near explosion. Their archives browser is ugly though... :-) -- Didier On 8/30/06, Joe Armstrong (TN/EAB) wrote: > > Once upon a time we started an Erlang mailing list. > > We used majordomo - we said "Let's put everything into one group" - > if the traffic gets too much we can split the group. > > Then we split the groups. > > To sign up you have to go to www.erlang.org then click on FAQs + > mailing lists > then you can read the old archives, or sign up so you get sent the mails > or > so that you can post to the list. > > This list seems to be exploding - as does traffic to the Erlang blogs. > > Recently there have been large numbers of posts to this list on porting > problems > and beginners questions. > > I think it is time to migrate to a forum and make a finer sub-division > of > the lists. > > The best alternative seems to be http://forum.trapexit.org/ > > The distribution of traffic at trapexit is very skew > > For example, there is a group Installing Erlang (at trap exit) with 3 > posts > but erlang-questions has 5318 posts - which get cross posted from > this list. > > Seems to me, like it would be a good idea to register with and post to > trap-exit, otherwise this group will disintegrate with the volume of > traffic. > > /Joe From joelr1@REDACTED Wed Aug 30 18:09:10 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 17:09:10 +0100 Subject: Screen scraping In-Reply-To: References: <1F5AC999-33E9-4ACC-AE63-D1CA00D3E11B@gmail.com> <44F53C0C.1020208@hyber.org> Message-ID: How would you compare it to www_tools and its parser? Have you tried that? On Aug 30, 2006, at 3:08 PM, Anders Nygren wrote: > I tried to use it [yaws parser] once and I found it to not be so > forgiving on broken > real-world(tm) > html. If it doesn't find the end tags it expects it chokes. -- http://wagerlabs.com/ From joelr1@REDACTED Wed Aug 30 18:10:56 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 17:10:56 +0100 Subject: Introducing ErlyDB: The Erlang Twist on Database Abstraction In-Reply-To: <9CB79C836F98504C81BF082C4291E987792B3E@CHITDSEXC02.tds.corp.cendant.org> References: <9CB79C836F98504C81BF082C4291E987792B3E@CHITDSEXC02.tds.corp.cendant.org> Message-ID: On Aug 30, 2006, at 3:21 PM, Logan, Martin wrote: > Erlydb looks great. This is just what erlang needs. Nice work so > far. What about performance? Is it possible to pre-compile the code to support the database schema at the moment of compilation? I assume this would be faster overall than generating Erlang code at request time. How is this handled by Erlydb? At what point does it generate/compile the code? Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Wed Aug 30 18:16:29 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 17:16:29 +0100 Subject: Erlang/OTP R11B-1 has been released In-Reply-To: <17653.42376.606501.470993@alkaid.it.uu.se> References: <17653.42376.606501.470993@alkaid.it.uu.se> Message-ID: <319581F2-0A87-49F9-A8CA-31C11AFDA6A9@gmail.com> Mikael, On Aug 30, 2006, at 3:49 PM, Mikael Pettersson wrote: > Intel Mac users may be interested in knowing that R11B-1 > includes support for FP exceptions and HiPE on Darwin/x86-32. > Those updates came very late so they missed being described > in the readme. Is this just FP exceptions or HiPE also? Thanks, Joel -- http://wagerlabs.com/ From anders.nygren@REDACTED Wed Aug 30 18:17:19 2006 From: anders.nygren@REDACTED (Anders Nygren) Date: Wed, 30 Aug 2006 11:17:19 -0500 Subject: Screen scraping In-Reply-To: References: <1F5AC999-33E9-4ACC-AE63-D1CA00D3E11B@gmail.com> <44F53C0C.1020208@hyber.org> Message-ID: On 8/30/06, Joel Reymont wrote: > How would you compare it to www_tools and its parser? > > Have you tried that? > No, I never tried www_tools, sorry /Anders > On Aug 30, 2006, at 3:08 PM, Anders Nygren wrote: > > > I tried to use it [yaws parser] once and I found it to not be so > > forgiving on broken > > real-world(tm) > > html. If it doesn't find the end tags it expects it chokes. > > -- > http://wagerlabs.com/ > > > > > > From simonpeterchappell@REDACTED Wed Aug 30 18:22:24 2006 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Wed, 30 Aug 2006 11:22:24 -0500 Subject: The Erlang mailing list In-Reply-To: <20060830155851.GG22945@delora.autosys.us> References: <20060830155851.GG22945@delora.autosys.us> Message-ID: <8ed733900608300922i773a83e9r773788acfca23c07@mail.gmail.com> On 8/30/06, Michael McDaniel wrote: > I like this suggestion, Joe, for going to trapexit. > > Regarding suggestions about google or yahoo, I tend to stay away from > any group/list on the 'mega systems' and would probably migrate offlist > if one ('mega system') were chosen as the erlang venue. It really does depend on the individual group. I've tried some where I unsubscribed in quick order, but as I've already mentioned in an earlier post, the JUnit group on Yahoo Groups is a shining jewel of help, discussion and debate. I'm sure an Erlang group would be the same. Simon -- www.simonpeter.org From joelr1@REDACTED Wed Aug 30 18:34:39 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 17:34:39 +0100 Subject: Mnesia dB size limits In-Reply-To: References: Message-ID: I have a suspicion that when people mention that Mnesia is great with huge data sets they unintentionally forget to mention important details. My understanding is that call record databases are insert/ retrieve only or for the most part. When people outside of the telco world ask about Mnesia they usually have MySQL, etc. in mind and wonder about insert/delete/update performance. My understanding at the moment is that Mnesia is not the best database for insert/update/delete, much less with huge databases. Please correct me if I'm wrong! On Aug 30, 2006, at 4:10 PM, Philip Robinson wrote: > I was once writing a program that needed to retrieve events > within a date/time range from an mnesia table, and found that it > did not seem to be hitting the index. It would scan the entire > 1-million-plus records every query... dead slow. > > When I wanted to retrieve a specific event there was no noticable > delay, but most of my queries were for a date/time range. > > I think the mnesia issues being mentioned on this list were to do > with database recovery across nodes after a node failure...? -- http://wagerlabs.com/ From joelr1@REDACTED Wed Aug 30 18:36:16 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 17:36:16 +0100 Subject: Erlang does have problems In-Reply-To: <6a36e7290608300825r1386ddb3jeff8f2cd6d5bbbb@mail.gmail.com> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <17244f480608291212w3dd67c26hcedbae7b74a3d53c@mail.gmail.com> <0D8DBC59-D2BE-4CF0-BC0E-A826A9250A89@gmail.com> <6a36e7290608300825r1386ddb3jeff8f2cd6d5bbbb@mail.gmail.com> Message-ID: On Aug 30, 2006, at 4:25 PM, Bob Ippolito wrote: > How is it less of a problem with lists? There still isn't any support > for text encodings in what ships with Erlang (that I've been able to > find, anyway). I (naively?) assumed that it's easier to process text encodings using lists than binaries. It should be the same, now that I think about it, just using much less space with binaries and maybe even faster. -- http://wagerlabs.com/ From joelr1@REDACTED Wed Aug 30 18:41:48 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 17:41:48 +0100 Subject: The Erlang mailing list In-Reply-To: <8ed733900608300701n7f366a03yf0c6eea4bf868344@mail.gmail.com> References: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> <8ed733900608300701n7f366a03yf0c6eea4bf868344@mail.gmail.com> Message-ID: On Aug 30, 2006, at 3:01 PM, Simon Chappell wrote: > Personally, I like the Yahoo groups. I'm a moderator on the JUnit > group and it seems to function pretty well. That said, I'm sure that > Google groups are comparable. I prefer the Web interface of Google groups. It shows all posts in a single page and I don't have to muck with expand, etc. It can also show you the thread in a side bar. Yahoo is a pain in the rear when browsing, IMO. >> There's already http://groups.google.com/group/think_erlang that I >> started a while ago. > > The group appears to be invitation only. That might slow down > membership. Ask for an invite and be one of the chosen few! But seriously, the group was started in jest (check out the description) and for a handful of people to interact. I'm not sure how it would be different from this list. More conceptual maybe? -- http://wagerlabs.com/ From serge@REDACTED Wed Aug 30 18:44:12 2006 From: serge@REDACTED (asergey) Date: Wed, 30 Aug 2006 17:44:12 +0100 Subject: setting up distributed environment References: Message-ID: <20060830164412.245405A1FC@mail.erlangsystems.com> [quote] > It's a bit unclear what do you mean by a 'master' node. Mnesia > doesn't have a notion of a master or slave. Any node that has a I mean 'mnesia:set_master_nodes/1'. [/quote] In my understanding mnesia:set_master_nodes/1 plays role in the selection of the source of replicated table(s) when you have an abnormal condition (i.e. partitioned network, system startup, etc), when you want to override default behaviour of selecting table sources based on 'extra_db_nodes'. Yet in "normal" operating conditions 'extra_db_nodes' helps mnesia determine the source nodes of replicated tables containing disk copies. [quote] > In your application you could have two nodes running on two separate > hosts with tables created using 'disc_copies' option. The mnesia > application would need to be started with the 'extra_db_nodes' option Will 'mnesia:add_table_copy/3' make the deal? Should I run each node with 'extra_db_nodes' option all the time? [/quote] mnesia:add_table_copy/3 should be used in cases when you need to add another replica to a node running mnesia. An example could be that you have two primary nodes 'a' and 'b' with disk_copies of a table 'customer' each started with 'extra_db_nodes' option containing: [a@REDACTED, b@REDACTED]. Suppose you want to dynamically add another replica of the 'customer' table in a node c@REDACTED containing a ram copy of the table. In this case c@REDACTED node should be started with the extra_db_nodes option containing [a@REDACTED, b@REDACTED], and mnesia:add_table_copy/3 can be used to add a local replica of the table residing on nodes a@REDACTED and b@REDACTED Note that as the result the disk-based database schema hosted on the [a@REDACTED, b@REDACTED] will be updated with the information that the table 'customer' is replicated to the c@REDACTED node as a ram copy. So, extra_db_nodes option tells the current node: 1. To establish connection at startup with the nodes listed in extra_db_nodes option. 2. Where to find nodes containing database schema. I am not sure though that this reply addressed your original question. Regards, Serge _________________________________________________________ Post sent from http://www.trapexit.org From bob@REDACTED Wed Aug 30 19:07:50 2006 From: bob@REDACTED (Bob Ippolito) Date: Wed, 30 Aug 2006 10:07:50 -0700 Subject: Erlang does have problems In-Reply-To: References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <17244f480608291212w3dd67c26hcedbae7b74a3d53c@mail.gmail.com> <0D8DBC59-D2BE-4CF0-BC0E-A826A9250A89@gmail.com> <6a36e7290608300825r1386ddb3jeff8f2cd6d5bbbb@mail.gmail.com> Message-ID: <6a36e7290608301007u481d01a7kff4f74d2424e16a7@mail.gmail.com> On 8/30/06, Joel Reymont wrote: > > On Aug 30, 2006, at 4:25 PM, Bob Ippolito wrote: > > > How is it less of a problem with lists? There still isn't any support > > for text encodings in what ships with Erlang (that I've been able to > > find, anyway). > > I (naively?) assumed that it's easier to process text encodings using > lists than binaries. It should be the same, now that I think about > it, just using much less space with binaries and maybe even faster. You could reasonably work with (lists of?) UTF-8 binaries as the in-memory representation. With that representation, you often won't have to convert things again for the wire. -bob From ke.han@REDACTED Wed Aug 30 19:09:24 2006 From: ke.han@REDACTED (ke han) Date: Thu, 31 Aug 2006 01:09:24 +0800 Subject: The Erlang mailing list In-Reply-To: References: Message-ID: <5DFE7E1C-8695-4014-A9B9-C2F12AED76F5@redstarling.com> On Aug 31, 2006, at 12:05 AM, dda wrote: > The Ruby-Talk list has daily the weekly traffic of this list, if not > more, and they're nowhere near explosion. Their archives browser is > ugly though... :-) yes, there are lots of lists that dwarf the traffic of this one that don't segment and are very useful communities. But if _not_ providing a way to appease people that are bothered by the high/ unsegmented traffic would lessen their involvement, then we need a solution. Maillists are the lowest common denominator and a default choice but if trapexit has worked through its bootstrapping issues and is ready to support us, it sounds fine. As to the google option, the user interface is just right IMO, but if it would offend some to go with a big name host, lets not fragment the group...that would be the worst thing that could happen. Just a few cents from someone who still considers himself an erlang noob and needs a solid community to count on. ke han > > -- > Didier > > On 8/30/06, Joe Armstrong (TN/EAB) wrote: >> >> Once upon a time we started an Erlang mailing list. >> >> We used majordomo - we said "Let's put everything into one group" - >> if the traffic gets too much we can split the group. >> >> Then we split the groups. >> >> To sign up you have to go to www.erlang.org then click on FAQs + >> mailing lists >> then you can read the old archives, or sign up so you get sent the >> mails >> or >> so that you can post to the list. >> >> This list seems to be exploding - as does traffic to the Erlang >> blogs. >> >> Recently there have been large numbers of posts to this list on >> porting >> problems >> and beginners questions. >> >> I think it is time to migrate to a forum and make a finer sub- >> division >> of >> the lists. >> >> The best alternative seems to be http://forum.trapexit.org/ >> >> The distribution of traffic at trapexit is very skew >> >> For example, there is a group Installing Erlang (at trap exit) >> with 3 >> posts >> but erlang-questions has 5318 posts - which get cross posted from >> this list. >> >> Seems to me, like it would be a good idea to register with and >> post to >> trap-exit, otherwise this group will disintegrate with the volume of >> traffic. >> >> /Joe From yarivvv@REDACTED Wed Aug 30 19:34:57 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 30 Aug 2006 13:34:57 -0400 Subject: Introducing ErlyDB: The Erlang Twist on Database Abstraction In-Reply-To: References: <9CB79C836F98504C81BF082C4291E987792B3E@CHITDSEXC02.tds.corp.cendant.org> Message-ID: <17244f480608301034h6fe7392k4b7c70ecd042dbce@mail.gmail.com> The Erlang code is generated just once, when you call erlydb:code_gen. This generates the entire abstraction layer on the fly. The idea is to call erlydb:code_gen once when you boostrap your app and then every time you make a schema change to your database. No code is generated at request time. On 8/30/06, Joel Reymont wrote: > > On Aug 30, 2006, at 3:21 PM, Logan, Martin wrote: > > > Erlydb looks great. This is just what erlang needs. Nice work so > > far. > > What about performance? Is it possible to pre-compile the code to > support the database schema at the moment of compilation? I assume > this would be faster overall than generating Erlang code at request > time. > > How is this handled by Erlydb? At what point does it generate/compile > the code? > > Thanks, Joel > > -- > http://wagerlabs.com/ > > > > > > From headspin@REDACTED Wed Aug 30 19:35:18 2006 From: headspin@REDACTED (dda) Date: Wed, 30 Aug 2006 19:35:18 +0200 Subject: The Erlang mailing list In-Reply-To: <5DFE7E1C-8695-4014-A9B9-C2F12AED76F5@redstarling.com> References: <5DFE7E1C-8695-4014-A9B9-C2F12AED76F5@redstarling.com> Message-ID: Like you I consider myself a newcomer, and appreciate the wealth of information. And by using GMail I get threads and a search engine, which helps a lot my browsing [or dismissing] of discussions. Just because I have mail doesn't mean I am going to read it... at least on the spot. OTOH, forums don't work for me, never have, never will. As for being offended by using a reliable solution by Google or Yahoo! I don't get it [and let's not start arguing this...]. But that's probably just me. I just hope one or more lists will be kept because I'd hate to loose such a good resource as erlang-questions. -- Didier On 8/30/06, ke han wrote: > > On Aug 31, 2006, at 12:05 AM, dda wrote: > > > The Ruby-Talk list has daily the weekly traffic of this list, if not > > more, and they're nowhere near explosion. Their archives browser is > > ugly though... :-) > > yes, there are lots of lists that dwarf the traffic of this one that > don't segment and are very useful communities. But if _not_ > providing a way to appease people that are bothered by the high/ > unsegmented traffic would lessen their involvement, then we need a > solution. Maillists are the lowest common denominator and a default > choice but if trapexit has worked through its bootstrapping issues > and is ready to support us, it sounds fine. As to the google option, > the user interface is just right IMO, but if it would offend some to > go with a big name host, lets not fragment the group...that would be > the worst thing that could happen. > Just a few cents from someone who still considers himself an erlang > noob and needs a solid community to count on. > ke han From yarivvv@REDACTED Wed Aug 30 19:41:34 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 30 Aug 2006 13:41:34 -0400 Subject: Mnesia dB size limits In-Reply-To: References: Message-ID: <17244f480608301041y55d98712r453d80c2a0fd51a1@mail.gmail.com> AFAIK the problems with Mnesia isn't that you can't insert a lot of data into it, but the following: 1) in the event of a crash, a very large dets table takes a long time to repair. 2) there are no join optimizations (yet), so some queries can take a long time to process 3) as the dets freelist gets fragmented it consumes more and more memory. None of these items means you can't put a lot of data in Mnesia -- they just mean that you may run into problems if you do. With ets tables, issues 1) and 3) go away. Yariv On 8/30/06, Joel Reymont wrote: > I have a suspicion that when people mention that Mnesia is great with > huge data sets they unintentionally forget to mention important > details. My understanding is that call record databases are insert/ > retrieve only or for the most part. > > When people outside of the telco world ask about Mnesia they usually > have MySQL, etc. in mind and wonder about insert/delete/update > performance. My understanding at the moment is that Mnesia is not the > best database for insert/update/delete, much less with huge databases. > > Please correct me if I'm wrong! > > On Aug 30, 2006, at 4:10 PM, Philip Robinson wrote: > > > I was once writing a program that needed to retrieve events > > within a date/time range from an mnesia table, and found that it > > did not seem to be hitting the index. It would scan the entire > > 1-million-plus records every query... dead slow. > > > > When I wanted to retrieve a specific event there was no noticable > > delay, but most of my queries were for a date/time range. > > > > I think the mnesia issues being mentioned on this list were to do > > with database recovery across nodes after a node failure...? > > -- > http://wagerlabs.com/ > > > > > > From simonpeterchappell@REDACTED Wed Aug 30 19:43:13 2006 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Wed, 30 Aug 2006 12:43:13 -0500 Subject: The Erlang mailing list In-Reply-To: References: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> <8ed733900608300701n7f366a03yf0c6eea4bf868344@mail.gmail.com> Message-ID: <8ed733900608301043o4a7b42f1vdbea96bf84a571eb@mail.gmail.com> On 8/30/06, Joel Reymont wrote: > > On Aug 30, 2006, at 3:01 PM, Simon Chappell wrote: > > > Personally, I like the Yahoo groups. I'm a moderator on the JUnit > > group and it seems to function pretty well. That said, I'm sure that > > Google groups are comparable. > > I prefer the Web interface of Google groups. It shows all posts in a > single page and I don't have to muck with expand, etc. It can also > show you the thread in a side bar. Yahoo is a pain in the rear when > browsing, IMO. I take a mixed approach. I normally interface with the group through email and I use Google Mail for that, so I get the nice conversational groupings and great interface. :-) > >> There's already http://groups.google.com/group/think_erlang that I > >> started a while ago. > > > > The group appears to be invitation only. That might slow down > > membership. > > Ask for an invite and be one of the chosen few! But seriously, the > group was started in jest (check out the description) and for a > handful of people to interact. I'm not sure how it would be different > from this list. More conceptual maybe? If you are prepared to accommodate folks that are really interested in learning and using Erlang, then I'd be happy to sign up. I'd try to keep the dumb questions to a minimum and would write down the words of wisdom that I receive and post them on my website as reference material (something I'm already doing for the Groovy scripting language) for other new Erlangers moving from procedural languages to concurrent functional programming nirvana. (Was that enough grovelling? ;-) Simon -- www.simonpeter.org From yarivvv@REDACTED Wed Aug 30 19:47:29 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 30 Aug 2006 13:47:29 -0400 Subject: Erlang does have problems In-Reply-To: <6a36e7290608300825r1386ddb3jeff8f2cd6d5bbbb@mail.gmail.com> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <17244f480608291212w3dd67c26hcedbae7b74a3d53c@mail.gmail.com> <0D8DBC59-D2BE-4CF0-BC0E-A826A9250A89@gmail.com> <6a36e7290608300825r1386ddb3jeff8f2cd6d5bbbb@mail.gmail.com> Message-ID: <17244f480608301047i5ababa2dla3662fff443437d0@mail.gmail.com> Look in the xmerl package. I think the file is called xml_ucs or something. Yariv > > > > How is it less of a problem with lists? There still isn't any support > for text encodings in what ships with Erlang (that I've been able to > find, anyway). > > -bob > From joelr1@REDACTED Wed Aug 30 19:51:07 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 18:51:07 +0100 Subject: The Erlang mailing list In-Reply-To: <5DFE7E1C-8695-4014-A9B9-C2F12AED76F5@redstarling.com> References: <5DFE7E1C-8695-4014-A9B9-C2F12AED76F5@redstarling.com> Message-ID: <4F285F10-D81E-451E-A8F0-4417F7724C3B@gmail.com> We appear to have ~600 members on this list, this is what I was told last time I asked. Is there a real need to split it? If yes then the discussion should be first along what lines and second where to host the sub-lists. -- http://wagerlabs.com/ From ke.han@REDACTED Wed Aug 30 15:02:19 2006 From: ke.han@REDACTED (ke han) Date: Wed, 30 Aug 2006 21:02:19 +0800 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <6056733.post@talk.nabble.com> References: <6056733.post@talk.nabble.com> Message-ID: <0C554180-FD58-4069-9430-170213B71689@redstarling.com> Byron, A few notes in regards to this line of code: >> listlen([First|TheRest]) -> 1 + listlen([TheRest]). 1 - your error appears to be that you are laking the tail of the list, bound as TheRest, and putting it back inside another list by your call to listlen([TheRest]). This is a common type of bug, no shame here, I'm sure I've done it before. TheRest is already a list, your tail recursive call is wrapping it inside another list with each call. So, yes you will run out of memory ;-) 2 - I would always put a space between my variable names and the | symbol. Your code: [First|TheRest] needs to be more readable. I always write code that has good spacing / formatting both for readability and to ensure I never hit any potential edge/corner cases of the compile toolchain. This is a general programming rule. I know of no reasons why erlang would read your code incorrectly. 3 - Also, for efficiency sake, you should name the variable "First" as "_First" to indicate you do not want the value bound. have fun, ke han On Aug 30, 2006, at 7:06 PM, fbg111 wrote: > > Hi all, I'm an Erlang noob working through the getting started > material at > erlang.org, and I have a question about a problem that's occuring > with my > code. If this isn't the appropriate place for this question, my > apologies > for wasting the bandwidth, please point me in the right direction. > Otherwise, running the function listlen([1,2,...n]) crashes the Erlang > emulator in WinXP. However, I can't see the difference b/t my code > and the > example code: > > http://erlang.org/doc/doc-5.5/doc/getting_started/seq_prog.html#2.5 > Example > code: > > >> The following example shows how we find the length of a list: >> >> -module(tut4). >> -export([list_length/1]). >> >> list_length([]) -> >> 0; >> list_length([First | Rest]) -> >> 1 + list_length(Rest). >> >> Compile (file tut4.erl) and test: >> 29> c(tut4). >> {ok,tut4} >> 30> tut4:list_length([1,2,3,4,5,6,7]). >> 7 >> > > My code: > > >> -module(tut). >> -export([double/1,fac/1,mult/2,convert/1,conv/2,listlen/1]). >> >> double(X) -> 2 * X. >> fac(0) -> 1; >> fac(N) -> N * fac(N-1). >> mult(X,Y) -> X*Y. >> conv(M,toInch) -> M/2.54; >> conv(N,toCentimeter) -> N*2.54. >> convert({M,centimeters}) -> {M/2.54,inches}; >> convert({M,inches}) -> {M*2.54,centimeters}. >> listlen([]) -> 0; >> listlen([First|TheRest]) -> 1 + listlen([TheRest]). >> > > And the result of running my code: > > >> Erlang (BEAM) emulator version 5.5 [async-threads:0] >> >> Eshell V5.5 (abort with ^G) >> 1> c(tut). >> ./tut.erl:13: Warning: variable 'First' is unused >> {ok,tut} >> 2> tut:listlen([]). >> 0 >> 3> tut:listlen([1,2]). >> >> Crash dump was written to: erl_crash.dump >> eheap_alloc: Cannot allocate 583848200 bytes of memory (of type >> "heap"). >> >> Abnormal termination >> > > Windows Task Manager confirms the process werl is trying to use > 581MB of > RAM. Before I tried to run this, Task Manager showed 821MB RAM in > use, out > of 1GB. Is this a problem with my code, or with my memory useage? > Any > suggestions about what I'm doing wrong? Thanks, > > Byron > -- > View this message in context: http://www.nabble.com/Noob---Getting- > Started-Infinte-Loop--tf2189189.html#a6056733 > Sent from the Erlang Questions forum at Nabble.com. > From ryanobjc@REDACTED Wed Aug 30 20:09:54 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Wed, 30 Aug 2006 11:09:54 -0700 Subject: The Erlang mailing list In-Reply-To: <8ed733900608301043o4a7b42f1vdbea96bf84a571eb@mail.gmail.com> References: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> <8ed733900608300701n7f366a03yf0c6eea4bf868344@mail.gmail.com> <8ed733900608301043o4a7b42f1vdbea96bf84a571eb@mail.gmail.com> Message-ID: <78568af10608301109q21816f9dmf0c61bc7bf63a5cc@mail.gmail.com> I also prefer mail lists. That way people can use whatever interface they want to read the messages with. Personally I have found that gmail is the absolute 100% best interface for reading and keeping up with mail lists/groups. As for the forum/email gateway idea - this can be ok, but as long as the forum is a good emailer and threading doesn't break. I don't personally understand why people would be worried about using a google groups. If the UI is better, and it's free, then who cares? -ryan On 8/30/06, Simon Chappell wrote: > On 8/30/06, Joel Reymont wrote: > > > > On Aug 30, 2006, at 3:01 PM, Simon Chappell wrote: > > > > > Personally, I like the Yahoo groups. I'm a moderator on the JUnit > > > group and it seems to function pretty well. That said, I'm sure that > > > Google groups are comparable. > > > > I prefer the Web interface of Google groups. It shows all posts in a > > single page and I don't have to muck with expand, etc. It can also > > show you the thread in a side bar. Yahoo is a pain in the rear when > > browsing, IMO. > > I take a mixed approach. I normally interface with the group through > email and I use Google Mail for that, so I get the nice conversational > groupings and great interface. :-) > > > >> There's already http://groups.google.com/group/think_erlang that I > > >> started a while ago. > > > > > > The group appears to be invitation only. That might slow down > > > membership. > > > > Ask for an invite and be one of the chosen few! But seriously, the > > group was started in jest (check out the description) and for a > > handful of people to interact. I'm not sure how it would be different > > from this list. More conceptual maybe? > > If you are prepared to accommodate folks that are really interested in > learning and using Erlang, then I'd be happy to sign up. I'd try to > keep the dumb questions to a minimum and would write down the words of > wisdom that I receive and post them on my website as reference > material (something I'm already doing for the Groovy scripting > language) for other new Erlangers moving from procedural languages to > concurrent functional programming nirvana. (Was that enough > grovelling? ;-) > > Simon > > -- > www.simonpeter.org > From jay.mccarthy@REDACTED Wed Aug 30 21:09:29 2006 From: jay.mccarthy@REDACTED (Jay McCarthy) Date: Wed, 30 Aug 2006 15:09:29 -0400 Subject: Finally: Mac Intel patches In-Reply-To: References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <20060823065514.GB4165@memphis> Message-ID: The R11B-1 release does not contain the mach_override files, nor instructions on how to get them. Jay On 8/25/06, Mikael Pettersson wrote: > The final set of Darwin/x86 patches have been committed to > the HiPE/OTP source repository, and they are likely to be > included in the upcoming R11B-1 release. On 8/23/06, Joel Reymont wrote: > I conveniently forgot to mention a key thing. You need to grab > mach_override.{c,h} from http://extendamac.sourceforge.net/ and drop > these into erts/emulator/hipe/. These are needed to patch up the > running erlang binary, nothing will work otherwise. -- Jay McCarthy http://jay.makeoutcity.com/ From vladdu55@REDACTED Wed Aug 30 21:35:12 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 30 Aug 2006 20:35:12 +0100 Subject: Introducing ErlyDB: The Erlang Twist on Database Abstraction In-Reply-To: <17244f480608301034h6fe7392k4b7c70ecd042dbce@mail.gmail.com> References: <9CB79C836F98504C81BF082C4291E987792B3E@CHITDSEXC02.tds.corp.cendant.org> <17244f480608301034h6fe7392k4b7c70ecd042dbce@mail.gmail.com> Message-ID: <95be1d3b0608301235wb6f80b5maef1cf89c871ce5@mail.gmail.com> On 8/30/06, Yariv Sadan wrote: > The Erlang code is generated just once, when you call erlydb:code_gen. > This generates the entire abstraction layer on the fly. The idea is to > call erlydb:code_gen once when you boostrap your app and then every > time you make a schema change to your database. No code is generated > at request time. Hi, Just a thought: regenerating the code at run-time when the schema changes is dangerous. Unless the change is trivial, any client modules would need to be updated too. IMHO it might be better to do the generation at compile time so that all changes can be caught and corrected before deploying the whole system at once. BTW, a non-trivial schema change can't be handled without taking the system down anyway, so maybe the above is not helping much :-) The important observation is that there's much more to think about than just generating the abstraction layer. regards, Vlad From parault2@REDACTED Wed Aug 30 21:36:34 2006 From: parault2@REDACTED (Patrice Rault) Date: Wed, 30 Aug 2006 21:36:34 +0200 Subject: Error reported when using pmap In-Reply-To: References: Message-ID: <1156966594.2517.13.camel@localhost.localdomain> Hello, Le mercredi 30 ao?t 2006 ? 16:22 +0800, Arbow a ?crit : > Hi All: > I am new in Erlang, and try the pmap at > http://www.erlang.org/ml-archive/erlang-questions/200606/msg00187.html: > > In file test.erl: > -module(test). > -export([pmap/2]). > > pmap(F, L) -> > S = self(), > Pids = list:map( > fun(I) -> > spawn( > fun() -> > do_f(S, F, I) > end) > end, L), > gather(Pids). > > gather([H|T]) -> > receive > {H, Ret} -> [Ret|gather(T)] > end; > gather([]) -> > []. > > do_f(Parent, F, I) -> > io:format("Receive item ~w~n", [I]), > Parent ! {self(), (catch F(I))}. > > In file testmain.erl: > -module(testmain). > -export([test3/0]). > > test3() -> > MyList = [1,2,3,4,5,6,7,8,9,10], > lists:map(fun(I) -> I*2 end, MyList). > > when I execute " testmain:test3(). ", I get errors: > > =ERROR REPORT==== 30-Aug-2006::16:21:51 === > Error in process <0.36.0> on node 'Erlide_2960df@REDACTED' with exit > value: > {undef,[{testmain,test3,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > ** exited: {undef,[{testmain,test3,[]}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > Anyone could help me? Thanks. > > Best regards. > Arbow Try this -module(test_pmap). -export([pmap/2]). pmap(F, L) -> S = self(), Pids = lists:map( % list:map ?? fun(I) -> spawn( fun() -> do_f(S, F, I) end) end, L), gather(Pids). gather([H|T]) -> receive {H, Ret} -> [Ret|gather(T)] end; gather([]) -> []. do_f(Parent, F, I) -> %io:format("Receive item ~w~n", [I]), Parent ! {self(), (catch F(I))}. -module(testmain). -export([test3/0]). test3() -> MyList = [1,2,3,4,5,6,7,8,9,10], %lists:map(fun(I) -> I*2 end, MyList), test_pmap:pmap(fun(I) -> I*2 end, MyList). Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] Eshell V5.5 (abort with ^G) 1> c(test_pmap). {ok,test_pmap} 2> c(testmain). {ok,testmain} 3> testmain:test3(). [2,4,6,8,10,12,14,16,18,20] 4> l(testmain). {module,testmain} 5> Regards. From robert.virding@REDACTED Wed Aug 30 22:00:43 2006 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 30 Aug 2006 22:00:43 +0200 Subject: Erlang does have problems In-Reply-To: References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <17244f480608291212w3dd67c26hcedbae7b74a3d53c@mail.gmail.com> <0D8DBC59-D2BE-4CF0-BC0E-A826A9250A89@gmail.com> <6a36e7290608300825r1386ddb3jeff8f2cd6d5bbbb@mail.gmail.com> Message-ID: <44F5EE6B.3040001@telia.com> No, while binaries, or a string data type equivalent, are definitely much more space efficient (a factor 2-8 depending on encoding) they are probably much slower for processing strings. Especially for pulling them apart and rebuilding them, and inserting or deleting bits which would entail much copying. Of course you could make a more complex datatype which keeps the characters in a linked sequence ... :-) Strings as lists also has the benefit that you can more easily work on 16 or 32 bit unicode characters directly without worrying about encoding. Then encode them when done. I would keep the statis strings as binaries and dynamic ones as lists. Robert Joel Reymont wrote: > > On Aug 30, 2006, at 4:25 PM, Bob Ippolito wrote: > >> How is it less of a problem with lists? There still isn't any support >> for text encodings in what ships with Erlang (that I've been able to >> find, anyway). > > > I (naively?) assumed that it's easier to process text encodings using > lists than binaries. It should be the same, now that I think about it, > just using much less space with binaries and maybe even faster. > > -- > http://wagerlabs.com/ From robert.virding@REDACTED Wed Aug 30 22:04:10 2006 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 30 Aug 2006 22:04:10 +0200 Subject: Mailing list message size Message-ID: <44F5EF3A.2020407@telia.com> Is there any limitation to the size of a message in the mailing list? I tried to publish the latest Erlog release (much improved) and it quietly vanished into the bit-bucket. And the code is pretty beautiful as well, so it wasn't that. :-) Robert From robert.virding@REDACTED Wed Aug 30 22:12:47 2006 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 30 Aug 2006 22:12:47 +0200 Subject: The Erlang mailing list In-Reply-To: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> References: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> Message-ID: <44F5F13F.1020505@telia.com> Joel Reymont wrote: > May I suggest a series of groups at http://groups.google.com? > > There's already http://groups.google.com/group/think_erlang that I > started a while ago. > > Google provides web acesss, RSS and email distribution of the posts > which I find extremely convenient. The interface is also the best I > have seen, better than Yahoo Groups. Why not just use trapexit in that case? The forum software they use is one of a number of full-featured packages. It would probably be movable if they decided they did not wish to continue. Robert P.S. Or write one Erlang ... From joelr1@REDACTED Wed Aug 30 22:14:54 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 21:14:54 +0100 Subject: giantfunnel vs. tenerifer Message-ID: <8D5427C7-E91E-4917-A15B-72F642D5FA10@gmail.com> I'm setting out to build a service that's best described as a giant funnel for web bits. Do you think I should go with giantfunnel.com or tenerifer.com? Please let me know what you think! Thanks, Joel From joelr1@REDACTED Wed Aug 30 22:20:07 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 21:20:07 +0100 Subject: The Erlang mailing list In-Reply-To: <44F5F13F.1020505@telia.com> References: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> <44F5F13F.1020505@telia.com> Message-ID: <415E8120-6DF7-47FA-B393-4E496D7587A5@gmail.com> On Aug 30, 2006, at 9:12 PM, Robert Virding wrote: > Why not just use trapexit in that case? The forum software they use > is one of a number of full-featured packages. It would probably be > movable if they decided they did not wish to continue. I don't like forums. I think this is seconded by other people. Gmail is a very good email management interface and I would like to make use of it. I like to be able to email posts and receive email back. Google Groups allows this as well as direct posts and browsing through the web site. -- http://wagerlabs.com/ From yarivvv@REDACTED Wed Aug 30 22:22:27 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 30 Aug 2006 16:22:27 -0400 Subject: Introducing ErlyDB: The Erlang Twist on Database Abstraction In-Reply-To: <95be1d3b0608301235wb6f80b5maef1cf89c871ce5@mail.gmail.com> References: <9CB79C836F98504C81BF082C4291E987792B3E@CHITDSEXC02.tds.corp.cendant.org> <17244f480608301034h6fe7392k4b7c70ecd042dbce@mail.gmail.com> <95be1d3b0608301235wb6f80b5maef1cf89c871ce5@mail.gmail.com> Message-ID: <17244f480608301322x2e7addc9pfecf9c3044ba9977@mail.gmail.com> Thanks for the thoughts. I think these are very valid points. It wouldn't be hard to hack Smerl into just spitting out the BEAM files to a directory. This way, all new app code can be deployed at once. However -- it should possible to use ErlyDB without taking the system offline if all schema changes are non-destructive. You would first update the schema, then call erlydb:code_gen, then load the new application modules. This way, everything should work. I haven't tried it, though :) Best, Yariv > > Hi, > > Just a thought: regenerating the code at run-time when the schema > changes is dangerous. Unless the change is trivial, any client modules > would need to be updated too. > > IMHO it might be better to do the generation at compile time so that > all changes can be caught and corrected before deploying the whole > system at once. > > BTW, a non-trivial schema change can't be handled without taking the > system down anyway, so maybe the above is not helping much :-) The > important observation is that there's much more to think about than > just generating the abstraction layer. > > regards, > Vlad > From bob@REDACTED Wed Aug 30 22:29:12 2006 From: bob@REDACTED (Bob Ippolito) Date: Wed, 30 Aug 2006 13:29:12 -0700 Subject: Erlang does have problems In-Reply-To: <44F5EE6B.3040001@telia.com> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <17244f480608291212w3dd67c26hcedbae7b74a3d53c@mail.gmail.com> <0D8DBC59-D2BE-4CF0-BC0E-A826A9250A89@gmail.com> <6a36e7290608300825r1386ddb3jeff8f2cd6d5bbbb@mail.gmail.com> <44F5EE6B.3040001@telia.com> Message-ID: <6a36e7290608301329r5b64fa63pdabc924ed82570f8@mail.gmail.com> The overhead of lists-as-strings on 64-bit platforms is 8x for latin-1 text for just the 8-bit vs 64-bit data types, which completely ignores the overhead of the list itself and whatever overhead there is to tracking integers (if that's what Erlang does). At some point, all of that storage bloat has to end up being a loss due to all of the memory bandwidth being used up. Inserting and deleting pieces could be fast operations if iodata-of-just-binaries were allowed instead of requiring binaries. All of the slicing and dicing should be memory-friendly since the majority of the time it will be a view on some larger binary in memory... so really it should be faster and more memory efficient in many cases because splitting a binary in half doesn't require copying of the first N/2 elements of the list. -bob On 8/30/06, Robert Virding wrote: > No, while binaries, or a string data type equivalent, are definitely > much more space efficient (a factor 2-8 depending on encoding) they are > probably much slower for processing strings. Especially for pulling them > apart and rebuilding them, and inserting or deleting bits which would > entail much copying. Of course you could make a more complex datatype > which keeps the characters in a linked sequence ... :-) > > Strings as lists also has the benefit that you can more easily work on > 16 or 32 bit unicode characters directly without worrying about > encoding. Then encode them when done. I would keep the statis strings as > binaries and dynamic ones as lists. > > Robert > > Joel Reymont wrote: > > > > On Aug 30, 2006, at 4:25 PM, Bob Ippolito wrote: > > > >> How is it less of a problem with lists? There still isn't any support > >> for text encodings in what ships with Erlang (that I've been able to > >> find, anyway). > > > > > > I (naively?) assumed that it's easier to process text encodings using > > lists than binaries. It should be the same, now that I think about it, > > just using much less space with binaries and maybe even faster. > > > > -- > > http://wagerlabs.com/ > > From vladdu55@REDACTED Wed Aug 30 22:39:03 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 30 Aug 2006 21:39:03 +0100 Subject: Introducing ErlyDB: The Erlang Twist on Database Abstraction In-Reply-To: <17244f480608301322x2e7addc9pfecf9c3044ba9977@mail.gmail.com> References: <9CB79C836F98504C81BF082C4291E987792B3E@CHITDSEXC02.tds.corp.cendant.org> <17244f480608301034h6fe7392k4b7c70ecd042dbce@mail.gmail.com> <95be1d3b0608301235wb6f80b5maef1cf89c871ce5@mail.gmail.com> <17244f480608301322x2e7addc9pfecf9c3044ba9977@mail.gmail.com> Message-ID: <95be1d3b0608301339w7016644cv871820d82ea530cb@mail.gmail.com> On 8/30/06, Yariv Sadan wrote: > Thanks for the thoughts. I think these are very valid points. It > wouldn't be hard to hack Smerl into just spitting out the BEAM files > to a directory. This way, all new app code can be deployed at once. Or better, to call it at compile time. The simple way is to use Ulf Wiger's contribution from trapexit "parse transform to evaluate code at compile time" or something like that. > However -- it should possible to use ErlyDB without taking the system > offline if all schema changes are non-destructive. You would first > update the schema, then call erlydb:code_gen, then load the new > application modules. This way, everything should work. I haven't tried > it, though :) If you have a process using the old definitions that is running when the schema is updated, it might crash. Hopefully it is only a transient process. OTOH, modifying the schema is difficult to do smoothly with any system, so one isn't worse in this case :-) regards, Vlad From joelr1@REDACTED Wed Aug 30 22:44:19 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 21:44:19 +0100 Subject: Erlang does have problems In-Reply-To: <6a36e7290608301329r5b64fa63pdabc924ed82570f8@mail.gmail.com> References: <44F43692.4090901@brainplugins.com> <20060829141354.43332.qmail@web38810.mail.mud.yahoo.com> <17244f480608291212w3dd67c26hcedbae7b74a3d53c@mail.gmail.com> <0D8DBC59-D2BE-4CF0-BC0E-A826A9250A89@gmail.com> <6a36e7290608300825r1386ddb3jeff8f2cd6d5bbbb@mail.gmail.com> <44F5EE6B.3040001@telia.com> <6a36e7290608301329r5b64fa63pdabc924ed82570f8@mail.gmail.com> Message-ID: <745F565B-203D-4176-97A5-3D0587EF6BCB@gmail.com> Bob, Can you please elaborate on the iodata-of-binaries bit and on what you see as wrong right now? On Aug 30, 2006, at 9:29 PM, Bob Ippolito wrote: > Inserting and deleting pieces could be fast operations if > iodata-of-just-binaries were allowed instead of requiring binaries. > All of the slicing and dicing should be memory-friendly since the > majority of the time it will be a view on some larger binary in > memory... -- http://wagerlabs.com/ From klacke@REDACTED Wed Aug 30 22:40:58 2006 From: klacke@REDACTED (Claes Wikstom) Date: Wed, 30 Aug 2006 22:40:58 +0200 Subject: Mailing list message size In-Reply-To: <44F5EF3A.2020407@telia.com> References: <44F5EF3A.2020407@telia.com> Message-ID: <44F5F7DA.1060209@hyber.org> Robert Virding wrote: > Is there any limitation to the size of a message in the mailing list? I > tried to publish the latest Erlog release (much improved) and it quietly > vanished into the bit-bucket. And the code is pretty beautiful as well, > so it wasn't that. :-) > > Robert > Maybe is disappeared due to the funky license you had attached to Erlog ? /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control cellphone: +46 70 2097763 From akopa@REDACTED Wed Aug 30 22:51:42 2006 From: akopa@REDACTED (Matthew D Swank) Date: Wed, 30 Aug 2006 15:51:42 -0500 Subject: The Erlang mailing list In-Reply-To: <78568af10608301109q21816f9dmf0c61bc7bf63a5cc@mail.gmail.com> References: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> <8ed733900608300701n7f366a03yf0c6eea4bf868344@mail.gmail.com> <8ed733900608301043o4a7b42f1vdbea96bf84a571eb@mail.gmail.com> <78568af10608301109q21816f9dmf0c61bc7bf63a5cc@mail.gmail.com> Message-ID: <44F5FA5E.4090500@charter.net> I also prefer mail lists, but would be happy with any solution that could provide (non-broken) mail support. Matt Ryan Rawson wrote: > I also prefer mail lists. That way people can use whatever interface > they want to read the messages with. -- "You do not really understand something unless you can explain it to your grandmother." ? Albert Einstein. From philrand@REDACTED Wed Aug 30 23:04:41 2006 From: philrand@REDACTED (Phil Rand) Date: Wed, 30 Aug 2006 14:04:41 -0700 Subject: giantfunnel vs. tenerifer In-Reply-To: <8D5427C7-E91E-4917-A15B-72F642D5FA10@gmail.com> References: <8D5427C7-E91E-4917-A15B-72F642D5FA10@gmail.com> Message-ID: <5784c1b10608301404y1720e2c5lef6b552f696923ca@mail.gmail.com> I'd go with giantfunnel.com and save tenerifer.com for something more general. On 8/30/06, Joel Reymont wrote: > I'm setting out to build a service that's best described as a giant > funnel for web bits. > > Do you think I should go with giantfunnel.com or tenerifer.com? > > Please let me know what you think! > > Thanks, Joel > > -- Phil Rand philrand@REDACTED From bob@REDACTED Wed Aug 30 23:05:46 2006 From: bob@REDACTED (Bob Ippolito) Date: Wed, 30 Aug 2006 14:05:46 -0700 Subject: Erlang does have problems In-Reply-To: <745F565B-203D-4176-97A5-3D0587EF6BCB@gmail.com> References: <44F43692.4090901@brainplugins.com> <17244f480608291212w3dd67c26hcedbae7b74a3d53c@mail.gmail.com> <0D8DBC59-D2BE-4CF0-BC0E-A826A9250A89@gmail.com> <6a36e7290608300825r1386ddb3jeff8f2cd6d5bbbb@mail.gmail.com> <44F5EE6B.3040001@telia.com> <6a36e7290608301329r5b64fa63pdabc924ed82570f8@mail.gmail.com> <745F565B-203D-4176-97A5-3D0587EF6BCB@gmail.com> Message-ID: <6a36e7290608301405t7d6614b2lfd70b55f8c0a5080@mail.gmail.com> Storing text as lists-of-integers is suboptimal for storage. It doesn't particularly bother me, because I'm simply not working with much text. The text I am working with in my current application is relatively static, so I can treat most of it as lists of UTF8 binaries... but that also means I have to write most of my own functions for operating on it. That's disappointing, but it doesn't bother me much because the strings module doesn't really provide much functionality either so I really am not missing much. iodata-of-binaries just means that such a binary-strings module could/should be able to handle lists-of-binaries in addition to raw binaries.. just like nearly all of the IO functions can deal with iodata. That way you could avoid unnecessary copying because you can use [<<"foo">>, <<"bar">>] to concatenate instead of iolist_to_binary([<<"foo">>, <<"bar">>]). Splitting binaries should already be faster than splitting lists in many cases, because the VM can choose to create views on the larger binary. Concatenation of binaries requires copying, so that's why it may be better to allow iodata instead of just pure strings, since copying can be avoided. I'm also not terribly convinced that lists are better for concatenation, because adding data to the end of a list requires a lot of copying and that's the most common operation in my experience. It really depends on how many operations you're doing and how many intermediate binaries you need to create. The binary copying might take less memory and be faster than all of the copying incurred by lists:reverse or whatever. In any case, what's needed is a prototype and some benchmarks that can be tested for performance on several kinds of machines to see what works well under which circumstances. The current implementation is good enough for me, so I'm not inclined to put in that kinda effort. -bob On 8/30/06, Joel Reymont wrote: > Bob, > > Can you please elaborate on the iodata-of-binaries bit and on what > you see as wrong right now? > > On Aug 30, 2006, at 9:29 PM, Bob Ippolito wrote: > > > Inserting and deleting pieces could be fast operations if > > iodata-of-just-binaries were allowed instead of requiring binaries. > > All of the slicing and dicing should be memory-friendly since the > > majority of the time it will be a view on some larger binary in > > memory... > -- > http://wagerlabs.com/ > > > > > > From bob@REDACTED Wed Aug 30 23:18:08 2006 From: bob@REDACTED (Bob Ippolito) Date: Wed, 30 Aug 2006 14:18:08 -0700 Subject: The Erlang mailing list In-Reply-To: <415E8120-6DF7-47FA-B393-4E496D7587A5@gmail.com> References: <22E2DFE3-D676-4651-AE27-B150F129F545@gmail.com> <44F5F13F.1020505@telia.com> <415E8120-6DF7-47FA-B393-4E496D7587A5@gmail.com> Message-ID: <6a36e7290608301418l91cfa27n6c62ed31192b3efa@mail.gmail.com> On 8/30/06, Joel Reymont wrote: > > On Aug 30, 2006, at 9:12 PM, Robert Virding wrote: > > > Why not just use trapexit in that case? The forum software they use > > is one of a number of full-featured packages. It would probably be > > movable if they decided they did not wish to continue. > > I don't like forums. I think this is seconded by other people. I don't think a forum would be a good place for something like erlang-questions either. Mailing lists and newsgroups (bridged w/ mailing lists) seem like the de facto standard for open source development (at least of this kind). > Gmail is a very good email management interface and I would like to > make use of it. I like to be able to email posts and receive email > back. Google Groups allows this as well as direct posts and browsing > through the web site. I've been pretty happy with Google Groups for other lists as well, both using and administering them. -bob From yarivvv@REDACTED Wed Aug 30 23:32:25 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 30 Aug 2006 17:32:25 -0400 Subject: Introducing ErlyDB: The Erlang Twist on Database Abstraction In-Reply-To: <95be1d3b0608301339w7016644cv871820d82ea530cb@mail.gmail.com> References: <9CB79C836F98504C81BF082C4291E987792B3E@CHITDSEXC02.tds.corp.cendant.org> <17244f480608301034h6fe7392k4b7c70ecd042dbce@mail.gmail.com> <95be1d3b0608301235wb6f80b5maef1cf89c871ce5@mail.gmail.com> <17244f480608301322x2e7addc9pfecf9c3044ba9977@mail.gmail.com> <95be1d3b0608301339w7016644cv871820d82ea530cb@mail.gmail.com> Message-ID: <17244f480608301432t75687b3ap4507fc2a82b64bce@mail.gmail.com> > > Or better, to call it at compile time. The simple way is to use Ulf > Wiger's contribution from trapexit "parse transform to evaluate code > at compile time" or something like that. Interesting. I'll take a look. > > If you have a process using the old definitions that is running when > the schema is updated, it might crash. Hopefully it is only a > transient process. In my app, it will probably be a process holding a connection to a user's browser. I think letting a few users take a temporary hit is better than taking the whole system offline. :) Thanks for the pointers Best, Yariv From valentin@REDACTED Wed Aug 30 23:34:24 2006 From: valentin@REDACTED (Valentin Micic) Date: Wed, 30 Aug 2006 23:34:24 +0200 Subject: Mnesia dB size limits References: <17244f480608301041y55d98712r453d80c2a0fd51a1@mail.gmail.com> Message-ID: <00cd01c6cc7c$175957e0$6401a8c0@moneymaker2> How many times are the same people going to give the same "answers". This is getting absurd. V. ----- Original Message ----- From: "Yariv Sadan" To: "Joel Reymont" Cc: "Philip Robinson" ; ; Sent: Wednesday, August 30, 2006 7:41 PM Subject: Re: Mnesia dB size limits > AFAIK the problems with Mnesia isn't that you can't insert a lot of > data into it, but the following: > > 1) in the event of a crash, a very large dets table takes a long time to > repair. > 2) there are no join optimizations (yet), so some queries can take a > long time to process > 3) as the dets freelist gets fragmented it consumes more and more memory. > > None of these items means you can't put a lot of data in Mnesia -- > they just mean that you may run into problems if you do. > > With ets tables, issues 1) and 3) go away. > > Yariv > > On 8/30/06, Joel Reymont wrote: >> I have a suspicion that when people mention that Mnesia is great with >> huge data sets they unintentionally forget to mention important >> details. My understanding is that call record databases are insert/ >> retrieve only or for the most part. >> >> When people outside of the telco world ask about Mnesia they usually >> have MySQL, etc. in mind and wonder about insert/delete/update >> performance. My understanding at the moment is that Mnesia is not the >> best database for insert/update/delete, much less with huge databases. >> >> Please correct me if I'm wrong! >> >> On Aug 30, 2006, at 4:10 PM, Philip Robinson wrote: >> >> > I was once writing a program that needed to retrieve events >> > within a date/time range from an mnesia table, and found that it >> > did not seem to be hitting the index. It would scan the entire >> > 1-million-plus records every query... dead slow. >> > >> > When I wanted to retrieve a specific event there was no noticable >> > delay, but most of my queries were for a date/time range. >> > >> > I think the mnesia issues being mentioned on this list were to do >> > with database recovery across nodes after a node failure...? >> >> -- >> http://wagerlabs.com/ >> >> >> >> >> >> From ke.han@REDACTED Wed Aug 30 23:43:17 2006 From: ke.han@REDACTED (ke han) Date: Thu, 31 Aug 2006 05:43:17 +0800 Subject: giantfunnel vs. tenerifer In-Reply-To: <8D5427C7-E91E-4917-A15B-72F642D5FA10@gmail.com> References: <8D5427C7-E91E-4917-A15B-72F642D5FA10@gmail.com> Message-ID: On Aug 31, 2006, at 4:14 AM, Joel Reymont wrote: > I'm setting out to build a service that's best described as a giant > funnel for web bits. I'm pretty sure the NSA already has such a service ;-) > > Do you think I should go with giantfunnel.com or tenerifer.com? are those our only choices? ;-) seriously, choose the one most people won't misspell when they try to go to your web site. You wouldn't want them typing tennyrifer.com and getting sucked through someone else's funnel, would you? ke han > > Please let me know what you think! > > Thanks, Joel > From joelr1@REDACTED Wed Aug 30 23:48:06 2006 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 30 Aug 2006 22:48:06 +0100 Subject: giantfunnel vs. tenerifer In-Reply-To: References: <8D5427C7-E91E-4917-A15B-72F642D5FA10@gmail.com> Message-ID: <63E85FB8-154D-408D-B316-48ED2138093F@gmail.com> On Aug 30, 2006, at 10:43 PM, ke han wrote: > On Aug 31, 2006, at 4:14 AM, Joel Reymont wrote: > >> I'm setting out to build a service that's best described as a >> giant funnel for web bits. > > I'm pretty sure the NSA already has such a service ;-) Well, Erlang is gonna create some competition! Also, unlike the NSA I'm also going to spit things out. >> Do you think I should go with giantfunnel.com or tenerifer.com? > > are those our only choices? ;-) Well, yes, unless you can offer some more. > seriously, choose the one most people won't misspell when they try > to go to your web site. You wouldn't want them typing > tennyrifer.com and getting sucked through someone else's funnel, > would you? giantfunnel it is. -- http://wagerlabs.com/ From serge@REDACTED Thu Aug 31 01:32:33 2006 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 30 Aug 2006 19:32:33 -0400 Subject: OTP Application's StartArgs Message-ID: <44F62011.3070709@hq.idt.net> I am sure everyone using the OTP application behavior knows that the second argument to the application's start/2 callback is the StartArgs from the *.app specifications file: Module:start(StartType, StartArgs) -> {ok, Pid} | {ok, Pid, State} | {error, Reason} But is it really? The documentation says that: "StartArgs is the StartArgs argument defined by the application specification key mod." In the process of creating a boot file for our application called myapp we create the application spec file and a release file: ebin/myapp.app priv/myapp.rel then do: $ cd priv $ erlc -pa ../ebin -o ../ebin myapp.rel This builds the ebin/myapp.boot. (Note: traditionally the boot file should go to the "releases/X.Y directory", but it's not important in terms of the content of this email). Now, if I wanted to pass some startup arguments [a, b, c] to myapp:start/2 function would I need to add the following entry to the myapp.app file? {application, myapp, [ ... {mod, {myapp_app, [a, b, c]}} ... ] }. Right? No, that's wrong! The boot file myapp.boot has the application spec embedded, and therefore if we are starting our system using the myapp.boot file, the modified application spec myapp.app will *not* be read. However, if we stop the application, unload it, and start it again, the application spec myapp.app will be read and modified startup arguments will be passed to the myapp:start/2 function. Perhaps this behavior is apparent for some people on the list, but I wanted to share this finding with the community, as it indeed cost me an hour of digging through the OTP sources to figure it out. I suggest that the OTP documentation of release handling and application behavior reflects this artifact. Regards, Serge -- Serge Aleynikov R&D Telecom, MIS, IDT Corp Tel: +1 (973) 438-3436 Fax: +1 (973) 438-1464 From rpettit@REDACTED Thu Aug 31 01:52:30 2006 From: rpettit@REDACTED (Rick Pettit) Date: Wed, 30 Aug 2006 18:52:30 -0500 Subject: The Erlang mailing list In-Reply-To: <4F285F10-D81E-451E-A8F0-4417F7724C3B@gmail.com> References: <5DFE7E1C-8695-4014-A9B9-C2F12AED76F5@redstarling.com> <4F285F10-D81E-451E-A8F0-4417F7724C3B@gmail.com> Message-ID: <20060830235230.GB10019@vailsys.com> On Wed, Aug 30, 2006 at 06:51:07PM +0100, Joel Reymont wrote: > We appear to have ~600 members on this list, this is what I was told > last time I asked. > > Is there a real need to split it? If yes then the discussion should > be first along what lines and second where to host the sub-lists. Traditionally the erlang list has been a low-volume list where intelligent questions are asked and intelligent answers given. It would be a real shame to see the signal-to-noise ration drop drastically with floods of newbie questions pertaining to basic installation, how does OTP work, how do I loop, why shouldn't I program in Ruby, etc. If the community is growing and such is inevitable then I for one propose a newbie list be started, else it might suffice to be firm (yet polite) and simply remind newbies to read the FAQs and other docs (and not ask silly questions without doing their homework first). My 2 cents. -Rick From joelr1@REDACTED Thu Aug 31 02:01:55 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 31 Aug 2006 01:01:55 +0100 Subject: The Erlang mailing list In-Reply-To: <20060830235230.GB10019@vailsys.com> References: <5DFE7E1C-8695-4014-A9B9-C2F12AED76F5@redstarling.com> <4F285F10-D81E-451E-A8F0-4417F7724C3B@gmail.com> <20060830235230.GB10019@vailsys.com> Message-ID: <58997FFA-005F-46A4-BCE4-E82DCED590BA@gmail.com> On Aug 31, 2006, at 12:52 AM, Rick Pettit wrote: > If the community is growing and such is inevitable then I for one > propose a > newbie list be started, else it might suffice to be firm (yet > polite) and > simply remind newbies to read the FAQs and other docs (and not ask > silly > questions without doing their homework first). I second the juniors/seniors split since it has worked well for OCaml. I humbly offer http://groups.google.com/group/think_erlang/ as the newbie list/group/forum. I think the name is appropriate and I made membership open so anyone can join now. We could return to discussing the heavy-duty stuff on Erlang-Questions and discuss Erlang vs. Ruby at Think_Erlang. Thanks, Joel -- http://wagerlabs.com/ From chandrashekhar.mullaparthi@REDACTED Thu Aug 31 02:04:34 2006 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Thu, 31 Aug 2006 01:04:34 +0100 Subject: The Erlang mailing list In-Reply-To: References: Message-ID: On 30/08/06, Joe Armstrong (TN/EAB) wrote: I think it is time to migrate to a forum and make a finer sub-division > of > the lists. > > The best alternative seems to be http://forum.trapexit.org/ I think trapexit.org should be used for putting up tutorials, news etc. and we should leave the erlang mailing list as it is. Forums have never worked for me. Google mail/groups have perfected the art of presenting email and newsgroups - it would be a shame to not use it and be stuck with a phpBB style interface. Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From fbg111@REDACTED Thu Aug 31 00:59:27 2006 From: fbg111@REDACTED (fbg111) Date: Wed, 30 Aug 2006 15:59:27 -0700 (PDT) Subject: Thanks all! Obvious in hindsight, appreciate the pointers! (nt) In-Reply-To: <6056733.post@talk.nabble.com> References: <6056733.post@talk.nabble.com> Message-ID: <6069987.post@talk.nabble.com> -- View this message in context: http://www.nabble.com/Noob---Getting-Started-Infinte-Loop--tf2189189.html#a6069987 Sent from the Erlang Questions forum at Nabble.com. From fbg111@REDACTED Thu Aug 31 00:57:58 2006 From: fbg111@REDACTED (fbg111) Date: Wed, 30 Aug 2006 15:57:58 -0700 (PDT) Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <0C554180-FD58-4069-9430-170213B71689@redstarling.com> References: <6056733.post@talk.nabble.com> <0C554180-FD58-4069-9430-170213B71689@redstarling.com> Message-ID: <6069968.post@talk.nabble.com> ke han wrote: > > 3 - Also, for efficiency sake, you should name the variable "First" > as "_First" to indicate you do not want the value bound. > I was under the impression so far that all variables in Erlang are bound, unless 'bound' means something other than you can't change the value of a variable after assignment? Thanks! -- View this message in context: http://www.nabble.com/Noob---Getting-Started-Infinte-Loop--tf2189189.html#a6069968 Sent from the Erlang Questions forum at Nabble.com. From fbg111@REDACTED Thu Aug 31 00:54:28 2006 From: fbg111@REDACTED (fbg111) Date: Wed, 30 Aug 2006 15:54:28 -0700 (PDT) Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <0C554180-FD58-4069-9430-170213B71689@redstarling.com> References: <6056733.post@talk.nabble.com> <0C554180-FD58-4069-9430-170213B71689@redstarling.com> Message-ID: <6069923.post@talk.nabble.com> ke han wrote: > > I always write code that has good spacing / formatting both for > readability and to ensure I never hit any potential edge/corner cases > of the compile toolchain. > Thanks, I'll use your suggestions, especially if this is what other Erlang coders expect. What are edge/corner cases, though? Situtations where spacing causes the compiler to interpret code differently? -- View this message in context: http://www.nabble.com/Noob---Getting-Started-Infinte-Loop--tf2189189.html#a6069923 Sent from the Erlang Questions forum at Nabble.com. From hokan.stenholm@REDACTED Thu Aug 31 03:03:21 2006 From: hokan.stenholm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Stenholm?=) Date: Thu, 31 Aug 2006 03:03:21 +0200 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <6069968.post@talk.nabble.com> References: <6056733.post@talk.nabble.com> <0C554180-FD58-4069-9430-170213B71689@redstarling.com> <6069968.post@talk.nabble.com> Message-ID: <44F63559.7000806@bredband.net> fbg111 wrote: > >ke han wrote: > >>3 - Also, for efficiency sake, you should name the variable "First" >>as "_First" to indicate you do not want the value bound. >> >> > >I was under the impression so far that all variables in Erlang are bound, >unless 'bound' means something other than you can't change the value of a >variable after assignment? Thanks! > There are actualy two uses of of the _ (underscore). * case 1; as a way to tell pattern matching to match anything (and don't bind anything to the _) e.g. in a function clause: foo(_, V2) -> V2; % ignore the first argument, as it's unused in this function clause foo(...) -> ... * case 2; as a way to tell the compiler that it is ok that the variable name V is unused (you'll otherwise get a "variable V unused in ..." error when using erlc) e.g.: foo(_V) -> ok; % variable V is unused, renamed to _V to inidicate that it's not used in this clause foo(V) -> .... Note that _V is still a valid variablename, so the code below is valid: foo(_V) -> _V * 2. a call to foo(42) would yield 84 in this case. But you should never use _ in variable names in this way (instead remove the _ if the V is to be used). The _ is usually applied to variable names after the compiler complains about unused variable names and we have ensured that the lack of usuage isn't due to some kind of bug - e.g. we forgot to use the variable or accidently instead used another variable in the wrong place. From yarivvv@REDACTED Thu Aug 31 04:00:12 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 30 Aug 2006 22:00:12 -0400 Subject: ErlyDB now has many-to-many relations support Message-ID: <17244f480608301900r1c9cb6cah137801519d8c56ee@mail.gmail.com> Hi, I added features to make dealing with many-to-many relations with ErlyDB a breeze. I also made many-to-one SELECT queries more powerful. Here's the announcement with a tutorial http://yarivsblog.com/articles/2006/08/30/many-to-many-relations-are-now-at-an-erlydb-near-you Enjoy! Best, Yariv From fritchie@REDACTED Thu Aug 31 04:14:17 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Wed, 30 Aug 2006 21:14:17 -0500 Subject: Mnesia dB size limits In-Reply-To: Message of "Thu, 31 Aug 2006 01:10:50 +1000." Message-ID: <200608310214.k7V2EHX6055597@snookles.snookles.com> >>>>> "pr" == Philip Robinson writes: pr> Damir asks: >> What are the upper limits where system can still be called >> "production quality" in terms of dB speed? In a few months, a project I've been working on will go "live" with approx 6GB total of data in about a half-dozen 'disc_copies' tables, using both replication and fragmentation (though only on 2 machines, but they have 16GB RAM each :-). pr> When I wanted to retrieve a specific event there was no noticable pr> delay, but most of my queries were for a date/time range. It all depends on how the index(s) is defined and whether you were using foldl/3 or index_match_object/3 or match_object/1 or scary-but-works-quite-well-at-what-it-does select/2. pr> I think the mnesia issues being mentioned on this list were to do pr> with database recovery across nodes after a node failure...? Step 0: Decide when to start the dead node. Step 1: Start the dead node. Step 2: There is no step 2. Overall throughput can take a hit when starting a dead node, because all out-of-date tables will be copied as-is from a live node. So doing Step 1 during your 1% or 5% peak usage time isn't a good idea. Dealing with network partitions is trickier. But if you're clustering, then you've probably also got some kind of infrastructure build for dealing with logging messages, events (of whatever sort, including 'mnesia_down' events from Mnesia itself), alarms, etc ... and all that makes it tricky enough to wuss out with an answer like, "It depends." -Scott From fbg111@REDACTED Thu Aug 31 05:01:06 2006 From: fbg111@REDACTED (fbg111) Date: Wed, 30 Aug 2006 20:01:06 -0700 (PDT) Subject: Erlang on Solaris x86 In-Reply-To: <5F959F21-39E0-4243-AD0E-83DD3A8BF001@gmail.com> References: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> <375AC5C7-2566-4803-A1CC-62F59ECF861B@redstarling.com> <5F959F21-39E0-4243-AD0E-83DD3A8BF001@gmail.com> Message-ID: <6072292.post@talk.nabble.com> Joel Reymont wrote: > > I'm not sure I understand the difference between a container and a VM. > I was wondering the same thing recently and found this article with a http://news.com.com/Linux+heavies+plan+lightweight+virtualization/2100-7339_3-6108272.html?tag=nefd.lede basic explanation . Here's the http://textdrive.com/hosting/container TextDrive page . -- View this message in context: http://www.nabble.com/Erlang-on-Solaris-x86-tf2187264.html#a6072292 Sent from the Erlang Questions forum at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fritchie@REDACTED Thu Aug 31 05:01:39 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Wed, 30 Aug 2006 22:01:39 -0500 Subject: Erlang does have problems In-Reply-To: Message of "Wed, 30 Aug 2006 14:05:46 PDT." <6a36e7290608301405t7d6614b2lfd70b55f8c0a5080@mail.gmail.com> Message-ID: <200608310301.k7V31dEw061433@snookles.snookles.com> >>>>> "bi" == Bob Ippolito writes: bi> I'm also not terribly convinced that lists are better for bi> concatenation, because adding data to the end of a list requires a bi> lot of copying and that's the most common operation in my bi> experience. Oh? At last check, "X = [A, B]" executed in O(1) time regardless of the sizes of A & B. As far as I/O lists are concerned, [<<"fo">>, [[], $o], [[[<<"ba">>]], <<"r">>]] yields the same effect as <<"foobar">>. If whatever library you're working can only tolerate "flat" lists(*), then you're limited to O(length(A)) concatenation (lists:append/2, A ++ B, etc). Richard O'Keefe's contributions to the "Strings (was: Re: are Mnesia tables immutable?)" thread on this mailing list(**) are quite informative and, IMO, should be mandatory reading for "strings" people. -Scott (*) 1> lists:flatten([<<"fo">>, [[], $o], [[[<<"ba">>]], <<"r">>]]). [<<"fo">>, 111, <<"ba">>, <<"r">>] (**) That thread took place (roughly) between 27 June and 06 July, 2006. From fbg111@REDACTED Thu Aug 31 05:03:26 2006 From: fbg111@REDACTED (fbg111) Date: Wed, 30 Aug 2006 20:03:26 -0700 (PDT) Subject: Erlang on Solaris x86 In-Reply-To: References: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> <375AC5C7-2566-4803-A1CC-62F59ECF861B@redstarling.com> Message-ID: <6072315.post@talk.nabble.com> Chris Double wrote: > > I run multiple OS's on one dedicated server using this setup including > Minix and Ubuntu Linux and it runs quite nicely. > A bit offtopic, but is it possible to compile and run Erlang on Minix? That would be an interesting platform. -- View this message in context: http://www.nabble.com/Erlang-on-Solaris-x86-tf2187264.html#a6072315 Sent from the Erlang Questions forum at Nabble.com. From ok@REDACTED Thu Aug 31 05:07:59 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 31 Aug 2006 15:07:59 +1200 (NZST) Subject: Noob - Getting Started Infinte Loop? Message-ID: <200608310307.k7V37xLB310168@atlas.otago.ac.nz> ke han wrote: > 3 - Also, for efficiency sake, you should name the variable "First" > as "_First" to indicate you do not want the value bound. In "Murder in the Cathedral" T.S.Eliot had Thomas a Becket say (from memory): "The last temptation is the greatest treason, to do the right thing for the wrong reason." Because anonymous variables are spelled "_", and everyone (compiler and human reader alike) knows that you don't care what value is bound to an anonymous variable, Prolog and Erlang have adopted a convention that if there is a variable which you have written down because you have to have *some* variable there, but you intend it to occur only once (you don't care what value gets bound to it), then you spell that variable with a leading underscore too. This is a hint to HUMAN BEINGS. The Erlang compiler does not need it. It is NOT an efficiency issue. The compiler can work out quite easily for itself that the variable is never used again. It's all about making it clear to HUMAN readers that you are doing this ON PURPOSE. I would expect listlen([First|Rest]) -> 1 + listlen(Rest) % 1 and listlen(_First|Rest]) -> 1 + listlen(Rest) % 2 and listlen([_|Rest]) -> 1 + listlen(Rest) % 3 and listlen([Betty_Crocker|Sony_RCA_Magnavox_TEAC]) -> % 4 1 + listlen(Sony_RCA_Magnavox_TEAC) to all result in exactly the same code. The only difference between them is that % 2 is more helpful to human beings: _First says "this variable will hold the first element of a list, but it's never used again, and I know and intend that it should never be used again". fbg111 asked: I was under the impression so far that all variables in Erlang are bound, unless 'bound' means something other than you can't change the value of a variable after assignment? Actually, that ISN'T what "bound means". Bound means "has a value". And putting an underscore in front of a variable does NOT mean that it will not get a value bound to it. As far as the meaning of the language goes, any time you successfully match a pattern against a term, new variables in the pattern end up bound. What's at issue is not whether the variable becomes bound or not, but whether the binding is *live* (might be of use in the future). If a variable has only a single occurrence, then the pattern matching code the compiler need not include anything to save the corresponding value anywhere. But it's just a fully automatic optimisation that you should not be concerned with. If you want to worry about efficiency, go on to the next lesson in the tutorial, where it should tell you to do list_length(List) -> list_length_loop(List, 0). list_length_loop([_|Rest], N) -> list_length_loop(Rest, N+1); list_length_loop([], N) -> N. which is just a "while" loop in disguise. From fbg111@REDACTED Thu Aug 31 05:16:08 2006 From: fbg111@REDACTED (fbg111) Date: Wed, 30 Aug 2006 20:16:08 -0700 (PDT) Subject: Dynamic languages are the future In-Reply-To: <46EBF46D-0372-4975-87BB-3684141FE26B@redstarling.com> References: <44F3AC58.9040306@duomark.com> <44F3D20B.7020104@duomark.com> <44F524DB.10405@mail.ru> <44F54982.8030406@it.uu.se> <44F564C4.10407@ericsson.com> <46EBF46D-0372-4975-87BB-3684141FE26B@redstarling.com> Message-ID: <6072416.post@talk.nabble.com> ke han wrote: > > But, I am absolutely amazed at how many "20-something" programmers > I've interviewed in the last two years that gave me a blank stare > when you ask them if the've tried Prolog or Lisp. That is, they > haven't just not tried it, they've never heard of it. To add further > insult to this statement, these candidates all had master's degrees > in CS from China's most prestigious schools... oops ;-) > Same problem http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html in America . More http://paulgraham.com/popular.html good writings on that topic at Paul Graham's site. -- View this message in context: http://www.nabble.com/Dynamic-languages-are-the-future-tf2181293.html#a6072416 Sent from the Erlang Questions forum at Nabble.com. From bob@REDACTED Thu Aug 31 05:44:36 2006 From: bob@REDACTED (Bob Ippolito) Date: Wed, 30 Aug 2006 20:44:36 -0700 Subject: Erlang does have problems In-Reply-To: <200608310301.k7V31dEw061433@snookles.snookles.com> References: <6a36e7290608301405t7d6614b2lfd70b55f8c0a5080@mail.gmail.com> <200608310301.k7V31dEw061433@snookles.snookles.com> Message-ID: <6a36e7290608302044n5cae1b2evdac47eef3239db9b@mail.gmail.com> On 8/30/06, Scott Lystig Fritchie wrote: > >>>>> "bi" == Bob Ippolito writes: > > bi> I'm also not terribly convinced that lists are better for > bi> concatenation, because adding data to the end of a list requires a > bi> lot of copying and that's the most common operation in my > bi> experience. > > Oh? At last check, "X = [A, B]" executed in O(1) time regardless of > the sizes of A & B. As far as I/O lists are concerned, > [<<"fo">>, [[], $o], [[[<<"ba">>]], <<"r">>]] yields the same effect as > <<"foobar">>. > > If whatever library you're working can only tolerate "flat" lists(*), > then you're limited to O(length(A)) concatenation (lists:append/2, A > ++ B, etc). I was referring to the stdlib string library (and the idea of "string()" in general, as far as Erlang documentation goes), which refers to exactly "flat" lists of integers. Sure, it's possible to write a string library that can work with iolists, and that'd be great, but Erlang doesn't ship with one as far as I can tell. 1> string:tokens("foo|bar|baz", "|"). ["foo","bar","baz"] 2> string:tokens(["foo", ["|bar|", "baz"]], "|"). [["foo",["|bar|","baz"]]] -bob From chris.double@REDACTED Thu Aug 31 05:46:47 2006 From: chris.double@REDACTED (Chris Double) Date: Thu, 31 Aug 2006 15:46:47 +1200 Subject: Erlang on Solaris x86 In-Reply-To: <6072315.post@talk.nabble.com> References: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> <375AC5C7-2566-4803-A1CC-62F59ECF861B@redstarling.com> <6072315.post@talk.nabble.com> Message-ID: On 8/31/06, fbg111 wrote: > > A bit offtopic, but is it possible to compile and run Erlang on Minix? That > would be an interesting platform. I had a brief attempt at it and got most of it to compile but never completed it. Quite a bit of work has gone on recently in Minix for cross platform compilation support so it may be a bit easier now. I'll have another go at it and see how it goes. Chris. -- http://www.bluishcoder.co.nz From fbg111@REDACTED Thu Aug 31 06:02:03 2006 From: fbg111@REDACTED (fbg111) Date: Wed, 30 Aug 2006 21:02:03 -0700 (PDT) Subject: giantfunnel vs. tenerifer In-Reply-To: <63E85FB8-154D-408D-B316-48ED2138093F@gmail.com> References: <8D5427C7-E91E-4917-A15B-72F642D5FA10@gmail.com> <63E85FB8-154D-408D-B316-48ED2138093F@gmail.com> Message-ID: <6072762.post@talk.nabble.com> Joel Reymont wrote: > > giantfunnel it is. > Web2.0-ify it: funnl.net/com ; funnl.icio.us ; bigfunnl.com/net :) -- View this message in context: http://www.nabble.com/giantfunnel-vs.-tenerifer-tf2192592.html#a6072762 Sent from the Erlang Questions forum at Nabble.com. From ok@REDACTED Thu Aug 31 06:11:27 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 31 Aug 2006 16:11:27 +1200 (NZST) Subject: Dynamic languages are the future Message-ID: <200608310411.k7V4BR4s310524@atlas.otago.ac.nz> fbg111 wrote: Same problem http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html in America. More http://paulgraham.com/popular.html good writings on that topic at Paul Graham's site. It must be synchronicity. We've had a thread about strings that looks like reviving. I'm in the middle of writing some Java classes for a 4th year student to use. And now here's mention of Java. The 4th year student is supposed to be investigating a topic in information retrieval; I wanted to see if multicore systems could do IR faster, and Andrew Trotman came up with the key concept for how to structure an index so that this might actually work. The student was given a tiny (< 500 line) IR engine in C that reads an XML document collection and builds an index (~ 300 lines) and that reads an index and queries (~ 300 lines; the two programs share some code). It's small, dead simple, and reasonably fast. It can index the test collection in under 3 minutes. The student basically got nowhere modifying it because despite having had C in 3rd year, she only really knows Java. Her Java rewrite of my C code (without the XML stuff; the document collection had to be reformatted) takes eight hours. Eight hours! That's 160 times slower than C! Just for grins, I rewrote the index builder in AWK. 44 lines of AWK. (It works on the same reformatted document collection as the student's code, uses built in hash tables, and writes numbers in ASCII, not binary.) Her Java program was more than 50 times slower than AWK. Profiling to the rescue: "java -Xprof BuildIndex wsj.data". It turned out that practically all the time was going in RandomAccessFile. Guess what: RandomAccessFile doesn't do any buffering, so each f.writeInt(x) turned into 4 calls to f.write((byte)(x >> ...)), and each of *those* is a call to a native method, involving a switch from Java to C and back. Just adding a few lines of code to buffer stuff into a byte array and flushing that every so often (just like using fwrite() in C would...) speeded the program up by a factor of 10. The mawk version is still sniggering at the Java version, but not as loudly. Of course this says nothing about Java AS A LANGUAGE. It's a library issue. But in real Java, practically _everything_ is a library issue. There's another student doing a GA+IR project whose program was speeded up by a large factor by another lecturer. Same thing: run the program with -Xprof, spot that the time is going in a library class (ArrayList, as it happens), rewrite to use plain arrays, time goes way down. One of the things that makes Erlang a practical language for real applications is the tools for working with Erlang, like 'eprof' and 'cover'. From jay@REDACTED Thu Aug 31 07:03:41 2006 From: jay@REDACTED (Jay Nelson) Date: Wed, 30 Aug 2006 22:03:41 -0700 Subject: Parallel parsing Message-ID: <44F66DAD.10203@duomark.com> Richard O'Keefe wrote: > I wanted to see if multicore systems could do IR faster Talk about synchronicity... I've never been too enamoured with the modern method of using grammar notation and yacc / lex etc. to do something like, say, parse XML or a programming language. It works for multiple languages easily, but it seemed so heavy handed and ugly to me. My big bone was that it is very, very serial. And no real way to undo that. I have been playing with the old pattern-based, weak methods of parsing because I think they can be made highly parallel and would benefit from SMP. I can see plenty of ways to parallelize a lookup against the index of words or parse tree or whatever, but not so many in generating the index. Anybody else having ideas in this area they are willing to share? jay From rlenglet@REDACTED Thu Aug 31 07:27:09 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Thu, 31 Aug 2006 14:27:09 +0900 Subject: giantfunnel vs. tenerifer In-Reply-To: <6072762.post@talk.nabble.com> References: <8D5427C7-E91E-4917-A15B-72F642D5FA10@gmail.com> <63E85FB8-154D-408D-B316-48ED2138093F@gmail.com> <6072762.post@talk.nabble.com> Message-ID: <200608311427.09553.rlenglet@users.forge.objectweb.org> fbg111 wrote: > Joel Reymont wrote: > > giantfunnel it is. > > Web2.0-ify it: funnl.net/com ; funnl.icio.us ; > bigfunnl.com/net Don't forget to mention that it is "BETA". Write it in big in the logo, too. If it's not BETA, it's no good these days. -- Romain LENGLET From ke.han@REDACTED Thu Aug 31 08:03:07 2006 From: ke.han@REDACTED (ke han) Date: Thu, 31 Aug 2006 14:03:07 +0800 Subject: Dynamic languages are the future In-Reply-To: <200608310411.k7V4BR4s310524@atlas.otago.ac.nz> References: <200608310411.k7V4BR4s310524@atlas.otago.ac.nz> Message-ID: <91485B30-0BEE-4295-9AE8-4FC2BB489B91@redstarling.com> From 1998 to 2002 my company built an aggressive app framework in Java and a vertical app to leverage it. We ended up with about 500,000 lines of code. Over half of this was replacing what should have been good enough in the core Java libraries. By the time we were done, we rewrote just about every core Java class as the JDK equivalent was poorly designed/implemented. We had to rewrite serialization, make thread safe collections and thread safe just about everything, rolled our own non-blocking io which after Sun came out with nio, we found ours was still much more time and space efficient....We ended up with something that showed Java as a language can be very efficient and scalable...but the libraries...not so much ;-) ke han On Aug 31, 2006, at 12:11 PM, Richard A. O'Keefe wrote: > fbg111 wrote: > Same problem > http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html > in America. More > http://paulgraham.com/popular.html > good writings on that topic at Paul Graham's site. > > It must be synchronicity. > We've had a thread about strings that looks like reviving. > I'm in the middle of writing some Java classes for a 4th year > student to use. > And now here's mention of Java. > > The 4th year student is supposed to be investigating a topic in > information > retrieval; I wanted to see if multicore systems could do IR faster, > and > Andrew Trotman came up with the key concept for how to structure an > index > so that this might actually work. > > The student was given a tiny (< 500 line) IR engine in C that reads > an XML > document collection and builds an index (~ 300 lines) and that reads > an index and queries (~ 300 lines; the two programs share some code). > It's small, dead simple, and reasonably fast. It can index the test > collection in under 3 minutes. The student basically got nowhere > modifying > it because despite having had C in 3rd year, she only really knows > Java. > Her Java rewrite of my C code (without the XML stuff; the document > collection had to be reformatted) takes eight hours. > > Eight hours! That's 160 times slower than C! > > Just for grins, I rewrote the index builder in AWK. 44 lines of AWK. > (It works on the same reformatted document collection as the student's > code, uses built in hash tables, and writes numbers in ASCII, not > binary.) > Her Java program was more than 50 times slower than AWK. > > Profiling to the rescue: "java -Xprof BuildIndex wsj.data". > It turned out that practically all the time was going in > RandomAccessFile. > Guess what: RandomAccessFile doesn't do any buffering, so each > > f.writeInt(x) > > turned into 4 calls to f.write((byte)(x >> ...)), and each of *those* > is a call to a native method, involving a switch from Java to C and > back. > > Just adding a few lines of code to buffer stuff into a byte array and > flushing that every so often (just like using fwrite() in C would...) > speeded the program up by a factor of 10. > > The mawk version is still sniggering at the Java version, but not > as loudly. > > Of course this says nothing about Java AS A LANGUAGE. > It's a library issue. But in real Java, practically _everything_ is > a library issue. There's another student doing a GA+IR project whose > program was speeded up by a large factor by another lecturer. Same > thing: run the program with -Xprof, spot that the time is going in a > library class (ArrayList, as it happens), rewrite to use plain arrays, > time goes way down. > > One of the things that makes Erlang a practical language for real > applications > is the tools for working with Erlang, like 'eprof' and 'cover'. > From fbg111@REDACTED Thu Aug 31 08:04:23 2006 From: fbg111@REDACTED (fbg111) Date: Wed, 30 Aug 2006 23:04:23 -0700 (PDT) Subject: giantfunnel vs. tenerifer In-Reply-To: <200608311427.09553.rlenglet@users.forge.objectweb.org> References: <8D5427C7-E91E-4917-A15B-72F642D5FA10@gmail.com> <63E85FB8-154D-408D-B316-48ED2138093F@gmail.com> <6072762.post@talk.nabble.com> <200608311427.09553.rlenglet@users.forge.objectweb.org> Message-ID: <6073578.post@talk.nabble.com> Romain Lenglet wrote: > > Don't forget to mention that it is "BETA". Write it in big in the > logo, too. If it's not BETA, it's no good these days. > Heh, http://msig.info/web2.php this may help with that... -- View this message in context: http://www.nabble.com/giantfunnel-vs.-tenerifer-tf2192592.html#a6073578 Sent from the Erlang Questions forum at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvg@REDACTED Thu Aug 31 08:16:55 2006 From: rvg@REDACTED (Rudolph van Graan) Date: Thu, 31 Aug 2006 08:16:55 +0200 Subject: ErlyDB now has many-to-many relations support In-Reply-To: <17244f480608301900r1c9cb6cah137801519d8c56ee@mail.gmail.com> References: <17244f480608301900r1c9cb6cah137801519d8c56ee@mail.gmail.com> Message-ID: <2B1BD11E-FECB-450C-85A8-81B2F1994B3E@patternmatched.com> Hey Yariv, I think you are certainly onto something here... A couple of comments below. Looking over the code for project, developer etc the one thing that bugs me is that I cannot see which fields/methods the files contain. So it is cool being able to generate the methods on the fly, but it makes very little sense not being able to guarantee what methods will be in the module between regeneration attempts. I am tempted to say that you will have to build in some mechanism with which to explicitly define methods. Maybe generate a .hrl file or a .erl that is a stub calling the dynamic code. Look at the orber mechanism for translating IDL files in erlang - that creates explicit function definitions. So looking at this: -module(project). -compile(export_all). relations() -> [{many_to_one, [language]}, {many_to_many, [developer]}]. I cannot see the table name it maps to (assuming it is the same as the module name?), nor that it is actually a dynamically generated module (think -behaviour(....) ) or maybe use a couple of attribute flags in the code. Also, I cannot see from the relations() which fields link to which in the tables - it is not necessarily true that the fields have the same name in both tables or do you reverse engineer the relations on the database level to establish these links? Rgds, Rudolph van Graan Pattern Matched Technologies Web: www.patternmatched.com On 31 Aug 2006, at 4:00 AM, Yariv Sadan wrote: > Hi, > > I added features to make dealing with many-to-many relations with > ErlyDB a breeze. > > I also made many-to-one SELECT queries more powerful. > > Here's the announcement with a tutorial > > http://yarivsblog.com/articles/2006/08/30/many-to-many-relations- > are-now-at-an-erlydb-near-you > > Enjoy! > > Best, > Yariv > From dmitriid@REDACTED Thu Aug 31 08:29:16 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Thu, 31 Aug 2006 09:29:16 +0300 Subject: The Erlang mailing list In-Reply-To: References: Message-ID: Trapexit should continue to web-interface mailing list archives though, I think. Quite often there is a need to see a previous discussion or a solution posted to a problem way back. The mailing list should remain a mailing list, I think (anyway, few real newbies know what a mailing list is, anyway). However, I like the idea of setting a group just for newbies (like think-erlang, or a sub-forum on trapexit, maybe). Becaues the questions like packaging and distributing Erlang applications, beginner questions about OTP, [rocesses, pattern matching, list comprehension etc. etc. will inevitably appear again and again as the community (hopefully) continues to grow. I like the idea of hosting a separate newbie forum thread on trapexit, because it will be easy for a person to move from a newbie forum to a grown-up forum after mastering the beginnings of Erlang. On 8/31/06, Chandru wrote: > > On 30/08/06, Joe Armstrong (TN/EAB) wrote: > > > I think it is time to migrate to a forum and make a finer sub-division > > of > > the lists. > > > > The best alternative seems to be http://forum.trapexit.org/ > > > I think trapexit.org should be used for putting up tutorials, news etc. > and we should leave the erlang mailing list as it is. Forums have never > worked for me. Google mail/groups have perfected the art of presenting email > and newsgroups - it would be a shame to not use it and be stuck with a phpBB > style interface. > > Chandru > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvg@REDACTED Thu Aug 31 08:33:33 2006 From: rvg@REDACTED (Rudolph van Graan) Date: Thu, 31 Aug 2006 08:33:33 +0200 Subject: Mnesia dB size limits In-Reply-To: <00cd01c6cc7c$175957e0$6401a8c0@moneymaker2> References: <17244f480608301041y55d98712r453d80c2a0fd51a1@mail.gmail.com> <00cd01c6cc7c$175957e0$6401a8c0@moneymaker2> Message-ID: Hi Valentin & Damir, Maybe the problem is that it is not actually clear what the answers are. Even reading each one of the questions and all the answers over the last four years I still don't know the exact answer myself. I can confirm that large tables (disc_copies) in a node that crashed can take a *very* long time to rebuild even if there are no DETS issues, especially if there are additional index fields on the field. (Mnesia creates a new ETS table for each index and needs to get the data into them). Ulf and I have fixed this in RDBMS by adding indexes that are now first class tables in mnesia. So be careful with indexes. (BTW if you get an MS SQL Server with a lot of data into "recovery" it will also take a very long time to recover - sometimes hours at a time) I've seen Mnesia crash a couple of times with funnies like this: (Usually on 1Gb or larger tables) =ERROR REPORT==== 29-Dec-2005::16:12:01 === Mnesia(tutuka@REDACTED): ** ERROR ** (core dumped to file: "d:/sys/ MnesiaCore.zuma@REDACTED") ** FATAL ** {error,{"Cannot open dets table", isopacketlog, [{file,"d:/sys/db/packetstorage.DAT"}, {keypos,2}, {repair,true}, {type,set}], {bad_freelists,"d:/sys/db/packetstorage.DAT"}}} We also have made it a "rule" in our design team never to use Mnesia for archiving data (i.e. as a warehouse) for the reason that by default mnesia keeps all the data in a table in *RAM* unless you use disc_only_copies and there is thus an upper limit to the size of the table. To solve this, we usually feed archive data (i.e. event records, logs etc) into an SQL database via some mechanism. It does become interesting where you need the data "online" all the time, i.e. requiring random access read/write to records. This problem you solve by partitioning via whatever mechanism you choose. Mnesia is brilliant for this type of system as reads have virtually no cost. In the old days (other languages) I used to be very careful in doing any SQL access, but I've learned that you can disregard that concern with Mnesia altogether. Valentin - maybe you can share some of your experience with large Mnesia databases with us? What are the things we need to be careful of? Br, Rudolph Pattern Matched Technologies www.patternmatched.com On 30 Aug 2006, at 11:34 PM, Valentin Micic wrote: > How many times are the same people going to give the same > "answers". This is getting absurd. > > V. > > ----- Original Message ----- From: "Yariv Sadan" > To: "Joel Reymont" > Cc: "Philip Robinson" ; ; > > Sent: Wednesday, August 30, 2006 7:41 PM > Subject: Re: Mnesia dB size limits > > >> AFAIK the problems with Mnesia isn't that you can't insert a lot of >> data into it, but the following: >> >> 1) in the event of a crash, a very large dets table takes a long >> time to repair. >> 2) there are no join optimizations (yet), so some queries can take a >> long time to process >> 3) as the dets freelist gets fragmented it consumes more and more >> memory. >> >> None of these items means you can't put a lot of data in Mnesia -- >> they just mean that you may run into problems if you do. >> >> With ets tables, issues 1) and 3) go away. >> >> Yariv >> >> On 8/30/06, Joel Reymont wrote: >>> I have a suspicion that when people mention that Mnesia is great >>> with >>> huge data sets they unintentionally forget to mention important >>> details. My understanding is that call record databases are insert/ >>> retrieve only or for the most part. >>> >>> When people outside of the telco world ask about Mnesia they usually >>> have MySQL, etc. in mind and wonder about insert/delete/update >>> performance. My understanding at the moment is that Mnesia is not >>> the >>> best database for insert/update/delete, much less with huge >>> databases. >>> >>> Please correct me if I'm wrong! >>> >>> On Aug 30, 2006, at 4:10 PM, Philip Robinson wrote: >>> >>> > I was once writing a program that needed to retrieve events >>> > within a date/time range from an mnesia table, and found that it >>> > did not seem to be hitting the index. It would scan the entire >>> > 1-million-plus records every query... dead slow. >>> > >>> > When I wanted to retrieve a specific event there was no noticable >>> > delay, but most of my queries were for a date/time range. >>> > >>> > I think the mnesia issues being mentioned on this list were to do >>> > with database recovery across nodes after a node failure...? >>> >>> -- >>> http://wagerlabs.com/ >>> >>> >>> >>> >>> > > From dmitriid@REDACTED Thu Aug 31 08:37:40 2006 From: dmitriid@REDACTED (Dmitrii Dimandt) Date: Thu, 31 Aug 2006 09:37:40 +0300 Subject: Erlang does have problems In-Reply-To: <200608310301.k7V31dEw061433@snookles.snookles.com> References: <6a36e7290608301405t7d6614b2lfd70b55f8c0a5080@mail.gmail.com> <200608310301.k7V31dEw061433@snookles.snookles.com> Message-ID: > > > Richard O'Keefe's contributions to the "Strings (was: Re: are Mnesia > tables immutable?)" thread on this mailing list(**) are quite > informative and, IMO, should be mandatory reading for "strings" > people. This is the thread: http://article.gmane.org/gmane.comp.lang.erlang.general/16021 It outlines nicely many the problems with strings and encodings. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikpe@REDACTED Thu Aug 31 08:48:35 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 31 Aug 2006 08:48:35 +0200 Subject: Erlang/OTP R11B-1 has been released In-Reply-To: <319581F2-0A87-49F9-A8CA-31C11AFDA6A9@gmail.com> References: <17653.42376.606501.470993@alkaid.it.uu.se> <319581F2-0A87-49F9-A8CA-31C11AFDA6A9@gmail.com> Message-ID: <17654.34371.785953.86450@alkaid.it.uu.se> Joel Reymont writes: > Mikael, > > On Aug 30, 2006, at 3:49 PM, Mikael Pettersson wrote: > > > Intel Mac users may be interested in knowing that R11B-1 > > includes support for FP exceptions and HiPE on Darwin/x86-32. > > Those updates came very late so they missed being described > > in the readme. > > Is this just FP exceptions or HiPE also? As implied by "and HiPE" above, HiPE support is included. From erlq@REDACTED Thu Aug 31 08:49:26 2006 From: erlq@REDACTED (Rob) Date: Wed, 30 Aug 2006 23:49:26 -0700 Subject: giantfunnel vs. tenerifer In-Reply-To: <6073578.post@talk.nabble.com> References: <8D5427C7-E91E-4917-A15B-72F642D5FA10@gmail.com> <63E85FB8-154D-408D-B316-48ED2138093F@gmail.com> <6072762.post@talk.nabble.com> <200608311427.09553.rlenglet@users.forge.objectweb.org> <6073578.post@talk.nabble.com> Message-ID: <44F68676.1080700@itsbeen.sent.com> fbg111 wrote: > Romain Lenglet wrote: > Don't forget to mention that it is "BETA". Write it in big in the > logo, too. If it's not BETA, it's no good these days. > > Heh, this may help with that... A whole toolset is beginning to form: http://mfrtz.blogspot.com/2006/08/web20-start-up-kit.html From mikpe@REDACTED Thu Aug 31 08:56:58 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 31 Aug 2006 08:56:58 +0200 Subject: Finally: Mac Intel patches In-Reply-To: References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <20060823065514.GB4165@memphis> Message-ID: <17654.34874.469273.130261@alkaid.it.uu.se> Jay McCarthy writes: > The R11B-1 release does not contain the mach_override files, nor > instructions on how to get them. > > Jay > > On 8/25/06, Mikael Pettersson wrote: > > The final set of Darwin/x86 patches have been committed to > > the HiPE/OTP source repository, and they are likely to be > > included in the upcoming R11B-1 release. > > On 8/23/06, Joel Reymont wrote: > > I conveniently forgot to mention a key thing. You need to grab > > mach_override.{c,h} from http://extendamac.sourceforge.net/ and drop > > these into erts/emulator/hipe/. These are needed to patch up the > > running erlang binary, nothing will work otherwise. Big deal, you have the link :-) Seriously, I haven't had time to review their licensing conditions, and ideally, mach_override _should_ be installed as a standard library and simply be part of the these-libraries-are-preconditions checks. From ke.han@REDACTED Wed Aug 30 14:36:15 2006 From: ke.han@REDACTED (ke han) Date: Wed, 30 Aug 2006 20:36:15 +0800 Subject: Erlang on Solaris x86 In-Reply-To: <5F959F21-39E0-4243-AD0E-83DD3A8BF001@gmail.com> References: <03B8C790-1251-47E6-84C3-EF6232F1DC3E@gmail.com> <375AC5C7-2566-4803-A1CC-62F59ECF861B@redstarling.com> <5F959F21-39E0-4243-AD0E-83DD3A8BF001@gmail.com> Message-ID: <8E870F3F-FC1A-43D8-AB2C-AA87B14CAD2A@redstarling.com> On Aug 30, 2006, at 6:23 PM, Joel Reymont wrote: > > On Aug 30, 2006, at 11:12 AM, ke han wrote: > >> Others have posted their testing results with the Niagra chip and >> erlang R11. The results I've seen so far look _very_ good. > > I must have missed the posts. Where are they? Joe Armstrong's post: http://www.erlang.org/ml-archive/erlang-questions/200606/msg00187.html I'm pretty sure one or two others had posted some results but I can't find them right now... > >> The very nice thing about what TextDrive is offering for their >> Opteron Solaris Containers is that you get the entire fault- >> tolerant infrastructure with it. Your renting a container, not a >> virtual machine on a particular server. > > I'm not sure I understand the difference between a container and a > VM. What is the fault-tolerant infrastructure and how do you get it > at TextDrive? A VM is a complete guest OS running on top of another host OS (either a general purpose host or a special purpose one just for hosting guest VMs). A Container/Zone (which is a Solaris-only animal) shares the same OS for all containers/zones on the same physical server.. Solaris has lots of built in tricks to partition or contain the resources inside your zone. Its my understanding that TextDrive is selling a container and guarantees that your container is always up. So if the physical server goes down, your container runs on another server (your data is on a shared SAN in their model). These kinds of tricks can be done with virtualization systems such as Xen or VMware. The trade off is in standardizing on the strength of managing one OS (Solaris) for everything vs. being OS agnostic and letting each VM be any OS. For a "full service" hosting provider, it makes sense to be a master of one OS than to supply only a rented resource for a customer to choose their own VM. Less OS choice, but possibly much better managed and refined solution...which is where the better profit margins are. ke han > > > -- > http://wagerlabs.com/ > > > > > From rlenglet@REDACTED Thu Aug 31 09:09:14 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Thu, 31 Aug 2006 16:09:14 +0900 Subject: The Erlang mailing list In-Reply-To: References: Message-ID: <200608311609.14971.rlenglet@users.forge.objectweb.org> Dmitrii Dimandt wrote: > Trapexit should continue to web-interface mailing list > archives though, I think. Quite often there is a need to see a > previous discussion or a solution posted to a problem way > back. > > The mailing list should remain a mailing list, I think > (anyway, few real newbies know what a mailing list is, > anyway). [...] I second this. However, the mailing list currently has a huge problem of delay. Apparently, looking at the message headers, every message to the mailing list takes 30 minutes to go through Ericsson's network. Am I the only one to experience this problem? Couldn't the mailing list(s?) be hosted elsewhere, e.g. on Trapexit? -- Romain Lenglet From erlang@REDACTED Thu Aug 31 09:11:43 2006 From: erlang@REDACTED (erlang) Date: Thu, 31 Aug 2006 00:11:43 -0700 Subject: net_adm:ping not working Message-ID: <48065077ecf74db486f13cb0c63562dc@cyberplasm.com> I can't get the ping-pong distributed example to work, so I tried simply pinging another node. This doesn't work either. os: windows server 2003, machine name is my-server. EShell v5.5.1 command lines: erl -sname a erl -sname b (b@REDACTED)1> net_adm:ping('a:my-server'). always returns pang. The cookie file is being read, and the cookie is the same in both nodes. What to try next? From lennart.ohman@REDACTED Thu Aug 31 09:20:06 2006 From: lennart.ohman@REDACTED (Lennart Ohman) Date: Thu, 31 Aug 2006 09:20:06 +0200 Subject: net_adm:ping not working In-Reply-To: <48065077ecf74db486f13cb0c63562dc@cyberplasm.com> Message-ID: <000601c6cccd$e2b43260$0200a8c0@st.se> Hi, is the colon ":" just a typo in your email? It should be "@" as you can see from the node name in the Erlang shell prompt. Best Regards Lennart > (b@REDACTED)1> net_adm:ping('a:my-server'). ------------------------------------------------------------- Lennart Ohman office : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 67 35 Sehlstedtsgatan 6 fax : +46-8-667 82 30 SE-115 28, STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > -----Original Message----- > From: owner-erlang-questions@REDACTED [mailto:owner-erlang- > questions@REDACTED] On Behalf Of erlang > Sent: Thursday, August 31, 2006 9:12 AM > To: erlang-questions@REDACTED > Subject: net_adm:ping not working > > I can't get the ping-pong distributed example to work, so I tried simply > pinging another node. This doesn't work either. > > os: windows server 2003, machine name is my-server. > EShell v5.5.1 > > command lines: erl -sname a > erl -sname b > > (b@REDACTED)1> net_adm:ping('a:my-server'). > > always returns pang. The cookie file is being read, and the cookie is > the same in both nodes. What to try next? > > > > > > From lukas@REDACTED Wed Aug 30 17:02:42 2006 From: lukas@REDACTED (garazdawi) Date: Wed, 30 Aug 2006 16:02:42 +0100 Subject: The Erlang mailing list References: Message-ID: <20060830150242.828925A416@mail.erlangsystems.com> > I agree with Joe's intent... > I think the biggest two requirement to fullfil which I don't see on > trapexit are: > 1 - RSS feeds (including for non-registered users; lurkers) > 2 - forum content must get indexed by google et al.. > > without these two features its hard to migrate from maillists. > > ke han You can already access the trapexit forum through rss, more information about that is available here: http://forum.trapexit.org/viewtopic.php?t=5859 Trapexit has been submitted to the google crawler for indexing, so it will hopefully be indexed within the next couple of weeks. Lukas Larsson Admin at Trapexit.org _________________________________________________________ Post sent from http://www.trapexit.org From lukas@REDACTED Wed Aug 30 17:13:06 2006 From: lukas@REDACTED (garazdawi) Date: Wed, 30 Aug 2006 16:13:06 +0100 Subject: The Erlang mailing list References: Message-ID: <20060830151306.47B5C5A4EB@mail.erlangsystems.com> > I agree with Joe's intent... > I think the biggest two requirement to fullfil which I don't see on > trapexit are: > 1 - RSS feeds (including for non-registered users; lurkers) > 2 - forum content must get indexed by google et al.. > > without these two features its hard to migrate from maillists. > > ke han You can already access the trapexit forum through rss, more information about that is available here: http://forum.trapexit.org/viewtopic.php?t=5859 Trapexit has been submitted to the google crawler for indexing, so it will hopefully be indexed within the next couple of weeks. Lukas Larsson Admin at Trapexit.org -- There are 10 kinds of people, those who speak binary and those who don't. _________________________________________________________ Post sent from http://www.trapexit.org From fbg111@REDACTED Thu Aug 31 00:54:28 2006 From: fbg111@REDACTED (fbg111) Date: Wed, 30 Aug 2006 15:54:28 -0700 (PDT) Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <0C554180-FD58-4069-9430-170213B71689@redstarling.com> References: <6056733.post@talk.nabble.com> <0C554180-FD58-4069-9430-170213B71689@redstarling.com> Message-ID: <6069923.post@talk.nabble.com> ke han wrote: > > I always write code that has good spacing / formatting both for > readability and to ensure I never hit any potential edge/corner cases > of the compile toolchain. > Thanks, I'll use your suggestions, especially if this is what other Erlang coders expect. What are edge/corner cases, though? Situtations where spacing causes the compiler to interpret code differently? -- View this message in context: http://www.nabble.com/Noob---Getting-Started-Infinte-Loop--tf2189189.html#a6069923 Sent from the Erlang Questions forum at Nabble.com. From fbg111@REDACTED Thu Aug 31 00:57:58 2006 From: fbg111@REDACTED (fbg111) Date: Wed, 30 Aug 2006 15:57:58 -0700 (PDT) Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <0C554180-FD58-4069-9430-170213B71689@redstarling.com> References: <6056733.post@talk.nabble.com> <0C554180-FD58-4069-9430-170213B71689@redstarling.com> Message-ID: <6069968.post@talk.nabble.com> ke han wrote: > > 3 - Also, for efficiency sake, you should name the variable "First" > as "_First" to indicate you do not want the value bound. > I was under the impression so far that all variables in Erlang are bound, unless 'bound' means something other than you can't change the value of a variable after assignment? Thanks! -- View this message in context: http://www.nabble.com/Noob---Getting-Started-Infinte-Loop--tf2189189.html#a6069968 Sent from the Erlang Questions forum at Nabble.com. From rvg@REDACTED Thu Aug 31 09:30:39 2006 From: rvg@REDACTED (Rudolph van Graan) Date: Thu, 31 Aug 2006 09:30:39 +0200 Subject: Database Layer Message-ID: <8D4D3A59-3149-4A94-ACDB-A5C79003E2AE@patternmatched.com> Hi Guys, Just a quick mail to poll the interest in us releasing as open source a new native Data Access Layer that at present has two types of connections it supports: 1 - A high performance Postgres native implementation with complete transaction support and connection pooling 2 - An Erlang/JDBC bridge allowing you to access any database for which you have a JDBC driver Both connection types have the same erlang api allowing you to switch databases with minimum overhead. Our intention is to try and get the entire framework into OTP at some stage thereby unifying the interface to different databases and introducing a standard mechanism for data representation and transactions. Please mail me directly. Rudolph van Graan Pattern Matched Technologies www.patternmatched.com From pedro.gomes@REDACTED Thu Aug 31 09:27:49 2006 From: pedro.gomes@REDACTED (Gomes, Pedro) Date: Thu, 31 Aug 2006 08:27:49 +0100 Subject: Question about debug info Message-ID: <82A8DA06D22E154E82F14B9C5F62A2E04BD61D@PTLISI051MSX.PT001.SIEMENS.NET> Hello All, I tryed to use the Erlang debugger and in order to do it I need to compile the source modules with debug info and for that matter I used -compile(debug_info) This seems to have no effect, even if the .beam module increases its size, because the debugger still continues to issue an error saying there no debug information present in the .beam module. What am I doing wrong ? Thanks, Pedro -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Thu Aug 31 09:32:16 2006 From: erlang@REDACTED (erlang) Date: Thu, 31 Aug 2006 00:32:16 -0700 Subject: net_adm:ping not working Message-ID: Sorry, this is indeed a typo in my email. Should be: (b@REDACTED)1> net_adm:ping('a@REDACTED'). > > Hi, is the colon ":" just a typo in your email? It should be > "@" as you can see from the node name in the Erlang shell prompt. > > Best Regards > Lennart > > > (b@REDACTED)1> net_adm:ping('a:my-server'). > > > ------------------------------------------------------------- > Lennart Ohman office : +46-8-587 623 27 > Sjoland & Thyselius Telecom AB cellular: +46-70-552 67 35 > Sehlstedtsgatan 6 fax : +46-8-667 82 30 > SE-115 28, STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > > -----Original Message----- > > From: owner-erlang-questions@REDACTED [mailto:owner-erlang- > > questions@REDACTED] On Behalf Of erlang > > Sent: Thursday, August 31, 2006 9:12 AM > > To: erlang-questions@REDACTED > > Subject: net_adm:ping not working > > > > I can't get the ping-pong distributed example to work, so I tried simply > > pinging another node. This doesn't work either. > > > > os: windows server 2003, machine name is my-server. > > EShell v5.5.1 > > > > command lines: erl -sname a > > erl -sname b > > > > (b@REDACTED)1> net_adm:ping('a:my-server'). > > > > always returns pang. The cookie file is being read, and the cookie is > > the same in both nodes. What to try next? > > > > > > > > > > > > From chsu79@REDACTED Thu Aug 31 09:40:02 2006 From: chsu79@REDACTED (Christian S) Date: Thu, 31 Aug 2006 09:40:02 +0200 Subject: The Erlang mailing list In-Reply-To: References: Message-ID: How about a new mailinglist for advocacy, it was a popular subcategory on usenet. A group for talking about blogs, community building, additional mailinglist and 5 second erlang submissions? From raimo+erlang-questions@REDACTED Thu Aug 31 09:41:20 2006 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 31 Aug 2006 09:41:20 +0200 Subject: Mailing list message size In-Reply-To: <44F5EF3A.2020407@telia.com> References: <44F5EF3A.2020407@telia.com> Message-ID: <20060831074120.GA11608@erix.ericsson.se> The size limit is currently 40000 bytes for headers, body and all. If I happen to spot an interesting message in my incoming spam flood, I usually approve them anyway, but this one slipped through... On Wed, Aug 30, 2006 at 10:04:10PM +0200, Robert Virding wrote: > Is there any limitation to the size of a message in the mailing list? I > tried to publish the latest Erlog release (much improved) and it quietly > vanished into the bit-bucket. And the code is pretty beautiful as well, > so it wasn't that. :-) > > Robert -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From per@REDACTED Thu Aug 31 09:52:33 2006 From: per@REDACTED (Per Hedeland) Date: Thu, 31 Aug 2006 09:52:33 +0200 (CEST) Subject: Error reported when using pmap In-Reply-To: Message-ID: <200608310752.k7V7qX8l005793@pluto.hedeland.org> Arbow wrote: > > I am new in Erlang, and try the pmap at >http://www.erlang.org/ml-archive/erlang-questions/200606/msg00187.html: [snip] >In file testmain.erl: >-module(testmain). >-export([test3/0]). > >test3() -> > MyList = [1,2,3,4,5,6,7,8,9,10], > lists:map(fun(I) -> I*2 end, MyList). > >when I execute " testmain:test3(). ", I get errors: > >=ERROR REPORT==== 30-Aug-2006::16:21:51 === >Error in process <0.36.0> on node 'Erlide_2960df@REDACTED' with exit value: >{undef,[{testmain,test3,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > >** exited: {undef,[{testmain,test3,[]}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > >Anyone could help me? Thanks. As others have shown, there is nothing with the code that would explain the error - did you actually compile it? How? FYI, 'undef' means that the system couldn't find the definition of the testmain:test3/0 function - this can have a couple of reasons: - The 'testmain' module wasn't found, neither already loaded nor in a location in the file system where the system would look for modules to load. - The 'testmain' module *was* found, but it didn't have a (exported) definition of test3/0. The latter could possibly apply in your case if an older version of 'testmain' was already loaded, and you compiled the current one in a way that didn't also load it - hence the questions above. --Per Hedeland From chsu79@REDACTED Thu Aug 31 09:54:24 2006 From: chsu79@REDACTED (Christian S) Date: Thu, 31 Aug 2006 09:54:24 +0200 Subject: Erlang downsides? In-Reply-To: References: <44F1BB02.3080101@gmail.com> Message-ID: > > * Regular expression matching (there's a module, but watch Perl beat > > it by a factor of 100). > > What language doesn't perl beat at regex? As far as I know perl's regexps are fast because C was used to implement them. If we would see an implementation of perl in perl I doubt its regexps would spank. From joelr1@REDACTED Thu Aug 31 10:19:43 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 31 Aug 2006 09:19:43 +0100 Subject: Database Layer In-Reply-To: <8D4D3A59-3149-4A94-ACDB-A5C79003E2AE@patternmatched.com> References: <8D4D3A59-3149-4A94-ACDB-A5C79003E2AE@patternmatched.com> Message-ID: <5E72FF47-A97F-4C5B-B254-BE45F7A3AA80@gmail.com> On Aug 31, 2006, at 8:30 AM, Rudolph van Graan wrote: > 1 - A high performance Postgres native implementation with complete > transaction support and connection pooling How is this different from pgsql in jungerl? Thanks, Joel -- http://wagerlabs.com/ From lennart.ohman@REDACTED Thu Aug 31 10:24:32 2006 From: lennart.ohman@REDACTED (Lennart Ohman) Date: Thu, 31 Aug 2006 10:24:32 +0200 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <6069968.post@talk.nabble.com> Message-ID: <000a01c6ccd6$e315c440$0200a8c0@st.se> Hi, the _ (only an underscore) is never bound from efficiency reasons. For instance: f(foo,bar) -> ...; f(frotz,X) -> ...; f(_,X) -> .... could be used to indicate in the third clause that Erlang should not spend time on binding the first argument to a variable since it will not be used. Actually, if you replace the third head with f(DontCare,X) -> you will get a compiler warning. The compiler suspects that you misspelled that variable name, and it should be one you actually use in the body. Then you have the possibility of placing an _ in front of a variable name. Like _dontCare. That will actually make the variable bound and possible to use (however good Erlang practise says you shouldn't). The underscore removes the compiler warnings in this case. Best Regards Lennart ------------------------------------------------------------- Lennart Ohman office : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 67 35 Sehlstedtsgatan 6 fax : +46-8-667 82 30 SE-115 28, STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > -----Original Message----- > From: owner-erlang-questions@REDACTED [mailto:owner-erlang- > questions@REDACTED] On Behalf Of fbg111 > Sent: Thursday, August 31, 2006 12:58 AM > To: erlang-questions@REDACTED > Subject: Re: Noob - Getting Started Infinte Loop? > > > > ke han wrote: > > > > 3 - Also, for efficiency sake, you should name the variable "First" > > as "_First" to indicate you do not want the value bound. > > > > I was under the impression so far that all variables in Erlang are bound, > unless 'bound' means something other than you can't change the value of a > variable after assignment? Thanks! > -- > View this message in context: http://www.nabble.com/Noob---Getting- > Started-Infinte-Loop--tf2189189.html#a6069968 > Sent from the Erlang Questions forum at Nabble.com. From joelr1@REDACTED Thu Aug 31 10:37:56 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 31 Aug 2006 09:37:56 +0100 Subject: The Erlang mailing list In-Reply-To: References: Message-ID: Think Erlang! On Aug 31, 2006, at 8:40 AM, Christian S wrote: > How about a new mailinglist for advocacy, it was a popular subcategory > on usenet. A group for talking about blogs, community building, > additional mailinglist and 5 second erlang submissions? -- http://wagerlabs.com/ From ke.han@REDACTED Thu Aug 31 10:50:05 2006 From: ke.han@REDACTED (ke han) Date: Thu, 31 Aug 2006 16:50:05 +0800 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <6069923.post@talk.nabble.com> References: <6056733.post@talk.nabble.com> <0C554180-FD58-4069-9430-170213B71689@redstarling.com> <6069923.post@talk.nabble.com> Message-ID: <5B0832B3-EB1B-4764-A4F1-65BA20C5A4DE@redstarling.com> On Aug 31, 2006, at 6:54 AM, fbg111 wrote: > > > ke han wrote: >> >> I always write code that has good spacing / formatting both for >> readability and to ensure I never hit any potential edge/corner cases >> of the compile toolchain. >> > > Thanks, I'll use your suggestions, especially if this is what other > Erlang > coders expect. What are edge/corner cases, though? Situtations where > spacing causes the compiler to interpret code differently? I don't know what cases might be interpreted different than the programmer intended. I have a long standing practice in all programming languages to write highly readable code..I therefore never hit on errors related to code style. My guess is that erlang's parse tools are much more refined than many other implementations in other languages. So don't let me scare you by thinking there are some issues to worry about. But not putting spaces on either side of a | or a ! is very hard for a guy like me to read regardless of what erlang thinks ;-). ke han > -- > View this message in context: http://www.nabble.com/Noob---Getting- > Started-Infinte-Loop--tf2189189.html#a6069923 > Sent from the Erlang Questions forum at Nabble.com. From chsu79@REDACTED Thu Aug 31 10:57:33 2006 From: chsu79@REDACTED (Christian S) Date: Thu, 31 Aug 2006 10:57:33 +0200 Subject: Database Layer In-Reply-To: <5E72FF47-A97F-4C5B-B254-BE45F7A3AA80@gmail.com> References: <8D4D3A59-3149-4A94-ACDB-A5C79003E2AE@patternmatched.com> <5E72FF47-A97F-4C5B-B254-BE45F7A3AA80@gmail.com> Message-ID: On 8/31/06, Joel Reymont wrote: > > On Aug 31, 2006, at 8:30 AM, Rudolph van Graan wrote: > > > 1 - A high performance Postgres native implementation with complete > > transaction support and connection pooling > > How is this different from pgsql in jungerl? It has no connection pooling, although I think connection pooling is a bad idea. It is better to pool multiple instances of the server application instead of the underlying connection it uses, since a connection session has state (prepared statements and temporary tables) associated to it. Those are things a gen_server could create at Mod:init/1 and use for the lifetime of the connection. The support for transactions isnt encapsulated in a similar nice way as mnesia:transaction/1. Manual calls to BEGIN and END. Also pgsql doesnt use any OTP behaviours, that area could be improved for supervision and error logging. A jdbc backend is an idea ive had too, but i think it should be hidden behind a portable front end which can have more efficiently implmemented native or port/cnode backends. From ft@REDACTED Thu Aug 31 10:57:34 2006 From: ft@REDACTED (Fredrik Thulin) Date: Thu, 31 Aug 2006 10:57:34 +0200 Subject: underscore prefixed variables (was: Re: Noob - Getting Started Infinte Loop?) In-Reply-To: <44F63559.7000806@bredband.net> References: <6056733.post@talk.nabble.com> <6069968.post@talk.nabble.com> <44F63559.7000806@bredband.net> Message-ID: <200608311057.34934.ft@it.su.se> On Thursday 31 August 2006 03:03, H?kan Stenholm wrote: ... > Note that _V is still a valid variablename, so the code below is > valid: > > foo(_V) -> > _V * 2. > > a call to foo(42) would yield 84 in this case. As H?kan points out, _V * 2 is valid. I think this is bad. In combination with assign-once, it introduces bugs like in this example : case lists:keysearch(primary, 1, MyList) of {value, {primary, _Socket}} -> %% do something because our "primary" socket exists, although we %% don't really care about the socket iself ... false -> case lists:keysearch(secondary, 1, MyList) of {value, {secondary, _Socket}} -> %% do something because our "secondary" socket exists, %% although we don't really care about the socket itself I think that a) variables prefixed with "_" should really not be variables that get set - like the special case _. b) the compiler should issue a warning that you are actually using a variable prefixed with "_". Would others care to share their view on this? /Fredrik From mats.cronqvist@REDACTED Thu Aug 31 10:59:58 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Thu, 31 Aug 2006 10:59:58 +0200 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <5B0832B3-EB1B-4764-A4F1-65BA20C5A4DE@redstarling.com> References: <6056733.post@talk.nabble.com> <0C554180-FD58-4069-9430-170213B71689@redstarling.com> <6069923.post@talk.nabble.com> <5B0832B3-EB1B-4764-A4F1-65BA20C5A4DE@redstarling.com> Message-ID: <44F6A50E.4020403@ericsson.com> ke han wrote: > > On Aug 31, 2006, at 6:54 AM, fbg111 wrote: > >> >> >> ke han wrote: >>> >>> I always write code that has good spacing / formatting both for >>> readability and to ensure I never hit any potential edge/corner cases >>> of the compile toolchain. >>> >> >> Thanks, I'll use your suggestions, especially if this is what other >> Erlang >> coders expect. What are edge/corner cases, though? Situtations where >> spacing causes the compiler to interpret code differently? here's an example. 24> A=<<"a">>. ** 1: syntax error before: '<' ** 24> A = <<"a">>. <<97>> 25> A=<<<"a">>. true mats From bjorn@REDACTED Thu Aug 31 11:19:17 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 31 Aug 2006 11:19:17 +0200 Subject: underscore prefixed variables (was: Re: Noob - Getting Started Infinte Loop?) In-Reply-To: <200608311057.34934.ft@it.su.se> References: <6056733.post@talk.nabble.com> <6069968.post@talk.nabble.com> <44F63559.7000806@bredband.net> <200608311057.34934.ft@it.su.se> Message-ID: It is sometimes useful to refer to variables with underscores in debug code. In the example below, the io:format/2 call can be simply uncommented when needed: foo(V) -> .... foo(_V) -> %% io:format("~p\n", [_V]), error. /Bjorn Fredrik Thulin writes: > On Thursday 31 August 2006 03:03, H?kan Stenholm wrote: > ... > > Note that _V is still a valid variablename, so the code below is > > valid: > > > > foo(_V) -> > > _V * 2. > > > > a call to foo(42) would yield 84 in this case. > > As H?kan points out, _V * 2 is valid. I think this is bad. In > combination with assign-once, it introduces bugs like in this example : > > case lists:keysearch(primary, 1, MyList) of > {value, {primary, _Socket}} -> > %% do something because our "primary" socket exists, although we > %% don't really care about the socket iself > ... > false -> > case lists:keysearch(secondary, 1, MyList) of > {value, {secondary, _Socket}} -> > %% do something because our "secondary" socket exists, > %% although we don't really care about the socket itself > > I think that > > a) variables prefixed with "_" should really not be variables that get > set - like the special case _. > b) the compiler should issue a warning that you are actually using a > variable prefixed with "_". > > Would others care to share their view on this? > > /Fredrik > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bengt.kleberg@REDACTED Thu Aug 31 11:25:45 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 31 Aug 2006 11:25:45 +0200 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <5B0832B3-EB1B-4764-A4F1-65BA20C5A4DE@redstarling.com> References: <6056733.post@talk.nabble.com> <0C554180-FD58-4069-9430-170213B71689@redstarling.com> <6069923.post@talk.nabble.com> <5B0832B3-EB1B-4764-A4F1-65BA20C5A4DE@redstarling.com> Message-ID: <44F6AB19.7030304@ericsson.com> On 2006-08-31 10:50, ke han wrote: ...deleted > about. But not putting spaces on either side of a | or a ! is very hard > for a guy like me to read regardless of what erlang thinks ;-). if you want to avoid ''hard to read'' you should avoid NamesThatLookLikeThis. Names_that_look_like_this are easier to read(*) bengt (*) yes, it is possible to learn how to read the former. one can become almost as good on this as the latter. but why use something that requires both time and effort and still only manages to achive almost as good? -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From raimo+erlang-questions@REDACTED Thu Aug 31 11:46:58 2006 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 31 Aug 2006 11:46:58 +0200 Subject: The Erlang mailing list In-Reply-To: References: Message-ID: <20060831094658.GA16038@erix.ericsson.se> I am currently migrating the mailing list from Majordomo to Mailman, and in Mailman there is a possibility to associate 'Topics' to a mailing list. Individual subscribers can then select to subscribe to their relevant topics, and whether or not to subscribe to non-topic posts. A topic can for example be specified by a line: Topic: mnesia at the top of the post. Would this improve the situation? -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From mats.cronqvist@REDACTED Thu Aug 31 11:49:48 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Thu, 31 Aug 2006 11:49:48 +0200 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <44F6AB19.7030304@ericsson.com> References: <6056733.post@talk.nabble.com> <0C554180-FD58-4069-9430-170213B71689@redstarling.com> <6069923.post@talk.nabble.com> <5B0832B3-EB1B-4764-A4F1-65BA20C5A4DE@redstarling.com> <44F6AB19.7030304@ericsson.com> Message-ID: <44F6B0BC.6040709@ericsson.com> Bengt Kleberg wrote: > On 2006-08-31 10:50, ke han wrote: > ...deleted >> about. But not putting spaces on either side of a | or a ! is very >> hard for a guy like me to read regardless of what erlang thinks ;-). > > if you want to avoid ''hard to read'' you should avoid > NamesThatLookLikeThis. Names_that_look_like_this are easier to read is this a scientific fact or your personal opinion? mats From winrothpatrik@REDACTED Thu Aug 31 12:24:13 2006 From: winrothpatrik@REDACTED (Patrik Winroth) Date: Thu, 31 Aug 2006 12:24:13 +0200 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <44F6AB19.7030304@ericsson.com> Message-ID: >From: Bengt Kleberg >To: erlang-questions@REDACTED >Subject: Re: Noob - Getting Started Infinte Loop? >Date: Thu, 31 Aug 2006 11:25:45 +0200 > >On 2006-08-31 10:50, ke han wrote: >...deleted >>about. But not putting spaces on either side of a | or a ! is very hard >>for a guy like me to read regardless of what erlang thinks ;-). > >if you want to avoid ''hard to read'' you should avoid >NamesThatLookLikeThis. Names_that_look_like_this are easier to read(*) Another reason for the latter is if you have a constant THAT_LOOK_LIKE_THIS it is far easier to read then one THATLOOKLIKETHIS. /cheers Patrik. From ft@REDACTED Thu Aug 31 12:22:41 2006 From: ft@REDACTED (Fredrik Thulin) Date: Thu, 31 Aug 2006 12:22:41 +0200 Subject: underscore prefixed variables (was: Re: Noob - Getting Started Infinte Loop?) In-Reply-To: References: <6056733.post@talk.nabble.com> <200608311057.34934.ft@it.su.se> Message-ID: <200608311222.41267.ft@it.su.se> On Thursday 31 August 2006 11:19, Bjorn Gustavsson wrote: > It is sometimes useful to refer to variables with underscores > in debug code. In the example below, the io:format/2 call can > be simply uncommented when needed: > > foo(V) -> > .... > foo(_V) -> > %% io:format("~p\n", [_V]), > error. And if a compiler warning was issued when you had uncommented the debug printout, you wouldn't forget to comment it out again when you were finished debugging ;) /Fredrik From simonpeterchappell@REDACTED Thu Aug 31 12:35:57 2006 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Thu, 31 Aug 2006 05:35:57 -0500 Subject: The Erlang mailing list In-Reply-To: References: Message-ID: <8ed733900608310335m6f08d5e0r19d0d15ff2ca0d52@mail.gmail.com> I'm voting with my feet and have joined Joel's Google Group. I plan to start asking my junior level questions there, so that I can start "thinking in Erlang". Come on in, the water's fine. Simon On 8/31/06, Joel Reymont wrote: > Think Erlang! > > On Aug 31, 2006, at 8:40 AM, Christian S wrote: > > > How about a new mailinglist for advocacy, it was a popular subcategory > > on usenet. A group for talking about blogs, community building, > > additional mailinglist and 5 second erlang submissions? > > -- > http://wagerlabs.com/ > > > > > > -- www.simonpeter.org From valentin@REDACTED Thu Aug 31 12:37:14 2006 From: valentin@REDACTED (Valentin Micic) Date: Thu, 31 Aug 2006 12:37:14 +0200 Subject: Mnesia dB size limits References: <17244f480608301041y55d98712r453d80c2a0fd51a1@mail.gmail.com> <00cd01c6cc7c$175957e0$6401a8c0@moneymaker2> Message-ID: <003501c6cce9$6e7d27a0$6401a8c0@moneymaker2> > > Valentin - maybe you can share some of your experience with large Mnesia > databases with us? What are the things we need to be careful of? > The point I've been trying to make is that one should encourage usage, and thus level of commitment to mnesia. By amplifying differences and/or problems this is not going to happen. Urban legned has it: there was a French mathematician that prove that it is impossible to fly an object heavier than air. Thanks goodness that some people never got around to read his thesis. Nobody remembers the mathematician anymore. I had a number of reasons for not sharing my experiences, primarely because I do not consider one-fits-it-all approach is the way to go. I strongly beleive that Erlang and Mnesia are at their best when viewed in a context of a given problem. However, since you've asked, I would like to share few things: 1) Do your own replication. We've created a database journalling system that is appropriate for our data model, and it serves dual role -- replication, and roll-forward functions. IMHO, it would be great if we can take this approach further. 2) Always create specialized API to access your data -- it will help you repacle mnesia if you have to do that in a future. 3) Always use mnesia:activity, instead of "higher level" functions. It might be a bit "low-level" initially, but will pay a significant dividend in a near-future. 4) With a risk of going to extreeme, always had table fragmentation in mind, unless you're talking small databases, say up to 150000 records. If the database gets bigger, you would be better off with fragmentation. 5) Fragmentation also helps with recovery -- under extreme conditions it is much easier to find extra 204MB on disk, and do it ten times over, than 2GB all at once. 6) If in doubt -- try it out first, and ask questions later. Help others help you. Erlang is extremely friendly to prototyping. And BTW: There was a bug in dets, picked up & fixed by Hans Bolinder (THANX HANS!!!). It is my understanding that R11B-1 shall include this bug-fix. There. V. From rvg@REDACTED Thu Aug 31 12:57:42 2006 From: rvg@REDACTED (Rudolph van Graan) Date: Thu, 31 Aug 2006 12:57:42 +0200 Subject: Mnesia dB size limits In-Reply-To: <003501c6cce9$6e7d27a0$6401a8c0@moneymaker2> References: <17244f480608301041y55d98712r453d80c2a0fd51a1@mail.gmail.com> <00cd01c6cc7c$175957e0$6401a8c0@moneymaker2> <003501c6cce9$6e7d27a0$6401a8c0@moneymaker2> Message-ID: Hi Valentin, > And BTW: There was a bug in dets, picked up & fixed by Hans > Bolinder (THANX HANS!!!). It is my understanding that R11B-1 shall > include this bug-fix. > Does this refer to the error I posted with the free list? R From joelr1@REDACTED Thu Aug 31 13:18:12 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 31 Aug 2006 12:18:12 +0100 Subject: The Erlang mailing list In-Reply-To: <8ed733900608310335m6f08d5e0r19d0d15ff2ca0d52@mail.gmail.com> References: <8ed733900608310335m6f08d5e0r19d0d15ff2ca0d52@mail.gmail.com> Message-ID: <325FBC33-2EDF-4C65-915D-0916D839A4B0@gmail.com> And about 15 other people have done the same. On Aug 31, 2006, at 11:35 AM, Simon Chappell wrote: > I'm voting with my feet and have joined Joel's Google Group. I plan to > start asking my junior level questions there, so that I can start > "thinking in Erlang". Come on in, the water's fine. -- http://wagerlabs.com/ From valentin@REDACTED Thu Aug 31 13:36:45 2006 From: valentin@REDACTED (Valentin Micic) Date: Thu, 31 Aug 2006 13:36:45 +0200 Subject: Mnesia dB size limits References: <17244f480608301041y55d98712r453d80c2a0fd51a1@mail.gmail.com> <00cd01c6cc7c$175957e0$6401a8c0@moneymaker2> <003501c6cce9$6e7d27a0$6401a8c0@moneymaker2> Message-ID: <004c01c6ccf1$bdda68f0$6401a8c0@moneymaker2> If I gave an undue credit or miss to give ti to someone I appologise. Let me rephrase the statement. There was a bug in dets and it has been fixed by Hans Bolinder (THANX HANS!!!!!!!!) ----- Original Message ----- From: "Rudolph van Graan" To: "Valentin Micic" Cc: "Erlang-Questions Mailing List" Sent: Thursday, August 31, 2006 12:57 PM Subject: Re: Mnesia dB size limits > Hi Valentin, > >> And BTW: There was a bug in dets, picked up & fixed by Hans Bolinder >> (THANX HANS!!!). It is my understanding that R11B-1 shall include this >> bug-fix. >> > > Does this refer to the error I posted with the free list? > > R > > From mazen@REDACTED Thu Aug 31 13:41:42 2006 From: mazen@REDACTED (Mazen) Date: Thu, 31 Aug 2006 12:41:42 +0100 Subject: The Erlang mailing list References: Message-ID: <20060831114142.6C4045A204@mail.erlangsystems.com> FYI There already are forums on Trapexit that can be used so all sort of questions. If there is a real need for a "Newbie" Forum I could have a chat with my colleagues and we could probably set one up. Imho it would be sad to see the community split using different channels for different things when we have something that connects them all already. Trapexit also reads in from the mailing lists (all of them) so you get a (to some people anyway) better overview. Would a Newbie section @ trapexit be something useful? /Mazen _________________________________________________________ Post sent from http://www.trapexit.org From bengt.kleberg@REDACTED Thu Aug 31 13:51:10 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 31 Aug 2006 13:51:10 +0200 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <44F6B0BC.6040709@ericsson.com> References: <6056733.post@talk.nabble.com> <0C554180-FD58-4069-9430-170213B71689@redstarling.com> <6069923.post@talk.nabble.com> <5B0832B3-EB1B-4764-A4F1-65BA20C5A4DE@redstarling.com> <44F6AB19.7030304@ericsson.com> <44F6B0BC.6040709@ericsson.com> Message-ID: <44F6CD2E.3080301@ericsson.com> On 2006-08-31 11:49, Mats Cronqvist wrote: > Bengt Kleberg wrote: ...deleted >> if you want to avoid ''hard to read'' you should avoid >> NamesThatLookLikeThis. Names_that_look_like_this are easier to read > > is this a scientific fact or your personal opinion? Somerthing in between. It is more than my personal opinion since 100% of the people i have asked say that NamesThatLookLikeThis are harder, or about as easy after learning how to do it, to read than Names_that_look_like_this. Nobody has ever claimed that they are easier to read. It is less than scientific fact since I do not know of any scientific report that discuss the question. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From joe.armstrong@REDACTED Thu Aug 31 13:55:05 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Thu, 31 Aug 2006 13:55:05 +0200 Subject: The Erlang mailing list In-Reply-To: <20060831114142.6C4045A204@mail.erlangsystems.com> Message-ID: Just thinking out aloud IHMO a decent mailing list system would have the following properties - It could be accessed via a "forum" OR a majordomo type interface - Google (whatever) should be able to reference it - Each posting should have a uniquely generated reference so that it can be referred to later - Given the reference it should be possible to find the mailing - It should support some kind of channel concept ie it should be possible to subscribe to a particular channel (bugs, beginners, ...) - It should aggregate over existing mail lists - It should present the user with a logical view of the mail lists Is there such a thing? If not can't we write a kind of mail sucker that sucks mail from all know forums and lists and put's them into a data base? Are there programmatic interfaces to (say) trap-exit etc, so that a program can craw and index through the mails? I don't want a web-crawler and indexer, I want a mail crawler and indexer that only indexes a specific set of sites /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Mazen > Sent: den 31 augusti 2006 13:42 > To: erlang-questions@REDACTED > Subject: The Erlang mailing list > > > FYI There already are forums on Trapexit that can be used so > all sort of questions. If there is a real need for a "Newbie" > Forum I could have a chat with my colleagues and we could > probably set one up. > > Imho it would be sad to see the community split using > different channels for different things when we have > something that connects them all already. > > Trapexit also reads in from the mailing lists (all of them) > so you get a (to some people anyway) better overview. > > Would a Newbie section @ trapexit be something useful? > > /Mazen > _________________________________________________________ > Post sent from http://www.trapexit.org > From jeffm@REDACTED Thu Aug 31 14:30:24 2006 From: jeffm@REDACTED (jm) Date: Thu, 31 Aug 2006 22:30:24 +1000 Subject: erlang in 5 seconds Message-ID: <44F6D660.2090207@ghostgun.com> More a tag line at a bit over 2 seconds.: Erlang - Success in spite of failure. Jeff. From chris.double@REDACTED Thu Aug 31 14:26:18 2006 From: chris.double@REDACTED (Chris Double) Date: Fri, 1 Sep 2006 00:26:18 +1200 Subject: The Erlang mailing list In-Reply-To: References: <20060831114142.6C4045A204@mail.erlangsystems.com> Message-ID: On 8/31/06, Joe Armstrong (TN/EAB) wrote: > [...snip mailing list requirements...] > Is there such a thing? I believe the trap exit forums does pretty much everything you list. It has normal forums for different categories of posts (web programming, faqs, etc) as well as a bidirectional gateway for posts to this mailing lists. And an excellent search facility. If Google doesn't know about it yet, I'm sure it will. Take a look: http://forum.trapexit.org/ Chris. -- http://www.bluishcoder.co.nz From bjorn@REDACTED Thu Aug 31 14:42:42 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 31 Aug 2006 14:42:42 +0200 Subject: Question about debug info In-Reply-To: <82A8DA06D22E154E82F14B9C5F62A2E04BD61D@PTLISI051MSX.PT001.SIEMENS.NET> References: <82A8DA06D22E154E82F14B9C5F62A2E04BD61D@PTLISI051MSX.PT001.SIEMENS.NET> Message-ID: -compile(debug_info) does not work. The debug_info options must be given on the command line for the compiler. I'll try to fix it for R11B-2 (or at least correct the documentation to point out that it doesn't work). How to check: Eshell V5.5.1 (abort with ^G) 1> c(t, debug_info). {ok,t} 2> beam_lib:info(t). [{file,"t.beam"}, {module,t}, {chunks,[{"Atom",20,77}, {"Code",108,129}, {"StrT",248,0}, {"ImpT",256,40}, {"ExpT",304,40}, {"LocT",352,4}, {"Attr",364,40}, {"CInf",412,172}, {"Abst",592,285}]}] If the second number on the last line (285 in this case) is non-zero, there is debug info in the beam file. If the number is zero, if there is no line at all containing "Abst", there is no debug information. /Bjorn "Gomes, Pedro" writes: > Hello All, > I tryed to use the Erlang debugger and in order to do it I need to > compile the source modules with debug info and for that matter I used > -compile(debug_info) > > This seems to have no effect, even if the .beam module increases its > size, because the debugger still continues to issue an error saying > there no debug information present in the .beam module. > > What am I doing wrong ? > > Thanks, > Pedro -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From james.hague@REDACTED Thu Aug 31 15:27:43 2006 From: james.hague@REDACTED (James Hague) Date: Thu, 31 Aug 2006 08:27:43 -0500 Subject: Erlang downsides? In-Reply-To: References: <44F1BB02.3080101@gmail.com> Message-ID: On 8/31/06, Christian S wrote: > > > * Regular expression matching (there's a module, but watch Perl beat > > > it by a factor of 100). > > > > What language doesn't perl beat at regex? > > As far as I know perl's regexps are fast because C was used to > implement them. If we would see an implementation of perl in perl I > doubt its regexps would spank. Exactly. And other dynamic languages--including Ruby and Python--simply link to the standard Perl regular expression library. In Erlang regular expression are slow because they're implemented entirely in high-level Erlang (which is simultaneously cool and slow). From richardc@REDACTED Thu Aug 31 15:55:40 2006 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 31 Aug 2006 15:55:40 +0200 Subject: Erlang downsides? In-Reply-To: References: <44F1BB02.3080101@gmail.com> Message-ID: <44F6EA5C.1090206@it.uu.se> James Hague wrote: > Exactly. And other dynamic languages--including Ruby and > Python--simply link to the standard Perl regular expression library. > In Erlang regular expression are slow because they're implemented > entirely in high-level Erlang (which is simultaneously cool and slow). Larry Wall, in a talk on Perl 6: "Now, the thing I really wanted to get to, which we think will influence the world outside of Perl is we saw how everyone borrowed Perl 5 compatible regular expressions, and we figured - well, you know, they're a really big mess, and we're sorry, but we're changing them now, now that you've just borrowed them." /Richard From hakan@REDACTED Thu Aug 31 16:45:47 2006 From: hakan@REDACTED (Hakan Mattsson) Date: Thu, 31 Aug 2006 16:45:47 +0200 (CEST) Subject: underscore prefixed variables (was: Re: Noob - Getting Started Infinte Loop?) In-Reply-To: <200608311057.34934.ft@it.su.se> References: <6056733.post@talk.nabble.com> <6069968.post@talk.nabble.com> <44F63559.7000806@bredband.net> <200608311057.34934.ft@it.su.se> Message-ID: On Thu, 31 Aug 2006, Fredrik Thulin wrote: FT> I think that FT> FT> a) variables prefixed with "_" should really not be FT> variables that get set - like the special case _. FT> b) the compiler should issue a warning that you are FT> actually using avariable prefixed with "_". FT> FT> Would others care to share their view on this? I think that it is a splendid idea to have the possibility to use anonymous variables with mnemonic names. The current semantics is quite error prone. But I suspect that there are production code out there that is relying on the current behavior. Your suggestion to add a new compiler warning should be enough. It would give attention to the potential error without breaking any existing code. /H?kan From markmillikan@REDACTED Thu Aug 31 17:57:03 2006 From: markmillikan@REDACTED (Mark Millikan) Date: Thu, 31 Aug 2006 11:57:03 -0400 Subject: Finally: Mac Intel patches In-Reply-To: <17654.34874.469273.130261@alkaid.it.uu.se> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <20060823065514.GB4165@memphis> <17654.34874.469273.130261@alkaid.it.uu.se> Message-ID: What is the recipe for building a hipe enabled erlang system on MacOSX/Intel? I've copied mach_override.(ch) to erts/emulator/hipe as described. configuring with --enable-smp-support and running make followed by sudo make install appears to work correctly. All three modes of invoking erl (plain, hybrid, and smp) startup and appear to work correctly. However: Erlang (BEAM) emulator version 5.5.1 [source] [async-threads:0] Eshell V5.5.1 (abort with ^G) 1> c(bank_client,native). ./bank_client.erl:none: Warning: this system is not configured for native-code compilation. {ok,bank_client} No [hipe] in the banner, and apparently no hipe in the emulator, any suggestions? On 8/31/06, Mikael Pettersson wrote: > Jay McCarthy writes: > > The R11B-1 release does not contain the mach_override files, nor > > instructions on how to get them. > > > > Jay > > > > On 8/25/06, Mikael Pettersson wrote: > > > The final set of Darwin/x86 patches have been committed to > > > the HiPE/OTP source repository, and they are likely to be > > > included in the upcoming R11B-1 release. > > > > On 8/23/06, Joel Reymont wrote: > > > I conveniently forgot to mention a key thing. You need to grab > > > mach_override.{c,h} from http://extendamac.sourceforge.net/ and drop > > > these into erts/emulator/hipe/. These are needed to patch up the > > > running erlang binary, nothing will work otherwise. > > Big deal, you have the link :-) > > Seriously, I haven't had time to review their licensing conditions, > and ideally, mach_override _should_ be installed as a standard library > and simply be part of the these-libraries-are-preconditions checks. > From joelr1@REDACTED Thu Aug 31 18:08:26 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 31 Aug 2006 17:08:26 +0100 Subject: Finally: Mac Intel patches In-Reply-To: References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17635.16544.567307.112086@alkaid.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <20060823065514.GB4165@memphis> <17654.34874.469273.130261@alkaid.it.uu.se> Message-ID: <0B153240-6980-4F8F-A753-DFE2346975D2@gmail.com> Why is everybody configuring hipe with --enable-smp-support instead of --enable-hipe? Is symmetrical multiprocessing tightly linked with the native-code compiler in the sources is there some README that tells people to do it this way? On Aug 31, 2006, at 4:57 PM, Mark Millikan wrote: > What is the recipe for building a hipe enabled erlang system on > MacOSX/Intel? > I've copied mach_override.(ch) to erts/emulator/hipe as described. > configuring with --enable-smp-support and running make followed by > sudo make install appears to work correctly. All three modes of > invoking erl (plain, hybrid, and smp) startup and appear to work > correctly. -- http://wagerlabs.com/ From markmillikan@REDACTED Thu Aug 31 18:21:13 2006 From: markmillikan@REDACTED (Mark Millikan) Date: Thu, 31 Aug 2006 12:21:13 -0400 Subject: Finally: Mac Intel patches In-Reply-To: <0B153240-6980-4F8F-A753-DFE2346975D2@gmail.com> References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17636.23172.37608.399423@alkaid.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <20060823065514.GB4165@memphis> <17654.34874.469273.130261@alkaid.it.uu.se> <0B153240-6980-4F8F-A753-DFE2346975D2@gmail.com> Message-ID: The README in the source distribution lists enable/disable options for building smp support (unrelated to hipe support). It also indicates that there is a --disable-hipe option. It says hipe will automatically be enabled on systems that support it. I'll try an explicit --enable-hipe. On 8/31/06, Joel Reymont wrote: > Why is everybody configuring hipe with --enable-smp-support instead > of --enable-hipe? > > Is symmetrical multiprocessing tightly linked with the native-code > compiler in the sources is there some README that tells people to do > it this way? > > On Aug 31, 2006, at 4:57 PM, Mark Millikan wrote: > > > What is the recipe for building a hipe enabled erlang system on > > MacOSX/Intel? > > I've copied mach_override.(ch) to erts/emulator/hipe as described. > > configuring with --enable-smp-support and running make followed by > > sudo make install appears to work correctly. All three modes of > > invoking erl (plain, hybrid, and smp) startup and appear to work > > correctly. > > -- > http://wagerlabs.com/ > > > > > > From garry@REDACTED Thu Aug 31 18:22:40 2006 From: garry@REDACTED (Garry Hodgson) Date: Thu, 31 Aug 2006 12:22:40 -0400 (EDT) Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <44F6CD2E.3080301@ericsson.com> References: <44F6CD2E.3080301@ericsson.com> Message-ID: <2006083112221157041360@k2.sage.att.com> Bengt Kleberg wrote: > ...deleted > >> if you want to avoid ''hard to read'' you should avoid > >> NamesThatLookLikeThis. Names_that_look_like_this are easier to read > > > > is this a scientific fact or your personal opinion? > > Somerthing in between. > > It is more than my personal opinion since 100% of the people i have > asked say that NamesThatLookLikeThis are harder, or about as easy after > learning how to do it, to read than Names_that_look_like_this. > Nobody has ever claimed that they are easier to read. you must have asked the wrong people. ---- Garry Hodgson, Senior Software Geek, AT&T CSO But I'm not giving in an inch to fear 'Cause I promised myself this year I feel like I owe it...to someone. From erlang@REDACTED Thu Aug 31 18:29:48 2006 From: erlang@REDACTED (erlang) Date: Thu, 31 Aug 2006 09:29:48 -0700 Subject: net_adm:ping not working -- still not answered Message-ID: <01d0eb76c8c04c57a117814044713637@cyberplasm.com> > > Sorry, this is indeed a typo in my email. Should be: > (b@REDACTED)1> net_adm:ping('a@REDACTED'). > > > > > Hi, is the colon ":" just a typo in your email? It should be > > "@" as you can see from the node name in the Erlang shell prompt. > > > > Best Regards > > Lennart > > > > > (b@REDACTED)1> net_adm:ping('a:my-server'). > > > > > I can't get the ping-pong distributed example to work, so I tried simply > > > pinging another node. This doesn't work either. > > > > > > os: windows server 2003, machine name is my-server. > > > EShell v5.5.1 > > > > > > command lines: erl -sname a > > > erl -sname b > > > > > > (b@REDACTED)1> net_adm:ping('a:my-server'). > > > > > > always returns pang. The cookie file is being read, and the cookie is > > > the same in both nodes. What to try next? > > > > > > > > > > > > > > > > > > From garry@REDACTED Thu Aug 31 18:31:45 2006 From: garry@REDACTED (Garry Hodgson) Date: Thu, 31 Aug 2006 12:31:45 -0400 (EDT) Subject: how to use a specific host alias for node name? Message-ID: <2006083112311157041905@k2.sage.att.com> in our application, a master server has a list of nodes that it can use for computation. in principle, we'd like the machines named node1, node2, ...nodeN, so the nodes would be node@REDACTED@nodeN. but some of our installations have their own naming conventions for machines. adding aliases in /etc/hosts doesn't help. so we resort to a config file, which seems kind of klunky. is there a way to cause the nodes to come up using a specific host alias? or better yet, is there a better way for the master to find out who's out there? the nodes check in when they come up, but this won't help if they're already up when master starts. and no, we're not using otp, alas, though i'd also be interested in otp approaches. ---- Garry Hodgson, Senior Software Geek, AT&T CSO But I'm not giving in an inch to fear 'Cause I promised myself this year I feel like I owe it...to someone. From garry@REDACTED Thu Aug 31 18:33:03 2006 From: garry@REDACTED (Garry Hodgson) Date: Thu, 31 Aug 2006 12:33:03 -0400 (EDT) Subject: The Erlang mailing list In-Reply-To: References: Message-ID: <2006083112331157041983@k2.sage.att.com> > How about a new mailinglist for advocacy, it was a popular subcategory > on usenet. A group for talking about blogs, community building, > additional mailinglist and 5 second erlang submissions? we could also add mailinglists to discuss the best ways to further fragment the already small erlang community. ---- Garry Hodgson, Senior Software Geek, AT&T CSO But I'm not giving in an inch to fear 'Cause I promised myself this year I feel like I owe it...to someone. From simonpeterchappell@REDACTED Thu Aug 31 18:40:36 2006 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Thu, 31 Aug 2006 11:40:36 -0500 Subject: underscore prefixed variables (was: Re: Noob - Getting Started Infinte Loop?) In-Reply-To: <200608311057.34934.ft@it.su.se> References: <6056733.post@talk.nabble.com> <6069968.post@talk.nabble.com> <44F63559.7000806@bredband.net> <200608311057.34934.ft@it.su.se> Message-ID: <8ed733900608310940r31187cc6x24cdd50a657b92e@mail.gmail.com> On 8/31/06, Fredrik Thulin wrote: > On Thursday 31 August 2006 03:03, H?kan Stenholm wrote: > ... > > Note that _V is still a valid variablename, so the code below is > > valid: > > > > foo(_V) -> > > _V * 2. > > > > a call to foo(42) would yield 84 in this case. When did that get added to the language? I looked in my copy of "Concurrent Programming in Erlang, 2ed" and didn't find that. All I found was that variables must start with an upper-case letter. Simon -- www.simonpeter.org From lennart.ohman@REDACTED Thu Aug 31 18:54:25 2006 From: lennart.ohman@REDACTED (Lennart Ohman) Date: Thu, 31 Aug 2006 18:54:25 +0200 Subject: underscore prefixed variables (was: Re: Noob - Getting Started Infinte Loop?) In-Reply-To: <8ed733900608310940r31187cc6x24cdd50a657b92e@mail.gmail.com> Message-ID: <003001c6cd1e$1db37150$0200a8c0@st.se> Hi, it has been in the language as long as I can remember. (That means from 1992 or something like that :-) But if my memory doesn't serve me wrong, the debated semantics on the more than just a single underscore changed somewhere. Probably right after the book was published!? Best Regards Lennart ------------------------------------------------------------- Lennart Ohman office : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 67 35 Sehlstedtsgatan 6 fax : +46-8-667 82 30 SE-115 28, STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > -----Original Message----- > From: owner-erlang-questions@REDACTED [mailto:owner-erlang- > questions@REDACTED] On Behalf Of Simon Chappell > Sent: Thursday, August 31, 2006 6:41 PM > To: erlangquestions > Subject: Re: underscore prefixed variables (was: Re: Noob - Getting > Started Infinte Loop?) > > On 8/31/06, Fredrik Thulin wrote: > > On Thursday 31 August 2006 03:03, H?kan Stenholm wrote: > > ... > > > Note that _V is still a valid variablename, so the code below is > > > valid: > > > > > > foo(_V) -> > > > _V * 2. > > > > > > a call to foo(42) would yield 84 in this case. > > When did that get added to the language? I looked in my copy of > "Concurrent Programming in Erlang, 2ed" and didn't find that. All I > found was that variables must start with an upper-case letter. > > Simon > > -- > www.simonpeter.org From Martin.Logan@REDACTED Thu Aug 31 19:10:07 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Thu, 31 Aug 2006 12:10:07 -0500 Subject: The Erlang mailing list In-Reply-To: <2006083112331157041983@k2.sage.att.com> Message-ID: <9CB79C836F98504C81BF082C4291E987792B54@CHITDSEXC02.tds.corp.cendant.org> Garry Hodgson wrote: we could also add mailinglists to discuss the best ways to further fragment the already small erlang community. I think Garry has a good point here. I don't think the mailing list is out of control yet. I still enjoy reading it. It was more fun 3 or 4 years ago perhaps but I still enjoy it. Seeing the community grow is a good thing. If we are to split the list, create a junior-erlang-questions list. Lets not make this any more complex than needs be. Cheers, Martin From simonpeterchappell@REDACTED Thu Aug 31 19:34:56 2006 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Thu, 31 Aug 2006 12:34:56 -0500 Subject: The Erlang mailing list In-Reply-To: <9CB79C836F98504C81BF082C4291E987792B54@CHITDSEXC02.tds.corp.cendant.org> References: <2006083112331157041983@k2.sage.att.com> <9CB79C836F98504C81BF082C4291E987792B54@CHITDSEXC02.tds.corp.cendant.org> Message-ID: <8ed733900608311034ma1fa3c3m885004cbb5f5cb1f@mail.gmail.com> On 8/31/06, Logan, Martin wrote: > If we are to split the list, create a junior-erlang-questions list. > Lets not make this any more complex than needs be. Agreed. In fact we already have some good basic conversation going on over at Joel's Think Erlang Google group. Simon -- www.simonpeter.org From bob@REDACTED Thu Aug 31 19:53:20 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 31 Aug 2006 10:53:20 -0700 Subject: Erlang downsides? In-Reply-To: References: <44F1BB02.3080101@gmail.com> Message-ID: <6a36e7290608311053v7d6c378bvf8bf5319bbfc8fd0@mail.gmail.com> On 8/31/06, James Hague wrote: > On 8/31/06, Christian S wrote: > > > > * Regular expression matching (there's a module, but watch Perl beat > > > > it by a factor of 100). > > > > > > What language doesn't perl beat at regex? > > > > As far as I know perl's regexps are fast because C was used to > > implement them. If we would see an implementation of perl in perl I > > doubt its regexps would spank. > > Exactly. And other dynamic languages--including Ruby and > Python--simply link to the standard Perl regular expression library. > In Erlang regular expression are slow because they're implemented > entirely in high-level Erlang (which is simultaneously cool and slow). > Python definitely does not use PCRE. I was under the impression that Ruby used Oniguruma, but I'm not sure because I don't use Ruby. The regexp module in Erlang is slow because it's a simple implementation and it doesn't cache compiled regular expressions. It also doesn't support modern regex features that you get with Perl or Python, making it even less attractive. -bob From rcbeerman@REDACTED Thu Aug 31 20:20:36 2006 From: rcbeerman@REDACTED (RCB) Date: Thu, 31 Aug 2006 11:20:36 -0700 Subject: how to use a specific host alias for node name? In-Reply-To: <2006083112311157041905@k2.sage.att.com> References: <2006083112311157041905@k2.sage.att.com> Message-ID: Gary, One idea (leveraging the OTP) is to use pg2. Make the computation nodes register themselves with pg2, using a pre-defined group name (such as 'comp'.) Then, from the master server, use pg2:get_members(comp) before dispatching. This will return a list of PIDs. From there you can easily get node names: Workers = [node(Pid) || Pid <- pg2:get_members(comp)] There are other ways, but this is pretty fast, dynamic (if a worker node goes offline it is instantly reflected via pg2, and it solves the late master problem you mentioned) and works well in some of the applications I've written. Rich On 8/31/06, Garry Hodgson wrote: > > in our application, a master server has a list of nodes > that it can use for computation. in principle, we'd like > the machines named node1, node2, ...nodeN, so the nodes > would be node@REDACTED@nodeN. but some of our > installations have their own naming conventions for machines. > adding aliases in /etc/hosts doesn't help. so we resort to a > config file, which seems kind of klunky. > > is there a way to cause the nodes to come up using a specific > host alias? or better yet, is there a better way for the master to find > out who's out there? the nodes check in when they come up, > but this won't help if they're already up when master starts. > > and no, we're not using otp, alas, though i'd also be interested > in otp approaches. > > ---- > Garry Hodgson, Senior Software Geek, AT&T CSO > > But I'm not giving in an inch to fear > 'Cause I promised myself this year > I feel like I owe it...to someone. > > -- Rich Beerman Cupertino, California mobile: 408/221-2444 fax: 408/255-7944 -------------- next part -------------- An HTML attachment was scrubbed... URL: From markmillikan@REDACTED Thu Aug 31 20:25:12 2006 From: markmillikan@REDACTED (Mark Millikan) Date: Thu, 31 Aug 2006 14:25:12 -0400 Subject: Finally: Mac Intel patches In-Reply-To: References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <20060823065514.GB4165@memphis> <17654.34874.469273.130261@alkaid.it.uu.se> <0B153240-6980-4F8F-A753-DFE2346975D2@gmail.com> Message-ID: It works! BTW the sourceforge web interface to subversion errors when trying to download mach_override.c, had to download whole repo using svn. On 8/31/06, Mark Millikan wrote: > The README in the source distribution lists enable/disable options for > building smp support (unrelated to hipe support). It also indicates > that there is a --disable-hipe option. It says hipe will automatically > be enabled on systems that support it. I'll try an explicit > --enable-hipe. > > On 8/31/06, Joel Reymont wrote: > > Why is everybody configuring hipe with --enable-smp-support instead > > of --enable-hipe? > > > > Is symmetrical multiprocessing tightly linked with the native-code > > compiler in the sources is there some README that tells people to do > > it this way? > > > > On Aug 31, 2006, at 4:57 PM, Mark Millikan wrote: > > > > > What is the recipe for building a hipe enabled erlang system on > > > MacOSX/Intel? > > > I've copied mach_override.(ch) to erts/emulator/hipe as described. > > > configuring with --enable-smp-support and running make followed by > > > sudo make install appears to work correctly. All three modes of > > > invoking erl (plain, hybrid, and smp) startup and appear to work > > > correctly. > > > > -- > > http://wagerlabs.com/ > > > > > > > > > > > > > From joelr1@REDACTED Thu Aug 31 20:30:17 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 31 Aug 2006 19:30:17 +0100 Subject: Finally: Mac Intel patches In-Reply-To: References: <200608151243.k7FCh5iI017788@harpo.it.uu.se> <17637.33494.353017.151134@alkaid.it.uu.se> <1D2CC918-72F3-4932-A90F-007A1D3F1551@gmail.com> <20060823065514.GB4165@memphis> <17654.34874.469273.130261@alkaid.it.uu.se> <0B153240-6980-4F8F-A753-DFE2346975D2@gmail.com> Message-ID: <689ABB2F-B97F-432E-ADCE-FB8FF88B7178@gmail.com> I'm glad. Kudos to Mikael and the HiPE group! On Aug 31, 2006, at 7:25 PM, Mark Millikan wrote: > It works! BTW the sourceforge web interface to subversion errors when > trying to download mach_override.c, had to download whole repo using > svn. -- http://wagerlabs.com/ From james.hague@REDACTED Thu Aug 31 21:22:07 2006 From: james.hague@REDACTED (James Hague) Date: Thu, 31 Aug 2006 14:22:07 -0500 Subject: Erlang downsides? In-Reply-To: <6a36e7290608311053v7d6c378bvf8bf5319bbfc8fd0@mail.gmail.com> References: <44F1BB02.3080101@gmail.com> <6a36e7290608311053v7d6c378bvf8bf5319bbfc8fd0@mail.gmail.com> Message-ID: On 8/31/06, Bob Ippolito wrote: > > Python definitely does not use PCRE. Correct, though it used to: "PCRE was used in Python 1.5.2, but it doesn't support 16-bit Unicode characters (only UTF-8 encoded strings), so Python now uses its own regex engine." From philrand@REDACTED Thu Aug 31 21:37:08 2006 From: philrand@REDACTED (Phil Rand) Date: Thu, 31 Aug 2006 12:37:08 -0700 Subject: Erlang downsides? In-Reply-To: References: <44F1BB02.3080101@gmail.com> Message-ID: <5784c1b10608311237q2837de31pea9a09e3b644d536@mail.gmail.com> On 8/31/06, Christian S wrote: > > > * Regular expression matching (there's a module, but watch Perl beat > > > it by a factor of 100). > > > > What language doesn't perl beat at regex? > > As far as I know perl's regexps are fast because C was used to > implement them. If we would see an implementation of perl in perl I > doubt its regexps would spank. > Edi Weitz's cl-ppcre in Common Lisp beats perl on the CMUCL lisp implementation: http://weitz.de/cl-ppcre/ -- Phil Rand philrand@REDACTED From klacke@REDACTED Thu Aug 31 21:36:50 2006 From: klacke@REDACTED (Claes Wikstom) Date: Thu, 31 Aug 2006 21:36:50 +0200 Subject: Erlang downsides? In-Reply-To: <6a36e7290608311053v7d6c378bvf8bf5319bbfc8fd0@mail.gmail.com> References: <44F1BB02.3080101@gmail.com> <6a36e7290608311053v7d6c378bvf8bf5319bbfc8fd0@mail.gmail.com> Message-ID: <44F73A52.4060906@hyber.org> Bob Ippolito wrote: > > > The regexp module in Erlang is slow because it's a simple > implementation and it doesn't cache compiled regular expressions. It > also doesn't support modern regex features that you get with Perl or > Python, making it even less attractive. > The amount of whining regarding erlang regexp support on this list is staggering. I wrote a proper linked in driver interface to all of posix regular expressions. It's here: http://yaws.hyber.org/download/posregex-1.0.tgz Go get. It should be equal in speed to other implementations in other langs. /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control cellphone: +46 70 2097763 From robert.virding@REDACTED Thu Aug 31 22:10:30 2006 From: robert.virding@REDACTED (Robert Virding) Date: Thu, 31 Aug 2006 22:10:30 +0200 Subject: Noob - Getting Started Infinte Loop? In-Reply-To: <44F63559.7000806@bredband.net> References: <6056733.post@talk.nabble.com> <0C554180-FD58-4069-9430-170213B71689@redstarling.com> <6069968.post@talk.nabble.com> <44F63559.7000806@bredband.net> Message-ID: <44F74236.3010803@telia.com> H?kan Stenholm wrote: > foo(_V) -> ok; % variable V is unused, renamed to _V to inidicate that > it's not used in this clause > foo(V) -> .... > > Note that _V is still a valid variablename, so the code below is valid: > > foo(_V) -> > _V * 2. > > a call to foo(42) would yield 84 in this case. > > > But you should never use _ in variable names in this way (instead remove > the _ if the V is to be used). Actually this is simple way to get rid of the annoying whining by the compiler, just prepend every variable with _ and it keeps quiet. :-) Seriously I would prefer the default to be to keep quiet. Robert From robert.virding@REDACTED Thu Aug 31 22:29:23 2006 From: robert.virding@REDACTED (Robert Virding) Date: Thu, 31 Aug 2006 22:29:23 +0200 Subject: underscore prefixed variables In-Reply-To: References: <6056733.post@talk.nabble.com> <6069968.post@talk.nabble.com> <44F63559.7000806@bredband.net> <200608311057.34934.ft@it.su.se> Message-ID: <44F746A3.40002@telia.com> Hakan Mattsson wrote: > On Thu, 31 Aug 2006, Fredrik Thulin wrote: > > FT> I think that > FT> > FT> a) variables prefixed with "_" should really not be > FT> variables that get set - like the special case _. > FT> b) the compiler should issue a warning that you are > FT> actually using avariable prefixed with "_". > FT> > FT> Would others care to share their view on this? > > I think that it is a splendid idea to have the > possibility to use anonymous variables with mnemonic > names. The current semantics is quite error prone. But > I suspect that there are production code out there that > is relying on the current behavior. > > Your suggestion to add a new compiler warning should be > enough. It would give attention to the potential error > without breaking any existing code. Enough is enough! Are you going to start complaining when people use _ at all in variables? It could be considered that they really MEANT it to be a single occurence variable. This is style and the compiler should not try and enforce a certain programming style. Remove the special handling of variables starting with _ and have a checker for single occurences which is off by default and let me turn it on when I get worried. Robert From robert.virding@REDACTED Thu Aug 31 22:32:57 2006 From: robert.virding@REDACTED (Robert Virding) Date: Thu, 31 Aug 2006 22:32:57 +0200 Subject: Mailing list message size In-Reply-To: <44F5F7DA.1060209@hyber.org> References: <44F5EF3A.2020407@telia.com> <44F5F7DA.1060209@hyber.org> Message-ID: <44F74779.8020200@telia.com> Claes Wikstom wrote: > Robert Virding wrote: > >> Is there any limitation to the size of a message in the mailing list? >> I tried to publish the latest Erlog release (much improved) and it >> quietly vanished into the bit-bucket. And the code is pretty beautiful >> as well, so it wasn't that. :-) >> >> Robert >> > > Maybe is disappeared due to the funky license you had > attached to Erlog ? Ah, that's because I have been contaminated by the computer gaming world where there is a shartp distinction between commercial and non-commercial. Anyway asking them to notify me is not asking too much, at I don't htink so. Just some common courtesy which is possible as the Erlang world is not yet so very large. I would like to see the filter though. :-) Robert From robert.virding@REDACTED Thu Aug 31 22:38:41 2006 From: robert.virding@REDACTED (Robert Virding) Date: Thu, 31 Aug 2006 22:38:41 +0200 Subject: Erlang downsides? In-Reply-To: <6a36e7290608311053v7d6c378bvf8bf5319bbfc8fd0@mail.gmail.com> References: <44F1BB02.3080101@gmail.com> <6a36e7290608311053v7d6c378bvf8bf5319bbfc8fd0@mail.gmail.com> Message-ID: <44F748D1.3060704@telia.com> Bob Ippolito wrote: > The regexp module in Erlang is slow because it's a simple > implementation and it doesn't cache compiled regular expressions. It > also doesn't support modern regex features that you get with Perl or > Python, making it even less attractive. The benefit of having it in Erlang is that you can DO things with the regexps in erlang. I am working on a version of regexp with a compiler and it will be intersting to see how much difference it makes. Anyway some of the modern regex features aren't too nice anyway, and some definitely make them go slowly. Robert From bob@REDACTED Thu Aug 31 22:42:46 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 31 Aug 2006 13:42:46 -0700 Subject: Erlang downsides? In-Reply-To: <44F73A52.4060906@hyber.org> References: <44F1BB02.3080101@gmail.com> <6a36e7290608311053v7d6c378bvf8bf5319bbfc8fd0@mail.gmail.com> <44F73A52.4060906@hyber.org> Message-ID: <6a36e7290608311342n3e96d1fcp3d851fe85adc059d@mail.gmail.com> On 8/31/06, Claes Wikstom wrote: > Bob Ippolito wrote: > > > > > > The regexp module in Erlang is slow because it's a simple > > implementation and it doesn't cache compiled regular expressions. It > > also doesn't support modern regex features that you get with Perl or > > Python, making it even less attractive. > > > > > The amount of whining regarding erlang regexp support on this list > is staggering. I wrote a proper linked in driver interface to > all of posix regular expressions. It's here: > > http://yaws.hyber.org/download/posregex-1.0.tgz > > Go get. It should be equal in speed to other implementations > in other langs. There seems to be some linuxisms in the Makefile and configure, it won't compile on Mac OS X (or FreeBSD for that matter). At a glance, there's at least two portability issues because the BSD version of cp doesn't support "-a", the ld option for Mac OS X to create bundles is not "-shared". I wasn't saying that there are no good regexp implementations available for Erlang, just that the one in stdlib isn't very interesting. The stdlib is where I imagine most (new?) people are going to look for functionality, because jungerl is a mess and erlrt/REPOS/whatever isn't ready yet. -bob From bob@REDACTED Thu Aug 31 22:50:57 2006 From: bob@REDACTED (Bob Ippolito) Date: Thu, 31 Aug 2006 13:50:57 -0700 Subject: Erlang downsides? In-Reply-To: <44F748D1.3060704@telia.com> References: <44F1BB02.3080101@gmail.com> <6a36e7290608311053v7d6c378bvf8bf5319bbfc8fd0@mail.gmail.com> <44F748D1.3060704@telia.com> Message-ID: <6a36e7290608311350j69b57c3v91bb949b5ea2b4b1@mail.gmail.com> On 8/31/06, Robert Virding wrote: > Bob Ippolito wrote: > > The regexp module in Erlang is slow because it's a simple > > implementation and it doesn't cache compiled regular expressions. It > > also doesn't support modern regex features that you get with Perl or > > Python, making it even less attractive. > > The benefit of having it in Erlang is that you can DO things with the > regexps in erlang. I am working on a version of regexp with a compiler > and it will be intersting to see how much difference it makes. I wasn't saying that it's a bad idea to have the implementation be pure Erlang, just that the current implementation is lacking the performance characteristics and features that people have come to expect from other languages over the years. > Anyway some of the modern regex features aren't too nice anyway, and > some definitely make them go slowly. The two features I use most that the stdlib implementation doesn't implement are the verbose syntax and named groups, which are more for readability/maintainability than anything else. -bob From yerl@REDACTED Thu Aug 31 22:54:45 2006 From: yerl@REDACTED (Yerl) Date: Thu, 31 Aug 2006 22:54:45 +0200 Subject: Erlang downsides? In-Reply-To: <6a36e7290608311053v7d6c378bvf8bf5319bbfc8fd0@mail.gmail.com> References: <44F1BB02.3080101@gmail.com> <6a36e7290608311053v7d6c378bvf8bf5319bbfc8fd0@mail.gmail.com> Message-ID: <44F74C95.7090304@club-internet.fr> Hi > > Python definitely does not use PCRE. I was under the impression that > Ruby used Oniguruma, but I'm not sure because I don't use Ruby. > I can confirm that. Ruby definitively use Oniguruma. A regexp library with different character encoding. http://www.geocities.jp/kosako3/oniguruma/ cheers Youn?s From headspin@REDACTED Thu Aug 31 23:06:50 2006 From: headspin@REDACTED (dda) Date: Thu, 31 Aug 2006 23:06:50 +0200 Subject: Erlang downsides? In-Reply-To: <44F73A52.4060906@hyber.org> References: <44F1BB02.3080101@gmail.com> <6a36e7290608311053v7d6c378bvf8bf5319bbfc8fd0@mail.gmail.com> <44F73A52.4060906@hyber.org> Message-ID: Doesn't compile on Mac OS X 10.3.9 ppc ? the -shared option is invalid. Apple's own version of gcc uses -dynamiclib -- Didier On 8/31/06, Claes Wikstom wrote: > Bob Ippolito wrote: > > > > > > The regexp module in Erlang is slow because it's a simple > > implementation and it doesn't cache compiled regular expressions. It > > also doesn't support modern regex features that you get with Perl or > > Python, making it even less attractive. > > > > > The amount of whining regarding erlang regexp support on this list > is staggering. I wrote a proper linked in driver interface to > all of posix regular expressions. It's here: > > http://yaws.hyber.org/download/posregex-1.0.tgz > > Go get. It should be equal in speed to other implementations > in other langs. > > > /klacke > > > -- > Claes Wikstrom -- Caps lock is nowhere and > http://www.hyber.org -- everything is under control > cellphone: +46 70 2097763 From richardc@REDACTED Thu Aug 31 23:09:18 2006 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 31 Aug 2006 23:09:18 +0200 Subject: warn_unused_vars (Was: Re: Noob - Getting Started Infinte Loop?) In-Reply-To: <44F74236.3010803@telia.com> References: <6056733.post@talk.nabble.com> <0C554180-FD58-4069-9430-170213B71689@redstarling.com> <6069968.post@talk.nabble.com> <44F63559.7000806@bredband.net> <44F74236.3010803@telia.com> Message-ID: <44F74FFE.4070904@it.uu.se> Robert Virding wrote: > Actually this is simple way to get rid of the annoying whining by the > compiler, just prepend every variable with _ and it keeps quiet. :-) > > Seriously I would prefer the default to be to keep quiet. Seriously, that would be a bad idea. It catches _way_ too many errors (nasty, hard-to-find typo bugs) to be turned off by default. Oh, not in _your_ code, of course. Goes without saying. ;-) /Richard From joelr1@REDACTED Thu Aug 31 23:33:52 2006 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 31 Aug 2006 22:33:52 +0100 Subject: Parsing RSS Message-ID: Has anyone tried to parse RSS feeds using Erlang? I tried the example at http://wiki.trapexit.org/index.php/ How_to_write_an_RSS_aggregator but xmerl_scan:string blows up. The proper URL for the feed is http://rss.slashdot.org/Slashdot/slashdot. Thanks, Joel -- http://wagerlabs.com/