From mickael.remond@REDACTED Thu Sep 1 08:53:11 2005 From: mickael.remond@REDACTED (=?ISO-8859-1?Q?Micka=EBl_R=E9mond?=) Date: Thu, 1 Sep 2005 08:53:11 +0200 Subject: Notice: several Erlang server problem Message-ID: <6B4BCF4D-D4F8-403F-A3B3-D0839A9601A5@erlang-fr.org> Hello, Just to let you know what happens: We have encountered a hardware crash on our server (For the third time this year and this is not the same machine. What a bad luck :-( We are working to make Dell go onsite to fix the problem as soon as possible and get everything back online. Sorry for the inconvenience (This concern erlang-projects.org, planeterlang.org, erlang-foundation.org and several others sites) Sorry again. We are doing our best to get thing online very fast. -- Micka?l R?mond From erlang@REDACTED Thu Sep 1 10:22:30 2005 From: erlang@REDACTED (Peter Lund) Date: Thu, 01 Sep 2005 10:22:30 +0200 Subject: Notice: several Erlang server problem In-Reply-To: <6B4BCF4D-D4F8-403F-A3B3-D0839A9601A5@erlang-fr.org> References: <6B4BCF4D-D4F8-403F-A3B3-D0839A9601A5@erlang-fr.org> Message-ID: <4316BA46.4030605@lundata.se> Next time you start the service, check the CPU usage. It is not good if the CPU is constant at 100%, since the computer may get too hot. I had that problem earlier with a erlang server running on a old FreeBSD version and on a old computer before. My harddrive stopped working. I was not completely sure about the cause but I suspected the 100% CPU usage to be part of the problem... Peter Micka?l R?mond wrote: > Hello, > > Just to let you know what happens: We have encountered a hardware > crash on our server (For the third time this year and this is not the > same machine. What a bad luck :-( > > We are working to make Dell go onsite to fix the problem as soon as > possible and get everything back online. > Sorry for the inconvenience (This concern erlang-projects.org, > planeterlang.org, erlang-foundation.org and several others sites) > > Sorry again. We are doing our best to get thing online very fast. > From francesco@REDACTED Thu Sep 1 08:36:53 2005 From: francesco@REDACTED (Francesco Cesarini (Erlang Training & Consulting)) Date: Thu, 01 Sep 2005 07:36:53 +0100 Subject: mnesia replication (Are there checksums?) In-Reply-To: References: <43147BD0.6090103@hq.idt.net> <17173.19195.826225.51972@rian.du.uab.ericsson.se> <43158FB9.6040708@erlang-consulting.com> Message-ID: <4316A185.7000707@erlang-consulting.com> I am amazed we never came across this bug (ok, feature :-) ) before. I would have expected an alarm to be generated as soon as the databases became inconsistent. I guess a way to come around the problem is to hash the dirty writes across the nodes based on the key. How hard would it be to add a checksum to each table? It should not generate any major overheads... The subject had been discussed, but probably before you took over the reins. all my best, Francesco -- http://www.erlang-consulting.com Hakan Mattsson wrote: > No, there are no table checksums. Mnesia relies on > other recovery mechanisms. > > The behaviour that you call a serious bug, is > deliberate. Normally all database accesses should be > performed within transactions. If the performance is > good enough you should not use dirty access at > all. The only reason for using dirty access is to > gain better performance. But that does not come for > free, as you need to deal with almost all > concurrency issues yourself. One of these issues is > serialization of updates. If this is unexpected, the > documentation should be blamed (or possibly the > reader of the documentation ;-). > > /H?kan > > On Wed, 31 Aug 2005, Francesco Cesarini (Erlang Training & Consulting) wrote: > > FC> I would class this as a serious bug! I have a vague recollection that > FC> there was a checksum being computed for every table, but have looked > FC> everywhere and can not find any reference for it. Maybe it was just a > FC> discussion I had with some one 10 years ago, or something... Did it ever > FC> happen? > FC> > FC> Francesco > FC> -- > FC> http://www.erlang-consulting.com > FC> > FC> > FC> Dan Gudmundsson wrote: > FC> > chandru writes: > FC> > > Hi, > FC> > > > On 30/08/05, Serge Aleynikov wrote: > FC> > > > Hello, > FC> > > > > > Could someone comment on the effect of short network outages > FC> > ( < 10-15 > FC> > > > s) on mnesia replication and how to prevent the inconsistency > FC> > > > demonstrated in the example below? I intentionally did not alter > FC> > the > FC> > > > net_ticktime kernel parameter so that it would be greater than the > FC> > > > duration of the brief network outage. > FC> > > > You can't really prevent this inconsistency if you are using > FC> > dirty > FC> > > operations. Have you tried the same test using transactions instead > FC> > of > FC> > > dirty operations. > FC> > > FC> > Since dirty_operation don't grab a lock you should be able see the same > FC> > problem > FC> > with a working network .. > FC> > > FC> > Dirty is dirty, be aware of that. > FC> > > FC> > /Dan From mickael.remond@REDACTED Thu Sep 1 10:32:11 2005 From: mickael.remond@REDACTED (=?ISO-8859-1?Q?Micka=EBl_R=E9mond?=) Date: Thu, 1 Sep 2005 10:32:11 +0200 Subject: Notice: several Erlang server problem In-Reply-To: <4316BA46.4030605@lundata.se> References: <6B4BCF4D-D4F8-403F-A3B3-D0839A9601A5@erlang-fr.org> <4316BA46.4030605@lundata.se> Message-ID: Le 1 sept. 05 ? 10:22, Peter Lund a ?crit : > Next time you start the service, check the CPU usage. It is not > good if the CPU is constant at 100%, since the computer may get too > hot. CPU was quite low as it was a dual CPU machine. not much swap either (2gb RAM). > I had that problem earlier with a erlang server running on a old > FreeBSD version and on a old computer before. My harddrive stopped > working. I was not completely sure about the cause but I suspected > the 100% CPU usage to be part of the problem... This time, the problem is probably that one of the ventilator died and the heat probably killed the RAID card :-( -- Micka?l R?mond From vipin@REDACTED Thu Sep 1 13:45:36 2005 From: vipin@REDACTED (vipin) Date: Thu, 01 Sep 2005 17:15:36 +0530 Subject: Erlang Process Limits !!! Message-ID: <4316E9E0.1090709@picopeta.com> Hello all, Is the maximum number of processes on an Erlang node a hard limit, or is there the potential for this to be increased (beyond 32767)? Your suggestions would be welcome. Cheers, Vipin From bengt.kleberg@REDACTED Thu Sep 1 13:56:33 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 01 Sep 2005 13:56:33 +0200 Subject: Erlang Process Limits !!! In-Reply-To: <4316E9E0.1090709@picopeta.com> References: <4316E9E0.1090709@picopeta.com> Message-ID: <4316EC71.6040402@ericsson.com> On 2005-09-01 13:45, vipin wrote: > Hello all, > > Is the maximum number of processes on an Erlang node a hard limit, or is > there the potential for this to be increased (beyond 32767)? from the erl (command used when starting erlang) manual page: +P Number: Sets the maximum number of concurrent processes for this system. By default this value is 32768. The Number must be in the range [16, 268435456]. bengt From ulf.wiger@REDACTED Thu Sep 1 14:12:05 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Thu, 1 Sep 2005 14:12:05 +0200 Subject: Erlang Process Limits !!! Message-ID: >From the R10B-7 readme: "The +P flag for 'erl', which sets the maximum number of processes allowed to exist at the same, no longer accepts values higher than 134217727. (You will still probably run out of memory before you'll be able to reach that limit.)" /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Bengt Kleberg > Sent: den 1 september 2005 13:57 > To: erlang-questions@REDACTED > Subject: Re: Erlang Process Limits !!! > > > On 2005-09-01 13:45, vipin wrote: > > Hello all, > > > > Is the maximum number of processes on an Erlang node a hard > limit, or is > > there the potential for this to be increased (beyond 32767)? > > from the erl (command used when starting erlang) manual page: > > +P Number: > > > Sets the maximum number of concurrent processes for > this system. By default this value is 32768. The > Number must be in the range [16, 268435456]. > > > > bengt > From joe.armstrong@REDACTED Thu Sep 1 16:17:18 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Thu, 1 Sep 2005 16:17:18 +0200 Subject: I had a dread Message-ID: I had a dream ... I had just installed Ubuntu on my machine and after four hours of struggling to get Xmodmap to understand what a tilde was, I dozed off and began dreaming I thought "I want to install yaws" I typed > apt-get install yaws The system spat back: Yaws depends upon mnesia and mnesia depends upon Erlang and Erlang depends upon stdlib, kernel and compiler all of this will occupy a piddling 3 MB on your machine shall I install it Oh great One? [Yes] I typed Y it purred back at me Fetching all these wonderful programs Installing them Everything works beautifully - shall I play some tranquil music and pour you out a Gin and Tonic - oh great One? Yes -pleeeeease .... I'm lying of course, but I could have had a dream like this. So what I did was fetch R10B-7 and typed in the magic spells "./configure; make; make install" Configure said No ncurses you moron So I said > apt-get install ncurses (or something) and configure said No ssl support you moron so I said > apt-get install openssl and configure said No java Hooray So I typed make And the system said I will make your program oh great one even though this will take a jolly long time and even though you have a spiffing new and jolly fast processor - verily thou shall wait a bugger of a long time a be entertained with a lot of strange warning messages which nobody (and I mean nobody) really understands [back to reality] If we want to spread Erlang we might like to think about how it is to be packaged. This means we must should agree on a dependency tree. Here's a shot at the dependency tree: Level 0 - Erlang base libraries stdlib kernel compiler ... Doing apt-get install stdlib gets the stdlib/*.beams and include files in stdlib Level 1 - Erlang erlang ... gets erlang the commands erl, erlc and escript now work Level 1 depends upon Level 0 - but only the necessary libraries (stdlib, kernel, compiler, etc. and not orber, .... etc. Also we have to decide what external dependencies are needed. My feeling here is yes to openssl, zlib etc. but not to other languages (java, python etc.) Level 2 - Graphics packages data bases written in or dependent upon Erlang gtkNode, mnesia, .... These depend upon Level 1 Level 3 - Apps Yaws, erlJabberd, erlguten, ... whatever Note the base level package is NOT erlang, but stdlib etc. I would expect users to start by installing applications - and for these to provided some "bangs for the buck" - ie do something fun immediately It might also be nice if we can automate a "gateway" from apt-get to erlmerge so that erl-merge packages automatically become apt-gettable! Now I do know a bit about Erlang but nothing about debian package making is what I have suggested feasible and/or desirable. How could we go about this? Do we need to make separate packagages for all the different debian based releases? Any volunteers? > -----Original Message----- > From: tobbe [mailto:tobbe@REDACTED] > Sent: den 1 september 2005 09:45 > To: erlang-questions@REDACTED > Subject: New erlmerge packages > > > > Two new erlmerge packages has now been created: iconv and dhcp. > The first one has been broken out from the esmb package and deals > with character set conversion. The latter is a DHCP > multi-client allocator, > see also: > > http://forums.trapexit.org:81/phpBB/viewtopic.php?p=17424#17424 > > Cheers, Tobbe > (Ps. Would be nice if more people would be interested in creating > erlmerge packages than just me... :-) > _________________________________________________________ > Sent using Mail2Forum (http://m2f.sourceforge.net) > From joe.armstrong@REDACTED Thu Sep 1 17:23:52 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Thu, 1 Sep 2005 17:23:52 +0200 Subject: I had a dream Message-ID: I didn't have a dread - it was dream - there was a typo in the heading /joe From mickael.remond@REDACTED Thu Sep 1 18:32:04 2005 From: mickael.remond@REDACTED (Mickael Remond) Date: Thu, 01 Sep 2005 18:32:04 +0200 Subject: I had a dread In-Reply-To: References: Message-ID: <43172D04.1030201@erlang-fr.org> Joe Armstrong (AL/EAB) wrote: > I had a dream ... > > I had just installed Ubuntu on my machine and after four hours of > struggling to get Xmodmap to understand what a tilde was, I dozed > off and began dreaming > > I thought "I want to install yaws" I typed > > > apt-get install yaws > > The system spat back: > > Yaws depends upon mnesia > and mnesia depends upon Erlang > and Erlang depends upon stdlib, kernel and compiler > all of this will occupy a piddling 3 MB on your machine > shall I install it Oh great One? [Yes] > > I typed Y it purred back at me > > Fetching all these wonderful programs > Installing them > Everything works beautifully - shall I play some tranquil music > and pour you out a Gin and Tonic - oh great One? > > Yes -pleeeeease > > .... > > I'm lying of course, but I could have had a dream like this. > > So what I did was fetch R10B-7 and typed in the magic spells > "./configure; make; make install" > > Configure said > > No ncurses you moron > > So I said > > > apt-get install ncurses (or something) > > and configure said > > No ssl support you moron > > so I said > > > apt-get install openssl > > and configure said > > No java > > Hooray > > So I typed make > > And the system said > > I will make your program oh great one > even though this will take a jolly long time > and even though you have a spiffing new and jolly fast > processor - verily thou shall wait a bugger of a long time > a be entertained with a lot of strange warning messages > which nobody (and I mean nobody) really understands > > > [back to reality] > > > If we want to spread Erlang we might like to think about > how it is to be packaged. This means we must should agree on a dependency tree. > > Here's a shot at the dependency tree: > > Level 0 - Erlang base libraries > > stdlib > kernel > compiler > ... > > Doing apt-get install stdlib > gets the stdlib/*.beams and include files in stdlib > > Level 1 - Erlang > > erlang > ... gets erlang > the commands erl, erlc and escript now work > > Level 1 depends upon Level 0 - but only the necessary libraries (stdlib, kernel, > compiler, etc. and not orber, .... etc. > > Also we have to decide what external dependencies are needed. My feeling here > is yes to openssl, zlib etc. but not to other languages (java, python etc.) > > Level 2 - Graphics packages data bases written in or dependent upon Erlang > > gtkNode, mnesia, .... > > These depend upon Level 1 > > Level 3 - Apps > > Yaws, erlJabberd, erlguten, ... whatever > > Note the base level package is NOT erlang, but stdlib etc. > > I would expect users to start by installing applications - and for these to > provided some "bangs for the buck" - ie do something fun immediately > > It might also be nice if we can automate a "gateway" from apt-get to erlmerge > so that erl-merge packages automatically become apt-gettable! > > Now I do know a bit about Erlang but nothing about debian package making > is what I have suggested feasible and/or desirable. > > How could we go about this? This is typically why we created REPOS, a complete Erlang repository of Erlang ready software ready to run, that you can install by just copying on your hard drive. It works very well and is my secret weapon for Erlang "evangelisation" (Yes, I know, you cannot download the CDROM repos ISO for now until out sites are up and running). Fortunatly, there is a mirror, if you want to give it a try: ftp://ftp.su.se/pub/mirrors/download.erlang-projects.org/repos/ Cheers, -- Micka?l R?mond From cyberlync@REDACTED Thu Sep 1 20:25:59 2005 From: cyberlync@REDACTED (Eric Merritt) Date: Thu, 1 Sep 2005 11:25:59 -0700 Subject: I had a dread In-Reply-To: <43172D04.1030201@erlang-fr.org> References: <43172D04.1030201@erlang-fr.org> Message-ID: Even with the availability of REPOS, Joe has a point. There is a bit of magic in being able to apt-get 'erlangish-foo' that you just can't get when you have to do something manually. I think that erlmerge is a huge step down this path, even though right now there only seems to be a couple of packages available and no ability to erlmerge update to the erlang distro. In general I think it would be great to have erlmerge and apt integrated, but at the very least it would be nice to have erlmerge in apt so that you could do an 'apt-get erlmerge' and then 'erlmerge erlangish-foo'. Its not optimal, but its a big step in the right direction. On 9/1/05, Mickael Remond wrote: > Joe Armstrong (AL/EAB) wrote: > > I had a dream ... > > > > I had just installed Ubuntu on my machine and after four hours of > > struggling to get Xmodmap to understand what a tilde was, I dozed > > off and began dreaming > > > > I thought "I want to install yaws" I typed > > > > > apt-get install yaws > > > > The system spat back: > > > > Yaws depends upon mnesia > > and mnesia depends upon Erlang > > and Erlang depends upon stdlib, kernel and compiler > > all of this will occupy a piddling 3 MB on your machine > > shall I install it Oh great One? [Yes] > > > > I typed Y it purred back at me > > > > Fetching all these wonderful programs > > Installing them > > Everything works beautifully - shall I play some tranquil music > > and pour you out a Gin and Tonic - oh great One? > > > > Yes -pleeeeease > > > > .... > > > > I'm lying of course, but I could have had a dream like this. > > > > So what I did was fetch R10B-7 and typed in the magic spells > > "./configure; make; make install" > > > > Configure said > > > > No ncurses you moron > > > > So I said > > > > > apt-get install ncurses (or something) > > > > and configure said > > > > No ssl support you moron > > > > so I said > > > > > apt-get install openssl > > > > and configure said > > > > No java > > > > Hooray > > > > So I typed make > > > > And the system said > > > > I will make your program oh great one > > even though this will take a jolly long time > > and even though you have a spiffing new and jolly fast > > processor - verily thou shall wait a bugger of a long time > > a be entertained with a lot of strange warning messages > > which nobody (and I mean nobody) really understands > > > > > > [back to reality] > > > > > > If we want to spread Erlang we might like to think about > > how it is to be packaged. This means we must should agree on a dependency tree. > > > > Here's a shot at the dependency tree: > > > > Level 0 - Erlang base libraries > > > > stdlib > > kernel > > compiler > > ... > > > > Doing apt-get install stdlib > > gets the stdlib/*.beams and include files in stdlib > > > > Level 1 - Erlang > > > > erlang > > ... gets erlang > > the commands erl, erlc and escript now work > > > > Level 1 depends upon Level 0 - but only the necessary libraries (stdlib, kernel, > > compiler, etc. and not orber, .... etc. > > > > Also we have to decide what external dependencies are needed. My feeling here > > is yes to openssl, zlib etc. but not to other languages (java, python etc.) > > > > Level 2 - Graphics packages data bases written in or dependent upon Erlang > > > > gtkNode, mnesia, .... > > > > These depend upon Level 1 > > > > Level 3 - Apps > > > > Yaws, erlJabberd, erlguten, ... whatever > > > > Note the base level package is NOT erlang, but stdlib etc. > > > > I would expect users to start by installing applications - and for these to > > provided some "bangs for the buck" - ie do something fun immediately > > > > It might also be nice if we can automate a "gateway" from apt-get to erlmerge > > so that erl-merge packages automatically become apt-gettable! > > > > Now I do know a bit about Erlang but nothing about debian package making > > is what I have suggested feasible and/or desirable. > > > > How could we go about this? > > This is typically why we created REPOS, a complete Erlang repository of > Erlang ready software ready to run, that you can install by just copying > on your hard drive. > It works very well and is my secret weapon for Erlang "evangelisation" > (Yes, I know, you cannot download the CDROM repos ISO for now until out > sites are up and running). > > Fortunatly, there is a mirror, if you want to give it a try: > ftp://ftp.su.se/pub/mirrors/download.erlang-projects.org/repos/ > > Cheers, > > -- > Micka?l R?mond > From kruegger@REDACTED Thu Sep 1 23:58:28 2005 From: kruegger@REDACTED (Stephen Han) Date: Thu, 1 Sep 2005 14:58:28 -0700 Subject: Erlang/OTP R10B-7 has been released In-Reply-To: References: Message-ID: <86f1f535050901145866608d41@mail.gmail.com> Why can't I find the xmerl document? On 31 Aug 2005 11:00:23 +0200, Bjorn Gustavsson wrote: > > Bug fix release : otp_src_R10B-7 > Build date : 2005-08-31 > > This is a bug fix release 7 for the R10B release. > You can download the full source distribution from > > http://www.erlang.org/download/otp_src_R10B-7.tar.gz > http://www.erlang.org/download/otp_src_R10B-7.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_R10B-7.exe > > The documentation at http://www.erlang.org will be updated. You can > also download the complete HTML documentation or the Unix manual files > > http://www.erlang.org/download/otp_doc_html_R10B-7.tar.gz > http://www.erlang.org/download/otp_doc_man_R10B-7.tar.gz > > For some OTP applications there are more detailed release notes in the > HTML documentation. > > We also want to thank those that sent us patches, suggestions and bug > reports, > > The OTP Team > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vlad_dumitrescu@REDACTED Fri Sep 2 10:46:14 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 2 Sep 2005 10:46:14 +0200 Subject: Shell prompt Message-ID: Hi all, I would like to make the default shell quiet, i.e. not print a prompt. From what I see in the code, I would need to hack either shell.erl or user.erl, which I am reluctant to do (not that it's difficult, but there's already many modules that I need to hack for erlide :-) Is there a way that I missed? If not, could it be of general interest to add an option to shell.erl so that it's more configurable? I will provide a patch. regards, Vlad From yerl@REDACTED Fri Sep 2 11:05:49 2005 From: yerl@REDACTED (yerl@REDACTED) Date: Fri, 2 Sep 2005 11:05:49 +0200 Subject: I had a dread Message-ID: An HTML attachment was scrubbed... URL: From ft@REDACTED Fri Sep 2 11:39:28 2005 From: ft@REDACTED (Fredrik Thulin) Date: Fri, 2 Sep 2005 11:39:28 +0200 Subject: proto_dist inet_ssl broken in R10B-7? Message-ID: <200509021139.28855.ft@it.su.se> Hi Is it just me, or is -proto_dist inet_ssl broken in R10B-7? R10B-6 : $ /pkg/erlang/R10B-6/bin/erl \ -proto_dist inet_ssl \ -ssl_dist_opt client_certfile cert.comb \ -ssl_dist_opt server_certfile cert.comb \ -ssl_dist_opt verify 2 \ -boot ~/path/to/R10B-6-compiled/start_ssl \ -name a Erlang (BEAM) emulator version 5.4.8 [source] [hipe] Eshell V5.4.8 (abort with ^G) (a@REDACTED)1> $ /pkg/erlang/R10B-7/bin/erl \ -proto_dist inet_ssl \ -ssl_dist_opt client_certfile cert.comb \ -ssl_dist_opt server_certfile cert.comb \ -ssl_dist_opt verify 2 \ -boot ~/path/to/R10B-7-compiled/start_ssl \ -name a R10B-7 just hangs. Same cert.comb. R10B-6 start_ssl.rel : %% Erlang OTP R10B-6 library versions %% File to get Erlang distribution using SSL started {release, {"Yxa foo","0.0"}, {erts, "5.2"}, [{kernel,"2.10.9"}, {stdlib,"1.13.8"}, {ssl, "3.0.7"} ] }. R10B-7 start_ssl.rel : %% Erlang OTP R10B-7 library versions %% File to get Erlang distribution using SSL started {release, {"Yxa foo","0.0"}, {erts, "5.2"}, [{kernel,"2.10.10"}, {stdlib,"1.13.9"}, {ssl, "3.0.7"} ] }. /Fredrik From johann.prieur@REDACTED Fri Sep 2 11:58:35 2005 From: johann.prieur@REDACTED (Johann Prieur) Date: Fri, 2 Sep 2005 11:58:35 +0200 Subject: I had a dread In-Reply-To: References: Message-ID: <3fd4e69c05090202585552ba9@mail.gmail.com> Hi! Well, some erlangish stuff are available through the Gentoo emerge system : > emerge erlang see http://packages.gentoo.org/search/?sstring=erlang for a complete list of available packages Cheers, Johann PRIEUR 3rd year computer science student INSA Rennes (France) From vlad_dumitrescu@REDACTED Fri Sep 2 14:16:25 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 2 Sep 2005 14:16:25 +0200 Subject: I had a dream References: Message-ID: Hi! It's all nice with the different tools in the different Linux distros, but it is still a dream for everybody running Windows or the "wrong" Linux distro. (Solaris too, but I suppose not many run that in a non-externally-managed environment :-) regards, Vlad From ulf.wiger@REDACTED Fri Sep 2 14:33:48 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 2 Sep 2005 14:33:48 +0200 Subject: why not export c:i/1? Message-ID: I find myself wanting to patch c.erl in orde to export the existing function i(Pids). We have an improved version of the jungerl contrib 'proc_reg', which among other things offers a filter front-end to the i() function (you choose to include or exlude registered processes based on pattern matching). The bottom line is that I want to be able to call i(Pids) using a sub-set of all pids in the system. This ought to be a reasonably useful function in large systems, and wouldn't add much in terms of support cost. I won't bother sending a patch, since it's a trivial change. /Uffe From yerl@REDACTED Fri Sep 2 15:08:34 2005 From: yerl@REDACTED (yerl@REDACTED) Date: Fri, 2 Sep 2005 15:08:34 +0200 Subject: I had a dream Message-ID: An HTML attachment was scrubbed... URL: From ke.han@REDACTED Fri Sep 2 15:54:05 2005 From: ke.han@REDACTED (ke.han) Date: Fri, 02 Sep 2005 21:54:05 +0800 Subject: I had a dream In-Reply-To: References: Message-ID: <4318597D.3010403@redstarling.com> I just did a ports install of erlang 10BR7 for freeBSD 5.4. Worked flawlessly. I also noticed that the freeBSD ports was updated the same day 10BR7 came out. Very impressive!!! I'm going to try out "hot off the presses" freeBSD 6 Beta 3 install tomorrow. Will report back. ke han Vlad Dumitrescu wrote: >Hi! > >It's all nice with the different tools in the different Linux distros, but >it is still a dream for everybody running Windows or the "wrong" Linux >distro. (Solaris too, but I suppose not many run that in a >non-externally-managed environment :-) > >regards, >Vlad > > From vlad_dumitrescu@REDACTED Fri Sep 2 16:00:51 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 2 Sep 2005 16:00:51 +0200 Subject: I had a dream References: Message-ID: Hi! Hmm, maybe I'm not looking at the right pkgmk, but how do you specify dependencies? I mean, if I have a clean machine, getting yaws should also get erlang, so that casual users don't need to know what other packages might be needed. Or so I interpreted Joe's dream ;-) /Vlad ----- Original Message ----- From: yerl@REDACTED To: erlang-questions@REDACTED Sent: Friday, September 02, 2005 3:08 PM Subject: Re: Re: I had a dream Hi! I disagree. On Crux Linux, all the install process is a very simple shell script called pkgmk. You can use it (with minor changes or as it is) on Windows/Cygwin, Solaris, AIX or any Unix system. For Windows users without a shell, I'm really sorry. But there is a lot of automating tools you can use to achieve the same degree of simplicity. /ycrux ----Message d'origine---- >De: "Vlad Dumitrescu" >A: >Sujet: Re: I had a dream >Date: Fri, 2 Sep 2005 14:16:25 +0200 > >Hi! > >It's all nice with the different tools in the different Linux distros, but >it is still a dream for everybody running Windows or the "wrong" Linux >distro. (Solaris too, but I suppose not many run that in a >non-externally-managed environment :-) > >regards, >Vlad > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yerl@REDACTED Fri Sep 2 16:11:53 2005 From: yerl@REDACTED (yerl@REDACTED) Date: Fri, 2 Sep 2005 16:11:53 +0200 Subject: I had a dream Message-ID: An HTML attachment was scrubbed... URL: From mickael.remond@REDACTED Fri Sep 2 17:25:28 2005 From: mickael.remond@REDACTED (=?ISO-8859-1?Q?Micka=EBl_R=E9mond?=) Date: Fri, 2 Sep 2005 17:25:28 +0200 Subject: I had a dread In-Reply-To: References: <43172D04.1030201@erlang-fr.org> Message-ID: <3316293C-0477-4948-B4D5-D842D636BABB@erlang-fr.org> Le 1 sept. 05 ? 20:25, Eric Merritt a ?crit : > Even with the availability of REPOS, Joe has a point. There is a bit > of magic in being able to apt-get 'erlangish-foo' that you just can't > get when you have to do something manually. I think that erlmerge is a > huge step down this path, even though right now there only seems to be > a couple of packages available and no ability to erlmerge update to > the erlang distro. > In general I think it would be great to have erlmerge and apt > integrated, but at the very least it would be nice to have erlmerge in > apt so that you could do an 'apt-get erlmerge' and then 'erlmerge > erlangish-foo'. Its not optimal, but its a big step in the right > direction. The main problem is that each distro has its own tool: apt-get, urpmi, yum, yast, emerge, and so on. erlmerge is a step is a good directory as it sits on top of the system package manage. This is what Perl is doing with CPAN. Distribution providers have to support base Erlang module and the other ones are supported by an Erlang native tool. One problem remains and is non trivial: how to support Erlang application that rely on binary modules ? This is even less trivial when you have a multiplatform environment like Erlang that run on various operating systems: Linux, *BSD, *Nix, Windows, MacOSX. What we are doing with REPOS is a hard job a precompiling all the native stuff, to have everything for all platforms (not all but as many as we can) ? This is not perfect at all, but is also a good start. Maybe merging REPOS effort with Erlmerge could lead to interesting and practical results. -- Micka?l R?mond From kruegger@REDACTED Fri Sep 2 23:42:37 2005 From: kruegger@REDACTED (Stephen Han) Date: Fri, 2 Sep 2005 14:42:37 -0700 Subject: debugger and try/catch Message-ID: <86f1f53505090214425453b31f@mail.gmail.com> I am using erlang 5.4.9 on Windows 2000. Whenever I add the module which contains try-catch block, I see debugger print out bunch of numbers on the erlang shell and got crashed. Is "try" supported by debugger? -module(t1). -compile(export_all). start() -> try throw ({hello}) catch hello -> world end. -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Sat Sep 3 00:05:38 2005 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 02 Sep 2005 18:05:38 -0400 Subject: debugger and try/catch In-Reply-To: <86f1f53505090214425453b31f@mail.gmail.com> References: <86f1f53505090214425453b31f@mail.gmail.com> Message-ID: <4318CCB2.9080706@hq.idt.net> No it's not supported yet. If you search the mailing list this issue has been reported several times. Serge Stephen Han wrote: > I am using erlang 5.4.9 on Windows 2000. > Whenever I add the module which contains try-catch block, I see debugger > print out bunch of numbers on the erlang shell and got crashed. > Is "try" supported by debugger? > > > -module(t1). > > -compile(export_all). > > start() -> > try > throw ({hello}) > catch > hello -> > world > end. From kruegger@REDACTED Sat Sep 3 00:40:23 2005 From: kruegger@REDACTED (Stephen Han) Date: Fri, 2 Sep 2005 15:40:23 -0700 Subject: debugger and try/catch In-Reply-To: <4318CCB2.9080706@hq.idt.net> References: <86f1f53505090214425453b31f@mail.gmail.com> <4318CCB2.9080706@hq.idt.net> Message-ID: <86f1f5350509021540297fd449@mail.gmail.com> Oh. oh.. sorry should have searched the mailling list before I post it. Thanks On 9/2/05, Serge Aleynikov wrote: > > No it's not supported yet. If you search the mailing list this issue > has been reported several times. > > Serge > > Stephen Han wrote: > > I am using erlang 5.4.9 on Windows 2000. > > Whenever I add the module which contains try-catch block, I see debugger > > print out bunch of numbers on the erlang shell and got crashed. > > Is "try" supported by debugger? > > > > > > -module(t1). > > > > -compile(export_all). > > > > start() -> > > try > > throw ({hello}) > > catch > > hello -> > > world > > end. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From orbitz@REDACTED Sat Sep 3 01:21:10 2005 From: orbitz@REDACTED (orbitz@REDACTED) Date: Fri, 2 Sep 2005 19:21:10 -0400 Subject: Shell prompt In-Reply-To: References: Message-ID: <845679835e5bb163453841b728312b1f@ezabel.com> Do you mean: erl -noshell ? On Sep 2, 2005, at 4:46 AM, Vlad Dumitrescu wrote: > Hi all, > > I would like to make the default shell quiet, i.e. not print a prompt. > From > what I see in the code, I would need to hack either shell.erl or > user.erl, > which I am reluctant to do (not that it's difficult, but there's > already > many modules that I need to hack for erlide :-) > > Is there a way that I missed? > > If not, could it be of general interest to add an option to shell.erl > so > that it's more configurable? I will provide a patch. > > regards, > Vlad > From vlad_dumitrescu@REDACTED Sat Sep 3 18:18:52 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Sat, 3 Sep 2005 18:18:52 +0200 Subject: Shell prompt References: <845679835e5bb163453841b728312b1f@ezabel.com> Message-ID: No, the -noshell option starts no shell, while I need one, just silent. I need to be able to enter things as usual, and I neet to receive any printouts from for example erlang:display or error:logger. /Vlad ----- Original Message ----- From: > Do you mean: > erl -noshell > ? > >> I would like to make the default shell quiet, i.e. not print a prompt. >> From >> what I see in the code, I would need to hack either shell.erl or >> user.erl, >> which I am reluctant to do (not that it's difficult, but there's already >> many modules that I need to hack for erlide :-) >> >> Is there a way that I missed? From orbitz@REDACTED Sat Sep 3 20:14:52 2005 From: orbitz@REDACTED (orbitz@REDACTED) Date: Sat, 3 Sep 2005 14:14:52 -0400 Subject: Shell prompt In-Reply-To: References: <845679835e5bb163453841b728312b1f@ezabel.com> Message-ID: Well I hate to not really answer your question but, why is not having a shell so important to this? You are going to enter data and get data back regardless so what differences does alittle prompt make? On Sep 3, 2005, at 12:18 PM, Vlad Dumitrescu wrote: > No, the -noshell option starts no shell, while I need one, just > silent. I need to be able to enter things as usual, and I neet to > receive any printouts from for example erlang:display or error:logger. > > /Vlad > > ----- Original Message ----- From: >> Do you mean: >> erl -noshell >> ? >> >>> I would like to make the default shell quiet, i.e. not print a >>> prompt. From >>> what I see in the code, I would need to hack either shell.erl or >>> user.erl, >>> which I am reluctant to do (not that it's difficult, but there's >>> already >>> many modules that I need to hack for erlide :-) >>> >>> Is there a way that I missed? > From vlad_dumitrescu@REDACTED Sat Sep 3 20:44:40 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Sat, 3 Sep 2005 20:44:40 +0200 Subject: Shell prompt References: <845679835e5bb163453841b728312b1f@ezabel.com> Message-ID: > Well I hate to not really answer your question but, why is not having a > shell so important to this? You are going to enter data and get data back > regardless so what differences does alittle prompt make? It's a perfectly reasonable question to ask :-) The answer is quite long, so bear with me... I need this for use with ErlIde. I had a requirement that the Erlang backend should not be distributed. This means the Java part can't be a hidden node, but must use rpc via a socket. All well and nice, but for the rpc mechanism isn't part of the distribution, so it has to be loaded into the runtime before use. The problem is that Eclipse plugins are jar archives, and the beam files are inside that archive. Erlang can't load them from there, so they have to be fed somehow in some other way. The solution I use is that I use the default console. It works fine, but when loading the bootstrapping code, the console displays spurious messages like {module, foo} and the first prompt is "4>" instead of "1>". To get rid of those artifacts, I use the reshd package, starting a new shell to use, but then any erlang:display or error_logger output still goes to the default console. So I capture that output too - and guess what? After each such output there's still a "4>" (or similar)... So instead of filtering it in a brutal way, I thought I'd ask if it can be removed in a clean manner. Does that answer your question? :-) regards, Vlad From devfunctional@REDACTED Sun Sep 4 11:35:17 2005 From: devfunctional@REDACTED (Dev Functional) Date: Sun, 4 Sep 2005 15:05:17 +0530 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> Message-ID: Hello all I would sincerely like to thank all of the people who responsded to my mail. Here are the details of the discussion and decisions made. 1) It was pointed out that while each language will have merits and strength, however, together they would have both interop (performance) and maintenance issues. 2) It was stated that it is better to fight with the nuances of one language, rather than drool on the strength of each of them independently and then face licensing issues, interop issues, performance issues, support issues , not to speak of the maintenance. 3) It was pointed out that today even Ericcsson does not use Erlang for its new product development. Why ? 4) The following products of Ericcsson are written in C++ TelORB distributed RAM database, the base for the TSP application server platform TDMA-CDMA HLR GSM-TDMA-CDMA mobility gateway AAA server. 5) It was pointed out that clisp has GPL licensing and no money should be wasted on acquiring software licenses (eg. Franz) 6) It was pointed out that Prolog, CLISP are themselves interested in C ! So, if there is a smart idea present eg. backtracking, we can see the implementation and use it in the code. There is no need to take the complete load of the language, since we don't want all the features any way. 7) RPC and message passing related weakness in Erlang can cause security vulnerability issues. 8) High performance in computation, high responsiveness in network i/o, aync and disk i/o is mandatory. The performance slide related to yaws was mentioned and the management wondered why the world hasn't moved on to yaws by ditching oh-so-slow Apache ? 8) The management has decided to organize 4 week long formal rigorous training in C++ and Template Programming. There will be sessions in competency building in tools like gprof, gdb, g++4, gcc4 etc. 9) The decision has been taken by the management and the tools to be used are - C++ (user land), g++4 - C (kernel land) gcc4 - STL - Boost Library There is no license fees to be paid to anybody. 10) All storage related standards have types defined in C and it makes sense to have the programmatic representation as close as possible to the standard. 11) The management also highlighted that if the languages so far used (prolog,lisp,erlang) were so great then the capitalists would have grabbed them up long time ago and made lots of money by now by developing and selling products. So, either the capitalists are fools or the current development team ! It was also pointed out that Google does lot of work related to information retrieval, inference, distributed computing over thousands of compute nodes but does not use Erlang ! Why ? In the final analysis, the project will proceed with the above made decisions and I will need to abide by these decisions if I am to keep my job. Once again thanks to all the people on this list, who tried to help me out. thanks Dev. From ulf@REDACTED Sun Sep 4 13:52:29 2005 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 04 Sep 2005 13:52:29 +0200 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> Message-ID: Den 2005-09-04 11:35:17 skrev Dev Functional : > 3) It was pointed out that today even Ericcsson does not use Erlang for > its > new product development. Why ? Ericsson has never used Erlang for *all* it's product development. We're doing more Erlang-based stuff now than we have in a long time. You'll have to wait a while for some official announcements, though. > 4) The following products of Ericcsson are written in C++ > TelORB > distributed RAM database, the base for the TSP application > server platform > TDMA-CDMA HLR > GSM-TDMA-CDMA mobility gateway > AAA server. Yes, they are. I could name a few others, too. (: /Uffe -- Ulf Wiger From david.nospam.hopwood@REDACTED Sun Sep 4 14:33:38 2005 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Sun, 04 Sep 2005 13:33:38 +0100 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> Message-ID: <431AE9A2.6090104@blueyonder.co.uk> Dev Functional wrote: > 8) The management has decided to organize 4 week long formal rigorous training > in C++ and Template Programming. You have my heartfelt sympathies. -- David Hopwood From mickael.remond@REDACTED Sun Sep 4 14:35:55 2005 From: mickael.remond@REDACTED (=?ISO-8859-1?Q?Micka=EBl_R=E9mond?=) Date: Sun, 4 Sep 2005 14:35:55 +0200 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> Message-ID: Hello, Le 4 sept. 05 ? 11:35, Dev Functional a ?crit : > 3) It was pointed out that today even Ericcsson does not use > Erlang for its > new product development. Why ? Ulf already answers on this one and this seems to be a wrong statement, now. > 7) RPC and message passing related weakness in Erlang can cause > security > vulnerability issues. ? This is a very surprising statement ? Do you know why they are saying that ? > 8) High performance in computation, high responsiveness in network > i/o, > aync and disk i/o is mandatory. > > The performance slide related to yaws was mentioned and the > management > wondered why the world hasn't moved on to yaws by ditching > oh-so-slow Apache ? Why would they do so if they have a solution that satisfy their needs ? This is the same with all legacy technology. Some enterprise still run Cobol applications. They do not rewrite it in another technology because it cost money. The decision is different for new project however and we are using Yaws for our new web development projects. This is always the kind of argument stated to refuse to consider new technologies. Most of the time, there is nothing to do about it, as it depends on the company culture and strategy. Some companies are early adopters and use technology as a way to make better product in a way that make them very different from their competitors. Other are only using established/legagy technology because they do not feel this a key element and are more afraid of failure than attracted by success. This is often a management decision and you cannot argue with technical arguments as this is seen as a strategic matter. > It was also pointed out that Google does lot of work related to > information > retrieval, inference, distributed computing over thousands of > compute nodes > but does not use Erlang ! Why ? Same reasons probably here. I would add that some company are using Erlang but do not tell it. I know a very very big dotcom company (not Google) that is using Erlang but insists no keeping this secret. > 11) The management also highlighted that if the languages so far used > (prolog,lisp,erlang) > were so great then the capitalists would have grabbed them up > long time ago > and made lots of money by now by developing and selling > products. > So, either the capitalists are fools or the current > development team ! They have. Both Lisp and Erlang are interesting as this is two languages that have been use to built success-story company (Viaweb for Lisp and Bluetail for Erlang). Other companies are using Erlang as a strategic technology. To understand how good a different technology can be for a company you should read Paul Graham's essays (For example, "The other road ahead", http://www.paulgraham.com/road.html, or "Beating the average", http://www.paulgraham.com/avg.html) > In the final analysis, the project will proceed with the above made > decisions > and I will need to abide by these decisions if I am to keep my job. Yes. As Joe Armstrong often explains it, the best way to introduce Erlang is to offer an alternative on a failing project (See for example Lessons learnt: http://www.cs.chalmers.se/~rjmh/Armstrong/ bits.ps) Anyway, good luck with your future projects, -- Micka?l R?mond From mickael.remond@REDACTED Sun Sep 4 16:05:20 2005 From: mickael.remond@REDACTED (=?ISO-8859-1?Q?Micka=EBl_R=E9mond?=) Date: Sun, 4 Sep 2005 16:05:20 +0200 Subject: Notice: several Erlang server problem In-Reply-To: <6B4BCF4D-D4F8-403F-A3B3-D0839A9601A5@erlang-fr.org> References: <6B4BCF4D-D4F8-403F-A3B3-D0839A9601A5@erlang-fr.org> Message-ID: <6CA72D64-1142-45E6-8F43-BF5EE15ABB4D@erlang-fr.org> Hello, Le 1 sept. 05 ? 08:53, Micka?l R?mond a ?crit : > We are working to make Dell go onsite to fix the problem as soon as > possible and get everything back online. > Sorry for the inconvenience (This concern erlang-projects.org, > planeterlang.org, erlang-foundation.org and several others sites) Service has been partially back online since Friday. After some tests, all sites should now work. Sorry for the inconvenience, -- Micka?l R?mond From serge@REDACTED Sun Sep 4 17:26:59 2005 From: serge@REDACTED (Serge Aleynikov) Date: Sun, 04 Sep 2005 11:26:59 -0400 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> Message-ID: <431B1243.6060206@hq.idt.net> It sounds regretful, yet from your initial post it looked like the managerial decision had already been made influenced by recommendations outside of your technical team. It is very difficult to steer management decision in the right direction, unless you have a lot of respect from them or a lot of money (and/or reputation). Otherwise all you have left is to abide their rules. From the statements below it is clear that the decision was made by people who were never involved in maintenance of medium/large projects developed in C++, and therefore they didn't realize the cost of the infrastructure needed to support such projects. Others may have a different view on this, but in my opinion the main weakness in C++ development is not so much the cost of development but the cost of maintenance. It is rare that the same people who developed the system in the first place (and hopefully followed some uniform coding standards) will be assigned to support the product. As your product evolves and you need to support more platforms the cost of finding bugs in C++ code is high, and eventually the code will evolve to be unmanageable, and it'll take a lot of time (and money) for a new developer introduced to the team to comprehend the system and be useful. On the other hand I don't know the details of your project, perhaps it is small, in which case C++ could be a suitable language. Yet in any event, from the management point of view it doesn't sound wise to completely ignore the opinion of their employees. If they only allowed you to make certain development choices, your team would be much more enthusiastic about solving the problem, and be rewarded by having management's respect. Serge Dev Functional wrote: > Hello all > > I would sincerely like to thank all of the people who responsded to my mail. > > Here are the details of the discussion and decisions made. > > 1) It was pointed out that while each language will have merits and strength, > however, together they would have both interop (performance) and > maintenance > issues. > > 2) It was stated that it is better to fight with the nuances of one language, > rather than drool on the strength of each of them independently and > then face licensing issues, interop issues, performance issues, support > issues , not to speak of the maintenance. > > 3) It was pointed out that today even Ericcsson does not use Erlang for its > new product development. Why ? > > 4) The following products of Ericcsson are written in C++ > TelORB > distributed RAM database, the base for the TSP application > server platform > TDMA-CDMA HLR > GSM-TDMA-CDMA mobility gateway > AAA server. > > 5) It was pointed out that clisp has GPL licensing and no money should be > wasted on acquiring software licenses (eg. Franz) > > 6) It was pointed out that Prolog, CLISP are themselves interested in C ! > So, if there is a smart idea present eg. backtracking, we can see the > implementation and use it in the code. There is no need to take > the complete > load of the language, since we don't want all the features any way. > > 7) RPC and message passing related weakness in Erlang can cause security > vulnerability issues. > > 8) High performance in computation, high responsiveness in network i/o, > aync and disk i/o is mandatory. > > The performance slide related to yaws was mentioned and the management > wondered why the world hasn't moved on to yaws by ditching > oh-so-slow Apache ? > > 8) The management has decided to organize 4 week long formal rigorous training > in C++ and Template Programming. There will be sessions in competency > building in tools like gprof, gdb, g++4, gcc4 etc. > > 9) The decision has been taken by the management and the tools to be used are > - C++ (user land), g++4 > - C (kernel land) gcc4 > - STL > - Boost Library > There is no license fees to be paid to anybody. > > 10) All storage related standards have types defined in C and it makes sense > to have the programmatic representation as close as possible to > the standard. > > 11) The management also highlighted that if the languages so far used > (prolog,lisp,erlang) > were so great then the capitalists would have grabbed them up > long time ago > and made lots of money by now by developing and selling products. > So, either the capitalists are fools or the current development team ! > > It was also pointed out that Google does lot of work related to > information > retrieval, inference, distributed computing over thousands of > compute nodes > but does not use Erlang ! Why ? > > In the final analysis, the project will proceed with the above made decisions > and I will need to abide by these decisions if I am to keep my job. > > Once again thanks to all the people on this list, who tried to help me out. > > thanks > Dev. > From david.nospam.hopwood@REDACTED Sun Sep 4 18:26:30 2005 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Sun, 04 Sep 2005 17:26:30 +0100 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: <431B1243.6060206@hq.idt.net> References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> <431B1243.6060206@hq.idt.net> Message-ID: <431B2036.1040606@blueyonder.co.uk> Serge Aleynikov wrote: > It sounds regretful, yet from your initial post it looked like the > managerial decision had already been made influenced by recommendations > outside of your technical team. It is very difficult to steer > management decision in the right direction, unless you have a lot of > respect from them or a lot of money (and/or reputation). Otherwise all > you have left is to abide their rules. > > From the statements below it is clear that the decision was made by > people who were never involved in maintenance of medium/large projects > developed in C++, and therefore they didn't realize the cost of the > infrastructure needed to support such projects. Indeed. This will be more expensive than the cross-language integration issues would have been (even if you had stuck with three languages rather than moving the Prolog stuff to Lisp or Erlang). Dev Functional wrote: >> 10) All storage related standards have types defined in C and it >> makes sense to have the programmatic representation as close as >> possible to the standard. While it does make sense to have a (not necessarily "the") programmatic representation as close as possible to the format specification, C/C++ types do not provide this: the byte order and alignment/padding is implementation-defined, so you have to write code that manually converts between a C structure and an external format if you want portability (or correctness, in some cases). Erlang bitfields, OTOH, do allow you to directly reflect the format specification at the language level. I know that doesn't really help much at this point. >> 11) The management also highlighted that if the languages so far used >> (prolog,lisp,erlang) were so great then the capitalists would have >> grabbed them up long time ago and made lots of money by now by >> developing and selling products. So, either the capitalists are >> fools or the current development team ! If I had been at the meeting, at this point I would probably have made some comment that would have got me fired. -- David Hopwood From thomasl_erlang@REDACTED Sun Sep 4 18:55:48 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Sun, 4 Sep 2005 09:55:48 -0700 (PDT) Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: Message-ID: <20050904165548.35298.qmail@web34407.mail.mud.yahoo.com> --- Dev Functional wrote: > In the final analysis, the project will proceed with > the above made decisions > and I will need to abide by these decisions if I am > to keep my job. Sorry to hear that. It seems like your managers prefer to follow the herd in their technology choices, so possibly this choice was really a social one, not a technological one. The arguments against Erlang above are basically a cry for some more courageous company to show the way. But on the bright side, maybe you can prototype in Erlang next time too. If your company is large enough, volunteer to join or form the prototyping group :-) Good luck. Best, Thomas ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs From francesco@REDACTED Sun Sep 4 19:19:09 2005 From: francesco@REDACTED (Francesco Cesarini (Erlang Training & Consulting)) Date: Sun, 04 Sep 2005 18:19:09 +0100 Subject: Erlang & AI Message-ID: <431B2C8D.9000106@erlang-consulting.com> For years, I have been saying that Erlang is a perfect language for certain types of AI applications. From self-modifying code for the sadomasochistic programmers in us to functions returning funs. With the thread on (Prolog + LISP + Erlang) with integration issues versus C++, I am happy to say that it is slowly happening... At the ACM SIGPLAN Erlang workshop in Tallinn, ERESYE will be presented. It stands for Artificial Intelligence in Erlang Programs. Even more interesting, however, is the fact that the IT University in (A part of Chalmers) has now adopted Erlang over more classical AI languages (LISP, Prolog, etc) as a tool to teach the subject, with very interesting labs and projects in the pipeline. About time, if you ask me... Francesco -- http://www.erlang-consulting.com From joelr1@REDACTED Sun Sep 4 19:52:04 2005 From: joelr1@REDACTED (Joel Reymont) Date: Sun, 4 Sep 2005 19:52:04 +0200 Subject: Erlang & AI Message-ID: Strange choice. How would you write self-modifying code in Erlang? On Sep 4, 2005, at 7:19 PM, Francesco Cesarini (Erlang Training & Consulting) wrote: > From self-modifying code for the sadomasochistic programmers in us > to functions returning funs. With the thread on (Prolog + LISP + > Erlang) with integration issues versus C++, I am happy to say that > it is slowly happening... From ulf@REDACTED Sun Sep 4 21:40:50 2005 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 04 Sep 2005 21:40:50 +0200 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> Message-ID: Wild guess, but... Basically, since your management started interfering based on advice from a close friend of the VP, any justification beyond that point will serve mainly to cloud the fact that the decision was made irrationally in the first place (or, more precisely, irrationally from the company's point of view, as it was mainly self-serving and not necessarily in the best interest of the company.) Once you start suspecting that, it's best to bail out of the debate, since the arguments in favour of the decision will be tempting to attack -- and attacking them is likely to hurt your career in the company. You need to have very powerful friends, an excellent case, and extreme motivation to take on upper management and try to expose their incompetence in a specific case. (They may not even be incompetent -- I'm sure all managers once in a while move too fast on some issue, and find out later that they had trusted the wrong advisor. Once they do, they still have to figure out what's worse: having their bad judgement exposed, which means they lose authority, or go with a less-than-optimal decision? In order _not_ to lose face, you have to carefully establish a leadership style where you own up to your mistakes and change your mind publicly and honestly when needed. This takes a lot of natural authority, if you're to pull it own. You can't fake it.) Still, let's succumb to the temptation and attack those arguments, shall we? ;) Den 2005-09-04 11:35:17 skrev Dev Functional : > 1) It was pointed out that while each language will have merits and > strength, however, together they would have both interop (performance) > and maintenance issues. a) the only way to establish that there are performance issues is to measure. Most likely, in a modular system written in C++, you will split the application into several unix processes, using socket or pipe communication between them, which will put you in roughly the same dilemma. If you don't, you may well run into maintenance issues with different threads vying for the same memory -- whose solution may well lead to performance problems, as you start calling by value rather than by reference, and putting in more semaphores than you actually need. Another common issue with C++ development projects where teams have to interop, is that they gradually move into a situation where each subsystem has its own class structure, and marshalling is done in the subsystem interfaces -- leading to lots of copying and restructuring of data. As Serge pointed out, many ambitious C++ projects suffer severe rot during maintenance. > 2) It was stated that it is better to fight with the nuances of one > language, rather than drool on the strength of each of them > independently and then face licensing issues, interop issues, > performance issues, support issues, not to speak of the > maintenance. "Drool"? If those were the very words used, I'd say your management has an attitude problem towards its engineers. Still, it was pointed out in this forum as well, that going with one of the languages Erlang, Lisp, Prolog, might be a better solution than using all three. > > 3) It was pointed out that today even Ericcsson does not use Erlang > for its new product development. Why ? I've answered this. For a more detailed answer, read Bjarne D?cker's excellent thesis "[Erlang] - A Case Study of Technology Introduction" (http://www.erlang.org/cslab/publications/bjarnelic.pdf) > 6) It was pointed out that Prolog, CLISP are themselves > [implemented] in C! So, if there is a smart idea present > eg. backtracking, we can see the implementation and use > it in the code. There is no need to take the complete > load of the language, since we don't want all the features > any way. Not really worthy of comment. Whoever said that cannot have looked inside e.g. a Prolog evaluator or e.g. the Erlang VM. Sure you can find small bits of code to reuse... but they clearly don't know what they're talking about in this regard. (For the record, I haven't looked inside a Prolog evaluator either). > The performance slide related to yaws was mentioned and the > management wondered why the world hasn't moved on to yaws by > ditching oh-so-slow Apache ? So they start by saying that performance is important; you show them that good performance is attainable; they respond by saying (in a word) performance is not that important after all? > 8) The management has decided to organize 4 week long formal rigorous > training in C++ and Template Programming. Four weeks is a start, but will not be nearly enough. > 9) The decision has been taken by the management and the tools to be > used are > - C++ (user land), g++4 > - C (kernel land) gcc4 > - STL > - Boost Library > There is no license fees to be paid to anybody. Only consultant fees etc. to some good friend of the boss. ;-) > 11) The management also highlighted that if the languages > so far used (prolog,lisp,erlang) were so great then > the capitalists would have grabbed them up long time > ago and made lots of money by now by developing and > selling products. What a wonderful metric! > So, either the capitalists are fools or the current > development team ! Again, your management seems to have an attitude problem! And no, venture capitalists are usually not fools. They are usually not software engineers either. And among those who recognize and love the strengths of those tools, very few know how to talk to a venture capitalist. > It was also pointed out that Google does lot of work related to > information retrieval, inference, distributed computing over > thousands of compute nodes but does not use Erlang ! Why ? Who knows? Maybe they do use Erlang (to my knowledge they don't) > In the final analysis, the project will proceed with the above > made decisions and I will need to abide by these decisions > if I am to keep my job. You will still need stuff like test rigs, simulators, etc. There may be pockets where you can apply some fun engineering as long as you don't make a big deal out of it. Good luck. Getting pounced on is never fun, but if you insist on using great technology, it's bound to happen every once in a while. Many of us have been there. (: /Uffe -- Ulf Wiger From james.hague@REDACTED Sun Sep 4 23:21:05 2005 From: james.hague@REDACTED (James Hague) Date: Sun, 4 Sep 2005 16:21:05 -0500 Subject: Erlang & AI In-Reply-To: References: Message-ID: On 9/4/05, Joel Reymont wrote: > Strange choice. How would you write self-modifying code in Erlang? Most of the time when someone says "self modifying code" in regard to AI, they simply mean manipulating code as an abstract syntax tree, then generating program text from that tree which can be compiled and loaded on the fly. Lisp has the advantage here, because the AST and program text can be identical, but this is easy enough to do in Erlang or any other language where you can call the compiler and reload code from a running program. From david.nospam.hopwood@REDACTED Sun Sep 4 23:53:27 2005 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Sun, 04 Sep 2005 22:53:27 +0100 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> Message-ID: <431B6CD7.6020200@blueyonder.co.uk> Ulf Wiger wrote: >> 3) It was pointed out that today even Ericcsson does not use Erlang >> for its new product development. Why ? > > I've answered this. For a more detailed answer, read Bjarne D?cker's > excellent thesis "[Erlang] - A Case Study of Technology Introduction" > (http://www.erlang.org/cslab/publications/bjarnelic.pdf) : # CSLab was formally established on March 1, 1984, and closed down on # June 30, 2002. However the thesis appears to be still available at (linked from ). There is some discussion of it at . -- David Hopwood From devfunctional@REDACTED Mon Sep 5 05:12:41 2005 From: devfunctional@REDACTED (Dev Functional) Date: Mon, 5 Sep 2005 08:42:41 +0530 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> Message-ID: On 9/4/05, Micka?l R?mond wrote: > > > They have. Both Lisp and Erlang are interesting as this is two > languages that have been use to built success-story company (Viaweb > for Lisp and Bluetail for Erlang). Other companies are using Erlang > as a strategic technology. > To understand how good a different technology can be for a company > you should read Paul Graham's essays (For example, "The other road > ahead", http://www.paulgraham.com/road.html, or "Beating the > average", http://www.paulgraham.com/avg.html) > > Yes, I did quote PG essays and http://wiki.alu.org/Evaluate_Lisp . The management responded by saying that this is self-serving argument and doesn't cut with thousands of very successful products implemented in C++. Additionally, all storage software companies write C/C++ programs. So, if they were to get fresh talent with storage domain knowledge, then even the current C++ training would be unnecessary. thanks Dev. From devfunctional@REDACTED Mon Sep 5 05:14:22 2005 From: devfunctional@REDACTED (Dev Functional) Date: Mon, 5 Sep 2005 08:44:22 +0530 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: <431AE9A2.6090104@blueyonder.co.uk> References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> <431AE9A2.6090104@blueyonder.co.uk> Message-ID: On 9/4/05, David Hopwood wrote: > Dev Functional wrote: > > 8) The management has decided to organize 4 week long formal rigorous training > > in C++ and Template Programming. > > You have my heartfelt sympathies. > > -- > David Hopwood > I suspect, the team will be laid off shortly and 4-weeks is just a buy-off time. thanks Dev. From orbitz@REDACTED Mon Sep 5 05:44:38 2005 From: orbitz@REDACTED (orbitz@REDACTED) Date: Sun, 4 Sep 2005 23:44:38 -0400 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: <431B6CD7.6020200@blueyonder.co.uk> References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> <431B6CD7.6020200@blueyonder.co.uk> Message-ID: Another nice article on the benefits using more expressive languages: http://www.paulgraham.com/power.html Coincidentally i got this page from another article and Mr. Wiger is mentioned which made me think of this thread. He is quite the superstar! On Sep 4, 2005, at 5:53 PM, David Hopwood wrote: > Ulf Wiger wrote: >>> 3) It was pointed out that today even Ericcsson does not use Erlang >>> for its new product development. Why ? >> I've answered this. For a more detailed answer, read Bjarne D?cker's >> excellent thesis "[Erlang] - A Case Study of Technology Introduction" >> (http://www.erlang.org/cslab/publications/bjarnelic.pdf) > > : > > # CSLab was formally established on March 1, 1984, and closed down on > # June 30, 2002. > > However the thesis appears to be still available at > > > (linked from ). > > There is some discussion of it at > . > > -- > David Hopwood > From devfunctional@REDACTED Mon Sep 5 05:46:23 2005 From: devfunctional@REDACTED (Dev Functional) Date: Mon, 5 Sep 2005 09:16:23 +0530 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> Message-ID: Hello Ulf Thanks for taking out time to write this mail. On 9/5/05, Ulf Wiger wrote: > > Wild guess, but... > > Basically, since your management started interfering based > on advice from a close friend of the VP, any justification > beyond that point will serve mainly to cloud the fact that > the decision was made irrationally in the first place (or, > more precisely, irrationally from the company's point of > view, as it was mainly self-serving and not necessarily in > the best interest of the company.) > > Once you start suspecting that, it's best to bail out of > the debate, since the arguments in favour of the decision > will be tempting to attack -- and attacking them is likely > to hurt your career in the company. You need to have very > powerful friends, an excellent case, and extreme motivation > to take on upper management and try to expose their > incompetence in a specific case. > > (They may not even be incompetent -- I'm sure all managers > once in a while move too fast on some issue, and find out > later that they had trusted the wrong advisor. Once they do, > they still have to figure out what's worse: having their > bad judgement exposed, which means they lose authority, > or go with a less-than-optimal decision? In order _not_ to > lose face, you have to carefully establish a leadership style > where you own up to your mistakes and change your mind > publicly and honestly when needed. This takes a lot of natural > authority, if you're to pull it own. You can't fake it.) > To tell the truth, the arguments were quite intense and at times heated. We met three times during the day as a discussion did not seem possible in one go. > > > > 2) It was stated that it is better to fight with the nuances of one > > language, rather than drool on the strength of each of them > > independently and then face licensing issues, interop issues, > > performance issues, support issues, not to speak of the > > maintenance. > > "Drool"? If those were the very words used, I'd say your management > has an attitude problem towards its engineers. > To quote, "Figure out C++, rather than drooling on Err-lang (mistake of language), Pro(log), cli(sp) and mumba jumba. Why do ya' guys want to sink this company ? Your Lead, has already made a fool of himself by immersing himself in this spaghetti!" > > > > > 3) It was pointed out that today even Ericcsson does not use Erlang > > for its new product development. Why ? > > I've answered this. For a more detailed answer, read Bjarne D?cker's > excellent thesis "[Erlang] - A Case Study of Technology Introduction" > (http://www.erlang.org/cslab/publications/bjarnelic.pdf) > Unfortunately, the Thesis also highlights Ericsson's decision to do things in C++ (rather than Erlang). The moment I mentioned this in the discussion, a 1 page printout of the specific page from the thesis was shoved on my face. To quote, "Huh ? Why this ? Has somebody paid you to do this to us ? Rather than wasting time on defending some bag of exotic languages, why don't you focus on taking the project ahead ? You are the lead, aren't you ? Why are you behind ?" > > > Good luck. Getting pounced on is never fun, but if you > insist on using great technology, it's bound to happen > every once in a while. Many of us have been there. (: > The junior dev's have agreed to participate in C++ training. The management talked to them about "future employability" and importance of having main-stream skillsets. Who will hire a lisp(er) [with a slant on stuttering (sic)] or an (err)lang(err) was their refrain ? Mostly, I am on my way out. Apologize to all the esteemed members of this list for this non-technical mail. kind regards Dev. From ok@REDACTED Mon Sep 5 07:04:59 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 5 Sep 2005 17:04:59 +1200 (NZST) Subject: (Prolog + LISP + Erlang) with integration issues versus C++ Message-ID: <200509050504.j8554xnY111725@atlas.otago.ac.nz> Dev Functional wrote: Here are the details of the discussion and decisions made. They are not Dev Functional's ideas, so when I attack them I mean no disrespect to Dev Functional. 1) It was pointed out that while each language will have merits and strength, however, together they would have both interop (performance) and maintenance issues. *ANYTHING* is going to have maintenance issues. And if a system has multiple components, it is certain to have interoperability issues (which are not the same as performance issues). And any system is going to have performance issues. The point is that all of this is meaningless shouting into the wind without a serious cost estimation. And the costs of using C++ are far higher than most people realise. One of my favourite little books is Taming the Tiger: Software Engineering and Software Economics by Leon S. Levy Springer, 1987 (I see Amazon have a used copy for $0.99, so this would be a good time to buy it.) Something I got from that book, although not in Levy's own words, is that a programming language can reduce your costs in three different ways: (A) it can make it easier for you to write what you DO want [reducing the SLOC count] (B) it can make it harder for you to write what you DON'T want [reducing the bugs-per-SLOC count] (C) it can make connections in the code more obvious [reducing the per-SLOC maintenance cost] Now most people get fixated on (A). This is the C++ tarpit. C++ seems to ignore (B) completely; implicit conversions make the type system far less helpful for bug prevention than it might be. Erlang addresses (A): if you have stuff to do that is naturally expressed in terms of communicating processes, Erlang makes it dead simple. Erlang addresses (B): "wrong size of integer" errors are IMPOSSIBLE because there is only one size, "big enough"; treating a number as an address is IMPOSSIBLE; freeing storage twice is IMPOSSIBLE; &c &c. One way to tell experienced programmers from inexperienced ones (including ones who have had the same experience repeatedly) is that when you try to tell them that a language can help you by NOT being able to do things, the inexperienced programmers cannot understand what you mean, while the experienced ones say "everyone knows that, but I'm not allowed to use such a language." My point here is that the a priori argument for maintenance costs being far LESS if you use some mix of Prolog, Erlang, and Lisp than in C++ is really quite strong. C++ is *too* powerful with respect to the vast range of low level bugs that are amazingly easy to write, and too weak in other ways. That too is shouting into the wind. Real costing, with real numbers, is a good idea. (And real numbers for Lisp, Prolog, and Erlang do exist.) 2) It was stated that it is better to fight with the nuances of one language, rather than drool on the strength of each of them independently and then face licensing issues, interop issues, performance issues, support issues , not to speak of the maintenance. Drooling? Sounds like prejudice talking there. When a carpenter says "I have some turning to do, so a lathe would be more useful than a drill press", he's not drooling, he's being competent. As noted above, there isn't the slightest scrap of a reason to expect maintenance costs to be lower in a single language (and it turns out that you _won't_ be using a single language anyway). 3) It was pointed out that today even Ericcsson does not use Erlang for its new product development. Why ? As I understand it from talking to some of the people who were there, "because the spectacular success of the Erlang projects was making the let's-use-C++ managers look too stupid." OK, so that's a bit too strong, but the largest *failed* project I ever heard of at Ericsson was a C++ project, not an Erlang project. More generally, if someone is arguing "it is a good idea to use languages which are good for specific problem areas rather than one-size-doesn't fit all", it is simply IRRATIONAL to say "then why doesn't everyone use your preferred language". I love Prolog a lot. I wrote a book about it. I spent years working on it. But when I have statistical calculations to do, I use R, not Prolog. If I have serious number-crunching to do, I'll use Fortran 90, not Prolog. If I ever had to do any embedded programming, I would use Spark/Ada (that is, the Spark subset of Ada) and use the Spark verifier to make *sure* it was right. I would not use Prolog. 4) The following products of Ericcsson are written in C++ TelORB distributed RAM database, the base for the TSP application server platform TDMA-CDMA HLR GSM-TDMA-CDMA mobility gateway AAA server. This is really the same as (3). At least one mobility server at another company has been written in Erlang. 5) It was pointed out that clisp has GPL licensing and no money should be wasted on acquiring software licenses (eg. Franz) Clisp isn't the only Common Lisp out there, not even the only free one. I have CMU Common Lisp, which is free. (No, I don't happen to remember the licence.) In a previous message I mentioned Poplog Common Lisp. On my G3 PowerMac I have an evaluation copy of PowerLisp; I haven't registered it because I'm not using it for software development. The registration fee is USD50. http://www.lisp.org/table/systems.htm has a list of Common Lisp implementations. I note that Macintosh Common Lisp is USD750 for a full licence. Sounds like a lot, but if a programmer costs USD60,000/year and overheads are comparable, then it's less than the cost of a programmer for 2 days, so if using Lisp saved 2 days of development time (how could it NOT?) it would pay for itself. I note that "CMUCL is public domain software; users may do anything with CMUCL and its sources, including linking it to other object files, and basing proprietary systems on it.", so there are *NO* GPL licence problems and *NO* money to be spent on software licences. There are also no licence fees for Erlang, and no barrier to using it in products. I also note the language of prejudice: money is SPENT acquiring licences; it is not WASTED unless the purchase turns out to be a bad idea. 6) It was pointed out that Prolog, CLISP are themselves interested in C! Presumably that's meant to be "implemented in C". As far as Prolog is concerned, I can only speak with authority about the Prolog systems I have personally worked on: DEC-10 Prolog: The garbage collector was written in Bliss-10. The rest of the run-time system was mostly in Prolog, extended with some low-level hacks. The compiler was written in Prolog. There was no C. PDP-11 Prolog: An interpreter, almost entirely written in assembly code. C Prolog. This was an interpreter. Someone (Luis Damas?) wrote a Prolog interpreter for EMAS in IMP. Fernando Pereira needed a Prolog on a VAX/UNIX system in a hurry, so translated EMAS Prolog to C. Written for portability, not speed. Quintus Prolog. Written in a mixture of languages. The compiler was written entirely in Prolog. The user interface was written in Emacs Lisp. The garbage collector, block storage manager, and the operating system interface were written in C. Most of the run-time library was in Prolog. The virtual machine emulator was written in Progol, somewhere between PL/370 and a macro assembler. Note: C was used for interfacing to things that already had C interfaces, notably the operating system. Xerox Quintus Prolog. Written in a mixture of languages. The compiler and most of the run time library were in Prolog. The user interface and the rest of the run time library were written in Interlisp-D. The virtual machine emulator was mostly written in D-machine microcode, with Lisp code to back it up. There was no C; the machine didn't *have* a C compiler. SWI Prolog. Written in a mix of C and Prolog. Performance is not very good *BECAUSE* so much of it is in C. I have seen a Prolog implementation for Lisp Machines, and that was in Prolog, Lisp, and microcode. But I haven't worked on it myself. What's the common thread here? It is that Prolog implementations that use C use it as a portably asembly/glue language, and that the high performance ones do NOT have have a VM emulator coded in C (these days they generate native code, like Aquarius did). So, if there is a smart idea present eg. backtracking, we can see the implementation and use it in the code. This is sheer lunacy. Have they *any* idea how *HARD* that is? Do they even have any idea of how little of an idea they have? There is no need to take the complete - load of the language, since we don't want all the features any way. This is like saying "you tell me that sex with a woman is good. Well, we don't need no women, we'll just stick the good bits onto a toad." The problem is that a language like Prolog just doesn't divide up into bits like that. 7) RPC and message passing related weakness in Erlang can cause security vulnerability issues. What weaknesses? What weaknesses does Erlang have that C or C++ does not? (Oh wait, there ISN'T any RPC or message passing in C or C++!) 8) High performance in computation, high responsiveness in network i/o, aync and disk i/o is mandatory. This has already been discussed. The performance slide related to yaws was mentioned and the management wondered why the world hasn't moved on to yaws by ditching oh-so-slow Apache ? They really don't have a clue, do that? Suppose you have built a web site around PHP, which Apache supports and Yaws doesn't. Are you going to switch to Yaws? Anybody who has static pages to serve and nothing else can easily switch. Anybody who is developing a web site from scratch can easily switch the design to Yaws. But someone who HAS a web site with all sorts of SSP and JSP and PHP and XYZZY stuff that's supported by Apache and not Yaws is going to find it much easier to buy more hardware than redesign their site. 8) The management has decided to organize 4 week long formal rigorous training in C++ and Template Programming. Do they even *know* that Template Programming *is* functional programming? (Functional programming in a seriously weird and seriously nasty language, but not *quite* as bad as XSLT, on second thoughts, since implementations of the template language are allowed to cut off function calls at different depths I was wrong, it's much nastier than XSLT.) I am sorry, but 4 weeks just is not going to be enough. There will be sessions in competency building in tools like gprof, gdb, g++4, gcc4 etc. That's nice. There's two weeks gone. What are the other two weeks going to be? 9) The decision has been taken by the management and the tools to be used are - C++ (user land), g++4 - C (kernel land) gcc4 - STL - Boost Library There is no license fees to be paid to anybody. And there wouldn't have been had you gone with Erlang and CMU Common Lisp either. I am rather worried about "kernel land". Why are you planning to mess with the operating system kernel? (Given that your prototype didn't.) Do they have *any* idea how much extra knowledge and skill that requires? 10) All storage related standards have types defined in C and it makes sense to have the programmatic representation as close as possible to the standard. You *can* define storage types in Ada, but you *can't* in C++ or C. I for one have run into trouble exchanging binary data between two programs on the *same* machine compiled from the *same* sources; they had been compiled by different C compilers. 11) The management also highlighted that if the languages so far used (prolog,lisp,erlang) were so great then the capitalists would have grabbed them up long time ago and made lots of money by now by developing and selling products. So, either the capitalists are fools or the current development team ! There is so much stupidity in this that it is hard to know where to begin, and I have to leave in a few minutes. Basically, management are saying You programmers are SO *DUMB* that you can never have any good ideas or even recognise any good ideas; the only way we can tell if something is a good idea is if everyone BUT you is already doing it. Why do you want to work for these people? When I heard how much the Bluetail people made out of Erlang, I felt a very complicated emotion. As near as I can decode it, the feeling was "I am glad they got so much money, it really vindicates them." "I am sad I didn't get any of it." "Mind you, they really really deserved it." "Why didn't I ask to join them back when I thought they were a bunch of nice, smart, but struggling people?" "D--- but they're smart." Joe Armstrong has a number of articles. One of them is called something like "Nobody likes the bearer of good news." There are (decimal) *order of magnitude* size and cost savings to be made by using unpopular languages. To use an unpopular language, you have to start by admitting that you might be wrong. Capitalists don't have to make the *best* choices, only better choices than their competitors. As long as your competitors are bad enough, you don't have to be very good to win. It was also pointed out that Google does lot of work related to information retrieval, inference, distributed computing over thousands of compute nodes but does not use Erlang! Why? How do you know Google don't? How do _they_ know what Google write programs in? I teach an IR course. IR is mostly dominated by I/O. C I/O has very low overheads. It's news to me that Google do any serious inference. From valentin@REDACTED Mon Sep 5 09:23:47 2005 From: valentin@REDACTED (Valentin Micic) Date: Mon, 5 Sep 2005 09:23:47 +0200 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> Message-ID: <00d201c5b1ea$c3145380$0100a8c0@MONEYMAKER2> > Mostly, I am on my way out. Maybe this is what management was hoping to achieve? As a (kind of) management, I fully understand a need to use as few languages as possible, although my choice today would not be centered arround C/C++. However, about 4 years ago, I did elect to use C/C++ for a "serious" system development -- partially because it was politically correct thing to do (I needed the business really, really badly), but partially because I wasn't quite convinced that my understanding of ERLANG was good enough to manage the risk. Fortunately, I did mention ERLANG as a by-the-way thing in my proposal. To cut the story short, C/C++ was used to gain "credibility", and ERLANG was mentioned to gain the competitive advantage over competitors -- we have what they have, and more... and we're cheaper! But the most critical ingredient is that customer/manager trust your ability to deliver. Note that this trust gets proportionally thiner with each non main-stream component you want to introduce. PROLOG, LISP & ERLANG in one go? Even G.W. Bush wouldn't be able to sell this. Dev, if you really want to help your company, stick around, get Erlang-ducated (this is a thing that you do on your own, for everyting else attend one of the Francesco's courses -- Francy, darling... do I get a commision for this?), and wait for a good opportuinity to help. Choose battles you can win. Valentin From joe.armstrong@REDACTED Mon Sep 5 09:24:35 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Mon, 5 Sep 2005 09:24:35 +0200 Subject: I had a dread Message-ID: Micka?l R?mond wrote > Le 1 sept. 05 ? 20:25, Eric Merritt a ?crit : > > > Even with the availability of REPOS, Joe has a point. There is a bit > > of magic in being able to apt-get 'erlangish-foo' that you > just can't > > get when you have to do something manually. I think that > erlmerge is a > > huge step down this path, even though right now there only > seems to be > > a couple of packages available and no ability to erlmerge update to > > the erlang distro. > > In general I think it would be great to have erlmerge and apt > > integrated, but at the very least it would be nice to have > erlmerge in > > apt so that you could do an 'apt-get erlmerge' and then 'erlmerge > > erlangish-foo'. Its not optimal, but its a big step in the right > > direction. > > The main problem is that each distro has its own tool: apt-get, > urpmi, yum, yast, emerge, and so on. > erlmerge is a step is a good directory as it sits on top of the > system package manage. This is what Perl is doing with CPAN. > Distribution providers have to support base Erlang module and the > other ones are supported by an Erlang native tool. YES What I was suggesting is a wrapper for (say) apt-get - so that once you have made your emerge package XX you evauate the magic function wrapit(apt, debian , "XX") and it automatically produces a debian apt package. > One problem remains and is non trivial: how to support Erlang > application that rely on binary modules ? > This is even less trivial when you have a multiplatform environment > like Erlang that run on various operating systems: Linux, > *BSD, *Nix, > Windows, MacOSX. Difficult - but there is a large set of applications for which this is not a problem ie the "pure erlang" sub-set. /Joe > > What we are doing with REPOS is a hard job a precompiling all the > native stuff, to have everything for all platforms (not all but as > many as we can) ? > This is not perfect at all, but is also a good start. Maybe merging > REPOS effort with Erlmerge could lead to interesting and practical > results. > > -- > Micka?l R?mond > > > > From francesco@REDACTED Mon Sep 5 09:26:27 2005 From: francesco@REDACTED (Francesco Cesarini (Erlang Training & Consulting)) Date: Mon, 05 Sep 2005 08:26:27 +0100 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> Message-ID: <431BF323.5050409@erlang-consulting.com> I have been reading this thread with interest. As a consultant working with Erlang helping others evaluate the technology, there have been times when presentations given by us have resulted in the opposite effect... Java and C++ projects being discontinued in favor of rewriting everything in Erlang. It does happen, but not often enough. The feeling of seeing the C++ and Java buffs run out of arguments and grind their teeth is priceless... Francesco -- http://www.erlang-consulting.com Dev Functional wrote: > Hello Ulf > > Thanks for taking out time to write this mail. > > > On 9/5/05, Ulf Wiger wrote: > >>Wild guess, but... >> >>Basically, since your management started interfering based >>on advice from a close friend of the VP, any justification >>beyond that point will serve mainly to cloud the fact that >>the decision was made irrationally in the first place (or, >>more precisely, irrationally from the company's point of >>view, as it was mainly self-serving and not necessarily in >>the best interest of the company.) >> >>Once you start suspecting that, it's best to bail out of >>the debate, since the arguments in favour of the decision >>will be tempting to attack -- and attacking them is likely >>to hurt your career in the company. You need to have very >>powerful friends, an excellent case, and extreme motivation >>to take on upper management and try to expose their >>incompetence in a specific case. >> >>(They may not even be incompetent -- I'm sure all managers >>once in a while move too fast on some issue, and find out >>later that they had trusted the wrong advisor. Once they do, >>they still have to figure out what's worse: having their >>bad judgement exposed, which means they lose authority, >>or go with a less-than-optimal decision? In order _not_ to >>lose face, you have to carefully establish a leadership style >>where you own up to your mistakes and change your mind >>publicly and honestly when needed. This takes a lot of natural >>authority, if you're to pull it own. You can't fake it.) >> > > > To tell the truth, the arguments were quite intense and at times heated. > We met three times during the day as a discussion did not seem possible > in one go. > > >> >>>2) It was stated that it is better to fight with the nuances of one >>> language, rather than drool on the strength of each of them >>> independently and then face licensing issues, interop issues, >>> performance issues, support issues, not to speak of the >>> maintenance. >> >>"Drool"? If those were the very words used, I'd say your management >>has an attitude problem towards its engineers. >> > > > To quote, "Figure out C++, rather than drooling on Err-lang (mistake > of language), > Pro(log), cli(sp) and mumba jumba. Why do ya' guys want to sink this company ? > Your Lead, has already made a fool of himself by immersing himself in > this spaghetti!" > > >>>3) It was pointed out that today even Ericcsson does not use Erlang >>> for its new product development. Why ? >> >>I've answered this. For a more detailed answer, read Bjarne D?cker's >>excellent thesis "[Erlang] - A Case Study of Technology Introduction" >>(http://www.erlang.org/cslab/publications/bjarnelic.pdf) >> > > > Unfortunately, the Thesis also highlights Ericsson's decision to do things > in C++ (rather than Erlang). > > The moment I mentioned this in the discussion, a 1 page printout of the > specific page from the thesis was shoved on my face. > > To quote, > "Huh ? Why this ? Has somebody paid you to do this to us ? > Rather than wasting time on defending some bag of exotic languages, > why don't you focus on taking the project ahead ? > You are the lead, aren't you ? Why are you behind ?" > > >> >>Good luck. Getting pounced on is never fun, but if you >>insist on using great technology, it's bound to happen >>every once in a while. Many of us have been there. (: >> > > > The junior dev's have agreed to participate in C++ training. > The management talked to them about "future employability" > and importance of having main-stream skillsets. > Who will hire a lisp(er) [with a slant on stuttering (sic)] or an > (err)lang(err) was their refrain ? > > Mostly, I am on my way out. > > Apologize to all the esteemed members of this list for this non-technical mail. > > kind regards > Dev. > > From francesco@REDACTED Mon Sep 5 09:33:40 2005 From: francesco@REDACTED (Francesco Cesarini (Erlang Training & Consulting)) Date: Mon, 05 Sep 2005 08:33:40 +0100 Subject: Erlang & AI In-Reply-To: References: Message-ID: <431BF4D4.8080709@erlang-consulting.com> As James and Ulf pointed out, you read a .erl file, add a few clauses (eg. pattern matching on specific cases), compile and load the code. Something similar to asserts in prolog. Speed gains can be substantial. Not for the faint of heart, however. People were playing around with it over 10 years ago. Francesco -- http://www.erlang-consulting.com James Hague wrote: > On 9/4/05, Joel Reymont wrote: > >>Strange choice. How would you write self-modifying code in Erlang? > > > Most of the time when someone says "self modifying code" in regard to > AI, they simply mean manipulating code as an abstract syntax tree, > then generating program text from that tree which can be compiled and > loaded on the fly. Lisp has the advantage here, because the AST and > program text can be identical, but this is easy enough to do in Erlang > or any other language where you can call the compiler and reload code > from a running program. > > From ulf.wiger@REDACTED Mon Sep 5 10:16:56 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 5 Sep 2005 10:16:56 +0200 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ Message-ID: Dev Functional wrote: > On 9/5/05, Ulf Wiger wrote: > > > 3) It was pointed out that today even Ericcsson does not > use Erlang > > > for its new product development. Why ? > > > > I've answered this. For a more detailed answer, read Bjarne D?cker's > > excellent thesis "[Erlang] - A Case Study of Technology > Introduction" > > (http://www.erlang.org/cslab/publications/bjarnelic.pdf) > > > > Unfortunately, the Thesis also highlights Ericsson's decision > to do things in C++ (rather than Erlang). > > The moment I mentioned this in the discussion, a 1 page > printout of the specific page from the thesis was shoved > on my face. I'm sure Bjarne would have some choice words for those who use his thesis in defense of choosing C++ over Erlang. :) Let's see what one can find if one reads the _whole_ thesis, and not just searching for phrases that seem to justify one's prejudice when lifted out of context. And we should bear in mind that Bjarne, while retired now, will always act in what he thinks is in the best interests of "good old LME" (LME = LM Ericsson, which was the original name of Ericsson AB, as well as the initials of its founder, Lars-Magnus): Lets skip first to the conclusion (p. 49): "Was it worth the effort? Did the Erlang development produce the desired technical result and did it serve the needs for product development? The answer must be 'yes' on both accounts." Then, back to the "Backlash" page (p. 37): "Once upon a time C++ [St91] was the contender vs. Erlang. However, after some large project failures C++ fell into disrepute and instead Java [Go96] appeared." Was this the page that they claim tells how Ericsson chose C++ over Erlang? The thesis talks about how the company wanted to move towards more high-level development tools, such as Rational Rose, etc. Ericsson is a _major_ user of UML, and was also a major user of SDL (which is now integrated into UML). It's fair to say that this move was in part an attempt to _get away_ from e.g. C++ and moving system design up to a higher abstraction level. Erlang in a way represents the same type of ambition, but building more from the ground up. This is also described by Bjarne (p. 22): "Programming is both a _top down_ activity from requirements and overall structure of the system and a _bottom up_ activity based on the _abstractions_ provided by the programming language. Abstractions such as _modules_, _processes_, _higher order functions_, etc. are to the programmer like transistors, capacitors, resistors, etc. to the hardware designer. It is important that the abstractions be few, simple to understand and yet powerful and provide the needed functionality." Towards the end of page 37, Bjarne hints that perhaps the move towards outsourcing development tools didn't go quite as smoothly as some might have hoped (Bjarne calls it "some turmoil".) Let me give you some insider background: One of the user quotes on p. 32: "We believe from project start, and still believe, that if we had tried to use any other technology, we would even remotely have been able to, within the desired time frame of roughly 1.5 years, reach the desired level of functionality, system software maturity and stability." was offered by one of Ericsson's most respected system architects, with years of experience in e.g. C++ projects. He was himself a guest researcher at MIT and participated in research that eventually led to the development of IDL and RPC (I think -- unfortunately, Google is not that reliable when it comes to ancient history like that. ;) In fact, significant parts of the architecture in the C++-based products you mention bear his signature. > Apologize to all the esteemed members of this list for > this non-technical mail. No need. Many people on this list have, I'm sure, been in similar battles. Hopefully, it will help some who still haven't to hear about arguments and counter-arguments, but perhaps also to recognize when the battle turns personal, and away from technical arguments. In a sense, all of this is "shouting into the wind", as ROK eloquently put it, but recognizing that this particular battle was lost, it doesn't hurt to wrap up, and hone the arguments until next time. Finally, a quote worth pondering: "...focus on interests, not 'positions'. Positions are bargaining statements so narrow that for one person to win, the other must lose." (From "Software Deadlines - Software Schedule Negotiating", Applied Computer Research, Inc. http://www.acrhq.com/surveys/deadline/sp-sched.htm /Uffe From Marc.Vanwoerkom@REDACTED Mon Sep 5 10:45:53 2005 From: Marc.Vanwoerkom@REDACTED (Marc van Woerkom) Date: Mon, 05 Sep 2005 10:45:53 +0200 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: <200509050504.j8554xnY111725@atlas.otago.ac.nz> Message-ID: > It was also pointed out that Google does lot of work > related to information retrieval, inference, distributed > computing over thousands of compute nodes but does not > use Erlang! Why? Google hired Rob Pike http://labs.google.com/people/r/ of Plan 9 (distributed Unix successor). Maybe they roll their own distributed OS. On the other hand, Microsoft has Tony Hoare on its payroll, don't know if they make use of his ideas. :) Regards, Marc From Marc.Vanwoerkom@REDACTED Mon Sep 5 10:57:42 2005 From: Marc.Vanwoerkom@REDACTED (Marc van Woerkom) Date: Mon, 05 Sep 2005 10:57:42 +0200 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: Message-ID: > Some enterprise still run Cobol applications. > They do not rewrite it in another technology > because it cost money. Why should one change if you have a good team? Our backend programmers use COBOL, new frontends are done in PHP (for the web) or XUL/JS/Mozilla (inhouse apps). Communication goes along well defined interface methods. The difference of both worlds, old school and new school, rather helps to make the separation more clean. Regards, Marc From joe.armstrong@REDACTED Mon Sep 5 11:10:58 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Mon, 5 Sep 2005 11:10:58 +0200 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ Message-ID: > Dev Functional wrote > Sent: den 4 september 2005 11:35 > To: erlang-questions@REDACTED > Subject: Re: (Prolog + LISP + Erlang) with integration issues > versus C++ > > > Hello all > > I would sincerely like to thank all of the people who > responsded to my mail. > > Here are the details of the discussion and decisions made. > 11 arguments -[cut] Argument [3] claimed falsely that: "Ericsson does not use Erlang for product development" Yes is does - that's what I'm doing *today* that's what my colleagues are doing - hacking away IN ERLANG - MAKING NEW PRODUCTS. (Sorry for shouting) Argument [11] was very strange Something about capitalists not grabbing up the new ideas. Yes they are. "Been there - done that" - I have *never* met a venture capitalist who asked or cared about the programming technology - never EVER (shouting again) Venture capitalists brains seem to work like this: - Can I make money? - Can this person to whom I am giving money deliver the goods? - What is my exit strategy=? (ie how can I take the money and run if things go wrong) I once asked our first VC why he invested in us - I said - "You must be totally mad - giving us a load of money when you haven't the faintest idea what we'll do with it" - he said - "I'm not investing in you, I'm investing in a sector - we buy into ten or twenty companies - some will succeed others fail." VC's don't care about (or understand) the technology - they invest in people and in business ideas. The other arguments are not worth refuting. Now I want to make some meta-comments. 1) What has happened to you is very common. The pattern like this: a) You prototype something in some new fun language b) The prototype is great c) A committee decides to investigate which technology to use d) you win all the arguments in committee e) You committee decides to use C++/Java and produces a spurious set of arguments to support their decision f) You get pissed off, so you either accept the decision (and still feel pissed-off) or g) go do something else Now I can't actually remember how many times this has happened to me (about 5 - 10 times) - after many years of experience I'd say "if you see the pattern coming" just hop to g) immediately. 2) You can't win an argument. I suggest you (and everybody) read Dale Carnegies "How to win friends and influence people" To paraphrase his argument "Let's suppose you *totally* win an argument - you out argue your opponent on every point - you win" - but the problem is that you don't win in the long term "winning the argument" in this sense leaves a sour taste in the mouth - the opponent bears grudges against you, possibly dislikes you, works against you in the future ... Carnegies message is "you can't win an argument" 3) People have to decide for themselves that they want to use your technology It is *extraordinarily* difficult to sell a new technology - here are a couple of mechanisms: a) - wait for failure, then step in b) - work alongside and set a good example and hope it "infects" the other side a) works very well - BUT is outside your control b) is *very* difficult - mainly because what you perceive as "a better technology and commercial advantage" - is perceived as "a career threat and a criticism of our ways of working" (or course it *is* a criticism - but not one which should be taken personally) Dale Carnegie say to have to raise in the other person a genuine desire to use your ideas/product/technology. He also says "If you do something good don't tell anybody about it" - this is *very* difficult (or course you want to tell everbody about your fantastic new gizmo - BUT what you thought to be great can be interpreted as critism and actually prevents what you want to happen). 4) Darwinism and feedback This is (I hope) the positive story. What happened to the Venture Capitalists who made money from the "first wave" of Erlang apps - did they go away? No - these capitalists made money from our technology - they made more money than we made - and they are first-in-line to invest in our new ideas (this is the feedback cycle). They do invest and they have carried on investing. Money is not automatic, so they want to see a good business idea - but they know that the technology works and trust has been established. These capitalists should make more money than the rest - Darwinism. 5) What then is the desired position? IMHO Erlang should ben positioned to - avoid starvation - not be main-stream ie We have sufficient users to avoid the situation that there are so few users that nobody cares and the technology withers and dies, and we are not main-stream. Why the "not main stream" - because then we *loose* our commercial advantage. If everybody starts using Erlang then all the small companies using Erlang (my friends) loose their commercial advantage. Right now the market is small enough that we encourage new companies to use Erlang - that's because they are not competing with each other - this is to help "avoid starvation". Interestingly - I know of a small number of companies using Erlang who absolutely do not wish it to be known that they are using Erlang - since it gives them a commercial advantage that they do not wish their competitors to know about. /Joe From hakan@REDACTED Mon Sep 5 11:51:50 2005 From: hakan@REDACTED (Hakan Mattsson) Date: Mon, 5 Sep 2005 11:51:50 +0200 (CEST) Subject: mnesia replication (Are there checksums?) In-Reply-To: <4316A185.7000707@erlang-consulting.com> References: <43147BD0.6090103@hq.idt.net> <17173.19195.826225.51972@rian.du.uab.ericsson.se> <43158FB9.6040708@erlang-consulting.com> <4316A185.7000707@erlang-consulting.com> Message-ID: On Thu, 1 Sep 2005, Francesco Cesarini (Erlang Training & Consulting) wrote: FC> I am amazed we never came across this bug (ok, feature :-) ) before. I FC> would have expected an alarm to be generated as soon as the databases FC> became inconsistent. I guess a way to come around the problem is to hash FC> the dirty writes across the nodes based on the key. FC> FC> How hard would it be to add a checksum to each table? It should not FC> generate any major overheads... The subject had been discussed, but FC> probably before you took over the reins. So you was involved with Mnesia internals before 1996 and still don't know the semantics of dirty access? ;-) I don't think that adding a checksum mechanism would make any substantial improvement. When the system would be able to detect that there is a checksum mismatch, it would be too late to make the database consistent again without stopping the system. The only sensible action at a "sloppy usage of Mnesia" alarm would be to restore the database from backup. Adding a table checksum mechanism would imply a performance penalty for all database updates, even though they not are needed for transaction protected ones. I assume that the overhead would not be negligible for disk resident tables, as it would imply an extra file access. Of course you could try to reinvent some of the properties of transaction protected access for dirty access operations. But by adding all these mechanisms (checksums, hashed access, tunnel updates through a central process, buffering updates at re-configuration etc.) you would loose the single reason (better performance) for using dirty access. Use transactions instead. Avoid dirty updates as far as possible. /H?kan From devfunctional@REDACTED Mon Sep 5 12:52:34 2005 From: devfunctional@REDACTED (Dev Functional) Date: Mon, 5 Sep 2005 16:22:34 +0530 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: References: Message-ID: On 9/5/05, Joe Armstrong (AL/EAB) wrote: > > Argument [3] claimed falsely that: > > "Ericsson does not use Erlang for product development" > > Yes is does - that's what I'm doing *today* that's what my colleagues are > doing - hacking away IN ERLANG - MAKING NEW PRODUCTS. (Sorry for shouting) > > > > 2) You can't win an argument. > > > Interestingly - I know of a small number of companies using Erlang who > absolutely do not wish it to be known that they are using Erlang - since it gives them > a commercial advantage that they do not wish their competitors to know about. > > /Joe > Dear Dr. Armstrong, Reading your mail was very inspiring and helped me feel better. Really ! It is also very reassuring to know that Ericcsson uses Erlang in its product development work today. Sure, I am going to read Dale Carnegie's book. kind regards Dev. From chsu79@REDACTED Mon Sep 5 15:45:11 2005 From: chsu79@REDACTED (Christian S) Date: Mon, 5 Sep 2005 15:45:11 +0200 Subject: Erlang on a wlan access point such as the "wrt54g"? In-Reply-To: References: Message-ID: Have anyone worked on getting Erlang to run on a wrt54g device? I recently found out about and corresponding project . Being able to run erlang on a low-power device like this, and having access to the hardware for implementing routing protocols at the link level of wlan could be really cool. From gerd@REDACTED Mon Sep 5 16:23:19 2005 From: gerd@REDACTED (Gerd Flaig) Date: Mon, 05 Sep 2005 16:23:19 +0200 Subject: I had a dread In-Reply-To: (Joe Armstrong's message of "Thu, 1 Sep 2005 16:17:18 +0200") References: Message-ID: "Joe Armstrong (AL/EAB)" writes: > apt-get install yaws works like a charm here on Debian sid (unstable). Goodbyte, Gerd. -- Gerd Flaig Technik gerd@REDACTED Bei Schlund + Partner AG Brauerstra?e 48 D-76135 Karlsruhe Physics is like sex: sure, it may give some practical results, but that's not why we do it. -- Richard Feynman From klacke@REDACTED Mon Sep 5 17:27:43 2005 From: klacke@REDACTED (Claes Wikstrom) Date: Mon, 05 Sep 2005 17:27:43 +0200 Subject: I had a dread In-Reply-To: References: Message-ID: <431C63EF.7000204@hyber.org> Gerd Flaig wrote: > "Joe Armstrong (AL/EAB)" writes: > > >>apt-get install yaws > > > works like a charm here on Debian sid (unstable). Would have worked just fine on Gentoo, had the gentoo developers accepted my .ebuild. For reasons unknown to me, they don't want it. /klacke -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: yaws.ebuild URL: From mikael.karlsson@REDACTED Mon Sep 5 19:09:22 2005 From: mikael.karlsson@REDACTED (Mikael Karlsson) Date: Mon, 5 Sep 2005 19:09:22 +0200 Subject: I had a dread In-Reply-To: References: Message-ID: <200509051909.22839.mikael.karlsson@creado.com> Mon 05 September 2005 09:24 Joe Armstrong (AL/EAB) wrote: > What I was suggesting is a wrapper for (say) apt-get - so that once you > have made your emerge package XX you > evauate the magic function wrapit(apt, debian , "XX") and it automatically > produces a debian apt package. > Hi Joe, a couple of projects that might fit into your vision: http://componentizedlinux.org/index.php/Main_Page http://www.openpkg.org/ /Mikael From spearce@REDACTED Mon Sep 5 20:27:52 2005 From: spearce@REDACTED (Shawn Pearce) Date: Mon, 5 Sep 2005 14:27:52 -0400 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: <431BF323.5050409@erlang-consulting.com> References: <200508260110.j7Q1A0H4040743@atlas.otago.ac.nz> <651946F6-6DDF-42E9-AE4F-1A633AE02F7B@iro.umontreal.ca> <431BF323.5050409@erlang-consulting.com> Message-ID: <20050905182752.GA25421@spearce.org> I have had a very similiar discussion with a client of mine last year. The product was an "embedded system" using pretty standard PC components - so they had full control over what they were running on. It was largely an I/O interface system, and it required pretty soft time requirements (~100 ms response). I figured Erlang on GNU/Linux was perfect for this and would actually offer faster response than was really required. They were trying to port their mass of unmaintainable C++ code off of QNX and onto Linux, so they could avoid the QNX licensing fees. The C++ code was horrible - nearly impossible to port. 12 months into the port my client decided to attempt a rewrite from the ground up instead of finishing the port. I had the development manager on board with using Erlang. But we couldn't get the president of the company or the chairman of the board to agree. The chairman is a rather famous hacker on the 'net (he has written or maintained several popular open source packages and is one of the founders of a rather well known software/hardware firm). The chairman insisted we use C++. The other C++ developers at the company agreed and insisted that the Boost++ library would give us everything we needed (but that if it didn't then ACE would provide everything else!). I offered them a timeline of 4 months of development and testing for an Erlang solution. They rejected it and asked for a C++ implementation instead. I no longer am doing work for this client. I just looked at their website today, over 14 months later. They still haven't shipped the product I suggested using Erlang in. We had a timeline of inception to market of about 4 months with Erlang. 14 months later this company still hasn't shipped the product, I suppose due to their inability to implement a C++ solution. Their competition however has already introduced their equivilent products. I think this company is on its last legs. If they can't launch the product this fall, they likely will be. "Francesco Cesarini (Erlang Training & Consulting)" wrote: > I have been reading this thread with interest. As a consultant working > with Erlang helping others evaluate the technology, there have been > times when presentations given by us have resulted in the opposite > effect... Java and C++ projects being discontinued in favor of rewriting > everything in Erlang. It does happen, but not often enough. The feeling > of seeing the C++ and Java buffs run out of arguments and grind their > teeth is priceless... > > Francesco > -- > http://www.erlang-consulting.com -- Shawn. From klacke@REDACTED Mon Sep 5 21:43:46 2005 From: klacke@REDACTED (Claes Wikstrom) Date: Mon, 05 Sep 2005 21:43:46 +0200 Subject: Erlang/OTP R10B-7 has been released In-Reply-To: References: Message-ID: <431C9FF2.80207@hyber.org> Bjorn Gustavsson wrote: > Bug fix release : otp_src_R10B-7 > Build date : 2005-08-31 > # find . -name '*.erl' | xargs wc -l | tail -n -1 435972 total We're almost on par with the C++ guys here .. lots of code :-) /klacke From francesco@REDACTED Mon Sep 5 20:31:11 2005 From: francesco@REDACTED (Francesco Cesarini (Erlang Training & Consulting)) Date: Mon, 05 Sep 2005 19:31:11 +0100 Subject: mnesia replication (Are there checksums?) In-Reply-To: References: <43147BD0.6090103@hq.idt.net> <17173.19195.826225.51972@rian.du.uab.ericsson.se> <43158FB9.6040708@erlang-consulting.com> <4316A185.7000707@erlang-consulting.com> Message-ID: <431C8EEF.1020201@erlang-consulting.com> Hakan Mattsson wrote: > On Thu, 1 Sep 2005, Francesco Cesarini (Erlang Training & Consulting) wrote: > > FC> I am amazed we never came across this bug (ok, feature :-) ) before. I > FC> would have expected an alarm to be generated as soon as the databases > FC> became inconsistent. I guess a way to come around the problem is to hash > FC> the dirty writes across the nodes based on the key. > FC> > FC> How hard would it be to add a checksum to each table? It should not > FC> generate any major overheads... The subject had been discussed, but > FC> probably before you took over the reins. > > So you was involved with Mnesia internals before 1996 > and still don't know the semantics of dirty access? ;-) We've always serialized the writes in a process, and when using multiple nodes, hashed the writes based on the key... I know the semantics pretty well, but do admit I got taken by surprise that one could end up in an inconsistent state without partitioned networks. Yet another aspect of concurrency. It is one of those things you think is handled behind the scenes. With a checksum mismatch, all you would do is reload a table based on a master node. Halsningar, Francesco -- http://www.erlang-consulting.com From vlad_dumitrescu@REDACTED Mon Sep 5 22:18:06 2005 From: vlad_dumitrescu@REDACTED (vladdu) Date: Mon, 5 Sep 2005 22:18:06 +0200 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ References: Message-ID: <20050905201806.7DD2C47031@bang.trapexit.org> [quote="joe] Interestingly - I know of a small number of companies using Erlang who absolutely do not wish it to be known that they are using Erlang - since it gives them a commercial advantage that they do not wish their competitors to know about. [/quote] Hi, Just out of curiosity, how do these companies recruit developers? Is "word of mouth" good enough? /Vlad _________________________________________________________ Sent using Mail2Forum (http://m2f.sourceforge.net) From valentin@REDACTED Tue Sep 6 07:53:38 2005 From: valentin@REDACTED (Valentin Micic) Date: Tue, 6 Sep 2005 07:53:38 +0200 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ References: <20050905201806.7DD2C47031@bang.trapexit.org> Message-ID: <00fa01c5b2a7$5467f9b0$0100a8c0@MONEYMAKER2> Let me tell you -- It is not easy. Why? Interested? ;-) Valentin Micic Pharos Consulting (Pty) Ltd. And no -- we do not have a Web Site. Cell: +27 83 212 9180 ----- Original Message ----- From: "vladdu" To: Sent: Monday, September 05, 2005 10:18 PM Subject: (Prolog + LISP + Erlang) with integration issues versus C++ > > [quote="joe] Interestingly - I know of a small number of companies using Erlang who > absolutely do not wish it to be known that they are using Erlang - since it gives them > a commercial advantage that they do not wish their competitors to know about. > [/quote] > > Hi, > > Just out of curiosity, how do these companies recruit developers? Is "word of mouth" good enough? > > /Vlad > _________________________________________________________ > Sent using Mail2Forum (http://m2f.sourceforge.net) From joe.armstrong@REDACTED Tue Sep 6 08:54:29 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Tue, 6 Sep 2005 08:54:29 +0200 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ Message-ID: > -----Original Message----- > From: vladdu [mailto:vlad_dumitrescu@REDACTED] > Sent: den 5 september 2005 22:18 > To: erlang-questions@REDACTED > Subject: (Prolog + LISP + Erlang) with integration issues versus C++ > > > > [quote="joe] Interestingly - I know of a small number of > companies using Erlang who > absolutely do not wish it to be known that they are using > Erlang - since it gives them > a commercial advantage that they do not wish their > competitors to know about. > [/quote] > > Hi, > > Just out of curiosity, how do these companies recruit > developers? Is "word of mouth" good enough? > No No No It's never good enough. Tell Francisco you want an Erlang job (if that's what you want) - he can't guess this Find out who is doing the fun stuff then contact them - Where are you located - where do you want a job? - I might be able to help with some names. Luke Gorrie (for example) got a job at Bluetail from Australia - he started by mailing me - he had written a wiki in Erlang - his code was so nice that I thought I had written it :-) - so we hired him In most cases they don't recruit developers - it was the developers who either started the company or managed to persuade their bosses to use Erlang. One very good way to start a company is to hook up with some business people - smart MBAs from a business school. Often these guys have very good business ideas but haven't a clue how to implement their ideas. We (programmers) tend to think we know it all - we often have good techniques but crap ideas about business prospects. Business people are the other way around - they often know exactly what they want, and the idea is good, BUT they can't implement it themselves - so they hire consultants => result disaster. I have learnt that "not many programmers can program" - (this took me years - I thought that because I could program that other people called "programmers" could program) - in fact very few people can take an idea and turn it into a working system (any fool can a trivial 1000 line program, and many fools do). The other think is "work with good people" - the Erlang Bluetail group was good because it reached critical mass. One isolated programmer rarely starts a company. Typical start-up size is 4 programmers 4 non-programmers (1 boss, 3 sales) /Joe > /Vlad > _________________________________________________________ > Sent using Mail2Forum (http://m2f.sourceforge.net) > From vlad.xx.dumitrescu@REDACTED Tue Sep 6 09:04:10 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Tue, 6 Sep 2005 09:04:10 +0200 Subject: (Prolog + LISP + Erlang) with integration issues versus C++ Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE5FC@esealmw105.eemea.ericsson.se> Hi, > > Just out of curiosity, how do these companies recruit > > developers? Is "word of mouth" good enough? > > No No No > > It's never good enough. I was only genuinely curious. :-) Thanks for the answers! regards, Vlad From mats.cronqvist@REDACTED Tue Sep 6 10:17:31 2005 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Tue, 06 Sep 2005 10:17:31 +0200 Subject: windows :< Message-ID: <431D509B.1050103@ericsson.com> anybody out there tried (or better yet; succeeded) to build a c-node on windows? i would like to use mingw if possible. mats From vlad.xx.dumitrescu@REDACTED Tue Sep 6 12:29:06 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Tue, 6 Sep 2005 12:29:06 +0200 Subject: Compiler backwards compatibility Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE601@esealmw105.eemea.ericsson.se> Hi, Is the R10 compiler able to generate beam files that are R9-compatible? I don't use any of the new features, but the beam files contain opcodes that aren't supported on R9. regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From neumann@REDACTED Tue Sep 6 05:12:57 2005 From: neumann@REDACTED (=?iso-8859-1?q?Fran=E7ois-Denis_Gonthier?=) Date: Mon, 5 Sep 2005 23:12:57 -0400 Subject: I had a dread In-Reply-To: References: Message-ID: <200509052312.59846.neumann@lostwebsite.net> On 5 September 2005 03:24, Joe Armstrong (AL/EAB) wrote: > What I was suggesting is a wrapper for (say) apt-get - so that once you > have made your emerge package XX you > evauate the magic function wrapit(apt, debian , "XX") and it automatically > produces a debian apt package. > As I see it, it might be trivial for Debian packages. One could make a simple package template that is customisable to each application that is erlmerged. The package could be mostly dummy except for the uninstall script which would call erlmerge for removal. This would probably require patch to erlmerge that would enable it to be aware of the package system it is working. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From bjorn@REDACTED Tue Sep 6 14:15:06 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 06 Sep 2005 14:15:06 +0200 Subject: Compiler backwards compatibility In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE601@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE601@esealmw105.eemea.ericsson.se> Message-ID: While not officially supported, we have some options we use for testing that should work: erlc +r7 file.erl OR erlc +no_new_binaries +no_new_apply file.erl /Bj?rn "Vlad Dumitrescu XX (LN/EAB)" writes: > Hi, > > Is the R10 compiler able to generate beam files that are R9-compatible? I don't use any of the new features, but the beam files contain opcodes that aren't supported on R9. > > regards, > Vlad > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From tim@REDACTED Tue Sep 6 15:27:52 2005 From: tim@REDACTED (Tim Bates) Date: Tue, 06 Sep 2005 22:57:52 +0930 Subject: Process discovery in a large OTP system Message-ID: <431D9958.50707@bates.id.au> Hi folks, I'm having some difficulty with the start-up procedure of my OTP-based system. Specifically, some applications start up faster than others and so Application A reaches its configuration phase faster than Application B and starts making requests of processes in Application B before they're initialised. I know one way to address this is to use included applications and start_phases. However I don't want to include the applications in each other, I'd like them to stand alone so I can shift them around and things. Someone on IRC suggested having each application's start() function not return until all the processes in that application are initialised, but I can't see an elegant way to do this. I've also heard someone say on this mailing list that they seldom use registered processes, which smacks of global state, and instead manage to pass around pids to only the processes that need them. Again, I don't know of an elegant structure that would allow me to do this for all the disparate parts of my system. Can someone offer some guidance in this matter? Thanks, Tim. -- Tim Bates tim@REDACTED From ulf.wiger@REDACTED Tue Sep 6 15:38:05 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Tue, 6 Sep 2005 15:38:05 +0200 Subject: Process discovery in a large OTP system Message-ID: Hi Tim, The first thing you should try is to use the 'applications' attribute. The application controller will hold off starting an application until all applications listed in 'applications' have been started. You should make sure that once an application returns to the application controller, it is ready to serve request. One way to do this is to use start phases: - Have the Mod:start/2 function call supervisor:start_link() which starts all processes in the application - Specify start_phases that perform any initialization that cannot be done elegantly in the init() functions of each process. /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Tim Bates > Sent: den 6 september 2005 15:28 > To: erlang-questions@REDACTED > Subject: Process discovery in a large OTP system > > > Hi folks, > I'm having some difficulty with the start-up procedure of my > OTP-based > system. Specifically, some applications start up faster than > others and > so Application A reaches its configuration phase faster than > Application > B and starts making requests of processes in Application B before > they're initialised. > > I know one way to address this is to use included applications and > start_phases. However I don't want to include the > applications in each > other, I'd like them to stand alone so I can shift them > around and things. > > Someone on IRC suggested having each application's start() > function not > return until all the processes in that application are > initialised, but > I can't see an elegant way to do this. > > I've also heard someone say on this mailing list that they seldom use > registered processes, which smacks of global state, and > instead manage > to pass around pids to only the processes that need them. > Again, I don't > know of an elegant structure that would allow me to do this > for all the > disparate parts of my system. > > Can someone offer some guidance in this matter? > > Thanks, > Tim. > > -- > Tim Bates > tim@REDACTED > From vlad.xx.dumitrescu@REDACTED Tue Sep 6 15:55:21 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Tue, 6 Sep 2005 15:55:21 +0200 Subject: Compiler backwards compatibility Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE604@esealmw105.eemea.ericsson.se> Hi, Okay, I checked these options, but 'r7' is a little too strong, as I need some of the features in any case. What options should I use in order to get R9 compatibility? The current complaint is for opcode 112, which should mean I have to use no_new_apply, but are there more? best regards, Vlad > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Bjorn > Gustavsson > Sent: Tuesday, September 06, 2005 2:15 PM > To: erlang-questions@REDACTED > Subject: Re: Compiler backwards compatibility > > > While not officially supported, we have some options we use for > testing that should work: > > erlc +r7 file.erl > > OR > > erlc +no_new_binaries +no_new_apply file.erl > > /Bj?rn > > "Vlad Dumitrescu XX (LN/EAB)" > writes: > > > Hi, > > > > Is the R10 compiler able to generate beam files that are > R9-compatible? I don't use any of the new features, but the > beam files contain opcodes that aren't supported on R9. > > > > regards, > > Vlad > > > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > From bjorn@REDACTED Tue Sep 6 17:00:25 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 06 Sep 2005 17:00:25 +0200 Subject: Compiler backwards compatibility In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE604@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE604@esealmw105.eemea.ericsson.se> Message-ID: "Vlad Dumitrescu XX \(LN/EAB\)" writes: > Hi, > > Okay, I checked these options, but 'r7' is a little too strong, as I need some of the features in any case. > You mean no_float_opt and no_new_funs? The code should still work on R9, although floating point operations will be slower. > What options should I use in order to get R9 compatibility? The current complaint is for opcode 112, which should mean I have to use no_new_apply, but are there more? no_new_binaries. I mentioned that in my previous answer (following the "OR"). /Bj?rn > > best regards, > Vlad > > > -----Original Message----- > > From: owner-erlang-questions@REDACTED > > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Bjorn > > Gustavsson > > Sent: Tuesday, September 06, 2005 2:15 PM > > To: erlang-questions@REDACTED > > Subject: Re: Compiler backwards compatibility > > > > > > While not officially supported, we have some options we use for > > testing that should work: > > > > erlc +r7 file.erl > > > > OR > > > > erlc +no_new_binaries +no_new_apply file.erl > > > > /Bj?rn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From rpettit@REDACTED Tue Sep 6 18:58:26 2005 From: rpettit@REDACTED (Rick Pettit) Date: Tue, 6 Sep 2005 11:58:26 -0500 Subject: I had a dread In-Reply-To: <200509051909.22839.mikael.karlsson@creado.com> References: <200509051909.22839.mikael.karlsson@creado.com> Message-ID: <20050906165826.GA20069@vailsys.com> On Mon, Sep 05, 2005 at 07:09:22PM +0200, Mikael Karlsson wrote: > Mon 05 September 2005 09:24 Joe Armstrong (AL/EAB) wrote: > > > What I was suggesting is a wrapper for (say) apt-get - so that once you > > have made your emerge package XX you > > evauate the magic function wrapit(apt, debian , "XX") and it automatically > > produces a debian apt package. > > > > Hi Joe, > > a couple of projects that might fit into your vision: > http://componentizedlinux.org/index.php/Main_Page > http://www.openpkg.org/ I really think it is worth checking out NetBSD Pkgsrc: http://www.netbsd.org/Documentation/software/packages.html I have posted an overview of our build setup before, but perhaps it is worth repeating. Our OTP applications (and all other software) is built from source code using the autotools (i.e. autoconf, automake, libtool, etc). You are going to be hard pressed to find something as flexible, though there is a learning curve (which isn't hard to overcome for people willing to RTFM and look at existing examples--the OpenSource community is loaded with them). After building a "distfile" (i.e. foo.tar.gz which can be extracted and built with the standard "./configure && make && make install") with the autotools we then package the distfile using NetBSD pkgsrc. We use NetBSD pkgsrc because it has a lot of features we care about, and because it is itself ported to most any *NIX we care about. This last point is a big one--when we switch operating system our NetBSD pkgsrc tree comes with us; we aren't forced to make new packages (e.g. going from Solaris to *BSD or Linux and back, etc). Pkgsrc gives us dependency tracking and even supports additional like package "views" (which can be handy when you want to install multiple versions of the same package on a system and not lose track of dependencies). By building our software with the autotools and packaging it with NetBSD pkgsrc we save ourselves a lot of headaches if/when we change OS. And though it is not necessary to remove the native packaging system and replace with pkgsrc we often do as pkgsrc gives us all we need. Anyhow, figured it was worth pointing out. -Rick From ulf@REDACTED Tue Sep 6 21:54:21 2005 From: ulf@REDACTED (Ulf Wiger) Date: Tue, 06 Sep 2005 21:54:21 +0200 Subject: Process discovery in a large OTP system In-Reply-To: <431D9958.50707@bates.id.au> References: <431D9958.50707@bates.id.au> Message-ID: Den 2005-09-06 15:27:52 skrev Tim Bates : > I've also heard someone say on this mailing list that they seldom use > registered processes, which smacks of global state, and instead manage > to pass around pids to only the processes that need them. Again, I don't > know of an elegant structure that would allow me to do this for all the > disparate parts of my system. I am moving in the opposite direction. A first attempt was the proc_reg contrib in Jungerl. I've developed it further (not released yet - sorry) and find the concept very appealing. Basically, you allow processes to register using any term, and if they want to, register under multiple names. Furthermore, you allow them to publish 'properties' which do not have to be unique. Think of processes as actors (which they _are_), and the process registry as the yellow pages, allowing you to find the right actor(s) easily. Add functions to easily operate on serveral actors at the same time - folding over a property in the process dictionary, for example. This can be used as a publish- subscribe pattern: subscribe(Event) -> procs:add_property({subscriber, Event}). notify(Event) -> procs:fold_property(fun({_, Pid}, Acc) -> Pid ! {event, Event} end, ok, {subscriber, Event}). This way, inspecting the published properties of an event tells you stuff about that process, dependencies towards different resources, group membership, etc, and when using the shell for debugging etc, you can rely on the process dictionary to efficiently select subsets of all processess for inspection. /Uffe -- Ulf Wiger From ok@REDACTED Wed Sep 7 02:15:14 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 7 Sep 2005 12:15:14 +1200 (NZST) Subject: (Prolog + LISP + Erlang) with integration issues versus C++ Message-ID: <200509070015.j870FEXJ139212@atlas.otago.ac.nz> Let me share with you something I discovered last night. It had me roaring with laughter rather sadly. Apparently one of the managers' arguments against Erlang &c was "if C/C++ are good enough for Google, they're good enough for us." Someone mentioned that Rob Pike is now at Google, and provided his URL: http://labs.google.com/people/r/ I wondered, if Google hired an expert on operating system design (Plan 9) and programming languages, what is he doing for them? Answer: "He works on distributed systems, data mining, programming languages, and software development tools." ^^^^^^^^^^^^^^^^^^^^^ So I started reading his papers. The relevant one is Interpreting the Data: Parallel Analysis with Sawzall by Pike, Dorward, Griesemer, and Quinlan. The paper describes an *interpreted* "typed-AWK" language called Sawzall. The context goes like this: Google have a Data Definition Language (not described in that paper, but apparently roughly the same kind of thing as ASN.1). "Although originally conceived for defining the messages communicated between servers, Google's protocol buffers are also used to describe the format of permanent records stored on disk. They serve a purpose similar to XML, but have a much denser, binary, represesentation, and an external data description language (DDL) that a protocol compiler can translate into support code for a wide variety of languages." This is the approach I recommended for gluing Lisp/Prolog/Erlang components together: invent and implement, or acquire, a common data language (such as UBF or the rather Prolog-like one from CWI or even ASN.1) and use an interface generator (= protocol compiler) to generate the reading/writing code, so that if you want to add a C or C++ component, you just add an interface generator for them. To start with, them, this means that the bulk of the I/O code in Google programs (other than actual page serving) is *not* written in C or C++, nor is it *hand* written in "a wide variety of languages", it is written once in DDL and shared by "a wide variety of languages". Now this fact alone tells us that Google *use* "a wide variety of languages". Continuing with the context for Sawzall: "The data sets are often stored in ... the Google File System [which] provides a reliable distributed storage system that can grow to petabyte scale. ... MapReduce is a library for applications that run on the [dsitributed load balanced cluster platform] [providing parallelism, distribution, fault tolerance, moving computations close to the data, &c]. ..." This is the kind of "put the good stuff in a library" which OTP basically is, and which the managers were suggesting should be written. Clearly, you can do that, and if you want to know how much work it is, look at OTP, count the lines, and do the COCOMO II or FPA calculations for yourself. GFS, Workqueue, and MapReduce provide a native C/C++ interface. It is possible to write C++ code to do massively parallel calculations on data, and sometimes Google do that. The basic kind of calculation that Google do with this involves *independently* processing each record (the kind of computation that's called "embarassingly parallel") followed by combining the results with commutative associative operations (like sum, filter, maximum, top N, &c). These calculations are mostly straightforward, but they operate on *amazing* volumes of data and may run for days even on a thousand CPUs. They have got to be right, and they have got to be fast. "The query language, Sawzall, operates at about the level of a type-safe scripting language. FOR PROBLEMS THAT CAN BE SOLVED IN SAWZALL, THE RESULTING CODE IS MUCH SIMPLER AND SHORTER - by a factor of ten or more - than the corresponding C++ code in MapReduce. ... Overall, Sawzall programs tend to be around 10 to 20 times shorter than the equivalent MapReduce programs in C++ and significantly easier to write." Sawzall programs pick up the type of the data they are processing from the DDL that describes it. Here is a sample Sawzall program from the paper. Its task is to find "for each web domain, which page in that domain has the highest page rank?" proto "document.proto" max_pagerank_url: table maximum (1) [domain: string] of url: string weight pagerank: int; doc: Document = input; url: string = doc.url; emit max_pagerank_url[domain(url)] <- url weight doc.pagerank; That's it, complete. What about performance? "Sawzall is about 1.6 times slower than interpreted Java, 21 times slower than compiled Jva, and 51 times slower than compiled C++." Ooh dear, 51 times slower than C++? Surely such dreadful performance must mean that it's completely useless. After all, that's basically what the managers were telling Dev Functional, not that they actually had any _evidence_ that the performance would be worse. Well, no, actually. "Although it has been deployed only for about 18 months, Sawzall has become ONE OF THE MOST WIDELY USED PROGRAMMING LANGUAGES AT GOOGLE." You know, Google sounds like a really exciting place to be. It sounds as though they are not in the least stuffy, not afraid to try anything new. How shall I put it? They sound like ENGINEERS! Yes, but what about performance? "One measure of Sawzall's utility is how much data processing it does. We monitored its use during the month of March 2005. During that time, on one dedicated ... cluster with 1500 Xeon CPUs, there were 32,580 Sawzall jobs launched, using an average of 220 machines each. While running those jobs, 18,636 failures occurred (application failure, network outage, system crash, &c) that triggered rerunning some portion of the job. The jobs read a total of 3.2x10**15 bytes of data (2.8PB) and wrote 9.9x10**12 bytes (9.3TB) (demonstrating that the term "data reduction" has some resonance). The average job therefore processed about 100GB. The jobs collectively consumed almost exactly one machine-century." So Google are shoving an almost unimaginable amount of data through this language. What's the secret? There is so *much* data that the jobs are I/O bound, making the Sawzall code 51 times faster would make no difference whatever to over-all system performance. So the Google lesson is the direct OPPOSITE of what the managers said: Google use "a wide variety of languages", not just C/C++. (In addition to Sawzall, Python is repeatedly mentioned.) Google have no hesitation in not only adopting a problem-specific language but inventing one. Using a mix of languages (C++ in the support libraries, DDL for the on-disc data structures, Sawzall for data reduction, sometimes SQL for final analysis of the reduced data) not only doesn't increase system or maintenance costs, it actually reduces them. In an I/O bound application, fifty times slower than C++ for the computational part may be more than fast enough. In a very large system, failures are common (1 for every 2 jobs, or 600+ per day) and automatic restart of affected computations can be a big help (think Erlang supervision trees). From vlad.xx.dumitrescu@REDACTED Wed Sep 7 08:48:25 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Wed, 7 Sep 2005 08:48:25 +0200 Subject: Compiler backwards compatibility Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE606@esealmw105.eemea.ericsson.se> > > What options should I use in order to get R9 compatibility? > The current complaint is for opcode 112, which should mean I > have to use no_new_apply, but are there more? > > no_new_binaries. I mentioned that in my previous answer > (following the "OR"). Oh, yes. Sorry. I thought you had picked just some options at random from the r7 bunch. /Vlad From kruegger@REDACTED Wed Sep 7 10:39:47 2005 From: kruegger@REDACTED (Stephen Han) Date: Wed, 7 Sep 2005 01:39:47 -0700 Subject: Procesing files received via ftp In-Reply-To: <019501c5ad9f$0f5ee610$dc00a8c0@INSWITCH244> References: <019501c5ad9f$0f5ee610$dc00a8c0@INSWITCH244> Message-ID: <86f1f535050907013955ac5423@mail.gmail.com> I used to put the file with temp name and client renaming the file name after finishing uploading the file. Of course the server is polling the specific file name extension on the other hand. However, I found out that this is not enough. Occasionally and specially the file system is NFS and the file is big, this doesn't work well. So I come up with other method. Each file consist of 2 component. Real file and specification file. Ex) - A.exe + A.spec : A.spec has MD5 hash of A.exe and file name - Upload A.exe first - Upload A.spec.lock - Rename A.spec.lock to A.spec - Meanwhile Server polling *.spec - Read A.spec - MD5 (A.exe) and compare with MD5 value in A.spec - Finally get the A.exe On 8/30/05, Sebastian Bello wrote: > > Hi list, > I need to process files received via ftp. > I see two approaches: > 1. poll the ftp directory > How can I make sure a file download has finished? > 2. use a specialized ftp server which triggers file processing after > receipt. > I've been trying the Erlang ftpd implementation. File uploads seems not > to work with a Windows client. And I'm not 100% sure they work fine with a > Linux one. Has anybody used ftpd in a production environment? > Any hints? > Thanks, > Sebastian- > > *Prepaid Expertise - Programmable Switches > Powered by Ericsson Licensed Technology > Sebasti?n Bello - Engineer - 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 > IN SWITCH EMEA Phone: +33 0 6 0335 9427 - Fax: +33 0 4 93655773 / > emea@REDACTED > IN SWITCH ASIA Phone: +92 51 2800397/8- Fax: +92 51 2800399/ > inswasia@REDACTED > e-mail: sebastian@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 klacke@REDACTED Wed Sep 7 13:10:14 2005 From: klacke@REDACTED (Claes Wikstom) Date: Wed, 07 Sep 2005 13:10:14 +0200 Subject: rr(Mod) in the shell Message-ID: <431ECA96.1020408@hyber.org> I've become totally and completely addicted to the feature of the shell where rr(Mod) in the shell reads the record defs of the Module and displays the records nicely in the shell. It would be very nice if also records could be nicely printed by io:format so we could get nice record printouts in logs. Our logs are widely populated by ugly record printouts. I've patched shell.erl and io_lib_format.erl to accomplish this. The format char for records is ~r (ofcource) I'm not claiming that I understand the code in io_lib but if you all think that this is also a nice fetaure, maybe someone who understands the io_lib code better than me could do it properly. As an example, as session from the shell: (mynode@REDACTED)3> [P] = mnesia:dirty_read({person, 6003310130}). [{person,6003310130, "Claes", "Wikstrom", {addr,[],"Malarhojdsvagen 5a",98765,"Stockholm",[],[],[]}, [], [], [], [{53,"247332"}], 0, [{4,63279658768}, {2,63292552384}, {5,63280394364}, {3,63283554755}, {53,63291634548}], 63291634548, ok, 262145024, [], [], 0}] (mynode@REDACTED)4> io:format("Person ~r", [P]). Person #person{pno = 6003310130, fname = "Claes", lname = "Wikstrom", addr = #addr{careof = [], street = "Malarhojdsvagen 5a", postno = 98765, city = "Stockholm", telno = [], cellno = [], email = []}, post_addr = [], extra_company_addrs = [], passwd = [], estore_names = [{53,"247332"}], blacklisted = 0, crdata = [{4,63279658768}, {2,63292552384}, {5,63280394364}, {3,63283554755}, {53,63291634548}], crdate = 63291634548, crresult = ok, credlimit_bits = 262145024, letters = [], email = [], flags = 0}ok The solution (which I believe has been up for disccussion earlier here on the list) is pretty expensive, since all record defs from all modules are kept in an ets table. I'd say it's worth it though, and if the feature isn't used, the ets table never gets created. What do you think ?? /klacke -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: shell.erl.diff URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: io_lib_format.erl.diff URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: klacke.vcf Type: text/x-vcard Size: 345 bytes Desc: not available URL: From joelr1@REDACTED Wed Sep 7 14:41:48 2005 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 7 Sep 2005 14:41:48 +0200 Subject: Erlang vs. Java Message-ID: <0ED34211-4CFE-49B7-BDD2-F240B3DD95E5@gmail.com> Folks, I just posted a comparison of Erlang vs. Java at http://wagerlabs.com/ tech/2005/09/erlang-vs-java.html for reading and writing binary packets. I thought someone might find it interesting. Thanks, Joel From ke.han@REDACTED Wed Sep 7 14:46:53 2005 From: ke.han@REDACTED (ke.han) Date: Wed, 07 Sep 2005 20:46:53 +0800 Subject: rr(Mod) in the shell In-Reply-To: <431ECA96.1020408@hyber.org> References: <431ECA96.1020408@hyber.org> Message-ID: <431EE13D.7070207@redstarling.com> Great improvement Claes. thanks for the code. I'm patching my erlang install immediately! I suppose the bigger question is how do we know if the "keepers of erlang" will accept this submission? I realize that asking for a formal community submission and acceptance process for erlang evolution may require more resources than ericsson can provide at the moment. But simple maililst acknowledgement that they are accepting and will get submissions like this added in short order would be nice. ;-) ke han Claes Wikstom wrote: > > > I've become totally and completely addicted to the > feature of the shell where rr(Mod) in the shell reads the record > defs of the Module and displays the records nicely in the shell. > > It would be very nice if also records could be nicely printed by > io:format so we could get nice record printouts in logs. Our > logs are widely populated by ugly record printouts. > > I've patched shell.erl and io_lib_format.erl to accomplish > this. The format char for records is ~r (ofcource) > > I'm not claiming that I understand the code in io_lib > but if you all think that this is also a nice fetaure, maybe > someone who understands the io_lib code better than me > could do it properly. > > > As an example, as session from the shell: > > (mynode@REDACTED)3> [P] = mnesia:dirty_read({person, 6003310130}). > [{person,6003310130, > "Claes", > "Wikstrom", > {addr,[],"Malarhojdsvagen 5a",98765,"Stockholm",[],[],[]}, > [], > [], > [], > [{53,"247332"}], > 0, > [{4,63279658768}, > {2,63292552384}, > {5,63280394364}, > {3,63283554755}, > {53,63291634548}], > 63291634548, > ok, > 262145024, > [], > [], > 0}] > > (mynode@REDACTED)4> io:format("Person ~r", [P]). > Person #person{pno = 6003310130, > fname = "Claes", > lname = "Wikstrom", > addr = #addr{careof = [], > street = "Malarhojdsvagen 5a", > postno = 98765, > city = "Stockholm", > telno = [], > cellno = [], > email = []}, > post_addr = [], > extra_company_addrs = [], > passwd = [], > estore_names = [{53,"247332"}], > blacklisted = 0, > crdata = [{4,63279658768}, > {2,63292552384}, > {5,63280394364}, > {3,63283554755}, > {53,63291634548}], > crdate = 63291634548, > crresult = ok, > credlimit_bits = 262145024, > letters = [], > email = [], > flags = 0}ok > > > > > The solution (which I believe has been up for disccussion > earlier here on the list) is pretty expensive, since all > record defs from all modules are kept in an ets table. I'd > say it's worth it though, and if the feature isn't used, the > ets table never gets created. > > > What do you think ?? > > > /klacke > From john-olof.bauner@REDACTED Wed Sep 7 14:51:33 2005 From: john-olof.bauner@REDACTED (John-Olof Bauner (KI/EAB)) Date: Wed, 7 Sep 2005 14:51:33 +0200 Subject: Erlang vs. Java Message-ID: And at Ericsson the managers would become so small if we would use this neat Erlang technology. And how many project leaders would loose their jobs. BR -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED]On Behalf Of Joel Reymont Sent: den 7 september 2005 14:42 To: Erlang Users' List Subject: Erlang vs. Java Folks, I just posted a comparison of Erlang vs. Java at http://wagerlabs.com/ tech/2005/09/erlang-vs-java.html for reading and writing binary packets. I thought someone might find it interesting. Thanks, Joel From erlang@REDACTED Wed Sep 7 15:55:39 2005 From: erlang@REDACTED (Peter-Henry Mander) Date: Wed, 07 Sep 2005 14:55:39 +0100 Subject: Erlang vs. Java In-Reply-To: References: Message-ID: <1126101339.6347.74.camel@hymir.newport-networks.com> ... But on the other hand, don't pick a fight you can't win. Thanks Joel for supplying convincing evidence to supplement what I already knew was the case with Erlang vs. C++. But even if you _know_ you're right, as Dr. Joe says, you can't win an argument. Specially with the boss. Pete. On Wed, 2005-09-07 at 14:51 +0200, John-Olof Bauner (KI/EAB) wrote: > And at Ericsson the managers would become so small if we would use this neat Erlang technology. > And how many project leaders would loose their jobs. > > BR -- "The Tao of Programming flows far away and returns on the wind of morning." From ulf.wiger@REDACTED Wed Sep 7 15:55:25 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 7 Sep 2005 15:55:25 +0200 Subject: rr(Mod) in the shell Message-ID: Agreed. I think it's a good idea too ;-) (http://www.erlang.org/ml-archive/erlang-questions/200505/msg00201.html) One problem I ran into was printing from a remote shell. I haven't checked whether that will be a problem with your code as well, and it wasn't actually clear to me why it was happening at all. Something about the translation of pids, I think, that causes it not to find the ets table (because it gets confused about whether it is local or remote) Perhaps that's something one can live with... /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Claes Wikstom > Sent: den 7 september 2005 13:10 > To: erlang-questions@REDACTED > Subject: rr(Mod) in the shell > > > > > I've become totally and completely addicted to the > feature of the shell where rr(Mod) in the shell reads the record > defs of the Module and displays the records nicely in the shell. > > It would be very nice if also records could be nicely printed by > io:format so we could get nice record printouts in logs. Our > logs are widely populated by ugly record printouts. > > I've patched shell.erl and io_lib_format.erl to accomplish > this. The format char for records is ~r (ofcource) > > I'm not claiming that I understand the code in io_lib > but if you all think that this is also a nice fetaure, maybe > someone who understands the io_lib code better than me > could do it properly. > > > As an example, as session from the shell: > > (mynode@REDACTED)3> [P] = mnesia:dirty_read({person, 6003310130}). > [{person,6003310130, > "Claes", > "Wikstrom", > {addr,[],"Malarhojdsvagen 5a",98765,"Stockholm",[],[],[]}, > [], > [], > [], > [{53,"247332"}], > 0, > [{4,63279658768}, > {2,63292552384}, > {5,63280394364}, > {3,63283554755}, > {53,63291634548}], > 63291634548, > ok, > 262145024, > [], > [], > 0}] > > (mynode@REDACTED)4> io:format("Person ~r", [P]). > Person #person{pno = 6003310130, > fname = "Claes", > lname = "Wikstrom", > addr = #addr{careof = [], > street = "Malarhojdsvagen 5a", > postno = 98765, > city = "Stockholm", > telno = [], > cellno = [], > email = []}, > post_addr = [], > extra_company_addrs = [], > passwd = [], > estore_names = [{53,"247332"}], > blacklisted = 0, > crdata = [{4,63279658768}, > {2,63292552384}, > {5,63280394364}, > {3,63283554755}, > {53,63291634548}], > crdate = 63291634548, > crresult = ok, > credlimit_bits = 262145024, > letters = [], > email = [], > flags = 0}ok > > > > > The solution (which I believe has been up for disccussion > earlier here on the list) is pretty expensive, since all > record defs from all modules are kept in an ets table. I'd > say it's worth it though, and if the feature isn't used, the > ets table never gets created. > > > What do you think ?? > > > /klacke > > From ulf.wiger@REDACTED Wed Sep 7 15:56:26 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 7 Sep 2005 15:56:26 +0200 Subject: Erlang vs. Java Message-ID: We _are_ using this neat technology, J-O. (: (I know, not where you're sitting.) /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of > John-Olof Bauner > (KI/EAB) > Sent: den 7 september 2005 14:52 > To: Joel Reymont; Erlang Users' List > Subject: RE: Erlang vs. Java > > > And at Ericsson the managers would become so small if we > would use this neat Erlang technology. > And how many project leaders would loose their jobs. > > BR > > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Joel Reymont > Sent: den 7 september 2005 14:42 > To: Erlang Users' List > Subject: Erlang vs. Java > > > Folks, > > I just posted a comparison of Erlang vs. Java at http://wagerlabs.com/ tech/2005/09/erlang-vs-java.html for reading and writing binary packets. I thought someone might find it interesting. Thanks, Joel From orbitz@REDACTED Wed Sep 7 16:49:55 2005 From: orbitz@REDACTED (orbitz@REDACTED) Date: Wed, 7 Sep 2005 10:49:55 -0400 Subject: rr(Mod) in the shell In-Reply-To: References: Message-ID: <39df15520a4414aa98f19a2911c2f429@ezabel.com> Does it still work if you have the same record name but different definitions for different modules? For instance, an ugly habit I have is to hold processor state I create a record local to that module named 'self'. So every module has it's own self record. I don't know how the record system works but that wouldn't be a problem would it? On Sep 7, 2005, at 9:55 AM, Ulf Wiger (AL/EAB) wrote: > > Agreed. I think it's a good idea too ;-) > (http://www.erlang.org/ml-archive/erlang-questions/200505/ > msg00201.html) > > One problem I ran into was printing from a remote shell. > I haven't checked whether that will be a problem with > your code as well, and it wasn't actually clear to me > why it was happening at all. Something about the translation > of pids, I think, that causes it not to find the ets table > (because it gets confused about whether it is local or remote) > > Perhaps that's something one can live with... > > /Uffe > >> -----Original Message----- >> From: owner-erlang-questions@REDACTED >> [mailto:owner-erlang-questions@REDACTED]On Behalf Of Claes Wikstom >> Sent: den 7 september 2005 13:10 >> To: erlang-questions@REDACTED >> Subject: rr(Mod) in the shell >> >> >> >> >> I've become totally and completely addicted to the >> feature of the shell where rr(Mod) in the shell reads the record >> defs of the Module and displays the records nicely in the shell. >> >> It would be very nice if also records could be nicely printed by >> io:format so we could get nice record printouts in logs. Our >> logs are widely populated by ugly record printouts. >> >> I've patched shell.erl and io_lib_format.erl to accomplish >> this. The format char for records is ~r (ofcource) >> >> I'm not claiming that I understand the code in io_lib >> but if you all think that this is also a nice fetaure, maybe >> someone who understands the io_lib code better than me >> could do it properly. >> >> >> As an example, as session from the shell: >> >> (mynode@REDACTED)3> [P] = mnesia:dirty_read({person, 6003310130}). >> [{person,6003310130, >> "Claes", >> "Wikstrom", >> {addr,[],"Malarhojdsvagen 5a",98765,"Stockholm",[],[],[]}, >> [], >> [], >> [], >> [{53,"247332"}], >> 0, >> [{4,63279658768}, >> {2,63292552384}, >> {5,63280394364}, >> {3,63283554755}, >> {53,63291634548}], >> 63291634548, >> ok, >> 262145024, >> [], >> [], >> 0}] >> >> (mynode@REDACTED)4> io:format("Person ~r", [P]). >> Person #person{pno = 6003310130, >> fname = "Claes", >> lname = "Wikstrom", >> addr = #addr{careof = [], >> street = "Malarhojdsvagen 5a", >> postno = 98765, >> city = "Stockholm", >> telno = [], >> cellno = [], >> email = []}, >> post_addr = [], >> extra_company_addrs = [], >> passwd = [], >> estore_names = [{53,"247332"}], >> blacklisted = 0, >> crdata = [{4,63279658768}, >> {2,63292552384}, >> {5,63280394364}, >> {3,63283554755}, >> {53,63291634548}], >> crdate = 63291634548, >> crresult = ok, >> credlimit_bits = 262145024, >> letters = [], >> email = [], >> flags = 0}ok >> >> >> >> >> The solution (which I believe has been up for disccussion >> earlier here on the list) is pretty expensive, since all >> record defs from all modules are kept in an ets table. I'd >> say it's worth it though, and if the feature isn't used, the >> ets table never gets created. >> >> >> What do you think ?? >> >> >> /klacke >> >> > From klacke@REDACTED Wed Sep 7 16:52:12 2005 From: klacke@REDACTED (Claes Wikstom) Date: Wed, 07 Sep 2005 16:52:12 +0200 Subject: rr(Mod) in the shell In-Reply-To: References: Message-ID: <431EFE9C.6060003@hyber.org> Ulf Wiger (AL/EAB) wrote: > Agreed. I think it's a good idea too ;-) > (http://www.erlang.org/ml-archive/erlang-questions/200505/msg00201.html) > > One problem I ran into was printing from a remote shell. > I haven't checked whether that will be a problem with > your code as well, yes there is a problem, It's solveable though assuming that the same set of modules are loaded on the two nodes which probably is unrealistic. It would be a shame if the shell 'r Node' capability which I rareley (If ever) use breaks this. /klacke -------------- next part -------------- A non-text attachment was scrubbed... Name: klacke.vcf Type: text/x-vcard Size: 345 bytes Desc: not available URL: From klacke@REDACTED Wed Sep 7 16:55:20 2005 From: klacke@REDACTED (Claes Wikstom) Date: Wed, 07 Sep 2005 16:55:20 +0200 Subject: rr(Mod) in the shell In-Reply-To: <39df15520a4414aa98f19a2911c2f429@ezabel.com> References: <39df15520a4414aa98f19a2911c2f429@ezabel.com> Message-ID: <431EFF58.4020401@hyber.org> orbitz@REDACTED wrote: > Does it still work if you have the same record name but different > definitions for different modules? No, Needs some though .... /klacke -------------- next part -------------- A non-text attachment was scrubbed... Name: klacke.vcf Type: text/x-vcard Size: 345 bytes Desc: not available URL: From ulf.wiger@REDACTED Wed Sep 7 17:21:23 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 7 Sep 2005 17:21:23 +0200 Subject: rr(Mod) in the shell Message-ID: I've been thinking (but haven't been able to verify) that the shell should be able to detect and cope with the issues of running as remote shell. Every once in a while, very strange things happen when running as remote shell. This violates the principle of least astonishment, but perhaps not enough people use this feature to raise enough complaints about it? /Uffe > -----Original Message----- > From: Claes Wikstom [mailto:klacke@REDACTED] > Sent: den 7 september 2005 16:52 > To: Ulf Wiger (AL/EAB) > Cc: erlang-questions@REDACTED > Subject: Re: rr(Mod) in the shell > > > Ulf Wiger (AL/EAB) wrote: > > Agreed. I think it's a good idea too ;-) > > > (http://www.erlang.org/ml-archive/erlang-questions/200505/msg0 > 0201.html) > > > > One problem I ran into was printing from a remote shell. > > I haven't checked whether that will be a problem with > > your code as well, > > yes there is a problem, > > It's solveable though assuming that the same > set of modules are loaded on the two nodes which > probably is unrealistic. > > It would be a shame if the shell 'r Node' > capability which I rareley (If ever) use > breaks this. > > > /klacke > From saifi.k@REDACTED Wed Sep 7 18:07:19 2005 From: saifi.k@REDACTED (=?iso-8859-1?Q?Saifi?=) Date: Wed, 07 Sep 2005 21:37:19 +0530 Subject: Introduction Message-ID: <20050907160719.906.qmail@coolhost77.com> Hi: I would like to introduce myself as Saifi Khan and an Erlang newbie. While taking reading Tim Bray's blog on CMT http://www.tbray.org/ongoing/When/200x/2005/06/20/Threads I happened to read about Erlang. I also read Joe's paper on Concurrency in Erlang at LL2. The concept of Concurrency as a construct is quite interesting. Couple of queries about Slides - Q. [Create more processes than OS supports.] Does Erlang process imply threads here ? Are the processes (threads) here library managed ? Is there a documentation for the user API somewhere ? Q. [Message Passing is "send and pray"] Is it UDP based communication ? Q. [Erlang is used in Nortel Alteon SSL Accelerator] What feature has been implemented in Erlang ? Is it SSL ? (Looked a Nortel Site, but they have no data on Erlang). Q. [Things in the world don't share data] Doesn't this make the program's inefficient ? In C programs we have shared data among various threads ? Misc questions - Q. Is Erlang a functional programming language ? Q. What is the best class of problems to solve with Erlang ? (The slides talk about soft real-time systems). Q. What class of problems *cannot* be solved using Erlang ? (eg. with Java we don't do Systems programming). Q. What are the new books on Erlang ? (could find only one on Amazon.com) I am keen to learn more about the language and have a C/C++/Java background. Thanks in advance. thanks Saifi . -- TWINCLING Society www.twincling.org freedom of innovation From chandrashekhar.mullaparthi@REDACTED Wed Sep 7 18:20:09 2005 From: chandrashekhar.mullaparthi@REDACTED (chandru) Date: Wed, 7 Sep 2005 17:20:09 +0100 Subject: rr(Mod) in the shell In-Reply-To: References: Message-ID: On 07/09/05, Ulf Wiger (AL/EAB) wrote: > > I've been thinking (but haven't been able to verify) > that the shell should be able to detect and cope with > the issues of running as remote shell. > > Every once in a while, very strange things happen when > running as remote shell. This violates the principle > of least astonishment, but perhaps not enough people > use this feature to raise enough complaints about it? I agree. I use this feature and the only strange thing I've encountered is that output messages are not printed to the remote shell being used - it is instead printed to the local shell i.e the shell which is local to the node - and this does reduce it's usefullness quite a lot. I never complained either. Chandru From chandrashekhar.mullaparthi@REDACTED Wed Sep 7 19:40:14 2005 From: chandrashekhar.mullaparthi@REDACTED (chandru) Date: Wed, 7 Sep 2005 18:40:14 +0100 Subject: Introduction In-Reply-To: <20050907160719.906.qmail@coolhost77.com> References: <20050907160719.906.qmail@coolhost77.com> Message-ID: Hi, On 07/09/05, Saifi wrote: > Hi: > > I would like to introduce myself as Saifi Khan and an Erlang newbie. > > While taking reading Tim Bray's blog on CMT > http://www.tbray.org/ongoing/When/200x/2005/06/20/Threads > I happened to read about Erlang. > > I also read Joe's paper on Concurrency in Erlang at LL2. > The concept of Concurrency as a construct is quite interesting. > > Couple of queries about Slides - > > Q. [Create more processes than OS supports.] > Does Erlang process imply threads here ? No - an erlang node is a virtual machine which has it's own lightweight processes. Though an erlang node can use multiple OS threads for IO. > Are the processes (threads) here library managed ? The concept of a process is at the heart of erlang. > Is there a documentation for the user API somewhere ? Look in the manpage for the erlang module or the proc_lib module and look for the spawn/3,4,5 functions. > > Q. [Message Passing is "send and pray"] > Is it UDP based communication ? No - each process has it's own message queue which is part of the heap space allocated for a process. What is meant by "send and pray" is that when process A sends a message to process B, but there is no automatic way for A to surely know that B has received the message. As long as process B exists, the message is guaranteed to be inserted into B's message queue. When both processes exist in the same erlang node, the VM directly inserts the message into B's message queue. If B exists on another erlang node, the message is sent via distributed erlang to the other node and that VM inserts the message into B's message queue. > > Q. [Erlang is used in Nortel Alteon SSL Accelerator] > What feature has been implemented in Erlang ? Is it SSL ? I am a user of this product so I might be wrong - but from what I know the it uses OpenSSL for all SSL termination but erlang is used to do "everything else" (other than the switching ofcourse). > Q. [Things in the world don't share data] > Doesn't this make the program's inefficient ? > In C programs we have shared data among various threads ? One of the design rules when using erlang is that you should first write code which solves your problem elegantly. Then you should measure the performance to see if it meets your requirements. If it does, who cares if it is inefficient. If it doesn't, then you tweak your implementation to share data using some built in components such as ETS and improve your performance. Sharing data is *bad* - repeat this mantra until you believe it :-) > Misc questions - > > Q. Is Erlang a functional programming language ? It is. > Q. What is the best class of problems to solve with Erlang ? > (The slides talk about soft real-time systems). Erlang is widely in use in the telecoms and banking industry. Basically any systems where you need fast response times, 5 nines availability, redundancy, and distribution can benefit from using erlang. > Q. What class of problems *cannot* be solved using Erlang ? > (eg. with Java we don't do Systems programming). Erlang isn't good at GUIs. You wouldn't want to use it to parse huge amounts of data either. With 32 bit erlang, each erlang node can only address 4GB of memory. So if you need databases bigger than this, you'll have to look elsewhere. But when 64 bit erlang is ready for prime time, this might change. > Q. What are the new books on Erlang ? > (could find only one on Amazon.com) There is a French one written by Mickael Remond besides the "red book". Other than that, ask any question on this mailing list. It's as good as having a book! > I am keen to learn more about the language and have a > C/C++/Java background. I had a warm fuzzy feeling in my stomach when I first found erlang after grappling with C++. :-) I'm sure you'll experience it as well. cheers Chandru From ke.han@REDACTED Wed Sep 7 19:55:13 2005 From: ke.han@REDACTED (ke.han) Date: Thu, 08 Sep 2005 01:55:13 +0800 Subject: Introduction In-Reply-To: <20050907160719.906.qmail@coolhost77.com> References: <20050907160719.906.qmail@coolhost77.com> Message-ID: <431F2981.7020206@redstarling.com> Saifi, I'm pretty new to erlang as well (about 6 months). Let me see if I can answer some of your questions. I assume the list will correct me if I''m wrong. Saifi wrote: > >Q. [Create more processes than OS supports.] > Does Erlang process imply threads here ? > Are the processes (threads) here library managed ? > Is there a documentation for the user API somewhere ? > > Erlang uses its own processes internal to the erlang VM. This is how Smalltalk has traditional dealt with processes and also how Jave used to do it early on. That's where the comparison stops though as erlang provides for more reliable process scheduling. There are many benefits to this. One you mention that you are only limited by the OS in terms of RAM needed to handle the processes. Another benefit is is you can expect an erlang app to behave the same on different OSes since it doesn't rely on the native OS process/thread scheduling. >Q. [Message Passing is "send and pray"] > Is it UDP based communication ? > > No, I beleive message passing between distributed erlang nodes is tcp. Message passing internal to a VM uses erlang internal methods of process communication. Although messaging is not guaranteed, it is more robust than other alternatives and erlang programming methods mostly ensure that you can easily know when something fails. >Q. [Erlang is used in Nortel Alteon SSL Accelerator] > What feature has been implemented in Erlang ? Is it SSL ? > (Looked a Nortel Site, but they have no data on Erlang). > > Yeah, companies that sell boxes don't usually worry too much about telling their customer base about internal technologies utilized. Erlang has implemented its own tcp stack protocol and ssl libraries. >Q. [Things in the world don't share data] > Doesn't this make the program's inefficient ? > In C programs we have shared data among various threads ? > > Depends on how you write the app. In good OO design, you want everything encapuslated so that you send in as little data as possible to a method and only data needed to supply the result is sent back. The object should shield you from the larger internal data structures it may use to determine your result. In other words, you almost never want to expose a large data structure to be accessed among multiple processes/objects. In case where you do need to have multiple processes operate on shared data, elrang has built in support for simple in memery tables (ets), disk based tables (dets), and a full transactional database (mnesia) which uses ets and dets as its internal store. Using these facilities, you can solve almost all your needs to safe mulit process access to large data structures. >Misc questions - > >Q. Is Erlang a functional programming language ? > > Not purely functional. Its has many functional aspects. Noteably, lazy evaluation is missing. >Q. What is the best class of problems to solve with Erlang ? > (The slides talk about soft real-time systems). > > That is the original use for erlang. But the creators did too good a job ;-). Now others outside ericsson (myself, for one) are using it for tradition business applications (web oriented server databases in my case) >Q. What class of problems *cannot* be solved using Erlang ? > (eg. with Java we don't do Systems programming). > > You should read the FAQ on www.erlang.org. Also there is much erlang documentation available. The intro docs talk about these sorts of issues. As a programmer who spent 6 years building very sophisticated Java server and client systems, I can tell you I don't miss Java one bit. Everything I do in erlang is faster to write and more reliable. erlang can make effiicient use of C libraries (see erlang Interface docs). This enables you to do "bare metal" programming if necessary. There are also libraries to eaily connect to Java (see JInterface docs). Communicating is one of the things erlang does best. Interacting with other libraries, processes written in any language is pretty straighforward. Also, erlang "scales down" pretty well from what I've read on this list. You can do embedded systems work using low power CPUs with only about 64MB RAM. >Q. What are the new books on Erlang ? > (could find only one on Amazon.com) > > Just a few months ago, I purchased a used version of "Concurrent Programming in ERLANG" from Amazon. The book is getting dated, but serves as a very good starting point for learning erlang language concepts. The first half of this book is available for download in PDF form at www.erlang.org. Between erlang.org, erlang.se and trapexit.org, you will find all the docs you need. >I am keen to learn more about the language and have a >C/C++/Java background. > > Keep an open mind, read lots of docs, practice erlang through its interactive shell environment, and read maillist archives. You can learn alot in very short time. have fun, ke han >Thanks in advance. > >thanks >Saifi . > >-- >TWINCLING Society www.twincling.org >freedom of innovation > > From akopa@REDACTED Wed Sep 7 21:01:35 2005 From: akopa@REDACTED (Matthew D Swank) Date: Wed, 07 Sep 2005 14:01:35 -0500 Subject: configure script in jungerl Message-ID: <431F390F.2010806@charter.net> Ulf Wiger wrote: > When trying to build the jungerl code on my Libranet (Debian) distro, > I encountered some autoheader errors. > > After some reading and hacking around, I made it work by changing > all AC_DEFINEs to an alternative syntax. This made autoheader stop > complaining about missing templates. > > For example, in config/aclocal.m4: > > AC_DEFINE(HAVE_MSGHDR_MSG_CONTROL) > > was changed to: > > AC_DEFINE([HAVE_MSGHDR_MSG_CONTROL], [], [Description]) > > and ditto for all AC_DEFINE(...) and AC_DEFINE_UNQUOTED(...) > in configure.in. > > I don't feel comfortable enough mucking around in this stuff > to commit my changes to sourceforge. Perhaps someone else can > judge whether this is something that should be done? > > Also, should it really be [Description] literally, or should > something descriptive be written in there instead? > > /Uffe according to the info file: Autoheader Macros ----------------- `autoheader' scans `configure.ac' and figures out which C preprocessor symbols it might define. It knows how to generate templates for symbols defined by `AC_CHECK_HEADERS', `AC_CHECK_FUNCS' etc., but if you `AC_DEFINE' any additional symbol, you must define a template for it. If there are missing templates, `autoheader' fails with an error message. The simplest way to create a template for a SYMBOL is to supply the DESCRIPTION argument to an `AC_DEFINE(SYMBOL)' ----------------- So a reasonable replacement would be AC_DEFINE(HAVE_MSGHDR_MSG_CONTROL,,HAVE_MSGHDR_MSG_CONTROL) for AC_DEFINE(HAVE_MSGHDR_MSG_CONTROL) and AC_DEFINE_UNQUOTED(CPU_VENDOR_OS, "$target", CPU_VENDOR_OS) for AC_DEFINE_UNQUOTED(CPU_VENDOR_OS, "$target") Though cutting and pasting from the error message works correctly also. Matt From ulf@REDACTED Wed Sep 7 22:44:25 2005 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 07 Sep 2005 22:44:25 +0200 Subject: Introduction In-Reply-To: References: <20050907160719.906.qmail@coolhost77.com> Message-ID: Den 2005-09-07 19:40:14 skrev chandru : >> Q. [Things in the world don't share data] >> Doesn't this make the program's inefficient ? >> In C programs we have shared data among various threads ? > One of the design rules when using erlang is that you should first > write code which solves your problem elegantly. Then you should > measure the performance to see if it meets your requirements. If it > does, who cares if it is inefficient. If it doesn't, then you tweak > your implementation to share data using some built in components such > as ETS and improve your performance. Sharing data is *bad* - repeat > this mantra until you believe it Actually, as the Erlang compiler and runtime system grow ever more sophisticated, it may become evident that not allowing explicit data sharing at the programmer level may *improve* performance rather than hurting it. Take the (experimental) "shared heap" for example, where all message passing between processes is done by passing pointer references. True, there is still "copy-on-write", but even at this point, you'd have to be a pretty expert C programmer to have the same degree of sharing together with the same degree of concurrency. It is not at all uncommon to see Erlang programs outperform C/C++ programs when a lot of concurrency is called for. As Erlang takes care of the really scary stuff (managing pointers and avoiding thrashing data structures), the programmer can focus on the more interesting problem of selecting the right algorithms for the job. /Uffe -- Ulf Wiger From thomasl_erlang@REDACTED Thu Sep 8 00:32:26 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 7 Sep 2005 15:32:26 -0700 (PDT) Subject: rr(Mod) in the shell In-Reply-To: <431EFF58.4020401@hyber.org> Message-ID: <20050907223226.70289.qmail@web34407.mail.mud.yahoo.com> --- Claes Wikstom wrote: > orbitz@REDACTED wrote: > > Does it still work if you have the same record > name but different > > definitions for different modules? > > No, > > Needs some though .... This is fairly common; in R10B7, 126 modules define a record named 'state' for example. I'd recommend implementing first class records to get this right. However, the original definition of records makes painfully clear that records are only syntactic sugar for macro expansion to tuples, so backwards compatibility may be nontrivial. Another option might be multiple record views of tuples. If a tuple looks like {rec_tag, X1,...,Xn}, then any definitions of a record named rec_tag with precisely n fields can be used to print it. Deciding which printer is correct is left to the implementor. (I can think of one simple way to decide: add a hidden field to each record to indicate the UNIQUE name of the record and use that, rather than the non-unique record name, to select the printing function. Solving the other problems with this approach is left as an exercise.) Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From thomasl_erlang@REDACTED Thu Sep 8 00:50:19 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 7 Sep 2005 15:50:19 -0700 (PDT) Subject: Introduction In-Reply-To: <20050907160719.906.qmail@coolhost77.com> Message-ID: <20050907225019.81319.qmail@web34414.mail.mud.yahoo.com> --- Saifi wrote: > Couple of queries about Slides - > > Q. [Create more processes than OS supports.] > Does Erlang process imply threads here ? > Are the processes (threads) here library managed > ? > Is there a documentation for the user API > somewhere ? At the language level, "logically", Erlang processes are independent, shared-nothing processes. An implementation may use green threads, OS threads, or something else when implementing the language. (In the current main implementation, green threads are used inside each node for Erlang processes. A node is a heavyweight process.) > Q. [Message Passing is "send and pray"] > Is it UDP based communication ? Again, logically, messages are sent from one process to another. The mechanism for this is up to the specific implementation. (Some implementations copy most of the message when sending messages within a node, others don't; distributed Erlang normally uses TCP/IP between nodes, but you can write your own bearer.) > Q. [Things in the world don't share data] > Doesn't this make the program's inefficient ? > In C programs we have shared data among various > threads ? The answer to this again depends on the implementation. In the regular Erlang/OTP, some data are shared, most are not. In other versions, most or all data are shared. This choice is normally not visible on the language level. Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From thomasl_erlang@REDACTED Thu Sep 8 01:09:19 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 7 Sep 2005 16:09:19 -0700 (PDT) Subject: Introduction In-Reply-To: Message-ID: <20050907230920.63290.qmail@web34410.mail.mud.yahoo.com> --- Ulf Wiger wrote: > It is not at all uncommon to see Erlang programs > outperform C/C++ > programs when a lot of concurrency is called for. As > Erlang takes > care of the really scary stuff (managing pointers > and avoiding > thrashing data structures), the programmer can focus > on the > more interesting problem of selecting the right > algorithms for the job. One view of Erlang/OTP is as a scripting glue controlling a sophisticated, battle-hardened C library for highly reliable massive concurrency and I/O. Why on earth shouldn't that be competitive with yet another C++ program? Best, Thomas ______________________________________________________ Click here to donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ From ft@REDACTED Thu Sep 8 08:06:56 2005 From: ft@REDACTED (Fredrik Thulin) Date: Thu, 8 Sep 2005 08:06:56 +0200 Subject: proto_dist inet_ssl broken in R10B-7? In-Reply-To: <200509021139.28855.ft@it.su.se> References: <200509021139.28855.ft@it.su.se> Message-ID: <65eebe027c922d81f7388bb0f5359c72@it.su.se> On 2 sep 2005, at 11.39, Fredrik Thulin wrote: > Hi > > Is it just me, or is -proto_dist inet_ssl broken in R10B-7? Does the absense of replys mean that I am the only one not getting distributet Erlang using SSL working in R10B-7, or that I am the only one trying? If someone is using proto_dist inet_ssl in R10B-7, please let me know. /Fredrik From bengt.kleberg@REDACTED Thu Sep 8 08:22:57 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 08 Sep 2005 08:22:57 +0200 Subject: configure script in jungerl In-Reply-To: <431F390F.2010806@charter.net> References: <431F390F.2010806@charter.net> Message-ID: <431FD8C1.2060205@ericsson.com> > Ulf Wiger wrote: > >> When trying to build the jungerl code on my Libranet (Debian) distro, >> I encountered some autoheader errors. while my dislike of autotools make me an unsuitable person to discuss their use, i still think i can contribute something here. imho it is an error to distribute a tarball that is missing the configure script. the configure script should already have been generated before the tarball is created and included in it. when i unpacked a tarball without the configure script and try to do ''make'' i always get an error similar to this: make: Fatal error in reader: config/include.mk, line 12: Unexpected end of line seen i then switch to gnumake and get this error instead: autoconf Can't locate object method "path" via package "Autom4te::Request" (perhaps you forgot to load "Autom4te::Request"?) at /EDUP/Autoconf/2.54/bin/autom4te line 81. imho one idea with the autotools is(was?) that the ''end user'' should not need to have them installed when building the c program that had been ported by using autotools. bengt From joe.armstrong@REDACTED Thu Sep 8 08:25:24 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Thu, 8 Sep 2005 08:25:24 +0200 Subject: Introduction Message-ID: > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Saifi > Sent: den 7 september 2005 18:07 > To: erlang-questions@REDACTED > Subject: Introduction > > > Hi: > > I would like to introduce myself as Saifi Khan and an Erlang newbie. > Welcome ... > While taking reading Tim Bray's blog on CMT > http://www.tbray.org/ongoing/When/200x/2005/06/20/Threads > I happened to read about Erlang. > > I also read Joe's paper on Concurrency in Erlang at LL2. > The concept of Concurrency as a construct is quite interesting. It's not only interesting - *it's how the world works* The world is parallel. Most programming languages are sequential. Programming parallel problems (ie problems interacting with the real world) in sequential languages is *incredibly difficult* Programming then in Erlang is *much* easier > > Couple of queries about Slides - > > Q. [Create more processes than OS supports.] > Does Erlang process imply threads here ? In most languages processes and threads belong *outside* the language and are provided by the OS - threads in C++ "means" an API that allows you to create an OS thread. In Erlang processes *are part of the language* - The Erlang run-time system just uses one OS process - and implements it's own memory management and context switching *within* this process. So while you're using one OS process, there with be 100K Erlang processes running inside the Erlang VM. Note also Erlang processes are much smaller and faster to create than OS threads. > Are the processes (threads) here library managed ? > Is there a documentation for the user API somewhere ? There is no user API - process creation is part of the language. Pid = spawn(fun() -> .... end) creates a process Pid ! M sends the message M to process Pid receive is selective receive {Pid1, M1} -> receive M1 from Pid1 or M2 from Pid2 ... etc. [Pid2, M2} -> ... end That's it ! > > Q. [Message Passing is "send and pray"] Pid ! M means send Message M to Pid "send and pray" means you will never know if it *arrived* at Pid if you want to be sure send a reply message and wait for it > Is it UDP based communication ? No - UDP/TCP is how system talk to each other Two Erlang nodes might use TCP/UDP to talk to each other - though this is not defined > > Q. [Erlang is used in Nortel Alteon SSL Accelerator] > What feature has been implemented in Erlang ? Is it SSL ? > (Looked a Nortel Site, but they have no data on Erlang). I'll let the Nortel people answer this :-) > Q. [Things in the world don't share data] > Doesn't this make the program's inefficient ? Yes - but - let's suppose you want to make a fault-tolerant system To make a fault-tolerant system you MUST use at least TWO computers and hope they don't both crash at the same time :-) You must also replicate all critical data on both computers. So Fault tolerance *implies* sharing. So yes sharing stuff leads to efficient non fault-tolerant programs. The key to efficiency is *parallelism* - sharing prevents (or hinders) parallelism so non-shared data system can each work on their chunks of data in parallel with no worries ... So the short answer is yes it is less efficient - but the long answer is "it has to be like this" if you want to make it scalable and fault-tolerant > In C programs we have shared data among various threads ? > This sucks > Misc questions - > > Q. Is Erlang a functional programming language ? > No - it's a concurrent language > Q. What is the best class of problems to solve with Erlang ? > (The slides talk about soft real-time systems). Scalable fault-tolerant distributed soft real-time systems that must run forever > Q. What class of problems *cannot* be solved using Erlang ? > (eg. with Java we don't do Systems programming). None. But memory intensive computations (JPG compression, etc.) should e written in C (note C - NOT *anything* else :-) > Q. What are the new books on Erlang ? > (could find only one on Amazon.com) No - there is a good French book (is anybody translating this?) > I am keen to learn more about the language and have a > C/C++/Java background. Great - welcome to the club /Joe > > Thanks in advance. > > thanks > Saifi . > > -- > TWINCLING Society > www.twincling.org > freedom of innovation > From joelr1@REDACTED Thu Sep 8 09:01:57 2005 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 8 Sep 2005 09:01:57 +0200 Subject: Erlang vs. Java In-Reply-To: References: Message-ID: Folks, There's a comment at http://wagerlabs.com/tech/2005/09/erlang-vs- java.html that asks very interesting questions on how you would do things in Erlang vs. Java, the type of questions that Erlang lovers here appreciate. The poster is obviously Java-biased. Please help me set the record straight! Sample quote: > 3. If I have an existing class that describes a binary packet > and I need to build something similar, it's a prime target > for refactoring into a base/derived class. Of course, the unit tests > that I have setup (discussed below) will cover my refactoring > and make sure that by doing so I don't break the existing code. Thanks, Joel From joelr1@REDACTED Thu Sep 8 15:20:01 2005 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 8 Sep 2005 15:20:01 +0200 Subject: High and low level testing with Erlang Message-ID: <110CE121-3DE0-40E7-BD96-E8BC504B85C9@gmail.com> Folks, Insprired by the Java vs. Erlang debate I decided to describe my approach to testing with Erlang. I do not use the test server but there's an example of using the trace facility ;-). More at http://wagerlabs.com/tech/2005/09/accept-no-substitutes.html Thanks, Joel -- http://wagerlabs.com/tech From joe.armstrong@REDACTED Thu Sep 8 16:06:40 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Thu, 8 Sep 2005 16:06:40 +0200 Subject: How long does mnesia take to warm up? Message-ID: When I evaluate mnesia:start() it seems to take a little time before mnesia is ready to do what I tell it - is this a bug? - do I really have to busy-wait before it is ready? I have made myself a little mnesia table called mom_types In this run I have to make 34 attempts to write the table, attempts 1 to 34 fail because there is no such table, but 35 succeeds because suddenly there *is* a table. Alternatively I can wait for half a second or so after starting mnesia I guess this is a synchronisation error in the start-up? /Joe Eshell V5.3 (abort with ^G) 1> bug:start() Oh dear N=0 {aborted,{no_exists,mom_types}} Oh dear N=1 {aborted,{no_exists,mom_types}} ... Oh dear N=33 {aborted,{no_exists,mom_types}} Oh dear N=34 {aborted,{no_exists,mom_types}} At last N=35 ok true -module(bug). -export([start/0]). start() -> mnesia:start(), do(0). do(N) -> V = mnesia:transaction(fun() -> mnesia:write({mom_types,a,b}) end), case V of {atomic, X} -> io:format("At last N=~w ~p~n",[N, X]), true; Other -> io:format("Oh dear N=~w ~p~n",[N, Other]), do(N+1) end. From erik.reitsma@REDACTED Thu Sep 8 16:11:39 2005 From: erik.reitsma@REDACTED (Erik Reitsma (RY/ETM)) Date: Thu, 8 Sep 2005 16:11:39 +0200 Subject: How long does mnesia take to warm up? Message-ID: <110BA8ACEE682C479D0B008B6BE4AEB10C14EC@esealmw107.eemea.ericsson.se> What about (from the mnesia docs): ----------------------- mnesia:wait_for_tables(TabList,Timeout) -> ok | {timeout, BadTabList} | {error, Reason} Some applications need to wait for certain tables to be accessible in order to do useful work. mnesia:wait_for_tables/2 hangs until all tables in the TabList are accessible, or until timeout is reached. ---------------------- *Erik. > Joe Armstrong wrote: > When I evaluate mnesia:start() it seems to take a little > time before mnesia is > ready to do what I tell it - is this a bug? - do I really > have to busy-wait > before it is ready? > > From erlang@REDACTED Thu Sep 8 16:24:55 2005 From: erlang@REDACTED (Inswitch Solutions) Date: Thu, 8 Sep 2005 11:24:55 -0300 Subject: How long does mnesia take to warm up? References: <110BA8ACEE682C479D0B008B6BE4AEB10C14EC@esealmw107.eemea.ericsson.se> Message-ID: <14ac01c5b481$18bd57d0$4a00a8c0@Inswitch251> Hi, In the context of replias been used. Setting it to "infinity" is a good choice to avoid mnesia inconsistences. But it could get stuck waiting forever, waiting for a machine with a disk crash. What is the best wise solution for it, a good timeout value? regards, Eduardo ----- Original Message ----- From: "Erik Reitsma (RY/ETM)" To: "Erlang Users' List" Cc: "Joe Armstrong (AL/EAB)" Sent: Thursday, September 08, 2005 11:11 AM Subject: RE: How long does mnesia take to warm up? > What about (from the mnesia docs): > > ----------------------- > mnesia:wait_for_tables(TabList,Timeout) -> ok | {timeout, BadTabList} | {error, Reason} > > Some applications need to wait for certain tables to be accessible in order to do useful work. mnesia:wait_for_tables/2 hangs until all tables in the TabList are accessible, or until timeout is reached. > ---------------------- > > *Erik. > > > Joe Armstrong wrote: > > When I evaluate mnesia:start() it seems to take a little > > time before mnesia is > > ready to do what I tell it - is this a bug? - do I really > > have to busy-wait > > before it is ready? > > > > > From serge@REDACTED Thu Sep 8 16:34:09 2005 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 08 Sep 2005 10:34:09 -0400 Subject: mnesia & network partitions Message-ID: <43204BE1.506@hq.idt.net> When two nodes funning mnesia reconnect after a network loss mnesia always seem to generate the following event: =ERROR REPORT==== 8-Sep-2005::10:24:08 === Mnesia(t2@REDACTED): ** ERROR ** mnesia_event got {inconsistent_database, running_partitioned_network, t1@REDACTED} despite the fact that no changes might have been made to either mnesia database during network partitioning. Is there a way to instruct mnesia to "resume" replication as if no network outage happened without requiring one of the nodes to restart? Thanks. Serge -- Serge Aleynikov R&D Telecom, IDT Corp. Tel: (973) 438-3436 Fax: (973) 438-1464 serge@REDACTED From erlang@REDACTED Thu Sep 8 16:41:23 2005 From: erlang@REDACTED (Peter Lund) Date: Thu, 08 Sep 2005 16:41:23 +0200 Subject: How long does mnesia take to warm up? In-Reply-To: References: Message-ID: <43204D93.3010405@lundata.se> I guess everyone else are using mnesia:wait_for_tables. Maybe you should too :) /Peter Joe Armstrong (AL/EAB) wrote: > When I evaluate mnesia:start() it seems to take a little time before mnesia is >ready to do what I tell it - is this a bug? - do I really have to busy-wait >before it is ready? > > I have made myself a little mnesia table called mom_types > > In this run I have to make 34 attempts to write the table, attempts 1 to 34 fail because there is no such table, but 35 succeeds because suddenly there *is* a table. > > Alternatively I can wait for half a second or so after starting mnesia > > I guess this is a synchronisation error in the start-up? > > /Joe > > > >Eshell V5.3 (abort with ^G) >1> bug:start() >Oh dear N=0 {aborted,{no_exists,mom_types}} >Oh dear N=1 {aborted,{no_exists,mom_types}} >... >Oh dear N=33 {aborted,{no_exists,mom_types}} >Oh dear N=34 {aborted,{no_exists,mom_types}} >At last N=35 ok >true > > >-module(bug). > >-export([start/0]). > >start() -> > mnesia:start(), > do(0). > >do(N) -> > V = mnesia:transaction(fun() -> > mnesia:write({mom_types,a,b}) > end), > case V of > {atomic, X} -> > io:format("At last N=~w ~p~n",[N, X]), > true; > Other -> > io:format("Oh dear N=~w ~p~n",[N, Other]), > do(N+1) > end. > > > From jay@REDACTED Thu Sep 8 17:33:36 2005 From: jay@REDACTED (Jay Nelson) Date: Thu, 08 Sep 2005 08:33:36 -0700 Subject: Opera releases GOGI UI library Message-ID: <432059D0.4050209@duomark.com> http://www.linuxdevices.com/news/NS2909868515.html "Opera Software has added a low-level graphics API to its user interface (UI) development toolkit for home media device developers. The addition of GOGI (generic Opera graphical interface) allows Opera's Home Media SDK to build interfaces for devices that lack Qt, X, or other relevant graphical libraries, the company says." Couldn't seem to find any more details on their website, but you can sign up to download the library. jay From akopa@REDACTED Thu Sep 8 18:07:23 2005 From: akopa@REDACTED (Matthew D Swank) Date: Thu, 08 Sep 2005 11:07:23 -0500 Subject: configure script in jungerl In-Reply-To: <431FD8C1.2060205@ericsson.com> References: <431F390F.2010806@charter.net> <431FD8C1.2060205@ericsson.com> Message-ID: <432061BB.1030905@charter.net> Bengt Kleberg wrote: > >> Ulf Wiger wrote: >> >>> When trying to build the jungerl code on my Libranet (Debian) distro, >>> I encountered some autoheader errors. > > > while my dislike of autotools make me an unsuitable person to discuss > their use, i still think i can contribute something here. > > > imho it is an error to distribute a tarball that is missing the > configure script. the configure script should already have been > generated before the tarball is created and included in it. Overall, across all the packages in the distribution, the build process has quite a few warts. I run gentoo and i always have to tweak individual Makefiles even after I get autoconf to correctly generate configure. This is not really a complaint per se: if there are problems and I can fix them I should feed the solutions back to the community. However, I am lazy and forgetful :) Matt From casper2000a@REDACTED Thu Sep 8 18:05:28 2005 From: casper2000a@REDACTED (casper2000a@REDACTED) Date: Thu, 8 Sep 2005 22:05:28 +0600 Subject: How long does mnesia take to warm up? In-Reply-To: <14ac01c5b481$18bd57d0$4a00a8c0@Inswitch251> References: <110BA8ACEE682C479D0B008B6BE4AEB10C14EC@esealmw107.eemea.ericsson.se> <14ac01c5b481$18bd57d0$4a00a8c0@Inswitch251> Message-ID: <1126195528.432061485d2ce@www.omnibis.com> An HTML attachment was scrubbed... URL: From harrisbhatti@REDACTED Thu Sep 8 19:27:15 2005 From: harrisbhatti@REDACTED (M. Harris Bhatti) Date: Thu, 8 Sep 2005 18:27:15 +0100 Subject: How long does mnesia take to warm up? In-Reply-To: References: Message-ID: Hi all, I had a question related to the gs interface. Is there some function that would let me read a value of a group of radio buttons so that i dont have to check each individual radio button and see if it is selected or not? Thanks, Harris From harrisbhatti@REDACTED Thu Sep 8 19:28:52 2005 From: harrisbhatti@REDACTED (M. Harris Bhatti) Date: Thu, 8 Sep 2005 18:28:52 +0100 Subject: Radio Button Grouping In-Reply-To: References: Message-ID: Sorry, posted this under the wrong thread. Check below: On 9/8/05, M. Harris Bhatti wrote: > Hi all, > > I had a question related to the gs interface. Is there some function > that would let me read a value of a group of radio buttons so that i > dont have to check each individual radio button and see if it is > selected or not? > > Thanks, > Harris > -- Regards, Harris M. Bhatti From chas@REDACTED Fri Sep 9 01:02:36 2005 From: chas@REDACTED (Charles Blair) Date: Thu, 08 Sep 2005 18:02:36 -0500 Subject: Erlang vs. Java In-Reply-To: Your message of "Thu, 08 Sep 2005 09:01:57 +0200." Message-ID: <20050908230236.F360339A231@jump.lib.uchicago.edu> > There's a comment at http://wagerlabs.com/tech/2005/09/erlang-vs- > java.html that asks very interesting questions on how you would do > things in Erlang vs. Java, the type of questions that Erlang lovers > here appreciate. The poster is obviously Java-biased. Please help me > set the record straight! as an addition to this exchange: --- Can I derive from an existing piece of code and extend it without copy/paste ? Yes, copy/paste is certainly easy. A common sentiment among erlang programmers is that programs can be made so expressive that reuse becomes less important. Having said that, I would also say that Erlang allows you to write very reusable code. --- i might add that i find the availability of macros in erlang to facilitate code re-use in a very big way: if i find myself using the same pattern again and again, i write a macro to capture it. From orbitz@REDACTED Fri Sep 9 02:33:48 2005 From: orbitz@REDACTED (orbitz@REDACTED) Date: Thu, 8 Sep 2005 20:33:48 -0400 Subject: Erlang vs. Java In-Reply-To: <20050908230236.F360339A231@jump.lib.uchicago.edu> References: <20050908230236.F360339A231@jump.lib.uchicago.edu> Message-ID: Could you elaborate on that? From what I've seen macro's in erlang seem to be almost as bad as macros in C. Is this not a fair analogy? I have heard talk of it being possible to create close to lisp like macros in Erlang, is this possible or just talk? On Sep 8, 2005, at 7:02 PM, Charles Blair wrote: >> There's a comment at http://wagerlabs.com/tech/2005/09/erlang-vs- >> java.html that asks very interesting questions on how you would do >> things in Erlang vs. Java, the type of questions that Erlang lovers >> here appreciate. The poster is obviously Java-biased. Please help me >> set the record straight! > > as an addition to this exchange: > > --- > Can I derive from an existing piece of code and extend it without > copy/paste ? > > Yes, copy/paste is certainly easy. A common sentiment among erlang > programmers is that programs can be made so expressive that reuse > becomes less important. Having said that, I would also say that Erlang > allows you to write very reusable code. > --- > > i might add that i find the availability of macros in erlang to > facilitate code re-use in a very big way: if i find myself using the > same pattern again and again, i write a macro to capture it. > > > From cyberlync@REDACTED Fri Sep 9 04:01:12 2005 From: cyberlync@REDACTED (Eric Merritt) Date: Thu, 8 Sep 2005 19:01:12 -0700 Subject: Erlang vs. Java In-Reply-To: References: <20050908230236.F360339A231@jump.lib.uchicago.edu> Message-ID: C style macros are of limited usefulness. The one and only big pain I have when using Erlang is the lack of syntactic transformation (lispish macros). I would love to see the problem solved and not have to worry about boiler plate code anymore. Granted erlang requires much less of that type of code out of the box then most other languages, but I wouldn't mind seeing it go away entirely. On 9/8/05, orbitz@REDACTED wrote: > Could you elaborate on that? From what I've seen macro's in erlang seem > to be almost as bad as macros in C. Is this not a fair analogy? I > have heard talk of it being possible to create close to lisp like > macros in Erlang, is this possible or just talk? > From ok@REDACTED Fri Sep 9 05:22:21 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 9 Sep 2005 15:22:21 +1200 (NZST) Subject: Erlang vs. Java Message-ID: <200509090322.j893MLOe164694@atlas.otago.ac.nz> Joel Reymont notified us about his comparison of Erlang and Java at http://wagerlabs.com/ tech/2005/09/erlang-vs-java.html I have two comments. My first comment is that I found it very difficult to read. In two senses. I normally browse with an old Netscape, and basically all I saw was a sea of black with a few dots of colour here and there. Once I switched to Mozilla, the only trouble was that it was horribly ugly, the kind of stuff which says more about the page designer than about the content. Normally I would not bother to read anything which pays so little attention to the needs of readers. Please, PLEASE, ***PLEASE*** read Nielsen on web page design (http://useit.com). The erlang-vs-java.html violates HTML readers' expectations in so many pointless ways. My second comment is that the comparison is grossly unfair to Java in a rather interesting way. Let's look at a typical fragment of the code: private float callAmt; ...... public float getCallAmt() { return callAmt; } ...... plus a warning in the text that setters would add a lot more code. Well, if *I* were writing Java, I'd write private accessor<> float callAmt; and the getCallAmt() function would be written automatically. If I wanted a setter as well, I'd just change it to private accessor<> mutator<> float callAmt; That's because I downloaded a copy of ELIDE. The basic idea of ELIDE is that when you notice a recurring pattern of code, you can define a transformation (in a .elide file, which is Java extended with a library for Java source code and something very like Lisp's backquote) and then your user-defined annotation "transform" triggers the rewrite, which can add any number of methods. ELIDE comes with accessor<> and mutator<>, preconditions postconditions and invariants, hooks into JUnit, the Visitor design pattern, and others. Note that contrary to the comment in that web page, if you use ELIDE to generate getters and setters (or anything else), the *generated* code does *NOT* have to be maintained. The Java+ELIDE programmer need never as much as see it. All that needs to be maintained is the field declaration: private accessor<> mutator<> float callAmt; It's not a matter of code being generated when you *edit* a program, but when you *build* it, just like nobody maintains the C code that the Yacc parser generates. On the other hand, comparing Erlang binaries with explicit Java code rather than Java serialisation *is* fair. Erlang gets to inspect the binary and decide whether to trust it, whereas Java serialisation means letting the sender create an object in your address space (doing who knows what in its constructor) *before* your program gets a chance to look at it. On the gripping hand, you could use ELIDE to define your own serialisation protocol for your own classes (with, again, code generated at *build* time, not *edit* time, so not being maintained by hand). Of course you can do automatic generation in/for Erlang too. In fact it's an area where Erlang shines, because the documented form of parsed modules is so simple, and the whole language is so simple, that it's a *lot* less work to build transformation tools for Erlang. (If Java had been designed to make tools like ELIDE easier to build, it would have been a *much* better language.) And of course most Java programmers don't have ELIDE, but that's their problem, not mine. If I didn't have ELIDE, I'd do whatever had to be done in M4, or build my own tools in Prolog or Erlang or Scheme. From dustin@REDACTED Fri Sep 9 06:18:39 2005 From: dustin@REDACTED (Dustin Sallings) Date: Thu, 8 Sep 2005 21:18:39 -0700 Subject: Erlang vs. Java In-Reply-To: <200509090322.j893MLOe164694@atlas.otago.ac.nz> References: <200509090322.j893MLOe164694@atlas.otago.ac.nz> Message-ID: On Sep 8, 2005, at 20:22 , Richard A. O'Keefe wrote: > My first comment is that I found it very difficult to read. > In two senses. I normally browse with an old Netscape, and > basically all I saw was a sea of black with a few dots of > colour here and there. This isn't a valid complaint. Although the page needs some minor changes to comply with the standard it's claiming, it's more or less what one would expect on any modern web site. If your browser is ten years old (a really dark time for the web), you shouldn't expect things to work well. > Once I switched to Mozilla, the > only trouble was that it was horribly ugly, the kind of stuff > which says more about the page designer than about the content. > Normally I would not bother to read anything which pays so > little attention to the needs of readers. Please, PLEASE, > ***PLEASE*** read Nielsen on web page design (http://useit.com). > The erlang-vs-java.html violates HTML readers' expectations in > so many pointless ways. I think naming one or two of them would have been nice here. > plus a warning in the text that setters would add a lot more > code. Well, if *I* were writing Java, I'd write > > private accessor<> float callAmt; That is *not* java. When you write this, you do not write java. This is effectively saying you'd make a new language and transform it to java before compiling. If I do that in vim, it points out my syntax error. If I open that in eclipse, my project will just fail to work because it's not valid java and won't compile under a java compiler. > Note that contrary to the comment in that web page, if you use ELIDE > to generate getters and setters (or anything else), the *generated* > code does *NOT* have to be maintained. The Java+ELIDE programmer > need never as much as see it. All that needs to be maintained is the > field declaration: > private accessor<> mutator<> float callAmt; > It's not a matter of code being generated when you *edit* a program, > but when you *build* it, just like nobody maintains the C code that > the Yacc parser generates. Right, but people will need to maintain this code at some point. I've opened a lot of my projects in eclipse just for the sake of having it detect certain errors (I've used several other analysis tools as well...some work on source, some work on bytecode). This would not be an option here since you're really making a custom language that's almost, but not quite java. It's more like calling your yacc input ``C'' code to use your example. Sure, after running it through the special tool, it will compile under a C compiler, but it's hardly C. > On the other hand, comparing Erlang binaries with explicit Java code > rather than Java serialisation *is* fair. Erlang gets to inspect the > binary and decide whether to trust it, whereas Java serialisation > means > letting the sender create an object in your address space (doing who > knows what in its constructor) *before* your program gets a chance to > look at it. I don't quite understand what you're saying here. Objects don't have constructors, classes do. You can't deserialize a class the same way you deserialize an object. A deserialized object when being unmarshalled has to represent an instance of a class that is already available by name to the classloader that is deserializing it. > And of course most Java programmers don't have ELIDE, but that's > their problem, not mine. If I didn't have ELIDE, I'd do whatever had > to be done in M4, or build my own tools in Prolog or Erlang or Scheme. I don't think it's fair to call something ``java'' that no java tools recognize. -- SPY My girlfriend asked me which one I like better. pub 1024/3CAE01D5 1994/11/03 Dustin Sallings | Key fingerprint = 87 02 57 08 02 D0 DA D6 C8 0F 3E 65 51 98 D8 BE L_______________________ I hope the answer won't upset her. ____________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Fri Sep 9 08:02:36 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 9 Sep 2005 18:02:36 +1200 (NZST) Subject: Erlang vs. Java Message-ID: <200509090602.j8962aLn106180@atlas.otago.ac.nz> Joel Reymont notified us about his comparison of Erlang and Java at http://wagerlabs.com/ tech/2005/09/erlang-vs-java.html I said I didn't like the looks. There's worse: when I printed it, the text came out pale grey on white. There is good stuff at that site, and if it's presented without messing with the colour scheme it'll be really nice to have around. From ok@REDACTED Fri Sep 9 08:51:44 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 9 Sep 2005 18:51:44 +1200 (NZST) Subject: Erlang vs. Java Message-ID: <200509090651.j896pi93163048@atlas.otago.ac.nz> Dustin Sallings apparently believes that everyone should have the very latest of everything. > If your browser is ten years old (a really dark time for the web), > you shouldn't expect things to work well. I didn't say that it's ten years old. I don't know where he got that figure. It is four years old, and I like it because out of (recent Amaya, Netscape, recent Mozilla, recent Opera) it is the only one which both (a) by default displays readable characters on my 90 dot per inch screen (Amaya also does this) (b) doesn't get confused all to heck by font sizes (when people much around with fonts Amaya tends to display them much TOO big). I have better things to do than install new browsers every month. (More accurately, I think our sysadmins have better things to do with their time than install new browsers for me every month.) He goes on: > That is *not* java. It *isn't* Java, but it *uses* Java. This is effectively saying you'd make a new language and transform it to java before compiling. Wrong in an important way: *AS AN AUTOMATIC PART OF COMPILING*. It's no different from using Lex or Yacc or Yecc. If I do that in vim, it points out my syntax error. So use a smarter editor. I mean, generating Java is hardly new or unusual. What about JFlex (lexical analyser generator) or JavaCUP or ANTLR or any of the other lex/yacc-style generators for Java? There's a lot of stuff that people have been doing for a long time *using* Java even though it "isn't" raw Java that they type. If I open that in eclipse, my project will just fail to work because it's not valid java and won't compile under a java compiler. But it *does* compile using Ant. The whole point that I am making is that you can *use* Java in a project by writing in some more suitable notation which is automatically transformed to java as part of the build process. Things like JFlex, JavaCUP, and ELIDE give you small steps up from Java. What you write is Java *plus* a few extra concepts. It's definitely writing Java rather than, say, Fortran or Smalltalk. Right, but people will need to maintain this code at some point. Why? This is the kind of stuff that gets "WARNING, AUTOMATICALLY GENERATED CODE, DO NOT TOUCH THIS ON PAIN OF DEATH" plastered all over it. I've opened a lot of my projects in eclipse just for the sake of having it detect certain errors (I've used several other analysis tools as well...some work on source, some work on bytecode). This would not be an option here since you're really making a custom language that's almost, but not quite java. Of course it's an option. The byte codes are standard Java byte codes, the intermediate source code is standard Java. Any tool that works on byte codes should have no trouble. Any tool that can work on standard Java should have no trouble with the intermediate code produced by ELIDE. But above all, one of the major reasons for using automatically generated code is to get the benefits of code that doesn't *have* errors in the first place. By the way, I note that this idea of adding annotations is now an official part of standard Java. JSR 175 introduced annotations/metadata, and they are part of Java 1.5. See http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html http://java.sun.com/j2se/1.5.0/docs/guide/apy/GettingStarted.html Quoting from the latter: Many of the intended use case for annotations involve having annotations in a base file hold information that is used to generate new derived files (source files, class files, deployment descriptors, etc.) that are logically consistent with the base file and its annotations. In other words, instead of manually maintaining consistency among the entire set of files, only the base file would need to be maintained since the derived files are generated. ELIDE pre-dates this feature, but the two are extremely close. So as of Java 1.5, this kind of thing *IS* standard Java, and any "Java" tool which doesn't handle @ markup is out of date. It's more like calling your yacc input ``C'' code to use your example. Sure, after running it through the special tool, it will compile under a C compiler, but it's hardly C. And my point is that *ignoring* this fact is like saying "C is useless for writing parsers" without paying any attention to the fact that there are tools that make it easy for people to mix parsing and C. I don't quite understand what you're saying here. Objects don't have constructors, classes do. Constructors do not run inside classes, they run inside objects. An object's constructor is the constructor that is constructing it. You can't deserialize a class the same way you deserialize an object. That may well be a deficiency in Java as it currently stands, but it is not a necessary truth about OO programming languages. In any case, whoever talked about unpicking a class? I certainly didn't. A deserialized object when being unmarshalled has to represent an instance of a class that is already available by name to the classloader that is deserializing it. And your point is? How does this in any way whatever contradict anyone I wrote? The classes that are available to the class loader by name form a set that is determined AT RUN TIME. This set need not be identical to the set that was observable by the person who wrote the code that asked for the object. Indeed, it is most unlikely to be identical. The point is that "deserializing" an object *may* result in an instance of a class that the programmer of the code that asked for it never heard of, so the constructor may do things that the programmer of the starting class never had a chance to consider. (And yes, I am aware that "deserializing" can run other things than constructors.) I don't think it's fair to call something ``java'' that no java tools recognize. Since ELIDE is a Java tool, it's fair. We're not talking about a compiler that produces Java byte codes, but a source-to-source transformer that produces standard Java which "I only understand Java" tools *can* recognize, just like JFlex and JavaCUP. Everything you have said against ELIDE seems to apply with equal force to JavaCUP. A grammar written in JavaCUP "isn't" Java, but it *uses* Java, and a Java programmer could be excused for staring at you in astonishment for suggesting that something which isn't strict Java syntax cannot fairly be called Java. Java is what you get when you try to sell Lisp in disguise to C++ programmers and only belately realise you made too many concessions. In effect, annotation preprocessors are Lisp macros making a comeback. I don't have Java 1.5 on my machines yet, but it _is_ a big step forward compared with the old Java. Erlang has had pluggable used-defined transformation for a long time. I guess it just doesn't need it as much. From erlang-list@REDACTED Fri Sep 9 10:05:01 2005 From: erlang-list@REDACTED (erlang-list@REDACTED) Date: Fri, 9 Sep 2005 10:05:01 +0200 (CEST) Subject: (Prolog + LISP + Erlang) with integration issues versus C++ In-Reply-To: References: Message-ID: <55626.212.155.207.253.1126253101.squirrel@212.155.207.253> Ulf Wiger quoted: > "...focus on interests, not 'positions'. Positions are > bargaining statements so narrow that for one person to > win, the other must lose." > (From "Software Deadlines - Software Schedule Negotiating", > Applied Computer Research, Inc. > http://www.acrhq.com/surveys/deadline/sp-sched.htm I think the four-part "principled negotiation" described in that article originated from the classic and invaluable "Getting to yes". Cheers, Dominic Williams http://www.dominicwilliams.net ---- From joelr1@REDACTED Fri Sep 9 10:16:58 2005 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 9 Sep 2005 10:16:58 +0200 Subject: Erlang vs. Java In-Reply-To: <200509090602.j8962aLn106180@atlas.otago.ac.nz> References: <200509090602.j8962aLn106180@atlas.otago.ac.nz> Message-ID: <33655603-80A2-414B-BDC9-63F7F5039CD3@gmail.com> Richard, I'm no web designer and this is one of the page designs provided by blogger.com. If you have another template to suggest please let me know. Try the one at http://wagerlabs.com and another one at http://wagerlabs.com/ uptick. Let me know which one you like better. Thanks, Joel On Sep 9, 2005, at 8:02 AM, Richard A. O'Keefe wrote: > Joel Reymont notified us about his > comparison of Erlang and Java at http://wagerlabs.com/ > tech/2005/09/erlang-vs-java.html > > I said I didn't like the looks. There's worse: when I printed it, > the text came out pale grey on white. There is good stuff at that > site, and if it's presented without messing with the colour scheme > it'll be really nice to have around. > > -- http://wagerlabs.com/uptick From joelr1@REDACTED Fri Sep 9 10:19:54 2005 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 9 Sep 2005 10:19:54 +0200 Subject: Pluggable syntax transformations (was Re: Erlang vs. Java) In-Reply-To: <200509090651.j896pi93163048@atlas.otago.ac.nz> References: <200509090651.j896pi93163048@atlas.otago.ac.nz> Message-ID: <124913EB-F860-4756-A7B4-44A5C4C5A8EE@gmail.com> Richard, Care to post some examples? And why do you think Erlang does not need them as much? Thanks, Joel On Sep 9, 2005, at 8:51 AM, Richard A. O'Keefe wrote: > Erlang has had pluggable used-defined transformation for a long time. > I guess it just doesn't need it as much. > From joelr1@REDACTED Fri Sep 9 10:30:56 2005 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 9 Sep 2005 10:30:56 +0200 Subject: Erlang vs. Java In-Reply-To: <200509090322.j893MLOe164694@atlas.otago.ac.nz> References: <200509090322.j893MLOe164694@atlas.otago.ac.nz> Message-ID: <53DCA5BB-A979-418C-84C8-12E062DEA57C@gmail.com> I changed the template. Hope you folks like it better. On Sep 9, 2005, at 5:22 AM, Richard A. O'Keefe wrote: > My first comment is that I found it very difficult to read. > In two senses. I normally browse with an old Netscape, and > basically all I saw was a sea of black with a few dots of > colour here and there. Once I switched to Mozilla, the > only trouble was that it was horribly ugly, the kind of stuff > which says more about the page designer than about the content. > Normally I would not bother to read anything which pays so > little attention to the needs of readers. Please, PLEASE, > ***PLEASE*** read Nielsen on web page design (http://useit.com). > The erlang-vs-java.html violates HTML readers' expectations in > so many pointless ways. From thomasl_erlang@REDACTED Fri Sep 9 10:42:04 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 9 Sep 2005 01:42:04 -0700 (PDT) Subject: Pluggable syntax transformations (was Re: Erlang vs. Java) In-Reply-To: <124913EB-F860-4756-A7B4-44A5C4C5A8EE@gmail.com> Message-ID: <20050909084204.46372.qmail@web34409.mail.mud.yahoo.com> --- Joel Reymont wrote: > Care to post some examples? These transformations are known as "parse transforms". Basically, you get the parsed syntax trees of the module as inputs, and emit a collection of syntax trees as output (ie, feed them to the rest of the compiler). In OTP, you have sys_pre_attributes, mnemosyne, qlc, ms_transform and perhaps others as examples. erl_id_trans.erl also has a simple template for writing parse transforms. (I would say Lisp macros are above and ahead of what Erlang offers today. But parse transforms can still be pretty useful.) Best, Thomas ______________________________________________________ Click here to donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ From ewan_higgs@REDACTED Fri Sep 9 10:48:02 2005 From: ewan_higgs@REDACTED (Ewan Higgs) Date: Fri, 9 Sep 2005 09:48:02 +0100 (BST) Subject: Erlang vs. Java In-Reply-To: <200509090651.j896pi93163048@atlas.otago.ac.nz> Message-ID: <20050909084802.17704.qmail@web25807.mail.ukl.yahoo.com> DPI is a bizarre way to describe screen resolution. It's a printer resolution term and people who can judge what size that is. (For the benefit of people reading along: 90 DPI is the resolution of a dot matrix printer -so pretty poor). Shall we assume you are legally blind and running 640x480 with large fonts? If that is the case then saying the design is flawed looks a bit strong for most people reading this list, I imagine. It might be more useful to have described your issues with the page in the context of your challenges. This way, you won't leave Joel to read the site you linked to and scratching his head as his page conforms to everything on all the top 10 lists of good things to do and breaks none of the rules on the top 10 lists of what not to do. Arguing that you don't want to download a new browser every month is a garbage strawman argument. > > That is *not* java. > > It *isn't* Java, but it *uses* Java. This is a very useful point in context of the recent discussion on this list about trying to make Erlang in conjunction with Lisp and Prolog a viable solution for developing projects. The problem was that C++ has so much political weight that it trumps other languages. One of the reasons given was that using several languages will leave the programmers in a weird situation of having to struggle with different syntaxes and tool chains. What a mess! However, Java is also politically successful - and yet, as you describe, people using it are using loads of mini languages with it to get their work done in spite of the adversity of the language! How's that then? (not directed at only you, but put to everyone). Also interesting is how Java is then criticized for not being that great since you have to use so many mini languages to get anything done. Though it seems the SmugLispWeenies are the ones doing this. That's weird since TheWayToDoIt for a lot of projects in Lisp is to write code in a minilanguage and then write an interpreter for that code. While we're on the topic of Java, I was wondering how Java fit into the discussion Boehm reopened in his recent paper, "Threads Cannot be Implemented as a Library": http://www.hpl.hp.com/techreports/2004/HPL-2004-209.html Does Java suffer from the issues Boehm says of pthreads? He says it does in the introduction that since they are described in the language specification that it doesn't nessesarily apply, but also that specifying such behariours are very difficult. He leaves it ambiguous over whether Java has been successful in helping programmers to model concurrency. I think it's on topic for this list as Erlang is probably the leading concurrent language, so getting an idea for how other languages do things is fairly relevant. If it isn't on topic, just say so. Warm Regards, Ewan ___________________________________________________________ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com From ulf.wiger@REDACTED Fri Sep 9 11:25:19 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 9 Sep 2005 11:25:19 +0200 Subject: Erlang vs. Java Message-ID: Speaking for myself, I find the new PokerTech layout much easier to read, and the code snippets stand out much better. I have difficulty reading the links in the dark header part, but that doesn't bother me too much. (The "Visit the ... blog, send me ... or take a look at my ....") That's roughly how it comes out on my screen until I move my mouse over the links. /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Joel Reymont > Sent: den 9 september 2005 10:17 > To: Erlang Users' List > Subject: Re: Erlang vs. Java > > > Richard, > > I'm no web designer and this is one of the page designs provided by > blogger.com. > > If you have another template to suggest please let me know. Try the > one at http://wagerlabs.com and another one at http://wagerlabs.com/ > uptick. > > Let me know which one you like better. > > Thanks, Joel > > On Sep 9, 2005, at 8:02 AM, Richard A. O'Keefe wrote: > > > Joel Reymont notified us about his > > comparison of Erlang and Java at http://wagerlabs.com/ > > tech/2005/09/erlang-vs-java.html > > > > I said I didn't like the looks. There's worse: when I printed it, > > the text came out pale grey on white. There is good stuff at that > > site, and if it's presented without messing with the colour scheme > > it'll be really nice to have around. > > > > > > -- > http://wagerlabs.com/uptick > > > > From thomasl_erlang@REDACTED Fri Sep 9 11:31:42 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 9 Sep 2005 02:31:42 -0700 (PDT) Subject: Erlang vs. Java In-Reply-To: <53DCA5BB-A979-418C-84C8-12E062DEA57C@gmail.com> Message-ID: <20050909093143.25711.qmail@web34411.mail.mud.yahoo.com> --- Joel Reymont wrote: > I changed the template. Hope you folks like it > better. Much easier to read at this end, thanks. Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From joelr1@REDACTED Fri Sep 9 11:39:30 2005 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 9 Sep 2005 11:39:30 +0200 Subject: Erlang vs. Java In-Reply-To: References: Message-ID: Did you scroll over that to see what's there? If so maybe I'll just leave it at as is to pique people's curiosity :D On Sep 9, 2005, at 11:25 AM, Ulf Wiger (AL/EAB) wrote: > > (The "Visit the ... blog, send me ... or take a look at my ....") > That's roughly how it comes out on my screen until I move my > mouse over the links. From akopa@REDACTED Fri Sep 9 12:16:51 2005 From: akopa@REDACTED (Matthew Swank) Date: Fri, 09 Sep 2005 05:16:51 -0500 Subject: Erlang vs. Java In-Reply-To: <20050909084802.17704.qmail@web25807.mail.ukl.yahoo.com> References: <20050909084802.17704.qmail@web25807.mail.ukl.yahoo.com> Message-ID: <43216113.30606@charter.net> Ewan Higgs wrote: > DPI is a bizarre way to describe screen resolution. > It's a printer resolution term and people who can > judge what size that is. (For the benefit of people > reading along: 90 DPI is the resolution of a dot > matrix printer -so pretty poor). > > Shall we assume you are legally blind and running > 640x480 with large fonts? Actually 90 dpi is quite a reasonable screen resolution. For instance I have a 19 in monitor that is capable of displaying 114 dpi at 1600X1200 Matt -- "You do not really understand something unless you can explain it to your grandmother." - Albert Einstein. From vances@REDACTED Fri Sep 9 19:09:44 2005 From: vances@REDACTED (Vance Shipley) Date: Fri, 9 Sep 2005 13:09:44 -0400 Subject: Question on functional style Message-ID: <20050909170944.GA78336@feeble.motivity.ca> Gurus, Is it bad form to use try/catch to handle non-local returns other than exceptions? I have some code which does a battery of tests in several phases. The tests are simple so it makes sense to me to just perform them sequentially in one function and throw when I want to skip to the next phase: start(Arg) -> try begin case lists:member(foo, Arg) of true -> throw(done); _ -> ok end, case lists:member(bar, Arg) of true -> throw(done); _ -> ok end, case lists:member(baz, Arg) of true -> throw(done); _ -> ok end end catch throw:done -> phase2() end. phase2() -> done. While this is easiest for me to understand my own code I wonder whether it is good functional style. I do end up with a very large function and the throw is not really an "exception". Alternatively I can hard cpode the sequence into the test functions: start(Arg) -> f1(Arg). f1(Arg) -> case lists:member(foo, Arg) of true -> phase2(); _ -> f2(Arg) end. f2(Arg) -> case lists:member(bar, Arg) of true -> phase2(); _ -> f3(Arg) end. f3(Arg) -> case lists:member(baz, Arg) of true -> phase2(); _ -> ok end. phase2() -> done. I find this makes it harder to follow the sequence and the tests can't be reused in a different order. I could pass the next function as an argument I suppose ... It seems to me that the above is less deterministic. The return from f1/1 depends on what happens in f2,f3,...fn. Using the first form I can actually perform many of the tests using an if statement and pattern matching. Your opinions are welcome. -Vance (who has never taken a CS course) From vlad_dumitrescu@REDACTED Fri Sep 9 20:09:02 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 9 Sep 2005 20:09:02 +0200 Subject: Question on functional style References: <20050909170944.GA78336@feeble.motivity.ca> Message-ID: Hi Vance, You could also code the tests as simple funs, and assemble them in a list, then do a lists:takewhile on it. In this way it stops at the first false result. regards, Vlad From ulf.wiger@REDACTED Fri Sep 9 20:14:45 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 9 Sep 2005 20:14:45 +0200 Subject: Question on functional style Message-ID: Sure, why not? This is basically what throw() is for, right? start(Arg) -> F = fun(X) case lists:member(X, Arg) of true -> throw(done); false -> ok end end, try [F(X) || X <- [foo,bar,baz]] of _ -> ok catch throw:done -> phase2() end. (A matter of taste, surely.) /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Vance Shipley > Sent: den 9 september 2005 19:10 > To: erlang-questions@REDACTED > Subject: Question on functional style > > > Gurus, > > Is it bad form to use try/catch to handle non-local returns > other than exceptions? > > I have some code which does a battery of tests in several phases. > The tests are simple so it makes sense to me to just perform > them sequentially in one function and throw when I want to skip > to the next phase: > > start(Arg) -> > try begin > case lists:member(foo, Arg) of > true -> > throw(done); > _ -> > ok > end, > case lists:member(bar, Arg) of > true -> > throw(done); > _ -> > ok > end, > case lists:member(baz, Arg) of > true -> > throw(done); > _ -> > ok > end > end > catch > throw:done -> > phase2() > end. > > phase2() -> > done. > > > While this is easiest for me to understand my own code I wonder > whether it is good functional style. I do end up with a very > large function and the throw is not really an "exception". > > Alternatively I can hard cpode the sequence into the test functions: > > start(Arg) -> > f1(Arg). > > f1(Arg) -> > case lists:member(foo, Arg) of > true -> > phase2(); > _ -> > f2(Arg) > end. > > f2(Arg) -> > case lists:member(bar, Arg) of > true -> > phase2(); > _ -> > f3(Arg) > end. > > f3(Arg) -> > case lists:member(baz, Arg) of > true -> > phase2(); > _ -> > ok > end. > > phase2() -> > done. > > > I find this makes it harder to follow the sequence and the tests > can't be reused in a different order. I could pass the next function > as an argument I suppose ... > > It seems to me that the above is less deterministic. The return > from f1/1 depends on what happens in f2,f3,...fn. > > Using the first form I can actually perform many of the tests using > an if statement and pattern matching. > > Your opinions are welcome. > > -Vance (who has never taken a CS course) > > From hakan.stenholm@REDACTED Fri Sep 9 20:44:14 2005 From: hakan.stenholm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Stenholm?=) Date: Fri, 09 Sep 2005 20:44:14 +0200 Subject: Question on functional style In-Reply-To: <20050909170944.GA78336@feeble.motivity.ca> References: <20050909170944.GA78336@feeble.motivity.ca> Message-ID: <4321D7FE.5040707@mbox304.swipnet.se> Vance Shipley wrote: >Gurus, > >Is it bad form to use try/catch to handle non-local returns >other than exceptions? > >I have some code which does a battery of tests in several phases. >The tests are simple so it makes sense to me to just perform >them sequentially in one function and throw when I want to skip >to the next phase: > >start(Arg) -> > try begin > case lists:member(foo, Arg) of > true -> > throw(done); > _ -> > ok > end, > case lists:member(bar, Arg) of > true -> > throw(done); > _ -> > ok > end, > case lists:member(baz, Arg) of > true -> > throw(done); > _ -> > ok > end > end > catch > throw:done -> > phase2() > end. > >phase2() -> > done. > > The following replacement code springs to mind: start(Arg) -> F = fun(E) -> lists:member(E, Arg) end, Matches = [foo,bar,baz], case lists:any(F, Matches) of true -> phase2(); false -> ok end. phase2() -> done. This does limited match testing with the help of lists:any/2, R10B-6 uses the following code: any(Pred, [Hd|Tail]) -> case Pred(Hd) of true -> true; false -> any(Pred, Tail) end; any(_, []) -> false. which stops after the first match, without resorting to try, catch or throw usage. Another choice is to do the following: start(Arg) -> try begin false = lists:member(foo, Arg), false = lists:member(bar, Arg), false = lists:member(baz, Arg) end catch throw:error -> % should it be 'exit' ? phase2() end. phase2() -> done. This relies on Erlang generating a runtime exception if one of the lists:member/2 calls become = 'true'. My personal choice would be to write the code without any exceptions, as their use implies a unexpected execution path in the code, rather than a standard path. > >While this is easiest for me to understand my own code I wonder >whether it is good functional style. I do end up with a very >large function and the throw is not really an "exception". > >Alternatively I can hard cpode the sequence into the test functions: > >start(Arg) -> > f1(Arg). > >f1(Arg) -> > case lists:member(foo, Arg) of > true -> > phase2(); > _ -> > f2(Arg) > end. > >f2(Arg) -> > case lists:member(bar, Arg) of > true -> > phase2(); > _ -> > f3(Arg) > end. > >f3(Arg) -> > case lists:member(baz, Arg) of > true -> > phase2(); > _ -> > ok > end. > >phase2() -> > done. > > >I find this makes it harder to follow the sequence and the tests >can't be reused in a different order. I could pass the next function >as an argument I suppose ... > >It seems to me that the above is less deterministic. The return >from f1/1 depends on what happens in f2,f3,...fn. > >Using the first form I can actually perform many of the tests using >an if statement and pattern matching. > >Your opinions are welcome. > > -Vance (who has never taken a CS course) > > > > From vances@REDACTED Fri Sep 9 21:05:26 2005 From: vances@REDACTED (Vance Shipley) Date: Fri, 9 Sep 2005 15:05:26 -0400 Subject: Question on functional style In-Reply-To: <4321D7FE.5040707@mbox304.swipnet.se> References: <20050909170944.GA78336@feeble.motivity.ca> <4321D7FE.5040707@mbox304.swipnet.se> Message-ID: <20050909190526.GC78336@feeble.motivity.ca> On Fri, Sep 09, 2005 at 08:44:14PM +0200, Hkan Stenholm wrote: } } The following replacement code springs to mind: } } start(Arg) -> } F = fun(E) -> } lists:member(E, Arg) } end, } Matches = [foo,bar,baz], } case lists:any(F, Matches) of } true -> phase2(); } false -> ok } end. Mine was a contrived example. The actual code is much more complicated with tests being done on a combination of received data, state data and database access. } start(Arg) -> } try begin } false = lists:member(foo, Arg), } false = lists:member(bar, Arg), } false = lists:member(baz, Arg) } end } catch } throw:error -> % should it be 'exit' ? } phase2() } end. ... } This relies on Erlang generating a runtime exception if one of the } lists:member/2 calls become = 'true'. My personal choice would be to } write the code without any exceptions, as their use implies a unexpected } execution path in the code, rather than a standard path. The above definetly gets my guard up as it does imply an error in an expected execution path. This was also my concern about using throw. -Vance From serge@REDACTED Fri Sep 9 21:23:26 2005 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 09 Sep 2005 15:23:26 -0400 Subject: tracing Message-ID: <4321E12E.2060000@hq.idt.net> When a tracing process is setup with dbg:tracer/2 it accepts a function that can accumulate traces in a custom accumulator, such as this: foo_trace(Args) -> dbg:tracer(process, {fun trace_handler/2, []}), dbg:p(self(), call), dbg:tpl(?MODULE, [{'_',[],[{return_trace}]}]), R = foo(Args), dbg:stop(), R. trace_handler(Msg, Acc) -> [Msg | Acc]. Is there a way to retrieve the content of this accumulator before calling dbg:stop()? I know that in case of a tracer port, one can store trace messages to a file and read them later with tracer_client, but I would like to know if it is possible enable/disable tracing and return the trace messages along with the function's result. Serge From brian@REDACTED Fri Sep 9 22:55:21 2005 From: brian@REDACTED (Brian Buchanan) Date: Fri, 9 Sep 2005 13:55:21 -0700 (PDT) Subject: tracing In-Reply-To: <4321E12E.2060000@hq.idt.net> References: <4321E12E.2060000@hq.idt.net> Message-ID: <20050909135324.S13238@mail.ncircle.com> On Fri, 9 Sep 2005, Serge Aleynikov wrote: > When a tracing process is setup with dbg:tracer/2 it accepts a function that > can accumulate traces in a custom accumulator, such as this: ... > Is there a way to retrieve the content of this accumulator before calling > dbg:stop()? Serge, Why not write a simple gen_server that abstracts this functionality? The trace fun would post messages to the server, which would record them as part of its internal state. The "stop trace" function would terminate the gen_server and return the collected trace results. - Brian -- Brian Buchanan Principal Engineer nCircle Network Security http://www.ncircle.com/ From serge@REDACTED Fri Sep 9 23:54:11 2005 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 09 Sep 2005 17:54:11 -0400 Subject: tracing In-Reply-To: <20050909135324.S13238@mail.ncircle.com> References: <4321E12E.2060000@hq.idt.net> <20050909135324.S13238@mail.ncircle.com> Message-ID: <43220483.2050002@hq.idt.net> True, but I thought there might be a more "light-weight" solution. Dbg starts it's own process which in turn starts a process handling the trace process function. One way to get its internal state that I could think of would be to store the trace in the trace process function's process dictionary, and do: trace(F, M, Args) -> % Set up a tracer dbg:tracer(process, {fun(M,A) -> T=[M|A], put(trace, T), T end, []}), dbg:p(self(), call), dbg:tpl(dbg, [{'_',[],[{return_trace}]}]), % Call the function Res = apply(F, M, Args), % Retrieve trace {ok, Tracer} = dbg:get_tracer(), Dict = process_info(Tracer, dictionary), dbg:stop(), case lists:keysearch(trace, 1, Dict) of {value, {_, Val}} -> {Res, format_trace(Val)}; false {Res, undefined} end. Are there more elegant ways? Serge Brian Buchanan wrote: > On Fri, 9 Sep 2005, Serge Aleynikov wrote: > >> When a tracing process is setup with dbg:tracer/2 it accepts a >> function that can accumulate traces in a custom accumulator, such as >> this: > > > ... > >> Is there a way to retrieve the content of this accumulator before >> calling dbg:stop()? > > > Serge, > > Why not write a simple gen_server that abstracts this functionality? > The trace fun would post messages to the server, which would record them > as part of its internal state. The "stop trace" function would > terminate the gen_server and return the collected trace results. > > - Brian > -- Serge Aleynikov R&D Telecom, IDT Corp. Tel: (973) 438-3436 Fax: (973) 438-1464 serge@REDACTED From serge@REDACTED Sat Sep 10 00:09:14 2005 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 09 Sep 2005 18:09:14 -0400 Subject: tracing In-Reply-To: <43220483.2050002@hq.idt.net> References: <4321E12E.2060000@hq.idt.net> <20050909135324.S13238@mail.ncircle.com> <43220483.2050002@hq.idt.net> Message-ID: <4322080A.5080303@hq.idt.net> After fixing a couple of slopy bugs this code should've read: trace(M, F, Args) -> % Set up a tracer Fun = fun(Msg,A) -> T=[Msg|A], put(trace, T), T end, dbg:tracer(process, {Fun, []}), dbg:p(self(), call), dbg:tpl(M, [{'_',[],[{return_trace}]}]), % Call the function Res = apply(M, F, Args), % Retrieve trace {ok, Tracer} = dbg:get_tracer(), {dictionary, Dict} = process_info(Tracer, dictionary), dbg:stop(), case lists:keysearch(trace, 1, Dict) of {value, {_, Val}} -> {Res, format_trace(Val)}; false -> {Res, undefined} end. Serge Serge Aleynikov wrote: > True, but I thought there might be a more "light-weight" solution. Dbg > starts it's own process which in turn starts a process handling the > trace process function. > > One way to get its internal state that I could think of would be to > store the trace in the trace process function's process dictionary, and do: > > trace(F, M, Args) -> > % Set up a tracer > dbg:tracer(process, {fun(M,A) -> T=[M|A], put(trace, T), T end, []}), > dbg:p(self(), call), > dbg:tpl(dbg, [{'_',[],[{return_trace}]}]), > > % Call the function > Res = apply(F, M, Args), > > % Retrieve trace > {ok, Tracer} = dbg:get_tracer(), > Dict = process_info(Tracer, dictionary), > dbg:stop(), > case lists:keysearch(trace, 1, Dict) of > {value, {_, Val}} -> > {Res, format_trace(Val)}; > false > {Res, undefined} > end. > > Are there more elegant ways? > > Serge > > Brian Buchanan wrote: > >> On Fri, 9 Sep 2005, Serge Aleynikov wrote: >> >>> When a tracing process is setup with dbg:tracer/2 it accepts a >>> function that can accumulate traces in a custom accumulator, such as >>> this: >> >> >> >> ... >> >>> Is there a way to retrieve the content of this accumulator before >>> calling dbg:stop()? >> >> >> >> Serge, >> >> Why not write a simple gen_server that abstracts this functionality? >> The trace fun would post messages to the server, which would record >> them as part of its internal state. The "stop trace" function would >> terminate the gen_server and return the collected trace results. >> >> - Brian >> > -- Serge Aleynikov R&D Telecom, IDT Corp. Tel: (973) 438-3436 Fax: (973) 438-1464 serge@REDACTED From ulf@REDACTED Sat Sep 10 00:14:48 2005 From: ulf@REDACTED (Ulf Wiger) Date: Sat, 10 Sep 2005 00:14:48 +0200 Subject: tracing In-Reply-To: <4321E12E.2060000@hq.idt.net> References: <4321E12E.2060000@hq.idt.net> Message-ID: Den 2005-09-09 21:23:26 skrev Serge Aleynikov : > foo_trace(Args) -> > dbg:tracer(process, {fun trace_handler/2, []}), > dbg:p(self(), call), > dbg:tpl(?MODULE, [{'_',[],[{return_trace}]}]), > R = foo(Args), > dbg:stop(), > R. > trace_handler(Msg, Acc) -> > [Msg | Acc]. > Is there a way to retrieve the content of this accumulator before > calling dbg:stop()? The only thing I could think of is this: 8> dbg:tracer(process, {fun(Msg,Acc) -> [Msg|Acc] end, [foo]}). {ok,<0.43.0>} 9> dbg:get_tracer(). {ok,<0.44.0>} 10> pid(0,44,0) ! {self(),stop}. {<0.30.0>,stop}** dbg got EXIT - terminating: normal 11> flush(). Shell got {stop,[foo]} ok That is, if you send the tracer process a {From, stop} message, it will stop and return the accumulator in the stop message. /Uffe -- Ulf Wiger From serge@REDACTED Sat Sep 10 00:30:06 2005 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 09 Sep 2005 18:30:06 -0400 Subject: tracing In-Reply-To: References: <4321E12E.2060000@hq.idt.net> Message-ID: <43220CEE.9070706@hq.idt.net> Thanks for the tip! I wish dbg had a function to do this gracefully without hacking the tracer process. :-) Serge Ulf Wiger wrote: > Den 2005-09-09 21:23:26 skrev Serge Aleynikov : > >> foo_trace(Args) -> >> dbg:tracer(process, {fun trace_handler/2, []}), >> dbg:p(self(), call), >> dbg:tpl(?MODULE, [{'_',[],[{return_trace}]}]), >> R = foo(Args), >> dbg:stop(), >> R. >> trace_handler(Msg, Acc) -> >> [Msg | Acc]. >> Is there a way to retrieve the content of this accumulator before >> calling dbg:stop()? > > > > The only thing I could think of is this: > > 8> dbg:tracer(process, {fun(Msg,Acc) -> [Msg|Acc] end, [foo]}). > {ok,<0.43.0>} > 9> dbg:get_tracer(). > {ok,<0.44.0>} > 10> pid(0,44,0) ! {self(),stop}. > {<0.30.0>,stop}** dbg got EXIT - terminating: normal > > 11> flush(). > Shell got {stop,[foo]} > ok > > That is, if you send the tracer process a {From, stop} > message, it will stop and return the accumulator in > the stop message. > > /Uffe From robert.virding@REDACTED Sat Sep 10 15:26:27 2005 From: robert.virding@REDACTED (Robert Virding) Date: Sat, 10 Sep 2005 15:26:27 +0200 Subject: Erlang vs. Java In-Reply-To: <0ED34211-4CFE-49B7-BDD2-F240B3DD95E5@gmail.com> References: <0ED34211-4CFE-49B7-BDD2-F240B3DD95E5@gmail.com> Message-ID: <4322DF03.1060609@telia.com> Could we please move the discussion about web browsers and colour schemes somewhere else? It is making it very difficult for me to read the erlang-vs-java discussion. :-) Robert Joel Reymont skrev: > Folks, > > I just posted a comparison of Erlang vs. Java at http://wagerlabs.com/ > tech/2005/09/erlang-vs-java.html for reading and writing binary packets. > > I thought someone might find it interesting. > > Thanks, Joel > > From ulf.wiger@REDACTED Sun Sep 11 20:57:45 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Sun, 11 Sep 2005 20:57:45 +0200 Subject: gb_trees:search/3 Message-ID: I've been playing with ways to implement a functional resource database. My current version uses gb_trees, but I decided I was missing a function: search(Fun, Acc, {_S, T}) -> _Acc1 = search_1(Fun, Acc, T). search_1(Fun, Acc, nil) -> case Fun(nil, nil, Acc) of {return, Acc1} -> Acc1; Other -> erlang:error({bad_return, Other}) end; search_1(Fun, Acc, {Key, V, Smaller, Bigger}) -> case Fun(Key, V, Acc) of {smaller, Acc1} -> search_1(Fun, Acc1, Smaller); {bigger, Acc1} -> search_1(Fun, Acc1, Bigger); {return, Acc1} -> Acc1 end. One could say that it's main purpose is to allow the user to come up with new access functions without having to know the exact structure of the tree. The functions next/2 and prev/2 could then be implemented in this way: next(Key, T) -> F = fun(nil,nil,Acc) -> case Acc of {found, Found} -> {return, Found}; not_found -> {return, '$end_of_table'} end; (K,V, not_found) when K =< Key -> {bigger, not_found}; (K,V, {found, Found}) when K =< Key -> {bigger, {found, Found}}; (K,V, not_found) when K > Key -> {smaller, {found, {K,V}}}; (K,V, {found,_}) when K > Key -> {smaller, {found,{K,V}}} end, gb_trees:search(F, not_found, T). prev(Key, T) -> F = fun(nil,nil,Acc) -> case Acc of {found, Found} -> {return, Found}; not_found -> {return, '$end_of_table'} end; (K,V, not_found) when K >= Key -> {smaller, not_found}; (K,V, {found, Found}) when K >= Key -> {smaller, {found, Found}}; (K,V, not_found) when K < Key -> {bigger, {found, {K,V}}}; (K,V, {found,_}) when K < Key -> {bigger, {found,{K,V}}} end, gb_rees:search(F, not_found, T). ******************** And my resource database reservation function could look like this. (The tree initially consists of one object, {Min, Max}, indicating the range of free resources. E.g. [{1,99},{101,1000}] would mean that the resource 100 has been allocated but the rest, i.e. 1-99 and 101-1000, are free reserve(N, T) -> F = fun(nil, nil, Acc) -> {return,Acc}; (A, A, _) when N==A -> {return, [fun(T1) -> gb_trees:delete(A, T1) end]}; (A, B, _) when N==A -> {return, [fun(T1) -> gb_trees:delete(A, T1) end, fun(T1) -> gb_trees:insert(A+1, B,T1) end]}; (A, B, _) when N==B -> {return, [fun(T1) -> gb_trees:update(A, B-1, T1) end]}; (A, B, _) when A < N, N < B -> {return, [fun(T1) -> gb_trees:update(A, N-1, T1) end, fun(T1) -> gb_trees:insert(N+1, B, T1) end]}; (A, _, Acc) when N > A -> {bigger, Acc}; (_, B, Acc) when N < B -> {smaller, Acc} end, case gb_trees:search(F, [], T) of [] -> throw(busy); [_|_] = Fns -> lists:foldl(fun(F,Tree) -> F(Tree) end, T, Fns) end. I'm sure you could do a lot of other stuff with search/3 too. There's probably a more elegant construct that would solve the problem with equal or better efficiency. Please go ahead and suggest better ways. /Uffe From ulf.wiger@REDACTED Sun Sep 11 21:27:09 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Sun, 11 Sep 2005 21:27:09 +0200 Subject: gb_trees:search/3 Message-ID: Replying to my own post, the easier case is of course when just a resource (not a specific number) is asked for: reserve(Free) -> case gb_trees:take_smallest(Free) of {Min, Min, Free1} -> {Min, Free1}; {Min, Max, Free1} when Max > Min -> {Min, gb_trees:insert(Min+1, Max, Free1)} end. free/2 is more involved as it needs to de-fragment the tree, but that would be done along the same lines as reserve/2, using the gb_trees:search/3 function. /Uffe From m_a_shure@REDACTED Mon Sep 12 00:32:51 2005 From: m_a_shure@REDACTED (mshure) Date: Mon, 12 Sep 2005 00:32:51 +0200 Subject: Trouble compiling R10B-7 on OS X References: Message-ID: <20050911223251.9492547C17@bang.trapexit.org> Hello, I've been experimenting with Erlang on and off for the past couple of years under various flavors of Windows, never reaching a high level of expertise. Soon after buying my first Mac (an iMac G5 running OS X v10.4.2), I recently decided to delve more deeply into Erlang. However, I haven't had much success in getting it to run... On Windows machines I took advantage of the binary downloads, but this is my first attempt at compiling the source code. Perhaps this isn't a good first project with my Mac, but I tried anyway. I installed the Xcode software, downloaded the R10B-7 source code, followed the instructions in the README file and typed "make". The compilation process seemed to go fine until I saw the following: "=== Leaving application debugger === Entering application gs erl -pa ../ebin -s gs_make -s erlang halt -noshell {error_logger,{{2005,9,11},{17,11,43}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,{'DOWN',#Ref<0.0.0.12>,process,<0.15.0>,normal}},{offender,[{pid,undefined},{name,code_server},{mfa,{code,start_link,[]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]} {error_logger,{{2005,9,11},{17,11,43}},crash_report,[[{pid,<0.7.0>},{registered_name,[]},{error_info,{shutdown,{kernel,start,[normal,[]]}}},{initial_call,{application_master,init,[<0.5.0>,<0.6.0>,{appl_data,kernel,[application_controller,erl_reply,auth,boot_server,code_server,disk_log_server,disk_log_sup,erl_prim_loader,error_logger,file_server,file_server_2,fixtable_server,global_group,global_name_server,heart,init,kernel_config,kernel_sup,net_kernel,net_sup,rex,user,os_server,ddll_server,erl_epmd,inet_db,pg2],undefined,{kernel,[]},[application,application_controller,application_master,application_starter,auth,code,code_aux,packages,code_server,dist_util,erl_boot_server,erl_distribution,erl_prim_loader,erl_reply,erlang,error_handler,error_logger,file,file_server,old_file_server,file_io_server,prim_file,global,global_group,global_search,group,heart,inet6_tcp,inet6_tcp_dist,inet6_udp,inet_config,inet_hosts,inet_gethost_native,inet_tcp_dist,init,kernel,kernel_config,net,net_adm ,net_kernel,os,ram_file,rpc,user,user_drv,user_sup,disk_log,disk_log_1,disk_log_server,disk_log_sup,dist_ac,erl_ddll,erl_epmd,erts_debug,gen_tcp,gen_udp,prim_inet,inet,inet_db,inet_dns,inet_parse,inet_res,inet_tcp,inet_udp,pg2,seq_trace,wrap_log_reader,zlib,otp_ring0],[],infinity,infinity},normal]}},{ancestors,[<0.6.0>]},{messages,[{'EXIT',<0.8.0>,normal}]},{links,[<0.6.0>,<0.5.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,987},{stack_size,21},{reductions,1062}],[]]} {error_logger,{{2005,9,11},{17,11,43}},std_info,[{application,kernel},{exited,{shutdown,{kernel,start,[normal,[]]}}},{type,permanent}]} {"Kernel pid terminated",application_controller,shutdown} Crash dump was written to: erl_crash.dump Kernel pid terminated (application_controller) (shutdown)" Here are the first 20 lines of the resulting erl_crash.dump file: "=erl_crash_dump:0.1 Sun Sep 11 16:01:58 2005 Slogan: Kernel pid terminated (application_controller) (shutdown) System version: Erlang (BEAM) emulator version 5.4.9 [source] [hipe] Compiled: Mon Sep 5 11:56:13 2005 Atoms: 3351 =memory total: 1710405 processes: 215258 processes_used: 208218 system: 1495147 atom: 137441 atom_used: 134092 binary: 144096 code: 873939 ets: 28268 =hash_table:atom_tab size: 2411 used: 1814 objs: 3351 ..." I pored over the Erlang Questions mailing list looking for previous problems with OS X and saw a suggestion to download the latest gcc version from the Apple website. I installed "Xcode Tools 2.2 Developer Preview 1", but this didn't seem to help. Can anyone suggest a solution to this problem? Thanks in advance for your help. Regards, Mark _________________________________________________________ Sent using Mail2Forum (http://m2f.sourceforge.net) From joe.armstrong@REDACTED Mon Sep 12 10:52:48 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Mon, 12 Sep 2005 10:52:48 +0200 Subject: Erlang vs. Java Message-ID: Dustin Sallings wrote > On Sep 8, 2005, at 20:22 , Richard A. O'Keefe wrote: > > My first comment is that I found it very difficult to read. > > In two senses. I normally browse with an old Netscape, and > > basically all I saw was a sea of black with a few dots of > > colour here and there. > This isn't a valid complaint. Although the page needs some minor changes to comply > with the standard it's claiming, it's more or less what one would expect on any modern > web site. If your browser is ten years old (a really dark time for the web), you > shouldn't expect things to work well I disagree - it *is* a valid comment - and it is a statement of fact Richard said "I found it difficult to read" - the consequence of this will be that he presumably not read the page unless he is not well motivated to do so. Now the best thing to is to install a favelet (or bookmarklet) such as, for example: http://www.accessify.com/accessibility-checking-favelets.asp In firefox you save the bookmark "Disable Stylesheets" in your favourites and enable your bookmarks toolbar - then when you see an unreadable page click on disable bookmarks and the CSS will be disassociated from the page - and the page magically becomes readable. IMHO all blogging/forum software should allow the *reader* of a page to decide the color scheme and layout etc - very few bloggers work this way. The stupid thing is that browsers allow the reader to change font sizes etc. but NOT color schemes - and I like Richard find certain color schemes very off-putting so I just don't bother to read these pages. When I author a web page I don't think "I know I'll choose a color scheme that makes my page totally unreadable - I'll but a purple background image, and make my text bright orange - and just in case I have any color-blind readers I'll make some nice green text on a red background. Oh and when you click on a link it will change to the background color, so you can never find it again" This has nothing to do with standards, nor the age of the browser - but everything to do with usability. As Richard said - "read Nielson" - not just the on-line stuff - buy the book. If you disagree with what I've said then please can you do one thing? - read the book Designing Web Usability: The Practice of Simplicity (Nielsen) before replying: Oh and read The Humane Interface - Rankin The Mythical man Month - Brooks The Elements of programming style - Kernigan and Plauger << aside - I just assume that everybody on this list has read these books - if you are programmer or software project manager or IT manager then not reading K&P, Brooks and Nielsen should be viewed as profession misconduct and lead to instant dismissal >> /Joe From mats.cronqvist@REDACTED Mon Sep 12 11:27:51 2005 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 12 Sep 2005 11:27:51 +0200 Subject: Erlang vs. Java In-Reply-To: References: Message-ID: <43254A17.6040703@ericsson.com> > Now the best thing to is to install a favelet (or bookmarklet) such as, > for example: > > http://www.accessify.com/accessibility-checking-favelets.asp interestingly enough this page looks like shit in firefox. small credibility problem there. mats From her@REDACTED Mon Sep 12 11:27:12 2005 From: her@REDACTED (Helmut Enck-Radana) Date: Mon, 12 Sep 2005 11:27:12 +0200 Subject: Erlang vs. Java In-Reply-To: References: Message-ID: <6.2.3.4.0.20050912111435.01e0a3e0@paradigma-software.de> Joe Armstrong wrote: >The stupid thing is that browsers allow the reader to change font >sizes etc. but NOT color schemes There is an extension for mozilla and firefox, which allows you to do just that with one click: http://prefbar.mozdev.org/ I always use it to read web pages with dark background or insufficient contrast. Other useful features of this extension include controlling support for javascript, java, flash, animations, fonts, popups and referrer http header - everything with one or two clicks (one click if it is used as toolbar, two clicks if used as pulldown menu). -- helmut From vlad.xx.dumitrescu@REDACTED Mon Sep 12 11:33:17 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Mon, 12 Sep 2005 11:33:17 +0200 Subject: Erlang vs. Java Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE616@esealmw105.eemea.ericsson.se> > > http://www.accessify.com/accessibility-checking-favelets.asp > > interestingly enough this page looks like shit in firefox. > small credibility problem there. The "real" page is at http://www.accessify.com/tools-and-wizards/accessibility-checking-favelets.asp, and it looks fine even in Firefox. /Vlad From sean.hinde@REDACTED Mon Sep 12 11:40:25 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Mon, 12 Sep 2005 10:40:25 +0100 Subject: Trouble compiling R10B-7 on OS X In-Reply-To: <20050911223251.9492547C17@bang.trapexit.org> References: <20050911223251.9492547C17@bang.trapexit.org> Message-ID: Hi, I don't have a solution to your problem, but can confirm that on my mac running the same OS version I do not see this problem. gs compiles and works well. Regards, Sean P.S Apologies for not abiding by the Reply-To header, but I'm not that convinced that my account is fully working for the mailing list these days.. On 11 Sep 2005, at 23:32, mshure wrote: > > Hello, > > > > I've been experimenting with Erlang on and off for the past couple > of years under various flavors of Windows, never reaching a high > level of expertise. Soon after buying my first Mac (an iMac G5 > running OS X v10.4.2), I recently decided to delve more deeply into > Erlang. However, I haven't had much success in getting it to run... > > > > On Windows machines I took advantage of the binary downloads, but > this is my first attempt at compiling the source code. Perhaps this > isn't a good first project with my Mac, but I tried anyway. I > installed the Xcode software, downloaded the R10B-7 source code, > followed the instructions in the README file and typed "make". The > compilation process seemed to go fine until I saw the following: > > > > "=== Leaving application debugger > > === Entering application gs > > erl -pa ../ebin -s gs_make -s erlang halt -noshell > > {error_logger,{{2005,9,11},{17,11,43}},supervisor_report, > [{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason, > {'DOWN',#Ref<0.0.0.12>,process,<0.15.0>,normal}},{offender, > [{pid,undefined},{name,code_server},{mfa,{code,start_link,[]}}, > {restart_type,permanent},{shutdown,2000},{child_type,worker}]}]} > > {error_logger,{{2005,9,11},{17,11,43}},crash_report,[[{pid,<0.7.0>}, > {registered_name,[]},{error_info,{shutdown,{kernel,start,[normal, > []]}}},{initial_call,{application_master,init,[<0.5.0>,<0.6.0>, > {appl_data,kernel, > [application_controller,erl_reply,auth,boot_server,code_server,disk_lo > g_server,disk_log_sup,erl_prim_loader,error_logger,file_server,file_se > rver_2,fixtable_server,global_group,global_name_server,heart,init,kern > el_config,kernel_sup,net_kernel,net_sup,rex,user,os_server,ddll_server > ,erl_epmd,inet_db,pg2],undefined,{kernel,[]}, > [application,application_controller,application_master,application_sta > rter,auth,code,code_aux,packages,code_server,dist_util,erl_boot_server > ,erl_distribution,erl_prim_loader,erl_reply,erlang,error_handler,error > _logger,file,file_server,old_file_server,file_io_server,prim_file,glob > al,global_group,global_search,group,heart,inet6_tcp,inet6_tcp_dist,ine > t6_udp,inet_config,inet_hosts,inet_gethost_native,inet_tcp_dist,init,k > ernel,kernel_config,net,net_adm > ,net_kernel,os,ram_file,rpc,user,user_drv,user_sup,disk_log,disk_log_ > 1,disk_log_server,disk_log_sup,dist_ac,erl_ddll,erl_epmd,erts_debug,ge > n_tcp,gen_udp,prim_inet,inet,inet_db,inet_dns,inet_parse,inet_res,inet > _tcp,inet_udp,pg2,seq_trace,wrap_log_reader,zlib,otp_ring0], > [],infinity,infinity},normal]}},{ancestors,[<0.6.0>]},{messages, > [{'EXIT',<0.8.0>,normal}]},{links,[<0.6.0>,<0.5.0>]},{dictionary, > []},{trap_exit,true},{status,running},{heap_size,987},{stack_size, > 21},{reductions,1062}],[]]} > > {error_logger,{{2005,9,11},{17,11,43}},std_info, > [{application,kernel},{exited,{shutdown,{kernel,start,[normal, > []]}}},{type,permanent}]} > > {"Kernel pid terminated",application_controller,shutdown} > > > > Crash dump was written to: erl_crash.dump > > Kernel pid terminated (application_controller) (shutdown)" > > > > Here are the first 20 lines of the resulting erl_crash.dump file: > > > > "=erl_crash_dump:0.1 > > Sun Sep 11 16:01:58 2005 > > Slogan: Kernel pid terminated (application_controller) (shutdown) > > System version: Erlang (BEAM) emulator version 5.4.9 [source] [hipe] > > Compiled: Mon Sep 5 11:56:13 2005 > > Atoms: 3351 > > =memory > > total: 1710405 > > processes: 215258 > > processes_used: 208218 > > system: 1495147 > > atom: 137441 > > atom_used: 134092 > > binary: 144096 > > code: 873939 > > ets: 28268 > > =hash_table:atom_tab > > size: 2411 > > used: 1814 > > objs: 3351 > > ..." > > > > I pored over the Erlang Questions mailing list looking for previous > problems with OS X and saw a suggestion to download the latest gcc > version from the Apple website. I installed "Xcode Tools 2.2 > Developer Preview 1", but this didn't seem to help. > > > > Can anyone suggest a solution to this problem? Thanks in advance > for your help. > > > > > > Regards, > > > > Mark > _________________________________________________________ > Sent using Mail2Forum (http://m2f.sourceforge.net) > From joelr1@REDACTED Mon Sep 12 11:52:41 2005 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 12 Sep 2005 11:52:41 +0200 Subject: Usability (was Re: Erlang vs. Java) In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE616@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE616@esealmw105.eemea.ericsson.se> Message-ID: <347D1E02-6851-4110-87DF-1928E416A058@gmail.com> Does anybody hate when threads get hijacked? It makes it tough to browse archives, for example. You are reading about Erlang vs. Java and all of a sudden you are in usability land ;-). On Sep 12, 2005, at 11:33 AM, Vlad Dumitrescu XX (LN/EAB) wrote: > > >>> http://www.accessify.com/accessibility-checking-favelets.asp >>> >> >> interestingly enough this page looks like shit in firefox. >> small credibility problem there. >> > > The "real" page is at http://www.accessify.com/tools-and-wizards/ > accessibility-checking-favelets.asp, and it looks fine even in > Firefox. > > /Vlad > > -- http://wagerlabs.com/uptick From mccratch@REDACTED Mon Sep 12 12:38:33 2005 From: mccratch@REDACTED (Matthias Kretschmer) Date: Mon, 12 Sep 2005 12:38:33 +0200 Subject: Usability (was Re: Erlang vs. Java) In-Reply-To: <347D1E02-6851-4110-87DF-1928E416A058@gmail.com> References: <11498CB7D3FCB54897058DE63BE3897C4BE616@esealmw105.eemea.ericsson.se> <347D1E02-6851-4110-87DF-1928E416A058@gmail.com> Message-ID: <20050912103832.GB703@khasra.kilrathi.lcn> Hello, just to give you all my two cents to this usability stuff. I asked my sister (who is working at the Fraunhofer Institut Angewandte Informationstechnik (FIT) in the field of usability as a Diplom psychologist) about what is good to read. She mentioned that Nielson is a very good start to read about usability stuff. And for example a german language magazine is publicated by FIT which ought to be good somehow. Thought maybe it isn't wrong to ask someone doing this stuff all day :) -- Matthias Kretschmer From klacke@REDACTED Mon Sep 12 16:39:40 2005 From: klacke@REDACTED (Claes Wikstom) Date: Mon, 12 Sep 2005 16:39:40 +0200 Subject: gs debugger Message-ID: <4325932C.5080503@hyber.org> Howdy list, I'm sometime using the gs debugger but I'm finding it incredibly confusing. I don't understand how to reload code in the debugger. All I want to do is to perform the equivalent of: > foo:run(). ... edit code, recompile code > l(foo). > foo:run(). I can't seem to do the above in the debugger. It's always highly unclear wether > int:i(Mod) really reads the new sourcecode or not. What am I missing ? How do you folks use the debugger ? /klacke -------------- next part -------------- A non-text attachment was scrubbed... Name: klacke.vcf Type: text/x-vcard Size: 301 bytes Desc: not available URL: From peter.c.marks@REDACTED Mon Sep 12 17:04:19 2005 From: peter.c.marks@REDACTED (Peter Marks) Date: Mon, 12 Sep 2005 11:04:19 -0400 Subject: Using cygwin Message-ID: <239d02ca05091208043f1347f2@mail.gmail.com> Hello, I'm new to the list. I came upon Erlang via the "Concepts, Techniques and Models..." book. So far, Erlang has satisfied my need for something simpler and more suitable for the type of work I do: developing distributed applications. While not what you would consider really "distributed", I spent the past year developing the deception called a web application. In this case, I was using Java, Faces and JSP. It wasn't fun. Prior to that I spent a few years at Sun working with the Jini infrastructure. I've looked in the archives but I couldn't find an answer to this question: I have been trying to build the cnode_s.c example from the Interoperability Tutorial using cygwin on Windows XP. What is a "typical" gcc compile and link command line? Thanks, Peter From harveyd@REDACTED Mon Sep 12 17:22:37 2005 From: harveyd@REDACTED (Dale Harvey) Date: Mon, 12 Sep 2005 16:22:37 +0100 Subject: Post Arguments Message-ID: Hey Im having small problems formulating post arguements in http:request to match the format sent by browsers, allowed types are binary, and string, I outputted Arg after sending a post request from a form with 2 fields, number and string the post part of the argument was in binary, so io:formatting binary_to_term came out [{"number","numberval"},{"string","stringval"}] this is also what yaws_api:parse_post() gave me which is pretty much what i expected, but if i send, PostArg = term_to_binary([{"number","numberval"},{"string","stringval"}]) http:request(post,{Url,[],"text/plain",PostArg},[],[]), I need to use [{MessageTemp,_}] = yaws_api:parse_post(Arg), Message = binary_to_term(list_to_binary(MessageTemp)). to get the post arguments in [{Key,Val}] format (please dont ask how / why i came up with that) So is there any way to manually formulate post arguements to match the format they are sent by a browser, as I havent found anything to help me do so Thanks Dale -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Vanwoerkom@REDACTED Mon Sep 12 17:35:09 2005 From: Marc.Vanwoerkom@REDACTED (Marc van Woerkom) Date: Mon, 12 Sep 2005 17:35:09 +0200 Subject: Using cygwin In-Reply-To: <239d02ca05091208043f1347f2@mail.gmail.com> Message-ID: >question: I have been trying to build the cnode_s.c >example from the >Interoperability Tutorial using cygwin on Windows XP. >What is a >"typical" gcc compile and link command line? If have not tried this yet. But if I would, I would make sure it links against the MS C lib, thus using mingw mode, as Erlang was compiled with the MS compiler. Read the doc http://www.mozilla.org/build/win32.html which explains a similiar problem, building Mozilla on Win32, and has links how to use gcc or download and use the free available MS cl (commandline C) compiler. Regards, Marc From svenolof@REDACTED Mon Sep 12 17:46:21 2005 From: svenolof@REDACTED (Sven-Olof Nystr|m) Date: Mon, 12 Sep 2005 17:46:21 +0200 Subject: gb_trees:search/3 In-Reply-To: References: Message-ID: <17189.41677.68216.959850@harpo.it.uu.se> Ulf Wiger (AL/EAB) writes: > > I've been playing with ways to implement a functional resource database. > My current version uses gb_trees, but I decided I was missing a function: > > > search(Fun, Acc, {_S, T}) -> > _Acc1 = search_1(Fun, Acc, T). > > > search_1(Fun, Acc, nil) -> [snip] > > One could say that it's main purpose is to allow the user to come up > with new access functions without having to know the exact structure > of the tree. > > The functions next/2 and prev/2 could then be implemented in > this way: > > next(Key, T) -> > F = fun(nil,nil,Acc) -> > case Acc of > {found, Found} -> > {return, Found}; > not_found -> > {return, '$end_of_table'} > end; > (K,V, not_found) when K =< Key -> > {bigger, not_found}; > (K,V, {found, Found}) when K =< Key -> > {bigger, {found, Found}}; > (K,V, not_found) when K > Key -> > {smaller, {found, {K,V}}}; > (K,V, {found,_}) when K > Key -> > {smaller, {found,{K,V}}} > end, > gb_trees:search(F, not_found, T). Clauses 2 & 3, and 4 & 5 could be merged, of course. The lookup function in the gb_trees library returns {value, V} when a value is found and `none' if not. Why not follow the same convention here? > And my resource database reservation function > could look like this. > (The tree initially consists of one object, > {Min, Max}, indicating the range of free resources. > E.g. [{1,99},{101,1000}] would mean that the > resource 100 has been allocated but the rest, i.e. > 1-99 and 101-1000, are free > > > reserve(N, T) -> [...] > I'm sure you could do a lot of other stuff with search/3 too. I'm not so sure. I can think of a few others, such as building (unbalanced) trees of all nodes greater or smaller than a given key, but I don't think you could do much else with the search function. > > There's probably a more elegant construct that would solve the > problem with equal or better efficiency. Please go ahead and > suggest better ways. See your next mail :-) Ulf Wiger (AL/EAB) writes: > > Replying to my own post, the easier case > is of course when just a resource (not a specific > number) is asked for: > > reserve(Free) -> > case gb_trees:take_smallest(Free) of > {Min, Min, Free1} -> > {Min, Free1}; > {Min, Max, Free1} when Max > Min -> > {Min, gb_trees:insert(Min+1, Max, Free1)} > end. > > free/2 is more involved as it needs to de-fragment the > tree, but that would be done along the same lines as > reserve/2, using the gb_trees:search/3 function. Why defragment? The cost of defragmentation could easily exeed the cost of having a fragmented tree in memory (unless you need to be able to allocate contiguous sequences of resources, of course). Yes, I can see situations where fragmentations might be worthwhile (for example, if the number of resources is very large), but then it might also be a good idea to consider alternatives to gb_trees. Sven-Olof From nicolas@REDACTED Mon Sep 12 19:10:56 2005 From: nicolas@REDACTED (Nicolas Niclausse) Date: Mon, 12 Sep 2005 19:10:56 +0200 Subject: set inetrc on a remote beam ? Message-ID: <4325B6A0.8050806@niclux.org> Hello, I'm trying to set an inetrc file with a remote beam started with the 'slave' module. Problem: it works when the remote beam is on the same host, but not on a remote host. My system: Linux RHAS3, Erlang (BEAM) emulator version 5.4.9 [64-bit] [source] [hipe] [threads:0] nef:>./test.sh nef Args: " -rsh ssh -setcookie bar " Result: {ok,foo@REDACTED} Args: " -rsh ssh -setcookie bar -kernel inetrc '\"/home/nniclaus/sources/erlang/tsunami/priv/inetrc\"'" Result: {ok,foo@REDACTED} nef:>./test.sh nef001 Args: " -rsh ssh -setcookie bar " Result: {ok,foo@REDACTED} Args: " -rsh ssh -setcookie bar -kernel inetrc '\"/home/nniclaus/sources/erlang/tsunami/priv/inetrc\"'" Result: {error,timeout} but the file exist on the remote host: nef:>ssh nef001 "cat /home/nniclaus/sources/erlang/tsunami/priv/inetrc" {file, resolv, "/etc/resolv.conf"}. {lookup, [dns]}. From the generated crash dump: ... 'no -shutdown_time flag' '/home/nniclaus/sources/erlang/tsunami/priv/inetrc' '\'/\'' 'syntax error before: ' 'application_controller: ~s: ~s~n' lowercase ... Any idea ? Or is there another way to set inet configuration ? ------------ testcase.erl: -module(testcase). -export([main/1, erl_system_args/0]). main([Host])-> main(Host); main(Host)-> Args= erl_system_args(), io:format("Args: ~p~n",[Args]), R = slave:start_link(Host,foo,Args ), io:format("Result: ~p~n",[R]). erl_system_args()-> Rsh = case init:get_argument(rsh) of {ok,[["ssh"]]} -> " -rsh ssh "; _ -> " " end, Cookies = "-setcookie " ++atom_to_list(erlang:get_cookie()), Inet = case init:get_argument(kernel) of {ok,[["inetrc",InetRcFile]]} -> " -kernel inetrc '"++ InetRcFile ++"'"; _ -> " " end, lists:append([Rsh,Cookies,Inet]). ----------- test.sh: #!/bin/bash INPUTRC='"/home/nniclaus/sources/erlang/tsunami/priv/inetrc"' erl -noshell -rsh ssh -s testcase main $1 -s init stop -sname bar \ -setcookie bar erl -noshell -rsh ssh -s testcase main $1 -s init stop -sname bar \ -setcookie bar -kernel inetrc $INPUTRC -- Nicolas From danie@REDACTED Mon Sep 12 19:25:56 2005 From: danie@REDACTED (Daniel Schutte) Date: Mon, 12 Sep 2005 19:25:56 +0200 Subject: Sybase Linked In Driver Message-ID: <200509121925.56518.danie@erlfinsys.net> Good afternoon, Eventually a new release of the driver :):) ?written by one of our clever programmers: Michael Scholtz. please find attached the new erlang sybase linked in driver with example code and documentation. ?Although it is stable, the code is not yet beautiful and not everything (like unloading) is fully supported. This driver is easier to install and deploy than the previous driver. This driver is giving us a 258% increase in performance on our benchmarking systems. ?Feel free to use or publish it. ?We will also be maintaining it at www.erlfinsys.net. If there is interest we can also make a subversion copy available. Questions, queries, bug fixes and bug reports can be sent to info@REDACTED Enjoy Danie -- Daniel H Schutte Mobile: +27 84 468 3138 Office: +27 11 675 2643 The more laws and order are made prominent, the more thieves and robbers there will be. -- Lao Tsu -------------- next part -------------- A non-text attachment was scrubbed... Name: erl_sybase_lid_1_00.tar.gz Type: application/x-tgz Size: 14663 bytes Desc: not available URL: From ulf.wiger@REDACTED Mon Sep 12 22:20:29 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 12 Sep 2005 22:20:29 +0200 Subject: gb_trees:search/3 Message-ID: Sven-Olof Nystr?m wrote: > > Ulf Wiger (AL/EAB) writes: > > Clauses 2 & 3, and 4 & 5 could be merged, of course. > > The lookup function in the gb_trees library returns > {value, V} when a value is found and `none' if not. > Why not follow the same convention here? Indeed. Obviously, the examples were put together in haste. (: > > I'm sure you could do a lot of other stuff with > search/3 too. > > I'm not so sure. I can think of a few others, such as > building (unbalanced) trees of all nodes greater or > smaller than a given key, but I don't think you could > do much else with the search function. Well, we're both wrong, as it turns out. (: As written, you probably cannot do much else with it, and in fact not even what you suggest, since there is no way to make sure that you actually find all nodes greater or smaller than a given key (since it always goes down only one branch). New attempt: search_1(_Fun, Acc, nil) -> Acc; search_1(Fun, Acc, {Key, V, Smaller, Bigger}) -> case Fun(Key, V, Acc) of {smaller, Acc1} -> search_1(Fun, Acc1, Smaller); {both, Acc1} -> Acc2 = search_1(Fun, Acc1, Smaller), search_1(Fun, Acc2, Bigger); {bigger, Acc1} -> search_1(Fun, Acc1, Bigger); {return, Acc1} -> Acc1 end. fixing the mistake of calling Fun(nil,nil,Acc) and allowing the iteration to scan both branches, it can at least be used for _some_ more stuff: 2> T = gb_trees:empty(). {0,nil} 3> T1 = lists:foldl(fun({K,V},Tx) -> gb_trees:insert(K,V,Tx) end, T, [{N,a} || N <- lists:seq(1,10,2)]). {5,{1,a,nil,{3,a,nil,{5,a,nil,{7,a,nil, {9,a,nil,nil}}}}}} 5> T2 = lists:foldl(fun({K,V},Tx) -> gb_trees:insert(K,V,Tx) end, T1, [{N,b} || N <- lists:seq(2,10,2)]). {10, {1, a, nil, {3, a, {2,b,nil,nil}, {5,a,{4,b,nil,nil},{7,a,{6,b,nil,nil}, {9,a,{8,b,nil,nil},{10,b,nil,nil}}}}}}} 11> F = fun(K,a,Acc) -> {both,[K|Acc]}; (_, _, Acc) -> {both,Acc} end. #Fun 12> vccTree:search(F,[],T2). [9,7,5,3,1] 14> F1 = fun(K,V,Acc) when K > 5 -> {smaller,Acc}; (K,V,Acc) -> {both,[{K,V}|Acc]} end. #Fun 15> vccTree:search(F1,[],T2). [{4,b},{5,a},{2,b},{3,a},{1,a}] The first example doesn't really introduce anything new, as it scans the whole tree (most likely less efficient than iterator()) The second example is almost equivalend to ets:select/2 on an ordered_set, but with the difference (as of now) that ets:select/2 will scan the whole table if at least the first part of the key isn't bound(*). Now, this is a feature that at least I use _a lot_. (*) Also with the difference that my function screws up the order. > > There's probably a more elegant construct > > that would solve the problem with equal > > or better efficiency. Please go ahead and > > suggest better ways. > > See your next mail :-) Not fair, as it solved another problem. (: I want to support both getting the first available free resource, and reserving a specific resource (c.f. UNIX sockets.) > > free/2 is more involved as it needs to > > de-fragment the tree, but that would be > > done along the same lines as reserve/2, > > using the gb_trees:search/3 function. > > Why defragment? The cost of defragmentation > could easily exeed the cost of having a > fragmented tree in memory (unless you need to be > able to allocate contiguous sequences of resources, > of course). Yes, I do that too. > Yes, I can see situations where > fragmentations might be worthwhile (for example, > if the number of resources is very large), but then > it might also be a good idea to consider alternatives > to gb_trees. My intention was to allow a very large virtual range. allocated. BTW, the code to free resources and de-fragment looks pretty much like this: do_free_x(Id, Free) -> Prev = prev(Id, Free), Next = next(Id, Free), case {Prev, Next} of {{value,{A,B}}, _} when A >= Id, Id >= B -> erlang:error({not_reserved, Id}); {_, {value,{C,D}}} when C >= Id, Id >= D -> erlang:error({not_reserved, Id}); {{value,{A,B}}, {value,{C,D}}} when B == Id-1, C == Id+1 -> Free1 = delete(C, Free), update(A, D, Free1); {_, {value,{C,D}}} when Id+1 == C -> Free1 = delete(C, Free), insert(Id, D, Free1); {{value,{A,B}}, _} when B+1 == Id -> update(A, Id, Free); Other -> insert(Id, Id, Free) end. Ony my SunBlade, reserving and freeing resources with gb_trees takes about 20-30 microsecs on a small tree, and about 40 usecs on a large one (10,000 nodes). Forgetting about this particular example, having previous(), next() and an efficient way to select nodes in a tree without having to traverse the whole tree would be useful, don't you think? Today, you can do that with ets ordered_set, but not easily with any of the functional data structures provided by OTP. /Uffe From klacke@REDACTED Mon Sep 12 22:58:32 2005 From: klacke@REDACTED (Claes Wikstrom) Date: Mon, 12 Sep 2005 22:58:32 +0200 Subject: gs debugger In-Reply-To: <200509122152.18628.stromme@telia.com> References: <4325932C.5080503@hyber.org> <200509122152.18628.stromme@telia.com> Message-ID: <4325EBF8.7080801@hyber.org> Per Einar Str?mme wrote: > s > > > > Hej Klacke ! > > If the "gs debugger" is the one started using "debugger:start()." > then this is how I use it: > Hmmm still unclear. Look at this session, it's a combination of the unix and the erlang shell # cat b.erl -module(b). -compile(export_all). foo() -> 5 + 2. # erlc +debug_info b.erl # erl Erlang (BEAM) emulator version 5.4.6 [source] [hipe] Eshell V5.4.6 (abort with ^G) 1> im(). %% pops up the debugger GUI <0.32.0> 2> int:i(b). {module,b} %% at this point I chose a breakpoint with the GUI at %% the line 5 + 2 %% I also click Options->Auto Attach->On Break %% 3> b:foo(). %% Fine, I get a breakpoint at the 5+2 line and %% all is fine, Click continue %% in another unix shell # emacs b.erl # cat b.erl -module(b). -compile(export_all). foo() -> 55 + 25. # erlc +debug_info b.erl Back to the erlang shell 4> l(b). ..... ahhh see it's always a good thing to write down stuff, everything gets clearer then. It sems as if I call > l(Mod). I still execute the old interpreted code, but my breakpoints disappear, whereas if I a) make sure the processes die Process->Kill and b) 5> int:i(Mod). I get to keep the breakpoints and also get the new code. Still confusing but better ... I thought that loading interpreted code with c:l/1 did the right thing (I seem to remember that it did many years ago ... but maybe my memory fails me ....) Also, reloading with 7> int:i(Mod). without killing the old process is probably what really confused me since it then looks simply as if the breakpoint disapears. /klacke -------------- next part -------------- A non-text attachment was scrubbed... Name: klacke.vcf Type: text/x-vcard Size: 315 bytes Desc: not available URL: From dustin@REDACTED Tue Sep 13 03:47:38 2005 From: dustin@REDACTED (Dustin Sallings) Date: Mon, 12 Sep 2005 18:47:38 -0700 Subject: Erlang vs. Java In-Reply-To: References: Message-ID: <97E25650-6333-4AC4-9E08-953A8527D296@spy.net> On Sep 12, 2005, at 1:52 , Joe Armstrong (AL/EAB) wrote: > I disagree - it *is* a valid comment - and it is a statement of fact > > Richard said "I found it difficult to read" - the consequence of > this will be > that he presumably not read the page unless he is not well > motivated to do so. First, let me apologize for perpetuating this thread digression, but there's a subtlety that was missed in here: 1) He said it's hard to read, but didn't give much of an indication as to how it was difficult to read. 2) In a private message, he described what the page looked like to him, and it was not what was specified (``In this year's Mozilla, it prints as pale grey on white.''). For #1, I don't believe it's constructive to tell people that something is bad and point them off at endless volumes of information about what is good hoping they'll spend time absorbing all of it and realize what small mistake was made. It's just not that hard to say, ``I have trouble reading this because of the low contrast between the grey text and the white background.'' At that point, it would've been obvious that something wasn't working correctly. For #2, this sounds like user error. The web page specifically called for a black background, which is how it was rendered on my screen. In order to get the background to be white, one would have to either be using a browser that doesn't understand web standards, or one would've had to have partially overridden what the designer had requested. Perhaps there are other possibilities, but I don't know what they were, because no further information was given. So, in summary, when I said it's not a valid complaint, perhaps I should've said it's not a constructive complaint. From what I've been able to gather after the initial complaint, it sounds more like user-error, which (I would say) would make it a completely invalid complaint. Sorry again for dragging this along. The java discussion was somewhat interesting at the beginning, at least. -- SPY My girlfriend asked me which one I like better. pub 1024/3CAE01D5 1994/11/03 Dustin Sallings | Key fingerprint = 87 02 57 08 02 D0 DA D6 C8 0F 3E 65 51 98 D8 BE L_______________________ I hope the answer won't upset her. ____________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Tue Sep 13 05:17:40 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 13 Sep 2005 15:17:40 +1200 (NZST) Subject: Usability (was: Re: Erlang vs Java) Message-ID: <200509130317.j8D3HeTx194942@atlas.otago.ac.nz> Dustin Sallings wrote: 1) He said it's hard to read, but didn't give much of an indication as to how it was difficult to read. Let's be accurate in our quotation, shall we? My first comment is that I found it very difficult to read. that's not a general assertion that it *is* hard to read (which I would take as meaning the text is bad) but a specific statement that *I* found it difficult to read (which means that there is a presentation problem). But there was detail: basically all I saw was a sea of black with a few dots of colour here and there. If you want technical detail, the page is very heavy-handed with CSS, and on one of the pages where I checked, the CSS wasn't quite legal. But it's surely clear that it's a matter of messing with colours &c. The reference to http//useit.com takes you to a link "Why this site has almost no graphics", which is relevant. The "Alertbox" link takes you to a page where you see Read these first: [Usability 101] and [Top ten mistakes of web design]. In the latter, mistake 5 has the very clear advice Respect the user's preferences and mistake 8, "Violating Design Conventions", is pretty much at the heart of the issue. Jakob's Law of the Web User Experience states that "users spend most of their time on _other_ websites." This means that they form their expectations for your site based on what's commonly done on most other sites. If you deviate, your site will be harder to use and users will leave. (It's off-topic, but the "worst example" in mistake 10 is one that has personally made me very cross indeed with a number of software vendors including one Prolog vendor. This guy just has so much good sense.) At the foot of that page, there are links to other lists, including three versions of the classic "Top Ten Mistakes in Web Design." "Non-Standard Link Colours" was number 8 originally, it's subsumed by the current #8. 2) In a private message, he described what the page looked like to him, and it was not what was specified (``In this year's Mozilla, it prints as pale grey on white.''). That's not how it *looked* on screen, but how it *prints*. And it prints that way because fancy colours on the screen *usually* print very badly on a black and white printer. Anyone who uses CSS heavily should use the CSS2 @media feature to provide separate @media print and @media screen rule-sets, because what works well for one often doesn't work well for the other. For #2, this sounds like user error. What possible user error could there be? Type mozilla "the URL goes here" on the command line, see page, select File|Print, clicky clicky to make it happen, the right page appears on the printer. It's just that it's a page which uses a lot of CSS that messes with colours and didn't use @media print to fix that for printing. The web page specifically called for a black background, which is how it was rendered on my screen. Setting a black background is in itself a pretty big web design botch. Over the last week I must have visited about a dozen blogs; this was the *only* one that tried to impose heavy styling on what is, let's face it, basically straightforward text. To repeat the quotation from Mistake 8: If you deviate, your site will be harder to use and users will leave. The heavy styhling in this blog is a sufficient deviation that normally I would just leave at once. Importantly, though, how a page is rendered on a colour *screen* (which I commented on for Netscape, and it was clear from that comment that I *did* get a black background) and how it is *printed* on a black-and-white printer are two different things. In order to get the background to be white, one would have to either be using a browser that doesn't understand web standards, or one would've had to have partially overridden what the designer had requested. In order to think that it's a user error, you have to misread what the user actually wrote. The relevant keyword was *PRINT*. So, in summary, when I said it's not a valid complaint, perhaps I should've said it's not a constructive complaint. Maybe you should have tried reading it more carefully. From neumann@REDACTED Tue Sep 13 05:25:53 2005 From: neumann@REDACTED (=?iso-8859-1?q?Fran=E7ois-Denis_Gonthier?=) Date: Mon, 12 Sep 2005 23:25:53 -0400 Subject: Fwd: Bug#328031: erlang: ftbfs [sparc] cp: cannot stat `lib/parsetools/ebin/*.beam' Message-ID: <200509122325.55590.neumann@lostwebsite.net> Anyone got any problem building (or any experience at all) with building Erlang 10.b.7 on Sparc. Erlang 10.b.7 recently got uploaded to the main Debian archive and it broke the build of 4 platform (mipsel, hppa, arm and sparc). I will take any clues. ---------- Forwarded Message ---------- Subject: Bug#328031: erlang: ftbfs [sparc] cp: cannot stat `lib/parsetools/ebin/*.beam' Date: 12 September 2005 22:56 From: Blars Blarson To: Debian Bug Tracking System Package: erlang Version: 1:10.b.7-1 Severity: serious Justification: fails to build from source erlang failed to build on a sparc buildd, duplicated on my sparc pbuilder. === Entering application hipe make[4]: Entering directory `/build/buildd/erlang-10.b.7/lib/hipe/rtl' /build/buildd/erlang-10.b.7/bin/sparc-unknown-linux-gnu/hipe_mkliterals -e > hipe_literals.hrl erlc -W +debug_info +inline -o../ebin hipe_rtl_arch.erl make[4]: *** [../ebin/hipe_rtl_arch.beam] Bus error make[4]: Leaving directory `/build/buildd/erlang-10.b.7/lib/hipe/rtl' make[4]: Entering directory `/build/buildd/erlang-10.b.7/lib/hipe/misc' erlc -W +debug_info -o../ebin hipe_consttab.erl make[4]: *** [../ebin/hipe_consttab.beam] Bus error make[4]: Leaving directory `/build/buildd/erlang-10.b.7/lib/hipe/misc' make[4]: Entering directory `/build/buildd/erlang-10.b.7/lib/hipe/main' sed -e "s;%VSN%;3.5.2;" hipe.hrl.src > hipe.hrl erlc -W +debug_info +nowarn_shadow_vars -o../ebin hipe.erl make[4]: *** [../ebin/hipe.beam] Bus error make[4]: Leaving directory `/build/buildd/erlang-10.b.7/lib/hipe/main' make[4]: Entering directory `/build/buildd/erlang-10.b.7/lib/hipe/cerl' erlc -W +debug_info +nowarn_shadow_vars +inline -o../ebin cerl_lib.erl make[4]: *** [../ebin/cerl_lib.beam] Bus error make[4]: Leaving directory `/build/buildd/erlang-10.b.7/lib/hipe/cerl' make[4]: Entering directory `/build/buildd/erlang-10.b.7/lib/hipe/icode' erlc -W +debug_info +nowarn_shadow_vars -o../ebin hipe_icode.erl make[4]: *** [../ebin/hipe_icode.beam] Bus error make[4]: Leaving directory `/build/buildd/erlang-10.b.7/lib/hipe/icode' make[4]: Entering directory `/build/buildd/erlang-10.b.7/lib/hipe/flow' erlc -W +debug_info -o../ebin hipe_bb.erl make[4]: *** [../ebin/hipe_bb.beam] Bus error make[4]: Leaving directory `/build/buildd/erlang-10.b.7/lib/hipe/flow' make[4]: Entering directory `/build/buildd/erlang-10.b.7/lib/hipe/util' erlc -W +debug_info -o../ebin hipe_timing.erl make[4]: *** [../ebin/hipe_timing.beam] Bus error make[4]: Leaving directory `/build/buildd/erlang-10.b.7/lib/hipe/util' === Leaving application hipe make[3]: Leaving directory `/build/buildd/erlang-10.b.7/lib/hipe' make[2]: Leaving directory `/build/buildd/erlang-10.b.7/lib' if test ! -d /build/buildd/erlang-10.b.7/bootstrap/lib/kernel ; then mkdir /build/buildd/erlang-10.b.7/bootstrap/lib/kernel ; fi if test ! -d /build/buildd/erlang-10.b.7/bootstrap/lib/kernel/ebin ; then mkdir /build/buildd/erlang-10.b.7/bootstrap/lib/kernel/ebin ; fi if test ! -d /build/buildd/erlang-10.b.7/bootstrap/lib/kernel/include ; then mkdir /build/buildd/erlang-10.b.7/bootstrap/lib/kernel/include ; fi cp -f lib/kernel/ebin/*.beam /build/buildd/erlang-10.b.7/bootstrap/lib/kernel/ebin cp -f lib/kernel/include/*.hrl /build/buildd/erlang-10.b.7/bootstrap/lib/kernel/include if test ! -d /build/buildd/erlang-10.b.7/bootstrap/lib/hipe ; then mkdir /build/buildd/erlang-10.b.7/bootstrap/lib/hipe ; fi if test ! -d /build/buildd/erlang-10.b.7/bootstrap/lib/hipe/ebin ; then mkdir /build/buildd/erlang-10.b.7/bootstrap/lib/hipe/ebin ; fi if test -f lib/hipe/ebin/hipe.beam ; then cp lib/hipe/ebin/*.beam /build/buildd/erlang-10.b.7/bootstrap/lib/hipe/ebin; fi if test ! -d /build/buildd/erlang-10.b.7/bootstrap/lib/parsetools ; then mkdir /build/buildd/erlang-10.b.7/bootstrap/lib/parsetools ; fi if test ! -d /build/buildd/erlang-10.b.7/bootstrap/lib/parsetools/ebin ; then mkdir /build/buildd/erlang-10.b.7/bootstrap/lib/parsetools/ebin ; fi if test ! -d /build/buildd/erlang-10.b.7/bootstrap/lib/parsetools/include ; then mkdir /build/buildd/erlang-10.b.7/bootstrap/lib/parsetools/include ; fi cp lib/parsetools/ebin/*.beam /build/buildd/erlang-10.b.7/bootstrap/lib/parsetools/ebin cp: cannot stat `lib/parsetools/ebin/*.beam': No such file or directory make[1]: *** [secondary_bootstrap_copy] Error 1 ------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From matthias@REDACTED Tue Sep 13 09:05:24 2005 From: matthias@REDACTED (Matthias Lang) Date: Tue, 13 Sep 2005 09:05:24 +0200 Subject: Usability (was: Re: Erlang vs Java) In-Reply-To: <200509130317.j8D3HeTx194942@atlas.otago.ac.nz> References: <200509130317.j8D3HeTx194942@atlas.otago.ac.nz> Message-ID: <17190.31284.498255.378921@antilipe.corelatus.se> Dustin Sallings: > So, in summary, when I said it's not a valid complaint, perhaps > I should've said it's not a constructive complaint. Richard A. O'Keefe: > Maybe you should have tried reading it more carefully. Looking back over the multiple clarifications and explanations and drawn-out delivery of relevant detail in this thread, I feel that the greatest improvement could have come from writing your original post more clearly. Matthias From bengt.kleberg@REDACTED Tue Sep 13 10:07:25 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 13 Sep 2005 10:07:25 +0200 Subject: gs debugger In-Reply-To: <4325932C.5080503@hyber.org> References: <4325932C.5080503@hyber.org> Message-ID: <432688BD.80506@ericsson.com> On 2005-09-12 16:39, Claes Wikstom wrote: > ...deleted > > What am I missing ? How do you folks use the > debugger ? i use the dbg module (instead). what does the debugger do that makes it better? bengt From knutbakke@REDACTED Tue Sep 13 10:22:17 2005 From: knutbakke@REDACTED (Knut Bakke) Date: Tue, 13 Sep 2005 01:22:17 -0700 (PDT) Subject: ets:lookup and ets:update_counter return [] although key/value is there Message-ID: <20050913082218.5584.qmail@web61020.mail.yahoo.com> Hi, after upgrading to a more powerfull pentium IV processor on an ets intensive application we have experienced that ets:lookup and ets:update_counter sometimes returns empty list although the key is there. By doing another lookup/update_couter immediatly after the failed one, the operation succeeds (key and value are returned). We see that this problem only affects a small set of keys (and the same keys). That is, 2 or 3 keys (and the same ones) out of about 1000 elements in a ets are having problems every now and then. There are parallell ets:update_counter/insert working on the same keys from other processes, but no delete. I know that ets should be deadly safe, but it is strange that the second lookup/update_counter happens immedialty after the failing one ALWAYS succeeds. The fault is reproducable only on the machine we see the problem and for the specific keys. The test simply lookup a key that we have seen failing. Doing 10000 ets:lookup's about 4 fails. We have upgraded to R10B without any improvement. Any idea? My best clue: I know that the memory driver for erlang has been changed to delete memory areas before updating them - to reduce memory fragmentation. Could it be that there is a time slice where the data is not there? BR Knut Bakke. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From klacke@REDACTED Tue Sep 13 10:37:42 2005 From: klacke@REDACTED (Claes Wikstom) Date: Tue, 13 Sep 2005 10:37:42 +0200 Subject: erlang and gdb Message-ID: <43268FD6.4040806@hyber.org> I'm getting a SIGSEGV when I start R10B-7 on one of machines. What's the preferred way to run the emulator under gdb these days? I used to use a script that was initially crafted by Tony I think but it's rotted over the years ... /klacke -------------- next part -------------- A non-text attachment was scrubbed... Name: klacke.vcf Type: text/x-vcard Size: 301 bytes Desc: not available URL: From bjorn@REDACTED Tue Sep 13 10:42:39 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 13 Sep 2005 10:42:39 +0200 Subject: ets:lookup and ets:update_counter return [] although key/value is there In-Reply-To: <20050913082218.5584.qmail@web61020.mail.yahoo.com> References: <20050913082218.5584.qmail@web61020.mail.yahoo.com> Message-ID: Knut Bakke writes: > My best clue: I know that the memory driver for erlang > has been changed to delete memory areas before > updating them - to reduce memory fragmentation. Could > it be that there is a time slice where the data is not > there? (I suppose you refer to the +r flag.) NO. The current emulator is single-threaded. Nothing else can run while an ets operation is taking place. I strongly suspect that there is a bug in your own application, that changing the hardware has changed the timing and exposed a latent bug. Of course, the bug could be in ets; in that case it should be possible to reproduce it on any machine if you would do EXACTLY the same ets operations. Have you tried to trace all ets operations? /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bjorn@REDACTED Tue Sep 13 10:51:50 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 13 Sep 2005 10:51:50 +0200 Subject: erlang and gdb In-Reply-To: <43268FD6.4040806@hyber.org> References: <43268FD6.4040806@hyber.org> Message-ID: To update the script, you can run erl -emu_args to find out which arguments that are normally passed to 'beam'. You'll also need to set some environment variable, for instance BINDIR. You can look in the 'erl' script to see how they should be set. But if you have a core-file, you just run gdb like this: gdb /erts-5.4.9/bin/beam core /Bjorn Claes Wikstom writes: > I'm getting a SIGSEGV when I start R10B-7 on one of machines. > > What's the preferred way to run the emulator under gdb these days? > I used to use a script that was initially crafted by Tony I think > but it's rotted over the years ... > > > /klacke > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From per.gustafsson@REDACTED Tue Sep 13 11:28:02 2005 From: per.gustafsson@REDACTED (Per Gustafsson) Date: Tue, 13 Sep 2005 11:28:02 +0200 Subject: erlang and gdb In-Reply-To: References: <43268FD6.4040806@hyber.org> Message-ID: <43269BA2.3020804@it.uu.se> I had to make sure that the directory containing inet_gethost (otp/bin/i686-pc-linux-gnu/) was in my path in order to run gdb. In addition to this I write export ROOTDIR=SuitablePath/otp/ export BINDIR=$ROOTDIR/bin/i686-pc-linux-gnu/ gdb $BINDIR/beam and in gdb run -- -root $ROOTDIR of course the i686-pc-linux-gnu part depends on what machine you are using. Per Bjorn Gustavsson wrote: >To update the script, you can run > > erl -emu_args > >to find out which arguments that are normally passed to 'beam'. > >You'll also need to set some environment variable, for instance >BINDIR. You can look in the 'erl' script to see how they should >be set. > >But if you have a core-file, you just run gdb like this: > >gdb /erts-5.4.9/bin/beam core > >/Bjorn > >Claes Wikstom writes: > > > >>I'm getting a SIGSEGV when I start R10B-7 on one of machines. >> >>What's the preferred way to run the emulator under gdb these days? >>I used to use a script that was initially crafted by Tony I think >>but it's rotted over the years ... >> >> >>/klacke >> >> >> > > > From klacke@REDACTED Tue Sep 13 11:46:54 2005 From: klacke@REDACTED (Claes Wikstom) Date: Tue, 13 Sep 2005 11:46:54 +0200 Subject: erlang and gdb In-Reply-To: <43269BA2.3020804@it.uu.se> References: <43268FD6.4040806@hyber.org> <43269BA2.3020804@it.uu.se> Message-ID: <4326A00E.6060202@hyber.org> Per Gustafsson wrote: > I had to make sure that the directory containing inet_gethost > (otp/bin/i686-pc-linux-gnu/) was in my path in order to run gdb. In > addition to this I write > > export ROOTDIR=SuitablePath/otp/ > export BINDIR=$ROOTDIR/bin/i686-pc-linux-gnu/ > gdb $BINDIR/beam > > and in gdb > > run -- -root $ROOTDIR > > of course the i686-pc-linux-gnu part depends on what machine you are using. > Thanks, /klacke -------------- next part -------------- A non-text attachment was scrubbed... Name: klacke.vcf Type: text/x-vcard Size: 301 bytes Desc: not available URL: From mikpe@REDACTED Tue Sep 13 11:48:30 2005 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 13 Sep 2005 11:48:30 +0200 Subject: Fwd: Bug#328031: erlang: ftbfs [sparc] cp: cannot stat `lib/parsetools/ebin/*.beam' In-Reply-To: <200509122325.55590.neumann@lostwebsite.net> References: <200509122325.55590.neumann@lostwebsite.net> Message-ID: <17190.41070.463877.471300@alkaid.it.uu.se> Fran?ois-Denis Gonthier writes: > Anyone got any problem building (or any experience at all) with building > Erlang 10.b.7 on Sparc. > > Erlang 10.b.7 recently got uploaded to the main Debian archive and it broke > the build of 4 platform (mipsel, hppa, arm and sparc). > > I will take any clues. > > ---------- Forwarded Message ---------- > > Subject: Bug#328031: erlang: ftbfs [sparc] cp: cannot stat > `lib/parsetools/ebin/*.beam' > Date: 12 September 2005 22:56 > From: Blars Blarson > To: Debian Bug Tracking System > > Package: erlang > Version: 1:10.b.7-1 > Severity: serious > Justification: fails to build from source > > erlang failed to build on a sparc buildd, duplicated on my sparc > pbuilder. > > > === Entering application hipe > make[4]: Entering directory `/build/buildd/erlang-10.b.7/lib/hipe/rtl' > /build/buildd/erlang-10.b.7/bin/sparc-unknown-linux-gnu/hipe_mkliterals -e > > hipe_literals.hrl erlc -W +debug_info +inline -o../ebin hipe_rtl_arch.erl > make[4]: *** [../ebin/hipe_rtl_arch.beam] Bus error > make[4]: Leaving directory `/build/buildd/erlang-10.b.7/lib/hipe/rtl' > make[4]: Entering directory `/build/buildd/erlang-10.b.7/lib/hipe/misc' > erlc -W +debug_info -o../ebin hipe_consttab.erl > make[4]: *** [../ebin/hipe_consttab.beam] Bus error This log is line-wrap damaged, but in all cases it's erlc that SIGBUSes. I don't have any Debian boxes, but R10B-7 builds fine for me on a) SPARC/Solaris9, gcc-4.0.1 b) x86/Linux (Fedora Core 4), gcc-4.0.1 c) PowerPC/OSX 10.3.9, gcc-4.0.1 and I've successfully built similar versions on PowerPC/Linux (YDL4). Since the Debian issues occur on multiple architectures, I suspect that Debian's toolchain, i.e., its glibc+binutils+gcc combo, is busted. Does R10B-6 build OK in the same environment(s)? /Mikael From vlad.xx.dumitrescu@REDACTED Tue Sep 13 12:28:23 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Tue, 13 Sep 2005 12:28:23 +0200 Subject: Retrieve release name Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE61D@esealmw105.eemea.ericsson.se> Hi, Just to make sure I didn't miss any hidden feature: is there any way to retrieve the release name? I mean the full "R10B-4" for example. The file install.ini contains a "SYSTEM_VSN=R10B" entry on Windows, but is something similar present in the other environments? Also I would like to be able to get the "-4" part too, if possible. The solution I use now is to use a hardcoded table to convert from the erts version returned by erlang:system_info(version), but I'm not sure it's guaanteed that the erts version will always change. Thanks in advance. Best regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn@REDACTED Tue Sep 13 13:24:31 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 13 Sep 2005 13:24:31 +0200 Subject: Retrieve release name In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE61D@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE61D@esealmw105.eemea.ericsson.se> Message-ID: 1> init:script_id(). {"OTP APN 181 01","R10B"} /Bj?rn "Vlad Dumitrescu XX (LN/EAB)" writes: > Hi, > > Just to make sure I didn't miss any hidden feature: is there any way to retrieve the release name? I mean the full "R10B-4" for example. > > The file install.ini contains a "SYSTEM_VSN=R10B" entry on Windows, but is something similar present in the other environments? Also I would like to be able to get the "-4" part too, if possible. > > The solution I use now is to use a hardcoded table to convert from the erts version returned by erlang:system_info(version), but I'm not sure it's guaanteed that the erts version will always change. > > Thanks in advance. Best regards, > Vlad > > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From vlad.xx.dumitrescu@REDACTED Tue Sep 13 13:40:01 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Tue, 13 Sep 2005 13:40:01 +0200 Subject: Retrieve release name Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE61E@esealmw105.eemea.ericsson.se> > 1> init:script_id(). > {"OTP APN 181 01","R10B"} Great, thanks! It seems I missed a documented feature :-) The "-6" part is not available, then? /Vlad From bjorn@REDACTED Tue Sep 13 14:25:49 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 13 Sep 2005 14:25:49 +0200 Subject: Retrieve release name In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE61E@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE61E@esealmw105.eemea.ericsson.se> Message-ID: The "-6" part is not a formal part of the OTP naming system (yet, at least). It is only used to name the open-source releases. /Bj?rn "Vlad Dumitrescu XX \(LN/EAB\)" writes: > > 1> init:script_id(). > > {"OTP APN 181 01","R10B"} > > Great, thanks! It seems I missed a documented feature :-) > > The "-6" part is not available, then? > > /Vlad > > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From svenolof@REDACTED Tue Sep 13 14:58:42 2005 From: svenolof@REDACTED (Sven-Olof Nystr|m) Date: Tue, 13 Sep 2005 14:58:42 +0200 Subject: gb_trees:search/3 In-Reply-To: References: Message-ID: <17190.52482.763482.759551@harpo.it.uu.se> Ulf Wiger (AL/EAB) writes: > > > I'm sure you could do a lot of other stuff with > > search/3 too. > > > > I'm not so sure. I can think of a few others, such as > > building (unbalanced) trees of all nodes greater or > > smaller than a given key, but I don't think you could > > do much else with the search function. > > Well, we're both wrong, as it turns out. (: > As written, you probably cannot do much else with it, That was my point. > and in fact not even what you suggest, since there > is no way to make sure that you actually find all nodes > greater or smaller than a given key (since it always > goes down only one branch). I disagree, but it's not very interesting, so I'll let it drop. > New attempt: > > search_1(_Fun, Acc, nil) -> [snip] > The first example doesn't really introduce > anything new, as it scans the whole tree > (most likely less efficient than iterator()) or to_list(). [Moved example] > 14> F1 = fun(K,V,Acc) when K > 5 -> > {smaller,Acc}; (K,V,Acc) -> > {both,[{K,V}|Acc]} end. > #Fun > > 15> vccTree:search(F1,[],T2). > [{4,b},{5,a},{2,b},{3,a},{1,a}] > > > The second example is almost equivalend to > ets:select/2 on an ordered_set, but with the > difference (as of now) that ets:select/2 will > scan the whole table if at least the first part > of the key isn't bound(*). Now, this is a feature > that at least I use _a lot_. So you scan the part of a tree where keys are smaller than 5. See my comment at the end for alternative ways to provide this functionality in gb_trees. > (*) Also with the difference that my function > screws up the order. Too bad. > > > There's probably a more elegant construct > > > that would solve the problem with equal > > > or better efficiency. Please go ahead and > > > suggest better ways. > > > > See your next mail :-) > > Not fair, as it solved another problem. (: > I want to support both getting the first > available free resource, and reserving > a specific resource (c.f. UNIX sockets.) OK. I actually didn't realise that they implemented different functions. > > > free/2 is more involved as it needs to > > > de-fragment the tree, but that would be > > > done along the same lines as reserve/2, > > > using the gb_trees:search/3 function. > > > > Why defragment? The cost of defragmentation > > could easily exeed the cost of having a > > fragmented tree in memory (unless you need to be > > able to allocate contiguous sequences of resources, > > of course). > > Yes, I do that too. OK. > My intention was to allow a very large virtual range. > allocated. BTW, the code to free resources and > de-fragment looks pretty much like this: > > do_free_x(Id, Free) -> > Prev = prev(Id, Free), > Next = next(Id, Free), > case {Prev, Next} of > {{value,{A,B}}, _} when A >= Id, Id >= B -> > erlang:error({not_reserved, Id}); > {_, {value,{C,D}}} when C >= Id, Id >= D -> > erlang:error({not_reserved, Id}); > {{value,{A,B}}, {value,{C,D}}} when B == Id-1, C == Id+1 -> > Free1 = delete(C, Free), > update(A, D, Free1); > {_, {value,{C,D}}} when Id+1 == C -> > Free1 = delete(C, Free), > insert(Id, D, Free1); > {{value,{A,B}}, _} when B+1 == Id -> > update(A, Id, Free); > Other -> > insert(Id, Id, Free) > end. > > > Ony my SunBlade, reserving and freeing resources > with gb_trees takes about 20-30 microsecs on a > small tree, and about 40 usecs on a large one > (10,000 nodes). That's nice. > > Forgetting about this particular example, having > previous(), next() and an efficient way to select > nodes in a tree without having to traverse the > whole tree would be useful, don't you think? Sure, previous() and next() could be useful. I would prefer more descriptive names, such as lookup_smaller() and lookup_larger(). Also, I think they should always return a strictly smaller/larger key, even if the given key is present. > Today, you can do that with ets ordered_set, but > not easily with any of the functional data > structures provided by OTP. Currently, iterators can only be used to scan the tree from start, One might consider iterators that start the scan from a point in the middle of the tree (from a given key), or iterators that scan the tree backwards. Another way to do partial scans might be a function to_list(Key1, Key2) that returns a list of the entries in the tree between the two keys. Sven-Olof From mats.cronqvist@REDACTED Tue Sep 13 14:59:27 2005 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Tue, 13 Sep 2005 14:59:27 +0200 Subject: Retrieve release name In-Reply-To: References: <11498CB7D3FCB54897058DE63BE3897C4BE61D@esealmw105.eemea.ericsson.se> Message-ID: <4326CD2F.104@ericsson.com> this information comes from the boot script, right? what happens if i generate a new script? mats Bjorn Gustavsson wrote: > 1> init:script_id(). > {"OTP APN 181 01","R10B"} > > /Bj?rn From gunilla@REDACTED Tue Sep 13 15:11:02 2005 From: gunilla@REDACTED (Gunilla Arendt) Date: Tue, 13 Sep 2005 15:11:02 +0200 Subject: Retrieve release name In-Reply-To: <4326CD2F.104@ericsson.com> References: <11498CB7D3FCB54897058DE63BE3897C4BE61D@esealmw105.eemea.ericsson.se> <4326CD2F.104@ericsson.com> Message-ID: <4326CFE6.1060703@erix.ericsson.se> init:script_id() returns the {RelName,Vsn} tuple as specified in the .rel file, see rel(4). / Gunilla Mats Cronqvist wrote: > this information comes from the boot script, right? what happens if i > generate a new script? > > mats > > Bjorn Gustavsson wrote: > >> 1> init:script_id(). >> {"OTP APN 181 01","R10B"} >> >> /Bj?rn > > > From thinus@REDACTED Tue Sep 13 12:10:58 2005 From: thinus@REDACTED (Thinus Pollard) Date: Tue, 13 Sep 2005 12:10:58 +0200 Subject: String representation in erlang Message-ID: <200509131210.58697.thinus@erlfinsys.net> Hi there According to the Erlang efficiency guide a string is internally represented as a list of integers, thus consuming 2 words (8 bytes on a 32bit platform) of memory *per* character. The attached code is an attempt at reducing the memory footprint of strings in erlang (passing between functions etc etc). The basic idea is to pack a string into n byte sized integers and unpacking them on the other side. The text file called compare.txt also shows the memory needed to represent strings in normal erlang strings and this string packing. Normal erlang strings are 2 words/character. The packed representation uses 1 word of memory per list element plus n bytes/wordsize per integer element, where every integer element contain n characters. Deficiencies: If the string length is not divisible by n, space is wasted (the string gets padded with zeros). Usage: Pick your the integer representation length. packstring/1 takes a string returns a list of n byte integers unpackstring/1 takes an integer representation and returns a string. There is a simple test suite in test/0. If anyone can improve upon this code, please do. If this was an exercise in futility, please let my know, I've only been programming erlang for 2 weeks and still need to learn all the gotchas ;) -- Thinus Pollard Mobile: +27 72 075 2751 -------------- next part -------------- Comparison of erlang strings vs packed strings. Left hand column is the string length, second column is the bytes erlang uses to represent that string, third - ninth column is the bytes needed to represent the packed string. pack[n] refers to a packed string using n byte integers to store the string. Chars erlang pack4 pack8 pack12 pack16 pack20 pack24 pack32 bytes bytes bytes bytes bytes bytes bytes bytes 0 0 0 0 0 0 0 0 0 1 8 8 12 16 20 24 28 36 2 16 8 12 16 20 24 28 36 3 24 8 12 16 20 24 28 36 4 32 8 12 16 20 24 28 36 5 40 16 12 16 20 24 28 36 6 48 16 12 16 20 24 28 36 7 56 16 12 16 20 24 28 36 8 64 16 12 16 20 24 28 36 9 72 24 24 16 20 24 28 36 10 80 24 24 16 20 24 28 36 11 88 24 24 16 20 24 28 36 12 96 24 24 16 20 24 28 36 13 104 32 24 32 20 24 28 36 14 112 32 24 32 20 24 28 36 15 120 32 24 32 20 24 28 36 16 128 32 24 32 20 24 28 36 17 136 40 36 32 40 24 28 36 18 144 40 36 32 40 24 28 36 19 152 40 36 32 40 24 28 36 20 160 40 36 32 40 24 28 36 21 168 48 36 32 40 48 28 36 22 176 48 36 32 40 48 28 36 23 184 48 36 32 40 48 28 36 24 192 48 36 32 40 48 28 36 25 200 56 48 48 40 48 56 36 26 208 56 48 48 40 48 56 36 27 216 56 48 48 40 48 56 36 28 224 56 48 48 40 48 56 36 29 232 64 48 48 40 48 56 36 30 240 64 48 48 40 48 56 36 31 248 64 48 48 40 48 56 36 32 256 64 48 48 40 48 56 36 33 264 72 60 48 60 48 56 72 34 272 72 60 48 60 48 56 72 35 280 72 60 48 60 48 56 72 36 288 72 60 48 60 48 56 72 37 296 80 60 64 60 48 56 72 38 304 80 60 64 60 48 56 72 39 312 80 60 64 60 48 56 72 40 320 80 60 64 60 48 56 72 41 328 88 72 64 60 72 56 72 42 336 88 72 64 60 72 56 72 43 344 88 72 64 60 72 56 72 44 352 88 72 64 60 72 56 72 45 360 96 72 64 60 72 56 72 46 368 96 72 64 60 72 56 72 47 376 96 72 64 60 72 56 72 48 384 96 72 64 60 72 56 72 49 392 104 84 80 80 72 84 72 50 400 104 84 80 80 72 84 72 51 408 104 84 80 80 72 84 72 52 416 104 84 80 80 72 84 72 53 424 112 84 80 80 72 84 72 54 432 112 84 80 80 72 84 72 55 440 112 84 80 80 72 84 72 56 448 112 84 80 80 72 84 72 57 456 120 96 80 80 72 84 72 58 464 120 96 80 80 72 84 72 59 472 120 96 80 80 72 84 72 60 480 120 96 80 80 72 84 72 61 488 128 96 96 80 96 84 72 62 496 128 96 96 80 96 84 72 63 504 128 96 96 80 96 84 72 64 512 128 96 96 80 96 84 72 65 520 136 108 96 100 96 84 108 66 528 136 108 96 100 96 84 108 67 536 136 108 96 100 96 84 108 68 544 136 108 96 100 96 84 108 69 552 144 108 96 100 96 84 108 70 560 144 108 96 100 96 84 108 71 568 144 108 96 100 96 84 108 72 576 144 108 96 100 96 84 108 73 584 152 120 112 100 96 112 108 74 592 152 120 112 100 96 112 108 75 600 152 120 112 100 96 112 108 76 608 152 120 112 100 96 112 108 77 616 160 120 112 100 96 112 108 78 624 160 120 112 100 96 112 108 79 632 160 120 112 100 96 112 108 80 640 160 120 112 100 96 112 108 81 648 168 132 112 120 120 112 108 82 656 168 132 112 120 120 112 108 83 664 168 132 112 120 120 112 108 84 672 168 132 112 120 120 112 108 85 680 176 132 128 120 120 112 108 86 688 176 132 128 120 120 112 108 87 696 176 132 128 120 120 112 108 88 704 176 132 128 120 120 112 108 89 712 184 144 128 120 120 112 108 90 720 184 144 128 120 120 112 108 91 728 184 144 128 120 120 112 108 92 736 184 144 128 120 120 112 108 93 744 192 144 128 120 120 112 108 94 752 192 144 128 120 120 112 108 95 760 192 144 128 120 120 112 108 96 768 192 144 128 120 120 112 108 97 776 200 156 144 140 120 140 144 98 784 200 156 144 140 120 140 144 99 792 200 156 144 140 120 140 144 100 800 200 156 144 140 120 140 144 -------------- next part -------------- %%%------------------------------------------------------------------- %%% File : packer.erl %%% Author : Thinus Pollard %%% Description : Pack erlang strings (8 bytes/char according to the %%% erlang efficiency guide) into a list of integers %%% (1 byte / char). %%% %%% Created : 12 Sep 2005 by Thinus Pollard %%%------------------------------------------------------------------- -module(packer). %% define the size of the to use in bytes -define(BYTES, 32). -define(BITS, (?BYTES * 8)). %% API -export([packstring/1,unpackstring/1]). -export([test/0]). %%==================================================================== %% API %%==================================================================== %%-------------------------------------------------------------------- %% Function: packstring/1 %% Description: Takes Erlang String and returns a list of integers of %% size BYTES containing this String. %%-------------------------------------------------------------------- packstring(String) -> packstring(String, []). %%-------------------------------------------------------------------- %% Function: unpackstring/1 %% Description: Takes List of BYTES sized integers and returns the %% repesented string. %%-------------------------------------------------------------------- unpackstring(List) -> unpackstring(List, []). %%-------------------------------------------------------------------- %% Function: test/0 %% Description: Takes List of BYTES sized integers and returns the %% repesented string. %%-------------------------------------------------------------------- test() -> test("", "Empty string"), test("T", "Single character string"), test("This is a String to be packed", "'Normal' sized string containing spaces"), test("0123456789abcdefghijklmnopqrstuvwxyz", "'Normal' sized string without spaces"), test("000000000011111111112222222222333333333344444444445555555555" "6666666666777777777788888888889999999999aaaaaaaaaabbbbbbbbbb" "ccccccccccddddddddddeeeeeeeeeeffffffffffgggggggggghhhhhhhhhh" "iiiiiiiiiijjjjjjjjjjkkkkkkkkkkllllllllllmmmmmmmmmmnnnnnnnnnn" "ooooooooooppppppppppqqqqqqqqqqrrrrrrrrrrsssssssssstttttttttt" "uuuuuuuuuuvvvvvvvvvvwwwwwwwwwwxxxxxxxxxxyyyyyyyyyyzzzzzzzzzz", "Longish string without spaces"). %%==================================================================== %% Internal functions %%==================================================================== %%-------------------------------------------------------------------- %% Function: packstring/2 %% Description: Takes Erlang String and returns a list of integers of %% size BYTES containing this String. %%-------------------------------------------------------------------- packstring([], Res)-> lists:reverse(Res); packstring(String, Res) -> case string:len(String) > ?BYTES - 1 of true -> %% at least BYTES characters left Working = string:substr(String, 1, ?BYTES), WC = list_to_binary(Working), <> = WC, packstring(string:substr(String, ?BYTES + 1), [WB|Res]); false -> %% we need to zero pad the remaining string to BYTES characters String2 = lists:append(String, lists:duplicate(?BYTES - string:len(String), 0)), packstring(String2, Res) end. %%-------------------------------------------------------------------- %% Function: unpackstring/2 %% Description: Takes List of BYTES sized integers and returns the %% repesented string. %%-------------------------------------------------------------------- unpackstring([], Res) -> %% drop the padded zeros (if any) Fun1 = fun (X) -> X /= 0 end, Res1 = lists:filter(Fun1, Res), lists:reverse(Res1); unpackstring([H|T], Res) -> %% take integers 1 by 1 and decode R = buildBin(H, ?BITS, []), unpackstring(T, R ++ Res). %%-------------------------------------------------------------------- %% Function: buildBin/3 %% Description: Takes a binary, number of bits representing that binary %% and a result list. Returns a list containing the binary %% broken into 8bit chunks %%-------------------------------------------------------------------- buildBin(_Bin, 0, Res) -> lists:reverse(Res); buildBin(Bin, Bits, Res) -> Bits2 = Bits - 8, <> = <>, Res2 = Res ++ binary_to_list(<>), buildBin(B, Bits - 8, Res2). %%-------------------------------------------------------------------- %% Function: test/2 %% Description: Test suite: encodes a string, decodes it and compares the %% original string with the decoded string. %%-------------------------------------------------------------------- test(String, Desc) -> R = packstring(String), Size = (length(R) * 4) + (?BYTES * length(R)), StringL = string:len(String), S = unpackstring(R, []), error_logger:info_msg("Test string description: ~p~n" "Original string: ~p~n" "Packing string into list of ~p byte sized integers~n" "Packed string: ~p~n" "Unpacked string: ~p~n" "Strings match: ~p~n" "-----~n" "Stats~n" "-----~n" "String length: ~p~n" "Size of erlang string (bytes): ~p~n" "Size of packed string (bytes): ~p~n", [Desc, String, ?BYTES, R, S, String == S, StringL, StringL * 8, Size]). From erlang@REDACTED Tue Sep 13 16:13:24 2005 From: erlang@REDACTED (Peter-Henry Mander) Date: Tue, 13 Sep 2005 15:13:24 +0100 Subject: String representation in erlang In-Reply-To: <200509131210.58697.thinus@erlfinsys.net> References: <200509131210.58697.thinus@erlfinsys.net> Message-ID: <1126620804.7001.58.camel@hymir.newport-networks.com> Hi Thinus, Did you consider using binaries? They will probably be more space efficient and can do more besides. If you're thinking of a transmission protocol, binaries are the way to go. Pete. On Tue, 2005-09-13 at 12:10 +0200, Thinus Pollard wrote: > Hi there > > According to the Erlang efficiency guide a string is internally represented as > a list of integers, thus consuming 2 words (8 bytes on a 32bit platform) of > memory *per* character. > > The attached code is an attempt at reducing the memory footprint of strings in > erlang (passing between functions etc etc). > > The basic idea is to pack a string into n byte sized integers and unpacking > them on the other side. The text file called compare.txt also shows the > memory needed to represent strings in normal erlang strings and this string > packing. > > Normal erlang strings are 2 words/character. The packed representation uses 1 > word of memory per list element plus n bytes/wordsize per integer element, > where every integer element contain n characters. > > Deficiencies: > If the string length is not divisible by n, space is wasted (the string gets > padded with zeros). > > Usage: > Pick your the integer representation length. > packstring/1 takes a string returns a list of n byte integers > unpackstring/1 takes an integer representation and returns a string. > > There is a simple test suite in test/0. > > If anyone can improve upon this code, please do. If this was an exercise in > futility, please let my know, I've only been programming erlang for 2 weeks > and still need to learn all the gotchas ;) > From spearce@REDACTED Tue Sep 13 16:17:09 2005 From: spearce@REDACTED (Shawn Pearce) Date: Tue, 13 Sep 2005 10:17:09 -0400 Subject: String representation in erlang In-Reply-To: <200509131210.58697.thinus@erlfinsys.net> References: <200509131210.58697.thinus@erlfinsys.net> Message-ID: <20050913141709.GA18701@spearce.org> Interesting - but how is this better than a binary? If I recall the source code correctly any binary using less than 255 words is stored on the process heap; larger binaries are allocated in a shared heap (to reduce message passing costs). This of course means that any "string" stored in a binary would require 8 + NumberOf8bitChars bytes of memory (rounded up to the next full word). If NumberOf8BitChars is < (255 * 4 = 1020) then it will be allocated on the private heap. Further binaries can be easily pattern matched in function headers and are already handled by the io library; this packed string representation is more difficult to pattern match against and isn't directly handled by the io library functions. Thinus Pollard wrote: > Hi there > > According to the Erlang efficiency guide a string is internally represented as > a list of integers, thus consuming 2 words (8 bytes on a 32bit platform) of > memory *per* character. > > The attached code is an attempt at reducing the memory footprint of strings in > erlang (passing between functions etc etc). > > The basic idea is to pack a string into n byte sized integers and unpacking > them on the other side. The text file called compare.txt also shows the > memory needed to represent strings in normal erlang strings and this string > packing. > > Normal erlang strings are 2 words/character. The packed representation uses 1 > word of memory per list element plus n bytes/wordsize per integer element, > where every integer element contain n characters. > > Deficiencies: > If the string length is not divisible by n, space is wasted (the string gets > padded with zeros). > > Usage: > Pick your the integer representation length. > packstring/1 takes a string returns a list of n byte integers > unpackstring/1 takes an integer representation and returns a string. > > There is a simple test suite in test/0. > > If anyone can improve upon this code, please do. If this was an exercise in > futility, please let my know, I've only been programming erlang for 2 weeks > and still need to learn all the gotchas ;) > > -- > > Thinus Pollard -- Shawn. From klacke@REDACTED Tue Sep 13 16:16:16 2005 From: klacke@REDACTED (Claes Wikstom) Date: Tue, 13 Sep 2005 16:16:16 +0200 Subject: String representation in erlang In-Reply-To: <200509131210.58697.thinus@erlfinsys.net> References: <200509131210.58697.thinus@erlfinsys.net> Message-ID: <4326DF30.8040507@hyber.org> Thinus Pollard wrote: > Hi there > > According to the Erlang efficiency guide a string is internally represented as > a list of integers, thus consuming 2 words (8 bytes on a 32bit platform) of > memory *per* character. > > The attached code is an attempt at reducing the memory footprint of strings in > erlang (passing between functions etc etc). > Me thinks you'd be better off using binaries for strings. /klacke -------------- next part -------------- A non-text attachment was scrubbed... Name: klacke.vcf Type: text/x-vcard Size: 301 bytes Desc: not available URL: From joe.armstrong@REDACTED Tue Sep 13 16:17:29 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Tue, 13 Sep 2005 16:17:29 +0200 Subject: String representation in erlang Message-ID: > erl Eshell V5.3 (abort with ^G) 1> S="abcdefghijklmnopqrstuvwxyz". "abcdefghijklmnopqrstuvwxyz" 2> size(term_to_binary(packer:packstring(S))). 42 3> size(term_to_binary(S)). 30 Anyway if you do like this: 1) Write as clearly as possible 2) Measure 3) Optimise if necessary You will probably never ever need to get to step 3 and compress your strings to save space. You might need to compresses them on disk to save space but then you need real compression, like LZSS... Anyway you might like to ask "what is a big string" - for me big starts at 1Meg/characters - below this optimisations aren't worth bothering about. I have written many programs that manipulate book length texts as strings and had no space worries. << aside a string to big int function and the inverse *is* useful since for moderatly small files (say < 1 K) you can convert them to a big int N and then rsa encode them with N ^ A mod B :-) - this works beautifully but is a wee bit slow - I am not joking here - I have done this >> /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Thinus Pollard > Sent: den 13 september 2005 12:11 > To: erlang-questions@REDACTED; danie@REDACTED > Subject: String representation in erlang > > > Hi there > > According to the Erlang efficiency guide a string is > internally represented as > a list of integers, thus consuming 2 words (8 bytes on a > 32bit platform) of > memory *per* character. > > The attached code is an attempt at reducing the memory > footprint of strings in > erlang (passing between functions etc etc). > > The basic idea is to pack a string into n byte sized integers > and unpacking > them on the other side. The text file called compare.txt also > shows the > memory needed to represent strings in normal erlang strings > and this string > packing. > > Normal erlang strings are 2 words/character. The packed > representation uses 1 > word of memory per list element plus n bytes/wordsize per > integer element, > where every integer element contain n characters. > > Deficiencies: > If the string length is not divisible by n, space is wasted > (the string gets > padded with zeros). > > Usage: > Pick your the integer representation length. > packstring/1 takes a string returns a list of n byte integers > unpackstring/1 takes an integer representation and returns a string. > > There is a simple test suite in test/0. > > If anyone can improve upon this code, please do. If this was > an exercise in > futility, please let my know, I've only been programming > erlang for 2 weeks > and still need to learn all the gotchas ;) > > -- > > Thinus Pollard > > Mobile: +27 72 075 2751 > From per.gustafsson@REDACTED Tue Sep 13 16:18:20 2005 From: per.gustafsson@REDACTED (Per Gustafsson) Date: Tue, 13 Sep 2005 16:18:20 +0200 Subject: String representation in erlang In-Reply-To: <200509131210.58697.thinus@erlfinsys.net> References: <200509131210.58697.thinus@erlfinsys.net> Message-ID: <4326DFAC.7030704@it.uu.se> Hi I think that there is a simpler solution to this problem: packstring(String) -> list_to_binary(String). unpackstring(Binary) -> binary_to_list(Binary). this will change the list representation of a string into binary format which will require 2 * WordSize + number of chars of String bytes if the string is less than 64 chars and 5 * Wordsize + number of chars of string bytes if the string is longer than 64 chars. In addition to this the larger strings will only be passed as a reference if it is sent in a message. Per Gustafsson Thinus Pollard wrote: >Hi there > >According to the Erlang efficiency guide a string is internally represented as >a list of integers, thus consuming 2 words (8 bytes on a 32bit platform) of >memory *per* character. > >The attached code is an attempt at reducing the memory footprint of strings in >erlang (passing between functions etc etc). > >The basic idea is to pack a string into n byte sized integers and unpacking >them on the other side. The text file called compare.txt also shows the >memory needed to represent strings in normal erlang strings and this string >packing. > >Normal erlang strings are 2 words/character. The packed representation uses 1 >word of memory per list element plus n bytes/wordsize per integer element, >where every integer element contain n characters. > >Deficiencies: >If the string length is not divisible by n, space is wasted (the string gets >padded with zeros). > >Usage: >Pick your the integer representation length. >packstring/1 takes a string returns a list of n byte integers >unpackstring/1 takes an integer representation and returns a string. > >There is a simple test suite in test/0. > >If anyone can improve upon this code, please do. If this was an exercise in >futility, please let my know, I've only been programming erlang for 2 weeks >and still need to learn all the gotchas ;) > > > >------------------------------------------------------------------------ > >Comparison of erlang strings vs packed strings. Left hand column is the >string length, second column is the bytes erlang uses to represent that >string, third - ninth column is the bytes needed to represent the packed >string. pack[n] refers to a packed string using n byte integers to store >the string. > >Chars erlang pack4 pack8 pack12 pack16 pack20 pack24 pack32 > bytes bytes bytes bytes bytes bytes bytes bytes >0 0 0 0 0 0 0 0 0 >1 8 8 12 16 20 24 28 36 >2 16 8 12 16 20 24 28 36 >3 24 8 12 16 20 24 28 36 >4 32 8 12 16 20 24 28 36 >5 40 16 12 16 20 24 28 36 >6 48 16 12 16 20 24 28 36 >7 56 16 12 16 20 24 28 36 >8 64 16 12 16 20 24 28 36 >9 72 24 24 16 20 24 28 36 >10 80 24 24 16 20 24 28 36 >11 88 24 24 16 20 24 28 36 >12 96 24 24 16 20 24 28 36 >13 104 32 24 32 20 24 28 36 >14 112 32 24 32 20 24 28 36 >15 120 32 24 32 20 24 28 36 >16 128 32 24 32 20 24 28 36 >17 136 40 36 32 40 24 28 36 >18 144 40 36 32 40 24 28 36 >19 152 40 36 32 40 24 28 36 >20 160 40 36 32 40 24 28 36 >21 168 48 36 32 40 48 28 36 >22 176 48 36 32 40 48 28 36 >23 184 48 36 32 40 48 28 36 >24 192 48 36 32 40 48 28 36 >25 200 56 48 48 40 48 56 36 >26 208 56 48 48 40 48 56 36 >27 216 56 48 48 40 48 56 36 >28 224 56 48 48 40 48 56 36 >29 232 64 48 48 40 48 56 36 >30 240 64 48 48 40 48 56 36 >31 248 64 48 48 40 48 56 36 >32 256 64 48 48 40 48 56 36 >33 264 72 60 48 60 48 56 72 >34 272 72 60 48 60 48 56 72 >35 280 72 60 48 60 48 56 72 >36 288 72 60 48 60 48 56 72 >37 296 80 60 64 60 48 56 72 >38 304 80 60 64 60 48 56 72 >39 312 80 60 64 60 48 56 72 >40 320 80 60 64 60 48 56 72 >41 328 88 72 64 60 72 56 72 >42 336 88 72 64 60 72 56 72 >43 344 88 72 64 60 72 56 72 >44 352 88 72 64 60 72 56 72 >45 360 96 72 64 60 72 56 72 >46 368 96 72 64 60 72 56 72 >47 376 96 72 64 60 72 56 72 >48 384 96 72 64 60 72 56 72 >49 392 104 84 80 80 72 84 72 >50 400 104 84 80 80 72 84 72 >51 408 104 84 80 80 72 84 72 >52 416 104 84 80 80 72 84 72 >53 424 112 84 80 80 72 84 72 >54 432 112 84 80 80 72 84 72 >55 440 112 84 80 80 72 84 72 >56 448 112 84 80 80 72 84 72 >57 456 120 96 80 80 72 84 72 >58 464 120 96 80 80 72 84 72 >59 472 120 96 80 80 72 84 72 >60 480 120 96 80 80 72 84 72 >61 488 128 96 96 80 96 84 72 >62 496 128 96 96 80 96 84 72 >63 504 128 96 96 80 96 84 72 >64 512 128 96 96 80 96 84 72 >65 520 136 108 96 100 96 84 108 >66 528 136 108 96 100 96 84 108 >67 536 136 108 96 100 96 84 108 >68 544 136 108 96 100 96 84 108 >69 552 144 108 96 100 96 84 108 >70 560 144 108 96 100 96 84 108 >71 568 144 108 96 100 96 84 108 >72 576 144 108 96 100 96 84 108 >73 584 152 120 112 100 96 112 108 >74 592 152 120 112 100 96 112 108 >75 600 152 120 112 100 96 112 108 >76 608 152 120 112 100 96 112 108 >77 616 160 120 112 100 96 112 108 >78 624 160 120 112 100 96 112 108 >79 632 160 120 112 100 96 112 108 >80 640 160 120 112 100 96 112 108 >81 648 168 132 112 120 120 112 108 >82 656 168 132 112 120 120 112 108 >83 664 168 132 112 120 120 112 108 >84 672 168 132 112 120 120 112 108 >85 680 176 132 128 120 120 112 108 >86 688 176 132 128 120 120 112 108 >87 696 176 132 128 120 120 112 108 >88 704 176 132 128 120 120 112 108 >89 712 184 144 128 120 120 112 108 >90 720 184 144 128 120 120 112 108 >91 728 184 144 128 120 120 112 108 >92 736 184 144 128 120 120 112 108 >93 744 192 144 128 120 120 112 108 >94 752 192 144 128 120 120 112 108 >95 760 192 144 128 120 120 112 108 >96 768 192 144 128 120 120 112 108 >97 776 200 156 144 140 120 140 144 >98 784 200 156 144 140 120 140 144 >99 792 200 156 144 140 120 140 144 >100 800 200 156 144 140 120 140 144 > > >------------------------------------------------------------------------ > >%%%------------------------------------------------------------------- >%%% File : packer.erl >%%% Author : Thinus Pollard >%%% Description : Pack erlang strings (8 bytes/char according to the >%%% erlang efficiency guide) into a list of integers >%%% (1 byte / char). >%%% >%%% Created : 12 Sep 2005 by Thinus Pollard >%%%------------------------------------------------------------------- >-module(packer). > >%% define the size of the to use in bytes >-define(BYTES, 32). > >-define(BITS, (?BYTES * 8)). > >%% API >-export([packstring/1,unpackstring/1]). >-export([test/0]). > >%%==================================================================== >%% API >%%==================================================================== >%%-------------------------------------------------------------------- >%% Function: packstring/1 >%% Description: Takes Erlang String and returns a list of integers of >%% size BYTES containing this String. >%%-------------------------------------------------------------------- >packstring(String) -> > packstring(String, []). > >%%-------------------------------------------------------------------- >%% Function: unpackstring/1 >%% Description: Takes List of BYTES sized integers and returns the >%% repesented string. >%%-------------------------------------------------------------------- >unpackstring(List) -> > unpackstring(List, []). > >%%-------------------------------------------------------------------- >%% Function: test/0 >%% Description: Takes List of BYTES sized integers and returns the >%% repesented string. >%%-------------------------------------------------------------------- >test() -> > test("", "Empty string"), > test("T", "Single character string"), > test("This is a String to be packed", "'Normal' sized string containing spaces"), > test("0123456789abcdefghijklmnopqrstuvwxyz", "'Normal' sized string without spaces"), > test("000000000011111111112222222222333333333344444444445555555555" > "6666666666777777777788888888889999999999aaaaaaaaaabbbbbbbbbb" > "ccccccccccddddddddddeeeeeeeeeeffffffffffgggggggggghhhhhhhhhh" > "iiiiiiiiiijjjjjjjjjjkkkkkkkkkkllllllllllmmmmmmmmmmnnnnnnnnnn" > "ooooooooooppppppppppqqqqqqqqqqrrrrrrrrrrsssssssssstttttttttt" > "uuuuuuuuuuvvvvvvvvvvwwwwwwwwwwxxxxxxxxxxyyyyyyyyyyzzzzzzzzzz", "Longish string without spaces"). > >%%==================================================================== >%% Internal functions >%%==================================================================== > >%%-------------------------------------------------------------------- >%% Function: packstring/2 >%% Description: Takes Erlang String and returns a list of integers of >%% size BYTES containing this String. >%%-------------------------------------------------------------------- >packstring([], Res)-> > lists:reverse(Res); >packstring(String, Res) -> > case string:len(String) > ?BYTES - 1 of > true -> %% at least BYTES characters left > Working = string:substr(String, 1, ?BYTES), > WC = list_to_binary(Working), > <> = WC, > packstring(string:substr(String, ?BYTES + 1), [WB|Res]); > false -> %% we need to zero pad the remaining string to BYTES characters > String2 = lists:append(String, lists:duplicate(?BYTES - string:len(String), 0)), > packstring(String2, Res) > end. > >%%-------------------------------------------------------------------- >%% Function: unpackstring/2 >%% Description: Takes List of BYTES sized integers and returns the >%% repesented string. >%%-------------------------------------------------------------------- >unpackstring([], Res) -> > %% drop the padded zeros (if any) > Fun1 = fun (X) -> > X /= 0 > end, > Res1 = lists:filter(Fun1, Res), > lists:reverse(Res1); >unpackstring([H|T], Res) -> > %% take integers 1 by 1 and decode > R = buildBin(H, ?BITS, []), > unpackstring(T, R ++ Res). > >%%-------------------------------------------------------------------- >%% Function: buildBin/3 >%% Description: Takes a binary, number of bits representing that binary >%% and a result list. Returns a list containing the binary >%% broken into 8bit chunks >%%-------------------------------------------------------------------- >buildBin(_Bin, 0, Res) -> > lists:reverse(Res); >buildBin(Bin, Bits, Res) -> > Bits2 = Bits - 8, > <> = <>, > Res2 = Res ++ binary_to_list(<>), > buildBin(B, Bits - 8, Res2). > >%%-------------------------------------------------------------------- >%% Function: test/2 >%% Description: Test suite: encodes a string, decodes it and compares the >%% original string with the decoded string. >%%-------------------------------------------------------------------- >test(String, Desc) -> > R = packstring(String), > Size = (length(R) * 4) + (?BYTES * length(R)), > StringL = string:len(String), > S = unpackstring(R, []), > error_logger:info_msg("Test string description: ~p~n" > "Original string: ~p~n" > "Packing string into list of ~p byte sized integers~n" > "Packed string: ~p~n" > "Unpacked string: ~p~n" > "Strings match: ~p~n" > "-----~n" > "Stats~n" > "-----~n" > "String length: ~p~n" > "Size of erlang string (bytes): ~p~n" > "Size of packed string (bytes): ~p~n", [Desc, String, ?BYTES, R, S, String == S, StringL, StringL * 8, Size]). > > From ulf.wiger@REDACTED Tue Sep 13 16:31:29 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Tue, 13 Sep 2005 16:31:29 +0200 Subject: gb_trees:search/3 Message-ID: Sven-Olof Nystr?m wrote: > > Ulf Wiger (AL/EAB) writes: > > The first example doesn't really introduce > > anything new, as it scans the whole tree > > (most likely less efficient than iterator()) > > or to_list(). Yes, well, I've grown a bit allergic to functions that return the whole contents of a data structure designed to be scalable. Given how the garbage collector works, you should only use them if you are sure that the number of objects is relatively small; and then you might as well use orddict or similar with very little performance penalty. (: That's not to say that to_list() isn't useful. > So you scan the part of a tree where keys are smaller than 5. > > See my comment at the end for alternative ways to provide this > functionality in gb_trees. With ets:select(), you can do much more than that. A fairly common type of pattern could be to have objects with a structured key, e.g.: {{DocId, [Chapter, SubChapter, Table, Row]}, Value} (fictitious example) and with ordered_set ets, you can quite easily then extract all rows in a given table in a given sub-chapter, ... etc in this fashion ets:select( docs, [{{DocId, [Chapter,SubChapter,Table,'$1']},'$2'}, [], [{{'$1', '$2'}}]}]) The syntax is horrible, but that's partly because you can't really copy each object to the process heap just to determine whether it's a match, and you don't have a context within ets for evaluating a fun. gb_trees can do much better, IMO. You could read up on the match specification syntax in the ERTS user's guide (http://erlang.se/doc/doc-5.4.8/erts-5.4.8/doc/html/match_spec.html#1) but I think that a functional data structure should just disregard match specifications and allow the user to provide a fun instead. > > Forgetting about this particular example, having > > previous(), next() and an efficient way to select > > nodes in a tree without having to traverse the > > whole tree would be useful, don't you think? > > Sure, previous() and next() could be useful. I would > prefer more descriptive names, such as lookup_smaller() > and lookup_larger(). Also, I think they should always > return a strictly smaller/larger key, even > if the given key is present. Yes, since all keys are unique, that's how it ought to work. The fun thing about ets ordered_sets is that next/2 and previous/2 work even if the given key is not present. This is not true for sets. More descriptive names is perfectly OK. (: > Currently, iterators can only be used to scan the > tree from start, One might consider iterators that > start the scan from a point in the middle of the > tree (from a given key), or iterators that scan the > tree backwards. > > Another way to do partial scans might be a function > > to_list(Key1, Key2) > > that returns a list of the entries in the tree between > the two keys. Nice, but decidedly less flexible than the ets:select() function. Perhaps it's just me, but I would like to see some functional data structures offer some of the power of ets, and perhaps manage to lure some people away from ets. For one thing, using a functional data structure, you get "undo" for free. /Uffe From klacke@REDACTED Tue Sep 13 16:58:33 2005 From: klacke@REDACTED (Claes Wikstom) Date: Tue, 13 Sep 2005 16:58:33 +0200 Subject: String representation in erlang In-Reply-To: <4326DFAC.7030704@it.uu.se> References: <200509131210.58697.thinus@erlfinsys.net> <4326DFAC.7030704@it.uu.se> Message-ID: <4326E919.8060708@hyber.org> Per Gustafsson wrote: > Hi > > I think that there is a simpler solution to this problem: > > packstring(String) -> > list_to_binary(String). > > unpackstring(Binary) -> > binary_to_list(Binary). > Quite a few replies here ... Anyway, now all we need is: 10> io:format("~p~n", [<<"abcde">>]). <<"abcde">> ok (aswell as nice record printouts ofcource) But to be serious, (hijacking the thread!!!) I never checked in the patches I sent the other day to the io_lib/shell code Two problems, both shitty in my NSHO, a) remote printing is broken b) multiple records with the same name don't work well (or at all). (b) is wore than (a) since there's a lot of code with #state{.... declarations .. i.e pretty much all gen_servers /klacke -------------- next part -------------- A non-text attachment was scrubbed... Name: klacke.vcf Type: text/x-vcard Size: 301 bytes Desc: not available URL: From thinus@REDACTED Tue Sep 13 17:35:52 2005 From: thinus@REDACTED (Thinus Pollard) Date: Tue, 13 Sep 2005 17:35:52 +0200 Subject: String representation in erlang In-Reply-To: <20050913141709.GA18701@spearce.org> References: <200509131210.58697.thinus@erlfinsys.net> <20050913141709.GA18701@spearce.org> Message-ID: <200509131735.52849.thinus@erlfinsys.net> Thanks for all the help. You live, you learn.... well mostly you live ;) It was an interesting exercise anyhow. Still getting my head around this after a few years of procedural programming. Maybe someone can use it in an RSA implementation somewhere, I've seen Joe mention. Thinus On Tuesday 13 September 2005 16:17, Shawn Pearce wrote: > Interesting - but how is this better than a binary? > > If I recall the source code correctly any binary using less than > 255 words is stored on the process heap; larger binaries are > allocated in a shared heap (to reduce message passing costs). > This of course means that any "string" stored in a binary would > require 8 + NumberOf8bitChars bytes of memory (rounded up to the > next full word). If NumberOf8BitChars is < (255 * 4 = 1020) then > it will be allocated on the private heap. > > Further binaries can be easily pattern matched in function headers > and are already handled by the io library; this packed string > representation is more difficult to pattern match against and isn't > directly handled by the io library functions. > > Thinus Pollard wrote: > > Hi there > > > > According to the Erlang efficiency guide a string is internally > > represented as a list of integers, thus consuming 2 words (8 bytes on a > > 32bit platform) of memory *per* character. > > > > The attached code is an attempt at reducing the memory footprint of > > strings in erlang (passing between functions etc etc). > > > > The basic idea is to pack a string into n byte sized integers and > > unpacking them on the other side. The text file called compare.txt also > > shows the memory needed to represent strings in normal erlang strings and > > this string packing. > > > > Normal erlang strings are 2 words/character. The packed representation > > uses 1 word of memory per list element plus n bytes/wordsize per integer > > element, where every integer element contain n characters. > > > > Deficiencies: > > If the string length is not divisible by n, space is wasted (the string > > gets padded with zeros). > > > > Usage: > > Pick your the integer representation length. > > packstring/1 takes a string returns a list of n byte integers > > unpackstring/1 takes an integer representation and returns a string. > > > > There is a simple test suite in test/0. > > > > If anyone can improve upon this code, please do. If this was an exercise > > in futility, please let my know, I've only been programming erlang for 2 > > weeks and still need to learn all the gotchas ;) > > > > -- > > > > Thinus Pollard -- Thinus Pollard Mobile: +27 72 075 2751 From neumann@REDACTED Tue Sep 13 17:47:34 2005 From: neumann@REDACTED (=?iso-8859-1?q?Fran=E7ois-Denis_Gonthier?=) Date: Tue, 13 Sep 2005 11:47:34 -0400 Subject: Fwd: Bug#328031: erlang: ftbfs [sparc] cp: cannot stat `lib/parsetools/ebin/*.beam' In-Reply-To: <17190.41070.463877.471300@alkaid.it.uu.se> References: <200509122325.55590.neumann@lostwebsite.net> <17190.41070.463877.471300@alkaid.it.uu.se> Message-ID: <200509131147.37225.neumann@lostwebsite.net> On 13 September 2005 05:48, you wrote: > This log is line-wrap damaged, but in all cases it's erlc that SIGBUSes. > I don't have any Debian boxes, but R10B-7 builds fine for me on > a) SPARC/Solaris9, gcc-4.0.1 > b) x86/Linux (Fedora Core 4), gcc-4.0.1 > c) PowerPC/OSX 10.3.9, gcc-4.0.1 > and I've successfully built similar versions on PowerPC/Linux (YDL4). If you are interrested in the full logs for each failing platforms you can see them at: http://packages.qa.debian.org/e/erlang.html > Since the Debian issues occur on multiple architectures, I suspect that > Debian's toolchain, i.e., its glibc+binutils+gcc combo, is busted. The crash occurs for 3 different reasons out of those 3 platforms. The problem on Mipsel and arm look like erlc bugs: [...] erlc -W +debug_info -I../include -I../../kernel/include -o../ebin beam_lib.erl ./beam_lib.erl:685: illegal guard expression ./beam_lib.erl:692: illegal guard expression [...] From the changelogs, I can see that such an error is supposed to be fixed, so I don't understand the why of this error. I'm not experienced enough with Erlang to interpret the stack for the hppa error: [...] erlc -W +debug_info -I../include -o../ebin prim_inet.erl (no error logger present) error: Error in process <0.1.0> with exit value: {badarg,[{erl_prim_loader,check_file_result,3},{init,get_boot,1}, {init,get_boot,2},{init,do_boot,3}]} [...] Will Newton suspects that this might be caused by the autobuilding lacking hd space. I believe hppa is the lowest priority for me right now. > Does R10B-6 build OK in the same environment(s)? The previous package version is 10.b.5. I'm annoyed that I skipped 10.b.6. I'm limited in my efforts to investigate this because I don't have access to a sparc-based computer on which I could compile this on. So, unless I find that this problem was previously reported, I'll leave those errors alone wait for the next upstream. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From m_a_shure@REDACTED Tue Sep 13 19:14:35 2005 From: m_a_shure@REDACTED (mshure) Date: Tue, 13 Sep 2005 19:14:35 +0200 Subject: Trouble compiling R10B-7 on OS X References: Message-ID: <20050913171436.3AD9C5903A@bang.trapexit.org> Hi Sean, Thanks for your reply. I'm wondering if my problems occur because I haven't properly configured my network services. Can you tell me whether you enabled or setup anything different from the default network settings? Regards, Mark _________________________________________________________ Sent using Mail2Forum (http://m2f.sourceforge.net) From ke.han@REDACTED Tue Sep 13 19:46:53 2005 From: ke.han@REDACTED (ke.han) Date: Wed, 14 Sep 2005 01:46:53 +0800 Subject: String representation in erlang In-Reply-To: <200509131210.58697.thinus@erlfinsys.net> References: <200509131210.58697.thinus@erlfinsys.net> Message-ID: <4327108D.4000206@redstarling.com> Yes, 8 bytes for a single character is hideously too long. You can encode any character on the planet with only 4 bytes. You can use variable byte encoding to further reduce overall length for complex languages. I would like to see these types of things corrected one day. Until then, I'll settle for understanding binary strings better. ;-) I understand the basic form: <<"abcde">>. What I don't understand is if this works with multi-byte (in particular variable-byte) encoding schemes (utf-8, 16, etc...). Does the binary string only work for 8 bit characters? ...any examples of other use? I think the kind of code example missing is something with Chinese (or pick your complex language) and English characters in the same "string", allow a user to enter the string into a yaws web form and stores the "string" in erlang and then redisplays the string. For binary strings, I don't even know where to start with this simple task. thanks, ke han hinus Pollard wrote: > Hi there > > According to the Erlang efficiency guide a string is internally represented as > a list of integers, thus consuming 2 words (8 bytes on a 32bit platform) of > memory *per* character. > > The attached code is an attempt at reducing the memory footprint of strings in > erlang (passing between functions etc etc). > > The basic idea is to pack a string into n byte sized integers and unpacking > them on the other side. The text file called compare.txt also shows the > memory needed to represent strings in normal erlang strings and this string > packing. > > Normal erlang strings are 2 words/character. The packed representation uses 1 > word of memory per list element plus n bytes/wordsize per integer element, > where every integer element contain n characters. > > Deficiencies: > If the string length is not divisible by n, space is wasted (the string gets > padded with zeros). > > Usage: > Pick your the integer representation length. > packstring/1 takes a string returns a list of n byte integers > unpackstring/1 takes an integer representation and returns a string. > > There is a simple test suite in test/0. > > If anyone can improve upon this code, please do. If this was an exercise in > futility, please let my know, I've only been programming erlang for 2 weeks > and still need to learn all the gotchas ;) > From ulf@REDACTED Tue Sep 13 21:17:14 2005 From: ulf@REDACTED (Ulf Wiger) Date: Tue, 13 Sep 2005 21:17:14 +0200 Subject: gb_trees:search/3 In-Reply-To: References: Message-ID: Den 2005-09-13 16:31:29 skrev Ulf Wiger (AL/EAB) : > Sven-Olof Nystr?m wrote: >> >> Ulf Wiger (AL/EAB) writes: >> > The first example doesn't really introduce >> > anything new, as it scans the whole tree >> > (most likely less efficient than iterator()) >> >> or to_list(). > Yes, well, I've grown a bit allergic to functions > that return the whole contents of a data structure > designed to be scalable. Given how the garbage > collector works, you should only use them if you > are sure that the number of objects is relatively > small; Of course, to be fair, there's a big difference in this regard between ets and e.g. gb_trees: since all objects in gb_trees already reside on the heap, to_list() only builds a bunch of cons cells pointing to already existing objects, whereas ets actually copies the objects onto the heap, causing potentially massive memory allocation. /Uffe -- Ulf Wiger From neumann@REDACTED Tue Sep 13 22:32:32 2005 From: neumann@REDACTED (=?iso-8859-1?q?Fran=E7ois-Denis_Gonthier?=) Date: Tue, 13 Sep 2005 16:32:32 -0400 Subject: Fwd: Bug#328031: erlang: ftbfs [sparc] cp: cannot stat `lib/parsetools/ebin/*.beam' In-Reply-To: <200509131147.37225.neumann@lostwebsite.net> References: <200509122325.55590.neumann@lostwebsite.net> <17190.41070.463877.471300@alkaid.it.uu.se> <200509131147.37225.neumann@lostwebsite.net> Message-ID: <200509131632.35161.neumann@lostwebsite.net> On 13 September 2005 11:47, Fran?ois-Denis Gonthier wrote: My sponsor, Will Newton informed me that he built the same package sparc today. It looks like it was truly a temporary toolchain problem, as suggested by Mikael Pettersson. I think I'll leave that bug alone until a new build attempt. > On 13 September 2005 05:48, you wrote: > > This log is line-wrap damaged, but in all cases it's erlc that SIGBUSes. > > I don't have any Debian boxes, but R10B-7 builds fine for me on > > a) SPARC/Solaris9, gcc-4.0.1 > > b) x86/Linux (Fedora Core 4), gcc-4.0.1 > > c) PowerPC/OSX 10.3.9, gcc-4.0.1 > > and I've successfully built similar versions on PowerPC/Linux (YDL4). > > If you are interrested in the full logs for each failing platforms you can > see them at: http://packages.qa.debian.org/e/erlang.html > > > Since the Debian issues occur on multiple architectures, I suspect that > > Debian's toolchain, i.e., its glibc+binutils+gcc combo, is busted. > > The crash occurs for 3 different reasons out of those 3 platforms. > > The problem on Mipsel and arm look like erlc bugs: > > [...] > erlc -W +debug_info -I../include -I../../kernel/include -o../ebin > beam_lib.erl > ./beam_lib.erl:685: illegal guard expression > ./beam_lib.erl:692: illegal guard expression > [...] > > From the changelogs, I can see that such an error is supposed to be fixed, > so I don't understand the why of this error. > > I'm not experienced enough with Erlang to interpret the stack for the hppa > error: > > [...] > erlc -W +debug_info -I../include -o../ebin prim_inet.erl > (no error logger present) error: Error in process <0.1.0> with exit value: > {badarg,[{erl_prim_loader,check_file_result,3},{init,get_boot,1}, > {init,get_boot,2},{init,do_boot,3}]} > [...] > > Will Newton suspects that this might be caused by the autobuilding lacking > hd space. > > I believe hppa is the lowest priority for me right now. > > > Does R10B-6 build OK in the same environment(s)? > > The previous package version is 10.b.5. I'm annoyed that I skipped 10.b.6. > > I'm limited in my efforts to investigate this because I don't have access > to a sparc-based computer on which I could compile this on. So, unless I > find that this problem was previously reported, I'll leave those errors > alone wait for the next upstream. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From mikpe@REDACTED Tue Sep 13 22:47:05 2005 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 13 Sep 2005 22:47:05 +0200 Subject: Fwd: Bug#328031: erlang: ftbfs [sparc] cp: cannot stat `lib/parsetools/ebin/*.beam' In-Reply-To: <200509131147.37225.neumann@lostwebsite.net> References: <200509122325.55590.neumann@lostwebsite.net> <17190.41070.463877.471300@alkaid.it.uu.se> <200509131147.37225.neumann@lostwebsite.net> Message-ID: <17191.15049.913972.274098@alkaid.it.uu.se> Fran?ois-Denis Gonthier writes: > On 13 September 2005 05:48, you wrote: > > > This log is line-wrap damaged, but in all cases it's erlc that SIGBUSes. > > I don't have any Debian boxes, but R10B-7 builds fine for me on > > a) SPARC/Solaris9, gcc-4.0.1 > > b) x86/Linux (Fedora Core 4), gcc-4.0.1 > > c) PowerPC/OSX 10.3.9, gcc-4.0.1 > > and I've successfully built similar versions on PowerPC/Linux (YDL4). > > If you are interrested in the full logs for each failing platforms you can see > them at: http://packages.qa.debian.org/e/erlang.html > > > Since the Debian issues occur on multiple architectures, I suspect that > > Debian's toolchain, i.e., its glibc+binutils+gcc combo, is busted. > > The crash occurs for 3 different reasons out of those 3 platforms. > > The problem on Mipsel and arm look like erlc bugs: > > [...] > erlc -W +debug_info -I../include -I../../kernel/include -o../ebin > beam_lib.erl > ./beam_lib.erl:685: illegal guard expression > ./beam_lib.erl:692: illegal guard expression This one is actually quite interesting. It means that you're compiling the R10B-7 sources with an older compiler that doesn't understand the new is_function/2 guard syntax. According to your build logs you start each build by running around in the unpacked tar ball and removing stuff, including stuff in bootstrap. That's not a good idea. Please try a build (on mips which didn't seem to have any SIGBUS issues) without clobbering the sources, i.e. just tar zxf + cd + ./configure + make. /Mikael From serge@REDACTED Tue Sep 13 23:18:42 2005 From: serge@REDACTED (Serge Aleynikov) Date: Tue, 13 Sep 2005 17:18:42 -0400 Subject: edoc Message-ID: <43274232.3080805@hq.idt.net> Hi, I am having trouble with edoc parsing the following header. It breaks at the definition of the ConvertFun type (second line below). According to documentation (.../erl5.4.9/lib/edoc-0.6.2/doc/html/overview-summary.html#typespecs) I believe this is a valid definition. Am I wrong? %% @spec convert(Data::list(), ConvertFun) -> OutData::list() %% ConvertFun = fun(InRecord::tuple()) -> OutRecord::tuple() Serge From neumann@REDACTED Wed Sep 14 00:00:05 2005 From: neumann@REDACTED (=?iso-8859-1?q?Fran=E7ois-Denis_Gonthier?=) Date: Tue, 13 Sep 2005 18:00:05 -0400 Subject: Fwd: Bug#328031: erlang: ftbfs [sparc] cp: cannot stat `lib/parsetools/ebin/*.beam' In-Reply-To: <17191.15049.913972.274098@alkaid.it.uu.se> References: <200509122325.55590.neumann@lostwebsite.net> <200509131147.37225.neumann@lostwebsite.net> <17191.15049.913972.274098@alkaid.it.uu.se> Message-ID: <200509131800.08255.neumann@lostwebsite.net> > This one is actually quite interesting. It means that you're compiling > the R10B-7 sources with an older compiler that doesn't understand the > new is_function/2 guard syntax. > > According to your build logs you start each build by running around in > the unpacked tar ball and removing stuff, including stuff in bootstrap. > That's not a good idea. Please try a build (on mips which didn't seem > to have any SIGBUS issues) without clobbering the sources, i.e. just > tar zxf + cd + ./configure + make. That is a *precious* observation. Will actually suspected that problem before but you confirm it. It is true that the clean phase at the start of the automated build actually clobbers the bootstrap compiler. I have inherited the build scripts from the previous maintainers and I'm just starting to comprehend how they work or, in some case, why they suck. I'm working on improving the build system to make it work with pristine upstream sources using auto-applied patches so that agressive cleaning such as it is currently done right now will no longer be necessary. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From ok@REDACTED Wed Sep 14 04:27:32 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 14 Sep 2005 14:27:32 +1200 (NZST) Subject: String representation in erlang Message-ID: <200509140227.j8E2RWwu190612@atlas.otago.ac.nz> Thinus Pollard wrote: According to the Erlang efficiency guide a string is internally represented as a list of integers, thus consuming 2 words (8 bytes on a 32bit platform) of memory *per* character. Unicode/ISO10646 characters require in general 21 bits. NOT 16 bits. Java claims to support Unicode, but there are already quite a lot of Unicode characters which don't fit in 16 bits, so many Unicode characters require two Java "chars". Needless to say, this stuffs up Java string indexing something wonderful. There's an easy way to save half of the space of a string that still leaves them able (in principle) to cope with the full range of Unicode characters: represent a string as a *tuple* of integer codes. Conversion functions: list_to_tuple(String) -> Tuple tuple_to_list(Tuple) -> String (Assumption: list elements cost 2 cells each, tuples with N elements cost 2N+c for c something like 1 or 2, so for large N, the space is about 1/2 that of a list.) The other alternative, of course, is to use binaries. Joe's proposal for <<"string">> notation makes them particularly attractive. From vipin@REDACTED Wed Sep 14 08:23:03 2005 From: vipin@REDACTED (vipin) Date: Wed, 14 Sep 2005 11:53:03 +0530 Subject: Blocking/Non-Blocking Sockets ??? Message-ID: <4327C1C7.1050307@picopeta.com> Hello all, How to figure out whether a socket is blocking or non-blocking ??? And if it is a blocking one, then how can i transform it into a non-blocking type ? Your suggestions would be welcome. Cheers, Vipin From bengt.kleberg@REDACTED Wed Sep 14 08:51:00 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 14 Sep 2005 08:51:00 +0200 Subject: Blocking/Non-Blocking Sockets ??? In-Reply-To: <4327C1C7.1050307@picopeta.com> References: <4327C1C7.1050307@picopeta.com> Message-ID: <4327C854.8000107@ericsson.com> On 2005-09-14 08:23, vipin wrote: > Hello all, > > How to figure out whether a socket is blocking or non-blocking ??? i presume that you mean the socket created by gen_udp:open() (or gen_tcp:open()). if you mean the operating systems sockets, they are non-blocking (and will so remain since the whole erlang node otherwoise would stop when any one process read from a blocking socket). > And if it is a blocking one, then how can i transform it into a > non-blocking type ? according to the documentation (gen_udp, gen_tcp and inet) a socket is active (sort of non-blocking) by default. it is possible to set it to non active when you open it. it is also possible to have it active once. bengt From ft@REDACTED Wed Sep 14 09:02:14 2005 From: ft@REDACTED (Fredrik Thulin) Date: Wed, 14 Sep 2005 09:02:14 +0200 Subject: Mnesia: changing hostname Message-ID: <200509140902.14248.ft@it.su.se> Hi I am at an interop event (SIPit), where I got a new hostname. I had a database in a Mnesia directory. Mnesia seems to be starting just fine, but the tables are not accessible. My old hostname is listed as a stopped db-node in mnesia:info(). This isn't very strange to me, but how can I detect this state of affairs? Currently my application just fails to start, because the Mnesia tables are not present. Thanks in advance /Fredrik From chandrashekhar.mullaparthi@REDACTED Wed Sep 14 09:06:38 2005 From: chandrashekhar.mullaparthi@REDACTED (chandru) Date: Wed, 14 Sep 2005 08:06:38 +0100 Subject: Blocking/Non-Blocking Sockets ??? In-Reply-To: <4327C1C7.1050307@picopeta.com> References: <4327C1C7.1050307@picopeta.com> Message-ID: Hi, Look at the {active, Boolean} option on sockets. You can change this option on a socket using the inet:setopts/2 function and inspect values using the inet:getopts/2 function. 56> {ok, Sock} = gen_tcp:connect("localhost", 22301, [{active, true}]). {ok,#Port<0.273>} 57> inet:getopts(Sock, [active]). {ok,[{active,true}]} When you set the {active, true} option on a connected socket, all data which is received on that socket will be sent to your process as messages of the form {tcp, Socket, Data} cheers Chandru On 14/09/05, vipin wrote: > Hello all, > > How to figure out whether a socket is blocking or non-blocking ??? > And if it is a blocking one, then how can i transform it into a > non-blocking type ? > > Your suggestions would be welcome. > > Cheers, > Vipin > From richardc@REDACTED Wed Sep 14 10:18:21 2005 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 14 Sep 2005 10:18:21 +0200 Subject: edoc In-Reply-To: <43274232.3080805@hq.idt.net> References: <43274232.3080805@hq.idt.net> Message-ID: <4327DCCD.2050807@csd.uu.se> Serge Aleynikov wrote: > Hi, > > I am having trouble with edoc parsing the following header. It breaks > at the definition of the ConvertFun type (second line below). According > to documentation > (.../erl5.4.9/lib/edoc-0.6.2/doc/html/overview-summary.html#typespecs) > I believe this is a valid definition. Am I wrong? > > %% @spec convert(Data::list(), ConvertFun) -> OutData::list() > %% ConvertFun = fun(InRecord::tuple()) -> OutRecord::tuple() Don't use the 'fun' keyword. /Richard From vlad.xx.dumitrescu@REDACTED Wed Sep 14 10:16:41 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Wed, 14 Sep 2005 10:16:41 +0200 Subject: Retrieve release name Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE620@esealmw105.eemea.ericsson.se> Hi again, I have another question on this issue: Start.script is also available in $ERL_TOP/releases/. Could it happen that there are several release directories present there? I don't think it would be very meaningful, but stranger things have happened :-) Thanks in advance, Vlad From gunilla@REDACTED Wed Sep 14 10:28:01 2005 From: gunilla@REDACTED (Gunilla Arendt) Date: Wed, 14 Sep 2005 10:28:01 +0200 Subject: Retrieve release name In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE620@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE620@esealmw105.eemea.ericsson.se> Message-ID: <4327DF11.3090706@erix.ericsson.se> Yes, there could be several release directories there, if you are using OTP release handling (the ability to upgrade to/downgrade from new versions of an entire release in run-time). Read more in the chapter 'Release Handling' in OTP Design Principles. / Gunilla Vlad Dumitrescu XX (LN/EAB) wrote: > Hi again, > > I have another question on this issue: > > Start.script is also available in $ERL_TOP/releases/. Could it happen that there are several release directories present there? I don't think it would be very meaningful, but stranger things have happened :-) > > Thanks in advance, > Vlad > > From dgud@REDACTED Wed Sep 14 10:34:09 2005 From: dgud@REDACTED (Dan Gudmundsson) Date: Wed, 14 Sep 2005 10:34:09 +0200 Subject: Mnesia: changing hostname In-Reply-To: <200509140902.14248.ft@it.su.se> References: <200509140902.14248.ft@it.su.se> Message-ID: <17191.57473.129025.822826@rian.du.uab.ericsson.se> Fredrik Thulin writes: > Hi > > I am at an interop event (SIPit), where I got a new hostname. I had a > database in a Mnesia directory. Mnesia seems to be starting just fine, > but the tables are not accessible. My old hostname is listed as a > stopped db-node in mnesia:info(). > > This isn't very strange to me, but how can I detect this state of > affairs? Currently my application just fails to start, because the > Mnesia tables are not present. > If you have a backup, you can use function provided in the mnesia examples directory, otherwise you'll have to hack the schema.dat file. /Dan > Thanks in advance > > /Fredrik From thomas@REDACTED Wed Sep 14 11:01:07 2005 From: thomas@REDACTED (Thomas Johnsson) Date: Wed, 14 Sep 2005 11:01:07 +0200 Subject: Towards a native windows GUI In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE5D4@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE5D4@esealmw105.eemea.ericsson.se> Message-ID: <4327E6D3.9090203@skri.net> [ Old thread revived .... ] Since wxWindows was mentioned (nowadays called wxWidgets, www.wxwidgets.org); Just want to point out the existence of wxHaskell, http://wxhaskell.sourceforge.net , people thinking about GUIs for Erlang might want to look into their experience. -- Thomas Vlad Dumitrescu XX (LN/EAB) wrote: >Hi, > > > >> << I think you could get a lot of mileage from just >>interfacing CreateWindowEx, SendMessage and PostMessage - but >>this might be incorrect << can a real windows expert comment >>on this>> >> >> >> > >Just some quick 2 cents' thoughts: > >* With the above you can indeed go quite far, but it's only half the story - you must also be able to receive the messages on the Erlang side. This is more tedious, but doable (possibly at the expense of less flexibility in defining new widgets). > >Creating window procedures that just pass the message to the Erlang side is no good, because even if the no action or the default action should be taken, there is still a round-trip to Erlang. Imagine having one of those every time a key is pressed or the mouse is moved... So there will have to be a way to register interest in only some events, but then there has to exist a sensible default handling on the C side - see below. > >* Also, not everything in a GUI is a window. For example, labels are handled by the parent window. The reason is that many windows are heavy on the system. > >* Third, programming Windows applications like in the old days, is not fun. It's very easy to miss some important messages, and that's why there are frameworks around this basic API. They can also transparently handle widgets that aren't really windows. And some frameworks are also not Windows-only. > >To sum it up, maybe it is better to not go all the way to the lowest level, but use some existing framework. wxWindows is being put to the test as we speak. > >If you are going to say "but frameworks are heavy and there's a huge API to control all kinds of things" I am going to answer "such a framework must be built in any case! Using the bare-bones mechanisms will only work for simple applications" ;-) > >best regards, >Vlad > >For more about Windows messaging, refer to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/messagesandmessagequeues/messagesandmessagequeuesreference/messagesandmessagequeuesfunctions/postmessage.asp > (sorry about the long URL...) > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hakan@REDACTED Wed Sep 14 11:06:36 2005 From: hakan@REDACTED (Hakan Mattsson) Date: Wed, 14 Sep 2005 11:06:36 +0200 (CEST) Subject: Mnesia: changing hostname In-Reply-To: <17191.57473.129025.822826@rian.du.uab.ericsson.se> References: <200509140902.14248.ft@it.su.se> <17191.57473.129025.822826@rian.du.uab.ericsson.se> Message-ID: On Wed, 14 Sep 2005, Dan Gudmundsson wrote: DG> Fredrik Thulin writes: DG> > Hi DG> > DG> > I am at an interop event (SIPit), where I got a new hostname. I had a DG> > database in a Mnesia directory. Mnesia seems to be starting just fine, DG> > but the tables are not accessible. My old hostname is listed as a DG> > stopped db-node in mnesia:info(). DG> > DG> > This isn't very strange to me, but how can I detect this state of DG> > affairs? Currently my application just fails to start, because the DG> > Mnesia tables are not present. DG> > DG> DG> If you have a backup, you can use function provided in the mnesia DG> examples directory, otherwise you'll have to hack the schema.dat file. If you are allowed to admin your host, you could add a temporary host alias and start the node with an explicit hostname like this: erl -s mynode@REDACTED /H?kan From ft@REDACTED Wed Sep 14 11:11:38 2005 From: ft@REDACTED (Fredrik Thulin) Date: Wed, 14 Sep 2005 11:11:38 +0200 Subject: Mnesia: changing hostname In-Reply-To: <17191.57473.129025.822826@rian.du.uab.ericsson.se> References: <200509140902.14248.ft@it.su.se> <17191.57473.129025.822826@rian.du.uab.ericsson.se> Message-ID: <200509141111.38622.ft@it.su.se> On Wednesday 14 September 2005 10.34, Dan Gudmundsson wrote: ... > If you have a backup, you can use function provided in the mnesia > examples directory, otherwise you'll have to hack the schema.dat > file. I didn't have anything important in the Mnesia database on my laptop (only use it for development), but people do change host names sometimes - even on servers. Some kind of warning that Mnesia did not load the data in the mnesia directory because the schema.dat contained another hostname than the current one is what I would have liked (and still would of course). /Fredrik From vlad_dumitrescu@REDACTED Wed Sep 14 11:12:13 2005 From: vlad_dumitrescu@REDACTED (vladdu) Date: Wed, 14 Sep 2005 11:12:13 +0200 Subject: [POLL] Release handling References: Message-ID: <20050914091213.6CF7D5903C@bang.trapexit.org> Hi all, I'd like to make a poll about this. Please go to trapexit.org to answer. By "release" I mean big releases, not maintenance releases. Thanks in advance! /Vlad _________________________________________________________ Sent using Mail2Forum (http://m2f.sourceforge.net) From bjorn@REDACTED Wed Sep 14 11:51:09 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 14 Sep 2005 11:51:09 +0200 Subject: Retrieve release name In-Reply-To: <4327DF11.3090706@erix.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE620@esealmw105.eemea.ericsson.se> <4327DF11.3090706@erix.ericsson.se> Message-ID: However, in practice, it is very unlikely that there are several releases in the dictionary. I don't think that anyone would install DEVELOPMENT systems that way (even though it would probably work). In a TARGET system (which is what Gunilla's answer refers to), I haven't heard of anyone actually using the release handler to upgrade from one major release of OTP to another. So I think that you could quite safely ignore the possibility of multiple major releases in one directory tree. /Bjorn Gunilla Arendt writes: > Yes, there could be several release directories there, if you are > using OTP release handling (the ability to upgrade to/downgrade from > new versions of an entire release in run-time). Read more in the > chapter 'Release Handling' in OTP Design Principles. > > / Gunilla > > Vlad Dumitrescu XX (LN/EAB) wrote: > > Hi again, > > I have another question on this issue: Start.script is also > > available in $ERL_TOP/releases/. Could it happen that there > > are several release directories present there? I don't think it > > would be very meaningful, but stranger things have happened :-) > > Thanks in advance, > > Vlad > > > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From vlad.xx.dumitrescu@REDACTED Wed Sep 14 12:06:59 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Wed, 14 Sep 2005 12:06:59 +0200 Subject: Retrieve release name Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE625@esealmw105.eemea.ericsson.se> Just the answer I wanted to hear! :-) Thanks! /Vlad > -----Original Message----- > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Bjorn > Gustavsson > I don't think that anyone would install DEVELOPMENT systems that way > (even though it would probably work). > > In a TARGET system (which is what Gunilla's answer refers to), > I haven't heard of anyone actually using the release handler to > upgrade from one major release of OTP to another. > > So I think that you could quite safely ignore the possibility of > multiple major releases in one directory tree. > > /Bjorn From rvg@REDACTED Wed Sep 14 12:11:54 2005 From: rvg@REDACTED (Rudolph van Graan) Date: Wed, 14 Sep 2005 12:11:54 +0200 Subject: Funs Message-ID: <1718FF2A-09A9-4131-9D06-204F9A7AA301@patternmatched.com> Hi all, I've just found a feature (?) that I would like to understand a bit better. Make a fun and stick it into ETS: _TID = ets:new(test,[named_table,public,set]), F = fun(Name) -> io:format("Name = ~p\n",[Name]) end, ets:insert(test,{f,F}); Retrieve and run it: [{f,F}] = ets:lookup(test,f), F(Name). >null:test("asdasd"). Name = "asdasd" ok Change the fun F = fun(Name) -> io:format("Name = ~p\n",[Name ++ "asdasd"]) end, Recompile Run the fun from ETS again: ** exited: {{badfun,#Fun}, [{null,test,1}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** I only changed the code IN the fun, not any references or arity or anything else. I presume beam checks the version of the stored fun against the one in ets and gives me a badfun when they don't match. Is there any way to relax this checking to only look at: 1. Arity and 2. That the number of external references stay the same and 3. The fun is still in the same location in the code (i.e. index etc) The problem has to do with dynamic code upgrade and although I can guarantee that the funs behave the same, I cannot guarantee the version numbers nor have I control over it. Ideas? Rgds, Rudolph From chandrashekhar.mullaparthi@REDACTED Wed Sep 14 12:24:45 2005 From: chandrashekhar.mullaparthi@REDACTED (chandru) Date: Wed, 14 Sep 2005 12:24:45 +0200 Subject: [POLL] Release handling References: Message-ID: <20050914102445.5EC8059042@bang.trapexit.org> I've answered the poll assuming that this was a question about the development env. cheers Chandru _________________________________________________________ Sent using Mail2Forum (http://m2f.sourceforge.net) From chandrashekhar.mullaparthi@REDACTED Wed Sep 14 12:31:11 2005 From: chandrashekhar.mullaparthi@REDACTED (chandru) Date: Wed, 14 Sep 2005 11:31:11 +0100 Subject: Retrieve release name In-Reply-To: References: <11498CB7D3FCB54897058DE63BE3897C4BE620@esealmw105.eemea.ericsson.se> <4327DF11.3090706@erix.ericsson.se> Message-ID: On 14 Sep 2005 11:51:09 +0200, Bjorn Gustavsson wrote: > However, in practice, it is very unlikely that there are several > releases in the dictionary. > > I don't think that anyone would install DEVELOPMENT systems that way > (even though it would probably work). True - I install releases under different directories in my dev env. > In a TARGET system (which is what Gunilla's answer refers to), > I haven't heard of anyone actually using the release handler to > upgrade from one major release of OTP to another. > > So I think that you could quite safely ignore the possibility of > multiple major releases in one directory tree. We have multiple major releases under one directory tree. But we don't use the release handler to switch from one release to another at runtime. We run a modified version of the Install script which switches releases and then we restart the node. cheers Chandru From ulf.wiger@REDACTED Wed Sep 14 12:35:35 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 14 Sep 2005 12:35:35 +0200 Subject: Retrieve release name Message-ID: Bj?rn Gustavsson wrote: > > In a TARGET system (which is what Gunilla's answer refers to), > I haven't heard of anyone actually using the release handler to > upgrade from one major release of OTP to another. ??? AXD 301 ought to have done that a few times, since it uses the release handler and has gone through several major OTP releases. However, in AXD 301, there's a releases/ directory outside the OTP_ROOT. /Uffe From vlad_dumitrescu@REDACTED Wed Sep 14 12:55:07 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 14 Sep 2005 12:55:07 +0200 Subject: [POLL] Release handling References: <20050914101736.245C559041@bang.trapexit.org> Message-ID: Hi, I mean an installation used while developing applications, in that environment. What developers use day-by-day. /Vlad ----- Original Message ----- From: "tobbe" To: Sent: Wednesday, September 14, 2005 12:17 PM Subject: [POLL] Release handling > > Cool ! The first POLL. Very nice :D > > However, I wonder about what you mean by development environment. > Do you mean production releases ? > > Cheers, Tobbe > _________________________________________________________ > Sent using Mail2Forum (http://m2f.sourceforge.net) > From svenolof@REDACTED Wed Sep 14 13:03:02 2005 From: svenolof@REDACTED (Sven-Olof Nystr|m) Date: Wed, 14 Sep 2005 13:03:02 +0200 Subject: gb_trees:search/3 In-Reply-To: References: Message-ID: <17192.870.520622.804394@harpo.it.uu.se> Ulf Wiger (AL/EAB) writes: > > Sven-Olof Nystr?m wrote: > > > > Ulf Wiger (AL/EAB) writes: > > > The first example doesn't really introduce > > > anything new, as it scans the whole tree > > > (most likely less efficient than iterator()) > > > > or to_list(). > > Yes, well, I've grown a bit allergic to functions > that return the whole contents of a data structure > designed to be scalable. Given how the garbage > collector works, you should only use them if you > are sure that the number of objects is relatively > small; and then you might as well use orddict or > similar with very little performance penalty. (: > > That's not to say that to_list() isn't useful. See your next mail :-) In general, scanning the tree using to_list is about as fast as using iterator, as long as you need to look at all nodes (iterator will also allocate stuff on the heap). If you only look at a small number of nodes, the situation is different, of course. > > > So you scan the part of a tree where keys are smaller than 5. > With ets:select(), you can do much more than that. > A fairly common type of pattern could be to > have objects with a structured key, e.g.: > > {{DocId, [Chapter, SubChapter, Table, Row]}, Value} > (fictitious example) > > and with ordered_set ets, you can quite easily > then extract all rows in a given table in a given > sub-chapter, ... etc in this fashion > > ets:select( > docs, > [{{DocId, [Chapter,SubChapter,Table,'$1']},'$2'}, > [], > [{{'$1', '$2'}}]}]) > > The syntax is horrible, but that's partly because > you can't really copy each object to the process > heap just to determine whether it's a match, and > you don't have a context within ets for evaluating > a fun. gb_trees can do much better, IMO. In the documentation, it is claimed that ets tables provide constant time access. Obviously, this does not hold if you use select() to look for tuples where, say, the third element + the fourth is less than 4711. Gb-trees (or other standard datastructures like for example hash-tables) only allow efficient access using one key. It is possible to have efficent search on several keys if one maintains one gb-tree for each key. > > You could read up on the match specification > syntax in the ERTS user's guide > (http://erlang.se/doc/doc-5.4.8/erts-5.4.8/doc/html/match_spec.html#1) > but I think that a functional data structure > should just disregard match specifications > and allow the user to provide a fun instead. I'm a little bit curious about the efficency of select(). In the general case, select must be implemented using a search through the entire table. It seems reasonable to assume that select() may sometimes use a more efficient search. (If you accept the cost of linear search, implementing select over a gb-tree is easy, of course.) > > Another way to do partial scans might be a function > > > > to_list(Key1, Key2) > > > > that returns a list of the entries in the tree between > > the two keys. > > Nice, but decidedly less flexible than the ets:select() > function. > > Perhaps it's just me, but I would like to see some > functional data structures offer some of the power > of ets, and perhaps manage to lure some people > away from ets. For one thing, using a functional > data structure, you get "undo" for free. It should be possible to build a general ets-like data structure on top of gb-trees. One tricky thing when designing such a datastructure is specifying the set of operations that need to be efficient. Personally, I have found that building specialized data structures using several gb-trees works fine, but perhaps people who have grown accustomed to using ets-tables see things differently. Sven-Olof From vlad.xx.dumitrescu@REDACTED Wed Sep 14 13:07:07 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Wed, 14 Sep 2005 13:07:07 +0200 Subject: Developing for multiple releases? Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE626@esealmw105.eemea.ericsson.se> Me again :-) Is anyone developing code that is to be compiled for/used in nodes running different releases? If yes, how do your development process look like? Just makefiles, or something more elaborate? Would a tool supporting this (semi)automatically be useful? [ My question refers mostly to the fact that beam code compiled for R10 can't be loaded by a R9 VM. So if I need to support both releases, I need to compile it twice. [*] Library incompatibilities make the code crash, but that can be handled "as usual". ] best regards, Vlad [*] Or R9 could catch the error, and if the beam file contains debug info, it could extract the abstract code, recompile and reload... -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Wed Sep 14 13:12:25 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 14 Sep 2005 04:12:25 -0700 (PDT) Subject: Funs In-Reply-To: <1718FF2A-09A9-4131-9D06-204F9A7AA301@patternmatched.com> Message-ID: <20050914111225.69726.qmail@web34411.mail.mud.yahoo.com> --- Rudolph van Graan wrote: > I only changed the code IN the fun, not any > references or arity or > anything else. I presume beam checks the version of > the stored fun > against the one in ets and gives me a badfun when > they don't match. Yes, funs are considered "transient", I guess. (Whether this way of handling funs is Right is another discussion.) One way of getting around this would be to store such funs in a module of their own (either one fun per module or one group of funs per module). The funs will live as long as that module. A second approach is to avoid funs, store {M,F,A, FVs} and invoke the actual function by hand. Some variation on this is probably the common solution. Inside the runtime system, a third way would be to garbage collect code; the fun can then just hang on to the code it needs. This is used in some FPLs, I believe, and was at least proposed for the multiprocessor Erlang prototype (don't know if it was implemented?). Persistence, e.g., storing the fun in mnesia, could yield surprising amounts of copying, though :-) Finally, perhaps the compiler and runtime could keep track of funs by using an extra level of indirection. Each fun gets a hash (a pseudo code pointer, or a handle to its code pointer) which is the hash key to its code pointer. When a module is loaded or unloaded, the hash table of (key, codeptr) is updated appropriately by deleting keys from purged modules and adding keys from loaded ones. Some refcounting may be required too. Anyway, an identical fun (same hash) will then by default point to its code in the most recent module. Cost of applying the fun compared to today is unclear. Best, Thomas __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com From ulf.wiger@REDACTED Wed Sep 14 13:13:49 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 14 Sep 2005 13:13:49 +0200 Subject: gb_trees:search/3 Message-ID: > From: Sven-Olof Nystr?m wrote: > > I'm a little bit curious about the efficency of > select(). In the general case, select must be > implemented using a search through the entire table. > It seems reasonable to assume that select() may > sometimes use a more efficient search. (If you > accept the cost of linear search, implementing select > over a gb-tree is easy, of course.) ets:select() detects the trivial case where the whole key is known, and then reduces to a lookup. If the first part of the key is known, and it's an ordered_set, the cost of ets:select() will be proportional to the number of records matching the bound part of the key. OTOH, searches like ets:select(Tab,[{{'$1','_'},[{'>','$1',17}], ['$_']}]) will result in a linear search, even though one could imagine a more efficient strategy. /Uffe From bjorn@REDACTED Wed Sep 14 13:21:31 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 14 Sep 2005 13:21:31 +0200 Subject: Developing for multiple releases? In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE626@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE626@esealmw105.eemea.ericsson.se> Message-ID: "Vlad Dumitrescu XX (LN/EAB)" writes: > Me again :-) > > Is anyone developing code that is to be compiled for/used in nodes running different releases? > > If yes, how do your development process look like? Just makefiles, or something more elaborate? Would a tool supporting this (semi)automatically be useful? > > [ > My question refers mostly to the fact that beam code compiled for R10 can't be loaded by a R9 VM. So if I need to support both releases, I need to compile it twice. [*] Why not compile using R9 then? The code will run on R10B. And whose code are you referring code? The code for your tools, or the user's code? /Bj?rn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From ft@REDACTED Wed Sep 14 13:24:06 2005 From: ft@REDACTED (Fredrik Thulin) Date: Wed, 14 Sep 2005 13:24:06 +0200 Subject: upper limit of 'receive after' timeout Message-ID: <200509141324.06198.ft@it.su.se> Hi There appears to be an undocumented upper limit of the timeout value in a 'receive after' clause. The documentation (http://www.erlang.se/doc/doc-5.4.8/doc/reference_manual/expressions.html#6.10) says "ExprT should evaluate to an integer.". 10 000 000 000 is an integer (10 million seconds, around 115 days), but apparently too big to be used as ExprT : $ erl Erlang (BEAM) emulator version 5.4.8 [source] [hipe] Eshell V5.4.8 (abort with ^G) 1> receive _ -> ok after 1000 -> io:format("timeout~n") end. timeout ok 2> T = 10000000 * 1000. 10000000000 3> is_integer(T). true 4> receive _ -> ok after T -> io:format("timeout~n") end. =ERROR REPORT==== 14-Sep-2005::13:16:29 === Error in process <0.30.0> with exit value: {timeout_value, [{erl_eval,receive_clauses,8},{shell,exprs,6},{shell,eval_loop,3}]} ** exited: {timeout_value,[{erl_eval,receive_clauses,8}, {shell,exprs,6}, {shell,eval_loop,3}]} ** 5> Why do I want to do this? To allow for TCP connections with veery little activitiy (on the application layer) over veery long time, but not indefinitely. SIP clients behind NATs might need this :(. Perhaps 115 days is a bit too much, but what is the upper limit of 'receive after'? /Fredrik From bjorn@REDACTED Wed Sep 14 13:32:23 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 14 Sep 2005 13:32:23 +0200 Subject: upper limit of 'receive after' timeout In-Reply-To: <200509141324.06198.ft@it.su.se> References: <200509141324.06198.ft@it.su.se> Message-ID: The highest allowed value is 16#ffffffff (i.e. the value must fit in 32 bits). /Bj?rn Fredrik Thulin writes: > Hi > > There appears to be an undocumented upper limit of the timeout value in > a 'receive after' clause. The documentation > (http://www.erlang.se/doc/doc-5.4.8/doc/reference_manual/expressions.html#6.10) > says "ExprT should evaluate to an integer.". 10 000 000 000 is an > integer (10 million seconds, around 115 days), but apparently too big > to be used as ExprT : > > $ erl > Erlang (BEAM) emulator version 5.4.8 [source] [hipe] > > Eshell V5.4.8 (abort with ^G) > 1> receive _ -> ok after 1000 -> io:format("timeout~n") end. > timeout > ok > 2> T = 10000000 * 1000. > 10000000000 > 3> is_integer(T). > true > 4> receive _ -> ok after T -> io:format("timeout~n") end. > > =ERROR REPORT==== 14-Sep-2005::13:16:29 === > Error in process <0.30.0> with exit value: {timeout_value, > [{erl_eval,receive_clauses,8},{shell,exprs,6},{shell,eval_loop,3}]} > > ** exited: {timeout_value,[{erl_eval,receive_clauses,8}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > 5> > > Why do I want to do this? To allow for TCP connections with veery little > activitiy (on the application layer) over veery long time, but not > indefinitely. SIP clients behind NATs might need this :(. Perhaps 115 > days is a bit too much, but what is the upper limit of 'receive after'? > > /Fredrik > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From vlad.xx.dumitrescu@REDACTED Wed Sep 14 13:34:37 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Wed, 14 Sep 2005 13:34:37 +0200 Subject: Developing for multiple releases? Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE627@esealmw105.eemea.ericsson.se> > > My question refers mostly to the fact that beam code > compiled for R10 can't be loaded by a R9 VM. So if I need to > support both releases, I need to compile it twice. [*] > > Why not compile using R9 then? The code will run on R10B. Yes, that's a possibility, but then I'll be stuck to the latest release anyone is using. That feels like the same issue you are confronting daily in the OTP team :-) > And whose code are you referring code? The code for your > tools, or the user's code? Both. ** For my tool's code, it's like this. I develop Erlide that also contains Erlang code. I personally use R10, but there are many potential users that use still R9. In order to be able to start Erlide on R9, the code must be compatible. So I can either step back and use R9 code in Erlide, or generate code for both releases and at runtime check current version and use that code. The first is simplest, but is limiting. The second is a little difficult to administrate. ** For the users' code, it may also be important. If it is something that is useful, it should be done early in my development cycle, because it affects other parts. regards, Vlad From bengt.tillman@REDACTED Wed Sep 14 15:02:52 2005 From: bengt.tillman@REDACTED (Bengt Tillman (LI/EAB)) Date: Wed, 14 Sep 2005 15:02:52 +0200 Subject: Developing for multiple releases? Message-ID: <1DA0626BEB4BCF4699FD33B78532C0A921835A@esealmw114.eemea.ericsson.se> "Vlad Dumitrescu XX (LN/EAB)" writes: > Me again :-) > > Is anyone developing code that is to be compiled for/used in nodes running different releases? > > If yes, how do your development process look like? Just makefiles, or something more elaborate? Would a tool supporting this (semi)automatically be useful? > For the NETSim product (Ericsson-internal link: http://internal.ericsson.com/page/hub_radionetwork/unit/pdu_gran/sim_products/netsim/index.jsp) we have solved the problem in a radically different way. We ship two Erlang runtime environments with the product (one for Solaris and one for Linux) so that it can be installed and executed on a network of mixed architectures. For each new OTP release we run a script which makes a run-time package out of our installations (by removing source code, documentation and applications we do not need). We then integrate the run-time package into the product. /Bengt Tillman From mickael.remond@REDACTED Wed Sep 14 16:07:35 2005 From: mickael.remond@REDACTED (Mickael Remond) Date: Wed, 14 Sep 2005 16:07:35 +0200 Subject: ssh 1.0 authentication problem Message-ID: <43282EA7.2050305@erlang-fr.org> Hello, I have been experimenting recently with the SSH-1.0 application. I do not ahve any success connecting to a distant machine with it, as I keep getting error messages of the form: {error,{ssh_msg_userauth_failure,"publickey,keyboard-interactive",false}} I am simple trying to connect to a distant shell using ssh:connect function. Any idea ? -- Micka?l R?mond From david.nospam.hopwood@REDACTED Wed Sep 14 16:31:56 2005 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Wed, 14 Sep 2005 15:31:56 +0100 Subject: String representation in erlang In-Reply-To: <200509140227.j8E2RWwu190612@atlas.otago.ac.nz> References: <200509140227.j8E2RWwu190612@atlas.otago.ac.nz> Message-ID: <4328345C.5080207@blueyonder.co.uk> Richard A. O'Keefe wrote: > Thinus Pollard wrote: > According to the Erlang efficiency guide a string is internally > represented as a list of integers, thus consuming 2 words > (8 bytes on a 32bit platform) of memory *per* character. > > Unicode/ISO10646 characters require in general 21 bits. > NOT 16 bits. Java claims to support Unicode, but there are already > quite a lot of Unicode characters which don't fit in 16 bits, so > many Unicode characters require two Java "chars". Needless to say, > this stuffs up Java string indexing something wonderful. Indexing into UTF-16 works fine (as does indexing into UTF-8). There's only a problem if you assume that it's necessary to index by code point instead of by code unit. Note that in Unicode, abstract characters are represented by *sequences* of code points (because of combining marks). So a "position" in a Unicode string, regardless of whether it is a code point index or a code unit index, does not in general correspond to a count of abstract characters from the start of the string. And for most purposes, this makes no difference; all you need is a position, not a count. From section 5.4 of Unicode 4.x (http://www.unicode.org/versions/Unicode4.1.0/): # [...] By accessing at most two code units, a process using the UTF-16 # encoding form can therefore interpret any Unicode character. Determining # character boundaries requires at most scanning one preceding or one # following code unit without regard to any other context. # # As long as an implementation does not remove either of a pair of surrogate # code units or incorrectly insert another character between them, the # integrity of the data is maintained. Moreover, even if the data becomes # corrupted, the corruption is localized, unlike with some other multibyte # encodings such as Shift-JIS or EUC. Corrupting a single UTF-16 code unit # affects only a single character. Because of non-overlap (see Section 2.5, # Encoding Forms), this kind of error does not propagate throughout the rest # of the text. # # UTF-16 enjoys a beneficial frequency distribution in that, for the majority # of all text data, surrogate pairs will be very rare; non-surrogate code # points, by contrast, will be very common. [and furthermore, non-surrogate code points are only used for characters that aren't likely to have any special interpretation in a given format/syntax] # Not only does this help to limit the performance penalty incurred when # handling a variable-width encoding, but it also allows many processes # either to take no specific action for surrogates or to handle surrogate # pairs with existing mechanisms that are already needed to handle character # sequences. -- David Hopwood From jakob@REDACTED Wed Sep 14 17:02:37 2005 From: jakob@REDACTED (Jakob Cederlund) Date: Wed, 14 Sep 2005 17:02:37 +0200 Subject: ssh 1.0 authentication problem In-Reply-To: <43282EA7.2050305@erlang-fr.org> References: <43282EA7.2050305@erlang-fr.org> Message-ID: <43283B8D.40008@erix.ericsson.se> I think you ought to wait for the new version of the ssh application, due to the next release. The 1.0-version has lots and lots of problems, one of them is having no working public-key user authentication. /Jakob Mickael Remond wrote: > Hello, > > I have been experimenting recently with the SSH-1.0 application. > I do not ahve any success connecting to a distant machine with it, as > I keep getting error messages of the form: > > {error,{ssh_msg_userauth_failure,"publickey,keyboard-interactive",false}} > > I am simple trying to connect to a distant shell using ssh:connect > function. > Any idea ? > From ok@REDACTED Thu Sep 15 02:28:15 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 15 Sep 2005 12:28:15 +1200 (NZST) Subject: String representation in erlang Message-ID: <200509150028.j8F0SFER210174@atlas.otago.ac.nz> David Hopwood appears to have taken exception to my statement that > Java claims to support Unicode, but there are already > quite a lot of Unicode characters which don't fit in 16 bits, so > many Unicode characters require two Java "chars". Needless to say, > this stuffs up Java string indexing something wonderful. Let's clarify things a bit. First, Unicode is seriously weird, AND they keep fiddling with the rules, so things like "which characters should I treat as spaces" have been known to change from one version of Unicode (2.0) to another (3.0), and I am not just talking about adding new characters, but about the status of existing characters. Second, Unicode is complex. That's because even if we restrict our attention to alphabetic writing systems used by major languages or language groups, there is plenty of weirdness about, and Unicode tries to handle them all. There are scripts where one phoneme is represented by two graphemes which are thought of as separate graphemes, like "th", "sh", and "ph" in English, there are scripts where there are symbols for phoneme x and phoneme y but although y is pronounced after x, the symbol for y may go before, above, below, or even inside the symbol for x, there are scripts where the same logical symbol has a different shape depending on where it is in the word (English used to do this with "s", using "long s" -- which looks like an "f" without a cross-bar -- in some contexts and the modern s elsewhere), there are scripts where an accented letter is thought of as a letter plus an accent (like stress accent and diaeresis in English) and others where visibly the same combination is treated as a different letter. I struggled for some time to come up with an unambiguous way to say "what is a character in Unicode", but I can't. However, we CAN say these things about Unicode. (1) Each version of Unicode defines a fixed set of Unicode characters; Unicode 4.0.0 lists 96,513 of them (excluding surrogates, private use codes, and reserved = not-yet-defined codes). => There is a well defined (but time dependent) notion of "a Unicode character." Unicode character numbers fit into 21 bits. There are programming languages and Web API definitions that call for string indexing to be in terms of Unicode characters. (2) Some of these are combining characters (also known as "floating diacriticals") that are meant to be attached to "base characters". There is no bound in principle on the number of floating diacriticals that could be attached to a single base character. This means that the set of Unicode characters, sensu latu, is infinite. The Unicode book points out sorrowfully that there isn't any general way to refer to a "user-perceived character", but does say that there is 'a core concept of "characters that should be kept together" ... that can be defined in a language-independent way' and calls this a "grapheme cluster". => There is a well defined (but time dependent) notion of "a Unicode grapheme cluster" containing one or more Unicode characters that are supposed to be kept together. The only "standard" I am aware of that calls for some way of accessing or stepping through a string in units of grapheme clusters is a proposal I wrote for Prolog, but there may be others. (3) There are many encoding forms for Unicode. Amongst others, UTF-16 replaces each Unicode character outside the 16-bit range by a pair of special codes called "surrogates", each of which carries 10 bits of the whole code. => There are programming languages (including Java) and Web API definitions that call for string indexing to be in terms of UTF-16 encoding units. => Since Java's 'char' type represents a *single* UTF-16 encoding units, there are something like 34 000 currently defined Unicode characters which cannot be held in a Java char'. Since Java's String type represents a sequence of UTF-16 encoding units, there is no way to refer to the ith *Unicode character* without parsing the string at least up to that point. (4) The fact that there are Web standards which call for indexing in terms of *Unicode characters* and other Web standards which call for indexing in terms of *UTF-16 encoding units* is clearly regrettable. If memory serves me, XPath and the DOM are examples of standards that disagree in this way. The terminology I am going to use here is anything but standard, but I hope it will make things clear. David Hopwood wrote Indexing into UTF-16 works fine (as does indexing into UTF-8). Indexing into UTF-16 works fine. I never said it didn't. The problem is that there IS a well defined notion of a Unicode character, and there IS a well defined notion of indexing into a Unicode string, BUT indexing into UTF-16 doesn't do that. I don't see the mismatch between UTF-8 and Unicode as much of a problem. UTF-8 codes range from 1 to 4(?) bytes, and not only that, the number of bytes per character varies within the dear old Latin 1 range (so ASCII is 1 byte, accented letters are 2 bytes). Programmers learn very quickly that indexing into byte strings is not at all the same as indexing into Unicode strings. However, if you WANT "give me Unicode characters from index s to index f" but you are GIVEN "UTF-16 encoding units from index s to index f", that is going to seem to work. In fact there are too many Java textbooks telling their victims that these are the same thing. Because the new characters are not widely used yet, it's pretty much certain to be one's customers who run into weird off-by-a-few problems rather than oneself. There's only a problem if you assume that it's necessary to index by code point instead of by code unit. In some web standards, it *is*. Note that in Unicode, abstract characters are represented by *sequences* of code points (because of combining marks). Section 2.10, near the foot of page 46 in the Unicode 4.0 book, defines "grapheme cluster". Section 3.4, definition D3 says that an abstract character - has no concrete form - should not be confused with a glyph - does not necessarily correspond to what a user calls a character - should not be confused with a grapheme - may be encoded in Unicode and is then called a Unicode abstract character - might be representable using combining characters; such abstract characters do not have any special name - some abstract characters are not representable at all There are no operations on nor properties listed for any abstract characters other than the Unicode abstract characters. So a "position" in a Unicode string, regardless of whether it is a code point index or a code unit index, does not in general correspond to a count of abstract characters from the start of the string. Nobody ever said it did. For one thing, when looking at the same visible marks, two different people may disagree about what the abstract characters *are*, let alone how many of them there are. Indexing in terms of abstract characters is of no practical use to anyone, because there is no general cross-language cross-script agreement about what they are. (Example: is Dz one letter or two? To me, two. To my grandfather Ivan, may be rest in peace, one. In fact there _is_ a Unicode character Dz=U+01F2, also a dz=U+01F3 and a DZ=U+01F1. Try as I might, I can't help thinking of them as two characters each, even though I know why they exist and have tried to learn the language they're used in.) Yes, it would be nice to be able to index in terms of abstract characters. But since we can't agree about what that means, there's no use crying for the moon. We *could* ask for indexing or string slicing in terms of Unicode grapheme clusters, because we DO have a well defined notion of what that is, and in my Prolog library specification I *have* asked for it. But the result has to be a string. And for most purposes, this makes no difference; all you need is a position, not a count. You mistake the issue. Yes, all we need is a position. But that position must have SOME definite value. Let's take XPath 1.0 as a specific example, where XPath 1.0 section 4.2 defines Function: string substring(string, number, number?) The substring function returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument. For example, substring("12345", 2, 3) returns "234". If the third argument is not specified, it returns the substring starting at the position specified in the second argument and continuing to the end of the string. For example, substring("12345", 2) returns "2345". More precisely, each character in the string (see [3.6 Strings]) is considered to have a numeric position: the position of the first character is 1, the position of the second character is 2, and so on. ... Function number string-length(string) The string-length function returns the number of characters in the string (see [3.6 Strings]). ... So what is a character? XPath 1.0 section 3.6 tells us Strings consist of a sequence of zero or more characters, where a character is defined in the XML Recommendation. A single character in XPath thus corresponds to a single Unicode abstract character -- note, this means an abstract character which is represented DIRECTLY -- in the Unicode standard as a SINGLE character, not a longer sequence -- of characters! with a single corresponding scalar value; this is not the same thing as a 16-bit Unicode code value: the Unicode coded character representation -- note, they really mean UTF-16, what they next say is not true of UCS4. for an abstract character with Unicode scalar value greater that [sic.] U+FFFF is apair of 16-bit Unicode code values (a surrogate pair). In many programming languages, a string is represented by a sequence of 16-bit Unicode values; implementations of XPath in such languages must take care to ensure that a surrogate pair is correctly treated as a single XPath character. *THIS* is what I was referring to when I said that Java string indexing was stuffed up. If you want to interpret substring(., 27, 42) in XPath, simply doing currentNode.stringValue.substring(27-1, 27-1+42) will give you the right answer often enough to trick you into expecting it to work all the time, but it WON'T. In fact there is NO method in the java.lang.String class that does this job. (The Java API is so huge these days that doubtless there is a suitable method *somewhere*, but the on-line docs don't point you to it.) [and furthermore, non-surrogate code points are only used for characters that aren't likely to have any special interpretation in a given format/syntax] I'm not sure what the relevance of this is. My point is this. People are using Erlang to process XML. We have Xmerl, for example, which has some level of "xpath" support. For XML, we have XPath 1.0, in which string lengths and substrings are specifiied in terms of single Unicode characters, explicitly NOT 16-bit units and NOT grapheme clusters or any other kind of "abstract character" than ones directly encoded as single Unicode characters. We also have XPointer (TR/xptr-xpointer), an extension of XPath, which defines lengths and ranges the same way. We also have XSLT, which again builds on XPath, and defines string lengths and substrings the same way. The DOM specifies 16-bit units, but the DOM does not specify stuff you might actually find in an XML document. Rather, the DOM is a language-neutral-as-long-as-the-language-is-Java-or-ECMAScript and rather clumsy kind of stuff to put in imperative programs; the model relies on side effects to mutable data structures, making it unsuitable for Erlang. So the Web standards that *could* fit into an Erlang way of doing things call for strings to be treated AS IF they were sequences of single Unicode characters. For this purpose, a list of 21-bit integers is quite convenient, while a packed byte representation is less convenient. Binaries could be *made* convenient for processing Unicode strings in an XPath-compatible way (I don't expect indexing into Unicode data to be O(1); I said "convenient", not "efficient") and this would require extra library support. From david.nospam.hopwood@REDACTED Thu Sep 15 03:30:19 2005 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Thu, 15 Sep 2005 02:30:19 +0100 Subject: String representation in erlang In-Reply-To: <200509150028.j8F0SFER210174@atlas.otago.ac.nz> References: <200509150028.j8F0SFER210174@atlas.otago.ac.nz> Message-ID: <4328CEAB.4000406@blueyonder.co.uk> Instead of "abstract character", I should have said "combining character sequence". Not that it really mattered to my argument, since the point was that you have to deal with variable-length encodings *whichever* notion of character you're using. Richard A. O'Keefe wrote: > (4) The fact that there are Web standards which call for indexing in > terms of *Unicode characters* and other Web standards which call > for indexing in terms of *UTF-16 encoding units* is clearly > regrettable. If memory serves me, XPath and the DOM are examples > of standards that disagree in this way. Yes, it is regrettable. However, it is not really a big problem. You just have to do a little bit more work to implement standards that index in terms of Unicode characters (i.e. code points). This is rarely an efficiency issue, because the kind of standards we're talking about here tend to impose enormous overhead anyway. (Also, using UTF-32 kills performance relative to UTF-16 or -8 due to the higher memory bandwidth needed.) It might be a correctness issue if implementors fail to pay attention to either the Unicode spec or the standard they're implementing, and just assume that indexing by code point and by UTF-16 code unit are the same thing. Frankly I don't have a great deal of sympathy for implementors who are that careless. [big snip] > *THIS* is what I was referring to when I said that Java string indexing > was stuffed up. If you want to interpret > > substring(., 27, 42) > > in XPath, simply doing > > currentNode.stringValue.substring(27-1, 27-1+42) > > will give you the right answer often enough to trick you into expecting it > to work all the time, but it WON'T. In fact there is NO method in the > java.lang.String class that does this job. int start = s.offsetByCodePoints(0, 27-1); stringValue.substring(start, s.offsetByCodePoints(start, 42)); > (The Java API is so huge these > days that doubtless there is a suitable method *somewhere*, but the on-line > docs don't point you to it.) It wasn't difficult to find. -- David Hopwood From ok@REDACTED Thu Sep 15 06:43:55 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 15 Sep 2005 16:43:55 +1200 (NZST) Subject: String representation in erlang Message-ID: <200509150443.j8F4htJE214577@atlas.otago.ac.nz> David Hopwood wrote: It might be a correctness issue if implementors fail to pay attention to either the Unicode spec or the standard they're implementing, and just assume that indexing by code point and by UTF-16 code unit are the same thing. As I commented, they are *taught* that in too many Java textbooks. (And Windows programming textbooks too.) Frankly I don't have a great deal of sympathy for implementors who are that careless. If programmers only had to write programs of a few hundred lines, I would be in agreement with you. But when people have to work on large systems with dozens of badly written specifications (and if I find *one* W3C specification which is, at least in its first published version, well written I will set up an altar to the authors), they really do have to take *some* of their tools on trust. I have been reading and re-reading the Unicode specifications since version 1.0 came out, and I still find it dauntingly complex. If a programmer gets confused because the natural way to use the tools in his language don't agree perfectly with what Unicode has become, it's not the programmer who deserves the principal blame. int start = s.offsetByCodePoints(0, 27-1); stringValue.substring(start, s.offsetByCodePoints(start, 42)); That's nice to know, but none of the three Java versions on my Sun box (Sun JDK 1.2.something, Sun JDK 1.4.0, and gcj) nor the Java system on my PowerMac (also 1.4) has the least knowledge of such a method. > (The Java API is so huge these > days that doubtless there is a suitable method *somewhere*, but the on-line > docs don't point you to it.) It wasn't difficult to find. It was *impossible* for the Java 1.4 compilers to find it. So I don't feel too bad about not finding in the documentation myself. (In fact grepping through the Javadoc-produce HTML shows that this method name is not *in* the documentation.) I didn't bother looking in the 1.5 documents because a method that isn't supported in the systems I'm actually using isn't any use to me. When I *do* look at the Java 1.5 documents for String I find complete gobble-de-gook like "The length is equal to the number of 16-bit Unicode characters in the string." What the dickens is a "16-bit Unicode character" when it's at home? Does this mean that it parses the string looking for things which are both 16-bit units *and* codes of Unicode characters? (Hint: some values you can put in a Java 'char' are permentantly outside the set of Unicode character codes.) However, I see that there are now quite a few methods which provide a better approximation to Unicode. It's still rather sad that the data type called 'char' in Java is not big enough to hold a character, so that .charAt() and .codePointAt() are not compatible. Remember, all along my aim has been to praise Erlang, not to dispraise Java. Java's designers standardisedg on 16-bit "characters" back when Unicode had less than 40,000 characters, although it's interesting that Sun's *C* people firmly insisted that wchar_t was to be 4 bytes from the first. *Because* Erlang has never had a 'character' data type, it has evaded the trap of committing to a character size (whether 8 or 16 bits doesn't matter) which would now be too small. From camster@REDACTED Thu Sep 15 12:12:09 2005 From: camster@REDACTED (Richard Cameron) Date: Thu, 15 Sep 2005 11:12:09 +0100 Subject: String representation in erlang In-Reply-To: References: Message-ID: <6D0C25A8-1BE4-4D6F-B831-3332F8291D99@citeulike.org> On 13 Sep 2005, at 15:17, Joe Armstrong (AL/EAB) wrote: > 2> size(term_to_binary(packer:packstring(S))). > 42 > 3> size(term_to_binary(S)). > 30 > > [snip] > > You might need to compresses them on disk to save space but then > you need > real compression, like LZSS... ... and you get compression for free if you use term_to_binary/2: 1> size(term_to_binary(lists:duplicate(1000000,$A))). 2000007 2> size(term_to_binary(lists:duplicate(1000000,$A), [compressed])). 1977 I use it to transport large chunks of data between distributed nodes over a (slow) network, and it works beautifully. At the other end, binary_to_term will automatically recognise the data as being in a compressed format and just do the right thing. Richard. From knutbakke@REDACTED Thu Sep 15 14:47:23 2005 From: knutbakke@REDACTED (Knut Bakke) Date: Thu, 15 Sep 2005 05:47:23 -0700 (PDT) Subject: ets:lookup and ets:update_counter return [] although key/value is there In-Reply-To: Message-ID: <20050915124723.46094.qmail@web61019.mail.yahoo.com> Hi, The bug is not in the application. I wouldn't dear to post the problem if there was a risk for application fault. A extreamly simple program writing and reading to ets is reproducing the problem that we see in the application. However, I have been hunting other machins with the exact HW in the meantime. On those machines I'm not able to reproduce it. Other program running on the machine is having no problems, so how can this be a problem only visible in ets - if its a HW problem? Is ets:lookup returning [] in any cases somethings go wrong in the emulator due to e.g. memory faults? -knut. --- Bjorn Gustavsson wrote: > Knut Bakke writes: > > > My best clue: I know that the memory driver for > erlang > > has been changed to delete memory areas before > > updating them - to reduce memory fragmentation. > Could > > it be that there is a time slice where the data is > not > > there? > > (I suppose you refer to the +r flag.) > > NO. The current emulator is single-threaded. Nothing > else > can run while an ets operation is taking place. > > I strongly suspect that there is a bug in your own > application, that > changing the hardware has changed the timing and > exposed a latent bug. > Of course, the bug could be in ets; in that case it > should be possible > to reproduce it on any machine if you would do > EXACTLY the same ets > operations. > > Have you tried to trace all ets operations? > > /Bjorn > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From peter.c.marks@REDACTED Thu Sep 15 14:58:22 2005 From: peter.c.marks@REDACTED (Peter Marks) Date: Thu, 15 Sep 2005 08:58:22 -0400 Subject: Resource allocation Message-ID: <239d02ca05091505587822e0ab@mail.gmail.com> My recent background in distributed systems involved the use of Jini Technology (http://www.jini.org) Jini has the notion of a Lease. A lease is given by entity L (Landlord) to entity R (Renter) if R is using some resource in L (a room - e.g., occupying a slot in a table). A lease is only good for a certain length of time. When the lease expires it is up to R to renew the lease with L. If the lease is not renewed then L is free to give the resource (the room) to some other entity. Leasing prevents the accumulation of garbage in a dynamic and distributed application. Importantly, making sure that the lease is renewed is the responsibility of the Renter, not the Landlord. So the Landlord does not have to keep asking its Renters whether they are still alive, a task which is often difficult to do. How long does one wait to hear back from the Renter, for example? How is the management of unused storage handled in Erlang? Is it done by linking one process to another? Or, is the type of relationship where one process uses resources in another process not used in Erlang programs? Thanks, Peter From ulf.wiger@REDACTED Thu Sep 15 16:54:38 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Thu, 15 Sep 2005 16:54:38 +0200 Subject: edoc - how to set up links? Message-ID: Looking at some generated edoc files, I'm wondering how one is supposed to set up working references to e.g. OTP's html pages. Per default, edoc creates references to http://www.erlang.org/edoc/doc/ etc., but those don't seem to work. It also has a utility function, edoc_lib:find_doc_dirs(), that searches the code path for doc/ directories relative to the ebins. For the doc directories to count, they must contain an 'edoc-info' file, but none of the OTP applications, at least in R10B-2 (or the latest commercial build) have such files, as far as I can tell. Is there a generally accepted, or at least recommended, procedure? If not, does anyone have a suggestion or success story to share? /Uffe From richardc@REDACTED Thu Sep 15 17:24:08 2005 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 15 Sep 2005 17:24:08 +0200 Subject: edoc - how to set up links? In-Reply-To: References: Message-ID: <43299218.9030403@csd.uu.se> Ulf Wiger (AL/EAB) wrote: > Looking at some generated edoc files, I'm wondering > how one is supposed to set up working references to > e.g. OTP's html pages. > > Per default, edoc creates references to http://www.erlang.org/edoc/doc/ > etc., but those don't seem to work. Well, that was just a sort of hopeful guess that I might be able to convince the OTP folks to generate edoc files for all standard libraries and put it up at a default location. Come to think about it, it might have worked better if I had actually told them about this bold and cunning plan... > It also has a utility function, > edoc_lib:find_doc_dirs(), that searches the code path for doc/ directories > relative to the ebins. For the doc directories to count, they must contain > an 'edoc-info' file, but none of the OTP applications, at least in R10B-2 > (or the latest commercial build) have such files, as far as I can tell. > > Is there a generally accepted, or at least recommended, procedure? Perhaps you can't call it a "procedure", but you can easily generate the docs for an application, like this: Eshell V5.5 (abort with ^G) 1> edoc:application(kernel). 2> edoc:application(stdlib). 3> ... (Then have a look in lib//doc/.) Of course, there's no actual edoc markup in those library files, but at least you get a list of modules and their functions (and often you get good usage hints from the parameter names). If your own source files actually contain cross-references between applications, you need to generate the docs twice to make sure you get all the references right. I meant to automate this even further, together with some nice index page generation, but I didn't find the time. However, it should already be somewhat usable as it is. /Richard PS. I've actually done a little edoc hacking lately, so perhaps this stuff will also be improved in the somewhat near future. One thing is already done: automatic paragraph breaking - no need for

...

! From serge@REDACTED Thu Sep 15 19:07:19 2005 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 15 Sep 2005 13:07:19 -0400 Subject: R10B-7 inets issue Message-ID: <4329AA47.3080300@hq.idt.net> OTP team: I installed R10B-7 release on Linux and while running inets httpd the following printout shows in the terminal window every time an http client is making a request to a dynamic web page (using mod_esi). This hasn't being seen in the prior OTP releases: 1> Env [{server_software,"inets/4.5.3"}, {server_name,"devlinuxpro"}, {gateway_interface,"CGI/1.1"}, {server_protocol,"HTTP/1.1"}, {server_port,8080}, {request_method,"GET"}, {remote_addr,"10.206.200.65"}, {script_name,"/cgi-bin/erl/server_mgr/http_get_state"}, {http_host,"devlinuxpro.mis.idt.net:8080"}, {http_user_agent,"Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20050603 Netscape/8.0.2"}, {http_accept,"text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"}, {http_accept_language,"en-us,en;q=0.5"}, {http_accept_encoding,"gzip,deflate"}, {http_accept_charset,"ISO-8859-1,utf-8;q=0.7,*;q=0.7"}, {http_keep_alive,"300"}, {http_connection,"keep-alive"}] Enter erl_scheme_webpage_chunk Enter erl_scheme_webpage_whole ---------- This is what I have in the inets' config file: >cat ../priv/inets.conf BindAddress * Port 8080 ServerName wwwproxy ServerRoot ../priv DocumentRoot ../priv/docroot Modules mod_alias mod_esi mod_auth mod_actions mod_cgi mod_include mod_dir mod_get mod_head DirectoryIndex index.html ErlScriptAlias /cgi-bin/erl io io_lib server_mgr ---------- The http client accesses a page /server_mgr/http_get_state Before calling server_mgr:http_get_state/2 the inets httpd server prints the information stated above. I narrowed down the problem to inets' mod_esi.erl lines: erl_scheme_webpage_chunk(Mod, Func, Env, Input, ModData) -> io:format("Enter erl_scheme_webpage_chunk~n", []), ... erl_scheme_webpage_whole(Module, Function, Env, Input, ModData) -> io:format("Enter erl_scheme_webpage_whole~n", []), ... generate_webpage(ModData, ESIBody, Modules, ModuleName, FunctionName, Input, ScriptElements) -> ... io:format("Env ~p ~n", [Env]), --------- Is this a debugging leftover??? I don't see any way to get rid of this other than to patch mod_esi. :-( Serge From esbjorn@REDACTED Thu Sep 15 19:51:35 2005 From: esbjorn@REDACTED (=?ISO-8859-1?Q?Esbj=F6rn_K=F6hler?=) Date: Thu, 15 Sep 2005 19:51:35 +0200 Subject: blowfish support in crypto? Message-ID: <20050915195135.32f3785a@localhost> I'm looking for a Blowfish cipher library for erlang, but the Crypto application does not seem to support Blowfish. Since Crypto is based on OpenSSL and OpenSSL has Blowfish - why is there no Blowfish in Crypto? Has anyone seen Blowfish implemented in erlang? Esbj?rn K?hler From danie@REDACTED Thu Sep 15 20:31:54 2005 From: danie@REDACTED (Daniel Schutte) Date: Thu, 15 Sep 2005 20:31:54 +0200 Subject: blowfish support in crypto? In-Reply-To: <20050915195135.32f3785a@localhost> References: <20050915195135.32f3785a@localhost> Message-ID: <200509152031.54620.danie@erlfinsys.net> Crypto does not in the default installation support blowfish, but you can add it since the source is there. We added standard DES previously and then just run make again. It is a small change to the c code and a small change to the erlang code. I just think that no-one ever needed it - that's why it wasn't added to the default installation. On Thursday 15 September 2005 19:51, Esbj?rn K?hler wrote: > I'm looking for a Blowfish cipher library for erlang, but the Crypto > application does not seem to support Blowfish. Since Crypto is based on > OpenSSL and OpenSSL has Blowfish - why is there no Blowfish in Crypto? > > Has anyone seen Blowfish implemented in erlang? > > Esbj?rn K?hler -- Daniel H Schutte Mobile: +27 84 468 3138 Office: +27 11 675 2643 The more laws and order are made prominent, the more thieves and robbers there will be. -- Lao Tsu From ulf.wiger@REDACTED Fri Sep 16 08:51:47 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 16 Sep 2005 08:51:47 +0200 Subject: edoc - how to set up links? Message-ID: Richard Carlsson wrote: > Perhaps you can't call it a "procedure", but you can easily generate > the docs for an application, like this: > > Eshell V5.5 (abort with ^G) > 1> edoc:application(kernel). > 2> edoc:application(stdlib). > 3> ... > > (Then have a look in lib//doc/.) I would very much prefer that the links point to the existing HTML docs, as regards OTP. /Uffe From ulf.wiger@REDACTED Fri Sep 16 09:16:59 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 16 Sep 2005 09:16:59 +0200 Subject: edoc - how to set up links? Message-ID: Since I've gotten started: edoc_doclet.hrl is not included in the commercial build of OTP (there is no include directory under edoc at all), and edoc.hrl contains the line -include("../include/edoc_doclet.hrl"). It would be better just to name the hrl, without specifying that it should be in a particular place. The file edoc_doclet.hrl does exist in the OTP R10B-6 Open Source tree. But there, I also found xmerl.hrl under the edoc/include/ directory. It's identical to the one found under xmerl/include/. /Uffe From ingela@REDACTED Fri Sep 16 09:38:01 2005 From: ingela@REDACTED (Ingela Anderton) Date: Fri, 16 Sep 2005 09:38:01 +0200 Subject: R10B-7 inets issue References: <4329AA47.3080300@hq.idt.net> Message-ID: <17194.30297.519108.656170@gargle.gargle.HOWL> Serge Aleynikov wrote: > OTP team: > > I installed R10B-7 release on Linux and while running inets httpd the > following printout shows in the terminal window every time an http > client is making a request to a dynamic web page (using mod_esi). This > hasn't being seen in the prior OTP releases: > > 1> Env [{server_software,"inets/4.5.3"}, > {server_name,"devlinuxpro"}, > {gateway_interface,"CGI/1.1"}, > {server_protocol,"HTTP/1.1"}, > {server_port,8080}, > {request_method,"GET"}, > {remote_addr,"10.206.200.65"}, > {script_name,"/cgi-bin/erl/server_mgr/http_get_state"}, > {http_host,"devlinuxpro.mis.idt.net:8080"}, > {http_user_agent,"Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; > rv:1.7.5) Gecko/20050603 Netscape/8.0.2"}, [...] > generate_webpage(ModData, ESIBody, Modules, ModuleName, FunctionName, > Input, ScriptElements) -> > ... > io:format("Env ~p ~n", [Env]), > > --------- > > Is this a debugging leftover??? I don't see any way to get rid of this > other than to patch mod_esi. :-( I am afraid you are right this is a debugg leftover. It has been removed in the latest version of the code. Trace is our preferred debugging method but sometimes a plain io:format comes in handy. I am sorry that it was able to make it into the open source release. -- /m.v.h Ingela - OTP team From jmoran@REDACTED Fri Sep 16 10:42:39 2005 From: jmoran@REDACTED (Fco. Javier =?ISO-8859-1?Q?Mor=E1n_R=FAa?=) Date: Fri, 16 Sep 2005 10:42:39 +0200 Subject: SERVAL: a new free sofware project developed in Erlang Message-ID: <1126860159.2918.14.camel@tournedix.vigo.igalia.com> Hello, I write this mail to present to the Erlang community a new project which is being developed in Erlang. Its name is SERVAL and Igalia, the company which initiated it and main sponsor of the project, already talked about it in the Erlang/OTP User Conference 2004 - http://www.erlang.se/euc/04/ -. SERVAL is an R+D project whose aim is to assess the feasibility of a system to create VLANs using a software server through Internet. It is a free software project licensed with GPL whose project page is http://serval.igalia.com . You can visit this page and there you will find all related information about the project: documentation, the instructions to download the CVS repository, the releases published in tgz, how to install SERVAL. At the moment, there is a first functional prototype which can be installed following the instructions in http://community.igalia.com/twiki/bin/view/Serval/UserDocumentation. So, I would like to encourage you to download SERVAL and test it. We have also a SERVAL list at Sourceforge.net - https://sourceforge.net/mail/?group_id=121962 -and you can subscribe to it.We would be pleased to know through this list if you have had troubles installing it, what features you would like to incorporate to the project, if you are interested in collaborating somehow with SERVAL or another issue you want to comment us. -- Fco. Javier Mor?n R?a IGALIA S.L. From richardc@REDACTED Fri Sep 16 10:54:44 2005 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 16 Sep 2005 10:54:44 +0200 Subject: edoc - how to set up links? In-Reply-To: References: Message-ID: <432A8854.2000106@csd.uu.se> Ulf Wiger (AL/EAB) wrote: > Richard Carlsson wrote: >> 1> edoc:application(kernel). >> 2> edoc:application(stdlib). >> 3> ... >> >>(Then have a look in lib//doc/.) > > I would very much prefer that the links point to > the existing HTML docs, as regards OTP. Me too, but the mapping is not so simple. E.g., the current URL for the lists:zip/2 function is: http://erlang.se/doc/doc-5.4.8/lib/stdlib-1.13.8/doc/html/lists.html#zip/2 Maybe OTP can be persuaded to set up some links in the tree, so that at least http://erlang.se/doc/doc/lib/stdlib/doc/html/lists.html#zip/2 always works regardless of the current version? (By the way, I'm not sure it's a great idea to use / in the last fragment.) /Richard From ulf.wiger@REDACTED Fri Sep 16 11:18:50 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 16 Sep 2005 11:18:50 +0200 Subject: SERVAL: a new free sofware project developed in Erlang Message-ID: Do you comply fully with 802.1Q and 801D? Specifically, how do you stand in relation to GVRP? /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Fco. Javier" > Mor?n R?a > Sent: den 16 september 2005 10:43 > To: erlang-questions@REDACTED > Subject: SERVAL: a new free sofware project developed in Erlang > > > Hello, > > I write this mail to present to the Erlang community a new > project which is being developed in Erlang. Its name is SERVAL and > Igalia, the company which initiated it and main sponsor of > the project, > already talked about it in the Erlang/OTP User Conference 2004 - > http://www.erlang.se/euc/04/ -. > > SERVAL is an R+D project whose aim is to assess the > feasibility of a > system to create VLANs using a software server through > Internet. It is a > free software project licensed with GPL whose project page is > http://serval.igalia.com . You can visit this page and there you will > find all related information about the project: documentation, the > instructions to download the CVS repository, the releases published in > tgz, how to install SERVAL. > > At the moment, there is a first functional prototype which can > be installed following the instructions in > http://community.igalia.com/twiki/bin/view/Serval/UserDocument ation. So, I would like to encourage you to download SERVAL and test it. We have also a SERVAL list at Sourceforge.net - https://sourceforge.net/mail/?group_id=121962 -and you can subscribe to it.We would be pleased to know through this list if you have had troubles installing it, what features you would like to incorporate to the project, if you are interested in collaborating somehow with SERVAL or another issue you want to comment us. -- Fco. Javier Mor?n R?a IGALIA S.L. From ulf.wiger@REDACTED Fri Sep 16 11:20:40 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 16 Sep 2005 11:20:40 +0200 Subject: edoc - how to set up links? Message-ID: Richard Carlsson wrote: > > http://erlang.se/doc/doc-5.4.8/lib/stdlib-1.13.8/doc/html/list s.html#zip/2 Maybe OTP can be persuaded to set up some links in the tree, so that at least http://erlang.se/doc/doc/lib/stdlib/doc/html/lists.html#zip/2 always works regardless of the current version? I think we would like version-specific links. /Uffe From ulf.wiger@REDACTED Fri Sep 16 11:25:36 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 16 Sep 2005 11:25:36 +0200 Subject: dialyzer and non-proper lists Message-ID: It's been argued that non-proper lists can always be avoided at minimal expense. How about this example: 20> [ets:insert(T, {"foo-" ++ integer_to_list(N)}) || N <- lists:seq(1,10)]. [true,true,true,true,true,true,true,true,true,true] 21> ets:select(T, [{{"foo" ++ '_'},[],['$_']}]). [{"foo-6"}, {"foo-7"}, {"foo-3"}, {"foo-8"}, {"foo-2"}, {"foo-9"}, {"foo-10"}, {"foo-5"}, {"foo-4"}, {"foo-1"}] Never mind the ++. It expands before the select() call into [$f, $o, $o | '_'], which is still a non-proper list, and the way you're supposed to do it in ets:match() and ets:select() /Uffe From vlad_dumitrescu@REDACTED Fri Sep 16 11:56:04 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 16 Sep 2005 11:56:04 +0200 Subject: dialyzer and non-proper lists References: Message-ID: It would be cool if patterns could be regular data structures too, so that one could have [$f, $o, $o | _] or [H | T] as proper Erlang terms. Maybe even some confusing syntax could also appear: "foo"_ instead of "foo" ++ _ regards, Vlad ----- Original Message ----- From: "Ulf Wiger (AL/EAB)" To: Sent: Friday, September 16, 2005 11:25 AM Subject: dialyzer and non-proper lists > > It's been argued that non-proper lists can always be > avoided at minimal expense. > > How about this example: > > 20> [ets:insert(T, {"foo-" ++ integer_to_list(N)}) || N <- lists:seq(1,10)]. > [true,true,true,true,true,true,true,true,true,true] > 21> ets:select(T, [{{"foo" ++ '_'},[],['$_']}]). > [{"foo-6"}, > {"foo-7"}, > {"foo-3"}, > {"foo-8"}, > {"foo-2"}, > {"foo-9"}, > {"foo-10"}, > {"foo-5"}, > {"foo-4"}, > {"foo-1"}] > > > Never mind the ++. It expands before the select() call into > [$f, $o, $o | '_'], which is still a non-proper list, and the way > you're supposed to do it in ets:match() and ets:select() > > /Uffe > From ulf.wiger@REDACTED Fri Sep 16 11:58:37 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 16 Sep 2005 11:58:37 +0200 Subject: edoc - how to set up links? Message-ID: I've attached a diff for edoc_lib.erl that at least finds the OTP documentation using the code path. Don't know what to do about the / in the relative part, though. It should be backward compatible. I added the option 'ref_any_html' (default 'false'). I'm not particularly proud of the name. It finds the OTP html pages, but doesn't jump to the right function. /Uffe > -----Original Message----- > From: Richard Carlsson [mailto:richardc@REDACTED] > Sent: den 16 september 2005 10:55 > To: Ulf Wiger (AL/EAB) > Cc: Bj?rn Gustavsson; erlang-questions@REDACTED > Subject: Re: edoc - how to set up links? > > > Ulf Wiger (AL/EAB) wrote: > > Richard Carlsson wrote: > >> 1> edoc:application(kernel). > >> 2> edoc:application(stdlib). > >> 3> ... > >> > >>(Then have a look in lib//doc/.) > > > > I would very much prefer that the links point to > > the existing HTML docs, as regards OTP. > > Me too, but the mapping is not so simple. E.g., the current URL for > the lists:zip/2 function is: > > http://erlang.se/doc/doc-5.4.8/lib/stdlib-1.13.8/doc/html/list s.html#zip/2 Maybe OTP can be persuaded to set up some links in the tree, so that at least http://erlang.se/doc/doc/lib/stdlib/doc/html/lists.html#zip/2 always works regardless of the current version? (By the way, I'm not sure it's a great idea to use / in the last fragment.) /Richard -------------- next part -------------- A non-text attachment was scrubbed... Name: edoc_lib.erl.diff Type: application/octet-stream Size: 4888 bytes Desc: edoc_lib.erl.diff URL: From jozsef.berces@REDACTED Fri Sep 16 13:16:34 2005 From: jozsef.berces@REDACTED (=?iso-8859-1?Q?J=F3zsef_B=E9rces_=28LA/ETH=29?=) Date: Fri, 16 Sep 2005 13:16:34 +0200 Subject: replacing one function Message-ID: Hi, I would like to extend the function of mod_esi supplied with the OTP releases. The module is changing in almost each release but the function I should modify stays the same. So what I need is to replace that particular function but use the rest from the original beam file, so that my code could be independent of the OTP release. Is there a way to do that? Thanks in advance, Jozsef From kostis@REDACTED Fri Sep 16 13:26:20 2005 From: kostis@REDACTED (Kostis Sagonas) Date: Fri, 16 Sep 2005 13:26:20 +0200 (MEST) Subject: dialyzer and non-proper lists In-Reply-To: Mail from '"Ulf Wiger (AL/EAB)" ' dated: Fri, 16 Sep 2005 11:25:36 +0200 Message-ID: <200509161126.j8GBQKgW011661@spikklubban.it.uu.se> Ulf Wiger wrote: > > It's been argued that non-proper lists can always be > avoided at minimal expense. > > How about this example: > > ... > 21> ets:select(T, [{{"foo" ++ '_'},[],['$_']}]). > ... > > Never mind the ++. It expands before the select() call into > [$f, $o, $o | '_'], which is still a non-proper list, and the way > you're supposed to do it in ets:match() and ets:select() >From the little I understand this example, apologies if I have totally misunderstood this, I would say that this has nothing to do with improper lists, but with (arguably brain-damaged design decisions) to: 1. Have match specifications described as lists, and 2. Being unable to have general selectors such as lists:prefix("foo", '$1') in the guard list (i.e., in the [] in Ulf's example above), which arguably are more natural. Btw, is there any really good reason why the so called GuardList has to be restricted to Erlang guards? Kostis From ulf.wiger@REDACTED Fri Sep 16 13:36:35 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 16 Sep 2005 13:36:35 +0200 Subject: dialyzer and non-proper lists Message-ID: Kostis Sagonas wrote: > Btw, is there any really good reason why > the so called GuardList has to be restricted to > Erlang guards? Yes, I guess a very good reason is that the match specification is interpreted in the emulator (e.g. ets or when determining whether to send a trace message), and not in any process context. I believe this is the reason why one didn't just call a user-supplied fun. (: Of course, in the case of trace patterns, one really doesn't want erlang functions to be called in the process of determining whether to send a call trace message. There are good reasons to use the Prefix ++ '_' pattern, esp. if the table is an ordered_set, since that ought to give good performance even when matching on the key. The current implementation of select() (as I wrote in a very recent mail) will always do a full linear search for patterns such as (the hypothetical) [{{'$1','$2'}, [{is_prefix, "foo", '$1'}], [{{'$1','$2'}}]}] But while someone is hacking away in the emulator code, introducing this optimization should be short work. (: /Uffe From jmoran@REDACTED Fri Sep 16 14:23:52 2005 From: jmoran@REDACTED (Fco. Javier =?ISO-8859-1?Q?Mor=E1n_R=FAa?=) Date: Fri, 16 Sep 2005 14:23:52 +0200 Subject: SERVAL: a new free sofware project developed in Erlang In-Reply-To: References: Message-ID: <1126873432.2918.112.camel@tournedix.vigo.igalia.com> El vie, 16-09-2005 a las 11:18 +0200, Ulf Wiger (AL/EAB) escribi?: > Do you comply fully with 802.1Q and 801D? > Specifically, how do you stand in relation > to GVRP? > With regard to your question, at the moment SERVAL is not able to operate with physical switches using these protocols. However, in the project we have already thought of this question before and we believe it is a very interesting thing to do in the future. Besides, I would like to point out that although SERVAL it is not able to talk to another switches by now, the user can do a lot of VLANs management operations in the virtual switch. This is done in the following way: To access to the virtual switch, the user has to run a client program - SERVAL client - in his computer. On connecting to the switch this application creates an virtual ethernet network interface and assigns to it a MAC delivered by the server. Then, using a shell utility, the user can request several operations to the server: (*) It can create an VLAN. (*) It can join to an existing VLAN. (*) It can request the list of VLANs existing in the switch, (*) ... These requests are encoded in ASN.1 and sent to the server using an own communications protocol. This is the explanation of how SERVAL is able to work with VLANS without using the link layer management protocols you mention, 802.1Q, 802.1D, GVRP ... Finally, I would like to say that although SERVAL does not talk to hardware switches by now, there are a lot of interesting applications we can do with SERVAL: (*) Company networks for employees being in external locations. Employees which are at homes, working outside company offices, in a hotel ... might connect to the SERVAL company switch and access to the intranet of the firm. (*) A telecommunication company could offer to its clients a SERVAL switch to connect. So, clients at home migth connect to its ISP SERVAL switch and create VLANs to share files with another users, to play to network games, etc .. -- Fco. Javier Mor?n R?a IGALIA S.L. From ulf.wiger@REDACTED Fri Sep 16 14:09:16 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 16 Sep 2005 14:09:16 +0200 Subject: edoc - how to set up links? Message-ID: The attached escript (slowly) transforms the OTP documentation: for each , it inserts an immediately afterwards. ./fix_otp_doc $OTP_ROOT This, in combination with my other patch, seems to produce links that point accurately into existing OTP docs. /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Ulf Wiger > (AL/EAB) > Sent: den 16 september 2005 11:59 > To: Richard Carlsson > Cc: Bj?rn Gustavsson; erlang-questions@REDACTED > Subject: RE: edoc - how to set up links? > > > > I've attached a diff for edoc_lib.erl that at > least finds the OTP documentation using the > code path. Don't know what to do about the / > in the relative part, though. > > It should be backward compatible. I added the > option 'ref_any_html' (default 'false'). > I'm not particularly proud of the name. > It finds the OTP html pages, but doesn't jump > to the right function. > > /Uffe > > > -----Original Message----- > > From: Richard Carlsson [mailto:richardc@REDACTED] > > Sent: den 16 september 2005 10:55 > > To: Ulf Wiger (AL/EAB) > > Cc: Bj?rn Gustavsson; erlang-questions@REDACTED > > Subject: Re: edoc - how to set up links? > > > > > > Ulf Wiger (AL/EAB) wrote: > > > Richard Carlsson wrote: > > >> 1> edoc:application(kernel). > > >> 2> edoc:application(stdlib). > > >> 3> ... > > >> > > >>(Then have a look in lib//doc/.) > > > > > > I would very much prefer that the links point to > > > the existing HTML docs, as regards OTP. > > > > Me too, but the mapping is not so simple. E.g., the current URL for > > the lists:zip/2 function is: > > > > http://erlang.se/doc/doc-5.4.8/lib/stdlib-1.13.8/doc/html/list > s.html#zip/2 > > Maybe OTP can be persuaded to set up some links in the tree, > so that at > least > http://erlang.se/doc/doc/lib/stdlib/doc/html/lists.html#zip/2 always > works regardless of the current version? > > (By the way, I'm not sure it's a great idea to use / in the > last fragment.) > > /Richard > -------------- next part -------------- A non-text attachment was scrubbed... Name: fix_otp_doc Type: application/octet-stream Size: 1507 bytes Desc: fix_otp_doc URL: From ingela@REDACTED Fri Sep 16 15:26:49 2005 From: ingela@REDACTED (Ingela Anderton) Date: Fri, 16 Sep 2005 15:26:49 +0200 Subject: replacing one function References: Message-ID: <17194.51225.793298.600994@gargle.gargle.HOWL> J?zsef B?rces (LA/ETH) wrote: > Hi, > > I would like to extend the function of mod_esi supplied with the OTP > releases. The module is changing in almost each release but the > function I should modify stays the same. So what I need is to > replace that particular function but use the rest from the original > beam file, so that my code could be independent of the OTP > release. Is there a way to do that? Which function would that be? And how do you want to change it? If it is something of general interest, maybe we could add it. (No promises). If I understand what you would like to do, answering your original question will be easier. To try to make a long story short: The HTTP-Server in inets was written a long time ago by people no longer working for OTP. Even though documentation was written for it, I personally think there is room for quite a lot of improvement in that area. Also lately there has been new people using it and some new features added which has revealed some slumbering problems and resulted in quite a lot of code restructuring. This to enable better test coverage and too avoid some code duplication and strange dependences that made the life a living hell for any one trying to maintain the code. -- /Ingela - OTP team From mats.cronqvist@REDACTED Fri Sep 16 16:21:41 2005 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Fri, 16 Sep 2005 16:21:41 +0200 Subject: record field names Message-ID: <432AD4F5.4060509@ericsson.com> feels like this is an faq, but i can't find it in the archive. according to the reference manual: "To each module using records, a pseudo function is added during compilation to obtain information about records: record_info(fields, Record) -> [Field] record_info(size, Record) -> Size" now, as i understand it, there is no function, just textual substitution (like a macro). but why not? if there was a real, exported function record_info/2 (just like module_info), one could do a lot of cool things. such as turning a record into a tagged tuple; readable_rec(Module,Rec) -> lists:zip(Module:record_info(fields,element(1,Rec)),tl(tuple_to_list(Rec))). or write a tool to check that all modules using a certain record agree on its definition. mats From ulf.wiger@REDACTED Fri Sep 16 16:33:18 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 16 Sep 2005 16:33:18 +0200 Subject: record field names Message-ID: In order to eliminate name clashes, why not Module:module_info({record, Rec, fields}) /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Mats Cronqvist > Sent: den 16 september 2005 16:22 > To: erlang-questions@REDACTED > Subject: record field names > > > feels like this is an faq, but i can't find it in the archive. > > according to the reference manual: > "To each module using records, a pseudo function is added > during compilation > to obtain information about records: > record_info(fields, Record) -> [Field] > record_info(size, Record) -> Size" > > now, as i understand it, there is no function, just > textual substitution > (like a macro). > > but why not? if there was a real, exported function > record_info/2 (just like > module_info), one could do a lot of cool things. > > such as turning a record into a tagged tuple; > > readable_rec(Module,Rec) -> > > lists:zip(Module:record_info(fields,element(1,Rec)),tl(tuple_t > o_list(Rec))). > > or write a tool to check that all modules using a certain > record agree on its > definition. > > mats > From rprice@REDACTED Fri Sep 16 16:47:45 2005 From: rprice@REDACTED (Roger Price) Date: Fri, 16 Sep 2005 16:47:45 +0200 (CEST) Subject: Module attributes Message-ID: I'm trying to understand the possibilities offered by module attributes. My source file "test.erl" contains just the two lines: -module (test) . -bad_binary(<<10,20>>) . I'm using Erlang (BEAM) emulator version 5.4.6 [source] [hipe], and the compiler crashes as follows: rprice@REDACTED:~> erlc test.erl test.erl:none: internal error in core_module; crash reason: {function_clause,[{core_lib,make_literal,[<<10,20>>]}, {core_lib,make_literal,1}, {v3_core,attribute,1}, {v3_core,form,2}, {v3_core,module,2}, {compile,core_module,1}, {compile,'-internal_comp/4-anonymous-1-',2}, {compile,fold_comp,3}]} In the Erlang Reference Manual 5.4.6: Clause 4.2 Module Attributes, says that a module attribute consists of a tag and a value. -Tag(Term) Clause 2.1 Terms, says "Erlang provides a number of data types which are listed in this chapter. A piece of data of any data type is called a term." Clause 2.4 Binary, says that <<10,20>> is a binary and therefore a term. Clause 2.6 Fun says a fun is a functional object. I conclude that a fun is a term, but if I write -add_one (fun (X) -> X+1 end) . I get the error message "test.erl:5: bad attribute". Shouldn't clause 4.2 say that a Module Attribute is -Tag(BasicTerm) where BasicTerm is an integer, real number, atom or string? Roger From james.hague@REDACTED Fri Sep 16 16:59:55 2005 From: james.hague@REDACTED (James Hague) Date: Fri, 16 Sep 2005 09:59:55 -0500 Subject: werl.exe window saving/restoring Message-ID: This was super-useful, but was disabled a few versions back because it didn't properly handle the case when the werl.exe window was minimized when you quit. Is it still disabled? In any case, the proper fix is to use GetWindowPlacement and SetWindowPlacement instead of other calls to get the window position and size. Save the WINDOWPLACEMENT struct directly in the registry in binary format. This automatically takes care of saving all window information, including whether a window is minimized/maximized or not. I'd make this change myself, except I'm not set-up with Cygwin on any of my current machines and don't have the time to do so in the near future. James From mats.cronqvist@REDACTED Fri Sep 16 17:04:37 2005 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Fri, 16 Sep 2005 17:04:37 +0200 Subject: record field names In-Reply-To: References: Message-ID: <432ADF05.60001@ericsson.com> name clashes? surely you can't have a real record_info/2 function? mats Ulf Wiger (AL/EAB) wrote: > In order to eliminate name clashes, why not > > Module:module_info({record, Rec, fields}) > > /Uffe > > >>-----Original Message----- >>From: owner-erlang-questions@REDACTED >>[mailto:owner-erlang-questions@REDACTED]On Behalf Of Mats Cronqvist >>Sent: den 16 september 2005 16:22 >>To: erlang-questions@REDACTED >>Subject: record field names >> >> >> feels like this is an faq, but i can't find it in the archive. >> >> according to the reference manual: >> "To each module using records, a pseudo function is added >>during compilation >>to obtain information about records: >>record_info(fields, Record) -> [Field] >>record_info(size, Record) -> Size" >> >> now, as i understand it, there is no function, just >>textual substitution >>(like a macro). >> >> but why not? if there was a real, exported function >>record_info/2 (just like >>module_info), one could do a lot of cool things. >> >> such as turning a record into a tagged tuple; >> >>readable_rec(Module,Rec) -> >> >>lists:zip(Module:record_info(fields,element(1,Rec)),tl(tuple_t >>o_list(Rec))). >> >> or write a tool to check that all modules using a certain >>record agree on its >>definition. >> >> mats >> From thomasl_erlang@REDACTED Fri Sep 16 17:33:07 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 16 Sep 2005 08:33:07 -0700 (PDT) Subject: record field names In-Reply-To: <432AD4F5.4060509@ericsson.com> Message-ID: <20050916153307.79687.qmail@web34411.mail.mud.yahoo.com> --- Mats Cronqvist wrote: > if there was a real, exported > function record_info/2 (just like > module_info), one could do a lot of cool things. > > such as turning a record into a tagged tuple; > The definition of records already basically requires a record to be just a tagged tuple (e.g., the #rec.field notation in Section 8.3 of the Erlang reference manual, or the Section 8.7 that you quote). More so if you want to be backwards compatible: "It is often desirable to write generic functions which will work on any record, not just a record of a particular type. For this reason, records are represented internally as tuples and the ordering of the fields in the tuple is strictly defined." -- the "Erlang Extensions since 4.4" documentation of R7, section 1.9 (http://erlang.se/doc/doc-5.0.2/doc/extensions/part_frame.html) I have accordingly encountered code that builds tuples, then uses them as if they were records (e.g., I think the R7 version of the asn1 compiler generated such tuples). And in the other direction, records matched against tuple patterns. In the R9 documentation, there is an example that goes like this: "The new module must translate the old state into the new state. Recall that a record is just syntactic sugar for a tuple: -module(gs1). -vsn(2). -behaviour(gen_server). -export([get_data/0, get_time/0]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). %% [old definition was -record(state, {data}). -record(state, {data, time}). ... code_change(1, {state, Data}, _Extra) -> {ok, #state{data = Data, time = erlang:time()}}. " -- from http://erlang.se/doc/doc-5.3/doc/design_principles/part_frame.html section 11.7.1.4, "advanced gen_server" (Which in its defense is less convoluted than trying to do the same with two definitions of #state.) (Personally, I'd prefer records as a sensible first-class datatype instead of tagged tuples. But it seems difficult to introduce that while remaining backwards compatible.) Best, Thomas __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com From ulf.wiger@REDACTED Fri Sep 16 17:34:20 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 16 Sep 2005 17:34:20 +0200 Subject: record field names Message-ID: Mats Cronqvist wrote: > name clashes? > surely you can't have a real record_info/2 function? > > mats You can bet that someone does. (: Well... perhaps that would be exceedingly unlikely. I'll grant you that. /Uffe From surindar.shanthi@REDACTED Sat Sep 17 14:57:54 2005 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Sat, 17 Sep 2005 18:27:54 +0530 Subject: OTP Message-ID: <42ea5fb605091705575c646481@mail.gmail.com> In Erlang/OTP, what is meant by OTP. Please reply soon -------------- next part -------------- An HTML attachment was scrubbed... URL: From danie@REDACTED Sat Sep 17 15:45:01 2005 From: danie@REDACTED (Daniel Schutte) Date: Sat, 17 Sep 2005 15:45:01 +0200 Subject: OTP In-Reply-To: <42ea5fb605091705575c646481@mail.gmail.com> References: <42ea5fb605091705575c646481@mail.gmail.com> Message-ID: <200509171545.02677.danie@erlfinsys.net> Open Telecoms Platform or rather Open Transaction Platform FAQ: OTP is a large collection of libraries for Erlang to do everything from compiling ASN.1 to providing a WWW server. Most projects using "Erlang" are actually using "Erlang/OTP", i.e. the language and the libraries. OTP is also open source. On Saturday 17 September 2005 14:57, Surindar Sivanesan wrote: > In Erlang/OTP, > what is meant by OTP. > Please reply soon -- Daniel H Schutte Mobile: +27 84 468 3138 Office: +27 11 675 2643 The more laws and order are made prominent, the more thieves and robbers there will be. -- Lao Tsu From orbitz@REDACTED Sat Sep 17 17:36:50 2005 From: orbitz@REDACTED (orbitz@REDACTED) Date: Sat, 17 Sep 2005 11:36:50 -0400 Subject: Erlang Type System Message-ID: <9841c5b11aa4b2aea98c2e4d62901cdc@ezabel.com> I was hoping someone could clear up some confusion. As I understand it, with a dynamically typed language you can change the type of x. For instance in Python x = 1; x = 1.5; Obviously we can't do that in Erlang. So is that a proper idea of what dynamic typing is, and does this make Erlang statically typed or dynamically? Most people tell me Erlang is still dynamically typed because the variable passed in a function can be of any type. Thanks http://orbitz-erlang.blogspot.com/ From JMBALADO@REDACTED Sat Sep 17 19:06:35 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Sat, 17 Sep 2005 19:06:35 +0200 Subject: newbie question about fun expressions Message-ID: <200509171906.36041.JMBALADO@terra.es> Hi, I have a question: In "Erlang reference manual" 6.17 Fun Expressions is says that the following fun expressions are also allowed: fun Name/Arity fun Module:Name/Arity So I tried "fun Name/Arity" like this: 46> lists:map(fun is_atom/1,[peter,1]). [true,false] 47> But "fun Module:Name/Arity" seems that does not work: 47> lists:map(fun lists:reverse/1,[peter,1]). ** 1: syntax error before: ':' ** 47> What am I doing wrong? Thanks. Best regards, Jose From hakan.stenholm@REDACTED Sat Sep 17 19:47:45 2005 From: hakan.stenholm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Stenholm?=) Date: Sat, 17 Sep 2005 19:47:45 +0200 Subject: newbie question about fun expressions In-Reply-To: <200509171906.36041.JMBALADO@terra.es> References: <200509171906.36041.JMBALADO@terra.es> Message-ID: <432C56C1.1060807@mbox304.swipnet.se> Jose Balado wrote: >Hi, I have a question: > >In "Erlang reference manual" 6.17 Fun Expressions is says that the following >fun expressions are also allowed: > >fun Name/Arity >fun Module:Name/Arity > > So I tried "fun Name/Arity" like this: > >46> lists:map(fun is_atom/1,[peter,1]). >[true,false] >47> > >But "fun Module:Name/Arity" seems that does not work: > >47> lists:map(fun lists:reverse/1,[peter,1]). >** 1: syntax error before: ':' ** >47> > > What am I doing wrong? > > You should ensure that your using a recent version of Erlang/OTP as the "fun Module:Name/Arity" syntax is fairly recent. My code has been tested in Erlang/OTP R10B-6. 1) is_atom/1 in source code test.erl ================ module(test). -export([test/0]). test() -> lists:map(fun is_atom/1,[peter,1]). %% 'is_atom/1' and 'erlang:is_atom/1' both work ================ erlang shell ================ 2> test:test(). [true,false] This works as functions in the module 'erlang' don't require to be called as 'erlang:function(...)', the erlang shell which sometimes works slightly different from regular code, doesn't appear to be able to figure out where to look for is_atom/1 if the module isn't supplied, as can be seen below: 2) call in erlang shell, using Function/Arity syntax 2> lists:map(fun is_atom/1,[peter,1]). =ERROR REPORT==== 17-Sep-2005::19:13:03 === Error in process <0.30.0> with exit value: {undef,[{erl_eval,is_atom,1},{erl_eval,expr,3}]} ** exited: {undef,[{erl_eval,is_atom,1},{erl_eval,expr,3}]} ** the function is_atom/1 is not found in erl_eval (the "module" of the shell), i.e. it's 'undefined', when erl_eval tries to process 'lists:map(fun is_atom/1,[peter,1]).'. 3) call in erlang shell, using Module:Function/Arity syntax works as expected 3> lists:map(fun erlang:is_atom/1,[peter,1]). [true,false] >Thanks. > >Best regards, >Jose > > > > > > From ulf@REDACTED Sat Sep 17 20:30:58 2005 From: ulf@REDACTED (Ulf Wiger) Date: Sat, 17 Sep 2005 20:30:58 +0200 Subject: Erlang Type System In-Reply-To: <9841c5b11aa4b2aea98c2e4d62901cdc@ezabel.com> References: <9841c5b11aa4b2aea98c2e4d62901cdc@ezabel.com> Message-ID: Den 2005-09-17 17:36:50 skrev : > I was hoping someone could clear up some confusion. As I understand it, > with a dynamically typed language you can change the type of x. For > instance in Python x = 1; x = 1.5; Obviously we can't do that in Erlang. Dynamically typed rather means that the type of an object is determined at runtime, instead of at compile time. For example, the compiler will not have any complaints about this code: foo() -> X = {a,b,c}, [H|T] = X. but if you run it, it will cause a run-time error, since the head-tail pattern cannot be used on a tuple. In a statically typed language, this program wouldn't compile. (Now, the compiler could very well complain about this, and perhaps hipe actually does. I know dialyzer would, but it would still be a warning, since it's a valid program in a statically typed language.) > So is that a proper idea of what dynamic typing is, and > does this make Erlang statically typed or dynamically? I think the term you're after is "single assignment", which means that variables can only be bound once. This really doesn't have anything to do with static vs dynamic typing. Most functional languages use single assignment at the core (I believe that with Haskell MVars, for example, you can have global mutable variables.) There is another expression, "strongly typed", which means that the type system cannot be subverted. For example, the above program might work if the language allowed a tuple to be treated as a list when needed. But this is not done in Erlang. Instead, you must explicitly convert from one type to another (e.g. [H|T] = tuple_to_list(X)) Compare this to C, for example, which allows you to re-cast a variable as something else, doing integer arithmetic on pointers, etc. > Most people tell me Erlang is still dynamically typed > because the variable passed in a function can be of any > type. Yes, but whether the function accepts the argument passed is up to the program, and is determined at run-time. This is exactly what dynamic typing is about. While my example was a program that compiles but doesn't work, one can write programs in a dynamically typed language that would be nearly impossible, or at least very difficult, to type in a statically typed language ... unless you resort to giving everything the any() type, of course, but that kind of defeats the purpose of static type checking. /Uffe -- Ulf Wiger From JMBALADO@REDACTED Sun Sep 18 01:21:52 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Sun, 18 Sep 2005 01:21:52 +0200 Subject: newbie question about fun expressions In-Reply-To: <432C56C1.1060807@mbox304.swipnet.se> References: <200509171906.36041.JMBALADO@terra.es> <432C56C1.1060807@mbox304.swipnet.se> Message-ID: <200509180121.53997.JMBALADO@terra.es> Thank you very much for your quick answer H?kan. > You should ensure that your using a recent version of Erlang/OTP as the > "fun Module:Name/Arity" syntax is fairly recent. My code has been tested > in Erlang/OTP R10B-6. Don't know the version because it is what I got with kubuntu typing "apt-get install erlang" but I think it is from november 2004. The command "apt-cache show erlang" says: Package: erlang Priority: optional Section: universe/interpreters Installed-Size: 64156 Maintainer: Brent A. Fulgham Architecture: all Version: 1:10.b.1a-2 Replaces: erlang-base (<< 1:10.b.1a-2) Depends: debianutils (>= 1.13.1), erlang-base (= 1:10.b.1a-2), tk8.4 Pre-Depends: dpkg (>= 1.4.1.17) Suggests: erlang-manpages (= 1:10.b.1a), erlang-doc-html (= 1:10.b.1a) Filename: pool/universe/e/erlang/erlang_10.b.1a-2_all.deb ... The new ubuntu ditribution "breezy" seems to have a new erlang package erlang-base (1:10.b.5-1), I hope this to be more up to date. Best regards, Jose -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Sun Sep 18 11:54:54 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Sun, 18 Sep 2005 02:54:54 -0700 (PDT) Subject: Erlang Type System In-Reply-To: <9841c5b11aa4b2aea98c2e4d62901cdc@ezabel.com> Message-ID: <20050918095454.6557.qmail@web34401.mail.mud.yahoo.com> --- orbitz@REDACTED wrote: > I was hoping someone could clear up some confusion. > As I understand > it, with a dynamically typed language you can change > the type of x. > For instance in Python x = 1; x = 1.5; Obviously we > can't do that in > Erlang. So is that a proper idea of what dynamic > typing is, and does > this make Erlang statically typed or dynamically? > Most people tell me > Erlang is still dynamically typed because the > variable passed in a > function can be of any type. Dynamic typing usually means that the system checks type correctness dynamically, at runtime, rather than statically, at compile time. In languages like Erlang, Lisp, Prolog, Smalltalk, ... all values/objects/terms have an associated type, which can be inspected at runtime. As an example, the Erlang VM thus checks that the inputs to "+" are numbers when the call to + occurs, and performs the appropriate sort of addition (integer add, bignum add, float add, conversion if needed). In the same vein, Smalltalk dynamically looks up the code for a method name when a send occurs; and so on. (If the types are wrong, an exception is raised.) Best, Thomas ______________________________________________________ Yahoo! for Good Donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ From orbitz@REDACTED Sun Sep 18 18:49:29 2005 From: orbitz@REDACTED (orbitz@REDACTED) Date: Sun, 18 Sep 2005 12:49:29 -0400 Subject: Parallel Language Message-ID: <9c124dc9da8d069a681a2ab6f076b9f4@ezabel.com> I apologize if my question is a bit too off-topic for this forum. However, my question is related to concurrency in some way and I thought, perhaps, people exposed to Erlang would have good suggestions. I am looking for a language similar to Erlang in concept. However I would like to do CPU intensive mathematical computations with it. I would like to be able to easily communicate with nodes on the cluster which is something that Erlang does quite well. One possibility is to write the CPU intensive stuff in C and interface it with Erlang, but if there is a language which does all of this for me, well, that would be great. I have come across ZPL http://www.cs.washington.edu/research/zpl/home/index.html However it does not appear to be stable yet or there is not much documentation on it. Any other suggestions would be appreciated. Thank you. From ok@REDACTED Sun Sep 18 22:38:10 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 19 Sep 2005 08:38:10 +1200 (NZST) Subject: Erlang Type System Message-ID: <200509182038.j8IKcAFT240776@atlas.otago.ac.nz> orbitz@REDACTED asked: As I understand it, with a dynamically typed language you can change the type of x. That is not a correct understanding. For instance in Python x = 1; x = 1.5; But in that example, nothing changed its type. 1 was and remained an integer. 1.5 was and remained a floating-point number. A more accurate statement would be that in a dynamically typed language "type" is a property of values rather than variables. Obviously we can't do that in Erlang. There are actually several senses in which you can. Each process has a process dictionary, which is in practice a hash table, and you can associate any kind of data with any key and you can change the kind of data associated with an existing key. Once you leave the realm of primitive scalar types, Java is arguably a dynamically typed language, or at least was until 1.5. Most people tell me Erlang is still dynamically typed because the variable passed in a function can be of any type. Either "most people" are confused, or you are mis-reporting them. You cannot pass a variable to a function in Erlang. Since Erlang does not associate types with variables at compile time, it clearly isn't a statically typed language. Since it has values of distinct and distinguishable types and has type-specific operations, it isn't an untyped language either. What's left? From orbitz@REDACTED Mon Sep 19 00:55:51 2005 From: orbitz@REDACTED (orbitz@REDACTED) Date: Sun, 18 Sep 2005 18:55:51 -0400 Subject: Erlang Type System In-Reply-To: <200509182038.j8IKcAFT240776@atlas.otago.ac.nz> References: <200509182038.j8IKcAFT240776@atlas.otago.ac.nz> Message-ID: <4114867f386ff2049b743d0a7aaa5819@ezabel.com> Yes thanks, from the previous post i realized my understanding of what dynamic and static typing meant. I understand now. Thanks On Sep 18, 2005, at 4:38 PM, Richard A. O'Keefe wrote: > orbitz@REDACTED asked: > As I understand it, with a dynamically typed language you can > change the type of x. > > That is not a correct understanding. > > For instance in Python x = 1; x = 1.5; > > But in that example, nothing changed its type. > 1 was and remained an integer. > 1.5 was and remained a floating-point number. > > A more accurate statement would be that in a dynamically typed language > "type" is a property of values rather than variables. > > Obviously we can't do that in Erlang. > > There are actually several senses in which you can. > Each process has a process dictionary, which is in practice > a hash table, and you can associate any kind of data with any > key and you can change the kind of data associated with an existing > key. > > Once you leave the realm of primitive scalar types, Java is arguably > a dynamically typed language, or at least was until 1.5. > > Most people tell me Erlang is still dynamically typed because > the variable passed in a function can be of any type. > > Either "most people" are confused, or you are mis-reporting them. > You cannot pass a variable to a function in Erlang. > > Since Erlang does not associate types with variables at compile time, > it clearly isn't a statically typed language. Since it has values of > distinct and distinguishable types and has type-specific operations, > it isn't an untyped language either. What's left? > From sanjaya@REDACTED Mon Sep 19 07:57:23 2005 From: sanjaya@REDACTED (Sanjaya Vitharana) Date: Mon, 19 Sep 2005 11:57:23 +0600 Subject: INETS-How to handle redirection Message-ID: <004201c5bcdf$02f8dd00$5dfaa8c0@seshanmobile> Hi...!!! Can any body help me to handle the get request in inets when REDIRECTION done by the PHP script. (or any other script in websever) ??? i.e. when get request made to below page http://scr.int/vm/dialout.php?key=c&session=abc the PHP Script redirect it to http://scr.int/vm/index2.xml?key=c&session=abc this is working on the web browser without any problem. But my inets client don't get any reply for the same request & time out happens. all other requests are working, but when redirection on the PHP Script inets don't get any reply from web serer, i tried with increasing timeout, but it also fails. may be when redirection on the Script there will be any other way to handle it in inets. I'm using handle_info({http, {RequestId, Result}}, State) -> to catch the webserver reply & and request type is Asynchronous. Need help from to handle the redirection properly in inets??? Regards, Sanjaya Vitharana. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mats.cronqvist@REDACTED Mon Sep 19 09:09:50 2005 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 19 Sep 2005 09:09:50 +0200 Subject: newbie question about fun expressions In-Reply-To: <200509180121.53997.JMBALADO@terra.es> References: <200509171906.36041.JMBALADO@terra.es> <432C56C1.1060807@mbox304.swipnet.se> <200509180121.53997.JMBALADO@terra.es> Message-ID: <432E643E.7060400@ericsson.com> > Don't know the version because it is what I got with kubuntu typing > "apt-get install erlang" but I think it is from november 2004. > for version numbering debian seems to use the convention Major:-Minor; where Major is currently 1. so 1:10.b.5-1 is R10B-5, first build. mats From mats.cronqvist@REDACTED Mon Sep 19 09:29:53 2005 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 19 Sep 2005 09:29:53 +0200 Subject: record field names In-Reply-To: References: Message-ID: <432E68F1.60005@ericsson.com> Ulf Wiger (AL/EAB) wrote: > Mats Cronqvist wrote: > >> name clashes? >> surely you can't have a real record_info/2 function? >> >> mats > > > > You can bet that someone does. (: > > Well... perhaps that would be exceedingly unlikely. > I'll grant you that. > > /Uffe > well, i belive that the compiler will refuse to generate code for record_info/2. thus, there cannot be a name clash. btw, i'd like this too; module_info(records) -> list(record_names). mats From ingela@REDACTED Mon Sep 19 09:56:51 2005 From: ingela@REDACTED (Ingela Anderton) Date: Mon, 19 Sep 2005 09:56:51 +0200 Subject: INETS-How to handle redirection References: <004201c5bcdf$02f8dd00$5dfaa8c0@seshanmobile> Message-ID: <17198.28483.922533.733073@gargle.gargle.HOWL> Sanjaya Vitharana wrote: > Hi...!!! > > Can any body help me to handle the get request in inets when REDIRECTION done by the PHP script. (or any other script in websever) ??? > > i.e. > when get request made to below page > http://scr.int/vm/dialout.php?key=c&session=abc > > the PHP Script redirect it to > http://scr.int/vm/index2.xml?key=c&session=abc > > this is working on the web browser without any problem. > > But my inets client don't get any reply for the same request & time out happens. > > all other requests are working, but when redirection on the PHP Script inets don't get any reply from web serer, i tried with increasing timeout, but it also fails. may be when redirection on the Script there will be any other way to handle it in inets. > > I'm using > > handle_info({http, {RequestId, Result}}, State) -> > > to catch the webserver reply & and request type is Asynchronous. > > Need help from to handle the redirection properly in inets??? Have you tried setting the option {autoredirect, false}? Do you get the redirect answer then? The intes client will automaticly try to redirect the request. If it gets a redirect more than four times in a row it should give up. You could try the following trace commands to get some more info about what happens. (If it does not seem to be what is expected you can send me the printouts and I will look at them.) dbg:tracer() dbg:p(all, [call]). dbg:tpl(httpc_response, redirect, [{'_', [], [{return_trace}]}]). -- /Ingela - OTP team From joe.armstrong@REDACTED Mon Sep 19 11:21:42 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Mon, 19 Sep 2005 11:21:42 +0200 Subject: GUIs - ruby on rails, rico Message-ID: It seems like my quest for a GUI is almost over. Klacke had pointed me at XMLHTTP but I just didn't get it (dumbo) - Then I hacked a bit and - WOW. Firstly XMLHTTP is nothing about XML - it's just allows a light weight RPC to made from within a web page. So you connect a bit of JavaScript to an event - this JavaScript RPCs a server, the server replies with a string that the JavaScript interprets (any old string - not necessarily XML) and the JavaScript modifies the web page. The last bit (the JavaScript modifies the web page) is the tricky bit - to do this you need to use the DOM - which is (uuugh) painful. Fortunately there are libraries to do this - ruby on rails uses prototype.js to do this http://prototype.conio.net/ And Tobbe has written a library (jungerl/lib/js) to take to prototype.js Also of interest is rico http://openrico.org/rico/home.page (especially their innerHTML demo) (see http://openrico.org/rico/demos.page?demo=ricoAjaxInnerHTML.html) As far as I can see one could make a pretty snazzy GUI in a web brower with - a local HTTP server (yaws) - XMLHTTP and - rico or prototype.js Also in the pipeline is an HTML extension which has made it to safari and mozilla - this is looking good. What would be even nicer would be a port of the konfabulator to linux http://www.konfabulator.com/ - since this (I think) would solve all my GUI problems. This technology is about to explode - so yaws should be well placed - this means that servers are going to be handling a lot of lightweight RPCs So go hack /Joe From nm@REDACTED Mon Sep 19 13:17:22 2005 From: nm@REDACTED (Gaspar Chilingarov) Date: Mon, 19 Sep 2005 16:17:22 +0500 Subject: GUIs - ruby on rails, rico In-Reply-To: References: Message-ID: <432E9E42.9030302@web.am> Hm. You have pointed good link to investigate and think about. At current moment I'm thinking about dynamically feeding XUL scripts with data generated on server. It have pluses - you can build and use complex user interfaces - which can have some logic on client. In other hand it works only in mozilla. Idea of making some standard calls from user interface to server is very amaizng in means that you can almost automate functoinal testing of applications. In case if your client is `thin` and have no logic at all in it -- you can have mistakes only in data rendering on page, which is easy to track (you should have test server, which will provide correct predefined responses to UI). Joe Armstrong (AL/EAB) wrote: > It seems like my quest for a GUI is almost over. > > Klacke had pointed me at XMLHTTP but I just didn't get it (dumbo) - > > Then I hacked a bit and - WOW. Firstly XMLHTTP is nothing about XML - it's just allows > a light weight RPC to made from within a web page. So you connect a bit > of JavaScript to an event - this JavaScript RPCs a server, the server replies with > a string that the JavaScript interprets (any old string - not necessarily XML) > and the JavaScript modifies the web page. > > The last bit (the JavaScript modifies the web page) is the tricky bit - to > do this you need to use the DOM - which is (uuugh) painful. > > Fortunately there are libraries to do this - ruby on rails uses prototype.js to do this > http://prototype.conio.net/ And Tobbe has written a library (jungerl/lib/js) to take to prototype.js > > Also of interest is rico http://openrico.org/rico/home.page (especially their innerHTML > demo) (see http://openrico.org/rico/demos.page?demo=ricoAjaxInnerHTML.html) > > As far as I can see one could make a pretty snazzy GUI in a web brower with > > - a local HTTP server (yaws) > - XMLHTTP and > - rico or prototype.js > > Also in the pipeline is an HTML extension which has made it to > safari and mozilla - this is looking good. > > What would be even nicer would be a port of the konfabulator to linux > http://www.konfabulator.com/ - since this (I think) would solve all my GUI problems. > > This technology is about to explode - so yaws should be well placed - > this means that servers are going to be handling a lot of lightweight RPCs > > So go hack > > /Joe > -- Gaspar Chilingarov System Administrator t +37491 419763 (mob) t +37410 240399 (office) w www.web.am i 63174784 e nm@REDACTED From joe.armstrong@REDACTED Mon Sep 19 14:22:58 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Mon, 19 Sep 2005 14:22:58 +0200 Subject: GUIs - ruby on rails, rico Message-ID: It's even better than I thought. The Canvas widget *is* in Firefox 1.5 beta 1 and runs out of the box!!! Strangely there are very few working examples on the net to show how the canvas is used. This is amazing - up to now it has been difficult to direct display vector graphics on the web - with the canvas widget this is easy. Wow /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Joe Armstrong > (AL/EAB) > Sent: den 19 september 2005 11:22 > To: erlang-questions > Subject: GUIs - ruby on rails, rico > > > > It seems like my quest for a GUI is almost over. > > Klacke had pointed me at XMLHTTP but I just didn't get it (dumbo) - > > Then I hacked a bit and - WOW. Firstly XMLHTTP is nothing > about XML - it's just allows > a light weight RPC to made from within a web page. So you > connect a bit > of JavaScript to an event - this JavaScript RPCs a server, > the server replies with > a string that the JavaScript interprets (any old string - not > necessarily XML) > and the JavaScript modifies the web page. > > The last bit (the JavaScript modifies the web page) is the > tricky bit - to > do this you need to use the DOM - which is (uuugh) painful. > > Fortunately there are libraries to do this - ruby on rails > uses prototype.js to do this > http://prototype.conio.net/ And Tobbe has written a library > (jungerl/lib/js) to take to prototype.js > > Also of interest is rico http://openrico.org/rico/home.page > (especially their innerHTML > demo) (see > http://openrico.org/rico/demos.page?demo=ricoAjaxInnerHTML.html) > > As far as I can see one could make a pretty snazzy GUI in a > web brower with > > - a local HTTP server (yaws) > - XMLHTTP and > - rico or prototype.js > > Also in the pipeline is an HTML extension which has > made it to > safari and mozilla - this is looking good. > > What would be even nicer would be a port of the konfabulator to linux > http://www.konfabulator.com/ - since this (I think) would > solve all my GUI problems. > > This technology is about to explode - so yaws should be well placed - > this means that servers are going to be handling a lot of > lightweight RPCs > > So go hack > > /Joe > > From bjorn@REDACTED Mon Sep 19 14:29:06 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 19 Sep 2005 14:29:06 +0200 Subject: Module attributes In-Reply-To: References: Message-ID: Roger Price writes: > I'm trying to understand the possibilities offered by module > attributes. My source file "test.erl" contains just the two lines: > > -module (test) . > -bad_binary(<<10,20>>) . > > I'm using Erlang (BEAM) emulator version 5.4.6 [source] [hipe], and > the compiler crashes as follows: > [...] Corrected. The correction will appear in R10B-8. > In the Erlang Reference Manual 5.4.6: Clause 4.2 Module Attributes, > says that a module attribute consists of a tag and a value. -Tag(Term) > I have changed it to say that the values for Module Attributes are "literal terms". > Shouldn't clause 4.2 say that a Module Attribute is -Tag(BasicTerm) > where BasicTerm is an integer, real number, atom or string? > List, tuples, and literal strings are also allowed. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From vlad.xx.dumitrescu@REDACTED Mon Sep 19 14:34:57 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Mon, 19 Sep 2005 14:34:57 +0200 Subject: Module attributes Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE63E@esealmw105.eemea.ericsson.se> > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Bjorn > Gustavsson > > Shouldn't clause 4.2 say that a Module Attribute is -Tag(BasicTerm) > > where BasicTerm is an integer, real number, atom or string? > > > > List, tuples, and literal strings are also allowed. Hi, Any reason why literal binaries shouldn't be allowed too? regards, Vlad From bjorn@REDACTED Mon Sep 19 14:55:00 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 19 Sep 2005 14:55:00 +0200 Subject: Module attributes In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE63E@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE63E@esealmw105.eemea.ericsson.se> Message-ID: "Vlad Dumitrescu XX (LN/EAB)" writes: > > -----Original Message----- > > From: owner-erlang-questions@REDACTED > > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Bjorn > > Gustavsson > > > Shouldn't clause 4.2 say that a Module Attribute is -Tag(BasicTerm) > > > where BasicTerm is an integer, real number, atom or string? > > > > > > > List, tuples, and literal strings are also allowed. > > Hi, > > Any reason why literal binaries shouldn't be allowed too? > I was unclear in my answer. Actually, we allow literal binaries too, but they used to crash the compiler in a later pass. Literal binaries will work in R10B-7. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From rasmussen.bryan@REDACTED Mon Sep 19 15:04:39 2005 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Mon, 19 Sep 2005 15:04:39 +0200 Subject: GUIs - ruby on rails, rico In-Reply-To: References: Message-ID: <3bb44c6e05091906048f9f451@mail.gmail.com> If you're talking about what I think, the Canvas as an editable vector graphics area is part of the whatwg specifications http://www.whatwg.org/specs/web-apps/current-work/ whatwg has various browser manufacturers/implementors as part of their group, but not IE. It has not been finalized in their specs yet IIRC thus given this I am not surprised as to the lack of examples as yet. On 9/19/05, Joe Armstrong (AL/EAB) wrote: > > It's even better than I thought. The Canvas widget *is* in > Firefox 1.5 beta 1 and runs out of the box!!! > > Strangely there are very few working examples on the net to show how the > canvas is used. > > This is amazing - up to now it has been difficult to direct display vector graphics > on the web - with the canvas widget this is easy. > > Wow > > /Joe > > > > > > -----Original Message----- > > From: owner-erlang-questions@REDACTED > > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Joe Armstrong > > (AL/EAB) > > Sent: den 19 september 2005 11:22 > > To: erlang-questions > > Subject: GUIs - ruby on rails, rico > > > > > > > > It seems like my quest for a GUI is almost over. > > > > Klacke had pointed me at XMLHTTP but I just didn't get it (dumbo) - > > > > Then I hacked a bit and - WOW. Firstly XMLHTTP is nothing > > about XML - it's just allows > > a light weight RPC to made from within a web page. So you > > connect a bit > > of JavaScript to an event - this JavaScript RPCs a server, > > the server replies with > > a string that the JavaScript interprets (any old string - not > > necessarily XML) > > and the JavaScript modifies the web page. > > > > The last bit (the JavaScript modifies the web page) is the > > tricky bit - to > > do this you need to use the DOM - which is (uuugh) painful. > > > > Fortunately there are libraries to do this - ruby on rails > > uses prototype.js to do this > > http://prototype.conio.net/ And Tobbe has written a library > > (jungerl/lib/js) to take to prototype.js > > > > Also of interest is rico http://openrico.org/rico/home.page > > (especially their innerHTML > > demo) (see > > http://openrico.org/rico/demos.page?demo=ricoAjaxInnerHTML.html) > > > > As far as I can see one could make a pretty snazzy GUI in a > > web brower with > > > > - a local HTTP server (yaws) > > - XMLHTTP and > > - rico or prototype.js > > > > Also in the pipeline is an HTML extension which has > > made it to > > safari and mozilla - this is looking good. > > > > What would be even nicer would be a port of the konfabulator to linux > > http://www.konfabulator.com/ - since this (I think) would > > solve all my GUI problems. > > > > This technology is about to explode - so yaws should be well placed - > > this means that servers are going to be handling a lot of > > lightweight RPCs > > > > So go hack > > > > /Joe > > > > > From peppe@REDACTED Mon Sep 19 15:05:34 2005 From: peppe@REDACTED (UAB L/K Peter Andersson) Date: Mon, 19 Sep 2005 15:05:34 +0200 Subject: werl.exe window saving/restoring References: Message-ID: <432EB79E.C7195E4F@erix.ericsson.se> Hi James, It was only disabled temporarily. In R10B-5 i believe. A proper fix was implemented right after that. So this should not be an issue in the latest two release. Peter James Hague wrote: > > This was super-useful, but was disabled a few versions back because it > didn't properly handle the case when the werl.exe window was minimized > when you quit. Is it still disabled? > > In any case, the proper fix is to use GetWindowPlacement and > SetWindowPlacement instead of other calls to get the window position > and size. Save the WINDOWPLACEMENT struct directly in the registry in > binary format. This automatically takes care of saving all window > information, including whether a window is minimized/maximized or not. > > I'd make this change myself, except I'm not set-up with Cygwin on any > of my current machines and don't have the time to do so in the near > future. > > James -- ----------------------- Erlang/OTP, Ericsson AB ----------------------- From rasmussen.bryan@REDACTED Mon Sep 19 15:06:34 2005 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Mon, 19 Sep 2005 15:06:34 +0200 Subject: GUIs - ruby on rails, rico In-Reply-To: <3bb44c6e05091906048f9f451@mail.gmail.com> References: <3bb44c6e05091906048f9f451@mail.gmail.com> Message-ID: <3bb44c6e05091906062977ee66@mail.gmail.com> given that the upcoming builds of firefox/mozilla should also be SVG capable I would suppose that SVG will be the better overall platform for doing it. I have seen a demo of svg inside canvas and canvas inside xhmtl inside svg etc. running in a private mozilla build. was pretty impressive. On 9/19/05, bryan rasmussen wrote: > If you're talking about what I think, the Canvas as an editable vector > graphics area is part of the whatwg specifications > http://www.whatwg.org/specs/web-apps/current-work/ > > whatwg has various browser manufacturers/implementors as part of their > group, but not IE. > It has not been finalized in their specs yet IIRC thus given this I am > not surprised as to the lack of examples as yet. > > On 9/19/05, Joe Armstrong (AL/EAB) wrote: > > > > It's even better than I thought. The Canvas widget *is* in > > Firefox 1.5 beta 1 and runs out of the box!!! > > > > Strangely there are very few working examples on the net to show how the > > canvas is used. > > > > This is amazing - up to now it has been difficult to direct display vector graphics > > on the web - with the canvas widget this is easy. > > > > Wow > > > > /Joe > > > > > > > > > > > -----Original Message----- > > > From: owner-erlang-questions@REDACTED > > > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Joe Armstrong > > > (AL/EAB) > > > Sent: den 19 september 2005 11:22 > > > To: erlang-questions > > > Subject: GUIs - ruby on rails, rico > > > > > > > > > > > > It seems like my quest for a GUI is almost over. > > > > > > Klacke had pointed me at XMLHTTP but I just didn't get it (dumbo) - > > > > > > Then I hacked a bit and - WOW. Firstly XMLHTTP is nothing > > > about XML - it's just allows > > > a light weight RPC to made from within a web page. So you > > > connect a bit > > > of JavaScript to an event - this JavaScript RPCs a server, > > > the server replies with > > > a string that the JavaScript interprets (any old string - not > > > necessarily XML) > > > and the JavaScript modifies the web page. > > > > > > The last bit (the JavaScript modifies the web page) is the > > > tricky bit - to > > > do this you need to use the DOM - which is (uuugh) painful. > > > > > > Fortunately there are libraries to do this - ruby on rails > > > uses prototype.js to do this > > > http://prototype.conio.net/ And Tobbe has written a library > > > (jungerl/lib/js) to take to prototype.js > > > > > > Also of interest is rico http://openrico.org/rico/home.page > > > (especially their innerHTML > > > demo) (see > > > http://openrico.org/rico/demos.page?demo=ricoAjaxInnerHTML.html) > > > > > > As far as I can see one could make a pretty snazzy GUI in a > > > web brower with > > > > > > - a local HTTP server (yaws) > > > - XMLHTTP and > > > - rico or prototype.js > > > > > > Also in the pipeline is an HTML extension which has > > > made it to > > > safari and mozilla - this is looking good. > > > > > > What would be even nicer would be a port of the konfabulator to linux > > > http://www.konfabulator.com/ - since this (I think) would > > > solve all my GUI problems. > > > > > > This technology is about to explode - so yaws should be well placed - > > > this means that servers are going to be handling a lot of > > > lightweight RPCs > > > > > > So go hack > > > > > > /Joe > > > > > > > > > From james.hague@REDACTED Mon Sep 19 15:52:40 2005 From: james.hague@REDACTED (James Hague) Date: Mon, 19 Sep 2005 08:52:40 -0500 Subject: werl.exe window saving/restoring In-Reply-To: <432EB79E.C7195E4F@erix.ericsson.se> References: <432EB79E.C7195E4F@erix.ericsson.se> Message-ID: On 9/19/05, UAB L/K Peter Andersson wrote: > > It was only disabled temporarily. In R10B-5 i believe. A proper fix was > implemented right after that. So this should not be an issue in the > latest two release. The latest release for Windows does not save the window size of position. I had forgotten how annoying that was! James From james.hague@REDACTED Mon Sep 19 15:53:33 2005 From: james.hague@REDACTED (James Hague) Date: Mon, 19 Sep 2005 08:53:33 -0500 Subject: werl.exe window saving/restoring In-Reply-To: References: <432EB79E.C7195E4F@erix.ericsson.se> Message-ID: > The latest release for Windows does not save the window size of > position. I had forgotten how annoying that was! Er, "size OR position." It does save the toolbar state, however. James From erik.reitsma@REDACTED Mon Sep 19 16:06:06 2005 From: erik.reitsma@REDACTED (Erik Reitsma (RY/ETM)) Date: Mon, 19 Sep 2005 16:06:06 +0200 Subject: Mnesia query: less or equal than given key Message-ID: <110BA8ACEE682C479D0B008B6BE4AEB10C14F6@esealmw107.eemea.ericsson.se> Hi all, Using mnesia, is there an efficient way to find the smallest entry in a table with a key equal to or less than a given key? So suppose that I have keys 10, 23, 33, 34, 56, 100 and I look for 26, I want to get 23 back. If I look for 23, I should get 23. I could select all entries smaller than or equal to my key, and then take the largest of those, but it seems like I would get an intermediate list that may consist of the entire table (i.e. if my key is larger than the largest key in the table). I could make my own binary search (the keys are integers anyway), but I wondered if there would be a more elegant way. Regards, *Erik. From peppe@REDACTED Mon Sep 19 16:43:45 2005 From: peppe@REDACTED (UAB L/K Peter Andersson) Date: Mon, 19 Sep 2005 16:43:45 +0200 Subject: werl.exe window saving/restoring References: <432EB79E.C7195E4F@erix.ericsson.se> Message-ID: <432ECEA1.F958428F@erix.ericsson.se> I also tried this now with the latest release and hey, you're absolutely right! Darn, I know we fixed this already. I'll look into it and get back to you. Sorry James! Peter James Hague wrote: > > > The latest release for Windows does not save the window size of > > position. I had forgotten how annoying that was! > > Er, "size OR position." It does save the toolbar state, however. > > James From sean.hinde@REDACTED Mon Sep 19 16:52:05 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Mon, 19 Sep 2005 15:52:05 +0100 Subject: Mnesia query: less or equal than given key In-Reply-To: <110BA8ACEE682C479D0B008B6BE4AEB10C14F6@esealmw107.eemea.ericsson.se> References: <110BA8ACEE682C479D0B008B6BE4AEB10C14F6@esealmw107.eemea.ericsson.se> Message-ID: <00BA6BA4-806E-4608-A4A8-76143955B402@gmail.com> Hi, You could try first looking up the exact key, and if not found then do a mnesia:dirty_prev/2 to get the next smallest. You would need to be careful of transaction safety.. Sean On 19 Sep 2005, at 15:06, Erik Reitsma (RY/ETM) wrote: > Hi all, > > Using mnesia, is there an efficient way to find the smallest entry > in a table with a key equal to or less than a given key? > > So suppose that I have keys 10, 23, 33, 34, 56, 100 and I look for > 26, I want to get 23 back. If I look for 23, I should get 23. > > I could select all entries smaller than or equal to my key, and > then take the largest of those, but it seems like I would get an > intermediate list that may consist of the entire table (i.e. if my > key is larger than the largest key in the table). > > I could make my own binary search (the keys are integers anyway), > but I wondered if there would be a more elegant way. > > Regards, > *Erik. > > From ulf.wiger@REDACTED Mon Sep 19 17:00:39 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 19 Sep 2005 17:00:39 +0200 Subject: Mnesia query: less or equal than given key Message-ID: Erik Reitsma wrote: > > Using mnesia, is there an efficient way to find the smallest > entry in a table with a key equal to or less than a given key? It appears as if you intended to write "the _largest_ entry with a key equal to or less than a given key". > So suppose that I have keys 10, 23, 33, 34, 56, 100 and I > look for 26, I want to get 23 back. If I look for 23, I should get 23. Here's a first suggestion: (ord@REDACTED)3> mnesia:create_table(test,[{type, ordered_set}]). {atomic,ok} (ord@REDACTED)4> [mnesia:dirty_write({test,N,a}) ||?N <- [10,23,33,34,56,100]]. [ok,ok,ok,ok,ok,ok] (ord@REDACTED)5> F = fun(N) -> mnesia:transaction( fun() -> case mnesia:read({test,N}) of [] -> case mnesia:dirty_prev(test,N) of '$end_of_table' -> []; Prev -> mnesia:read({test,Prev}) end; [Obj] -> Obj end end) end. #Fun (ord@REDACTED)6> F(26). {atomic,[{test,23,a}]} (ord@REDACTED)7> F(23). {atomic,{test,23,a}} (ord@REDACTED)8> It's not 100% safe, since dirty_prev bypasses the transaction store, while the second read() doesn't. /Uffe From chandrashekhar.mullaparthi@REDACTED Mon Sep 19 17:13:01 2005 From: chandrashekhar.mullaparthi@REDACTED (chandru) Date: Mon, 19 Sep 2005 16:13:01 +0100 Subject: Mnesia query: less or equal than given key In-Reply-To: <110BA8ACEE682C479D0B008B6BE4AEB10C14F6@esealmw107.eemea.ericsson.se> References: <110BA8ACEE682C479D0B008B6BE4AEB10C14F6@esealmw107.eemea.ericsson.se> Message-ID: Hi, >From the man page for mnesia dirty_prev(Tab, Key) -> Key | exit({aborted, Reason}) This function works exactly mnesia:dirty_next/2 but returns the previous object in Erlang term order for the ordered_set table type. For all other table types, mnesia:dirty_next/2 and mne- sia:dirty_prev/2 are synonyms. cheers Chandru On 19/09/05, Erik Reitsma (RY/ETM) wrote: > Hi all, > > Using mnesia, is there an efficient way to find the smallest entry in a table with a key equal to or less than a given key? > > So suppose that I have keys 10, 23, 33, 34, 56, 100 and I look for 26, I want to get 23 back. If I look for 23, I should get 23. > > I could select all entries smaller than or equal to my key, and then take the largest of those, but it seems like I would get an intermediate list that may consist of the entire table (i.e. if my key is larger than the largest key in the table). > > I could make my own binary search (the keys are integers anyway), but I wondered if there would be a more elegant way. > > Regards, > *Erik. > > From james.hague@REDACTED Mon Sep 19 18:06:11 2005 From: james.hague@REDACTED (James Hague) Date: Mon, 19 Sep 2005 11:06:11 -0500 Subject: GUIs - ruby on rails, rico In-Reply-To: References: Message-ID: An impressive application to look at is tiddlywiki: http://www.tiddlywiki.com/ This is a "microcontent wiki" that's contained entirely in a single HTML file. Once you've viewed the above page, you already have the application on your machine. You can copy the HTML page to another part of your hard drive for safekeeping. The whole app--the GUI, the database--is in the HTML file. From martin@REDACTED Mon Sep 19 19:22:06 2005 From: martin@REDACTED (Martin Carlson) Date: Mon, 19 Sep 2005 18:22:06 +0100 (BST) Subject: GUIs - ruby on rails, rico In-Reply-To: References: Message-ID: Hi all, I haven't had a close look at this XMLHTTP, but to me it don't sound to far from XUL (http://www.xulplanet.com). Where you use the mozilla chrome engine to render a gui. The "thing" is that you can either render XUL pages (much like html pages) remotely in a sandbox mode or you can install them ontop of mozilla as a extention, which infact run as a "normal" application i.e. thunderbird or firefox. The XUL rendering works in pretty much the same way where you have a horrible XML file and thus a DOM tree that you can manipulat with java scripts. Thus, using the XmlHttpRequest to communicate with the server can make the gui appear interactive where all communication takes place in the background as POST and GET requests to the server. Martin On Mon, 19 Sep 2005, Joe Armstrong (AL/EAB) wrote: > > It's even better than I thought. The Canvas widget *is* in > Firefox 1.5 beta 1 and runs out of the box!!! > > Strangely there are very few working examples on the net to show how the > canvas is used. > > This is amazing - up to now it has been difficult to direct display vector graphics > on the web - with the canvas widget this is easy. > > Wow > > /Joe > > > > >> -----Original Message----- >> From: owner-erlang-questions@REDACTED >> [mailto:owner-erlang-questions@REDACTED]On Behalf Of Joe Armstrong >> (AL/EAB) >> Sent: den 19 september 2005 11:22 >> To: erlang-questions >> Subject: GUIs - ruby on rails, rico >> >> >> >> It seems like my quest for a GUI is almost over. >> >> Klacke had pointed me at XMLHTTP but I just didn't get it (dumbo) - >> >> Then I hacked a bit and - WOW. Firstly XMLHTTP is nothing >> about XML - it's just allows >> a light weight RPC to made from within a web page. So you >> connect a bit >> of JavaScript to an event - this JavaScript RPCs a server, >> the server replies with >> a string that the JavaScript interprets (any old string - not >> necessarily XML) >> and the JavaScript modifies the web page. >> >> The last bit (the JavaScript modifies the web page) is the >> tricky bit - to >> do this you need to use the DOM - which is (uuugh) painful. >> >> Fortunately there are libraries to do this - ruby on rails >> uses prototype.js to do this >> http://prototype.conio.net/ And Tobbe has written a library >> (jungerl/lib/js) to take to prototype.js >> >> Also of interest is rico http://openrico.org/rico/home.page >> (especially their innerHTML >> demo) (see >> http://openrico.org/rico/demos.page?demo=ricoAjaxInnerHTML.html) >> >> As far as I can see one could make a pretty snazzy GUI in a >> web brower with >> >> - a local HTTP server (yaws) >> - XMLHTTP and >> - rico or prototype.js >> >> Also in the pipeline is an HTML extension which has >> made it to >> safari and mozilla - this is looking good. >> >> What would be even nicer would be a port of the konfabulator to linux >> http://www.konfabulator.com/ - since this (I think) would >> solve all my GUI problems. >> >> This technology is about to explode - so yaws should be well placed - >> this means that servers are going to be handling a lot of >> lightweight RPCs >> >> So go hack >> >> /Joe >> >> > From rasmussen.bryan@REDACTED Mon Sep 19 22:00:53 2005 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Mon, 19 Sep 2005 22:00:53 +0200 Subject: GUIs - ruby on rails, rico In-Reply-To: References: Message-ID: <3bb44c6e05091913007bdc5d9d@mail.gmail.com> xmlhttp is an object included with most modern browsers which allows a scripting engine implemented in the browser to make asynchronous http gets, posts etc. it has the name xmlhttp because microsoft who came up with it evidently envisioned it for sending around xml. xmlhttp has nothing to do with the gui, the gui has to be coded. on the other hand XUL is browser specific. One area where the cross, my understanding is that Google for some of their dynamic web applications have a transformation server side of XUL to dynamic html for IE etc. and deliver just XUL to Netscape, Mozilla etc. however this is a partially remembered bit of web trivia so don't hold me to it. On 9/19/05, Martin Carlson wrote: > > Hi all, > > I haven't had a close look at this XMLHTTP, but to me it > don't sound to far from XUL (http://www.xulplanet.com). > Where you use the mozilla chrome engine to render a gui. > The "thing" is that you can either render XUL pages > (much like html pages) remotely in a sandbox mode or > you can install them ontop of mozilla as a extention, > which infact run as a "normal" application i.e. thunderbird > or firefox. > > The XUL rendering works in pretty much the same way where > you have a horrible XML file and thus a DOM tree that you can > manipulat with java scripts. Thus, using the XmlHttpRequest to > communicate with the server can make the gui appear interactive > where all communication takes place in the background as POST and > GET requests to the server. > > Martin > > On Mon, 19 Sep 2005, Joe Armstrong (AL/EAB) wrote: > > > > > It's even better than I thought. The Canvas widget *is* in > > Firefox 1.5 beta 1 and runs out of the box!!! > > > > Strangely there are very few working examples on the net to show how the > > canvas is used. > > > > This is amazing - up to now it has been difficult to direct display vector graphics > > on the web - with the canvas widget this is easy. > > > > Wow > > > > /Joe > > > > > > > > > >> -----Original Message----- > >> From: owner-erlang-questions@REDACTED > >> [mailto:owner-erlang-questions@REDACTED]On Behalf Of Joe Armstrong > >> (AL/EAB) > >> Sent: den 19 september 2005 11:22 > >> To: erlang-questions > >> Subject: GUIs - ruby on rails, rico > >> > >> > >> > >> It seems like my quest for a GUI is almost over. > >> > >> Klacke had pointed me at XMLHTTP but I just didn't get it (dumbo) - > >> > >> Then I hacked a bit and - WOW. Firstly XMLHTTP is nothing > >> about XML - it's just allows > >> a light weight RPC to made from within a web page. So you > >> connect a bit > >> of JavaScript to an event - this JavaScript RPCs a server, > >> the server replies with > >> a string that the JavaScript interprets (any old string - not > >> necessarily XML) > >> and the JavaScript modifies the web page. > >> > >> The last bit (the JavaScript modifies the web page) is the > >> tricky bit - to > >> do this you need to use the DOM - which is (uuugh) painful. > >> > >> Fortunately there are libraries to do this - ruby on rails > >> uses prototype.js to do this > >> http://prototype.conio.net/ And Tobbe has written a library > >> (jungerl/lib/js) to take to prototype.js > >> > >> Also of interest is rico http://openrico.org/rico/home.page > >> (especially their innerHTML > >> demo) (see > >> http://openrico.org/rico/demos.page?demo=ricoAjaxInnerHTML.html) > >> > >> As far as I can see one could make a pretty snazzy GUI in a > >> web brower with > >> > >> - a local HTTP server (yaws) > >> - XMLHTTP and > >> - rico or prototype.js > >> > >> Also in the pipeline is an HTML extension which has > >> made it to > >> safari and mozilla - this is looking good. > >> > >> What would be even nicer would be a port of the konfabulator to linux > >> http://www.konfabulator.com/ - since this (I think) would > >> solve all my GUI problems. > >> > >> This technology is about to explode - so yaws should be well placed - > >> this means that servers are going to be handling a lot of > >> lightweight RPCs > >> > >> So go hack > >> > >> /Joe > >> > >> > > > > From hakan.stenholm@REDACTED Tue Sep 20 00:47:21 2005 From: hakan.stenholm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Stenholm?=) Date: Tue, 20 Sep 2005 00:47:21 +0200 Subject: Where and how does one find Erlang jobs ? In-Reply-To: <3bb44c6e05091913007bdc5d9d@mail.gmail.com> References: <3bb44c6e05091913007bdc5d9d@mail.gmail.com> Message-ID: <432F3FF9.9040006@mbox304.swipnet.se> [I'm posting this somewhat spamish post to this mailing list, as I can't think of any better or more appropriate place to post it to.] I'm currently looking for a job (preferably Erlang or some other non-mainstream language), and would like to notify those who might be looking for programmers, about my current availability. I know a number of ways to find Erlang jobs: * Check this mailing list - thats how I ended up working on YXA (http://www.stacken.kth.se/projekt/yxa/) * Check the Erlang jobs web page (http://www.erlang-consulting.com/jobs_fs.html) * Contact known Erlang users, this is a bit trickier, but a fair number of presumably Erlang using companies can be found by checking www.erlang.se (certified Erlang users) and by checking for whom the speakers and participants visiting the "Erlang User Conference", work for. With this post I'm mainly trying to reach/contact those that are not easily reached by the above mentioned methods e.g. those that are not publicly using Erlang (as mentioned in recent mailing-list posts), companies that may dismiss me as unsuited as they may not even know that they use Erlang, etc ... Any tips or hints are appreciated. =============================================== ___About Me___ * Got a Master of science degree in Computer Science, 1998, at Uppsala university (Sweden). * Well versed in C, Java and Erlang. * Most noteworthy (Erlang) software development jobs: - Four years (1998/09 - 2002/11) working at Ericsson developing Erlang code for the AXD301 (Multi Service Switch - handling ATM / IP / phone traffic / frame relay / ...). - Seven months (2004/09 - 2005/04) working on YXA (IP telephony server) and CPL at Stockholm university ("Sektionen f?r IT och Media" / "Division of IT and media services") to complete the initial YXA version, so that it can be tested. * Links to stuff I worked on: http://www.stacken.kth.se/projekt/yxa/ http://www.stacken.kth.se/projekt/yxa/cpl_implementation.html ___Contact info___ Name: H?kan Stenholm Email: hakan.stenholm@REDACTED Address: Stockholm - Sweden (this is also my preferred work location, but I'm willing to move) From sanjaya@REDACTED Tue Sep 20 05:04:03 2005 From: sanjaya@REDACTED (Sanjaya Vitharana) Date: Tue, 20 Sep 2005 09:04:03 +0600 Subject: INETS-How to handle redirection References: <004201c5bcdf$02f8dd00$5dfaa8c0@seshanmobile> <17198.28483.922533.733073@gargle.gargle.HOWL> Message-ID: <002a01c5bd90$1c4f8180$5dfaa8c0@seshanmobile> Hi...!!! Many thanks for your quick reply, I have tried with {autoredirect, false}, but it fails. dbg:tracer(). dbg:p(all, [call]). dbg:tpl(httpc_response, redirect, [{'_', [], [{return_trace}]}]). I exactly don't know how to handle above 3 commands (where can I found how to use the above commands?). Anyhow what I did is just use this 3 command in erlang emulator window and made the http request in the same window. Below I'll copy the full steps that I followed. Kindly refer & inform if I am doing anything wrong, so I can give you the exact result what you need. Only chnage that I have made comparing with my implemented code is, i have change the Asynchronous request to Synchronous when I use the erlang emulator. Furthermore, PHP page has only 1 redirection, & working with the web browser (IE) without any problem Regards, Sanjaya Vitharana --------------------full steps that I followed----------------------------------------- Erlang (BEAM) emulator version 5.4.8 [threads:0] Eshell V5.4.8 (abort with ^G) 1> dbg:tracer(). {ok,<0.32.0>} 2> dbg:p(all, [call]). {ok,[{matched,nonode@REDACTED,25}]} 3> dbg:tpl(httpc_response, redirect, [{'_', [], [{return_trace}]}]). {ok,[{matched,nonode@REDACTED,1},{saved,1}]} --------------------Request to Redirected Page----------------------------------------- 4> URL3="http://scr.int/vm/dialout.php?key=c&session=abc". "http://scr.int/vm/dialout.php?key=c&session=abc" 5> http:request(get, {URL3, []}, [{timeout, 10000},{autoredirect, false}],[]). =INFO REPORT==== 19-Sep-2005::16:26:23 === The inets application was not started. Has now been started as a temporary appli cation. {error,timeout} 6> http:request(get, {URL3, []}, [{timeout, 10000},{autoredirect, false}],[]). {error,timeout} --------------------Request to NON Redirected Page-------------------------------------- 7> URL2="http://scr.int/vm/index2.xml?key=c&session=abc". "http://scr.int/vm/index2.xml?key=c&session=abc" 8> http:request(get, {URL2, []}, [{timeout, 10000},{autoredirect, false}],[]). {ok,{{"HTTP/1.1",200,"OK"}, [{"connection","Keep-Alive"}, {"date","Mon, 19 Sep 2005 10:25:26 GMT"}, {"etag","\"112ee7-14a-34558640\""}, {"server", "Apache/2.0.52 (Unix) mod_ssl/2.0.52 OpenSSL/0.9.7a DAV/2 PHP/5.0.3"}, {"content-length","330"}, {"content-type","application/xml"}, {"last-modified","Sun, 18 Sep 2005 17:32:01 GMT"}, {"accept-ranges","bytes"}, {"keep-alive","timeout=15, max=100"}], "\n\n\n/vms/73.vox\n/vms/1234.vox\nhttp://192.168.248.27/vm/index2.xml\nhtt p://192.168.248.27/vm/connect.xml\n304901077501446820 01126528157\n\n"}} 9> ---------------------------------------------------------------------------------------------- ----- Original Message ----- From: "Ingela Anderton" To: Cc: Sent: Monday, September 19, 2005 1:56 PM Subject: Re: INETS-How to handle redirection > Sanjaya Vitharana wrote: >> Hi...!!! >> >> Can any body help me to handle the get request in inets when REDIRECTION >> done by the PHP script. (or any other script in websever) ??? >> >> i.e. >> when get request made to below page >> http://scr.int/vm/dialout.php?key=c&session=abc >> >> the PHP Script redirect it to >> http://scr.int/vm/index2.xml?key=c&session=abc >> >> this is working on the web browser without any problem. >> >> But my inets client don't get any reply for the same request & time out >> happens. >> >> all other requests are working, but when redirection on the PHP Script >> inets don't get any reply from web serer, i tried with increasing >> timeout, but it also fails. may be when redirection on the Script there >> will be any other way to handle it in inets. >> >> I'm using >> >> handle_info({http, {RequestId, Result}}, State) -> >> >> to catch the webserver reply & and request type is Asynchronous. >> >> Need help from to handle the redirection properly in inets??? > Have you tried setting the option {autoredirect, false}? Do you get > the redirect answer then? The intes client will automaticly try to > redirect the request. If it gets a redirect more than four times > in a row it should give up. > > You could try the following trace commands to get some more info > about what happens. (If it does not seem to be what is expected > you can send me the printouts and I will look at them.) > dbg:tracer() > dbg:p(all, [call]). > dbg:tpl(httpc_response, redirect, [{'_', [], [{return_trace}]}]). > > -- > /Ingela - OTP team > > > > > > From ulf.wiger@REDACTED Tue Sep 20 09:11:54 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Tue, 20 Sep 2005 09:11:54 +0200 Subject: INETS-How to handle redirection Message-ID: Sanjaya Vitharana wrote: > dbg:tracer(). > dbg:p(all, [call]). > dbg:tpl(httpc_response, redirect, [{'_', [], [{return_trace}]}]). > > > I exactly don't know how to handle above 3 commands (where > can I found how to use the above commands?). http://erlang.se/doc/doc-5.4.8/lib/runtime_tools-1.5.1.1/doc/html/dbg.html or simply 'erl -man dbg' Another way to write the tpl() command would be dbg:tpl(httpc_response, redirect, dbg:fun2ms(fun(_) -> return_trace() end)). /Uffe From ewan_higgs@REDACTED Tue Sep 20 09:51:14 2005 From: ewan_higgs@REDACTED (Ewan Higgs) Date: Tue, 20 Sep 2005 08:51:14 +0100 (BST) Subject: GUIs - ruby on rails, rico In-Reply-To: <3bb44c6e05091913007bdc5d9d@mail.gmail.com> Message-ID: <20050920075115.80018.qmail@web25804.mail.ukl.yahoo.com> > xmlhttp is an object included with most modern > browsers which allows a > scripting engine implemented in the browser to make > asynchronous http > gets, posts etc. it has the name xmlhttp because > microsoft who came up > with it evidently envisioned it for sending around > xml. For what it's worth, a lot of Dashboard widgets on OS X use the XMLHttpRequest object to asynchronously update their state. http://developer.apple.com/macosx/dashboard.html http://developer.apple.com/internet/webcontent/xmlhttpreq.html http://developer.apple.com/samplecode/SampleRSS/SampleRSS.html Wikipedia's entry is suprisingly good for an article on an API: http://en.wikipedia.org/wiki/XMLHttpRequest Ewan ___________________________________________________________ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com From erlang@REDACTED Tue Sep 20 13:47:21 2005 From: erlang@REDACTED (Inswitch Solutions) Date: Tue, 20 Sep 2005 08:47:21 -0300 Subject: Mnesia and dist_auto_connect once Message-ID: <008401c5bdd9$1352bef0$4a00a8c0@Inswitch251> Hi, I've seen some past posts in the list about using "dist_auto_connect once" for the "mnesia partitioned network" issue. I don't clearly understand what kind of problems can be avoided by using that setting, any ideas? 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 francesco@REDACTED Tue Sep 20 16:42:49 2005 From: francesco@REDACTED (Francesco Cesarini (Erlang Training & Consulting)) Date: Tue, 20 Sep 2005 15:42:49 +0100 Subject: Where and how does one find Erlang jobs ? In-Reply-To: <432F3FF9.9040006@mbox304.swipnet.se> References: <3bb44c6e05091913007bdc5d9d@mail.gmail.com> <432F3FF9.9040006@mbox304.swipnet.se> Message-ID: <43301FE9.9030006@erlang-consulting.com> Hi Hakan, if you are interested in a job in London, we are currently looking for four programmers/testers who can start within the next month or so, as well as support staff (We will be posting the descriptions soon). We are also looking for two in Rome, and have a few more jobs in the pipeline in the US. Someone will be calling you soon :-) To receive updates, register at http://www.erlang-consulting.com/jobs_fs.html Francesco -- http://www.erlang-consulting.com H?kan Stenholm wrote: > [I'm posting this somewhat spamish post to this mailing list, as I can't > think of any better or more appropriate place to post it to.] > > > > I'm currently looking for a job (preferably Erlang or some other > non-mainstream language), and would like to notify those who might be > looking for programmers, about my current availability. > > I know a number of ways to find Erlang jobs: > * Check this mailing list - thats how I ended up working on YXA > (http://www.stacken.kth.se/projekt/yxa/) > * Check the Erlang jobs web page > (http://www.erlang-consulting.com/jobs_fs.html) > * Contact known Erlang users, this is a bit trickier, but a fair number > of presumably Erlang using companies can be found by checking > www.erlang.se (certified Erlang users) and by checking for whom the > speakers and participants visiting the "Erlang User Conference", work for. > > With this post I'm mainly trying to reach/contact those that are not > easily reached by the above mentioned methods e.g. those that are not > publicly using Erlang (as mentioned in recent mailing-list posts), > companies that may dismiss me as unsuited as they may not even know that > they use Erlang, etc ... > > Any tips or hints are appreciated. > > =============================================== > > > ___About Me___ > > * Got a Master of science degree in Computer Science, 1998, at Uppsala > university (Sweden). > > * Well versed in C, Java and Erlang. > > * Most noteworthy (Erlang) software development jobs: > > - Four years (1998/09 - 2002/11) working at Ericsson developing Erlang > code for the AXD301 (Multi Service Switch - handling ATM / IP / phone > traffic / frame relay / ...). > - Seven months (2004/09 - 2005/04) working on YXA (IP telephony server) > and CPL at Stockholm university ("Sektionen f?r IT och Media" / > "Division of IT and media services") to complete the initial YXA > version, so that it can be tested. > > * Links to stuff I worked on: > http://www.stacken.kth.se/projekt/yxa/ > http://www.stacken.kth.se/projekt/yxa/cpl_implementation.html > > > ___Contact info___ > > Name: H?kan Stenholm > Email: hakan.stenholm@REDACTED > Address: Stockholm - Sweden > (this is also my preferred work location, but I'm willing to move) > > > > From micke@REDACTED Tue Sep 20 17:23:05 2005 From: micke@REDACTED (Michael Fogeborg) Date: Tue, 20 Sep 2005 17:23:05 +0200 Subject: metacase and erlang Message-ID: <6.2.1.2.0.20050920172211.027ed298@mail.online.no> Has anyone here used metacase in a erlang context ? See www.metacase.com From rprice@REDACTED Tue Sep 20 18:41:38 2005 From: rprice@REDACTED (Roger Price) Date: Tue, 20 Sep 2005 18:41:38 +0200 (CEST) Subject: Module attributes In-Reply-To: Message-ID: On 19 Sep 2005, Bjorn Gustavsson wrote: > > In the Erlang Reference Manual 5.4.6: Clause 4.2 Module Attributes, > > says that a module attribute consists of a tag and a value. -Tag(Term) > I have changed it to say that the values for Module Attributes are > "literal terms". Clause 4.2.3 Macro and Record Definition, says that: "The same syntax as for module definitions is used for macro and record definitions": -record(Record,Fields) where Record is an atom and Fields is a tuple. However the following test program - module (test) . - record (r,{}) . - not_a_record (r,{}) . produces the error message rprice@REDACTED:~> erlc ./test/test.erl test/test.erl:3: bad attribute The -record(.,.) syntax has arity 2 whereas all user-defined attributes have arity one, so may I suggest changing the wording of clause 4.2 from "There exists a number of module attributes with predefined meanings." to "All user-defined module attributes have arity one. There exists a number of module attributes with predefined meanings, some of which have arity two." Roger From ke.han@REDACTED Tue Sep 20 20:38:03 2005 From: ke.han@REDACTED (ke.han) Date: Wed, 21 Sep 2005 02:38:03 +0800 Subject: Module attributes In-Reply-To: References: Message-ID: <4330570B.9080103@redstarling.com> Roger Price wrote: >The -record(.,.) syntax has arity 2 whereas all user-defined attributes >have arity one, so may I suggest changing the wording of clause 4.2 from > >"There exists a number of module attributes with predefined meanings." > >to > >"All user-defined module attributes have arity one. There exists a number >of module attributes with predefined meanings, some of which have arity >two." > > Sounds good. Could you also include a reference to the list of "system" module attributes and their respective arities/param types? thanks, ke han From tty@REDACTED Tue Sep 20 21:37:31 2005 From: tty@REDACTED (tty@REDACTED) Date: Tue, 20 Sep 2005 15:37:31 -0400 Subject: pool:attach connection error. Message-ID: Hello, I am attempting to start a pool with a remote node. Cookies and versions are similar on both hosts; net_adm:world and net_adm:ping return the proper values. However when I try pool:start/1 the call hangs then returns with the following error message: test1.tg.cti.com: Connection refused Can't start node on host 'test1.tg.cti.com' due to timeout At this point I can still manually add the remote node using a pool:attach/1. From here on pool:pspawn acts as normal. Does anyone have any ideas on correcting this ? Thanks tee From harveyd@REDACTED Tue Sep 20 21:49:35 2005 From: harveyd@REDACTED (Dale Harvey) Date: Tue, 20 Sep 2005 20:49:35 +0100 Subject: Post Arguments Message-ID: Sorry to bring up an unaswered thread, but I started playing about with the again, and getting some progress, but i still cant find how to replicate the post information sent by the browser using http:request, it seems pretty close but without being able to find any documentation I cant see what im doing wrong, http:request(post,{Url,[],"application/x-www-form-urlencoded","key1=var1&key2=var2"},[],[]). http:request(post,{Url,[],"application/x-www-form-urlencoded",<<"key1=var1&key2=var2">>},[],[]). are both throwing the same error Reason: {{badmatch,[{"key1","val1"},{"key2","val2"}]},[mymodule,out,1},{yaws_server,deliver_dyn_part,8 .... (mymodule:out/1 is just io:formatting arg for now) I assume its getting close as [{"key1","val1"},{"key2","val2"}] is the format the post args come out when i parse_post data sent from an actual post form. Ive scraped through the inets - http source code, without finding much clues, and nothing on previous newletter / internet searches. also tried formatting the binary data sent when using an actual form [{"key1","val1"},{"key2","val2"}] being sent prints out -> <<107,101,121,49,61,118,97,108,49,38,107,101,121,50,61,118,97,108,50>> as the post body but this wont binary_to_term, I also tried reverse engineering parse post, but having a hard time understanding it -------------- next part -------------- An HTML attachment was scrubbed... URL: From tty@REDACTED Tue Sep 20 22:55:30 2005 From: tty@REDACTED (tty@REDACTED) Date: Tue, 20 Sep 2005 16:55:30 -0400 Subject: pool:attach Message-ID: Hello, Found it. rsh was disabled on the remote host. Changed the erl command line to use ssh and it works fine. Thanks t From ok@REDACTED Wed Sep 21 02:12:02 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 21 Sep 2005 12:12:02 +1200 (NZST) Subject: Module attributes Message-ID: <200509210012.j8L0C2L5262563@atlas.otago.ac.nz> Roger Price wrote: may I suggest changing the wording of clause 4.2 from "There exists a number of module attributes with predefined meanings." to "All user-defined module attributes have arity one. There exists a number of module attributes with predefined meanings, some of which have arity two." If that's going to be touched, how about removing the rather strained "There exists a number of" wording and rewrite as "There are several module attributes with predefined meanings, some of which have arity two, but user-defined module attributes must have arity one." From bjorn@REDACTED Wed Sep 21 12:50:56 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 21 Sep 2005 12:50:56 +0200 Subject: Module attributes In-Reply-To: <200509210012.j8L0C2L5262563@atlas.otago.ac.nz> References: <200509210012.j8L0C2L5262563@atlas.otago.ac.nz> Message-ID: Thanks, Roger and Richard! I used Richard's wording. /Bjorn "Richard A. O'Keefe" writes: > Roger Price wrote: > may I suggest changing the wording of clause 4.2 from > > "There exists a number of module attributes with predefined meanings." > > to > > "All user-defined module attributes have arity one. There > exists a number of module attributes with predefined meanings, > some of which have arity two." > > If that's going to be touched, how about removing the rather strained > "There exists a number of" wording and rewrite as > > "There are several module attributes with predefined meanings, > some of which have arity two, but user-defined module > attributes must have arity one." > > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From ft@REDACTED Wed Sep 21 14:17:05 2005 From: ft@REDACTED (Fredrik Thulin) Date: Wed, 21 Sep 2005 14:17:05 +0200 Subject: Announce: Yxa 0.90pre1 Message-ID: <200509211417.05945.ft@it.su.se> Hi Just wanted to let you know that the Yxa project has reached the pre-release state, after almost three years of snapshots. Read more here : https://lists.su.se/archive/public/yxa-devel/msg00229.html Project homepage : http://www.stacken.kth.se/projekt/yxa/ About : (from the freshmeat entry I just created, so not really worded for you people who already know the benefits of using a high-level language ;) ) Yxa is a SIP-stack and a set of SIP server applications written in Erlang/OTP. The SIP-stack is RFC3261 compliant. Among the features implemented are SIP registrar, SIP router, forking, CPL, IPv6, TLS, ENUM, PSTN gateway access control and modular user database backends. The main goals of the project is to create a robust SIP server platform that can scale to tens of thousands of users, be interoperable through standards compliance and still have short time-to-market for new features due to the use of a high level language. /Fredrik From camster@REDACTED Wed Sep 21 14:17:00 2005 From: camster@REDACTED (Richard Cameron) Date: Wed, 21 Sep 2005 13:17:00 +0100 Subject: GUIs - ruby on rails, rico In-Reply-To: <3bb44c6e05091913007bdc5d9d@mail.gmail.com> References: <3bb44c6e05091913007bdc5d9d@mail.gmail.com> Message-ID: <34D6C7B3-D7A7-4A11-9931-607F7368D772@citeulike.org> On 19 Sep 2005, at 21:00, bryan rasmussen wrote: > xmlhttp is an object included with most modern browsers which allows a > scripting engine implemented in the browser to make asynchronous http > gets, posts etc. it has the name xmlhttp because microsoft who came up > with it evidently envisioned it for sending around xml. One thing I'd love to do would be to build a message passing library for javascript built on top the XMLHttpRequest which can communicate with a server written in Erlang. The idea would be a sort of analogue of what Distel does for Emacs - it fakes up messages and send/receive primitives in such a way that you can see them in elisp. So, typical applications for this library would be web pages which dynamically update when information is "pushed" to them. The simplest toy example might be a stock ticker which updates when the price of the stock actually changes, not just every 60 seconds when the javascript on the web page re-polls. A more ambitious example would be to implement something like SubEthaEdit as a pure-web application. SubEthaEdit is quite a clever little Mac OS X application which allows two users on different machines to simultaneously edit the same text file and see the changes appear in real time. Unfortunately the only way I can think of to get this to work over HTTP turns out to be a bit of a hack. Luckily though, Erlang is probably ideally placed to cope with the hackiness. Perhaps something like this would do the trick: 1) The browser makes an XMLHttpRequest to, say, http://hostname/ encrypted_erlang_process_id/receive 2) That request is handled by Yaws which simply sits and waits for any erlang message destined for the browser. If nothing arrives within a suitably conservative http timeout interval (say 30 seconds), it returns content back over HTTP to indicate that there are no messages. If any messages are pending, it sends them all down the socket over HTTP under some suitable encoding. 3) The browser interprets what it gets back from the XMLHttpRequest and dispatches javascript events corresponding to the underlying Erlang messages. These can handled by the client side javascript. The client then re-polls as in step one, but perhaps acknowledging that it's received the messages so we can have some sort of reliable message delivery system. Additionally, the client-side "send" operation could work making XMLHttpRequest to a separate URL, say http://hostname/ encrypted_erlang_process_id/send So, of course, the hacky bit is trying to turn the HTTP "pull" protocol into a "push" protocol by having the browser spending all its time sitting with an open socket on port 80 waiting for the server to return the next message. Having several thousand open sockets (one for each connected client) at once is the sort of thing which would utterly kill any apache based server infrastructure, but the Yaws propaganda , support for /dev/poll and kqueue in Erlang on certain architectures, and the whole design of Erlang/OTP indicates that it's probably the right tool for this hack. It just strikes me that message passing is probably the right way of thinking when you're trying to build these "AJAX" applications for the web, and if you can get over the particularly grim way of trying to fit it into existing browsers, it might be quite a nice way of working. Does anyone know if anyone's already implement anything like this? Would it even work? Richard. From david.nospam.hopwood@REDACTED Wed Sep 21 15:08:53 2005 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Wed, 21 Sep 2005 14:08:53 +0100 Subject: GUIs - ruby on rails, rico In-Reply-To: <34D6C7B3-D7A7-4A11-9931-607F7368D772@citeulike.org> References: <3bb44c6e05091913007bdc5d9d@mail.gmail.com> <34D6C7B3-D7A7-4A11-9931-607F7368D772@citeulike.org> Message-ID: <43315B65.8070903@blueyonder.co.uk> Richard Cameron wrote: > So, of course, the hacky bit is trying to turn the HTTP "pull" protocol > into a "push" protocol by having the browser spending all its time > sitting with an open socket on port 80 waiting for the server to return > the next message. Having several thousand open sockets (one for each > connected client) at once is the sort of thing which would utterly kill > any apache based server infrastructure, but the Yaws propaganda > , support for /dev/poll and > kqueue in Erlang on certain architectures, and the whole design of > Erlang/OTP indicates that it's probably the right tool for this hack. This will be handled badly by most TCP/IP implementations, even if Erlang and the web server do everything right. -- David Hopwood From spearce@REDACTED Wed Sep 21 15:16:10 2005 From: spearce@REDACTED (Shawn Pearce) Date: Wed, 21 Sep 2005 09:16:10 -0400 Subject: GUIs - ruby on rails, rico In-Reply-To: <34D6C7B3-D7A7-4A11-9931-607F7368D772@citeulike.org> References: <3bb44c6e05091913007bdc5d9d@mail.gmail.com> <34D6C7B3-D7A7-4A11-9931-607F7368D772@citeulike.org> Message-ID: <20050921131610.GA8239@spearce.org> I have done something like this back in the ``old days'' of the web with Netscape 1.1 (it was around 1995 I guess). We created a live chat website which used server-side push to update the client as soon as a new message was available. For those who don't know, server-side push is a special MIME-type created by Netscape and supported in their browser to allow the server to replace the content of an image. This was the first animation on the web, before animated GIFs came along. Here is the really old Netscape webpage on the topic: http://wp.netscape.com/assist/net_sites/pushpull.html At the time we were using ``A Patchy Server'' (NCSA + the initial Apache patches) so prefork was just coming out... there was no way A Patchy Server would handle the load from the number of clients we wanted... so I wrote our own micro-HTTP server based around select; pthreads were used to initially accept connections or to accept send message events from clients; a master distribution thread used select to push data to all of the server-side push connections currently active. Within the client we used HTTP frames (note: not iframes, which today are better visually) to create a 1 pixel high frame at the bottom of the window. JavaScript was used on the client to update the URL of the bottom frame with a ``message'' to send to the server. This message was then posted within the 1 pixel high frame. The result is the server got messages immediately, the user never saw the page refresh, and everyone else saw the update immediately after the master distribution thread caught up. One nice thing was we were able to consistently keep the HTTP server side push channel open to a client for hours at a time. It even worked through many HTTP proxy servers. Problems? Definately. Our largest one was the simple fact that a browser getting data from a server-side push whose current content boundary hasn't terminated wouldn't always render the content right away. See, if you terminate the current part in a server-side push the client assumes the file is over, and when you open the next boundary the client will clear the content and start to redraw again. So we used only 1 content object in the entire multipart/x-mixed-replace stream. Frequent use of

tags caused the clients to redraw pretty much immediately after getting data, but we needed like 8

tags between messages. :-) Many years later I did this again to some extent with iframes; the client used JavaScript to push data into an iframe (which was then visually invisible) and the iframe posted content to the server. The response from the server was HTML+JavaScript to update the client's DOM tree via DHTML. Worked like a charm. But I didn't reimplement the idea of server side push... we were looking into the idea though as we wanted some live feedback indicators in a few places on the GUI. I have never used XMLHttpRequest; I think it became available in Mozilla only after I had finished debugging the iframe implementation. :-( Richard Cameron wrote: > > On 19 Sep 2005, at 21:00, bryan rasmussen wrote: > > >xmlhttp is an object included with most modern browsers which allows a > >scripting engine implemented in the browser to make asynchronous http > >gets, posts etc. it has the name xmlhttp because microsoft who came up > >with it evidently envisioned it for sending around xml. > > One thing I'd love to do would be to build a message passing library > for javascript built on top the XMLHttpRequest which can communicate > with a server written in Erlang. The idea would be a sort of analogue > of what Distel does for Emacs - it fakes up messages and send/receive > primitives in such a way that you can see them in elisp. > > So, typical applications for this library would be web pages which > dynamically update when information is "pushed" to them. The simplest > toy example might be a stock ticker which updates when the price of > the stock actually changes, not just every 60 seconds when the > javascript on the web page re-polls. A more ambitious example would > be to implement something like SubEthaEdit www.codingmonkeys.de/subethaedit/> as a pure-web application. > SubEthaEdit is quite a clever little Mac OS X application which > allows two users on different machines to simultaneously edit the > same text file and see the changes appear in real time. > > Unfortunately the only way I can think of to get this to work over > HTTP turns out to be a bit of a hack. Luckily though, Erlang is > probably ideally placed to cope with the hackiness. Perhaps something > like this would do the trick: > > 1) The browser makes an XMLHttpRequest to, say, http://hostname/ > encrypted_erlang_process_id/receive > 2) That request is handled by Yaws which simply sits and waits for > any erlang message destined for the browser. If nothing arrives > within a suitably conservative http timeout interval (say 30 > seconds), it returns content back over HTTP to indicate that there > are no messages. If any messages are pending, it sends them all down > the socket over HTTP under some suitable encoding. > 3) The browser interprets what it gets back from the XMLHttpRequest > and dispatches javascript events corresponding to the underlying > Erlang messages. These can handled by the client side javascript. The > client then re-polls as in step one, but perhaps acknowledging that > it's received the messages so we can have some sort of reliable > message delivery system. > > Additionally, the client-side "send" operation could work making > XMLHttpRequest to a separate URL, say http://hostname/ > encrypted_erlang_process_id/send > > So, of course, the hacky bit is trying to turn the HTTP "pull" > protocol into a "push" protocol by having the browser spending all > its time sitting with an open socket on port 80 waiting for the > server to return the next message. Having several thousand open > sockets (one for each connected client) at once is the sort of thing > which would utterly kill any apache based server infrastructure, but > the Yaws propaganda , > support for /dev/poll and kqueue in Erlang on certain architectures, > and the whole design of Erlang/OTP indicates that it's probably the > right tool for this hack. > > It just strikes me that message passing is probably the right way of > thinking when you're trying to build these "AJAX" applications for > the web, and if you can get over the particularly grim way of trying > to fit it into existing browsers, it might be quite a nice way of > working. > > Does anyone know if anyone's already implement anything like this? > Would it even work? > > Richard. -- Shawn. "The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man." -- George Bernard Shaw From mickael.remond@REDACTED Wed Sep 21 15:36:56 2005 From: mickael.remond@REDACTED (Mickael Remond) Date: Wed, 21 Sep 2005 15:36:56 +0200 Subject: GUIs - ruby on rails, rico In-Reply-To: <34D6C7B3-D7A7-4A11-9931-607F7368D772@citeulike.org> References: <3bb44c6e05091913007bdc5d9d@mail.gmail.com> <34D6C7B3-D7A7-4A11-9931-607F7368D772@citeulike.org> Message-ID: <433161F8.2010009@erlang-fr.org> Richard Cameron wrote: > So, of course, the hacky bit is trying to turn the HTTP "pull" protocol > into a "push" protocol by having the browser spending all its time > sitting with an open socket on port 80 waiting for the server to return > the next message. Having several thousand open sockets (one for each > connected client) at once is the sort of thing which would utterly kill > any apache based server infrastructure, but the Yaws propaganda > , support for /dev/poll and > kqueue in Erlang on certain architectures, and the whole design of > Erlang/OTP indicates that it's probably the right tool for this hack. That's what I am pushing with J-EAI, ejabberd and out Instant messaging stuff. If you replace HTTP with a bidrectionnal connected protocol you can have realtime feedback from the server in your application. This is how instant messaging application work and this is how you could define enhanced clients that keep the connection with the server, exchanging data in both direction. The XMPP protocol is quite nice for that. -- Micka?l R?mond From joe.armstrong@REDACTED Wed Sep 21 16:15:46 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Wed, 21 Sep 2005 16:15:46 +0200 Subject: GUIs - ruby on rails, rico Message-ID: Yes - this is exactly right. In my "latest and best" web/blog/information thingy is based of the idea of viewing web pages as processes (remember "everything in Erlang is a process") So a blogger template looks likes this: ... ${Title}$ ... ${SideBar}$ ... ... ${Blogs}$ ... ... ${Footer}$ Of course, there is *lots* of crap here but this thing to note is is this a kind of abstraction. But what sort of abstraction? My first blogger viewed a template as a lambda abstraction. ie the ${Title}$ etc in the template are just variables which need to be filled in. So this page is a just a function of the free variables ${Title}$ ${Blogs}$ etc. A more interesting way to view the template is as a process. The variables represet *place markers* to which "things" can be sent. To create a page I say Page = create_page(templateName) Then I can fill in the data Title@REDACTED ! "this is a blog" This sends a "this is a blog" message to the ${Title}$ receptor in Page So I can fill in the values of the fields by sending message to the page. For the recursive case I can send templates to the receptors. So Blog@REDACTED ! {template, "foo"} - puts a foo template inb the Blog receptor of Page. If the template foo has receptors X and Y then I can send message to these as well X@REDACTED@Page ! " some text " I can query a receptor with !! ie Title@REDACTED !! read is shorthand for an RPC that reads the title from page. This all gets to be rather fun in a distruibuted environment. Now all I have to do is implement it - pretty easy given erlang and rico like stuff. BTW - why is it called XMLHTTP? - as far as I can see there is absolutly no requirement for the server responding to requests with XML - the server can reply with any old string that it feels like, and a javascript receptor can do anything it feels like with the result. /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Richard Cameron > Sent: den 21 september 2005 14:17 > To: rasmussen.bryan@REDACTED > Cc: Martin Carlson; erlang-questions@REDACTED > Subject: Re: GUIs - ruby on rails, rico > > > > On 19 Sep 2005, at 21:00, bryan rasmussen wrote: > > > xmlhttp is an object included with most modern browsers > which allows a > > scripting engine implemented in the browser to make > asynchronous http > > gets, posts etc. it has the name xmlhttp because microsoft > who came up > > with it evidently envisioned it for sending around xml. > > One thing I'd love to do would be to build a message passing library > for javascript built on top the XMLHttpRequest which can communicate > with a server written in Erlang. The idea would be a sort of > analogue > of what Distel does for Emacs - it fakes up messages and > send/receive > primitives in such a way that you can see them in elisp. > > So, typical applications for this library would be web pages which > dynamically update when information is "pushed" to them. The > simplest > toy example might be a stock ticker which updates when the price of > the stock actually changes, not just every 60 seconds when the > javascript on the web page re-polls. A more ambitious example would > be to implement something like SubEthaEdit www.codingmonkeys.de/subethaedit/> as a pure-web application. > SubEthaEdit is quite a clever little Mac OS X application which > allows two users on different machines to simultaneously edit the > same text file and see the changes appear in real time. > > Unfortunately the only way I can think of to get this to work over > HTTP turns out to be a bit of a hack. Luckily though, Erlang is > probably ideally placed to cope with the hackiness. Perhaps > something > like this would do the trick: > > 1) The browser makes an XMLHttpRequest to, say, http://hostname/ > encrypted_erlang_process_id/receive > 2) That request is handled by Yaws which simply sits and waits for > any erlang message destined for the browser. If nothing arrives > within a suitably conservative http timeout interval (say 30 > seconds), it returns content back over HTTP to indicate that there > are no messages. If any messages are pending, it sends them all down > the socket over HTTP under some suitable encoding. > 3) The browser interprets what it gets back from the XMLHttpRequest > and dispatches javascript events corresponding to the underlying > Erlang messages. These can handled by the client side > javascript. The > client then re-polls as in step one, but perhaps acknowledging that > it's received the messages so we can have some sort of reliable > message delivery system. > > Additionally, the client-side "send" operation could work making > XMLHttpRequest to a separate URL, say http://hostname/ > encrypted_erlang_process_id/send > > So, of course, the hacky bit is trying to turn the HTTP "pull" > protocol into a "push" protocol by having the browser spending all > its time sitting with an open socket on port 80 waiting for the > server to return the next message. Having several thousand open > sockets (one for each connected client) at once is the sort of thing > which would utterly kill any apache based server infrastructure, but > the Yaws propaganda , > support for /dev/poll and kqueue in Erlang on certain architectures, > and the whole design of Erlang/OTP indicates that it's probably the > right tool for this hack. > > It just strikes me that message passing is probably the right way of > thinking when you're trying to build these "AJAX" applications for > the web, and if you can get over the particularly grim way of trying > to fit it into existing browsers, it might be quite a nice way of > working. > > Does anyone know if anyone's already implement anything like this? > Would it even work? > > Richard. > From spearce@REDACTED Wed Sep 21 17:31:20 2005 From: spearce@REDACTED (Shawn Pearce) Date: Wed, 21 Sep 2005 11:31:20 -0400 Subject: GUIs - ruby on rails, rico In-Reply-To: References: Message-ID: <20050921153120.GA8670@spearce.org> "Joe Armstrong (AL/EAB)" wrote: > BTW - why is it called XMLHTTP? - as far as I can see there is absolutly no > requirement for the server responding to requests with XML - the server can reply with > any old string that it feels like, and a javascript receptor can do anything > it feels like with the result. Because XML is coooooool. Or something like that. Management will purchase anything with a hot buzzword in it, if they had just called it HTTPRequest it wouldn't have gotten management buy-in, as everything was about XML at the time. SOAP was especially cool around 1999. But SOAPHTTPRequest might have been considered to be too specific, so XMLHTTPRequest it is... Why is Erlang called Erlang? :-) Why is Internet Explorer not called Automatic Virus Downloader? -- Shawn. "We learn from history that we learn nothing from history." -- George Bernard Shaw From camster@REDACTED Wed Sep 21 18:13:11 2005 From: camster@REDACTED (Richard Cameron) Date: Wed, 21 Sep 2005 17:13:11 +0100 Subject: GUIs - ruby on rails, rico In-Reply-To: References: Message-ID: <1ED7420F-DA69-4330-8FF0-AD3C7C9B62F7@citeulike.org> On 21 Sep 2005, at 15:15, Joe Armstrong (AL/EAB) wrote: > A more interesting way to view the template is as a process. The > variables > represet *place markers* to which "things" can be sent. > > To create a page I say > > Page = create_page(templateName) > > Then I can fill in the data > > Title@REDACTED ! "this is a blog" > > This sends a "this is a blog" message to the ${Title}$ receptor > in Page ... and you could take this approach to its logical extreme if you're interested in building these really dynamic "AJAX" style applications like, for example: http://www.meebo.com/ http://www.protopage.com/ (the second doesn't seem to like Safari, so you'd need Firefox or even IE) Any browser not completely past its sell-by date will make available the contents of the DOM for inspection and manipulation in javascript. So that's what's happening when these applications dynamically create little floating "div" things which look like windows. They even appear to be dragable by means lots of behind-the- scenes javascript. When you combine this with XMLHttpRequest, you can update little bits of content dynamically from the server without having to regenerate the entire HTML page from the template and send it over the network again. So, if instead of writing your template engine (the thing which spits out fully rendered HTML) as a server-side Erlang thing, you just bit the bullet and implemented it in Javascript then you could have this sort of _Title@REDACTED ! "this is a blog"_ construct actually update the page on the browser as the user looks at it. Your web application turns out to be an Erlang process which keeps track of the raw data which can be sent down to the browser which simply displays it. So an immediately useful consequence of all this is that you could write, for example, a blog posting page with a large textbox which can auto- save your work such that you don't lose it all when you accidentally close the window, or your browser crashes - you've kept the state on the server. It's even vaguely "Model-View-Controller" buzzword compliant, it's just the view happens to live on a completely different machine. Actually, looking on the blogs, it seems that the instant messaging application is implementing pretty much exactly this distributed message passing approach: http://plasser.net/blog/continuous_ajax_requests/ http://blog.meebo.com/?p=23 All the javascript to do this seems to be highly embedded into their application, but it ought to be fairly easy to develop a stand-alone library which implements the message passing primitives - exactly like Distel, but in a browser. Clearly the real magic is going to happen on the server side though. Erlang is the "right" language to think about about writing applications which control the UI by some distributed message passing protocol. It's also going to handle the load a whole lot better than an apache/python implementation. > Now all I have to do is implement it - pretty easy given erlang > and rico > like stuff. ... yes. I'm having exactly the same problem. Always much more difficult when you have to actually do the work. > BTW - why is it called XMLHTTP? - as far as I can see there is > absolutly no > requirement for the server responding to requests with XML - the > server can reply with > any old string that it feels like, and a javascript receptor can do > anything > it feels like with the result. Yes, you can define your own protocol and do what you like with it. The reason it's called "XML" is because the object has a property called "responseXML". If your messages are well-formed XML then you can use the browser's built-in operations to traverse the document tree and generally process the data. There's some argument that the performance benefit of using the native operations in the browser to do this (rather than implementing a parser which has to run as interpreted javascript) might even be worth the cost of lugging lots of verbose XML over the network[*]. All depends on what's in your messages I suppose. If you're transporting complex Erlang expressions then there's a reasonable term <-> lisp s-expression <-> XML mapping which might mean that you end up with something the browser can actually manipulate at the other end without having to write your own erlang term parser in javascript. The downside to all that is that different XML libraries are available in different browsers, so you have bit of a nightmare checking it's all cross-platform. Richard. [*] - although the standard trick of compressing verbose content with zlib as it's actually transported over the network should work fine here. See for an Apache implementation. From chsu79@REDACTED Wed Sep 21 18:19:59 2005 From: chsu79@REDACTED (Christian S) Date: Wed, 21 Sep 2005 18:19:59 +0200 Subject: GUIs - ruby on rails, rico In-Reply-To: References: Message-ID: 2005/9/21, Joe Armstrong (AL/EAB) : > BTW - why is it called XMLHTTP? - as far as I can see there is absolutly no > requirement for the server responding to requests with XML - the server can reply with > any old string that it feels like, and a javascript receptor can do anything > it feels like with the result. Because of this method on the object: readonly attribute Document responseXML [From http://www.whatwg.org/specs/web-apps/current-work/#scripted-http] It was probably believed that XML would be the best and the only way for message passing. There are alternatives such as JSON. [JSON http://www.crockford.com/JSON/index.html] I guess nothing stops us from just calling the object HttpRequest... except the induced confusion. From camster@REDACTED Wed Sep 21 18:28:04 2005 From: camster@REDACTED (Richard Cameron) Date: Wed, 21 Sep 2005 17:28:04 +0100 Subject: GUIs - ruby on rails, rico In-Reply-To: <43315B65.8070903@blueyonder.co.uk> References: <3bb44c6e05091913007bdc5d9d@mail.gmail.com> <34D6C7B3-D7A7-4A11-9931-607F7368D772@citeulike.org> <43315B65.8070903@blueyonder.co.uk> Message-ID: <478D67DF-CB8B-4545-907F-2A65089D64A5@citeulike.org> On 21 Sep 2005, at 14:08, David Hopwood wrote: >> , support for /dev/ >> poll and >> kqueue in Erlang on certain architectures, and the whole design of >> Erlang/OTP indicates that it's probably the right tool for this >> hack. >> > > This will be handled badly by most TCP/IP implementations, even if > Erlang > and the web server do everything right. What's the problem? If we equip the server with HTTP keepalives then then the subsequent XMLHttpRequest should reuse the socket from the previous request. All we've got is several thousand persistent sockets connected to a listening process on a server. It's the same sort of engineering challenge ejabberd has in trying to keep lots of connections open at once - and it seems to cope extremely well. Richard. From meena_selvam@REDACTED Wed Sep 21 20:29:57 2005 From: meena_selvam@REDACTED (MEENA SELVAM) Date: Wed, 21 Sep 2005 11:29:57 -0700 (PDT) Subject: How to get rid of this badarg error Message-ID: <20050921182957.75732.qmail@web30409.mail.mud.yahoo.com> I have some code as follows: 1 {CookieInt, _} = string:to_integer(CookieStr), 2 io:format("[CookieInt] = ~p~n", [CookieInt]), 3 [CacheEntry] = ets:lookup(aaa_cache,CookieInt), where CookieInt is printed as 15063539827397697793 I get an error at Line 3 as follows Unrecognised error: {badarg,[{ets,lookup,[aaa_cache,15063539827397697793]}, {ssl_xnet_cmd,'-user_kick/2-fun-0-',1}, {lists,foreach,2}, ... ... Where as when I type [CacheEntry] = ets:lookup(aaa_cache, 15063539827397697793). at the erlang shell it fetches the record correctly from the aaa_cache table, where 15063539827397697793 is the key. So what is CookieInt at line 1. Is it an atom or variable. I supposed it was a variable and hence used it line 3. But I do not understand why it does not work? Any suggestions or comments to get out of this problem? PS; the CookieStr in line 1 was derived from these code. I think, these may not be relevant to the problem: A= binary_to_list(Cookie), io:format("[A] = ~p~n", [A]), % A is printed as ed5f793776732.15063539827397697793 Index = string:chr(A,$.), CookieStr = string:substr(A, Index+1), meena __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com From ulf.wiger@REDACTED Wed Sep 21 21:24:27 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 21 Sep 2005 21:24:27 +0200 Subject: How to get rid of this badarg error Message-ID: MEENA SELVAM wrote: > > I have some code as follows: > > 1 {CookieInt, _} = string:to_integer(CookieStr), > 2 io:format("[CookieInt] = ~p~n", [CookieInt]), > 3 [CacheEntry] = ets:lookup(aaa_cache,CookieInt), > > where CookieInt is printed as 15063539827397697793 > I get an error at Line 3 as follows > > Unrecognised error: > {badarg,[{ets,lookup,[aaa_cache,15063539827397697793]}, > > {ssl_xnet_cmd,'-user_kick/2-fun-0-',1}, > {lists,foreach,2}, Who is the owner of the ETS table aaa_cache, and what is its protection mode (private, public or protected)? /Uffe From david.nospam.hopwood@REDACTED Wed Sep 21 22:06:44 2005 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Wed, 21 Sep 2005 21:06:44 +0100 Subject: GUIs - ruby on rails, rico In-Reply-To: <478D67DF-CB8B-4545-907F-2A65089D64A5@citeulike.org> References: <3bb44c6e05091913007bdc5d9d@mail.gmail.com> <34D6C7B3-D7A7-4A11-9931-607F7368D772@citeulike.org> <43315B65.8070903@blueyonder.co.uk> <478D67DF-CB8B-4545-907F-2A65089D64A5@citeulike.org> Message-ID: <4331BD54.1010600@blueyonder.co.uk> Richard Cameron wrote: > On 21 Sep 2005, at 14:08, David Hopwood wrote: > >>> , support for /dev/ poll and >>> kqueue in Erlang on certain architectures, and the whole design of >>> Erlang/OTP indicates that it's probably the right tool for this hack. >> >> This will be handled badly by most TCP/IP implementations, even if >> Erlang and the web server do everything right. > > What's the problem? Actually I may have been mistaken; it seems you can get to 10000 connections fairly easily if using kqueue: -- David Hopwood From david.nospam.hopwood@REDACTED Wed Sep 21 22:12:37 2005 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Wed, 21 Sep 2005 21:12:37 +0100 Subject: GUIs - ruby on rails, rico In-Reply-To: <20050921153120.GA8670@spearce.org> References: <20050921153120.GA8670@spearce.org> Message-ID: <4331BEB5.2030208@blueyonder.co.uk> Shawn Pearce wrote: > "Joe Armstrong (AL/EAB)" wrote: > >> BTW - why is it called XMLHTTP? - as far as I can see there is absolutly no >>requirement for the server responding to requests with XML - the server can reply with >>any old string that it feels like, and a javascript receptor can do anything >>it feels like with the result. > > Because XML is coooooool. Or something like that. Management will > purchase anything with a hot buzzword in it, if they had just > called it HTTPRequest it wouldn't have gotten management buy-in, > as everything was about XML at the time. Why would it need to get management buy-in? This is low-level stuff that should be left to the techies in any sanely run company... (...oh, right, I see what assumption I'm making ;-) > SOAP was especially cool around 1999. But SOAPHTTPRequest might have been > considered to be too specific, so XMLHTTPRequest it is... > > Why is Erlang called Erlang? :-) > Why is Internet Explorer not called Automatic Virus Downloader? Dunno. -- David Hopwood From ok@REDACTED Thu Sep 22 07:47:35 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 22 Sep 2005 17:47:35 +1200 (NZST) Subject: Making Erlang records more reliable Message-ID: <200509220547.j8M5lZ0X247668@atlas.otago.ac.nz> Improving the reliability of Erlang records. Now that people want to print Erlang records in a way that reflects the original record declaration, we are finding that many record names are used over and over again (especially 'state'), so that it is not possible to figure out which declaration to use given just the record name and arity. The model for Erlang records goes like this: 1. Record forms are introduced by a declaration -record(Name, {Field1(=Default1),...,FieldN(=DefaultN)}). They are a function of the preprocessor rather than being a real built-in data type. 2. A record with N fields is represented by a tuple with N+1 elements, where the last N elements of the tuple correspond in order to the N fields of the record. The first field of the record holds a tag. The tag is supposed to identity the record and make it unlikely that a record pattern will accidentally unify with a record of a different type. 3, A record tag is an atom. 4. A record tag is the declared name of the record type. We could change each of these decisions. 1. We could introduce a proper type for records. I have written an unpublished paper about this, but not implemented it. Basically, is like a tuple {Descriptor,Val1,...,ValN} except that Descriptor points to something like a tuple {Name,Field1,...,FieldN}, the field names having first been sorted in both cases. This is as space-efficient as current Erlang records, and rather more robust (if you add a field to a record, code that matches against it just keeps working), but it is not as time-efficient because name matching happens at run time. However, fetching k fields out of a record with n fields is still O(n+k), so when most of the fields are of interest it's not too bad. 2. There is no law of nature that says the tag information has to be a single field. We could use {Name,Source,Field1,...,FieldN} where Source is some kind of code derived from the place where the record type is declared. However, it makes a lot of sense that pattern matching, after checking the arity, should match the tag first, so making the tag the first (or first few) elements is a good idea. And using tuples makes more sense than lists, while Erlang has nothing other than tuples or lists to choose from. 3. A tag could be some other kind of value. It could be a {Name,Module} pair. Tag comparison has to be fast, so it has to be an atom, an immediate number, or something else that compares fast. It is tempting to suggest a reference, but we want two Erlang nodes that use the same record type to use the same tag, even before they first communicate. This rules out most alternatives. 4. The tag is exactly the record name. This decision avoids invention, but it results in conflct. To me it seems obvious both that 1 is the right thing to do long term, but that in order to get something useful as quickly as possible, the smallest change that could possibly work is to overturn point 4. Instead of the atom being the record name, it will include it, but it will or may include other stuff as well. However, the record tag has to be derived from available information in such a way that all Erlang compilers on all Erlang nodes can generate the same tag. Step 1: introduce a new preprocessor declaration, -record_tag/2. We start by adding a new preprocessor declaration form. -record_tag(RecordName, TagName). Within a module there may be at most one explicit -record_tag declaration for each record type. In fact each record type visible in a module will have exactly one -record_tag declaration; the others will be generated implicitly. For any given TagName known in a module, there must be exactly one (explicit or implicit) -record_tag declaration. One effect of this declaration is to define a new macro as if by -define(RecordName_TAG, TagName). For example, -record_tag(state, 'WFTP_Control_State'). not only tells the -record code to use 'WFTP_Control_State' as the tag for #state, but also does -define(state_TAG, 'WFTP_Control_State'). The purpose of this macro is to allow is_record(Expr, state) to be replaced by is_record(Expr, ?state_TAG). I have wondered whether -define(is_RecordName(X), is_record(X, TagName)). might be better, but we are talking about the least possible change here. It is a fatal error if a -record_tag declaration follows the corresponding -record declaration. If there is a -record_tag declaration for which there is no corresponding -record declaration, a warning message should be issued, but this need not be a fatal error. A -record_tag declaration must be in exactly the same file as its corresponding -record declaration. This means that it is impossible for a record declaration in a .hrl file to be given one tag in one module and another tag in another module. The -record_tag declaration is NOT intended for normal use. It has two intended uses: (a) as a transition tool for moving from the current scheme to the (slightly) improved scheme. (b) as an escape hatch for rare cases when the implicitly generated tags conflict or do not carry necessary information. Step 2. Implicit -record_tag declarations. If there is a -record declaration with no explicit -record_tag declaration preceding it, it might be intended as a private declaration for use within the containing module only, or it might be intended for sharing with other modules. The preprocessor can use a simple rule to tell these cases apart. Any -record declaration that is meant to be shared between modules must be in an -included file; any -record declaration that is not -included must be intended to be private. The default tag for a private record type is ':#'. The default tag for a shared record type is '#'. What is the magic code? Ideally, we would like to ensure that two tags are the same if and only if the corresponding -record declarations are the same. It would be nice to base this on the identity of the file containing the declaration, but thanks to hard links, symbolic links, aliases, and networked file systems, it is possible for a file to have many different names. The present scheme checks that the record name is the same and the number of fields is the same, but it does not check for the names of the fields or their order. So if we have -record(foo, {a, b}). in one module and -record(foo, {b,a}). in another module, a #foo{a=1,b=2} in the first will be mistaken for a #foo{b=1,a=2} in the second. So at a minimum the should depend on the names of the fields and their order. Some hash code based on [Field1,...,FieldN] should suffice. (One obvious alternative would be to encode the actual field names, but it would then be tempting to rely on that for decoding, but for the sake of backwards compatibility and to cope with -record_tag declarations, it's better that the field names should never be visible in the tag name although they should influence it. At this time I do not want to say anything about the hashing algorithm, except to note that 30 to 60 bits of hash code encoded in Base 64 should be adequate. This scheme does not prevent collision, although it should be very unlikely. In any situation where the implicit tag is unsatisfactory, you can povide an explicit one. If someone wanted to use 'state@REDACTED' as a tag name, I'm not going to stop them. The only effect of these changes is to change the atom that is used as the tag for a record declaration. Everything else done by the compiler remains unchanged, the instruction set remains unchanged, and the emulator remains unchanged. HiPE would be unchanged. Even the way the compiler handles is_record would be unchanged. Step 3. The record-printing code has to learn how to undo tags. Somehow the present setup conveys to the run-time system "in module so-and- so, tag name such-and-such is associated with these fields." This has to be changed slightly to "in module so-and-so, tag name such-and-such is associated with record name thingy having these fields." In fact it should usually be possible to ignore the module name. Evaluation. This is not a perfect scheme. Collision is still possible, but it is unlikely, and if it does happen a manual -record_tag can fix it up. However, it satisfies one major requirement: WE CAN GET THERE FROM HERE. The first stage adds -ifdef("this is an Erlang version that understands -record_tag"). -record_tag(rname, rname). ... -else. -define(rname_TAG, rname). ... -endif. to each file containing at least on -record declaration. These extra declarations ensure that code compiled using the new preprocessor will use the same tags as code compiled using the old one. These patches can be automatically generated! The second stage is to go through all the code fixing up is_record/2 tests. When we are finally ready to switch over to the new system, the third stage is to remove the preprocessor lines added in the first stage, which can again be an automatic process. What this doesn't help with, of course, is people taking records apart or building them with hand-written code. However, because design properties 1, 2, 3 are preserved, data-walking functions that know about records in general as opposed to specific record types should not be affected, and thanks to the implied -define of _TAG, even code that does build or match records "by hand" should be comparatively easy to convert. From yerl@REDACTED Thu Sep 22 08:19:39 2005 From: yerl@REDACTED (yerl@REDACTED) Date: Thu, 22 Sep 2005 08:19:39 +0200 Subject: GUIs - ruby on rails, rico Message-ID: An HTML attachment was scrubbed... URL: From erik.reitsma@REDACTED Thu Sep 22 11:11:26 2005 From: erik.reitsma@REDACTED (Erik Reitsma (RY/ETM)) Date: Thu, 22 Sep 2005 11:11:26 +0200 Subject: Mnesia query: less or equal than given key Message-ID: <110BA8ACEE682C479D0B008B6BE4AEB10C1503@esealmw107.eemea.ericsson.se> It works very nicely, thanks! I was not aware that mnesia:dirty_prev/2 would work like this. > Erik Reitsma wrote: > > > > Using mnesia, is there an efficient way to find the smallest > > entry in a table with a key equal to or less than a given key? > > It appears as if you intended to write "the _largest_ entry > with a key equal to or less than a given key". Yes, you understood me correctly. :) > > So suppose that I have keys 10, 23, 33, 34, 56, 100 and I > > look for 26, I want to get 23 back. If I look for 23, I > should get 23. > > Here's a first suggestion: > > (ord@REDACTED)3> mnesia:create_table(test,[{type, ordered_set}]). > {atomic,ok} > (ord@REDACTED)4> [mnesia:dirty_write({test,N,a}) ||?N <- > [10,23,33,34,56,100]]. > [ok,ok,ok,ok,ok,ok] > (ord@REDACTED)5> F = fun(N) -> > mnesia:transaction( > fun() -> > case mnesia:read({test,N}) of > [] -> > case mnesia:dirty_prev(test,N) of > '$end_of_table' -> []; > Prev -> mnesia:read({test,Prev}) > end; [Obj] -> Obj > end > end) > end. > #Fun > (ord@REDACTED)6> F(26). > {atomic,[{test,23,a}]} > (ord@REDACTED)7> F(23). > > {atomic,{test,23,a}} > (ord@REDACTED)8> > > > It's not 100% safe, since dirty_prev bypasses the > transaction store, while the second read() doesn't. I will be accessing the table from one process anyway, so there should not be a problem. *Erik. From mats.cronqvist@REDACTED Thu Sep 22 11:25:28 2005 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Thu, 22 Sep 2005 11:25:28 +0200 Subject: Parallel Language In-Reply-To: <9c124dc9da8d069a681a2ab6f076b9f4@ezabel.com> References: <9c124dc9da8d069a681a2ab6f076b9f4@ezabel.com> Message-ID: <43327888.60404@ericsson.com> fwaiw, i would write the math stuff in C and run it in a c-node. i do that in gtkNode (in jungerl) and it's quite cool. mats orbitz@REDACTED wrote: > I apologize if my question is a bit too off-topic for this forum. > However, my question is related to concurrency in some way and I > thought, perhaps, people exposed to Erlang would have good suggestions. > I am looking for a language similar to Erlang in concept. However I > would like to do CPU intensive mathematical computations with it. I > would like to be able to easily communicate with nodes on the cluster > which is something that Erlang does quite well. One possibility is to > write the CPU intensive stuff in C and interface it with Erlang, but if > there is a language which does all of this for me, well, that would be > great. I have come across ZPL > > http://www.cs.washington.edu/research/zpl/home/index.html > > However it does not appear to be stable yet or there is not much > documentation on it. Any other suggestions would be appreciated. > > Thank you. > From joe.armstrong@REDACTED Thu Sep 22 12:10:05 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Thu, 22 Sep 2005 12:10:05 +0200 Subject: Template language proposal Message-ID: Here is a proposal for a template language (suitable for yaws) Here is a file mis.template - it contains two templates main and bar @module misc @template main(E)

Example

Factorial is I suppose and M = . @template bar(X)

@code fac(0) -> 0; fac(N) -> N * fac(N-1). Semantics means evaluate Expr1, Expr2 in order, the result is the result of evaluating ExprN - this value is pasted into the doument - and bindings created in evaluation Expr1,... are carried forward. It is expanded into: -module(misc). -export([test/0, main/1, bar/1]). test() -> binary_to_list(list_to_binary(main(""))). main(E) -> V1 = s(<<"\n">>), V2 = s(begin M = 30, N=20, "" end), V3 = s(<<"

Example

\n

Factorial ">>), V4 = s(begin N end), V5 = s(<<" is ">>), V6 = s(begin fac(N) end), V7 = s(<<" I supppose and M = ">>), V8 = s(begin M end), V9 = s(begin bar(fac(M)) end), [V1,V2,V3,V4,V5,V6,V7,V8,V9]. bar(X) -> V1 = s(<<"
">>), V2 = s(begin X end), V3 = s(<<"
">>), [V1,V2,V3]. fac(0) -> 1; fac(N) -> N * fac(N-1). s(N) when integer(N) -> integer_to_list(N); s(N) when atom(N) -> atom_to_list(N); s(N) -> N. Evaluating misc:test() yields > misc:test(). "\n

Example

\n

Factorial 20 is 2432902008176640000 I supppose and M = 30
265252859812191058636308480000000
" As expected Cheers /Joe From joelr1@REDACTED Thu Sep 22 12:12:59 2005 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 22 Sep 2005 12:12:59 +0200 Subject: OpenPoker is now truly open Message-ID: <65E1ED8E-BE36-482D-80F8-EB4180976481@gmail.com> Folks, I released OpenPoker under a dual GPL/commercial license today. The project is not bringing in much money and poker engines are a commodity item. I still think that Erlang is the best language for a truly scalable poker server and will be maintaining OpenPoker going forward. The source code is at http://wagerlabs.com/openpoker.tgz. Your comments and review are very welcome. I hope folks new to Erlang could learn from OpenPoker and see what can actually be done in Erlang. I'm also looking for a development job in Sweden and will entertain all reasonable offers. Thanks, Joel From rasmussen.bryan@REDACTED Thu Sep 22 12:59:13 2005 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Thu, 22 Sep 2005 12:59:13 +0200 Subject: OpenPoker is now truly open In-Reply-To: <65E1ED8E-BE36-482D-80F8-EB4180976481@gmail.com> References: <65E1ED8E-BE36-482D-80F8-EB4180976481@gmail.com> Message-ID: <3bb44c6e05092203591de8ed69@mail.gmail.com> I've often thought Erlang would be the language for running an army of poker-bots. On 9/22/05, Joel Reymont wrote: > Folks, > > I released OpenPoker under a dual GPL/commercial license today. The > project is not bringing in much money and poker engines are a > commodity item. I still think that Erlang is the best language for a > truly scalable poker server and will be maintaining OpenPoker going > forward. > > The source code is at http://wagerlabs.com/openpoker.tgz. Your > comments and review are very welcome. > > I hope folks new to Erlang could learn from OpenPoker and see what > can actually be done in Erlang. I'm also looking for a development > job in Sweden and will entertain all reasonable offers. > > Thanks, Joel > > From joelr1@REDACTED Thu Sep 22 13:05:54 2005 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 22 Sep 2005 13:05:54 +0200 Subject: OpenPoker is now truly open In-Reply-To: <3bb44c6e05092203591de8ed69@mail.gmail.com> References: <65E1ED8E-BE36-482D-80F8-EB4180976481@gmail.com> <3bb44c6e05092203591de8ed69@mail.gmail.com> Message-ID: Right. You can try adapting bot.erl to the purpose. Bots run from a script now but AI could be added. On Sep 22, 2005, at 12:59 PM, bryan rasmussen wrote: > I've often thought Erlang would be the language for running an army of > poker-bots. From joelr1@REDACTED Thu Sep 22 13:48:00 2005 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 22 Sep 2005 13:48:00 +0200 Subject: OpenPoker is now truly open In-Reply-To: <200509221343.33417.henk@erlfinsys.net> References: <65E1ED8E-BE36-482D-80F8-EB4180976481@gmail.com> <200509221343.33417.henk@erlfinsys.net> Message-ID: <4A9282C9-6C01-4CB5-A169-3B4A32D1F00C@gmail.com> Henk, You can recompile the source code. Did you try that? Download from http://wagerlabs.com/openpoker.tgz Thanks, Joel On Sep 22, 2005, at 1:43 PM, Henk Bijker wrote: > Using R9C, SuSE 9.3 :( > > =ERROR REPORT==== 22-Sep-2005::13:39:52 === > beam/beam_load.c(1091): Error loading module game: > use of opcode 109; this emulator supports only up to 108 > > ** exited: {undef,[{game,setup,[2,20,{1,10,20},10000,15000,10]}, > {schema,install,1}, > {erl_eval,do_apply,5}, > {shell,eval_loop,2}]} ** > > =ERROR REPORT==== 22-Sep-2005::13:39:52 === > Loading of /home/henk/games/openpoker/openpoker-0.95.0/game.beam > failed: > badfile From joelr1@REDACTED Thu Sep 22 14:47:08 2005 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 22 Sep 2005 14:47:08 +0200 Subject: OpenPoker is now truly open In-Reply-To: <3bb44c6e05092203591de8ed69@mail.gmail.com> References: <65E1ED8E-BE36-482D-80F8-EB4180976481@gmail.com> <3bb44c6e05092203591de8ed69@mail.gmail.com> Message-ID: Folks, If you are not seeing the Erlang source code in openpoker.tgz then download http://wagerlabs.com/openpoker-0.96.0.tgz directly. Thanks, Joel From vlad.xx.dumitrescu@REDACTED Thu Sep 22 15:41:10 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Thu, 22 Sep 2005 15:41:10 +0200 Subject: Template language proposal Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE655@esealmw105.eemea.ericsson.se> Hi, I think it's an interesting proposal. However, I feel that code shouldn't be present in a template... See www.stringtemplate.org. There's a nice presentation called "Enforcing Strict Model-View Separation in Template Engines" which describes this point of view. I had started to implement this in Erlang, but choked on the parser (which is not trivial) and later moved to other projects... regards, Vlad From surindar.shanthi@REDACTED Thu Sep 22 16:09:12 2005 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Thu, 22 Sep 2005 19:39:12 +0530 Subject: Clarify my doubt please Message-ID: <42ea5fb6050922070970455dcd@mail.gmail.com> Please reply me: 1) [1,2,3,4] is a list,whether "surindar" is list.If yes tell me how?(Please apologise me if the question is very silly.Im just now started learning Erlang). 2) give me some details about monitoring&demonitoring with some simple examples. 3)What is meant by group leader in Erlang? -------------- next part -------------- An HTML attachment was scrubbed... URL: From harrisbhatti@REDACTED Thu Sep 22 16:53:26 2005 From: harrisbhatti@REDACTED (M. Harris Bhatti) Date: Thu, 22 Sep 2005 15:53:26 +0100 Subject: Clarify my doubt please In-Reply-To: <42ea5fb6050922070970455dcd@mail.gmail.com> References: <42ea5fb6050922070970455dcd@mail.gmail.com> Message-ID: I am also new to erlang however I can answer your first query, Both [1,2,3,4] and "surindar" are lists. In erlang there is no data type to represent a string instead strings are represented as a list of characters/their ascii codes and if a list contains a number of ascii codes then "" (double quotes) are used to easily represent such lists. On 9/22/05, Surindar Sivanesan wrote: > Please reply me: > 1) [1,2,3,4] is a list,whether "surindar" is list.If yes tell me > how?(Please apologise me if the question is very silly.Im just now started > learning Erlang). > 2) give me some details about monitoring&demonitoring with some simple > examples. > 3)What is meant by group leader in Erlang? > > > -- Regards, Harris M. Bhatti From rprice@REDACTED Thu Sep 22 18:43:38 2005 From: rprice@REDACTED (Roger Price) Date: Thu, 22 Sep 2005 18:43:38 +0200 (CEST) Subject: Making Erlang records more reliable In-Reply-To: <200509220547.j8M5lZ0X247668@atlas.otago.ac.nz> Message-ID: This seems to me to be a most interesting proposal. I implemented something similar in a pi-calculus language for which I developed an Erlang emulator. There were some syntactic differences about which we need not waste time, but there were also some typing differences. 1. The pi-calculus language is strictly typed, but is comfortably translated to dynamically typed Erlang. I believe that simplicity and dynamic typing are part of the strengths of Erlang and I do not wish to change this. 2. I distinguished [1] between the type function, represented by the tag, which maps the record type to the defined type, and name of the defined type. SGML and XML do not make this separation, confusing the two ideas. In an Erlang-like notation, this could be expressed as -record(DefinedType,Tag,TupleType) where Tag is the name of a type function Tag : TupleType -> DefinedType I understand that this is the intent of the proposed new declaration -record_tag(RecordName,TagName) which taken with the existing declaration -record(TagName,Tuple) provide the type function TagName : Tuple -> RecordName 3. I found that converging the ideas of elements and records, and replacing the SGML/XML world's validation-by-parsing by type checking provides additional safety assurances than cannot be achieved by SGML/XML techniques. 4. Rather than make a lot of experimental changes to the Erlang language, I would personally prefer to see such ideas included in a strictly typed subset of Erlang which could be (automatically) type checked before re-issue as "true" Erlang. Maybe in the long term the ideas will also appear in the Erlang language, but an experimental front end would be helpful in the short term. I started work on such a front end, but I have so far made little progress. _________________________________________________________________________ On Thu, 22 Sep 2005, Richard A. O'Keefe wrote: > What this doesn't help with, of course, is people taking records apart > or building them with hand-written code. If I understand the proposal correctly the combined effect of -record_tag and -record is similar to ML's datatype declaration: datatype DefinedType = Tag of TupleType ML datatypes are conveniently deconstructed using hand-written pattern matching, which seems to me to be a natural way of deconstructing elements. Such deconstructions will be difficult to avoid. _________________________________________________________________________ On Thu, 22 Sep 2005, Joe Armstrong wrote: Here is a proposal for a template language (suitable for yaws) @module misc @template main(E)

Example

...
@code fac(0) -> 0; fac(N) -> N * fac(N-1). If the "" syntax of records were sufficiently developed, it would be possible not only to write such a template in Erlang, but to perform a thorough type check validation of the elements and their attributes against the code; something which is difficult in independent template languages. Roger [1] Pint User's Guide, http://rogerprice.org/pint/pint.pdf, "Element type declaration", page 37. From joelr1@REDACTED Thu Sep 22 22:43:17 2005 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 22 Sep 2005 22:43:17 +0200 Subject: Dissecting OpenPoker Message-ID: <113D5EF5-3C88-4913-A5A7-5D1CD6CABF86@gmail.com> Folks, I wrote some articles dissecting the OpenPoker architecture and explaining how I'm achieving scalability, load balancing and fault tolerance with Erlang. I'm planning to write some articles for game development magazines as well since the same ideas can be used for building massively multiplayer game servers. Last but not least, I plan to write a paper and present at the Erlang User Conference in November. Please see the articles at http://wagerlabs.com/w/openpoker under Dissecting OpenPoker. Thanks, Joel -- http://wagerlabs.com/ From edmundd@REDACTED Fri Sep 23 05:31:26 2005 From: edmundd@REDACTED (Edmund Dengler) Date: Thu, 22 Sep 2005 23:31:26 -0400 (EDT) Subject: Segmentation fault on Linux Message-ID: Howdy folks! I am getting segmentation errors when trying to run using OTP 10B-6 and 10B-7 on Linux. I can compile 10B-5 with no problems. Anybody have any ideas on what may be causing this? Details: - Gentoo Linux (2.6.8-gentoo-r3) - gcc version 3.3.5 - compile flags: ./configure --prefix=/opt/pkgs/erlang/10b-6 I did notice a previous message on this (http://www.erlang.org/ml-archive/erlang-questions/200410/msg00057.html) but no solution seemd to be posted. Regards! Ed From bjorn@REDACTED Fri Sep 23 08:12:07 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 23 Sep 2005 08:12:07 +0200 Subject: Segmentation fault on Linux In-Reply-To: References: Message-ID: Could you please run gdb on the core dump and print the stack backtrace so that we can see where it crashed? /Bjorn Edmund Dengler writes: > Howdy folks! > > I am getting segmentation errors when trying to run using OTP 10B-6 > and 10B-7 on Linux. I can compile 10B-5 with no problems. Anybody have any > ideas on what may be causing this? > > Details: > - Gentoo Linux (2.6.8-gentoo-r3) > - gcc version 3.3.5 > - compile flags: > ./configure --prefix=/opt/pkgs/erlang/10b-6 > > I did notice a previous message on this > (http://www.erlang.org/ml-archive/erlang-questions/200410/msg00057.html) > but no solution seemd to be posted. > > Regards! > Ed > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From raimo@REDACTED Fri Sep 23 13:45:56 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 23 Sep 2005 13:45:56 +0200 Subject: Clarify my doubt please References: <42ea5fb6050922070970455dcd@mail.gmail.com> Message-ID: surindar.shanthi@REDACTED (Surindar Sivanesan) writes: > Please reply me: > 1) [1,2,3,4] is a list,whether "surindar" is list.If yes tell me how?(Please > apologise me if the question is very silly.Im just now started learning > Erlang). "surindar" is syntactical sugar for (the same as) [$s,$u,$r,$i,$n,$d,$a,$r] ($s i the ASCII code for the character s). > 2) give me some details about monitoring&demonitoring with some simple > examples. A monitor is a one-directional supervision link. When you have executed erlang:monitor/2 you are guaranteed to receive a {'DOWN',Mref,_,_,_} message if the process you tried to monitor did not exist or when it ceases to exist for any reason. After you have executed erlang:demonitor/1, you may have a {'DOWN',Mref,_,_,_} in the receive queue, but you will not get one later. You can set any number of monitors on a process from a process and they are independant of each other. The returned Mref is your handle to a specific monitor. To compare with process links where there can be only one link between any pair of two processes, so you can not reliably set a link in a library function because the library function has no idea of whether the process may have a process link to another process or not. Example of server start of a server with a registered name: start_server() -> Parent = self(), Child = spawn(fun() -> register(my_server_name, self()), Parent ! {self(), registered}, server_loop() end), Mref = erlang:monitor(process, Child), receive {Child,registered} -> %% Demonitor and cleanup stray DOWN message just in case. erlang:demonitor(Mref), receive {'DOWN',Mref,_,_,_} -> ok after 0 -> ok end, %% Now we know that the server managed to register %% its name. {ok,Child}; {'DOWN',Mref,_,_,_} -> %% Now we know the server failed to start, most %% probably because the register/2 failed, because %% another instance of the server was already started. {error,already_started} end. server_loop() -> %% loop the loop... > 3)What is meant by group leader in Erlang? The group leader for an Erlang process corresponds to standard output for a Unix process. The group leader is the default receiver of printout from e.g io:format/2. -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From luke@REDACTED Fri Sep 23 17:00:33 2005 From: luke@REDACTED (Luke Gorrie) Date: 23 Sep 2005 17:00:33 +0200 Subject: Parse transformery (Was: Re: Calling internal functions - foo::bar() ?) References: <200503071936.j27JaCQ4010970@spikklubban.it.uu.se> Message-ID: Luke Gorrie writes: > Of course I have hacked the shell to support this interface (patch > below) but it can also be used in a more klunky way: MY GOD I NEED TO LEARN TO PROGRAM. > --- erl_eval.erl.orig 2005-03-08 01:40:58.000000000 +0100 > +++ erl_eval.erl 2005-03-08 02:20:00.000000000 +0100 > @@ -396,7 +396,32 @@ > %% ExternalFuncHandler = {value,F} | none. > %% MF is a tuple {Module,Function} or a fun. > > -do_apply(Func, As, Bs0, Ef, RBs) -> > +do_apply({Mod,Func}, As, Bs0, Ef, RBs) -> [ ... ] > + end. > + > +do_apply1(Func, As, Bs0, Ef, RBs) -> You don't need to be a dializer to see that calling funs from my erlang shell has been broken since march. Updated erl_eval patch is attached in case someone is using the parse transform. (I'm still stuck in R9B-0 land for the moment now.) -------------- next part -------------- A non-text attachment was scrubbed... Name: erl_eval.patch Type: text/x-patch Size: 1303 bytes Desc: not available URL: From nm@REDACTED Fri Sep 23 17:18:42 2005 From: nm@REDACTED (Gaspar Chilingarov) Date: Fri, 23 Sep 2005 20:18:42 +0500 Subject: proxy? behaviour pattern implementation Message-ID: <43341CD2.1070701@web.am> hi there! I have some problems with properly implementing proxy pattern - i.e. I have one process which can emit messages to another process, and I wish to have another running process to retranslate them to subscribed processes. So I need to implement process which can handle registering/ unregistering subscribers, and broadcasting messages got from another process. This can be implemented without any problems, but how should I handle crashes and restarts of receiving processes? And how emitting process should know and handle restarts of proxy process -- I mean how it should get new pid after restart? -- Gaspar Chilingarov System Administrator t +37491 419763 (mob) t +37410 240399 (office) w www.web.am i 63174784 e nm@REDACTED From kruegger@REDACTED Sat Sep 24 01:14:04 2005 From: kruegger@REDACTED (Stephen Han) Date: Fri, 23 Sep 2005 16:14:04 -0700 Subject: INETS-4.5.3 HTTP Client - 100 Continue Message-ID: <86f1f535050923161430565825@mail.gmail.com> Hi. Some web servers return 100 Continue before 200 Ok without Content-Length. Host-A -> Host-B HTTP/1.1 100 Continue..Server: Microsoft-IIS/5.0..Date: Fri, 23 Sep 2005 22 :52:10 GMT..X-Powered-By: ASP.NET.... Host-A -> Host-B HTTP/1.1 200 OK..Server: Microsoft-IIS/5.0..Date: Fri, 23 Sep 2005 22:52:27 GMT..X-Powered-By: ASP.NET..X-AspNet-Version: 1.1.4322..Cache-Control: pri vate, max-age=0..Content-Type: text/xml; charset=utf-8..Content-Length: 199 94........ After running the debugger on httpc_handler.erl, I found out that HTTP Client libary captures the length of the content from the first message and uses it all the way. Since real content length was exists in next message, 200 OK, the http:request eventaully failed because it thinks the length is 0. I just add another "handle_http_msg/2" function to "httpc_handler" module to ignore first 100 Conitnue message. handle_http_msg({_, 100, _, _, _}, State = #state{session = Session}) -> http_transport:setopts(socket_type(Session#tcp_session.scheme), Session#tcp_session.socket, [{active, once}]), {noreply, State#state{mfa = {httpc_response, parse, [State#state.max_header_size]}}}; This is just a quick fix for my work, and still I am not sure whose behaviour is right or wrong. I do see some original code to ignore 100 Continue message in the code but I don't know in what situation reaches that point. regards, -------------- next part -------------- An HTML attachment was scrubbed... URL: From kruegger@REDACTED Sat Sep 24 01:33:13 2005 From: kruegger@REDACTED (Stephen Han) Date: Fri, 23 Sep 2005 16:33:13 -0700 Subject: Segmentation fault on Linux In-Reply-To: References: Message-ID: <86f1f53505092316337fa54654@mail.gmail.com> I also have a problem in gentoo linux. Try to compile with --disable-hipe, see if it is work. There is an issue with new linux thread, the hipe may not be work in some situation, depends on what versions of libaries in your gentoo linux. There were 2 ways to fix the problem and the easiest thing is to disable hipe. The other one I forgot. regards, On 9/22/05, Edmund Dengler wrote: > > Howdy folks! > > I am getting segmentation errors when trying to run using OTP 10B-6 > and 10B-7 on Linux. I can compile 10B-5 with no problems. Anybody have any > ideas on what may be causing this? > > Details: > - Gentoo Linux (2.6.8-gentoo-r3) > - gcc version 3.3.5 > - compile flags: > ./configure --prefix=/opt/pkgs/erlang/10b-6 > > I did notice a previous message on this > (http://www.erlang.org/ml-archive/erlang-questions/200410/msg00057.html) > but no solution seemd to be posted. > > Regards! > Ed > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Sat Sep 24 18:39:50 2005 From: serge@REDACTED (Serge Aleynikov) Date: Sat, 24 Sep 2005 12:39:50 -0400 Subject: gen_event feature request Message-ID: <43358156.6000902@hq.idt.net> Current implementation of gen_event doesn't have an option to atomically check for an installed duplicate event handler before adding a new event handler. The common practice seems to be: case lists:member(NewHandler, gen_event:which_handlers(EventMgr)) of true -> ok; false -> gen_event:add_handler(EventMgr, NewHandler) end. Apparently this approach has a race condition. Secondly, when an existing event handler is being replaced by a new one using gen_event:swap_handler/3 this option also does not check if the NewHandler is already installed, which results in a duplicate handler added. As example of this can be found in the error_logger module: swap_handler(tty) -> gen_event:swap_handler(error_logger, {error_logger, swap}, {error_logger_tty_h, []}), simple_logger(). When you call error_logger:swap_handler(tty) multiple times you'll find that multiple copies of error_logger_tty_h get installed (which is not intuitive). In order to overcome these issues I would recommend to add new features: 1. gen_event:add_handler_unique(EventMgrRef, NewHandler, Args) -> Result Result = ok | already_installed | {'EXIT',Reason} | term() 2. gen_event:swap_handler_unique( EventMgrRef, {OldHandler,Args1}, {NewHandler,Args2}) -> Result Result = ok | already_installed | {error, Reason} | term() 'already_installed' is returned if the NewHandler is already installed. Thoughts? Serge From joelr1@REDACTED Sat Sep 24 20:39:53 2005 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 24 Sep 2005 20:39:53 +0200 Subject: Driver for OpenSSL encryption Message-ID: <283D91C3-4FAF-46D5-9FC4-315BE5D70AFF@gmail.com> Folks, Does anyone have an extended driver for the OpenSSL library? I would like to be able to encrypt binary data using RC5 asymetrical and block encryption. Thanks, Joel -- http://wagerlabs.com/ From micke@REDACTED Sun Sep 25 11:06:08 2005 From: micke@REDACTED (Michael Fogeborg) Date: Sun, 25 Sep 2005 11:06:08 +0200 Subject: Erlang job at Cellicium, France ! In-Reply-To: <113D5EF5-3C88-4913-A5A7-5D1CD6CABF86@gmail.com> References: <113D5EF5-3C88-4913-A5A7-5D1CD6CABF86@gmail.com> Message-ID: <6.2.1.2.0.20050925110400.0280cb08@mail.online.no> Looks like there is an Erlang-job at Cellicium... Keywords: Linux, Erlang, XML, HTTP, r?seaux IP et t?l?coms GSM (SS.7...) http://jobbsok.monster.no/getjob.asp?JobID=33607615&AVSDM=2005%2D09%2D08+11%3A46%3A13&Logo=0&q=erlang&sort=dt&vw=d&brd=1&ct=EU&aj=Europe --- From joelr1@REDACTED Sun Sep 25 14:28:25 2005 From: joelr1@REDACTED (Joel Reymont) Date: Sun, 25 Sep 2005 14:28:25 +0200 Subject: Low pain massively multiplayer systems: Peer review requested Message-ID: <125AF8D4-D919-4401-9503-CDEFA46371BB@gmail.com> Folks, I wrote for http://www.gamedev.net and would like to request your review. I'm looking for critique and suggestions on language, grammar, ease of reading the article, etc. Of course you are welcome to point out any other mistakes as well. The article can be found at http://wagerlabs.com/w/PowerStrip This article will also serve as the base for my presentation at the Erlang conference, although I'll probably focus more on card logic implementation with a modified gen_fsm module. Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Mon Sep 26 09:18:15 2005 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 26 Sep 2005 09:18:15 +0200 Subject: Low pain massively multiplayer systems: Peer review requested In-Reply-To: <20050925.225436.26298163.mbj@tail-f.com> References: <125AF8D4-D919-4401-9503-CDEFA46371BB@gmail.com> <20050925.225436.26298163.mbj@tail-f.com> Message-ID: <8BAAA31A-474C-437E-90FA-90A0806193CA@gmail.com> On Sep 25, 2005, at 10:54 PM, Martin Bjorklund wrote: > o In the second sentence, you say that you achive "unlimited > scalability". When I read such a claim I get suspicious... Well, I mean that you can just throw hardware at the problem. > o In the scalability chapter, a picture of the architecture might > help. Such as this (if I got it right): > > Tier 3: mnesia masters M0 --- M1 --- ... --- Mm > > Tier 2: game servers G0 --- G1 --- ... --- Gn > > Tier 1: gateways X0 --- X1 --- ... --- Xp > > I would also like to see a discussion about the numbers m, n and > p above, and how the nodes in the layers communicate. Also how > mnesia is used in the different layers. Nodes communicate using ... regular Erlang internode communications. I envision only having a couple of Mnesia masters, tailored for fast writes (RAID?) and a few gateways. Gateways don't do a lot of work and connections to them are very short-lived (less than a second?). The rest can be game servers. Mnesia really does not need to be used on the gateways but I use Mnesia for configuration data. Now, gateways don't use any configuration data and pick out game servers with a pg2 call, so gateways still don't need to use Mnesia. I suppose you could pass the name of the node make a connection with to the gateway "startup" function, then the effect should be the same as with giving extra_db_nodes to Mnesia. > NOTE: At nortel we have (had, I'm not at nortel anymore...) a > similar high-level architecture, where we have up to 4 "master" > nodes, which are fully-connected distrib. erlang nodes, with > disk-copy mnesia. Then we have up to 252 "slaves" which are NOT > part of the distrib. erlang net, but talk (erlang terms) over a > socket to the masters. This could be a good idea going forward, yes. > I'd like to see a discussion about this as well. It looks like > all your nodes ar part of the same distrib. erlang networks - > this may have scalability issues. I think that putting all the nodes on a Gigabit LAN might speed things up. You disagree? > How do you handle partitioned netowrks? I'm not. What are the conditions under which Mnesia partitions? > o Which parts of the run-time state is kept in mnesia? RAM/disk? Game and player info is kept in memory and disk. I don't have any disc_only tables. My idea is to run through a game and then save the results and ship bulky items such as hand histories to a relational db. > o Have you done any tests with many nodes, lots of ongoing games, > and e.g. pulled a network cable somewhere? I simulate a number of conditions but mostly on my laptop. I have tested lots of ongoing games but not with many nodes. Joel -- http://wagerlabs.com/ From joelr1@REDACTED Mon Sep 26 12:25:40 2005 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 26 Sep 2005 12:25:40 +0200 Subject: Crypto driver source code Message-ID: <45A79C07-E591-4F72-A3E4-6BF55E1E1B61@gmail.com> Folks, Where is the source code for the crypto driver (crypto_drv) of the crypto-1.3 module? I compiled the distribution from the sources but a search for crypto* only reveals the object files. I would like to add the rest of the OpenSSL encryption functions to the crypto module as well as add the OpenSSL random number generator. Thanks, Joel -- http://wagerlabs.com/ From joelr1@REDACTED Mon Sep 26 12:31:43 2005 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 26 Sep 2005 12:31:43 +0200 Subject: Crypto driver source code In-Reply-To: <45A79C07-E591-4F72-A3E4-6BF55E1E1B61@gmail.com> References: <45A79C07-E591-4F72-A3E4-6BF55E1E1B61@gmail.com> Message-ID: <107CEB6E-89AC-44AA-BA37-45BB1A7CB5F3@gmail.com> I'm an idiot, the c_src directory is removed after the build apparently. At least when installing via darwinports it is. On Sep 26, 2005, at 12:25 PM, Joel Reymont wrote: > Folks, > > Where is the source code for the crypto driver (crypto_drv) of the > crypto-1.3 module? > > I compiled the distribution from the sources but a search for > crypto* only reveals the object files. > > I would like to add the rest of the OpenSSL encryption functions to > the crypto module as well as add the OpenSSL random number generator. > > Thanks, Joel -- http://wagerlabs.com/ From esbjorn@REDACTED Mon Sep 26 13:09:34 2005 From: esbjorn@REDACTED (=?ISO-8859-1?Q?Esbj=F6rn_K=F6hler?=) Date: Mon, 26 Sep 2005 13:09:34 +0200 Subject: Crypto driver source code In-Reply-To: <45A79C07-E591-4F72-A3E4-6BF55E1E1B61@gmail.com> References: <45A79C07-E591-4F72-A3E4-6BF55E1E1B61@gmail.com> Message-ID: <20050926130934.5b6d0311@localhost> as I mentioned earlier on the list, I'd need Blowfish in Crypto.. Since I have not yet had time to give it a go myself, I'd really like to see this work be done! Good initiative! /esbj?rn On Mon, 26 Sep 2005 12:25:40 +0200 Joel Reymont wrote: > Folks, > > Where is the source code for the crypto driver (crypto_drv) of the > crypto-1.3 module? > > I compiled the distribution from the sources but a search for crypto* > only reveals the object files. > > I would like to add the rest of the OpenSSL encryption functions to > the crypto module as well as add the OpenSSL random number generator. > > Thanks, Joel > > -- > http://wagerlabs.com/ > > > > From joelr1@REDACTED Mon Sep 26 13:34:41 2005 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 26 Sep 2005 13:34:41 +0200 Subject: Crypto driver source code In-Reply-To: <20050926130934.5b6d0311@localhost> References: <45A79C07-E591-4F72-A3E4-6BF55E1E1B61@gmail.com> <20050926130934.5b6d0311@localhost> Message-ID: <1C64AE69-090C-498C-A35E-1FA91F68949D@gmail.com> Well, I have no intention on adding all the crypto functions, unfortunately. I just need some RSA and RC5 crypto stuff initially. I'll gladly shared the patches, though. On Sep 26, 2005, at 1:09 PM, Esbj?rn K?hler wrote: > as I mentioned earlier on the list, I'd need Blowfish in Crypto.. > Since I have not yet had time to give it a go myself, I'd really > like to > see this work be done! -- http://wagerlabs.com/ From bjorn@REDACTED Mon Sep 26 14:30:05 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 26 Sep 2005 14:30:05 +0200 Subject: Crypto driver source code In-Reply-To: <45A79C07-E591-4F72-A3E4-6BF55E1E1B61@gmail.com> References: <45A79C07-E591-4F72-A3E4-6BF55E1E1B61@gmail.com> Message-ID: The crypto driver in R10B-8 will probably be updated with more algorithms, at least those needed by SSH. R10B-8 will probably be released at the end of October. /Bj?rn Joel Reymont writes: > Folks, > > Where is the source code for the crypto driver (crypto_drv) of the > crypto-1.3 module? > > I compiled the distribution from the sources but a search for crypto* > only reveals the object files. > > I would like to add the rest of the OpenSSL encryption functions to > the crypto module as well as add the OpenSSL random number generator. > > Thanks, Joel > > -- > http://wagerlabs.com/ > > > > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From serge@REDACTED Mon Sep 26 14:56:34 2005 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 26 Sep 2005 08:56:34 -0400 Subject: Low pain massively multiplayer systems: Peer review requested In-Reply-To: <8BAAA31A-474C-437E-90FA-90A0806193CA@gmail.com> References: <125AF8D4-D919-4401-9503-CDEFA46371BB@gmail.com> <20050925.225436.26298163.mbj@tail-f.com> <8BAAA31A-474C-437E-90FA-90A0806193CA@gmail.com> Message-ID: <4337F002.40605@hq.idt.net> Joel Reymont wrote: >> How do you handle partitioned netowrks? > > > I'm not. What are the conditions under which Mnesia partitions? > > Joel I suggest that you search the mailing list for "mnesia partition" keywords. This issue has been mentioned several times. For example see this link: http://forums.trapexit.org:81/phpBB/viewtopic.php?t=2523&highlight=mnesia+partition Network partitioning happens when there is a loss of connectivity between two nodes, they drop a timed-out connection, and then, when the network is healed, they detect connectivity (say, when some process tries to send a distributed message) and reconnect. Network partitioning doesn't create a problem just for Mnesia, but also for global and dist_ac (perhaps other apps as well?). The suggested approach is to set 'dist_auto_connect' kernel option to 'once', and use custom UDP ping protocol on partitioned nodes, so that when such a condition is detected, determine a master node, and restart the others, so that they would have it's state replicated from the master at startup. Due to this limitation, when you have master and replica mnesia tiers, in cases of network partitioning, you would have to restart replica nodes (therefore making these nodes unavailable to serve client requests for a period of time until they would come up and resynch mnesia data). You would probably need some randomization so that not all replicated nodes would get restarted simultaneously (to avoid complete interruption of service). I found it very convenient to test network partitioning by having two servers with dual interfaces connected to two switches like this: +----------------------+ | Controlling terminal | +-+--------------------+ | ---LAN---+---+- | +----+----+ +---------+ | Switch1 | | Switch2 | +-+-----+-+ +-+-----+-+ | | | | | | +-------+ | | | +-+ Host1 +-+ | | +-------+ | | +-------+ | +-------+ Host2 +-------+ +-------+ Run Erlang distribution on Host1 and Host2 and force it to use 'inet_dist_use_interface' option to only bind to the interface connected on Switch2, so that you can bring this interface up and down without affecting hosts' connectivity to the Controlling Terminal client. Switches 1&2 could be replaced by hubs, though use of CISCO 3750 routers instead would allow to test other interesting features (like HSRP) to increase network resilience to faults. Regards, Serge From joelr1@REDACTED Mon Sep 26 15:00:12 2005 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 26 Sep 2005 15:00:12 +0200 Subject: Crypto driver source code In-Reply-To: References: <45A79C07-E591-4F72-A3E4-6BF55E1E1B61@gmail.com> Message-ID: <8E075460-3FD3-4440-97B9-79BDF6B5EFF8@gmail.com> Bjorn, Can you tell me if RC5-CBC will make it in? Also, I'm struggling with something and can't figure it out... Suppose I use d2i_RSAPrivateKey to read in a private key. The routine returns a pointer to the RSA structure that other routines take as their argument. How do I keep this pointer around in the driver or return it to the caller? Is there a favored approach for this? In my case I need to grab a public key and shoot it over the network, decrypt the received block key using the private key and then use the block key to encrypt/decrypt using RC5-CBC. The Erlang Driver Toolkit does not build on Mac OSX (the underlying SFL library does not) so I'm back to trying to add the functionality I need to the crypto driver. Thanks, Joel On Sep 26, 2005, at 2:30 PM, Bjorn Gustavsson wrote: > The crypto driver in R10B-8 will probably be updated with more > algorithms, at least those needed by SSH. > > R10B-8 will probably be released at the end of October. -- http://wagerlabs.com/ From ft@REDACTED Mon Sep 26 16:35:39 2005 From: ft@REDACTED (Fredrik Thulin) Date: Mon, 26 Sep 2005 16:35:39 +0200 Subject: extracting subjectAltName Message-ID: <200509261635.39867.ft@it.su.se> If I have a certificate structure returned by ssl:peercert/2, how do I extract the subjectAltName(s)? It seems that subjectAltName is an extension that is stored in the 'extensions' element of a 'TBSCertificate' record, which is in turn part of the 'Certificate' record returned by ssl:peercert(Socket, [pkix]). I find various encoding/decoding functions for certificates among the SSL sources - some of which actually looks like they know what the subjectAltName extension is. However I can't seem to find the right one that extracts the extension I'm interested in, so I would be very thankful for some help. Thanks in advance /Fredrik From surindar.shanthi@REDACTED Mon Sep 26 16:45:30 2005 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Mon, 26 Sep 2005 20:15:30 +0530 Subject: Some Erlang terms Message-ID: <42ea5fb60509260745307f90d8@mail.gmail.com> Explain me the term 1.Full sweep garbage collection. 2.heap size. 3.hash. 4.erlang driver. 5.File discriptor. If you know any of the above terms, please spend some time to answer it. -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Mon Sep 26 17:03:20 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 26 Sep 2005 17:03:20 +0200 Subject: Some Erlang terms In-Reply-To: <42ea5fb60509260745307f90d8@mail.gmail.com> References: <42ea5fb60509260745307f90d8@mail.gmail.com> Message-ID: <43380DB8.8040800@ericsson.com> On 2005-09-26 16:45, Surindar Sivanesan wrote: > > Explain me the term > 1.Full sweep garbage collection. http://lists.tunes.org/archives/tunes-lll/1996-April/000004.html > 2.heap size. http://en.wikipedia.org/wiki/Heap > 3.hash. http://en.wikipedia.org/wiki/Hash_function > 4.erlang driver. > 5.File discriptor. http://en.wikipedia.org/wiki/Computer_file > If you know any of the above terms, please spend some time to answer it. bengt From edmundd@REDACTED Mon Sep 26 21:51:16 2005 From: edmundd@REDACTED (Edmund Dengler) Date: Mon, 26 Sep 2005 15:51:16 -0400 (EDT) Subject: Segmentation fault on Linux In-Reply-To: References: Message-ID: Howdy! I did the run, but probably not what was expected. Is there a "compile so the binary is debuggable" option for configuration? # export ROOTDIR=/opt/pkgs/erlang/10b-7/lib/erlang BINDIR=$ROOTDIR/erts-5.4.9/bin EMU=beam PROGNAME=erl # gdb GNU gdb 6.0 Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu". (gdb) file lib/erlang/erts-5.4.9/bin/erlexec Reading symbols from lib/erlang/erts-5.4.9/bin/erlexec...done. Using host libthread_db library "/lib/libthread_db.so.1". (gdb) r -- -root /opt/pkgs/erlang/10b-7/bin Starting program: /opt/pkgs/erlang/10b-7/lib/erlang/erts-5.4.9/bin/erlexec -- -root /opt/pkgs/erlang/10b-7/bin warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. Detaching after fork from child process 835. Detaching after fork from child process 839. Program received signal SIGSEGV, Segmentation fault. 0x401ac16e in ?? () (gdb) bt #0 0x401ac16e in ?? () (gdb) Regards! Ed On Fri, 23 Sep 2005, Bjorn Gustavsson wrote: > Could you please run gdb on the core dump and print the stack backtrace > so that we can see where it crashed? > > /Bjorn > > Edmund Dengler writes: > > > Howdy folks! > > > > I am getting segmentation errors when trying to run using OTP 10B-6 > > and 10B-7 on Linux. I can compile 10B-5 with no problems. Anybody have any > > ideas on what may be causing this? > > > > Details: > > - Gentoo Linux (2.6.8-gentoo-r3) > > - gcc version 3.3.5 > > - compile flags: > > ./configure --prefix=/opt/pkgs/erlang/10b-6 > > > > I did notice a previous message on this > > (http://www.erlang.org/ml-archive/erlang-questions/200410/msg00057.html) > > but no solution seemd to be posted. > > > > Regards! > > Ed > > > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > From edmundd@REDACTED Mon Sep 26 22:18:19 2005 From: edmundd@REDACTED (Edmund Dengler) Date: Mon, 26 Sep 2005 16:18:19 -0400 (EDT) Subject: Segmentation fault on Linux In-Reply-To: <86f1f53505092316337fa54654@mail.gmail.com> References: <86f1f53505092316337fa54654@mail.gmail.com> Message-ID: Howdy! I can report that using '--disable-hipe' does indeed work (at the expense of optimizations). Are there any plans/hopes on fixing this, or is this a fundamental problem requiring the switch to native posix threads (as has been suggsted as another solution - I have not had time to test out)? Regards! Ed On Fri, 23 Sep 2005, Stephen Han wrote: > I also have a problem in gentoo linux. > > Try to compile with --disable-hipe, see if it is work. > > There is an issue with new linux thread, the hipe may not be work in some > situation, depends on what versions of libaries in your gentoo linux. > There were 2 ways to fix the problem and the easiest thing is to disable > hipe. The other one I forgot. > > regards, > > On 9/22/05, Edmund Dengler wrote: > > > > Howdy folks! > > > > I am getting segmentation errors when trying to run using OTP 10B-6 > > and 10B-7 on Linux. I can compile 10B-5 with no problems. Anybody have any > > ideas on what may be causing this? > > > > Details: > > - Gentoo Linux (2.6.8-gentoo-r3) > > - gcc version 3.3.5 > > - compile flags: > > ./configure --prefix=/opt/pkgs/erlang/10b-6 > > > > I did notice a previous message on this > > (http://www.erlang.org/ml-archive/erlang-questions/200410/msg00057.html) > > but no solution seemd to be posted. > > > > Regards! > > Ed > > > From mikpe@REDACTED Mon Sep 26 22:50:24 2005 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 26 Sep 2005 22:50:24 +0200 Subject: Segmentation fault on Linux In-Reply-To: References: Message-ID: <17208.24336.101579.188782@alkaid.it.uu.se> Edmund Dengler writes: > Howdy! > > I did the run, but probably not what was expected. Is there a "compile so > the binary is debuggable" option for configuration? > > # export ROOTDIR=/opt/pkgs/erlang/10b-7/lib/erlang > BINDIR=$ROOTDIR/erts-5.4.9/bin EMU=beam PROGNAME=erl > > # gdb > GNU gdb 6.0 > Copyright 2003 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you are > welcome to change it and/or distribute copies of it under certain conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for details. > This GDB was configured as "i686-pc-linux-gnu". > (gdb) file lib/erlang/erts-5.4.9/bin/erlexec > Reading symbols from lib/erlang/erts-5.4.9/bin/erlexec...done. > Using host libthread_db library "/lib/libthread_db.so.1". > (gdb) r -- -root /opt/pkgs/erlang/10b-7/bin > Starting program: /opt/pkgs/erlang/10b-7/lib/erlang/erts-5.4.9/bin/erlexec > -- -root /opt/pkgs/erlang/10b-7/bin > warning: Unable to find dynamic linker breakpoint function. > GDB will be unable to debug shared library initializers > and track explicitly loaded dynamic code. > Detaching after fork from child process 835. > Detaching after fork from child process 839. > > Program received signal SIGSEGV, Segmentation fault. > 0x401ac16e in ?? () > (gdb) bt > #0 0x401ac16e in ?? () > (gdb) > > Regards! > Ed > > On Fri, 23 Sep 2005, Bjorn Gustavsson wrote: > > > Could you please run gdb on the core dump and print the stack backtrace > > so that we can see where it crashed? > > > > /Bjorn 1) file core.$pid to figure out which executable dumped it 2) gdb /path/to/otp/bin/$executable core.$pid From edmundd@REDACTED Mon Sep 26 22:57:49 2005 From: edmundd@REDACTED (Edmund Dengler) Date: Mon, 26 Sep 2005 16:57:49 -0400 (EDT) Subject: Segmentation fault on Linux In-Reply-To: <17208.24336.101579.188782@alkaid.it.uu.se> References: <17208.24336.101579.188782@alkaid.it.uu.se> Message-ID: # file core core: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style, SVR4-style, from 'beam' # gdb ./lib/erlang/erts-5.4.9/bin/beam core GNU gdb 6.0 Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". Core was generated by `/opt/pkgs/erlang/10b-7/lib/erlang/erts-5.4.9/bin/beam -- -root /opt/pkgs/erlang'. Program terminated with signal 11, Segmentation fault. warning: current_sos: Can't read pathname for load map: Input/output error Reading symbols from /lib/libncurses.so.5...done. Loaded symbols for /lib/libncurses.so.5 Reading symbols from /lib/libdl.so.2...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /lib/libm.so.6...done. Loaded symbols for /lib/libm.so.6 Reading symbols from /lib/librt.so.1...done. Loaded symbols for /lib/librt.so.1 Reading symbols from /lib/libc.so.6...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /lib/libpthread.so.0...done. Loaded symbols for /lib/libpthread.so.0 #0 0x401ac16e in __pthread_sighandler () from /lib/libpthread.so.0 (gdb) bt #0 0x401ac16e in __pthread_sighandler () from /lib/libpthread.so.0 #1 #2 0x4013b061 in fts_children () from /lib/libc.so.6 #3 0x080ec627 in check_io (do_wait=1) at sys/unix/sys.c:2506 #4 0x080ed0db in erl_sys_schedule (runnable=0) at sys/unix/sys.c:3366 #5 0x0809c84a in schedule (p=0x0, calls=0) at beam/erl_process.c:477 #6 0x080d3aa7 in process_main () at beam/beam_emu.c:1148 #7 0x0807622f in erl_start (argc=9, argv=0x0) at beam/erl_init.c:902 #8 0x08065c1b in main (argc=-4, argv=0xfffffffc) at sys/unix/erl_main.c:28 (gdb) Regards! Ed On Mon, 26 Sep 2005, Mikael Pettersson wrote: > Edmund Dengler writes: > > Howdy! > > > > I did the run, but probably not what was expected. Is there a "compile so > > the binary is debuggable" option for configuration? > > > > # export ROOTDIR=/opt/pkgs/erlang/10b-7/lib/erlang > > BINDIR=$ROOTDIR/erts-5.4.9/bin EMU=beam PROGNAME=erl > > > > # gdb > > GNU gdb 6.0 > > Copyright 2003 Free Software Foundation, Inc. > > GDB is free software, covered by the GNU General Public License, and you are > > welcome to change it and/or distribute copies of it under certain conditions. > > Type "show copying" to see the conditions. > > There is absolutely no warranty for GDB. Type "show warranty" for details. > > This GDB was configured as "i686-pc-linux-gnu". > > (gdb) file lib/erlang/erts-5.4.9/bin/erlexec > > Reading symbols from lib/erlang/erts-5.4.9/bin/erlexec...done. > > Using host libthread_db library "/lib/libthread_db.so.1". > > (gdb) r -- -root /opt/pkgs/erlang/10b-7/bin > > Starting program: /opt/pkgs/erlang/10b-7/lib/erlang/erts-5.4.9/bin/erlexec > > -- -root /opt/pkgs/erlang/10b-7/bin > > warning: Unable to find dynamic linker breakpoint function. > > GDB will be unable to debug shared library initializers > > and track explicitly loaded dynamic code. > > Detaching after fork from child process 835. > > Detaching after fork from child process 839. > > > > Program received signal SIGSEGV, Segmentation fault. > > 0x401ac16e in ?? () > > (gdb) bt > > #0 0x401ac16e in ?? () > > (gdb) > > > > Regards! > > Ed > > > > On Fri, 23 Sep 2005, Bjorn Gustavsson wrote: > > > > > Could you please run gdb on the core dump and print the stack backtrace > > > so that we can see where it crashed? > > > > > > /Bjorn > > 1) file core.$pid > to figure out which executable dumped it > 2) gdb /path/to/otp/bin/$executable core.$pid > From mikpe@REDACTED Mon Sep 26 22:59:38 2005 From: mikpe@REDACTED (Mikael Pettersson) Date: Mon, 26 Sep 2005 22:59:38 +0200 Subject: Segmentation fault on Linux In-Reply-To: References: <86f1f53505092316337fa54654@mail.gmail.com> Message-ID: <17208.24890.792287.179917@alkaid.it.uu.se> Edmund Dengler writes: > Howdy! > > I can report that using '--disable-hipe' does indeed work (at the expense > of optimizations). Are there any plans/hopes on fixing this, or is this a > fundamental problem requiring the switch to native posix threads (as has > been suggsted as another solution - I have not had time to test out)? > > Regards! > Ed > > > On Fri, 23 Sep 2005, Stephen Han wrote: > > > I also have a problem in gentoo linux. > > > > Try to compile with --disable-hipe, see if it is work. > > > > There is an issue with new linux thread, the hipe may not be work in some > > situation, depends on what versions of libaries in your gentoo linux. > > There were 2 ways to fix the problem and the easiest thing is to disable > > hipe. The other one I forgot. > > > > regards, > > > > On 9/22/05, Edmund Dengler wrote: > > > > > > Howdy folks! > > > > > > I am getting segmentation errors when trying to run using OTP 10B-6 > > > and 10B-7 on Linux. I can compile 10B-5 with no problems. Anybody have any > > > ideas on what may be causing this? > > > > > > Details: > > > - Gentoo Linux (2.6.8-gentoo-r3) > > > - gcc version 3.3.5 > > > - compile flags: > > > ./configure --prefix=/opt/pkgs/erlang/10b-6 > > > > > > I did notice a previous message on this > > > (http://www.erlang.org/ml-archive/erlang-questions/200410/msg00057.html) > > > but no solution seemd to be posted. > > > > > > Regards! > > > Ed Post a decent bug report. From the above I can't tell which CPU architecture or glibc version you're using, or where the segfaults occur. R10B-7 with HiPE works fine here on FC4 (x86 and amd64), FC3 (x86 and amd64), FC2 (x86), and YDL4 (ppc32), in addition to Solaris and OSX. Since R10B-5 works on your Gentoo system, and there aren't any substantial HiPE-related runtime system changes between R10B-5 and R10B-{6,7}, I'm inclined to believe that this is a Gentoo issue. (I'm also pretty sure it works on Debian though I can't say which release.) From edmundd@REDACTED Mon Sep 26 23:27:56 2005 From: edmundd@REDACTED (Edmund Dengler) Date: Mon, 26 Sep 2005 17:27:56 -0400 (EDT) Subject: Segmentation fault on Linux In-Reply-To: <17208.24890.792287.179917@alkaid.it.uu.se> References: <86f1f53505092316337fa54654@mail.gmail.com> <17208.24890.792287.179917@alkaid.it.uu.se> Message-ID: Greetings! On Mon, 26 Sep 2005, Mikael Pettersson wrote: > Post a decent bug report. From the above I can't tell which > CPU architecture or glibc version you're using, or where the > segfaults occur. > > R10B-7 with HiPE works fine here on FC4 (x86 and amd64), > FC3 (x86 and amd64), FC2 (x86), and YDL4 (ppc32), in addition > to Solaris and OSX. Since R10B-5 works on your Gentoo system, > and there aren't any substantial HiPE-related runtime system > changes between R10B-5 and R10B-{6,7}, I'm inclined to believe > that this is a Gentoo issue. (I'm also pretty sure it works on > Debian though I can't say which release.) > Processor, O/S: # uname -a Linux tycho 2.6.8-gentoo-r3 #1 Fri Oct 29 20:02:11 UTC 2004 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz GenuineIntel GNU/Linux (x86 architecture, compiles claim 686 as the architecture of choice) GLIBC: # emerge --search glibc Searching... [ Results for search key : glibc ] [ Applications found : 1 ] * sys-libs/glibc Latest version available: 2.3.4.20040808-r1 Latest version installed: 2.3.4.20040808-r1 Size of downloaded files: 15,381 kB Homepage: http://sources.redhat.com/glibc/ Description: GNU libc6 (also called glibc2) C library License: LGPL-2 Any other info needed? Seems strange that if nothing has changed between 10B-5 and 10B-6/7, that all of a sudden there would be segmentation faults. I can believe some pthread dependency/feature change in HIPE was added/changed that finally broke the linux threads in favour of POSIX threads (note, I am using 10B-7 on an OpenBSD 3.6 system with no problems). If somebody has a newer Gentoo system (2.6 kernel please) where 10B-6/7 is working, I would love to hear from you to see if this is an issues with a slightly older kernel/libraries. Regards! Ed From orbitz@REDACTED Tue Sep 27 01:01:20 2005 From: orbitz@REDACTED (orbitz@REDACTED) Date: Mon, 26 Sep 2005 19:01:20 -0400 Subject: Some Erlang terms In-Reply-To: <42ea5fb60509260745307f90d8@mail.gmail.com> References: <42ea5fb60509260745307f90d8@mail.gmail.com> Message-ID: Saying "please" would be nice. The answers you seek are all very easy to find on google. On Sep 26, 2005, at 10:45 AM, Surindar Sivanesan wrote: > > Explain me the term > 1.Full sweep garbage collection. > 2.heap size. > 3.hash. > 4.erlang driver. > 5.File discriptor. > If you know any of the above terms, please spend some time to answer > it. > -- > with regards, > S.Surindar From orbitz@REDACTED Tue Sep 27 01:03:01 2005 From: orbitz@REDACTED (orbitz@REDACTED) Date: Mon, 26 Sep 2005 19:03:01 -0400 Subject: Driver for OpenSSL encryption In-Reply-To: <283D91C3-4FAF-46D5-9FC4-315BE5D70AFF@gmail.com> References: <283D91C3-4FAF-46D5-9FC4-315BE5D70AFF@gmail.com> Message-ID: <09c9657fdc7d7ff2e2749269e1f35f0d@ezabel.com> http://ortdotlove.net/docs/erlang-doc/crypto-1.2.2.pdf On Sep 24, 2005, at 2:39 PM, Joel Reymont wrote: > Folks, > > Does anyone have an extended driver for the OpenSSL library? > > I would like to be able to encrypt binary data using RC5 asymetrical > and block encryption. > > Thanks, Joel > > -- > http://wagerlabs.com/ > > > > From francesco@REDACTED Tue Sep 27 07:35:17 2005 From: francesco@REDACTED (Francesco Cesarini (Erlang Training & Consulting)) Date: Tue, 27 Sep 2005 06:35:17 +0100 Subject: Some Erlang terms In-Reply-To: <42ea5fb60509260745307f90d8@mail.gmail.com> References: <42ea5fb60509260745307f90d8@mail.gmail.com> Message-ID: <4338DA15.9080405@erlang-consulting.com> Does your teacher know you are getting help from the Erlang mailing list? Regardless, it does not beat the time we were asked to develop a simple TCP/IP based program. When requesting the spec, who we believed was the client sent us exercise descriptions from his first year course... Francesco -- http://www.erlang-consulting.com Francesco Surindar Sivanesan wrote: > > Explain me the term > 1.Full sweep garbage collection. > 2.heap size. > 3.hash. > 4.erlang driver. > 5.File discriptor. > If you know any of the above terms, please spend some time to answer it. > -- > with regards, > S.Surindar From erlang@REDACTED Tue Sep 27 07:44:27 2005 From: erlang@REDACTED (Michael McDaniel) Date: Mon, 26 Sep 2005 22:44:27 -0700 Subject: Segmentation fault on Linux In-Reply-To: <17208.24890.792287.179917@alkaid.it.uu.se> References: <86f1f53505092316337fa54654@mail.gmail.com> <17208.24890.792287.179917@alkaid.it.uu.se> Message-ID: <20050927054427.GY9642@delora.autosys.us> On Mon, Sep 26, 2005 at 10:59:38PM +0200, Mikael Pettersson wrote: > Edmund Dengler writes: > > Howdy! > > > > I can report that using '--disable-hipe' does indeed work (at the expense > > of optimizations). Are there any plans/hopes on fixing this, or is this a > > fundamental problem requiring the switch to native posix threads (as has > > been suggsted as another solution - I have not had time to test out)? > > > > Regards! > > Ed > > > > > > On Fri, 23 Sep 2005, Stephen Han wrote: > > > > > I also have a problem in gentoo linux. > > > > > > Try to compile with --disable-hipe, see if it is work. > > > > > > There is an issue with new linux thread, the hipe may not be work in some > > > situation, depends on what versions of libaries in your gentoo linux. > > > There were 2 ways to fix the problem and the easiest thing is to disable > > > hipe. The other one I forgot. > > > > > > regards, > > > > > > On 9/22/05, Edmund Dengler wrote: > > > > > > > > Howdy folks! > > > > > > > > I am getting segmentation errors when trying to run using OTP 10B-6 > > > > and 10B-7 on Linux. I can compile 10B-5 with no problems. Anybody have any > > > > ideas on what may be causing this? > > > > > > > > Details: > > > > - Gentoo Linux (2.6.8-gentoo-r3) > > > > - gcc version 3.3.5 > > > > - compile flags: > > > > ./configure --prefix=/opt/pkgs/erlang/10b-6 > > > > > > > > I did notice a previous message on this > > > > (http://www.erlang.org/ml-archive/erlang-questions/200410/msg00057.html) > > > > but no solution seemd to be posted. > > > > > > > > Regards! > > > > Ed > > Post a decent bug report. From the above I can't tell which > CPU architecture or glibc version you're using, or where the > segfaults occur. > > R10B-7 with HiPE works fine here on FC4 (x86 and amd64), > FC3 (x86 and amd64), FC2 (x86), and YDL4 (ppc32), in addition > to Solaris and OSX. Since R10B-5 works on your Gentoo system, > and there aren't any substantial HiPE-related runtime system > changes between R10B-5 and R10B-{6,7}, I'm inclined to believe > that this is a Gentoo issue. (I'm also pretty sure it works on > Debian though I can't say which release.) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I am using Ubuntu Linux on my laptop, based on Debian. It uses an Intel Centrino system; from dmesg ... CPU: Intel(R) Pentium(R) M processor 1.60GHz stepping 06 agpgart: Detected an Intel 855 Chipset. And, from the bash shell ... $ uname -a Linux delora 2.6.10-5-386 #1 Tue Apr 5 12:12:40 UTC 2005 i686 GNU/Linux $ erl Erlang (BEAM) emulator version 5.4.9 [source] [hipe] Eshell V5.4.9 (abort with ^G) 1> q(). ok $ that is Erlang R10B-7, and here is the successful configure command... ./configure --with-odbc --x-includes=/usr/local/include \ --x-libraries=/usr/lib --with-ssl ~Michael From vipin@REDACTED Tue Sep 27 08:37:56 2005 From: vipin@REDACTED (vipin) Date: Tue, 27 Sep 2005 12:07:56 +0530 Subject: Mnesia - tables ??? Message-ID: <4338E8C4.8080508@picopeta.com> Hello all !!! I've created five database tables, it works fine as long as 'Erlang node' (where database is running) is up. When it goes down or i do quit from the node and again restart the database server on the same node then i've lost all the data in the tables. What should i do to make it persistent ? when i execute mnesia:info() i found that my all tables are lying in RAM (as shown below). If the problem is wandering around here, then please tell me how to move these ram_copies to disc_copies ? (I'm using Erlang-R10B-6.) ============================================================= (database@REDACTED)5> mnesia:info(). ---> Processes holding locks <--- ---> Processes waiting for locks <--- ---> Participant transactions <--- ---> Coordinator transactions <--- ---> Uncertain transactions <--- ---> Active tables <--- client_profile : with 109 records occupying 2785 words of mem client_buddylist: with 2 records occupying 341 words of mem client_offlinemessages: with 0 records occupying 277 words of mem client_reverse_buddylist: with 2 records occupying 341 words of mem client_online : with 97 records occupying 2837 words of mem schema : with 6 records occupying 951 words of mem ===> System info in version "4.2.2", debug level = none <=== opt_disc. Directory "/home/vipin/elbis/database/Mnesia.database@REDACTED" is used. use fallback at restart = false running db nodes = [database@REDACTED] stopped db nodes = [] master node tables = [] remote = [] ram_copies = [client_buddylist, client_offlinemessages, client_online, client_profile, client_reverse_buddylist] disc_copies = [schema] disc_only_copies = [] [{database@REDACTED,disc_copies}] = [schema] [{database@REDACTED,ram_copies}] = [client_online, client_reverse_buddylist, client_offlinemessages, client_buddylist, client_profile] 355 transactions committed, 0 aborted, 0 restarted, 0 logged to disc 0 held locks, 0 in queue; 0 local transactions, 0 remote 0 transactions waits for other nodes: [] ok ============================================================ Your suggestions would be welcome. Cheers, Vipin From p-news@REDACTED Tue Sep 27 10:30:01 2005 From: p-news@REDACTED (P) Date: Tue, 27 Sep 2005 10:30:01 +0200 Subject: Segmentation fault on Linux In-Reply-To: References: <86f1f53505092316337fa54654@mail.gmail.com> Message-ID: <200509271030.01843.p-news@telia.com> s Hej Edmund ! A less scientific way might be to remove the whole (old) erlang distribution and rebuild the new. If --prefix= ls might look like: ... ... ... drwxrwxr-x erts-5.4.6 drwxr-xr-x erts-5.4.9 ... ... ... I had some strange behaviour when building erlang some time ago (a year ?) which disapeared after a removal and a rebuild. BTW. where is the erlang.gif supposed to be ? It has been in several applications. Mvh. Per Einar ------------------------------------------------------------------------------ Per Einar Str?mme p-news@REDACTED ------------------------------------------------------------------------------ m?ndag 26 september 2005 22:18 skrev Edmund Dengler: > Howdy! > > I can report that using '--disable-hipe' does indeed work (at the expense > of optimizations). Are there any plans/hopes on fixing this, or is this a > fundamental problem requiring the switch to native posix threads (as has > been suggsted as another solution - I have not had time to test out)? > > Regards! > Ed > > > On Fri, 23 Sep 2005, Stephen Han wrote: > > > I also have a problem in gentoo linux. > > > > Try to compile with --disable-hipe, see if it is work. > > > > There is an issue with new linux thread, the hipe may not be work in some > > situation, depends on what versions of libaries in your gentoo linux. > > There were 2 ways to fix the problem and the easiest thing is to disable > > hipe. The other one I forgot. > > > > regards, > > > > On 9/22/05, Edmund Dengler wrote: > > > > > > Howdy folks! > > > > > > I am getting segmentation errors when trying to run using OTP 10B-6 > > > and 10B-7 on Linux. I can compile 10B-5 with no problems. Anybody have any > > > ideas on what may be causing this? > > > > > > Details: > > > - Gentoo Linux (2.6.8-gentoo-r3) > > > - gcc version 3.3.5 > > > - compile flags: > > > ./configure --prefix=/opt/pkgs/erlang/10b-6 > > > > > > I did notice a previous message on this > > > (http://www.erlang.org/ml-archive/erlang-questions/200410/msg00057.html) > > > but no solution seemd to be posted. > > > > > > Regards! > > > Ed > > > > > > From tpatro@REDACTED Tue Sep 27 10:47:00 2005 From: tpatro@REDACTED (Tamas Patrovics) Date: Tue, 27 Sep 2005 10:47:00 +0200 Subject: Closing parenthesis optional for -define? Message-ID: This code (note the lack of a closing parenthesis in the -define line) can be compiled and works as expected. Is it a feature? epp_dodger chokes on it with a syntax error.. -module(test). -export([func/0]). -define(a, 1. func() -> 2 + ?a. From thomasl_erlang@REDACTED Tue Sep 27 10:50:57 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 27 Sep 2005 01:50:57 -0700 (PDT) Subject: Some Erlang terms In-Reply-To: <4338DA15.9080405@erlang-consulting.com> Message-ID: <20050927085057.22384.qmail@web34405.mail.mud.yahoo.com> --- "Francesco Cesarini (Erlang Training & Consulting)" wrote: > Regardless, it does not beat the time we were asked > to develop a simple > TCP/IP based program. When requesting the spec, who > we believed was the > client sent us exercise descriptions from his first > year course... Well, don't keep us in suspense -- did you invoice him? :-) Best, Thomas __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com From joelr1@REDACTED Tue Sep 27 11:40:56 2005 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 27 Sep 2005 11:40:56 +0200 Subject: Driver for OpenSSL encryption In-Reply-To: <09c9657fdc7d7ff2e2749269e1f35f0d@ezabel.com> References: <283D91C3-4FAF-46D5-9FC4-315BE5D70AFF@gmail.com> <09c9657fdc7d7ff2e2749269e1f35f0d@ezabel.com> Message-ID: <956BBBCA-C8FD-4D0E-B151-A72126292234@gmail.com> The current version is 1.3 I think and it still does not do RC5-CBC encryption. On Sep 27, 2005, at 1:03 AM, orbitz@REDACTED wrote: > http://ortdotlove.net/docs/erlang-doc/crypto-1.2.2.pdf -- http://wagerlabs.com/ From hakan@REDACTED Tue Sep 27 11:59:28 2005 From: hakan@REDACTED (Hakan Mattsson) Date: Tue, 27 Sep 2005 11:59:28 +0200 (CEST) Subject: Mnesia - tables ??? In-Reply-To: <4338E8C4.8080508@picopeta.com> References: <4338E8C4.8080508@picopeta.com> Message-ID: On Tue, 27 Sep 2005, vipin wrote: vipin> Date: Tue, 27 Sep 2005 12:07:56 +0530 vipin> From: vipin vipin> To: erlang-questions@REDACTED vipin> Subject: Mnesia - tables ??? vipin> vipin> Hello all !!! vipin> vipin> I've created five database tables, it works fine as long as 'Erlang node' vipin> (where database is running) is up. When it goes down or i do quit vipin> from the node and again restart the database server on the same node then vipin> i've lost all the data in the tables. What should i do to make vipin> it persistent ? You need to use som other storage type than ram_copies for your tables. Try mnesia:create_table(Tab, [{disc_copies, Nodes}]). vipin> vipin> when i execute mnesia:info() i found that my all tables are lying in RAM (as vipin> shown below). If the problem is wandering around here, vipin> then please tell me how to move these ram_copies to disc_copies ? Already existing tables may be converted with: mnesia:change_table_copy_type(Tab, Node, disc_copies) /H?kan From tim@REDACTED Tue Sep 27 13:26:03 2005 From: tim@REDACTED (Tim Bates) Date: Tue, 27 Sep 2005 20:56:03 +0930 Subject: Debugging crashes during init Message-ID: <43392C4B.5090500@bates.id.au> Hi folks, When a process crashes during normal operation I get a lovely error report printout with a reason for the crash and a traceback. When something crashes inside my Application:start/2 functions I get this: $ erl -boot lib/traderl/priv/traderl -config test -traderl gainfiles '[test1.csv, test2.csv]' Erlang (BEAM) emulator version 5.4.8 [source] [hipe] [threads:0] =INFO REPORT==== 27-Sep-2005::20:50:40 === application: traderl exited: {shutdown,{traderl_app,start,[normal,[]]}} type: permanent {"Kernel pid terminated",application_controller,shutdown} Crash dump was written to: erl_crash.dump Kernel pid terminated (application_controller) (shutdown) The crash dump doesn't really give me any more useful information than this. How can I find out where and why my init routines crashed? I've been reduced to using print statements and it's frustrating to say the least. Thanks, Tim. -- Tim Bates tim@REDACTED From JMBALADO@REDACTED Tue Sep 27 14:22:41 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Tue, 27 Sep 2005 14:22:41 +0200 Subject: Only trying to post to the list Message-ID: <200509271422.41223.JMBALADO@terra.es> Sorry, this is only a probe to the list because I'm having problems to post From joelr1@REDACTED Tue Sep 27 15:46:26 2005 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 27 Sep 2005 15:46:26 +0200 Subject: Max number of open file descriptors is too low Message-ID: <965C7B8D-0B24-427A-8E42-D9E6330A0362@gmail.com> Folks, Erlang hardcodes the maximum number of open file descriptors and I think the default number is too low. At least on Windows it is. Look for max_files in erts/emulator/{unix,win32}/sys.c. On Unix it hardcodes FD_SETSIZE so I changed the system header files to up that from 1024 to 10240. On Windows the maximum number of handles per process can be set pretty high apparently but it's fixed by Erlang at 1024, period. This is quite important as it prevents you from building a socket server that handles more than 1024 connections under Windows. Would the Erlang/OTP consider upping the number of descriptors on Windows to something like 1024*8 or 1024*10? Thanks, Joel -- http://wagerlabs.com/ From bengt.kleberg@REDACTED Tue Sep 27 16:06:17 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 27 Sep 2005 16:06:17 +0200 Subject: Max number of open file descriptors is too low In-Reply-To: <965C7B8D-0B24-427A-8E42-D9E6330A0362@gmail.com> References: <965C7B8D-0B24-427A-8E42-D9E6330A0362@gmail.com> Message-ID: <433951D9.2070300@ericsson.com> On 2005-09-27 15:46, Joel Reymont wrote: > Folks, > > Erlang hardcodes the maximum number of open file descriptors and I > think the default number is too low. At least on Windows it is. ...deleted > > Would the Erlang/OTP consider upping the number of descriptors on > Windows to something like 1024*8 or 1024*10? greetings, have you tried this: (http://www.erlang.se/doc/doc-5.4.8/doc/efficiency_guide/part_frame.html) Open files, and sockets The maximum number of simultaneously open files and sockets depend on the maximum number of Erlang ports available, and operating system specific settings and limits. Open ports The maximum number of simultaneously open Erlang ports is by default 1024. This limit can be raised up to at most 268435456 at startup (see environment variable ERL_MAX_PORTS in erlang(3)) The maximum limit of 268435456 open ports will at least on a 32-bit architecture be impossible to reach due to memory shortage. bengt From joelr1@REDACTED Tue Sep 27 16:16:53 2005 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 27 Sep 2005 16:16:53 +0200 Subject: Max number of open file descriptors is too low In-Reply-To: <433951D9.2070300@ericsson.com> References: <965C7B8D-0B24-427A-8E42-D9E6330A0362@gmail.com> <433951D9.2070300@ericsson.com> Message-ID: This won't work on Unix. Assuming that MAX_FILES() will return ERL_MAX_PORTS, it will be reset back to FD_SETSIZE. I had this problem on the Mac and had to edit header files. Could this be a bug? From erts/emulator/unix/sys.c void erl_sys_init(void) { ... if ((max_files = MAX_FILES()) < 0) erl_exit(1, "Can't get no. of available file descriptors\n"); /* Note: this is if MAX_FILES() differ from FD_SETSIZE which it */ /* does by deafult on e.g. BSDI */ #if defined(USE_SELECT) && defined(FD_SETSIZE) if (max_files > FD_SETSIZE) max_files = FD_SETSIZE; #endif .. } On Sep 27, 2005, at 4:06 PM, Bengt Kleberg wrote: > On 2005-09-27 15:46, Joel Reymont wrote: > >> Folks, >> Erlang hardcodes the maximum number of open file descriptors and >> I think the default number is too low. At least on Windows it is. >> > > ...deleted > >> Would the Erlang/OTP consider upping the number of descriptors on >> Windows to something like 1024*8 or 1024*10? >> > > greetings, > > have you tried this: > > (http://www.erlang.se/doc/doc-5.4.8/doc/efficiency_guide/ > part_frame.html) > > Open files, and sockets > The maximum number of simultaneously open files and sockets > depend on the maximum number of Erlang ports available, and > operating system specific settings and limits. > > Open ports > The maximum number of simultaneously open Erlang ports is by > default 1024. This limit can be raised up to at most 268435456 at > startup (see environment variable ERL_MAX_PORTS in erlang(3)) The > maximum limit of 268435456 open ports will at least on a 32-bit > architecture be impossible to reach due to memory shortage. > > > bengt > > -- http://wagerlabs.com/ From joelr1@REDACTED Tue Sep 27 16:24:48 2005 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 27 Sep 2005 16:24:48 +0200 Subject: Max number of open file descriptors is too low In-Reply-To: <433951D9.2070300@ericsson.com> References: <965C7B8D-0B24-427A-8E42-D9E6330A0362@gmail.com> <433951D9.2070300@ericsson.com> Message-ID: <30514448-E7E5-4FFA-AB97-C032A5315287@gmail.com> It seems that on Windows max_files in erts/emulator/sys/win32/sys.c is just preset at 1024. I see the following at the top of the file: static int max_files = 1024; I see sys_max_files() that returns the value of max_files and I see max_files being used all over the place. I do not see any functions that could be used by Erlang to set max_files to the value of ERL_MAX_PORTS. It looks like a bug to me. If the intention was to set max_files to ERL_MAX_PORTS then there's no code in the emulator bootstrapping functions to do so. Joel On Sep 27, 2005, at 4:06 PM, Bengt Kleberg wrote: > Open ports > The maximum number of simultaneously open Erlang ports is by > default 1024. This limit can be raised up to at most 268435456 at > startup (see environment variable ERL_MAX_PORTS in erlang(3)) The > maximum limit of 268435456 open ports will at least on a 32-bit > architecture be impossible to reach due to memory shortage. -- http://wagerlabs.com/ From JMBALADO@REDACTED Tue Sep 27 17:20:44 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Tue, 27 Sep 2005 17:20:44 +0200 Subject: Problems posting Message-ID: <200509271720.44498.JMBALADO@terra.es> Please, anyone knows if there is a problem posting to th list with kontact, or perhaps with length of post or any other issue? Because I can only post small messages like this. Thanks, Jose From JMBALADO@REDACTED Tue Sep 27 17:25:13 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Tue, 27 Sep 2005 17:25:13 +0200 Subject: Problems posting Message-ID: <200509271725.13556.JMBALADO@terra.es> Please, anyone knows if there is a problem posting to th list with kontact, or perhaps with length of post or any other issue? Because I can only post small messages like this. Thanks, Jose From JMBALADO@REDACTED Tue Sep 27 17:57:56 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Tue, 27 Sep 2005 17:57:56 +0200 Subject: Problems posting Message-ID: <200509271757.56823.JMBALADO@terra.es> Please, anyone knows if there is a problem posting to th list with kontact, or perhaps with length of post or any other issue? Because I can only post small messages like this. Thanks, Jose From jahakala@REDACTED Tue Sep 27 17:56:31 2005 From: jahakala@REDACTED (Jani Hakala) Date: Tue, 27 Sep 2005 18:56:31 +0300 Subject: Max number of open file descriptors is too low In-Reply-To: (Joel Reymont's message of "Tue, 27 Sep 2005 16:16:53 +0200") References: <965C7B8D-0B24-427A-8E42-D9E6330A0362@gmail.com> <433951D9.2070300@ericsson.com> Message-ID: <871x3amrm8.fsf@pingviini.kortex.jyu.fi> Joel Reymont writes: > This won't work on Unix. Assuming that MAX_FILES() will return > ERL_MAX_PORTS, it will be reset back to FD_SETSIZE. > Only if USE_SELECT is defined i.e. poll() is not used? > I had this problem on the Mac and had to edit header files. > If I remember correctly poll() is somehow broken on MacOS(?) so you faced the limitation related to select(). Jani Hakala From JMBALADO@REDACTED Tue Sep 27 18:06:36 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Tue, 27 Sep 2005 18:06:36 +0200 Subject: Problems to post Message-ID: <200509271806.36196.JMBALADO@terra.es> I have problems to post with kontact any help please. Thanks, Jose From JMBALADO@REDACTED Tue Sep 27 18:52:02 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Tue, 27 Sep 2005 18:52:02 +0200 Subject: Sorry!!! Message-ID: <200509271852.02936.JMBALADO@terra.es> Sorry, it was not my intention to post so many messages. Still need help with posting, thanks to all and sorry. Best regards, Jose From klacke@REDACTED Tue Sep 27 18:47:11 2005 From: klacke@REDACTED (Claes Wikstrom) Date: Tue, 27 Sep 2005 18:47:11 +0200 Subject: Max number of open file descriptors is too low In-Reply-To: <871x3amrm8.fsf@pingviini.kortex.jyu.fi> References: <965C7B8D-0B24-427A-8E42-D9E6330A0362@gmail.com> <433951D9.2070300@ericsson.com> <871x3amrm8.fsf@pingviini.kortex.jyu.fi> Message-ID: <4339778F.4020407@hyber.org> Jani Hakala wrote: > > If I remember correctly poll() is somehow broken on MacOS(?) so you > faced the limitation related to select(). > > Indeed, poll() is select() on MacOs, or rather it used to be I think it's fixed in some of the latest releases of MacOs, which one, I don;t know, /klacke -------------- next part -------------- A non-text attachment was scrubbed... Name: klacke.vcf Type: text/x-vcard Size: 303 bytes Desc: not available URL: From edmundd@REDACTED Tue Sep 27 18:55:22 2005 From: edmundd@REDACTED (Edmund Dengler) Date: Tue, 27 Sep 2005 12:55:22 -0400 (EDT) Subject: Segmentation fault on Linux In-Reply-To: <200509271030.01843.p-news@telia.com> References: <86f1f53505092316337fa54654@mail.gmail.com> <200509271030.01843.p-news@telia.com> Message-ID: Greetings! I build each distribution into it's own directory, so I should have no issues re old components. Regards! Ed On Tue, 27 Sep 2005, P wrote: > s > > > > Hej Edmund ! > > A less scientific way might be to remove the whole (old) erlang distribution > and rebuild the new. > > If --prefix= > > ls might look like: > ... > ... > ... > drwxrwxr-x erts-5.4.6 > drwxr-xr-x erts-5.4.9 > ... > ... > ... > > I had some strange behaviour when building erlang some time ago > (a year ?) which disapeared after a removal and a rebuild. > > > BTW. where is the erlang.gif supposed to be ? It has been in several > applications. > > Mvh. > Per Einar > > > ------------------------------------------------------------------------------ > Per Einar Str?mme > p-news@REDACTED > ------------------------------------------------------------------------------ > > > > m?ndag 26 september 2005 22:18 skrev Edmund Dengler: > > Howdy! > > > > I can report that using '--disable-hipe' does indeed work (at the expense > > of optimizations). Are there any plans/hopes on fixing this, or is this a > > fundamental problem requiring the switch to native posix threads (as has > > been suggsted as another solution - I have not had time to test out)? > > > > Regards! > > Ed > > > > > > On Fri, 23 Sep 2005, Stephen Han wrote: > > > > > I also have a problem in gentoo linux. > > > > > > Try to compile with --disable-hipe, see if it is work. > > > > > > There is an issue with new linux thread, the hipe may not be work in some > > > situation, depends on what versions of libaries in your gentoo linux. > > > There were 2 ways to fix the problem and the easiest thing is to disable > > > hipe. The other one I forgot. > > > > > > regards, > > > > > > On 9/22/05, Edmund Dengler wrote: > > > > > > > > Howdy folks! > > > > > > > > I am getting segmentation errors when trying to run using OTP 10B-6 > > > > and 10B-7 on Linux. I can compile 10B-5 with no problems. Anybody have any > > > > ideas on what may be causing this? > > > > > > > > Details: > > > > - Gentoo Linux (2.6.8-gentoo-r3) > > > > - gcc version 3.3.5 > > > > - compile flags: > > > > ./configure --prefix=/opt/pkgs/erlang/10b-6 > > > > > > > > I did notice a previous message on this > > > > (http://www.erlang.org/ml-archive/erlang-questions/200410/msg00057.html) > > > > but no solution seemd to be posted. > > > > > > > > Regards! > > > > Ed > > > > > > > > > > From joelr1@REDACTED Tue Sep 27 19:00:59 2005 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 27 Sep 2005 19:00:59 +0200 Subject: Max number of open file descriptors is too low In-Reply-To: <871x3amrm8.fsf@pingviini.kortex.jyu.fi> References: <965C7B8D-0B24-427A-8E42-D9E6330A0362@gmail.com> <433951D9.2070300@ericsson.com> <871x3amrm8.fsf@pingviini.kortex.jyu.fi> Message-ID: <78E8D6A9-425C-4192-923F-11C15ED7EB69@gmail.com> Right, but it still does not resolve the same issue under Windows ;-). On Sep 27, 2005, at 5:56 PM, Jani Hakala wrote: > Joel Reymont writes: > > >> This won't work on Unix. Assuming that MAX_FILES() will return >> ERL_MAX_PORTS, it will be reset back to FD_SETSIZE. >> >> > Only if USE_SELECT is defined i.e. poll() is not used? > > >> I had this problem on the Mac and had to edit header files. >> >> > If I remember correctly poll() is somehow broken on MacOS(?) so you > faced the limitation related to select(). > > Jani Hakala > -- http://wagerlabs.com/ From chandrashekhar.mullaparthi@REDACTED Tue Sep 27 19:08:19 2005 From: chandrashekhar.mullaparthi@REDACTED (chandru) Date: Tue, 27 Sep 2005 18:08:19 +0100 Subject: proxy? behaviour pattern implementation In-Reply-To: <43341CD2.1070701@web.am> References: <43341CD2.1070701@web.am> Message-ID: Hi, On 23/09/05, Gaspar Chilingarov wrote: > hi there! > > I have some problems with properly implementing > proxy pattern - i.e. I have one process which can emit messages to > another process, and I wish to have another running process to > retranslate them to subscribed processes. > > So I need to implement process which can handle registering/ > unregistering subscribers, and broadcasting messages got from another > process. > > This can be implemented without any problems, but how should I handle > crashes and restarts of receiving processes? You can monitor the receiving processes. Checkout erlang:monitor/1 > And how emitting process > should know and handle restarts of proxy process -- I mean how it should > get new pid after restart? Register a name for your proxy and you can always refer to it by name. cheers Chandru From kruegger@REDACTED Tue Sep 27 19:34:16 2005 From: kruegger@REDACTED (Stephen Han) Date: Tue, 27 Sep 2005 10:34:16 -0700 Subject: Segmentation fault on Linux In-Reply-To: <200509271030.01843.p-news@telia.com> References: <86f1f53505092316337fa54654@mail.gmail.com> <200509271030.01843.p-news@telia.com> Message-ID: <86f1f5350509271034228cd478@mail.gmail.com> Hi... Here is the bug report on debian list. He also mentioned about gentoo, too at the end of the report. linux.debian.bugs.dist Bug#276800 That is where I found about this problem. regards, On 9/27/05, P wrote: > > s > > > > Hej Edmund ! > > A less scientific way might be to remove the whole (old) erlang > distribution > and rebuild the new. > > If --prefix= > > ls might look like: > ... > ... > ... > drwxrwxr-x erts-5.4.6 > drwxr-xr-x erts-5.4.9 > ... > ... > ... > > I had some strange behaviour when building erlang some time ago > (a year ?) which disapeared after a removal and a rebuild. > > > BTW. where is the erlang.gif supposed to be ? It has been in several > applications. > > Mvh. > Per Einar > > > > ------------------------------------------------------------------------------ > Per Einar Str?mme > p-news@REDACTED > > ------------------------------------------------------------------------------ > > > > m?ndag 26 september 2005 22:18 skrev Edmund Dengler: > > Howdy! > > > > I can report that using '--disable-hipe' does indeed work (at the > expense > > of optimizations). Are there any plans/hopes on fixing this, or is this > a > > fundamental problem requiring the switch to native posix threads (as has > > been suggsted as another solution - I have not had time to test out)? > > > > Regards! > > Ed > > > > > > On Fri, 23 Sep 2005, Stephen Han wrote: > > > > > I also have a problem in gentoo linux. > > > > > > Try to compile with --disable-hipe, see if it is work. > > > > > > There is an issue with new linux thread, the hipe may not be work in > some > > > situation, depends on what versions of libaries in your gentoo linux. > > > There were 2 ways to fix the problem and the easiest thing is to > disable > > > hipe. The other one I forgot. > > > > > > regards, > > > > > > On 9/22/05, Edmund Dengler wrote: > > > > > > > > Howdy folks! > > > > > > > > I am getting segmentation errors when trying to run using OTP > 10B-6 > > > > and 10B-7 on Linux. I can compile 10B-5 with no problems. Anybody > have any > > > > ideas on what may be causing this? > > > > > > > > Details: > > > > - Gentoo Linux (2.6.8-gentoo-r3) > > > > - gcc version 3.3.5 > > > > - compile flags: > > > > ./configure --prefix=/opt/pkgs/erlang/10b-6 > > > > > > > > I did notice a previous message on this > > > > ( > http://www.erlang.org/ml-archive/erlang-questions/200410/msg00057.html) > > > > but no solution seemd to be posted. > > > > > > > > Regards! > > > > Ed > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From klacke@REDACTED Tue Sep 27 19:34:41 2005 From: klacke@REDACTED (Claes Wikstrom) Date: Tue, 27 Sep 2005 19:34:41 +0200 Subject: Debugging crashes during init In-Reply-To: <43392C4B.5090500@bates.id.au> References: <43392C4B.5090500@bates.id.au> Message-ID: <433982B1.6030007@hyber.org> Tim Bates wrote: > Hi folks, > When a process crashes during normal operation I get a lovely error > report printout with a reason for the crash and a traceback. When > something crashes inside my Application:start/2 functions I get this: > > > > $ erl -boot lib/traderl/priv/traderl -config test -traderl gainfiles > '[test1.csv, test2.csv]' > Erlang (BEAM) emulator version 5.4.8 [source] [hipe] [threads:0] > > > =INFO REPORT==== 27-Sep-2005::20:50:40 === > application: traderl > exited: {shutdown,{traderl_app,start,[normal,[]]}} > type: permanent > {"Kernel pid terminated",application_controller,shutdown} Hmmm, this has irritated me too for some time and I've been bugging Martin Bjorklund about it since this is originally his code which delivers the above worthless errormsg. However, I started to play with it and cannot really reproduce. Exactly when is it that erlang cannot give a good reason for failing to boot. ? /klacke From emil.hellman@REDACTED Tue Sep 27 19:44:02 2005 From: emil.hellman@REDACTED (Emil Hellman) Date: Tue, 27 Sep 2005 19:44:02 +0200 Subject: Debugging crashes during init In-Reply-To: <43392C4B.5090500@bates.id.au> References: <43392C4B.5090500@bates.id.au> Message-ID: Hello! I'm no expert on erlang applications, but have you tried starting the application with application:start()? If you are not certain where the application acctually crashes you could try starting the toplevel supervisor by hand and see if everything works as intended...If it doesn't work you will most likely get better crash reports, but if it does work you know that the crash has something to do with your module implementing the application behaviour (which you are implying). Also you could try starting up the sasl application before starting your own application (if you're not doing that already)... that might give you some aditional output i suppose... Then again I might be off base here since I'm still just a student at uni =) Cheers! -Emil On 9/27/05, Tim Bates wrote: > Hi folks, > When a process crashes during normal operation I get a lovely error > report printout with a reason for the crash and a traceback. When > something crashes inside my Application:start/2 functions I get this: > > > > $ erl -boot lib/traderl/priv/traderl -config test -traderl gainfiles > '[test1.csv, test2.csv]' > Erlang (BEAM) emulator version 5.4.8 [source] [hipe] [threads:0] > > > =INFO REPORT==== 27-Sep-2005::20:50:40 === > application: traderl > exited: {shutdown,{traderl_app,start,[normal,[]]}} > type: permanent > {"Kernel pid terminated",application_controller,shutdown} > > Crash dump was written to: erl_crash.dump > Kernel pid terminated (application_controller) (shutdown) > > > > The crash dump doesn't really give me any more useful information than > this. How can I find out where and why my init routines crashed? I've > been reduced to using print statements and it's frustrating to say the > least. > > Thanks, > Tim. > > -- > Tim Bates > tim@REDACTED > From feucht@REDACTED Tue Sep 27 21:47:08 2005 From: feucht@REDACTED (feucht@REDACTED) Date: Tue, 27 Sep 2005 21:47:08 +0200 (CEST) Subject: Problems posting In-Reply-To: <200509271757.56823.JMBALADO@terra.es> Message-ID: On 27 Sep, Jose Balado wrote: > Please, anyone knows if there is a problem posting to th list with kontact, > or perhaps with length of post or any other issue? > Because I can only post small messages like this. > > Thanks, > Jose Hello Jose, put the file on a webserver and post the link? greetings, Philip From mikpe@REDACTED Tue Sep 27 22:56:53 2005 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 27 Sep 2005 22:56:53 +0200 Subject: Segmentation fault on Linux In-Reply-To: <86f1f5350509271034228cd478@mail.gmail.com> References: <86f1f53505092316337fa54654@mail.gmail.com> <200509271030.01843.p-news@telia.com> <86f1f5350509271034228cd478@mail.gmail.com> Message-ID: <17209.45589.930985.723517@alkaid.it.uu.se> Stephen Han writes: > Hi... > Here is the bug report on debian list. He also mentioned about gentoo, too > at the end of the report. > linux.debian.bugs.dist > Bug#276800 > That is where I found about this problem. > regards, Please post a direct URL if you expect us to look into this bug report. From neumann@REDACTED Wed Sep 28 00:02:48 2005 From: neumann@REDACTED (=?iso-8859-1?q?Fran=E7ois-Denis_Gonthier?=) Date: Tue, 27 Sep 2005 18:02:48 -0400 Subject: Segmentation fault on Linux In-Reply-To: <86f1f5350509271034228cd478@mail.gmail.com> References: <200509271030.01843.p-news@telia.com> <86f1f5350509271034228cd478@mail.gmail.com> Message-ID: <200509271802.51033.neumann@lostwebsite.net> On 27 September 2005 13:34, Stephen Han wrote: This bug has been closed sometimes ago. I don't know about Gentoo, but it's the case in Debian. If anyone still has problem with Erlang on Debian I'd like to know it. > Hi... > Here is the bug report on debian list. He also mentioned about gentoo, too > at the end of the report. > linux.debian.bugs.dist > Bug#276800 > That is where I found about this problem. > regards, > > On 9/27/05, P wrote: > > s > > > > > > > > Hej Edmund ! > > > > A less scientific way might be to remove the whole (old) erlang > > distribution > > and rebuild the new. > > > > If --prefix= > > > > ls might look like: > > ... > > ... > > ... > > drwxrwxr-x erts-5.4.6 > > drwxr-xr-x erts-5.4.9 > > ... > > ... > > ... > > > > I had some strange behaviour when building erlang some time ago > > (a year ?) which disapeared after a removal and a rebuild. > > > > > > BTW. where is the erlang.gif supposed to be ? It has been in several > > applications. > > > > Mvh. > > Per Einar > > > > > > > > ------------------------------------------------------------------------- > >----- Per Einar Str?mme > > p-news@REDACTED > > > > ------------------------------------------------------------------------- > >----- > > > > m?ndag 26 september 2005 22:18 skrev Edmund Dengler: > > > Howdy! > > > > > > I can report that using '--disable-hipe' does indeed work (at the > > > > expense > > > > > of optimizations). Are there any plans/hopes on fixing this, or is this > > > > a > > > > > fundamental problem requiring the switch to native posix threads (as > > > has been suggsted as another solution - I have not had time to test > > > out)? > > > > > > Regards! > > > Ed > > > > > > On Fri, 23 Sep 2005, Stephen Han wrote: > > > > I also have a problem in gentoo linux. > > > > > > > > Try to compile with --disable-hipe, see if it is work. > > > > > > > > There is an issue with new linux thread, the hipe may not be work in > > > > some > > > > > > situation, depends on what versions of libaries in your gentoo linux. > > > > There were 2 ways to fix the problem and the easiest thing is to > > > > disable > > > > > > hipe. The other one I forgot. > > > > > > > > regards, > > > > > > > > On 9/22/05, Edmund Dengler wrote: > > > > > Howdy folks! > > > > > > > > > > I am getting segmentation errors when trying to run using OTP > > > > 10B-6 > > > > > > > and 10B-7 on Linux. I can compile 10B-5 with no problems. Anybody > > > > have any > > > > > > > ideas on what may be causing this? > > > > > > > > > > Details: > > > > > - Gentoo Linux (2.6.8-gentoo-r3) > > > > > - gcc version 3.3.5 > > > > > - compile flags: > > > > > ./configure --prefix=/opt/pkgs/erlang/10b-6 > > > > > > > > > > I did notice a previous message on this > > > > > ( > > > > http://www.erlang.org/ml-archive/erlang-questions/200410/msg00057.html) > > > > > > > but no solution seemd to be posted. > > > > > > > > > > Regards! > > > > > Ed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From tim@REDACTED Wed Sep 28 01:30:00 2005 From: tim@REDACTED (Tim Bates) Date: Wed, 28 Sep 2005 09:00:00 +0930 Subject: Debugging crashes during init In-Reply-To: <433982B1.6030007@hyber.org> References: <43392C4B.5090500@bates.id.au> <433982B1.6030007@hyber.org> Message-ID: <4339D5F8.4000607@bates.id.au> Claes Wikstrom wrote: > However, I started to play with it and cannot really reproduce. > Exactly when is it that erlang cannot give a good reason for > failing to boot. ? With a bit of experimentation, I've found that it gives the exited: {shutdown,{traderl_app,start,[normal,[]]}} message when something crashes inside one of my worker processes' init() functions. So eg causing a crash inside my_app:start/2 or my_sup:init/1 gives a proper error, but causing a crash inside my_proc:init/1 (which is a process that is started and supervised by my_sup) gives the above error. Hope this helps, Tim. -- Tim Bates tim@REDACTED From kruegger@REDACTED Wed Sep 28 07:43:42 2005 From: kruegger@REDACTED (Stephen Han) Date: Tue, 27 Sep 2005 22:43:42 -0700 Subject: Segmentation fault on Linux In-Reply-To: <17209.45589.930985.723517@alkaid.it.uu.se> References: <86f1f53505092316337fa54654@mail.gmail.com> <200509271030.01843.p-news@telia.com> <86f1f5350509271034228cd478@mail.gmail.com> <17209.45589.930985.723517@alkaid.it.uu.se> Message-ID: <86f1f53505092722435699bc91@mail.gmail.com> http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/260ed6a19375ce7a/235db24c7e73a8e3?q=276800+thread&rnum=1&hl=en#235db24c7e73a8e3 On 9/27/05, Mikael Pettersson wrote: > > Stephen Han writes: > > Hi... > > Here is the bug report on debian list. He also mentioned about gentoo, > too > > at the end of the report. > > linux.debian.bugs.dist > > Bug#276800 > > That is where I found about this problem. > > regards, > > Please post a direct URL if you expect us to look into this bug report. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.wiger@REDACTED Wed Sep 28 09:29:50 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 28 Sep 2005 09:29:50 +0200 Subject: record field names Message-ID: Interestingly, in sys_pre_expand.erl, you find the following code and comment: %% Expand a call to record_info/2. We have checked that it is not %% shadowed by an import. record_info_call(Line, [{atom,_Li,Info},{atom,_Ln,Name}], St) -> case Info of size -> {{integer,Line,1+length(record_fields(Name, St))},St}; fields -> {make_list(field_names(record_fields(Name, St)), Line),St} end. Apparently, someone had envisioned a way to import a record_info/2 function. From where, one might wonder? /Uffe > -----Original Message----- > From: Mats Cronqvist [mailto:mats.cronqvist@REDACTED] > Sent: den 16 september 2005 17:05 > To: Ulf Wiger (AL/EAB) > Cc: erlang-questions@REDACTED > Subject: Re: record field names > > > name clashes? surely you can't have a real record_info/2 function? > > mats > > Ulf Wiger (AL/EAB) wrote: > > In order to eliminate name clashes, why not > > > > Module:module_info({record, Rec, fields}) > > > > /Uffe > > > > > >>-----Original Message----- > >>From: owner-erlang-questions@REDACTED > >>[mailto:owner-erlang-questions@REDACTED]On Behalf Of Mats > Cronqvist > >>Sent: den 16 september 2005 16:22 > >>To: erlang-questions@REDACTED > >>Subject: record field names > >> > >> > >> feels like this is an faq, but i can't find it in the archive. > >> > >> according to the reference manual: > >> "To each module using records, a pseudo function is added > >>during compilation > >>to obtain information about records: > >>record_info(fields, Record) -> [Field] > >>record_info(size, Record) -> Size" > >> > >> now, as i understand it, there is no function, just > >>textual substitution > >>(like a macro). > >> > >> but why not? if there was a real, exported function > >>record_info/2 (just like > >>module_info), one could do a lot of cool things. > >> > >> such as turning a record into a tagged tuple; > >> > >>readable_rec(Module,Rec) -> > >> > >>lists:zip(Module:record_info(fields,element(1,Rec)),tl(tuple_t > >>o_list(Rec))). > >> > >> or write a tool to check that all modules using a certain > >>record agree on its > >>definition. > >> > >> mats > >> > From feucht@REDACTED Wed Sep 28 09:46:44 2005 From: feucht@REDACTED (feucht@REDACTED) Date: Wed, 28 Sep 2005 09:46:44 +0200 (CEST) Subject: Problems posting In-Reply-To: <200509272143.37390.JMBALADO@terra.es> Message-ID: Hello, Mr Jose Balado asked to post this text. greetings Philip Hi, I am Jose Balado from Santiago de Compostela, (Galicia, Spain), and would like to know if there is somebody, preferably near to meet in person, to help me with learning Erlang or perhaps interested in learning it with me. ?I am studying second course of "Tecnico superior en administracion de sistemas informaticos", sorry but I don't know the equivalent degree in Europe. I would like to do a final proyect for this course with Erlang if I be able to persuade the teacher, so any help to this matter will be greatly appereciated. ?I would like to program some basic artificial intelligence problems using Erlang and I am trying to do with Erlang the problems from Ivan Bratko book "Prolog programming for articificial intelligence". I studied logic and a little prolog in my philosopy studies. I have a bachelor degree in philosopy. ?Hey, I think only a bachelor degree in philosophy should be allowed to be PhD "Doctor of Philosophy" :-) ?If anyone wants to make a team with me please, let me know. Thank you very much, Jose From ulf.wiger@REDACTED Wed Sep 28 10:51:07 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 28 Sep 2005 10:51:07 +0200 Subject: record field names Message-ID: Here's a diff for sys_pre_expand.erl (rel. to compiler-4.3.9), which converts the pseudo-function record_info/2 into a real, exported function. I decided that I really would like to have this function myself. Example: ws12858> erlc -W sys_pre_expand.erl ./sys_pre_expand.erl:617: Warning: erlang:hash/2 obsolete; use erlang:phash2/2 ./sys_pre_expand.erl:626: Warning: erlang:hash/2 obsolete; use erlang:phash2/2 ws12858> erlc -pa . ../classic_server.erl ws12858> erl -pa . Erlang (BEAM) emulator version 5.4.9 [hipe] [threads:0] [kernel-poll] Eshell V5.4.9 (abort with ^G) 1> classic_server:module_info(records). [state] 2> classic_server:record_info(fields,state). [value] 3> classic_server:record_info(size,state). 2 4> classic_server:record_info(dummy,state). ** exited: {function_clause,[{classic_server,record_info,[dummy,state]}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Ulf Wiger > (AL/EAB) > Sent: den 28 september 2005 09:30 > To: Mats Cronqvist (AL/EAB) > Cc: erlang-questions@REDACTED > Subject: RE: record field names > > > > Interestingly, in sys_pre_expand.erl, you find the > following code and comment: > > %% Expand a call to record_info/2. We have checked that it is not > %% shadowed by an import. > > record_info_call(Line, [{atom,_Li,Info},{atom,_Ln,Name}], St) -> > case Info of > size -> > {{integer,Line,1+length(record_fields(Name, St))},St}; > fields -> > {make_list(field_names(record_fields(Name, St)), Line),St} > end. > > Apparently, someone had envisioned a way to import a > record_info/2 function. From where, one might wonder? > > /Uffe > > > -----Original Message----- > > From: Mats Cronqvist [mailto:mats.cronqvist@REDACTED] > > Sent: den 16 september 2005 17:05 > > To: Ulf Wiger (AL/EAB) > > Cc: erlang-questions@REDACTED > > Subject: Re: record field names > > > > > > name clashes? surely you can't have a real record_info/2 > function? > > > > mats > > > > Ulf Wiger (AL/EAB) wrote: > > > In order to eliminate name clashes, why not > > > > > > Module:module_info({record, Rec, fields}) > > > > > > /Uffe > > > > > > > > >>-----Original Message----- > > >>From: owner-erlang-questions@REDACTED > > >>[mailto:owner-erlang-questions@REDACTED]On Behalf Of Mats > > Cronqvist > > >>Sent: den 16 september 2005 16:22 > > >>To: erlang-questions@REDACTED > > >>Subject: record field names > > >> > > >> > > >> feels like this is an faq, but i can't find it in the archive. > > >> > > >> according to the reference manual: > > >> "To each module using records, a pseudo function is added > > >>during compilation > > >>to obtain information about records: > > >>record_info(fields, Record) -> [Field] > > >>record_info(size, Record) -> Size" > > >> > > >> now, as i understand it, there is no function, just > > >>textual substitution > > >>(like a macro). > > >> > > >> but why not? if there was a real, exported function > > >>record_info/2 (just like > > >>module_info), one could do a lot of cool things. > > >> > > >> such as turning a record into a tagged tuple; > > >> > > >>readable_rec(Module,Rec) -> > > >> > > >>lists:zip(Module:record_info(fields,element(1,Rec)),tl(tuple_t > > >>o_list(Rec))). > > >> > > >> or write a tool to check that all modules using a certain > > >>record agree on its > > >>definition. > > >> > > >> mats > > >> > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: sys_pre_expand.erl.diff Type: application/octet-stream Size: 5481 bytes Desc: sys_pre_expand.erl.diff URL: From ok@REDACTED Tue Sep 13 05:46:05 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 13 Sep 2005 15:46:05 +1200 (NZST) Subject: Erlang vs Java revisited Message-ID: <200509130346.j8D3k50P188686@atlas.otago.ac.nz> I've just been reading Opinion - Taking Software Seriously P. B. Ladkin University of Bielefeld Journal of System Safety 41(3), May-June 2005 (No, I don't subscribe to that Journal. Wish I did. I got it from the Beielefeld web site.) The topic of the paper is basically "How do we achieve, and know that we have achieved, extremely low failure rates? We can't." Quotes: Both these standards [for safety critical software] require that, for the most critical systems, someone will have had to demonstrate a dangerous failure rate of at most one failure in one hundred million [one standard], respectively one billion [the other], hours of operation (the fabled ten-to-the-minus-nine rate), for the device running your software. ... What do we know about defect rates or failure rates? ... current good practice achievs a defect rate in delivered software of less than one per deliver KLOC. Les Hatton ... using "Safer C" ... 0.24 per K executable LOC ... Praxis ... 0.22 per KSLOC ... on [a] helicoper landing advisory system [and] 0.04 defects per KSLOC on [a] smart card security project [and] comparable or lower defect rates on more recent projects. I know of no better results than those of Praxis. Issue: defect rates are thought to scale worse than linearly with SLOC; reducing SLOC count by a factor of 6, say, can be expected to reduce number of defects by more than a factor of 6. ... what do we know about the efficacy of testing SW? Quite a lot. There is a hard mathematical limit ... published by Bev Littlewood and Lorenzo Strigini ... and Rick Butler and George Finelli ... in 1993. It disturbs me that it is still not generally known. ... how can you possibly attain that [] confidence when you know that the very best practice only gets you down to one fault per few KLOC? Answer: you can't. ... To summarise, the very best statistical- testing regime will find you those faults which lead to failure at a rate equal to or more frequent than one hundred thousand operational hours [that's 1 every 11 years; what if your software is running on 11,000 sites? it's 1000 every year then] How many failures are those? Edward Adams ... [found that] fully one third of the [failure] reports [from the field] concerned faults that could be expected to result in failure less frequently than once every 60k operational months. [that means testing is not likely to find them] Through statistical testing you can expect to find those faults which cause at most two-thirds of your failures. (What do you do about that remaining one-third?) Issue: do our best, and we are still going to have defects. We need design methods and supporting tools (like languages) that let us cope with unreliable components. This has always been part of the design ideas behind Erlang. ... some organisations develop their systems according to rigorous development processes, such as SEI's Capability Maturity Model and derivatives. The problem with this approach is that no reliable correlation has ever been demonstated between adherence to a development-process model and the quality of the resulting product, no matter how we might wish for one. Oops. There's no denying it, Java *is* more verbose than Erlang. (There's also no denying that Erlang is verbose compared with, say, Haskell. I have a Haskell-like notation for Erlang which reduces the SLOC count by a factor of 1.6; I'm fairly confident that it is possible to do better.) Using higher level tools which *generate* Java rather than writing Java directly is an extremely sensible thing to do. Ditto for Erlang, when appropriate, which is why Erlang has Yecc and interface-generating tools for CORBA and ASN.1. JUnit (originally designed for Smalltalk, which is also considerably more concise than Java) is one of the great strengths of Java, but we have testing tools for Erlang, including QuickCheck. There is a C++Unit. The way Praxis get their error rates down is by using a verifier (written in Poplog Prolog, I believe; why else did the SPARK kit come with a Poplog installation?). ESC/Java2 is a verifier for Java; I don't know of any comparable free tool for C++. Thomas Arts &c has been doing impressive stuff verifying Erlang, and the Dialyzer is a relevant tool. Programs are data. My big complaint about older IDEs is that they encouraged people to think of programs as exclusively something human-written, when our best hope of reliable software is to write as little of it as possible. What would Template Haskell look like in Erlang? From JMBALADO@REDACTED Wed Sep 21 23:58:34 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Wed, 21 Sep 2005 23:58:34 +0200 Subject: Help with learning Erlang Message-ID: <200509212358.34916.JMBALADO@terra.es> ?Hi, I am Jose Balado from Santiago de Compostela, (Galicia, Spain). and would like to know if there is somebody near to help me in learning Erlang, or perhaps interested in learning it with me. I am studying second course of "t?cnico superior en administraci?n de sistemas inform?ticos", sorry I don't know what would be the equivalent degree in Europe, and I would like to do a final proyect for this course with Erlang, if I be able to persuade the teacher, so any help will be greatly appreciated. ?I would like to try programming some basic problems of Artificial Intelligence, I studied of logic and a little prolog in my philosophy studies, I am "licenciado en filosof?a" ?"bachelor degree in philosophy?". ? Hey, I think only a bachelor degree in philosophy must be allowed to be ?Phd 'Doctor of Philosophy' :-) ?Another question: ?Please, is anybody interesting in doing with me a very basic Erlang tutorial? You can take a look of my work at: http://anarchitech.org/wiki/showPage.yaws?node=ErlangBeginnersTutorial ?I think Erlang lacks of a truly beginners tutorial and this is very important for any programming language. A tutorial easy to follow, fun, with a lot of simple and useful examples, with lots of problems and their solutions, so anyone wanting to learn a programming language could have Erlang as its first programming language. ?The tutorial are mainly notes written by me with my poor understanding of Erlang and English. Thank you very much, Jose From JMBALADO@REDACTED Tue Sep 20 23:21:36 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Tue, 20 Sep 2005 23:21:36 +0200 Subject: Help with learning Erlang Message-ID: <200509202321.37097.JMBALADO@terra.es> I hope not to be too much off topic. ?Hi, I am Jose Balado from Santiago de Compostela, (Galicia, Spain). and would like to know if there is somebody near to help me in learning Erlang, or perhaps interested in learning it with me. I am studying second course of "t?cnico superior en administraci?n de sistemas inform?ticos", sorry I don't know what would be the equivalent degree in Europe, and I would like to do a final proyect for this course with Erlang, if I be able to persuade the teacher, so any help will be greatly appreciated. ?I would like to try programming some basic problems of Artificial Intelligence, I studied of logic and a little prolog in my philosophy studies, I am "licenciado en filosof?a" ?"bachelor degree in philosophy?". ? Hey, I think only a bachelor degree in philosophy must be allowed to be ?Phd 'Doctor of Philosophy' :-) ?Another question: ?Please, is anybody interesting in doing with me a very basic Erlang tutorial? You can take a look of my work at: http://anarchitech.org/wiki/showPage.yaws?node=ErlangBeginnersTutorial ?I think Erlang lacks of a truly beginners tutorial and this is very important for any programming language. A tutorial easy to follow, fun, with a lot of simple and useful examples, with lots of problems and their solutions, so anyone wanting to learn a programming language could have Erlang as its first programming language. ?The tutorial are mainly notes written by me with my poor understanding of Erlang and English. Thank you very much, Jose From JMBALADO@REDACTED Tue Sep 20 11:30:21 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Tue, 20 Sep 2005 11:30:21 +0200 Subject: Help in learning Erlang Message-ID: <200509201130.21618.JMBALADO@terra.es> I hope not to be too much off topic. Hi, I am Jose Balado from Santiago de Compostela, (Galicia, Spain). and would like to know if there is somebody near to help me in learning Erlang, or perhaps interested in learning it with me. I am studying second course of "t?cnico superior en administraci?n de sistemas inform?ticos", sorry I don't know what would be the equivalent degree in Europe, and I would like to do a final proyect for this course with Erlang, if I be able to persuade the teacher, so any help will be greatly appreciated. I would like to try programming some basic problems of Artificial Intelligence, I studied of logic and a little prolog in my philosophy studies, I am "licenciado en filosof?a" "bachelor degree in philosophy?". Hey, I think only a bachelor degree in philosophy must be allowed to be Phd 'Doctor of Philosophy' :-) Another question: Please, is anybody interesting in doing with me a very basic Erlang tutorial? You can take a look of my work at: http://anarchitech.org/wiki/showPage.yaws?node=ErlangBeginnersTutorial I think Erlang lacks of a truly beginners tutorial and this is very important for any programming language. A tutorial easy to follow, fun, with a lot of simple and useful examples, with lots of problems and their solutions, so anyone wanting to learn a programming language could have Erlang as its first programming language. The tutorial are mainly notes written by me with my poor understanding of Erlang and English. Thank you very much, Jose From JMBALADO@REDACTED Tue Sep 27 18:39:59 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Tue, 27 Sep 2005 18:39:59 +0200 Subject: Help with learning Erlang Message-ID: <200509271839.59441.JMBALADO@terra.es> Hi, I am Jose Balado from Santiago de Compostela, (Galicia, Spain), and would like to know if there is somebody, preferably near to meet in person, to help me with learning Erlang or perhaps interested in learning it with me. I am studying second course of "Tecnico superior en administracion de sistemas informaticos", sorry but I don't know the equivalent degree in Europe. I would like to do a final proyect for this course with Erlang if I be able to persuade the teacher, so any help to this matter will be greatly appereciated. I would like to program some basic artificial intelligence problems using Erlang and I am trying to do with Erlang the problems from Ivan Bratko book "Prolog programming for articificial intelligence". I studied logic and a little prolog in my philosopy studies. I have a bachelor degree in philosopy. Hey, I think only a bachelor degree in philosophy should be allowed to be PhD "Doctor of Philosophy" :-) If anyone wants to make a team with me please, let me know. Thank you very much, Jose From JMBALADO@REDACTED Tue Sep 27 15:19:32 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Tue, 27 Sep 2005 15:19:32 +0200 Subject: Help with learning Erlang Message-ID: <200509271519.32692.JMBALADO@terra.es> Hi, I am Jose Balado from Santiago de Compostela, (Galicia, Spain). and would like to know if there is somebody near, to meet in person or perhaps interested in learning it with me. I am studying second course of "t?cnico superior en administraci?n de sistemas inform?ticos", sorry I don't know what would be the equivalent degree in Europe, and I would like to do a final proyect for this course with Erlang, if I be able to persuade the teacher, so any help will be greatly appreciated in that respect. ?I would like to try programming some basic problems of Artificial Intelligence. I'm tryng in Erlang some Prolog problems I take from Ivan Bratko "Prolog programming for artificial intelligence". I studied of logic and a little prolog in my philosophy studies, I have a?"bachelor degree in philosophy?". ? Hey, I think only a bachelor degree in philosophy must be allowed to be ?Phd 'Doctor of Philosophy' :-) ?Another question: ?Please, is anybody interesting in doing with me a very basic Erlang tutorial? You can take a look of my work at: http://anarchitech.org/wiki/showPage.yaws?node=ErlangBeginnersTutorial ?I think Erlang lacks of a truly beginners tutorial and this is very important for any programming language. A tutorial easy to follow, fun, with a lot of simple and useful examples, with lots of problems and their solutions, so anyone wanting to learn a programming language could have Erlang as its first programming language. ?The tutorial are mainly notes written by me with my poor understanding of Erlang and English. Sorry for this long a boring speech. Thank you very much, Jose From JMBALADO@REDACTED Tue Sep 27 17:13:04 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Tue, 27 Sep 2005 17:13:04 +0200 Subject: Help with learning Erlang Message-ID: <200509271713.04668.JMBALADO@terra.es> Hi, I am Jose Balado from Santiago de Compostela, (Galicia, Spain), and would like to know if there is somebody, preferably near to meet in person, to help me with learning Erlang or perhaps interested in learning it with me. I am studying second course of "Tecnico superior en administracion de sistemas informaticos", sorry but I don't know the equivalent degree in Europe. I would like to do a final proyect for this course with Erlang if I be able to persuade the teacher, so any help to this matter will be greatly appereciated. I would like to program some basic artificial intelligence problems using Erlang and I am trying to do with Erlang the problems from Ivan Bratko book "Prolog programming for articificial intelligence". I studied logic and a little prolog in my philosopy studies. I have a bachelor degree in philosopy. Hey, I think only a bachelor degree in philosophy should be allowed to be PhD "Doctor of Philosophy" :-) If anyone is willing to make a team with me please, let me know. Thank you very much, Jose From JMBALADO@REDACTED Tue Sep 27 15:54:55 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Tue, 27 Sep 2005 15:54:55 +0200 Subject: Help with learning Erlang Message-ID: <200509271554.55704.JMBALADO@terra.es> Hi, I am Jose Balado from Santiago de Compostela, (Galicia, Spain). and would like to know if there is somebody, preferably near, to help me in learning Erlang or perhaps interested in learning it with me. I would be nice if we could meet in person. I am studying second course of "t?cnico superior en administraci?n de sistemas inform?ticos", sorry I don't know what would be the equivalent degree in Europe, and I would like to do a final proyect for this course with Erlang, if I be able to persuade the teacher. So any help to persuade the teacher, will be greatly appreciated. ?I would like to try programming some basic problems of Artificial Intelligence. I'm trying to do, in Erlang, some Prolog problems from Ivan Bratko "Prolog programming for artificial intelligence". I studied of logic and a little prolog in my philosophy studies, I have a?"bachelor degree in philosophy?". ? Hey, I think only a bachelor degree in philosophy must be allowed to be ?Phd 'Doctor of Philosophy' :-) Sorry for the long and boring speech. Thank you very much, Jose From JMBALADO@REDACTED Tue Sep 27 21:51:45 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Tue, 27 Sep 2005 21:51:45 +0200 Subject: Help with learning Erlang Message-ID: <200509272151.45154.JMBALADO@terra.es> Hi, I am Jose Balado from Santiago de Compostela, (Galicia, Spain), and would like to know if there is somebody, preferably near to meet in person, to help me with learning Erlang or perhaps interested in learning it with me. ?I am studying second course of "Tecnico superior en administracion de sistemas informaticos", sorry but I don't know the equivalent degree in Europe. I would like to do a final proyect for this course with Erlang if I be able to persuade the teacher, so any help to this matter will be greatly appereciated. ?I would like to program some basic artificial intelligence problems using Erlang and I am trying to do with Erlang the problems from Ivan Bratko book "Prolog programming for articificial intelligence". I studied logic and a little prolog in my philosopy studies. I have a bachelor degree in philosopy. ?If anyone wants to make a team with me please, let me know. Thank you very much, Jose From mikpe@REDACTED Wed Sep 28 11:28:21 2005 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 28 Sep 2005 11:28:21 +0200 Subject: Segmentation fault on Linux In-Reply-To: <200509271802.51033.neumann@lostwebsite.net> References: <200509271030.01843.p-news@telia.com> <86f1f5350509271034228cd478@mail.gmail.com> <200509271802.51033.neumann@lostwebsite.net> Message-ID: <17210.25141.889915.461104@alkaid.it.uu.se> Fran?ois-Denis Gonthier writes: > On 27 September 2005 13:34, Stephen Han wrote: > > This bug has been closed sometimes ago. I don't know about Gentoo, but it's > the case in Debian. > > If anyone still has problem with Erlang on Debian I'd like to know it. > > > Hi... > > Here is the bug report on debian list. He also mentioned about gentoo, too > > at the end of the report. > > linux.debian.bugs.dist > > Bug#276800 What was the resolution? Was the bug in Debian's glibc, in hipe_x86_signal.c's override of sigaction(), or in its sigaltstack usage? I'm surprised about the bug report's indications that 2.4 kernels (so LinuxThreads not NPTL) break things, since I've definitely tested those extensively (on RH/FC systems). /Mikael From raimo@REDACTED Wed Sep 28 11:44:47 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 28 Sep 2005 11:44:47 +0200 Subject: Problem posting Message-ID: As some may have noticed we have had a little problem with the mailing list, i.e the list owner suffered a heart attack. He is well, regarding the circumbstances (after surgery), and we have hijacked his inbox, processed the administrative list mails and assigned a new temporary rookie list owner. Sorry about this. We hope you will not experience any more problems because of this. -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From thomas.arts@REDACTED Wed Sep 28 11:54:02 2005 From: thomas.arts@REDACTED (Thomas Arts) Date: Wed, 28 Sep 2005 11:54:02 +0200 Subject: Help with learning Erlang In-Reply-To: <200509271713.04668.JMBALADO@terra.es> References: <200509271713.04668.JMBALADO@terra.es> Message-ID: <433A683A.50000@ituniv.se> Hi Jose There is a pretty strong group at the University of A Coruna that is very well capable of teaching Erlang. Why not take a course there? Look for LFCIA. There are even people there that used Erlang for AI! /Thomas Jose Balado wrote: > Hi, I am Jose Balado from Santiago de Compostela, (Galicia, Spain), and would >like to know if there is somebody, preferably near to meet in person, to help >me with learning Erlang or perhaps interested in learning it with me. > > I am studying second course of "Tecnico superior en administracion de >sistemas informaticos", sorry but I don't know the equivalent degree in >Europe. I would like to do a final proyect for this course with Erlang if I >be able to persuade the teacher, so any help to this matter will be greatly >appereciated. > > I would like to program some basic artificial intelligence problems using >Erlang and I am trying to do with Erlang the problems from Ivan Bratko book >"Prolog programming for articificial intelligence". I studied logic and a >little prolog in my philosopy studies. I have a bachelor degree in philosopy. > > Hey, I think only a bachelor degree in philosophy should be allowed to be PhD >"Doctor of Philosophy" :-) > > If anyone is willing to make a team with me please, let me know. > > >Thank you very much, >Jose > > > > > From Manjeet.Singh.Sardar@REDACTED Wed Sep 28 12:35:59 2005 From: Manjeet.Singh.Sardar@REDACTED (Manjeet.Singh Sardar (AC/EDD)) Date: Wed, 28 Sep 2005 12:35:59 +0200 Subject: Using Multiple nodes with same Cookie on single machine Message-ID: Hi, We are working on a project, which involves sever communication with our mobile application. The Sever and mobile application runs on different machines as Erlang nodes the server and mobile application communicates by setting a Cookie.This is working fine without any problem. We are currently planning to run multiple servers on a single machine and communicate with multiple mobile applications which are running on different machines. My question is, since we are planning to run different server nodes on single machine with same Cookie, does it effects the communication or performance of the system. Has anybody tested this type of setup? Thanks in Advance Regards Manjeet From laura@REDACTED Wed Sep 28 13:03:42 2005 From: laura@REDACTED (Laura M. Castro) Date: Wed, 28 Sep 2005 13:03:42 +0200 Subject: ODBC application error Message-ID: <433A788E.5000904@alfa21.com> Hi all, We have found a little confusing behaviour concerning the Erlang ODBC driver. This is a case example: connecting to the (postgresql) database through ODBC (using the isql utility), we can perform the following set of commands: lcastro:~$ isql ourdatabase +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> create table cosa (c1 integer, c2 varchar); SQLRowCount returns 0 SQL> select * from cosa; +------------+------------+ | c1 | c2 | +------------+------------+ +------------+------------+ SQLRowCount returns 0 SQL> insert into cosa values (1, 'Hola'); SQLRowCount returns 1 SQL> insert into cosa values (12, 'Holaa'); SQLRowCount returns 1 SQL> insert into cosa values (123, 'Holaaa'); SQLRowCount returns 1 SQL> insert into cosa values (1234, 'Holaaaa'); SQLRowCount returns 1 SQL> insert into cosa values (12345, 'Holaaaaa'); SQLRowCount returns 1 SQL> select * from cosa; +------------+------------+ | c1 | c2 | +------------+------------+ | 1 | Hola | | 12 | Holaa | | 123 | Holaaa | | 1234 | Holaaaa | | 12345 | Holaaaaa | +------------+------------+ SQLRowCount returns 5 5 rows fetched SQL> select * from cosa where c1 = 2; +------------+------------+ | c1 | c2 | +------------+------------+ +------------+------------+ SQLRowCount returns 0 SQL> delete from cosa where c1 = 2; SQLRowCount returns 0 But if we do the same through the Erlang ODBC driver, have a look at the result we get: Eshell V5.4.9 (abort with ^G) 1> application:start(odbc). ok 2> {ok, C} = odbc:connect("DSN=ourdatabase",[{auto_commit, off}, {timeout, infinity}, {scrollable_cursors, off}, {trace_driver, off}, {tuple_row, off}]). {ok,<0.42.0>} 3> odbc:sql_query(C, "select * from cosa", infinity). {selected,["c1","c2"], [[1,"Hola"], [12,"Holaa"], [123,"Holaaa"], [1234,"Holaaaa"], [12345,"Holaaaaa"]]} 4> odbc:sql_query(C, "select * from cosa where c1=2", infinity). {selected,["c1","c2"],[]} 5> odbc:sql_query(C, "delete from cosa where c1=2", infinity). {error,"No SQL-driver information available."} What I am trying to show it that I guess the Erlang ODBC driver may have some kind of problem with those SQL DELETE statements which eventually do not delete anything :-? Any help/comment will be very welcome... Thanks in advance, Laura Castro P.S. We were using Erlang R9C-2 but we have also tried with the newest version, Erlang R10B-7 and the situation remains the same. From ft@REDACTED Wed Sep 28 13:11:18 2005 From: ft@REDACTED (Fredrik Thulin) Date: Wed, 28 Sep 2005 13:11:18 +0200 Subject: extracting subjectAltName In-Reply-To: <200509261635.39867.ft@it.su.se> References: <200509261635.39867.ft@it.su.se> Message-ID: <200509281311.18828.ft@it.su.se> On Monday 26 September 2005 16.35, Fredrik Thulin wrote: > If I have a certificate structure returned by ssl:peercert/2, how do > I extract the subjectAltName(s)? ... Since there were no answers to my post, I figured there were no easy way. This is a post for the archives, in case anyone else wants to do this in the future. First, I realized that ssl:peercert/2's option 'ssl' is useless on the bewildered Internet, as it crashes with a function_clause as soon as you try to use it on a certificate that contains any extensions that Erlang SSL is not aware of. This has been reported several times (by myself and others) on the mailing list, but nobody seems intersted in fixing it (yes, in my opinion it is something that should be fixed). Use option 'pkix' instead, and then use the exported but not documented functions from the ssl application to make use of the results. The following is from my file yxa/src/transportlayer/tcp_connection.erl, mildly modified to e-mail format. I use Erlang/OTP R10B-6 since Erlang SSL distibution is broken in R10B-7 (although I haven't received any responses from the OTP team when reporting this - nudge nudge). -include_lib("ssl/include/SSL-PKIX.hrl"). ... {ok, Cert} = ssl:peercert(Socket, [pkix]), ... %%-------------------------------------------------------------------- %% Function: get_ssl_peer_info_host_altnames(Cert) %% Cert = 'Certificate' record, SSL PKIX parsed %% Descrip.: Extracts subjectAltName's of type dNSName or iPAddress %% from an SSL PKIX certificate. %% Returns : {ok, AltNames} %% AltNames = list() of string() %%-------------------------------------------------------------------- get_ssl_peer_info_host_altnames(Cert) when is_record(Cert, 'Certificate') -> Extensions = (Cert#'Certificate'.tbsCertificate)#'TBSCertificate'.extensions, AltNameExtensions = get_tbs_extensions( ssl_pkix_oid:atom2id(subjectAltName), Extensions), {ok, DNS_altNames} = get_host_altnames('SubjectAltName', AltNameExtensions), {ok, DNS_altNames}. %% get_tbs_extensions/2 - part of get_ssl_peer_info_host_altnames/1 %% Returns : list() of 'Extension' record get_tbs_extensions(Key, Extensions) -> get_tbs_extensions(Key, Extensions, []). get_tbs_extensions(Key, [#'Extension'{extnID = Key} = H | T], Res) -> get_tbs_extensions(Key, T, [H | Res]); get_tbs_extensions(Key, [H | T], Res) when is_record(H, 'Extension') -> get_tbs_extensions(Key, T, Res); get_tbs_extensions(_Key, [], Res) -> lists:reverse(Res). %% get_dns_altnames(Type, Extensions) - %% part of get_ssl_peer_info_host_altnames/1 %% Returns : {ok, Strings} get_host_altnames(Type, Extensions) -> get_host_altnames(Type, Extensions, []). get_host_altnames(Type, [#'Extension'{extnValue = Value} | T], Res) -> {ok, Decoded} = 'PKIX1Implicit88':decode(Type, list_to_binary(Value)), %% Decoded is a list of tuples, for example : %% [{rfc822Name, "ft@REDACTED"}, %% {dNSName, "sip.example.org"}] This = lists:foldl(fun({dNSName, Name}, Acc) when is_list(Name) -> [http_util:to_lower(Name) | Acc]; ({iPAddress, IP}, Acc) when is_list(IP) -> IPtuple = siphost:makeip( list_to_tuple(IP)), [IPstr | Acc]; (_NonDNSname, Acc) -> Acc end, [], Decoded), case This of [] -> %% we found no dNSName or iPAddress tuples in Decoded get_host_altnames(Type, T, Res); _ -> get_host_altnames(Type, T, Res ++ This) end; get_host_altnames(_Type, [], Res) -> {ok, Res}. /Fredrik From ft@REDACTED Wed Sep 28 13:45:16 2005 From: ft@REDACTED (Fredrik Thulin) Date: Wed, 28 Sep 2005 13:45:16 +0200 Subject: Using Multiple nodes with same Cookie on single machine In-Reply-To: References: Message-ID: <200509281345.16803.ft@it.su.se> On Wednesday 28 September 2005 12.35, Manjeet.Singh Sardar (AC/EDD) wrote: ... > My question is, since we are planning to run different server nodes > on single machine with same Cookie, does it effects the communication > or performance of the system. I assume you mean 'affect', not 'effect'. What do you mean by 'affect'? Node-to-node communication over the loopback interface is probably a tiny bit faster than node-to-node communication over fast ethernet (100 Mbp/s) or gigabit ethernet (1000 Mbp/s), but only marginally. > Has anybody tested this type of setup? Yes, I have several physical servers which run more than one erlang-node per server - naturally using the same cookie. /Fredrik From bjorn@REDACTED Wed Sep 28 13:48:56 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 28 Sep 2005 13:48:56 +0200 Subject: Max number of open file descriptors is too low In-Reply-To: References: <965C7B8D-0B24-427A-8E42-D9E6330A0362@gmail.com> <433951D9.2070300@ericsson.com> Message-ID: The code is correct. max_files will be adjusted downwards only if select() is actually used. On Mac OS X select() IS used. On Mac OS X 10.3, poll() is actually emulated using select(), so we call select() ourselves. On Mac OS X 10.4, there is a real poll() but it does not work for devices (including the terminal), so we use select() instead. /Bjorn Joel Reymont writes: > This won't work on Unix. Assuming that MAX_FILES() will return > ERL_MAX_PORTS, it will be reset back to FD_SETSIZE. I had this > problem on the Mac and had to edit header files. > > Could this be a bug? > > From erts/emulator/unix/sys.c > > void > erl_sys_init(void) > { > ... > if ((max_files = MAX_FILES()) < 0) > erl_exit(1, "Can't get no. of available file descriptors\n"); > > /* Note: this is if MAX_FILES() differ from FD_SETSIZE which it */ > /* does by deafult on e.g. BSDI */ > #if defined(USE_SELECT) && defined(FD_SETSIZE) > if (max_files > FD_SETSIZE) > max_files = FD_SETSIZE; > #endif > .. > } > > > On Sep 27, 2005, at 4:06 PM, Bengt Kleberg wrote: > > > On 2005-09-27 15:46, Joel Reymont wrote: > > > >> Folks, > >> Erlang hardcodes the maximum number of open file descriptors and I > >> think the default number is too low. At least on Windows it is. > >> > > > > ...deleted > > > >> Would the Erlang/OTP consider upping the number of descriptors on > >> Windows to something like 1024*8 or 1024*10? > >> > > > > greetings, > > > > have you tried this: > > > > (http://www.erlang.se/doc/doc-5.4.8/doc/efficiency_guide/ > > part_frame.html) > > > > Open files, and sockets > > The maximum number of simultaneously open files and sockets > > depend on the maximum number of Erlang ports available, and > > operating system specific settings and limits. > > > > Open ports > > The maximum number of simultaneously open Erlang ports is by > > default 1024. This limit can be raised up to at most 268435456 at > > startup (see environment variable ERL_MAX_PORTS in erlang(3)) The > > maximum limit of 268435456 open ports will at least on a 32-bit > > architecture be impossible to reach due to memory shortage. > > > > > > bengt > > > > > > -- > http://wagerlabs.com/ > > > > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From JMBALADO@REDACTED Wed Sep 28 12:25:46 2005 From: JMBALADO@REDACTED (Jose Balado) Date: Wed, 28 Sep 2005 12:25:46 +0200 Subject: apologize for so many Help with learning Erlang!!! In-Reply-To: <241d382f05092802547476d3bb@mail.gmail.com> References: <200509212358.34916.JMBALADO@terra.es> <241d382f05092802547476d3bb@mail.gmail.com> Message-ID: <200509281225.46366.JMBALADO@terra.es> On Wednesday 28 September 2005 11:54, Timur Irmatov wrote: > Dear Jose! > > Sending 7 emails with identical content to a public mailing list is > not a good way to seek help with any subject, be it Erlang or > whatever. > > Please, be polite and stop spamming.. > > If you don't see any responses to your mail, may be there are no > interested people, or they just didn't even read your email yet, or > may be not willing to answer or help. > > Thanks. You are absolutely right, but this is not spam, is me having problems posting to the list and I simply don't know what problem is, if you look to the date of some postings you will see than some was sent by me almost two weeks ago but not reached the list till today. I try it few times thinking the messages were lost. I am very sorry and hope you all to understand that it is not my intention to upset you. Best regards, Jose From joelr1@REDACTED Wed Sep 28 14:30:31 2005 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 28 Sep 2005 14:30:31 +0200 Subject: Max number of open file descriptors is too low In-Reply-To: References: <965C7B8D-0B24-427A-8E42-D9E6330A0362@gmail.com> <433951D9.2070300@ericsson.com> Message-ID: <0689248F-BE02-404B-B783-E600EFD31D45@gmail.com> So Mac OSX is not a good platform for running Erlang servers with a high number of simultaneous connections, right? I do see this code for Windows so ERL_MAX_PORTS would work there. I'm on Mac OSX, though, and I do not want to run Windows :-( --- void sys_init_io(byte *buf, Uint size) { tmp_buf = buf; tmp_buf_size = size; cerr_pos = 0; /* Now heres an icky one... This is called before drivers are, so we can change our view of the number of open files possible. We estimate the number to twice the amount of ports. We really dont know on windows, do we? */ max_files = 2*erts_max_ports; --- The whole thing is sad although I do understand the issues. I noticed that my server starts misbehaving at about 2,200 connections. No more connections are accepted roughly at that point. Could have something to do with select() and the number of open sockets. Thanks, Joel On Sep 28, 2005, at 1:48 PM, Bjorn Gustavsson wrote: > The code is correct. > > max_files will be adjusted downwards only if select() is actually > used. > > On Mac OS X select() IS used. On Mac OS X 10.3, poll() is actually > emulated using select(), so we call select() ourselves. On Mac OS X > 10.4, > there is a real poll() but it does not work for devices (including the > terminal), so we use select() instead. -- http://wagerlabs.com/ From Manjeet.Singh.Sardar@REDACTED Wed Sep 28 14:42:23 2005 From: Manjeet.Singh.Sardar@REDACTED (Manjeet.Singh Sardar (AC/EDD)) Date: Wed, 28 Sep 2005 14:42:23 +0200 Subject: Using Multiple nodes with same Cookie on single machine Message-ID: Hi Fredrick, You have answered my query. Regarding effect:I mean we are planning to run approx 50 nodes on a single physical server and the communication is over fast Ethernet 100Mbp/s does this effects the performance i.e. speed since we are communicating simultaneously. Thanks and Regards Manjeet -----Original Message----- From: Fredrik Thulin [mailto:ft@REDACTED] Sent: Wednesday, September 28, 2005 1:45 PM To: Manjeet.Singh Sardar (AC/EDD) Cc: Erlang-Questions (E-mail) Subject: Re: Using Multiple nodes with same Cookie on single machine On Wednesday 28 September 2005 12.35, Manjeet.Singh Sardar (AC/EDD) wrote: ... > My question is, since we are planning to run different server nodes > on single machine with same Cookie, does it effects the communication > or performance of the system. I assume you mean 'affect', not 'effect'. What do you mean by 'affect'? Node-to-node communication over the loopback interface is probably a tiny bit faster than node-to-node communication over fast ethernet (100 Mbp/s) or gigabit ethernet (1000 Mbp/s), but only marginally. > Has anybody tested this type of setup? Yes, I have several physical servers which run more than one erlang-node per server - naturally using the same cookie. /Fredrik From joelr1@REDACTED Wed Sep 28 14:44:55 2005 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 28 Sep 2005 14:44:55 +0200 Subject: BEA offers real-time version of WebLogic server Message-ID: <99D8D70E-A990-43D0-8FA7-89CD2DC1A297@gmail.com> Thought you folks will find it interesting: http://www.eweek.com/article2/0,1759,1864334,00.asp The Real Time Edition was developed to reduce pauses for garbage collection to a few milliseconds to provide a "very predictable response time to all applications that are running" ... "Goal is to bring to our customers in the financial services and telecommunications and other industries real-time or near-real-time performance," Carges said. The WebLogic Real Time Edition is essentially a combination of the Web Logic Server with BEA's JRockit Java Virtual Machine that provides the reliability and performance for enterprise applications, he said. -- http://wagerlabs.com/ From csanto@REDACTED Wed Sep 28 14:49:04 2005 From: csanto@REDACTED (Corrado Santoro) Date: Wed, 28 Sep 2005 14:49:04 +0200 Subject: Help with learning Erlang In-Reply-To: <200509272151.45154.JMBALADO@terra.es> References: <200509272151.45154.JMBALADO@terra.es> Message-ID: <433A9140.5030804@diit.unict.it> Hi Jose, we are working on Erlang and AI and we developed a rule-processing system in Erlang. It has been presented at the last Erlang Workshop in Tallinn. If you are interested, contact me. I could send the paper and/or the tool. Regards, --Corrado Jose Balado wrote: > Hi, I am Jose Balado from Santiago de Compostela, (Galicia, Spain), and would > like to know if there is somebody, preferably near to meet in person, to help > me with learning Erlang or perhaps interested in learning it with me. > > I am studying second course of "Tecnico superior en administracion de > sistemas informaticos", sorry but I don't know the equivalent degree in > Europe. I would like to do a final proyect for this course with Erlang if I > be able to persuade the teacher, so any help to this matter will be greatly > appereciated. > > I would like to program some basic artificial intelligence problems using > Erlang and I am trying to do with Erlang the problems from Ivan Bratko book > "Prolog programming for articificial intelligence". I studied logic and a > little prolog in my philosopy studies. I have a bachelor degree in philosopy. > > If anyone wants to make a team with me please, let me know. > > > Thank you very much, > Jose -- ====================================================== Eng. Corrado Santoro, Ph.D. University of Catania - Engineering Faculty Department of Computer Science and Telecommunications Engineering Viale A. Doria, 6 - 95125 CATANIA (ITALY) Tel: +39 095 7382144 Int. (5) 8035 +39 095 7382380 +39 095 7382365 +39 095 7382364 VoIP: sip:8035@REDACTED Fax: +39 095 7382397 EMail: csanto@REDACTED Personal Home Page: http://www.diit.unict.it/users/csanto NUXI Home Page: http://nuxi.iit.unict.it ====================================================== From bjorn@REDACTED Wed Sep 28 15:03:13 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 28 Sep 2005 15:03:13 +0200 Subject: Max number of open file descriptors is too low In-Reply-To: <0689248F-BE02-404B-B783-E600EFD31D45@gmail.com> References: <965C7B8D-0B24-427A-8E42-D9E6330A0362@gmail.com> <433951D9.2070300@ericsson.com> <0689248F-BE02-404B-B783-E600EFD31D45@gmail.com> Message-ID: Joel Reymont writes: > I do see this code for Windows so ERL_MAX_PORTS would work there. I'm > on Mac OSX, though, and I do not want to run Windows :-( That is correct. ERL_MAX_PORTS does work on Windows. > > The whole thing is sad although I do understand the issues. I noticed > that my server starts misbehaving at about 2,200 connections. No more > connections are accepted roughly at that point. Could have something > to do with select() and the number of open sockets. Sad, but not surprising. APIs and operating system were designed when 64 file descriptors would be enough for any application and 256 file descriptors were considered much more than anyone would need. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From yerl@REDACTED Wed Sep 28 15:19:16 2005 From: yerl@REDACTED (yerl@REDACTED) Date: Wed, 28 Sep 2005 15:19:16 +0200 Subject: ODBC application error Message-ID: An HTML attachment was scrubbed... URL: From klacke@REDACTED Wed Sep 28 15:22:33 2005 From: klacke@REDACTED (Claes Wikstom) Date: Wed, 28 Sep 2005 15:22:33 +0200 Subject: extracting subjectAltName In-Reply-To: <200509281311.18828.ft@it.su.se> References: <200509261635.39867.ft@it.su.se> <200509281311.18828.ft@it.su.se> Message-ID: <433A9919.2090809@hyber.org> Fredrik Thulin wrote: > > I use Erlang/OTP R10B-6 since Erlang > SSL distibution is broken in R10B-7 (although I haven't received any > responses from the OTP team when reporting this - I must have missed your reports on this. What was broken ? /klacke -------------- next part -------------- A non-text attachment was scrubbed... Name: klacke.vcf Type: text/x-vcard Size: 301 bytes Desc: not available URL: From taavi@REDACTED Wed Sep 28 15:26:55 2005 From: taavi@REDACTED (Taavi Talvik) Date: Wed, 28 Sep 2005 16:26:55 +0300 Subject: Help with learning Erlang In-Reply-To: <433A9140.5030804@diit.unict.it> References: <200509272151.45154.JMBALADO@terra.es> <433A9140.5030804@diit.unict.it> Message-ID: On Sep 28, 2005, at 3:49 PM, Corrado Santoro wrote: > we are working on Erlang and AI and we developed a rule-processing > system in Erlang. It has been presented at the last Erlang Workshop in > Tallinn. > > If you are interested, contact me. I could send the paper and/or the > tool. Hello! Are the Erlang Workshop proceedings available anywhere online? Unfortunately missed workshop despite being held practically at home:( best regards, taavi ---- Taavi Talvik Strategic Network Planning Tel: +372 6800013 Elisa GSM: +372 56569996 P?rnu mnt. 105 Fax: +372 6800001 Tallinn 11312, Estonia E-mail: taavi.talvik@REDACTED From ft@REDACTED Wed Sep 28 15:34:13 2005 From: ft@REDACTED (Fredrik Thulin) Date: Wed, 28 Sep 2005 15:34:13 +0200 Subject: extracting subjectAltName In-Reply-To: <433A9919.2090809@hyber.org> References: <200509261635.39867.ft@it.su.se> <200509281311.18828.ft@it.su.se> <433A9919.2090809@hyber.org> Message-ID: <200509281534.13466.ft@it.su.se> On Wednesday 28 September 2005 15.22, Claes Wikstom wrote: > Fredrik Thulin wrote: > > I use Erlang/OTP R10B-6 since Erlang > > SSL distibution is broken in R10B-7 (although I haven't received > > any responses from the OTP team when reporting this - > > I must have missed your reports on this. What was broken ? My nodes just hang. http://thread.gmane.org/gmane.comp.lang.erlang.bugs/128 /Fredrik From kostis@REDACTED Wed Sep 28 15:37:32 2005 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 28 Sep 2005 15:37:32 +0200 (MEST) Subject: Help with learning Erlang In-Reply-To: Mail from 'Taavi Talvik ' dated: Wed, 28 Sep 2005 16:26:55 +0300 Message-ID: <200509281337.j8SDbWMZ006531@spikklubban.it.uu.se> > Are the Erlang Workshop proceedings available anywhere online? Not yet as far as I know, but they will be available at the ACM Digital Library. > Unfortunately missed workshop despite being held practically at home:( Another option is to go and ask for or buy a copy at the workshop's venue in Tallinn. There are other co-located events still going on till the end of this week. Best, Kostis From simon@REDACTED Wed Sep 28 15:34:39 2005 From: simon@REDACTED (Simon@erlang) Date: Wed, 28 Sep 2005 14:34:39 +0100 Subject: Erlang Workshop Presentations Message-ID: <433A9BEF.4030406@erlang-consulting.com> We have now added the four presentations Erlang Training & Consulting gave in Tallinn online: On Saturday, we spoke at the Commercial Users of Functional programming languages workshop (CUFP) describing our experiences in ten years of marketing, using, testing and supporting Erlang. At the Erlang workshop, Francesca Gangemi presented ERESYE, a tool for the realization of expert systems. It is now possible to have an inference engine running in the same memory space as your Erlang application. Simon Aurell presented his thesis on home automation using instant messaging, a project developed using ejabberd, X10 drivers, and other open source components. Martin Carlson took advantage of the 10 minute ?crazy idea? session to talk about the 40% reduction in bugs when using test driven development with Erlang. All presentations are available at http://www.erlang-consulting.com/about_fs.html in both html and pdf. Hopefully, Bjarne will put up all other presentations online later on in the week on the official workshop page at http://www.erlang.se/workshop/2005/ Enjoy, Francesco -- http://www.erlang-consulting.com From vlad.xx.dumitrescu@REDACTED Wed Sep 28 15:35:02 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Wed, 28 Sep 2005 15:35:02 +0200 Subject: Meta-Erlang (was RE: Erlang vs Java revisited) Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE664@esealmw105.eemea.ericsson.se> Hello, > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Richard A. O'Keefe > Programs are data. My big complaint about older IDEs is that > they encouraged people to think of programs as exclusively something > human-written, when our best hope of reliable software is to write as little of > it as possible. Is it the IDEs that did that? > What would Template Haskell look like in Erlang? Parse transforms are a kind of meta-programming, just not embedded in the language and quite clunky to use. Since the compiler is readily available to any Erlang program, including itself, and the abstract syntax is already expressed in Erlang terms, I suppose it would be relatively easy to add some syntactic sugar through a parse transform to enable "proper" meta-programing. The lack of static typing would mean that one should be extremely careful when writing and testing meta-programs, but probably just as much as when writing "normal" parse transforms. I think it would be a very interesting area to explore. If only I could find the time... best regards, Vlad From ulf.wiger@REDACTED Wed Sep 28 16:04:35 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 28 Sep 2005 16:04:35 +0200 Subject: Erlang Workshop Presentations Message-ID: Simon (or was it Francesco?) wrote: > > All presentations are available at > http://www.erlang-consulting.com/about_fs.html in both html > and pdf. They rather seem to be available here: http://www.erlang-consulting.com/erlangarticles_fs.html /Uffe From ingela@REDACTED Wed Sep 28 16:14:15 2005 From: ingela@REDACTED (Ingela Anderton) Date: Wed, 28 Sep 2005 16:14:15 +0200 Subject: ODBC application error References: <433A788E.5000904@alfa21.com> Message-ID: <17210.42295.305501.902937@gargle.gargle.HOWL> Without investigating this further I would just like to clarify one thing. The Erlang odbc application is not a driver it is an Erlang interface to communicate with relational SQL-databases. It is built on top of Microsofts ODBC interface and therefore requires that you have an ODBC driver to the database that you want to connect to. > Eshell V5.4.9 (abort with ^G) > 1> application:start(odbc). > ok > 2> {ok, C} = odbc:connect("DSN=ourdatabase",[{auto_commit, off}, > {timeout, infinity}, {scrollable_cursors, off}, {trace_driver, off}, > {tuple_row, off}]). > {ok,<0.42.0>} > 3> odbc:sql_query(C, "select * from cosa", infinity). > {selected,["c1","c2"], > [[1,"Hola"], > [12,"Holaa"], > [123,"Holaaa"], > [1234,"Holaaaa"], > [12345,"Holaaaaa"]]} > 4> odbc:sql_query(C, "select * from cosa where c1=2", infinity). > {selected,["c1","c2"],[]} > 5> odbc:sql_query(C, "delete from cosa where c1=2", infinity). > {error,"No SQL-driver information available."} This query is sent directly to your odbc-driver without alterations. The driver returns an error which is reflected in erlang by {error,"No SQL-driver information available."} and unfortunately there is no information available in the driver to help us understand why it failed. -- /Ingela - OTP Team From ulf.wiger@REDACTED Wed Sep 28 16:21:12 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 28 Sep 2005 16:21:12 +0200 Subject: Meta-Erlang (was RE: Erlang vs Java revisited) Message-ID: For the next person itching to explore parse transforms: One of the annoying things about parse transforms is that you tend to have to cover the entire language even if you just want to add a small tweak. Last time I attempted one, I decided to try with syntax_tools. It seemed to me as if it would be possible to write a small and maintainable parse transform using syntax_tools, but I got stuck on some details, and was then diverted. Unfortunately, I have lost both my unfinished code and the recollection of whatever it was I got stuck on. All I have left to contribute is moral support. :) /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Vlad Dumitrescu > XX (LN/EAB) > Sent: den 28 september 2005 15:35 > To: Richard A. O'Keefe; erlang-questions@REDACTED > Subject: Meta-Erlang (was RE: Erlang vs Java revisited) > > > Hello, > > > -----Original Message----- > > From: owner-erlang-questions@REDACTED > > [mailto:owner-erlang-questions@REDACTED]On Behalf Of > Richard A. O'Keefe > > > Programs are data. My big complaint about older IDEs is that > > they encouraged people to think of programs as exclusively > something > > human-written, when our best hope of reliable software is > to write as little of > > it as possible. > > Is it the IDEs that did that? > > > What would Template Haskell look like in Erlang? > > Parse transforms are a kind of meta-programming, just not > embedded in the language and quite clunky to use. > > Since the compiler is readily available to any Erlang > program, including itself, and the abstract syntax is already > expressed in Erlang terms, I suppose it would be relatively > easy to add some syntactic sugar through a parse transform to > enable "proper" meta-programing. > > The lack of static typing would mean that one should be > extremely careful when writing and testing meta-programs, but > probably just as much as when writing "normal" parse transforms. > > I think it would be a very interesting area to explore. If > only I could find the time... > > best regards, > Vlad > > > > From francesco@REDACTED Wed Sep 28 16:14:58 2005 From: francesco@REDACTED (Francesco Cesarini (Erlang Training & Consulting)) Date: Wed, 28 Sep 2005 15:14:58 +0100 Subject: Correct Link: Erlang Workshop Presentations In-Reply-To: <433A9BEF.4030406@erlang-consulting.com> References: <433A9BEF.4030406@erlang-consulting.com> Message-ID: <433AA562.8050205@erlang-consulting.com> Sorry, Wrong link. Either click on the Articles section in the left menu or click on the correct one at http://www.erlang-consulting.com/erlangarticles_fs.html Francesco -- http://www.erlang-consulting.com Simon@REDACTED wrote: > We have now added the four presentations Erlang Training & Consulting > gave in Tallinn online: > > On Saturday, we spoke at the Commercial Users of Functional programming > languages workshop (CUFP) describing our experiences in ten years of > marketing, using, testing and supporting Erlang. > At the Erlang workshop, Francesca Gangemi presented ERESYE, a tool for > the realization of expert systems. It is now possible to have an > inference engine running in the same memory space as your Erlang > application. > > Simon Aurell presented his thesis on home automation using instant > messaging, a project developed using ejabberd, X10 drivers, and other > open source components. > Martin Carlson took advantage of the 10 minute ?crazy idea? session to > talk about the 40% reduction in bugs when using test driven development > with Erlang. > > All presentations are available at > http://www.erlang-consulting.com/about_fs.html in both html and pdf. > Hopefully, Bjarne will put up all other presentations online later on in > the week on the official workshop page at > http://www.erlang.se/workshop/2005/ > > Enjoy, > Francesco > From laura@REDACTED Wed Sep 28 16:46:34 2005 From: laura@REDACTED (Laura M. Castro) Date: Wed, 28 Sep 2005 16:46:34 +0200 Subject: ODBC application error In-Reply-To: <17210.42295.305501.902937@gargle.gargle.HOWL> References: <433A788E.5000904@alfa21.com> <17210.42295.305501.902937@gargle.gargle.HOWL> Message-ID: <433AACCA.4060900@alfa21.com> Hello Ingela, > Without investigating this further I would just like to clarify one > thing. The Erlang odbc application is not a driver it is an Erlang > interface to communicate with relational SQL-databases. It is built on > top of Microsofts ODBC interface and therefore requires that you have > an ODBC driver to the database that you want to connect to. I understand that, and of course we do have an underlying ODBC driver. We use unixodbc debian package, to be precise, which also provides the isql tool we used to test that the driver works perfectly. >>5> odbc:sql_query(C, "delete from cosa where c1=2", infinity). >>{error,"No SQL-driver information available."} > > This query is sent directly to your odbc-driver without alterations. > The driver returns an error which is reflected in erlang by > {error,"No SQL-driver information available."} > and unfortunately there is no information available in the driver > to help us understand why it failed. Of course it is not my intention to call into question your words, but if that is the case, I just can not understand why using the isql tool the DELETE statement performs correctly and returns just "SQLRowCount returns 0", as it does after a simply empty-result SQL SELECT statement, but fails using Erlang ODBC application... Regards, Laura Castro From erlang@REDACTED Wed Sep 28 16:58:22 2005 From: erlang@REDACTED (Michael McDaniel) Date: Wed, 28 Sep 2005 07:58:22 -0700 Subject: Problem posting In-Reply-To: References: Message-ID: <20050928145822.GF16739@delora.autosys.us> On Wed, Sep 28, 2005 at 11:44:47AM +0200, Raimo Niskanen wrote: > > As some may have noticed we have had a little problem with > the mailing list, i.e the list owner suffered a heart attack. > He is well, regarding the circumbstances (after surgery), and we ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Best Wishes/Prayers for a full recovery. ~Michael > have hijacked his inbox, processed the administrative list mails > and assigned a new temporary rookie list owner. > > Sorry about this. We hope you will not experience any more > problems because of this. > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB From erlang@REDACTED Wed Sep 28 17:16:05 2005 From: erlang@REDACTED (Michael McDaniel) Date: Wed, 28 Sep 2005 08:16:05 -0700 Subject: ODBC application error In-Reply-To: <433A788E.5000904@alfa21.com> References: <433A788E.5000904@alfa21.com> Message-ID: <20050928151604.GG16739@delora.autosys.us> Do you have the UID and PWD embedded in your ODBC files? And the UID has been GRANTed delete permissions to database? I do my odbc:connect similar to ... 1> application:start(odbc). ok 2> {ok,Ref} = odbc:connect("DSN=myodbc3;UID=test;PWD=test", [{trace_driver,on}]). {ok, } 3> q(). $ Maybe it makes a difference if UID/PWD is in odbc:connect call rather than ODBC files. I do not know, maybe worth trying. ~Michael On Wed, Sep 28, 2005 at 01:03:42PM +0200, Laura M. Castro wrote: > > Hi all, > > We have found a little confusing behaviour concerning the Erlang > ODBC driver. This is a case example: connecting to the (postgresql) > database through ODBC (using the isql utility), we can perform the > following set of commands: > > lcastro:~$ isql ourdatabase > +---------------------------------------+ > | Connected! | > | | > | sql-statement | > | help [tablename] | > | quit | > | | > +---------------------------------------+ > SQL> create table cosa (c1 integer, c2 varchar); > SQLRowCount returns 0 > > SQL> select * from cosa; > +------------+------------+ > | c1 | c2 > > > | > +------------+------------+ > +------------+------------+ > SQLRowCount returns 0 > > SQL> insert into cosa values (1, 'Hola'); > SQLRowCount returns 1 > > SQL> insert into cosa values (12, 'Holaa'); > SQLRowCount returns 1 > > SQL> insert into cosa values (123, 'Holaaa'); > SQLRowCount returns 1 > > SQL> insert into cosa values (1234, 'Holaaaa'); > SQLRowCount returns 1 > > SQL> insert into cosa values (12345, 'Holaaaaa'); > SQLRowCount returns 1 > > SQL> select * from cosa; > +------------+------------+ > | c1 | c2 | > +------------+------------+ > | 1 | Hola > > > | > | 12 | Holaa > > > | > | 123 | Holaaa | > | 1234 | Holaaaa > > > | > | 12345 | Holaaaaa > > > | > +------------+------------+ > SQLRowCount returns 5 > > 5 rows fetched > SQL> select * from cosa where c1 = 2; > +------------+------------+ > | c1 | c2 | > +------------+------------+ > +------------+------------+ > SQLRowCount returns 0 > > SQL> delete from cosa where c1 = 2; > SQLRowCount returns 0 > > > > But if we do the same through the Erlang ODBC driver, have a look at > the result we get: > > Eshell V5.4.9 (abort with ^G) > 1> application:start(odbc). > ok > 2> {ok, C} = odbc:connect("DSN=ourdatabase",[{auto_commit, off}, > {timeout, infinity}, {scrollable_cursors, off}, {trace_driver, off}, > {tuple_row, off}]). > {ok,<0.42.0>} > 3> odbc:sql_query(C, "select * from cosa", infinity). > {selected,["c1","c2"], > [[1,"Hola"], > [12,"Holaa"], > [123,"Holaaa"], > [1234,"Holaaaa"], > [12345,"Holaaaaa"]]} > 4> odbc:sql_query(C, "select * from cosa where c1=2", infinity). > {selected,["c1","c2"],[]} > 5> odbc:sql_query(C, "delete from cosa where c1=2", infinity). > {error,"No SQL-driver information available."} > > > What I am trying to show it that I guess the Erlang ODBC driver may > have some kind of problem with those SQL DELETE statements which > eventually do not delete anything :-? > > Any help/comment will be very welcome... > > Thanks in advance, > > Laura Castro > > P.S. We were using Erlang R9C-2 but we have also tried with the newest > version, Erlang R10B-7 and the situation remains the same. -- Michael McDaniel Portland, Oregon, USA http://autosys.us +1 503 283 5284 From ingela@REDACTED Wed Sep 28 17:32:13 2005 From: ingela@REDACTED (Ingela Anderton) Date: Wed, 28 Sep 2005 17:32:13 +0200 Subject: ODBC application error References: <433A788E.5000904@alfa21.com> <17210.42295.305501.902937@gargle.gargle.HOWL> <433AACCA.4060900@alfa21.com> Message-ID: <17210.46973.945109.671547@gargle.gargle.HOWL> Laura M. Castro wrote: > >>5> odbc:sql_query(C, "delete from cosa where c1=2", infinity). > >>{error,"No SQL-driver information available."} > > > > This query is sent directly to your odbc-driver without alterations. > > The driver returns an error which is reflected in erlang by > > {error,"No SQL-driver information available."} > > and unfortunately there is no information available in the driver > > to help us understand why it failed. > > Of course it is not my intention to call into question your words, > but if that is the case, I just can not understand why using the isql > tool the DELETE statement performs correctly and returns just > "SQLRowCount returns 0", as it does after a simply empty-result SQL > SELECT statement, but fails using Erlang ODBC application... Well then that is strange! I am only saying this seems to be in the driver but it would not be the first time though something that should not affect something turns out to do so ;). If that is the case still needs to be investigate. Alas I have no time to look in to this any further at the moment. Maybe you could write a small c-program to access the driver via the same interface as erlang odbc and see what SQLExecDirect returns for your particular query. One potential problem I can see is if it returns SQL_SUCCESS_WITH_INFO as this has been used to indicate an error in the user input by drivers in this particular situation. I no longer recall exactly what the odbc standard says about this, but we have a comment in the code stating this to be the case, and only SQL_SUCCESS is considered to be correct. Maybe this could be a problem of different interpretations of the standard. If you find anything out please let me know. -- /m.v.h Ingela - OTP team From laura@REDACTED Wed Sep 28 17:39:46 2005 From: laura@REDACTED (Laura M. Castro) Date: Wed, 28 Sep 2005 17:39:46 +0200 Subject: ODBC application error In-Reply-To: <20050928151604.GG16739@delora.autosys.us> References: <433A788E.5000904@alfa21.com> <20050928151604.GG16739@delora.autosys.us> Message-ID: <433AB942.3050204@alfa21.com> Hello Michael, > Maybe it makes a difference if UID/PWD is in odbc:connect call rather > than ODBC files. I do not know, maybe worth trying. Thanks for your comment. Indeed our connection string is more similar to yours, but that is not the key for the problem :-(. As I said before, in my opinion it may be something related to DELETE statements that in the end do not delete anything at all, because I can perform a slightly modified test this way: Erlang (BEAM) emulator version 5.4.9 [hipe] Eshell V5.4.9 (abort with ^G) 1> application:start(odbc). ok 2> {ok, C} = odbc:connect("DSN=ourdatabase;UID=ouruser;PWD=ourpass",[{auto_commit, off},{timeout, infinity}, {scrollable_cursors, off}, {trace_driver, off},{tuple_row, off}]). {ok,<0.44.0>} 3> odbc:sql_query(C, "select * from cosa", infinity). {selected,["c1","c2"], [[1,"Hola"], [12,"Holaa"], [123,"Holaaa"], [1234,"Holaaaa"], [12345,"Holaaaaa"]]} 4> odbc:sql_query(C, "select * from cosa where c1=2", infinity). {selected,["c1","c2"],[]} 5> odbc:sql_query(C, "delete from cosa where c1=1", infinity). {updated,1} 6> odbc:sql_query(C, "delete from cosa where c1=2", infinity). {error,"No SQL-driver information available."} And, as you can see, we get the same error, but not in the case in which the DELETE statement succeeded in deleting "something". In my opinion, the expectable behaviour would be: 6> odbc:sql_query(C, "delete from cosa where c1=2", infinity). {updated,0} Regards, Laura Castro From joelr1@REDACTED Wed Sep 28 18:12:41 2005 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 28 Sep 2005 18:12:41 +0200 Subject: BEA offers real-time version of WebLogic server In-Reply-To: <99D8D70E-A990-43D0-8FA7-89CD2DC1A297@gmail.com> References: <99D8D70E-A990-43D0-8FA7-89CD2DC1A297@gmail.com> Message-ID: It sounds like Erlang has got some competition now. Moreover, it seems like there will be far less reason for people to move to Erlang now since the claims like soft real-time and hot code loading have been matched for Java. Me? I wanna try network servers in Haskell and network or database- based Shared Transactional Memory (STM). ------ http://news.com.com/BEA+Upgrades+are+now+on+the+fly/ 2100-1012_3-5884633.html?part=rss&tag=5884633&subj=news "Upgrades are now on the fly," CEO Alfred Chuang told approximately 2,000 delegates at the company's users' conference in Santa Clara, Calif. "This is the world's first hot-swappable application server in production. Imagine changing the engine of a race car during the race...this is what we are doing. "I remember the days in the early '90s of the first hot-swappable server, where things kept running while you upgraded components inside a machine. We've got the first hot-swappable application server." -- http://wagerlabs.com/ From laura@REDACTED Wed Sep 28 18:37:31 2005 From: laura@REDACTED (Laura M. Castro) Date: Wed, 28 Sep 2005 18:37:31 +0200 Subject: ODBC application error In-Reply-To: <17210.46973.945109.671547@gargle.gargle.HOWL> References: <433A788E.5000904@alfa21.com> <17210.42295.305501.902937@gargle.gargle.HOWL> <433AACCA.4060900@alfa21.com> <17210.46973.945109.671547@gargle.gargle.HOWL> Message-ID: <433AC6CB.2030902@alfa21.com> Hello again, > One potential problem I can see is if it returns SQL_SUCCESS_WITH_INFO > as this has been used to indicate an error in the user input by > drivers in this particular situation. I no longer recall exactly what > the odbc standard says about this, but we have a comment in the code > stating this to be the case, and only SQL_SUCCESS is considered to > be correct. Maybe this could be a problem of different interpretations > of the standard. If you find anything out please let me know. Yes, after having a quick look at odbcserver.c, I suspected the same. The source code fragment you are referring to is: /* SQL_SUCCESS_WITH_INFO at this point indicates error in user input. */ if (result != SQL_SUCCESS) { diagnos = get_diagnos(SQL_HANDLE_STMT, statement_handle(state)); msg = encode_error_message(diagnos.error_msg); clean_state(state); return msg; } But that is not the case: in fact, the value assigned to the variable 'result' is 100, that corresponds with the constant SQL_NO_DATA. I do not know the details of the ODBC standard either, so I am not sure at all about which of the different result code constants present in odbc.hrl should be taken into account in that 'if' condition... Anyway, it seems that the mystery is all over :-D. Cheers, Laura Castro From rpettit@REDACTED Wed Sep 28 18:37:34 2005 From: rpettit@REDACTED (Rick Pettit) Date: Wed, 28 Sep 2005 11:37:34 -0500 Subject: BEA offers real-time version of WebLogic server In-Reply-To: References: <99D8D70E-A990-43D0-8FA7-89CD2DC1A297@gmail.com> Message-ID: <20050928163734.GA25942@vailsys.com> On Wed, Sep 28, 2005 at 06:12:41PM +0200, Joel Reymont wrote: > It sounds like Erlang has got some competition now. Moreover, it > seems like there will be far less reason for people to move to Erlang > now since the claims like soft real-time and hot code loading have > been matched for Java. Java hasn't had it working for over a decade though. C/C++ environments typically support soft real-time and hot code loading features as well (shared objects and the like) but I won't go running back to them (unless I absolutely have to) anytime soon. > Me? I wanna try network servers in Haskell and network or database- > based Shared Transactional Memory (STM). I'm sticking with Erlang--I learn more every day and problems just keep getting easier. -Rick > ------ > http://news.com.com/BEA+Upgrades+are+now+on+the+fly/ > 2100-1012_3-5884633.html?part=rss&tag=5884633&subj=news > "Upgrades are now on the fly," CEO Alfred Chuang told approximately > 2,000 delegates at the company's users' conference in Santa Clara, > Calif. "This is the world's first hot-swappable application server in > production. Imagine changing the engine of a race car during the > race...this is what we are doing. I am not sure this statement is true. > "I remember the days in the early '90s of the first hot-swappable > server, where things kept running while you upgraded components > inside a machine. We've got the first hot-swappable application server." I don't think so. -Rick From csanto@REDACTED Wed Sep 28 18:51:59 2005 From: csanto@REDACTED (Corrado Santoro) Date: Wed, 28 Sep 2005 18:51:59 +0200 Subject: BEA offers real-time version of WebLogic server In-Reply-To: References: <99D8D70E-A990-43D0-8FA7-89CD2DC1A297@gmail.com> Message-ID: <433ACA2F.30005@diit.unict.it> Joel Reymont wrote: > It sounds like Erlang has got some competition now. Moreover, it seems > like there will be far less reason for people to move to Erlang now > since the claims like soft real-time and hot code loading have been > matched for Java. No please... not again another discussion about Erlang vs. Java. Is it only a matter of soft real-time abilities and hot code loading? No! These are only minor reasons, I think. The best comparison I show to my student is a piece of code that filters data in a vector: Java: Vector source = ....; Vector dest = new Vector (); for (int i = 0; i < source.size(); i++) { int data = source.elementAt (i); if (data > 10) { dest.add (data); } } ... and the code is worse if a "int[]" has to be filtered, instead of a "Vector". Erlang: [ X || X <- Source, X > 10] This should *definitively* remove any doubts :-)) Ciao, --Corrado -- ====================================================== Eng. Corrado Santoro, Ph.D. University of Catania - Engineering Faculty Department of Computer Science and Telecommunications Engineering Viale A. Doria, 6 - 95125 CATANIA (ITALY) Tel: +39 095 7382144 Int. (5) 8035 +39 095 7382380 +39 095 7382365 +39 095 7382364 VoIP: sip:8035@REDACTED Fax: +39 095 7382397 EMail: csanto@REDACTED Personal Home Page: http://www.diit.unict.it/users/csanto NUXI Home Page: http://nuxi.iit.unict.it ====================================================== From vlad_dumitrescu@REDACTED Wed Sep 28 19:10:37 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 28 Sep 2005 19:10:37 +0200 Subject: Meta-Erlang (was RE: Erlang vs Java revisited) References: Message-ID: Hi, ----- Original Message ----- From: "Ulf Wiger (AL/EAB)" > One of the annoying things about parse transforms is that > you tend to have to cover the entire language even if you > just want to add a small tweak. Yes, I know, I tried it myself. That's why I think that it would be interesting to explore how it would work to be able to embed this into the language proper (or more precisely, its meta-variant). Example, a simple parse transform could look like this (just a rough sketch): ParseTransform = meta:define( fun(F, A) -> io:format("start fun ~p(~p)", [P, A]), Result = apply(meta:splice(F), meta:splice(A)), io:format("returns ~p", [Result]), Result end ) where meta:define() returns the abstract code for the argument meta:splice() inserts the arguments' value in the current abstract code tree Then by defining -apply_parse_transform(ParseTransform, foo/2). this parse transform would be applied in the compiled code. Much simpler, right? regards, Vlad From joelr1@REDACTED Wed Sep 28 19:13:30 2005 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 28 Sep 2005 19:13:30 +0200 Subject: BEA offers real-time version of WebLogic server In-Reply-To: <20050928163734.GA25942@vailsys.com> References: <99D8D70E-A990-43D0-8FA7-89CD2DC1A297@gmail.com> <20050928163734.GA25942@vailsys.com> Message-ID: Well, I do have some beef with Erlang, although I would not go to Java or C/C++ or Python. Haskell is my current enfatuation. 1) Erlang is not a panacea. You should leave some stuff outside probably but linked in drivers are a major pain in the rear. So if I were doing a trading system I would link in the algorithms. Talking to external stuff through pipes or sockets is a kludge, really. 2) I think Erlang is most suited for applications where high computational performance is not of essense. What's the right term, apps that are not CPU-bound? I wouldn't do a trading system in Erlang, for example. I know of no other platforms that offer transparent process distribution. A lot of other platforms offer lightweight concurrency, though. Haskell (Concurrent Haskell?), has STM (shared transactional memory) which I'm dying to try in a highly concurrent setting. I think that if you modify STM to save to save or the network you'll get... Mnesia! You would still not get distributed processes with the node encoded in the process id, though. On Sep 28, 2005, at 6:37 PM, Rick Pettit wrote: > I'm sticking with Erlang--I learn more every day and problems just > keep > getting easier. -- http://wagerlabs.com/ From rpettit@REDACTED Wed Sep 28 19:28:38 2005 From: rpettit@REDACTED (Rick Pettit) Date: Wed, 28 Sep 2005 12:28:38 -0500 Subject: BEA offers real-time version of WebLogic server In-Reply-To: References: <99D8D70E-A990-43D0-8FA7-89CD2DC1A297@gmail.com> <20050928163734.GA25942@vailsys.com> Message-ID: <20050928172838.GA18552@vailsys.com> On Wed, Sep 28, 2005 at 07:13:30PM +0200, Joel Reymont wrote: > Well, I do have some beef with Erlang, although I would not go to > Java or C/C++ or Python. Haskell is my current enfatuation. > > 1) Erlang is not a panacea. You should leave some stuff outside > probably but linked in drivers are a major pain in the rear. > > So if I were doing a trading system I would link in the algorithms. > Talking to external stuff through pipes or sockets is a kludge, really. Talking to external components (Expect scripts, C binaries, etc) has always been trivial for me. What's wrong with the port mechanism? When using binary communication, is that not fast enough for you? > 2) I think Erlang is most suited for applications where high > computational performance is not of essense. What's the right term, > apps that are not CPU-bound? I wouldn't do a trading system in > Erlang, for example. I have some very CPU-bound code running on Erlang/OTP systems with excellent uptime and very little problems. When it isn't fast enough I will tweak--but I'm not there yet. > I know of no other platforms that offer transparent process > distribution. A lot of other platforms offer lightweight concurrency, > though. Haskell (Concurrent Haskell?), has STM (shared transactional > memory) which I'm dying to try in a highly concurrent setting. Why not just use mnesia? > I think that if you modify STM to save to save or the network you'll > get... Mnesia! You would still not get distributed processes with the > node encoded in the process id, though. Why bother? -Rick From neumann@REDACTED Wed Sep 28 20:41:56 2005 From: neumann@REDACTED (=?iso-8859-1?q?Fran=E7ois-Denis_Gonthier?=) Date: Wed, 28 Sep 2005 14:41:56 -0400 Subject: Segmentation fault on Linux In-Reply-To: <17210.25141.889915.461104@alkaid.it.uu.se> References: <200509271802.51033.neumann@lostwebsite.net> <17210.25141.889915.461104@alkaid.it.uu.se> Message-ID: <200509281442.00253.neumann@lostwebsite.net> On 28 September 2005 05:28, Mikael Pettersson wrote: > Fran?ois-Denis Gonthier writes: > > On 27 September 2005 13:34, Stephen Han wrote: > > > > This bug has been closed sometimes ago. I don't know about Gentoo, but > > it's the case in Debian. > > > > If anyone still has problem with Erlang on Debian I'd like to know it. > > > > > Hi... > > > Here is the bug report on debian list. He also mentioned about > > > gentoo, too at the end of the report. > > > linux.debian.bugs.dist > > > Bug#276800 > > What was the resolution? Was the bug in Debian's glibc, in > hipe_x86_signal.c's override of sigaction(), or in its > sigaltstack usage? > I'm surprised about the bug report's indications that 2.4 > kernels (so LinuxThreads not NPTL) break things, since I've > definitely tested those extensively (on RH/FC systems). I closed the bug by making the package for version 10.b.5 which was uploaded by Will Newton. But is the bug still there or not? I'm not sure. I've never really tested the thing on a 2.4 kernel. It occurs to me that I should try that right now on my Sarge box. We'll see... -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From alex.arnon@REDACTED Wed Sep 28 22:46:15 2005 From: alex.arnon@REDACTED (Alex Arnon) Date: Wed, 28 Sep 2005 23:46:15 +0300 Subject: Using Multiple nodes with same Cookie on single machine In-Reply-To: References: Message-ID: <944da41d0509281346707d090b@mail.gmail.com> AFAIK communication should be over the loopback interface (at least on Unix servers). On 9/28/05, Manjeet.Singh Sardar (AC/EDD) wrote: > > Hi Fredrick, > You have answered my query. > Regarding effect:I mean we are planning to run approx 50 nodes on a single > physical server and the communication is over fast Ethernet 100Mbp/s does > this effects the performance i.e. speed since we are communicating > simultaneously. > > Thanks and Regards > Manjeet > > -----Original Message----- > From: Fredrik Thulin [mailto:ft@REDACTED] > Sent: Wednesday, September 28, 2005 1:45 PM > To: Manjeet.Singh Sardar (AC/EDD) > Cc: Erlang-Questions (E-mail) > Subject: Re: Using Multiple nodes with same Cookie on single machine > > > On Wednesday 28 September 2005 12.35, Manjeet.Singh Sardar (AC/EDD) > wrote: > ... > > My question is, since we are planning to run different server nodes > > on single machine with same Cookie, does it effects the communication > > or performance of the system. > > I assume you mean 'affect', not 'effect'. What do you mean by 'affect'? > > Node-to-node communication over the loopback interface is probably a > tiny bit faster than node-to-node communication over fast ethernet (100 > Mbp/s) or gigabit ethernet (1000 Mbp/s), but only marginally. > > > Has anybody tested this type of setup? > > Yes, I have several physical servers which run more than one erlang-node > per server - naturally using the same cookie. > > /Fredrik > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpettit@REDACTED Thu Sep 29 07:31:45 2005 From: rpettit@REDACTED (Rick Pettit) Date: Thu, 29 Sep 2005 00:31:45 -0500 Subject: recording process crash (in supervisor?) Message-ID: <20050929053145.GB2337@vailsys.com> I want to record application process crash info (proc_name/date/time/reason) in an ETS table which persists as long as the top-level supervisor remains alive. I realize I need to create the ETS table from the supervisor in order to ensure it persists past all other application process crashes. What I don't know is if/where there is a hook for recording such information from the supervisor. I don't see any supervisor callback which would allow for recording of process crash info. I see supervisor.erl in stdlib appears to log this information to the error_logger (when reason is not normal|shutdown): do_restart(permanent, Reason, Child, State) -> report_error(child_terminated, Reason, Child, State#state.name), restart(Child, State); do_restart(_, normal, Child, State) -> NState = state_del_child(Child, State), {ok, NState}; do_restart(_, shutdown, Child, State) -> NState = state_del_child(Child, State), {ok, NState}; do_restart(transient, Reason, Child, State) -> report_error(child_terminated, Reason, Child, State#state.name), restart(Child, State); do_restart(temporary, Reason, Child, State) -> report_error(child_terminated, Reason, Child, State#state.name), NState = state_del_child(Child, State), {ok, NState}. ... ... ... report_error(Error, Reason, Child, SupName) -> ErrorMsg = [{supervisor, SupName}, {errorContext, Error}, {reason, Reason}, {offender, extract_child(Child)}], error_logger:error_report(supervisor_report, ErrorMsg). If I want to process crash information (name/date/time/reason) when application processes crash is the convention to install a custom handler via error_logger:add_report_handler/[12]? My knee jerk reaction is that it would be awfully nice if the supervisor behaviour simply provided a callback for processing process crash info. The callback could even be spawn'd if risk of crashing the supervisor in the handler was a concern. Thanks for wading through the rambling--any comments/suggestions are much appreciated. -Rick P.S. One approach which I have seen work but which seems cumbersome and unnecessary involved adding an addition process, under the top-level supervisor, with which all other application processes registered by name (at which time monitor/2 and/or link/1 were called). This additional process then listened for EXIT signals from registered processes and recorded their crash info. Since the supervisor is already setup to receive all the crash info adding another process to duplicate the functionality seemed silly to me. From vances@REDACTED Thu Sep 29 12:14:15 2005 From: vances@REDACTED (Vance Shipley) Date: Thu, 29 Sep 2005 06:14:15 -0400 Subject: BEA offers real-time version of WebLogic server In-Reply-To: References: <99D8D70E-A990-43D0-8FA7-89CD2DC1A297@gmail.com> <20050928163734.GA25942@vailsys.com> Message-ID: <20050929101415.GA786@feeble.motivity.ca> On Wed, Sep 28, 2005 at 07:13:30PM +0200, Joel Reymont wrote: } } 1) Erlang is not a panacea. You should leave some stuff outside } probably but linked in drivers are a major pain in the rear. Writing a linked in driver is one solution to the language binding problem. There is the ei/erl_interface library solution for building C nodes and jinterface for java nodes. You can use a simple port interface or you can roll your own IP based message channel. There has been plenty, plenty work done and made available for interfacing Erlang with the outside world. Language bindings are by necessity not perfectly tight integrations. Look at any other language binding, they all use a communications channel. You can use Corba for instance to make it look like a procedure call but in the end the two domains have to communicate using a channel. So yes, it is a pain because it's not pure Erlang anymore. That's not much of a criticism of Erlang. -Vance From serge@REDACTED Thu Sep 29 13:59:23 2005 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 29 Sep 2005 07:59:23 -0400 Subject: recording process crash (in supervisor?) In-Reply-To: <20050929053145.GB2337@vailsys.com> References: <20050929053145.GB2337@vailsys.com> Message-ID: <433BD71B.80604@hq.idt.net> Rick, Even though you don't seem to favor the addition of another event handler, that is pretty much the only approach of getting custom handling of crash reports. As you correctly pointed out when there is a process crash, a supervisor calls error_logger:error_report/2, which indeed is the candidate for a custom callback. Such a handler is very simple to implement (see stdlib's error_logger_tty_h.erl). What you can do is that you can add another child process to the supervisor of interest, that can use gen_event:add_sup_handler(error_logger, YourHandler, Args). The presence of the child process (with appropriate {gen_event_EXIT, YourHandler, _} message monitoring) will reinstall this handler in case of crashes. What puzzles me about this last approach is that neither error_logger or SASL use supervised handlers for event reporting to screen. This raises a rhetorical question: if the implementation code is 100% correct, does it mean that the process running this code doesn't require a supervisor? Perhaps someone on the list can share his/her perception on this... Serge P.S. In a couple of weeks I am planning to make a contribution (LAMA - Log and Alarm MAnager) that will demonstrate the use of this principle for sending all error reports and alarms to syslog / snmp manager. Rick Pettit wrote: > I want to record application process crash info (proc_name/date/time/reason) > in an ETS table which persists as long as the top-level supervisor remains > alive. I realize I need to create the ETS table from the supervisor in order > to ensure it persists past all other application process crashes. > > What I don't know is if/where there is a hook for recording such information > from the supervisor. I don't see any supervisor callback which would allow > for recording of process crash info. > > I see supervisor.erl in stdlib appears to log this information to the > error_logger (when reason is not normal|shutdown): > > do_restart(permanent, Reason, Child, State) -> > report_error(child_terminated, Reason, Child, State#state.name), > restart(Child, State); > do_restart(_, normal, Child, State) -> > NState = state_del_child(Child, State), > {ok, NState}; > do_restart(_, shutdown, Child, State) -> > NState = state_del_child(Child, State), > {ok, NState}; > do_restart(transient, Reason, Child, State) -> > report_error(child_terminated, Reason, Child, State#state.name), > restart(Child, State); > do_restart(temporary, Reason, Child, State) -> > report_error(child_terminated, Reason, Child, State#state.name), > NState = state_del_child(Child, State), > {ok, NState}. > ... > ... > ... > > report_error(Error, Reason, Child, SupName) -> > ErrorMsg = [{supervisor, SupName}, > {errorContext, Error}, > {reason, Reason}, > {offender, extract_child(Child)}], > error_logger:error_report(supervisor_report, ErrorMsg). > > If I want to process crash information (name/date/time/reason) when application > processes crash is the convention to install a custom handler via > error_logger:add_report_handler/[12]? > > My knee jerk reaction is that it would be awfully nice if the supervisor > behaviour simply provided a callback for processing process crash info. The > callback could even be spawn'd if risk of crashing the supervisor in the > handler was a concern. > > Thanks for wading through the rambling--any comments/suggestions are much > appreciated. > > -Rick > > P.S. One approach which I have seen work but which seems cumbersome and > unnecessary involved adding an addition process, under the top-level > supervisor, with which all other application processes registered > by name (at which time monitor/2 and/or link/1 were called). This > additional process then listened for EXIT signals from registered > processes and recorded their crash info. Since the supervisor is already > setup to receive all the crash info adding another process to duplicate > the functionality seemed silly to me. > From joelr1@REDACTED Thu Sep 29 16:46:06 2005 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 29 Sep 2005 16:46:06 +0200 Subject: Mac OSX and kqueue Message-ID: <6A04C0B6-8891-47CC-AB2E-5B3311BEA790@gmail.com> I noticed some code related to kqueue in erts/emulator/sys/unix/ sys.c. Is it possible to configure Erlang to use kqueue on Mac OSX? Thanks, Joel -- http://wagerlabs.com/ From craigmcd@REDACTED Thu Sep 29 20:53:25 2005 From: craigmcd@REDACTED (Craig McDaniel) Date: Thu, 29 Sep 2005 14:53:25 -0400 Subject: Jungerl fails to compile - UCS Message-ID: <87ll1fogd6.fsf@neko.dyndns.org> Hello all, I just checked out Jungerl from CVS and am getting the following errors when compiling: make[3]: Entering directory `/home/cmcdaniel/src/jungerl/lib/ucs/src' erlc -W -I ../include -o ../ebin ucs.erl /home/cmcdaniel/src/jungerl/lib/ucs/src/../ebin/ucs.bea#: error writing file make[3]: *** [../ebin/ucs.beam] Error 1 make[3]: Leaving directory `/home/cmcdaniel/src/jungerl/lib/ucs/src' make[3]: Entering directory `/home/cmcdaniel/src/jungerl/lib/ucs/priv' erl -noshell -pa ../ebin -s ucs rebuild_database unidata -s init stop {"init terminating in do_boot",{undef,[{ucs,rebuild_database,[[unidata]]},{init,start_it,1},{init,start_em,1}]}} Crash dump was written to: erl_crash.dump init terminating in do_boot () make[3]: *** [db/unidata.dets] Error 1 make[3]: Leaving directory `/home/cmcdaniel/src/jungerl/lib/ucs/priv' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/cmcdaniel/src/jungerl/lib/ucs' make[1]: *** [ucs] Error 2 make[1]: Leaving directory `/home/cmcdaniel/src/jungerl/lib' make: *** [all] Error 2 Erlang version: otp_src_R10B-7.tar.gz System: Linux 2.4.9 Let me know if I need to provide other details. Thanks -- Craig McDaniel From ok@REDACTED Fri Sep 30 05:11:25 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 30 Sep 2005 15:11:25 +1200 (NZST) Subject: Meta-Erlang (was RE: Erlang vs Java revisited) Message-ID: <200509300311.j8U3BPFW331059@atlas.otago.ac.nz> I wrote: > Programs are data. My big complaint about older IDEs is that > they encouraged people to think of programs as exclusively something > human-written, when our best hope of reliable software is to write as little of > it as possible. "Vlad Dumitrescu XX (LN/EAB)" challenged: Is it the IDEs that did that? I did not say that the IDEs *alone* encouraged that view, but yes, they did encourage it. I still remember someone from Xerox insisting fervently that "A program is not a listing!" The Smalltalk and Interlisp-D environments were based on the idea that a program is a database and that it is a database which programs may populate and manipulate. Smalltalk and Interlisp were not the kind of "older IDE" that I had in mind, although I must say that they are older than the ones I did have in mind. Now some of the more modern IDEs have to some extent followed the lead of Emacs and offer "plugin" features. But the great thing about Interlisp and Smalltalk is that you could write useful program- manipulating code after reading a *small* amount of documentation. The Java reflection API, including the new stuff that's needed to do program transformation, is about as think as the local phone book. I come to praise Erlang, not to bury Java, but the effect that the syntactic complexity and irregularity of a language has on code that manipulates that language is important. Consider the whole StringTemplate, er, scratches head for polite term, thingy. To my mind, it's a typically overcomplicated response to the fact that Java is pretty much hopeless at expressing data structures in source code. Working on the same kinds of things in Scheme, I never needed more than backquote and maybe a few calls to a mapping function. What has this got to do with Erlang? Erlang *started* in a very promising way, as a language with just enough syntax to do the job, very easy to parse and transform in Prolog, Lisp, or Erlang itself. But Erlang has never had the "a program is a database view", and there seems to be constant pressure on it to adopt features that make it more complex. The preprocessor has to be the outstanding example. Records added a lot more syntax. Anonymous functions added very little extra syntax, and that of great value. List comprehensions added more syntax, although again it has a high payoff. The whole Java-envy dotted module name thing is an attempt to deal with a problem by working in terms of a *listing* rather than a *database*. What I am saying is that one way a language like Erlang can help us produce reliable software is by making it *easy* to automate as much of the code-construction process as makes sense. Erlang makes it a lot easier than Java, but it's still not as easy as it could be. And the preprocessor is very definitely the wrong kind of way to do it. From rpettit@REDACTED Fri Sep 30 06:41:16 2005 From: rpettit@REDACTED (Rick Pettit) Date: Thu, 29 Sep 2005 23:41:16 -0500 Subject: recording process crash (in supervisor?) In-Reply-To: <433BD71B.80604@hq.idt.net> References: <20050929053145.GB2337@vailsys.com> <433BD71B.80604@hq.idt.net> Message-ID: <20050930044116.GA19115@vailsys.com> On Thu, Sep 29, 2005 at 07:59:23AM -0400, Serge Aleynikov wrote: > Rick, > > Even though you don't seem to favor the addition of another event > handler, that is pretty much the only approach of getting custom > handling of crash reports. > > As you correctly pointed out when there is a process crash, a supervisor > calls error_logger:error_report/2, which indeed is the candidate for a > custom callback. Such a handler is very simple to implement (see > stdlib's error_logger_tty_h.erl). > > What you can do is that you can add another child process to the > supervisor of interest, that can use > gen_event:add_sup_handler(error_logger, YourHandler, Args). The > presence of the child process (with appropriate {gen_event_EXIT, > YourHandler, _} message monitoring) will reinstall this handler in case > of crashes. I am playing with a toy gen_event module which will serve as my handler. Here is the handle_event/2 callback: %%-------------------------------------------------------------------- %% Func: handle_event/2 %% Returns: {ok, State} | %% {swap_handler, Args1, State1, Mod2, Args2} | %% remove_handler %%-------------------------------------------------------------------- handle_event({error_report,_,{_,crash_report,[DataList,[]]}}=_Event,State) -> {value,{registered_name,RegisteredName}} = lists:keysearch(registered_name,1,DataList), {value,{error_info,ErrorInfo}} = lists:keysearch(error_info,1,DataList), io:format("event_h: process ~p crashed w/reason ~p~n", [RegisteredName, ErrorInfo]), {ok,State}; handle_event(Event,State) -> io:format("event_h: recv'd event: ~p~n", [Event]), {ok,State}. Now, when a process crashes this toy gen_event handler writes something like: "event_h: process foo crashed w/reason dunno\n" Having to dig up the (undocumented?) format of the crash_report message (and count on it not changing across releases) troubles me (duh). Surely what I did must be "wrong", no? Also, it now seems clear that I need _two_ processes in addition to the supervisor to do a job that a simple supervisor callback could do just as well--one child/worker process (to invoke gen_event:add_sup_handler/3) and the actual gen_event handler process to receive and process error_logger messages. Am I doing something unconventional here (i.e. processing/recording process crash info)? It seems like there should be an easier way. It also seems as though my error_logger handler, which only really cares about crash_report information, is going to have to "ignore" a whole lot of other messages which a supervisor (callback/handler) wouldn't even see--this seems needlessly inefficient. The last point about efficiency almost makes the following (from original post) look good (or at least better than it did): One approach which I have seen work but which seems cumbersome and unnecessary involved adding an additional process, under the top-level supervisor, with which all other application processes registered by name (at which time monitor/2 and/or link/1 were called). This additional process then listened for EXIT signals from registered processes and recorded their crash info. Since the supervisor is already setup to receive all the crash info adding another process to duplicate the functionality seemed silly to me. It now seems less silly to have this additional process link-to-and-trap-exits-for its siblings than it does to have it install a third process to process *all* error_logger messages and pick out the crash reports. Someone feel free to smack me if I still "don't get it". -Rick > What puzzles me about this last approach is that neither error_logger or > SASL use supervised handlers for event reporting to screen. This raises > a rhetorical question: if the implementation code is 100% correct, does > it mean that the process running this code doesn't require a supervisor? > Perhaps someone on the list can share his/her perception on this... > > Serge > > P.S. In a couple of weeks I am planning to make a contribution (LAMA - > Log and Alarm MAnager) that will demonstrate the use of this principle > for sending all error reports and alarms to syslog / snmp manager. > > > Rick Pettit wrote: > >I want to record application process crash info > >(proc_name/date/time/reason) > >in an ETS table which persists as long as the top-level supervisor remains > >alive. I realize I need to create the ETS table from the supervisor in > >order > >to ensure it persists past all other application process crashes. > > > >What I don't know is if/where there is a hook for recording such > >information > >from the supervisor. I don't see any supervisor callback which would allow > >for recording of process crash info. > > > >I see supervisor.erl in stdlib appears to log this information to the > >error_logger (when reason is not normal|shutdown): > > > > do_restart(permanent, Reason, Child, State) -> > > report_error(child_terminated, Reason, Child, State#state.name), > > restart(Child, State); > > do_restart(_, normal, Child, State) -> > > NState = state_del_child(Child, State), > > {ok, NState}; > > do_restart(_, shutdown, Child, State) -> > > NState = state_del_child(Child, State), > > {ok, NState}; > > do_restart(transient, Reason, Child, State) -> > > report_error(child_terminated, Reason, Child, State#state.name), > > restart(Child, State); > > do_restart(temporary, Reason, Child, State) -> > > report_error(child_terminated, Reason, Child, State#state.name), > > NState = state_del_child(Child, State), > > {ok, NState}. > > ... > > ... > > ... > > > > report_error(Error, Reason, Child, SupName) -> > > ErrorMsg = [{supervisor, SupName}, > > {errorContext, Error}, > > {reason, Reason}, > > {offender, extract_child(Child)}], > > error_logger:error_report(supervisor_report, ErrorMsg). > > > >If I want to process crash information (name/date/time/reason) when > >application > >processes crash is the convention to install a custom handler via > >error_logger:add_report_handler/[12]? > > > >My knee jerk reaction is that it would be awfully nice if the supervisor > >behaviour simply provided a callback for processing process crash info. The > >callback could even be spawn'd if risk of crashing the supervisor in the > >handler was a concern. > > > >Thanks for wading through the rambling--any comments/suggestions are much > >appreciated. > > > >-Rick From mccratch@REDACTED Fri Sep 30 07:55:53 2005 From: mccratch@REDACTED (Matthias Kretschmer) Date: Fri, 30 Sep 2005 07:55:53 +0200 Subject: Meta-Erlang (was RE: Erlang vs Java revisited) In-Reply-To: <200509300311.j8U3BPFW331059@atlas.otago.ac.nz> References: <200509300311.j8U3BPFW331059@atlas.otago.ac.nz> Message-ID: <6939d887cfd20f0d0c7282191c341bd2@gmx.net> 30.09.2005 um 05:11 wrote Richard A. O'Keefe: > I still remember someone from Xerox insisting fervently that > "A program is not a listing!" The Smalltalk and Interlisp-D > environments were based on the idea that a program is a database > and that it is a database which programs may populate and > manipulate. > I was just thinking of what kind of IDE you are talking about (I hope it was not too obvious from your posts). I just know one Smalltalk IDE (that provided by Squeak). I think the approach of having a view of the program as some sort of database like it is done there is very nice. What would be nice additionally, would be a virtual version of EUMEL with Erlang instead of ELAN to develop applications IMHO. I always liked about EUMEL the hierarchical task system and the way the system is organized. Being able to extend a task at any point in the tree by reusing the code of the parent, would be nice for maintainance later or if one wants to extend features. If then you get some view of the program/modules like in Squeak ... just my two cents about programming environments ... -- Matthias From rrerlang@REDACTED Fri Sep 30 10:43:17 2005 From: rrerlang@REDACTED (Robert Raschke) Date: Fri, 30 Sep 2005 09:43:17 +0100 Subject: OT Re: Meta-Erlang In-Reply-To: <6939d887cfd20f0d0c7282191c341bd2@gmx.net> Message-ID: <82d76bdc60022e12eedfce0c2cd70ef0@tombob.com> Matthias Kretschmer wrote on Fri 30 Sep around 07:20 : > What would be nice additionally, would be a virtual version of EUMEL > with Erlang instead of ELAN to develop applications IMHO. I always > liked about EUMEL the hierarchical task system and the way the system > is organized. Being able to extend a task at any point in the tree by > reusing the code of the parent, would be nice for maintainance later or > if one wants to extend features. If then you get some view of the > program/modules like in Squeak ... ELAN? Now that takes me back to my student days. I could never get my head around identifiers that may contain spaces. Does it still allow that? With respect to programs as data, I've not really found anything that can best Lisp and co. Although Forth (using meta interpreters) is very interesting, but its philosophy is ever so slightly too stark for my taste. The DB aspect of Smalltalk is great for experimental coding, but I tend to get lost along the way, making it impossible to figure out what my architecture looks like (or, for that matter, is meant to look like). I am a great believer in literate programming approaches. But that approach, at least through the tools currently available, depends on the fact that a program is a listing of some sort. Robby From tobbe@REDACTED Thu Sep 29 22:31:35 2005 From: tobbe@REDACTED (tobbe) Date: Thu, 29 Sep 2005 22:31:35 +0200 Subject: Jungerl fails to compile - UCS References: Message-ID: <20050929203135.A961A4124E@bang.trapexit.org> Do you have a ucs/ebin directory ? If not, then create one and try again. If you are not interested in the ucs stuff then you could, as a workaround, remove that directory. --Tobbe _________________________________________________________ Sent using Mail2Forum (http://m2f.sourceforge.net) From camster@REDACTED Fri Sep 30 11:58:24 2005 From: camster@REDACTED (Richard Cameron) Date: Fri, 30 Sep 2005 10:58:24 +0100 Subject: Mac OSX and kqueue In-Reply-To: <6A04C0B6-8891-47CC-AB2E-5B3311BEA790@gmail.com> References: <6A04C0B6-8891-47CC-AB2E-5B3311BEA790@gmail.com> Message-ID: On 29 Sep 2005, at 15:46, Joel Reymont wrote: > I noticed some code related to kqueue in erts/emulator/sys/unix/ > sys.c. Is it possible to configure Erlang to use kqueue on Mac OSX? kqueue was certainly broken in OSX 10.3 and produced some quite spectacular kernel panics. Apple had a bug open in radar about this and they claimed they were going to fix it in 10.4, however 10.4.0 still shipped with a broken implementation. I'd love to hear if anyone has had any experience getting it to work in 10.4.1 and 10.4.2. I've heard rumours that it's been fixed, but I've personally given up hope. Richard. From vlad_dumitrescu@REDACTED Fri Sep 30 12:11:33 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 30 Sep 2005 12:11:33 +0200 Subject: Meta-Erlang References: <200509300311.j8U3BPFW331059@atlas.otago.ac.nz> Message-ID: ----- Original Message ----- From: "Richard A. O'Keefe" > I wrote: > > Programs are data. My big complaint about older IDEs is that > > they encouraged people to think of programs as exclusively something > > human-written, when our best hope of reliable software is to write as little of > > it as possible. > > "Vlad Dumitrescu XX (LN/EAB)" > challenged: > Is it the IDEs that did that? Oh, "challenged" is maybe a too strong word :-) > I still remember someone from Xerox insisting fervently that > "A program is not a listing!" The Smalltalk and Interlisp-D > environments were based on the idea that a program is a database > and that it is a database which programs may populate and > manipulate. Okay, now I understand what you refer to. I think there are pros and cons to both approaches. Meta-programming feels like trying to capitalize on the advantages of both, so it works to integrate it in some regular language I say, why not? best regards, Vlad From vlad@REDACTED Fri Sep 30 14:04:46 2005 From: vlad@REDACTED (Vlad Balin) Date: Fri, 30 Sep 2005 16:04:46 +0400 Subject: OT Re: Meta-Erlang In-Reply-To: <82d76bdc60022e12eedfce0c2cd70ef0@tombob.com> Message-ID: > With respect to programs as data, I've not really found anything that > can best Lisp and co. Yes, it's due to the fact that Lisp and co don't have a syntax. Syntax tree structure defined directly with "lots of irritating silly parenthesis". That's why writing language extensions (macros) are so simple. However, there's quite interesting work done in this area for languages with syntax. Camlp4 is pre-processor for OCaml language (ML family) allowing you to easily extend language grammar. And this approach looks very, very nice. http://pauillac.inria.fr/caml/camlp4/ Example: pascal-like repeat-until loop. open Pcaml;; EXTEND expr: LEVEL "expr1" [[ "repeat"; e1 = expr; "until"; e2 = expr -> <:expr< do { $e1$; while not $e2$ do { $e1$; } } >> ]]; END;; It would be interesting to see something similar in dynamic language with syntax like Erlang. >Although Forth (using meta interpreters) is > very interesting, but its philosophy is ever so slightly too stark for > my taste. The DB aspect of Smalltalk is great for experimental > coding, but I tend to get lost along the way, making it impossible to > figure out what my architecture looks like (or, for that matter, is > meant to look like). Yes. > I am a great believer in literate programming approaches. But that > approach, at least through the tools currently available, depends on > the fact that a program is a listing of some sort. Agree. :) From serge@REDACTED Fri Sep 30 14:05:05 2005 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 30 Sep 2005 08:05:05 -0400 Subject: recording process crash (in supervisor?) In-Reply-To: <20050930044116.GA19115@vailsys.com> References: <20050929053145.GB2337@vailsys.com> <433BD71B.80604@hq.idt.net> <20050930044116.GA19115@vailsys.com> Message-ID: <433D29F1.3000501@hq.idt.net> Rick Pettit wrote: [...] > Having to dig up the (undocumented?) format of the crash_report message (and > count on it not changing across releases) troubles me (duh). Surely what I > did must be "wrong", no? You can look at proc_lib:format(Report) for formatting crash reports, and extracting appropriate details. > Also, it now seems clear that I need _two_ processes in addition to the > supervisor to do a job that a simple supervisor callback could do just as > well--one child/worker process (to invoke gen_event:add_sup_handler/3) and > the actual gen_event handler process to receive and process error_logger > messages. Not quite. In reality you either don't need any additional processes, or need one - a supervised guard of the event handler. The primary difference between gen_event and gen_server is that gen_server runs in the context of a dedicated process of its own, whereas gen_event runs in the context of an EventManager to which the event handler is being added. If (and only if) fault tolerance is needed, a separate process can be used to trap event handler's crash messages. This is accomplished by using gen_event:add_sup_handler/3, which will instruct the EventManager to send a message to that process indicating that the event handler was removed, but other than that this process will do nothing. If you needed fault tolerance of the event handler, you could add this worker process to a supervisor, where this process would simply implement a loop: init() -> gen_event:add_sup_handler(error_logger, ?MODULE, []), loop(). loop() -> receive {gen_event_EXIT, ?MODULE, Reason} -> exit(Reason); Other -> loop(Handler) end. > Am I doing something unconventional here (i.e. processing/recording process > crash info)? It seems like there should be an easier way. It also seems as > though my error_logger handler, which only really cares about crash_report > information, is going to have to "ignore" a whole lot of other messages which > a supervisor (callback/handler) wouldn't even see--this seems needlessly > inefficient. If you examine the SASL's and KERNEL's error reporting, this is how its done there (ignore irrelevant messages). I am not in position to question the efficiency of this approach, as this hasn't been an issue in the applications I've been building. One thought though is that an OTP process crash is an infrequent event (compared to all normal processing). Therefore the question about efficiency of processing crash info might be irrelevant to the efficiency of the system as a whole, given its rare likelihood. Regards, Serge From craigmcd@REDACTED Fri Sep 30 15:00:57 2005 From: craigmcd@REDACTED (Craig McDaniel) Date: Fri, 30 Sep 2005 09:00:57 -0400 Subject: Jungerl fails to compile - UCS In-Reply-To: <20050929203135.A961A4124E@bang.trapexit.org> (tobbe@tornkvist.org's message of "Thu, 29 Sep 2005 22:31:35 +0200") References: <20050929203135.A961A4124E@bang.trapexit.org> Message-ID: <87ek76ogl2.fsf@neko.dyndns.org> On Thu Sep 29 2005 at 16:31, "tobbe" wrote: > Do you have a ucs/ebin directory ? > If not, then create one and try again. > Thanks. That did the trick. Both the ucs and eldap modules don't create an ebin directory when created from CVS. -- Craig McDaniel From jahakala@REDACTED Fri Sep 30 15:22:09 2005 From: jahakala@REDACTED (Jani Hakala) Date: Fri, 30 Sep 2005 16:22:09 +0300 Subject: Max number of open file descriptors is too low In-Reply-To: <78E8D6A9-425C-4192-923F-11C15ED7EB69@gmail.com> (Joel Reymont's message of "Tue, 27 Sep 2005 19:00:59 +0200") References: <965C7B8D-0B24-427A-8E42-D9E6330A0362@gmail.com> <433951D9.2070300@ericsson.com> <871x3amrm8.fsf@pingviini.kortex.jyu.fi> <78E8D6A9-425C-4192-923F-11C15ED7EB69@gmail.com> Message-ID: <87br2ak7we.fsf@pingviini.kortex.jyu.fi> Joel Reymont writes: > Right, but it still does not resolve the same issue under Windows ;-). > That might require some changes. Perhaps something like in ACE library (Proactor-framework) where asynchronous calls like WSArecv and I/O completion ports are used. I have no idea how many sockets could be used that way, some estimations seem to be available: http://tangentsoft.net/wskfaq/advanced.html#maxsockets Jani Hakala From craigmcd@REDACTED Fri Sep 30 16:50:37 2005 From: craigmcd@REDACTED (Craig McDaniel) Date: Fri, 30 Sep 2005 10:50:37 -0400 Subject: Jungerl fails to compile - UCS In-Reply-To: <87ek76ogl2.fsf@neko.dyndns.org> (Craig McDaniel's message of "Fri, 30 Sep 2005 09:00:57 -0400") References: <20050929203135.A961A4124E@bang.trapexit.org> <87ek76ogl2.fsf@neko.dyndns.org> Message-ID: <877jcyobia.fsf@neko.dyndns.org> In case anyone wants to fix this in CVS, these are the changes I made to get the entire thing to compile. 1. Add jungerl/lib/ucs/ebin directory. 2. Add jungerl/lib/eldap/ebin directory. 3. Fix jungerl/lib/posix_drv/c_src/Makefile (couldn't find config.h): 3c3 < CFLAGS += -I$(ERL_C_INCLUDE_DIR) -I. --- > CFLAGS += -I$(ERL_C_INCLUDE_DIR) -I../../../support -I. 4. Fix jungerl/lib/ssh/c_src/Makefile (same issue): 10c10 < override CFLAGS += -I$(ERL_C_INCLUDE_DIR) --- > override CFLAGS += -I$(ERL_C_INCLUDE_DIR) -I../../../support 5. Fix jungerl/lib/tuntap/c_src/Makefile (same issue): 3c3 < CFLAGS += -I $(ERL_C_INCLUDE_DIR) --- > CFLAGS += -I$(ERL_C_INCLUDE_DIR) -I../../../support -- Craig McDaniel From rpettit@REDACTED Fri Sep 30 19:19:08 2005 From: rpettit@REDACTED (Rick Pettit) Date: Fri, 30 Sep 2005 12:19:08 -0500 Subject: recording process crash (in supervisor?) In-Reply-To: <433D29F1.3000501@hq.idt.net> References: <20050929053145.GB2337@vailsys.com> <433BD71B.80604@hq.idt.net> <20050930044116.GA19115@vailsys.com> <433D29F1.3000501@hq.idt.net> Message-ID: <20050930171908.GD545@vailsys.com> On Fri, Sep 30, 2005 at 08:05:05AM -0400, Serge Aleynikov wrote: > Rick Pettit wrote: > [...] > >Having to dig up the (undocumented?) format of the crash_report message > >(and > >count on it not changing across releases) troubles me (duh). Surely what I > >did must be "wrong", no? > > You can look at proc_lib:format(Report) for formatting crash reports, > and extracting appropriate details. This is the documentation I was looking for--thank you. > >Also, it now seems clear that I need _two_ processes in addition to the > >supervisor to do a job that a simple supervisor callback could do just as > >well--one child/worker process (to invoke gen_event:add_sup_handler/3) and > >the actual gen_event handler process to receive and process error_logger > >messages. > > Not quite. In reality you either don't need any additional processes, > or need one - a supervised guard of the event handler. The primary > difference between gen_event and gen_server is that gen_server runs in > the context of a dedicated process of its own, whereas gen_event runs in > the context of an EventManager to which the event handler is being > added. Duh, of course. Silly me. > If (and only if) fault tolerance is needed, a separate process > can be used to trap event handler's crash messages. This is > accomplished by using gen_event:add_sup_handler/3, which will instruct > the EventManager to send a message to that process indicating that the > event handler was removed, but other than that this process will do > nothing. If you needed fault tolerance of the event handler, you could > add this worker process to a supervisor, where this process would simply > implement a loop: > > init() -> > gen_event:add_sup_handler(error_logger, ?MODULE, []), > loop(). > > loop() -> > receive > {gen_event_EXIT, ?MODULE, Reason} -> > exit(Reason); > Other -> > loop(Handler) > end. Perfect--I think I finally see the light. > >Am I doing something unconventional here (i.e. processing/recording process > >crash info)? It seems like there should be an easier way. It also seems as > >though my error_logger handler, which only really cares about crash_report > >information, is going to have to "ignore" a whole lot of other messages > >which > >a supervisor (callback/handler) wouldn't even see--this seems needlessly > >inefficient. > > If you examine the SASL's and KERNEL's error reporting, this is how its > done there (ignore irrelevant messages). I am not in position to > question the efficiency of this approach, as this hasn't been an issue > in the applications I've been building. Nor for me (IIRC the rule of thumb is to 1) make it work, 2) make it beautiful, 3) make it fast). I need to get past (1) first :-) > One thought though is that an OTP process crash is an infrequent event > (compared to all normal processing). Therefore the question about > efficiency of processing crash info might be irrelevant to the > efficiency of the system as a whole, given its rare likelihood. Agreed. You have been very helpful, thanks again. -Rick From kruegger@REDACTED Fri Sep 30 20:14:55 2005 From: kruegger@REDACTED (Stephen Han) Date: Fri, 30 Sep 2005 11:14:55 -0700 Subject: run_erl privilege Message-ID: <86f1f5350509301114g5c5257dal7b465e826f763fb0@mail.gmail.com> Hi. run_erl only work with root priviliege? Is it possible to run run_erl within normal user account other than roo? regards, -------------- next part -------------- An HTML attachment was scrubbed... URL: From vances@REDACTED Fri Sep 30 21:10:45 2005 From: vances@REDACTED (Vance Shipley) Date: Fri, 30 Sep 2005 15:10:45 -0400 Subject: run_erl privilege In-Reply-To: <86f1f5350509301114g5c5257dal7b465e826f763fb0@mail.gmail.com> References: <86f1f5350509301114g5c5257dal7b465e826f763fb0@mail.gmail.com> Message-ID: <20050930191045.GD18766@feeble.motivity.ca> On Fri, Sep 30, 2005 at 11:14:55AM -0700, Stephen Han wrote: } } run_erl only work with root priviliege? } Is it possible to run run_erl within normal user account other than roo? Not true. Follow the "Installing an embedded systems" documentation. Run as otpuser. -Vance From massimo.cesaro@REDACTED Fri Sep 30 17:18:24 2005 From: massimo.cesaro@REDACTED (Massimo Cesaro) Date: 30 Sep 2005 17:18:24 +0200 Subject: BEA offers real-time version of WebLogic server In-Reply-To: References: <99D8D70E-A990-43D0-8FA7-89CD2DC1A297@gmail.com> <20050928163734.GA25942@vailsys.com> Message-ID: <1128093505.1412.141.camel@xam> On Wed, 2005-09-28 at 19:13, Joel Reymont wrote: > > 2) I think Erlang is most suited for applications where high > computational performance is not of essense. What's the right term, > apps that are not CPU-bound? I wouldn't do a trading system in > Erlang, for example. > Can't tell for trading systems, but we do DSP stuff (i.e. codec implementation, audio conferencing, media streming, etc) in Erlang with "near C" performance. The productivity gain of our programmers, and the dramatically reduced time to pass from prototype to production code in Erlang is unmatched by any other development environment we used in the last 10 years of TLC development. And this advantages, more than compensate the supposed lack of performance compared with native C code; sometimes we found that rethinking to algorithms with the Erlang point of view actually outperformed plain vanilla C/C++ code. Massimo